Added totp/mail otp, split up dto and api into multiple files
This commit is contained in:
19
dto/responses/auth.ts
Normal file
19
dto/responses/auth.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { BaseResponse, SuccessResponse } from './base';
|
||||
|
||||
export type TfaRequiredResponse = SuccessResponse;
|
||||
export type RemoveTfaResponse = SuccessResponse;
|
||||
export type RequestEmailTfaResponse = SuccessResponse;
|
||||
export type TfaCompletedResponse = SuccessResponse;
|
||||
export type SignupResponse = SuccessResponse;
|
||||
export type RefreshResponse = LoginResponse;
|
||||
|
||||
export interface LoginResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
jwt: string;
|
||||
}
|
||||
|
||||
export interface RequestTotpTfaResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
qrCode: string;
|
||||
secret: string;
|
||||
}
|
||||
12
dto/responses/base.ts
Normal file
12
dto/responses/base.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface BaseResponse {
|
||||
statusCode: number;
|
||||
}
|
||||
|
||||
export interface SuccessResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
}
|
||||
|
||||
export interface ErrorResponse extends BaseResponse {
|
||||
statusCode: 400 | 401 | 403;
|
||||
message?: string;
|
||||
}
|
||||
30
dto/responses/fs.ts
Normal file
30
dto/responses/fs.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { BaseResponse, SuccessResponse } from './base';
|
||||
|
||||
export type UploadFileResponse = SuccessResponse;
|
||||
export type DeleteResponse = SuccessResponse;
|
||||
export type CreateFileResponse = CreateFolderResponse;
|
||||
|
||||
export interface GetRootResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
rootId: number;
|
||||
}
|
||||
|
||||
export interface GetNodeResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
id: number;
|
||||
name: string;
|
||||
isFile: boolean;
|
||||
parent: number | null;
|
||||
children?: number[];
|
||||
size?: number;
|
||||
}
|
||||
|
||||
export interface GetPathResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface CreateFolderResponse extends BaseResponse {
|
||||
statusCode: 200;
|
||||
id: number;
|
||||
}
|
||||
3
dto/responses/index.ts
Normal file
3
dto/responses/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './base';
|
||||
export * as Auth from './auth';
|
||||
export * as FS from './fs';
|
||||
Reference in New Issue
Block a user