curtain-web-api 1.0.71 → 1.0.73

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.
@@ -96,6 +96,31 @@ export interface CreatePermanentLinkRequest {
96
96
  requested_expiry_months?: number;
97
97
  reason?: string;
98
98
  }
99
+ export interface CurtainCollection {
100
+ id: number;
101
+ created: string;
102
+ updated: string;
103
+ name: string;
104
+ description: string;
105
+ owner: number;
106
+ owner_username: string;
107
+ curtains: number[];
108
+ curtain_count: number;
109
+ }
110
+ export interface CreateCurtainCollection {
111
+ name: string;
112
+ description?: string;
113
+ curtains?: number[];
114
+ }
115
+ export interface UpdateCurtainCollection {
116
+ name?: string;
117
+ description?: string;
118
+ curtains?: number[];
119
+ }
120
+ export interface AddCurtainToCollection {
121
+ curtain_id?: number;
122
+ link_id?: string;
123
+ }
99
124
  export declare class CurtainWebAPI {
100
125
  loginURL: string;
101
126
  logoutURL: string;
@@ -196,4 +221,20 @@ export declare class CurtainWebAPI {
196
221
  message: string;
197
222
  request: PermanentLinkRequest;
198
223
  }, any, {}>>;
224
+ getCurtainCollections(limit?: number, offset?: number, search?: string, ordering?: string, curtain_id?: number, link_id?: string): Promise<import("axios").AxiosResponse<{
225
+ count: number;
226
+ results: CurtainCollection[];
227
+ }, any, {}>>;
228
+ getCurtainCollection(id: number): Promise<import("axios").AxiosResponse<CurtainCollection, any, {}>>;
229
+ createCurtainCollection(collection: CreateCurtainCollection): Promise<import("axios").AxiosResponse<CurtainCollection, any, {}>>;
230
+ updateCurtainCollection(id: number, collection: UpdateCurtainCollection): Promise<import("axios").AxiosResponse<CurtainCollection, any, {}>>;
231
+ deleteCurtainCollection(id: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
232
+ addCurtainToCollection(collectionId: number, data: AddCurtainToCollection): Promise<import("axios").AxiosResponse<{
233
+ message: string;
234
+ collection: CurtainCollection;
235
+ }, any, {}>>;
236
+ removeCurtainFromCollection(collectionId: number, data: AddCurtainToCollection): Promise<import("axios").AxiosResponse<{
237
+ message: string;
238
+ collection: CurtainCollection;
239
+ }, any, {}>>;
199
240
  }
@@ -874,4 +874,58 @@ export class CurtainWebAPI {
874
874
  const data = admin_notes ? { admin_notes } : {};
875
875
  return this.axiosInstance.post(this.baseURL + "permanent-link-requests/" + id + "/reject/", data, { headers: headers, responseType: "json" });
876
876
  }
877
+ getCurtainCollections(limit = 10, offset = 0, search, ordering, curtain_id, link_id) {
878
+ let headers = new AxiosHeaders();
879
+ headers["Accept"] = "application/json";
880
+ let params = new URLSearchParams();
881
+ params.append("limit", limit.toString());
882
+ params.append("offset", offset.toString());
883
+ if (search) {
884
+ params.append("search", search);
885
+ }
886
+ if (ordering) {
887
+ params.append("ordering", ordering);
888
+ }
889
+ if (curtain_id) {
890
+ params.append("curtain_id", curtain_id.toString());
891
+ }
892
+ if (link_id) {
893
+ params.append("link_id", link_id);
894
+ }
895
+ return this.axiosInstance.get(this.baseURL + "curtain-collections/", { headers: headers, params: params, responseType: "json" });
896
+ }
897
+ getCurtainCollection(id) {
898
+ let headers = new AxiosHeaders();
899
+ headers["Accept"] = "application/json";
900
+ return this.axiosInstance.get(this.baseURL + "curtain-collections/" + id + "/", { headers: headers, responseType: "json" });
901
+ }
902
+ createCurtainCollection(collection) {
903
+ let headers = new AxiosHeaders();
904
+ headers["Accept"] = "application/json";
905
+ headers["Content-Type"] = "application/json";
906
+ return this.axiosInstance.post(this.baseURL + "curtain-collections/", collection, { headers: headers, responseType: "json" });
907
+ }
908
+ updateCurtainCollection(id, collection) {
909
+ let headers = new AxiosHeaders();
910
+ headers["Accept"] = "application/json";
911
+ headers["Content-Type"] = "application/json";
912
+ return this.axiosInstance.patch(this.baseURL + "curtain-collections/" + id + "/", collection, { headers: headers, responseType: "json" });
913
+ }
914
+ deleteCurtainCollection(id) {
915
+ let headers = new AxiosHeaders();
916
+ headers["Accept"] = "application/json";
917
+ return this.axiosInstance.delete(this.baseURL + "curtain-collections/" + id + "/", { headers: headers });
918
+ }
919
+ addCurtainToCollection(collectionId, data) {
920
+ let headers = new AxiosHeaders();
921
+ headers["Accept"] = "application/json";
922
+ headers["Content-Type"] = "application/json";
923
+ return this.axiosInstance.post(this.baseURL + "curtain-collections/" + collectionId + "/add_curtain/", data, { headers: headers, responseType: "json" });
924
+ }
925
+ removeCurtainFromCollection(collectionId, data) {
926
+ let headers = new AxiosHeaders();
927
+ headers["Accept"] = "application/json";
928
+ headers["Content-Type"] = "application/json";
929
+ return this.axiosInstance.post(this.baseURL + "curtain-collections/" + collectionId + "/remove_curtain/", data, { headers: headers, responseType: "json" });
930
+ }
877
931
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curtain-web-api",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -133,6 +133,35 @@ export interface CreatePermanentLinkRequest {
133
133
  reason?: string;
134
134
  }
