diff --git a/src/axios.ts b/src/axios.ts index 7e73417..e801881 100644 --- a/src/axios.ts +++ b/src/axios.ts @@ -70,7 +70,7 @@ export interface MultinetAxiosInstance extends AxiosInstance { createSession(workspace: string, itemId: number, type: 'network' | 'table', visApp: string, name: string): AxiosPromise; listSessions(workspace: string, type: 'network' | 'table'): AxiosPromise; deleteSession(workspace: string, sessionId: number, type: 'network' | 'table'): Promise; - updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: string): AxiosPromise; + updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise; renameSession(workspace: string, sessionId: number, type: 'network' | 'table', name: string): AxiosPromise; getSession(workspace: string, sessionId: number, type: 'network' | 'table'): AxiosPromise; } @@ -252,7 +252,7 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios return this.delete(`workspaces/${workspace}/sessions/${type}/${sessionId}/`); }; - Proto.updateSession = function(workspace: string, sessionId: number, type: 'network' | 'table', state: string): AxiosPromise { + Proto.updateSession = function(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise { return this.patch(`workspaces/${workspace}/sessions/${type}/${sessionId}/state/`, { state, }); diff --git a/src/index.ts b/src/index.ts index 16caecd..bab9f4a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -273,7 +273,7 @@ class MultinetAPI { return (await this.axios.deleteSession(workspace, sessionId, type)).data; } - public async updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: string): Promise { + public async updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: object): Promise { return (await this.axios.updateSession(workspace, sessionId, type, state)).data; }