curtain-web-api 1.0.46 → 1.0.48
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.
|
@@ -21,7 +21,7 @@ export declare class CurtainWebAPI {
|
|
|
21
21
|
ORCIDLogin(authorizationCode: string, redirectURI: string): Promise<User>;
|
|
22
22
|
checkIfRefreshTokenExpired(): boolean;
|
|
23
23
|
deleteCurtainLink(curtainLinkID: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
24
|
-
putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, encryption?: CurtainEncryption, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
24
|
+
putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, encryption?: CurtainEncryption, permanent?: boolean, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
25
25
|
postSettings(id: string, token: string, onDownloadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
26
26
|
getPrideData(accession: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
27
27
|
generateTemporarySession(linkId: string, lifetime: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -105,7 +105,8 @@ class CurtainWebAPI {
|
|
|
105
105
|
config.url === this.logoutURL ||
|
|
106
106
|
config.url === this.userInfoURL ||
|
|
107
107
|
config.url.startsWith(this.curtainURL) ||
|
|
108
|
-
config.url.startsWith(this.baseURL + "data_filter_list/")
|
|
108
|
+
config.url.startsWith(this.baseURL + "data_filter_list/") ||
|
|
109
|
+
config.url.startsWith(this.baseURL + "api_key/")) {
|
|
109
110
|
if (this.user.loginStatus) {
|
|
110
111
|
config.headers["Authorization"] = "Bearer " + this.user.access_token;
|
|
111
112
|
}
|
|
@@ -221,7 +222,7 @@ class CurtainWebAPI {
|
|
|
221
222
|
putSettings(settings, enable = true, description = "", sessionType = "TP", encryption = {
|
|
222
223
|
encrypted: false,
|
|
223
224
|
e2e: false,
|
|
224
|
-
}, onUploadProgress = undefined) {
|
|
225
|
+
}, permanent = false, onUploadProgress = undefined) {
|
|
225
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
227
|
let form = new FormData();
|
|
227
228
|
let data = JSON.stringify(settings, exports.replacer);
|
|
@@ -243,6 +244,12 @@ class CurtainWebAPI {
|
|
|
243
244
|
else {
|
|
244
245
|
form.append("e2e", "False");
|
|
245
246
|
}
|
|
247
|
+
if (permanent) {
|
|
248
|
+
form.append("permanent", "True");
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
form.append("permanent", "False");
|
|
252
|
+
}
|
|
246
253
|
if (encryption.encrypted && encryption.e2e && encryption.publicKey !== undefined) {
|
|
247
254
|
const aesKey = yield (0, curtain_encryption_1.generateAESKey)();
|
|
248
255
|
console.log("Encrypting data");
|
package/package.json
CHANGED
|
@@ -78,7 +78,8 @@ export class CurtainWebAPI {
|
|
|
78
78
|
config.url === this.logoutURL ||
|
|
79
79
|
config.url === this.userInfoURL ||
|
|
80
80
|
config.url.startsWith(this.curtainURL) ||
|
|
81
|
-
config.url.startsWith(this.baseURL + "data_filter_list/")
|
|
81
|
+
config.url.startsWith(this.baseURL + "data_filter_list/") ||
|
|
82
|
+
config.url.startsWith(this.baseURL + "api_key/")) {
|
|
82
83
|
if (this.user.loginStatus) {
|
|
83
84
|
config.headers["Authorization"] = "Bearer " + this.user.access_token;
|
|
84
85
|
}
|
|
@@ -208,7 +209,7 @@ export class CurtainWebAPI {
|
|
|
208
209
|
async putSettings(settings: any, enable: boolean = true, description: string = "", sessionType: string = "TP", encryption: CurtainEncryption = {
|
|
209
210
|
encrypted: false,
|
|
210
211
|
e2e: false,
|
|
211
|
-
},
|
|
212
|
+
}, permanent: boolean = false, onUploadProgress: any = undefined) {
|
|
212
213
|
let form: FormData = new FormData();
|
|
213
214
|
let data = JSON.stringify(settings, replacer)
|
|
214
215
|
if (enable) {
|
|
@@ -226,7 +227,11 @@ export class CurtainWebAPI {
|
|
|
226
227
|
} else {
|
|
227
228
|
form.append("e2e", "False")
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
+
if (permanent) {
|
|
231
|
+
form.append("permanent", "True")
|
|
232
|
+
} else {
|
|
233
|
+
form.append("permanent", "False")
|
|
234
|
+
}
|
|
230
235
|
if (encryption.encrypted && encryption.e2e && encryption.publicKey !== undefined) {
|
|
231
236
|
const aesKey = await generateAESKey()
|
|
232
237
|
console.log("Encrypting data")
|