Skip to content

Commit

Permalink
Merge pull request #91 from multinet-app/network-builder-check
Browse files Browse the repository at this point in the history
Add networkBuildRequests endpoint
  • Loading branch information
JackWilb authored Oct 3, 2023
2 parents 785caac + bf6eed9 commit b6857fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface MultinetAxiosInstance extends AxiosInstance {
renameSession(workspace: string, sessionId: number, type: 'network' | 'table', name: string): AxiosPromise<any>;
getSession(workspace: string, sessionId: number, type: 'network' | 'table'): AxiosPromise<any>;
generateAltText(verbosity: string, level: number, explain: string, data: object, title?: string): AxiosPromise<any>;
networkBuildRequests(workspace: string): AxiosPromise<number[]>;
}

export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxiosInstance {
Expand Down Expand Up @@ -287,5 +288,9 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios
return this.post(`alttxt/`, formData);
};

Proto.networkBuildRequests = function(workspace: string): AxiosPromise<number[]> {
return this.get(`workspaces/${workspace}/network_build_requests/`);
};

return axiosInstance as MultinetAxiosInstance;
}
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ class MultinetAPI {
public async generateAltText(verbosity: string, level: number, explain: string, data: object, title?: string): Promise<any> {
return (await this.axios.generateAltText(verbosity, level, explain, data, title)).data;
}

public async networkBuildRequests(workspace: string): Promise<number[]> {
return (await this.axios.networkBuildRequests(workspace)).data;
}

}

export function multinetApi(baseURL: string): MultinetAPI {
Expand Down

0 comments on commit b6857fc

Please sign in to comment.