@povio/openapi-codegen-cli 3.3.0-rc.2 → 3.3.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.
Files changed (68) hide show
  1. package/README.md +132 -9
  2. package/dist/AuthGuard-GbtTDXs0.d.mts +32 -0
  3. package/dist/AuthGuard-qpAtHaBz.mjs +24 -0
  4. package/dist/acl.d.mts +14 -27
  5. package/dist/acl.mjs +17 -14
  6. package/dist/{auth.context-BAz8frX9.mjs → auth.context-COWO6ssl.mjs} +1 -18
  7. package/dist/auth.d.mts +2 -0
  8. package/dist/auth.mjs +3 -0
  9. package/dist/axios.d.mts +2 -0
  10. package/dist/axios.mjs +2 -0
  11. package/dist/{config-BQqze8rU.d.mts → config-BYiBd1QI.d.mts} +1 -2
  12. package/dist/config.d.mts +4 -0
  13. package/dist/config.mjs +5 -0
  14. package/dist/{error-handling-D6ZYITQ3.d.mts → error-handling-LPEPQV1V.d.mts} +3 -42
  15. package/dist/{error-handling-CsnufAil.mjs → error-handling-uS0DgYUR.mjs} +23 -47
  16. package/dist/errors.d.mts +3 -0
  17. package/dist/errors.mjs +2 -0
  18. package/dist/generate.runner-CxlaA4c5.mjs +1670 -0
  19. package/dist/generate.utils-SfgYwPe7.cjs +2271 -0
  20. package/dist/generateCodeFromOpenAPIDoc-CmN4bFjv.mjs +2246 -0
  21. package/dist/{generateCodeFromOpenAPIDoc-SYuVswEJ.mjs → generateCodeFromOpenAPIDoc-Dv-hqKhh.cjs} +1511 -2269
  22. package/dist/generator.d.mts +3 -10
  23. package/dist/generator.mjs +6 -4
  24. package/dist/getDataFromOpenAPIDoc-DzeHecv2.mjs +2016 -0
  25. package/dist/i18n-B_brQh4X.d.mts +38 -0
  26. package/dist/i18n-D-FesqFb.mjs +36 -0
  27. package/dist/index.d.mts +12 -198
  28. package/dist/index.mjs +12 -256
  29. package/dist/metro.cjs +118 -4862
  30. package/dist/metro.d.mts +3 -4
  31. package/dist/metro.mjs +3 -3
  32. package/dist/native-rest-interceptor-Np4Ov54n.mjs +215 -0
  33. package/dist/native-rest-interceptor-PgziZt1f.d.mts +49 -0
  34. package/dist/native.d.mts +3 -0
  35. package/dist/native.mjs +3 -0
  36. package/dist/openapi-codegen-native-darwin-arm64.node +0 -0
  37. package/dist/openapi-codegen-native-linux-x64.node +0 -0
  38. package/dist/openapi-codegen-native-win32-x64.node +0 -0
  39. package/dist/{openapi-codegen.runner-CCXQsUum.mjs → openapi-codegen.runner-DDd4AXRT.mjs} +2 -2
  40. package/dist/{openapi-source.runner-8kCe-g9S.mjs → openapi-source.runner-DPUNTduQ.mjs} +25 -11
  41. package/dist/{openapi-source.runner-B6KKrXw7.d.mts → openapi-source.runner-lmK-P6HE.d.mts} +2 -8
  42. package/dist/{options-DdQJ9BSc.d.mts → options-DH-fAG0w.d.mts} +12 -1
  43. package/dist/query.d.mts +3 -0
  44. package/dist/query.mjs +3 -0
  45. package/dist/queryConfig.context-CRJOgf19.d.mts +22 -0
  46. package/dist/queryConfig.context-CldQ5YL9.mjs +34 -0
  47. package/dist/rest-client-CQyFvqYC.d.mts +55 -0
  48. package/dist/rest-interceptor-Dm9DFErh.mjs +115 -0
  49. package/dist/rest-transport.types-DM5-qyOJ.d.mts +66 -0
  50. package/dist/rest-transport.types-DxitRtsB.mjs +11 -0
  51. package/dist/rest.d.mts +2 -0
  52. package/dist/rest.mjs +2 -0
  53. package/dist/rest.utils-DpiFIdhF.d.mts +9 -0
  54. package/dist/router.context-EPlMBk3G.mjs +21 -0
  55. package/dist/sh.d.mts +1 -1
  56. package/dist/sh.mjs +55 -55
  57. package/dist/tiny.d.mts +1 -1
  58. package/dist/tiny.mjs +1 -1
  59. package/dist/useMutationEffects-DIdL8tlx.d.mts +29 -0
  60. package/dist/useMutationEffects-PB1fvKWM.mjs +68 -0
  61. package/dist/vite.d.mts +3 -4
  62. package/dist/vite.mjs +5 -4
  63. package/dist/workspace.context-XWvQ_7Hg.mjs +26 -0
  64. package/dist/workspace.context-isVY9ves.d.mts +23 -0
  65. package/dist/zod.d.mts +2 -7
  66. package/dist/zod.mjs +1 -1
  67. package/package.json +71 -21
  68. package/dist/generate.runner-B0Zm3pIl.mjs +0 -87
