curtain-web-api 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,8 +19,8 @@ export declare class CurtainWebAPI {
19
19
  ORCIDLogin(authorizationCode: string, redirectURI: string): Promise<User>;
20
20
  checkIfRefreshTokenExpired(): boolean;
21
21
  deleteCurtainLink(curtainLinkID: string): Promise<import("axios").AxiosResponse<any, any>>;
22
- putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string): Promise<import("axios").AxiosResponse<any, any>>;
23
- postSettings(id: string, token: string): Promise<import("axios").AxiosResponse<any, any>>;
22
+ putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
23
+ postSettings(id: string, token: string, onDownloadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
24
24
  getPrideData(accession: string): Promise<import("axios").AxiosResponse<any, any>>;
25
25
  generateTemporarySession(linkId: string, lifetime: number): Promise<import("axios").AxiosResponse<any, any>>;
26
26
  updateSession(sessionData: any, linkId: string): Promise<import("axios").AxiosResponse<any, any>>;
@@ -35,6 +35,7 @@ export declare class CurtainWebAPI {
35
35
  getDataFilterList(title?: string, searchTerm?: string, category?: string, limit?: number): Promise<import("axios").AxiosResponse<any, any>>;
36
36
  deleteDataFilterList(id: number): Promise<import("axios").AxiosResponse<any, any>>;
37
37
  downloadStats(): Promise<import("axios").AxiosResponse<any, any>>;
38
- postInteractomeAtlasProxy(data: any): Promise<import("axios").AxiosResponse<any, any>>;
38
+ postInteractomeAtlasProxy(genes: string[], filterParameter: string): Promise<import("axios").AxiosResponse<any, any>>;
39
39
  postPrimitiveStatsTest(data: any, type?: string): Promise<import("axios").AxiosResponse<any, any>>;
40
+ getDataAllListCategory(): Promise<import("axios").AxiosResponse<any, any>>;
40
41
  }
@@ -204,7 +204,7 @@ class CurtainWebAPI {
204
204
  return response;
205
205
  });
206
206
  }
