curtain-web-api 1.0.55 → 1.0.57
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>>;
|
|
@@ -54,4 +54,8 @@ export declare class CurtainWebAPI {
|
|
|
54
54
|
getDataCite(id: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
55
55
|
getDataCiteTimeLimitedPermissionToken(suffix: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
56
56
|
getDataCiteProxyOrcidPublicRecord(orcid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
57
|
+
getDataCiteQuota(): Promise<import("axios").AxiosResponse<{
|
|
58
|
+
quota: number;
|
|
59
|
+
max_quota: number;
|
|
60
|
+
}, any>>;
|
|
57
61
|
}
|
|
@@ -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) {
|
|
@@ -575,5 +587,10 @@ class CurtainWebAPI {
|
|
|
575
587
|
headers["Accept"] = "application/json";
|
|
576
588
|
return this.axiosInstance.get(this.baseURL + "datacite/proxy_orcid/?orcid=" + orcid, { headers: headers, responseType: "json" });
|
|
577
589
|
}
|
|
590
|
+
getDataCiteQuota() {
|
|
591
|
+
let headers = new axios_1.AxiosHeaders();
|
|
592
|
+
headers["Accept"] = "application/json";
|
|
593
|
+
return this.axiosInstance.get(this.baseURL + "datacite/get_quota/", { headers: headers, responseType: "json" });
|
|
594
|
+
}
|
|
578
595
|
}
|
|
579
596
|
exports.CurtainWebAPI = CurtainWebAPI;
|
package/package.json
CHANGED
|
@@ -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) {
|
|
@@ -591,5 +602,11 @@ export class CurtainWebAPI {
|
|
|
591
602
|
headers["Accept"] = "application/json"
|
|
592
603
|
return this.axiosInstance.get(this.baseURL + "datacite/proxy_orcid/?orcid=" + orcid, {headers: headers, responseType: "json"})
|
|
593
604
|
}
|
|
605
|
+
|
|
606
|
+
getDataCiteQuota() {
|
|
607
|
+
let headers = new AxiosHeaders()
|
|
608
|
+
headers["Accept"] = "application/json"
|
|
609
|
+
return this.axiosInstance.get<{quota: number, max_quota: number}>(this.baseURL + "datacite/get_quota/", {headers: headers, responseType: "json"})
|
|
610
|
+
}
|
|
594
611
|
}
|
|
595
612
|
|