@lasuillard/raindrop-client 0.8.0 → 0.8.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.
Files changed (78) hide show
  1. package/dist/{src/generated/api.d.ts → index.d.mts} +638 -206
  2. package/dist/index.d.ts +5992 -0
  3. package/dist/index.js +3872 -0
  4. package/dist/index.mjs +3839 -0
  5. package/package.json +89 -79
  6. package/dist/index.cjs.js +0 -1
  7. package/dist/index.es.js +0 -1912
  8. package/dist/src/client/auth.d.ts +0 -18
  9. package/dist/src/client/client.d.ts +0 -25
  10. package/dist/src/client/collection.d.ts +0 -14
  11. package/dist/src/client/index.d.ts +0 -1
  12. package/dist/src/client/raindrop.d.ts +0 -23
  13. package/dist/src/generated/base.d.ts +0 -55
  14. package/dist/src/generated/common.d.ts +0 -54
  15. package/dist/src/generated/configuration.d.ts +0 -91
  16. package/dist/src/generated/index.d.ts +0 -13
  17. package/dist/src/index.d.ts +0 -6
  18. package/dist/src/utils/index.d.ts +0 -2
  19. package/dist/src/utils/tree.d.ts +0 -49
  20. package/dist/tests/__typechecks__/checkURLsExist.test-d.d.ts +0 -1
  21. package/dist/tests/__typechecks__/createCollection.test-d.d.ts +0 -1
  22. package/dist/tests/__typechecks__/createRaindrop.test-d.d.ts +0 -1
  23. package/dist/tests/__typechecks__/createRaindrops.test-d.d.ts +0 -1
  24. package/dist/tests/__typechecks__/emptyTrash.test-d.d.ts +0 -1
  25. package/dist/tests/__typechecks__/getAllHighlights.test-d.d.ts +0 -1
  26. package/dist/tests/__typechecks__/getChildCollections.test-d.d.ts +0 -1
  27. package/dist/tests/__typechecks__/getCollection.test-d.d.ts +0 -1
  28. package/dist/tests/__typechecks__/getCurrentUser.test-d.d.ts +0 -1
  29. package/dist/tests/__typechecks__/getFeaturedCovers.test-d.d.ts +0 -1
  30. package/dist/tests/__typechecks__/getFilters.test-d.d.ts +0 -1
  31. package/dist/tests/__typechecks__/getHighlightsInCollection.test-d.d.ts +0 -1
  32. package/dist/tests/__typechecks__/getPublicUserByName.test-d.d.ts +0 -1
  33. package/dist/tests/__typechecks__/getRaindrop.test-d.d.ts +0 -1
  34. package/dist/tests/__typechecks__/getRaindrops.test-d.d.ts +0 -1
  35. package/dist/tests/__typechecks__/getRootCollections.test-d.d.ts +0 -1
  36. package/dist/tests/__typechecks__/getSystemCollectionStats.test-d.d.ts +0 -1
  37. package/dist/tests/__typechecks__/getTagsInCollection.test-d.d.ts +0 -1
  38. package/dist/tests/__typechecks__/importHTMLBookmarkFile.test-d.d.ts +0 -1
  39. package/dist/tests/__typechecks__/mergeCollections.test-d.d.ts +0 -1
  40. package/dist/tests/__typechecks__/parseURL.test-d.d.ts +0 -1
  41. package/dist/tests/__typechecks__/removeAllEmptyCollections.test-d.d.ts +0 -1
  42. package/dist/tests/__typechecks__/removeCollection.test-d.d.ts +0 -1
  43. package/dist/tests/__typechecks__/removeCollections.test-d.d.ts +0 -1
  44. package/dist/tests/__typechecks__/removeRaindrop.test-d.d.ts +0 -1
  45. package/dist/tests/__typechecks__/removeRaindrops.test-d.d.ts +0 -1
  46. package/dist/tests/__typechecks__/removeTagsFromCollection.test-d.d.ts +0 -1
  47. package/dist/tests/__typechecks__/renameOrMergeTags.test-d.d.ts +0 -1
  48. package/dist/tests/__typechecks__/reorderAllCollections.test-d.d.ts +0 -1
  49. package/dist/tests/__typechecks__/searchCovers.test-d.d.ts +0 -1
  50. package/dist/tests/__typechecks__/shareCollection.test-d.d.ts +0 -1
  51. package/dist/tests/__typechecks__/updateCollection.test-d.d.ts +0 -1
  52. package/dist/tests/__typechecks__/updateCurrentUser.test-d.d.ts +0 -1
  53. package/dist/tests/__typechecks__/updateRaindrop.test-d.d.ts +0 -1
  54. package/dist/tests/__typechecks__/updateRaindrops.test-d.d.ts +0 -1
  55. package/dist/tests/__typechecks__/uploadCollectionCover.test-d.d.ts +0 -1
  56. package/dist/tests/__typechecks__/uploadFile.test-d.d.ts +0 -1
  57. package/dist/tests/__typechecks__/uploadRaindropCover.test-d.d.ts +0 -1
  58. package/dist/tests/_helpers/axios.d.ts +0 -11
  59. package/dist/tests/_helpers/common.d.ts +0 -2
  60. package/dist/tests/_helpers/polly.d.ts +0 -5
  61. package/dist/tests/_helpers/raindrop.d.ts +0 -17
  62. package/dist/tests/_helpers/typechecks.d.ts +0 -14
  63. package/dist/tests/_helpers/utils.d.ts +0 -1
  64. package/dist/tests/_helpers/vitest.d.ts +0 -29
  65. package/dist/tests/client/auth.test.d.ts +0 -1
  66. package/dist/tests/client/client.test.d.ts +0 -1
  67. package/dist/tests/client/collection.test.d.ts +0 -1
  68. package/dist/tests/client/raindrop.test.d.ts +0 -1
  69. package/dist/tests/generated/auth.test.d.ts +0 -1
  70. package/dist/tests/generated/collection.test.d.ts +0 -1
  71. package/dist/tests/generated/filter.test.d.ts +0 -1
  72. package/dist/tests/generated/highlight.test.d.ts +0 -1
  73. package/dist/tests/generated/import.test.d.ts +0 -1
  74. package/dist/tests/generated/raindrop.test.d.ts +0 -1
  75. package/dist/tests/generated/tag.test.d.ts +0 -1
  76. package/dist/tests/generated/user.test.d.ts +0 -1
  77. package/dist/tests/setup.d.ts +0 -1
  78. package/dist/tests/utils/tree.test.d.ts +0 -1
