kleisterjs 1.0.0

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 (121) hide show
  1. package/.codacy.yml +6 -0
  2. package/.editorconfig +24 -0
  3. package/.github/issue_template.md +9 -0
  4. package/.github/pull_request_template.md +8 -0
  5. package/.github/renovate.json +6 -0
  6. package/.github/semantic.yml +23 -0
  7. package/.github/settings.yml +44 -0
  8. package/.github/workflows/automerge.yml +49 -0
  9. package/.github/workflows/flake.yml +56 -0
  10. package/.github/workflows/general.yml +39 -0
  11. package/.github/workflows/openapi.yml +74 -0
  12. package/.github/workflows/release.yml +56 -0
  13. package/.openapi-generator/FILES +94 -0
  14. package/.openapi-generator/VERSION +1 -0
  15. package/.openapi-generator-ignore +3 -0
  16. package/.releaserc +195 -0
  17. package/CHANGELOG.md +17 -0
  18. package/CONTRIBUTING.md +121 -0
  19. package/DCO +34 -0
  20. package/LICENSE +202 -0
  21. package/README.md +88 -0
  22. package/api/auth-api.ts +743 -0
  23. package/api/fabric-api.ts +943 -0
  24. package/api/forge-api.ts +942 -0
  25. package/api/minecraft-api.ts +949 -0
  26. package/api/mod-api.ts +4028 -0
  27. package/api/neoforge-api.ts +945 -0
  28. package/api/pack-api.ts +4007 -0
  29. package/api/profile-api.ts +431 -0
  30. package/api/quilt-api.ts +942 -0
  31. package/api/team-api.ts +3216 -0
  32. package/api/user-api.ts +3210 -0
  33. package/api.ts +25 -0
  34. package/base.ts +91 -0
  35. package/common.ts +203 -0
  36. package/configuration.ts +132 -0
  37. package/flake.lock +472 -0
  38. package/flake.nix +59 -0
  39. package/hack/generate-client.sh +36 -0
  40. package/hack/openapi/templates/README.mustache +93 -0
  41. package/hack/openapi/templates/gitignore +6 -0
  42. package/index.ts +17 -0
  43. package/model/auth-login.ts +33 -0
  44. package/model/auth-token.ts +33 -0
  45. package/model/auth-verify.ts +33 -0
  46. package/model/build-version-params.ts +33 -0
  47. package/model/build-version.ts +64 -0
  48. package/model/build-versions.ts +55 -0
  49. package/model/build.ts +169 -0
  50. package/model/builds.ts +46 -0
  51. package/model/fabric-build-params.ts +33 -0
  52. package/model/fabric-builds.ts +46 -0
  53. package/model/fabric.ts +45 -0
  54. package/model/fabrics.ts +37 -0
  55. package/model/forge-build-params.ts +33 -0
  56. package/model/forge-builds.ts +46 -0
  57. package/model/forge.ts +51 -0
  58. package/model/forges.ts +37 -0
  59. package/model/index.ts +73 -0
  60. package/model/minecraft-build-params.ts +33 -0
  61. package/model/minecraft-builds.ts +46 -0
  62. package/model/minecraft.ts +51 -0
  63. package/model/minecrafts.ts +37 -0
  64. package/model/mod-team-params.ts +42 -0
  65. package/model/mod-teams.ts +46 -0
  66. package/model/mod-user-params.ts +42 -0
  67. package/model/mod-users.ts +46 -0
  68. package/model/mod.ts +123 -0
  69. package/model/mods.ts +37 -0
  70. package/model/neoforge-build-params.ts +33 -0
  71. package/model/neoforge-builds.ts +46 -0
  72. package/model/neoforge.ts +51 -0
  73. package/model/neoforges.ts +37 -0
  74. package/model/notification.ts +43 -0
  75. package/model/pack-back.ts +91 -0
  76. package/model/pack-icon.ts +91 -0
  77. package/model/pack-logo.ts +91 -0
  78. package/model/pack-team-params.ts +42 -0
  79. package/model/pack-teams.ts +46 -0
  80. package/model/pack-user-params.ts +42 -0
  81. package/model/pack-users.ts +46 -0
  82. package/model/pack.ts +142 -0
  83. package/model/packs.ts +37 -0
  84. package/model/profile.ts +118 -0
  85. package/model/quilt-build-params.ts +33 -0
  86. package/model/quilt-builds.ts +46 -0
  87. package/model/quilt.ts +45 -0
  88. package/model/quilts.ts +37 -0
  89. package/model/team-mod-params.ts +42 -0
  90. package/model/team-mod.ts +79 -0
  91. package/model/team-mods.ts +46 -0
  92. package/model/team-pack-params.ts +42 -0
  93. package/model/team-pack.ts +79 -0
  94. package/model/team-packs.ts +46 -0
  95. package/model/team-user-params.ts +42 -0
  96. package/model/team-users.ts +46 -0
  97. package/model/team.ts +79 -0
  98. package/model/teams.ts +37 -0
  99. package/model/user-auth.ts +45 -0
  100. package/model/user-mod-params.ts +42 -0
  101. package/model/user-mod.ts +79 -0
  102. package/model/user-mods.ts +46 -0
  103. package/model/user-pack-params.ts +42 -0
  104. package/model/user-pack.ts +79 -0
  105. package/model/user-packs.ts +46 -0
  106. package/model/user-team-params.ts +42 -0
  107. package/model/user-team.ts +79 -0
  108. package/model/user-teams.ts +46 -0
  109. package/model/user.ts +118 -0
  110. package/model/users.ts +37 -0
  111. package/model/validation.ts +33 -0
  112. package/model/version-build-params.ts +33 -0
  113. package/model/version-builds.ts +55 -0
  114. package/model/version-file.ts +91 -0
  115. package/model/version.ts +91 -0
  116. package/model/versions.ts +46 -0
  117. package/openapi.yml +12 -0
  118. package/openapitools.json +7 -0
  119. package/package.json +41 -0
  120. package/tsconfig.esm.json +7 -0
  121. package/tsconfig.json +18 -0