135
135
 
136
+ export interface CurtainCollection {
137
+ id: number;
138
+ created: string;
139
+ updated: string;
140
+ name: string;
141
+ description: string;
142
+ owner: number;
143
+ owner_username: string;
144
+ curtains: number[];
145
+ curtain_count: number;
146
+ }
147
+
148
+ export interface CreateCurtainCollection {
149
+ name: string;
150
+ description?: string;
151
+ curtains?: number[];
152
+ }
153
+
154
+ export interface UpdateCurtainCollection {
155
+ name?: string;
156
+ description?: string;
157
+ curtains?: number[];
158
+ }
159
+
160
+ export interface AddCurtainToCollection {
161
+ curtain_id?: number;
162
+ link_id?: string;
163
+ }
164
+
136
165
  export class CurtainWebAPI {
137
166
  loginURL: string = "";
138
167
  logoutURL: string = "";
@@ -1090,5 +1119,66 @@ export class CurtainWebAPI {
1090
1119
  const data = admin_notes ? {admin_notes} : {};
1091
1120
  return this.axiosInstance.post<{message: string, request: PermanentLinkRequest}>(this.baseURL + "permanent-link-requests/" + id + "/reject/", data, {headers: headers, responseType: "json"});
1092
1121
  }
1122
+
1123
+ getCurtainCollections(limit: number = 10, offset: number = 0, search?: string, ordering?: string, curtain_id?: number, link_id?: string) {
1124
+ let headers = new AxiosHeaders();
1125
+ headers["Accept"] = "application/json";
1126
+ let params = new URLSearchParams();
1127
+ params.append("limit", limit.toString());
1128
+ params.append("offset", offset.toString());
1129
+ if (search) {
1130
+ params.append("search", search);
1131
+ }
1132
+ if (ordering) {
1133
+ params.append("ordering", ordering);
1134
+ }
1135
+ if (curtain_id) {
1136
+ params.append("curtain_id", curtain_id.toString());
1137
+ }
1138
+ if (link_id) {
1139
+ params.append("link_id", link_id);
1140
+ }
1141
+ return this.axiosInstance.get<{count: number, results: CurtainCollection[]}>(this.baseURL + "curtain-collections/", {headers: headers, params: params, responseType: "json"});
1142
+ }
1143
+
1144
+ getCurtainCollection(id: number) {
1145
+ let headers = new AxiosHeaders();
1146
+ headers["Accept"] = "application/json";
1147
+ return this.axiosInstance.get<CurtainCollection>(this.baseURL + "curtain-collections/" + id + "/", {headers: headers, responseType: "json"});
1148
+ }
1149
+
1150
+ createCurtainCollection(collection: CreateCurtainCollection) {
1151
+ let headers = new AxiosHeaders();
1152
+ headers["Accept"] = "application/json";
1153
+ headers["Content-Type"] = "application/json";
1154
+ return this.axiosInstance.post<CurtainCollection>(this.baseURL + "curtain-collections/", collection, {headers: headers, responseType: "json"});
1155
+ }
1156
+
1157
+ updateCurtainCollection(id: number, collection: UpdateCurtainCollection) {
1158
+ let headers = new AxiosHeaders();
1159
+ headers["Accept"] = "application/json";
1160
+ headers["Content-Type"] = "application/json";
1161
+ return this.axiosInstance.patch<CurtainCollection>(this.baseURL + "curtain-collections/" + id + "/", collection, {headers: headers, responseType: "json"});
1162
+ }
1163
+
1164
+ deleteCurtainCollection(id: number) {
1165
+ let headers = new AxiosHeaders();
1166
+ headers["Accept"] = "application/json";
1167
+ return this.axiosInstance.delete(this.baseURL + "curtain-collections/" + id + "/", {headers: headers});
1168
+ }
1169
+
1170
+ addCurtainToCollection(collectionId: number, data: AddCurtainToCollection) {
1171
+ let headers = new AxiosHeaders();
1172
+ headers["Accept"] = "application/json";
1173
+ headers["Content-Type"] = "application/json";
1174
+ return this.axiosInstance.post<{message: string, collection: CurtainCollection}>(this.baseURL + "curtain-collections/" + collectionId + "/add_curtain/", data, {headers: headers, responseType: "json"});
1175
+ }
1176
+
1177
+ removeCurtainFromCollection(collectionId: number, data: AddCurtainToCollection) {
1178
+ let headers = new AxiosHeaders();
1179
+ headers["Accept"] = "application/json";
1180
+ headers["Content-Type"] = "application/json";
1181
+ return this.axiosInstance.post<{message: string, collection: CurtainCollection}>(this.baseURL + "curtain-collections/" + collectionId + "/remove_curtain/", data, {headers: headers, responseType: "json"});
1182
+ }
1093
1183
  }
1094
1184