feat(client): support sharing api

This commit is contained in:
hexxa 2021-08-18 15:05:14 +08:00 committed by Hexxa
parent 422232a34f
commit 86474e044f
2 changed files with 16 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import {
UploadStatusResp, UploadStatusResp,
ListResp, ListResp,
ListUploadingsResp, ListUploadingsResp,
ListSharingsResp,
} from "./"; } from "./";
const filePathQuery = "fp"; const filePathQuery = "fp";
@ -189,4 +190,11 @@ export class FilesClient extends BaseClient {
}, },
}); });
}; };
listSharings = (): Promise<Response<ListSharingsResp>> => {
return this.do({
method: "get",
url: `${this.url}/v1/fs/sharings`,
});
};
} }

View file

@ -54,6 +54,10 @@ export interface ListUploadingsResp {
uploadInfos: UploadInfo[]; uploadInfos: UploadInfo[];
} }
export interface ListSharingsResp {
sharingDirs: string[];
}
export interface IUsersClient { export interface IUsersClient {
login: (user: string, pwd: string, captchaId: string, captchaInput:string) => Promise<Response>; login: (user: string, pwd: string, captchaId: string, captchaInput:string) => Promise<Response>;
logout: () => Promise<Response>; logout: () => Promise<Response>;
@ -86,6 +90,10 @@ export interface IFilesClient {
listHome: () => Promise<Response<ListResp>>; listHome: () => Promise<Response<ListResp>>;
listUploadings: () => Promise<Response<ListUploadingsResp>>; listUploadings: () => Promise<Response<ListUploadingsResp>>;
deleteUploading: (filePath: string) => Promise<Response>; deleteUploading: (filePath: string) => Promise<Response>;
addSharing: (dirPath: string) => Promise<Response>;
deleteSharing: (dirPath: string) => Promise<Response>;
isSharing: (dirPath: string) => Promise<Response>;
listSharings: () => Promise<Response<ListSharingsResp>>;
} }
export interface Response<T = any> { export interface Response<T = any> {