@lasuillard/raindrop-client 0.8.0 → 0.8.2

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