kitstore-cli 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 (71) hide show
  1. package/.env.test +4 -0
  2. package/.eslintrc.js +29 -0
  3. package/dist/__tests__/commands/init.test.js +76 -0
  4. package/dist/__tests__/commands/install.test.js +422 -0
  5. package/dist/__tests__/commands/list.test.js +173 -0
  6. package/dist/__tests__/commands/login.test.js +281 -0
  7. package/dist/__tests__/commands/rule-check.test.js +72 -0
  8. package/dist/__tests__/commands/search.test.js +175 -0
  9. package/dist/__tests__/commands/upload.test.js +367 -0
  10. package/dist/__tests__/config.test.js +179 -0
  11. package/dist/__tests__/setup.js +8 -0
  12. package/dist/api/client.js +18 -0
  13. package/dist/api/generated/api.js +912 -0
  14. package/dist/api/generated/base.js +48 -0
  15. package/dist/api/generated/common.js +108 -0
  16. package/dist/api/generated/configuration.js +48 -0
  17. package/dist/api/generated/index.js +31 -0
  18. package/dist/commands/init.js +79 -0
  19. package/dist/commands/install.js +150 -0
  20. package/dist/commands/list.js +70 -0
  21. package/dist/commands/login.js +64 -0
  22. package/dist/commands/rule-check.js +81 -0
  23. package/dist/commands/search.js +59 -0
  24. package/dist/commands/upload.js +138 -0
  25. package/dist/config.js +84 -0
  26. package/dist/index.js +71 -0
  27. package/e2e/install.e2e.test.ts +237 -0
  28. package/e2e/integration.e2e.test.ts +346 -0
  29. package/e2e/login.e2e.test.ts +188 -0
  30. package/jest.config.js +24 -0
  31. package/openapitools.json +7 -0
  32. package/package.json +41 -0
  33. package/src/__tests__/commands/init.test.ts +52 -0
  34. package/src/__tests__/commands/install.test.ts +449 -0
  35. package/src/__tests__/commands/list.test.ts +164 -0
  36. package/src/__tests__/commands/login.test.ts +293 -0
  37. package/src/__tests__/commands/rule-check.test.ts +52 -0
  38. package/src/__tests__/commands/search.test.ts +168 -0
  39. package/src/__tests__/commands/upload.test.ts +404 -0
  40. package/src/__tests__/config.test.ts +181 -0
  41. package/src/__tests__/setup.ts +11 -0
  42. package/src/api/client.ts +20 -0
  43. package/src/api/generated/.openapi-generator/FILES +17 -0
  44. package/src/api/generated/.openapi-generator/VERSION +1 -0
  45. package/src/api/generated/.openapi-generator-ignore +23 -0
  46. package/src/api/generated/api.ts +1171 -0
  47. package/src/api/generated/base.ts +62 -0
  48. package/src/api/generated/common.ts +113 -0
  49. package/src/api/generated/configuration.ts +121 -0
  50. package/src/api/generated/docs/AuthApi.md +158 -0
  51. package/src/api/generated/docs/AuthResponseDto.md +22 -0
  52. package/src/api/generated/docs/AuthUserDto.md +24 -0
  53. package/src/api/generated/docs/HealthApi.md +183 -0
  54. package/src/api/generated/docs/LoginDto.md +22 -0
  55. package/src/api/generated/docs/RegisterDto.md +24 -0
  56. package/src/api/generated/docs/RuleAuthorDto.md +22 -0
  57. package/src/api/generated/docs/RuleResponseDto.md +36 -0
  58. package/src/api/generated/docs/RulesApi.md +289 -0
  59. package/src/api/generated/git_push.sh +57 -0
  60. package/src/api/generated/index.ts +18 -0
  61. package/src/commands/init.ts +46 -0
  62. package/src/commands/install.ts +129 -0
  63. package/src/commands/list.ts +71 -0
  64. package/src/commands/login.ts +65 -0
  65. package/src/commands/rule-check.ts +49 -0
  66. package/src/commands/search.ts +66 -0
  67. package/src/commands/upload.ts +117 -0
  68. package/src/config.ts +66 -0
  69. package/src/index.ts +79 -0
  70. package/test-cli-config.js +118 -0
  71. package/tsconfig.json +24 -0
@@ -0,0 +1,912 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Cursor Kit API
6
+ * API for managing Cursor rules and commands
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.RulesControllerFindAllTypeEnum = exports.RulesControllerCreateTypeEnum = exports.RulesApi = exports.RulesApiFactory = exports.RulesApiFp = exports.RulesApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.AuthApi = exports.AuthApiFactory = exports.AuthApiFp = exports.AuthApiAxiosParamCreator = exports.RuleResponseDtoTypeEnum = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ // Some imports not used depending on template conditions
22
+ // @ts-ignore
23
+ const common_1 = require("./common");
24
+ // @ts-ignore
25
+ const base_1 = require("./base");
26
+ exports.RuleResponseDtoTypeEnum = {
27
+ Rule: 'rule',
28
+ Command: 'command'
29
+ };
30
+ /**
31
+ * AuthApi - axios parameter creator
32
+ */
33
+ const AuthApiAxiosParamCreator = function (configuration) {
34
+ return {
35
+ /**
36
+ *
37
+ * @summary Login user
38
+ * @param {LoginDto} loginDto
39
+ * @param {*} [options] Override http request option.
40
+ * @throws {RequiredError}
41
+ */
42
+ authControllerLogin: async (loginDto, options = {}) => {
43
+ // verify required parameter 'loginDto' is not null or undefined
44
+ (0, common_1.assertParamExists)('authControllerLogin', 'loginDto', loginDto);
45
+ const localVarPath = `/api/auth/login`;
46
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
47
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
48
+ let baseOptions;
49
+ if (configuration) {
50
+ baseOptions = configuration.baseOptions;
51
+ }
52
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
53
+ const localVarHeaderParameter = {};
54
+ const localVarQueryParameter = {};
55
+ localVarHeaderParameter['Content-Type'] = 'application/json';
56
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
57
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
58
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
59
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(loginDto, localVarRequestOptions, configuration);
60
+ return {
61
+ url: (0, common_1.toPathString)(localVarUrlObj),
62
+ options: localVarRequestOptions,
63
+ };
64
+ },
65
+ /**
66
+ *
67
+ * @summary Register new user
68
+ * @param {RegisterDto} registerDto
69
+ * @param {*} [options] Override http request option.
70
+ * @throws {RequiredError}
71
+ */
72
+ authControllerRegister: async (registerDto, options = {}) => {
73
+ // verify required parameter 'registerDto' is not null or undefined
74
+ (0, common_1.assertParamExists)('authControllerRegister', 'registerDto', registerDto);
75
+ const localVarPath = `/api/auth/register`;
76
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
77
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
78
+ let baseOptions;
79
+ if (configuration) {
80
+ baseOptions = configuration.baseOptions;
81
+ }
82
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
83
+ const localVarHeaderParameter = {};
84
+ const localVarQueryParameter = {};
85
+ localVarHeaderParameter['Content-Type'] = 'application/json';
86
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
87
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
88
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
89
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(registerDto, localVarRequestOptions, configuration);
90
+ return {
91
+ url: (0, common_1.toPathString)(localVarUrlObj),
92
+ options: localVarRequestOptions,
93
+ };
94
+ },
95
+ /**
96
+ *
97
+ * @summary Validate token
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ */
101
+ authControllerValidate: async (options = {}) => {
102
+ const localVarPath = `/api/auth/validate`;
103
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
104
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
105
+ let baseOptions;
106
+ if (configuration) {
107
+ baseOptions = configuration.baseOptions;
108
+ }
109
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
110
+ const localVarHeaderParameter = {};
111
+ const localVarQueryParameter = {};
112
+ // authentication bearer required
113
+ // http bearer authentication required
114
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
115
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
116
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
117
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
118
+ return {
119
+ url: (0, common_1.toPathString)(localVarUrlObj),
120
+ options: localVarRequestOptions,
121
+ };
122
+ },
123
+ };
124
+ };
125
+ exports.AuthApiAxiosParamCreator = AuthApiAxiosParamCreator;
126
+ /**
127
+ * AuthApi - functional programming interface
128
+ */
129
+ const AuthApiFp = function (configuration) {
130
+ const localVarAxiosParamCreator = (0, exports.AuthApiAxiosParamCreator)(configuration);
131
+ return {
132
+ /**
133
+ *
134
+ * @summary Login user
135
+ * @param {LoginDto} loginDto
136
+ * @param {*} [options] Override http request option.
137
+ * @throws {RequiredError}
138
+ */
139
+ async authControllerLogin(loginDto, options) {
140
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authControllerLogin(loginDto, options);
141
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
142
+ const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.authControllerLogin']?.[localVarOperationServerIndex]?.url;
143
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
144
+ },
145
+ /**
146
+ *
147
+ * @summary Register new user
148
+ * @param {RegisterDto} registerDto
149
+ * @param {*} [options] Override http request option.
150
+ * @throws {RequiredError}
151
+ */
152
+ async authControllerRegister(registerDto, options) {
153
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authControllerRegister(registerDto, options);
154
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
155
+ const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.authControllerRegister']?.[localVarOperationServerIndex]?.url;
156
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
157
+ },
158
+ /**
159
+ *
160
+ * @summary Validate token
161
+ * @param {*} [options] Override http request option.
162
+ * @throws {RequiredError}
163
+ */
164
+ async authControllerValidate(options) {
165
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authControllerValidate(options);
166
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
167
+ const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.authControllerValidate']?.[localVarOperationServerIndex]?.url;
168
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
169
+ },
170
+ };
171
+ };
172
+ exports.AuthApiFp = AuthApiFp;
173
+ /**
174
+ * AuthApi - factory interface
175
+ */
176
+ const AuthApiFactory = function (configuration, basePath, axios) {
177
+ const localVarFp = (0, exports.AuthApiFp)(configuration);
178
+ return {
179
+ /**
180
+ *
181
+ * @summary Login user
182
+ * @param {LoginDto} loginDto
183
+ * @param {*} [options] Override http request option.
184
+ * @throws {RequiredError}
185
+ */
186
+ authControllerLogin(loginDto, options) {
187
+ return localVarFp.authControllerLogin(loginDto, options).then((request) => request(axios, basePath));
188
+ },
189
+ /**
190
+ *
191
+ * @summary Register new user
192
+ * @param {RegisterDto} registerDto
193
+ * @param {*} [options] Override http request option.
194
+ * @throws {RequiredError}
195
+ */
196
+ authControllerRegister(registerDto, options) {
197
+ return localVarFp.authControllerRegister(registerDto, options).then((request) => request(axios, basePath));
198
+ },
199
+ /**
200
+ *
201
+ * @summary Validate token
202
+ * @param {*} [options] Override http request option.
203
+ * @throws {RequiredError}
204
+ */
205
+ authControllerValidate(options) {
206
+ return localVarFp.authControllerValidate(options).then((request) => request(axios, basePath));
207
+ },
208
+ };
209
+ };
210
+ exports.AuthApiFactory = AuthApiFactory;
211
+ /**
212
+ * AuthApi - object-oriented interface
213
+ */
214
+ class AuthApi extends base_1.BaseAPI {
215
+ /**
216
+ *
217
+ * @summary Login user
218
+ * @param {LoginDto} loginDto
219
+ * @param {*} [options] Override http request option.
220
+ * @throws {RequiredError}
221
+ */
222
+ authControllerLogin(loginDto, options) {
223
+ return (0, exports.AuthApiFp)(this.configuration).authControllerLogin(loginDto, options).then((request) => request(this.axios, this.basePath));
224
+ }
225
+ /**
226
+ *
227
+ * @summary Register new user
228
+ * @param {RegisterDto} registerDto
229
+ * @param {*} [options] Override http request option.
230
+ * @throws {RequiredError}
231
+ */
232
+ authControllerRegister(registerDto, options) {
233
+ return (0, exports.AuthApiFp)(this.configuration).authControllerRegister(registerDto, options).then((request) => request(this.axios, this.basePath));
234
+ }
235
+ /**
236
+ *
237
+ * @summary Validate token
238
+ * @param {*} [options] Override http request option.
239
+ * @throws {RequiredError}
240
+ */
241
+ authControllerValidate(options) {
242
+ return (0, exports.AuthApiFp)(this.configuration).authControllerValidate(options).then((request) => request(this.axios, this.basePath));
243
+ }
244
+ }
245
+ exports.AuthApi = AuthApi;
246
+ /**
247
+ * HealthApi - axios parameter creator
248
+ */
249
+ const HealthApiAxiosParamCreator = function (configuration) {
250
+ return {
251
+ /**
252
+ *
253
+ * @param {*} [options] Override http request option.
254
+ * @throws {RequiredError}
255
+ */
256
+ healthControllerHealth: async (options = {}) => {
257
+ const localVarPath = `/api/health`;
258
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
259
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
260
+ let baseOptions;
261
+ if (configuration) {
262
+ baseOptions = configuration.baseOptions;
263
+ }
264
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
265
+ const localVarHeaderParameter = {};
266
+ const localVarQueryParameter = {};
267
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
268
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
269
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
270
+ return {
271
+ url: (0, common_1.toPathString)(localVarUrlObj),
272
+ options: localVarRequestOptions,
273
+ };
274
+ },
275
+ /**
276
+ *
277
+ * @param {*} [options] Override http request option.
278
+ * @throws {RequiredError}
279
+ */
280
+ healthControllerLiveness: async (options = {}) => {
281
+ const localVarPath = `/api/health/live`;
282
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
283
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
284
+ let baseOptions;
285
+ if (configuration) {
286
+ baseOptions = configuration.baseOptions;
287
+ }
288
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
289
+ const localVarHeaderParameter = {};
290
+ const localVarQueryParameter = {};
291
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
292
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
293
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
294
+ return {
295
+ url: (0, common_1.toPathString)(localVarUrlObj),
296
+ options: localVarRequestOptions,
297
+ };
298
+ },
299
+ /**
300
+ *
301
+ * @param {*} [options] Override http request option.
302
+ * @throws {RequiredError}
303
+ */
304
+ healthControllerPing: async (options = {}) => {
305
+ const localVarPath = `/api/health/ping`;
306
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
307
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
308
+ let baseOptions;
309
+ if (configuration) {
310
+ baseOptions = configuration.baseOptions;
311
+ }
312
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
313
+ const localVarHeaderParameter = {};
314
+ const localVarQueryParameter = {};
315
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
316
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
317
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
318
+ return {
319
+ url: (0, common_1.toPathString)(localVarUrlObj),
320
+ options: localVarRequestOptions,
321
+ };
322
+ },
323
+ /**
324
+ *
325
+ * @param {*} [options] Override http request option.
326
+ * @throws {RequiredError}
327
+ */
328
+ healthControllerReadiness: async (options = {}) => {
329
+ const localVarPath = `/api/health/ready`;
330
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
331
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
332
+ let baseOptions;
333
+ if (configuration) {
334
+ baseOptions = configuration.baseOptions;
335
+ }
336
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
337
+ const localVarHeaderParameter = {};
338
+ const localVarQueryParameter = {};
339
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
340
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
341
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
342
+ return {
343
+ url: (0, common_1.toPathString)(localVarUrlObj),
344
+ options: localVarRequestOptions,
345
+ };
346
+ },
347
+ };
348
+ };
349
+ exports.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator;
350
+ /**
351
+ * HealthApi - functional programming interface
352
+ */
353
+ const HealthApiFp = function (configuration) {
354
+ const localVarAxiosParamCreator = (0, exports.HealthApiAxiosParamCreator)(configuration);
355
+ return {
356
+ /**
357
+ *
358
+ * @param {*} [options] Override http request option.
359
+ * @throws {RequiredError}
360
+ */
361
+ async healthControllerHealth(options) {
362
+ const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerHealth(options);
363
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
364
+ const localVarOperationServerBasePath = base_1.operationServerMap['HealthApi.healthControllerHealth']?.[localVarOperationServerIndex]?.url;
365
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
366
+ },
367
+ /**
368
+ *
369
+ * @param {*} [options] Override http request option.
370
+ * @throws {RequiredError}
371
+ */
372
+ async healthControllerLiveness(options) {
373
+ const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerLiveness(options);
374
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
375
+ const localVarOperationServerBasePath = base_1.operationServerMap['HealthApi.healthControllerLiveness']?.[localVarOperationServerIndex]?.url;
376
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
377
+ },
378
+ /**
379
+ *
380
+ * @param {*} [options] Override http request option.
381
+ * @throws {RequiredError}
382
+ */
383
+ async healthControllerPing(options) {
384
+ const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerPing(options);
385
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
386
+ const localVarOperationServerBasePath = base_1.operationServerMap['HealthApi.healthControllerPing']?.[localVarOperationServerIndex]?.url;
387
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
388
+ },
389
+ /**
390
+ *
391
+ * @param {*} [options] Override http request option.
392
+ * @throws {RequiredError}
393
+ */
394
+ async healthControllerReadiness(options) {
395
+ const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerReadiness(options);
396
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
397
+ const localVarOperationServerBasePath = base_1.operationServerMap['HealthApi.healthControllerReadiness']?.[localVarOperationServerIndex]?.url;
398
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
399
+ },
400
+ };
401
+ };
402
+ exports.HealthApiFp = HealthApiFp;
403
+ /**
404
+ * HealthApi - factory interface
405
+ */
406
+ const HealthApiFactory = function (configuration, basePath, axios) {
407
+ const localVarFp = (0, exports.HealthApiFp)(configuration);
408
+ return {
409
+ /**
410
+ *
411
+ * @param {*} [options] Override http request option.
412
+ * @throws {RequiredError}
413
+ */
414
+ healthControllerHealth(options) {
415
+ return localVarFp.healthControllerHealth(options).then((request) => request(axios, basePath));
416
+ },
417
+ /**
418
+ *
419
+ * @param {*} [options] Override http request option.
420
+ * @throws {RequiredError}
421
+ */
422
+ healthControllerLiveness(options) {
423
+ return localVarFp.healthControllerLiveness(options).then((request) => request(axios, basePath));
424
+ },
425
+ /**
426
+ *
427
+ * @param {*} [options] Override http request option.
428
+ * @throws {RequiredError}
429
+ */
430
+ healthControllerPing(options) {
431
+ return localVarFp.healthControllerPing(options).then((request) => request(axios, basePath));
432
+ },
433
+ /**
434
+ *
435
+ * @param {*} [options] Override http request option.
436
+ * @throws {RequiredError}
437
+ */
438
+ healthControllerReadiness(options) {
439
+ return localVarFp.healthControllerReadiness(options).then((request) => request(axios, basePath));
440
+ },
441
+ };
442
+ };
443
+ exports.HealthApiFactory = HealthApiFactory;
444
+ /**
445
+ * HealthApi - object-oriented interface
446
+ */
447
+ class HealthApi extends base_1.BaseAPI {
448
+ /**
449
+ *
450
+ * @param {*} [options] Override http request option.
451
+ * @throws {RequiredError}
452
+ */
453
+ healthControllerHealth(options) {
454
+ return (0, exports.HealthApiFp)(this.configuration).healthControllerHealth(options).then((request) => request(this.axios, this.basePath));
455
+ }
456
+ /**
457
+ *
458
+ * @param {*} [options] Override http request option.
459
+ * @throws {RequiredError}
460
+ */
461
+ healthControllerLiveness(options) {
462
+ return (0, exports.HealthApiFp)(this.configuration).healthControllerLiveness(options).then((request) => request(this.axios, this.basePath));
463
+ }
464
+ /**
465
+ *
466
+ * @param {*} [options] Override http request option.
467
+ * @throws {RequiredError}
468
+ */
469
+ healthControllerPing(options) {
470
+ return (0, exports.HealthApiFp)(this.configuration).healthControllerPing(options).then((request) => request(this.axios, this.basePath));
471
+ }
472
+ /**
473
+ *
474
+ * @param {*} [options] Override http request option.
475
+ * @throws {RequiredError}
476
+ */
477
+ healthControllerReadiness(options) {
478
+ return (0, exports.HealthApiFp)(this.configuration).healthControllerReadiness(options).then((request) => request(this.axios, this.basePath));
479
+ }
480
+ }
481
+ exports.HealthApi = HealthApi;
482
+ /**
483
+ * RulesApi - axios parameter creator
484
+ */
485
+ const RulesApiAxiosParamCreator = function (configuration) {
486
+ return {
487
+ /**
488
+ *
489
+ * @summary Upload rule/command
490
+ * @param {string} name
491
+ * @param {string} tag
492
+ * @param {RulesControllerCreateTypeEnum} type
493
+ * @param {string} [description]
494
+ * @param {string} [version]
495
+ * @param {*} [options] Override http request option.
496
+ * @throws {RequiredError}
497
+ */
498
+ rulesControllerCreate: async (name, tag, type, description, version, options = {}) => {
499
+ // verify required parameter 'name' is not null or undefined
500
+ (0, common_1.assertParamExists)('rulesControllerCreate', 'name', name);
501
+ // verify required parameter 'tag' is not null or undefined
502
+ (0, common_1.assertParamExists)('rulesControllerCreate', 'tag', tag);
503
+ // verify required parameter 'type' is not null or undefined
504
+ (0, common_1.assertParamExists)('rulesControllerCreate', 'type', type);
505
+ const localVarPath = `/api/rules`;
506
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
507
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
508
+ let baseOptions;
509
+ if (configuration) {
510
+ baseOptions = configuration.baseOptions;
511
+ }
512
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
513
+ const localVarHeaderParameter = {};
514
+ const localVarQueryParameter = {};
515
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
516
+ // authentication bearer required
517
+ // http bearer authentication required
518
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
519
+ if (name !== undefined) {
520
+ localVarFormParams.append('name', name);
521
+ }
522
+ if (tag !== undefined) {
523
+ localVarFormParams.append('tag', tag);
524
+ }
525
+ if (type !== undefined) {
526
+ localVarFormParams.append('type', type);
527
+ }
528
+ if (description !== undefined) {
529
+ localVarFormParams.append('description', description);
530
+ }
531
+ if (version !== undefined) {
532
+ localVarFormParams.append('version', version);
533
+ }
534
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
535
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
536
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
537
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
538
+ localVarRequestOptions.data = localVarFormParams;
539
+ return {
540
+ url: (0, common_1.toPathString)(localVarUrlObj),
541
+ options: localVarRequestOptions,
542
+ };
543
+ },
544
+ /**
545
+ *
546
+ * @summary Get rules/commands
547
+ * @param {number} [page]
548
+ * @param {number} [limit]
549
+ * @param {string} [tag]
550
+ * @param {string} [name]
551
+ * @param {RulesControllerFindAllTypeEnum} [type]
552
+ * @param {string} [authorId]
553
+ * @param {*} [options] Override http request option.
554
+ * @throws {RequiredError}
555
+ */
556
+ rulesControllerFindAll: async (page, limit, tag, name, type, authorId, options = {}) => {
557
+ const localVarPath = `/api/rules`;
558
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
559
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
560
+ let baseOptions;
561
+ if (configuration) {
562
+ baseOptions = configuration.baseOptions;
563
+ }
564
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
565
+ const localVarHeaderParameter = {};
566
+ const localVarQueryParameter = {};
567
+ if (page !== undefined) {
568
+ localVarQueryParameter['page'] = page;
569
+ }
570
+ if (limit !== undefined) {
571
+ localVarQueryParameter['limit'] = limit;
572
+ }
573
+ if (tag !== undefined) {
574
+ localVarQueryParameter['tag'] = tag;
575
+ }
576
+ if (name !== undefined) {
577
+ localVarQueryParameter['name'] = name;
578
+ }
579
+ if (type !== undefined) {
580
+ localVarQueryParameter['type'] = type;
581
+ }
582
+ if (authorId !== undefined) {
583
+ localVarQueryParameter['authorId'] = authorId;
584
+ }
585
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
586
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
587
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
588
+ return {
589
+ url: (0, common_1.toPathString)(localVarUrlObj),
590
+ options: localVarRequestOptions,
591
+ };
592
+ },
593
+ /**
594
+ *
595
+ * @summary Get rule/command by ID
596
+ * @param {string} id
597
+ * @param {*} [options] Override http request option.
598
+ * @throws {RequiredError}
599
+ */
600
+ rulesControllerFindOne: async (id, options = {}) => {
601
+ // verify required parameter 'id' is not null or undefined
602
+ (0, common_1.assertParamExists)('rulesControllerFindOne', 'id', id);
603
+ const localVarPath = `/api/rules/{id}`
604
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
605
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
606
+ const localVarUrlObj = new URL(localVarPath, common_1.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
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
615
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
616
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
617
+ return {
618
+ url: (0, common_1.toPathString)(localVarUrlObj),
619
+ options: localVarRequestOptions,
620
+ };
621
+ },
622
+ /**
623
+ *
624
+ * @summary Get download URL
625
+ * @param {string} id
626
+ * @param {*} [options] Override http request option.
627
+ * @throws {RequiredError}
628
+ */
629
+ rulesControllerGetDownloadUrl: async (id, options = {}) => {
630
+ // verify required parameter 'id' is not null or undefined
631
+ (0, common_1.assertParamExists)('rulesControllerGetDownloadUrl', 'id', id);
632
+ const localVarPath = `/api/rules/{id}/download`
633
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
634
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
635
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
636
+ let baseOptions;
637
+ if (configuration) {
638
+ baseOptions = configuration.baseOptions;
639
+ }
640
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
641
+ const localVarHeaderParameter = {};
642
+ const localVarQueryParameter = {};
643
+ // authentication bearer required
644
+ // http bearer authentication required
645
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
646
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
647
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
648
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
649
+ return {
650
+ url: (0, common_1.toPathString)(localVarUrlObj),
651
+ options: localVarRequestOptions,
652
+ };
653
+ },
654
+ /**
655
+ *
656
+ * @summary Delete rule/command
657
+ * @param {string} id
658
+ * @param {*} [options] Override http request option.
659
+ * @throws {RequiredError}
660
+ */
661
+ rulesControllerRemove: async (id, options = {}) => {
662
+ // verify required parameter 'id' is not null or undefined
663
+ (0, common_1.assertParamExists)('rulesControllerRemove', 'id', id);
664
+ const localVarPath = `/api/rules/{id}`
665
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
666
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
667
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
668
+ let baseOptions;
669
+ if (configuration) {
670
+ baseOptions = configuration.baseOptions;
671
+ }
672
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
673
+ const localVarHeaderParameter = {};
674
+ const localVarQueryParameter = {};
675
+ // authentication bearer required
676
+ // http bearer authentication required
677
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
678
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
679
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
680
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
681
+ return {
682
+ url: (0, common_1.toPathString)(localVarUrlObj),
683
+ options: localVarRequestOptions,
684
+ };
685
+ },
686
+ };
687
+ };
688
+ exports.RulesApiAxiosParamCreator = RulesApiAxiosParamCreator;
689
+ /**
690
+ * RulesApi - functional programming interface
691
+ */
692
+ const RulesApiFp = function (configuration) {
693
+ const localVarAxiosParamCreator = (0, exports.RulesApiAxiosParamCreator)(configuration);
694
+ return {
695
+ /**
696
+ *
697
+ * @summary Upload rule/command
698
+ * @param {string} name
699
+ * @param {string} tag
700
+ * @param {RulesControllerCreateTypeEnum} type
701
+ * @param {string} [description]
702
+ * @param {string} [version]
703
+ * @param {*} [options] Override http request option.
704
+ * @throws {RequiredError}
705
+ */
706
+ async rulesControllerCreate(name, tag, type, description, version, options) {
707
+ const localVarAxiosArgs = await localVarAxiosParamCreator.rulesControllerCreate(name, tag, type, description, version, options);
708
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
709
+ const localVarOperationServerBasePath = base_1.operationServerMap['RulesApi.rulesControllerCreate']?.[localVarOperationServerIndex]?.url;
710
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
711
+ },
712
+ /**
713
+ *
714
+ * @summary Get rules/commands
715
+ * @param {number} [page]
716
+ * @param {number} [limit]
717
+ * @param {string} [tag]
718
+ * @param {string} [name]
719
+ * @param {RulesControllerFindAllTypeEnum} [type]
720
+ * @param {string} [authorId]
721
+ * @param {*} [options] Override http request option.
722
+ * @throws {RequiredError}
723
+ */
724
+ async rulesControllerFindAll(page, limit, tag, name, type, authorId, options) {
725
+ const localVarAxiosArgs = await localVarAxiosParamCreator.rulesControllerFindAll(page, limit, tag, name, type, authorId, options);
726
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
727
+ const localVarOperationServerBasePath = base_1.operationServerMap['RulesApi.rulesControllerFindAll']?.[localVarOperationServerIndex]?.url;
728
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
729
+ },
730
+ /**
731
+ *
732
+ * @summary Get rule/command by ID
733
+ * @param {string} id
734
+ * @param {*} [options] Override http request option.
735
+ * @throws {RequiredError}
736
+ */
737
+ async rulesControllerFindOne(id, options) {
738
+ const localVarAxiosArgs = await localVarAxiosParamCreator.rulesControllerFindOne(id, options);
739
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
740
+ const localVarOperationServerBasePath = base_1.operationServerMap['RulesApi.rulesControllerFindOne']?.[localVarOperationServerIndex]?.url;
741
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
742
+ },
743
+ /**
744
+ *
745
+ * @summary Get download URL
746
+ * @param {string} id
747
+ * @param {*} [options] Override http request option.
748
+ * @throws {RequiredError}
749
+ */
750
+ async rulesControllerGetDownloadUrl(id, options) {
751
+ const localVarAxiosArgs = await localVarAxiosParamCreator.rulesControllerGetDownloadUrl(id, options);
752
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
753
+ const localVarOperationServerBasePath = base_1.operationServerMap['RulesApi.rulesControllerGetDownloadUrl']?.[localVarOperationServerIndex]?.url;
754
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
755
+ },
756
+ /**
757
+ *
758
+ * @summary Delete rule/command
759
+ * @param {string} id
760
+ * @param {*} [options] Override http request option.
761
+ * @throws {RequiredError}
762
+ */
763
+ async rulesControllerRemove(id, options) {
764
+ const localVarAxiosArgs = await localVarAxiosParamCreator.rulesControllerRemove(id, options);
765
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
766
+ const localVarOperationServerBasePath = base_1.operationServerMap['RulesApi.rulesControllerRemove']?.[localVarOperationServerIndex]?.url;
767
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
768
+ },
769
+ };
770
+ };
771
+ exports.RulesApiFp = RulesApiFp;
772
+ /**
773
+ * RulesApi - factory interface
774
+ */
775
+ const RulesApiFactory = function (configuration, basePath, axios) {
776
+ const localVarFp = (0, exports.RulesApiFp)(configuration);
777
+ return {
778
+ /**
779
+ *
780
+ * @summary Upload rule/command
781
+ * @param {string} name
782
+ * @param {string} tag
783
+ * @param {RulesControllerCreateTypeEnum} type
784
+ * @param {string} [description]
785
+ * @param {string} [version]
786
+ * @param {*} [options] Override http request option.
787
+ * @throws {RequiredError}
788
+ */
789
+ rulesControllerCreate(name, tag, type, description, version, options) {
790
+ return localVarFp.rulesControllerCreate(name, tag, type, description, version, options).then((request) => request(axios, basePath));
791
+ },
792
+ /**
793
+ *
794
+ * @summary Get rules/commands
795
+ * @param {number} [page]
796
+ * @param {number} [limit]
797
+ * @param {string} [tag]
798
+ * @param {string} [name]
799
+ * @param {RulesControllerFindAllTypeEnum} [type]
800
+ * @param {string} [authorId]
801
+ * @param {*} [options] Override http request option.
802
+ * @throws {RequiredError}
803
+ */
804
+ rulesControllerFindAll(page, limit, tag, name, type, authorId, options) {
805
+ return localVarFp.rulesControllerFindAll(page, limit, tag, name, type, authorId, options).then((request) => request(axios, basePath));
806
+ },
807
+ /**
808
+ *
809
+ * @summary Get rule/command by ID
810
+ * @param {string} id
811
+ * @param {*} [options] Override http request option.
812
+ * @throws {RequiredError}
813
+ */
814
+ rulesControllerFindOne(id, options) {
815
+ return localVarFp.rulesControllerFindOne(id, options).then((request) => request(axios, basePath));
816
+ },
817
+ /**
818
+ *
819
+ * @summary Get download URL
820
+ * @param {string} id
821
+ * @param {*} [options] Override http request option.
822
+ * @throws {RequiredError}
823
+ */
824
+ rulesControllerGetDownloadUrl(id, options) {
825
+ return localVarFp.rulesControllerGetDownloadUrl(id, options).then((request) => request(axios, basePath));
826
+ },
827
+ /**
828
+ *
829
+ * @summary Delete rule/command
830
+ * @param {string} id
831
+ * @param {*} [options] Override http request option.
832
+ * @throws {RequiredError}
833
+ */
834
+ rulesControllerRemove(id, options) {
835
+ return localVarFp.rulesControllerRemove(id, options).then((request) => request(axios, basePath));
836
+ },
837
+ };
838
+ };
839
+ exports.RulesApiFactory = RulesApiFactory;
840
+ /**
841
+ * RulesApi - object-oriented interface
842
+ */
843
+ class RulesApi extends base_1.BaseAPI {
844
+ /**
845
+ *
846
+ * @summary Upload rule/command
847
+ * @param {string} name
848
+ * @param {string} tag
849
+ * @param {RulesControllerCreateTypeEnum} type
850
+ * @param {string} [description]
851
+ * @param {string} [version]
852
+ * @param {*} [options] Override http request option.
853
+ * @throws {RequiredError}
854
+ */
855
+ rulesControllerCreate(name, tag, type, description, version, options) {
856
+ return (0, exports.RulesApiFp)(this.configuration).rulesControllerCreate(name, tag, type, description, version, options).then((request) => request(this.axios, this.basePath));
857
+ }
858
+ /**
859
+ *
860
+ * @summary Get rules/commands
861
+ * @param {number} [page]
862
+ * @param {number} [limit]
863
+ * @param {string} [tag]
864
+ * @param {string} [name]
865
+ * @param {RulesControllerFindAllTypeEnum} [type]
866
+ * @param {string} [authorId]
867
+ * @param {*} [options] Override http request option.
868
+ * @throws {RequiredError}
869
+ */
870
+ rulesControllerFindAll(page, limit, tag, name, type, authorId, options) {
871
+ return (0, exports.RulesApiFp)(this.configuration).rulesControllerFindAll(page, limit, tag, name, type, authorId, options).then((request) => request(this.axios, this.basePath));
872
+ }
873
+ /**
874
+ *
875
+ * @summary Get rule/command by ID
876
+ * @param {string} id
877
+ * @param {*} [options] Override http request option.
878
+ * @throws {RequiredError}
879
+ */
880
+ rulesControllerFindOne(id, options) {
881
+ return (0, exports.RulesApiFp)(this.configuration).rulesControllerFindOne(id, options).then((request) => request(this.axios, this.basePath));
882
+ }
883
+ /**
884
+ *
885
+ * @summary Get download URL
886
+ * @param {string} id
887
+ * @param {*} [options] Override http request option.
888
+ * @throws {RequiredError}
889
+ */
890
+ rulesControllerGetDownloadUrl(id, options) {
891
+ return (0, exports.RulesApiFp)(this.configuration).rulesControllerGetDownloadUrl(id, options).then((request) => request(this.axios, this.basePath));
892
+ }
893
+ /**
894
+ *
895
+ * @summary Delete rule/command
896
+ * @param {string} id
897
+ * @param {*} [options] Override http request option.
898
+ * @throws {RequiredError}
899
+ */
900
+ rulesControllerRemove(id, options) {
901
+ return (0, exports.RulesApiFp)(this.configuration).rulesControllerRemove(id, options).then((request) => request(this.axios, this.basePath));
902
+ }
903
+ }
904
+ exports.RulesApi = RulesApi;
905
+ exports.RulesControllerCreateTypeEnum = {
906
+ Rule: 'rule',
907
+ Command: 'command'
908
+ };
909
+ exports.RulesControllerFindAllTypeEnum = {
910
+ Rule: 'rule',
911
+ Command: 'command'
912
+ };