package/dist/index.es.js DELETED
@@ -1,1912 +0,0 @@
1
- import e from "axios";
2
- //#region \0rolldown/runtime.js
3
- var t = Object.defineProperty, n = (e, n) => {
4
- let r = {};
5
- for (var i in e) t(r, i, {
6
- get: e[i],
7
- enumerable: !0
8
- });
9
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
10
- }, r = "https://api.raindrop.io".replace(/\/+$/, ""), i = class {
11
- basePath;
12
- axios;
13
- configuration;
14
- constructor(t, n = r, i = e) {
15
- this.basePath = n, this.axios = i, t && (this.configuration = t, this.basePath = t.basePath ?? n);
16
- }
17
- }, a = class extends Error {
18
- field;
19
- constructor(e, t) {
20
- super(t), this.field = e, this.name = "RequiredError";
21
- }
22
- }, o = {}, s = "https://example.com", c = function(e, t, n) {
23
- if (n == null) throw new a(t, `Required parameter ${t} was null or undefined when calling ${e}.`);
24
- }, l = async function(e, t) {
25
- t && t.accessToken && (e.Authorization = "Bearer " + (typeof t.accessToken == "function" ? await t.accessToken() : await t.accessToken));
26
- };
27
- function u(e, t, n = "") {
28
- t != null && (typeof t == "object" ? Array.isArray(t) ? t.forEach((t) => u(e, t, n)) : Object.keys(t).forEach((r) => u(e, t[r], `${n}${n === "" ? "" : "."}${r}`)) : e.has(n) ? e.append(n, t) : e.set(n, t));
29
- }
30
- var d = function(e, ...t) {
31
- let n = new URLSearchParams(e.search);
32
- u(n, t), e.search = n.toString();
33
- }, f = function(e, t, n) {
34
- let r = typeof e != "string";
35
- return (r && n && n.isJsonMime ? n.isJsonMime(t.headers["Content-Type"]) : r) ? JSON.stringify(e === void 0 ? {} : p(e)) : e || "";
36
- };
37
- function p(e) {
38
- if (typeof Set > "u" || typeof Map > "u" || typeof e != "object" || !e) return e;
39
- if (e instanceof Set) return Array.from(e).map((e) => p(e));
40
- if (e instanceof Map) {
41
- let t = [];
42
- return e.forEach((e, n) => {
43
- t.push([n, p(e)]);
44
- }), h(t);
45
- }
46
- return Array.isArray(e) ? e.map((e) => p(e)) : h(m(e).map(([e, t]) => [e, p(t)]));
47
- }
48
- function m(e) {
49
- return Object.keys(e).map((t) => [t, e[t]]);
50
- }
51
- function h(e) {
52
- return [...e].reduce((e, [t, n]) => (e[t] = n, e), {});
53
- }
54
- var g = function(e) {
55
- return e.pathname + e.search + e.hash;
56
- }, _ = function(e, t, n, r) {
57
- return (i = t, a = n) => {
58
- let o = {
59
- ...e.options,
60
- url: (i.defaults.baseURL ? "" : r?.basePath ?? a) + e.url
61
- };
62
- return i.request(o);
63
- };
64
- }, v = { Collections: "collections" }, y = { AuthorizationCode: "authorization_code" }, b = { RefreshToken: "refresh_token" }, x = {
65
- Member: "member",
66
- Viewer: "viewer"
67
- }, ee = { Bearer: "Bearer" }, S = function(e) {
68
- return {
69
- authorize: async (t, n, r = {}) => {
70
- c("authorize", "redirectUri", t), c("authorize", "clientId", n);
71
- let i = new URL("/v1/oauth/authorize", s), a;
72
- e && (a = e.baseOptions);
73
- let o = {
74
- method: "GET",
75
- ...a,
76
- ...r
77
- }, l = {}, u = {};
78
- t !== void 0 && (u.redirect_uri = t), n !== void 0 && (u.client_id = n), d(i, u);
79
- let f = a && a.headers ? a.headers : {};
80
- return o.headers = {
81
- ...l,
82
- ...f,
83
- ...r.headers
84
- }, {
85
- url: g(i),
86
- options: o
87
- };
88
- },
89
- getOrRefreshToken: async (t, n = {}) => {
90
- let r = new URL("/v1/oauth/access_token", s), i;
91
- e && (i = e.baseOptions);
92
- let a = {
93
- method: "POST",
94
- ...i,
95
- ...n
96
- }, o = {};
97
- o["Content-Type"] = "application/json", d(r, {});
98
- let c = i && i.headers ? i.headers : {};
99
- return a.headers = {
100
- ...o,
101
- ...c,
102
- ...n.headers
103
- }, a.data = f(t, a, e), {
104
- url: g(r),
105
- options: a
106
- };
107
- }
108
- };
109
- }, C = function(t) {
110
- let n = S(t);
111
- return {
112
- async authorize(i, a, s) {
113
- let c = await n.authorize(i, a, s), l = t?.serverIndex ?? 0, u = o["AuthenticationApi.authorize"]?.[l]?.url;
114
- return (n, i) => _(c, e, r, t)(n, u || i);
115
- },
116
- async getOrRefreshToken(i, a) {
117
- let s = await n.getOrRefreshToken(i, a), c = t?.serverIndex ?? 0, l = o["AuthenticationApi.getOrRefreshToken"]?.[c]?.url;
118
- return (n, i) => _(s, e, r, t)(n, l || i);
119
- }
120
- };
121
- }, te = function(e, t, n) {
122
- let r = C(e);
123
- return {
124
- authorize(e, i, a) {
125
- return r.authorize(e, i, a).then((e) => e(n, t));
126
- },
127
- getOrRefreshToken(e, i) {
128
- return r.getOrRefreshToken(e, i).then((e) => e(n, t));
129
- }
130
- };
131
- }, w = class extends i {
132
- authorize(e, t, n) {
133
- return C(this.configuration).authorize(e, t, n).then((e) => e(this.axios, this.basePath));
134
- }
135
- getOrRefreshToken(e, t) {
136
- return C(this.configuration).getOrRefreshToken(e, t).then((e) => e(this.axios, this.basePath));
137
- }
138
- }, T = function(e) {
139
- return {
140
- acceptInvitation: async (t, n = {}) => {
141
- c("acceptInvitation", "id", t);
142
- let r = "/rest/v1/collection/{id}/join".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
143
- e && (a = e.baseOptions);
144
- let o = {
145
- method: "POST",
146
- ...a,
147
- ...n
148
- }, u = {};
149
- await l(u, e), d(i, {});
150
- let f = a && a.headers ? a.headers : {};
151
- return o.headers = {
152
- ...u,
153
- ...f,
154
- ...n.headers
155
- }, {
156
- url: g(i),
157
- options: o
158
- };
159
- },
160
- changeCollaboratorAccessLevel: async (t, n, r, i = {}) => {
161
- c("changeCollaboratorAccessLevel", "userId", t), c("changeCollaboratorAccessLevel", "id", n);
162
- let a = "/rest/v1/collection/{id}/sharing/{userId}".replace("{userId}", encodeURIComponent(String(t))).replace("{id}", encodeURIComponent(String(n))), o = new URL(a, s), u;
163
- e && (u = e.baseOptions);
164
- let p = {
165
- method: "PUT",
166
- ...u,
167
- ...i
168
- }, m = {};
169
- await l(m, e), m["Content-Type"] = "application/json", d(o, {});
170
- let h = u && u.headers ? u.headers : {};
171
- return p.headers = {
172
- ...m,
173
- ...h,
174
- ...i.headers
175
- }, p.data = f(r, p, e), {
176
- url: g(o),
177
- options: p
178
- };
179
- },
180
- createCollection: async (t, n = {}) => {
181
- let r = new URL("/rest/v1/collection", s), i;
182
- e && (i = e.baseOptions);
183
- let a = {
184
- method: "POST",
185
- ...i,
186
- ...n
187
- }, o = {};
188
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
189
- let c = i && i.headers ? i.headers : {};
190
- return a.headers = {
191
- ...o,
192
- ...c,
193
- ...n.headers
194
- }, a.data = f(t, a, e), {
195
- url: g(r),
196
- options: a
197
- };
198
- },
199
- deleteCollaborator: async (t, n, r = {}) => {
200
- c("deleteCollaborator", "userId", t), c("deleteCollaborator", "id", n);
201
- let i = "/rest/v1/collection/{id}/sharing/{userId}".replace("{userId}", encodeURIComponent(String(t))).replace("{id}", encodeURIComponent(String(n))), a = new URL(i, s), o;
202
- e && (o = e.baseOptions);
203
- let u = {
204
- method: "DELETE",
205
- ...o,
206
- ...r
207
- }, f = {};
208
- await l(f, e), d(a, {});
209
- let p = o && o.headers ? o.headers : {};
210
- return u.headers = {
211
- ...f,
212
- ...p,
213
- ...r.headers
214
- }, {
215
- url: g(a),
216
- options: u
217
- };
218
- },
219
- emptyTrash: async (t = {}) => {
220
- let n = new URL("/rest/v1/collection/-99", s), r;
221
- e && (r = e.baseOptions);
222
- let i = {
223
- method: "DELETE",
224
- ...r,
225
- ...t
226
- }, a = {};
227
- await l(a, e), d(n, {});
228
- let o = r && r.headers ? r.headers : {};
229
- return i.headers = {
230
- ...a,
231
- ...o,
232
- ...t.headers
233
- }, {
234
- url: g(n),
235
- options: i
236
- };
237
- },
238
- getChildCollections: async (t = {}) => {
239
- let n = new URL("/rest/v1/collections/childrens", s), r;
240
- e && (r = e.baseOptions);
241
- let i = {
242
- method: "GET",
243
- ...r,
244
- ...t
245
- }, a = {};
246
- await l(a, e), d(n, {});
247
- let o = r && r.headers ? r.headers : {};
248
- return i.headers = {
249
- ...a,
250
- ...o,
251
- ...t.headers
252
- }, {
253
- url: g(n),
254
- options: i
255
- };
256
- },
257
- getCollaborators: async (t, n = {}) => {
258
- c("getCollaborators", "id", t);
259
- let r = "/rest/v1/collection/{id}/sharing".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
260
- e && (a = e.baseOptions);
261
- let o = {
262
- method: "GET",
263
- ...a,
264
- ...n
265
- }, u = {};
266
- await l(u, e), d(i, {});
267
- let f = a && a.headers ? a.headers : {};
268
- return o.headers = {
269
- ...u,
270
- ...f,
271
- ...n.headers
272
- }, {
273
- url: g(i),
274
- options: o
275
- };
276
- },
277
- getCollection: async (t, n = {}) => {
278
- c("getCollection", "id", t);
279
- let r = "/rest/v1/collection/{id}".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
280
- e && (a = e.baseOptions);
281
- let o = {
282
- method: "GET",
283
- ...a,
284
- ...n
285
- }, u = {};
286
- await l(u, e), d(i, {});
287
- let f = a && a.headers ? a.headers : {};
288
- return o.headers = {
289
- ...u,
290
- ...f,
291
- ...n.headers
292
- }, {
293
- url: g(i),
294
- options: o
295
- };
296
- },
297
- getFeaturedCovers: async (t = {}) => {
298
- let n = new URL("/rest/v1/collections/covers", s), r;
299
- e && (r = e.baseOptions);
300
- let i = {
301
- method: "GET",
302
- ...r,
303
- ...t
304
- }, a = {};
305
- await l(a, e), d(n, {});
306
- let o = r && r.headers ? r.headers : {};
307
- return i.headers = {
308
- ...a,
309
- ...o,
310
- ...t.headers
311
- }, {
312
- url: g(n),
313
- options: i
314
- };
315
- },
316
- getRootCollections: async (t = {}) => {
317
- let n = new URL("/rest/v1/collections", s), r;
318
- e && (r = e.baseOptions);
319
- let i = {
320
- method: "GET",
321
- ...r,
322
- ...t
323
- }, a = {};
324
- await l(a, e), d(n, {});
325
- let o = r && r.headers ? r.headers : {};
326
- return i.headers = {
327
- ...a,
328
- ...o,
329
- ...t.headers
330
- }, {
331
- url: g(n),
332
- options: i
333
- };
334
- },
335
- getSystemCollectionStats: async (t = {}) => {
336
- let n = new URL("/rest/v1/user/stats", s), r;
337
- e && (r = e.baseOptions);
338
- let i = {
339
- method: "GET",
340
- ...r,
341
- ...t
342
- }, a = {};
343
- await l(a, e), d(n, {});
344
- let o = r && r.headers ? r.headers : {};
345
- return i.headers = {
346
- ...a,
347
- ...o,
348
- ...t.headers
349
- }, {
350
- url: g(n),
351
- options: i
352
- };
353
- },
354
- mergeCollections: async (t, n = {}) => {
355
- let r = new URL("/rest/v1/collections/merge", s), i;
356
- e && (i = e.baseOptions);
357
- let a = {
358
- method: "PUT",
359
- ...i,
360
- ...n
361
- }, o = {};
362
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
363
- let c = i && i.headers ? i.headers : {};
364
- return a.headers = {
365
- ...o,
366
- ...c,
367
- ...n.headers
368
- }, a.data = f(t, a, e), {
369
- url: g(r),
370
- options: a
371
- };
372
- },
373
- removeAllEmptyCollections: async (t = {}) => {
374
- let n = new URL("/rest/v1/collections/clean", s), r;
375
- e && (r = e.baseOptions);
376
- let i = {
377
- method: "PUT",
378
- ...r,
379
- ...t
380
- }, a = {};
381
- await l(a, e), d(n, {});
382
- let o = r && r.headers ? r.headers : {};
383
- return i.headers = {
384
- ...a,
385
- ...o,
386
- ...t.headers
387
- }, {
388
- url: g(n),
389
- options: i
390
- };
391
- },
392
- removeCollection: async (t, n = {}) => {
393
- c("removeCollection", "id", t);
394
- let r = "/rest/v1/collection/{id}".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
395
- e && (a = e.baseOptions);
396
- let o = {
397
- method: "DELETE",
398
- ...a,
399
- ...n
400
- }, u = {};
401
- await l(u, e), d(i, {});
402
- let f = a && a.headers ? a.headers : {};
403
- return o.headers = {
404
- ...u,
405
- ...f,
406
- ...n.headers
407
- }, {
408
- url: g(i),
409
- options: o
410
- };
411
- },
412
- removeCollections: async (t, n = {}) => {
413
- let r = new URL("/rest/v1/collections", s), i;
414
- e && (i = e.baseOptions);
415
- let a = {
416
- method: "DELETE",
417
- ...i,
418
- ...n
419
- }, o = {};
420
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
421
- let c = i && i.headers ? i.headers : {};
422
- return a.headers = {
423
- ...o,
424
- ...c,
425
- ...n.headers
426
- }, a.data = f(t, a, e), {
427
- url: g(r),
428
- options: a
429
- };
430
- },
431
- reorderAllCollections: async (t, n = {}) => {
432
- let r = new URL("/rest/v1/collections", s), i;
433
- e && (i = e.baseOptions);
434
- let a = {
435
- method: "PUT",
436
- ...i,
437
- ...n
438
- }, o = {};
439
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
440
- let c = i && i.headers ? i.headers : {};
441
- return a.headers = {
442
- ...o,
443
- ...c,
444
- ...n.headers
445
- }, a.data = f(t, a, e), {
446
- url: g(r),
447
- options: a
448
- };
449
- },
450
- searchCovers: async (t, n = {}) => {
451
- c("searchCovers", "text", t);
452
- let r = "/rest/v1/collections/covers/{text}".replace("{text}", encodeURIComponent(String(t))), i = new URL(r, s), a;
453
- e && (a = e.baseOptions);
454
- let o = {
455
- method: "GET",
456
- ...a,
457
- ...n
458
- }, u = {};
459
- await l(u, e), d(i, {});
460
- let f = a && a.headers ? a.headers : {};
461
- return o.headers = {
462
- ...u,
463
- ...f,
464
- ...n.headers
465
- }, {
466
- url: g(i),
467
- options: o
468
- };
469
- },
470
- shareCollection: async (t, n, r = {}) => {
471
- c("shareCollection", "id", t);
472
- let i = "/rest/v1/collection/{id}/sharing".replace("{id}", encodeURIComponent(String(t))), a = new URL(i, s), o;
473
- e && (o = e.baseOptions);
474
- let u = {
475
- method: "POST",
476
- ...o,
477
- ...r
478
- }, p = {};
479
- await l(p, e), p["Content-Type"] = "application/json", d(a, {});
480
- let m = o && o.headers ? o.headers : {};
481
- return u.headers = {
482
- ...p,
483
- ...m,
484
- ...r.headers
485
- }, u.data = f(n, u, e), {
486
- url: g(a),
487
- options: u
488
- };
489
- },
490
- unshareOrLeaveCollection: async (t, n = {}) => {
491
- c("unshareOrLeaveCollection", "id", t);
492
- let r = "/rest/v1/collection/{id}/sharing".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
493
- e && (a = e.baseOptions);
494
- let o = {
495
- method: "DELETE",
496
- ...a,
497
- ...n
498
- }, u = {};
499
- await l(u, e), d(i, {});
500
- let f = a && a.headers ? a.headers : {};
501
- return o.headers = {
502
- ...u,
503
- ...f,
504
- ...n.headers
505
- }, {
506
- url: g(i),
507
- options: o
508
- };
509
- },
510
- updateCollection: async (t, n, r = {}) => {
511
- c("updateCollection", "id", t);
512
- let i = "/rest/v1/collection/{id}".replace("{id}", encodeURIComponent(String(t))), a = new URL(i, s), o;
513
- e && (o = e.baseOptions);
514
- let u = {
515
- method: "PUT",
516
- ...o,
517
- ...r
518
- }, p = {};
519
- await l(p, e), p["Content-Type"] = "application/json", d(a, {});
520
- let m = o && o.headers ? o.headers : {};
521
- return u.headers = {
522
- ...p,
523
- ...m,
524
- ...r.headers
525
- }, u.data = f(n, u, e), {
526
- url: g(a),
527
- options: u
528
- };
529
- },
530
- uploadCollectionCover: async (t, n, r = {}) => {
531
- c("uploadCollectionCover", "id", t);
532
- let i = "/rest/v1/collection/{id}/cover".replace("{id}", encodeURIComponent(String(t))), a = new URL(i, s), o;
533
- e && (o = e.baseOptions);
534
- let u = {
535
- method: "PUT",
536
- ...o,
537
- ...r
538
- }, f = {}, p = {}, m = new (e && e.formDataCtor || FormData)();
539
- await l(f, e), n !== void 0 && m.append("cover", n), f["Content-Type"] = "multipart/form-data", d(a, p);
540
- let h = o && o.headers ? o.headers : {};
541
- return u.headers = {
542
- ...f,
543
- ...h,
544
- ...r.headers
545
- }, u.data = m, {
546
- url: g(a),
547
- options: u
548
- };
549
- }
550
- };
551
- }, E = function(t) {
552
- let n = T(t);
553
- return {
554
- async acceptInvitation(i, a) {
555
- let s = await n.acceptInvitation(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.acceptInvitation"]?.[c]?.url;
556
- return (n, i) => _(s, e, r, t)(n, l || i);
557
- },
558
- async changeCollaboratorAccessLevel(i, a, s, c) {
559
- let l = await n.changeCollaboratorAccessLevel(i, a, s, c), u = t?.serverIndex ?? 0, d = o["CollectionApi.changeCollaboratorAccessLevel"]?.[u]?.url;
560
- return (n, i) => _(l, e, r, t)(n, d || i);
561
- },
562
- async createCollection(i, a) {
563
- let s = await n.createCollection(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.createCollection"]?.[c]?.url;
564
- return (n, i) => _(s, e, r, t)(n, l || i);
565
- },
566
- async deleteCollaborator(i, a, s) {
567
- let c = await n.deleteCollaborator(i, a, s), l = t?.serverIndex ?? 0, u = o["CollectionApi.deleteCollaborator"]?.[l]?.url;
568
- return (n, i) => _(c, e, r, t)(n, u || i);
569
- },
570
- async emptyTrash(i) {
571
- let a = await n.emptyTrash(i), s = t?.serverIndex ?? 0, c = o["CollectionApi.emptyTrash"]?.[s]?.url;
572
- return (n, i) => _(a, e, r, t)(n, c || i);
573
- },
574
- async getChildCollections(i) {
575
- let a = await n.getChildCollections(i), s = t?.serverIndex ?? 0, c = o["CollectionApi.getChildCollections"]?.[s]?.url;
576
- return (n, i) => _(a, e, r, t)(n, c || i);
577
- },
578
- async getCollaborators(i, a) {
579
- let s = await n.getCollaborators(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.getCollaborators"]?.[c]?.url;
580
- return (n, i) => _(s, e, r, t)(n, l || i);
581
- },
582
- async getCollection(i, a) {
583
- let s = await n.getCollection(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.getCollection"]?.[c]?.url;
584
- return (n, i) => _(s, e, r, t)(n, l || i);
585
- },
586
- async getFeaturedCovers(i) {
587
- let a = await n.getFeaturedCovers(i), s = t?.serverIndex ?? 0, c = o["CollectionApi.getFeaturedCovers"]?.[s]?.url;
588
- return (n, i) => _(a, e, r, t)(n, c || i);
589
- },
590
- async getRootCollections(i) {
591
- let a = await n.getRootCollections(i), s = t?.serverIndex ?? 0, c = o["CollectionApi.getRootCollections"]?.[s]?.url;
592
- return (n, i) => _(a, e, r, t)(n, c || i);
593
- },
594
- async getSystemCollectionStats(i) {
595
- let a = await n.getSystemCollectionStats(i), s = t?.serverIndex ?? 0, c = o["CollectionApi.getSystemCollectionStats"]?.[s]?.url;
596
- return (n, i) => _(a, e, r, t)(n, c || i);
597
- },
598
- async mergeCollections(i, a) {
599
- let s = await n.mergeCollections(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.mergeCollections"]?.[c]?.url;
600
- return (n, i) => _(s, e, r, t)(n, l || i);
601
- },
602
- async removeAllEmptyCollections(i) {
603
- let a = await n.removeAllEmptyCollections(i), s = t?.serverIndex ?? 0, c = o["CollectionApi.removeAllEmptyCollections"]?.[s]?.url;
604
- return (n, i) => _(a, e, r, t)(n, c || i);
605
- },
606
- async removeCollection(i, a) {
607
- let s = await n.removeCollection(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.removeCollection"]?.[c]?.url;
608
- return (n, i) => _(s, e, r, t)(n, l || i);
609
- },
610
- async removeCollections(i, a) {
611
- let s = await n.removeCollections(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.removeCollections"]?.[c]?.url;
612
- return (n, i) => _(s, e, r, t)(n, l || i);
613
- },
614
- async reorderAllCollections(i, a) {
615
- let s = await n.reorderAllCollections(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.reorderAllCollections"]?.[c]?.url;
616
- return (n, i) => _(s, e, r, t)(n, l || i);
617
- },
618
- async searchCovers(i, a) {
619
- let s = await n.searchCovers(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.searchCovers"]?.[c]?.url;
620
- return (n, i) => _(s, e, r, t)(n, l || i);
621
- },
622
- async shareCollection(i, a, s) {
623
- let c = await n.shareCollection(i, a, s), l = t?.serverIndex ?? 0, u = o["CollectionApi.shareCollection"]?.[l]?.url;
624
- return (n, i) => _(c, e, r, t)(n, u || i);
625
- },
626
- async unshareOrLeaveCollection(i, a) {
627
- let s = await n.unshareOrLeaveCollection(i, a), c = t?.serverIndex ?? 0, l = o["CollectionApi.unshareOrLeaveCollection"]?.[c]?.url;
628
- return (n, i) => _(s, e, r, t)(n, l || i);
629
- },
630
- async updateCollection(i, a, s) {
631
- let c = await n.updateCollection(i, a, s), l = t?.serverIndex ?? 0, u = o["CollectionApi.updateCollection"]?.[l]?.url;
632
- return (n, i) => _(c, e, r, t)(n, u || i);
633
- },
634
- async uploadCollectionCover(i, a, s) {
635
- let c = await n.uploadCollectionCover(i, a, s), l = t?.serverIndex ?? 0, u = o["CollectionApi.uploadCollectionCover"]?.[l]?.url;
636
- return (n, i) => _(c, e, r, t)(n, u || i);
637
- }
638
- };
639
- }, D = function(e, t, n) {
640
- let r = E(e);
641
- return {
642
- acceptInvitation(e, i) {
643
- return r.acceptInvitation(e, i).then((e) => e(n, t));
644
- },
645
- changeCollaboratorAccessLevel(e, i, a, o) {
646
- return r.changeCollaboratorAccessLevel(e, i, a, o).then((e) => e(n, t));
647
- },
648
- createCollection(e, i) {
649
- return r.createCollection(e, i).then((e) => e(n, t));
650
- },
651
- deleteCollaborator(e, i, a) {
652
- return r.deleteCollaborator(e, i, a).then((e) => e(n, t));
653
- },
654
- emptyTrash(e) {
655
- return r.emptyTrash(e).then((e) => e(n, t));
656
- },
657
- getChildCollections(e) {
658
- return r.getChildCollections(e).then((e) => e(n, t));
659
- },
660
- getCollaborators(e, i) {
661
- return r.getCollaborators(e, i).then((e) => e(n, t));
662
- },
663
- getCollection(e, i) {
664
- return r.getCollection(e, i).then((e) => e(n, t));
665
- },
666
- getFeaturedCovers(e) {
667
- return r.getFeaturedCovers(e).then((e) => e(n, t));
668
- },
669
- getRootCollections(e) {
670
- return r.getRootCollections(e).then((e) => e(n, t));
671
- },
672
- getSystemCollectionStats(e) {
673
- return r.getSystemCollectionStats(e).then((e) => e(n, t));
674
- },
675
- mergeCollections(e, i) {
676
- return r.mergeCollections(e, i).then((e) => e(n, t));
677
- },
678
- removeAllEmptyCollections(e) {
679
- return r.removeAllEmptyCollections(e).then((e) => e(n, t));
680
- },
681
- removeCollection(e, i) {
682
- return r.removeCollection(e, i).then((e) => e(n, t));
683
- },
684
- removeCollections(e, i) {
685
- return r.removeCollections(e, i).then((e) => e(n, t));
686
- },
687
- reorderAllCollections(e, i) {
688
- return r.reorderAllCollections(e, i).then((e) => e(n, t));
689
- },
690
- searchCovers(e, i) {
691
- return r.searchCovers(e, i).then((e) => e(n, t));
692
- },
693
- shareCollection(e, i, a) {
694
- return r.shareCollection(e, i, a).then((e) => e(n, t));
695
- },
696
- unshareOrLeaveCollection(e, i) {
697
- return r.unshareOrLeaveCollection(e, i).then((e) => e(n, t));
698
- },
699
- updateCollection(e, i, a) {
700
- return r.updateCollection(e, i, a).then((e) => e(n, t));
701
- },
702
- uploadCollectionCover(e, i, a) {
703
- return r.uploadCollectionCover(e, i, a).then((e) => e(n, t));
704
- }
705
- };
706
- }, O = class extends i {
707
- acceptInvitation(e, t) {
708
- return E(this.configuration).acceptInvitation(e, t).then((e) => e(this.axios, this.basePath));
709
- }
710
- changeCollaboratorAccessLevel(e, t, n, r) {
711
- return E(this.configuration).changeCollaboratorAccessLevel(e, t, n, r).then((e) => e(this.axios, this.basePath));
712
- }
713
- createCollection(e, t) {
714
- return E(this.configuration).createCollection(e, t).then((e) => e(this.axios, this.basePath));
715
- }
716
- deleteCollaborator(e, t, n) {
717
- return E(this.configuration).deleteCollaborator(e, t, n).then((e) => e(this.axios, this.basePath));
718
- }
719
- emptyTrash(e) {
720
- return E(this.configuration).emptyTrash(e).then((e) => e(this.axios, this.basePath));
721
- }
722
- getChildCollections(e) {
723
- return E(this.configuration).getChildCollections(e).then((e) => e(this.axios, this.basePath));
724
- }
725
- getCollaborators(e, t) {
726
- return E(this.configuration).getCollaborators(e, t).then((e) => e(this.axios, this.basePath));
727
- }
728
- getCollection(e, t) {
729
- return E(this.configuration).getCollection(e, t).then((e) => e(this.axios, this.basePath));
730
- }
731
- getFeaturedCovers(e) {
732
- return E(this.configuration).getFeaturedCovers(e).then((e) => e(this.axios, this.basePath));
733
- }
734
- getRootCollections(e) {
735
- return E(this.configuration).getRootCollections(e).then((e) => e(this.axios, this.basePath));
736
- }
737
- getSystemCollectionStats(e) {
738
- return E(this.configuration).getSystemCollectionStats(e).then((e) => e(this.axios, this.basePath));
739
- }
740
- mergeCollections(e, t) {
741
- return E(this.configuration).mergeCollections(e, t).then((e) => e(this.axios, this.basePath));
742
- }
743
- removeAllEmptyCollections(e) {
744
- return E(this.configuration).removeAllEmptyCollections(e).then((e) => e(this.axios, this.basePath));
745
- }
746
- removeCollection(e, t) {
747
- return E(this.configuration).removeCollection(e, t).then((e) => e(this.axios, this.basePath));
748
- }
749
- removeCollections(e, t) {
750
- return E(this.configuration).removeCollections(e, t).then((e) => e(this.axios, this.basePath));
751
- }
752
- reorderAllCollections(e, t) {
753
- return E(this.configuration).reorderAllCollections(e, t).then((e) => e(this.axios, this.basePath));
754
- }
755
- searchCovers(e, t) {
756
- return E(this.configuration).searchCovers(e, t).then((e) => e(this.axios, this.basePath));
757
- }
758
- shareCollection(e, t, n) {
759
- return E(this.configuration).shareCollection(e, t, n).then((e) => e(this.axios, this.basePath));
760
- }
761
- unshareOrLeaveCollection(e, t) {
762
- return E(this.configuration).unshareOrLeaveCollection(e, t).then((e) => e(this.axios, this.basePath));
763
- }
764
- updateCollection(e, t, n) {
765
- return E(this.configuration).updateCollection(e, t, n).then((e) => e(this.axios, this.basePath));
766
- }
767
- uploadCollectionCover(e, t, n) {
768
- return E(this.configuration).uploadCollectionCover(e, t, n).then((e) => e(this.axios, this.basePath));
769
- }
770
- }, k = function(e) {
771
- return { getFilters: async (t, n, r, i = {}) => {
772
- c("getFilters", "collectionId", t);
773
- let a = "/rest/v1/filters/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), o = new URL(a, s), u;
774
- e && (u = e.baseOptions);
775
- let f = {
776
- method: "GET",
777
- ...u,
778
- ...i
779
- }, p = {}, m = {};
780
- await l(p, e), n !== void 0 && (m.tagsSort = n), r !== void 0 && (m.search = r), d(o, m);
781
- let h = u && u.headers ? u.headers : {};
782
- return f.headers = {
783
- ...p,
784
- ...h,
785
- ...i.headers
786
- }, {
787
- url: g(o),
788
- options: f
789
- };
790
- } };
791
- }, A = function(t) {
792
- let n = k(t);
793
- return { async getFilters(i, a, s, c) {
794
- let l = await n.getFilters(i, a, s, c), u = t?.serverIndex ?? 0, d = o["FilterApi.getFilters"]?.[u]?.url;
795
- return (n, i) => _(l, e, r, t)(n, d || i);
796
- } };
797
- }, ne = function(e, t, n) {
798
- let r = A(e);
799
- return { getFilters(e, i, a, o) {
800
- return r.getFilters(e, i, a, o).then((e) => e(n, t));
801
- } };
802
- }, j = class extends i {
803
- getFilters(e, t, n, r) {
804
- return A(this.configuration).getFilters(e, t, n, r).then((e) => e(this.axios, this.basePath));
805
- }
806
- }, re = {
807
- MinusCount: "-count",
808
- Id: "_id"
809
- }, M = function(e) {
810
- return {
811
- getAllHighlights: async (t, n, r = {}) => {
812
- let i = new URL("/rest/v1/highlights", s), a;
813
- e && (a = e.baseOptions);
814
- let o = {
815
- method: "GET",
816
- ...a,
817
- ...r
818
- }, c = {}, u = {};
819
- await l(c, e), t !== void 0 && (u.page = t), n !== void 0 && (u.perpage = n), d(i, u);
820
- let f = a && a.headers ? a.headers : {};
821
- return o.headers = {
822
- ...c,
823
- ...f,
824
- ...r.headers
825
- }, {
826
- url: g(i),
827
- options: o
828
- };
829
- },
830
- getHighlightsInCollection: async (t, n, r, i = {}) => {
831
- c("getHighlightsInCollection", "collectionId", t);
832
- let a = "/rest/v1/highlights/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), o = new URL(a, s), u;
833
- e && (u = e.baseOptions);
834
- let f = {
835
- method: "GET",
836
- ...u,
837
- ...i
838
- }, p = {}, m = {};
839
- await l(p, e), n !== void 0 && (m.page = n), r !== void 0 && (m.perpage = r), d(o, m);
840
- let h = u && u.headers ? u.headers : {};
841
- return f.headers = {
842
- ...p,
843
- ...h,
844
- ...i.headers
845
- }, {
846
- url: g(o),
847
- options: f
848
- };
849
- },
850
- getRaindrop: async (t, n = {}) => {
851
- c("getRaindrop", "id", t);
852
- let r = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
853
- e && (a = e.baseOptions);
854
- let o = {
855
- method: "GET",
856
- ...a,
857
- ...n
858
- }, u = {};
859
- await l(u, e), d(i, {});
860
- let f = a && a.headers ? a.headers : {};
861
- return o.headers = {
862
- ...u,
863
- ...f,
864
- ...n.headers
865
- }, {
866
- url: g(i),
867
- options: o
868
- };
869
- },
870
- updateRaindrop: async (t, n, r = {}) => {
871
- c("updateRaindrop", "id", t);
872
- let i = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), a = new URL(i, s), o;
873
- e && (o = e.baseOptions);
874
- let u = {
875
- method: "PUT",
876
- ...o,
877
- ...r
878
- }, p = {};
879
- await l(p, e), p["Content-Type"] = "application/json", d(a, {});
880
- let m = o && o.headers ? o.headers : {};
881
- return u.headers = {
882
- ...p,
883
- ...m,
884
- ...r.headers
885
- }, u.data = f(n, u, e), {
886
- url: g(a),
887
- options: u
888
- };
889
- }
890
- };
891
- }, N = function(t) {
892
- let n = M(t);
893
- return {
894
- async getAllHighlights(i, a, s) {
895
- let c = await n.getAllHighlights(i, a, s), l = t?.serverIndex ?? 0, u = o["HighlightApi.getAllHighlights"]?.[l]?.url;
896
- return (n, i) => _(c, e, r, t)(n, u || i);
897
- },
898
- async getHighlightsInCollection(i, a, s, c) {
899
- let l = await n.getHighlightsInCollection(i, a, s, c), u = t?.serverIndex ?? 0, d = o["HighlightApi.getHighlightsInCollection"]?.[u]?.url;
900
- return (n, i) => _(l, e, r, t)(n, d || i);
901
- },
902
- async getRaindrop(i, a) {
903
- let s = await n.getRaindrop(i, a), c = t?.serverIndex ?? 0, l = o["HighlightApi.getRaindrop"]?.[c]?.url;
904
- return (n, i) => _(s, e, r, t)(n, l || i);
905
- },
906
- async updateRaindrop(i, a, s) {
907
- let c = await n.updateRaindrop(i, a, s), l = t?.serverIndex ?? 0, u = o["HighlightApi.updateRaindrop"]?.[l]?.url;
908
- return (n, i) => _(c, e, r, t)(n, u || i);
909
- }
910
- };
911
- }, P = function(e, t, n) {
912
- let r = N(e);
913
- return {
914
- getAllHighlights(e, i, a) {
915
- return r.getAllHighlights(e, i, a).then((e) => e(n, t));
916
- },
917
- getHighlightsInCollection(e, i, a, o) {
918
- return r.getHighlightsInCollection(e, i, a, o).then((e) => e(n, t));
919
- },
920
- getRaindrop(e, i) {
921
- return r.getRaindrop(e, i).then((e) => e(n, t));
922
- },
923
- updateRaindrop(e, i, a) {
924
- return r.updateRaindrop(e, i, a).then((e) => e(n, t));
925
- }
926
- };
927
- }, F = class extends i {
928
- getAllHighlights(e, t, n) {
929
- return N(this.configuration).getAllHighlights(e, t, n).then((e) => e(this.axios, this.basePath));
930
- }
931
- getHighlightsInCollection(e, t, n, r) {
932
- return N(this.configuration).getHighlightsInCollection(e, t, n, r).then((e) => e(this.axios, this.basePath));
933
- }
934
- getRaindrop(e, t) {
935
- return N(this.configuration).getRaindrop(e, t).then((e) => e(this.axios, this.basePath));
936
- }
937
- updateRaindrop(e, t, n) {
938
- return N(this.configuration).updateRaindrop(e, t, n).then((e) => e(this.axios, this.basePath));
939
- }
940
- }, I = function(e) {
941
- return {
942
- checkURLsExist: async (t, n = {}) => {
943
- let r = new URL("/rest/v1/import/url/exists", s), i;
944
- e && (i = e.baseOptions);
945
- let a = {
946
- method: "POST",
947
- ...i,
948
- ...n
949
- }, o = {};
950
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
951
- let c = i && i.headers ? i.headers : {};
952
- return a.headers = {
953
- ...o,
954
- ...c,
955
- ...n.headers
956
- }, a.data = f(t, a, e), {
957
- url: g(r),
958
- options: a
959
- };
960
- },
961
- importHTMLBookmarkFile: async (t, n = {}) => {
962
- let r = new URL("/rest/v1/import/file", s), i;
963
- e && (i = e.baseOptions);
964
- let a = {
965
- method: "POST",
966
- ...i,
967
- ...n
968
- }, o = {}, c = {}, u = new (e && e.formDataCtor || FormData)();
969
- await l(o, e), t !== void 0 && u.append("import", t), o["Content-Type"] = "multipart/form-data", d(r, c);
970
- let f = i && i.headers ? i.headers : {};
971
- return a.headers = {
972
- ...o,
973
- ...f,
974
- ...n.headers
975
- }, a.data = u, {
976
- url: g(r),
977
- options: a
978
- };
979
- },
980
- parseURL: async (t, n = {}) => {
981
- let r = new URL("/rest/v1/import/url/parse", s), i;
982
- e && (i = e.baseOptions);
983
- let a = {
984
- method: "GET",
985
- ...i,
986
- ...n
987
- }, o = {}, c = {};
988
- await l(o, e), t !== void 0 && (c.url = t), d(r, c);
989
- let u = i && i.headers ? i.headers : {};
990
- return a.headers = {
991
- ...o,
992
- ...u,
993
- ...n.headers
994
- }, {
995
- url: g(r),
996
- options: a
997
- };
998
- }
999
- };
1000
- }, L = function(t) {
1001
- let n = I(t);
1002
- return {
1003
- async checkURLsExist(i, a) {
1004
- let s = await n.checkURLsExist(i, a), c = t?.serverIndex ?? 0, l = o["ImportApi.checkURLsExist"]?.[c]?.url;
1005
- return (n, i) => _(s, e, r, t)(n, l || i);
1006
- },
1007
- async importHTMLBookmarkFile(i, a) {
1008
- let s = await n.importHTMLBookmarkFile(i, a), c = t?.serverIndex ?? 0, l = o["ImportApi.importHTMLBookmarkFile"]?.[c]?.url;
1009
- return (n, i) => _(s, e, r, t)(n, l || i);
1010
- },
1011
- async parseURL(i, a) {
1012
- let s = await n.parseURL(i, a), c = t?.serverIndex ?? 0, l = o["ImportApi.parseURL"]?.[c]?.url;
1013
- return (n, i) => _(s, e, r, t)(n, l || i);
1014
- }
1015
- };
1016
- }, ie = function(e, t, n) {
1017
- let r = L(e);
1018
- return {
1019
- checkURLsExist(e, i) {
1020
- return r.checkURLsExist(e, i).then((e) => e(n, t));
1021
- },
1022
- importHTMLBookmarkFile(e, i) {
1023
- return r.importHTMLBookmarkFile(e, i).then((e) => e(n, t));
1024
- },
1025
- parseURL(e, i) {
1026
- return r.parseURL(e, i).then((e) => e(n, t));
1027
- }
1028
- };
1029
- }, R = class extends i {
1030
- checkURLsExist(e, t) {
1031
- return L(this.configuration).checkURLsExist(e, t).then((e) => e(this.axios, this.basePath));
1032
- }
1033
- importHTMLBookmarkFile(e, t) {
1034
- return L(this.configuration).importHTMLBookmarkFile(e, t).then((e) => e(this.axios, this.basePath));
1035
- }
1036
- parseURL(e, t) {
1037
- return L(this.configuration).parseURL(e, t).then((e) => e(this.axios, this.basePath));
1038
- }
1039
- }, z = function(e) {
1040
- return {
1041
- createRaindrop: async (t, n = {}) => {
1042
- let r = new URL("/rest/v1/raindrop", s), i;
1043
- e && (i = e.baseOptions);
1044
- let a = {
1045
- method: "POST",
1046
- ...i,
1047
- ...n
1048
- }, o = {};
1049
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
1050
- let c = i && i.headers ? i.headers : {};
1051
- return a.headers = {
1052
- ...o,
1053
- ...c,
1054
- ...n.headers
1055
- }, a.data = f(t, a, e), {
1056
- url: g(r),
1057
- options: a
1058
- };
1059
- },
1060
- createRaindrops: async (t, n = {}) => {
1061
- let r = new URL("/rest/v1/raindrops", s), i;
1062
- e && (i = e.baseOptions);
1063
- let a = {
1064
- method: "POST",
1065
- ...i,
1066
- ...n
1067
- }, o = {};
1068
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
1069
- let c = i && i.headers ? i.headers : {};
1070
- return a.headers = {
1071
- ...o,
1072
- ...c,
1073
- ...n.headers
1074
- }, a.data = f(t, a, e), {
1075
- url: g(r),
1076
- options: a
1077
- };
1078
- },
1079
- getPermanentCopy: async (t, n = {}) => {
1080
- c("getPermanentCopy", "id", t);
1081
- let r = "/rest/v1/raindrop/{id}/cache".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1082
- e && (a = e.baseOptions);
1083
- let o = {
1084
- method: "GET",
1085
- ...a,
1086
- ...n
1087
- }, u = {};
1088
- await l(u, e), d(i, {});
1089
- let f = a && a.headers ? a.headers : {};
1090
- return o.headers = {
1091
- ...u,
1092
- ...f,
1093
- ...n.headers
1094
- }, {
1095
- url: g(i),
1096
- options: o
1097
- };
1098
- },
1099
- getRaindrop: async (t, n = {}) => {
1100
- c("getRaindrop", "id", t);
1101
- let r = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1102
- e && (a = e.baseOptions);
1103
- let o = {
1104
- method: "GET",
1105
- ...a,
1106
- ...n
1107
- }, u = {};
1108
- await l(u, e), d(i, {});
1109
- let f = a && a.headers ? a.headers : {};
1110
- return o.headers = {
1111
- ...u,
1112
- ...f,
1113
- ...n.headers
1114
- }, {
1115
- url: g(i),
1116
- options: o
1117
- };
1118
- },
1119
- getRaindrops: async (t, n, r, i, a, o = {}) => {
1120
- c("getRaindrops", "collectionId", t);
1121
- let u = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), f = new URL(u, s), p;
1122
- e && (p = e.baseOptions);
1123
- let m = {
1124
- method: "GET",
1125
- ...p,
1126
- ...o
1127
- }, h = {}, _ = {};
1128
- await l(h, e), n !== void 0 && (_.sort = n), r !== void 0 && (_.perpage = r), i !== void 0 && (_.page = i), a !== void 0 && (_.search = a), d(f, _);
1129
- let v = p && p.headers ? p.headers : {};
1130
- return m.headers = {
1131
- ...h,
1132
- ...v,
1133
- ...o.headers
1134
- }, {
1135
- url: g(f),
1136
- options: m
1137
- };
1138
- },
1139
- removeRaindrop: async (t, n = {}) => {
1140
- c("removeRaindrop", "id", t);
1141
- let r = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1142
- e && (a = e.baseOptions);
1143
- let o = {
1144
- method: "DELETE",
1145
- ...a,
1146
- ...n
1147
- }, u = {};
1148
- await l(u, e), d(i, {});
1149
- let f = a && a.headers ? a.headers : {};
1150
- return o.headers = {
1151
- ...u,
1152
- ...f,
1153
- ...n.headers
1154
- }, {
1155
- url: g(i),
1156
- options: o
1157
- };
1158
- },
1159
- removeRaindrops: async (t, n, r, i = {}) => {
1160
- c("removeRaindrops", "collectionId", t);
1161
- let a = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), o = new URL(a, s), u;
1162
- e && (u = e.baseOptions);
1163
- let p = {
1164
- method: "DELETE",
1165
- ...u,
1166
- ...i
1167
- }, m = {}, h = {};
1168
- await l(m, e), n !== void 0 && (h.search = n), m["Content-Type"] = "application/json", d(o, h);
1169
- let _ = u && u.headers ? u.headers : {};
1170
- return p.headers = {
1171
- ...m,
1172
- ..._,
1173
- ...i.headers
1174
- }, p.data = f(r, p, e), {
1175
- url: g(o),
1176
- options: p
1177
- };
1178
- },
1179
- suggestForExistingBookmark: async (t, n = {}) => {
1180
- c("suggestForExistingBookmark", "id", t);
1181
- let r = "/rest/v1/raindrop/{id}/suggest".replace("{id}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1182
- e && (a = e.baseOptions);
1183
- let o = {
1184
- method: "GET",
1185
- ...a,
1186
- ...n
1187
- }, u = {};
1188
- await l(u, e), d(i, {});
1189
- let f = a && a.headers ? a.headers : {};
1190
- return o.headers = {
1191
- ...u,
1192
- ...f,
1193
- ...n.headers
1194
- }, {
1195
- url: g(i),
1196
- options: o
1197
- };
1198
- },
1199
- suggestForNewBookmark: async (t, n = {}) => {
1200
- let r = new URL("/rest/v1/raindrop/suggest", s), i;
1201
- e && (i = e.baseOptions);
1202
- let a = {
1203
- method: "POST",
1204
- ...i,
1205
- ...n
1206
- }, o = {};
1207
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
1208
- let c = i && i.headers ? i.headers : {};
1209
- return a.headers = {
1210
- ...o,
1211
- ...c,
1212
- ...n.headers
1213
- }, a.data = f(t, a, e), {
1214
- url: g(r),
1215
- options: a
1216
- };
1217
- },
1218
- updateRaindrop: async (t, n, r = {}) => {
1219
- c("updateRaindrop", "id", t);
1220
- let i = "/rest/v1/raindrop/{id}".replace("{id}", encodeURIComponent(String(t))), a = new URL(i, s), o;
1221
- e && (o = e.baseOptions);
1222
- let u = {
1223
- method: "PUT",
1224
- ...o,
1225
- ...r
1226
- }, p = {};
1227
- await l(p, e), p["Content-Type"] = "application/json", d(a, {});
1228
- let m = o && o.headers ? o.headers : {};
1229
- return u.headers = {
1230
- ...p,
1231
- ...m,
1232
- ...r.headers
1233
- }, u.data = f(n, u, e), {
1234
- url: g(a),
1235
- options: u
1236
- };
1237
- },
1238
- updateRaindrops: async (t, n, r = {}) => {
1239
- c("updateRaindrops", "collectionId", t);
1240
- let i = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), a = new URL(i, s), o;
1241
- e && (o = e.baseOptions);
1242
- let u = {
1243
- method: "PUT",
1244
- ...o,
1245
- ...r
1246
- }, p = {};
1247
- await l(p, e), p["Content-Type"] = "application/json", d(a, {});
1248
- let m = o && o.headers ? o.headers : {};
1249
- return u.headers = {
1250
- ...p,
1251
- ...m,
1252
- ...r.headers
1253
- }, u.data = f(n, u, e), {
1254
- url: g(a),
1255
- options: u
1256
- };
1257
- },
1258
- uploadFile: async (t, n, r = {}) => {
1259
- let i = new URL("/rest/v1/raindrop/file", s), a;
1260
- e && (a = e.baseOptions);
1261
- let o = {
1262
- method: "PUT",
1263
- ...a,
1264
- ...r
1265
- }, c = {}, u = {}, f = new (e && e.formDataCtor || FormData)();
1266
- await l(c, e), t !== void 0 && f.append("file", t), n !== void 0 && f.append("collectionId", n), c["Content-Type"] = "multipart/form-data", d(i, u);
1267
- let p = a && a.headers ? a.headers : {};
1268
- return o.headers = {
1269
- ...c,
1270
- ...p,
1271
- ...r.headers
1272
- }, o.data = f, {
1273
- url: g(i),
1274
- options: o
1275
- };
1276
- },
1277
- uploadRaindropCover: async (t, n, r = {}) => {
1278
- c("uploadRaindropCover", "id", t);
1279
- let i = "/rest/v1/raindrop/{id}/cover".replace("{id}", encodeURIComponent(String(t))), a = new URL(i, s), o;
1280
- e && (o = e.baseOptions);
1281
- let u = {
1282
- method: "PUT",
1283
- ...o,
1284
- ...r
1285
- }, f = {}, p = {}, m = new (e && e.formDataCtor || FormData)();
1286
- await l(f, e), n !== void 0 && m.append("cover", n), f["Content-Type"] = "multipart/form-data", d(a, p);
1287
- let h = o && o.headers ? o.headers : {};
1288
- return u.headers = {
1289
- ...f,
1290
- ...h,
1291
- ...r.headers
1292
- }, u.data = m, {
1293
- url: g(a),
1294
- options: u
1295
- };
1296
- }
1297
- };
1298
- }, B = function(t) {
1299
- let n = z(t);
1300
- return {
1301
- async createRaindrop(i, a) {
1302
- let s = await n.createRaindrop(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.createRaindrop"]?.[c]?.url;
1303
- return (n, i) => _(s, e, r, t)(n, l || i);
1304
- },
1305
- async createRaindrops(i, a) {
1306
- let s = await n.createRaindrops(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.createRaindrops"]?.[c]?.url;
1307
- return (n, i) => _(s, e, r, t)(n, l || i);
1308
- },
1309
- async getPermanentCopy(i, a) {
1310
- let s = await n.getPermanentCopy(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.getPermanentCopy"]?.[c]?.url;
1311
- return (n, i) => _(s, e, r, t)(n, l || i);
1312
- },
1313
- async getRaindrop(i, a) {
1314
- let s = await n.getRaindrop(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.getRaindrop"]?.[c]?.url;
1315
- return (n, i) => _(s, e, r, t)(n, l || i);
1316
- },
1317
- async getRaindrops(i, a, s, c, l, u) {
1318
- let d = await n.getRaindrops(i, a, s, c, l, u), f = t?.serverIndex ?? 0, p = o["RaindropApi.getRaindrops"]?.[f]?.url;
1319
- return (n, i) => _(d, e, r, t)(n, p || i);
1320
- },
1321
- async removeRaindrop(i, a) {
1322
- let s = await n.removeRaindrop(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.removeRaindrop"]?.[c]?.url;
1323
- return (n, i) => _(s, e, r, t)(n, l || i);
1324
- },
1325
- async removeRaindrops(i, a, s, c) {
1326
- let l = await n.removeRaindrops(i, a, s, c), u = t?.serverIndex ?? 0, d = o["RaindropApi.removeRaindrops"]?.[u]?.url;
1327
- return (n, i) => _(l, e, r, t)(n, d || i);
1328
- },
1329
- async suggestForExistingBookmark(i, a) {
1330
- let s = await n.suggestForExistingBookmark(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.suggestForExistingBookmark"]?.[c]?.url;
1331
- return (n, i) => _(s, e, r, t)(n, l || i);
1332
- },
1333
- async suggestForNewBookmark(i, a) {
1334
- let s = await n.suggestForNewBookmark(i, a), c = t?.serverIndex ?? 0, l = o["RaindropApi.suggestForNewBookmark"]?.[c]?.url;
1335
- return (n, i) => _(s, e, r, t)(n, l || i);
1336
- },
1337
- async updateRaindrop(i, a, s) {
1338
- let c = await n.updateRaindrop(i, a, s), l = t?.serverIndex ?? 0, u = o["RaindropApi.updateRaindrop"]?.[l]?.url;
1339
- return (n, i) => _(c, e, r, t)(n, u || i);
1340
- },
1341
- async updateRaindrops(i, a, s) {
1342
- let c = await n.updateRaindrops(i, a, s), l = t?.serverIndex ?? 0, u = o["RaindropApi.updateRaindrops"]?.[l]?.url;
1343
- return (n, i) => _(c, e, r, t)(n, u || i);
1344
- },
1345
- async uploadFile(i, a, s) {
1346
- let c = await n.uploadFile(i, a, s), l = t?.serverIndex ?? 0, u = o["RaindropApi.uploadFile"]?.[l]?.url;
1347
- return (n, i) => _(c, e, r, t)(n, u || i);
1348
- },
1349
- async uploadRaindropCover(i, a, s) {
1350
- let c = await n.uploadRaindropCover(i, a, s), l = t?.serverIndex ?? 0, u = o["RaindropApi.uploadRaindropCover"]?.[l]?.url;
1351
- return (n, i) => _(c, e, r, t)(n, u || i);
1352
- }
1353
- };
1354
- }, ae = function(e, t, n) {
1355
- let r = B(e);
1356
- return {
1357
- createRaindrop(e, i) {
1358
- return r.createRaindrop(e, i).then((e) => e(n, t));
1359
- },
1360
- createRaindrops(e, i) {
1361
- return r.createRaindrops(e, i).then((e) => e(n, t));
1362
- },
1363
- getPermanentCopy(e, i) {
1364
- return r.getPermanentCopy(e, i).then((e) => e(n, t));
1365
- },
1366
- getRaindrop(e, i) {
1367
- return r.getRaindrop(e, i).then((e) => e(n, t));
1368
- },
1369
- getRaindrops(e, i, a, o, s, c) {
1370
- return r.getRaindrops(e, i, a, o, s, c).then((e) => e(n, t));
1371
- },
1372
- removeRaindrop(e, i) {
1373
- return r.removeRaindrop(e, i).then((e) => e(n, t));
1374
- },
1375
- removeRaindrops(e, i, a, o) {
1376
- return r.removeRaindrops(e, i, a, o).then((e) => e(n, t));
1377
- },
1378
- suggestForExistingBookmark(e, i) {
1379
- return r.suggestForExistingBookmark(e, i).then((e) => e(n, t));
1380
- },
1381
- suggestForNewBookmark(e, i) {
1382
- return r.suggestForNewBookmark(e, i).then((e) => e(n, t));
1383
- },
1384
- updateRaindrop(e, i, a) {
1385
- return r.updateRaindrop(e, i, a).then((e) => e(n, t));
1386
- },
1387
- updateRaindrops(e, i, a) {
1388
- return r.updateRaindrops(e, i, a).then((e) => e(n, t));
1389
- },
1390
- uploadFile(e, i, a) {
1391
- return r.uploadFile(e, i, a).then((e) => e(n, t));
1392
- },
1393
- uploadRaindropCover(e, i, a) {
1394
- return r.uploadRaindropCover(e, i, a).then((e) => e(n, t));
1395
- }
1396
- };
1397
- }, V = class extends i {
1398
- createRaindrop(e, t) {
1399
- return B(this.configuration).createRaindrop(e, t).then((e) => e(this.axios, this.basePath));
1400
- }
1401
- createRaindrops(e, t) {
1402
- return B(this.configuration).createRaindrops(e, t).then((e) => e(this.axios, this.basePath));
1403
- }
1404
- getPermanentCopy(e, t) {
1405
- return B(this.configuration).getPermanentCopy(e, t).then((e) => e(this.axios, this.basePath));
1406
- }
1407
- getRaindrop(e, t) {
1408
- return B(this.configuration).getRaindrop(e, t).then((e) => e(this.axios, this.basePath));
1409
- }
1410
- getRaindrops(e, t, n, r, i, a) {
1411
- return B(this.configuration).getRaindrops(e, t, n, r, i, a).then((e) => e(this.axios, this.basePath));
1412
- }
1413
- removeRaindrop(e, t) {
1414
- return B(this.configuration).removeRaindrop(e, t).then((e) => e(this.axios, this.basePath));
1415
- }
1416
- removeRaindrops(e, t, n, r) {
1417
- return B(this.configuration).removeRaindrops(e, t, n, r).then((e) => e(this.axios, this.basePath));
1418
- }
1419
- suggestForExistingBookmark(e, t) {
1420
- return B(this.configuration).suggestForExistingBookmark(e, t).then((e) => e(this.axios, this.basePath));
1421
- }
1422
- suggestForNewBookmark(e, t) {
1423
- return B(this.configuration).suggestForNewBookmark(e, t).then((e) => e(this.axios, this.basePath));
1424
- }
1425
- updateRaindrop(e, t, n) {
1426
- return B(this.configuration).updateRaindrop(e, t, n).then((e) => e(this.axios, this.basePath));
1427
- }
1428
- updateRaindrops(e, t, n) {
1429
- return B(this.configuration).updateRaindrops(e, t, n).then((e) => e(this.axios, this.basePath));
1430
- }
1431
- uploadFile(e, t, n) {
1432
- return B(this.configuration).uploadFile(e, t, n).then((e) => e(this.axios, this.basePath));
1433
- }
1434
- uploadRaindropCover(e, t, n) {
1435
- return B(this.configuration).uploadRaindropCover(e, t, n).then((e) => e(this.axios, this.basePath));
1436
- }
1437
- }, H = function(e) {
1438
- return {
1439
- getTagsInCollection: async (t, n = {}) => {
1440
- let r = "/rest/v1/tags/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1441
- e && (a = e.baseOptions);
1442
- let o = {
1443
- method: "GET",
1444
- ...a,
1445
- ...n
1446
- }, c = {};
1447
- await l(c, e), d(i, {});
1448
- let u = a && a.headers ? a.headers : {};
1449
- return o.headers = {
1450
- ...c,
1451
- ...u,
1452
- ...n.headers
1453
- }, {
1454
- url: g(i),
1455
- options: o
1456
- };
1457
- },
1458
- removeTagsFromCollection: async (t, n, r = {}) => {
1459
- let i = "/rest/v1/tags/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), a = new URL(i, s), o;
1460
- e && (o = e.baseOptions);
1461
- let c = {
1462
- method: "DELETE",
1463
- ...o,
1464
- ...r
1465
- }, u = {};
1466
- await l(u, e), u["Content-Type"] = "application/json", d(a, {});
1467
- let p = o && o.headers ? o.headers : {};
1468
- return c.headers = {
1469
- ...u,
1470
- ...p,
1471
- ...r.headers
1472
- }, c.data = f(n, c, e), {
1473
- url: g(a),
1474
- options: c
1475
- };
1476
- },
1477
- renameOrMergeTags: async (t, n, r = {}) => {
1478
- let i = "/rest/v1/tags/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), a = new URL(i, s), o;
1479
- e && (o = e.baseOptions);
1480
- let c = {
1481
- method: "PUT",
1482
- ...o,
1483
- ...r
1484
- }, u = {};
1485
- await l(u, e), u["Content-Type"] = "application/json", d(a, {});
1486
- let p = o && o.headers ? o.headers : {};
1487
- return c.headers = {
1488
- ...u,
1489
- ...p,
1490
- ...r.headers
1491
- }, c.data = f(n, c, e), {
1492
- url: g(a),
1493
- options: c
1494
- };
1495
- }
1496
- };
1497
- }, U = function(t) {
1498
- let n = H(t);
1499
- return {
1500
- async getTagsInCollection(i, a) {
1501
- let s = await n.getTagsInCollection(i, a), c = t?.serverIndex ?? 0, l = o["TagApi.getTagsInCollection"]?.[c]?.url;
1502
- return (n, i) => _(s, e, r, t)(n, l || i);
1503
- },
1504
- async removeTagsFromCollection(i, a, s) {
1505
- let c = await n.removeTagsFromCollection(i, a, s), l = t?.serverIndex ?? 0, u = o["TagApi.removeTagsFromCollection"]?.[l]?.url;
1506
- return (n, i) => _(c, e, r, t)(n, u || i);
1507
- },
1508
- async renameOrMergeTags(i, a, s) {
1509
- let c = await n.renameOrMergeTags(i, a, s), l = t?.serverIndex ?? 0, u = o["TagApi.renameOrMergeTags"]?.[l]?.url;
1510
- return (n, i) => _(c, e, r, t)(n, u || i);
1511
- }
1512
- };
1513
- }, oe = function(e, t, n) {
1514
- let r = U(e);
1515
- return {
1516
- getTagsInCollection(e, i) {
1517
- return r.getTagsInCollection(e, i).then((e) => e(n, t));
1518
- },
1519
- removeTagsFromCollection(e, i, a) {
1520
- return r.removeTagsFromCollection(e, i, a).then((e) => e(n, t));
1521
- },
1522
- renameOrMergeTags(e, i, a) {
1523
- return r.renameOrMergeTags(e, i, a).then((e) => e(n, t));
1524
- }
1525
- };
1526
- }, W = class extends i {
1527
- getTagsInCollection(e, t) {
1528
- return U(this.configuration).getTagsInCollection(e, t).then((e) => e(this.axios, this.basePath));
1529
- }
1530
- removeTagsFromCollection(e, t, n) {
1531
- return U(this.configuration).removeTagsFromCollection(e, t, n).then((e) => e(this.axios, this.basePath));
1532
- }
1533
- renameOrMergeTags(e, t, n) {
1534
- return U(this.configuration).renameOrMergeTags(e, t, n).then((e) => e(this.axios, this.basePath));
1535
- }
1536
- }, G = function(e) {
1537
- return {
1538
- connectSocialNetworkProvider: async (t, n = {}) => {
1539
- c("connectSocialNetworkProvider", "provider", t);
1540
- let r = "/rest/v1/user/connect/{provider}".replace("{provider}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1541
- e && (a = e.baseOptions);
1542
- let o = {
1543
- method: "GET",
1544
- ...a,
1545
- ...n
1546
- }, u = {};
1547
- await l(u, e), d(i, {});
1548
- let f = a && a.headers ? a.headers : {};
1549
- return o.headers = {
1550
- ...u,
1551
- ...f,
1552
- ...n.headers
1553
- }, {
1554
- url: g(i),
1555
- options: o
1556
- };
1557
- },
1558
- disconnectSocialNetworkProvider: async (t, n = {}) => {
1559
- c("disconnectSocialNetworkProvider", "provider", t);
1560
- let r = "/rest/v1/user/connect/{provider}/revoke".replace("{provider}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1561
- e && (a = e.baseOptions);
1562
- let o = {
1563
- method: "GET",
1564
- ...a,
1565
- ...n
1566
- }, u = {};
1567
- await l(u, e), d(i, {});
1568
- let f = a && a.headers ? a.headers : {};
1569
- return o.headers = {
1570
- ...u,
1571
- ...f,
1572
- ...n.headers
1573
- }, {
1574
- url: g(i),
1575
- options: o
1576
- };
1577
- },
1578
- getCurrentUser: async (t = {}) => {
1579
- let n = new URL("/rest/v1/user", s), r;
1580
- e && (r = e.baseOptions);
1581
- let i = {
1582
- method: "GET",
1583
- ...r,
1584
- ...t
1585
- }, a = {};
1586
- await l(a, e), d(n, {});
1587
- let o = r && r.headers ? r.headers : {};
1588
- return i.headers = {
1589
- ...a,
1590
- ...o,
1591
- ...t.headers
1592
- }, {
1593
- url: g(n),
1594
- options: i
1595
- };
1596
- },
1597
- getPublicUserByName: async (t, n = {}) => {
1598
- c("getPublicUserByName", "name", t);
1599
- let r = "/rest/v1/user/{name}".replace("{name}", encodeURIComponent(String(t))), i = new URL(r, s), a;
1600
- e && (a = e.baseOptions);
1601
- let o = {
1602
- method: "GET",
1603
- ...a,
1604
- ...n
1605
- }, u = {};
1606
- await l(u, e), d(i, {});
1607
- let f = a && a.headers ? a.headers : {};
1608
- return o.headers = {
1609
- ...u,
1610
- ...f,
1611
- ...n.headers
1612
- }, {
1613
- url: g(i),
1614
- options: o
1615
- };
1616
- },
1617
- getSystemCollectionStats: async (t = {}) => {
1618
- let n = new URL("/rest/v1/user/stats", s), r;
1619
- e && (r = e.baseOptions);
1620
- let i = {
1621
- method: "GET",
1622
- ...r,
1623
- ...t
1624
- }, a = {};
1625
- await l(a, e), d(n, {});
1626
- let o = r && r.headers ? r.headers : {};
1627
- return i.headers = {
1628
- ...a,
1629
- ...o,
1630
- ...t.headers
1631
- }, {
1632
- url: g(n),
1633
- options: i
1634
- };
1635
- },
1636
- updateCurrentUser: async (t, n = {}) => {
1637
- let r = new URL("/rest/v1/user", s), i;
1638
- e && (i = e.baseOptions);
1639
- let a = {
1640
- method: "PUT",
1641
- ...i,
1642
- ...n
1643
- }, o = {};
1644
- await l(o, e), o["Content-Type"] = "application/json", d(r, {});
1645
- let c = i && i.headers ? i.headers : {};
1646
- return a.headers = {
1647
- ...o,
1648
- ...c,
1649
- ...n.headers
1650
- }, a.data = f(t, a, e), {
1651
- url: g(r),
1652
- options: a
1653
- };
1654
- }
1655
- };
1656
- }, K = function(t) {
1657
- let n = G(t);
1658
- return {
1659
- async connectSocialNetworkProvider(i, a) {
1660
- let s = await n.connectSocialNetworkProvider(i, a), c = t?.serverIndex ?? 0, l = o["UserApi.connectSocialNetworkProvider"]?.[c]?.url;
1661
- return (n, i) => _(s, e, r, t)(n, l || i);
1662
- },
1663
- async disconnectSocialNetworkProvider(i, a) {
1664
- let s = await n.disconnectSocialNetworkProvider(i, a), c = t?.serverIndex ?? 0, l = o["UserApi.disconnectSocialNetworkProvider"]?.[c]?.url;
1665
- return (n, i) => _(s, e, r, t)(n, l || i);
1666
- },
1667
- async getCurrentUser(i) {
1668
- let a = await n.getCurrentUser(i), s = t?.serverIndex ?? 0, c = o["UserApi.getCurrentUser"]?.[s]?.url;
1669
- return (n, i) => _(a, e, r, t)(n, c || i);
1670
- },
1671
- async getPublicUserByName(i, a) {
1672
- let s = await n.getPublicUserByName(i, a), c = t?.serverIndex ?? 0, l = o["UserApi.getPublicUserByName"]?.[c]?.url;
1673
- return (n, i) => _(s, e, r, t)(n, l || i);
1674
- },
1675
- async getSystemCollectionStats(i) {
1676
- let a = await n.getSystemCollectionStats(i), s = t?.serverIndex ?? 0, c = o["UserApi.getSystemCollectionStats"]?.[s]?.url;
1677
- return (n, i) => _(a, e, r, t)(n, c || i);
1678
- },
1679
- async updateCurrentUser(i, a) {
1680
- let s = await n.updateCurrentUser(i, a), c = t?.serverIndex ?? 0, l = o["UserApi.updateCurrentUser"]?.[c]?.url;
1681
- return (n, i) => _(s, e, r, t)(n, l || i);
1682
- }
1683
- };
1684
- }, se = function(e, t, n) {
1685
- let r = K(e);
1686
- return {
1687
- connectSocialNetworkProvider(e, i) {
1688
- return r.connectSocialNetworkProvider(e, i).then((e) => e(n, t));
1689
- },
1690
- disconnectSocialNetworkProvider(e, i) {
1691
- return r.disconnectSocialNetworkProvider(e, i).then((e) => e(n, t));
1692
- },
1693
- getCurrentUser(e) {
1694
- return r.getCurrentUser(e).then((e) => e(n, t));
1695
- },
1696
- getPublicUserByName(e, i) {
1697
- return r.getPublicUserByName(e, i).then((e) => e(n, t));
1698
- },
1699
- getSystemCollectionStats(e) {
1700
- return r.getSystemCollectionStats(e).then((e) => e(n, t));
1701
- },
1702
- updateCurrentUser(e, i) {
1703
- return r.updateCurrentUser(e, i).then((e) => e(n, t));
1704
- }
1705
- };
1706
- }, q = class extends i {
1707
- connectSocialNetworkProvider(e, t) {
1708
- return K(this.configuration).connectSocialNetworkProvider(e, t).then((e) => e(this.axios, this.basePath));
1709
- }
1710
- disconnectSocialNetworkProvider(e, t) {
1711
- return K(this.configuration).disconnectSocialNetworkProvider(e, t).then((e) => e(this.axios, this.basePath));
1712
- }
1713
- getCurrentUser(e) {
1714
- return K(this.configuration).getCurrentUser(e).then((e) => e(this.axios, this.basePath));
1715
- }
1716
- getPublicUserByName(e, t) {
1717
- return K(this.configuration).getPublicUserByName(e, t).then((e) => e(this.axios, this.basePath));
1718
- }
1719
- getSystemCollectionStats(e) {
1720
- return K(this.configuration).getSystemCollectionStats(e).then((e) => e(this.axios, this.basePath));
1721
- }
1722
- updateCurrentUser(e, t) {
1723
- return K(this.configuration).updateCurrentUser(e, t).then((e) => e(this.axios, this.basePath));
1724
- }
1725
- }, ce = {
1726
- Facebook: "facebook",
1727
- Google: "google",
1728
- Twitter: "twitter",
1729
- Vkontate: "vkontate",
1730
- Dropbox: "dropbox",
1731
- Gdrive: "gdrive"
1732
- }, le = {
1733
- Facebook: "facebook",
1734
- Google: "google",
1735
- Twitter: "twitter",
1736
- Vkontate: "vkontate",
1737
- Dropbox: "dropbox",
1738
- Gdrive: "gdrive"
1739
- }, J = class {
1740
- apiKey;
1741
- username;
1742
- password;
1743
- accessToken;
1744
- basePath;
1745
- serverIndex;
1746
- baseOptions;
1747
- formDataCtor;
1748
- constructor(e = {}) {
1749
- this.apiKey = e.apiKey, this.username = e.username, this.password = e.password, this.accessToken = e.accessToken, this.basePath = e.basePath, this.serverIndex = e.serverIndex, this.baseOptions = e.baseOptions, this.formDataCtor = e.formDataCtor;
1750
- }
1751
- isJsonMime(e) {
1752
- return e !== null && ((/* @__PURE__ */ RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i")).test(e) || e.toLowerCase() === "application/json-patch+json");
1753
- }
1754
- }, ue = /* @__PURE__ */ n({
1755
- AuthenticationApi: () => w,
1756
- AuthenticationApiAxiosParamCreator: () => S,
1757
- AuthenticationApiFactory: () => te,
1758
- AuthenticationApiFp: () => C,
1759
- CollectionApi: () => O,
1760
- CollectionApiAxiosParamCreator: () => T,
1761
- CollectionApiFactory: () => D,
1762
- CollectionApiFp: () => E,
1763
- CollectionRefRefEnum: () => v,
1764
- Configuration: () => J,
1765
- ConnectSocialNetworkProviderProviderEnum: () => ce,
1766
- DisconnectSocialNetworkProviderProviderEnum: () => le,
1767
- FilterApi: () => j,
1768
- FilterApiAxiosParamCreator: () => k,
1769
- FilterApiFactory: () => ne,
1770
- FilterApiFp: () => A,
1771
- GetFiltersTagsSortEnum: () => re,
1772
- HighlightApi: () => F,
1773
- HighlightApiAxiosParamCreator: () => M,
1774
- HighlightApiFactory: () => P,
1775
- HighlightApiFp: () => N,
1776
- ImportApi: () => R,
1777
- ImportApiAxiosParamCreator: () => I,
1778
- ImportApiFactory: () => ie,
1779
- ImportApiFp: () => L,
1780
- ObtainTokenGrantTypeEnum: () => y,
1781
- RaindropApi: () => V,
1782
- RaindropApiAxiosParamCreator: () => z,
1783
- RaindropApiFactory: () => ae,
1784
- RaindropApiFp: () => B,
1785
- RefreshTokenGrantTypeEnum: () => b,
1786
- Role: () => x,
1787
- TagApi: () => W,
1788
- TagApiAxiosParamCreator: () => H,
1789
- TagApiFactory: () => oe,
1790
- TagApiFp: () => U,
1791
- TokenResponseTokenTypeEnum: () => ee,
1792
- UserApi: () => q,
1793
- UserApiAxiosParamCreator: () => G,
1794
- UserApiFactory: () => se,
1795
- UserApiFp: () => K
1796
- }), de = class extends w {
1797
- async exchangeToken(e, t) {
1798
- return this.getOrRefreshToken({
1799
- ...e,
1800
- grant_type: y.AuthorizationCode
1801
- }, t).then((e) => {
1802
- if (Y(e.data)) throw Error(`Request failed with error: ${e.data.errorMessage}`);
1803
- return e;
1804
- });
1805
- }
1806
- async refreshToken(e, t) {
1807
- return this.getOrRefreshToken({
1808
- ...e,
1809
- grant_type: b.RefreshToken
1810
- }, t).then((e) => {
1811
- if (Y(e.data)) throw Error(`Request failed with error: ${e.data.errorMessage}`);
1812
- return e;
1813
- });
1814
- }
1815
- };
1816
- function Y(e) {
1817
- return "result" in e && e.result === !1;
1818
- }
1819
- //#endregion
1820
- //#region src/utils/tree.ts
1821
- var fe = /* @__PURE__ */ n({
1822
- TreeNode: () => X,
1823
- makeTree: () => Q
1824
- }), X = class {
1825
- _data;
1826
- _parent = null;
1827
- _children = [];
1828
- constructor(e, t) {
1829
- this._data = e, t && this.addChildren(...t);
1830
- }
1831
- get data() {
1832
- return this._data;
1833
- }
1834
- get parent() {
1835
- return this._parent;
1836
- }
1837
- set parent(e) {
1838
- this._parent = e, e._children.push(this);
1839
- }
1840
- isRoot() {
1841
- return this._parent === null;
1842
- }
1843
- get children() {
1844
- return this._children;
1845
- }
1846
- addChildren(...e) {
1847
- this._children.push(...e);
1848
- for (let t of e) t._parent = this;
1849
- }
1850
- traverse(e) {
1851
- e(this);
1852
- for (let t of this.children) t.traverse(e);
1853
- }
1854
- };
1855
- function Z(e, t, n) {
1856
- let r = n.filter((e) => e.parent === t);
1857
- for (let t of r) {
1858
- let r = t.toNode();
1859
- Z(r, t.id, n), e.addChildren(r);
1860
- }
1861
- }
1862
- function Q(e, t) {
1863
- let n = new X(e);
1864
- return Z(n, null, t), n;
1865
- }
1866
- //#endregion
1867
- //#region src/client/collection.ts
1868
- var pe = class extends O {
1869
- async getCollectionTree() {
1870
- let [{ data: e }, { data: t }] = await Promise.all([this.getRootCollections(), this.getChildCollections()]), n = e.items.map((e) => ({
1871
- data: e,
1872
- id: e._id.toString(),
1873
- parent: null,
1874
- toNode() {
1875
- return new X(this.data);
1876
- }
1877
- })), r = t.items.map((e) => ({
1878
- data: e,
1879
- id: e._id.toString(),
1880
- parent: e.parent?.$id.toString() || null,
1881
- toNode() {
1882
- return new X(this.data);
1883
- }
1884
- })), i = n.concat(r);
1885
- return i.sort((e, t) => e.data.title.localeCompare(t.data.title) || e.data._id - t.data._id), Q(null, i.filter((e, t, n) => n.findIndex((t) => t.id === e.id) === t));
1886
- }
1887
- }, me = class extends V {
1888
- async getAllRaindrops(e, t, n) {
1889
- let r = e ?? 0, i = t?.sort ?? "", a = t?.pageSize ?? 50, o = t?.search ?? "", { data: s } = await this.getRaindrops(r, i, a, 0, o, n), c = s.count, l = Math.ceil(c / a), u = Array.from(Array(l).keys());
1890
- u.shift();
1891
- let d = await Promise.all(u.map((e) => this.getRaindrops(r, i, a, e, o, n).then(({ data: e }) => e))), f = [...s.items];
1892
- for (let e of d) f.push(...e.items);
1893
- return f;
1894
- }
1895
- }, $ = class {
1896
- client;
1897
- configuration;
1898
- auth;
1899
- user;
1900
- collection;
1901
- filter;
1902
- highlight;
1903
- import;
1904
- raindrop;
1905
- tag;
1906
- constructor(t, n) {
1907
- this.client = n ?? e, this.configuration = t ?? new J(), this.auth = new de(t, void 0, this.client), this.collection = new pe(t, void 0, this.client), this.filter = new j(t, void 0, this.client), this.highlight = new F(t, void 0, this.client), this.import = new R(t, void 0, this.client), this.raindrop = new me(t, void 0, this.client), this.tag = new W(t, void 0, this.client), this.user = new q(t, void 0, this.client);
1908
- }
1909
- }, he = /* @__PURE__ */ n({ Raindrop: () => $ }), ge = /* @__PURE__ */ n({ tree: () => fe }), _e = $;
1910
- /* v8 ignore end */
1911
- //#endregion
1912
- export { he as client, _e as default, ue as generated, ge as utils };