curtain-web-api 1.0.80 → 1.0.82

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.
@@ -13,6 +13,7 @@ export interface SiteProperties {
13
13
  jwt_remember_me_refresh_token_lifetime_days: number;
14
14
  umami_website_id?: string;
15
15
  umami_url?: string;
16
+ orcid_client_id?: string;
16
17
  }
17
18
  export interface CurtainChunkedUploadStatus {
18
19
  id: string;
@@ -46,6 +47,7 @@ export interface CurtainChunkedUploadResponse {
46
47
  }
47
48
  export interface CurtainChunkedUploadCompletionRequest {
48
49
  md5?: string;
50
+ name?: string;
49
51
  description?: string;
50
52
  curtain_type?: string;
51
53
  permanent?: boolean;
@@ -177,7 +179,7 @@ export declare class CurtainWebAPI {
177
179
  ORCIDLogin(authorizationCode: string, redirectURI: string, remember_me?: boolean): Promise<User>;
178
180
  checkIfRefreshTokenExpired(): boolean;
179
181
  deleteCurtainLink(curtainLinkID: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
180
- putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, encryption?: CurtainEncryption, permanent?: boolean, expiry_duration?: number, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any, {}>>;
182
+ putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, encryption?: CurtainEncryption, permanent?: boolean, expiry_duration?: number, onUploadProgress?: any, name?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
181
183
  postSettings(id: string, token: string, onDownloadProgress?: any, url?: string | undefined): Promise<import("axios").AxiosResponse<any, any, {}>>;
182
184
  getPrideData(accession: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
183
185
  generateTemporarySession(linkId: string, lifetime: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
@@ -187,7 +189,7 @@ export declare class CurtainWebAPI {
187
189
  getOwners(linkId: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
188
190
  addOwner(linkId: string, owner: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
189
191
  removeOwner(linkId: string, owner: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
190
- getCurtainLinks(username: string, sessionDescription?: string, offset?: number, sessionType?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
192
+ getCurtainLinks(username: string, sessionName?: string, offset?: number, sessionType?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
191
193
  getSiteProperties(appType?: string): Promise<import("axios").AxiosResponse<SiteProperties, any, {}>>;
192
194
  saveDataFilterList(name: string, data: string, category?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
193
195
  getDataFilterListByID(id: number, limit?: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
@@ -234,6 +236,7 @@ export declare class CurtainWebAPI {
234
236
  completeCurtainUpload(uploadId: string, request?: CurtainChunkedUploadCompletionRequest): Promise<import("axios").AxiosResponse<CurtainChunkedUploadCompletionResponse, any, {}>>;
235
237
  cancelCurtainUpload(uploadId: string): Promise<import("axios").AxiosResponse<void, any, {}>>;
236
238
  uploadCurtainFileInChunks(file: File, chunkSize?: number, options?: {
239
+ name?: string;
237
240
  description?: string;
238
241
  curtain_type?: string;
239
242
  permanent?: boolean;
@@ -197,7 +197,7 @@ export class CurtainWebAPI {
197
197
  async putSettings(settings, enable = true, description = "", sessionType = "TP", encryption = {
198
198
  encrypted: false,
199
199
  e2e: false,
200
- }, permanent = false, expiry_duration, onUploadProgress = undefined) {
200
+ }, permanent = false, expiry_duration, onUploadProgress = undefined, name) {
201
201
  let form = new FormData();
202
202
  let data = JSON.stringify(settings, replacer);
203
203
  if (enable) {
@@ -248,6 +248,9 @@ export class CurtainWebAPI {
248
248
  else {
249
249
  form.append("file", new Blob([data], { type: 'text/json' }), "curtain-settings.json");
250
250
  }
251
+ if (name) {
252
+ form.append("name", name);
253
+ }
251
254
  form.append("description", description);
252
255
  form.append("curtain_type", sessionType);
253
256
  let headers = new AxiosHeaders();
@@ -343,6 +346,9 @@ export class CurtainWebAPI {
343
346
  if ("expiry_duration" in sessionData) {
344
347
  form.append("expiry_duration", sessionData["expiry_duration"].toString());
345
348
  }
349
+ if ("name" in sessionData) {
350
+ form.append("name", sessionData["name"]);
351
+ }
346
352
  if (encryption.encrypted) {
347
353
  form.append("encrypted", "True");
348
354
  }
@@ -407,12 +413,12 @@ export class CurtainWebAPI {
407
413
  return response;
408
414
  });
409
415
  }
410
- getCurtainLinks(username, sessionDescription = "", offset = 0, sessionType = "TP") {
416
+ getCurtainLinks(username, sessionName = "", offset = 0, sessionType = "TP") {
411
417
  let headers = new AxiosHeaders();
412
418
  headers["Accept"] = "application/json";
413
419
  let params = new URLSearchParams();
414
420
  params.append("username", username);
415
- params.append("description", sessionDescription);
421
+ params.append("name", sessionName);
416
422
  params.append("offset", offset.toString());
417
423
  params.append("curtain_type", sessionType);
418
424
  params.append("ordering", "-created");
@@ -772,6 +778,9 @@ export class CurtainWebAPI {
772
778
  if (request?.md5) {
773
779
  formData.append('md5', request.md5);
774
780
  }
781
+ if (request?.name) {
782
+ formData.append('name', request.name);
783
+ }
775
784
  if (request?.description) {
776
785
  formData.append('description', request.description);
777
786
  }
@@ -824,6 +833,7 @@ export class CurtainWebAPI {
824
833
  enable: options?.enable
825
834
  });
826
835
  const completionResponse = await this.completeCurtainUpload(response.data.id, {
836
+ name: options?.name,
827
837
  description: options?.description,
828
838
  curtain_type: options?.curtain_type,
829
839
  permanent: options?.permanent,
@@ -845,6 +855,7 @@ export class CurtainWebAPI {
845
855
  if (uploadId) {
846
856
  try {
847
857
  const completionResponse = await this.completeCurtainUpload(uploadId, {
858
+ name: options?.name,
848
859
  description: options?.description,
849
860
  curtain_type: options?.curtain_type,
850
861
  permanent: options?.permanent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curtain-web-api",
3
- "version": "1.0.80",
3
+ "version": "1.0.82",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -42,6 +42,7 @@ export interface SiteProperties {
42
42
  jwt_remember_me_refresh_token_lifetime_days: number;
43
43
  umami_website_id?: string;
44
44
  umami_url?: string;
45
+ orcid_client_id?: string;
45
46
  }
46
47
 
47
48
  export interface CurtainChunkedUploadStatus {
@@ -79,6 +80,7 @@ export interface CurtainChunkedUploadResponse {
79
80
 
80
81
  export interface CurtainChunkedUploadCompletionRequest {
81
82
  md5?: string;
83
+ name?: string;
82
84
  description?: string;
83
85
  curtain_type?: string;
84
86
  permanent?: boolean;
@@ -394,7 +396,7 @@ export class CurtainWebAPI {
394
396
  async putSettings(settings: any, enable: boolean = true, description: string = "", sessionType: string = "TP", encryption: CurtainEncryption = {
395
397
  encrypted: false,
396
398
  e2e: false,
397
- }, permanent: boolean = false, expiry_duration?: number, onUploadProgress: any = undefined) {
399
+ }, permanent: boolean = false, expiry_duration?: number, onUploadProgress: any = undefined, name?: string) {
398
400
  let form: FormData = new FormData();
399
401
  let data = JSON.stringify(settings, replacer)
400
402
  if (enable) {
@@ -441,6 +443,9 @@ export class CurtainWebAPI {
441
443
  form.append("file", new Blob([data], {type: 'text/json'}), "curtain-settings.json")
442
444
  }
443
445
 
446
+ if (name) {
447
+ form.append("name", name)
448
+ }
444
449
  form.append("description", description)
445
450
  form.append("curtain_type", sessionType)
446
451
  let headers = new AxiosHeaders();
@@ -540,6 +545,10 @@ export class CurtainWebAPI {
540
545
  form.append("expiry_duration", sessionData["expiry_duration"].toString())
541
546
  }
542
547
 
548
+ if ("name" in sessionData) {
549
+ form.append("name", sessionData["name"])
550
+ }
551
+
543
552
  if (encryption.encrypted) {
544
553
  form.append("encrypted", "True")
545
554
  } else {
@@ -614,12 +623,12 @@ export class CurtainWebAPI {
614
623
  })
615
624
  }
616
625
 
617
- getCurtainLinks(username: string, sessionDescription: string = "", offset: number = 0, sessionType: string = "TP") {
626
+ getCurtainLinks(username: string, sessionName: string = "", offset: number = 0, sessionType: string = "TP") {
618
627
  let headers = new AxiosHeaders();
619
628
  headers["Accept"] = "application/json";
620
629
  let params: URLSearchParams = new URLSearchParams();
621
630
  params.append("username", username);
622
- params.append("description", sessionDescription);
631
+ params.append("name", sessionName);
623
632
  params.append("offset", offset.toString());
624
633
  params.append("curtain_type", sessionType);
625
634
  params.append("ordering", "-created");
@@ -1035,6 +1044,9 @@ export class CurtainWebAPI {
1035
1044
  if (request?.md5) {
1036
1045
  formData.append('md5', request.md5);
1037
1046
  }
1047
+ if (request?.name) {
1048
+ formData.append('name', request.name);
1049
+ }
1038
1050
  if (request?.description) {
1039
1051
  formData.append('description', request.description);
1040
1052
  }
@@ -1075,6 +1087,7 @@ export class CurtainWebAPI {
1075
1087
  file: File,
1076
1088
  chunkSize: number = 1024 * 1024,
1077
1089
  options?: {
1090
+ name?: string;
1078
1091
  description?: string;
1079
1092
  curtain_type?: string;
1080
1093
  permanent?: boolean;
@@ -1107,6 +1120,7 @@ export class CurtainWebAPI {
1107
1120
  });
1108
1121
 
1109
1122
  const completionResponse = await this.completeCurtainUpload(response.data.id, {
1123
+ name: options?.name,
1110
1124
  description: options?.description,
1111
1125
  curtain_type: options?.curtain_type,
1112
1126
  permanent: options?.permanent,
@@ -1128,6 +1142,7 @@ export class CurtainWebAPI {
1128
1142
  if (uploadId) {
1129
1143
  try {
1130
1144
  const completionResponse = await this.completeCurtainUpload(uploadId, {
1145
+ name: options?.name,
1131
1146
  description: options?.description,
1132
1147
  curtain_type: options?.curtain_type,
1133
1148
  permanent: options?.permanent,