@lasuillard/raindrop-client 0.4.1
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.
- package/.vscode/extensions.json +14 -0
- package/.vscode/launch.json +4 -0
- package/.vscode/settings.json +27 -0
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/index.cjs.js +24 -0
- package/dist/index.d.ts +5173 -0
- package/dist/index.es.js +3791 -0
- package/package.json +66 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,3791 @@
|
|
|
1
|
+
import h from "axios";
|
|
2
|
+
const p = "https://api.raindrop.io".replace(/\/+$/, "");
|
|
3
|
+
class I {
|
|
4
|
+
constructor(t, e = p, a = h) {
|
|
5
|
+
this.basePath = e, this.axios = a, t && (this.configuration = t, this.basePath = t.basePath ?? e);
|
|
6
|
+
}
|
|
7
|
+
configuration;
|
|
8
|
+
}
|
|
9
|
+
class fe extends Error {
|
|
10
|
+
constructor(t, e) {
|
|
11
|
+
super(e), this.field = t, this.name = "RequiredError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const u = {}, m = "https://example.com", P = function(s, t, e) {
|
|
15
|
+
if (e == null)
|
|
16
|
+
throw new fe(t, `Required parameter ${t} was null or undefined when calling ${s}.`);
|
|
17
|
+
}, v = async function(s, t) {
|
|
18
|
+
if (t && t.accessToken) {
|
|
19
|
+
const e = typeof t.accessToken == "function" ? await t.accessToken() : await t.accessToken;
|
|
20
|
+
s.Authorization = "Bearer " + e;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function Q(s, t, e = "") {
|
|
24
|
+
t != null && (typeof t == "object" ? Array.isArray(t) ? t.forEach((a) => Q(s, a, e)) : Object.keys(t).forEach(
|
|
25
|
+
(a) => Q(s, t[a], `${e}${e !== "" ? "." : ""}${a}`)
|
|
26
|
+
) : s.has(e) ? s.append(e, t) : s.set(e, t));
|
|
27
|
+
}
|
|
28
|
+
const C = function(s, ...t) {
|
|
29
|
+
const e = new URLSearchParams(s.search);
|
|
30
|
+
Q(e, t), s.search = e.toString();
|
|
31
|
+
}, b = function(s, t, e) {
|
|
32
|
+
const a = typeof s != "string";
|
|
33
|
+
return (a && e && e.isJsonMime ? e.isJsonMime(t.headers["Content-Type"]) : a) ? JSON.stringify(s !== void 0 ? s : {}) : s || "";
|
|
34
|
+
}, O = function(s) {
|
|
35
|
+
return s.pathname + s.search + s.hash;
|
|
36
|
+
}, R = function(s, t, e, a) {
|
|
37
|
+
return (o = t, r = e) => {
|
|
38
|
+
const n = { ...s.options, url: (a?.basePath || o.defaults.baseURL || r) + s.url };
|
|
39
|
+
return o.request(n);
|
|
40
|
+
};
|
|
41
|
+
}, Se = {
|
|
42
|
+
NUMBER_1: 1,
|
|
43
|
+
NUMBER_2: 2,
|
|
44
|
+
NUMBER_3: 3,
|
|
45
|
+
NUMBER_4: 4
|
|
46
|
+
}, Le = {
|
|
47
|
+
Collections: "collections"
|
|
48
|
+
}, ke = {
|
|
49
|
+
BadAuthorizationCode: "bad_authorization_code"
|
|
50
|
+
}, je = {
|
|
51
|
+
Blue: "blue",
|
|
52
|
+
Brown: "brown",
|
|
53
|
+
Cyan: "cyan",
|
|
54
|
+
Gray: "gray",
|
|
55
|
+
Green: "green",
|
|
56
|
+
Indigo: "indigo",
|
|
57
|
+
Orange: "orange",
|
|
58
|
+
Pink: "pink",
|
|
59
|
+
Purple: "purple",
|
|
60
|
+
Red: "red",
|
|
61
|
+
Teal: "teal",
|
|
62
|
+
Yellow: "yellow"
|
|
63
|
+
}, He = {
|
|
64
|
+
Blue: "blue",
|
|
65
|
+
Brown: "brown",
|
|
66
|
+
Cyan: "cyan",
|
|
67
|
+
Gray: "gray",
|
|
68
|
+
Green: "green",
|
|
69
|
+
Indigo: "indigo",
|
|
70
|
+
Orange: "orange",
|
|
71
|
+
Pink: "pink",
|
|
72
|
+
Purple: "purple",
|
|
73
|
+
Red: "red",
|
|
74
|
+
Teal: "teal",
|
|
75
|
+
Yellow: "yellow"
|
|
76
|
+
}, X = {
|
|
77
|
+
AuthorizationCode: "authorization_code"
|
|
78
|
+
}, Ne = {
|
|
79
|
+
Ready: "ready",
|
|
80
|
+
Retry: "retry",
|
|
81
|
+
Failed: "failed",
|
|
82
|
+
InvalidOrigin: "invalid-origin",
|
|
83
|
+
InvalidTimeout: "invalid-timeout",
|
|
84
|
+
InvalidSize: "invalid-size"
|
|
85
|
+
}, qe = {
|
|
86
|
+
Link: "link",
|
|
87
|
+
Image: "image"
|
|
88
|
+
}, Z = {
|
|
89
|
+
RefreshToken: "refresh_token"
|
|
90
|
+
}, Me = {
|
|
91
|
+
Member: "member",
|
|
92
|
+
Viewer: "viewer"
|
|
93
|
+
}, Qe = {
|
|
94
|
+
Title: "title",
|
|
95
|
+
Title2: "-title",
|
|
96
|
+
Count: "-count",
|
|
97
|
+
LastUpdate: "-lastUpdate"
|
|
98
|
+
}, $e = {
|
|
99
|
+
Bearer: "Bearer"
|
|
100
|
+
}, _e = {
|
|
101
|
+
List: "list",
|
|
102
|
+
Simple: "simple",
|
|
103
|
+
Grid: "grid",
|
|
104
|
+
Masonry: "masonry"
|
|
105
|
+
}, ee = function(s) {
|
|
106
|
+
return {
|
|
107
|
+
/**
|
|
108
|
+
* Direct the user to our authorization URL with specified request parameters. - If the user is not logged in, they will be asked to log in - The user will be asked if he would like to grant your application access to his Raindrop.io data
|
|
109
|
+
* @summary Authorization request
|
|
110
|
+
* @param {string} redirectUri
|
|
111
|
+
* @param {string} clientId
|
|
112
|
+
* @param {*} [options] Override http request option.
|
|
113
|
+
* @throws {RequiredError}
|
|
114
|
+
*/
|
|
115
|
+
authorize: async (t, e, a = {}) => {
|
|
116
|
+
P("authorize", "redirectUri", t), P("authorize", "clientId", e);
|
|
117
|
+
const o = "/v1/oauth/authorize", r = new URL(o, m);
|
|
118
|
+
let n;
|
|
119
|
+
s && (n = s.baseOptions);
|
|
120
|
+
const l = { method: "GET", ...n, ...a }, i = {}, c = {};
|
|
121
|
+
t !== void 0 && (c.redirect_uri = t), e !== void 0 && (c.client_id = e), C(r, c);
|
|
122
|
+
let d = n && n.headers ? n.headers : {};
|
|
123
|
+
return l.headers = { ...i, ...d, ...a.headers }, {
|
|
124
|
+
url: O(r),
|
|
125
|
+
options: l
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* Once you have the authorization code, you can exchange it for the `access_token` by doing a POST request with all required body parameters as JSON. For security reasons access tokens (except \"test tokens\") will expire after two weeks. In this case you should request the new one, by calling POST request with body parameters (JSON).
|
|
130
|
+
* @summary Obtain or refresh access token
|
|
131
|
+
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
|
|
132
|
+
* @param {*} [options] Override http request option.
|
|
133
|
+
* @throws {RequiredError}
|
|
134
|
+
*/
|
|
135
|
+
getOrRefreshToken: async (t, e = {}) => {
|
|
136
|
+
const a = "/v1/oauth/access_token", o = new URL(a, m);
|
|
137
|
+
let r;
|
|
138
|
+
s && (r = s.baseOptions);
|
|
139
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
140
|
+
l["Content-Type"] = "application/json", C(o, i);
|
|
141
|
+
let c = r && r.headers ? r.headers : {};
|
|
142
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
143
|
+
url: O(o),
|
|
144
|
+
options: n
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}, H = function(s) {
|
|
149
|
+
const t = ee(s);
|
|
150
|
+
return {
|
|
151
|
+
/**
|
|
152
|
+
* Direct the user to our authorization URL with specified request parameters. - If the user is not logged in, they will be asked to log in - The user will be asked if he would like to grant your application access to his Raindrop.io data
|
|
153
|
+
* @summary Authorization request
|
|
154
|
+
* @param {string} redirectUri
|
|
155
|
+
* @param {string} clientId
|
|
156
|
+
* @param {*} [options] Override http request option.
|
|
157
|
+
* @throws {RequiredError}
|
|
158
|
+
*/
|
|
159
|
+
async authorize(e, a, o) {
|
|
160
|
+
const r = await t.authorize(e, a, o), n = s?.serverIndex ?? 0, l = u["AuthenticationApi.authorize"]?.[n]?.url;
|
|
161
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* Once you have the authorization code, you can exchange it for the `access_token` by doing a POST request with all required body parameters as JSON. For security reasons access tokens (except \"test tokens\") will expire after two weeks. In this case you should request the new one, by calling POST request with body parameters (JSON).
|
|
165
|
+
* @summary Obtain or refresh access token
|
|
166
|
+
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
|
|
167
|
+
* @param {*} [options] Override http request option.
|
|
168
|
+
* @throws {RequiredError}
|
|
169
|
+
*/
|
|
170
|
+
async getOrRefreshToken(e, a) {
|
|
171
|
+
const o = await t.getOrRefreshToken(e, a), r = s?.serverIndex ?? 0, n = u["AuthenticationApi.getOrRefreshToken"]?.[r]?.url;
|
|
172
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, Ge = function(s, t, e) {
|
|
176
|
+
const a = H(s);
|
|
177
|
+
return {
|
|
178
|
+
/**
|
|
179
|
+
* Direct the user to our authorization URL with specified request parameters. - If the user is not logged in, they will be asked to log in - The user will be asked if he would like to grant your application access to his Raindrop.io data
|
|
180
|
+
* @summary Authorization request
|
|
181
|
+
* @param {string} redirectUri
|
|
182
|
+
* @param {string} clientId
|
|
183
|
+
* @param {*} [options] Override http request option.
|
|
184
|
+
* @throws {RequiredError}
|
|
185
|
+
*/
|
|
186
|
+
authorize(o, r, n) {
|
|
187
|
+
return a.authorize(o, r, n).then((l) => l(e, t));
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Once you have the authorization code, you can exchange it for the `access_token` by doing a POST request with all required body parameters as JSON. For security reasons access tokens (except \"test tokens\") will expire after two weeks. In this case you should request the new one, by calling POST request with body parameters (JSON).
|
|
191
|
+
* @summary Obtain or refresh access token
|
|
192
|
+
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
|
|
193
|
+
* @param {*} [options] Override http request option.
|
|
194
|
+
* @throws {RequiredError}
|
|
195
|
+
*/
|
|
196
|
+
getOrRefreshToken(o, r) {
|
|
197
|
+
return a.getOrRefreshToken(o, r).then((n) => n(e, t));
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
let te = class extends I {
|
|
202
|
+
/**
|
|
203
|
+
* Direct the user to our authorization URL with specified request parameters. - If the user is not logged in, they will be asked to log in - The user will be asked if he would like to grant your application access to his Raindrop.io data
|
|
204
|
+
* @summary Authorization request
|
|
205
|
+
* @param {string} redirectUri
|
|
206
|
+
* @param {string} clientId
|
|
207
|
+
* @param {*} [options] Override http request option.
|
|
208
|
+
* @throws {RequiredError}
|
|
209
|
+
* @memberof AuthenticationApi
|
|
210
|
+
*/
|
|
211
|
+
authorize(t, e, a) {
|
|
212
|
+
return H(this.configuration).authorize(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Once you have the authorization code, you can exchange it for the `access_token` by doing a POST request with all required body parameters as JSON. For security reasons access tokens (except \"test tokens\") will expire after two weeks. In this case you should request the new one, by calling POST request with body parameters (JSON).
|
|
216
|
+
* @summary Obtain or refresh access token
|
|
217
|
+
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
|
|
218
|
+
* @param {*} [options] Override http request option.
|
|
219
|
+
* @throws {RequiredError}
|
|
220
|
+
* @memberof AuthenticationApi
|
|
221
|
+
*/
|
|
222
|
+
getOrRefreshToken(t, e) {
|
|
223
|
+
return H(this.configuration).getOrRefreshToken(t, e).then((a) => a(this.axios, this.basePath));
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const re = function(s) {
|
|
227
|
+
return {
|
|
228
|
+
/**
|
|
229
|
+
* Accept an invitation to join a shared collection
|
|
230
|
+
* @summary Accept an invitation
|
|
231
|
+
* @param {number} id Existing collection
|
|
232
|
+
* @param {*} [options] Override http request option.
|
|
233
|
+
* @throws {RequiredError}
|
|
234
|
+
*/
|
|
235
|
+
acceptInvitation: async (t, e = {}) => {
|
|
236
|
+
P("acceptInvitation", "id", t);
|
|
237
|
+
const a = "/rest/v1/collections/{id}/join".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
238
|
+
let r;
|
|
239
|
+
s && (r = s.baseOptions);
|
|
240
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
241
|
+
await v(l, s), C(o, i);
|
|
242
|
+
let c = r && r.headers ? r.headers : {};
|
|
243
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
244
|
+
url: O(o),
|
|
245
|
+
options: n
|
|
246
|
+
};
|
|
247
|
+
},
|
|
248
|
+
/**
|
|
249
|
+
*
|
|
250
|
+
* @summary Change access level of collaborator
|
|
251
|
+
* @param {number} userId User ID of collaborator
|
|
252
|
+
* @param {number} id Existing collection ID
|
|
253
|
+
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
|
|
254
|
+
* @param {*} [options] Override http request option.
|
|
255
|
+
* @throws {RequiredError}
|
|
256
|
+
*/
|
|
257
|
+
changeCollaboratorAccessLevel: async (t, e, a, o = {}) => {
|
|
258
|
+
P("changeCollaboratorAccessLevel", "userId", t), P("changeCollaboratorAccessLevel", "id", e);
|
|
259
|
+
const r = "/rest/v1/collections/{id}/sharing/{userId}".replace("{userId}", encodeURIComponent(String(t))).replace("{id}", encodeURIComponent(String(e))), n = new URL(r, m);
|
|
260
|
+
let l;
|
|
261
|
+
s && (l = s.baseOptions);
|
|
262
|
+
const i = { method: "PUT", ...l, ...o }, c = {}, d = {};
|
|
263
|
+
await v(c, s), c["Content-Type"] = "application/json", C(n, d);
|
|
264
|
+
let V = l && l.headers ? l.headers : {};
|
|
265
|
+
return i.headers = { ...c, ...V, ...o.headers }, i.data = b(a, i, s), {
|
|
266
|
+
url: O(n),
|
|
267
|
+
options: i
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* Create a new collection
|
|
272
|
+
* @summary Create collection
|
|
273
|
+
* @param {CreateCollection} [createCollection]
|
|
274
|
+
* @param {*} [options] Override http request option.
|
|
275
|
+
* @throws {RequiredError}
|
|
276
|
+
*/
|
|
277
|
+
createCollection: async (t, e = {}) => {
|
|
278
|
+
const a = "/rest/v1/collection", o = new URL(a, m);
|
|
279
|
+
let r;
|
|
280
|
+
s && (r = s.baseOptions);
|
|
281
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
282
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
283
|
+
let c = r && r.headers ? r.headers : {};
|
|
284
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
285
|
+
url: O(o),
|
|
286
|
+
options: n
|
|
287
|
+
};
|
|
288
|
+
},
|
|
289
|
+
/**
|
|
290
|
+
* Remove an user from shared collection
|
|
291
|
+
* @summary Delete a collaborator
|
|
292
|
+
* @param {number} userId User ID of collaborator
|
|
293
|
+
* @param {number} id Existing collection ID
|
|
294
|
+
* @param {*} [options] Override http request option.
|
|
295
|
+
* @throws {RequiredError}
|
|
296
|
+
*/
|
|
297
|
+
deleteCollaborator: async (t, e, a = {}) => {
|
|
298
|
+
P("deleteCollaborator", "userId", t), P("deleteCollaborator", "id", e);
|
|
299
|
+
const o = "/rest/v1/collections/{id}/sharing/{userId}".replace("{userId}", encodeURIComponent(String(t))).replace("{id}", encodeURIComponent(String(e))), r = new URL(o, m);
|
|
300
|
+
let n;
|
|
301
|
+
s && (n = s.baseOptions);
|
|
302
|
+
const l = { method: "DELETE", ...n, ...a }, i = {}, c = {};
|
|
303
|
+
await v(i, s), C(r, c);
|
|
304
|
+
let d = n && n.headers ? n.headers : {};
|
|
305
|
+
return l.headers = { ...i, ...d, ...a.headers }, {
|
|
306
|
+
url: O(r),
|
|
307
|
+
options: l
|
|
308
|
+
};
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
*
|
|
312
|
+
* @summary Empty Trash
|
|
313
|
+
* @param {*} [options] Override http request option.
|
|
314
|
+
* @throws {RequiredError}
|
|
315
|
+
*/
|
|
316
|
+
emptyTrash: async (t = {}) => {
|
|
317
|
+
const e = "/rest/v1/collection/-99", a = new URL(e, m);
|
|
318
|
+
let o;
|
|
319
|
+
s && (o = s.baseOptions);
|
|
320
|
+
const r = { method: "DELETE", ...o, ...t }, n = {}, l = {};
|
|
321
|
+
await v(n, s), C(a, l);
|
|
322
|
+
let i = o && o.headers ? o.headers : {};
|
|
323
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
324
|
+
url: O(a),
|
|
325
|
+
options: r
|
|
326
|
+
};
|
|
327
|
+
},
|
|
328
|
+
/**
|
|
329
|
+
* Returns JSON-encoded array containing all nested collections (that have positive `parent.$id`)
|
|
330
|
+
* @summary Get child collections
|
|
331
|
+
* @param {*} [options] Override http request option.
|
|
332
|
+
* @throws {RequiredError}
|
|
333
|
+
*/
|
|
334
|
+
getChildCollections: async (t = {}) => {
|
|
335
|
+
const e = "/rest/v1/collections/childrens", a = new URL(e, m);
|
|
336
|
+
let o;
|
|
337
|
+
s && (o = s.baseOptions);
|
|
338
|
+
const r = { method: "GET", ...o, ...t }, n = {}, l = {};
|
|
339
|
+
await v(n, s), C(a, l);
|
|
340
|
+
let i = o && o.headers ? o.headers : {};
|
|
341
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
342
|
+
url: O(a),
|
|
343
|
+
options: r
|
|
344
|
+
};
|
|
345
|
+
},
|
|
346
|
+
/**
|
|
347
|
+
*
|
|
348
|
+
* @summary Get collaborators list of collection
|
|
349
|
+
* @param {number} id Existing collection ID
|
|
350
|
+
* @param {*} [options] Override http request option.
|
|
351
|
+
* @throws {RequiredError}
|
|
352
|
+
*/
|
|
353
|
+
getCollaborators: async (t, e = {}) => {
|
|
354
|
+
P("getCollaborators", "id", t);
|
|
355
|
+
const a = "/rest/v1/collections/{id}/sharing".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
356
|
+
let r;
|
|
357
|
+
s && (r = s.baseOptions);
|
|
358
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
359
|
+
await v(l, s), C(o, i);
|
|
360
|
+
let c = r && r.headers ? r.headers : {};
|
|
361
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
362
|
+
url: O(o),
|
|
363
|
+
options: n
|
|
364
|
+
};
|
|
365
|
+
},
|
|
366
|
+
/**
|
|
367
|
+
*
|
|
368
|
+
* @summary Get collection
|
|
369
|
+
* @param {number} id Collection ID
|
|
370
|
+
* @param {*} [options] Override http request option.
|
|
371
|
+
* @throws {RequiredError}
|
|
372
|
+
*/
|
|
373
|
+
getCollection: async (t, e = {}) => {
|
|
374
|
+
P("getCollection", "id", t);
|
|
375
|
+
const a = "/rest/v1/collection/{id}".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
376
|
+
let r;
|
|
377
|
+
s && (r = s.baseOptions);
|
|
378
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
379
|
+
await v(l, s), C(o, i);
|
|
380
|
+
let c = r && r.headers ? r.headers : {};
|
|
381
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
382
|
+
url: O(o),
|
|
383
|
+
options: n
|
|
384
|
+
};
|
|
385
|
+
},
|
|
386
|
+
/**
|
|
387
|
+
*
|
|
388
|
+
* @summary Featured covers
|
|
389
|
+
* @param {*} [options] Override http request option.
|
|
390
|
+
* @throws {RequiredError}
|
|
391
|
+
*/
|
|
392
|
+
getFeaturedCovers: async (t = {}) => {
|
|
393
|
+
const e = "/rest/v1/collections/covers", a = new URL(e, m);
|
|
394
|
+
let o;
|
|
395
|
+
s && (o = s.baseOptions);
|
|
396
|
+
const r = { method: "GET", ...o, ...t }, n = {}, l = {};
|
|
397
|
+
await v(n, s), C(a, l);
|
|
398
|
+
let i = o && o.headers ? o.headers : {};
|
|
399
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
400
|
+
url: O(a),
|
|
401
|
+
options: r
|
|
402
|
+
};
|
|
403
|
+
},
|
|
404
|
+
/**
|
|
405
|
+
* Returns JSON-encoded array containing all root collections.
|
|
406
|
+
* @summary Get root collections
|
|
407
|
+
* @param {*} [options] Override http request option.
|
|
408
|
+
* @throws {RequiredError}
|
|
409
|
+
*/
|
|
410
|
+
getRootCollections: async (t = {}) => {
|
|
411
|
+
const e = "/rest/v1/collections", a = new URL(e, m);
|
|
412
|
+
let o;
|
|
413
|
+
s && (o = s.baseOptions);
|
|
414
|
+
const r = { method: "GET", ...o, ...t }, n = {}, l = {};
|
|
415
|
+
await v(n, s), C(a, l);
|
|
416
|
+
let i = o && o.headers ? o.headers : {};
|
|
417
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
418
|
+
url: O(a),
|
|
419
|
+
options: r
|
|
420
|
+
};
|
|
421
|
+
},
|
|
422
|
+
/**
|
|
423
|
+
*
|
|
424
|
+
* @summary Get system collections count
|
|
425
|
+
* @param {*} [options] Override http request option.
|
|
426
|
+
* @throws {RequiredError}
|
|
427
|
+
*/
|
|
428
|
+
getSystemCollectionStats: async (t = {}) => {
|
|
429
|
+
const e = "/rest/v1/user/stats", a = new URL(e, m);
|
|
430
|
+
let o;
|
|
431
|
+
s && (o = s.baseOptions);
|
|
432
|
+
const r = { method: "GET", ...o, ...t }, n = {}, l = {};
|
|
433
|
+
await v(n, s), C(a, l);
|
|
434
|
+
let i = o && o.headers ? o.headers : {};
|
|
435
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
436
|
+
url: O(a),
|
|
437
|
+
options: r
|
|
438
|
+
};
|
|
439
|
+
},
|
|
440
|
+
/**
|
|
441
|
+
* Merge multiple collections
|
|
442
|
+
* @summary Merge collections
|
|
443
|
+
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
|
|
444
|
+
* @param {*} [options] Override http request option.
|
|
445
|
+
* @throws {RequiredError}
|
|
446
|
+
*/
|
|
447
|
+
mergeCollections: async (t, e = {}) => {
|
|
448
|
+
const a = "/rest/v1/collections/merge", o = new URL(a, m);
|
|
449
|
+
let r;
|
|
450
|
+
s && (r = s.baseOptions);
|
|
451
|
+
const n = { method: "PUT", ...r, ...e }, l = {}, i = {};
|
|
452
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
453
|
+
let c = r && r.headers ? r.headers : {};
|
|
454
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
455
|
+
url: O(o),
|
|
456
|
+
options: n
|
|
457
|
+
};
|
|
458
|
+
},
|
|
459
|
+
/**
|
|
460
|
+
*
|
|
461
|
+
* @summary Remove all empty collections
|
|
462
|
+
* @param {*} [options] Override http request option.
|
|
463
|
+
* @throws {RequiredError}
|
|
464
|
+
*/
|
|
465
|
+
removeAllEmptyCollections: async (t = {}) => {
|
|
466
|
+
const e = "/rest/v1/collections/clean", a = new URL(e, m);
|
|
467
|
+
let o;
|
|
468
|
+
s && (o = s.baseOptions);
|
|
469
|
+
const r = { method: "PUT", ...o, ...t }, n = {}, l = {};
|
|
470
|
+
await v(n, s), C(a, l);
|
|
471
|
+
let i = o && o.headers ? o.headers : {};
|
|
472
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
473
|
+
url: O(a),
|
|
474
|
+
options: r
|
|
475
|
+
};
|
|
476
|
+
},
|
|
477
|
+
/**
|
|
478
|
+
* Remove an existing collection and all its descendants. Raindrops will be moved to \"Trash\" collection
|
|
479
|
+
* @summary Remove collection
|
|
480
|
+
* @param {number} id Collection ID
|
|
481
|
+
* @param {*} [options] Override http request option.
|
|
482
|
+
* @throws {RequiredError}
|
|
483
|
+
*/
|
|
484
|
+
removeCollection: async (t, e = {}) => {
|
|
485
|
+
P("removeCollection", "id", t);
|
|
486
|
+
const a = "/rest/v1/collection/{id}".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
487
|
+
let r;
|
|
488
|
+
s && (r = s.baseOptions);
|
|
489
|
+
const n = { method: "DELETE", ...r, ...e }, l = {}, i = {};
|
|
490
|
+
await v(l, s), C(o, i);
|
|
491
|
+
let c = r && r.headers ? r.headers : {};
|
|
492
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
493
|
+
url: O(o),
|
|
494
|
+
options: n
|
|
495
|
+
};
|
|
496
|
+
},
|
|
497
|
+
/**
|
|
498
|
+
* Remove multiple collections at once. Nested collections are ignored (include ID\'s in ids array to remove them)
|
|
499
|
+
* @summary Remove multiple collections
|
|
500
|
+
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
|
|
501
|
+
* @param {*} [options] Override http request option.
|
|
502
|
+
* @throws {RequiredError}
|
|
503
|
+
*/
|
|
504
|
+
removeCollections: async (t, e = {}) => {
|
|
505
|
+
const a = "/rest/v1/collections", o = new URL(a, m);
|
|
506
|
+
let r;
|
|
507
|
+
s && (r = s.baseOptions);
|
|
508
|
+
const n = { method: "DELETE", ...r, ...e }, l = {}, i = {};
|
|
509
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
510
|
+
let c = r && r.headers ? r.headers : {};
|
|
511
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
512
|
+
url: O(o),
|
|
513
|
+
options: n
|
|
514
|
+
};
|
|
515
|
+
},
|
|
516
|
+
/**
|
|
517
|
+
* Updates order of all collections
|
|
518
|
+
* @summary Reorder all collections
|
|
519
|
+
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
|
|
520
|
+
* @param {*} [options] Override http request option.
|
|
521
|
+
* @throws {RequiredError}
|
|
522
|
+
*/
|
|
523
|
+
reorderAllCollections: async (t, e = {}) => {
|
|
524
|
+
const a = "/rest/v1/collections", o = new URL(a, m);
|
|
525
|
+
let r;
|
|
526
|
+
s && (r = s.baseOptions);
|
|
527
|
+
const n = { method: "PUT", ...r, ...e }, l = {}, i = {};
|
|
528
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
529
|
+
let c = r && r.headers ? r.headers : {};
|
|
530
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
531
|
+
url: O(o),
|
|
532
|
+
options: n
|
|
533
|
+
};
|
|
534
|
+
},
|
|
535
|
+
/**
|
|
536
|
+
* Search for specific cover (icon)
|
|
537
|
+
* @summary Search for cover
|
|
538
|
+
* @param {string} text For example \"pokemon\"
|
|
539
|
+
* @param {*} [options] Override http request option.
|
|
540
|
+
* @throws {RequiredError}
|
|
541
|
+
*/
|
|
542
|
+
searchCovers: async (t, e = {}) => {
|
|
543
|
+
P("searchCovers", "text", t);
|
|
544
|
+
const a = "/rest/v1/collections/covers/{text}".replace("{text}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
545
|
+
let r;
|
|
546
|
+
s && (r = s.baseOptions);
|
|
547
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
548
|
+
await v(l, s), C(o, i);
|
|
549
|
+
let c = r && r.headers ? r.headers : {};
|
|
550
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
551
|
+
url: O(o),
|
|
552
|
+
options: n
|
|
553
|
+
};
|
|
554
|
+
},
|
|
555
|
+
/**
|
|
556
|
+
* Share collection with another user(s). As result invitation(s) will be send to specified email(s) with link to join collection.
|
|
557
|
+
* @summary Share collection
|
|
558
|
+
* @param {number} id Existing collection ID
|
|
559
|
+
* @param {ShareCollectionRequest} [shareCollectionRequest]
|
|
560
|
+
* @param {*} [options] Override http request option.
|
|
561
|
+
* @throws {RequiredError}
|
|
562
|
+
*/
|
|
563
|
+
shareCollection: async (t, e, a = {}) => {
|
|
564
|
+
P("shareCollection", "id", t);
|
|
565
|
+
const o = "/rest/v1/collections/{id}/sharing".replace("{id}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
566
|
+
let n;
|
|
567
|
+
s && (n = s.baseOptions);
|
|
568
|
+
const l = { method: "POST", ...n, ...a }, i = {}, c = {};
|
|
569
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
570
|
+
let d = n && n.headers ? n.headers : {};
|
|
571
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
572
|
+
url: O(r),
|
|
573
|
+
options: l
|
|
574
|
+
};
|
|
575
|
+
},
|
|
576
|
+
/**
|
|
577
|
+
* There two possible results of calling this method, depends on who authenticated user is: - Owner: collection will be unshared and all collaborators will be removed - Member or viewer: authenticated user will be removed from collaborators list
|
|
578
|
+
* @summary Unshare or leave collection
|
|
579
|
+
* @param {number} id Existing collection ID
|
|
580
|
+
* @param {*} [options] Override http request option.
|
|
581
|
+
* @throws {RequiredError}
|
|
582
|
+
*/
|
|
583
|
+
unshareOrLeaveCollection: async (t, e = {}) => {
|
|
584
|
+
P("unshareOrLeaveCollection", "id", t);
|
|
585
|
+
const a = "/rest/v1/collections/{id}/sharing".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
586
|
+
let r;
|
|
587
|
+
s && (r = s.baseOptions);
|
|
588
|
+
const n = { method: "DELETE", ...r, ...e }, l = {}, i = {};
|
|
589
|
+
await v(l, s), C(o, i);
|
|
590
|
+
let c = r && r.headers ? r.headers : {};
|
|
591
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
592
|
+
url: O(o),
|
|
593
|
+
options: n
|
|
594
|
+
};
|
|
595
|
+
},
|
|
596
|
+
/**
|
|
597
|
+
* Update an existing collection
|
|
598
|
+
* @summary Update collection
|
|
599
|
+
* @param {number} id Collection ID
|
|
600
|
+
* @param {UpdateCollection} [updateCollection]
|
|
601
|
+
* @param {*} [options] Override http request option.
|
|
602
|
+
* @throws {RequiredError}
|
|
603
|
+
*/
|
|
604
|
+
updateCollection: async (t, e, a = {}) => {
|
|
605
|
+
P("updateCollection", "id", t);
|
|
606
|
+
const o = "/rest/v1/collection/{id}".replace("{id}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
607
|
+
let n;
|
|
608
|
+
s && (n = s.baseOptions);
|
|
609
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {};
|
|
610
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
611
|
+
let d = n && n.headers ? n.headers : {};
|
|
612
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
613
|
+
url: O(r),
|
|
614
|
+
options: l
|
|
615
|
+
};
|
|
616
|
+
},
|
|
617
|
+
/**
|
|
618
|
+
* It\'s possible to upload cover from desktop. PNG, GIF and JPEG supported
|
|
619
|
+
* @summary Upload cover
|
|
620
|
+
* @param {number} id Existing collection ID
|
|
621
|
+
* @param {File} [cover]
|
|
622
|
+
* @param {*} [options] Override http request option.
|
|
623
|
+
* @throws {RequiredError}
|
|
624
|
+
*/
|
|
625
|
+
uploadCollectionCover: async (t, e, a = {}) => {
|
|
626
|
+
P("uploadCollectionCover", "id", t);
|
|
627
|
+
const o = "/rest/v1/collections/{id}/cover".replace("{id}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
628
|
+
let n;
|
|
629
|
+
s && (n = s.baseOptions);
|
|
630
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {}, d = new (s && s.formDataCtor || FormData)();
|
|
631
|
+
await v(i, s), e !== void 0 && d.append("cover", e), i["Content-Type"] = "multipart/form-data", C(r, c);
|
|
632
|
+
let V = n && n.headers ? n.headers : {};
|
|
633
|
+
return l.headers = { ...i, ...V, ...a.headers }, l.data = d, {
|
|
634
|
+
url: O(r),
|
|
635
|
+
options: l
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
}, A = function(s) {
|
|
640
|
+
const t = re(s);
|
|
641
|
+
return {
|
|
642
|
+
/**
|
|
643
|
+
* Accept an invitation to join a shared collection
|
|
644
|
+
* @summary Accept an invitation
|
|
645
|
+
* @param {number} id Existing collection
|
|
646
|
+
* @param {*} [options] Override http request option.
|
|
647
|
+
* @throws {RequiredError}
|
|
648
|
+
*/
|
|
649
|
+
async acceptInvitation(e, a) {
|
|
650
|
+
const o = await t.acceptInvitation(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.acceptInvitation"]?.[r]?.url;
|
|
651
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
652
|
+
},
|
|
653
|
+
/**
|
|
654
|
+
*
|
|
655
|
+
* @summary Change access level of collaborator
|
|
656
|
+
* @param {number} userId User ID of collaborator
|
|
657
|
+
* @param {number} id Existing collection ID
|
|
658
|
+
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
|
|
659
|
+
* @param {*} [options] Override http request option.
|
|
660
|
+
* @throws {RequiredError}
|
|
661
|
+
*/
|
|
662
|
+
async changeCollaboratorAccessLevel(e, a, o, r) {
|
|
663
|
+
const n = await t.changeCollaboratorAccessLevel(e, a, o, r), l = s?.serverIndex ?? 0, i = u["CollectionApi.changeCollaboratorAccessLevel"]?.[l]?.url;
|
|
664
|
+
return (c, d) => R(n, h, p, s)(c, i || d);
|
|
665
|
+
},
|
|
666
|
+
/**
|
|
667
|
+
* Create a new collection
|
|
668
|
+
* @summary Create collection
|
|
669
|
+
* @param {CreateCollection} [createCollection]
|
|
670
|
+
* @param {*} [options] Override http request option.
|
|
671
|
+
* @throws {RequiredError}
|
|
672
|
+
*/
|
|
673
|
+
async createCollection(e, a) {
|
|
674
|
+
const o = await t.createCollection(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.createCollection"]?.[r]?.url;
|
|
675
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
676
|
+
},
|
|
677
|
+
/**
|
|
678
|
+
* Remove an user from shared collection
|
|
679
|
+
* @summary Delete a collaborator
|
|
680
|
+
* @param {number} userId User ID of collaborator
|
|
681
|
+
* @param {number} id Existing collection ID
|
|
682
|
+
* @param {*} [options] Override http request option.
|
|
683
|
+
* @throws {RequiredError}
|
|
684
|
+
*/
|
|
685
|
+
async deleteCollaborator(e, a, o) {
|
|
686
|
+
const r = await t.deleteCollaborator(e, a, o), n = s?.serverIndex ?? 0, l = u["CollectionApi.deleteCollaborator"]?.[n]?.url;
|
|
687
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
688
|
+
},
|
|
689
|
+
/**
|
|
690
|
+
*
|
|
691
|
+
* @summary Empty Trash
|
|
692
|
+
* @param {*} [options] Override http request option.
|
|
693
|
+
* @throws {RequiredError}
|
|
694
|
+
*/
|
|
695
|
+
async emptyTrash(e) {
|
|
696
|
+
const a = await t.emptyTrash(e), o = s?.serverIndex ?? 0, r = u["CollectionApi.emptyTrash"]?.[o]?.url;
|
|
697
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
698
|
+
},
|
|
699
|
+
/**
|
|
700
|
+
* Returns JSON-encoded array containing all nested collections (that have positive `parent.$id`)
|
|
701
|
+
* @summary Get child collections
|
|
702
|
+
* @param {*} [options] Override http request option.
|
|
703
|
+
* @throws {RequiredError}
|
|
704
|
+
*/
|
|
705
|
+
async getChildCollections(e) {
|
|
706
|
+
const a = await t.getChildCollections(e), o = s?.serverIndex ?? 0, r = u["CollectionApi.getChildCollections"]?.[o]?.url;
|
|
707
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
708
|
+
},
|
|
709
|
+
/**
|
|
710
|
+
*
|
|
711
|
+
* @summary Get collaborators list of collection
|
|
712
|
+
* @param {number} id Existing collection ID
|
|
713
|
+
* @param {*} [options] Override http request option.
|
|
714
|
+
* @throws {RequiredError}
|
|
715
|
+
*/
|
|
716
|
+
async getCollaborators(e, a) {
|
|
717
|
+
const o = await t.getCollaborators(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.getCollaborators"]?.[r]?.url;
|
|
718
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
719
|
+
},
|
|
720
|
+
/**
|
|
721
|
+
*
|
|
722
|
+
* @summary Get collection
|
|
723
|
+
* @param {number} id Collection ID
|
|
724
|
+
* @param {*} [options] Override http request option.
|
|
725
|
+
* @throws {RequiredError}
|
|
726
|
+
*/
|
|
727
|
+
async getCollection(e, a) {
|
|
728
|
+
const o = await t.getCollection(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.getCollection"]?.[r]?.url;
|
|
729
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
730
|
+
},
|
|
731
|
+
/**
|
|
732
|
+
*
|
|
733
|
+
* @summary Featured covers
|
|
734
|
+
* @param {*} [options] Override http request option.
|
|
735
|
+
* @throws {RequiredError}
|
|
736
|
+
*/
|
|
737
|
+
async getFeaturedCovers(e) {
|
|
738
|
+
const a = await t.getFeaturedCovers(e), o = s?.serverIndex ?? 0, r = u["CollectionApi.getFeaturedCovers"]?.[o]?.url;
|
|
739
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
740
|
+
},
|
|
741
|
+
/**
|
|
742
|
+
* Returns JSON-encoded array containing all root collections.
|
|
743
|
+
* @summary Get root collections
|
|
744
|
+
* @param {*} [options] Override http request option.
|
|
745
|
+
* @throws {RequiredError}
|
|
746
|
+
*/
|
|
747
|
+
async getRootCollections(e) {
|
|
748
|
+
const a = await t.getRootCollections(e), o = s?.serverIndex ?? 0, r = u["CollectionApi.getRootCollections"]?.[o]?.url;
|
|
749
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
750
|
+
},
|
|
751
|
+
/**
|
|
752
|
+
*
|
|
753
|
+
* @summary Get system collections count
|
|
754
|
+
* @param {*} [options] Override http request option.
|
|
755
|
+
* @throws {RequiredError}
|
|
756
|
+
*/
|
|
757
|
+
async getSystemCollectionStats(e) {
|
|
758
|
+
const a = await t.getSystemCollectionStats(e), o = s?.serverIndex ?? 0, r = u["CollectionApi.getSystemCollectionStats"]?.[o]?.url;
|
|
759
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
760
|
+
},
|
|
761
|
+
/**
|
|
762
|
+
* Merge multiple collections
|
|
763
|
+
* @summary Merge collections
|
|
764
|
+
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
|
|
765
|
+
* @param {*} [options] Override http request option.
|
|
766
|
+
* @throws {RequiredError}
|
|
767
|
+
*/
|
|
768
|
+
async mergeCollections(e, a) {
|
|
769
|
+
const o = await t.mergeCollections(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.mergeCollections"]?.[r]?.url;
|
|
770
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
771
|
+
},
|
|
772
|
+
/**
|
|
773
|
+
*
|
|
774
|
+
* @summary Remove all empty collections
|
|
775
|
+
* @param {*} [options] Override http request option.
|
|
776
|
+
* @throws {RequiredError}
|
|
777
|
+
*/
|
|
778
|
+
async removeAllEmptyCollections(e) {
|
|
779
|
+
const a = await t.removeAllEmptyCollections(e), o = s?.serverIndex ?? 0, r = u["CollectionApi.removeAllEmptyCollections"]?.[o]?.url;
|
|
780
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
781
|
+
},
|
|
782
|
+
/**
|
|
783
|
+
* Remove an existing collection and all its descendants. Raindrops will be moved to \"Trash\" collection
|
|
784
|
+
* @summary Remove collection
|
|
785
|
+
* @param {number} id Collection ID
|
|
786
|
+
* @param {*} [options] Override http request option.
|
|
787
|
+
* @throws {RequiredError}
|
|
788
|
+
*/
|
|
789
|
+
async removeCollection(e, a) {
|
|
790
|
+
const o = await t.removeCollection(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.removeCollection"]?.[r]?.url;
|
|
791
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
792
|
+
},
|
|
793
|
+
/**
|
|
794
|
+
* Remove multiple collections at once. Nested collections are ignored (include ID\'s in ids array to remove them)
|
|
795
|
+
* @summary Remove multiple collections
|
|
796
|
+
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
|
|
797
|
+
* @param {*} [options] Override http request option.
|
|
798
|
+
* @throws {RequiredError}
|
|
799
|
+
*/
|
|
800
|
+
async removeCollections(e, a) {
|
|
801
|
+
const o = await t.removeCollections(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.removeCollections"]?.[r]?.url;
|
|
802
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
803
|
+
},
|
|
804
|
+
/**
|
|
805
|
+
* Updates order of all collections
|
|
806
|
+
* @summary Reorder all collections
|
|
807
|
+
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
|
|
808
|
+
* @param {*} [options] Override http request option.
|
|
809
|
+
* @throws {RequiredError}
|
|
810
|
+
*/
|
|
811
|
+
async reorderAllCollections(e, a) {
|
|
812
|
+
const o = await t.reorderAllCollections(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.reorderAllCollections"]?.[r]?.url;
|
|
813
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
814
|
+
},
|
|
815
|
+
/**
|
|
816
|
+
* Search for specific cover (icon)
|
|
817
|
+
* @summary Search for cover
|
|
818
|
+
* @param {string} text For example \"pokemon\"
|
|
819
|
+
* @param {*} [options] Override http request option.
|
|
820
|
+
* @throws {RequiredError}
|
|
821
|
+
*/
|
|
822
|
+
async searchCovers(e, a) {
|
|
823
|
+
const o = await t.searchCovers(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.searchCovers"]?.[r]?.url;
|
|
824
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
825
|
+
},
|
|
826
|
+
/**
|
|
827
|
+
* Share collection with another user(s). As result invitation(s) will be send to specified email(s) with link to join collection.
|
|
828
|
+
* @summary Share collection
|
|
829
|
+
* @param {number} id Existing collection ID
|
|
830
|
+
* @param {ShareCollectionRequest} [shareCollectionRequest]
|
|
831
|
+
* @param {*} [options] Override http request option.
|
|
832
|
+
* @throws {RequiredError}
|
|
833
|
+
*/
|
|
834
|
+
async shareCollection(e, a, o) {
|
|
835
|
+
const r = await t.shareCollection(e, a, o), n = s?.serverIndex ?? 0, l = u["CollectionApi.shareCollection"]?.[n]?.url;
|
|
836
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
837
|
+
},
|
|
838
|
+
/**
|
|
839
|
+
* There two possible results of calling this method, depends on who authenticated user is: - Owner: collection will be unshared and all collaborators will be removed - Member or viewer: authenticated user will be removed from collaborators list
|
|
840
|
+
* @summary Unshare or leave collection
|
|
841
|
+
* @param {number} id Existing collection ID
|
|
842
|
+
* @param {*} [options] Override http request option.
|
|
843
|
+
* @throws {RequiredError}
|
|
844
|
+
*/
|
|
845
|
+
async unshareOrLeaveCollection(e, a) {
|
|
846
|
+
const o = await t.unshareOrLeaveCollection(e, a), r = s?.serverIndex ?? 0, n = u["CollectionApi.unshareOrLeaveCollection"]?.[r]?.url;
|
|
847
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
848
|
+
},
|
|
849
|
+
/**
|
|
850
|
+
* Update an existing collection
|
|
851
|
+
* @summary Update collection
|
|
852
|
+
* @param {number} id Collection ID
|
|
853
|
+
* @param {UpdateCollection} [updateCollection]
|
|
854
|
+
* @param {*} [options] Override http request option.
|
|
855
|
+
* @throws {RequiredError}
|
|
856
|
+
*/
|
|
857
|
+
async updateCollection(e, a, o) {
|
|
858
|
+
const r = await t.updateCollection(e, a, o), n = s?.serverIndex ?? 0, l = u["CollectionApi.updateCollection"]?.[n]?.url;
|
|
859
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
860
|
+
},
|
|
861
|
+
/**
|
|
862
|
+
* It\'s possible to upload cover from desktop. PNG, GIF and JPEG supported
|
|
863
|
+
* @summary Upload cover
|
|
864
|
+
* @param {number} id Existing collection ID
|
|
865
|
+
* @param {File} [cover]
|
|
866
|
+
* @param {*} [options] Override http request option.
|
|
867
|
+
* @throws {RequiredError}
|
|
868
|
+
*/
|
|
869
|
+
async uploadCollectionCover(e, a, o) {
|
|
870
|
+
const r = await t.uploadCollectionCover(e, a, o), n = s?.serverIndex ?? 0, l = u["CollectionApi.uploadCollectionCover"]?.[n]?.url;
|
|
871
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
}, De = function(s, t, e) {
|
|
875
|
+
const a = A(s);
|
|
876
|
+
return {
|
|
877
|
+
/**
|
|
878
|
+
* Accept an invitation to join a shared collection
|
|
879
|
+
* @summary Accept an invitation
|
|
880
|
+
* @param {number} id Existing collection
|
|
881
|
+
* @param {*} [options] Override http request option.
|
|
882
|
+
* @throws {RequiredError}
|
|
883
|
+
*/
|
|
884
|
+
acceptInvitation(o, r) {
|
|
885
|
+
return a.acceptInvitation(o, r).then((n) => n(e, t));
|
|
886
|
+
},
|
|
887
|
+
/**
|
|
888
|
+
*
|
|
889
|
+
* @summary Change access level of collaborator
|
|
890
|
+
* @param {number} userId User ID of collaborator
|
|
891
|
+
* @param {number} id Existing collection ID
|
|
892
|
+
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
|
|
893
|
+
* @param {*} [options] Override http request option.
|
|
894
|
+
* @throws {RequiredError}
|
|
895
|
+
*/
|
|
896
|
+
changeCollaboratorAccessLevel(o, r, n, l) {
|
|
897
|
+
return a.changeCollaboratorAccessLevel(o, r, n, l).then((i) => i(e, t));
|
|
898
|
+
},
|
|
899
|
+
/**
|
|
900
|
+
* Create a new collection
|
|
901
|
+
* @summary Create collection
|
|
902
|
+
* @param {CreateCollection} [createCollection]
|
|
903
|
+
* @param {*} [options] Override http request option.
|
|
904
|
+
* @throws {RequiredError}
|
|
905
|
+
*/
|
|
906
|
+
createCollection(o, r) {
|
|
907
|
+
return a.createCollection(o, r).then((n) => n(e, t));
|
|
908
|
+
},
|
|
909
|
+
/**
|
|
910
|
+
* Remove an user from shared collection
|
|
911
|
+
* @summary Delete a collaborator
|
|
912
|
+
* @param {number} userId User ID of collaborator
|
|
913
|
+
* @param {number} id Existing collection ID
|
|
914
|
+
* @param {*} [options] Override http request option.
|
|
915
|
+
* @throws {RequiredError}
|
|
916
|
+
*/
|
|
917
|
+
deleteCollaborator(o, r, n) {
|
|
918
|
+
return a.deleteCollaborator(o, r, n).then((l) => l(e, t));
|
|
919
|
+
},
|
|
920
|
+
/**
|
|
921
|
+
*
|
|
922
|
+
* @summary Empty Trash
|
|
923
|
+
* @param {*} [options] Override http request option.
|
|
924
|
+
* @throws {RequiredError}
|
|
925
|
+
*/
|
|
926
|
+
emptyTrash(o) {
|
|
927
|
+
return a.emptyTrash(o).then((r) => r(e, t));
|
|
928
|
+
},
|
|
929
|
+
/**
|
|
930
|
+
* Returns JSON-encoded array containing all nested collections (that have positive `parent.$id`)
|
|
931
|
+
* @summary Get child collections
|
|
932
|
+
* @param {*} [options] Override http request option.
|
|
933
|
+
* @throws {RequiredError}
|
|
934
|
+
*/
|
|
935
|
+
getChildCollections(o) {
|
|
936
|
+
return a.getChildCollections(o).then((r) => r(e, t));
|
|
937
|
+
},
|
|
938
|
+
/**
|
|
939
|
+
*
|
|
940
|
+
* @summary Get collaborators list of collection
|
|
941
|
+
* @param {number} id Existing collection ID
|
|
942
|
+
* @param {*} [options] Override http request option.
|
|
943
|
+
* @throws {RequiredError}
|
|
944
|
+
*/
|
|
945
|
+
getCollaborators(o, r) {
|
|
946
|
+
return a.getCollaborators(o, r).then((n) => n(e, t));
|
|
947
|
+
},
|
|
948
|
+
/**
|
|
949
|
+
*
|
|
950
|
+
* @summary Get collection
|
|
951
|
+
* @param {number} id Collection ID
|
|
952
|
+
* @param {*} [options] Override http request option.
|
|
953
|
+
* @throws {RequiredError}
|
|
954
|
+
*/
|
|
955
|
+
getCollection(o, r) {
|
|
956
|
+
return a.getCollection(o, r).then((n) => n(e, t));
|
|
957
|
+
},
|
|
958
|
+
/**
|
|
959
|
+
*
|
|
960
|
+
* @summary Featured covers
|
|
961
|
+
* @param {*} [options] Override http request option.
|
|
962
|
+
* @throws {RequiredError}
|
|
963
|
+
*/
|
|
964
|
+
getFeaturedCovers(o) {
|
|
965
|
+
return a.getFeaturedCovers(o).then((r) => r(e, t));
|
|
966
|
+
},
|
|
967
|
+
/**
|
|
968
|
+
* Returns JSON-encoded array containing all root collections.
|
|
969
|
+
* @summary Get root collections
|
|
970
|
+
* @param {*} [options] Override http request option.
|
|
971
|
+
* @throws {RequiredError}
|
|
972
|
+
*/
|
|
973
|
+
getRootCollections(o) {
|
|
974
|
+
return a.getRootCollections(o).then((r) => r(e, t));
|
|
975
|
+
},
|
|
976
|
+
/**
|
|
977
|
+
*
|
|
978
|
+
* @summary Get system collections count
|
|
979
|
+
* @param {*} [options] Override http request option.
|
|
980
|
+
* @throws {RequiredError}
|
|
981
|
+
*/
|
|
982
|
+
getSystemCollectionStats(o) {
|
|
983
|
+
return a.getSystemCollectionStats(o).then((r) => r(e, t));
|
|
984
|
+
},
|
|
985
|
+
/**
|
|
986
|
+
* Merge multiple collections
|
|
987
|
+
* @summary Merge collections
|
|
988
|
+
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
|
|
989
|
+
* @param {*} [options] Override http request option.
|
|
990
|
+
* @throws {RequiredError}
|
|
991
|
+
*/
|
|
992
|
+
mergeCollections(o, r) {
|
|
993
|
+
return a.mergeCollections(o, r).then((n) => n(e, t));
|
|
994
|
+
},
|
|
995
|
+
/**
|
|
996
|
+
*
|
|
997
|
+
* @summary Remove all empty collections
|
|
998
|
+
* @param {*} [options] Override http request option.
|
|
999
|
+
* @throws {RequiredError}
|
|
1000
|
+
*/
|
|
1001
|
+
removeAllEmptyCollections(o) {
|
|
1002
|
+
return a.removeAllEmptyCollections(o).then((r) => r(e, t));
|
|
1003
|
+
},
|
|
1004
|
+
/**
|
|
1005
|
+
* Remove an existing collection and all its descendants. Raindrops will be moved to \"Trash\" collection
|
|
1006
|
+
* @summary Remove collection
|
|
1007
|
+
* @param {number} id Collection ID
|
|
1008
|
+
* @param {*} [options] Override http request option.
|
|
1009
|
+
* @throws {RequiredError}
|
|
1010
|
+
*/
|
|
1011
|
+
removeCollection(o, r) {
|
|
1012
|
+
return a.removeCollection(o, r).then((n) => n(e, t));
|
|
1013
|
+
},
|
|
1014
|
+
/**
|
|
1015
|
+
* Remove multiple collections at once. Nested collections are ignored (include ID\'s in ids array to remove them)
|
|
1016
|
+
* @summary Remove multiple collections
|
|
1017
|
+
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
|
|
1018
|
+
* @param {*} [options] Override http request option.
|
|
1019
|
+
* @throws {RequiredError}
|
|
1020
|
+
*/
|
|
1021
|
+
removeCollections(o, r) {
|
|
1022
|
+
return a.removeCollections(o, r).then((n) => n(e, t));
|
|
1023
|
+
},
|
|
1024
|
+
/**
|
|
1025
|
+
* Updates order of all collections
|
|
1026
|
+
* @summary Reorder all collections
|
|
1027
|
+
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
|
|
1028
|
+
* @param {*} [options] Override http request option.
|
|
1029
|
+
* @throws {RequiredError}
|
|
1030
|
+
*/
|
|
1031
|
+
reorderAllCollections(o, r) {
|
|
1032
|
+
return a.reorderAllCollections(o, r).then((n) => n(e, t));
|
|
1033
|
+
},
|
|
1034
|
+
/**
|
|
1035
|
+
* Search for specific cover (icon)
|
|
1036
|
+
* @summary Search for cover
|
|
1037
|
+
* @param {string} text For example \"pokemon\"
|
|
1038
|
+
* @param {*} [options] Override http request option.
|
|
1039
|
+
* @throws {RequiredError}
|
|
1040
|
+
*/
|
|
1041
|
+
searchCovers(o, r) {
|
|
1042
|
+
return a.searchCovers(o, r).then((n) => n(e, t));
|
|
1043
|
+
},
|
|
1044
|
+
/**
|
|
1045
|
+
* Share collection with another user(s). As result invitation(s) will be send to specified email(s) with link to join collection.
|
|
1046
|
+
* @summary Share collection
|
|
1047
|
+
* @param {number} id Existing collection ID
|
|
1048
|
+
* @param {ShareCollectionRequest} [shareCollectionRequest]
|
|
1049
|
+
* @param {*} [options] Override http request option.
|
|
1050
|
+
* @throws {RequiredError}
|
|
1051
|
+
*/
|
|
1052
|
+
shareCollection(o, r, n) {
|
|
1053
|
+
return a.shareCollection(o, r, n).then((l) => l(e, t));
|
|
1054
|
+
},
|
|
1055
|
+
/**
|
|
1056
|
+
* There two possible results of calling this method, depends on who authenticated user is: - Owner: collection will be unshared and all collaborators will be removed - Member or viewer: authenticated user will be removed from collaborators list
|
|
1057
|
+
* @summary Unshare or leave collection
|
|
1058
|
+
* @param {number} id Existing collection ID
|
|
1059
|
+
* @param {*} [options] Override http request option.
|
|
1060
|
+
* @throws {RequiredError}
|
|
1061
|
+
*/
|
|
1062
|
+
unshareOrLeaveCollection(o, r) {
|
|
1063
|
+
return a.unshareOrLeaveCollection(o, r).then((n) => n(e, t));
|
|
1064
|
+
},
|
|
1065
|
+
/**
|
|
1066
|
+
* Update an existing collection
|
|
1067
|
+
* @summary Update collection
|
|
1068
|
+
* @param {number} id Collection ID
|
|
1069
|
+
* @param {UpdateCollection} [updateCollection]
|
|
1070
|
+
* @param {*} [options] Override http request option.
|
|
1071
|
+
* @throws {RequiredError}
|
|
1072
|
+
*/
|
|
1073
|
+
updateCollection(o, r, n) {
|
|
1074
|
+
return a.updateCollection(o, r, n).then((l) => l(e, t));
|
|
1075
|
+
},
|
|
1076
|
+
/**
|
|
1077
|
+
* It\'s possible to upload cover from desktop. PNG, GIF and JPEG supported
|
|
1078
|
+
* @summary Upload cover
|
|
1079
|
+
* @param {number} id Existing collection ID
|
|
1080
|
+
* @param {File} [cover]
|
|
1081
|
+
* @param {*} [options] Override http request option.
|
|
1082
|
+
* @throws {RequiredError}
|
|
1083
|
+
*/
|
|
1084
|
+
uploadCollectionCover(o, r, n) {
|
|
1085
|
+
return a.uploadCollectionCover(o, r, n).then((l) => l(e, t));
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
};
|
|
1089
|
+
let ae = class extends I {
|
|
1090
|
+
/**
|
|
1091
|
+
* Accept an invitation to join a shared collection
|
|
1092
|
+
* @summary Accept an invitation
|
|
1093
|
+
* @param {number} id Existing collection
|
|
1094
|
+
* @param {*} [options] Override http request option.
|
|
1095
|
+
* @throws {RequiredError}
|
|
1096
|
+
* @memberof CollectionApi
|
|
1097
|
+
*/
|
|
1098
|
+
acceptInvitation(t, e) {
|
|
1099
|
+
return A(this.configuration).acceptInvitation(t, e).then((a) => a(this.axios, this.basePath));
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
*
|
|
1103
|
+
* @summary Change access level of collaborator
|
|
1104
|
+
* @param {number} userId User ID of collaborator
|
|
1105
|
+
* @param {number} id Existing collection ID
|
|
1106
|
+
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
|
|
1107
|
+
* @param {*} [options] Override http request option.
|
|
1108
|
+
* @throws {RequiredError}
|
|
1109
|
+
* @memberof CollectionApi
|
|
1110
|
+
*/
|
|
1111
|
+
changeCollaboratorAccessLevel(t, e, a, o) {
|
|
1112
|
+
return A(this.configuration).changeCollaboratorAccessLevel(t, e, a, o).then((r) => r(this.axios, this.basePath));
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Create a new collection
|
|
1116
|
+
* @summary Create collection
|
|
1117
|
+
* @param {CreateCollection} [createCollection]
|
|
1118
|
+
* @param {*} [options] Override http request option.
|
|
1119
|
+
* @throws {RequiredError}
|
|
1120
|
+
* @memberof CollectionApi
|
|
1121
|
+
*/
|
|
1122
|
+
createCollection(t, e) {
|
|
1123
|
+
return A(this.configuration).createCollection(t, e).then((a) => a(this.axios, this.basePath));
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* Remove an user from shared collection
|
|
1127
|
+
* @summary Delete a collaborator
|
|
1128
|
+
* @param {number} userId User ID of collaborator
|
|
1129
|
+
* @param {number} id Existing collection ID
|
|
1130
|
+
* @param {*} [options] Override http request option.
|
|
1131
|
+
* @throws {RequiredError}
|
|
1132
|
+
* @memberof CollectionApi
|
|
1133
|
+
*/
|
|
1134
|
+
deleteCollaborator(t, e, a) {
|
|
1135
|
+
return A(this.configuration).deleteCollaborator(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
*
|
|
1139
|
+
* @summary Empty Trash
|
|
1140
|
+
* @param {*} [options] Override http request option.
|
|
1141
|
+
* @throws {RequiredError}
|
|
1142
|
+
* @memberof CollectionApi
|
|
1143
|
+
*/
|
|
1144
|
+
emptyTrash(t) {
|
|
1145
|
+
return A(this.configuration).emptyTrash(t).then((e) => e(this.axios, this.basePath));
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Returns JSON-encoded array containing all nested collections (that have positive `parent.$id`)
|
|
1149
|
+
* @summary Get child collections
|
|
1150
|
+
* @param {*} [options] Override http request option.
|
|
1151
|
+
* @throws {RequiredError}
|
|
1152
|
+
* @memberof CollectionApi
|
|
1153
|
+
*/
|
|
1154
|
+
getChildCollections(t) {
|
|
1155
|
+
return A(this.configuration).getChildCollections(t).then((e) => e(this.axios, this.basePath));
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
*
|
|
1159
|
+
* @summary Get collaborators list of collection
|
|
1160
|
+
* @param {number} id Existing collection ID
|
|
1161
|
+
* @param {*} [options] Override http request option.
|
|
1162
|
+
* @throws {RequiredError}
|
|
1163
|
+
* @memberof CollectionApi
|
|
1164
|
+
*/
|
|
1165
|
+
getCollaborators(t, e) {
|
|
1166
|
+
return A(this.configuration).getCollaborators(t, e).then((a) => a(this.axios, this.basePath));
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
*
|
|
1170
|
+
* @summary Get collection
|
|
1171
|
+
* @param {number} id Collection ID
|
|
1172
|
+
* @param {*} [options] Override http request option.
|
|
1173
|
+
* @throws {RequiredError}
|
|
1174
|
+
* @memberof CollectionApi
|
|
1175
|
+
*/
|
|
1176
|
+
getCollection(t, e) {
|
|
1177
|
+
return A(this.configuration).getCollection(t, e).then((a) => a(this.axios, this.basePath));
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
*
|
|
1181
|
+
* @summary Featured covers
|
|
1182
|
+
* @param {*} [options] Override http request option.
|
|
1183
|
+
* @throws {RequiredError}
|
|
1184
|
+
* @memberof CollectionApi
|
|
1185
|
+
*/
|
|
1186
|
+
getFeaturedCovers(t) {
|
|
1187
|
+
return A(this.configuration).getFeaturedCovers(t).then((e) => e(this.axios, this.basePath));
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Returns JSON-encoded array containing all root collections.
|
|
1191
|
+
* @summary Get root collections
|
|
1192
|
+
* @param {*} [options] Override http request option.
|
|
1193
|
+
* @throws {RequiredError}
|
|
1194
|
+
* @memberof CollectionApi
|
|
1195
|
+
*/
|
|
1196
|
+
getRootCollections(t) {
|
|
1197
|
+
return A(this.configuration).getRootCollections(t).then((e) => e(this.axios, this.basePath));
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
*
|
|
1201
|
+
* @summary Get system collections count
|
|
1202
|
+
* @param {*} [options] Override http request option.
|
|
1203
|
+
* @throws {RequiredError}
|
|
1204
|
+
* @memberof CollectionApi
|
|
1205
|
+
*/
|
|
1206
|
+
getSystemCollectionStats(t) {
|
|
1207
|
+
return A(this.configuration).getSystemCollectionStats(t).then((e) => e(this.axios, this.basePath));
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Merge multiple collections
|
|
1211
|
+
* @summary Merge collections
|
|
1212
|
+
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
|
|
1213
|
+
* @param {*} [options] Override http request option.
|
|
1214
|
+
* @throws {RequiredError}
|
|
1215
|
+
* @memberof CollectionApi
|
|
1216
|
+
*/
|
|
1217
|
+
mergeCollections(t, e) {
|
|
1218
|
+
return A(this.configuration).mergeCollections(t, e).then((a) => a(this.axios, this.basePath));
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
*
|
|
1222
|
+
* @summary Remove all empty collections
|
|
1223
|
+
* @param {*} [options] Override http request option.
|
|
1224
|
+
* @throws {RequiredError}
|
|
1225
|
+
* @memberof CollectionApi
|
|
1226
|
+
*/
|
|
1227
|
+
removeAllEmptyCollections(t) {
|
|
1228
|
+
return A(this.configuration).removeAllEmptyCollections(t).then((e) => e(this.axios, this.basePath));
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Remove an existing collection and all its descendants. Raindrops will be moved to \"Trash\" collection
|
|
1232
|
+
* @summary Remove collection
|
|
1233
|
+
* @param {number} id Collection ID
|
|
1234
|
+
* @param {*} [options] Override http request option.
|
|
1235
|
+
* @throws {RequiredError}
|
|
1236
|
+
* @memberof CollectionApi
|
|
1237
|
+
*/
|
|
1238
|
+
removeCollection(t, e) {
|
|
1239
|
+
return A(this.configuration).removeCollection(t, e).then((a) => a(this.axios, this.basePath));
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Remove multiple collections at once. Nested collections are ignored (include ID\'s in ids array to remove them)
|
|
1243
|
+
* @summary Remove multiple collections
|
|
1244
|
+
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
|
|
1245
|
+
* @param {*} [options] Override http request option.
|
|
1246
|
+
* @throws {RequiredError}
|
|
1247
|
+
* @memberof CollectionApi
|
|
1248
|
+
*/
|
|
1249
|
+
removeCollections(t, e) {
|
|
1250
|
+
return A(this.configuration).removeCollections(t, e).then((a) => a(this.axios, this.basePath));
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Updates order of all collections
|
|
1254
|
+
* @summary Reorder all collections
|
|
1255
|
+
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
|
|
1256
|
+
* @param {*} [options] Override http request option.
|
|
1257
|
+
* @throws {RequiredError}
|
|
1258
|
+
* @memberof CollectionApi
|
|
1259
|
+
*/
|
|
1260
|
+
reorderAllCollections(t, e) {
|
|
1261
|
+
return A(this.configuration).reorderAllCollections(t, e).then((a) => a(this.axios, this.basePath));
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Search for specific cover (icon)
|
|
1265
|
+
* @summary Search for cover
|
|
1266
|
+
* @param {string} text For example \"pokemon\"
|
|
1267
|
+
* @param {*} [options] Override http request option.
|
|
1268
|
+
* @throws {RequiredError}
|
|
1269
|
+
* @memberof CollectionApi
|
|
1270
|
+
*/
|
|
1271
|
+
searchCovers(t, e) {
|
|
1272
|
+
return A(this.configuration).searchCovers(t, e).then((a) => a(this.axios, this.basePath));
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Share collection with another user(s). As result invitation(s) will be send to specified email(s) with link to join collection.
|
|
1276
|
+
* @summary Share collection
|
|
1277
|
+
* @param {number} id Existing collection ID
|
|
1278
|
+
* @param {ShareCollectionRequest} [shareCollectionRequest]
|
|
1279
|
+
* @param {*} [options] Override http request option.
|
|
1280
|
+
* @throws {RequiredError}
|
|
1281
|
+
* @memberof CollectionApi
|
|
1282
|
+
*/
|
|
1283
|
+
shareCollection(t, e, a) {
|
|
1284
|
+
return A(this.configuration).shareCollection(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* There two possible results of calling this method, depends on who authenticated user is: - Owner: collection will be unshared and all collaborators will be removed - Member or viewer: authenticated user will be removed from collaborators list
|
|
1288
|
+
* @summary Unshare or leave collection
|
|
1289
|
+
* @param {number} id Existing collection ID
|
|
1290
|
+
* @param {*} [options] Override http request option.
|
|
1291
|
+
* @throws {RequiredError}
|
|
1292
|
+
* @memberof CollectionApi
|
|
1293
|
+
*/
|
|
1294
|
+
unshareOrLeaveCollection(t, e) {
|
|
1295
|
+
return A(this.configuration).unshareOrLeaveCollection(t, e).then((a) => a(this.axios, this.basePath));
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Update an existing collection
|
|
1299
|
+
* @summary Update collection
|
|
1300
|
+
* @param {number} id Collection ID
|
|
1301
|
+
* @param {UpdateCollection} [updateCollection]
|
|
1302
|
+
* @param {*} [options] Override http request option.
|
|
1303
|
+
* @throws {RequiredError}
|
|
1304
|
+
* @memberof CollectionApi
|
|
1305
|
+
*/
|
|
1306
|
+
updateCollection(t, e, a) {
|
|
1307
|
+
return A(this.configuration).updateCollection(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* It\'s possible to upload cover from desktop. PNG, GIF and JPEG supported
|
|
1311
|
+
* @summary Upload cover
|
|
1312
|
+
* @param {number} id Existing collection ID
|
|
1313
|
+
* @param {File} [cover]
|
|
1314
|
+
* @param {*} [options] Override http request option.
|
|
1315
|
+
* @throws {RequiredError}
|
|
1316
|
+
* @memberof CollectionApi
|
|
1317
|
+
*/
|
|
1318
|
+
uploadCollectionCover(t, e, a) {
|
|
1319
|
+
return A(this.configuration).uploadCollectionCover(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
const se = function(s) {
|
|
1323
|
+
return {
|
|
1324
|
+
/**
|
|
1325
|
+
*
|
|
1326
|
+
* @summary Get filters
|
|
1327
|
+
* @param {number} collectionId Collection ID
|
|
1328
|
+
* @param {GetFiltersTagsSortEnum} [tagsSort] Sort tags by: `-count` by count, default `_id` by name
|
|
1329
|
+
* @param {string} [search] Check \"raindrops\" documentation for more details
|
|
1330
|
+
* @param {*} [options] Override http request option.
|
|
1331
|
+
* @throws {RequiredError}
|
|
1332
|
+
*/
|
|
1333
|
+
getFilters: async (t, e, a, o = {}) => {
|
|
1334
|
+
P("getFilters", "collectionId", t);
|
|
1335
|
+
const r = "/rest/v1/filters/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), n = new URL(r, m);
|
|
1336
|
+
let l;
|
|
1337
|
+
s && (l = s.baseOptions);
|
|
1338
|
+
const i = { method: "GET", ...l, ...o }, c = {}, d = {};
|
|
1339
|
+
await v(c, s), e !== void 0 && (d.tagsSort = e), a !== void 0 && (d.search = a), C(n, d);
|
|
1340
|
+
let V = l && l.headers ? l.headers : {};
|
|
1341
|
+
return i.headers = { ...c, ...V, ...o.headers }, {
|
|
1342
|
+
url: O(n),
|
|
1343
|
+
options: i
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
}, _ = function(s) {
|
|
1348
|
+
const t = se(s);
|
|
1349
|
+
return {
|
|
1350
|
+
/**
|
|
1351
|
+
*
|
|
1352
|
+
* @summary Get filters
|
|
1353
|
+
* @param {number} collectionId Collection ID
|
|
1354
|
+
* @param {GetFiltersTagsSortEnum} [tagsSort] Sort tags by: `-count` by count, default `_id` by name
|
|
1355
|
+
* @param {string} [search] Check \"raindrops\" documentation for more details
|
|
1356
|
+
* @param {*} [options] Override http request option.
|
|
1357
|
+
* @throws {RequiredError}
|
|
1358
|
+
*/
|
|
1359
|
+
async getFilters(e, a, o, r) {
|
|
1360
|
+
const n = await t.getFilters(e, a, o, r), l = s?.serverIndex ?? 0, i = u["FilterApi.getFilters"]?.[l]?.url;
|
|
1361
|
+
return (c, d) => R(n, h, p, s)(c, i || d);
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
}, ze = function(s, t, e) {
|
|
1365
|
+
const a = _(s);
|
|
1366
|
+
return {
|
|
1367
|
+
/**
|
|
1368
|
+
*
|
|
1369
|
+
* @summary Get filters
|
|
1370
|
+
* @param {number} collectionId Collection ID
|
|
1371
|
+
* @param {GetFiltersTagsSortEnum} [tagsSort] Sort tags by: `-count` by count, default `_id` by name
|
|
1372
|
+
* @param {string} [search] Check \"raindrops\" documentation for more details
|
|
1373
|
+
* @param {*} [options] Override http request option.
|
|
1374
|
+
* @throws {RequiredError}
|
|
1375
|
+
*/
|
|
1376
|
+
getFilters(o, r, n, l) {
|
|
1377
|
+
return a.getFilters(o, r, n, l).then((i) => i(e, t));
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
};
|
|
1381
|
+
class oe extends I {
|
|
1382
|
+
/**
|
|
1383
|
+
*
|
|
1384
|
+
* @summary Get filters
|
|
1385
|
+
* @param {number} collectionId Collection ID
|
|
1386
|
+
* @param {GetFiltersTagsSortEnum} [tagsSort] Sort tags by: `-count` by count, default `_id` by name
|
|
1387
|
+
* @param {string} [search] Check \"raindrops\" documentation for more details
|
|
1388
|
+
* @param {*} [options] Override http request option.
|
|
1389
|
+
* @throws {RequiredError}
|
|
1390
|
+
* @memberof FilterApi
|
|
1391
|
+
*/
|
|
1392
|
+
getFilters(t, e, a, o) {
|
|
1393
|
+
return _(this.configuration).getFilters(t, e, a, o).then((r) => r(this.axios, this.basePath));
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
const Je = {
|
|
1397
|
+
Count: "-count",
|
|
1398
|
+
Id: "_id"
|
|
1399
|
+
}, ne = function(s) {
|
|
1400
|
+
return {
|
|
1401
|
+
/**
|
|
1402
|
+
*
|
|
1403
|
+
* @summary Get all highlights
|
|
1404
|
+
* @param {number} [page]
|
|
1405
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1406
|
+
* @param {*} [options] Override http request option.
|
|
1407
|
+
* @throws {RequiredError}
|
|
1408
|
+
*/
|
|
1409
|
+
getAllHighlights: async (t, e, a = {}) => {
|
|
1410
|
+
const o = "/rest/v1/highlights", r = new URL(o, m);
|
|
1411
|
+
let n;
|
|
1412
|
+
s && (n = s.baseOptions);
|
|
1413
|
+
const l = { method: "GET", ...n, ...a }, i = {}, c = {};
|
|
1414
|
+
await v(i, s), t !== void 0 && (c.page = t), e !== void 0 && (c.perpage = e), C(r, c);
|
|
1415
|
+
let d = n && n.headers ? n.headers : {};
|
|
1416
|
+
return l.headers = { ...i, ...d, ...a.headers }, {
|
|
1417
|
+
url: O(r),
|
|
1418
|
+
options: l
|
|
1419
|
+
};
|
|
1420
|
+
},
|
|
1421
|
+
/**
|
|
1422
|
+
*
|
|
1423
|
+
* @summary Get all highlights in a collection
|
|
1424
|
+
* @param {number} collectionId Collection ID
|
|
1425
|
+
* @param {number} [page]
|
|
1426
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1427
|
+
* @param {*} [options] Override http request option.
|
|
1428
|
+
* @throws {RequiredError}
|
|
1429
|
+
*/
|
|
1430
|
+
getHighlightsInCollection: async (t, e, a, o = {}) => {
|
|
1431
|
+
P("getHighlightsInCollection", "collectionId", t);
|
|
1432
|
+
const r = "/rest/v1/highlights/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), n = new URL(r, m);
|
|
1433
|
+
let l;
|
|
1434
|
+
s && (l = s.baseOptions);
|
|
1435
|
+
const i = { method: "GET", ...l, ...o }, c = {}, d = {};
|
|
1436
|
+
await v(c, s), e !== void 0 && (d.page = e), a !== void 0 && (d.perpage = a), C(n, d);
|
|
1437
|
+
let V = l && l.headers ? l.headers : {};
|
|
1438
|
+
return i.headers = { ...c, ...V, ...o.headers }, {
|
|
1439
|
+
url: O(n),
|
|
1440
|
+
options: i
|
|
1441
|
+
};
|
|
1442
|
+
},
|
|
1443
|
+
/**
|
|
1444
|
+
*
|
|
1445
|
+
* @summary Get raindrop
|
|
1446
|
+
* @param {number} id Existing raindrop ID
|
|
1447
|
+
* @param {*} [options] Override http request option.
|
|
1448
|
+
* @throws {RequiredError}
|
|
1449
|
+
*/
|
|
1450
|
+
getRaindrop: async (t, e = {}) => {
|
|
1451
|
+
P("getRaindrop", "id", t);
|
|
1452
|
+
const a = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
1453
|
+
let r;
|
|
1454
|
+
s && (r = s.baseOptions);
|
|
1455
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
1456
|
+
await v(l, s), C(o, i);
|
|
1457
|
+
let c = r && r.headers ? r.headers : {};
|
|
1458
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
1459
|
+
url: O(o),
|
|
1460
|
+
options: n
|
|
1461
|
+
};
|
|
1462
|
+
},
|
|
1463
|
+
/**
|
|
1464
|
+
*
|
|
1465
|
+
* @summary Update raindrop
|
|
1466
|
+
* @param {number} id Existing raindrop ID
|
|
1467
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
1468
|
+
* @param {*} [options] Override http request option.
|
|
1469
|
+
* @throws {RequiredError}
|
|
1470
|
+
*/
|
|
1471
|
+
updateRaindrop: async (t, e, a = {}) => {
|
|
1472
|
+
P("updateRaindrop", "id", t);
|
|
1473
|
+
const o = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
1474
|
+
let n;
|
|
1475
|
+
s && (n = s.baseOptions);
|
|
1476
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {};
|
|
1477
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
1478
|
+
let d = n && n.headers ? n.headers : {};
|
|
1479
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
1480
|
+
url: O(r),
|
|
1481
|
+
options: l
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
}, E = function(s) {
|
|
1486
|
+
const t = ne(s);
|
|
1487
|
+
return {
|
|
1488
|
+
/**
|
|
1489
|
+
*
|
|
1490
|
+
* @summary Get all highlights
|
|
1491
|
+
* @param {number} [page]
|
|
1492
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1493
|
+
* @param {*} [options] Override http request option.
|
|
1494
|
+
* @throws {RequiredError}
|
|
1495
|
+
*/
|
|
1496
|
+
async getAllHighlights(e, a, o) {
|
|
1497
|
+
const r = await t.getAllHighlights(e, a, o), n = s?.serverIndex ?? 0, l = u["HighlightApi.getAllHighlights"]?.[n]?.url;
|
|
1498
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
1499
|
+
},
|
|
1500
|
+
/**
|
|
1501
|
+
*
|
|
1502
|
+
* @summary Get all highlights in a collection
|
|
1503
|
+
* @param {number} collectionId Collection ID
|
|
1504
|
+
* @param {number} [page]
|
|
1505
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1506
|
+
* @param {*} [options] Override http request option.
|
|
1507
|
+
* @throws {RequiredError}
|
|
1508
|
+
*/
|
|
1509
|
+
async getHighlightsInCollection(e, a, o, r) {
|
|
1510
|
+
const n = await t.getHighlightsInCollection(e, a, o, r), l = s?.serverIndex ?? 0, i = u["HighlightApi.getHighlightsInCollection"]?.[l]?.url;
|
|
1511
|
+
return (c, d) => R(n, h, p, s)(c, i || d);
|
|
1512
|
+
},
|
|
1513
|
+
/**
|
|
1514
|
+
*
|
|
1515
|
+
* @summary Get raindrop
|
|
1516
|
+
* @param {number} id Existing raindrop ID
|
|
1517
|
+
* @param {*} [options] Override http request option.
|
|
1518
|
+
* @throws {RequiredError}
|
|
1519
|
+
*/
|
|
1520
|
+
async getRaindrop(e, a) {
|
|
1521
|
+
const o = await t.getRaindrop(e, a), r = s?.serverIndex ?? 0, n = u["HighlightApi.getRaindrop"]?.[r]?.url;
|
|
1522
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
1523
|
+
},
|
|
1524
|
+
/**
|
|
1525
|
+
*
|
|
1526
|
+
* @summary Update raindrop
|
|
1527
|
+
* @param {number} id Existing raindrop ID
|
|
1528
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
1529
|
+
* @param {*} [options] Override http request option.
|
|
1530
|
+
* @throws {RequiredError}
|
|
1531
|
+
*/
|
|
1532
|
+
async updateRaindrop(e, a, o) {
|
|
1533
|
+
const r = await t.updateRaindrop(e, a, o), n = s?.serverIndex ?? 0, l = u["HighlightApi.updateRaindrop"]?.[n]?.url;
|
|
1534
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
}, We = function(s, t, e) {
|
|
1538
|
+
const a = E(s);
|
|
1539
|
+
return {
|
|
1540
|
+
/**
|
|
1541
|
+
*
|
|
1542
|
+
* @summary Get all highlights
|
|
1543
|
+
* @param {number} [page]
|
|
1544
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1545
|
+
* @param {*} [options] Override http request option.
|
|
1546
|
+
* @throws {RequiredError}
|
|
1547
|
+
*/
|
|
1548
|
+
getAllHighlights(o, r, n) {
|
|
1549
|
+
return a.getAllHighlights(o, r, n).then((l) => l(e, t));
|
|
1550
|
+
},
|
|
1551
|
+
/**
|
|
1552
|
+
*
|
|
1553
|
+
* @summary Get all highlights in a collection
|
|
1554
|
+
* @param {number} collectionId Collection ID
|
|
1555
|
+
* @param {number} [page]
|
|
1556
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1557
|
+
* @param {*} [options] Override http request option.
|
|
1558
|
+
* @throws {RequiredError}
|
|
1559
|
+
*/
|
|
1560
|
+
getHighlightsInCollection(o, r, n, l) {
|
|
1561
|
+
return a.getHighlightsInCollection(o, r, n, l).then((i) => i(e, t));
|
|
1562
|
+
},
|
|
1563
|
+
/**
|
|
1564
|
+
*
|
|
1565
|
+
* @summary Get raindrop
|
|
1566
|
+
* @param {number} id Existing raindrop ID
|
|
1567
|
+
* @param {*} [options] Override http request option.
|
|
1568
|
+
* @throws {RequiredError}
|
|
1569
|
+
*/
|
|
1570
|
+
getRaindrop(o, r) {
|
|
1571
|
+
return a.getRaindrop(o, r).then((n) => n(e, t));
|
|
1572
|
+
},
|
|
1573
|
+
/**
|
|
1574
|
+
*
|
|
1575
|
+
* @summary Update raindrop
|
|
1576
|
+
* @param {number} id Existing raindrop ID
|
|
1577
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
1578
|
+
* @param {*} [options] Override http request option.
|
|
1579
|
+
* @throws {RequiredError}
|
|
1580
|
+
*/
|
|
1581
|
+
updateRaindrop(o, r, n) {
|
|
1582
|
+
return a.updateRaindrop(o, r, n).then((l) => l(e, t));
|
|
1583
|
+
}
|
|
1584
|
+
};
|
|
1585
|
+
};
|
|
1586
|
+
class le extends I {
|
|
1587
|
+
/**
|
|
1588
|
+
*
|
|
1589
|
+
* @summary Get all highlights
|
|
1590
|
+
* @param {number} [page]
|
|
1591
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1592
|
+
* @param {*} [options] Override http request option.
|
|
1593
|
+
* @throws {RequiredError}
|
|
1594
|
+
* @memberof HighlightApi
|
|
1595
|
+
*/
|
|
1596
|
+
getAllHighlights(t, e, a) {
|
|
1597
|
+
return E(this.configuration).getAllHighlights(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
*
|
|
1601
|
+
* @summary Get all highlights in a collection
|
|
1602
|
+
* @param {number} collectionId Collection ID
|
|
1603
|
+
* @param {number} [page]
|
|
1604
|
+
* @param {number} [perpage] How many highlights per page. 50 max. Default 25
|
|
1605
|
+
* @param {*} [options] Override http request option.
|
|
1606
|
+
* @throws {RequiredError}
|
|
1607
|
+
* @memberof HighlightApi
|
|
1608
|
+
*/
|
|
1609
|
+
getHighlightsInCollection(t, e, a, o) {
|
|
1610
|
+
return E(this.configuration).getHighlightsInCollection(t, e, a, o).then((r) => r(this.axios, this.basePath));
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
*
|
|
1614
|
+
* @summary Get raindrop
|
|
1615
|
+
* @param {number} id Existing raindrop ID
|
|
1616
|
+
* @param {*} [options] Override http request option.
|
|
1617
|
+
* @throws {RequiredError}
|
|
1618
|
+
* @memberof HighlightApi
|
|
1619
|
+
*/
|
|
1620
|
+
getRaindrop(t, e) {
|
|
1621
|
+
return E(this.configuration).getRaindrop(t, e).then((a) => a(this.axios, this.basePath));
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
*
|
|
1625
|
+
* @summary Update raindrop
|
|
1626
|
+
* @param {number} id Existing raindrop ID
|
|
1627
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
1628
|
+
* @param {*} [options] Override http request option.
|
|
1629
|
+
* @throws {RequiredError}
|
|
1630
|
+
* @memberof HighlightApi
|
|
1631
|
+
*/
|
|
1632
|
+
updateRaindrop(t, e, a) {
|
|
1633
|
+
return E(this.configuration).updateRaindrop(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
const ie = function(s) {
|
|
1637
|
+
return {
|
|
1638
|
+
/**
|
|
1639
|
+
* Does specified URL\'s are already saved?
|
|
1640
|
+
* @summary Check URL(s) existence
|
|
1641
|
+
* @param {CheckURLsExistRequest} [checkURLsExistRequest]
|
|
1642
|
+
* @param {*} [options] Override http request option.
|
|
1643
|
+
* @throws {RequiredError}
|
|
1644
|
+
*/
|
|
1645
|
+
checkURLsExist: async (t, e = {}) => {
|
|
1646
|
+
const a = "/rest/v1/import/url/exists", o = new URL(a, m);
|
|
1647
|
+
let r;
|
|
1648
|
+
s && (r = s.baseOptions);
|
|
1649
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
1650
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
1651
|
+
let c = r && r.headers ? r.headers : {};
|
|
1652
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
1653
|
+
url: O(o),
|
|
1654
|
+
options: n
|
|
1655
|
+
};
|
|
1656
|
+
},
|
|
1657
|
+
/**
|
|
1658
|
+
* Convert HTML bookmark file to JSON. Support Nestcape, Pocket and Instapaper file formats
|
|
1659
|
+
* @summary Parse HTML import file
|
|
1660
|
+
* @param {File} [_import] File
|
|
1661
|
+
* @param {*} [options] Override http request option.
|
|
1662
|
+
* @throws {RequiredError}
|
|
1663
|
+
*/
|
|
1664
|
+
importHTMLBookmarkFile: async (t, e = {}) => {
|
|
1665
|
+
const a = "/rest/v1/import/file", o = new URL(a, m);
|
|
1666
|
+
let r;
|
|
1667
|
+
s && (r = s.baseOptions);
|
|
1668
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {}, c = new (s && s.formDataCtor || FormData)();
|
|
1669
|
+
await v(l, s), t !== void 0 && c.append("import", t), l["Content-Type"] = "multipart/form-data", C(o, i);
|
|
1670
|
+
let d = r && r.headers ? r.headers : {};
|
|
1671
|
+
return n.headers = { ...l, ...d, ...e.headers }, n.data = c, {
|
|
1672
|
+
url: O(o),
|
|
1673
|
+
options: n
|
|
1674
|
+
};
|
|
1675
|
+
},
|
|
1676
|
+
/**
|
|
1677
|
+
* Parse and extract useful info from any URL
|
|
1678
|
+
* @summary Parse URL
|
|
1679
|
+
* @param {string} [url] URL
|
|
1680
|
+
* @param {*} [options] Override http request option.
|
|
1681
|
+
* @throws {RequiredError}
|
|
1682
|
+
*/
|
|
1683
|
+
parseURL: async (t, e = {}) => {
|
|
1684
|
+
const a = "/rest/v1/import/url/parse", o = new URL(a, m);
|
|
1685
|
+
let r;
|
|
1686
|
+
s && (r = s.baseOptions);
|
|
1687
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
1688
|
+
await v(l, s), t !== void 0 && (i.url = t), C(o, i);
|
|
1689
|
+
let c = r && r.headers ? r.headers : {};
|
|
1690
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
1691
|
+
url: O(o),
|
|
1692
|
+
options: n
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
}, f = function(s) {
|
|
1697
|
+
const t = ie(s);
|
|
1698
|
+
return {
|
|
1699
|
+
/**
|
|
1700
|
+
* Does specified URL\'s are already saved?
|
|
1701
|
+
* @summary Check URL(s) existence
|
|
1702
|
+
* @param {CheckURLsExistRequest} [checkURLsExistRequest]
|
|
1703
|
+
* @param {*} [options] Override http request option.
|
|
1704
|
+
* @throws {RequiredError}
|
|
1705
|
+
*/
|
|
1706
|
+
async checkURLsExist(e, a) {
|
|
1707
|
+
const o = await t.checkURLsExist(e, a), r = s?.serverIndex ?? 0, n = u["ImportApi.checkURLsExist"]?.[r]?.url;
|
|
1708
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
1709
|
+
},
|
|
1710
|
+
/**
|
|
1711
|
+
* Convert HTML bookmark file to JSON. Support Nestcape, Pocket and Instapaper file formats
|
|
1712
|
+
* @summary Parse HTML import file
|
|
1713
|
+
* @param {File} [_import] File
|
|
1714
|
+
* @param {*} [options] Override http request option.
|
|
1715
|
+
* @throws {RequiredError}
|
|
1716
|
+
*/
|
|
1717
|
+
async importHTMLBookmarkFile(e, a) {
|
|
1718
|
+
const o = await t.importHTMLBookmarkFile(e, a), r = s?.serverIndex ?? 0, n = u["ImportApi.importHTMLBookmarkFile"]?.[r]?.url;
|
|
1719
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
1720
|
+
},
|
|
1721
|
+
/**
|
|
1722
|
+
* Parse and extract useful info from any URL
|
|
1723
|
+
* @summary Parse URL
|
|
1724
|
+
* @param {string} [url] URL
|
|
1725
|
+
* @param {*} [options] Override http request option.
|
|
1726
|
+
* @throws {RequiredError}
|
|
1727
|
+
*/
|
|
1728
|
+
async parseURL(e, a) {
|
|
1729
|
+
const o = await t.parseURL(e, a), r = s?.serverIndex ?? 0, n = u["ImportApi.parseURL"]?.[r]?.url;
|
|
1730
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
}, Ye = function(s, t, e) {
|
|
1734
|
+
const a = f(s);
|
|
1735
|
+
return {
|
|
1736
|
+
/**
|
|
1737
|
+
* Does specified URL\'s are already saved?
|
|
1738
|
+
* @summary Check URL(s) existence
|
|
1739
|
+
* @param {CheckURLsExistRequest} [checkURLsExistRequest]
|
|
1740
|
+
* @param {*} [options] Override http request option.
|
|
1741
|
+
* @throws {RequiredError}
|
|
1742
|
+
*/
|
|
1743
|
+
checkURLsExist(o, r) {
|
|
1744
|
+
return a.checkURLsExist(o, r).then((n) => n(e, t));
|
|
1745
|
+
},
|
|
1746
|
+
/**
|
|
1747
|
+
* Convert HTML bookmark file to JSON. Support Nestcape, Pocket and Instapaper file formats
|
|
1748
|
+
* @summary Parse HTML import file
|
|
1749
|
+
* @param {File} [_import] File
|
|
1750
|
+
* @param {*} [options] Override http request option.
|
|
1751
|
+
* @throws {RequiredError}
|
|
1752
|
+
*/
|
|
1753
|
+
importHTMLBookmarkFile(o, r) {
|
|
1754
|
+
return a.importHTMLBookmarkFile(o, r).then((n) => n(e, t));
|
|
1755
|
+
},
|
|
1756
|
+
/**
|
|
1757
|
+
* Parse and extract useful info from any URL
|
|
1758
|
+
* @summary Parse URL
|
|
1759
|
+
* @param {string} [url] URL
|
|
1760
|
+
* @param {*} [options] Override http request option.
|
|
1761
|
+
* @throws {RequiredError}
|
|
1762
|
+
*/
|
|
1763
|
+
parseURL(o, r) {
|
|
1764
|
+
return a.parseURL(o, r).then((n) => n(e, t));
|
|
1765
|
+
}
|
|
1766
|
+
};
|
|
1767
|
+
};
|
|
1768
|
+
class ce extends I {
|
|
1769
|
+
/**
|
|
1770
|
+
* Does specified URL\'s are already saved?
|
|
1771
|
+
* @summary Check URL(s) existence
|
|
1772
|
+
* @param {CheckURLsExistRequest} [checkURLsExistRequest]
|
|
1773
|
+
* @param {*} [options] Override http request option.
|
|
1774
|
+
* @throws {RequiredError}
|
|
1775
|
+
* @memberof ImportApi
|
|
1776
|
+
*/
|
|
1777
|
+
checkURLsExist(t, e) {
|
|
1778
|
+
return f(this.configuration).checkURLsExist(t, e).then((a) => a(this.axios, this.basePath));
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Convert HTML bookmark file to JSON. Support Nestcape, Pocket and Instapaper file formats
|
|
1782
|
+
* @summary Parse HTML import file
|
|
1783
|
+
* @param {File} [_import] File
|
|
1784
|
+
* @param {*} [options] Override http request option.
|
|
1785
|
+
* @throws {RequiredError}
|
|
1786
|
+
* @memberof ImportApi
|
|
1787
|
+
*/
|
|
1788
|
+
importHTMLBookmarkFile(t, e) {
|
|
1789
|
+
return f(this.configuration).importHTMLBookmarkFile(t, e).then((a) => a(this.axios, this.basePath));
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Parse and extract useful info from any URL
|
|
1793
|
+
* @summary Parse URL
|
|
1794
|
+
* @param {string} [url] URL
|
|
1795
|
+
* @param {*} [options] Override http request option.
|
|
1796
|
+
* @throws {RequiredError}
|
|
1797
|
+
* @memberof ImportApi
|
|
1798
|
+
*/
|
|
1799
|
+
parseURL(t, e) {
|
|
1800
|
+
return f(this.configuration).parseURL(t, e).then((a) => a(this.axios, this.basePath));
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
const de = function(s) {
|
|
1804
|
+
return {
|
|
1805
|
+
/**
|
|
1806
|
+
*
|
|
1807
|
+
* @summary Create raindrop
|
|
1808
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
1809
|
+
* @param {*} [options] Override http request option.
|
|
1810
|
+
* @throws {RequiredError}
|
|
1811
|
+
*/
|
|
1812
|
+
createRaindrop: async (t, e = {}) => {
|
|
1813
|
+
const a = "/rest/v1/raindrop", o = new URL(a, m);
|
|
1814
|
+
let r;
|
|
1815
|
+
s && (r = s.baseOptions);
|
|
1816
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
1817
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
1818
|
+
let c = r && r.headers ? r.headers : {};
|
|
1819
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
1820
|
+
url: O(o),
|
|
1821
|
+
options: n
|
|
1822
|
+
};
|
|
1823
|
+
},
|
|
1824
|
+
/**
|
|
1825
|
+
*
|
|
1826
|
+
* @summary Create many raindrops
|
|
1827
|
+
* @param {CreateRaindropsRequest} [createRaindropsRequest]
|
|
1828
|
+
* @param {*} [options] Override http request option.
|
|
1829
|
+
* @throws {RequiredError}
|
|
1830
|
+
*/
|
|
1831
|
+
createRaindrops: async (t, e = {}) => {
|
|
1832
|
+
const a = "/rest/v1/raindrops", o = new URL(a, m);
|
|
1833
|
+
let r;
|
|
1834
|
+
s && (r = s.baseOptions);
|
|
1835
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
1836
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
1837
|
+
let c = r && r.headers ? r.headers : {};
|
|
1838
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
1839
|
+
url: O(o),
|
|
1840
|
+
options: n
|
|
1841
|
+
};
|
|
1842
|
+
},
|
|
1843
|
+
/**
|
|
1844
|
+
* Links permanently saved with all content (only in PRO plan). Using this method you can navigate to this copy.
|
|
1845
|
+
* @summary Get permanent copy
|
|
1846
|
+
* @param {number} id Existing raindrop ID
|
|
1847
|
+
* @param {*} [options] Override http request option.
|
|
1848
|
+
* @throws {RequiredError}
|
|
1849
|
+
*/
|
|
1850
|
+
getPermanentCopy: async (t, e = {}) => {
|
|
1851
|
+
P("getPermanentCopy", "id", t);
|
|
1852
|
+
const a = "/rest/v1/raindrop/{id}/cache".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
1853
|
+
let r;
|
|
1854
|
+
s && (r = s.baseOptions);
|
|
1855
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
1856
|
+
await v(l, s), C(o, i);
|
|
1857
|
+
let c = r && r.headers ? r.headers : {};
|
|
1858
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
1859
|
+
url: O(o),
|
|
1860
|
+
options: n
|
|
1861
|
+
};
|
|
1862
|
+
},
|
|
1863
|
+
/**
|
|
1864
|
+
*
|
|
1865
|
+
* @summary Get raindrop
|
|
1866
|
+
* @param {number} id Existing raindrop ID
|
|
1867
|
+
* @param {*} [options] Override http request option.
|
|
1868
|
+
* @throws {RequiredError}
|
|
1869
|
+
*/
|
|
1870
|
+
getRaindrop: async (t, e = {}) => {
|
|
1871
|
+
P("getRaindrop", "id", t);
|
|
1872
|
+
const a = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
1873
|
+
let r;
|
|
1874
|
+
s && (r = s.baseOptions);
|
|
1875
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
1876
|
+
await v(l, s), C(o, i);
|
|
1877
|
+
let c = r && r.headers ? r.headers : {};
|
|
1878
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
1879
|
+
url: O(o),
|
|
1880
|
+
options: n
|
|
1881
|
+
};
|
|
1882
|
+
},
|
|
1883
|
+
/**
|
|
1884
|
+
*
|
|
1885
|
+
* @summary Get raindrops
|
|
1886
|
+
* @param {number} collectionId Collection ID
|
|
1887
|
+
* @param {string} [sort]
|
|
1888
|
+
* @param {number} [perpage]
|
|
1889
|
+
* @param {number} [page]
|
|
1890
|
+
* @param {string} [search]
|
|
1891
|
+
* @param {*} [options] Override http request option.
|
|
1892
|
+
* @throws {RequiredError}
|
|
1893
|
+
*/
|
|
1894
|
+
getRaindrops: async (t, e, a, o, r, n = {}) => {
|
|
1895
|
+
P("getRaindrops", "collectionId", t);
|
|
1896
|
+
const l = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), i = new URL(l, m);
|
|
1897
|
+
let c;
|
|
1898
|
+
s && (c = s.baseOptions);
|
|
1899
|
+
const d = { method: "GET", ...c, ...n }, V = {}, y = {};
|
|
1900
|
+
await v(V, s), e !== void 0 && (y.sort = e), a !== void 0 && (y.perpage = a), o !== void 0 && (y.page = o), r !== void 0 && (y.search = r), C(i, y);
|
|
1901
|
+
let x = c && c.headers ? c.headers : {};
|
|
1902
|
+
return d.headers = { ...V, ...x, ...n.headers }, {
|
|
1903
|
+
url: O(i),
|
|
1904
|
+
options: d
|
|
1905
|
+
};
|
|
1906
|
+
},
|
|
1907
|
+
/**
|
|
1908
|
+
* When you remove raindrop it will be moved to user Trash collection. But if you try to remove raindrop from Trash, it will be removed permanently.
|
|
1909
|
+
* @summary Remove raindrop
|
|
1910
|
+
* @param {number} id Existing raindrop ID
|
|
1911
|
+
* @param {*} [options] Override http request option.
|
|
1912
|
+
* @throws {RequiredError}
|
|
1913
|
+
*/
|
|
1914
|
+
removeRaindrop: async (t, e = {}) => {
|
|
1915
|
+
P("removeRaindrop", "id", t);
|
|
1916
|
+
const a = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
1917
|
+
let r;
|
|
1918
|
+
s && (r = s.baseOptions);
|
|
1919
|
+
const n = { method: "DELETE", ...r, ...e }, l = {}, i = {};
|
|
1920
|
+
await v(l, s), C(o, i);
|
|
1921
|
+
let c = r && r.headers ? r.headers : {};
|
|
1922
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
1923
|
+
url: O(o),
|
|
1924
|
+
options: n
|
|
1925
|
+
};
|
|
1926
|
+
},
|
|
1927
|
+
/**
|
|
1928
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be moved to \"Trash\" When :collectionId is -99, raindrops will be permanently removed!
|
|
1929
|
+
* @summary Remove many raindrops
|
|
1930
|
+
* @param {number} collectionId Collection ID
|
|
1931
|
+
* @param {string} [search]
|
|
1932
|
+
* @param {RemoveRaindropsRequest} [removeRaindropsRequest]
|
|
1933
|
+
* @param {*} [options] Override http request option.
|
|
1934
|
+
* @throws {RequiredError}
|
|
1935
|
+
*/
|
|
1936
|
+
removeRaindrops: async (t, e, a, o = {}) => {
|
|
1937
|
+
P("removeRaindrops", "collectionId", t);
|
|
1938
|
+
const r = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), n = new URL(r, m);
|
|
1939
|
+
let l;
|
|
1940
|
+
s && (l = s.baseOptions);
|
|
1941
|
+
const i = { method: "DELETE", ...l, ...o }, c = {}, d = {};
|
|
1942
|
+
await v(c, s), e !== void 0 && (d.search = e), c["Content-Type"] = "application/json", C(n, d);
|
|
1943
|
+
let V = l && l.headers ? l.headers : {};
|
|
1944
|
+
return i.headers = { ...c, ...V, ...o.headers }, i.data = b(a, i, s), {
|
|
1945
|
+
url: O(n),
|
|
1946
|
+
options: i
|
|
1947
|
+
};
|
|
1948
|
+
},
|
|
1949
|
+
/**
|
|
1950
|
+
*
|
|
1951
|
+
* @summary Suggest collection and tags for existing bookmark
|
|
1952
|
+
* @param {number} id Bookmark id
|
|
1953
|
+
* @param {*} [options] Override http request option.
|
|
1954
|
+
* @throws {RequiredError}
|
|
1955
|
+
*/
|
|
1956
|
+
suggestForExistingBookmark: async (t, e = {}) => {
|
|
1957
|
+
P("suggestForExistingBookmark", "id", t);
|
|
1958
|
+
const a = "/rest/v1/raindrop/{id}/suggest".replace("{id}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
1959
|
+
let r;
|
|
1960
|
+
s && (r = s.baseOptions);
|
|
1961
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
1962
|
+
await v(l, s), C(o, i);
|
|
1963
|
+
let c = r && r.headers ? r.headers : {};
|
|
1964
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
1965
|
+
url: O(o),
|
|
1966
|
+
options: n
|
|
1967
|
+
};
|
|
1968
|
+
},
|
|
1969
|
+
/**
|
|
1970
|
+
*
|
|
1971
|
+
* @summary Suggest collection and tags for new bookmark
|
|
1972
|
+
* @param {SuggestForNewBookmarkRequest} [suggestForNewBookmarkRequest]
|
|
1973
|
+
* @param {*} [options] Override http request option.
|
|
1974
|
+
* @throws {RequiredError}
|
|
1975
|
+
*/
|
|
1976
|
+
suggestForNewBookmark: async (t, e = {}) => {
|
|
1977
|
+
const a = "/rest/v1/raindrop/suggest", o = new URL(a, m);
|
|
1978
|
+
let r;
|
|
1979
|
+
s && (r = s.baseOptions);
|
|
1980
|
+
const n = { method: "POST", ...r, ...e }, l = {}, i = {};
|
|
1981
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
1982
|
+
let c = r && r.headers ? r.headers : {};
|
|
1983
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
1984
|
+
url: O(o),
|
|
1985
|
+
options: n
|
|
1986
|
+
};
|
|
1987
|
+
},
|
|
1988
|
+
/**
|
|
1989
|
+
*
|
|
1990
|
+
* @summary Update raindrop
|
|
1991
|
+
* @param {number} id Existing raindrop ID
|
|
1992
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
1993
|
+
* @param {*} [options] Override http request option.
|
|
1994
|
+
* @throws {RequiredError}
|
|
1995
|
+
*/
|
|
1996
|
+
updateRaindrop: async (t, e, a = {}) => {
|
|
1997
|
+
P("updateRaindrop", "id", t);
|
|
1998
|
+
const o = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
1999
|
+
let n;
|
|
2000
|
+
s && (n = s.baseOptions);
|
|
2001
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {};
|
|
2002
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
2003
|
+
let d = n && n.headers ? n.headers : {};
|
|
2004
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
2005
|
+
url: O(r),
|
|
2006
|
+
options: l
|
|
2007
|
+
};
|
|
2008
|
+
},
|
|
2009
|
+
/**
|
|
2010
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be updated. Possible fields that could be updated are described in \"Body Parameters\"
|
|
2011
|
+
* @summary Update many raindrops
|
|
2012
|
+
* @param {number} collectionId Collection ID
|
|
2013
|
+
* @param {UpdateRaindropsRequest} [updateRaindropsRequest]
|
|
2014
|
+
* @param {*} [options] Override http request option.
|
|
2015
|
+
* @throws {RequiredError}
|
|
2016
|
+
*/
|
|
2017
|
+
updateRaindrops: async (t, e, a = {}) => {
|
|
2018
|
+
P("updateRaindrops", "collectionId", t);
|
|
2019
|
+
const o = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
2020
|
+
let n;
|
|
2021
|
+
s && (n = s.baseOptions);
|
|
2022
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {};
|
|
2023
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
2024
|
+
let d = n && n.headers ? n.headers : {};
|
|
2025
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
2026
|
+
url: O(r),
|
|
2027
|
+
options: l
|
|
2028
|
+
};
|
|
2029
|
+
},
|
|
2030
|
+
/**
|
|
2031
|
+
* Make sure to send PUT request with [multipart/form-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#example) body
|
|
2032
|
+
* @summary Upload file
|
|
2033
|
+
* @param {File} [file] File
|
|
2034
|
+
* @param {number} [collectionId] Collection Id
|
|
2035
|
+
* @param {*} [options] Override http request option.
|
|
2036
|
+
* @throws {RequiredError}
|
|
2037
|
+
*/
|
|
2038
|
+
uploadFile: async (t, e, a = {}) => {
|
|
2039
|
+
const o = "/rest/v1/raindrop/file", r = new URL(o, m);
|
|
2040
|
+
let n;
|
|
2041
|
+
s && (n = s.baseOptions);
|
|
2042
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {}, d = new (s && s.formDataCtor || FormData)();
|
|
2043
|
+
await v(i, s), t !== void 0 && d.append("file", t), e !== void 0 && d.append("collectionId", e), i["Content-Type"] = "multipart/form-data", C(r, c);
|
|
2044
|
+
let V = n && n.headers ? n.headers : {};
|
|
2045
|
+
return l.headers = { ...i, ...V, ...a.headers }, l.data = d, {
|
|
2046
|
+
url: O(r),
|
|
2047
|
+
options: l
|
|
2048
|
+
};
|
|
2049
|
+
},
|
|
2050
|
+
/**
|
|
2051
|
+
* PNG, GIF or JPEG
|
|
2052
|
+
* @summary Upload cover
|
|
2053
|
+
* @param {number} id Existing raindrop ID
|
|
2054
|
+
* @param {File} [cover] File
|
|
2055
|
+
* @param {*} [options] Override http request option.
|
|
2056
|
+
* @throws {RequiredError}
|
|
2057
|
+
*/
|
|
2058
|
+
uploadRaindropCover: async (t, e, a = {}) => {
|
|
2059
|
+
P("uploadRaindropCover", "id", t);
|
|
2060
|
+
const o = "/rest/v1/raindrop/{id}/cover".replace("{id}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
2061
|
+
let n;
|
|
2062
|
+
s && (n = s.baseOptions);
|
|
2063
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {}, d = new (s && s.formDataCtor || FormData)();
|
|
2064
|
+
await v(i, s), e !== void 0 && d.append("cover", e), i["Content-Type"] = "multipart/form-data", C(r, c);
|
|
2065
|
+
let V = n && n.headers ? n.headers : {};
|
|
2066
|
+
return l.headers = { ...i, ...V, ...a.headers }, l.data = d, {
|
|
2067
|
+
url: O(r),
|
|
2068
|
+
options: l
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
}, g = function(s) {
|
|
2073
|
+
const t = de(s);
|
|
2074
|
+
return {
|
|
2075
|
+
/**
|
|
2076
|
+
*
|
|
2077
|
+
* @summary Create raindrop
|
|
2078
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
2079
|
+
* @param {*} [options] Override http request option.
|
|
2080
|
+
* @throws {RequiredError}
|
|
2081
|
+
*/
|
|
2082
|
+
async createRaindrop(e, a) {
|
|
2083
|
+
const o = await t.createRaindrop(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.createRaindrop"]?.[r]?.url;
|
|
2084
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2085
|
+
},
|
|
2086
|
+
/**
|
|
2087
|
+
*
|
|
2088
|
+
* @summary Create many raindrops
|
|
2089
|
+
* @param {CreateRaindropsRequest} [createRaindropsRequest]
|
|
2090
|
+
* @param {*} [options] Override http request option.
|
|
2091
|
+
* @throws {RequiredError}
|
|
2092
|
+
*/
|
|
2093
|
+
async createRaindrops(e, a) {
|
|
2094
|
+
const o = await t.createRaindrops(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.createRaindrops"]?.[r]?.url;
|
|
2095
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2096
|
+
},
|
|
2097
|
+
/**
|
|
2098
|
+
* Links permanently saved with all content (only in PRO plan). Using this method you can navigate to this copy.
|
|
2099
|
+
* @summary Get permanent copy
|
|
2100
|
+
* @param {number} id Existing raindrop ID
|
|
2101
|
+
* @param {*} [options] Override http request option.
|
|
2102
|
+
* @throws {RequiredError}
|
|
2103
|
+
*/
|
|
2104
|
+
async getPermanentCopy(e, a) {
|
|
2105
|
+
const o = await t.getPermanentCopy(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.getPermanentCopy"]?.[r]?.url;
|
|
2106
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2107
|
+
},
|
|
2108
|
+
/**
|
|
2109
|
+
*
|
|
2110
|
+
* @summary Get raindrop
|
|
2111
|
+
* @param {number} id Existing raindrop ID
|
|
2112
|
+
* @param {*} [options] Override http request option.
|
|
2113
|
+
* @throws {RequiredError}
|
|
2114
|
+
*/
|
|
2115
|
+
async getRaindrop(e, a) {
|
|
2116
|
+
const o = await t.getRaindrop(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.getRaindrop"]?.[r]?.url;
|
|
2117
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2118
|
+
},
|
|
2119
|
+
/**
|
|
2120
|
+
*
|
|
2121
|
+
* @summary Get raindrops
|
|
2122
|
+
* @param {number} collectionId Collection ID
|
|
2123
|
+
* @param {string} [sort]
|
|
2124
|
+
* @param {number} [perpage]
|
|
2125
|
+
* @param {number} [page]
|
|
2126
|
+
* @param {string} [search]
|
|
2127
|
+
* @param {*} [options] Override http request option.
|
|
2128
|
+
* @throws {RequiredError}
|
|
2129
|
+
*/
|
|
2130
|
+
async getRaindrops(e, a, o, r, n, l) {
|
|
2131
|
+
const i = await t.getRaindrops(e, a, o, r, n, l), c = s?.serverIndex ?? 0, d = u["RaindropApi.getRaindrops"]?.[c]?.url;
|
|
2132
|
+
return (V, y) => R(i, h, p, s)(V, d || y);
|
|
2133
|
+
},
|
|
2134
|
+
/**
|
|
2135
|
+
* When you remove raindrop it will be moved to user Trash collection. But if you try to remove raindrop from Trash, it will be removed permanently.
|
|
2136
|
+
* @summary Remove raindrop
|
|
2137
|
+
* @param {number} id Existing raindrop ID
|
|
2138
|
+
* @param {*} [options] Override http request option.
|
|
2139
|
+
* @throws {RequiredError}
|
|
2140
|
+
*/
|
|
2141
|
+
async removeRaindrop(e, a) {
|
|
2142
|
+
const o = await t.removeRaindrop(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.removeRaindrop"]?.[r]?.url;
|
|
2143
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2144
|
+
},
|
|
2145
|
+
/**
|
|
2146
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be moved to \"Trash\" When :collectionId is -99, raindrops will be permanently removed!
|
|
2147
|
+
* @summary Remove many raindrops
|
|
2148
|
+
* @param {number} collectionId Collection ID
|
|
2149
|
+
* @param {string} [search]
|
|
2150
|
+
* @param {RemoveRaindropsRequest} [removeRaindropsRequest]
|
|
2151
|
+
* @param {*} [options] Override http request option.
|
|
2152
|
+
* @throws {RequiredError}
|
|
2153
|
+
*/
|
|
2154
|
+
async removeRaindrops(e, a, o, r) {
|
|
2155
|
+
const n = await t.removeRaindrops(e, a, o, r), l = s?.serverIndex ?? 0, i = u["RaindropApi.removeRaindrops"]?.[l]?.url;
|
|
2156
|
+
return (c, d) => R(n, h, p, s)(c, i || d);
|
|
2157
|
+
},
|
|
2158
|
+
/**
|
|
2159
|
+
*
|
|
2160
|
+
* @summary Suggest collection and tags for existing bookmark
|
|
2161
|
+
* @param {number} id Bookmark id
|
|
2162
|
+
* @param {*} [options] Override http request option.
|
|
2163
|
+
* @throws {RequiredError}
|
|
2164
|
+
*/
|
|
2165
|
+
async suggestForExistingBookmark(e, a) {
|
|
2166
|
+
const o = await t.suggestForExistingBookmark(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.suggestForExistingBookmark"]?.[r]?.url;
|
|
2167
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2168
|
+
},
|
|
2169
|
+
/**
|
|
2170
|
+
*
|
|
2171
|
+
* @summary Suggest collection and tags for new bookmark
|
|
2172
|
+
* @param {SuggestForNewBookmarkRequest} [suggestForNewBookmarkRequest]
|
|
2173
|
+
* @param {*} [options] Override http request option.
|
|
2174
|
+
* @throws {RequiredError}
|
|
2175
|
+
*/
|
|
2176
|
+
async suggestForNewBookmark(e, a) {
|
|
2177
|
+
const o = await t.suggestForNewBookmark(e, a), r = s?.serverIndex ?? 0, n = u["RaindropApi.suggestForNewBookmark"]?.[r]?.url;
|
|
2178
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2179
|
+
},
|
|
2180
|
+
/**
|
|
2181
|
+
*
|
|
2182
|
+
* @summary Update raindrop
|
|
2183
|
+
* @param {number} id Existing raindrop ID
|
|
2184
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
2185
|
+
* @param {*} [options] Override http request option.
|
|
2186
|
+
* @throws {RequiredError}
|
|
2187
|
+
*/
|
|
2188
|
+
async updateRaindrop(e, a, o) {
|
|
2189
|
+
const r = await t.updateRaindrop(e, a, o), n = s?.serverIndex ?? 0, l = u["RaindropApi.updateRaindrop"]?.[n]?.url;
|
|
2190
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
2191
|
+
},
|
|
2192
|
+
/**
|
|
2193
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be updated. Possible fields that could be updated are described in \"Body Parameters\"
|
|
2194
|
+
* @summary Update many raindrops
|
|
2195
|
+
* @param {number} collectionId Collection ID
|
|
2196
|
+
* @param {UpdateRaindropsRequest} [updateRaindropsRequest]
|
|
2197
|
+
* @param {*} [options] Override http request option.
|
|
2198
|
+
* @throws {RequiredError}
|
|
2199
|
+
*/
|
|
2200
|
+
async updateRaindrops(e, a, o) {
|
|
2201
|
+
const r = await t.updateRaindrops(e, a, o), n = s?.serverIndex ?? 0, l = u["RaindropApi.updateRaindrops"]?.[n]?.url;
|
|
2202
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
2203
|
+
},
|
|
2204
|
+
/**
|
|
2205
|
+
* Make sure to send PUT request with [multipart/form-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#example) body
|
|
2206
|
+
* @summary Upload file
|
|
2207
|
+
* @param {File} [file] File
|
|
2208
|
+
* @param {number} [collectionId] Collection Id
|
|
2209
|
+
* @param {*} [options] Override http request option.
|
|
2210
|
+
* @throws {RequiredError}
|
|
2211
|
+
*/
|
|
2212
|
+
async uploadFile(e, a, o) {
|
|
2213
|
+
const r = await t.uploadFile(e, a, o), n = s?.serverIndex ?? 0, l = u["RaindropApi.uploadFile"]?.[n]?.url;
|
|
2214
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
2215
|
+
},
|
|
2216
|
+
/**
|
|
2217
|
+
* PNG, GIF or JPEG
|
|
2218
|
+
* @summary Upload cover
|
|
2219
|
+
* @param {number} id Existing raindrop ID
|
|
2220
|
+
* @param {File} [cover] File
|
|
2221
|
+
* @param {*} [options] Override http request option.
|
|
2222
|
+
* @throws {RequiredError}
|
|
2223
|
+
*/
|
|
2224
|
+
async uploadRaindropCover(e, a, o) {
|
|
2225
|
+
const r = await t.uploadRaindropCover(e, a, o), n = s?.serverIndex ?? 0, l = u["RaindropApi.uploadRaindropCover"]?.[n]?.url;
|
|
2226
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
2227
|
+
}
|
|
2228
|
+
};
|
|
2229
|
+
}, Ke = function(s, t, e) {
|
|
2230
|
+
const a = g(s);
|
|
2231
|
+
return {
|
|
2232
|
+
/**
|
|
2233
|
+
*
|
|
2234
|
+
* @summary Create raindrop
|
|
2235
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
2236
|
+
* @param {*} [options] Override http request option.
|
|
2237
|
+
* @throws {RequiredError}
|
|
2238
|
+
*/
|
|
2239
|
+
createRaindrop(o, r) {
|
|
2240
|
+
return a.createRaindrop(o, r).then((n) => n(e, t));
|
|
2241
|
+
},
|
|
2242
|
+
/**
|
|
2243
|
+
*
|
|
2244
|
+
* @summary Create many raindrops
|
|
2245
|
+
* @param {CreateRaindropsRequest} [createRaindropsRequest]
|
|
2246
|
+
* @param {*} [options] Override http request option.
|
|
2247
|
+
* @throws {RequiredError}
|
|
2248
|
+
*/
|
|
2249
|
+
createRaindrops(o, r) {
|
|
2250
|
+
return a.createRaindrops(o, r).then((n) => n(e, t));
|
|
2251
|
+
},
|
|
2252
|
+
/**
|
|
2253
|
+
* Links permanently saved with all content (only in PRO plan). Using this method you can navigate to this copy.
|
|
2254
|
+
* @summary Get permanent copy
|
|
2255
|
+
* @param {number} id Existing raindrop ID
|
|
2256
|
+
* @param {*} [options] Override http request option.
|
|
2257
|
+
* @throws {RequiredError}
|
|
2258
|
+
*/
|
|
2259
|
+
getPermanentCopy(o, r) {
|
|
2260
|
+
return a.getPermanentCopy(o, r).then((n) => n(e, t));
|
|
2261
|
+
},
|
|
2262
|
+
/**
|
|
2263
|
+
*
|
|
2264
|
+
* @summary Get raindrop
|
|
2265
|
+
* @param {number} id Existing raindrop ID
|
|
2266
|
+
* @param {*} [options] Override http request option.
|
|
2267
|
+
* @throws {RequiredError}
|
|
2268
|
+
*/
|
|
2269
|
+
getRaindrop(o, r) {
|
|
2270
|
+
return a.getRaindrop(o, r).then((n) => n(e, t));
|
|
2271
|
+
},
|
|
2272
|
+
/**
|
|
2273
|
+
*
|
|
2274
|
+
* @summary Get raindrops
|
|
2275
|
+
* @param {number} collectionId Collection ID
|
|
2276
|
+
* @param {string} [sort]
|
|
2277
|
+
* @param {number} [perpage]
|
|
2278
|
+
* @param {number} [page]
|
|
2279
|
+
* @param {string} [search]
|
|
2280
|
+
* @param {*} [options] Override http request option.
|
|
2281
|
+
* @throws {RequiredError}
|
|
2282
|
+
*/
|
|
2283
|
+
getRaindrops(o, r, n, l, i, c) {
|
|
2284
|
+
return a.getRaindrops(o, r, n, l, i, c).then((d) => d(e, t));
|
|
2285
|
+
},
|
|
2286
|
+
/**
|
|
2287
|
+
* When you remove raindrop it will be moved to user Trash collection. But if you try to remove raindrop from Trash, it will be removed permanently.
|
|
2288
|
+
* @summary Remove raindrop
|
|
2289
|
+
* @param {number} id Existing raindrop ID
|
|
2290
|
+
* @param {*} [options] Override http request option.
|
|
2291
|
+
* @throws {RequiredError}
|
|
2292
|
+
*/
|
|
2293
|
+
removeRaindrop(o, r) {
|
|
2294
|
+
return a.removeRaindrop(o, r).then((n) => n(e, t));
|
|
2295
|
+
},
|
|
2296
|
+
/**
|
|
2297
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be moved to \"Trash\" When :collectionId is -99, raindrops will be permanently removed!
|
|
2298
|
+
* @summary Remove many raindrops
|
|
2299
|
+
* @param {number} collectionId Collection ID
|
|
2300
|
+
* @param {string} [search]
|
|
2301
|
+
* @param {RemoveRaindropsRequest} [removeRaindropsRequest]
|
|
2302
|
+
* @param {*} [options] Override http request option.
|
|
2303
|
+
* @throws {RequiredError}
|
|
2304
|
+
*/
|
|
2305
|
+
removeRaindrops(o, r, n, l) {
|
|
2306
|
+
return a.removeRaindrops(o, r, n, l).then((i) => i(e, t));
|
|
2307
|
+
},
|
|
2308
|
+
/**
|
|
2309
|
+
*
|
|
2310
|
+
* @summary Suggest collection and tags for existing bookmark
|
|
2311
|
+
* @param {number} id Bookmark id
|
|
2312
|
+
* @param {*} [options] Override http request option.
|
|
2313
|
+
* @throws {RequiredError}
|
|
2314
|
+
*/
|
|
2315
|
+
suggestForExistingBookmark(o, r) {
|
|
2316
|
+
return a.suggestForExistingBookmark(o, r).then((n) => n(e, t));
|
|
2317
|
+
},
|
|
2318
|
+
/**
|
|
2319
|
+
*
|
|
2320
|
+
* @summary Suggest collection and tags for new bookmark
|
|
2321
|
+
* @param {SuggestForNewBookmarkRequest} [suggestForNewBookmarkRequest]
|
|
2322
|
+
* @param {*} [options] Override http request option.
|
|
2323
|
+
* @throws {RequiredError}
|
|
2324
|
+
*/
|
|
2325
|
+
suggestForNewBookmark(o, r) {
|
|
2326
|
+
return a.suggestForNewBookmark(o, r).then((n) => n(e, t));
|
|
2327
|
+
},
|
|
2328
|
+
/**
|
|
2329
|
+
*
|
|
2330
|
+
* @summary Update raindrop
|
|
2331
|
+
* @param {number} id Existing raindrop ID
|
|
2332
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
2333
|
+
* @param {*} [options] Override http request option.
|
|
2334
|
+
* @throws {RequiredError}
|
|
2335
|
+
*/
|
|
2336
|
+
updateRaindrop(o, r, n) {
|
|
2337
|
+
return a.updateRaindrop(o, r, n).then((l) => l(e, t));
|
|
2338
|
+
},
|
|
2339
|
+
/**
|
|
2340
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be updated. Possible fields that could be updated are described in \"Body Parameters\"
|
|
2341
|
+
* @summary Update many raindrops
|
|
2342
|
+
* @param {number} collectionId Collection ID
|
|
2343
|
+
* @param {UpdateRaindropsRequest} [updateRaindropsRequest]
|
|
2344
|
+
* @param {*} [options] Override http request option.
|
|
2345
|
+
* @throws {RequiredError}
|
|
2346
|
+
*/
|
|
2347
|
+
updateRaindrops(o, r, n) {
|
|
2348
|
+
return a.updateRaindrops(o, r, n).then((l) => l(e, t));
|
|
2349
|
+
},
|
|
2350
|
+
/**
|
|
2351
|
+
* Make sure to send PUT request with [multipart/form-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#example) body
|
|
2352
|
+
* @summary Upload file
|
|
2353
|
+
* @param {File} [file] File
|
|
2354
|
+
* @param {number} [collectionId] Collection Id
|
|
2355
|
+
* @param {*} [options] Override http request option.
|
|
2356
|
+
* @throws {RequiredError}
|
|
2357
|
+
*/
|
|
2358
|
+
uploadFile(o, r, n) {
|
|
2359
|
+
return a.uploadFile(o, r, n).then((l) => l(e, t));
|
|
2360
|
+
},
|
|
2361
|
+
/**
|
|
2362
|
+
* PNG, GIF or JPEG
|
|
2363
|
+
* @summary Upload cover
|
|
2364
|
+
* @param {number} id Existing raindrop ID
|
|
2365
|
+
* @param {File} [cover] File
|
|
2366
|
+
* @param {*} [options] Override http request option.
|
|
2367
|
+
* @throws {RequiredError}
|
|
2368
|
+
*/
|
|
2369
|
+
uploadRaindropCover(o, r, n) {
|
|
2370
|
+
return a.uploadRaindropCover(o, r, n).then((l) => l(e, t));
|
|
2371
|
+
}
|
|
2372
|
+
};
|
|
2373
|
+
};
|
|
2374
|
+
let he = class extends I {
|
|
2375
|
+
/**
|
|
2376
|
+
*
|
|
2377
|
+
* @summary Create raindrop
|
|
2378
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
2379
|
+
* @param {*} [options] Override http request option.
|
|
2380
|
+
* @throws {RequiredError}
|
|
2381
|
+
* @memberof RaindropApi
|
|
2382
|
+
*/
|
|
2383
|
+
createRaindrop(t, e) {
|
|
2384
|
+
return g(this.configuration).createRaindrop(t, e).then((a) => a(this.axios, this.basePath));
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
*
|
|
2388
|
+
* @summary Create many raindrops
|
|
2389
|
+
* @param {CreateRaindropsRequest} [createRaindropsRequest]
|
|
2390
|
+
* @param {*} [options] Override http request option.
|
|
2391
|
+
* @throws {RequiredError}
|
|
2392
|
+
* @memberof RaindropApi
|
|
2393
|
+
*/
|
|
2394
|
+
createRaindrops(t, e) {
|
|
2395
|
+
return g(this.configuration).createRaindrops(t, e).then((a) => a(this.axios, this.basePath));
|
|
2396
|
+
}
|
|
2397
|
+
/**
|
|
2398
|
+
* Links permanently saved with all content (only in PRO plan). Using this method you can navigate to this copy.
|
|
2399
|
+
* @summary Get permanent copy
|
|
2400
|
+
* @param {number} id Existing raindrop ID
|
|
2401
|
+
* @param {*} [options] Override http request option.
|
|
2402
|
+
* @throws {RequiredError}
|
|
2403
|
+
* @memberof RaindropApi
|
|
2404
|
+
*/
|
|
2405
|
+
getPermanentCopy(t, e) {
|
|
2406
|
+
return g(this.configuration).getPermanentCopy(t, e).then((a) => a(this.axios, this.basePath));
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
*
|
|
2410
|
+
* @summary Get raindrop
|
|
2411
|
+
* @param {number} id Existing raindrop ID
|
|
2412
|
+
* @param {*} [options] Override http request option.
|
|
2413
|
+
* @throws {RequiredError}
|
|
2414
|
+
* @memberof RaindropApi
|
|
2415
|
+
*/
|
|
2416
|
+
getRaindrop(t, e) {
|
|
2417
|
+
return g(this.configuration).getRaindrop(t, e).then((a) => a(this.axios, this.basePath));
|
|
2418
|
+
}
|
|
2419
|
+
/**
|
|
2420
|
+
*
|
|
2421
|
+
* @summary Get raindrops
|
|
2422
|
+
* @param {number} collectionId Collection ID
|
|
2423
|
+
* @param {string} [sort]
|
|
2424
|
+
* @param {number} [perpage]
|
|
2425
|
+
* @param {number} [page]
|
|
2426
|
+
* @param {string} [search]
|
|
2427
|
+
* @param {*} [options] Override http request option.
|
|
2428
|
+
* @throws {RequiredError}
|
|
2429
|
+
* @memberof RaindropApi
|
|
2430
|
+
*/
|
|
2431
|
+
getRaindrops(t, e, a, o, r, n) {
|
|
2432
|
+
return g(this.configuration).getRaindrops(t, e, a, o, r, n).then((l) => l(this.axios, this.basePath));
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* When you remove raindrop it will be moved to user Trash collection. But if you try to remove raindrop from Trash, it will be removed permanently.
|
|
2436
|
+
* @summary Remove raindrop
|
|
2437
|
+
* @param {number} id Existing raindrop ID
|
|
2438
|
+
* @param {*} [options] Override http request option.
|
|
2439
|
+
* @throws {RequiredError}
|
|
2440
|
+
* @memberof RaindropApi
|
|
2441
|
+
*/
|
|
2442
|
+
removeRaindrop(t, e) {
|
|
2443
|
+
return g(this.configuration).removeRaindrop(t, e).then((a) => a(this.axios, this.basePath));
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be moved to \"Trash\" When :collectionId is -99, raindrops will be permanently removed!
|
|
2447
|
+
* @summary Remove many raindrops
|
|
2448
|
+
* @param {number} collectionId Collection ID
|
|
2449
|
+
* @param {string} [search]
|
|
2450
|
+
* @param {RemoveRaindropsRequest} [removeRaindropsRequest]
|
|
2451
|
+
* @param {*} [options] Override http request option.
|
|
2452
|
+
* @throws {RequiredError}
|
|
2453
|
+
* @memberof RaindropApi
|
|
2454
|
+
*/
|
|
2455
|
+
removeRaindrops(t, e, a, o) {
|
|
2456
|
+
return g(this.configuration).removeRaindrops(t, e, a, o).then((r) => r(this.axios, this.basePath));
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
*
|
|
2460
|
+
* @summary Suggest collection and tags for existing bookmark
|
|
2461
|
+
* @param {number} id Bookmark id
|
|
2462
|
+
* @param {*} [options] Override http request option.
|
|
2463
|
+
* @throws {RequiredError}
|
|
2464
|
+
* @memberof RaindropApi
|
|
2465
|
+
*/
|
|
2466
|
+
suggestForExistingBookmark(t, e) {
|
|
2467
|
+
return g(this.configuration).suggestForExistingBookmark(t, e).then((a) => a(this.axios, this.basePath));
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
*
|
|
2471
|
+
* @summary Suggest collection and tags for new bookmark
|
|
2472
|
+
* @param {SuggestForNewBookmarkRequest} [suggestForNewBookmarkRequest]
|
|
2473
|
+
* @param {*} [options] Override http request option.
|
|
2474
|
+
* @throws {RequiredError}
|
|
2475
|
+
* @memberof RaindropApi
|
|
2476
|
+
*/
|
|
2477
|
+
suggestForNewBookmark(t, e) {
|
|
2478
|
+
return g(this.configuration).suggestForNewBookmark(t, e).then((a) => a(this.axios, this.basePath));
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
*
|
|
2482
|
+
* @summary Update raindrop
|
|
2483
|
+
* @param {number} id Existing raindrop ID
|
|
2484
|
+
* @param {CreateRaindrop} [createRaindrop]
|
|
2485
|
+
* @param {*} [options] Override http request option.
|
|
2486
|
+
* @throws {RequiredError}
|
|
2487
|
+
* @memberof RaindropApi
|
|
2488
|
+
*/
|
|
2489
|
+
updateRaindrop(t, e, a) {
|
|
2490
|
+
return g(this.configuration).updateRaindrop(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Specify optional search and/or ids parameters to limit raindrops that will be updated. Possible fields that could be updated are described in \"Body Parameters\"
|
|
2494
|
+
* @summary Update many raindrops
|
|
2495
|
+
* @param {number} collectionId Collection ID
|
|
2496
|
+
* @param {UpdateRaindropsRequest} [updateRaindropsRequest]
|
|
2497
|
+
* @param {*} [options] Override http request option.
|
|
2498
|
+
* @throws {RequiredError}
|
|
2499
|
+
* @memberof RaindropApi
|
|
2500
|
+
*/
|
|
2501
|
+
updateRaindrops(t, e, a) {
|
|
2502
|
+
return g(this.configuration).updateRaindrops(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
2503
|
+
}
|
|
2504
|
+
/**
|
|
2505
|
+
* Make sure to send PUT request with [multipart/form-data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#example) body
|
|
2506
|
+
* @summary Upload file
|
|
2507
|
+
* @param {File} [file] File
|
|
2508
|
+
* @param {number} [collectionId] Collection Id
|
|
2509
|
+
* @param {*} [options] Override http request option.
|
|
2510
|
+
* @throws {RequiredError}
|
|
2511
|
+
* @memberof RaindropApi
|
|
2512
|
+
*/
|
|
2513
|
+
uploadFile(t, e, a) {
|
|
2514
|
+
return g(this.configuration).uploadFile(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* PNG, GIF or JPEG
|
|
2518
|
+
* @summary Upload cover
|
|
2519
|
+
* @param {number} id Existing raindrop ID
|
|
2520
|
+
* @param {File} [cover] File
|
|
2521
|
+
* @param {*} [options] Override http request option.
|
|
2522
|
+
* @throws {RequiredError}
|
|
2523
|
+
* @memberof RaindropApi
|
|
2524
|
+
*/
|
|
2525
|
+
uploadRaindropCover(t, e, a) {
|
|
2526
|
+
return g(this.configuration).uploadRaindropCover(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
const pe = function(s) {
|
|
2530
|
+
return {
|
|
2531
|
+
/**
|
|
2532
|
+
*
|
|
2533
|
+
* @summary Get tags
|
|
2534
|
+
* @param {number} [collectionId] Optional collection ID, when not specified all tags from all collections will be retrieved
|
|
2535
|
+
* @param {*} [options] Override http request option.
|
|
2536
|
+
* @throws {RequiredError}
|
|
2537
|
+
*/
|
|
2538
|
+
getTagsInCollection: async (t, e = {}) => {
|
|
2539
|
+
const a = "/rest/v1/tags/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
2540
|
+
let r;
|
|
2541
|
+
s && (r = s.baseOptions);
|
|
2542
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
2543
|
+
await v(l, s), C(o, i);
|
|
2544
|
+
let c = r && r.headers ? r.headers : {};
|
|
2545
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
2546
|
+
url: O(o),
|
|
2547
|
+
options: n
|
|
2548
|
+
};
|
|
2549
|
+
},
|
|
2550
|
+
/**
|
|
2551
|
+
*
|
|
2552
|
+
* @summary Remove tags
|
|
2553
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2554
|
+
* @param {RemoveTagsFromCollectionRequest} [removeTagsFromCollectionRequest]
|
|
2555
|
+
* @param {*} [options] Override http request option.
|
|
2556
|
+
* @throws {RequiredError}
|
|
2557
|
+
*/
|
|
2558
|
+
removeTagsFromCollection: async (t, e, a = {}) => {
|
|
2559
|
+
const o = "/rest/v1/tags/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
2560
|
+
let n;
|
|
2561
|
+
s && (n = s.baseOptions);
|
|
2562
|
+
const l = { method: "DELETE", ...n, ...a }, i = {}, c = {};
|
|
2563
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
2564
|
+
let d = n && n.headers ? n.headers : {};
|
|
2565
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
2566
|
+
url: O(r),
|
|
2567
|
+
options: l
|
|
2568
|
+
};
|
|
2569
|
+
},
|
|
2570
|
+
/**
|
|
2571
|
+
*
|
|
2572
|
+
* @summary Rename tag / Merge tags
|
|
2573
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2574
|
+
* @param {RenameOrMergeTagsRequest} [renameOrMergeTagsRequest]
|
|
2575
|
+
* @param {*} [options] Override http request option.
|
|
2576
|
+
* @throws {RequiredError}
|
|
2577
|
+
*/
|
|
2578
|
+
renameOrMergeTags: async (t, e, a = {}) => {
|
|
2579
|
+
const o = "/rest/v1/tags/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), r = new URL(o, m);
|
|
2580
|
+
let n;
|
|
2581
|
+
s && (n = s.baseOptions);
|
|
2582
|
+
const l = { method: "PUT", ...n, ...a }, i = {}, c = {};
|
|
2583
|
+
await v(i, s), i["Content-Type"] = "application/json", C(r, c);
|
|
2584
|
+
let d = n && n.headers ? n.headers : {};
|
|
2585
|
+
return l.headers = { ...i, ...d, ...a.headers }, l.data = b(e, l, s), {
|
|
2586
|
+
url: O(r),
|
|
2587
|
+
options: l
|
|
2588
|
+
};
|
|
2589
|
+
}
|
|
2590
|
+
};
|
|
2591
|
+
}, S = function(s) {
|
|
2592
|
+
const t = pe(s);
|
|
2593
|
+
return {
|
|
2594
|
+
/**
|
|
2595
|
+
*
|
|
2596
|
+
* @summary Get tags
|
|
2597
|
+
* @param {number} [collectionId] Optional collection ID, when not specified all tags from all collections will be retrieved
|
|
2598
|
+
* @param {*} [options] Override http request option.
|
|
2599
|
+
* @throws {RequiredError}
|
|
2600
|
+
*/
|
|
2601
|
+
async getTagsInCollection(e, a) {
|
|
2602
|
+
const o = await t.getTagsInCollection(e, a), r = s?.serverIndex ?? 0, n = u["TagApi.getTagsInCollection"]?.[r]?.url;
|
|
2603
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2604
|
+
},
|
|
2605
|
+
/**
|
|
2606
|
+
*
|
|
2607
|
+
* @summary Remove tags
|
|
2608
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2609
|
+
* @param {RemoveTagsFromCollectionRequest} [removeTagsFromCollectionRequest]
|
|
2610
|
+
* @param {*} [options] Override http request option.
|
|
2611
|
+
* @throws {RequiredError}
|
|
2612
|
+
*/
|
|
2613
|
+
async removeTagsFromCollection(e, a, o) {
|
|
2614
|
+
const r = await t.removeTagsFromCollection(e, a, o), n = s?.serverIndex ?? 0, l = u["TagApi.removeTagsFromCollection"]?.[n]?.url;
|
|
2615
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
2616
|
+
},
|
|
2617
|
+
/**
|
|
2618
|
+
*
|
|
2619
|
+
* @summary Rename tag / Merge tags
|
|
2620
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2621
|
+
* @param {RenameOrMergeTagsRequest} [renameOrMergeTagsRequest]
|
|
2622
|
+
* @param {*} [options] Override http request option.
|
|
2623
|
+
* @throws {RequiredError}
|
|
2624
|
+
*/
|
|
2625
|
+
async renameOrMergeTags(e, a, o) {
|
|
2626
|
+
const r = await t.renameOrMergeTags(e, a, o), n = s?.serverIndex ?? 0, l = u["TagApi.renameOrMergeTags"]?.[n]?.url;
|
|
2627
|
+
return (i, c) => R(r, h, p, s)(i, l || c);
|
|
2628
|
+
}
|
|
2629
|
+
};
|
|
2630
|
+
}, Xe = function(s, t, e) {
|
|
2631
|
+
const a = S(s);
|
|
2632
|
+
return {
|
|
2633
|
+
/**
|
|
2634
|
+
*
|
|
2635
|
+
* @summary Get tags
|
|
2636
|
+
* @param {number} [collectionId] Optional collection ID, when not specified all tags from all collections will be retrieved
|
|
2637
|
+
* @param {*} [options] Override http request option.
|
|
2638
|
+
* @throws {RequiredError}
|
|
2639
|
+
*/
|
|
2640
|
+
getTagsInCollection(o, r) {
|
|
2641
|
+
return a.getTagsInCollection(o, r).then((n) => n(e, t));
|
|
2642
|
+
},
|
|
2643
|
+
/**
|
|
2644
|
+
*
|
|
2645
|
+
* @summary Remove tags
|
|
2646
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2647
|
+
* @param {RemoveTagsFromCollectionRequest} [removeTagsFromCollectionRequest]
|
|
2648
|
+
* @param {*} [options] Override http request option.
|
|
2649
|
+
* @throws {RequiredError}
|
|
2650
|
+
*/
|
|
2651
|
+
removeTagsFromCollection(o, r, n) {
|
|
2652
|
+
return a.removeTagsFromCollection(o, r, n).then((l) => l(e, t));
|
|
2653
|
+
},
|
|
2654
|
+
/**
|
|
2655
|
+
*
|
|
2656
|
+
* @summary Rename tag / Merge tags
|
|
2657
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2658
|
+
* @param {RenameOrMergeTagsRequest} [renameOrMergeTagsRequest]
|
|
2659
|
+
* @param {*} [options] Override http request option.
|
|
2660
|
+
* @throws {RequiredError}
|
|
2661
|
+
*/
|
|
2662
|
+
renameOrMergeTags(o, r, n) {
|
|
2663
|
+
return a.renameOrMergeTags(o, r, n).then((l) => l(e, t));
|
|
2664
|
+
}
|
|
2665
|
+
};
|
|
2666
|
+
};
|
|
2667
|
+
class ue extends I {
|
|
2668
|
+
/**
|
|
2669
|
+
*
|
|
2670
|
+
* @summary Get tags
|
|
2671
|
+
* @param {number} [collectionId] Optional collection ID, when not specified all tags from all collections will be retrieved
|
|
2672
|
+
* @param {*} [options] Override http request option.
|
|
2673
|
+
* @throws {RequiredError}
|
|
2674
|
+
* @memberof TagApi
|
|
2675
|
+
*/
|
|
2676
|
+
getTagsInCollection(t, e) {
|
|
2677
|
+
return S(this.configuration).getTagsInCollection(t, e).then((a) => a(this.axios, this.basePath));
|
|
2678
|
+
}
|
|
2679
|
+
/**
|
|
2680
|
+
*
|
|
2681
|
+
* @summary Remove tags
|
|
2682
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2683
|
+
* @param {RemoveTagsFromCollectionRequest} [removeTagsFromCollectionRequest]
|
|
2684
|
+
* @param {*} [options] Override http request option.
|
|
2685
|
+
* @throws {RequiredError}
|
|
2686
|
+
* @memberof TagApi
|
|
2687
|
+
*/
|
|
2688
|
+
removeTagsFromCollection(t, e, a) {
|
|
2689
|
+
return S(this.configuration).removeTagsFromCollection(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
2692
|
+
*
|
|
2693
|
+
* @summary Rename tag / Merge tags
|
|
2694
|
+
* @param {number} [collectionId] It\'s possible to restrict rename action to just one collection. It\'s optional
|
|
2695
|
+
* @param {RenameOrMergeTagsRequest} [renameOrMergeTagsRequest]
|
|
2696
|
+
* @param {*} [options] Override http request option.
|
|
2697
|
+
* @throws {RequiredError}
|
|
2698
|
+
* @memberof TagApi
|
|
2699
|
+
*/
|
|
2700
|
+
renameOrMergeTags(t, e, a) {
|
|
2701
|
+
return S(this.configuration).renameOrMergeTags(t, e, a).then((o) => o(this.axios, this.basePath));
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
const me = function(s) {
|
|
2705
|
+
return {
|
|
2706
|
+
/**
|
|
2707
|
+
* Connect social network account as sign in authentication option
|
|
2708
|
+
* @summary Connect social network acount
|
|
2709
|
+
* @param {ConnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2710
|
+
* @param {*} [options] Override http request option.
|
|
2711
|
+
* @throws {RequiredError}
|
|
2712
|
+
*/
|
|
2713
|
+
connectSocialNetworkProvider: async (t, e = {}) => {
|
|
2714
|
+
P("connectSocialNetworkProvider", "provider", t);
|
|
2715
|
+
const a = "/rest/v1/user/connect/{provider}".replace("{provider}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
2716
|
+
let r;
|
|
2717
|
+
s && (r = s.baseOptions);
|
|
2718
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
2719
|
+
await v(l, s), C(o, i);
|
|
2720
|
+
let c = r && r.headers ? r.headers : {};
|
|
2721
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
2722
|
+
url: O(o),
|
|
2723
|
+
options: n
|
|
2724
|
+
};
|
|
2725
|
+
},
|
|
2726
|
+
/**
|
|
2727
|
+
* Disconnect social network account from available authentication options
|
|
2728
|
+
* @summary Disconnect social network account
|
|
2729
|
+
* @param {DisconnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2730
|
+
* @param {*} [options] Override http request option.
|
|
2731
|
+
* @throws {RequiredError}
|
|
2732
|
+
*/
|
|
2733
|
+
disconnectSocialNetworkProvider: async (t, e = {}) => {
|
|
2734
|
+
P("disconnectSocialNetworkProvider", "provider", t);
|
|
2735
|
+
const a = "/rest/v1/user/connect/{provider}/revoke".replace("{provider}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
2736
|
+
let r;
|
|
2737
|
+
s && (r = s.baseOptions);
|
|
2738
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
2739
|
+
await v(l, s), C(o, i);
|
|
2740
|
+
let c = r && r.headers ? r.headers : {};
|
|
2741
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
2742
|
+
url: O(o),
|
|
2743
|
+
options: n
|
|
2744
|
+
};
|
|
2745
|
+
},
|
|
2746
|
+
/**
|
|
2747
|
+
* Get currently authenticated user details
|
|
2748
|
+
* @summary Get user
|
|
2749
|
+
* @param {*} [options] Override http request option.
|
|
2750
|
+
* @throws {RequiredError}
|
|
2751
|
+
*/
|
|
2752
|
+
getCurrentUser: async (t = {}) => {
|
|
2753
|
+
const e = "/rest/v1/user", a = new URL(e, m);
|
|
2754
|
+
let o;
|
|
2755
|
+
s && (o = s.baseOptions);
|
|
2756
|
+
const r = { method: "GET", ...o, ...t }, n = {}, l = {};
|
|
2757
|
+
await v(n, s), C(a, l);
|
|
2758
|
+
let i = o && o.headers ? o.headers : {};
|
|
2759
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
2760
|
+
url: O(a),
|
|
2761
|
+
options: r
|
|
2762
|
+
};
|
|
2763
|
+
},
|
|
2764
|
+
/**
|
|
2765
|
+
* Get\'s publicly available user details
|
|
2766
|
+
* @summary Get user by name
|
|
2767
|
+
* @param {number} name Username
|
|
2768
|
+
* @param {*} [options] Override http request option.
|
|
2769
|
+
* @throws {RequiredError}
|
|
2770
|
+
*/
|
|
2771
|
+
getPublicUserByName: async (t, e = {}) => {
|
|
2772
|
+
P("getPublicUserByName", "name", t);
|
|
2773
|
+
const a = "/rest/v1/user/{name}".replace("{name}", encodeURIComponent(String(t))), o = new URL(a, m);
|
|
2774
|
+
let r;
|
|
2775
|
+
s && (r = s.baseOptions);
|
|
2776
|
+
const n = { method: "GET", ...r, ...e }, l = {}, i = {};
|
|
2777
|
+
await v(l, s), C(o, i);
|
|
2778
|
+
let c = r && r.headers ? r.headers : {};
|
|
2779
|
+
return n.headers = { ...l, ...c, ...e.headers }, {
|
|
2780
|
+
url: O(o),
|
|
2781
|
+
options: n
|
|
2782
|
+
};
|
|
2783
|
+
},
|
|
2784
|
+
/**
|
|
2785
|
+
*
|
|
2786
|
+
* @summary Get system collections count
|
|
2787
|
+
* @param {*} [options] Override http request option.
|
|
2788
|
+
* @throws {RequiredError}
|
|
2789
|
+
*/
|
|
2790
|
+
getSystemCollectionStats: async (t = {}) => {
|
|
2791
|
+
const e = "/rest/v1/user/stats", a = new URL(e, m);
|
|
2792
|
+
let o;
|
|
2793
|
+
s && (o = s.baseOptions);
|
|
2794
|
+
const r = { method: "GET", ...o, ...t }, n = {}, l = {};
|
|
2795
|
+
await v(n, s), C(a, l);
|
|
2796
|
+
let i = o && o.headers ? o.headers : {};
|
|
2797
|
+
return r.headers = { ...n, ...i, ...t.headers }, {
|
|
2798
|
+
url: O(a),
|
|
2799
|
+
options: r
|
|
2800
|
+
};
|
|
2801
|
+
},
|
|
2802
|
+
/**
|
|
2803
|
+
* To change email, config, password, etc... you can do it from single endpoint
|
|
2804
|
+
* @summary Update user
|
|
2805
|
+
* @param {UpdateCurrentUserRequest} [updateCurrentUserRequest]
|
|
2806
|
+
* @param {*} [options] Override http request option.
|
|
2807
|
+
* @throws {RequiredError}
|
|
2808
|
+
*/
|
|
2809
|
+
updateCurrentUser: async (t, e = {}) => {
|
|
2810
|
+
const a = "/rest/v1/user", o = new URL(a, m);
|
|
2811
|
+
let r;
|
|
2812
|
+
s && (r = s.baseOptions);
|
|
2813
|
+
const n = { method: "PUT", ...r, ...e }, l = {}, i = {};
|
|
2814
|
+
await v(l, s), l["Content-Type"] = "application/json", C(o, i);
|
|
2815
|
+
let c = r && r.headers ? r.headers : {};
|
|
2816
|
+
return n.headers = { ...l, ...c, ...e.headers }, n.data = b(t, n, s), {
|
|
2817
|
+
url: O(o),
|
|
2818
|
+
options: n
|
|
2819
|
+
};
|
|
2820
|
+
}
|
|
2821
|
+
};
|
|
2822
|
+
}, T = function(s) {
|
|
2823
|
+
const t = me(s);
|
|
2824
|
+
return {
|
|
2825
|
+
/**
|
|
2826
|
+
* Connect social network account as sign in authentication option
|
|
2827
|
+
* @summary Connect social network acount
|
|
2828
|
+
* @param {ConnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2829
|
+
* @param {*} [options] Override http request option.
|
|
2830
|
+
* @throws {RequiredError}
|
|
2831
|
+
*/
|
|
2832
|
+
async connectSocialNetworkProvider(e, a) {
|
|
2833
|
+
const o = await t.connectSocialNetworkProvider(e, a), r = s?.serverIndex ?? 0, n = u["UserApi.connectSocialNetworkProvider"]?.[r]?.url;
|
|
2834
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2835
|
+
},
|
|
2836
|
+
/**
|
|
2837
|
+
* Disconnect social network account from available authentication options
|
|
2838
|
+
* @summary Disconnect social network account
|
|
2839
|
+
* @param {DisconnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2840
|
+
* @param {*} [options] Override http request option.
|
|
2841
|
+
* @throws {RequiredError}
|
|
2842
|
+
*/
|
|
2843
|
+
async disconnectSocialNetworkProvider(e, a) {
|
|
2844
|
+
const o = await t.disconnectSocialNetworkProvider(e, a), r = s?.serverIndex ?? 0, n = u["UserApi.disconnectSocialNetworkProvider"]?.[r]?.url;
|
|
2845
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2846
|
+
},
|
|
2847
|
+
/**
|
|
2848
|
+
* Get currently authenticated user details
|
|
2849
|
+
* @summary Get user
|
|
2850
|
+
* @param {*} [options] Override http request option.
|
|
2851
|
+
* @throws {RequiredError}
|
|
2852
|
+
*/
|
|
2853
|
+
async getCurrentUser(e) {
|
|
2854
|
+
const a = await t.getCurrentUser(e), o = s?.serverIndex ?? 0, r = u["UserApi.getCurrentUser"]?.[o]?.url;
|
|
2855
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
2856
|
+
},
|
|
2857
|
+
/**
|
|
2858
|
+
* Get\'s publicly available user details
|
|
2859
|
+
* @summary Get user by name
|
|
2860
|
+
* @param {number} name Username
|
|
2861
|
+
* @param {*} [options] Override http request option.
|
|
2862
|
+
* @throws {RequiredError}
|
|
2863
|
+
*/
|
|
2864
|
+
async getPublicUserByName(e, a) {
|
|
2865
|
+
const o = await t.getPublicUserByName(e, a), r = s?.serverIndex ?? 0, n = u["UserApi.getPublicUserByName"]?.[r]?.url;
|
|
2866
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2867
|
+
},
|
|
2868
|
+
/**
|
|
2869
|
+
*
|
|
2870
|
+
* @summary Get system collections count
|
|
2871
|
+
* @param {*} [options] Override http request option.
|
|
2872
|
+
* @throws {RequiredError}
|
|
2873
|
+
*/
|
|
2874
|
+
async getSystemCollectionStats(e) {
|
|
2875
|
+
const a = await t.getSystemCollectionStats(e), o = s?.serverIndex ?? 0, r = u["UserApi.getSystemCollectionStats"]?.[o]?.url;
|
|
2876
|
+
return (n, l) => R(a, h, p, s)(n, r || l);
|
|
2877
|
+
},
|
|
2878
|
+
/**
|
|
2879
|
+
* To change email, config, password, etc... you can do it from single endpoint
|
|
2880
|
+
* @summary Update user
|
|
2881
|
+
* @param {UpdateCurrentUserRequest} [updateCurrentUserRequest]
|
|
2882
|
+
* @param {*} [options] Override http request option.
|
|
2883
|
+
* @throws {RequiredError}
|
|
2884
|
+
*/
|
|
2885
|
+
async updateCurrentUser(e, a) {
|
|
2886
|
+
const o = await t.updateCurrentUser(e, a), r = s?.serverIndex ?? 0, n = u["UserApi.updateCurrentUser"]?.[r]?.url;
|
|
2887
|
+
return (l, i) => R(o, h, p, s)(l, n || i);
|
|
2888
|
+
}
|
|
2889
|
+
};
|
|
2890
|
+
}, Ze = function(s, t, e) {
|
|
2891
|
+
const a = T(s);
|
|
2892
|
+
return {
|
|
2893
|
+
/**
|
|
2894
|
+
* Connect social network account as sign in authentication option
|
|
2895
|
+
* @summary Connect social network acount
|
|
2896
|
+
* @param {ConnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2897
|
+
* @param {*} [options] Override http request option.
|
|
2898
|
+
* @throws {RequiredError}
|
|
2899
|
+
*/
|
|
2900
|
+
connectSocialNetworkProvider(o, r) {
|
|
2901
|
+
return a.connectSocialNetworkProvider(o, r).then((n) => n(e, t));
|
|
2902
|
+
},
|
|
2903
|
+
/**
|
|
2904
|
+
* Disconnect social network account from available authentication options
|
|
2905
|
+
* @summary Disconnect social network account
|
|
2906
|
+
* @param {DisconnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2907
|
+
* @param {*} [options] Override http request option.
|
|
2908
|
+
* @throws {RequiredError}
|
|
2909
|
+
*/
|
|
2910
|
+
disconnectSocialNetworkProvider(o, r) {
|
|
2911
|
+
return a.disconnectSocialNetworkProvider(o, r).then((n) => n(e, t));
|
|
2912
|
+
},
|
|
2913
|
+
/**
|
|
2914
|
+
* Get currently authenticated user details
|
|
2915
|
+
* @summary Get user
|
|
2916
|
+
* @param {*} [options] Override http request option.
|
|
2917
|
+
* @throws {RequiredError}
|
|
2918
|
+
*/
|
|
2919
|
+
getCurrentUser(o) {
|
|
2920
|
+
return a.getCurrentUser(o).then((r) => r(e, t));
|
|
2921
|
+
},
|
|
2922
|
+
/**
|
|
2923
|
+
* Get\'s publicly available user details
|
|
2924
|
+
* @summary Get user by name
|
|
2925
|
+
* @param {number} name Username
|
|
2926
|
+
* @param {*} [options] Override http request option.
|
|
2927
|
+
* @throws {RequiredError}
|
|
2928
|
+
*/
|
|
2929
|
+
getPublicUserByName(o, r) {
|
|
2930
|
+
return a.getPublicUserByName(o, r).then((n) => n(e, t));
|
|
2931
|
+
},
|
|
2932
|
+
/**
|
|
2933
|
+
*
|
|
2934
|
+
* @summary Get system collections count
|
|
2935
|
+
* @param {*} [options] Override http request option.
|
|
2936
|
+
* @throws {RequiredError}
|
|
2937
|
+
*/
|
|
2938
|
+
getSystemCollectionStats(o) {
|
|
2939
|
+
return a.getSystemCollectionStats(o).then((r) => r(e, t));
|
|
2940
|
+
},
|
|
2941
|
+
/**
|
|
2942
|
+
* To change email, config, password, etc... you can do it from single endpoint
|
|
2943
|
+
* @summary Update user
|
|
2944
|
+
* @param {UpdateCurrentUserRequest} [updateCurrentUserRequest]
|
|
2945
|
+
* @param {*} [options] Override http request option.
|
|
2946
|
+
* @throws {RequiredError}
|
|
2947
|
+
*/
|
|
2948
|
+
updateCurrentUser(o, r) {
|
|
2949
|
+
return a.updateCurrentUser(o, r).then((n) => n(e, t));
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
};
|
|
2953
|
+
class Ce extends I {
|
|
2954
|
+
/**
|
|
2955
|
+
* Connect social network account as sign in authentication option
|
|
2956
|
+
* @summary Connect social network acount
|
|
2957
|
+
* @param {ConnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2958
|
+
* @param {*} [options] Override http request option.
|
|
2959
|
+
* @throws {RequiredError}
|
|
2960
|
+
* @memberof UserApi
|
|
2961
|
+
*/
|
|
2962
|
+
connectSocialNetworkProvider(t, e) {
|
|
2963
|
+
return T(this.configuration).connectSocialNetworkProvider(t, e).then((a) => a(this.axios, this.basePath));
|
|
2964
|
+
}
|
|
2965
|
+
/**
|
|
2966
|
+
* Disconnect social network account from available authentication options
|
|
2967
|
+
* @summary Disconnect social network account
|
|
2968
|
+
* @param {DisconnectSocialNetworkProviderProviderEnum} provider facebook google twitter vkontakte dropbox or gdrive
|
|
2969
|
+
* @param {*} [options] Override http request option.
|
|
2970
|
+
* @throws {RequiredError}
|
|
2971
|
+
* @memberof UserApi
|
|
2972
|
+
*/
|
|
2973
|
+
disconnectSocialNetworkProvider(t, e) {
|
|
2974
|
+
return T(this.configuration).disconnectSocialNetworkProvider(t, e).then((a) => a(this.axios, this.basePath));
|
|
2975
|
+
}
|
|
2976
|
+
/**
|
|
2977
|
+
* Get currently authenticated user details
|
|
2978
|
+
* @summary Get user
|
|
2979
|
+
* @param {*} [options] Override http request option.
|
|
2980
|
+
* @throws {RequiredError}
|
|
2981
|
+
* @memberof UserApi
|
|
2982
|
+
*/
|
|
2983
|
+
getCurrentUser(t) {
|
|
2984
|
+
return T(this.configuration).getCurrentUser(t).then((e) => e(this.axios, this.basePath));
|
|
2985
|
+
}
|
|
2986
|
+
/**
|
|
2987
|
+
* Get\'s publicly available user details
|
|
2988
|
+
* @summary Get user by name
|
|
2989
|
+
* @param {number} name Username
|
|
2990
|
+
* @param {*} [options] Override http request option.
|
|
2991
|
+
* @throws {RequiredError}
|
|
2992
|
+
* @memberof UserApi
|
|
2993
|
+
*/
|
|
2994
|
+
getPublicUserByName(t, e) {
|
|
2995
|
+
return T(this.configuration).getPublicUserByName(t, e).then((a) => a(this.axios, this.basePath));
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
*
|
|
2999
|
+
* @summary Get system collections count
|
|
3000
|
+
* @param {*} [options] Override http request option.
|
|
3001
|
+
* @throws {RequiredError}
|
|
3002
|
+
* @memberof UserApi
|
|
3003
|
+
*/
|
|
3004
|
+
getSystemCollectionStats(t) {
|
|
3005
|
+
return T(this.configuration).getSystemCollectionStats(t).then((e) => e(this.axios, this.basePath));
|
|
3006
|
+
}
|
|
3007
|
+
/**
|
|
3008
|
+
* To change email, config, password, etc... you can do it from single endpoint
|
|
3009
|
+
* @summary Update user
|
|
3010
|
+
* @param {UpdateCurrentUserRequest} [updateCurrentUserRequest]
|
|
3011
|
+
* @param {*} [options] Override http request option.
|
|
3012
|
+
* @throws {RequiredError}
|
|
3013
|
+
* @memberof UserApi
|
|
3014
|
+
*/
|
|
3015
|
+
updateCurrentUser(t, e) {
|
|
3016
|
+
return T(this.configuration).updateCurrentUser(t, e).then((a) => a(this.axios, this.basePath));
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
const et = {
|
|
3020
|
+
Facebook: "facebook",
|
|
3021
|
+
Google: "google",
|
|
3022
|
+
Twitter: "twitter",
|
|
3023
|
+
Vkontate: "vkontate",
|
|
3024
|
+
Dropbox: "dropbox",
|
|
3025
|
+
Gdrive: "gdrive"
|
|
3026
|
+
}, tt = {
|
|
3027
|
+
Facebook: "facebook",
|
|
3028
|
+
Google: "google",
|
|
3029
|
+
Twitter: "twitter",
|
|
3030
|
+
Vkontate: "vkontate",
|
|
3031
|
+
Dropbox: "dropbox",
|
|
3032
|
+
Gdrive: "gdrive"
|
|
3033
|
+
};
|
|
3034
|
+
class Oe {
|
|
3035
|
+
/**
|
|
3036
|
+
* parameter for apiKey security
|
|
3037
|
+
* @param name security name
|
|
3038
|
+
* @memberof Configuration
|
|
3039
|
+
*/
|
|
3040
|
+
apiKey;
|
|
3041
|
+
/**
|
|
3042
|
+
* parameter for basic security
|
|
3043
|
+
*
|
|
3044
|
+
* @type {string}
|
|
3045
|
+
* @memberof Configuration
|
|
3046
|
+
*/
|
|
3047
|
+
username;
|
|
3048
|
+
/**
|
|
3049
|
+
* parameter for basic security
|
|
3050
|
+
*
|
|
3051
|
+
* @type {string}
|
|
3052
|
+
* @memberof Configuration
|
|
3053
|
+
*/
|
|
3054
|
+
password;
|
|
3055
|
+
/**
|
|
3056
|
+
* parameter for oauth2 security
|
|
3057
|
+
* @param name security name
|
|
3058
|
+
* @param scopes oauth2 scope
|
|
3059
|
+
* @memberof Configuration
|
|
3060
|
+
*/
|
|
3061
|
+
accessToken;
|
|
3062
|
+
/**
|
|
3063
|
+
* override base path
|
|
3064
|
+
*
|
|
3065
|
+
* @type {string}
|
|
3066
|
+
* @memberof Configuration
|
|
3067
|
+
*/
|
|
3068
|
+
basePath;
|
|
3069
|
+
/**
|
|
3070
|
+
* override server index
|
|
3071
|
+
*
|
|
3072
|
+
* @type {number}
|
|
3073
|
+
* @memberof Configuration
|
|
3074
|
+
*/
|
|
3075
|
+
serverIndex;
|
|
3076
|
+
/**
|
|
3077
|
+
* base options for axios calls
|
|
3078
|
+
*
|
|
3079
|
+
* @type {any}
|
|
3080
|
+
* @memberof Configuration
|
|
3081
|
+
*/
|
|
3082
|
+
baseOptions;
|
|
3083
|
+
/**
|
|
3084
|
+
* The FormData constructor that will be used to create multipart form data
|
|
3085
|
+
* requests. You can inject this here so that execution environments that
|
|
3086
|
+
* do not support the FormData class can still run the generated client.
|
|
3087
|
+
*
|
|
3088
|
+
* @type {new () => FormData}
|
|
3089
|
+
*/
|
|
3090
|
+
formDataCtor;
|
|
3091
|
+
constructor(t = {}) {
|
|
3092
|
+
this.apiKey = t.apiKey, this.username = t.username, this.password = t.password, this.accessToken = t.accessToken, this.basePath = t.basePath, this.serverIndex = t.serverIndex, this.baseOptions = t.baseOptions, this.formDataCtor = t.formDataCtor;
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* Check if the given MIME is a JSON MIME.
|
|
3096
|
+
* JSON MIME examples:
|
|
3097
|
+
* application/json
|
|
3098
|
+
* application/json; charset=UTF8
|
|
3099
|
+
* APPLICATION/JSON
|
|
3100
|
+
* application/vnd.company+json
|
|
3101
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
3102
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
3103
|
+
*/
|
|
3104
|
+
isJsonMime(t) {
|
|
3105
|
+
const e = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i");
|
|
3106
|
+
return t !== null && (e.test(t) || t.toLowerCase() === "application/json-patch+json");
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3110
|
+
__proto__: null,
|
|
3111
|
+
AuthenticationApi: te,
|
|
3112
|
+
AuthenticationApiAxiosParamCreator: ee,
|
|
3113
|
+
AuthenticationApiFactory: Ge,
|
|
3114
|
+
AuthenticationApiFp: H,
|
|
3115
|
+
CollectionAccessLevelEnum: Se,
|
|
3116
|
+
CollectionApi: ae,
|
|
3117
|
+
CollectionApiAxiosParamCreator: re,
|
|
3118
|
+
CollectionApiFactory: De,
|
|
3119
|
+
CollectionApiFp: A,
|
|
3120
|
+
CollectionRefRefEnum: Le,
|
|
3121
|
+
Configuration: Oe,
|
|
3122
|
+
ConnectSocialNetworkProviderProviderEnum: et,
|
|
3123
|
+
DisconnectSocialNetworkProviderProviderEnum: tt,
|
|
3124
|
+
FilterApi: oe,
|
|
3125
|
+
FilterApiAxiosParamCreator: se,
|
|
3126
|
+
FilterApiFactory: ze,
|
|
3127
|
+
FilterApiFp: _,
|
|
3128
|
+
GetFiltersTagsSortEnum: Je,
|
|
3129
|
+
GetOrRefreshToken400ResponseErrorEnum: ke,
|
|
3130
|
+
HighlightApi: le,
|
|
3131
|
+
HighlightApiAxiosParamCreator: ne,
|
|
3132
|
+
HighlightApiFactory: We,
|
|
3133
|
+
HighlightApiFp: E,
|
|
3134
|
+
HighlightColorEnum: je,
|
|
3135
|
+
HighlightItemColorEnum: He,
|
|
3136
|
+
ImportApi: ce,
|
|
3137
|
+
ImportApiAxiosParamCreator: ie,
|
|
3138
|
+
ImportApiFactory: Ye,
|
|
3139
|
+
ImportApiFp: f,
|
|
3140
|
+
ObtainTokenGrantTypeEnum: X,
|
|
3141
|
+
RaindropAllOfCacheStatusEnum: Ne,
|
|
3142
|
+
RaindropApi: he,
|
|
3143
|
+
RaindropApiAxiosParamCreator: de,
|
|
3144
|
+
RaindropApiFactory: Ke,
|
|
3145
|
+
RaindropApiFp: g,
|
|
3146
|
+
RaindropBaseMediaInnerTypeEnum: qe,
|
|
3147
|
+
RefreshTokenGrantTypeEnum: Z,
|
|
3148
|
+
Role: Me,
|
|
3149
|
+
SortBy: Qe,
|
|
3150
|
+
TagApi: ue,
|
|
3151
|
+
TagApiAxiosParamCreator: pe,
|
|
3152
|
+
TagApiFactory: Xe,
|
|
3153
|
+
TagApiFp: S,
|
|
3154
|
+
TokenResponseTokenTypeEnum: $e,
|
|
3155
|
+
UserApi: Ce,
|
|
3156
|
+
UserApiAxiosParamCreator: me,
|
|
3157
|
+
UserApiFactory: Ze,
|
|
3158
|
+
UserApiFp: T,
|
|
3159
|
+
View: _e
|
|
3160
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3161
|
+
var Re = { exports: {} }, rt = function s(t, e) {
|
|
3162
|
+
if (t === e)
|
|
3163
|
+
return !0;
|
|
3164
|
+
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
3165
|
+
if (t.constructor !== e.constructor)
|
|
3166
|
+
return !1;
|
|
3167
|
+
var a, o, r;
|
|
3168
|
+
if (Array.isArray(t)) {
|
|
3169
|
+
if (a = t.length, a != e.length)
|
|
3170
|
+
return !1;
|
|
3171
|
+
for (o = a; o-- !== 0; )
|
|
3172
|
+
if (!s(t[o], e[o]))
|
|
3173
|
+
return !1;
|
|
3174
|
+
return !0;
|
|
3175
|
+
}
|
|
3176
|
+
if (t.constructor === RegExp)
|
|
3177
|
+
return t.source === e.source && t.flags === e.flags;
|
|
3178
|
+
if (t.valueOf !== Object.prototype.valueOf)
|
|
3179
|
+
return t.valueOf() === e.valueOf();
|
|
3180
|
+
if (t.toString !== Object.prototype.toString)
|
|
3181
|
+
return t.toString() === e.toString();
|
|
3182
|
+
if (r = Object.keys(t), a = r.length, a !== Object.keys(e).length)
|
|
3183
|
+
return !1;
|
|
3184
|
+
for (o = a; o-- !== 0; )
|
|
3185
|
+
if (!Object.prototype.hasOwnProperty.call(e, r[o]))
|
|
3186
|
+
return !1;
|
|
3187
|
+
for (o = a; o-- !== 0; ) {
|
|
3188
|
+
var n = r[o];
|
|
3189
|
+
if (!s(t[n], e[n]))
|
|
3190
|
+
return !1;
|
|
3191
|
+
}
|
|
3192
|
+
return !0;
|
|
3193
|
+
}
|
|
3194
|
+
return t !== t && e !== e;
|
|
3195
|
+
};
|
|
3196
|
+
/*!
|
|
3197
|
+
* Determine if an object is a Buffer
|
|
3198
|
+
*
|
|
3199
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
3200
|
+
* @license MIT
|
|
3201
|
+
*/
|
|
3202
|
+
var at = function(t) {
|
|
3203
|
+
return t != null && t.constructor != null && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
|
|
3204
|
+
};
|
|
3205
|
+
/*!
|
|
3206
|
+
* MIT License
|
|
3207
|
+
*
|
|
3208
|
+
* Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
3209
|
+
*
|
|
3210
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
3211
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
3212
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
3213
|
+
* persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
3214
|
+
*
|
|
3215
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
3216
|
+
* Software.
|
|
3217
|
+
*
|
|
3218
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
3219
|
+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
3220
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
3221
|
+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3222
|
+
*/
|
|
3223
|
+
function st(s) {
|
|
3224
|
+
return typeof Blob > "u" ? !1 : s instanceof Blob || Object.prototype.toString.call(s) === "[object Blob]";
|
|
3225
|
+
}
|
|
3226
|
+
var ot = st, D = h, ve = rt, nt = at, lt = ot, Ve = Object.prototype.toString;
|
|
3227
|
+
function ye(s, t) {
|
|
3228
|
+
for (var e = s.length, a = 0; a < e; a++) {
|
|
3229
|
+
var o = s[a];
|
|
3230
|
+
if (t(o))
|
|
3231
|
+
return o;
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
function Pe(s) {
|
|
3235
|
+
return Ve.call(s) === "[object Function]";
|
|
3236
|
+
}
|
|
3237
|
+
function Ae(s) {
|
|
3238
|
+
return s !== null && typeof s == "object";
|
|
3239
|
+
}
|
|
3240
|
+
function it(s) {
|
|
3241
|
+
return Ae(s) && Pe(s.pipe);
|
|
3242
|
+
}
|
|
3243
|
+
function ct(s) {
|
|
3244
|
+
return Ve.call(s) === "[object ArrayBuffer]";
|
|
3245
|
+
}
|
|
3246
|
+
function z(s, t) {
|
|
3247
|
+
return s ? s.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : t;
|
|
3248
|
+
}
|
|
3249
|
+
function dt(s, t, e, a, o, r, n) {
|
|
3250
|
+
return ye(s[t.toLowerCase()], function(l) {
|
|
3251
|
+
if (typeof l[0] == "string")
|
|
3252
|
+
return (J(e, l[0]) || J(z(n, e), l[0])) && $(t, a, o, l[1]) && N(r, l[2]);
|
|
3253
|
+
if (l[0] instanceof RegExp)
|
|
3254
|
+
return (l[0].test(e) || l[0].test(z(n, e))) && $(t, a, o, l[1]) && N(r, l[2]);
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
function J(s, t) {
|
|
3258
|
+
var e = s[0] === "/" ? s.substr(1) : s, a = t[0] === "/" ? t.substr(1) : t;
|
|
3259
|
+
return e === a;
|
|
3260
|
+
}
|
|
3261
|
+
function $(s, t, e, a) {
|
|
3262
|
+
var o = ["delete", "get", "head", "options"];
|
|
3263
|
+
if (o.indexOf(s.toLowerCase()) >= 0) {
|
|
3264
|
+
var r = a ? a.data : void 0, n = a ? a.params : void 0;
|
|
3265
|
+
return N(e, n) && W(t, r);
|
|
3266
|
+
} else
|
|
3267
|
+
return W(t, a);
|
|
3268
|
+
}
|
|
3269
|
+
function N(s, t) {
|
|
3270
|
+
return t === void 0 ? !0 : typeof t.asymmetricMatch == "function" ? t.asymmetricMatch(s) : ve(s, t);
|
|
3271
|
+
}
|
|
3272
|
+
function W(s, t) {
|
|
3273
|
+
if (t === void 0)
|
|
3274
|
+
return !0;
|
|
3275
|
+
var e;
|
|
3276
|
+
try {
|
|
3277
|
+
e = JSON.parse(s);
|
|
3278
|
+
} catch {
|
|
3279
|
+
}
|
|
3280
|
+
return N(e || s, t);
|
|
3281
|
+
}
|
|
3282
|
+
function ht(s, t) {
|
|
3283
|
+
Object.keys(s.handlers).forEach(function(e) {
|
|
3284
|
+
var a = s.handlers[e].indexOf(t);
|
|
3285
|
+
a > -1 && s.handlers[e].splice(a, 1);
|
|
3286
|
+
});
|
|
3287
|
+
}
|
|
3288
|
+
function be(s, t, e, a) {
|
|
3289
|
+
if (a > 0) {
|
|
3290
|
+
setTimeout(be, a, s, t, e);
|
|
3291
|
+
return;
|
|
3292
|
+
}
|
|
3293
|
+
!e.config.validateStatus || e.config.validateStatus(e.status) ? s(e) : t(
|
|
3294
|
+
ge(
|
|
3295
|
+
"Request failed with status code " + e.status,
|
|
3296
|
+
e.config,
|
|
3297
|
+
e
|
|
3298
|
+
)
|
|
3299
|
+
);
|
|
3300
|
+
}
|
|
3301
|
+
function ge(s, t, e, a) {
|
|
3302
|
+
if (typeof D.AxiosError == "function")
|
|
3303
|
+
return D.AxiosError.from(new Error(s), a, t, null, e);
|
|
3304
|
+
var o = new Error(s);
|
|
3305
|
+
return o.isAxiosError = !0, o.config = t, e !== void 0 && (o.response = e), a !== void 0 && (o.code = a), o.toJSON = function() {
|
|
3306
|
+
return {
|
|
3307
|
+
// Standard
|
|
3308
|
+
message: this.message,
|
|
3309
|
+
name: this.name,
|
|
3310
|
+
// Microsoft
|
|
3311
|
+
description: this.description,
|
|
3312
|
+
number: this.number,
|
|
3313
|
+
// Mozilla
|
|
3314
|
+
fileName: this.fileName,
|
|
3315
|
+
lineNumber: this.lineNumber,
|
|
3316
|
+
columnNumber: this.columnNumber,
|
|
3317
|
+
stack: this.stack,
|
|
3318
|
+
// Axios
|
|
3319
|
+
config: this.config,
|
|
3320
|
+
code: this.code
|
|
3321
|
+
};
|
|
3322
|
+
}, o;
|
|
3323
|
+
}
|
|
3324
|
+
function pt(s) {
|
|
3325
|
+
var t = `Could not find mock for:
|
|
3326
|
+
` + JSON.stringify(s, ["method", "url"], 2), e = new Error(t);
|
|
3327
|
+
return e.isCouldNotFindMockError = !0, e.url = s.url, e.method = s.method, e;
|
|
3328
|
+
}
|
|
3329
|
+
var we = {
|
|
3330
|
+
find: ye,
|
|
3331
|
+
findHandler: dt,
|
|
3332
|
+
purgeIfReplyOnce: ht,
|
|
3333
|
+
settle: be,
|
|
3334
|
+
isStream: it,
|
|
3335
|
+
isArrayBuffer: ct,
|
|
3336
|
+
isFunction: Pe,
|
|
3337
|
+
isObjectOrArray: Ae,
|
|
3338
|
+
isBuffer: nt,
|
|
3339
|
+
isBlob: lt,
|
|
3340
|
+
isBodyOrParametersMatching: $,
|
|
3341
|
+
isEqual: ve,
|
|
3342
|
+
createAxiosError: ge,
|
|
3343
|
+
createCouldNotFindMockError: pt
|
|
3344
|
+
}, w = we;
|
|
3345
|
+
function ut(s) {
|
|
3346
|
+
return w.isArrayBuffer(s) || w.isBuffer(s) || w.isStream(s) || w.isBlob(s) ? s : w.isObjectOrArray(s) ? JSON.parse(JSON.stringify(s)) : s;
|
|
3347
|
+
}
|
|
3348
|
+
function L(s, t) {
|
|
3349
|
+
return {
|
|
3350
|
+
status: s[0],
|
|
3351
|
+
data: ut(s[1]),
|
|
3352
|
+
headers: s[2],
|
|
3353
|
+
config: t,
|
|
3354
|
+
request: {
|
|
3355
|
+
responseURL: t.url
|
|
3356
|
+
}
|
|
3357
|
+
};
|
|
3358
|
+
}
|
|
3359
|
+
function Y(s, t, e, a) {
|
|
3360
|
+
var o = a.baseURL;
|
|
3361
|
+
if (a.baseURL && !/^https?:/.test(a.baseURL) && (o = void 0), typeof s.originalAdapter == "function")
|
|
3362
|
+
return s.originalAdapter(a).then(t, e);
|
|
3363
|
+
s.axiosInstanceWithoutInterceptors(Object.assign({}, a, {
|
|
3364
|
+
baseURL: o,
|
|
3365
|
+
// Use the original adapter, not the mock adapter
|
|
3366
|
+
adapter: s.originalAdapter,
|
|
3367
|
+
// The request transformation runs on the original axios handler already
|
|
3368
|
+
transformRequest: [],
|
|
3369
|
+
transformResponse: []
|
|
3370
|
+
})).then(t, e);
|
|
3371
|
+
}
|
|
3372
|
+
function mt(s, t, e, a) {
|
|
3373
|
+
var o = a.url || "";
|
|
3374
|
+
a.baseURL && o.substr(0, a.baseURL.length) === a.baseURL && (o = o.slice(a.baseURL.length)), delete a.adapter, s.history[a.method].push(a);
|
|
3375
|
+
var r = w.findHandler(
|
|
3376
|
+
s.handlers,
|
|
3377
|
+
a.method,
|
|
3378
|
+
o,
|
|
3379
|
+
a.data,
|
|
3380
|
+
a.params,
|
|
3381
|
+
a.headers && a.headers.constructor.name === "AxiosHeaders" ? Object.assign({}, a.headers) : a.headers,
|
|
3382
|
+
a.baseURL
|
|
3383
|
+
);
|
|
3384
|
+
if (r)
|
|
3385
|
+
if (r.length === 7 && w.purgeIfReplyOnce(s, r), r.length === 2)
|
|
3386
|
+
Y(s, t, e, a);
|
|
3387
|
+
else if (typeof r[3] != "function")
|
|
3388
|
+
w.settle(
|
|
3389
|
+
t,
|
|
3390
|
+
e,
|
|
3391
|
+
L(r.slice(3), a),
|
|
3392
|
+
k(s, r)
|
|
3393
|
+
);
|
|
3394
|
+
else {
|
|
3395
|
+
var n = r[3](a);
|
|
3396
|
+
typeof n.then != "function" ? w.settle(
|
|
3397
|
+
t,
|
|
3398
|
+
e,
|
|
3399
|
+
L(n, a),
|
|
3400
|
+
k(s, r)
|
|
3401
|
+
) : n.then(
|
|
3402
|
+
function(l) {
|
|
3403
|
+
l.config && l.status ? w.settle(
|
|
3404
|
+
t,
|
|
3405
|
+
e,
|
|
3406
|
+
L(
|
|
3407
|
+
[l.status, l.data, l.headers],
|
|
3408
|
+
l.config
|
|
3409
|
+
),
|
|
3410
|
+
0
|
|
3411
|
+
) : w.settle(
|
|
3412
|
+
t,
|
|
3413
|
+
e,
|
|
3414
|
+
L(l, a),
|
|
3415
|
+
k(s, r)
|
|
3416
|
+
);
|
|
3417
|
+
},
|
|
3418
|
+
function(l) {
|
|
3419
|
+
s.delayResponse > 0 ? setTimeout(function() {
|
|
3420
|
+
e(l);
|
|
3421
|
+
}, k(s, r)) : e(l);
|
|
3422
|
+
}
|
|
3423
|
+
);
|
|
3424
|
+
}
|
|
3425
|
+
else
|
|
3426
|
+
switch (s.onNoMatch) {
|
|
3427
|
+
case "passthrough":
|
|
3428
|
+
Y(s, t, e, a);
|
|
3429
|
+
break;
|
|
3430
|
+
case "throwException":
|
|
3431
|
+
throw w.createCouldNotFindMockError(a);
|
|
3432
|
+
default:
|
|
3433
|
+
w.settle(
|
|
3434
|
+
t,
|
|
3435
|
+
e,
|
|
3436
|
+
{
|
|
3437
|
+
status: 404,
|
|
3438
|
+
config: a
|
|
3439
|
+
},
|
|
3440
|
+
s.delayResponse
|
|
3441
|
+
);
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
function k(s, t) {
|
|
3445
|
+
var e;
|
|
3446
|
+
return t.length === 8 && (e = t[7]), e || s.delayResponse;
|
|
3447
|
+
}
|
|
3448
|
+
var Ct = mt, Ot = Ct, B = we, G = [
|
|
3449
|
+
"get",
|
|
3450
|
+
"post",
|
|
3451
|
+
"head",
|
|
3452
|
+
"delete",
|
|
3453
|
+
"patch",
|
|
3454
|
+
"put",
|
|
3455
|
+
"options",
|
|
3456
|
+
"list",
|
|
3457
|
+
"link",
|
|
3458
|
+
"unlink"
|
|
3459
|
+
];
|
|
3460
|
+
function Rt() {
|
|
3461
|
+
return function(s) {
|
|
3462
|
+
var t = this;
|
|
3463
|
+
return new Promise(function(e, a) {
|
|
3464
|
+
Ot(t, e, a, s);
|
|
3465
|
+
});
|
|
3466
|
+
}.bind(this);
|
|
3467
|
+
}
|
|
3468
|
+
function xe() {
|
|
3469
|
+
return G.reduce(function(s, t) {
|
|
3470
|
+
return s[t] = [], s;
|
|
3471
|
+
}, {});
|
|
3472
|
+
}
|
|
3473
|
+
function Ue() {
|
|
3474
|
+
Te.call(this), Be.call(this);
|
|
3475
|
+
}
|
|
3476
|
+
function Te() {
|
|
3477
|
+
this.handlers = xe();
|
|
3478
|
+
}
|
|
3479
|
+
function Be() {
|
|
3480
|
+
this.history = xe();
|
|
3481
|
+
}
|
|
3482
|
+
function F(s, t) {
|
|
3483
|
+
if (Ue.call(this), s)
|
|
3484
|
+
this.axiosInstance = s, this.axiosInstanceWithoutInterceptors = s.create ? s.create() : void 0, this.originalAdapter = s.defaults.adapter, this.delayResponse = t && t.delayResponse > 0 ? t.delayResponse : null, this.onNoMatch = t && t.onNoMatch || null, s.defaults.adapter = this.adapter.call(this);
|
|
3485
|
+
else
|
|
3486
|
+
throw new Error("Please provide an instance of axios to mock");
|
|
3487
|
+
}
|
|
3488
|
+
F.prototype.adapter = Rt;
|
|
3489
|
+
F.prototype.restore = function() {
|
|
3490
|
+
this.axiosInstance && (this.axiosInstance.defaults.adapter = this.originalAdapter, this.axiosInstance = void 0);
|
|
3491
|
+
};
|
|
3492
|
+
F.prototype.reset = Ue;
|
|
3493
|
+
F.prototype.resetHandlers = Te;
|
|
3494
|
+
F.prototype.resetHistory = Be;
|
|
3495
|
+
G.concat("any").forEach(function(s) {
|
|
3496
|
+
var t = "on" + s.charAt(0).toUpperCase() + s.slice(1);
|
|
3497
|
+
F.prototype[t] = function(n, a, o) {
|
|
3498
|
+
var r = this, n = n === void 0 ? /.*/ : n;
|
|
3499
|
+
function l(V, y, x) {
|
|
3500
|
+
var U = [n, a, o, V, y, x];
|
|
3501
|
+
return j(s, r.handlers, U), r;
|
|
3502
|
+
}
|
|
3503
|
+
function i(V, y, x, U) {
|
|
3504
|
+
var M = [n, a, o, y, x, U, !1, V];
|
|
3505
|
+
return j(s, r.handlers, M), r;
|
|
3506
|
+
}
|
|
3507
|
+
function c(V) {
|
|
3508
|
+
return function(y, x, U) {
|
|
3509
|
+
i(V, y, x, U);
|
|
3510
|
+
};
|
|
3511
|
+
}
|
|
3512
|
+
function d(V, y, x) {
|
|
3513
|
+
var U = [
|
|
3514
|
+
n,
|
|
3515
|
+
a,
|
|
3516
|
+
o,
|
|
3517
|
+
V,
|
|
3518
|
+
y,
|
|
3519
|
+
x,
|
|
3520
|
+
!0
|
|
3521
|
+
];
|
|
3522
|
+
return j(s, r.handlers, U), r;
|
|
3523
|
+
}
|
|
3524
|
+
return {
|
|
3525
|
+
reply: l,
|
|
3526
|
+
replyOnce: d,
|
|
3527
|
+
withDelayInMs: c,
|
|
3528
|
+
passThrough: function() {
|
|
3529
|
+
var y = [n, a];
|
|
3530
|
+
return j(s, r.handlers, y), r;
|
|
3531
|
+
},
|
|
3532
|
+
abortRequest: function() {
|
|
3533
|
+
return l(function(V) {
|
|
3534
|
+
var y = B.createAxiosError(
|
|
3535
|
+
"Request aborted",
|
|
3536
|
+
V,
|
|
3537
|
+
void 0,
|
|
3538
|
+
"ECONNABORTED"
|
|
3539
|
+
);
|
|
3540
|
+
return Promise.reject(y);
|
|
3541
|
+
});
|
|
3542
|
+
},
|
|
3543
|
+
abortRequestOnce: function() {
|
|
3544
|
+
return d(function(V) {
|
|
3545
|
+
var y = B.createAxiosError(
|
|
3546
|
+
"Request aborted",
|
|
3547
|
+
V,
|
|
3548
|
+
void 0,
|
|
3549
|
+
"ECONNABORTED"
|
|
3550
|
+
);
|
|
3551
|
+
return Promise.reject(y);
|
|
3552
|
+
});
|
|
3553
|
+
},
|
|
3554
|
+
networkError: function() {
|
|
3555
|
+
return l(function(V) {
|
|
3556
|
+
var y = B.createAxiosError("Network Error", V);
|
|
3557
|
+
return Promise.reject(y);
|
|
3558
|
+
});
|
|
3559
|
+
},
|
|
3560
|
+
networkErrorOnce: function() {
|
|
3561
|
+
return d(function(V) {
|
|
3562
|
+
var y = B.createAxiosError("Network Error", V);
|
|
3563
|
+
return Promise.reject(y);
|
|
3564
|
+
});
|
|
3565
|
+
},
|
|
3566
|
+
timeout: function() {
|
|
3567
|
+
return l(function(V) {
|
|
3568
|
+
var y = B.createAxiosError(
|
|
3569
|
+
V.timeoutErrorMessage || "timeout of " + V.timeout + "ms exceeded",
|
|
3570
|
+
V,
|
|
3571
|
+
void 0,
|
|
3572
|
+
V.transitional && V.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"
|
|
3573
|
+
);
|
|
3574
|
+
return Promise.reject(y);
|
|
3575
|
+
});
|
|
3576
|
+
},
|
|
3577
|
+
timeoutOnce: function() {
|
|
3578
|
+
return d(function(V) {
|
|
3579
|
+
var y = B.createAxiosError(
|
|
3580
|
+
V.timeoutErrorMessage || "timeout of " + V.timeout + "ms exceeded",
|
|
3581
|
+
V,
|
|
3582
|
+
void 0,
|
|
3583
|
+
V.transitional && V.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"
|
|
3584
|
+
);
|
|
3585
|
+
return Promise.reject(y);
|
|
3586
|
+
});
|
|
3587
|
+
}
|
|
3588
|
+
};
|
|
3589
|
+
};
|
|
3590
|
+
});
|
|
3591
|
+
function vt(s, t, e) {
|
|
3592
|
+
for (var a = -1, o = 0; o < t[s].length; o += 1) {
|
|
3593
|
+
var r = t[s][o], n = r.length === 7, l = r[0] instanceof RegExp && e[0] instanceof RegExp ? String(r[0]) === String(e[0]) : r[0] === e[0], i = l && B.isEqual(r[1], e[1]) && B.isEqual(r[2], e[2]);
|
|
3594
|
+
i && !n && (a = o);
|
|
3595
|
+
}
|
|
3596
|
+
return a;
|
|
3597
|
+
}
|
|
3598
|
+
function j(s, t, e) {
|
|
3599
|
+
if (s === "any")
|
|
3600
|
+
G.forEach(function(o) {
|
|
3601
|
+
t[o].push(e);
|
|
3602
|
+
});
|
|
3603
|
+
else {
|
|
3604
|
+
var a = vt(s, t, e);
|
|
3605
|
+
a > -1 && e.length < 7 ? t[s].splice(a, 1, e) : t[s].push(e);
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
Re.exports = F;
|
|
3609
|
+
Re.exports.default = F;
|
|
3610
|
+
class Vt extends te {
|
|
3611
|
+
/**
|
|
3612
|
+
* Wrapper function of {@link _AuthenticationApi.getOrRefreshToken} for token exchange.
|
|
3613
|
+
* @param request {@link ObtainToken} but without `grant_type` field.
|
|
3614
|
+
* @param options Axios request configuration.
|
|
3615
|
+
* @returns API response.
|
|
3616
|
+
*/
|
|
3617
|
+
async exchangeToken(t, e) {
|
|
3618
|
+
return this.getOrRefreshToken(
|
|
3619
|
+
{ ...t, grant_type: X.AuthorizationCode },
|
|
3620
|
+
e
|
|
3621
|
+
).then((a) => {
|
|
3622
|
+
if (K(a.data))
|
|
3623
|
+
throw new Error(`Request failed with error: ${a.data.errorMessage}`);
|
|
3624
|
+
return a;
|
|
3625
|
+
});
|
|
3626
|
+
}
|
|
3627
|
+
/**
|
|
3628
|
+
* Wrapper function of {@link _AuthenticationApi.getOrRefreshToken} for token refresh.
|
|
3629
|
+
* @param request {@link RefreshToken} but without `grant_type` field.
|
|
3630
|
+
* @param options Axios request configuration.
|
|
3631
|
+
* @returns API response.
|
|
3632
|
+
*/
|
|
3633
|
+
async refreshToken(t, e) {
|
|
3634
|
+
return this.getOrRefreshToken(
|
|
3635
|
+
{ ...t, grant_type: Z.RefreshToken },
|
|
3636
|
+
e
|
|
3637
|
+
).then((a) => {
|
|
3638
|
+
if (K(a.data))
|
|
3639
|
+
throw new Error(`Request failed with error: ${a.data.errorMessage}`);
|
|
3640
|
+
return a;
|
|
3641
|
+
});
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
function K(s) {
|
|
3645
|
+
return "result" in s && s.result === !1;
|
|
3646
|
+
}
|
|
3647
|
+
class q {
|
|
3648
|
+
_data;
|
|
3649
|
+
_parent = null;
|
|
3650
|
+
_children = [];
|
|
3651
|
+
/**
|
|
3652
|
+
* Create tree node.
|
|
3653
|
+
* @param data Node data.
|
|
3654
|
+
* @param children Initial tree children.
|
|
3655
|
+
*/
|
|
3656
|
+
constructor(t, e) {
|
|
3657
|
+
this._data = t, e && this.addChildren(...e);
|
|
3658
|
+
}
|
|
3659
|
+
get data() {
|
|
3660
|
+
return this._data;
|
|
3661
|
+
}
|
|
3662
|
+
get parent() {
|
|
3663
|
+
return this._parent;
|
|
3664
|
+
}
|
|
3665
|
+
set parent(t) {
|
|
3666
|
+
this._parent = t, t._children.push(this);
|
|
3667
|
+
}
|
|
3668
|
+
isRoot() {
|
|
3669
|
+
return this._parent === null;
|
|
3670
|
+
}
|
|
3671
|
+
get children() {
|
|
3672
|
+
return this._children;
|
|
3673
|
+
}
|
|
3674
|
+
/**
|
|
3675
|
+
* Add children to current node.
|
|
3676
|
+
* @param children Children nodes to append.
|
|
3677
|
+
*/
|
|
3678
|
+
addChildren(...t) {
|
|
3679
|
+
this._children.push(...t);
|
|
3680
|
+
for (const e of t)
|
|
3681
|
+
e._parent = this;
|
|
3682
|
+
}
|
|
3683
|
+
/**
|
|
3684
|
+
* Pre-order traverse this tree.
|
|
3685
|
+
* @param callbackFn Function to be called with traversing nodes.
|
|
3686
|
+
*/
|
|
3687
|
+
traverse(t) {
|
|
3688
|
+
t(this);
|
|
3689
|
+
for (const e of this.children)
|
|
3690
|
+
e.traverse(t);
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
function Ie(s, t, e) {
|
|
3694
|
+
const a = e.filter((o) => o.parent == t);
|
|
3695
|
+
for (const o of a) {
|
|
3696
|
+
const r = o.toNode();
|
|
3697
|
+
Ie(r, o.id, e), s.addChildren(r);
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
function Fe(s, t) {
|
|
3701
|
+
const e = new q(s);
|
|
3702
|
+
return Ie(e, null, t), e;
|
|
3703
|
+
}
|
|
3704
|
+
const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3705
|
+
__proto__: null,
|
|
3706
|
+
TreeNode: q,
|
|
3707
|
+
makeTree: Fe
|
|
3708
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3709
|
+
class Pt extends ae {
|
|
3710
|
+
/**
|
|
3711
|
+
* Create structured tree of collections.
|
|
3712
|
+
* @returns Root of tree.
|
|
3713
|
+
*/
|
|
3714
|
+
async getCollectionTree() {
|
|
3715
|
+
const [{ data: t }, { data: e }] = await Promise.all([
|
|
3716
|
+
this.getRootCollections(),
|
|
3717
|
+
this.getChildCollections()
|
|
3718
|
+
]), a = t.items.map((l) => ({
|
|
3719
|
+
data: l,
|
|
3720
|
+
id: l._id.toString(),
|
|
3721
|
+
parent: null,
|
|
3722
|
+
toNode() {
|
|
3723
|
+
return new q(this.data);
|
|
3724
|
+
}
|
|
3725
|
+
})), o = e.items.map((l) => ({
|
|
3726
|
+
data: l,
|
|
3727
|
+
id: l._id.toString(),
|
|
3728
|
+
parent: l.parent.$id.toString(),
|
|
3729
|
+
toNode() {
|
|
3730
|
+
return new q(this.data);
|
|
3731
|
+
}
|
|
3732
|
+
})), r = a.concat(o);
|
|
3733
|
+
return r.sort(
|
|
3734
|
+
(l, i) => (l.data?.title ?? "").localeCompare(i.data?.title ?? "") || (l.data?._id ?? 0) - (i.data?._id ?? 0)
|
|
3735
|
+
), Fe(null, r);
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
class At extends he {
|
|
3739
|
+
/**
|
|
3740
|
+
* Fetch all raindrops of a collection.
|
|
3741
|
+
* @param collectionId ID of collection.
|
|
3742
|
+
* @param params Request parameters.
|
|
3743
|
+
* @param options Axios request config.
|
|
3744
|
+
* @returns Array of raindrops.
|
|
3745
|
+
*/
|
|
3746
|
+
async getAllRaindrops(t, e, a) {
|
|
3747
|
+
const o = t ?? 0, r = e?.sort ?? "", n = e?.pageSize ?? 50, l = e?.search ?? "", { data: i } = await this.getRaindrops(o, r, n, 0, l, a), c = i.count, d = Math.ceil(c / n), V = Array.from(Array(d).keys());
|
|
3748
|
+
V.shift();
|
|
3749
|
+
const y = await Promise.all(
|
|
3750
|
+
V.map(
|
|
3751
|
+
(U) => this.getRaindrops(o, r, n, U, l, a).then(
|
|
3752
|
+
({ data: M }) => M
|
|
3753
|
+
)
|
|
3754
|
+
)
|
|
3755
|
+
), x = [...i.items];
|
|
3756
|
+
for (const U of y)
|
|
3757
|
+
x.push(...U.items);
|
|
3758
|
+
return x;
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
class Ee {
|
|
3762
|
+
/** Axios client instance. If not set, will use default Axios instance. */
|
|
3763
|
+
client;
|
|
3764
|
+
/** API global configurations. */
|
|
3765
|
+
configuration;
|
|
3766
|
+
// API namespaces
|
|
3767
|
+
auth;
|
|
3768
|
+
user;
|
|
3769
|
+
collection;
|
|
3770
|
+
filter;
|
|
3771
|
+
highlight;
|
|
3772
|
+
import;
|
|
3773
|
+
raindrop;
|
|
3774
|
+
tag;
|
|
3775
|
+
constructor(t, e) {
|
|
3776
|
+
this.client = e ?? h, this.configuration = t ?? new Oe(), this.auth = new Vt(t, void 0, this.client), this.collection = new Pt(t, void 0, this.client), this.filter = new oe(t, void 0, this.client), this.highlight = new le(t, void 0, this.client), this.import = new ce(t, void 0, this.client), this.raindrop = new At(t, void 0, this.client), this.tag = new ue(t, void 0, this.client), this.user = new Ce(t, void 0, this.client);
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3780
|
+
__proto__: null,
|
|
3781
|
+
Raindrop: Ee
|
|
3782
|
+
}, Symbol.toStringTag, { value: "Module" })), Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3783
|
+
__proto__: null,
|
|
3784
|
+
tree: yt
|
|
3785
|
+
}, Symbol.toStringTag, { value: "Module" })), It = Ee;
|
|
3786
|
+
export {
|
|
3787
|
+
Tt as client,
|
|
3788
|
+
It as default,
|
|
3789
|
+
Ut as generated,
|
|
3790
|
+
Bt as utils
|
|
3791
|
+
};
|