curtain-web-api 1.0.69 → 1.0.71

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.
@@ -34,6 +34,8 @@ export interface CurtainChunkedUploadRequest {
34
34
  encrypted?: boolean;
35
35
  expiry_duration?: number;
36
36
  enable?: boolean;
37
+ curtain_id?: number;
38
+ link_id?: string;
37
39
  }
38
40
  export interface CurtainChunkedUploadResponse {
39
41
  id: string;
@@ -48,6 +50,8 @@ export interface CurtainChunkedUploadCompletionRequest {
48
50
  encrypted?: boolean;
49
51
  expiry_duration?: number;
50
52
  enable?: boolean;
53
+ curtain_id?: number;
54
+ link_id?: string;
51
55
  }
52
56
  export interface CurtainChunkedUploadCompletionResponse {
53
57
  curtain?: any;
@@ -121,6 +125,7 @@ export declare class CurtainWebAPI {
121
125
  getOwnership(linkId: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
122
126
  getOwners(linkId: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
123
127
  addOwner(linkId: string, owner: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
128
+ removeOwner(linkId: string, owner: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
124
129
  getCurtainLinks(username: string, sessionDescription?: string, offset?: number, sessionType?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
125
130
  getSiteProperties(): Promise<import("axios").AxiosResponse<SiteProperties, any, {}>>;
126
131
  saveDataFilterList(name: string, data: string, category?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
@@ -170,6 +175,8 @@ export declare class CurtainWebAPI {
170
175
  enable?: boolean;
171
176
  upload_session_id?: string;
172
177
  onProgress?: (progress: number) => void;
178
+ curtain_id?: number;
179
+ link_id?: string;
173
180
  }): Promise<CurtainChunkedUploadCompletionResponse>;
174
181
  getAnnouncements(limit?: number, offset?: number): Promise<import("axios").AxiosResponse<{
175
182
  count: number;
@@ -381,7 +381,23 @@ export class CurtainWebAPI {
381
381
  let headers = new AxiosHeaders();
382
382
  headers["Accept"] = "application/json";
383
383
  headers["Content-Type"] = "multipart/form-data";
384
- return this.axiosInstance.patch(this.baseURL + "curtain/" + linkId + "/add_owner/", form, { headers: headers, responseType: "json" }).then((response) => {
384
+ return this.axiosInstance.patch(this.baseURL + "curtain/" + linkId + "/add_owner/", form, {
385
+ headers: headers,
386
+ responseType: "json"
387
+ }).then((response) => {
388
+ return response;
389
+ });
390
+ }
391
+ removeOwner(linkId, owner) {
392
+ let form = new FormData();
393
+ form.append("username", owner);
394
+ let headers = new AxiosHeaders();
395
+ headers["Accept"] = "application/json";
396
+ headers["Content-Type"] = "multipart/form-data";
397
+ return this.axiosInstance.patch(this.baseURL + "curtain/" + linkId + "/remove_owner/", form, {
398
+ headers: headers,
399
+ responseType: "json"
400
+ }).then((response) => {
385
401
  return response;
386
402
  });
387
403
  }
@@ -708,6 +724,12 @@ export class CurtainWebAPI {
708
724
  if (request?.enable !== undefined) {
709
725
  formData.append('enable', request.enable.toString());
710
726
  }
727
+ if (request?.curtain_id !== undefined) {
728
+ formData.append('curtain_id', request.curtain_id.toString());
729
+ }
730
+ if (request?.link_id) {
731
+ formData.append('link_id', request.link_id);
732
+ }
711
733
  let headers = new AxiosHeaders();
712
734
  headers["Accept"] = "application/json";
713
735
  return this.axiosInstance.put(`${this.baseURL}curtain-chunked-upload/${uploadId}/`, formData, { headers: headers });
@@ -741,7 +763,9 @@ export class CurtainWebAPI {
741
763
  permanent: options?.permanent,
742
764
  encrypted: options?.encrypted,
743
765
  expiry_duration: options?.expiry_duration,
744
- enable: options?.enable
766
+ enable: options?.enable,
767
+ curtain_id: options?.curtain_id,
768
+ link_id: options?.link_id
745
769
  });
746
770
  resolve(completionResponse.data);
747
771
  }
@@ -760,7 +784,9 @@ export class CurtainWebAPI {
760
784
  permanent: options?.permanent,
761
785
  encrypted: options?.encrypted,
762
786
  expiry_duration: options?.expiry_duration,
763
- enable: options?.enable
787
+ enable: options?.enable,
788
+ curtain_id: options?.curtain_id,
789
+ link_id: options?.link_id
764
790
  });
765
791
  resolve(completionResponse.data);
766
792
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curtain-web-api",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -64,6 +64,8 @@ export interface CurtainChunkedUploadRequest {
64
64
  encrypted?: boolean;
65
65
  expiry_duration?: number;
66
66
  enable?: boolean;
67
+ curtain_id?: number;
68
+ link_id?: string;
67
69
  }
68
70
 
69
71
  export interface CurtainChunkedUploadResponse {
@@ -80,6 +82,8 @@ export interface CurtainChunkedUploadCompletionRequest {
80
82
  encrypted?: boolean;
81
83
  expiry_duration?: number;
82
84
  enable?: boolean;
85
+ curtain_id?: number;
86
+ link_id?: string;
83
87
  }
84
88
 
85
89
  export interface CurtainChunkedUploadCompletionResponse {
@@ -510,7 +514,26 @@ export class CurtainWebAPI {
510
514
  headers["Accept"] = "application/json";
511
515
  headers["Content-Type"] = "multipart/form-data";
512
516
 
513
- return this.axiosInstance.patch(this.baseURL + "curtain/" + linkId + "/add_owner/", form, {headers: headers, responseType:"json"}).then((response) => {
517
+ return this.axiosInstance.patch(this.baseURL + "curtain/" + linkId + "/add_owner/", form, {
518
+ headers: headers,
519
+ responseType: "json"
520
+ }).then((response) => {
521
+ return response;
522
+ })
523
+ }
524
+
525
+ removeOwner(linkId: string, owner: string) {
526
+ let form = new FormData();
527
+ form.append("username", owner);
528
+
529
+ let headers = new AxiosHeaders();
530
+ headers["Accept"] = "application/json";
531
+ headers["Content-Type"] = "multipart/form-data";
532
+
533
+ return this.axiosInstance.patch(this.baseURL + "curtain/" + linkId + "/remove_owner/", form, {
534
+ headers: headers,
535
+ responseType: "json"
536
+ }).then((response) => {
514
537
  return response;
515
538
  })
516
539
  }
@@ -888,6 +911,12 @@ export class CurtainWebAPI {
888
911
  if (request?.enable !== undefined) {
889
912
  formData.append('enable', request.enable.toString());
890
913
  }
914
+ if (request?.curtain_id !== undefined) {
915
+ formData.append('curtain_id', request.curtain_id.toString());
916
+ }
917
+ if (request?.link_id) {
918
+ formData.append('link_id', request.link_id);
919
+ }
891
920
 
892
921
  let headers = new AxiosHeaders();
893
922
  headers["Accept"] = "application/json";
@@ -912,6 +941,8 @@ export class CurtainWebAPI {
912
941
  enable?: boolean;
913
942
  upload_session_id?: string;
914
943
  onProgress?: (progress: number) => void;
944
+ curtain_id?: number;
945
+ link_id?: string;
915
946
  }
916
947
  ): Promise<CurtainChunkedUploadCompletionResponse> {
917
948
  return new Promise(async (resolve, reject) => {
@@ -939,7 +970,9 @@ export class CurtainWebAPI {
939
970
  permanent: options?.permanent,
940
971
  encrypted: options?.encrypted,
941
972
  expiry_duration: options?.expiry_duration,
942
- enable: options?.enable
973
+ enable: options?.enable,
974
+ curtain_id: options?.curtain_id,
975
+ link_id: options?.link_id
943
976
  });
944
977
  resolve(completionResponse.data);
945
978
  } catch (error) {
@@ -958,7 +991,9 @@ export class CurtainWebAPI {
958
991
  permanent: options?.permanent,
959
992
  encrypted: options?.encrypted,
960
993
  expiry_duration: options?.expiry_duration,
961
- enable: options?.enable
994
+ enable: options?.enable,
995
+ curtain_id: options?.curtain_id,
996
+ link_id: options?.link_id
962
997
  });
963
998
  resolve(completionResponse.data);
964
999
  } catch (error) {