curtain-web-api 1.0.71 → 1.0.72
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): 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,52 @@ 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) {
|
|
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
|
+
return this.axiosInstance.get(this.baseURL + "curtain-collections/", { headers: headers, params: params, responseType: "json" });
|
|
890
|
+
}
|
|
891
|
+
getCurtainCollection(id) {
|
|
892
|
+
let headers = new AxiosHeaders();
|
|
893
|
+
headers["Accept"] = "application/json";
|
|
894
|
+
return this.axiosInstance.get(this.baseURL + "curtain-collections/" + id + "/", { headers: headers, responseType: "json" });
|
|
895
|
+
}
|
|
896
|
+
createCurtainCollection(collection) {
|
|
897
|
+
let headers = new AxiosHeaders();
|
|
898
|
+
headers["Accept"] = "application/json";
|
|
899
|
+
headers["Content-Type"] = "application/json";
|
|
900
|
+
return this.axiosInstance.post(this.baseURL + "curtain-collections/", collection, { headers: headers, responseType: "json" });
|
|
901
|
+
}
|
|
902
|
+
updateCurtainCollection(id, collection) {
|
|
903
|
+
let headers = new AxiosHeaders();
|
|
904
|
+
headers["Accept"] = "application/json";
|
|
905
|
+
headers["Content-Type"] = "application/json";
|
|
906
|
+
return this.axiosInstance.patch(this.baseURL + "curtain-collections/" + id + "/", collection, { headers: headers, responseType: "json" });
|
|
907
|
+
}
|
|
908
|
+
deleteCurtainCollection(id) {
|
|
909
|
+
let headers = new AxiosHeaders();
|
|
910
|
+
headers["Accept"] = "application/json";
|
|
911
|
+
return this.axiosInstance.delete(this.baseURL + "curtain-collections/" + id + "/", { headers: headers });
|
|
912
|
+
}
|
|
913
|
+
addCurtainToCollection(collectionId, data) {
|
|
914
|
+
let headers = new AxiosHeaders();
|
|
915
|
+
headers["Accept"] = "application/json";
|
|
916
|
+
headers["Content-Type"] = "application/json";
|
|
917
|
+
return this.axiosInstance.post(this.baseURL + "curtain-collections/" + collectionId + "/add_curtain/", data, { headers: headers, responseType: "json" });
|
|
918
|
+
}
|
|
919
|
+
removeCurtainFromCollection(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 + "/remove_curtain/", data, { headers: headers, responseType: "json" });
|
|
924
|
+
}
|
|
877
925
|
}
|
package/package.json
CHANGED
|
@@ -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,60 @@ 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) {
|
|
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
|
+
return this.axiosInstance.get<{count: number, results: CurtainCollection[]}>(this.baseURL + "curtain-collections/", {headers: headers, params: params, responseType: "json"});
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
getCurtainCollection(id: number) {
|
|
1139
|
+
let headers = new AxiosHeaders();
|
|
1140
|
+
headers["Accept"] = "application/json";
|
|
1141
|
+
return this.axiosInstance.get<CurtainCollection>(this.baseURL + "curtain-collections/" + id + "/", {headers: headers, responseType: "json"});
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
createCurtainCollection(collection: CreateCurtainCollection) {
|
|
1145
|
+
let headers = new AxiosHeaders();
|
|
1146
|
+
headers["Accept"] = "application/json";
|
|
1147
|
+
headers["Content-Type"] = "application/json";
|
|
1148
|
+
return this.axiosInstance.post<CurtainCollection>(this.baseURL + "curtain-collections/", collection, {headers: headers, responseType: "json"});
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
updateCurtainCollection(id: number, collection: UpdateCurtainCollection) {
|
|
1152
|
+
let headers = new AxiosHeaders();
|
|
1153
|
+
headers["Accept"] = "application/json";
|
|
1154
|
+
headers["Content-Type"] = "application/json";
|
|
1155
|
+
return this.axiosInstance.patch<CurtainCollection>(this.baseURL + "curtain-collections/" + id + "/", collection, {headers: headers, responseType: "json"});
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
deleteCurtainCollection(id: number) {
|
|
1159
|
+
let headers = new AxiosHeaders();
|
|
1160
|
+
headers["Accept"] = "application/json";
|
|
1161
|
+
return this.axiosInstance.delete(this.baseURL + "curtain-collections/" + id + "/", {headers: headers});
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
addCurtainToCollection(collectionId: number, data: AddCurtainToCollection) {
|
|
1165
|
+
let headers = new AxiosHeaders();
|
|
1166
|
+
headers["Accept"] = "application/json";
|
|
1167
|
+
headers["Content-Type"] = "application/json";
|
|
1168
|
+
return this.axiosInstance.post<{message: string, collection: CurtainCollection}>(this.baseURL + "curtain-collections/" + collectionId + "/add_curtain/", data, {headers: headers, responseType: "json"});
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
removeCurtainFromCollection(collectionId: number, data: AddCurtainToCollection) {
|
|
1172
|
+
let headers = new AxiosHeaders();
|
|
1173
|
+
headers["Accept"] = "application/json";
|
|
1174
|
+
headers["Content-Type"] = "application/json";
|
|
1175
|
+
return this.axiosInstance.post<{message: string, collection: CurtainCollection}>(this.baseURL + "curtain-collections/" + collectionId + "/remove_curtain/", data, {headers: headers, responseType: "json"});
|
|
1176
|
+
}
|
|
1093
1177
|
}
|
|
1094
1178
|
|