mobx-tanstack-query-api 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/utils/define-config.d.cts +1 -1
- package/cli/utils/define-config.d.cts.map +1 -1
- package/cli/utils/define-config.d.ts +1 -1
- package/cli/utils/define-config.d.ts.map +1 -1
- package/codegen/index.cjs +43 -43
- package/codegen/index.d.cts +2 -165
- package/codegen/index.d.cts.map +1 -1
- package/codegen/index.d.ts +2 -165
- package/codegen/index.d.ts.map +1 -1
- package/codegen/index.js +30 -44
- package/codegen/templates/all-endpoints-per-file.tmpl.cjs +8 -13
- package/codegen/templates/all-endpoints-per-file.tmpl.d.cts +5 -10
- package/codegen/templates/all-endpoints-per-file.tmpl.d.cts.map +1 -1
- package/codegen/templates/all-endpoints-per-file.tmpl.d.ts +5 -10
- package/codegen/templates/all-endpoints-per-file.tmpl.d.ts.map +1 -1
- package/codegen/templates/all-endpoints-per-file.tmpl.js +8 -13
- package/codegen/templates/all-exports.tmpl.d.cts +2 -4
- package/codegen/templates/all-exports.tmpl.d.cts.map +1 -1
- package/codegen/templates/all-exports.tmpl.d.ts +2 -4
- package/codegen/templates/all-exports.tmpl.d.ts.map +1 -1
- package/codegen/templates/data-contract.tmpl.d.cts +2 -2
- package/codegen/templates/data-contract.tmpl.d.cts.map +1 -1
- package/codegen/templates/data-contract.tmpl.d.ts +2 -2
- package/codegen/templates/data-contract.tmpl.d.ts.map +1 -1
- package/codegen/templates/data-contracts-file.tmpl.cjs +5 -5
- package/codegen/templates/data-contracts-file.tmpl.d.cts +3 -7
- package/codegen/templates/data-contracts-file.tmpl.d.cts.map +1 -1
- package/codegen/templates/data-contracts-file.tmpl.d.ts +3 -7
- package/codegen/templates/data-contracts-file.tmpl.d.ts.map +1 -1
- package/codegen/templates/data-contracts-file.tmpl.js +5 -5
- package/codegen/templates/endpoint-jsdoc.tmpl.cjs +2 -1
- package/codegen/templates/endpoint-jsdoc.tmpl.d.cts +3 -5
- package/codegen/templates/endpoint-jsdoc.tmpl.d.cts.map +1 -1
- package/codegen/templates/endpoint-jsdoc.tmpl.d.ts +3 -5
- package/codegen/templates/endpoint-jsdoc.tmpl.d.ts.map +1 -1
- package/codegen/templates/endpoint-jsdoc.tmpl.js +2 -1
- package/codegen/templates/endpoint-per-file.tmpl.cjs +8 -11
- package/codegen/templates/endpoint-per-file.tmpl.d.cts +4 -9
- package/codegen/templates/endpoint-per-file.tmpl.d.cts.map +1 -1
- package/codegen/templates/endpoint-per-file.tmpl.d.ts +4 -9
- package/codegen/templates/endpoint-per-file.tmpl.d.ts.map +1 -1
- package/codegen/templates/endpoint-per-file.tmpl.js +8 -11
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts +2 -6
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts.map +1 -1
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts +2 -6
- package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts.map +1 -1
- package/codegen/templates/meta-info.tmpl.d.cts +2 -5
- package/codegen/templates/meta-info.tmpl.d.cts.map +1 -1
- package/codegen/templates/meta-info.tmpl.d.ts +2 -5
- package/codegen/templates/meta-info.tmpl.d.ts.map +1 -1
- package/codegen/templates/new-endpoint.tmpl.cjs +5 -5
- package/codegen/templates/new-endpoint.tmpl.d.cts +4 -7
- package/codegen/templates/new-endpoint.tmpl.d.cts.map +1 -1
- package/codegen/templates/new-endpoint.tmpl.d.ts +4 -7
- package/codegen/templates/new-endpoint.tmpl.d.ts.map +1 -1
- package/codegen/templates/new-endpoint.tmpl.js +5 -5
- package/codegen/types/all-import-file-params.cjs +2 -0
- package/codegen/types/all-import-file-params.d.cts +5 -0
- package/codegen/types/all-import-file-params.d.cts.map +1 -0
- package/codegen/types/all-import-file-params.d.ts +5 -0
- package/codegen/types/all-import-file-params.d.ts.map +1 -0
- package/codegen/types/all-import-file-params.js +1 -0
- package/codegen/types/base-tmpl-params.cjs +2 -0
- package/codegen/types/base-tmpl-params.d.cts +14 -0
- package/codegen/types/base-tmpl-params.d.cts.map +1 -0
- package/codegen/types/base-tmpl-params.d.ts +14 -0
- package/codegen/types/base-tmpl-params.d.ts.map +1 -0
- package/codegen/types/base-tmpl-params.js +1 -0
- package/codegen/types/codegen-data-utils.cjs +2 -0
- package/codegen/types/codegen-data-utils.d.cts +8 -0
- package/codegen/types/codegen-data-utils.d.cts.map +1 -0
- package/codegen/types/codegen-data-utils.d.ts +8 -0
- package/codegen/types/codegen-data-utils.d.ts.map +1 -0
- package/codegen/types/codegen-data-utils.js +1 -0
- package/codegen/types/endpoint-data.cjs +2 -0
- package/codegen/types/endpoint-data.d.cts +3 -0
- package/codegen/types/endpoint-data.d.cts.map +1 -0
- package/codegen/types/endpoint-data.d.ts +3 -0
- package/codegen/types/endpoint-data.d.ts.map +1 -0
- package/codegen/types/endpoint-data.js +1 -0
- package/codegen/types/generate-query-api-params.cjs +2 -0
- package/codegen/types/generate-query-api-params.d.cts +149 -0
- package/codegen/types/generate-query-api-params.d.cts.map +1 -0
- package/codegen/types/generate-query-api-params.d.ts +149 -0
- package/codegen/types/generate-query-api-params.d.ts.map +1 -0
- package/codegen/types/generate-query-api-params.js +1 -0
- package/codegen/types/import-file-params.cjs +2 -0
- package/codegen/types/import-file-params.d.cts +5 -0
- package/codegen/types/import-file-params.d.cts.map +1 -0
- package/codegen/types/import-file-params.d.ts +5 -0
- package/codegen/types/import-file-params.d.ts.map +1 -0
- package/codegen/types/import-file-params.js +1 -0
- package/codegen/types/index.cjs +23 -0
- package/codegen/types/index.d.cts +8 -0
- package/codegen/types/index.d.cts.map +1 -0
- package/codegen/types/index.d.ts +8 -0
- package/codegen/types/index.d.ts.map +1 -0
- package/codegen/types/index.js +7 -0
- package/codegen/types/meta-info.cjs +2 -0
- package/codegen/types/meta-info.d.cts +6 -0
- package/codegen/types/meta-info.d.cts.map +1 -0
- package/codegen/types/meta-info.d.ts +6 -0
- package/codegen/types/meta-info.d.ts.map +1 -0
- package/codegen/types/meta-info.js +1 -0
- package/codegen/utils/remove-unused-types.d.cts +1 -1
- package/codegen/utils/remove-unused-types.d.cts.map +1 -1
- package/codegen/utils/remove-unused-types.d.ts +1 -1
- package/codegen/utils/remove-unused-types.d.ts.map +1 -1
- package/codegen/utils/remove-unused-types.js +1 -1
- package/codegen/utils/unpack-filter-option.d.cts +1 -1
- package/codegen/utils/unpack-filter-option.d.cts.map +1 -1
- package/codegen/utils/unpack-filter-option.d.ts +1 -1
- package/codegen/utils/unpack-filter-option.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Maybe } from 'yummies/utils/types';
|
|
2
|
-
import type { GenerateQueryApiParams } from "../../codegen/index.cjs";
|
|
2
|
+
import type { GenerateQueryApiParams } from "../../codegen/types/index.cjs";
|
|
3
3
|
export declare const defineConfig: (...configs: Maybe<GenerateQueryApiParams | GenerateQueryApiParams[]>[]) => GenerateQueryApiParams[];
|
|
4
4
|
//# sourceMappingURL=define-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sCAAqC;AAE3E,eAAO,MAAM,YAAY,GACvB,GAAG,SAAS,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,EAAE,CAAC,EAAE,KACrE,sBAAsB,EAIxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Maybe } from 'yummies/utils/types';
|
|
2
|
-
import type { GenerateQueryApiParams } from "../../codegen/index.js";
|
|
2
|
+
import type { GenerateQueryApiParams } from "../../codegen/types/index.js";
|
|
3
3
|
export declare const defineConfig: (...configs: Maybe<GenerateQueryApiParams | GenerateQueryApiParams[]>[]) => GenerateQueryApiParams[];
|
|
4
4
|
//# sourceMappingURL=define-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,qCAAqC;AAE3E,eAAO,MAAM,YAAY,GACvB,GAAG,SAAS,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,EAAE,CAAC,EAAE,KACrE,sBAAsB,EAIxB,CAAC"}
|
package/codegen/index.cjs
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -16,12 +30,15 @@ const index_ts_for_endpoint_per_file_tmpl_js_1 = require("./templates/index-ts-f
|
|
|
16
30
|
const meta_info_tmpl_js_1 = require("./templates/meta-info.tmpl.cjs");
|
|
17
31
|
const remove_unused_types_js_1 = require("./utils/remove-unused-types.cjs");
|
|
18
32
|
const unpack_filter_option_js_1 = require("./utils/unpack-filter-option.cjs");
|
|
33
|
+
__exportStar(require("./types/index.cjs"), exports);
|
|
19
34
|
const __filename = (0, node_url_1.fileURLToPath)(require("url").pathToFileURL(__filename));
|
|
20
35
|
const __dirname = node_path_1.default.dirname(__filename);
|
|
21
36
|
const __execdirname = process.cwd();
|
|
22
37
|
const generateApi = async (params) => {
|
|
23
38
|
if (Array.isArray(params)) {
|
|
24
|
-
await
|
|
39
|
+
for await (const param of params) {
|
|
40
|
+
await (0, exports.generateApi)(param);
|
|
41
|
+
}
|
|
25
42
|
return;
|
|
26
43
|
}
|
|
27
44
|
const tsconfigPath = params.tsconfigPath
|
|
@@ -56,9 +73,9 @@ const generateApi = async (params) => {
|
|
|
56
73
|
outputDir: node_path_1.default.resolve(process.cwd(), params.output),
|
|
57
74
|
};
|
|
58
75
|
//#region swagger-typescript-api
|
|
59
|
-
const
|
|
76
|
+
const swaggerTypescriptApiCodegenBaseParams = {
|
|
60
77
|
httpClientType: 'fetch',
|
|
61
|
-
cleanOutput: true,
|
|
78
|
+
cleanOutput: params.cleanOutput ?? true,
|
|
62
79
|
modular: true,
|
|
63
80
|
patch: true,
|
|
64
81
|
typeSuffix: 'DC',
|
|
@@ -99,7 +116,7 @@ const generateApi = async (params) => {
|
|
|
99
116
|
inputData.spec = params.input;
|
|
100
117
|
}
|
|
101
118
|
const generated = await (0, swagger_typescript_api_1.generateApi)({
|
|
102
|
-
...
|
|
119
|
+
...swaggerTypescriptApiCodegenBaseParams,
|
|
103
120
|
...inputData,
|
|
104
121
|
hooks: {
|
|
105
122
|
onInit: (configuration, codeGenProcessFromInit) => {
|
|
@@ -112,13 +129,13 @@ const generateApi = async (params) => {
|
|
|
112
129
|
configuration.swaggerSchema.components.schemas =
|
|
113
130
|
// @ts-expect-error
|
|
114
131
|
configuration.swaggerSchema.components.schemas || {};
|
|
115
|
-
return
|
|
132
|
+
return swaggerTypescriptApiCodegenBaseParams?.hooks?.onInit?.(configuration, codeGenProcessFromInit);
|
|
116
133
|
},
|
|
117
134
|
onPrepareConfig: (config) => {
|
|
118
135
|
config.routes.combined?.forEach((routeInfo) => {
|
|
119
136
|
routeInfo.routes.sort((routeA, routeB) => routeA.routeName.usage.localeCompare(routeB.routeName.usage));
|
|
120
137
|
});
|
|
121
|
-
return
|
|
138
|
+
return swaggerTypescriptApiCodegenBaseParams?.hooks?.onPrepareConfig?.(config);
|
|
122
139
|
},
|
|
123
140
|
onFormatRouteName: (routeInfo, usageRouteName) => {
|
|
124
141
|
let formattedRouteName = usageRouteName;
|
|
@@ -134,7 +151,7 @@ const generateApi = async (params) => {
|
|
|
134
151
|
}
|
|
135
152
|
const endpointName = formattedRouteName;
|
|
136
153
|
return (params?.formatEndpointName?.(endpointName, routeInfo) ??
|
|
137
|
-
|
|
154
|
+
swaggerTypescriptApiCodegenBaseParams?.hooks?.onFormatRouteName?.(routeInfo, endpointName) ??
|
|
138
155
|
endpointName);
|
|
139
156
|
},
|
|
140
157
|
},
|
|
@@ -142,6 +159,15 @@ const generateApi = async (params) => {
|
|
|
142
159
|
//#endregion
|
|
143
160
|
const utils = codegenProcess.getRenderTemplateData()
|
|
144
161
|
.utils;
|
|
162
|
+
const baseTmplParams = {
|
|
163
|
+
...generated,
|
|
164
|
+
codegenParams: params,
|
|
165
|
+
configuration: generated.configuration,
|
|
166
|
+
formatTSContent: generated.formatTSContent,
|
|
167
|
+
codegenProcess,
|
|
168
|
+
importFileParams,
|
|
169
|
+
utils,
|
|
170
|
+
};
|
|
145
171
|
const { _ } = utils;
|
|
146
172
|
let namespace = null;
|
|
147
173
|
if (params.namespace) {
|
|
@@ -172,12 +198,8 @@ const generateApi = async (params) => {
|
|
|
172
198
|
const fileNamesWithRequestInfo = [];
|
|
173
199
|
for await (const route of allRoutes) {
|
|
174
200
|
const { content: requestInfoPerFileContent, reservedDataContractNames, } = await (0, endpoint_per_file_tmpl_js_1.endpointPerFileTmpl)({
|
|
175
|
-
...
|
|
201
|
+
...baseTmplParams,
|
|
176
202
|
route,
|
|
177
|
-
apiParams: params,
|
|
178
|
-
codegenProcess,
|
|
179
|
-
importFileParams,
|
|
180
|
-
utils,
|
|
181
203
|
relativePathDataContracts: '../data-contracts',
|
|
182
204
|
groupName: null,
|
|
183
205
|
metaInfo: {
|
|
@@ -210,9 +232,7 @@ const generateApi = async (params) => {
|
|
|
210
232
|
fileName: 'index.ts',
|
|
211
233
|
withPrefix: false,
|
|
212
234
|
content: await (0, index_ts_for_endpoint_per_file_tmpl_js_1.indexTsForEndpointPerFileTmpl)({
|
|
213
|
-
...
|
|
214
|
-
apiParams: params,
|
|
215
|
-
codegenProcess,
|
|
235
|
+
...baseTmplParams,
|
|
216
236
|
generatedRequestFileNames: fileNamesWithRequestInfo,
|
|
217
237
|
}),
|
|
218
238
|
});
|
|
@@ -221,12 +241,8 @@ const generateApi = async (params) => {
|
|
|
221
241
|
else {
|
|
222
242
|
// #region кодогенерация несколько эндпоинтов в 1 файле без группировки
|
|
223
243
|
const { content: requestInfoPerFileContent, reservedDataContractNames } = await (0, all_endpoints_per_file_tmpl_js_1.allEndpointPerFileTmpl)({
|
|
224
|
-
...
|
|
244
|
+
...baseTmplParams,
|
|
225
245
|
routes: allRoutes,
|
|
226
|
-
apiParams: params,
|
|
227
|
-
codegenProcess,
|
|
228
|
-
importFileParams,
|
|
229
|
-
utils,
|
|
230
246
|
relativePathDataContracts: './data-contracts',
|
|
231
247
|
groupName: null,
|
|
232
248
|
metaInfo: {
|
|
@@ -299,12 +315,8 @@ const generateApi = async (params) => {
|
|
|
299
315
|
codegenFs.createDir(node_path_1.default.resolve(groupDirectory, 'endpoints'));
|
|
300
316
|
for await (const route of routes) {
|
|
301
317
|
const { content: requestInfoPerFileContent, reservedDataContractNames, } = await (0, endpoint_per_file_tmpl_js_1.endpointPerFileTmpl)({
|
|
302
|
-
...
|
|
318
|
+
...baseTmplParams,
|
|
303
319
|
route,
|
|
304
|
-
apiParams: params,
|
|
305
|
-
codegenProcess,
|
|
306
|
-
importFileParams,
|
|
307
|
-
utils,
|
|
308
320
|
relativePathDataContracts: '../../data-contracts',
|
|
309
321
|
groupName,
|
|
310
322
|
metaInfo: {
|
|
@@ -338,12 +350,8 @@ const generateApi = async (params) => {
|
|
|
338
350
|
else {
|
|
339
351
|
// #region Генерация нескольких эндпоинтов на 1 файл
|
|
340
352
|
const { content: requestInfoPerFileContent, reservedDataContractNames, } = await (0, all_endpoints_per_file_tmpl_js_1.allEndpointPerFileTmpl)({
|
|
341
|
-
...
|
|
353
|
+
...baseTmplParams,
|
|
342
354
|
routes,
|
|
343
|
-
apiParams: params,
|
|
344
|
-
codegenProcess,
|
|
345
|
-
importFileParams,
|
|
346
|
-
utils,
|
|
347
355
|
relativePathDataContracts: '../data-contracts',
|
|
348
356
|
groupName,
|
|
349
357
|
metaInfo: {
|
|
@@ -394,9 +402,7 @@ export * as ${exportGroupName} from './endpoints';
|
|
|
394
402
|
fileName: 'index.ts',
|
|
395
403
|
withPrefix: false,
|
|
396
404
|
content: await (0, index_ts_for_endpoint_per_file_tmpl_js_1.indexTsForEndpointPerFileTmpl)({
|
|
397
|
-
...
|
|
398
|
-
apiParams: params,
|
|
399
|
-
codegenProcess,
|
|
405
|
+
...baseTmplParams,
|
|
400
406
|
generatedRequestFileNames: fileNamesWithRequestInfo,
|
|
401
407
|
}),
|
|
402
408
|
});
|
|
@@ -420,9 +426,7 @@ export * as ${exportGroupName} from './endpoints';
|
|
|
420
426
|
.filter(([_, count]) => count === 1)
|
|
421
427
|
.map(([name]) => name);
|
|
422
428
|
const dataContractsContent = await (0, data_contracts_file_tmpl_js_1.dataContractsFileTmpl)({
|
|
423
|
-
...
|
|
424
|
-
apiParams: params,
|
|
425
|
-
codegenProcess,
|
|
429
|
+
...baseTmplParams,
|
|
426
430
|
excludedDataContractNames,
|
|
427
431
|
});
|
|
428
432
|
codegenFs.createFile({
|
|
@@ -436,10 +440,8 @@ export * as ${exportGroupName} from './endpoints';
|
|
|
436
440
|
fileName: 'meta-info.ts',
|
|
437
441
|
withPrefix: false,
|
|
438
442
|
content: await (0, meta_info_tmpl_js_1.metaInfoTmpl)({
|
|
439
|
-
...
|
|
443
|
+
...baseTmplParams,
|
|
440
444
|
metaInfo,
|
|
441
|
-
utils,
|
|
442
|
-
codegenParams: params,
|
|
443
445
|
}),
|
|
444
446
|
});
|
|
445
447
|
if (namespace) {
|
|
@@ -448,10 +450,9 @@ export * as ${exportGroupName} from './endpoints';
|
|
|
448
450
|
fileName: '__exports.ts',
|
|
449
451
|
withPrefix: false,
|
|
450
452
|
content: await (0, all_exports_tmpl_js_1.allExportsTmpl)({
|
|
451
|
-
...
|
|
453
|
+
...baseTmplParams,
|
|
452
454
|
collectedExportFiles: collectedExportFilesFromIndexFile,
|
|
453
455
|
metaInfo,
|
|
454
|
-
utils,
|
|
455
456
|
}),
|
|
456
457
|
});
|
|
457
458
|
codegenFs.createFile({
|
|
@@ -469,10 +470,9 @@ export * as ${namespace} from './__exports';
|
|
|
469
470
|
fileName: 'index.ts',
|
|
470
471
|
withPrefix: false,
|
|
471
472
|
content: await (0, all_exports_tmpl_js_1.allExportsTmpl)({
|
|
472
|
-
...
|
|
473
|
+
...baseTmplParams,
|
|
473
474
|
collectedExportFiles: collectedExportFilesFromIndexFile,
|
|
474
475
|
metaInfo,
|
|
475
|
-
utils,
|
|
476
476
|
}),
|
|
477
477
|
});
|
|
478
478
|
}
|
package/codegen/index.d.cts
CHANGED
|
@@ -1,167 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import type { RequestInit } from 'undici-types';
|
|
4
|
-
import type { AnyObject, KeyOfByValue, Maybe } from 'yummies/utils/types';
|
|
5
|
-
import { type RemoveUnusedTypesParams } from "./utils/remove-unused-types.cjs";
|
|
6
|
-
export type CodegenDataUtils = {
|
|
7
|
-
_: LoDashStatic;
|
|
8
|
-
getInlineParseContent: (requestParams: AnyObject) => string;
|
|
9
|
-
formatModelName: (modelName: string) => string;
|
|
10
|
-
};
|
|
11
|
-
export type EndpointData = ParsedRoute;
|
|
12
|
-
export type FilterOption<T extends (...args: any[]) => boolean> = T | string | RegExp | (RegExp | string)[];
|
|
13
|
-
type FilterEndpointsOption = FilterOption<(endpoint: EndpointData) => boolean>;
|
|
14
|
-
type FilterGroupsOption = FilterOption<(groupName: string) => boolean>;
|
|
15
|
-
export type CodegenProcess = AnyObject;
|
|
16
|
-
export interface ImportFileParams {
|
|
17
|
-
path: string;
|
|
18
|
-
exportName: string;
|
|
19
|
-
}
|
|
20
|
-
export interface MetaInfo {
|
|
21
|
-
namespace: string | null;
|
|
22
|
-
groupNames: string[];
|
|
23
|
-
tags?: string[];
|
|
24
|
-
}
|
|
25
|
-
export interface GenerateQueryApiParams {
|
|
26
|
-
/**
|
|
27
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#output)
|
|
28
|
-
*/
|
|
29
|
-
output: string;
|
|
30
|
-
/**
|
|
31
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#input)
|
|
32
|
-
*/
|
|
33
|
-
input: string | AnyObject;
|
|
34
|
-
/**
|
|
35
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#requestpathprefix)
|
|
36
|
-
*/
|
|
37
|
-
requestPathPrefix?: string;
|
|
38
|
-
/**
|
|
39
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#requestpathsuffix)
|
|
40
|
-
*/
|
|
41
|
-
requestPathSuffix?: string;
|
|
42
|
-
/**
|
|
43
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#removeunusedtypes)
|
|
44
|
-
*/
|
|
45
|
-
removeUnusedTypes?: true | {
|
|
46
|
-
keepTypes?: RemoveUnusedTypesParams['keepTypes'];
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#formatendpointname)
|
|
50
|
-
*/
|
|
51
|
-
formatEndpointName?: (endpointName: string, endpointData: RawRouteInfo) => Maybe<string>;
|
|
52
|
-
/**
|
|
53
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#formatexportgroupname)
|
|
54
|
-
*/
|
|
55
|
-
formatExportGroupName?: (groupName: string, utils: CodegenDataUtils) => string;
|
|
56
|
-
/**
|
|
57
|
-
* Various generation output types
|
|
58
|
-
*
|
|
59
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#outputtype)
|
|
60
|
-
*
|
|
61
|
-
* `one-endpoint-per-file`
|
|
62
|
-
* @example
|
|
63
|
-
* ```
|
|
64
|
-
* outputdir
|
|
65
|
-
* groupname
|
|
66
|
-
* index.ts
|
|
67
|
-
* endpoints
|
|
68
|
-
* index.ts
|
|
69
|
-
* get-endpoint-1.ts
|
|
70
|
-
* get-endpoint-n.ts
|
|
71
|
-
* ```
|
|
72
|
-
* @example
|
|
73
|
-
* ```
|
|
74
|
-
* outputdir
|
|
75
|
-
* index.ts
|
|
76
|
-
* endpoints
|
|
77
|
-
* index.ts
|
|
78
|
-
* get-endpoint-1.ts
|
|
79
|
-
* get-endpoint-n.ts
|
|
80
|
-
* ```
|
|
81
|
-
*
|
|
82
|
-
* `endpoints-per-file`
|
|
83
|
-
* @example
|
|
84
|
-
* ```
|
|
85
|
-
* outputdir
|
|
86
|
-
* groupname
|
|
87
|
-
* index.ts
|
|
88
|
-
* endpoints.ts
|
|
89
|
-
* ```
|
|
90
|
-
* @example
|
|
91
|
-
* ```
|
|
92
|
-
* outputdir
|
|
93
|
-
* index.ts
|
|
94
|
-
* endpoints.ts
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
outputType?: 'one-endpoint-per-file' | 'endpoints-per-file';
|
|
98
|
-
/**
|
|
99
|
-
* Group endpoints and collect it into object
|
|
100
|
-
*
|
|
101
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#groupby)
|
|
102
|
-
*/
|
|
103
|
-
groupBy?: ((endpoint: EndpointData) => string) | `path-segment` | `path-segment-${number}` | `tag` | `tag-${number}`;
|
|
104
|
-
/**
|
|
105
|
-
* Collect all exports into single namespace
|
|
106
|
-
*
|
|
107
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#namespace)
|
|
108
|
-
*/
|
|
109
|
-
namespace?: string | ((utils: AnyObject) => string);
|
|
110
|
-
/**
|
|
111
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#addpathsegmenttoroutename)
|
|
112
|
-
*/
|
|
113
|
-
addPathSegmentToRouteName?: boolean | number;
|
|
114
|
-
/**
|
|
115
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#queryclient)
|
|
116
|
-
*/
|
|
117
|
-
queryClient?: 'builtin' | ImportFileParams;
|
|
118
|
-
/**
|
|
119
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#endpoint)
|
|
120
|
-
*/
|
|
121
|
-
endpoint?: 'builtin' | ImportFileParams;
|
|
122
|
-
/**
|
|
123
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#httpclient)
|
|
124
|
-
*/
|
|
125
|
-
httpClient?: 'builtin' | ImportFileParams;
|
|
126
|
-
/**
|
|
127
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#getendpointmeta)
|
|
128
|
-
*/
|
|
129
|
-
getEndpointMeta?: (route: AnyObject, utils: AnyObject) => {
|
|
130
|
-
typeName?: string;
|
|
131
|
-
typeNameImportPath?: string;
|
|
132
|
-
tmplData: string;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#getrequestmeta)
|
|
136
|
-
*/
|
|
137
|
-
getRequestMeta?: (route: AnyObject, utils: AnyObject) => {
|
|
138
|
-
tmplData: string;
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Additional parameters used to fetch your OpenAPI schema
|
|
142
|
-
*
|
|
143
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#fetchschemarequestoptions)
|
|
144
|
-
*/
|
|
145
|
-
fetchSchemaRequestOptions?: RequestInit;
|
|
146
|
-
otherCodegenParams?: AnyObject;
|
|
147
|
-
/**
|
|
148
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#filterendpoints)
|
|
149
|
-
*/
|
|
150
|
-
filterEndpoints?: FilterEndpointsOption;
|
|
151
|
-
/**
|
|
152
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#filtergroups)
|
|
153
|
-
*/
|
|
154
|
-
filterGroups?: FilterGroupsOption;
|
|
155
|
-
libImports?: {
|
|
156
|
-
'mobx-tanstack-query-api'?: string;
|
|
157
|
-
};
|
|
158
|
-
tsconfigPath?: string;
|
|
159
|
-
transforms?: {
|
|
160
|
-
groupEnumValue?: (group: string, namespace?: Maybe<string>) => string;
|
|
161
|
-
tagEnumValue?: (tag: string, namespace?: Maybe<string>) => string;
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
export type AllImportFileParams = Record<KeyOfByValue<Required<GenerateQueryApiParams>, 'builtin' | ImportFileParams>, ImportFileParams>;
|
|
1
|
+
import type { GenerateQueryApiParams } from "./types/index.cjs";
|
|
2
|
+
export * from "./types/index.cjs";
|
|
165
3
|
export declare const generateApi: (params: GenerateQueryApiParams | GenerateQueryApiParams[]) => Promise<void>;
|
|
166
|
-
export {};
|
|
167
4
|
//# sourceMappingURL=index.d.ts.map
|
package/codegen/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAIV,sBAAsB,EAEvB,0BAAyB;AAI1B,kCAAiC;AAOjC,eAAO,MAAM,WAAW,GACtB,QAAQ,sBAAsB,GAAG,sBAAsB,EAAE,KAExD,OAAO,CAAC,IAAI,CA8lBd,CAAC"}
|
package/codegen/index.d.ts
CHANGED
|
@@ -1,167 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import type { RequestInit } from 'undici-types';
|
|
4
|
-
import type { AnyObject, KeyOfByValue, Maybe } from 'yummies/utils/types';
|
|
5
|
-
import { type RemoveUnusedTypesParams } from "./utils/remove-unused-types.js";
|
|
6
|
-
export type CodegenDataUtils = {
|
|
7
|
-
_: LoDashStatic;
|
|
8
|
-
getInlineParseContent: (requestParams: AnyObject) => string;
|
|
9
|
-
formatModelName: (modelName: string) => string;
|
|
10
|
-
};
|
|
11
|
-
export type EndpointData = ParsedRoute;
|
|
12
|
-
export type FilterOption<T extends (...args: any[]) => boolean> = T | string | RegExp | (RegExp | string)[];
|
|
13
|
-
type FilterEndpointsOption = FilterOption<(endpoint: EndpointData) => boolean>;
|
|
14
|
-
type FilterGroupsOption = FilterOption<(groupName: string) => boolean>;
|
|
15
|
-
export type CodegenProcess = AnyObject;
|
|
16
|
-
export interface ImportFileParams {
|
|
17
|
-
path: string;
|
|
18
|
-
exportName: string;
|
|
19
|
-
}
|
|
20
|
-
export interface MetaInfo {
|
|
21
|
-
namespace: string | null;
|
|
22
|
-
groupNames: string[];
|
|
23
|
-
tags?: string[];
|
|
24
|
-
}
|
|
25
|
-
export interface GenerateQueryApiParams {
|
|
26
|
-
/**
|
|
27
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#output)
|
|
28
|
-
*/
|
|
29
|
-
output: string;
|
|
30
|
-
/**
|
|
31
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#input)
|
|
32
|
-
*/
|
|
33
|
-
input: string | AnyObject;
|
|
34
|
-
/**
|
|
35
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#requestpathprefix)
|
|
36
|
-
*/
|
|
37
|
-
requestPathPrefix?: string;
|
|
38
|
-
/**
|
|
39
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#requestpathsuffix)
|
|
40
|
-
*/
|
|
41
|
-
requestPathSuffix?: string;
|
|
42
|
-
/**
|
|
43
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#removeunusedtypes)
|
|
44
|
-
*/
|
|
45
|
-
removeUnusedTypes?: true | {
|
|
46
|
-
keepTypes?: RemoveUnusedTypesParams['keepTypes'];
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#formatendpointname)
|
|
50
|
-
*/
|
|
51
|
-
formatEndpointName?: (endpointName: string, endpointData: RawRouteInfo) => Maybe<string>;
|
|
52
|
-
/**
|
|
53
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#formatexportgroupname)
|
|
54
|
-
*/
|
|
55
|
-
formatExportGroupName?: (groupName: string, utils: CodegenDataUtils) => string;
|
|
56
|
-
/**
|
|
57
|
-
* Various generation output types
|
|
58
|
-
*
|
|
59
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#outputtype)
|
|
60
|
-
*
|
|
61
|
-
* `one-endpoint-per-file`
|
|
62
|
-
* @example
|
|
63
|
-
* ```
|
|
64
|
-
* outputdir
|
|
65
|
-
* groupname
|
|
66
|
-
* index.ts
|
|
67
|
-
* endpoints
|
|
68
|
-
* index.ts
|
|
69
|
-
* get-endpoint-1.ts
|
|
70
|
-
* get-endpoint-n.ts
|
|
71
|
-
* ```
|
|
72
|
-
* @example
|
|
73
|
-
* ```
|
|
74
|
-
* outputdir
|
|
75
|
-
* index.ts
|
|
76
|
-
* endpoints
|
|
77
|
-
* index.ts
|
|
78
|
-
* get-endpoint-1.ts
|
|
79
|
-
* get-endpoint-n.ts
|
|
80
|
-
* ```
|
|
81
|
-
*
|
|
82
|
-
* `endpoints-per-file`
|
|
83
|
-
* @example
|
|
84
|
-
* ```
|
|
85
|
-
* outputdir
|
|
86
|
-
* groupname
|
|
87
|
-
* index.ts
|
|
88
|
-
* endpoints.ts
|
|
89
|
-
* ```
|
|
90
|
-
* @example
|
|
91
|
-
* ```
|
|
92
|
-
* outputdir
|
|
93
|
-
* index.ts
|
|
94
|
-
* endpoints.ts
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
outputType?: 'one-endpoint-per-file' | 'endpoints-per-file';
|
|
98
|
-
/**
|
|
99
|
-
* Group endpoints and collect it into object
|
|
100
|
-
*
|
|
101
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#groupby)
|
|
102
|
-
*/
|
|
103
|
-
groupBy?: ((endpoint: EndpointData) => string) | `path-segment` | `path-segment-${number}` | `tag` | `tag-${number}`;
|
|
104
|
-
/**
|
|
105
|
-
* Collect all exports into single namespace
|
|
106
|
-
*
|
|
107
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#namespace)
|
|
108
|
-
*/
|
|
109
|
-
namespace?: string | ((utils: AnyObject) => string);
|
|
110
|
-
/**
|
|
111
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#addpathsegmenttoroutename)
|
|
112
|
-
*/
|
|
113
|
-
addPathSegmentToRouteName?: boolean | number;
|
|
114
|
-
/**
|
|
115
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#queryclient)
|
|
116
|
-
*/
|
|
117
|
-
queryClient?: 'builtin' | ImportFileParams;
|
|
118
|
-
/**
|
|
119
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#endpoint)
|
|
120
|
-
*/
|
|
121
|
-
endpoint?: 'builtin' | ImportFileParams;
|
|
122
|
-
/**
|
|
123
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#httpclient)
|
|
124
|
-
*/
|
|
125
|
-
httpClient?: 'builtin' | ImportFileParams;
|
|
126
|
-
/**
|
|
127
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#getendpointmeta)
|
|
128
|
-
*/
|
|
129
|
-
getEndpointMeta?: (route: AnyObject, utils: AnyObject) => {
|
|
130
|
-
typeName?: string;
|
|
131
|
-
typeNameImportPath?: string;
|
|
132
|
-
tmplData: string;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#getrequestmeta)
|
|
136
|
-
*/
|
|
137
|
-
getRequestMeta?: (route: AnyObject, utils: AnyObject) => {
|
|
138
|
-
tmplData: string;
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Additional parameters used to fetch your OpenAPI schema
|
|
142
|
-
*
|
|
143
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#fetchschemarequestoptions)
|
|
144
|
-
*/
|
|
145
|
-
fetchSchemaRequestOptions?: RequestInit;
|
|
146
|
-
otherCodegenParams?: AnyObject;
|
|
147
|
-
/**
|
|
148
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#filterendpoints)
|
|
149
|
-
*/
|
|
150
|
-
filterEndpoints?: FilterEndpointsOption;
|
|
151
|
-
/**
|
|
152
|
-
* [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/codegen/config/#filtergroups)
|
|
153
|
-
*/
|
|
154
|
-
filterGroups?: FilterGroupsOption;
|
|
155
|
-
libImports?: {
|
|
156
|
-
'mobx-tanstack-query-api'?: string;
|
|
157
|
-
};
|
|
158
|
-
tsconfigPath?: string;
|
|
159
|
-
transforms?: {
|
|
160
|
-
groupEnumValue?: (group: string, namespace?: Maybe<string>) => string;
|
|
161
|
-
tagEnumValue?: (tag: string, namespace?: Maybe<string>) => string;
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
export type AllImportFileParams = Record<KeyOfByValue<Required<GenerateQueryApiParams>, 'builtin' | ImportFileParams>, ImportFileParams>;
|
|
1
|
+
import type { GenerateQueryApiParams } from "./types/index.js";
|
|
2
|
+
export * from "./types/index.js";
|
|
165
3
|
export declare const generateApi: (params: GenerateQueryApiParams | GenerateQueryApiParams[]) => Promise<void>;
|
|
166
|
-
export {};
|
|
167
4
|
//# sourceMappingURL=index.d.ts.map
|
package/codegen/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAIV,sBAAsB,EAEvB,yBAAyB;AAI1B,iCAAiC;AAOjC,eAAO,MAAM,WAAW,GACtB,QAAQ,sBAAsB,GAAG,sBAAsB,EAAE,KAExD,OAAO,CAAC,IAAI,CA8lBd,CAAC"}
|