Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@master
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node environment
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '10.x'
node-version: lts/*
cache: 'yarn'

- name: Restore node_modules cache
uses: actions/cache@v1
id: multinetjs-cache
with:
path: /home/runner/work/multinetjs/multinetjs/node_modules
key: ${{ runner.os }}-${{ hashFiles('/home/runner/work/multinetjs/multinetjs/yarn.lock') }}-multinetjs-cache

- name: Install yarn packages
if: steps.multinetjs-cache.outputs.cache-hit != 'true'
run: yarn install
run: yarn install --immutable

- name: Run linting test
run: yarn lint
Expand Down
5 changes: 5 additions & 0 deletions src/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface MultinetAxiosInstance extends AxiosInstance {
networkTables(workspace: string, network: string, type: TableType): AxiosPromise<Table[]>;
createWorkspace(workspace: string): AxiosPromise<string>;
deleteWorkspace(workspace: string): AxiosPromise<string>;
forkWorkspace(workspace: string): AxiosPromise<Workspace>;
renameWorkspace(workspace: string, name: string): AxiosPromise<Workspace>;
uploadTable(workspace: string, table: string, options: TableUploadOptionsSpec, config?: AxiosRequestConfig): AxiosPromise<Array<{}>>;
deleteTable(workspace: string, table: string): AxiosPromise<string>;
Expand Down Expand Up @@ -165,6 +166,10 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios
});
};

Proto.forkWorkspace = function(workspace: string): AxiosPromise<Workspace> {
return this.post(`workspaces/${workspace}/fork/`);
};

Proto.uploadTable = async function(workspace: string, table: string, options: TableUploadOptionsSpec): Promise<AxiosResponse<Array<{}>>> {
const { data, edgeTable, columnTypes, fileType, delimiter, quoteChar } = options;
const s3ffClient = new S3FileFieldClient({
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ class MultinetAPI {
return (await this.axios.deleteWorkspace(workspace)).data;
}

public async forkWorkspace(workspace: string): Promise<Workspace> {
return (await this.axios.forkWorkspace(workspace)).data;
}

public async renameWorkspace(workspace: string, name: string): Promise<Workspace> {
return (await this.axios.renameWorkspace(workspace, name)).data;
}
Expand Down