@povio/openapi-codegen-cli 3.2.0-rc.2 → 3.2.0-rc.4

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.
@@ -1,4 +1,4 @@
1
- import { t as GenerateOptions } from "./options-DtAnhCLZ.mjs";
1
+ import { t as GenerateOptions } from "./options-B47gUU4P.mjs";
2
2
  //#region src/generators/types/config.d.ts
3
3
  type OpenAPICodegenConfig = Partial<GenerateOptions>;
4
4
  //#endregion
@@ -480,6 +480,7 @@ const DEFAULT_GENERATE_OPTIONS = {
480
480
  excludePathRegex: "",
481
481
  excludeRedundantZodSchemas: true,
482
482
  tsNamespaces: true,
483
+ treeShakeableNamespaces: false,
483
484
  tsPath: "@/data",
484
485
  importPath: "ts",
485
486
  configs: {
@@ -510,6 +511,7 @@ const DEFAULT_GENERATE_OPTIONS = {
510
511
  schemaSuffix: SCHEMA_SUFFIX,
511
512
  enumSuffix: ENUM_SUFFIX,
512
513
  modelsInCommon: false,
514
+ modelsInModules: false,
513
515
  withDefaultValues: true,
514
516
  extractEnums: true,
515
517
  replaceOptionalWithNullish: false,
@@ -641,7 +643,7 @@ const getImportedZodSchemaName = (resolver, zodSchemaName, namespaceTag) => {
641
643
  })}.` : ""}${zodSchemaName}`;
642
644
  };
643
645
  function getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag) {
644
- if (namespaceTag && resolver.options.modelsInCommon && resolver.options.splitByTags) return namespaceTag;
646
+ if (namespaceTag && (resolver.options.modelsInCommon || resolver.options.modelsInModules) && resolver.options.splitByTags) return namespaceTag;
645
647
  return resolver.getTagByZodSchemaName(zodSchemaName) ?? namespaceTag;
646
648
  }
