This commit is contained in:
250
gen/auth.ts
250
gen/auth.ts
@@ -1,250 +0,0 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-ts_proto v2.11.6
|
|
||||||
// protoc v7.34.1
|
|
||||||
// source: auth.proto
|
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
||||||
import { Observable } from "rxjs";
|
|
||||||
import { Status } from "./google/rpc/status";
|
|
||||||
|
|
||||||
export const protobufPackage = "auth.v1";
|
|
||||||
|
|
||||||
export interface LoginRequest {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface LoginResponse {
|
|
||||||
accessToken: string;
|
|
||||||
status: string;
|
|
||||||
need2fa: boolean;
|
|
||||||
tempToken: string;
|
|
||||||
message: string;
|
|
||||||
errorCode: string;
|
|
||||||
error: Status | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RegisterRequest {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RegisterResponse {
|
|
||||||
userId: string;
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Verify2FaRequest {
|
|
||||||
tempToken: string;
|
|
||||||
totpCode: string;
|
|
||||||
telegramCode: string;
|
|
||||||
reserveCode: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Verify2FaResponse {
|
|
||||||
accessToken: string;
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
reserveCodes: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AuthenticatedAccessRequest {
|
|
||||||
accessToken: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetTwoFaStatusRequest {
|
|
||||||
accessToken: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetTwoFaStatusResponse {
|
|
||||||
totpEnabled: boolean;
|
|
||||||
telegramEnabled: boolean;
|
|
||||||
totpEnrollmentPending: boolean;
|
|
||||||
telegramEnrollmentPending: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StartTotpEnrollmentResponse {
|
|
||||||
secretBase32: string;
|
|
||||||
otpauthUri: string;
|
|
||||||
issuer: string;
|
|
||||||
accountLabel: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfirmTotpEnrollmentRequest {
|
|
||||||
accessToken: string;
|
|
||||||
totpCode: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfirmTotpEnrollmentResponse {
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
reserveCodes: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CancelTotpEnrollmentResponse {
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DisableTotpRequest {
|
|
||||||
accessToken: string;
|
|
||||||
password: string;
|
|
||||||
totpCode?: string | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DisableTotpResponse {
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StartTelegramEnrollmentResponse {
|
|
||||||
enrollmentToken: string;
|
|
||||||
deepLink: string;
|
|
||||||
botUsername: string;
|
|
||||||
expiresAtIso: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfirmTelegramEnrollmentRequest {
|
|
||||||
accessToken: string;
|
|
||||||
enrollmentToken: string;
|
|
||||||
otpCode: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfirmTelegramEnrollmentResponse {
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
reserveCodes: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DisableTelegramRequest {
|
|
||||||
accessToken: string;
|
|
||||||
password: string;
|
|
||||||
telegramOtpCode?: string | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DisableTelegramResponse {
|
|
||||||
status: string;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
||||||
|
|
||||||
export interface AuthServiceClient {
|
|
||||||
login(request: LoginRequest): Observable<LoginResponse>;
|
|
||||||
|
|
||||||
register(request: RegisterRequest): Observable<RegisterResponse>;
|
|
||||||
|
|
||||||
verify2Fa(request: Verify2FaRequest): Observable<Verify2FaResponse>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AuthServiceController {
|
|
||||||
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
|
|
||||||
|
|
||||||
register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
|
|
||||||
|
|
||||||
verify2Fa(request: Verify2FaRequest): Promise<Verify2FaResponse> | Observable<Verify2FaResponse> | Verify2FaResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function AuthServiceControllerMethods() {
|
|
||||||
return function (constructor: Function) {
|
|
||||||
const grpcMethods: string[] = ["login", "register", "verify2Fa"];
|
|
||||||
for (const method of grpcMethods) {
|
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
||||||
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
||||||
}
|
|
||||||
const grpcStreamMethods: string[] = [];
|
|
||||||
for (const method of grpcStreamMethods) {
|
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
||||||
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export const AUTH_SERVICE_NAME = "AuthService";
|
|
||||||
|
|
||||||
export interface TwoFaSrviceClient {
|
|
||||||
getTwoFaStatus(request: GetTwoFaStatusRequest): Observable<GetTwoFaStatusResponse>;
|
|
||||||
|
|
||||||
startTotpEnrollment(request: AuthenticatedAccessRequest): Observable<StartTotpEnrollmentResponse>;
|
|
||||||
|
|
||||||
confirmTotpErollment(request: ConfirmTotpEnrollmentRequest): Observable<ConfirmTotpEnrollmentResponse>;
|
|
||||||
|
|
||||||
cancelTotpEnrollment(request: AuthenticatedAccessRequest): Observable<CancelTotpEnrollmentResponse>;
|
|
||||||
|
|
||||||
disableTotp(request: DisableTotpRequest): Observable<DisableTotpResponse>;
|
|
||||||
|
|
||||||
startTelegramEnrollment(request: AuthenticatedAccessRequest): Observable<StartTelegramEnrollmentResponse>;
|
|
||||||
|
|
||||||
confirmTelegramEnrollment(request: ConfirmTelegramEnrollmentRequest): Observable<ConfirmTelegramEnrollmentResponse>;
|
|
||||||
|
|
||||||
disableTelegram(request: DisableTelegramRequest): Observable<DisableTelegramResponse>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TwoFaSrviceController {
|
|
||||||
getTwoFaStatus(
|
|
||||||
request: GetTwoFaStatusRequest,
|
|
||||||
): Promise<GetTwoFaStatusResponse> | Observable<GetTwoFaStatusResponse> | GetTwoFaStatusResponse;
|
|
||||||
|
|
||||||
startTotpEnrollment(
|
|
||||||
request: AuthenticatedAccessRequest,
|
|
||||||
): Promise<StartTotpEnrollmentResponse> | Observable<StartTotpEnrollmentResponse> | StartTotpEnrollmentResponse;
|
|
||||||
|
|
||||||
confirmTotpErollment(
|
|
||||||
request: ConfirmTotpEnrollmentRequest,
|
|
||||||
): Promise<ConfirmTotpEnrollmentResponse> | Observable<ConfirmTotpEnrollmentResponse> | ConfirmTotpEnrollmentResponse;
|
|
||||||
|
|
||||||
cancelTotpEnrollment(
|
|
||||||
request: AuthenticatedAccessRequest,
|
|
||||||
): Promise<CancelTotpEnrollmentResponse> | Observable<CancelTotpEnrollmentResponse> | CancelTotpEnrollmentResponse;
|
|
||||||
|
|
||||||
disableTotp(
|
|
||||||
request: DisableTotpRequest,
|
|
||||||
): Promise<DisableTotpResponse> | Observable<DisableTotpResponse> | DisableTotpResponse;
|
|
||||||
|
|
||||||
startTelegramEnrollment(
|
|
||||||
request: AuthenticatedAccessRequest,
|
|
||||||
):
|
|
||||||
| Promise<StartTelegramEnrollmentResponse>
|
|
||||||
| Observable<StartTelegramEnrollmentResponse>
|
|
||||||
| StartTelegramEnrollmentResponse;
|
|
||||||
|
|
||||||
confirmTelegramEnrollment(
|
|
||||||
request: ConfirmTelegramEnrollmentRequest,
|
|
||||||
):
|
|
||||||
| Promise<ConfirmTelegramEnrollmentResponse>
|
|
||||||
| Observable<ConfirmTelegramEnrollmentResponse>
|
|
||||||
| ConfirmTelegramEnrollmentResponse;
|
|
||||||
|
|
||||||
disableTelegram(
|
|
||||||
request: DisableTelegramRequest,
|
|
||||||
): Promise<DisableTelegramResponse> | Observable<DisableTelegramResponse> | DisableTelegramResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function TwoFaSrviceControllerMethods() {
|
|
||||||
return function (constructor: Function) {
|
|
||||||
const grpcMethods: string[] = [
|
|
||||||
"getTwoFaStatus",
|
|
||||||
"startTotpEnrollment",
|
|
||||||
"confirmTotpErollment",
|
|
||||||
"cancelTotpEnrollment",
|
|
||||||
"disableTotp",
|
|
||||||
"startTelegramEnrollment",
|
|
||||||
"confirmTelegramEnrollment",
|
|
||||||
"disableTelegram",
|
|
||||||
];
|
|
||||||
for (const method of grpcMethods) {
|
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
||||||
GrpcMethod("TwoFaSrvice", method)(constructor.prototype[method], method, descriptor);
|
|
||||||
}
|
|
||||||
const grpcStreamMethods: string[] = [];
|
|
||||||
for (const method of grpcStreamMethods) {
|
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
||||||
GrpcStreamMethod("TwoFaSrvice", method)(constructor.prototype[method], method, descriptor);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export const TWO_FA_SRVICE_SERVICE_NAME = "TwoFaSrvice";
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-ts_proto v2.11.6
|
|
||||||
// protoc v7.34.1
|
|
||||||
// source: google/protobuf/any.proto
|
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
export const protobufPackage = "google.protobuf";
|
|
||||||
|
|
||||||
export interface Any {
|
|
||||||
typeUrl: string;
|
|
||||||
value: Uint8Array;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-ts_proto v2.11.6
|
|
||||||
// protoc v7.34.1
|
|
||||||
// source: google/rpc/status.proto
|
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
import { Any } from "../protobuf/any";
|
|
||||||
|
|
||||||
export const protobufPackage = "google.rpc";
|
|
||||||
|
|
||||||
export interface Status {
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
details: Any[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export const GOOGLE_RPC_PACKAGE_NAME = "google.rpc";
|
|
||||||
@@ -9,7 +9,6 @@ service AuthService {
|
|||||||
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
||||||
rpc Logout (LogoutRequest) returns (LogoutResponse);
|
rpc Logout (LogoutRequest) returns (LogoutResponse);
|
||||||
rpc UnlockPin (UnlockPinRequest) returns (UnlockPinResponse);
|
rpc UnlockPin (UnlockPinRequest) returns (UnlockPinResponse);
|
||||||
rpc Register (RegisterRequest) returns (RegisterResponse);
|
|
||||||
rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse);
|
rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,16 +67,6 @@ message UnlockPinResponse {
|
|||||||
string message = 2;
|
string message = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RegisterRequest {
|
|
||||||
string username = 1;
|
|
||||||
string password = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RegisterResponse {
|
|
||||||
string user_id = 1;
|
|
||||||
string status = 2;
|
|
||||||
string message = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Verify2FaRequest {
|
message Verify2FaRequest {
|
||||||
string temp_token = 1;
|
string temp_token = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user