207
- putSettings(settings, enable = true, description = "", sessionType = "TP") {
207
+ putSettings(settings, enable = true, description = "", sessionType = "TP", onUploadProgress = undefined) {
208
208
  let form = new FormData();
209
209
  form.append("file", new Blob([JSON.stringify(settings, exports.replacer)], { type: 'text/json' }), "curtain-settings.json");
210
210
  if (enable) {
@@ -218,13 +218,23 @@ class CurtainWebAPI {
218
218
  let headers = new axios_1.AxiosHeaders();
219
219
  headers["Accept"] = "application/json";
220
220
  headers["Content-Type"] = "multipart/form-data";
221
+ if (onUploadProgress !== undefined) {
222
+ return this.axiosInstance.post(this.baseURL + "curtain/", form, { headers: headers, responseType: "json", onUploadProgress: onUploadProgress }).then((response) => {
223
+ return response;
224
+ });
225
+ }
221
226
  return this.axiosInstance.post(this.baseURL + "curtain/", form, { headers: headers, responseType: "json" }).then((response) => {
222
227
  return response;
223
228
  });
224
229
  }
225
- postSettings(id, token) {
230
+ postSettings(id, token, onDownloadProgress = undefined) {
226
231
  let headers = new axios_1.AxiosHeaders();
227
232
  headers["Accept"] = "application/json";
233
+ if (onDownloadProgress !== undefined) {
234
+ return this.axiosInstance.get(this.baseURL + "curtain/" + id + "/download/token=" + token + "/", { responseType: "json", onDownloadProgress: onDownloadProgress }).then((response) => {
235
+ return response;
236
+ });
237
+ }
228
238
  return this.axiosInstance.get(this.baseURL + "curtain/" + id + "/download/token=" + token + "/", { responseType: "json" }).then((response) => {
229
239
  return response;
230
240
  });
@@ -359,11 +369,21 @@ class CurtainWebAPI {
359
369
  return response;
360
370
  });
361
371
  }
362
- postInteractomeAtlasProxy(data) {
372
+ postInteractomeAtlasProxy(genes, filterParameter) {
373
+ let params = new URLSearchParams();
374
+ params.append("query_interactors", "query");
375
+ params.append("query_id_array", genes.join("%2C"));
376
+ params.append("search_term_parameter", genes.join("%2C"));
377
+ params.append("filter_parameter", filterParameter);
378
+ let searchTermArray = [];
379
+ for (const g of genes) {
380
+ searchTermArray.push("search_term_array%5B%5D=" + g);
381
+ }
382
+ const data = "http://www.interactome-atlas.org/search_results_interactions?" + params.toString() + "&" + searchTermArray.join("&");
363
383
  let headers = new axios_1.AxiosHeaders();
364
384
  headers["Accept"] = "application/json";
365
385
  headers["Content-Type"] = "application/json";
366
- return axios_1.default.post(this.baseURL + "interactome-atlas-proxy/", data, { headers: headers, responseType: "json" }).then((response) => {
386
+ return axios_1.default.post(this.baseURL + "interactome-atlas-proxy/", { link: data }, { headers: headers, responseType: "json" }).then((response) => {
367
387
  return response;
368
388
  });
369
389
  }
@@ -375,5 +395,11 @@ class CurtainWebAPI {
375
395
  return response;
376
396
  });
377
397
  }
398
+ getDataAllListCategory() {
399
+ let headers = new axios_1.AxiosHeaders();
400
+ headers["Accept"] = "application/json";
401
+ headers["Content-Type"] = "application/json";
402
+ return axios_1.default.get(this.baseURL + "/data_filter_list/get_all_category/", { headers: headers, responseType: "json" }).then((response) => { return response; });
403
+ }
378
404
  }
379
405
  exports.CurtainWebAPI = CurtainWebAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curtain-web-api",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -192,7 +192,7 @@ export class CurtainWebAPI {
192
192
  }
193
193
 
194
194
 
195
- putSettings(settings: any, enable: boolean = true, description: string = "", sessionType: string = "TP") {
195
+ putSettings(settings: any, enable: boolean = true, description: string = "", sessionType: string = "TP", onUploadProgress: any = undefined) {
196
196
  let form: FormData = new FormData();
197
197
  form.append("file", new Blob([JSON.stringify(settings, replacer)], {type: 'text/json'}), "curtain-settings.json")
198
198
  if (enable) {
@@ -205,14 +205,24 @@ export class CurtainWebAPI {
205
205
  let headers = new AxiosHeaders();
206
206
  headers["Accept"] = "application/json";
207
207
  headers["Content-Type"] = "multipart/form-data";
208
+ if (onUploadProgress !== undefined) {
209
+ return this.axiosInstance.post(this.baseURL + "curtain/", form, {headers: headers, responseType:"json", onUploadProgress: onUploadProgress}).then((response) => {
210
+ return response;
211
+ });
212
+ }
208
213
  return this.axiosInstance.post(this.baseURL + "curtain/", form, {headers: headers, responseType:"json"}).then((response) => {
209
214
  return response;
210
215
  });
211
216
  }
212
217
 
213
- postSettings(id: string, token: string) {
218
+ postSettings(id: string, token: string, onDownloadProgress: any = undefined) {
214
219
  let headers = new AxiosHeaders();
215
220
  headers["Accept"] = "application/json";
221
+ if (onDownloadProgress !== undefined) {
222
+ return this.axiosInstance.get(this.baseURL + "curtain/" + id + "/download/token=" + token + "/", {responseType:"json", onDownloadProgress: onDownloadProgress}).then((response) => {
223
+ return response;
224
+ })
225
+ }
216
226
  return this.axiosInstance.get(this.baseURL + "curtain/" + id + "/download/token=" + token + "/", {responseType:"json"}).then((response) => {
217
227
  return response;
218
228
  })
@@ -367,11 +377,21 @@ export class CurtainWebAPI {
367
377
  });
368
378
  }
369
379
 
370
- postInteractomeAtlasProxy(data: any) {
380
+ postInteractomeAtlasProxy(genes: string[], filterParameter: string) {
381
+ let params = new URLSearchParams();
382
+ params.append("query_interactors", "query");
383
+ params.append("query_id_array", genes.join("%2C"));
384
+ params.append("search_term_parameter", genes.join("%2C"));
385
+ params.append("filter_parameter", filterParameter);
386
+ let searchTermArray: string[] = []
387
+ for (const g of genes) {
388
+ searchTermArray.push("search_term_array%5B%5D="+g)
389
+ }
390
+ const data = "http://www.interactome-atlas.org/search_results_interactions?" + params.toString() + "&" + searchTermArray.join("&")
371
391
  let headers = new AxiosHeaders();
372
392
  headers["Accept"] = "application/json";
373
393
  headers["Content-Type"] = "application/json";
374
- return axios.post(this.baseURL + "interactome-atlas-proxy/", data, {headers: headers, responseType: "json"}).then((response) => {
394
+ return axios.post(this.baseURL + "interactome-atlas-proxy/", {link: data}, {headers: headers, responseType: "json"}).then((response) => {
375
395
  return response;
376
396
  });
377
397
  }
@@ -384,5 +404,12 @@ export class CurtainWebAPI {
384
404
  return response;
385
405
  });
386
406
  }
407
+
408
+ getDataAllListCategory() {
409
+ let headers = new AxiosHeaders();
410
+ headers["Accept"] = "application/json";
411
+ headers["Content-Type"] = "application/json";
412
+ return axios.get(this.baseURL + "/data_filter_list/get_all_category/", {headers: headers, responseType: "json"}).then((response) => {return response;});
413
+ }
387
414
  }
388
415