647
649
  const getImportedZodSchemaInferedTypeName = (resolver, zodSchemaName, currentTag, namespaceTag) => {
@@ -919,7 +921,7 @@ function getImportPath(options, fromRoot = false) {
919
921
  function getImports({ type = "models", tag: currentTag, entities, getTag, getEntityName, options }) {
920
922
  const imports = /* @__PURE__ */ new Map();
921
923
  entities.forEach((entity) => {
922
- const tag = type === "models" && options.modelsInCommon && options.splitByTags ? currentTag : getTag(entity);
924
+ const tag = type === "models" && (options.modelsInCommon || options.modelsInModules) && options.splitByTags ? currentTag : getTag(entity);
923
925
  if (!imports.has(tag)) {
924
926
  const sameTagDir = currentTag === tag;
925
927
  imports.set(tag, {
@@ -1583,7 +1585,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
1583
1585
  const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
1584
1586
  if (nativeFiles) return nativeFiles;
1585
1587
  }
1586
- const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-CLQbTTwF.mjs").then((n) => n.n);
1588
+ const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-BOuCcW6U.mjs").then((n) => n.n);
1587
1589
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
1588
1590
  source: nativeInput.source,
1589
1591
  yaml: nativeInput.yaml
@@ -70,6 +70,7 @@ const DEFAULT_GENERATE_OPTIONS = {
70
70
  excludePathRegex: "",
71
71
  excludeRedundantZodSchemas: true,
72
72
  tsNamespaces: true,
73
+ treeShakeableNamespaces: false,
73
74
  tsPath: "@/data",
74
75
  importPath: "ts",
75
76
  configs: {
@@ -100,6 +101,7 @@ const DEFAULT_GENERATE_OPTIONS = {
100
101
  schemaSuffix: SCHEMA_SUFFIX,
101
102
  enumSuffix: ENUM_SUFFIX,
102
103
  modelsInCommon: false,
104
+ modelsInModules: false,
103
105
  withDefaultValues: true,
104
106
  extractEnums: true,
105
107
  replaceOptionalWithNullish: false,
@@ -819,7 +821,7 @@ const getImportedZodSchemaName = (resolver, zodSchemaName, namespaceTag) => {
819
821
  })}.` : ""}${zodSchemaName}`;
820
822
  };
821
823
  function getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag) {
822
- if (namespaceTag && resolver.options.modelsInCommon && resolver.options.splitByTags) return namespaceTag;
824
+ if (namespaceTag && (resolver.options.modelsInCommon || resolver.options.modelsInModules) && resolver.options.splitByTags) return namespaceTag;
823
825
  return resolver.getTagByZodSchemaName(zodSchemaName) ?? namespaceTag;
824
826
  }
825
827
  const getImportedZodSchemaInferedTypeName = (resolver, zodSchemaName, currentTag, namespaceTag) => {
@@ -1298,7 +1300,7 @@ function getImportPath(options, fromRoot = false) {
1298
1300
  function getImports({ type = "models", tag: currentTag, entities, getTag, getEntityName, options }) {
1299
1301
  const imports = /* @__PURE__ */ new Map();
1300
1302
  entities.forEach((entity) => {
1301
- const tag = type === "models" && options.modelsInCommon && options.splitByTags ? currentTag : getTag(entity);
1303
+ const tag = type === "models" && (options.modelsInCommon || options.modelsInModules) && options.splitByTags ? currentTag : getTag(entity);
1302
1304
  if (!imports.has(tag)) {
1303
1305
  const sameTagDir = currentTag === tag;
1304
1306
  imports.set(tag, {
@@ -1,4 +1,4 @@
1
- const require_generate_utils = require("./generate.utils-C29zzyBl.cjs");
1
+ const require_generate_utils = require("./generate.utils-1rU0zIjA.cjs");
2
2
  //#region src/generators/core/zod/getZodChain.ts
3
3
  const zodChainCache = /* @__PURE__ */ new WeakMap();
4
4
  function getZodChain({ schema, meta, options }) {
@@ -1139,7 +1139,7 @@ function resolveOperationName({ path, method, operation, options, tag, keepOpera
1139
1139
  const regex = new RegExp(`^.*${options.removeOperationPrefixEndingWith}`);
1140
1140
  operationName = operationName.replace(regex, "");
1141
1141
  }
1142
- if (options.tsNamespaces && !keepOperationTag) {
1142
+ if ((options.tsNamespaces || options.treeShakeableNamespaces) && !keepOperationTag) {
1143
1143
  const operationNameWithoutTag = require_generate_utils.removeWord(operationName, tag);
1144
1144
  if (operationNameWithoutTag === "") operationName = method.toLowerCase();
1145
1145
  else if (!RESERVED_WORDS.includes(operationNameWithoutTag)) operationName = operationNameWithoutTag;
@@ -1581,6 +1581,17 @@ var SchemaResolver = class {
1581
1581
  this.zodSchemaTagCache?.set(zodSchemaName, tag);
1582
1582
  return tag;
1583
1583
  }
1584
+ getTagsByZodSchemaName(zodSchemaName) {
1585
+ if (!this.options.splitByTags) return [require_generate_utils.formatTag(this.options.defaultTag)];
1586
+ const extractedEnum = this.extractedEnumZodSchemaData.find((data) => data.zodSchemaName === zodSchemaName);
1587
+ if (extractedEnum) {
1588
+ const tags = require_generate_utils.getUniqueArray(extractedEnum.meta.tags);
1589
+ return (tags.length > 0 ? tags : [extractedEnum.tag ?? this.options.defaultTag]).map(require_generate_utils.formatTag);
1590
+ }
1591
+ const schemaRef = this.getRefByZodSchemaName(zodSchemaName);
1592
+ const tags = require_generate_utils.getUniqueArray(schemaRef ? this.getSchemaDataByRef(schemaRef)?.tags ?? [] : [], this.zodSchemaDataByName.get(zodSchemaName)?.tags ?? []);
1593
+ return (tags.length > 0 ? tags : [this.options.defaultTag]).map(require_generate_utils.formatTag);
1594
+ }
1584
1595
  enableZodSchemaTagCache() {
1585
1596
  this.zodSchemaTagCache = /* @__PURE__ */ new Map();
1586
1597
  }
@@ -1955,9 +1966,21 @@ function splitDataByTags({ resolver, endpoints, zodSchemas, options }) {
1955
1966
  getTagElement$1(require_generate_utils.getEndpointTag(endpoint, options), data).endpoints.push(endpoint);
1956
1967
  });
1957
1968
  Object.entries(zodSchemas).forEach(([zodSchemaName, zodSchemaCode]) => {
1969
+ if (options.modelsInModules) {
1970
+ for (const tag of resolver.getTagsByZodSchemaName(zodSchemaName)) getTagElement$1(tag, data).zodSchemas[zodSchemaName] = zodSchemaCode;
1971
+ return;
1972
+ }
1958
1973
  const tag = options.modelsInCommon ? options.defaultTag : resolver.getTagByZodSchemaName(zodSchemaName);
1959
1974
  if (tag) getTagElement$1(tag, data).zodSchemas[zodSchemaName] = zodSchemaCode;
1960
1975
  });
1976
+ if (options.modelsInModules) for (const tagData of data.values()) {
1977
+ const pending = Object.keys(tagData.zodSchemas);
1978
+ for (let index = 0; index < pending.length; index++) for (const dependencyName of getZodSchemaRefs(resolver, pending[index])) {
1979
+ if (tagData.zodSchemas[dependencyName] || !zodSchemas[dependencyName]) continue;
1980
+ tagData.zodSchemas[dependencyName] = zodSchemas[dependencyName];
1981
+ pending.push(dependencyName);
1982
+ }
1983
+ }
1961
1984
  return data;
1962
1985
  }
1963
1986
  function getTagElement$1(tag, data) {
@@ -2655,7 +2678,7 @@ function generateEndpoints({ resolver, data, tag }) {
2655
2678
  return lines.join("\n").trimEnd() + "\n";
2656
2679
  }
2657
2680
  function renderRequestInfo(resolver, endpoint, tag) {
2658
- return `{ resSchema: ${require_generate_utils.getImportedZodSchemaName(resolver, endpoint.response, resolver.options.modelsInCommon && resolver.options.splitByTags ? tag : void 0)} }`;
2681
+ return `{ resSchema: ${require_generate_utils.getImportedZodSchemaName(resolver, endpoint.response, (resolver.options.modelsInCommon || resolver.options.modelsInModules) && resolver.options.splitByTags ? tag : void 0)} }`;
2659
2682
  }
2660
2683
  function getRequestConfigType$1() {
2661
2684
  return `${require_generate_utils.AXIOS_REQUEST_CONFIG_TYPE} & { allowInvalidResponseData?: boolean }`;
@@ -3320,26 +3343,28 @@ function renderInfiniteQueryOptions({ resolver, endpoint, inlineEndpoints }) {
3320
3343
  return lines.join("\n");
3321
3344
  }
3322
3345
  function renderPrefetchQuery({ resolver, endpoint }) {
3323
- const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
3346
+ const hasRequestConfigParam = resolver.options.axiosRequestConfig || endpoint.method === "get";
3324
3347
  const endpointParams = renderEndpointParams(resolver, endpoint, { modelNamespaceTag: require_generate_utils.getEndpointTag(endpoint, resolver.options) });
3325
3348
  const endpointArgs = renderEndpointArgs(resolver, endpoint, {});
3326
3349
  const lines = [];
3327
- lines.push(`export const ${require_generate_utils.getPrefetchQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}: ${require_generate_utils.AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchQuery"]>[0], "queryKey" | "queryFn">) => {`);
3328
- lines.push(` return queryClient.prefetchQuery({ ...${require_generate_utils.getQueryOptionsName(endpoint)}(${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}` : ""}), ...options });`);
3350
+ lines.push(`export const ${require_generate_utils.getPrefetchQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}options?: Omit<Parameters<QueryClient["prefetchQuery"]>[0], "queryKey" | "queryFn">, ${hasRequestConfigParam ? `${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}?: ${require_generate_utils.AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}throwOnError = false) => {`);
3351
+ lines.push(` const queryOptions = { ...${require_generate_utils.getQueryOptionsName(endpoint)}(${endpointParams ? `{ ${endpointArgs} }` : ""}${hasRequestConfigParam ? `${endpointParams ? ", " : ""}${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}` : ""}), ...options };`);
3352
+ lines.push(` return throwOnError ? queryClient.fetchQuery(queryOptions) : queryClient.prefetchQuery(queryOptions);`);
3329
3353
  lines.push("};");
3330
3354
  return lines.join("\n");
3331
3355
  }
3332
3356
  function renderPrefetchInfiniteQuery({ resolver, endpoint }) {
3333
- const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
3357
+ const hasRequestConfigParam = resolver.options.axiosRequestConfig || endpoint.method === "get";
3334
3358
  const endpointParams = renderEndpointParams(resolver, endpoint, {
3335
3359
  excludePageParam: true,
3336
3360
  modelNamespaceTag: require_generate_utils.getEndpointTag(endpoint, resolver.options)
3337
3361
  });
3338
3362
  const endpointArgs = renderEndpointArgs(resolver, endpoint, { excludePageParam: true });
3339
- const optionsArgs = `${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
3363
+ const optionsArgs = `${endpointParams ? `{ ${endpointArgs} }` : ""}${hasRequestConfigParam ? `${endpointParams ? ", " : ""}${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
3340
3364
  const lines = [];
3341
- lines.push(`export const ${require_generate_utils.getPrefetchInfiniteQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}: ${require_generate_utils.AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchInfiniteQuery"]>[0], "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">) => {`);
3342
- lines.push(` return queryClient.prefetchInfiniteQuery({ ...${require_generate_utils.getInfiniteQueryOptionsName(endpoint)}(${optionsArgs}), ...(options as {}) });`);
3365
+ lines.push(`export const ${require_generate_utils.getPrefetchInfiniteQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}options?: Omit<Parameters<QueryClient["prefetchInfiniteQuery"]>[0], "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">, ${hasRequestConfigParam ? `${require_generate_utils.AXIOS_REQUEST_CONFIG_NAME}?: ${require_generate_utils.AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}throwOnError = false) => {`);
3366
+ lines.push(` const queryOptions = { ...${require_generate_utils.getInfiniteQueryOptionsName(endpoint)}(${optionsArgs}), ...(options as {}) };`);
3367
+ lines.push(` return throwOnError ? queryClient.fetchInfiniteQuery(queryOptions) : queryClient.prefetchInfiniteQuery(queryOptions);`);
3343
3368
  lines.push("};");
3344
3369
  return lines.join("\n");
3345
3370
  }
@@ -1,5 +1,5 @@
1
- import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-fPRPa4_t.mjs";
2
- import { $ as getImportedAbilityFunctionName, $t as isParamMediaTypeAllowed, A as getEndpointsImports, B as getPrefetchInfiniteQueryName, Bt as QUERY_MODULE_ENUM, C as getAppRestClientImportPath, Ct as isReadEndpoint, D as getTagFileName, Dn as AXIOS_IMPORT, E as getQueryTypesImportPath, En as AXIOS_DEFAULT_IMPORT_NAME, F as mergeImports, Ft as APP_REST_CLIENT_NAME, G as getAbilityConditionType, H as getQueryName, Ht as ZOD_EXTENDED, I as getImportedInfiniteQueryName, In as shouldInlineEndpointsForTag, It as BUILDERS_UTILS, J as getAbilityFunctionName, K as getAbilityConditionsTypes, L as getImportedQueryName, Ln as camelToSpaceSeparated, Lt as DOMAIN_ERRORS_FILE, M as getInfiniteQueriesImports, Mt as isEnumZodSchema, N as getModelsImports, Nn as getEndpointTag, Nt as isNamedZodSchema, O as getTagImportPath, On as AXIOS_REQUEST_CONFIG_NAME, P as getQueriesImports, Pt as APP_REST_CLIENT_FILE, Q as getAppAbilitiesType, R as getInfiniteQueryName, Rn as capitalize, Rt as MUTATION_EFFECTS, St as isReadAllEndpoint, T as getQueryModulesImportPath, Tn as ZOD_IMPORT, Tt as invalidVariableNameCharactersToCamel, U as getQueryOptionsName, Ut as PACKAGE_IMPORT_PATH, V as getPrefetchQueryName, Vn as kebabToCamel, Vt as QUERY_OPTIONS_TYPES, W as getAbilityAction, Wn as Profiler, Wt as getNamespaceName, X as getAbilitySubjectTypes, Y as getAbilitySubject, Z as getAclData, _ as hasEndpointConfig, _t as getPathSegments, at as getZodSchemaInferedTypeName, b as requiresBody, bt as isDeleteEndpoint, c as getDestructuredVariables, ct as getSchemaDescriptions, d as isQuery, dn as isSchemaObject, dt as DEFAULT_GENERATE_OPTIONS, et as hasAbilityConditions, f as getEndpointBody, ft as ACL_APP_ABILITIES, g as getImportedEndpointName, gt as CASL_ABILITY_IMPORT, h as getEndpointPath, ht as CASL_ABILITY_BINDING, i as shouldUseNativeCodegen, it as getZodSchemaDescription, j as getImportPath, jn as JSON_APPLICATION_FORMAT, k as getAclImports, kn as AXIOS_REQUEST_CONFIG_TYPE, l as isInfiniteQuery, m as getEndpointName, mn as ANY_SCHEMA, mt as ACL_CHECK_HOOK, nt as getImportedZodSchemaInferedTypeName, o as getOutputFileName, ot as getZodSchemaPropertyDescriptions, p as getEndpointConfig, pt as ACL_APP_ABILITY_FILE, q as getAbilityDescription, r as compileNativeData, rt as getImportedZodSchemaName, st as getZodSchemaType, tt as renderAclCheckCall, u as isMutation, un as isReferenceObject, ut as getUniqueArray, v as mapEndpointParamsToFunctionParams, vt as isBulkDeleteEndpoint, w as getFileNameWithExtension, wt as isUpdateEndpoint, xt as isPathSegmentParam, y as renderMediaUploadMutationBody, yt as isCreateEndpoint, z as getInfiniteQueryOptionsName, zt as QUERY_MODULES_FILE } from "./generate.runner-BGhsnDm8.mjs";
1
+ import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-CkIfezoI.mjs";
2
+ import { $ as getImportedAbilityFunctionName, $t as isParamMediaTypeAllowed, A as getEndpointsImports, B as getPrefetchInfiniteQueryName, Bt as QUERY_MODULE_ENUM, C as getAppRestClientImportPath, Ct as isReadEndpoint, D as getTagFileName, Dn as AXIOS_IMPORT, E as getQueryTypesImportPath, En as AXIOS_DEFAULT_IMPORT_NAME, F as mergeImports, Ft as APP_REST_CLIENT_NAME, G as getAbilityConditionType, H as getQueryName, Ht as ZOD_EXTENDED, I as getImportedInfiniteQueryName, In as shouldInlineEndpointsForTag, It as BUILDERS_UTILS, J as getAbilityFunctionName, K as getAbilityConditionsTypes, L as getImportedQueryName, Ln as camelToSpaceSeparated, Lt as DOMAIN_ERRORS_FILE, M as getInfiniteQueriesImports, Mt as isEnumZodSchema, N as getModelsImports, Nn as getEndpointTag, Nt as isNamedZodSchema, O as getTagImportPath, On as AXIOS_REQUEST_CONFIG_NAME, P as getQueriesImports, Pt as APP_REST_CLIENT_FILE, Q as getAppAbilitiesType, R as getInfiniteQueryName, Rn as capitalize, Rt as MUTATION_EFFECTS, St as isReadAllEndpoint, T as getQueryModulesImportPath, Tn as ZOD_IMPORT, Tt as invalidVariableNameCharactersToCamel, U as getQueryOptionsName, Ut as PACKAGE_IMPORT_PATH, V as getPrefetchQueryName, Vn as kebabToCamel, Vt as QUERY_OPTIONS_TYPES, W as getAbilityAction, Wn as Profiler, Wt as getNamespaceName, X as getAbilitySubjectTypes, Y as getAbilitySubject, Z as getAclData, _ as hasEndpointConfig, _t as getPathSegments, at as getZodSchemaInferedTypeName, b as requiresBody, bt as isDeleteEndpoint, c as getDestructuredVariables, ct as getSchemaDescriptions, d as isQuery, dn as isSchemaObject, dt as DEFAULT_GENERATE_OPTIONS, et as hasAbilityConditions, f as getEndpointBody, ft as ACL_APP_ABILITIES, g as getImportedEndpointName, gt as CASL_ABILITY_IMPORT, h as getEndpointPath, ht as CASL_ABILITY_BINDING, i as shouldUseNativeCodegen, it as getZodSchemaDescription, j as getImportPath, jn as JSON_APPLICATION_FORMAT, k as getAclImports, kn as AXIOS_REQUEST_CONFIG_TYPE, l as isInfiniteQuery, m as getEndpointName, mn as ANY_SCHEMA, mt as ACL_CHECK_HOOK, nt as getImportedZodSchemaInferedTypeName, o as getOutputFileName, ot as getZodSchemaPropertyDescriptions, p as getEndpointConfig, pt as ACL_APP_ABILITY_FILE, q as getAbilityDescription, r as compileNativeData, rt as getImportedZodSchemaName, st as getZodSchemaType, tt as renderAclCheckCall, u as isMutation, un as isReferenceObject, ut as getUniqueArray, v as mapEndpointParamsToFunctionParams, vt as isBulkDeleteEndpoint, w as getFileNameWithExtension, wt as isUpdateEndpoint, xt as isPathSegmentParam, y as renderMediaUploadMutationBody, yt as isCreateEndpoint, z as getInfiniteQueryOptionsName, zt as QUERY_MODULES_FILE } from "./generate.runner-BxdZdYX4.mjs";
3
3
  import "node:module";
4
4
  //#region \0rolldown/runtime.js
5
5
  var __defProp = Object.defineProperty;
@@ -700,7 +700,7 @@ function generateEndpoints({ resolver, data, tag }) {
700
700
  return lines.join("\n").trimEnd() + "\n";
701
701
  }
702
702
  function renderRequestInfo(resolver, endpoint, tag) {
703
- return `{ resSchema: ${getImportedZodSchemaName(resolver, endpoint.response, resolver.options.modelsInCommon && resolver.options.splitByTags ? tag : void 0)} }`;
703
+ return `{ resSchema: ${getImportedZodSchemaName(resolver, endpoint.response, (resolver.options.modelsInCommon || resolver.options.modelsInModules) && resolver.options.splitByTags ? tag : void 0)} }`;
704
704
  }
705
705
  function getRequestConfigType$1() {
706
706
  return `${AXIOS_REQUEST_CONFIG_TYPE} & { allowInvalidResponseData?: boolean }`;
@@ -1365,26 +1365,28 @@ function renderInfiniteQueryOptions({ resolver, endpoint, inlineEndpoints }) {
1365
1365
  return lines.join("\n");
1366
1366
  }
1367
1367
  function renderPrefetchQuery({ resolver, endpoint }) {
1368
- const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
1368
+ const hasRequestConfigParam = resolver.options.axiosRequestConfig || endpoint.method === "get";
1369
1369
  const endpointParams = renderEndpointParams(resolver, endpoint, { modelNamespaceTag: getEndpointTag(endpoint, resolver.options) });
1370
1370
  const endpointArgs = renderEndpointArgs(resolver, endpoint, {});
1371
1371
  const lines = [];
1372
- lines.push(`export const ${getPrefetchQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchQuery"]>[0], "queryKey" | "queryFn">) => {`);
1373
- lines.push(` return queryClient.prefetchQuery({ ...${getQueryOptionsName(endpoint)}(${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}), ...options });`);
1372
+ lines.push(`export const ${getPrefetchQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}options?: Omit<Parameters<QueryClient["prefetchQuery"]>[0], "queryKey" | "queryFn">, ${hasRequestConfigParam ? `${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}throwOnError = false) => {`);
1373
+ lines.push(` const queryOptions = { ...${getQueryOptionsName(endpoint)}(${endpointParams ? `{ ${endpointArgs} }` : ""}${hasRequestConfigParam ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}), ...options };`);
1374
+ lines.push(` return throwOnError ? queryClient.fetchQuery(queryOptions) : queryClient.prefetchQuery(queryOptions);`);
1374
1375
  lines.push("};");
1375
1376
  return lines.join("\n");
1376
1377
  }
1377
1378
  function renderPrefetchInfiniteQuery({ resolver, endpoint }) {
1378
- const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
1379
+ const hasRequestConfigParam = resolver.options.axiosRequestConfig || endpoint.method === "get";
1379
1380
  const endpointParams = renderEndpointParams(resolver, endpoint, {
1380
1381
  excludePageParam: true,
1381
1382
  modelNamespaceTag: getEndpointTag(endpoint, resolver.options)
1382
1383
  });
1383
1384
  const endpointArgs = renderEndpointArgs(resolver, endpoint, { excludePageParam: true });
1384
- const optionsArgs = `${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
1385
+ const optionsArgs = `${endpointParams ? `{ ${endpointArgs} }` : ""}${hasRequestConfigParam ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
1385
1386
  const lines = [];
1386
- lines.push(`export const ${getPrefetchInfiniteQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchInfiniteQuery"]>[0], "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">) => {`);
1387
- lines.push(` return queryClient.prefetchInfiniteQuery({ ...${getInfiniteQueryOptionsName(endpoint)}(${optionsArgs}), ...(options as {}) });`);
1387
+ lines.push(`export const ${getPrefetchInfiniteQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}options?: Omit<Parameters<QueryClient["prefetchInfiniteQuery"]>[0], "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">, ${hasRequestConfigParam ? `${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}throwOnError = false) => {`);
1388
+ lines.push(` const queryOptions = { ...${getInfiniteQueryOptionsName(endpoint)}(${optionsArgs}), ...(options as {}) };`);
1389
+ lines.push(` return throwOnError ? queryClient.fetchInfiniteQuery(queryOptions) : queryClient.prefetchInfiniteQuery(queryOptions);`);
1388
1390
  lines.push("};");
1389
1391
  return lines.join("\n");
1390
1392
  }
@@ -1,4 +1,4 @@
1
- import { n as GenerateFileData, t as GenerateOptions } from "./options-DtAnhCLZ.mjs";
1
+ import { n as GenerateFileData, t as GenerateOptions } from "./options-B47gUU4P.mjs";
2
2
  import { OpenAPIV3 } from "openapi-types";
3
3
  //#region src/generators/types/metadata.d.ts
4
4
  interface GenerateParams {
@@ -1,6 +1,6 @@
1
- import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-CLQbTTwF.mjs";
2
- import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-fPRPa4_t.mjs";
3
- import { $t as isParamMediaTypeAllowed, H as getQueryName, Mn as formatTag, O as getTagImportPath, Qt as isMediaTypeAllowed, S as getTsTypeBase, Tt as invalidVariableNameCharactersToCamel, Wt as getNamespaceName, d as isQuery, dt as DEFAULT_GENERATE_OPTIONS, t as getOpenApiDoc, u as isMutation, x as getSchemaTsMetaType } from "./generate.runner-BGhsnDm8.mjs";
1
+ import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-BOuCcW6U.mjs";
2
+ import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-CkIfezoI.mjs";
3
+ import { $t as isParamMediaTypeAllowed, H as getQueryName, Mn as formatTag, O as getTagImportPath, Qt as isMediaTypeAllowed, S as getTsTypeBase, Tt as invalidVariableNameCharactersToCamel, Wt as getNamespaceName, d as isQuery, dt as DEFAULT_GENERATE_OPTIONS, t as getOpenApiDoc, u as isMutation, x as getSchemaTsMetaType } from "./generate.runner-BxdZdYX4.mjs";
4
4
  //#region src/generators/core/getMetadataFromOpenAPIDoc.ts
5
5
  async function getMetadataFromOpenAPIDoc(openApiDoc, options) {
6
6
  const { resolver, data } = await getDataFromOpenAPIDoc(openApiDoc, options);
@@ -1,4 +1,4 @@
1
- import { $t as isParamMediaTypeAllowed, An as BODY_PARAMETER_NAME, At as getZodSchemaName, Bn as getMostCommonAdjacentCombinationSplit, Cn as UUID_SCHEMA, Dt as getEnumZodSchemaName, Et as getBodyZodSchemaName, Fn as isTagIncluded, Gt as autocorrectRef, Hn as removeWord, Jt as getSchemaNameByRef, Kt as escapeControlCharacters, Mn as formatTag, Nn as getEndpointTag, Nt as isNamedZodSchema, Ot as getParamZodSchemaName, Pn as getOperationTag, Qt as isMediaTypeAllowed, Rn as capitalize, Sn as URL_SCHEMA, Tt as invalidVariableNameCharactersToCamel, Un as snakeToCamel, Wn as Profiler, Wt as getNamespaceName, Xt as isErrorStatus, Yt as getSchemaRef, Zt as isMainResponseStatus, _n as EMAIL_SCHEMA, an as replaceHyphenatedPath, bn as NUMBER_SCHEMA, cn as inferRequiredSchema, d as isQuery, dn as isSchemaObject, en as isPathExcluded, fn as ALLOWED_METHODS, gn as DATETIME_SCHEMA, hn as BLOB_SCHEMA, in as pathToVariableName, jn as JSON_APPLICATION_FORMAT, jt as getZodSchemaOperationName, kt as getResponseZodSchemaName, ln as isArraySchemaObject, lt as iterateSchema, mn as ANY_SCHEMA, nn as isSortingParameterObject, on as unwrapQuotesIfNeeded, pn as ALLOWED_PATH_IN, qt as getParameterEnumNames, rn as pathParamToVariableName, s as pick, sn as wrapWithQuotesIfNeeded, tn as isPrimitiveType, un as isReferenceObject, ut as getUniqueArray, vn as ENUM_SCHEMA, wn as VOID_SCHEMA, xn as STRING_SCHEMA, yn as INT_SCHEMA, zn as decapitalize } from "./generate.runner-BGhsnDm8.mjs";
1
+ import { $t as isParamMediaTypeAllowed, An as BODY_PARAMETER_NAME, At as getZodSchemaName, Bn as getMostCommonAdjacentCombinationSplit, Cn as UUID_SCHEMA, Dt as getEnumZodSchemaName, Et as getBodyZodSchemaName, Fn as isTagIncluded, Gt as autocorrectRef, Hn as removeWord, Jt as getSchemaNameByRef, Kt as escapeControlCharacters, Mn as formatTag, Nn as getEndpointTag, Nt as isNamedZodSchema, Ot as getParamZodSchemaName, Pn as getOperationTag, Qt as isMediaTypeAllowed, Rn as capitalize, Sn as URL_SCHEMA, Tt as invalidVariableNameCharactersToCamel, Un as snakeToCamel, Wn as Profiler, Wt as getNamespaceName, Xt as isErrorStatus, Yt as getSchemaRef, Zt as isMainResponseStatus, _n as EMAIL_SCHEMA, an as replaceHyphenatedPath, bn as NUMBER_SCHEMA, cn as inferRequiredSchema, d as isQuery, dn as isSchemaObject, en as isPathExcluded, fn as ALLOWED_METHODS, gn as DATETIME_SCHEMA, hn as BLOB_SCHEMA, in as pathToVariableName, jn as JSON_APPLICATION_FORMAT, jt as getZodSchemaOperationName, kt as getResponseZodSchemaName, ln as isArraySchemaObject, lt as iterateSchema, mn as ANY_SCHEMA, nn as isSortingParameterObject, on as unwrapQuotesIfNeeded, pn as ALLOWED_PATH_IN, qt as getParameterEnumNames, rn as pathParamToVariableName, s as pick, sn as wrapWithQuotesIfNeeded, tn as isPrimitiveType, un as isReferenceObject, ut as getUniqueArray, vn as ENUM_SCHEMA, wn as VOID_SCHEMA, xn as STRING_SCHEMA, yn as INT_SCHEMA, zn as decapitalize } from "./generate.runner-BxdZdYX4.mjs";
2
2
  //#region src/generators/const/validation.const.ts
3
3
  const HTTP_STATUS_CODES = {
4
4
  "100": "Continue",
@@ -1156,7 +1156,7 @@ function resolveOperationName({ path, method, operation, options, tag, keepOpera
1156
1156
  const regex = new RegExp(`^.*${options.removeOperationPrefixEndingWith}`);
1157
1157
  operationName = operationName.replace(regex, "");
1158
1158
  }
1159
- if (options.tsNamespaces && !keepOperationTag) {
1159
+ if ((options.tsNamespaces || options.treeShakeableNamespaces) && !keepOperationTag) {
1160
1160
  const operationNameWithoutTag = removeWord(operationName, tag);
1161
1161
  if (operationNameWithoutTag === "") operationName = method.toLowerCase();
1162
1162
  else if (!RESERVED_WORDS.includes(operationNameWithoutTag)) operationName = operationNameWithoutTag;
@@ -1598,6 +1598,17 @@ var SchemaResolver = class {
1598
1598
  this.zodSchemaTagCache?.set(zodSchemaName, tag);
1599
1599
  return tag;
1600
1600
  }
1601
+ getTagsByZodSchemaName(zodSchemaName) {
1602
+ if (!this.options.splitByTags) return [formatTag(this.options.defaultTag)];
1603
+ const extractedEnum = this.extractedEnumZodSchemaData.find((data) => data.zodSchemaName === zodSchemaName);
1604
+ if (extractedEnum) {
1605
+ const tags = getUniqueArray(extractedEnum.meta.tags);
1606
+ return (tags.length > 0 ? tags : [extractedEnum.tag ?? this.options.defaultTag]).map(formatTag);
1607
+ }
1608
+ const schemaRef = this.getRefByZodSchemaName(zodSchemaName);
1609
+ const tags = getUniqueArray(schemaRef ? this.getSchemaDataByRef(schemaRef)?.tags ?? [] : [], this.zodSchemaDataByName.get(zodSchemaName)?.tags ?? []);
1610
+ return (tags.length > 0 ? tags : [this.options.defaultTag]).map(formatTag);
1611
+ }
1601
1612
  enableZodSchemaTagCache() {
1602
1613
  this.zodSchemaTagCache = /* @__PURE__ */ new Map();
1603
1614
  }
@@ -1972,9 +1983,21 @@ function splitDataByTags({ resolver, endpoints, zodSchemas, options }) {
1972
1983
  getTagElement(getEndpointTag(endpoint, options), data).endpoints.push(endpoint);
1973
1984
  });
1974
1985
  Object.entries(zodSchemas).forEach(([zodSchemaName, zodSchemaCode]) => {
1986
+ if (options.modelsInModules) {
1987
+ for (const tag of resolver.getTagsByZodSchemaName(zodSchemaName)) getTagElement(tag, data).zodSchemas[zodSchemaName] = zodSchemaCode;
1988
+ return;
1989
+ }
1975
1990
  const tag = options.modelsInCommon ? options.defaultTag : resolver.getTagByZodSchemaName(zodSchemaName);
1976
1991
  if (tag) getTagElement(tag, data).zodSchemas[zodSchemaName] = zodSchemaCode;
1977
1992
  });
1993
+ if (options.modelsInModules) for (const tagData of data.values()) {
1994
+ const pending = Object.keys(tagData.zodSchemas);
1995
+ for (let index = 0; index < pending.length; index++) for (const dependencyName of getZodSchemaRefs(resolver, pending[index])) {
1996
+ if (tagData.zodSchemas[dependencyName] || !zodSchemas[dependencyName]) continue;
1997
+ tagData.zodSchemas[dependencyName] = zodSchemas[dependencyName];
1998
+ pending.push(dependencyName);
1999
+ }
2000
+ }
1978
2001
  return data;
1979
2002
  }
1980
2003
  function getTagElement(tag, data) {
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as ErrorHandler, c as SharedErrorHandler, d as ns, f as resources, i as ErrorEntry, l as TranslateFunction, n as DomainErrorEntry, o as ErrorHandlerOptions, r as DomainErrorRegistry, s as GeneralErrorCodes, t as ApplicationException, u as configureTranslations } from "./error-handling-CNOHs4Fc.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-DFpV8mjG.mjs";
2
+ import { t as OpenAPICodegenConfig } from "./config-mWuUhYNE.mjs";
3
3
  import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, CreateAxiosDefaults } from "axios";
4
4
  import { z } from "zod";
5
5
  import { PropsWithChildren, ReactNode } from "react";
package/dist/metro.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_generate_utils = require("./generate.utils-C29zzyBl.cjs");
2
+ const require_generate_utils = require("./generate.utils-1rU0zIjA.cjs");
3
3
  let fs = require("fs");
4
4
  fs = require_generate_utils.__toESM(fs, 1);
5
5
  let path = require("path");
@@ -97,7 +97,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
97
97
  const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
98
98
  if (nativeFiles) return nativeFiles;
99
99
  }
100
- const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-B0Cmn2dx.cjs"));
100
+ const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-5VZFVFK1.cjs"));
101
101
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
102
102
  source: nativeInput.source,
103
103
  yaml: nativeInput.yaml
package/dist/metro.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { r as GenerateFileFormatter } from "./options-DtAnhCLZ.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-DFpV8mjG.mjs";
3
- import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-zPcbJwpP.mjs";
1
+ import { r as GenerateFileFormatter } from "./options-B47gUU4P.mjs";
2
+ import { t as OpenAPICodegenConfig } from "./config-mWuUhYNE.mjs";
3
+ import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-DmJoXvFj.mjs";
4
4
  import { IncomingMessage, ServerResponse } from "http";
5
5
  //#region src/metro/openapi-codegen.plugin.d.ts
6
6
  type OpenApiCodegenMetroConfig = OpenAPICodegenConfig & {
package/dist/metro.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-BtaqQSH2.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-fS_gOezd.mjs";
2
2
  import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-BZ6ZLgRO.mjs";
3
3
  import fs from "fs";
4
4
  import path from "path";
@@ -1,4 +1,4 @@
1
- import { Wn as Profiler, n as runGenerate } from "./generate.runner-BGhsnDm8.mjs";
1
+ import { Wn as Profiler, n as runGenerate } from "./generate.runner-BxdZdYX4.mjs";
2
2
  import path from "path";
3
3
  //#region src/plugins/openapi-codegen.runner.ts
4
4
  function createOpenApiCodegenRunner(config, options = {}) {
@@ -1,4 +1,4 @@
1
- import { t as OpenAPICodegenConfig } from "./config-DFpV8mjG.mjs";
1
+ import { t as OpenAPICodegenConfig } from "./config-mWuUhYNE.mjs";
2
2
  //#region src/tiny/openapi.d.ts
3
3
  interface GenerateOpenApiFileOptions {
4
4
  argv?: readonly string[];
@@ -18,6 +18,7 @@ interface ZodGenerateOptions {
18
18
  schemaSuffix: string;
19
19
  enumSuffix: string;
20
20
  modelsInCommon?: boolean;
21
+ modelsInModules?: boolean;
21
22
  withImplicitRequiredProps?: boolean;
22
23
  withDefaultValues?: boolean;
23
24
  withDescription?: boolean;
@@ -90,6 +91,7 @@ interface BaseGenerateOptions {
90
91
  excludePathRegex: string;
91
92
  excludeRedundantZodSchemas: boolean;
92
93
  tsNamespaces: boolean;
94
+ treeShakeableNamespaces?: boolean;
93
95
  tsPath: string;
94
96
  importPath: "ts" | "relative" | "absolute";
95
97
  configs: Record<GenerateType, GenerateConfig>;
package/dist/sh.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
- import { i as VALIDATION_ERROR_TYPE_TITLE, n as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-fPRPa4_t.mjs";
3
- import { D as getTagFileName, Wn as Profiler, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc } from "./generate.runner-BGhsnDm8.mjs";
2
+ import { i as VALIDATION_ERROR_TYPE_TITLE, n as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-CkIfezoI.mjs";
3
+ import { D as getTagFileName, Wn as Profiler, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc } from "./generate.runner-BxdZdYX4.mjs";
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
6
  import { styleText } from "node:util";
@@ -31,7 +31,7 @@ function logBanner(message) {
31
31
  * Fetch the version from package.json
32
32
  */
33
33
  function getVersion() {
34
- return "3.2.0-rc.2";
34
+ return "3.2.0-rc.4";
35
35
  }
36
36
  //#endregion
37
37
  //#region src/helpers/yargs.helper.ts
@@ -253,6 +253,7 @@ var GenerateOptions = class {
253
253
  clearOutput;
254
254
  incremental;
255
255
  tsNamespaces;
256
+ treeShakeableNamespaces;
256
257
  tsPath;
257
258
  splitByTags;
258
259
  defaultTag;
@@ -263,6 +264,7 @@ var GenerateOptions = class {
263
264
  importPath;
264
265
  extractEnums;
265
266
  modelsInCommon;
267
+ modelsInModules;
266
268
  zodImportPath;
267
269
  mutationEffectsImportPath;
268
270
  aclCheckImportPath;
@@ -300,6 +302,10 @@ __decorate([YargOption({
300
302
  envAlias: "tsNamespaces",
301
303
  type: "boolean"
302
304
  }), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "tsNamespaces", void 0);
305
+ __decorate([YargOption({
306
+ envAlias: "treeShakeableNamespaces",
307
+ type: "boolean"
308
+ }), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "treeShakeableNamespaces", void 0);
303
309
  __decorate([YargOption({ envAlias: "tsPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "tsPath", void 0);
304
310
  __decorate([YargOption({
305
311
  envAlias: "splitByTags",
@@ -322,6 +328,10 @@ __decorate([YargOption({
322
328
  envAlias: "modelsInCommon",
323
329
  type: "boolean"
324
330
  }), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "modelsInCommon", void 0);
331
+ __decorate([YargOption({
332
+ envAlias: "modelsInModules",
333
+ type: "boolean"
334
+ }), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "modelsInModules", void 0);
325
335
  __decorate([YargOption({ envAlias: "zodImportPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "zodImportPath", void 0);
326
336
  __decorate([YargOption({ envAlias: "mutationEffectsImportPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "mutationEffectsImportPath", void 0);
327
337
  __decorate([YargOption({ envAlias: "aclCheckImportPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "aclCheckImportPath", void 0);
package/dist/tiny.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-zPcbJwpP.mjs";
1
+ import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-DmJoXvFj.mjs";
2
2
  export { AclRule, AnyContractRouter, AnySchema, GenerateORPCOpenAPISpecOptions, GenerateOpenApiFile, GenerateOpenApiFileOptions, GenerateOpenApiFileResult, GenerateOpenApiSpec, GenerateTinyOpenApiFileOptions, JsonObject, OpenApiSchemaRegistry, ProcedureMeta, TinyOpenApiModule, type TinyOpenApiSourceRunnerConfig, TinyOpenApiUserRole, ZodSchema, addContractSchema, applyEnumExtensions, applyOperationMeta, applyPaginatedItemSchemas, applyParameterExtensions, applyRobodevModuleExtensions, applyRobodevUserRolesExtension, asStringArray, collectApiModelSchemaExports, collectContractSchemaRoots, collectContractSchemas, collectDbTableModelSchemaExport, collectDbTableModelSchemaExports, collectExtraSchemas, collectModelSchemaExports, collectModuleModelSchemaExports, collectOperationMeta, collectOperationTags, collectReachableModelSchemas, collectSchemaRegistryRoots, compactTagName, createModelSchemaNameGetter, createTinyOpenApiSourceRunner, defineOpenApiSchemas, findComponentEnumNames, findEnumNames, generateORPCOpenAPISpec, generateOpenApiFile, getComponentSchemas, getContractProcedureData, getDerivedOperationId, getModuleOpenApiController, getModuleOpenApiTag, getObjectPropertySchema, getOpenApiSchemaName, getOperationAction, getOperationController, getPaginatedItemSchema, getProcedureInputSchemaRole, getRobodevModuleRoles, getStringEnumValues, getLocalInputPath as getTinyOpenApiLocalInputPath, isContractProcedure, isNullSchema, isNullableOnlySchema, isObject, isProcedureMeta, isTinyOpenApiFakeMode, isZodSchema, modelSchemaExportName, modelSchemaNameEntries, namedControllerActionInputDtoSchema, namedControllerActionSchema, namedOpenApiOutputSchema, namedOpenApiRequestSchema, namedOpenApiResponseSchema, namedOpenApiSchema, normalizeWatchFolders as normalizeTinyOpenApiWatchFolders, operationKey, procedureSchemaName, resolveOpenApiOutputPath, routeHasPathParameters, schemaComponentRef, schemaExportName, sharedSchemaExportName, stripNoContentResponseBodies, toOpenAPI30Document, toOpenAPI30Schema, toOpenAPIAclRule, toPascalCase, visitZodSchema };
package/dist/vite.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { r as GenerateFileFormatter } from "./options-DtAnhCLZ.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-DFpV8mjG.mjs";
3
- import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-zPcbJwpP.mjs";
1
+ import { r as GenerateFileFormatter } from "./options-B47gUU4P.mjs";
2
+ import { t as OpenAPICodegenConfig } from "./config-mWuUhYNE.mjs";
3
+ import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-DmJoXvFj.mjs";
4
4
  import { Plugin, PluginOption } from "vite";
5
5
  //#region src/plugins/openapi-codegen.runner.d.ts
6
6
  type OpenApiCodegenPluginConfig = OpenAPICodegenConfig & {
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-BtaqQSH2.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-fS_gOezd.mjs";
2
2
  import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-BZ6ZLgRO.mjs";
3
3
  import path from "path";
4
4
  //#region src/vite/openapi-codegen.plugin.ts
package/package.json CHANGED
@@ -141,5 +141,5 @@
141
141
  "node": ">= 18"
142
142
  },
143
143
  "packageManager": "bun@1.3.14",
144
- "version": "3.2.0-rc.2"
144
+ "version": "3.2.0-rc.4"
145
145
  }