@@ -0,0 +1,949 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Kleister OpenAPI
5
+ * API definition for Kleister, manage mod packs for Minecraft
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0-alpha1
8
+ * Contact: kleister@webhippie.de
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import type { Configuration } from "../configuration";
16
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios";
17
+ import globalAxios from "axios";
18
+ // URLSearchParams not necessarily used
19
+ // @ts-ignore
20
+ import { URL, URLSearchParams } from "url";
21
+ // Some imports not used depending on template conditions
22
+ // @ts-ignore
23
+ import {
24
+ DUMMY_BASE_URL,
25
+ assertParamExists,
26
+ setApiKeyToObject,
27
+ setBasicAuthToObject,
28
+ setBearerAuthToObject,
29
+ setOAuthToObject,
30
+ setSearchParams,
31
+ serializeDataIfNeeded,
32
+ toPathString,
33
+ createRequestFunction,
34
+ } from "../common";
35
+ // @ts-ignore
36
+ import {
37
+ BASE_PATH,
38
+ COLLECTION_FORMATS,
39
+ type RequestArgs,
40
+ BaseAPI,
41
+ RequiredError,
42
+ operationServerMap,
43
+ } from "../base";
44
+ // @ts-ignore
45
+ import type { MinecraftBuildParams } from "../model";
46
+ // @ts-ignore
47
+ import type { MinecraftBuilds } from "../model";
48
+ // @ts-ignore
49
+ import type { Minecrafts } from "../model";
50
+ // @ts-ignore
51
+ import type { Notification } from "../model";
52
+ /**
53
+ * MinecraftApi - axios parameter creator
54
+ * @export
55
+ */
56
+ export const MinecraftApiAxiosParamCreator = function (
57
+ configuration?: Configuration,
58
+ ) {
59
+ return {
60
+ /**
61
+ *
62
+ * @summary Attach a build to a Minecraft version
63
+ * @param {string} minecraftId A minecraft identifier or slug
64
+ * @param {MinecraftBuildParams} minecraftBuildParams The build data to attach
65
+ * @param {*} [options] Override http request option.
66
+ * @throws {RequiredError}
67
+ */
68
+ attachMinecraftToBuild: async (
69
+ minecraftId: string,
70
+ minecraftBuildParams: MinecraftBuildParams,
71
+ options: RawAxiosRequestConfig = {},
72
+ ): Promise<RequestArgs> => {
73
+ // verify required parameter 'minecraftId' is not null or undefined
74
+ assertParamExists("attachMinecraftToBuild", "minecraftId", minecraftId);
75
+ // verify required parameter 'minecraftBuildParams' is not null or undefined
76
+ assertParamExists(
77
+ "attachMinecraftToBuild",
78
+ "minecraftBuildParams",
79
+ minecraftBuildParams,
80
+ );
81
+ const localVarPath = `/minecraft/{minecraft_id}/builds`.replace(
82
+ `{${"minecraft_id"}}`,
83
+ encodeURIComponent(String(minecraftId)),
84
+ );
85
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
86
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
87
+ let baseOptions;
88
+ if (configuration) {
89
+ baseOptions = configuration.baseOptions;
90
+ }
91
+
92
+ const localVarRequestOptions = {
93
+ method: "POST",
94
+ ...baseOptions,
95
+ ...options,
96
+ };
97
+ const localVarHeaderParameter = {} as any;
98
+ const localVarQueryParameter = {} as any;
99
+
100
+ // authentication Cookie required
101
+ await setApiKeyToObject(localVarHeaderParameter, "Cookie", configuration);
102
+
103
+ // authentication Basic required
104
+ // http basic authentication required
105
+ setBasicAuthToObject(localVarRequestOptions, configuration);
106
+
107
+ // authentication Header required
108
+ await setApiKeyToObject(
109
+ localVarHeaderParameter,
110
+ "X-API-Key",
111
+ configuration,
112
+ );
113
+
114
+ // authentication Bearer required
115
+ // http bearer authentication required
116
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
117
+
118
+ localVarHeaderParameter["Content-Type"] = "application/json";
119
+
120
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
121
+ let headersFromBaseOptions =
122
+ baseOptions && baseOptions.headers ? baseOptions.headers : {};
123
+ localVarRequestOptions.headers = {
124
+ ...localVarHeaderParameter,
125
+ ...headersFromBaseOptions,
126
+ ...options.headers,
127
+ };
128
+ localVarRequestOptions.data = serializeDataIfNeeded(
129
+ minecraftBuildParams,
130
+ localVarRequestOptions,
131
+ configuration,
132
+ );
133
+
134
+ return {
135
+ url: toPathString(localVarUrlObj),
136
+ options: localVarRequestOptions,
137
+ };
138
+ },
139
+ /**
140
+ *
141
+ * @summary Unlink a build from a Minecraft version
142
+ * @param {string} minecraftId A minecraft identifier or slug
143
+ * @param {MinecraftBuildParams} minecraftBuildParams The build data to unlink
144
+ * @param {*} [options] Override http request option.
145
+ * @throws {RequiredError}
146
+ */
147
+ deleteMinecraftFromBuild: async (
148
+ minecraftId: string,
149
+ minecraftBuildParams: MinecraftBuildParams,
150
+ options: RawAxiosRequestConfig = {},
151
+ ): Promise<RequestArgs> => {
152
+ // verify required parameter 'minecraftId' is not null or undefined
153
+ assertParamExists("deleteMinecraftFromBuild", "minecraftId", minecraftId);
154
+ // verify required parameter 'minecraftBuildParams' is not null or undefined
155
+ assertParamExists(
156
+ "deleteMinecraftFromBuild",
157
+ "minecraftBuildParams",
158
+ minecraftBuildParams,
159
+ );
160
+ const localVarPath = `/minecraft/{minecraft_id}/builds`.replace(
161
+ `{${"minecraft_id"}}`,
162
+ encodeURIComponent(String(minecraftId)),
163
+ );
164
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
166
+ let baseOptions;
167
+ if (configuration) {
168
+ baseOptions = configuration.baseOptions;
169
+ }
170
+
171
+ const localVarRequestOptions = {
172
+ method: "DELETE",
173
+ ...baseOptions,
174
+ ...options,
175
+ };
176
+ const localVarHeaderParameter = {} as any;
177
+ const localVarQueryParameter = {} as any;
178
+
179
+ // authentication Cookie required
180
+ await setApiKeyToObject(localVarHeaderParameter, "Cookie", configuration);
181
+
182
+ // authentication Basic required
183
+ // http basic authentication required
184
+ setBasicAuthToObject(localVarRequestOptions, configuration);
185
+
186
+ // authentication Header required
187
+ await setApiKeyToObject(
188
+ localVarHeaderParameter,
189
+ "X-API-Key",
190
+ configuration,
191
+ );
192
+
193
+ // authentication Bearer required
194
+ // http bearer authentication required
195
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
196
+
197
+ localVarHeaderParameter["Content-Type"] = "application/json";
198
+
199
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
200
+ let headersFromBaseOptions =
201
+ baseOptions && baseOptions.headers ? baseOptions.headers : {};
202
+ localVarRequestOptions.headers = {
203
+ ...localVarHeaderParameter,
204
+ ...headersFromBaseOptions,
205
+ ...options.headers,
206
+ };
207
+ localVarRequestOptions.data = serializeDataIfNeeded(
208
+ minecraftBuildParams,
209
+ localVarRequestOptions,
210
+ configuration,
211
+ );
212
+
213
+ return {
214
+ url: toPathString(localVarUrlObj),
215
+ options: localVarRequestOptions,
216
+ };
217
+ },
218
+ /**
219
+ *
220
+ * @summary Fetch the builds attached to a Minecraft version
221
+ * @param {string} minecraftId A minecraft identifier or slug
222
+ * @param {string} [search] Search query
223
+ * @param {ListMinecraftBuildsSortEnum} [sort] Sorting column
224
+ * @param {ListMinecraftBuildsOrderEnum} [order] Sorting order
225
+ * @param {number} [limit] Paging limit
226
+ * @param {number} [offset] Paging offset
227
+ * @param {*} [options] Override http request option.
228
+ * @throws {RequiredError}
229
+ */
230
+ listMinecraftBuilds: async (
231
+ minecraftId: string,
232
+ search?: string,
233
+ sort?: ListMinecraftBuildsSortEnum,
234
+ order?: ListMinecraftBuildsOrderEnum,
235
+ limit?: number,
236
+ offset?: number,
237
+ options: RawAxiosRequestConfig = {},
238
+ ): Promise<RequestArgs> => {
239
+ // verify required parameter 'minecraftId' is not null or undefined
240
+ assertParamExists("listMinecraftBuilds", "minecraftId", minecraftId);
241
+ const localVarPath = `/minecraft/{minecraft_id}/builds`.replace(
242
+ `{${"minecraft_id"}}`,
243
+ encodeURIComponent(String(minecraftId)),
244
+ );
245
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
246
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
247
+ let baseOptions;
248
+ if (configuration) {
249
+ baseOptions = configuration.baseOptions;
250
+ }
251
+
252
+ const localVarRequestOptions = {
253
+ method: "GET",
254
+ ...baseOptions,
255
+ ...options,
256
+ };
257
+ const localVarHeaderParameter = {} as any;
258
+ const localVarQueryParameter = {} as any;
259
+
260
+ // authentication Cookie required
261
+ await setApiKeyToObject(localVarHeaderParameter, "Cookie", configuration);
262
+
263
+ // authentication Basic required
264
+ // http basic authentication required
265
+ setBasicAuthToObject(localVarRequestOptions, configuration);
266
+
267
+ // authentication Header required
268
+ await setApiKeyToObject(
269
+ localVarHeaderParameter,
270
+ "X-API-Key",
271
+ configuration,
272
+ );
273
+
274
+ // authentication Bearer required
275
+ // http bearer authentication required
276
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
277
+
278
+ if (search !== undefined) {
279
+ localVarQueryParameter["search"] = search;
280
+ }
281
+
282
+ if (sort !== undefined) {
283
+ localVarQueryParameter["sort"] = sort;
284
+ }
285
+
286
+ if (order !== undefined) {
287
+ localVarQueryParameter["order"] = order;
288
+ }
289
+
290
+ if (limit !== undefined) {
291
+ localVarQueryParameter["limit"] = limit;
292
+ }
293
+
294
+ if (offset !== undefined) {
295
+ localVarQueryParameter["offset"] = offset;
296
+ }
297
+
298
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
299
+ let headersFromBaseOptions =
300
+ baseOptions && baseOptions.headers ? baseOptions.headers : {};
301
+ localVarRequestOptions.headers = {
302
+ ...localVarHeaderParameter,
303
+ ...headersFromBaseOptions,
304
+ ...options.headers,
305
+ };
306
+
307
+ return {
308
+ url: toPathString(localVarUrlObj),
309
+ options: localVarRequestOptions,
310
+ };
311
+ },
312
+ /**
313
+ *
314
+ * @summary Fetch the available Minecraft versions
315
+ * @param {string} [search] Search query
316
+ * @param {*} [options] Override http request option.
317
+ * @throws {RequiredError}
318
+ */
319
+ listMinecrafts: async (
320
+ search?: string,
321
+ options: RawAxiosRequestConfig = {},
322
+ ): Promise<RequestArgs> => {
323
+ const localVarPath = `/minecraft`;
324
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
325
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
326
+ let baseOptions;
327
+ if (configuration) {
328
+ baseOptions = configuration.baseOptions;
329
+ }
330
+
331
+ const localVarRequestOptions = {
332
+ method: "GET",
333
+ ...baseOptions,
334
+ ...options,
335
+ };
336
+ const localVarHeaderParameter = {} as any;
337
+ const localVarQueryParameter = {} as any;
338
+
339
+ // authentication Cookie required
340
+ await setApiKeyToObject(localVarHeaderParameter, "Cookie", configuration);
341
+
342
+ // authentication Basic required
343
+ // http basic authentication required
344
+ setBasicAuthToObject(localVarRequestOptions, configuration);
345
+
346
+ // authentication Header required
347
+ await setApiKeyToObject(
348
+ localVarHeaderParameter,
349
+ "X-API-Key",
350
+ configuration,
351
+ );
352
+
353
+ // authentication Bearer required
354
+ // http bearer authentication required
355
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
356
+
357
+ if (search !== undefined) {
358
+ localVarQueryParameter["search"] = search;
359
+ }
360
+
361
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
362
+ let headersFromBaseOptions =
363
+ baseOptions && baseOptions.headers ? baseOptions.headers : {};
364
+ localVarRequestOptions.headers = {
365
+ ...localVarHeaderParameter,
366
+ ...headersFromBaseOptions,
367
+ ...options.headers,
368
+ };
369
+
370
+ return {
371
+ url: toPathString(localVarUrlObj),
372
+ options: localVarRequestOptions,
373
+ };
374
+ },
375
+ /**
376
+ *
377
+ * @summary Update the available Minecraft versions
378
+ * @param {*} [options] Override http request option.
379
+ * @throws {RequiredError}
380
+ */
381
+ updateMinecraft: async (
382
+ options: RawAxiosRequestConfig = {},
383
+ ): Promise<RequestArgs> => {
384
+ const localVarPath = `/minecraft`;
385
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
386
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
387
+ let baseOptions;
388
+ if (configuration) {
389
+ baseOptions = configuration.baseOptions;
390
+ }
391
+
392
+ const localVarRequestOptions = {
393
+ method: "PUT",
394
+ ...baseOptions,
395
+ ...options,
396
+ };
397
+ const localVarHeaderParameter = {} as any;
398
+ const localVarQueryParameter = {} as any;
399
+
400
+ // authentication Cookie required
401
+ await setApiKeyToObject(localVarHeaderParameter, "Cookie", configuration);
402
+
403
+ // authentication Basic required
404
+ // http basic authentication required
405
+ setBasicAuthToObject(localVarRequestOptions, configuration);
406
+
407
+ // authentication Header required
408
+ await setApiKeyToObject(
409
+ localVarHeaderParameter,
410
+ "X-API-Key",
411
+ configuration,
412
+ );
413
+
414
+ // authentication Bearer required
415
+ // http bearer authentication required
416
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
417
+
418
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
419
+ let headersFromBaseOptions =
420
+ baseOptions && baseOptions.headers ? baseOptions.headers : {};
421
+ localVarRequestOptions.headers = {
422
+ ...localVarHeaderParameter,
423
+ ...headersFromBaseOptions,
424
+ ...options.headers,
425
+ };
426
+
427
+ return {
428
+ url: toPathString(localVarUrlObj),
429
+ options: localVarRequestOptions,
430
+ };
431
+ },
432
+ };
433
+ };
434
+
435
+ /**
436
+ * MinecraftApi - functional programming interface
437
+ * @export
438
+ */
439
+ export const MinecraftApiFp = function (configuration?: Configuration) {
440
+ const localVarAxiosParamCreator =
441
+ MinecraftApiAxiosParamCreator(configuration);
442
+ return {
443
+ /**
444
+ *
445
+ * @summary Attach a build to a Minecraft version
446
+ * @param {string} minecraftId A minecraft identifier or slug
447
+ * @param {MinecraftBuildParams} minecraftBuildParams The build data to attach
448
+ * @param {*} [options] Override http request option.
449
+ * @throws {RequiredError}
450
+ */
451
+ async attachMinecraftToBuild(
452
+ minecraftId: string,
453
+ minecraftBuildParams: MinecraftBuildParams,
454
+ options?: RawAxiosRequestConfig,
455
+ ): Promise<
456
+ (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Notification>
457
+ > {
458
+ const localVarAxiosArgs =
459
+ await localVarAxiosParamCreator.attachMinecraftToBuild(
460
+ minecraftId,
461
+ minecraftBuildParams,
462
+ options,
463
+ );
464
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
465
+ const localVarOperationServerBasePath =
466
+ operationServerMap["MinecraftApi.attachMinecraftToBuild"]?.[
467
+ localVarOperationServerIndex
468
+ ]?.url;
469
+ return (axios, basePath) =>
470
+ createRequestFunction(
471
+ localVarAxiosArgs,
472
+ globalAxios,
473
+ BASE_PATH,
474
+ configuration,
475
+ )(axios, localVarOperationServerBasePath || basePath);
476
+ },
477
+ /**
478
+ *
479
+ * @summary Unlink a build from a Minecraft version
480
+ * @param {string} minecraftId A minecraft identifier or slug
481
+ * @param {MinecraftBuildParams} minecraftBuildParams The build data to unlink
482
+ * @param {*} [options] Override http request option.
483
+ * @throws {RequiredError}
484
+ */
485
+ async deleteMinecraftFromBuild(
486
+ minecraftId: string,
487
+ minecraftBuildParams: MinecraftBuildParams,
488
+ options?: RawAxiosRequestConfig,
489
+ ): Promise<
490
+ (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Notification>
491
+ > {
492
+ const localVarAxiosArgs =
493
+ await localVarAxiosParamCreator.deleteMinecraftFromBuild(
494
+ minecraftId,
495
+ minecraftBuildParams,
496
+ options,
497
+ );
498
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
499
+ const localVarOperationServerBasePath =
500
+ operationServerMap["MinecraftApi.deleteMinecraftFromBuild"]?.[
501
+ localVarOperationServerIndex
502
+ ]?.url;
503
+ return (axios, basePath) =>
504
+ createRequestFunction(
505
+ localVarAxiosArgs,
506
+ globalAxios,
507
+ BASE_PATH,
508
+ configuration,
509
+ )(axios, localVarOperationServerBasePath || basePath);
510
+ },
511
+ /**
512
+ *
513
+ * @summary Fetch the builds attached to a Minecraft version
514
+ * @param {string} minecraftId A minecraft identifier or slug
515
+ * @param {string} [search] Search query
516
+ * @param {ListMinecraftBuildsSortEnum} [sort] Sorting column
517
+ * @param {ListMinecraftBuildsOrderEnum} [order] Sorting order
518
+ * @param {number} [limit] Paging limit
519
+ * @param {number} [offset] Paging offset
520
+ * @param {*} [options] Override http request option.
521
+ * @throws {RequiredError}
522
+ */
523
+ async listMinecraftBuilds(
524
+ minecraftId: string,
525
+ search?: string,
526
+ sort?: ListMinecraftBuildsSortEnum,
527
+ order?: ListMinecraftBuildsOrderEnum,
528
+ limit?: number,
529
+ offset?: number,
530
+ options?: RawAxiosRequestConfig,
531
+ ): Promise<
532
+ (
533
+ axios?: AxiosInstance,
534
+ basePath?: string,
535
+ ) => AxiosPromise<MinecraftBuilds>
536
+ > {
537
+ const localVarAxiosArgs =
538
+ await localVarAxiosParamCreator.listMinecraftBuilds(
539
+ minecraftId,
540
+ search,
541
+ sort,
542
+ order,
543
+ limit,
544
+ offset,
545
+ options,
546
+ );
547
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
548
+ const localVarOperationServerBasePath =
549
+ operationServerMap["MinecraftApi.listMinecraftBuilds"]?.[
550
+ localVarOperationServerIndex
551
+ ]?.url;
552
+ return (axios, basePath) =>
553
+ createRequestFunction(
554
+ localVarAxiosArgs,
555
+ globalAxios,
556
+ BASE_PATH,
557
+ configuration,
558
+ )(axios, localVarOperationServerBasePath || basePath);
559
+ },
560
+ /**
561
+ *
562
+ * @summary Fetch the available Minecraft versions
563
+ * @param {string} [search] Search query
564
+ * @param {*} [options] Override http request option.
565
+ * @throws {RequiredError}
566
+ */
567
+ async listMinecrafts(
568
+ search?: string,
569
+ options?: RawAxiosRequestConfig,
570
+ ): Promise<
571
+ (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Minecrafts>
572
+ > {
573
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listMinecrafts(
574
+ search,
575
+ options,
576
+ );
577
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
578
+ const localVarOperationServerBasePath =
579
+ operationServerMap["MinecraftApi.listMinecrafts"]?.[
580
+ localVarOperationServerIndex
581
+ ]?.url;
582
+ return (axios, basePath) =>
583
+ createRequestFunction(
584
+ localVarAxiosArgs,
585
+ globalAxios,
586
+ BASE_PATH,
587
+ configuration,
588
+ )(axios, localVarOperationServerBasePath || basePath);
589
+ },
590
+ /**
591
+ *
592
+ * @summary Update the available Minecraft versions
593
+ * @param {*} [options] Override http request option.
594
+ * @throws {RequiredError}
595
+ */
596
+ async updateMinecraft(
597
+ options?: RawAxiosRequestConfig,
598
+ ): Promise<
599
+ (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Notification>
600
+ > {
601
+ const localVarAxiosArgs =
602
+ await localVarAxiosParamCreator.updateMinecraft(options);
603
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
604
+ const localVarOperationServerBasePath =
605
+ operationServerMap["MinecraftApi.updateMinecraft"]?.[
606
+ localVarOperationServerIndex
607
+ ]?.url;
608
+ return (axios, basePath) =>
609
+ createRequestFunction(
610
+ localVarAxiosArgs,
611
+ globalAxios,
612
+ BASE_PATH,
613
+ configuration,
614
+ )(axios, localVarOperationServerBasePath || basePath);
615
+ },
616
+ };
617
+ };
618
+
619
+ /**
620
+ * MinecraftApi - factory interface
621
+ * @export
622
+ */
623
+ export const MinecraftApiFactory = function (
624
+ configuration?: Configuration,
625
+ basePath?: string,
626
+ axios?: AxiosInstance,
627
+ ) {
628
+ const localVarFp = MinecraftApiFp(configuration);
629
+ return {
630
+ /**
631
+ *
632
+ * @summary Attach a build to a Minecraft version
633
+ * @param {MinecraftApiAttachMinecraftToBuildRequest} requestParameters Request parameters.
634
+ * @param {*} [options] Override http request option.
635
+ * @throws {RequiredError}
636
+ */
637
+ attachMinecraftToBuild(
638
+ requestParameters: MinecraftApiAttachMinecraftToBuildRequest,
639
+ options?: RawAxiosRequestConfig,
640
+ ): AxiosPromise<Notification> {
641
+ return localVarFp
642
+ .attachMinecraftToBuild(
643
+ requestParameters.minecraftId,
644
+ requestParameters.minecraftBuildParams,
645
+ options,
646
+ )
647
+ .then((request) => request(axios, basePath));
648
+ },
649
+ /**
650
+ *
651
+ * @summary Unlink a build from a Minecraft version
652
+ * @param {MinecraftApiDeleteMinecraftFromBuildRequest} requestParameters Request parameters.
653
+ * @param {*} [options] Override http request option.
654
+ * @throws {RequiredError}
655
+ */
656
+ deleteMinecraftFromBuild(
657
+ requestParameters: MinecraftApiDeleteMinecraftFromBuildRequest,
658
+ options?: RawAxiosRequestConfig,
659
+ ): AxiosPromise<Notification> {
660
+ return localVarFp
661
+ .deleteMinecraftFromBuild(
662
+ requestParameters.minecraftId,
663
+ requestParameters.minecraftBuildParams,
664
+ options,
665
+ )
666
+ .then((request) => request(axios, basePath));
667
+ },
668
+ /**
669
+ *
670
+ * @summary Fetch the builds attached to a Minecraft version
671
+ * @param {MinecraftApiListMinecraftBuildsRequest} requestParameters Request parameters.
672
+ * @param {*} [options] Override http request option.
673
+ * @throws {RequiredError}
674
+ */
675
+ listMinecraftBuilds(
676
+ requestParameters: MinecraftApiListMinecraftBuildsRequest,
677
+ options?: RawAxiosRequestConfig,
678
+ ): AxiosPromise<MinecraftBuilds> {
679
+ return localVarFp
680
+ .listMinecraftBuilds(
681
+ requestParameters.minecraftId,
682
+ requestParameters.search,
683
+ requestParameters.sort,
684
+ requestParameters.order,
685
+ requestParameters.limit,
686
+ requestParameters.offset,
687
+ options,
688
+ )
689
+ .then((request) => request(axios, basePath));
690
+ },
691
+ /**
692
+ *
693
+ * @summary Fetch the available Minecraft versions
694
+ * @param {MinecraftApiListMinecraftsRequest} requestParameters Request parameters.
695
+ * @param {*} [options] Override http request option.
696
+ * @throws {RequiredError}
697
+ */
698
+ listMinecrafts(
699
+ requestParameters: MinecraftApiListMinecraftsRequest = {},
700
+ options?: RawAxiosRequestConfig,
701
+ ): AxiosPromise<Minecrafts> {
702
+ return localVarFp
703
+ .listMinecrafts(requestParameters.search, options)
704
+ .then((request) => request(axios, basePath));
705
+ },
706
+ /**
707
+ *
708
+ * @summary Update the available Minecraft versions
709
+ * @param {*} [options] Override http request option.
710
+ * @throws {RequiredError}
711
+ */
712
+ updateMinecraft(
713
+ options?: RawAxiosRequestConfig,
714
+ ): AxiosPromise<Notification> {
715
+ return localVarFp
716
+ .updateMinecraft(options)
717
+ .then((request) => request(axios, basePath));
718
+ },
719
+ };
720
+ };
721
+
722
+ /**
723
+ * Request parameters for attachMinecraftToBuild operation in MinecraftApi.
724
+ * @export
725
+ * @interface MinecraftApiAttachMinecraftToBuildRequest
726
+ */
727
+ export interface MinecraftApiAttachMinecraftToBuildRequest {
728
+ /**
729
+ * A minecraft identifier or slug
730
+ * @type {string}
731
+ * @memberof MinecraftApiAttachMinecraftToBuild
732
+ */
733
+ readonly minecraftId: string;
734
+
735
+ /**
736
+ * The build data to attach
737
+ * @type {MinecraftBuildParams}
738
+ * @memberof MinecraftApiAttachMinecraftToBuild
739
+ */
740
+ readonly minecraftBuildParams: MinecraftBuildParams;
741
+ }
742
+
743
+ /**
744
+ * Request parameters for deleteMinecraftFromBuild operation in MinecraftApi.
745
+ * @export
746
+ * @interface MinecraftApiDeleteMinecraftFromBuildRequest
747
+ */
748
+ export interface MinecraftApiDeleteMinecraftFromBuildRequest {
749
+ /**
750
+ * A minecraft identifier or slug
751
+ * @type {string}
752
+ * @memberof MinecraftApiDeleteMinecraftFromBuild
753
+ */
754
+ readonly minecraftId: string;
755
+
756
+ /**
757
+ * The build data to unlink
758
+ * @type {MinecraftBuildParams}
759
+ * @memberof MinecraftApiDeleteMinecraftFromBuild
760
+ */
761
+ readonly minecraftBuildParams: MinecraftBuildParams;
762
+ }
763
+
764
+ /**
765
+ * Request parameters for listMinecraftBuilds operation in MinecraftApi.
766
+ * @export
767
+ * @interface MinecraftApiListMinecraftBuildsRequest
768
+ */
769
+ export interface MinecraftApiListMinecraftBuildsRequest {
770
+ /**
771
+ * A minecraft identifier or slug
772
+ * @type {string}
773
+ * @memberof MinecraftApiListMinecraftBuilds
774
+ */
775
+ readonly minecraftId: string;
776
+
777
+ /**
778
+ * Search query
779
+ * @type {string}
780
+ * @memberof MinecraftApiListMinecraftBuilds
781
+ */
782
+ readonly search?: string;
783
+
784
+ /**
785
+ * Sorting column
786
+ * @type {'name' | 'public'}
787
+ * @memberof MinecraftApiListMinecraftBuilds
788
+ */
789
+ readonly sort?: ListMinecraftBuildsSortEnum;
790
+
791
+ /**
792
+ * Sorting order
793
+ * @type {'asc' | 'desc'}
794
+ * @memberof MinecraftApiListMinecraftBuilds
795
+ */
796
+ readonly order?: ListMinecraftBuildsOrderEnum;
797
+
798
+ /**
799
+ * Paging limit
800
+ * @type {number}
801
+ * @memberof MinecraftApiListMinecraftBuilds
802
+ */
803
+ readonly limit?: number;
804
+
805
+ /**
806
+ * Paging offset
807
+ * @type {number}
808
+ * @memberof MinecraftApiListMinecraftBuilds
809
+ */
810
+ readonly offset?: number;
811
+ }
812
+
813
+ /**
814
+ * Request parameters for listMinecrafts operation in MinecraftApi.
815
+ * @export
816
+ * @interface MinecraftApiListMinecraftsRequest
817
+ */
818
+ export interface MinecraftApiListMinecraftsRequest {
819
+ /**
820
+ * Search query
821
+ * @type {string}
822
+ * @memberof MinecraftApiListMinecrafts
823
+ */
824
+ readonly search?: string;
825
+ }
826
+
827
+ /**
828
+ * MinecraftApi - object-oriented interface
829
+ * @export
830
+ * @class MinecraftApi
831
+ * @extends {BaseAPI}
832
+ */
833
+ export class MinecraftApi extends BaseAPI {
834
+ /**
835
+ *
836
+ * @summary Attach a build to a Minecraft version
837
+ * @param {MinecraftApiAttachMinecraftToBuildRequest} requestParameters Request parameters.
838
+ * @param {*} [options] Override http request option.
839
+ * @throws {RequiredError}
840
+ * @memberof MinecraftApi
841
+ */
842
+ public attachMinecraftToBuild(
843
+ requestParameters: MinecraftApiAttachMinecraftToBuildRequest,
844
+ options?: RawAxiosRequestConfig,
845
+ ) {
846
+ return MinecraftApiFp(this.configuration)
847
+ .attachMinecraftToBuild(
848
+ requestParameters.minecraftId,
849
+ requestParameters.minecraftBuildParams,
850
+ options,
851
+ )
852
+ .then((request) => request(this.axios, this.basePath));
853
+ }
854
+
855
+ /**
856
+ *
857
+ * @summary Unlink a build from a Minecraft version
858
+ * @param {MinecraftApiDeleteMinecraftFromBuildRequest} requestParameters Request parameters.
859
+ * @param {*} [options] Override http request option.
860
+ * @throws {RequiredError}
861
+ * @memberof MinecraftApi
862
+ */
863
+ public deleteMinecraftFromBuild(
864
+ requestParameters: MinecraftApiDeleteMinecraftFromBuildRequest,
865
+ options?: RawAxiosRequestConfig,
866
+ ) {
867
+ return MinecraftApiFp(this.configuration)
868
+ .deleteMinecraftFromBuild(
869
+ requestParameters.minecraftId,
870
+ requestParameters.minecraftBuildParams,
871
+ options,
872
+ )
873
+ .then((request) => request(this.axios, this.basePath));
874
+ }
875
+
876
+ /**
877
+ *
878
+ * @summary Fetch the builds attached to a Minecraft version
879
+ * @param {MinecraftApiListMinecraftBuildsRequest} requestParameters Request parameters.
880
+ * @param {*} [options] Override http request option.
881
+ * @throws {RequiredError}
882
+ * @memberof MinecraftApi
883
+ */
884
+ public listMinecraftBuilds(
885
+ requestParameters: MinecraftApiListMinecraftBuildsRequest,
886
+ options?: RawAxiosRequestConfig,
887
+ ) {
888
+ return MinecraftApiFp(this.configuration)
889
+ .listMinecraftBuilds(
890
+ requestParameters.minecraftId,
891
+ requestParameters.search,
892
+ requestParameters.sort,
893
+ requestParameters.order,
894
+ requestParameters.limit,
895
+ requestParameters.offset,
896
+ options,
897
+ )
898
+ .then((request) => request(this.axios, this.basePath));
899
+ }
900
+
901
+ /**
902
+ *
903
+ * @summary Fetch the available Minecraft versions
904
+ * @param {MinecraftApiListMinecraftsRequest} requestParameters Request parameters.
905
+ * @param {*} [options] Override http request option.
906
+ * @throws {RequiredError}
907
+ * @memberof MinecraftApi
908
+ */
909
+ public listMinecrafts(
910
+ requestParameters: MinecraftApiListMinecraftsRequest = {},
911
+ options?: RawAxiosRequestConfig,
912
+ ) {
913
+ return MinecraftApiFp(this.configuration)
914
+ .listMinecrafts(requestParameters.search, options)
915
+ .then((request) => request(this.axios, this.basePath));
916
+ }
917
+
918
+ /**
919
+ *
920
+ * @summary Update the available Minecraft versions
921
+ * @param {*} [options] Override http request option.
922
+ * @throws {RequiredError}
923
+ * @memberof MinecraftApi
924
+ */
925
+ public updateMinecraft(options?: RawAxiosRequestConfig) {
926
+ return MinecraftApiFp(this.configuration)
927
+ .updateMinecraft(options)
928
+ .then((request) => request(this.axios, this.basePath));
929
+ }
930
+ }
931
+
932
+ /**
933
+ * @export
934
+ */
935
+ export const ListMinecraftBuildsSortEnum = {
936
+ Name: "name",
937
+ Public: "public",
938
+ } as const;
939
+ export type ListMinecraftBuildsSortEnum =
940
+ (typeof ListMinecraftBuildsSortEnum)[keyof typeof ListMinecraftBuildsSortEnum];
941
+ /**
942
+ * @export
943
+ */
944
+ export const ListMinecraftBuildsOrderEnum = {
945
+ Asc: "asc",
946
+ Desc: "desc",
947
+ } as const;
948
+ export type ListMinecraftBuildsOrderEnum =
949
+ (typeof ListMinecraftBuildsOrderEnum)[keyof typeof ListMinecraftBuildsOrderEnum];