curtain-web-api 1.0.54 → 1.0.56

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.
@@ -23,7 +23,7 @@ export declare class CurtainWebAPI {
23
23
  checkIfRefreshTokenExpired(): boolean;
24
24
  deleteCurtainLink(curtainLinkID: string): Promise<import("axios").AxiosResponse<any, any>>;
25
25
  putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, encryption?: CurtainEncryption, permanent?: boolean, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
26
- postSettings(id: string, token: string, onDownloadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
26
+ postSettings(id: string, token: string, onDownloadProgress?: any, url?: string | undefined): Promise<import("axios").AxiosResponse<any, any>>;
27
27
  getPrideData(accession: string): Promise<import("axios").AxiosResponse<any, any>>;
28
28
  generateTemporarySession(linkId: string, lifetime: number): Promise<import("axios").AxiosResponse<any, any>>;
29
29
  updateSession(sessionData: any, linkId: string, encryption?: CurtainEncryption): Promise<import("axios").AxiosResponse<any, any>>;
@@ -53,4 +53,5 @@ export declare class CurtainWebAPI {
53
53
  submitDataCite(data: any): Promise<import("axios").AxiosResponse<any, any>>;
54
54
  getDataCite(id: number): Promise<import("axios").AxiosResponse<any, any>>;
55
55
  getDataCiteTimeLimitedPermissionToken(suffix: string): Promise<import("axios").AxiosResponse<any, any>>;
56
+ getDataCiteProxyOrcidPublicRecord(orcid: string): Promise<import("axios").AxiosResponse<any, any>>;
56
57
  }
@@ -287,9 +287,21 @@ class CurtainWebAPI {
287
287
  }
288
288
  });
289
289
  }
290
- postSettings(id, token, onDownloadProgress = undefined) {
290
+ postSettings(id, token, onDownloadProgress = undefined, url = undefined) {
291
291
  let headers = new axios_1.AxiosHeaders();
292
292
  headers["Accept"] = "application/json";
293
+ if (url !== undefined) {
294
+ return this.axiosInstance.get(url, { responseType: "json" }).then((response) => {
295
+ if ("url" in response.data) {
296
+ return this.axiosInstance.get(response.data.url, { responseType: "json", onDownloadProgress: onDownloadProgress }).then((response) => {
297
+ return response;
298
+ });
299
+ }
300
+ else {
301
+ return response;
302
+ }
303
+ });
304
+ }
293
305
  if (onDownloadProgress !== undefined) {
294
306
  return this.axiosInstance.get(this.baseURL + "curtain/" + id + "/download/token=" + token + "/", { responseType: "json" }).then((response) => {
295
307
  if ("url" in response.data) {
@@ -570,5 +582,10 @@ class CurtainWebAPI {
570
582
  headers["Accept"] = "application/json";
571
583
  return this.axiosInstance.get(this.baseURL + "datacite/get_time_limited_permission_token/?suffix=" + suffix, { headers: headers, responseType: "json" });
572
584
  }
585
+ getDataCiteProxyOrcidPublicRecord(orcid) {
586
+ let headers = new axios_1.AxiosHeaders();
587
+ headers["Accept"] = "application/json";
588
+ return this.axiosInstance.get(this.baseURL + "datacite/proxy_orcid/?orcid=" + orcid, { headers: headers, responseType: "json" });
589
+ }
573
590
  }
574
591
  exports.CurtainWebAPI = CurtainWebAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curtain-web-api",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -269,9 +269,20 @@ export class CurtainWebAPI {
269
269
 
270
270
  }
271
271
 
272
- postSettings(id: string, token: string, onDownloadProgress: any = undefined) {
272
+ postSettings(id: string, token: string, onDownloadProgress: any = undefined, url: string|undefined = undefined) {
273
273
  let headers = new AxiosHeaders();
274
274
  headers["Accept"] = "application/json";
275
+ if (url !== undefined) {
276
+ return this.axiosInstance.get(url, {responseType: "json"}).then((response) => {
277
+ if ("url" in response.data) {
278
+ return this.axiosInstance.get(response.data.url, {responseType: "json", onDownloadProgress: onDownloadProgress}).then((response) => {
279
+ return response;
280
+ })
281
+ } else {
282
+ return response;
283
+ }
284
+ })
285
+ }
275
286
  if (onDownloadProgress !== undefined) {
276
287
  return this.axiosInstance.get(this.baseURL + "curtain/" + id + "/download/token=" + token + "/", {responseType:"json"}).then((response) => {
277
288
  if ("url" in response.data) {
@@ -585,5 +596,11 @@ export class CurtainWebAPI {
585
596
  headers["Accept"] = "application/json"
586
597
  return this.axiosInstance.get(this.baseURL + "datacite/get_time_limited_permission_token/?suffix=" + suffix, {headers: headers, responseType: "json"})
587
598
  }
599
+
600
+ getDataCiteProxyOrcidPublicRecord(orcid: string) {
601
+ let headers = new AxiosHeaders()
602
+ headers["Accept"] = "application/json"
603
+ return this.axiosInstance.get(this.baseURL + "datacite/proxy_orcid/?orcid=" + orcid, {headers: headers, responseType: "json"})
604
+ }
588
605
  }
589
606