mobx-tanstack-query-api 0.0.31 → 0.0.33

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/bin.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { generateApi } from '../codegen/index.js';
5
+ import { defineConfig } from './define-config.js';
5
6
  const projectDir = process.cwd();
6
7
  let generateApiParams;
7
8
  let module;
@@ -17,10 +18,10 @@ else if (existsSync(path.resolve(projectDir, 'api-codegen.config.json'))) {
17
18
  else {
18
19
  throw new Error('api-codegen.config.(js|mjs|json) not found');
19
20
  }
20
- if (module.default && 'links' in module.default) {
21
+ if (module.default) {
21
22
  generateApiParams = module.default;
22
23
  }
23
24
  else {
24
- throw new Error('api-codegen.config.(js|mjs|json) is not valid');
25
+ throw new Error('api-codegen.config.(js|mjs|json) is not valid, This file should return object - result of the defineConfig function');
25
26
  }
26
- generateApi(generateApiParams);
27
+ defineConfig(generateApiParams).forEach(generateApi);
package/cli/bin.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { generateApi } from '../codegen/index.js';
5
+ import { defineConfig } from './define-config.js';
5
6
  const projectDir = process.cwd();
6
7
  let generateApiParams;
7
8
  let module;
@@ -17,10 +18,10 @@ else if (existsSync(path.resolve(projectDir, 'api-codegen.config.json'))) {
17
18
  else {
18
19
  throw new Error('api-codegen.config.(js|mjs|json) not found');
19
20
  }
20
- if (module.default && 'links' in module.default) {
21
+ if (module.default) {
21
22
  generateApiParams = module.default;
22
23
  }
23
24
  else {
24
- throw new Error('api-codegen.config.(js|mjs|json) is not valid');
25
+ throw new Error('api-codegen.config.(js|mjs|json) is not valid, This file should return object - result of the defineConfig function');
25
26
  }
26
- generateApi(generateApiParams);
27
+ defineConfig(generateApiParams).forEach(generateApi);
@@ -1,3 +1,4 @@
1
- import { GenerateApiParams } from '../codegen/index.js';
2
- export declare const defineConfig: (config: GenerateApiParams) => GenerateApiParams;
1
+ import { Maybe } from 'yummies/utils/types';
2
+ import { GenerateQueryApiParams } from '../codegen/index.js';
3
+ export declare const defineConfig: (...configs: Maybe<GenerateQueryApiParams | GenerateQueryApiParams[]>[]) => GenerateQueryApiParams[];
3
4
  //# sourceMappingURL=define-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../src/cli/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,YAAY,WAAY,iBAAiB,sBAErD,CAAC"}
1
+ {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../src/cli/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,eAAO,MAAM,YAAY,eACX,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,EAAE,CAAC,EAAE,KACrE,sBAAsB,EAIxB,CAAC"}
@@ -1,3 +1,5 @@
1
- export const defineConfig = (config) => {
2
- return config;
1
+ export const defineConfig = (...configs) => {
2
+ return configs
3
+ .flat()
4
+ .filter((config) => !!config);
3
5
  };
@@ -8,15 +8,46 @@ export interface ImportFileParams {
8
8
  path: string;
9
9
  exportName: string;
10
10
  }
11
- export interface QueryApiParams {
11
+ export interface GenerateQueryApiParams {
12
+ output: string;
13
+ input: string | AnyObject;
12
14
  requestPathPrefix?: string;
13
15
  requestPathSuffix?: string;
14
16
  requestInfoPrefix?: string;
15
- outputType: 'request-info-per-file';
17
+ /**
18
+ * Group endpoints and collect it into object
19
+ */
20
+ groupBy?: ((route: ParsedRoute) => string) | `path-segment` | `path-segment-${number}` | `tag` | `tag-${number}`;
21
+ /**
22
+ * Collect all exports into single namespace
23
+ *
24
+ * Example:
25
+ * without namespace:
26
+ *
27
+ * export * from "./endpoints";
28
+ * export * from "./data-contracts";
29
+ *
30
+ * with namespace:
31
+ *
32
+ * export * as namespaceName from "./__exports"; // exports like above
33
+ *
34
+ *
35
+ * namespaceName.login.toMutation()
36
+ */
37
+ namespace?: string | ((utils: CodegenDataUtils) => string);
38
+ /**
39
+ * Example:
40
+ * operationId: 'getById'
41
+ * /api/v1/users/{userId} => /api/v1/users/1
42
+ *
43
+ * addPathSegmentToRouteName: 2 (users), 0 - api
44
+ *
45
+ * output endpoint instance name: `usersGetById` (pathSegments[2] + operationId)
46
+ */
16
47
  addPathSegmentToRouteName?: boolean | number;
17
- queryClient: 'builtin' | ImportFileParams;
18
- endpoint: 'builtin' | ImportFileParams;
19
- httpClient: 'builtin' | ImportFileParams;
48
+ queryClient?: 'builtin' | ImportFileParams;
49
+ endpoint?: 'builtin' | ImportFileParams;
50
+ httpClient?: 'builtin' | ImportFileParams;
20
51
  getEndpointMeta?: (route: ParsedRoute, utils: CodegenDataUtils) => {
21
52
  typeName: string;
22
53
  importTypePath: string;
@@ -25,11 +56,9 @@ export interface QueryApiParams {
25
56
  getRequestMeta?: (route: ParsedRoute, utils: CodegenDataUtils) => {
26
57
  tmplData: string;
27
58
  };
59
+ requestOptions?: GenerateApiParamsFromSwagger['requestOptions'];
60
+ otherCodegenParams?: Omit<GenerateApiParamsFromSwagger, 'requestOptions' | 'output' | 'moduleNameFirstTag' | 'moduleNameIndex' | 'url' | 'input' | 'spec'>;
28
61
  }
29
- export type AllImportFileParams = Record<KeyOfByValue<Required<QueryApiParams>, 'builtin' | ImportFileParams>, ImportFileParams>;
30
- export type GenerateApiParams = Omit<GenerateApiParamsFromSwagger, 'output' | 'moduleNameFirstTag' | 'moduleNameIndex' | 'url' | 'input' | 'spec'> & {
31
- output: string;
32
- input: string | AnyObject;
33
- } & QueryApiParams;
34
- export declare const generateApi: (inputParams: GenerateApiParams) => Promise<void>;
62
+ export type AllImportFileParams = Record<KeyOfByValue<Required<GenerateQueryApiParams>, 'builtin' | ImportFileParams>, ImportFileParams>;
63
+ export declare const generateApi: (params: GenerateQueryApiParams | GenerateQueryApiParams[]) => Promise<void>;
35
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,IAAI,4BAA4B,EACjD,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAa9D,MAAM,MAAM,cAAc,GAAG,UAAU,CACrC,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,4BAA4B,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAC3E,SAAS,CACV,CAAC,QAAQ,CAAC,CACZ,CAAC,CAAC,CAAC,CAAC;AAEL,MAAM,MAAM,gBAAgB,GAAG,UAAU,CACvC,cAAc,CAAC,uBAAuB,CAAC,CACxC,CAAC,OAAO,CAAC,CAAC;AAEX,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,uBAAuB,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE7C,WAAW,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAE1C,QAAQ,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAEvC,UAAU,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAEzC,eAAe,CAAC,EAAE,CAChB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,gBAAgB,KACpB;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,gBAAgB,KACpB;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC,EACpE,gBAAgB,CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,4BAA4B,EAC5B,QAAQ,GAAG,oBAAoB,GAAG,iBAAiB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAC/E,GAAG;IACF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,GAAG,cAAc,CAAC;AAEnB,eAAO,MAAM,WAAW,gBAAuB,iBAAiB,kBAgO/D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,IAAI,4BAA4B,EACjD,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAc9D,MAAM,MAAM,cAAc,GAAG,UAAU,CACrC,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,4BAA4B,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAC3E,SAAS,CACV,CAAC,QAAQ,CAAC,CACZ,CAAC,CAAC,CAAC,CAAC;AAEL,MAAM,MAAM,gBAAgB,GAAG,UAAU,CACvC,cAAc,CAAC,uBAAuB,CAAC,CACxC,CAAC,OAAO,CAAC,CAAC;AAEX,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EACJ,CAAC,CAAC,KAAK,EAAE,WAAW,KAAK,MAAM,CAAC,GAChC,cAAc,GACd,gBAAgB,MAAM,EAAE,GACxB,KAAK,GACL,OAAO,MAAM,EAAE,CAAC;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAC;IAE3D;;;;;;;;OAQG;IACH,yBAAyB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE7C,WAAW,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IACxC,UAAU,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAE1C,eAAe,CAAC,EAAE,CAChB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,gBAAgB,KACpB;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,gBAAgB,KACpB;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,cAAc,CAAC,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;IAEhE,kBAAkB,CAAC,EAAE,IAAI,CACvB,4BAA4B,EAC1B,gBAAgB,GAChB,QAAQ,GACR,oBAAoB,GACpB,iBAAiB,GACjB,KAAK,GACL,OAAO,GACP,MAAM,CACT,CAAC;CACH;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,YAAY,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAC5E,gBAAgB,CACjB,CAAC;AAEF,eAAO,MAAM,WAAW,WACd,sBAAsB,GAAG,sBAAsB,EAAE,KACxD,OAAO,CAAC,IAAI,CA6Wd,CAAC"}
package/codegen/index.js CHANGED
@@ -1,40 +1,43 @@
1
1
  import { generateApi as generateApiFromSwagger, } from 'swagger-typescript-api';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
- import { dataContractsTmpl } from './templates/data-contracts.tmpl.js';
4
+ import { LINTERS_IGNORE } from './templates/constants.js';
5
+ import { dataContractsFileTmpl } from './templates/data-contracts-file.tmpl.js';
5
6
  import { indexTsForRequestPerFileTmpl } from './templates/index-ts-for-request-per-file.tmpl.js';
6
7
  import { requestInfoPerFileTmpl } from './templates/request-info-per-file.tmpl.js';
7
8
  const __filename = fileURLToPath(import.meta.url);
8
9
  const __dirname = path.dirname(__filename);
9
- export const generateApi = async (inputParams) => {
10
- const { output, input, ...params } = inputParams;
10
+ export const generateApi = async (params) => {
11
+ if (Array.isArray(params)) {
12
+ await Promise.all(params.map((param) => generateApi(param)));
13
+ return;
14
+ }
11
15
  const importFileParams = {
12
- queryClient: typeof inputParams.queryClient === 'string'
16
+ queryClient: !params.queryClient || typeof params.queryClient === 'string'
13
17
  ? {
14
18
  exportName: 'queryClient',
15
19
  path: 'mobx-tanstack-query-api/builtin',
16
20
  }
17
- : inputParams.queryClient,
18
- endpoint: typeof inputParams.endpoint === 'string'
21
+ : params.queryClient,
22
+ endpoint: !params.endpoint || typeof params.endpoint === 'string'
19
23
  ? {
20
24
  exportName: 'Endpoint',
21
25
  path: 'mobx-tanstack-query-api',
22
26
  }
23
- : inputParams.endpoint,
24
- httpClient: typeof inputParams.httpClient === 'string'
27
+ : params.endpoint,
28
+ httpClient: !params.httpClient || typeof params.httpClient === 'string'
25
29
  ? {
26
30
  exportName: 'http',
27
31
  path: 'mobx-tanstack-query-api/builtin',
28
32
  }
29
- : inputParams.httpClient,
33
+ : params.httpClient,
30
34
  };
31
35
  const paths = {
32
36
  templates: path.resolve(__dirname, 'templates'),
33
37
  requestInfoClass: path.resolve(__dirname, 'templates/request-info-class.ejs'),
34
38
  httpClient: path.resolve(__dirname, 'templates/http-client.ejs'),
35
39
  createRequestInfoInstance: path.resolve(__dirname, 'templates/create-request-info-instance.ejs'),
36
- outputDir: output,
37
- outputEndpoints: path.resolve(output, 'endpoints'),
40
+ outputDir: params.output,
38
41
  };
39
42
  const codegenParams = {
40
43
  httpClientType: 'fetch',
@@ -59,19 +62,20 @@ export const generateApi = async (inputParams) => {
59
62
  ...constructs,
60
63
  object: () => `Record<string, any>`,
61
64
  float: () => `number`,
62
- ...params?.primitiveTypeConstructs?.(constructs),
65
+ ...params.otherCodegenParams?.primitiveTypeConstructs?.(constructs),
63
66
  };
64
67
  },
65
- ...params,
68
+ requestOptions: params.requestOptions,
69
+ ...params.otherCodegenParams,
66
70
  };
67
71
  let codegenProcess;
68
72
  const inputData = {};
69
- if (typeof input === 'string') {
70
- inputData.input = input;
71
- inputData.url = input;
73
+ if (typeof params.input === 'string') {
74
+ inputData.input = params.input;
75
+ inputData.url = params.input;
72
76
  }
73
77
  else {
74
- inputData.spec = input;
78
+ inputData.spec = params.input;
75
79
  }
76
80
  const generated = await generateApiFromSwagger({
77
81
  ...codegenParams,
@@ -89,10 +93,10 @@ export const generateApi = async (inputParams) => {
89
93
  },
90
94
  onFormatRouteName: (routeInfo, usageRouteName) => {
91
95
  let formattedRouteName = usageRouteName;
92
- if (inputParams.addPathSegmentToRouteName === true ||
93
- typeof inputParams.addPathSegmentToRouteName === 'number') {
94
- const pathSegmentForSuffix = typeof inputParams.addPathSegmentToRouteName === 'number'
95
- ? inputParams.addPathSegmentToRouteName
96
+ if (params.addPathSegmentToRouteName === true ||
97
+ typeof params.addPathSegmentToRouteName === 'number') {
98
+ const pathSegmentForSuffix = typeof params.addPathSegmentToRouteName === 'number'
99
+ ? params.addPathSegmentToRouteName
96
100
  : 0;
97
101
  const pathSegments = routeInfo.route.split('/').filter(Boolean);
98
102
  const { _ } = codegenProcess.getRenderTemplateData().utils;
@@ -105,41 +109,134 @@ export const generateApi = async (inputParams) => {
105
109
  const utils = codegenProcess.getRenderTemplateData().utils;
106
110
  const { _ } = utils;
107
111
  const codegenFs = codegenProcess.fileSystem;
108
- codegenFs.cleanDir(output);
109
- codegenFs.createDir(output);
110
- codegenFs.createDir(paths.outputEndpoints);
112
+ codegenFs.cleanDir(params.output);
113
+ codegenFs.createDir(params.output);
111
114
  const allRoutes = Object.values(generated.configuration.routes)
112
115
  .flat()
113
116
  .flatMap((routeGroup) => 'routes' in routeGroup ? routeGroup.routes : routeGroup);
114
117
  const reservedDataContractNamesMap = new Map();
115
- const fileNamesWithRequestInfo = [];
116
- for await (const route of allRoutes) {
117
- const { content: requestInfoPerFileContent, reservedDataContractNames } = await requestInfoPerFileTmpl({
118
- ...generated,
119
- route,
120
- apiParams: inputParams,
121
- codegenProcess,
122
- importFileParams,
123
- utils,
124
- });
125
- reservedDataContractNames.forEach((name) => {
126
- reservedDataContractNamesMap.set(name, (reservedDataContractNamesMap.get(name) ?? 0) + 1);
127
- });
128
- const fileName = `${_.kebabCase(route.routeName.usage)}.ts`;
129
- fileNamesWithRequestInfo.push(fileName);
118
+ if (params.groupBy == null) {
119
+ // #region кодогенерация 1 эндпоинт - 1 файл без группировки
120
+ codegenFs.createDir(path.resolve(params.output, 'endpoints'));
121
+ const fileNamesWithRequestInfo = [];
122
+ for await (const route of allRoutes) {
123
+ const { content: requestInfoPerFileContent, reservedDataContractNames } = await requestInfoPerFileTmpl({
124
+ ...generated,
125
+ route,
126
+ apiParams: params,
127
+ codegenProcess,
128
+ importFileParams,
129
+ utils,
130
+ relativePathDataContracts: '../data-contracts',
131
+ });
132
+ reservedDataContractNames.forEach((name) => {
133
+ reservedDataContractNamesMap.set(name, (reservedDataContractNamesMap.get(name) ?? 0) + 1);
134
+ });
135
+ const fileName = `${_.kebabCase(route.routeName.usage)}.ts`;
136
+ fileNamesWithRequestInfo.push(fileName);
137
+ codegenFs.createFile({
138
+ path: path.resolve(params.output, 'endpoints'),
139
+ fileName,
140
+ withPrefix: false,
141
+ content: requestInfoPerFileContent,
142
+ });
143
+ }
130
144
  codegenFs.createFile({
131
- path: paths.outputEndpoints,
132
- fileName,
145
+ path: path.resolve(params.output, 'endpoints'),
146
+ fileName: 'index.ts',
133
147
  withPrefix: false,
134
- content: requestInfoPerFileContent,
148
+ content: await indexTsForRequestPerFileTmpl({
149
+ ...generated,
150
+ apiParams: params,
151
+ codegenProcess,
152
+ generatedRequestFileNames: fileNamesWithRequestInfo,
153
+ }),
135
154
  });
155
+ // #endregion
156
+ }
157
+ else {
158
+ // #region кодогенерация с группировкой
159
+ // #region разбиение роутов по группам
160
+ const groupsMap = new Map();
161
+ allRoutes.forEach((route) => {
162
+ let group;
163
+ if (typeof params.groupBy === 'function') {
164
+ group = params.groupBy(route);
165
+ }
166
+ else if (params.groupBy?.includes('path-segment')) {
167
+ const segmentIndex = +params.groupBy.replaceAll(/path-segment-?/g, '') || 0;
168
+ group =
169
+ route.request.path?.split('/')?.filter(Boolean)?.[segmentIndex] || undefined;
170
+ }
171
+ else if (params.groupBy?.includes('tag')) {
172
+ const tagIndex = +params.groupBy.replaceAll(/tag-?/g, '') || 0;
173
+ group = route.raw?.tags?.[tagIndex] ?? undefined;
174
+ }
175
+ if (group == null) {
176
+ group = '_other';
177
+ }
178
+ if (!groupsMap.has(group)) {
179
+ groupsMap.set(group, []);
180
+ }
181
+ groupsMap.get(group)?.push(route);
182
+ });
183
+ // #endregion
184
+ for await (const [groupName, routes] of groupsMap) {
185
+ const fileNamesWithRequestInfo = [];
186
+ codegenFs.createDir(path.resolve(params.output, _.kebabCase(groupName)));
187
+ codegenFs.createDir(path.resolve(params.output, _.kebabCase(groupName), 'endpoints'));
188
+ for await (const route of routes) {
189
+ const { content: requestInfoPerFileContent, reservedDataContractNames, } = await requestInfoPerFileTmpl({
190
+ ...generated,
191
+ route,
192
+ apiParams: params,
193
+ codegenProcess,
194
+ importFileParams,
195
+ utils,
196
+ relativePathDataContracts: '../../data-contracts',
197
+ });
198
+ reservedDataContractNames.forEach((name) => {
199
+ reservedDataContractNamesMap.set(name, (reservedDataContractNamesMap.get(name) ?? 0) + 1);
200
+ });
201
+ const fileName = `${_.kebabCase(route.routeName.usage)}.ts`;
202
+ fileNamesWithRequestInfo.push(fileName);
203
+ codegenFs.createFile({
204
+ path: path.resolve(params.output, _.kebabCase(groupName), 'endpoints'),
205
+ fileName,
206
+ withPrefix: false,
207
+ content: requestInfoPerFileContent,
208
+ });
209
+ }
210
+ if (routes.length > 0) {
211
+ codegenFs.createFile({
212
+ path: path.resolve(params.output, _.kebabCase(groupName)),
213
+ fileName: 'index.ts',
214
+ withPrefix: false,
215
+ content: `${LINTERS_IGNORE}
216
+ export * from './endpoints';
217
+ `,
218
+ });
219
+ codegenFs.createFile({
220
+ path: path.resolve(params.output, _.kebabCase(groupName), 'endpoints'),
221
+ fileName: 'index.ts',
222
+ withPrefix: false,
223
+ content: await indexTsForRequestPerFileTmpl({
224
+ ...generated,
225
+ apiParams: params,
226
+ codegenProcess,
227
+ generatedRequestFileNames: fileNamesWithRequestInfo,
228
+ }),
229
+ });
230
+ }
231
+ }
232
+ // #endregion
136
233
  }
137
234
  const excludedDataContractNames = Array.from(reservedDataContractNamesMap.entries())
138
235
  .filter(([_, count]) => count === 1)
139
236
  .map(([name]) => name);
140
- const dataContractsContent = await dataContractsTmpl({
237
+ const dataContractsContent = await dataContractsFileTmpl({
141
238
  ...generated,
142
- apiParams: inputParams,
239
+ apiParams: params,
143
240
  codegenProcess,
144
241
  excludedDataContractNames,
145
242
  });
@@ -149,26 +246,37 @@ export const generateApi = async (inputParams) => {
149
246
  withPrefix: false,
150
247
  content: dataContractsContent,
151
248
  });
152
- codegenFs.createFile({
153
- path: paths.outputEndpoints,
154
- fileName: 'index.ts',
155
- withPrefix: false,
156
- content: await indexTsForRequestPerFileTmpl({
157
- ...generated,
158
- apiParams: inputParams,
159
- codegenProcess,
160
- generatedRequestFileNames: fileNamesWithRequestInfo,
161
- }),
162
- });
163
- codegenFs.createFile({
164
- path: paths.outputDir,
165
- fileName: 'index.ts',
166
- withPrefix: false,
167
- content: `
168
- /* eslint-disable */
169
- /* tslint:disable */
249
+ if (params.namespace) {
250
+ const namespace = typeof params.namespace === 'function'
251
+ ? params.namespace(utils)
252
+ : params.namespace;
253
+ codegenFs.createFile({
254
+ path: paths.outputDir,
255
+ fileName: '__exports.ts',
256
+ withPrefix: false,
257
+ content: `${LINTERS_IGNORE}
170
258
  export * from './data-contracts';
171
259
  export * from './endpoints';
260
+ `,
261
+ });
262
+ codegenFs.createFile({
263
+ path: paths.outputDir,
264
+ fileName: 'index.ts',
265
+ withPrefix: false,
266
+ content: `${LINTERS_IGNORE}
267
+ export * as ${namespace} from './__exports';
172
268
  `,
173
- });
269
+ });
270
+ }
271
+ else {
272
+ codegenFs.createFile({
273
+ path: paths.outputDir,
274
+ fileName: 'index.ts',
275
+ withPrefix: false,
276
+ content: `${LINTERS_IGNORE}
277
+ export * from './data-contracts';
278
+ export * from './endpoints';
279
+ `,
280
+ });
281
+ }
174
282
  };
@@ -0,0 +1,2 @@
1
+ export declare const LINTERS_IGNORE = "/* eslint-disable */\n/* tslint:disable */";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,+CACN,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const LINTERS_IGNORE = `/* eslint-disable */
2
+ /* tslint:disable */`;
@@ -0,0 +1,10 @@
1
+ import { GenerateApiConfiguration, GenerateApiOutput } from 'swagger-typescript-api';
2
+ import type { CodegenProcess, GenerateQueryApiParams } from '../index.js';
3
+ export interface DataContractsTmplParams extends GenerateApiOutput {
4
+ configuration: GenerateApiConfiguration;
5
+ apiParams: GenerateQueryApiParams;
6
+ codegenProcess: CodegenProcess;
7
+ excludedDataContractNames?: string[];
8
+ }
9
+ export declare const dataContractsFileTmpl: ({ configuration, formatTSContent, excludedDataContractNames, }: DataContractsTmplParams) => Promise<string>;
10
+ //# sourceMappingURL=data-contracts-file.tmpl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-contracts-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/data-contracts-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAK1E,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,sBAAsB,CAAC;IAClC,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,qBAAqB,mEAI/B,uBAAuB,oBA6BzB,CAAC"}
@@ -1,5 +1,6 @@
1
+ import { LINTERS_IGNORE } from './constants.js';
1
2
  import { dataContractTmpl } from './data-contract.tmpl.js';
2
- export const dataContractsTmpl = async ({ configuration, formatTSContent, excludedDataContractNames, }) => {
3
+ export const dataContractsFileTmpl = async ({ configuration, formatTSContent, excludedDataContractNames, }) => {
3
4
  const { config, modelTypes } = configuration;
4
5
  const contractDefinitions = [];
5
6
  if (config.internalTemplateOptions?.addUtilRequiredKeysType) {
@@ -15,8 +16,7 @@ export const dataContractsTmpl = async ({ configuration, formatTSContent, exclud
15
16
  addExportKeyword: true,
16
17
  }));
17
18
  }
18
- return await formatTSContent(`/* eslint-disable */
19
- /* tslint:disable */
19
+ return await formatTSContent(`${LINTERS_IGNORE}
20
20
 
21
21
  ${contractDefinitions.join('\n\n')}
22
22
  `);
@@ -1,8 +1,8 @@
1
1
  import { GenerateApiConfiguration, GenerateApiOutput } from 'swagger-typescript-api';
2
- import { CodegenProcess, QueryApiParams } from '../index.js';
2
+ import { CodegenProcess, GenerateQueryApiParams } from '../index.js';
3
3
  export interface IndexTsForRequestPerFileTmplParams extends GenerateApiOutput {
4
4
  configuration: GenerateApiConfiguration;
5
- apiParams: QueryApiParams;
5
+ apiParams: GenerateQueryApiParams;
6
6
  codegenProcess: CodegenProcess;
7
7
  generatedRequestFileNames: string[];
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index-ts-for-request-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/index-ts-for-request-per-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,WAAW,kCAAmC,SAAQ,iBAAiB;IAC3E,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,cAAc,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,4BAA4B,mCAEtC,kCAAkC,oBAKpC,CAAC"}
1
+ {"version":3,"file":"index-ts-for-request-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/index-ts-for-request-per-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAIrE,MAAM,WAAW,kCAAmC,SAAQ,iBAAiB;IAC3E,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,sBAAsB,CAAC;IAClC,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,4BAA4B,mCAEtC,kCAAkC,oBAIpC,CAAC"}
@@ -1,6 +1,6 @@
1
+ import { LINTERS_IGNORE } from './constants.js';
1
2
  export const indexTsForRequestPerFileTmpl = async ({ generatedRequestFileNames, }) => {
2
- return `/* eslint-disable */
3
- /* tslint:disable */
3
+ return `${LINTERS_IGNORE}
4
4
  ${generatedRequestFileNames.map((fileName) => `export * from './${fileName.replace('.ts', '')}';`).join('\n')}
5
5
  `;
6
6
  };
@@ -1,9 +1,9 @@
1
1
  import { GenerateApiConfiguration, ParsedRoute } from 'swagger-typescript-api';
2
- import type { AllImportFileParams, CodegenDataUtils, QueryApiParams } from '../index.js';
2
+ import type { AllImportFileParams, CodegenDataUtils, GenerateQueryApiParams } from '../index.js';
3
3
  export interface NewRequestInfoTmplParams {
4
4
  route: ParsedRoute;
5
5
  configuration: GenerateApiConfiguration;
6
- apiParams: QueryApiParams;
6
+ apiParams: GenerateQueryApiParams;
7
7
  importFileParams: AllImportFileParams;
8
8
  utils: CodegenDataUtils;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"new-request-info.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/new-request-info.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,cAAc,CAAC;IAC1B,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAiBD,eAAO,MAAM,kBAAkB,mDAK5B,wBAAwB;;;CAqO1B,CAAC"}
1
+ {"version":3,"file":"new-request-info.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/new-request-info.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,sBAAsB,CAAC;IAClC,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAiBD,eAAO,MAAM,kBAAkB,mDAK5B,wBAAwB;;;CAqO1B,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { ParsedRoute, GenerateApiConfiguration } from 'swagger-typescript-api';
2
- import { QueryApiParams } from '../index.js';
2
+ import { GenerateQueryApiParams } from '../index.js';
3
3
  export interface RequestInfoJSDocTmplParams {
4
4
  route: ParsedRoute;
5
5
  configuration: GenerateApiConfiguration;
6
- apiParams: QueryApiParams;
6
+ apiParams: GenerateQueryApiParams;
7
7
  offset?: number;
8
8
  }
9
9
  export declare const requestInfoJSDocTmpl: ({ route, configuration, offset, }: RequestInfoJSDocTmplParams) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"request-info-jsdoc.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-jsdoc.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,sCAI9B,0BAA0B,WAkH5B,CAAC"}
1
+ {"version":3,"file":"request-info-jsdoc.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-jsdoc.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,sCAI9B,0BAA0B,WAkH5B,CAAC"}
@@ -1,14 +1,15 @@
1
1
  import { ParsedRoute, GenerateApiConfiguration, GenerateApiOutput } from 'swagger-typescript-api';
2
- import type { AllImportFileParams, CodegenDataUtils, CodegenProcess, QueryApiParams } from '../index.js';
2
+ import type { AllImportFileParams, CodegenDataUtils, CodegenProcess, GenerateQueryApiParams } from '../index.js';
3
3
  export interface RequestInfoPerFileTmplParams extends GenerateApiOutput {
4
4
  route: ParsedRoute;
5
5
  configuration: GenerateApiConfiguration;
6
- apiParams: QueryApiParams;
6
+ apiParams: GenerateQueryApiParams;
7
7
  codegenProcess: CodegenProcess;
8
8
  importFileParams: AllImportFileParams;
9
9
  utils: CodegenDataUtils;
10
+ relativePathDataContracts: string;
10
11
  }
11
- export declare const requestInfoPerFileTmpl: ({ route, configuration, apiParams, formatTSContent, importFileParams, utils, }: RequestInfoPerFileTmplParams) => Promise<{
12
+ export declare const requestInfoPerFileTmpl: ({ route, configuration, apiParams, formatTSContent, importFileParams, utils, relativePathDataContracts, }: RequestInfoPerFileTmplParams) => Promise<{
12
13
  reservedDataContractNames: string[];
13
14
  content: string;
14
15
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"request-info-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-per-file.tmpl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACf,MAAM,aAAa,CAAC;AAMrB,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB;IACrE,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,cAAc,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,eAAO,MAAM,sBAAsB,mFAOhC,4BAA4B;;;EA8E9B,CAAC"}
1
+ {"version":3,"file":"request-info-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-per-file.tmpl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAOrB,MAAM,WAAW,4BAA6B,SAAQ,iBAAiB;IACrE,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,sBAAsB,CAAC;IAClC,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,KAAK,EAAE,gBAAgB,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,sBAAsB,8GAQhC,4BAA4B;;;EA6E9B,CAAC"}
@@ -1,7 +1,8 @@
1
+ import { LINTERS_IGNORE } from './constants.js';
1
2
  import { dataContractTmpl } from './data-contract.tmpl.js';
2
3
  import { newRequestInfoTmpl } from './new-request-info.tmpl.js';
3
4
  import { requestInfoJSDocTmpl } from './request-info-jsdoc.tmpl.js';
4
- export const requestInfoPerFileTmpl = async ({ route, configuration, apiParams, formatTSContent, importFileParams, utils, }) => {
5
+ export const requestInfoPerFileTmpl = async ({ route, configuration, apiParams, formatTSContent, importFileParams, utils, relativePathDataContracts, }) => {
5
6
  const { _ } = utils;
6
7
  const { content: requestInfoInstanceContent, reservedDataContractNames } = newRequestInfoTmpl({
7
8
  route,
@@ -19,8 +20,7 @@ export const requestInfoPerFileTmpl = async ({ route, configuration, apiParams,
19
20
  });
20
21
  return {
21
22
  reservedDataContractNames: dataContractNamesInThisFile,
22
- content: await formatTSContent(`/* eslint-disable */
23
- /* tslint:disable */
23
+ content: await formatTSContent(`${LINTERS_IGNORE}
24
24
  import { RequestParams } from "mobx-tanstack-query-api";
25
25
  import { ${importFileParams.endpoint.exportName} } from "${importFileParams.endpoint.path}";
26
26
  import { ${importFileParams.httpClient.exportName} } from "${importFileParams.httpClient.path}";
@@ -30,7 +30,7 @@ export const requestInfoPerFileTmpl = async ({ route, configuration, apiParams,
30
30
  import { ${configuration.modelTypes
31
31
  .map((it) => it.name)
32
32
  .filter((it) => !dataContractNamesInThisFile.includes(it))
33
- .join(', ')} } from "../data-contracts";
33
+ .join(', ')} } from "${relativePathDataContracts}";
34
34
  `
35
35
  : ''}
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx-tanstack-query-api",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "keywords": [],
5
5
  "author": "js2me",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "swagger-typescript-api": "13.0.23",
25
- "yummies": "^3.0.36"
25
+ "yummies": "^3.0.37"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^20.17.11",
@@ -30,6 +30,7 @@
30
30
  "js2me-eslint-config": "^1.0.7",
31
31
  "js2me-exports-post-build-script": "^2.0.17",
32
32
  "jsdom": "^26.0.0",
33
+ "nodemon": "^3.1.9",
33
34
  "rimraf": "^6.0.1",
34
35
  "typescript": "^5.7.2",
35
36
  "unplugin-swc": "^1.5.1",
@@ -61,15 +62,20 @@
61
62
  "default": "./codegen/index.js",
62
63
  "types": "./codegen/index.d.ts"
63
64
  },
65
+ "./codegen/templates/constants": {
66
+ "import": "./codegen/templates/constants.js",
67
+ "default": "./codegen/templates/constants.js",
68
+ "types": "./codegen/templates/constants.d.ts"
69
+ },
64
70
  "./codegen/templates/data-contract.tmpl": {
65
71
  "import": "./codegen/templates/data-contract.tmpl.js",
66
72
  "default": "./codegen/templates/data-contract.tmpl.js",
67
73
  "types": "./codegen/templates/data-contract.tmpl.d.ts"
68
74
  },
69
- "./codegen/templates/data-contracts.tmpl": {
70
- "import": "./codegen/templates/data-contracts.tmpl.js",
71
- "default": "./codegen/templates/data-contracts.tmpl.js",
72
- "types": "./codegen/templates/data-contracts.tmpl.d.ts"
75
+ "./codegen/templates/data-contracts-file.tmpl": {
76
+ "import": "./codegen/templates/data-contracts-file.tmpl.js",
77
+ "default": "./codegen/templates/data-contracts-file.tmpl.js",
78
+ "types": "./codegen/templates/data-contracts-file.tmpl.d.ts"
73
79
  },
74
80
  "./codegen/templates/index-ts-for-request-per-file.tmpl": {
75
81
  "import": "./codegen/templates/index-ts-for-request-per-file.tmpl.js",
@@ -134,6 +140,7 @@
134
140
  "ts:check": "tsc --noEmit",
135
141
  "check": "npm run lint:check && npm run ts:check",
136
142
  "prebuild": "npm run clean && npm run check",
143
+ "build:watch": "npm run build && nodemon --watch src --ext ts --exec \"tsc && node ./post-build.mjs\"",
137
144
  "build": "tsc && node ./post-build.mjs",
138
145
  "pub": "PUBLISH=true pnpm run build",
139
146
  "pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",
@@ -1,10 +0,0 @@
1
- import { GenerateApiConfiguration, GenerateApiOutput } from 'swagger-typescript-api';
2
- import type { CodegenProcess, QueryApiParams } from '../index.js';
3
- export interface DataContractsTmplParams extends GenerateApiOutput {
4
- configuration: GenerateApiConfiguration;
5
- apiParams: QueryApiParams;
6
- codegenProcess: CodegenProcess;
7
- excludedDataContractNames?: string[];
8
- }
9
- export declare const dataContractsTmpl: ({ configuration, formatTSContent, excludedDataContractNames, }: DataContractsTmplParams) => Promise<string>;
10
- //# sourceMappingURL=data-contracts.tmpl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-contracts.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/data-contracts.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlE,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,EAAE,cAAc,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,iBAAiB,mEAI3B,uBAAuB,oBA8BzB,CAAC"}