Skip to content

Commit 7e9bf00

Browse files
committed
Update promise return type
1 parent d87f795 commit 7e9bf00

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/axios.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export interface MultinetAxiosInstance extends AxiosInstance {
5858
networkTables(workspace: string, network: string, type: TableType): AxiosPromise<Table[]>;
5959
createWorkspace(workspace: string): AxiosPromise<string>;
6060
deleteWorkspace(workspace: string): AxiosPromise<string>;
61+
forkWorkspace(workspace: string): AxiosPromise<Workspace>;
6162
renameWorkspace(workspace: string, name: string): AxiosPromise<Workspace>;
6263
uploadTable(workspace: string, table: string, options: TableUploadOptionsSpec, config?: AxiosRequestConfig): AxiosPromise<Array<{}>>;
6364
deleteTable(workspace: string, table: string): AxiosPromise<string>;
@@ -165,6 +166,10 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios
165166
});
166167
};
167168

169+
Proto.forkWorkspace = function(workspace: string): AxiosPromise<Workspace> {
170+
return this.post(`workspaces/${workspace}/fork/`);
171+
};
172+
168173
Proto.uploadTable = async function(workspace: string, table: string, options: TableUploadOptionsSpec): Promise<AxiosResponse<Array<{}>>> {
169174
const { data, edgeTable, columnTypes, fileType, delimiter, quoteChar } = options;
170175
const s3ffClient = new S3FileFieldClient({

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ class MultinetAPI {
224224
return (await this.axios.deleteWorkspace(workspace)).data;
225225
}
226226

227+
public async forkWorkspace(workspace: string): Promise<Workspace> {
228+
return (await this.axios.forkWorkspace(workspace)).data;
229+
}
230+
227231
public async renameWorkspace(workspace: string, name: string): Promise<Workspace> {
228232
return (await this.axios.renameWorkspace(workspace, name)).data;
229233
}

0 commit comments

Comments
 (0)