@@ -0,0 +1,2271 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ let fs = require("fs");
24
+ fs = __toESM(fs, 1);
25
+ let path = require("path");
26
+ path = __toESM(path, 1);
27
+ require("url");
28
+ let node_module = require("node:module");
29
+ let node_fs = require("node:fs");
30
+ let node_url = require("node:url");
31
+ let node_path = require("node:path");
32
+ node_path = __toESM(node_path, 1);
33
+ let openapi_types = require("openapi-types");
34
+ //#region src/generators/const/package.const.ts
35
+ const PACKAGE_IMPORT_PATH = "@povio/openapi-codegen-cli";
36
+ const AXIOS_PACKAGE_IMPORT_PATH = `${PACKAGE_IMPORT_PATH}/axios`;
37
+ const NATIVE_PACKAGE_IMPORT_PATH = `${PACKAGE_IMPORT_PATH}/native`;
38
+ const REST_PACKAGE_IMPORT_PATH = `${PACKAGE_IMPORT_PATH}/rest`;
39
+ const QUERY_PACKAGE_IMPORT_PATH = `${PACKAGE_IMPORT_PATH}/query`;
40
+ const CONFIG_PACKAGE_IMPORT_PATH = `${PACKAGE_IMPORT_PATH}/config`;
41
+ //#endregion
42
+ //#region src/generators/const/zod.const.ts
43
+ const SCHEMA_SUFFIX = "Schema";
44
+ const ENUM_SUFFIX = "Enum";
45
+ const BODY_SCHEMA_SUFFIX = "Body";
46
+ const PARAM_SCHEMA_SUFFIX = "Param";
47
+ const RESPONSE_SCHEMA_SUFFIX = "Response";
48
+ const ERROR_RESPONSE_SCHEMA_SUFFIX = "ErrorResponse";
49
+ const VOID_SCHEMA = "z.void()";
50
+ const ANY_SCHEMA = "z.any()";
51
+ const BLOB_SCHEMA = "z.instanceof(Blob)";
52
+ const ENUM_SCHEMA = "z.enum";
53
+ const INT_SCHEMA = "z.int()";
54
+ const NUMBER_SCHEMA = "z.number()";
55
+ const STRING_SCHEMA = "z.string()";
56
+ const EMAIL_SCHEMA = "z.email()";
57
+ const URL_SCHEMA = "z.url()";
58
+ const UUID_SCHEMA = "z.uuid()";
59
+ const DATETIME_SCHEMA = "z.iso.datetime({ offset: true })";
60
+ const ZOD_IMPORT = {
61
+ bindings: ["z"],
62
+ from: "zod"
63
+ };
64
+ //#endregion
65
+ //#region src/generators/const/options.const.ts
66
+ const DEFAULT_GENERATE_OPTIONS = {
67
+ input: "http://localhost:4000/docs-json/",
68
+ output: "output",
69
+ clearOutput: false,
70
+ incremental: true,
71
+ splitByTags: true,
72
+ defaultTag: "Common",
73
+ includeTags: [],
74
+ excludeTags: [],
75
+ excludePathRegex: "",
76
+ excludeRedundantZodSchemas: true,
77
+ tsNamespaces: true,
78
+ treeShakeableNamespaces: false,
79
+ tsPath: "@/data",
80
+ importPath: "ts",
81
+ configs: {
82
+ ["models"]: {
83
+ outputFileNameSuffix: "models",
84
+ namespaceSuffix: "Models"
85
+ },
86
+ ["endpoints"]: {
87
+ outputFileNameSuffix: "api",
88
+ namespaceSuffix: "Api"
89
+ },
90
+ ["queries"]: {
91
+ outputFileNameSuffix: "queries",
92
+ namespaceSuffix: "Queries"
93
+ },
94
+ ["acl"]: {
95
+ outputFileNameSuffix: "acl",
96
+ namespaceSuffix: "Acl"
97
+ },
98
+ ["configs"]: {
99
+ outputFileNameSuffix: "configs",
100
+ namespaceSuffix: "Configs"
101
+ }
102
+ },
103
+ baseUrl: "",
104
+ modelsOnly: false,
105
+ standalone: false,
106
+ compileSchemas: false,
107
+ lazySchemas: false,
108
+ generateJsDoc: false,
109
+ schemaSuffix: SCHEMA_SUFFIX,
110
+ enumSuffix: ENUM_SUFFIX,
111
+ modelsInCommon: false,
112
+ modelsInModules: false,
113
+ withDefaultValues: true,
114
+ extractEnums: true,
115
+ replaceOptionalWithNullish: false,
116
+ restClient: "axios",
117
+ restClientImportPath: "",
118
+ zodImportPath: "@povio/openapi-codegen-cli/zod",
119
+ errorHandlingImportPath: "",
120
+ removeOperationPrefixEndingWith: "Controller_",
121
+ parseRequestParams: true,
122
+ inlineEndpoints: false,
123
+ inlineEndpointsExcludeModules: [],
124
+ queryTypesImportPath: QUERY_PACKAGE_IMPORT_PATH,
125
+ mutationEffectsImportPath: QUERY_PACKAGE_IMPORT_PATH,
126
+ axiosRequestConfig: false,
127
+ mutationEffects: true,
128
+ mutationDefaultOnError: false,
129
+ workspaceContext: [],
130
+ prefetchQueries: true,
131
+ mutationScope: false,
132
+ infiniteQueries: false,
133
+ infiniteQueryParamNames: { page: "page" },
134
+ infiniteQueryResponseParamNames: {
135
+ page: "page",
136
+ totalItems: "totalItems",
137
+ limit: "limit"
138
+ },
139
+ acl: true,
140
+ checkAcl: true,
141
+ abilityContextGenericAppAbilities: false,
142
+ abilityContextImportPath: "",
143
+ aclCheckImportPath: "@povio/openapi-codegen-cli/acl",
144
+ builderConfigs: false,
145
+ filterParamName: "filter",
146
+ dataResponseParamNames: ["data", "items"],
147
+ dynamicInputsImportPath: "@povio/ui",
148
+ dynamicColumnsImportPath: "@povio/ui"
149
+ };
150
+ //#endregion
151
+ //#region src/generators/utils/object.utils.ts
152
+ /** Pick given properties in object */
153
+ function pick(obj, paths) {
154
+ const result = {};
155
+ Object.keys(obj).forEach((key) => {
156
+ if (!paths.includes(key)) return;
157
+ result[key] = obj[key];
158
+ });
159
+ return result;
160
+ }
161
+ /**
162
+ * Deep merge two or more objects/arrays recursively.
163
+ * Arrays are concatenated, objects are merged recursively.
164
+ * Later arguments take precedence over earlier ones.
165
+ * Returns a new object/array without mutating the originals.
166
+ */
167
+ function deepMerge(source, ...sources) {
168
+ if (sources.length === 0) return source;
169
+ let result = source;
170
+ for (const source of sources) result = mergeTwoValues(result, source);
171
+ return result;
172
+ }
173
+ /**
174
+ * Merge two values recursively
175
+ */
176
+ function mergeTwoValues(target, source) {
177
+ if (source === null || source === void 0) return target;
178
+ if (target === null || target === void 0) return deepClone(source);
179
+ if (Array.isArray(target) && Array.isArray(source)) return [...target, ...source];
180
+ if (isPlainObject(target) && isPlainObject(source)) {
181
+ const result = {};
182
+ for (const [key, targetValue] of Object.entries(target)) result[key] = deepClone(targetValue);
183
+ for (const [key, sourceValue] of Object.entries(source)) {
184
+ const targetValue = result[key];
185
+ if (sourceValue === void 0) continue;
186
+ else if (sourceValue === null) result[key] = sourceValue;
187
+ else if (isPlainObject(targetValue) && isPlainObject(sourceValue)) result[key] = mergeTwoValues(targetValue, sourceValue);
188
+ else if (Array.isArray(targetValue) && Array.isArray(sourceValue)) result[key] = [...targetValue, ...sourceValue];
189
+ else result[key] = deepClone(sourceValue);
190
+ }
191
+ return result;
192
+ }
193
+ return deepClone(source);
194
+ }
195
+ /**
196
+ * Deep clone an object or array to avoid reference sharing.
197
+ * Helper function for deepMerge.
198
+ */
199
+ function deepClone(obj) {
200
+ if (obj === null || obj === void 0 || typeof obj !== "object") return obj;
201
+ if (Array.isArray(obj)) return obj.map((item) => deepClone(item));
202
+ if (isPlainObject(obj)) {
203
+ const result = {};
204
+ for (const [key, value] of Object.entries(obj)) result[key] = deepClone(value);
205
+ return result;
206
+ }
207
+ return obj;
208
+ }
209
+ /**
210
+ * Check if a value is a plain object (not an array, Date, etc.)
211
+ */
212
+ function isPlainObject(obj) {
213
+ return obj !== null && typeof obj === "object" && !Array.isArray(obj) && Object.prototype.toString.call(obj) === "[object Object]";
214
+ }
215
+ //#endregion
216
+ //#region src/generators/utils/file.utils.ts
217
+ function getOutputFileName({ output, fileName }) {
218
+ return `${output}/${fileName}`;
219
+ }
220
+ async function writeFileIfChanged(file, data, skipExistingCheck = false) {
221
+ if (skipExistingCheck) {
222
+ await fs.default.promises.writeFile(file, data, "utf-8");
223
+ return;
224
+ }
225
+ try {
226
+ if (await fs.default.promises.readFile(file, "utf-8") === data) return;
227
+ } catch (error) {
228
+ if (error.code !== "ENOENT") throw error;
229
+ }
230
+ await fs.default.promises.writeFile(file, data, "utf-8");
231
+ }
232
+ async function writeFile({ fileName, content }, options) {
233
+ const formattedContent = options?.formatGeneratedFile ? await options.formatGeneratedFile({
234
+ fileName,
235
+ content
236
+ }) : content;
237
+ await fs.default.promises.mkdir(path.default.dirname(fileName), { recursive: true });
238
+ await writeFileIfChanged(fileName, formattedContent, options?.skipExistingCheck);
239
+ }
240
+ async function writeGenerateFileData(filesData, options) {
241
+ if (!options?.formatGeneratedFile) {
242
+ const directories = new Set(filesData.map(({ fileName }) => path.default.dirname(fileName)));
243
+ for (const directory of directories) fs.default.mkdirSync(directory, { recursive: true });
244
+ await Promise.all(filesData.map(({ fileName, content }) => writeFileIfChanged(fileName, content, options?.skipExistingCheck)));
245
+ return;
246
+ }
247
+ for (const file of filesData) await writeFile(file, options);
248
+ }
249
+ function removeStaleGeneratedFiles({ output, filesData, options }) {
250
+ if (!fs.default.existsSync(output)) return;
251
+ const expectedFiles = new Set(filesData.map((file) => path.default.resolve(file.fileName)));
252
+ const generatedSuffixes = new Set(Object.values(options.configs).map((config) => config.outputFileNameSuffix));
253
+ const staleFiles = [];
254
+ const visit = (dirPath) => {
255
+ for (const dirent of fs.default.readdirSync(dirPath, { withFileTypes: true })) {
256
+ const entryPath = path.default.join(dirPath, dirent.name);
257
+ if (dirent.isDirectory()) {
258
+ visit(entryPath);
259
+ continue;
260
+ }
261
+ if (isGeneratedFile(entryPath, output, generatedSuffixes) && !expectedFiles.has(path.default.resolve(entryPath))) staleFiles.push(entryPath);
262
+ }
263
+ };
264
+ visit(output);
265
+ staleFiles.forEach((filePath) => fs.default.rmSync(filePath, { force: true }));
266
+ removeEmptyDirectories(output);
267
+ }
268
+ function isGeneratedFile(filePath, output, generatedSuffixes) {
269
+ const relativePath = path.default.relative(output, filePath);
270
+ if (relativePath === ".openapi-codegen-cache.json") return true;
271
+ const normalizedRelativePath = relativePath.split(path.default.sep).join("/");
272
+ if ([
273
+ "app-rest-client.ts",
274
+ "queryModules.ts",
275
+ "acl/app.ability.ts"
276
+ ].includes(normalizedRelativePath)) return true;
277
+ if (path.default.parse(filePath).ext !== ".ts") return false;
278
+ const segments = relativePath.split(path.default.sep).filter(Boolean);
279
+ if (segments.length < 2) return false;
280
+ const moduleName = segments[0];
281
+ const fileName = segments[segments.length - 1];
282
+ if (!fileName.startsWith(`${moduleName}.`)) return false;
283
+ const suffix = fileName.slice(moduleName.length + 1).replace(/\.tsx?$/, "");
284
+ return generatedSuffixes.has(suffix);
285
+ }
286
+ function removeEmptyDirectories(root) {
287
+ if (!fs.default.existsSync(root)) return;
288
+ const removeIfEmpty = (dirPath) => {
289
+ for (const dirent of fs.default.readdirSync(dirPath, { withFileTypes: true })) if (dirent.isDirectory()) removeIfEmpty(path.default.join(dirPath, dirent.name));
290
+ if (dirPath !== root && fs.default.readdirSync(dirPath).length === 0) fs.default.rmdirSync(dirPath);
291
+ };
292
+ removeIfEmpty(root);
293
+ }
294
+ //#endregion
295
+ //#region src/helpers/profile.helper.ts
296
+ function nowMs() {
297
+ return Number(process.hrtime.bigint()) / 1e6;
298
+ }
299
+ var Profiler = class {
300
+ enabled;
301
+ entries = /* @__PURE__ */ new Map();
302
+ constructor(enabled) {
303
+ this.enabled = enabled;
304
+ }
305
+ add(label, elapsedMs) {
306
+ if (!this.enabled) return;
307
+ const prev = this.entries.get(label);
308
+ if (prev) {
309
+ prev.totalMs += elapsedMs;
310
+ prev.count += 1;
311
+ return;
312
+ }
313
+ this.entries.set(label, {
314
+ totalMs: elapsedMs,
315
+ count: 1
316
+ });
317
+ }
318
+ runSync(label, fn) {
319
+ if (!this.enabled) return fn();
320
+ const startMs = nowMs();
321
+ try {
322
+ return fn();
323
+ } finally {
324
+ this.add(label, nowMs() - startMs);
325
+ }
326
+ }
327
+ async runAsync(label, fn) {
328
+ if (!this.enabled) return await fn();
329
+ const startMs = nowMs();
330
+ try {
331
+ return await fn();
332
+ } finally {
333
+ this.add(label, nowMs() - startMs);
334
+ }
335
+ }
336
+ formatLines() {
337
+ if (!this.enabled) return [];
338
+ return Array.from(this.entries.entries()).sort((a, b) => b[1].totalMs - a[1].totalMs).map(([label, entry]) => {
339
+ const avgMs = entry.totalMs / entry.count;
340
+ return `${label}: ${entry.totalMs.toFixed(1)}ms (count: ${entry.count}, avg: ${avgMs.toFixed(2)}ms)`;
341
+ });
342
+ }
343
+ };
344
+ //#endregion
345
+ //#region src/native/native-bindings.ts
346
+ let bindings;
347
+ let nativePath;
348
+ function getNativePath() {
349
+ if (nativePath) return nativePath;
350
+ const moduleDir = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
351
+ const binaryName = `openapi-codegen-native-${process.platform}-${process.arch}.node`;
352
+ nativePath = [node_path.default.join(moduleDir, binaryName), node_path.default.resolve(moduleDir, "../../dist", binaryName)].find(node_fs.existsSync);
353
+ if (!nativePath) throw new Error("Native OpenAPI codegen module is not built. Run `bun run build:native`.");
354
+ return nativePath;
355
+ }
356
+ function hasNativeBindings() {
357
+ try {
358
+ getNativeBindings();
359
+ return true;
360
+ } catch {
361
+ return false;
362
+ }
363
+ }
364
+ function shouldUseNativeCodegen() {
365
+ if (process.env.OPENAPI_CODEGEN_NATIVE === "0") return false;
366
+ if (process.env.OPENAPI_CODEGEN_NATIVE === "1") return true;
367
+ return hasNativeBindings();
368
+ }
369
+ function getNativeBindings() {
370
+ if (!bindings) {
371
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
372
+ const resolvedNativePath = getNativePath();
373
+ if (typeof process.dlopen === "function") {
374
+ const nativeModule = { exports: {} };
375
+ process.dlopen(nativeModule, resolvedNativePath);
376
+ bindings = nativeModule.exports;
377
+ } else bindings = require$1(resolvedNativePath);
378
+ }
379
+ return bindings;
380
+ }
381
+ function compileNativeData(source, yaml, optionsJson) {
382
+ return getNativeBindings().compileData(source, yaml, optionsJson);
383
+ }
384
+ //#endregion
385
+ //#region src/generators/const/deps.const.ts
386
+ const APP_REST_CLIENT_NAME = "AppRestClient";
387
+ const APP_REST_CLIENT_FILE = {
388
+ fileName: "app-rest-client",
389
+ extension: "ts"
390
+ };
391
+ const DOMAIN_ERRORS_FILE = {
392
+ fileName: "domain-errors",
393
+ extension: "ts"
394
+ };
395
+ const QUERY_OPTIONS_TYPES = {
396
+ query: "AppQueryOptions",
397
+ infiniteQuery: "AppInfiniteQueryOptions",
398
+ mutation: "AppMutationOptions"
399
+ };
400
+ const TEMPLATE_DATA_FILE_PATH = "src/data";
401
+ const ERROR_HANDLERS = {
402
+ ErrorHandler: "ErrorHandler",
403
+ SharedErrorHandler: "SharedErrorHandler"
404
+ };
405
+ ERROR_HANDLERS.ErrorHandler, ERROR_HANDLERS.SharedErrorHandler;
406
+ const BUILDERS_UTILS = {
407
+ dynamicInputs: "dynamicInputs",
408
+ dynamicColumns: "dynamicColumns"
409
+ };
410
+ const QUERY_MODULE_ENUM = "QueryModule";
411
+ const QUERY_MODULES_FILE = {
412
+ fileName: "queryModules",
413
+ extension: "ts"
414
+ };
415
+ const MUTATION_EFFECTS = {
416
+ optionsType: "MutationEffectsOptions",
417
+ hookName: "useMutationEffects",
418
+ runFunctionName: "runMutationEffects"
419
+ };
420
+ const ZOD_EXTENDED = {
421
+ namespace: "ZodExtended",
422
+ exports: {
423
+ parse: "parse",
424
+ sortExp: "sortExp"
425
+ }
426
+ };
427
+ //#endregion
428
+ //#region src/generators/utils/string.utils.ts
429
+ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
430
+ const decapitalize = (str) => str.charAt(0).toLowerCase() + str.slice(1);
431
+ const kebabToCamel = (str) => str.replace(/(-\w)/g, (group) => group[1].toUpperCase());
432
+ const snakeToCamel = (str) => str.replace(/(_\w)/g, (group) => group[1].toUpperCase());
433
+ const nonWordCharactersToCamel = (str) => str.replace(/[\W_]+(\w)?/g, (_, char) => char?.toUpperCase() ?? "");
434
+ const suffixIfNeeded = (text, suffix = "") => text.endsWith(suffix) ? text : `${text}${suffix}`;
435
+ const removeSuffix = (text, suffix) => text.replace(new RegExp(`${suffix}$`), "");
436
+ const getLongestMostCommon = (strs) => {
437
+ const counter = strs.reduce((acc, str) => ({
438
+ ...acc,
439
+ [str]: (acc[str] ?? 0) + 1
440
+ }), {});
441
+ return Object.entries(counter).toSorted((a, b) => {
442
+ if (a[1] === b[1]) return b[0].length - a[0].length;
443
+ return b[1] - a[1];
444
+ })[0]?.[0];
445
+ };
446
+ const getMostCommonAdjacentCombinationSplit = (strs) => {
447
+ const splits = strs.flatMap((str) => getAdjacentStringCombinations(splitByUppercase(capitalize(str))));
448
+ return getLongestMostCommon(splits);
449
+ };
450
+ const splitByUppercase = (str) => {
451
+ return str.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean);
452
+ };
453
+ const camelToSpaceSeparated = (text) => splitByUppercase(text).join(" ");
454
+ const getAdjacentStringCombinations = (strs, ignoreStrs = [
455
+ "dto",
456
+ "by",
457
+ "for",
458
+ "of",
459
+ "in",
460
+ "to",
461
+ "and",
462
+ "with"
463
+ ]) => {
464
+ const combinations = [];
465
+ for (let i = 0; i < strs.length; i++) {
466
+ if (ignoreStrs.includes(strs[i].toLowerCase())) continue;
467
+ for (let j = i + 1; j <= strs.length; j++) {
468
+ if (ignoreStrs.includes(strs[j - 1]?.toLowerCase())) continue;
469
+ combinations.push(strs.slice(i, j).join(""));
470
+ }
471
+ }
472
+ return combinations;
473
+ };
474
+ const removeWord = (source, wordToRemove) => {
475
+ const singularWordToRemove = wordToRemove.replace(/es$|s$/g, "");
476
+ const pattern = new RegExp(`(${decapitalize(singularWordToRemove)}|${capitalize(singularWordToRemove)})[a-z]*(?=$|[A-Z])`, "g");
477
+ return source.replace(pattern, "");
478
+ };
479
+ //#endregion
480
+ //#region src/generators/utils/array.utils.ts
481
+ const getUniqueArray = (...arrs) => [...new Set(arrs.flat())];
482
+ //#endregion
483
+ //#region src/generators/utils/namespace.utils.ts
484
+ const getNamespaceName = ({ type, tag, options }) => `${capitalize(tag)}${options.configs[type].namespaceSuffix}`;
485
+ //#endregion
486
+ //#region src/generators/utils/tag.utils.ts
487
+ const formattedTagCache = /* @__PURE__ */ new Map();
488
+ const tagFilterCache = /* @__PURE__ */ new WeakMap();
489
+ function formatTag(tag) {
490
+ let formattedTag = formattedTagCache.get(tag);
491
+ if (formattedTag === void 0) {
492
+ formattedTag = nonWordCharactersToCamel(tag);
493
+ formattedTagCache.set(tag, formattedTag);
494
+ }
495
+ return formattedTag;
496
+ }
497
+ function getOperationTag(operation, options) {
498
+ const tag = operation.tags?.[0];
499
+ return formatTag(tag ?? options.defaultTag);
500
+ }
501
+ function getEndpointTag(endpoint, options) {
502
+ return formatTag((options.splitByTags ? endpoint.tags?.[0] : options.defaultTag) ?? options.defaultTag);
503
+ }
504
+ function isTagIncluded(tag, options) {
505
+ const normalizedTag = formatTag(tag).toLowerCase();
506
+ let filters = tagFilterCache.get(options);
507
+ if (!filters) {
508
+ filters = {
509
+ include: new Set(options.includeTags.map((includeTag) => formatTag(includeTag).toLowerCase())),
510
+ exclude: new Set(options.excludeTags.map((excludeTag) => formatTag(excludeTag).toLowerCase()))
511
+ };
512
+ tagFilterCache.set(options, filters);
513
+ }
514
+ if (filters.include.has(normalizedTag)) return true;
515
+ if (filters.exclude.has(normalizedTag)) return false;
516
+ return options.includeTags.length === 0;
517
+ }
518
+ function shouldInlineEndpointsForTag(tag, options) {
519
+ if (!options.inlineEndpoints) return false;
520
+ return !(options.inlineEndpointsExcludeModules ?? []).some((moduleName) => formatTag(moduleName).toLowerCase() === tag.toLowerCase());
521
+ }
522
+ //#endregion
523
+ //#region src/generators/utils/js.utils.ts
524
+ const isValidPropertyName = (str) => /^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(str);
525
+ const invalidVariableNameCharactersToCamel = (str) => str.replace(/^[^a-zA-Z_$]*/g, "").replace(/[^a-zA-Z0-9_$]+(\w)?/g, (_, char) => char?.toUpperCase() ?? "");
526
+ //#endregion
527
+ //#region src/generators/const/openapi.const.ts
528
+ const ALLOWED_PARAM_MEDIA_TYPES = [
529
+ "application/octet-stream",
530
+ "multipart/form-data",
531
+ "application/x-www-form-urlencoded",
532
+ "*/*"
533
+ ];
534
+ const ALLOWED_PATH_IN = [
535
+ "query",
536
+ "header",
537
+ "path"
538
+ ];
539
+ const ALLOWED_METHODS = [
540
+ openapi_types.OpenAPIV3.HttpMethods.GET,
541
+ openapi_types.OpenAPIV3.HttpMethods.PUT,
542
+ openapi_types.OpenAPIV3.HttpMethods.POST,
543
+ openapi_types.OpenAPIV3.HttpMethods.DELETE,
544
+ openapi_types.OpenAPIV3.HttpMethods.OPTIONS,
545
+ openapi_types.OpenAPIV3.HttpMethods.HEAD,
546
+ openapi_types.OpenAPIV3.HttpMethods.PATCH,
547
+ openapi_types.OpenAPIV3.HttpMethods.TRACE
548
+ ];
549
+ const PRIMITIVE_TYPE_LIST = [
550
+ "string",
551
+ "number",
552
+ "integer",
553
+ "boolean"
554
+ ];
555
+ const COMPOSITE_KEYWORDS = [
556
+ "allOf",
557
+ "anyOf",
558
+ "oneOf"
559
+ ];
560
+ //#endregion
561
+ //#region src/generators/utils/openapi-schema.utils.ts
562
+ function isReferenceObject(obj) {
563
+ return obj != null && Object.prototype.hasOwnProperty.call(obj, "$ref");
564
+ }
565
+ function isSchemaObject(schema) {
566
+ return !isReferenceObject(schema);
567
+ }
568
+ function isArraySchemaObject(schema) {
569
+ return schema.type === "array";
570
+ }
571
+ function inferRequiredSchema(schema) {
572
+ if (!schema.allOf) throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");
573
+ const [standaloneRequisites, noRequiredOnlyAllof] = schema.allOf.reduce((acc, cur) => {
574
+ if (isBrokenAllOfItem(cur)) {
575
+ const required = cur.required;
576
+ acc[0].push(...required ?? []);
577
+ } else acc[1].push(cur);
578
+ return acc;
579
+ }, [[], []]);
580
+ const composedRequiredSchema = {
581
+ properties: standaloneRequisites.reduce((acc, cur) => {
582
+ acc[cur] = {};
583
+ return acc;
584
+ }, {}),
585
+ type: "object",
586
+ required: standaloneRequisites
587
+ };
588
+ return {
589
+ noRequiredOnlyAllof,
590
+ composedRequiredSchema,
591
+ patchRequiredSchemaInLoop: (prop, getSchemaByRef) => {
592
+ if (isReferenceObject(prop)) {
593
+ const refType = getSchemaByRef(prop.$ref);
594
+ if (refType) composedRequiredSchema.required.forEach((required) => {
595
+ composedRequiredSchema.properties[required] = refType?.properties?.[required] ?? {};
596
+ });
597
+ } else {
598
+ const properties = prop["properties"] ?? {};
599
+ composedRequiredSchema.required.forEach((required) => {
600
+ if (properties[required]) composedRequiredSchema.properties[required] = properties[required] ?? {};
601
+ });
602
+ }
603
+ }
604
+ };
605
+ }
606
+ const isBrokenAllOfItem = (item) => {
607
+ return !isReferenceObject(item) && !!item.required && !item.type && !item.properties && !item?.allOf && !item?.anyOf && !item.oneOf;
608
+ };
609
+ //#endregion
610
+ //#region src/generators/core/openapi/iterateSchema.ts
611
+ function iterateSchema(schema, options) {
612
+ if (!schema) return;
613
+ const { data, onSchema } = options;
614
+ if (isReferenceObject(schema) && onSchema({
615
+ type: "reference",
616
+ schema,
617
+ data
618
+ }) === true) return;
619
+ const schemaObj = schema;
620
+ if (COMPOSITE_KEYWORDS.some((prop) => prop in schemaObj && schemaObj[prop])) {
621
+ const schemaObjs = schemaObj.allOf ?? schemaObj.anyOf ?? schemaObj.oneOf ?? [];
622
+ for (const compositeObj of schemaObjs) {
623
+ if (onSchema?.({
624
+ type: "composite",
625
+ parentSchema: schema,
626
+ schema: compositeObj,
627
+ data
628
+ }) === true) continue;
629
+ iterateSchema(compositeObj, {
630
+ data,
631
+ onSchema
632
+ });
633
+ }
634
+ }
635
+ if (schemaObj.properties) for (const [propertyName, propertyObj] of Object.entries(schemaObj.properties)) {
636
+ if (onSchema({
637
+ type: "property",
638
+ parentSchema: schema,
639
+ schema: propertyObj,
640
+ data,
641
+ propertyName
642
+ }) === true) continue;
643
+ iterateSchema(propertyObj, options);
644
+ }
645
+ if (schemaObj.additionalProperties && typeof schemaObj.additionalProperties === "object") {
646
+ if (onSchema({
647
+ type: "additionalProperties",
648
+ parentSchema: schema,
649
+ schema: schemaObj.additionalProperties,
650
+ data
651
+ }) === true) return;
652
+ iterateSchema(schemaObj.additionalProperties, options);
653
+ }
654
+ if (schemaObj.type === "array") {
655
+ const arrayObj = schema.items;
656
+ if (onSchema({
657
+ type: "array",
658
+ parentSchema: schema,
659
+ schema: arrayObj,
660
+ data
661
+ }) === true) return;
662
+ iterateSchema(arrayObj, options);
663
+ }
664
+ }
665
+ //#endregion
666
+ //#region src/generators/utils/openapi.utils.ts
667
+ const getSchemaRef = (schemaName) => `#/components/schemas/${schemaName}`;
668
+ const autocorrectRef = (ref) => ref[1] === "/" ? ref : "#/" + ref.slice(1);
669
+ const getSchemaNameByRef = (ref) => autocorrectRef(ref).split("/").at(-1);
670
+ function normalizeString(text) {
671
+ const formatted = prefixStringStartingWithNumberIfNeeded(text).normalize("NFKD").trim().replace(/\s+/g, "_").replace(/--+/g, "-").replace(/-+/g, "_").replace(/[^\w-]+/g, "_");
672
+ return snakeToCamel(formatted);
673
+ }
674
+ function wrapWithQuotesIfNeeded(str) {
675
+ if (/^[a-zA-Z]\w*$/.test(str)) return str;
676
+ return `"${str}"`;
677
+ }
678
+ function unwrapQuotesIfNeeded(value) {
679
+ if (typeof value === "string" && value.startsWith("\"") && value.endsWith("\"")) return value.slice(1, -1);
680
+ return value;
681
+ }
682
+ function prefixStringStartingWithNumberIfNeeded(str) {
683
+ const firstAsNumber = Number(str[0]);
684
+ if (typeof firstAsNumber === "number" && !Number.isNaN(firstAsNumber)) return "_" + str;
685
+ return str;
686
+ }
687
+ function pathParamToVariableName(name) {
688
+ const preserveUnderscore = name.replaceAll("_", "#");
689
+ return snakeToCamel(preserveUnderscore.replaceAll("-", "_")).replaceAll("#", "_");
690
+ }
691
+ const isPrimitiveType = (type) => PRIMITIVE_TYPE_LIST.includes(type);
692
+ function escapeControlCharacters(str) {
693
+ return str.replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g, (_m, p1) => {
694
+ const dec = p1.codePointAt();
695
+ const hex = dec.toString(16);
696
+ if (dec <= 255) return `\\x${`00${hex}`.slice(-2)}`;
697
+ return `\\u${`0000${hex}`.slice(-4)}`;
698
+ }).replace(/\//g, "\\/");
699
+ }
700
+ function isParamMediaTypeAllowed(mediaType) {
701
+ return mediaType.includes("application/") && mediaType.includes("json") || ALLOWED_PARAM_MEDIA_TYPES.includes(mediaType) || mediaType.includes("text/");
702
+ }
703
+ function isMainResponseStatus(status) {
704
+ return status >= 200 && status < 300;
705
+ }
706
+ function isErrorStatus(status) {
707
+ return !(status >= 200 && status < 300);
708
+ }
709
+ function isMediaTypeAllowed(mediaType) {
710
+ return mediaType.startsWith("application/");
711
+ }
712
+ const PATH_PARAM_WITH_BRACKETS_REGEX = /({\w+})/g;
713
+ const WORD_PRECEDED_BY_NON_WORD_CHARACTER = /[^\w\-]+/g;
714
+ /** @example turns `/media-objects/{id}` into `MediaObjectsById` */
715
+ function pathToVariableName(path) {
716
+ path = capitalize(kebabToCamel(path.replaceAll("/", "-")).replaceAll("-", ""));
717
+ const pathParams = [...path.matchAll(PATH_PARAM_WITH_BRACKETS_REGEX)];
718
+ if (pathParams.length > 0) {
719
+ const lastPathParam = pathParams.toSorted((a, b) => a.index - b.index)[pathParams.length - 1][0];
720
+ path = `${path.replace(PATH_PARAM_WITH_BRACKETS_REGEX, "")}By${capitalize(lastPathParam.slice(1, -1))}`;
721
+ }
722
+ return path.replace(WORD_PRECEDED_BY_NON_WORD_CHARACTER, "_");
723
+ }
724
+ const MATCHER_REGEX = /{(\b\w+(?:-\w+)*\b)}/g;
725
+ function replaceHyphenatedPath(path) {
726
+ const matches = path.match(MATCHER_REGEX);
727
+ if (matches === null) return path.replaceAll(MATCHER_REGEX, ":$1");
728
+ matches.forEach((match) => {
729
+ const replacement = pathParamToVariableName(match.replaceAll(MATCHER_REGEX, ":$1"));
730
+ path = path.replaceAll(match, replacement);
731
+ });
732
+ return path;
733
+ }
734
+ const isSortingParameterObject = (param, schema = param.schema, resolver) => {
735
+ const enumNames = getParameterEnumNames(param, schema);
736
+ return Array.isArray(enumNames) && enumNames.length > 0 && isStringLikeParameterSchema(schema, resolver);
737
+ };
738
+ function getParameterEnumNames(param, schema = param.schema) {
739
+ return param["x-enumNames"] ?? (schema && isSchemaObject(schema) ? schema["x-enumNames"] : void 0);
740
+ }
741
+ function isStringLikeParameterSchema(schema, resolver) {
742
+ if (!schema) return false;
743
+ if (isReferenceObject(schema)) return resolver ? isStringLikeParameterSchema(resolver.resolveObject(schema), resolver) : true;
744
+ if (schema.type === "string" || Array.isArray(schema.type) && schema.type.includes("string")) return true;
745
+ return [
746
+ ...schema.allOf ?? [],
747
+ ...schema.oneOf ?? [],
748
+ ...schema.anyOf ?? []
749
+ ].some((compositeSchema) => isStringLikeParameterSchema(compositeSchema, resolver));
750
+ }
751
+ const isPathExcluded = (path, options) => {
752
+ if (!options.excludePathRegex) return false;
753
+ return new RegExp(options.excludePathRegex).test(path);
754
+ };
755
+ //#endregion
756
+ //#region src/generators/utils/zod-schema.utils.ts
757
+ const getZodSchemaName = (name, schemaSuffix) => suffixIfNeeded(capitalize(normalizeString(name)), schemaSuffix);
758
+ const getEnumZodSchemaName = (name, enumSuffix, schemaSuffix) => suffixIfNeeded(capitalize(normalizeString(name)), `${enumSuffix}${schemaSuffix}`);
759
+ const isNamedZodSchema = (schema) => ["z.", `${ZOD_EXTENDED.namespace}.`].every((searchString) => !schema.startsWith(searchString));
760
+ const isEnumZodSchema = (schema) => schema.startsWith(ENUM_SCHEMA);
761
+ const getZodSchemaOperationName = (operationName, isUniqueOperationName, tag) => isUniqueOperationName ? operationName : `${tag}_${operationName}`;
762
+ const getBodyZodSchemaName = (operationName) => snakeToCamel(`${operationName}_${BODY_SCHEMA_SUFFIX}`);
763
+ const getParamZodSchemaName = (operationName, paramName) => snakeToCamel(`${operationName}_${paramName}${PARAM_SCHEMA_SUFFIX}`);
764
+ const getMainResponseZodSchemaName = (operationName) => snakeToCamel(`${operationName}${RESPONSE_SCHEMA_SUFFIX}`);
765
+ const getErrorResponseZodSchemaName = (operationName, statusCode) => snakeToCamel(`${operationName}_${statusCode}_${ERROR_RESPONSE_SCHEMA_SUFFIX}`);
766
+ function getResponseZodSchemaName({ statusCode, operationName, isUniqueOperationName, tag }) {
767
+ const status = Number(statusCode);
768
+ const zodSchemaOperationName = getZodSchemaOperationName(operationName, isUniqueOperationName, tag);
769
+ if (!isMainResponseStatus(status) && statusCode !== "default" && isErrorStatus(status)) return getErrorResponseZodSchemaName(zodSchemaOperationName, statusCode);
770
+ return getMainResponseZodSchemaName(zodSchemaOperationName);
771
+ }
772
+ //#endregion
773
+ //#region src/generators/utils/generate/generate.openapi.utils.ts
774
+ const schemaDescriptionsCache = /* @__PURE__ */ new WeakMap();
775
+ function getSchemaDescriptions(schemaObj) {
776
+ const cachedSchemaDescriptions = schemaDescriptionsCache.get(schemaObj);
777
+ if (cachedSchemaDescriptions) return cachedSchemaDescriptions;
778
+ const schemaDescriptions = [
779
+ "minimum",
780
+ "exclusiveMinimum",
781
+ "maximum",
782
+ "exclusiveMaximum",
783
+ "minItems",
784
+ "minLength",
785
+ "minProperties",
786
+ "maxItems",
787
+ "maxLength",
788
+ "maxProperties",
789
+ "default",
790
+ "example"
791
+ ].filter((key) => schemaObj[key] !== void 0).reduce((acc, key) => [...acc, `${capitalize(camelToSpaceSeparated(key))}: \`${schemaObj[key]}\``], []);
792
+ schemaDescriptionsCache.set(schemaObj, schemaDescriptions);
793
+ return schemaDescriptions;
794
+ }
795
+ //#endregion
796
+ //#region src/generators/utils/generate/generate.zod.utils.ts
797
+ const getZodSchemaInferedTypeName = (zodSchemaName, options) => removeSuffix(isNamedZodSchema(zodSchemaName) ? zodSchemaName.split(".")[0] : zodSchemaName, options.schemaSuffix);
798
+ const getImportedZodSchemaName = (resolver, zodSchemaName, namespaceTag) => {
799
+ if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName;
800
+ const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName.split(".")[0], namespaceTag);
801
+ return `${resolver.options.tsNamespaces ? `${getNamespaceName({
802
+ type: "models",
803
+ tag,
804
+ options: resolver.options
805
+ })}.` : ""}${zodSchemaName}`;
806
+ };
807
+ function getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag) {
808
+ if (namespaceTag && (resolver.options.modelsInCommon || resolver.options.modelsInModules) && resolver.options.splitByTags) return namespaceTag;
809
+ return resolver.getTagByZodSchemaName(zodSchemaName) ?? namespaceTag;
810
+ }
811
+ const getImportedZodSchemaInferedTypeName = (resolver, zodSchemaName, currentTag, namespaceTag) => {
812
+ if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName === "z.void()" ? "void" : zodSchemaName;
813
+ const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName.split(".")[0], namespaceTag);
814
+ return `${resolver.options.tsNamespaces && (Boolean(namespaceTag) || tag !== currentTag) ? `${getNamespaceName({
815
+ type: "models",
816
+ tag,
817
+ options: resolver.options
818
+ })}.` : ""}${getZodSchemaInferedTypeName(zodSchemaName, resolver.options)}`;
819
+ };
820
+ function getZodSchemaType(data) {
821
+ return data.isEnum ? "enum" : data.schemaObj?.type ?? "object";
822
+ }
823
+ function getZodSchemaDescription(data) {
824
+ if (!data.schemaObj) return;
825
+ return [data.schemaObj.description, ...getSchemaDescriptions(data.schemaObj)].filter(Boolean).join(". ");
826
+ }
827
+ function getType(resolver, schemaObj, tag) {
828
+ if (isReferenceObject(schemaObj)) {
829
+ const zodSchemaName = resolver.getZodSchemaNameByRef(schemaObj.$ref);
830
+ return zodSchemaName ? getImportedZodSchemaInferedTypeName(resolver, zodSchemaName, tag) : void 0;
831
+ }
832
+ if (isArraySchemaObject(schemaObj)) {
833
+ if (!isReferenceObject(schemaObj.items)) return `${schemaObj.items?.type ?? "unknown"}[]`;
834
+ const zodSchemaName = resolver.getZodSchemaNameByRef(schemaObj.items.$ref);
835
+ return zodSchemaName ? `${getImportedZodSchemaInferedTypeName(resolver, zodSchemaName, tag)}[]` : void 0;
836
+ }
837
+ if (COMPOSITE_KEYWORDS.some((prop) => prop in schemaObj && schemaObj[prop])) {
838
+ const schemaObjs = schemaObj.allOf ?? schemaObj.anyOf ?? schemaObj.oneOf ?? [];
839
+ if (schemaObjs.length > 0) return getType(resolver, schemaObjs[0], tag);
840
+ }
841
+ return schemaObj.type;
842
+ }
843
+ function getZodSchemaPropertyDescriptions(resolver, data, tag) {
844
+ if (!data.schemaObj) return [];
845
+ const ARRAY_INDEX = "[0]";
846
+ const ADDITIONAL_PROPERTIES_KEY = "[key]";
847
+ const properties = {};
848
+ const onSchema = (schemaData) => {
849
+ if (schemaData.type === "reference") return true;
850
+ if (schemaData.type === "composite") return;
851
+ const segments = [...schemaData.data?.pathSegments ?? []];
852
+ if (schemaData.type === "array") segments.push(ARRAY_INDEX);
853
+ else if (schemaData.type === "property") segments.push(schemaData.propertyName);
854
+ else if (schemaData.type === "additionalProperties") segments.push(ADDITIONAL_PROPERTIES_KEY);
855
+ if (schemaData.schema && segments[segments.length - 1] !== ARRAY_INDEX) {
856
+ const resolvedSchema = resolver.resolveObject(schemaData.schema);
857
+ const schemaDescriptions = [resolvedSchema?.description, ...getSchemaDescriptions(resolvedSchema)].filter(Boolean);
858
+ const propertyKey = segments.join(".");
859
+ if (!(properties[propertyKey] && "type" in schemaData.schema && schemaData.schema.type === "object")) {
860
+ delete properties[propertyKey];
861
+ properties[propertyKey] = {
862
+ type: getType(resolver, schemaData.schema, tag) ?? "unknown",
863
+ description: schemaDescriptions.join(". ")
864
+ };
865
+ }
866
+ }
867
+ iterateSchema(schemaData.schema, {
868
+ data: { pathSegments: [...segments] },
869
+ onSchema
870
+ });
871
+ return true;
872
+ };
873
+ if ("allOf" in data.schemaObj && data.schemaObj.allOf) data.schemaObj.allOf.forEach((schemaObj) => {
874
+ if (isReferenceObject(schemaObj)) iterateSchema(resolver.resolveObject(schemaObj), {
875
+ data: { pathSegments: [] },
876
+ onSchema
877
+ });
878
+ });
879
+ iterateSchema(data.schemaObj, {
880
+ data: { pathSegments: [] },
881
+ onSchema
882
+ });
883
+ return properties;
884
+ }
885
+ //#endregion
886
+ //#region src/generators/utils/generate/generate.acl.utils.ts
887
+ const getAbilityFunctionName = (endpoint) => `canUse${capitalize(snakeToCamel(endpoint.operationName))}`;
888
+ const getImportedAbilityFunctionName = (endpoint, options) => {
889
+ return `${options.tsNamespaces ? `${getNamespaceName({
890
+ type: "acl",
891
+ tag: getEndpointTag(endpoint, options),
892
+ options
893
+ })}.` : ""}${getAbilityFunctionName(endpoint)}`;
894
+ };
895
+ const getAbilityAction = (endpoint) => endpoint.acl?.[0].action;
896
+ const getAbilitySubject = (endpoint) => endpoint.acl?.[0].subject;
897
+ const hasAbilityConditions = (endpoint) => !!getAbilityConditionsTypes(endpoint)?.length;
898
+ const getAbilityConditionsTypes = (endpoint) => endpoint.acl?.[0].conditionsTypes?.sort((a, b) => a.name.localeCompare(b.name));
899
+ const getAbilityDescription = (endpoint) => endpoint.acl?.[0]?.description;
900
+ const getAbilitySubjectTypes = (endpoint, resolver, tag) => {
901
+ const abilitySubject = getAbilitySubject(endpoint);
902
+ const types = [`"${abilitySubject ?? ""}"`];
903
+ if (hasAbilityConditions(endpoint)) types.push(`ForcedSubject<"${abilitySubject}"> & { ${getAbilityConditionsTypes(endpoint)?.map((conditionType) => `${conditionType.name}${conditionType.required ? "" : "?"}: ${getAbilityConditionType(conditionType, resolver, tag)},`).join(" ")} }`);
904
+ return types;
905
+ };
906
+ function getAbilityConditionType(conditionType, resolver, tag) {
907
+ if (!conditionType.zodSchemaName) return conditionType.type ?? "";
908
+ if (!resolver) return `${conditionType.type ?? ""}${conditionType.zodSchemaName}`;
909
+ return getImportedZodSchemaInferedTypeName(resolver, conditionType.zodSchemaName, tag, tag);
910
+ }
911
+ function getAclData({ resolver, data, tag }) {
912
+ const endpoints = data.get(tag)?.endpoints.filter(({ acl }) => acl && acl.length > 0);
913
+ if (!endpoints || endpoints.length === 0) return;
914
+ const hasAdditionalAbilityImports = endpoints.some(({ acl }) => acl?.[0].conditions && Object.keys(acl[0].conditions).length > 0);
915
+ const aclZodSchemas = endpoints.reduce((acc, endpoint) => {
916
+ const zodSchemas = endpoint.acl?.[0].conditionsTypes?.reduce((acc, propertyType) => [...acc, ...propertyType?.zodSchemaName ? [propertyType.zodSchemaName] : []], []);
917
+ return [...acc, ...zodSchemas ?? []];
918
+ }, []);
919
+ return {
920
+ endpoints,
921
+ hasAdditionalAbilityImports,
922
+ modelsImports: getModelsImports({
923
+ resolver,
924
+ tag,
925
+ zodSchemasAsTypes: getUniqueArray(aclZodSchemas)
926
+ })
927
+ };
928
+ }
929
+ const getAppAbilitiesType = ({ resolver, data }) => {
930
+ const appAbilitiesTypeMap = /* @__PURE__ */ new Map();
931
+ const modelsImportsArr = [];
932
+ let hasAdditionalAbilityImports = false;
933
+ data.forEach((_, tag) => {
934
+ const aclData = getAclData({
935
+ resolver,
936
+ data,
937
+ tag
938
+ });
939
+ if (!aclData) return;
940
+ const { modelsImports: tagModelsImports, hasAdditionalAbilityImports: tagHasAdditionalAbilityImports, endpoints } = aclData;
941
+ modelsImportsArr.push(tagModelsImports);
942
+ hasAdditionalAbilityImports = hasAdditionalAbilityImports || tagHasAdditionalAbilityImports;
943
+ endpoints.forEach((endpoint) => {
944
+ const abilityAction = getAbilityAction(endpoint);
945
+ if (abilityAction) appAbilitiesTypeMap.set(abilityAction, /* @__PURE__ */ new Set([...appAbilitiesTypeMap.get(abilityAction) ?? [], ...getAbilitySubjectTypes(endpoint, resolver, tag)]));
946
+ });
947
+ });
948
+ const modelsImports = mergeImports(resolver.options, ...modelsImportsArr);
949
+ return {
950
+ appAbilitiesType: appAbilitiesTypeMap.size > 0 ? Object.fromEntries(Array.from(appAbilitiesTypeMap.entries()).map(([key, valueSet]) => [key, Array.from(valueSet)])) : void 0,
951
+ modelsImports,
952
+ hasAdditionalAbilityImports
953
+ };
954
+ };
955
+ /** Renders a `checkAcl(...)` call, passing the ability's conditions object only when the
956
+ * ability function actually expects one (i.e. the endpoint declares matching conditions). */
957
+ function renderAclCheckCall(resolver, endpoint, replacements, indent = "") {
958
+ const checkParams = getAbilityConditionsTypes(endpoint)?.map((condition) => invalidVariableNameCharactersToCamel(condition.name));
959
+ const paramNames = new Set(endpoint.parameters.map((param) => invalidVariableNameCharactersToCamel(param.name)));
960
+ const hasAllCheckParams = checkParams?.every((param) => paramNames.has(param));
961
+ const args = hasAbilityConditions(endpoint) && hasAllCheckParams ? `{ ${(checkParams ?? []).map((param) => {
962
+ const resolvedParam = replacements?.[param] ?? param;
963
+ return resolvedParam === param ? param : `${param}: ${resolvedParam}`;
964
+ }).join(", ")} } ` : "";
965
+ return `${indent}checkAcl(${getImportedAbilityFunctionName(endpoint, resolver.options)}(${args}));`;
966
+ }
967
+ //#endregion
968
+ //#region src/generators/const/endpoints.const.ts
969
+ const JSON_APPLICATION_FORMAT = "application/json";
970
+ const DEFAULT_HEADERS = {
971
+ "Content-Type": JSON_APPLICATION_FORMAT,
972
+ Accept: JSON_APPLICATION_FORMAT
973
+ };
974
+ const BODY_PARAMETER_NAME = "data";
975
+ const AXIOS_DEFAULT_IMPORT_NAME = "axios";
976
+ const AXIOS_REQUEST_CONFIG_NAME = "config";
977
+ const AXIOS_REQUEST_CONFIG_TYPE = "AxiosRequestConfig";
978
+ const NATIVE_REQUEST_CONFIG_TYPE = "TransportRequestConfig";
979
+ const NATIVE_RESPONSE_TYPE = "TransportResponse";
980
+ const AXIOS_IMPORT = {
981
+ defaultImport: AXIOS_DEFAULT_IMPORT_NAME,
982
+ bindings: [],
983
+ typeBindings: [AXIOS_REQUEST_CONFIG_TYPE],
984
+ from: "axios"
985
+ };
986
+ function getRequestConfigTypeName(restClient) {
987
+ return restClient === "native" ? NATIVE_REQUEST_CONFIG_TYPE : AXIOS_REQUEST_CONFIG_TYPE;
988
+ }
989
+ //#endregion
990
+ //#region src/generators/utils/endpoint.utils.ts
991
+ const isGetEndpoint = (endpoint) => endpoint.method === openapi_types.OpenAPIV3.HttpMethods.GET;
992
+ const isPaginatedGetEndpoint = (endpoint, options) => isGetEndpoint(endpoint) && Object.values(options.infiniteQueryParamNames).every((infiniteQueryParam) => endpoint.parameters.some((param) => param.name === infiniteQueryParam && param.type === "Query"));
993
+ const isReadAllEndpoint = (endpoint, options) => endpoint.method === openapi_types.OpenAPIV3.HttpMethods.GET && !isPathSegmentParam(endpoint.pathSegments.at(-1)) && isPaginatedGetEndpoint(endpoint, options);
994
+ const isReadEndpoint = (endpoint, readAllEndpoint) => endpoint.method === openapi_types.OpenAPIV3.HttpMethods.GET && hasMatchingPathWithTrailingParam(endpoint, readAllEndpoint);
995
+ const isCreateEndpoint = (endpoint, readAllEndpoint) => endpoint.method === openapi_types.OpenAPIV3.HttpMethods.POST && hasMatchingPathWithoutTrailingParam(endpoint, readAllEndpoint);
996
+ const isUpdateEndpoint = (endpoint, readAllEndpoint) => [openapi_types.OpenAPIV3.HttpMethods.PUT, openapi_types.OpenAPIV3.HttpMethods.PATCH].includes(endpoint.method) && hasMatchingPathWithTrailingParam(endpoint, readAllEndpoint);
997
+ const isDeleteEndpoint = (endpoint, readAllEndpoint) => endpoint.method === openapi_types.OpenAPIV3.HttpMethods.DELETE && hasMatchingPathWithTrailingParam(endpoint, readAllEndpoint);
998
+ const isBulkDeleteEndpoint = (endpoint, readAllEndpoint) => endpoint.method === openapi_types.OpenAPIV3.HttpMethods.DELETE && hasMatchingPathWithoutTrailingParam(endpoint, readAllEndpoint);
999
+ const getPathSegments = (path) => path.split("/").filter(Boolean);
1000
+ const isPathSegmentParam = (pathSegment) => pathSegment?.startsWith(":");
1001
+ const hasMatchingPath = (endpoint, readAllEndpoint) => readAllEndpoint.pathSegments.every((segment, index) => isPathSegmentParam(segment) && isPathSegmentParam(endpoint.pathSegments[index]) || segment === endpoint.pathSegments[index]);
1002
+ const hasMatchingPathWithoutTrailingParam = (endpoint, readAllEndpoint) => endpoint.pathSegments.length === readAllEndpoint.pathSegments.length && hasMatchingPath(endpoint, readAllEndpoint);
1003
+ const hasMatchingPathWithTrailingParam = (endpoint, readAllEndpoint) => endpoint.pathSegments.length - 1 === readAllEndpoint.pathSegments.length && isPathSegmentParam(endpoint.pathSegments.at(-1)) && hasMatchingPath(endpoint, readAllEndpoint);
1004
+ //#endregion
1005
+ //#region src/generators/utils/query.utils.ts
1006
+ const isQuery = (endpoint) => isGetEndpoint(endpoint);
1007
+ const isMutation = (endpoint) => !isGetEndpoint(endpoint) || !!endpoint.mediaDownload;
1008
+ const isInfiniteQuery = (endpoint, options) => isPaginatedGetEndpoint(endpoint, options);
1009
+ const getDestructuredVariables = (resolver, endpoint, updateQueryEndpoints) => {
1010
+ const requiredUpdateQueryParams = updateQueryEndpoints.reduce((acc, updateEndpoint) => [...acc, ...mapEndpointParamsToFunctionParams(resolver, updateEndpoint, { includeOnlyRequiredParams: true }).map((param) => param.name)], []);
1011
+ return mapEndpointParamsToFunctionParams(resolver, endpoint, {
1012
+ includeOnlyRequiredParams: true,
1013
+ excludeBodyParam: true
1014
+ }).filter((param) => requiredUpdateQueryParams.includes(param.name)).map((param) => param.name);
1015
+ };
1016
+ //#endregion
1017
+ //#region src/generators/utils/ts.utils.ts
1018
+ function primitiveTypeToTsType(type) {
1019
+ switch (type) {
1020
+ case "string": return "string";
1021
+ case "number":
1022
+ case "integer": return "number";
1023
+ case "boolean": return "boolean";
1024
+ }
1025
+ }
1026
+ //#endregion
1027
+ //#region src/generators/utils/generate/generate.endpoints.utils.ts
1028
+ const endpointNameCache = /* @__PURE__ */ new WeakMap();
1029
+ const endpointPathCache = /* @__PURE__ */ new WeakMap();
1030
+ const endpointBodyCache = /* @__PURE__ */ new WeakMap();
1031
+ const endpointConfigCache = /* @__PURE__ */ new WeakMap();
1032
+ const getEndpointName = (endpoint) => {
1033
+ let name = endpointNameCache.get(endpoint);
1034
+ if (name === void 0) {
1035
+ name = decapitalize(snakeToCamel(endpoint.operationName));
1036
+ endpointNameCache.set(endpoint, name);
1037
+ }
1038
+ return name;
1039
+ };
1040
+ function getImportedEndpointName(endpoint, options) {
1041
+ return `${options.tsNamespaces ? `${getNamespaceName({
1042
+ type: "endpoints",
1043
+ tag: getEndpointTag(endpoint, options),
1044
+ options
1045
+ })}.` : ""}${getEndpointName(endpoint)}`;
1046
+ }
1047
+ const requiresBody = (endpoint) => endpoint.method !== openapi_types.OpenAPIV3.HttpMethods.GET;
1048
+ const findEndpointBody = (endpoint) => endpoint.parameters.find((param) => param.type === "Body");
1049
+ const getEndpointBody = (endpoint) => {
1050
+ if (!endpointBodyCache.has(endpoint)) endpointBodyCache.set(endpoint, findEndpointBody(endpoint));
1051
+ return endpointBodyCache.get(endpoint);
1052
+ };
1053
+ const hasEndpointConfig = (endpoint, resolver) => {
1054
+ const endpointConfig = getEndpointConfig(endpoint);
1055
+ const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
1056
+ const needsBlobConfig = endpoint.mediaDownload || endpoint.response === "z.instanceof(Blob)";
1057
+ return Object.keys(endpointConfig).length > 0 || hasAxiosRequestConfig || needsBlobConfig;
1058
+ };
1059
+ const getEndpointPath = (endpoint) => {
1060
+ let endpointPath = endpointPathCache.get(endpoint);
1061
+ if (endpointPath === void 0) {
1062
+ endpointPath = endpoint.path.replace(/:([a-zA-Z0-9_]+)/g, "${$1}");
1063
+ endpointPathCache.set(endpoint, endpointPath);
1064
+ }
1065
+ return endpointPath;
1066
+ };
1067
+ function mapEndpointParamsToFunctionParams(resolver, endpoint, options) {
1068
+ const optionalPathParams = options?.optionalPathParams ? new Set(options.optionalPathParams) : void 0;
1069
+ const params = endpoint.parameters.map((param) => {
1070
+ let type = "string";
1071
+ if (isNamedZodSchema(param.zodSchema)) type = getImportedZodSchemaInferedTypeName(resolver, param.zodSchema, void 0, options?.modelNamespaceTag);
1072
+ else if (param.parameterObject?.schema && isSchemaObject(param.parameterObject.schema)) {
1073
+ const openApiSchemaType = (param.parameterObject?.schema)?.type;
1074
+ if (openApiSchemaType && isPrimitiveType(openApiSchemaType)) type = primitiveTypeToTsType(openApiSchemaType);
1075
+ }
1076
+ return {
1077
+ name: invalidVariableNameCharactersToCamel(param.name),
1078
+ type,
1079
+ paramType: param.type,
1080
+ required: param.parameterObject?.required ?? true,
1081
+ parameterObject: param.parameterObject,
1082
+ bodyObject: param.bodyObject
1083
+ };
1084
+ });
1085
+ if (options?.includeFileParam && endpoint.mediaUpload) params.push({
1086
+ name: "file",
1087
+ type: "File",
1088
+ paramType: "Body",
1089
+ required: false,
1090
+ parameterObject: void 0,
1091
+ bodyObject: void 0
1092
+ });
1093
+ return params.toSorted((a, b) => {
1094
+ if (a.required === b.required) {
1095
+ const sortedParamTypes = [
1096
+ "Path",
1097
+ "Body",
1098
+ "Query",
1099
+ "Header"
1100
+ ];
1101
+ return sortedParamTypes.indexOf(a.paramType) - sortedParamTypes.indexOf(b.paramType);
1102
+ }
1103
+ return a.required ? -1 : 1;
1104
+ }).filter((param) => (!options?.excludeBodyParam || param.name !== "data") && (!options?.excludePageParam || param.name !== resolver.options.infiniteQueryParamNames.page) && (!options?.includeOnlyRequiredParams || param.required) && (!options?.excludePathParams || param.paramType !== "Path")).map((param) => ({
1105
+ ...param,
1106
+ name: options?.replacePageParam && param.name === resolver.options.infiniteQueryParamNames.page ? "pageParam" : param.name,
1107
+ required: param.paramType === "Path" && optionalPathParams?.has(param.name) ? false : param.required && (param.paramType === "Path" || !options?.pathParamsRequiredOnly)
1108
+ }));
1109
+ }
1110
+ function getEndpointConfig(endpoint) {
1111
+ let config = endpointConfigCache.get(endpoint);
1112
+ if (!config) {
1113
+ config = createEndpointConfig(endpoint);
1114
+ endpointConfigCache.set(endpoint, config);
1115
+ }
1116
+ return config;
1117
+ }
1118
+ function createEndpointConfig(endpoint) {
1119
+ const params = endpoint.parameters.filter((param) => param.type === "Query").map((param) => {
1120
+ const paramPropertyName = isValidPropertyName(param.name) ? param.name : `"${param.name}"`;
1121
+ const paramVariableName = invalidVariableNameCharactersToCamel(param.name);
1122
+ return {
1123
+ ...param,
1124
+ name: paramPropertyName,
1125
+ value: paramVariableName
1126
+ };
1127
+ });
1128
+ const headers = {};
1129
+ if (endpoint.requestFormat !== DEFAULT_HEADERS["Content-Type"]) headers["Content-Type"] = `'${endpoint.requestFormat}'`;
1130
+ if (endpoint.responseFormat && endpoint.responseFormat !== DEFAULT_HEADERS.Accept) headers.Accept = `'${endpoint.responseFormat}'`;
1131
+ endpoint.parameters.filter((param) => param.type === "Header").forEach((param) => {
1132
+ headers[param.name] = invalidVariableNameCharactersToCamel(param.name);
1133
+ });
1134
+ return {
1135
+ ...params.length > 0 ? { params } : {},
1136
+ ...Object.keys(headers).length ? { headers } : {}
1137
+ };
1138
+ }
1139
+ /** Renders the body of a media-upload mutationFn: call the endpoint (without the file arg) to
1140
+ * get upload instructions, then upload the file itself to the returned URL. Shared between
1141
+ * renderMutation (*.queries.ts) and renderMutationContent (*.configs.ts / builderConfigs) so
1142
+ * both mutation paths stay in sync. Lines are relative to the caller's own indent. */
1143
+ function renderMediaUploadMutationBody({ resolver, endpointFunction, resolvedEndpointArgs }) {
1144
+ return [
1145
+ `const uploadInstructions = await ${endpointFunction}(${resolvedEndpointArgs}${resolver.options.axiosRequestConfig ? `${resolvedEndpointArgs ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""});`,
1146
+ "",
1147
+ "if (file && uploadInstructions.url) {",
1148
+ ` const method = (uploadInstructions.method?.toLowerCase() ?? "put") as "put" | "post";`,
1149
+ " let dataToSend: File | FormData = file;",
1150
+ " if (method === \"post\") {",
1151
+ " dataToSend = new FormData();",
1152
+ " if (\"fields\" in uploadInstructions && uploadInstructions.fields) {",
1153
+ " for (const [key, value] of Object.entries(uploadInstructions.fields)) {",
1154
+ " dataToSend.append(key, String(value));",
1155
+ " }",
1156
+ " }",
1157
+ " dataToSend.append(\"file\", file);",
1158
+ " }",
1159
+ resolver.options.restClient === "native" ? " await AppRestClient.upload(uploadInstructions.url, dataToSend, {" : " await axios[method](uploadInstructions.url, dataToSend, {",
1160
+ resolver.options.restClient === "native" ? " headers: method === \"put\" ? { \"Content-Type\": file.type } : undefined," : " headers: {",
1161
+ ...resolver.options.restClient === "native" ? [] : [" \"Content-Type\": file.type,", " },"],
1162
+ " signal: abortController?.signal,",
1163
+ " onUploadProgress: onUploadProgress",
1164
+ " ? (progressEvent) => onUploadProgress({ loaded: progressEvent.loaded, total: progressEvent.total ?? 0 })",
1165
+ " : undefined,",
1166
+ resolver.options.restClient === "native" ? " }, method);" : " });",
1167
+ "}",
1168
+ "",
1169
+ "return uploadInstructions;"
1170
+ ];
1171
+ }
1172
+ //#endregion
1173
+ //#region src/generators/utils/generate/generate.query.utils.ts
1174
+ const operationNameByEndpoint = /* @__PURE__ */ new WeakMap();
1175
+ const capitalizedOperationNameByEndpoint = /* @__PURE__ */ new WeakMap();
1176
+ function getOperationName(endpoint) {
1177
+ let name = operationNameByEndpoint.get(endpoint);
1178
+ if (name === void 0) {
1179
+ name = snakeToCamel(endpoint.operationName);
1180
+ operationNameByEndpoint.set(endpoint, name);
1181
+ }
1182
+ return name;
1183
+ }
1184
+ function getCapitalizedOperationName(endpoint) {
1185
+ let name = capitalizedOperationNameByEndpoint.get(endpoint);
1186
+ if (name === void 0) {
1187
+ name = capitalize(getOperationName(endpoint));
1188
+ capitalizedOperationNameByEndpoint.set(endpoint, name);
1189
+ }
1190
+ return name;
1191
+ }
1192
+ const getQueryName = (endpoint, mutation) => {
1193
+ const addMutationSuffix = isQuery(endpoint) && isMutation(endpoint) && mutation;
1194
+ return `use${getCapitalizedOperationName(endpoint)}${addMutationSuffix ? "Mutation" : ""}`;
1195
+ };
1196
+ const getInfiniteQueryName = (endpoint) => `use${getCapitalizedOperationName(endpoint)}Infinite`;
1197
+ const getQueryOptionsName = (endpoint) => `${getOperationName(endpoint)}QueryOptions`;
1198
+ const getInfiniteQueryOptionsName = (endpoint) => `${getOperationName(endpoint)}InfiniteQueryOptions`;
1199
+ const getPrefetchQueryName = (endpoint) => `prefetch${getCapitalizedOperationName(endpoint)}`;
1200
+ const getPrefetchInfiniteQueryName = (endpoint) => `prefetch${getCapitalizedOperationName(endpoint)}Infinite`;
1201
+ const getImportedQueryName = (endpoint, options) => {
1202
+ return `${options.tsNamespaces ? `${getNamespaceName({
1203
+ type: "queries",
1204
+ tag: getEndpointTag(endpoint, options),
1205
+ options
1206
+ })}.` : ""}${getQueryName(endpoint)}`;
1207
+ };
1208
+ const getImportedInfiniteQueryName = (endpoint, options) => {
1209
+ return `${options.tsNamespaces ? `${getNamespaceName({
1210
+ type: "queries",
1211
+ tag: getEndpointTag(endpoint, options),
1212
+ options
1213
+ })}.` : ""}${getInfiniteQueryName(endpoint)}`;
1214
+ };
1215
+ //#endregion
1216
+ //#region src/generators/utils/generate/generate.imports.utils.ts
1217
+ function getModelsImports({ resolver, tag, zodSchemas = [], zodSchemasAsTypes = [] }) {
1218
+ const type = "models";
1219
+ const getTag = (zodSchemaName) => resolver.getTagByZodSchemaName(zodSchemaName.split(".")[0]);
1220
+ const zodSchemaImports = getImports({
1221
+ type,
1222
+ tag,
1223
+ entities: zodSchemas,
1224
+ getTag,
1225
+ getEntityName: (zodSchema) => zodSchema.split(".")[0],
1226
+ options: resolver.options
1227
+ });
1228
+ const zodSchemaTypeImports = getImports({
1229
+ type,
1230
+ tag,
1231
+ entities: zodSchemasAsTypes,
1232
+ getTag,
1233
+ getEntityName: (zodSchema) => getZodSchemaInferedTypeName(zodSchema, resolver.options),
1234
+ options: resolver.options
1235
+ }).map((importData) => ({
1236
+ ...importData,
1237
+ ...resolver.options.tsNamespaces ? {} : { typeOnly: true }
1238
+ }));
1239
+ return mergeImports(resolver.options, zodSchemaImports, zodSchemaTypeImports);
1240
+ }
1241
+ function getEndpointsImports({ tag, endpoints, options }) {
1242
+ return getImports({
1243
+ type: "endpoints",
1244
+ tag,
1245
+ entities: endpoints,
1246
+ getTag: (endpoint) => getEndpointTag(endpoint, options),
1247
+ getEntityName: getEndpointName,
1248
+ options
1249
+ });
1250
+ }
1251
+ function getQueriesImports({ tag, endpoints, options }) {
1252
+ return getImports({
1253
+ type: "queries",
1254
+ tag,
1255
+ entities: endpoints,
1256
+ getTag: (endpoint) => getEndpointTag(endpoint, options),
1257
+ getEntityName: getQueryName,
1258
+ options
1259
+ });
1260
+ }
1261
+ function getInfiniteQueriesImports({ tag, endpoints, options }) {
1262
+ return getImports({
1263
+ type: "queries",
1264
+ tag,
1265
+ entities: endpoints,
1266
+ getTag: (endpoint) => getEndpointTag(endpoint, options),
1267
+ getEntityName: getInfiniteQueryName,
1268
+ options
1269
+ });
1270
+ }
1271
+ function getAclImports({ tag, endpoints, options }) {
1272
+ return getImports({
1273
+ type: "acl",
1274
+ tag,
1275
+ entities: endpoints,
1276
+ getTag: (endpoint) => getEndpointTag(endpoint, options),
1277
+ getEntityName: getAbilityFunctionName,
1278
+ options
1279
+ });
1280
+ }
1281
+ function getImportPath(options, fromRoot = false) {
1282
+ let importPath = options.tsPath;
1283
+ if (options.importPath === "relative") importPath = fromRoot ? "./" : "../";
1284
+ else if (options.importPath === "absolute") importPath = options.output;
1285
+ else if (new RegExp(`src/data`, "g").test(options.output)) importPath = options.output.replace(new RegExp(`.*${TEMPLATE_DATA_FILE_PATH}`, "g"), options.tsPath);
1286
+ return `${importPath}/`.replace(/\/\//g, "/");
1287
+ }
1288
+ function getImports({ type = "models", tag: currentTag, entities, getTag, getEntityName, options }) {
1289
+ const imports = /* @__PURE__ */ new Map();
1290
+ entities.forEach((entity) => {
1291
+ const tag = type === "models" && (options.modelsInCommon || options.modelsInModules) && options.splitByTags ? currentTag : getTag(entity);
1292
+ if (!imports.has(tag)) {
1293
+ const sameTagDir = currentTag === tag;
1294
+ imports.set(tag, {
1295
+ bindings: [options.tsNamespaces ? getNamespaceName({
1296
+ type,
1297
+ tag,
1298
+ options
1299
+ }) : getEntityName(entity)],
1300
+ from: `${sameTagDir ? "./" : getImportPath(options)}${getTagImportPath({
1301
+ type,
1302
+ tag,
1303
+ includeTagDir: !sameTagDir,
1304
+ options
1305
+ })}`
1306
+ });
1307
+ } else if (!options.tsNamespaces) imports.get(tag).bindings.push(getEntityName(entity));
1308
+ });
1309
+ return Array.from(imports.values());
1310
+ }
1311
+ function mergeImports(options, ...importArrs) {
1312
+ const merged = /* @__PURE__ */ new Map();
1313
+ importArrs.forEach((imports) => {
1314
+ imports.forEach((importItem) => {
1315
+ if (!merged.has(importItem.from)) merged.set(importItem.from, {
1316
+ ...importItem,
1317
+ bindings: importItem.typeOnly ? [] : [...importItem.bindings],
1318
+ typeBindings: [...importItem.typeBindings ?? [], ...importItem.typeOnly ? importItem.bindings : []]
1319
+ });
1320
+ else {
1321
+ const existing = merged.get(importItem.from);
1322
+ if (!options.tsNamespaces && !importItem.typeOnly) existing.bindings.push(...importItem.bindings);
1323
+ existing.typeBindings = [
1324
+ ...existing.typeBindings ?? [],
1325
+ ...importItem.typeBindings ?? [],
1326
+ ...importItem.typeOnly ? importItem.bindings : []
1327
+ ];
1328
+ existing.typeOnly = false;
1329
+ }
1330
+ });
1331
+ });
1332
+ return Array.from(merged.values()).map((importItem) => ({
1333
+ ...importItem,
1334
+ bindings: getUniqueArray(importItem.bindings),
1335
+ typeBindings: getUniqueArray(importItem.typeBindings ?? []).filter((binding) => !importItem.bindings.includes(binding)),
1336
+ typeOnly: Boolean(importItem.typeOnly && importItem.bindings.length === 0 && (importItem.typeBindings?.length ?? 0) > 0)
1337
+ }));
1338
+ }
1339
+ //#endregion
1340
+ //#region src/generators/utils/generate/generate.utils.ts
1341
+ function getFileNameWithExtension({ fileName, extension }) {
1342
+ return `${fileName}.${extension}`;
1343
+ }
1344
+ function getTagFileNameWithoutExtension({ type, tag, options, includeTagDir = true }) {
1345
+ const outputFileNameSuffix = options.configs[type].outputFileNameSuffix;
1346
+ if (!tag) return outputFileNameSuffix;
1347
+ return `${includeTagDir ? `${decapitalize(tag)}/` : ""}${decapitalize(tag)}.${outputFileNameSuffix}`;
1348
+ }
1349
+ function getTagImportPath(...args) {
1350
+ return getTagFileNameWithoutExtension(...args);
1351
+ }
1352
+ function getTagFileName(...args) {
1353
+ return `${getTagFileNameWithoutExtension(...args)}.ts`;
1354
+ }
1355
+ function getAppRestClientImportPath(options) {
1356
+ if (options.restClientImportPath === DEFAULT_GENERATE_OPTIONS.restClientImportPath) return `${getImportPath(options)}${APP_REST_CLIENT_FILE.fileName}`;
1357
+ return options.restClientImportPath;
1358
+ }
1359
+ function getQueryModulesImportPath(options) {
1360
+ return `${getImportPath(options)}${QUERY_MODULES_FILE.fileName}`;
1361
+ }
1362
+ function getQueryTypesImportPath(options) {
1363
+ return options.queryTypesImportPath === "@povio/openapi-codegen-cli" ? QUERY_PACKAGE_IMPORT_PATH : options.queryTypesImportPath;
1364
+ }
1365
+ //#endregion
1366
+ Object.defineProperty(exports, "ALLOWED_METHODS", {
1367
+ enumerable: true,
1368
+ get: function() {
1369
+ return ALLOWED_METHODS;
1370
+ }
1371
+ });
1372
+ Object.defineProperty(exports, "ALLOWED_PATH_IN", {
1373
+ enumerable: true,
1374
+ get: function() {
1375
+ return ALLOWED_PATH_IN;
1376
+ }
1377
+ });
1378
+ Object.defineProperty(exports, "ANY_SCHEMA", {
1379
+ enumerable: true,
1380
+ get: function() {
1381
+ return ANY_SCHEMA;
1382
+ }
1383
+ });
1384
+ Object.defineProperty(exports, "APP_REST_CLIENT_FILE", {
1385
+ enumerable: true,
1386
+ get: function() {
1387
+ return APP_REST_CLIENT_FILE;
1388
+ }
1389
+ });
1390
+ Object.defineProperty(exports, "APP_REST_CLIENT_NAME", {
1391
+ enumerable: true,
1392
+ get: function() {
1393
+ return APP_REST_CLIENT_NAME;
1394
+ }
1395
+ });
1396
+ Object.defineProperty(exports, "AXIOS_DEFAULT_IMPORT_NAME", {
1397
+ enumerable: true,
1398
+ get: function() {
1399
+ return AXIOS_DEFAULT_IMPORT_NAME;
1400
+ }
1401
+ });
1402
+ Object.defineProperty(exports, "AXIOS_IMPORT", {
1403
+ enumerable: true,
1404
+ get: function() {
1405
+ return AXIOS_IMPORT;
1406
+ }
1407
+ });
1408
+ Object.defineProperty(exports, "AXIOS_PACKAGE_IMPORT_PATH", {
1409
+ enumerable: true,
1410
+ get: function() {
1411
+ return AXIOS_PACKAGE_IMPORT_PATH;
1412
+ }
1413
+ });
1414
+ Object.defineProperty(exports, "AXIOS_REQUEST_CONFIG_NAME", {
1415
+ enumerable: true,
1416
+ get: function() {
1417
+ return AXIOS_REQUEST_CONFIG_NAME;
1418
+ }
1419
+ });
1420
+ Object.defineProperty(exports, "AXIOS_REQUEST_CONFIG_TYPE", {
1421
+ enumerable: true,
1422
+ get: function() {
1423
+ return AXIOS_REQUEST_CONFIG_TYPE;
1424
+ }
1425
+ });
1426
+ Object.defineProperty(exports, "BLOB_SCHEMA", {
1427
+ enumerable: true,
1428
+ get: function() {
1429
+ return BLOB_SCHEMA;
1430
+ }
1431
+ });
1432
+ Object.defineProperty(exports, "BODY_PARAMETER_NAME", {
1433
+ enumerable: true,
1434
+ get: function() {
1435
+ return BODY_PARAMETER_NAME;
1436
+ }
1437
+ });
1438
+ Object.defineProperty(exports, "BUILDERS_UTILS", {
1439
+ enumerable: true,
1440
+ get: function() {
1441
+ return BUILDERS_UTILS;
1442
+ }
1443
+ });
1444
+ Object.defineProperty(exports, "CONFIG_PACKAGE_IMPORT_PATH", {
1445
+ enumerable: true,
1446
+ get: function() {
1447
+ return CONFIG_PACKAGE_IMPORT_PATH;
1448
+ }
1449
+ });
1450
+ Object.defineProperty(exports, "DATETIME_SCHEMA", {
1451
+ enumerable: true,
1452
+ get: function() {
1453
+ return DATETIME_SCHEMA;
1454
+ }
1455
+ });
1456
+ Object.defineProperty(exports, "DEFAULT_GENERATE_OPTIONS", {
1457
+ enumerable: true,
1458
+ get: function() {
1459
+ return DEFAULT_GENERATE_OPTIONS;
1460
+ }
1461
+ });
1462
+ Object.defineProperty(exports, "DOMAIN_ERRORS_FILE", {
1463
+ enumerable: true,
1464
+ get: function() {
1465
+ return DOMAIN_ERRORS_FILE;
1466
+ }
1467
+ });
1468
+ Object.defineProperty(exports, "EMAIL_SCHEMA", {
1469
+ enumerable: true,
1470
+ get: function() {
1471
+ return EMAIL_SCHEMA;
1472
+ }
1473
+ });
1474
+ Object.defineProperty(exports, "ENUM_SCHEMA", {
1475
+ enumerable: true,
1476
+ get: function() {
1477
+ return ENUM_SCHEMA;
1478
+ }
1479
+ });
1480
+ Object.defineProperty(exports, "INT_SCHEMA", {
1481
+ enumerable: true,
1482
+ get: function() {
1483
+ return INT_SCHEMA;
1484
+ }
1485
+ });
1486
+ Object.defineProperty(exports, "JSON_APPLICATION_FORMAT", {
1487
+ enumerable: true,
1488
+ get: function() {
1489
+ return JSON_APPLICATION_FORMAT;
1490
+ }
1491
+ });
1492
+ Object.defineProperty(exports, "MUTATION_EFFECTS", {
1493
+ enumerable: true,
1494
+ get: function() {
1495
+ return MUTATION_EFFECTS;
1496
+ }
1497
+ });
1498
+ Object.defineProperty(exports, "NATIVE_PACKAGE_IMPORT_PATH", {
1499
+ enumerable: true,
1500
+ get: function() {
1501
+ return NATIVE_PACKAGE_IMPORT_PATH;
1502
+ }
1503
+ });
1504
+ Object.defineProperty(exports, "NATIVE_RESPONSE_TYPE", {
1505
+ enumerable: true,
1506
+ get: function() {
1507
+ return NATIVE_RESPONSE_TYPE;
1508
+ }
1509
+ });
1510
+ Object.defineProperty(exports, "NUMBER_SCHEMA", {
1511
+ enumerable: true,
1512
+ get: function() {
1513
+ return NUMBER_SCHEMA;
1514
+ }
1515
+ });
1516
+ Object.defineProperty(exports, "Profiler", {
1517
+ enumerable: true,
1518
+ get: function() {
1519
+ return Profiler;
1520
+ }
1521
+ });
1522
+ Object.defineProperty(exports, "QUERY_MODULES_FILE", {
1523
+ enumerable: true,
1524
+ get: function() {
1525
+ return QUERY_MODULES_FILE;
1526
+ }
1527
+ });
1528
+ Object.defineProperty(exports, "QUERY_MODULE_ENUM", {
1529
+ enumerable: true,
1530
+ get: function() {
1531
+ return QUERY_MODULE_ENUM;
1532
+ }
1533
+ });
1534
+ Object.defineProperty(exports, "QUERY_OPTIONS_TYPES", {
1535
+ enumerable: true,
1536
+ get: function() {
1537
+ return QUERY_OPTIONS_TYPES;
1538
+ }
1539
+ });
1540
+ Object.defineProperty(exports, "REST_PACKAGE_IMPORT_PATH", {
1541
+ enumerable: true,
1542
+ get: function() {
1543
+ return REST_PACKAGE_IMPORT_PATH;
1544
+ }
1545
+ });
1546
+ Object.defineProperty(exports, "STRING_SCHEMA", {
1547
+ enumerable: true,
1548
+ get: function() {
1549
+ return STRING_SCHEMA;
1550
+ }
1551
+ });
1552
+ Object.defineProperty(exports, "URL_SCHEMA", {
1553
+ enumerable: true,
1554
+ get: function() {
1555
+ return URL_SCHEMA;
1556
+ }
1557
+ });
1558
+ Object.defineProperty(exports, "UUID_SCHEMA", {
1559
+ enumerable: true,
1560
+ get: function() {
1561
+ return UUID_SCHEMA;
1562
+ }
1563
+ });
1564
+ Object.defineProperty(exports, "VOID_SCHEMA", {
1565
+ enumerable: true,
1566
+ get: function() {
1567
+ return VOID_SCHEMA;
1568
+ }
1569
+ });
1570
+ Object.defineProperty(exports, "ZOD_EXTENDED", {
1571
+ enumerable: true,
1572
+ get: function() {
1573
+ return ZOD_EXTENDED;
1574
+ }
1575
+ });
1576
+ Object.defineProperty(exports, "ZOD_IMPORT", {
1577
+ enumerable: true,
1578
+ get: function() {
1579
+ return ZOD_IMPORT;
1580
+ }
1581
+ });
1582
+ Object.defineProperty(exports, "__toESM", {
1583
+ enumerable: true,
1584
+ get: function() {
1585
+ return __toESM;
1586
+ }
1587
+ });
1588
+ Object.defineProperty(exports, "autocorrectRef", {
1589
+ enumerable: true,
1590
+ get: function() {
1591
+ return autocorrectRef;
1592
+ }
1593
+ });
1594
+ Object.defineProperty(exports, "camelToSpaceSeparated", {
1595
+ enumerable: true,
1596
+ get: function() {
1597
+ return camelToSpaceSeparated;
1598
+ }
1599
+ });
1600
+ Object.defineProperty(exports, "capitalize", {
1601
+ enumerable: true,
1602
+ get: function() {
1603
+ return capitalize;
1604
+ }
1605
+ });
1606
+ Object.defineProperty(exports, "compileNativeData", {
1607
+ enumerable: true,
1608
+ get: function() {
1609
+ return compileNativeData;
1610
+ }
1611
+ });
1612
+ Object.defineProperty(exports, "decapitalize", {
1613
+ enumerable: true,
1614
+ get: function() {
1615
+ return decapitalize;
1616
+ }
1617
+ });
1618
+ Object.defineProperty(exports, "deepMerge", {
1619
+ enumerable: true,
1620
+ get: function() {
1621
+ return deepMerge;
1622
+ }
1623
+ });
1624
+ Object.defineProperty(exports, "escapeControlCharacters", {
1625
+ enumerable: true,
1626
+ get: function() {
1627
+ return escapeControlCharacters;
1628
+ }
1629
+ });
1630
+ Object.defineProperty(exports, "formatTag", {
1631
+ enumerable: true,
1632
+ get: function() {
1633
+ return formatTag;
1634
+ }
1635
+ });
1636
+ Object.defineProperty(exports, "getAbilityAction", {
1637
+ enumerable: true,
1638
+ get: function() {
1639
+ return getAbilityAction;
1640
+ }
1641
+ });
1642
+ Object.defineProperty(exports, "getAbilityConditionType", {
1643
+ enumerable: true,
1644
+ get: function() {
1645
+ return getAbilityConditionType;
1646
+ }
1647
+ });
1648
+ Object.defineProperty(exports, "getAbilityConditionsTypes", {
1649
+ enumerable: true,
1650
+ get: function() {
1651
+ return getAbilityConditionsTypes;
1652
+ }
1653
+ });
1654
+ Object.defineProperty(exports, "getAbilityDescription", {
1655
+ enumerable: true,
1656
+ get: function() {
1657
+ return getAbilityDescription;
1658
+ }
1659
+ });
1660
+ Object.defineProperty(exports, "getAbilityFunctionName", {
1661
+ enumerable: true,
1662
+ get: function() {
1663
+ return getAbilityFunctionName;
1664
+ }
1665
+ });
1666
+ Object.defineProperty(exports, "getAbilitySubject", {
1667
+ enumerable: true,
1668
+ get: function() {
1669
+ return getAbilitySubject;
1670
+ }
1671
+ });
1672
+ Object.defineProperty(exports, "getAbilitySubjectTypes", {
1673
+ enumerable: true,
1674
+ get: function() {
1675
+ return getAbilitySubjectTypes;
1676
+ }
1677
+ });
1678
+ Object.defineProperty(exports, "getAclData", {
1679
+ enumerable: true,
1680
+ get: function() {
1681
+ return getAclData;
1682
+ }
1683
+ });
1684
+ Object.defineProperty(exports, "getAclImports", {
1685
+ enumerable: true,
1686
+ get: function() {
1687
+ return getAclImports;
1688
+ }
1689
+ });
1690
+ Object.defineProperty(exports, "getAppAbilitiesType", {
1691
+ enumerable: true,
1692
+ get: function() {
1693
+ return getAppAbilitiesType;
1694
+ }
1695
+ });
1696
+ Object.defineProperty(exports, "getAppRestClientImportPath", {
1697
+ enumerable: true,
1698
+ get: function() {
1699
+ return getAppRestClientImportPath;
1700
+ }
1701
+ });
1702
+ Object.defineProperty(exports, "getBodyZodSchemaName", {
1703
+ enumerable: true,
1704
+ get: function() {
1705
+ return getBodyZodSchemaName;
1706
+ }
1707
+ });
1708
+ Object.defineProperty(exports, "getDestructuredVariables", {
1709
+ enumerable: true,
1710
+ get: function() {
1711
+ return getDestructuredVariables;
1712
+ }
1713
+ });
1714
+ Object.defineProperty(exports, "getEndpointBody", {
1715
+ enumerable: true,
1716
+ get: function() {
1717
+ return getEndpointBody;
1718
+ }
1719
+ });
1720
+ Object.defineProperty(exports, "getEndpointConfig", {
1721
+ enumerable: true,
1722
+ get: function() {
1723
+ return getEndpointConfig;
1724
+ }
1725
+ });
1726
+ Object.defineProperty(exports, "getEndpointName", {
1727
+ enumerable: true,
1728
+ get: function() {
1729
+ return getEndpointName;
1730
+ }
1731
+ });
1732
+ Object.defineProperty(exports, "getEndpointPath", {
1733
+ enumerable: true,
1734
+ get: function() {
1735
+ return getEndpointPath;
1736
+ }
1737
+ });
1738
+ Object.defineProperty(exports, "getEndpointTag", {
1739
+ enumerable: true,
1740
+ get: function() {
1741
+ return getEndpointTag;
1742
+ }
1743
+ });
1744
+ Object.defineProperty(exports, "getEndpointsImports", {
1745
+ enumerable: true,
1746
+ get: function() {
1747
+ return getEndpointsImports;
1748
+ }
1749
+ });
1750
+ Object.defineProperty(exports, "getEnumZodSchemaName", {
1751
+ enumerable: true,
1752
+ get: function() {
1753
+ return getEnumZodSchemaName;
1754
+ }
1755
+ });
1756
+ Object.defineProperty(exports, "getFileNameWithExtension", {
1757
+ enumerable: true,
1758
+ get: function() {
1759
+ return getFileNameWithExtension;
1760
+ }
1761
+ });
1762
+ Object.defineProperty(exports, "getImportPath", {
1763
+ enumerable: true,
1764
+ get: function() {
1765
+ return getImportPath;
1766
+ }
1767
+ });
1768
+ Object.defineProperty(exports, "getImportedAbilityFunctionName", {
1769
+ enumerable: true,
1770
+ get: function() {
1771
+ return getImportedAbilityFunctionName;
1772
+ }
1773
+ });
1774
+ Object.defineProperty(exports, "getImportedEndpointName", {
1775
+ enumerable: true,
1776
+ get: function() {
1777
+ return getImportedEndpointName;
1778
+ }
1779
+ });
1780
+ Object.defineProperty(exports, "getImportedInfiniteQueryName", {
1781
+ enumerable: true,
1782
+ get: function() {
1783
+ return getImportedInfiniteQueryName;
1784
+ }
1785
+ });
1786
+ Object.defineProperty(exports, "getImportedQueryName", {
1787
+ enumerable: true,
1788
+ get: function() {
1789
+ return getImportedQueryName;
1790
+ }
1791
+ });
1792
+ Object.defineProperty(exports, "getImportedZodSchemaInferedTypeName", {
1793
+ enumerable: true,
1794
+ get: function() {
1795
+ return getImportedZodSchemaInferedTypeName;
1796
+ }
1797
+ });
1798
+ Object.defineProperty(exports, "getImportedZodSchemaName", {
1799
+ enumerable: true,
1800
+ get: function() {
1801
+ return getImportedZodSchemaName;
1802
+ }
1803
+ });
1804
+ Object.defineProperty(exports, "getInfiniteQueriesImports", {
1805
+ enumerable: true,
1806
+ get: function() {
1807
+ return getInfiniteQueriesImports;
1808
+ }
1809
+ });
1810
+ Object.defineProperty(exports, "getInfiniteQueryName", {
1811
+ enumerable: true,
1812
+ get: function() {
1813
+ return getInfiniteQueryName;
1814
+ }
1815
+ });
1816
+ Object.defineProperty(exports, "getInfiniteQueryOptionsName", {
1817
+ enumerable: true,
1818
+ get: function() {
1819
+ return getInfiniteQueryOptionsName;
1820
+ }
1821
+ });
1822
+ Object.defineProperty(exports, "getModelsImports", {
1823
+ enumerable: true,
1824
+ get: function() {
1825
+ return getModelsImports;
1826
+ }
1827
+ });
1828
+ Object.defineProperty(exports, "getMostCommonAdjacentCombinationSplit", {
1829
+ enumerable: true,
1830
+ get: function() {
1831
+ return getMostCommonAdjacentCombinationSplit;
1832
+ }
1833
+ });
1834
+ Object.defineProperty(exports, "getNamespaceName", {
1835
+ enumerable: true,
1836
+ get: function() {
1837
+ return getNamespaceName;
1838
+ }
1839
+ });
1840
+ Object.defineProperty(exports, "getOperationTag", {
1841
+ enumerable: true,
1842
+ get: function() {
1843
+ return getOperationTag;
1844
+ }
1845
+ });
1846
+ Object.defineProperty(exports, "getOutputFileName", {
1847
+ enumerable: true,
1848
+ get: function() {
1849
+ return getOutputFileName;
1850
+ }
1851
+ });
1852
+ Object.defineProperty(exports, "getParamZodSchemaName", {
1853
+ enumerable: true,
1854
+ get: function() {
1855
+ return getParamZodSchemaName;
1856
+ }
1857
+ });
1858
+ Object.defineProperty(exports, "getParameterEnumNames", {
1859
+ enumerable: true,
1860
+ get: function() {
1861
+ return getParameterEnumNames;
1862
+ }
1863
+ });
1864
+ Object.defineProperty(exports, "getPathSegments", {
1865
+ enumerable: true,
1866
+ get: function() {
1867
+ return getPathSegments;
1868
+ }
1869
+ });
1870
+ Object.defineProperty(exports, "getPrefetchInfiniteQueryName", {
1871
+ enumerable: true,
1872
+ get: function() {
1873
+ return getPrefetchInfiniteQueryName;
1874
+ }
1875
+ });
1876
+ Object.defineProperty(exports, "getPrefetchQueryName", {
1877
+ enumerable: true,
1878
+ get: function() {
1879
+ return getPrefetchQueryName;
1880
+ }
1881
+ });
1882
+ Object.defineProperty(exports, "getQueriesImports", {
1883
+ enumerable: true,
1884
+ get: function() {
1885
+ return getQueriesImports;
1886
+ }
1887
+ });
1888
+ Object.defineProperty(exports, "getQueryModulesImportPath", {
1889
+ enumerable: true,
1890
+ get: function() {
1891
+ return getQueryModulesImportPath;
1892
+ }
1893
+ });
1894
+ Object.defineProperty(exports, "getQueryName", {
1895
+ enumerable: true,
1896
+ get: function() {
1897
+ return getQueryName;
1898
+ }
1899
+ });
1900
+ Object.defineProperty(exports, "getQueryOptionsName", {
1901
+ enumerable: true,
1902
+ get: function() {
1903
+ return getQueryOptionsName;
1904
+ }
1905
+ });
1906
+ Object.defineProperty(exports, "getQueryTypesImportPath", {
1907
+ enumerable: true,
1908
+ get: function() {
1909
+ return getQueryTypesImportPath;
1910
+ }
1911
+ });
1912
+ Object.defineProperty(exports, "getRequestConfigTypeName", {
1913
+ enumerable: true,
1914
+ get: function() {
1915
+ return getRequestConfigTypeName;
1916
+ }
1917
+ });
1918
+ Object.defineProperty(exports, "getResponseZodSchemaName", {
1919
+ enumerable: true,
1920
+ get: function() {
1921
+ return getResponseZodSchemaName;
1922
+ }
1923
+ });
1924
+ Object.defineProperty(exports, "getSchemaDescriptions", {
1925
+ enumerable: true,
1926
+ get: function() {
1927
+ return getSchemaDescriptions;
1928
+ }
1929
+ });
1930
+ Object.defineProperty(exports, "getSchemaNameByRef", {
1931
+ enumerable: true,
1932
+ get: function() {
1933
+ return getSchemaNameByRef;
1934
+ }
1935
+ });
1936
+ Object.defineProperty(exports, "getSchemaRef", {
1937
+ enumerable: true,
1938
+ get: function() {
1939
+ return getSchemaRef;
1940
+ }
1941
+ });
1942
+ Object.defineProperty(exports, "getTagFileName", {
1943
+ enumerable: true,
1944
+ get: function() {
1945
+ return getTagFileName;
1946
+ }
1947
+ });
1948
+ Object.defineProperty(exports, "getTagImportPath", {
1949
+ enumerable: true,
1950
+ get: function() {
1951
+ return getTagImportPath;
1952
+ }
1953
+ });
1954
+ Object.defineProperty(exports, "getUniqueArray", {
1955
+ enumerable: true,
1956
+ get: function() {
1957
+ return getUniqueArray;
1958
+ }
1959
+ });
1960
+ Object.defineProperty(exports, "getZodSchemaDescription", {
1961
+ enumerable: true,
1962
+ get: function() {
1963
+ return getZodSchemaDescription;
1964
+ }
1965
+ });
1966
+ Object.defineProperty(exports, "getZodSchemaInferedTypeName", {
1967
+ enumerable: true,
1968
+ get: function() {
1969
+ return getZodSchemaInferedTypeName;
1970
+ }
1971
+ });
1972
+ Object.defineProperty(exports, "getZodSchemaName", {
1973
+ enumerable: true,
1974
+ get: function() {
1975
+ return getZodSchemaName;
1976
+ }
1977
+ });
1978
+ Object.defineProperty(exports, "getZodSchemaOperationName", {
1979
+ enumerable: true,
1980
+ get: function() {
1981
+ return getZodSchemaOperationName;
1982
+ }
1983
+ });
1984
+ Object.defineProperty(exports, "getZodSchemaPropertyDescriptions", {
1985
+ enumerable: true,
1986
+ get: function() {
1987
+ return getZodSchemaPropertyDescriptions;
1988
+ }
1989
+ });
1990
+ Object.defineProperty(exports, "getZodSchemaType", {
1991
+ enumerable: true,
1992
+ get: function() {
1993
+ return getZodSchemaType;
1994
+ }
1995
+ });
1996
+ Object.defineProperty(exports, "hasAbilityConditions", {
1997
+ enumerable: true,
1998
+ get: function() {
1999
+ return hasAbilityConditions;
2000
+ }
2001
+ });
2002
+ Object.defineProperty(exports, "hasEndpointConfig", {
2003
+ enumerable: true,
2004
+ get: function() {
2005
+ return hasEndpointConfig;
2006
+ }
2007
+ });
2008
+ Object.defineProperty(exports, "inferRequiredSchema", {
2009
+ enumerable: true,
2010
+ get: function() {
2011
+ return inferRequiredSchema;
2012
+ }
2013
+ });
2014
+ Object.defineProperty(exports, "invalidVariableNameCharactersToCamel", {
2015
+ enumerable: true,
2016
+ get: function() {
2017
+ return invalidVariableNameCharactersToCamel;
2018
+ }
2019
+ });
2020
+ Object.defineProperty(exports, "isArraySchemaObject", {
2021
+ enumerable: true,
2022
+ get: function() {
2023
+ return isArraySchemaObject;
2024
+ }
2025
+ });
2026
+ Object.defineProperty(exports, "isBulkDeleteEndpoint", {
2027
+ enumerable: true,
2028
+ get: function() {
2029
+ return isBulkDeleteEndpoint;
2030
+ }
2031
+ });
2032
+ Object.defineProperty(exports, "isCreateEndpoint", {
2033
+ enumerable: true,
2034
+ get: function() {
2035
+ return isCreateEndpoint;
2036
+ }
2037
+ });
2038
+ Object.defineProperty(exports, "isDeleteEndpoint", {
2039
+ enumerable: true,
2040
+ get: function() {
2041
+ return isDeleteEndpoint;
2042
+ }
2043
+ });
2044
+ Object.defineProperty(exports, "isEnumZodSchema", {
2045
+ enumerable: true,
2046
+ get: function() {
2047
+ return isEnumZodSchema;
2048
+ }
2049
+ });
2050
+ Object.defineProperty(exports, "isErrorStatus", {
2051
+ enumerable: true,
2052
+ get: function() {
2053
+ return isErrorStatus;
2054
+ }
2055
+ });
2056
+ Object.defineProperty(exports, "isInfiniteQuery", {
2057
+ enumerable: true,
2058
+ get: function() {
2059
+ return isInfiniteQuery;
2060
+ }
2061
+ });
2062
+ Object.defineProperty(exports, "isMainResponseStatus", {
2063
+ enumerable: true,
2064
+ get: function() {
2065
+ return isMainResponseStatus;
2066
+ }
2067
+ });
2068
+ Object.defineProperty(exports, "isMediaTypeAllowed", {
2069
+ enumerable: true,
2070
+ get: function() {
2071
+ return isMediaTypeAllowed;
2072
+ }
2073
+ });
2074
+ Object.defineProperty(exports, "isMutation", {
2075
+ enumerable: true,
2076
+ get: function() {
2077
+ return isMutation;
2078
+ }
2079
+ });
2080
+ Object.defineProperty(exports, "isNamedZodSchema", {
2081
+ enumerable: true,
2082
+ get: function() {
2083
+ return isNamedZodSchema;
2084
+ }
2085
+ });
2086
+ Object.defineProperty(exports, "isParamMediaTypeAllowed", {
2087
+ enumerable: true,
2088
+ get: function() {
2089
+ return isParamMediaTypeAllowed;
2090
+ }
2091
+ });
2092
+ Object.defineProperty(exports, "isPathExcluded", {
2093
+ enumerable: true,
2094
+ get: function() {
2095
+ return isPathExcluded;
2096
+ }
2097
+ });
2098
+ Object.defineProperty(exports, "isPathSegmentParam", {
2099
+ enumerable: true,
2100
+ get: function() {
2101
+ return isPathSegmentParam;
2102
+ }
2103
+ });
2104
+ Object.defineProperty(exports, "isPrimitiveType", {
2105
+ enumerable: true,
2106
+ get: function() {
2107
+ return isPrimitiveType;
2108
+ }
2109
+ });
2110
+ Object.defineProperty(exports, "isQuery", {
2111
+ enumerable: true,
2112
+ get: function() {
2113
+ return isQuery;
2114
+ }
2115
+ });
2116
+ Object.defineProperty(exports, "isReadAllEndpoint", {
2117
+ enumerable: true,
2118
+ get: function() {
2119
+ return isReadAllEndpoint;
2120
+ }
2121
+ });
2122
+ Object.defineProperty(exports, "isReadEndpoint", {
2123
+ enumerable: true,
2124
+ get: function() {
2125
+ return isReadEndpoint;
2126
+ }
2127
+ });
2128
+ Object.defineProperty(exports, "isReferenceObject", {
2129
+ enumerable: true,
2130
+ get: function() {
2131
+ return isReferenceObject;
2132
+ }
2133
+ });
2134
+ Object.defineProperty(exports, "isSchemaObject", {
2135
+ enumerable: true,
2136
+ get: function() {
2137
+ return isSchemaObject;
2138
+ }
2139
+ });
2140
+ Object.defineProperty(exports, "isSortingParameterObject", {
2141
+ enumerable: true,
2142
+ get: function() {
2143
+ return isSortingParameterObject;
2144
+ }
2145
+ });
2146
+ Object.defineProperty(exports, "isTagIncluded", {
2147
+ enumerable: true,
2148
+ get: function() {
2149
+ return isTagIncluded;
2150
+ }
2151
+ });
2152
+ Object.defineProperty(exports, "isUpdateEndpoint", {
2153
+ enumerable: true,
2154
+ get: function() {
2155
+ return isUpdateEndpoint;
2156
+ }
2157
+ });
2158
+ Object.defineProperty(exports, "iterateSchema", {
2159
+ enumerable: true,
2160
+ get: function() {
2161
+ return iterateSchema;
2162
+ }
2163
+ });
2164
+ Object.defineProperty(exports, "kebabToCamel", {
2165
+ enumerable: true,
2166
+ get: function() {
2167
+ return kebabToCamel;
2168
+ }
2169
+ });
2170
+ Object.defineProperty(exports, "mapEndpointParamsToFunctionParams", {
2171
+ enumerable: true,
2172
+ get: function() {
2173
+ return mapEndpointParamsToFunctionParams;
2174
+ }
2175
+ });
2176
+ Object.defineProperty(exports, "mergeImports", {
2177
+ enumerable: true,
2178
+ get: function() {
2179
+ return mergeImports;
2180
+ }
2181
+ });
2182
+ Object.defineProperty(exports, "pathParamToVariableName", {
2183
+ enumerable: true,
2184
+ get: function() {
2185
+ return pathParamToVariableName;
2186
+ }
2187
+ });
2188
+ Object.defineProperty(exports, "pathToVariableName", {
2189
+ enumerable: true,
2190
+ get: function() {
2191
+ return pathToVariableName;
2192
+ }
2193
+ });
2194
+ Object.defineProperty(exports, "pick", {
2195
+ enumerable: true,
2196
+ get: function() {
2197
+ return pick;
2198
+ }
2199
+ });
2200
+ Object.defineProperty(exports, "removeStaleGeneratedFiles", {
2201
+ enumerable: true,
2202
+ get: function() {
2203
+ return removeStaleGeneratedFiles;
2204
+ }
2205
+ });
2206
+ Object.defineProperty(exports, "removeWord", {
2207
+ enumerable: true,
2208
+ get: function() {
2209
+ return removeWord;
2210
+ }
2211
+ });
2212
+ Object.defineProperty(exports, "renderAclCheckCall", {
2213
+ enumerable: true,
2214
+ get: function() {
2215
+ return renderAclCheckCall;
2216
+ }
2217
+ });
2218
+ Object.defineProperty(exports, "renderMediaUploadMutationBody", {
2219
+ enumerable: true,
2220
+ get: function() {
2221
+ return renderMediaUploadMutationBody;
2222
+ }
2223
+ });
2224
+ Object.defineProperty(exports, "replaceHyphenatedPath", {
2225
+ enumerable: true,
2226
+ get: function() {
2227
+ return replaceHyphenatedPath;
2228
+ }
2229
+ });
2230
+ Object.defineProperty(exports, "requiresBody", {
2231
+ enumerable: true,
2232
+ get: function() {
2233
+ return requiresBody;
2234
+ }
2235
+ });
2236
+ Object.defineProperty(exports, "shouldInlineEndpointsForTag", {
2237
+ enumerable: true,
2238
+ get: function() {
2239
+ return shouldInlineEndpointsForTag;
2240
+ }
2241
+ });
2242
+ Object.defineProperty(exports, "shouldUseNativeCodegen", {
2243
+ enumerable: true,
2244
+ get: function() {
2245
+ return shouldUseNativeCodegen;
2246
+ }
2247
+ });
2248
+ Object.defineProperty(exports, "snakeToCamel", {
2249
+ enumerable: true,
2250
+ get: function() {
2251
+ return snakeToCamel;
2252
+ }
2253
+ });
2254
+ Object.defineProperty(exports, "unwrapQuotesIfNeeded", {
2255
+ enumerable: true,
2256
+ get: function() {
2257
+ return unwrapQuotesIfNeeded;
2258
+ }
2259
+ });
2260
+ Object.defineProperty(exports, "wrapWithQuotesIfNeeded", {
2261
+ enumerable: true,
2262
+ get: function() {
2263
+ return wrapWithQuotesIfNeeded;
2264
+ }
2265
+ });
2266
+ Object.defineProperty(exports, "writeGenerateFileData", {
2267
+ enumerable: true,
2268
+ get: function() {
2269
+ return writeGenerateFileData;
2270
+ }
2271
+ });