feat(client): support sharing api
This commit is contained in:
parent
422232a34f
commit
86474e044f
2 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,7 @@ import {
|
|||
UploadStatusResp,
|
||||
ListResp,
|
||||
ListUploadingsResp,
|
||||
ListSharingsResp,
|
||||
} from "./";
|
||||
|
||||
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`,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -54,6 +54,10 @@ export interface ListUploadingsResp {
|
|||
uploadInfos: UploadInfo[];
|
||||
}
|
||||
|
||||
export interface ListSharingsResp {
|
||||
sharingDirs: string[];
|
||||
}
|
||||
|
||||
export interface IUsersClient {
|
||||
login: (user: string, pwd: string, captchaId: string, captchaInput:string) => Promise<Response>;
|
||||
logout: () => Promise<Response>;
|
||||
|
@ -86,6 +90,10 @@ export interface IFilesClient {
|
|||
listHome: () => Promise<Response<ListResp>>;
|
||||
listUploadings: () => Promise<Response<ListUploadingsResp>>;
|
||||
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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue