@povio/openapi-codegen-cli 4.0.0-rc.5 → 4.0.0-rc.6

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-B7-eMFcv.mjs";
1
+ import { t as GenerateOptions } from "./options-DQabDsdb.mjs";
2
2
  //#region src/generators/types/config.d.ts
3
3
  type OpenAPICodegenConfig = Partial<GenerateOptions>;
4
4
  //#endregion
@@ -106,6 +106,8 @@ const removeWord = (source, wordToRemove) => {
106
106
  const pattern = new RegExp(`(${decapitalize(singularWordToRemove)}|${capitalize(singularWordToRemove)})[a-z]*(?=$|[A-Z])`, "g");
107
107
  return source.replace(pattern, "");
108
108
  };
109
+ /** Removes spaces and tabs at the end of every line (formatters such as `bun fmt` keep them in comments). */
110
+ const trimTrailingWhitespace = (text) => text.replace(/[ \t]+$/gm, "");
109
111
  //#endregion
110
112
  //#region src/generators/utils/tag.utils.ts
111
113
  const formattedTagCache = /* @__PURE__ */ new Map();
@@ -1427,7 +1429,10 @@ function generateFilesFromNativeOpenAPI(source, yaml, options) {
1427
1429
  if (!options.restClientImportPath) files.push(outputFile(options, "app-rest-client.ts", `import { ${options.restClient === "native" ? "NativeRestClient" : "RestClient"} } from "@povio/openapi-codegen-cli${options.restClient === "native" ? "/native" : "/axios"}";\n\nexport const AppRestClient = new ${options.restClient === "native" ? "NativeRestClient" : "RestClient"}({\n config: {\n baseURL: "${nativeData.baseUrl}"\n },\n});\n`));
1428
1430
  if (nativeData.renderedShared.domainErrors) files.push(outputFile(options, "domain-errors.ts", nativeData.renderedShared.domainErrors));
1429
1431
  }
1430
- return files;
1432
+ return files.map((file) => ({
1433
+ ...file,
1434
+ content: trimTrailingWhitespace(file.content)
1435
+ }));
1431
1436
  }
1432
1437
  function supportsCompleteNativeRender(options) {
1433
1438
  return options.splitByTags && !options.inlineEndpoints && (options.workspaceContext?.length ?? 0) === 0;
@@ -1474,7 +1479,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
1474
1479
  const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
1475
1480
  if (nativeFiles) return nativeFiles;
1476
1481
  }
1477
- const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-B7VWwIbb.mjs").then((n) => n.n);
1482
+ const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-CW9i6U7J.mjs").then((n) => n.n);
1478
1483
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
1479
1484
  source: nativeInput.source,
1480
1485
  yaml: nativeInput.yaml
@@ -1562,4 +1567,4 @@ function getGenerateStats(filesData, config) {
1562
1567
  };
1563
1568
  }
1564
1569
  //#endregion
1565
- export { getParamZodSchemaName as $, AXIOS_DEFAULT_IMPORT_NAME as $t, getAbilityConditionType as A, pathParamToVariableName as At, getImportedZodSchemaInferedTypeName as B, ALLOWED_PATH_IN as Bt, getTagFileName as C, isErrorStatus as Ct, getImportPath as D, isPathExcluded as Dt, getEndpointsImports as E, isParamMediaTypeAllowed as Et, getAbilitySubjectTypes as F, inferRequiredSchema as Ft, getZodSchemaType as G, ENUM_SCHEMA as Gt, getZodSchemaDescription as H, BLOB_SCHEMA as Ht, getAclData as I, isArraySchemaObject as It, getUniqueArray as J, STRING_SCHEMA as Jt, getSchemaDescriptions as K, INT_SCHEMA as Kt, getAppAbilitiesType as L, isReferenceObject as Lt, getAbilityDescription as M, replaceHyphenatedPath as Mt, getAbilityFunctionName as N, unwrapQuotesIfNeeded as Nt, getModelsImports as O, isPrimitiveType as Ot, getAbilitySubject as P, wrapWithQuotesIfNeeded as Pt, getEnumZodSchemaName as Q, ZOD_IMPORT as Qt, hasAbilityConditions as R, isSchemaObject as Rt, getQueryTypesImportPath as S, getSchemaRef as St, getAclImports as T, isMediaTypeAllowed as Tt, getZodSchemaInferedTypeName as U, DATETIME_SCHEMA as Ut, getImportedZodSchemaName as V, ANY_SCHEMA as Vt, getZodSchemaPropertyDescriptions as W, EMAIL_SCHEMA as Wt, invalidVariableNameCharactersToCamel as X, UUID_SCHEMA as Xt, DEFAULT_GENERATE_OPTIONS as Y, URL_SCHEMA as Yt, getBodyZodSchemaName as Z, VOID_SCHEMA as Zt, getSchemaTsMetaType as _, Profiler as _n, getNamespaceName as _t, resolveConfig as a, NATIVE_RESPONSE_TYPE as an, APP_REST_CLIENT_FILE as at, getFileNameWithExtension as b, getParameterEnumNames as bt, getEndpointBody as c, getEndpointTag as cn, MUTATION_EFFECTS as ct, getEndpointPath as d, shouldInlineEndpointsForTag as dn, QUERY_OPTIONS_TYPES as dt, AXIOS_IMPORT as en, getResponseZodSchemaName as et, getImportedEndpointName as f, capitalize as fn, ZOD_EXTENDED as ft, requiresBody as g, snakeToCamel as gn, REST_PACKAGE_IMPORT_PATH as gt, renderMediaUploadMutationBody as h, removeWord as hn, NATIVE_PACKAGE_IMPORT_PATH as ht, shouldUseNativeCodegen as i, JSON_APPLICATION_FORMAT as in, isNamedZodSchema as it, getAbilityConditionsTypes as j, pathToVariableName as jt, getAbilityAction as k, isSortingParameterObject as kt, getEndpointConfig as l, getOperationTag as ln, QUERY_MODULES_FILE as lt, mapEndpointParamsToFunctionParams as m, getMostCommonAdjacentCombinationSplit as mn, CONFIG_PACKAGE_IMPORT_PATH as mt, runGenerate as n, AXIOS_REQUEST_CONFIG_TYPE as nn, getZodSchemaOperationName as nt, getOutputFileName as o, getRequestConfigTypeName as on, APP_REST_CLIENT_NAME as ot, hasEndpointConfig as p, decapitalize as pn, AXIOS_PACKAGE_IMPORT_PATH as pt, iterateSchema as q, NUMBER_SCHEMA as qt, compileNativeData as r, BODY_PARAMETER_NAME as rn, isEnumZodSchema as rt, pick as s, formatTag as sn, DOMAIN_ERRORS_FILE as st, getOpenApiDoc as t, AXIOS_REQUEST_CONFIG_NAME as tn, getZodSchemaName as tt, getEndpointName as u, isTagIncluded as un, QUERY_MODULE_ENUM as ut, getTsTypeBase as v, autocorrectRef as vt, getTagImportPath as w, isMainResponseStatus as wt, getQueryModulesImportPath as x, getSchemaNameByRef as xt, getAppRestClientImportPath as y, escapeControlCharacters as yt, renderAclCheckCall as z, ALLOWED_METHODS as zt };
1570
+ export { getParamZodSchemaName as $, AXIOS_DEFAULT_IMPORT_NAME as $t, getAbilityConditionType as A, pathParamToVariableName as At, getImportedZodSchemaInferedTypeName as B, ALLOWED_PATH_IN as Bt, getTagFileName as C, isErrorStatus as Ct, getImportPath as D, isPathExcluded as Dt, getEndpointsImports as E, isParamMediaTypeAllowed as Et, getAbilitySubjectTypes as F, inferRequiredSchema as Ft, getZodSchemaType as G, ENUM_SCHEMA as Gt, getZodSchemaDescription as H, BLOB_SCHEMA as Ht, getAclData as I, isArraySchemaObject as It, getUniqueArray as J, STRING_SCHEMA as Jt, getSchemaDescriptions as K, INT_SCHEMA as Kt, getAppAbilitiesType as L, isReferenceObject as Lt, getAbilityDescription as M, replaceHyphenatedPath as Mt, getAbilityFunctionName as N, unwrapQuotesIfNeeded as Nt, getModelsImports as O, isPrimitiveType as Ot, getAbilitySubject as P, wrapWithQuotesIfNeeded as Pt, getEnumZodSchemaName as Q, ZOD_IMPORT as Qt, hasAbilityConditions as R, isSchemaObject as Rt, getQueryTypesImportPath as S, getSchemaRef as St, getAclImports as T, isMediaTypeAllowed as Tt, getZodSchemaInferedTypeName as U, DATETIME_SCHEMA as Ut, getImportedZodSchemaName as V, ANY_SCHEMA as Vt, getZodSchemaPropertyDescriptions as W, EMAIL_SCHEMA as Wt, invalidVariableNameCharactersToCamel as X, UUID_SCHEMA as Xt, DEFAULT_GENERATE_OPTIONS as Y, URL_SCHEMA as Yt, getBodyZodSchemaName as Z, VOID_SCHEMA as Zt, getSchemaTsMetaType as _, trimTrailingWhitespace as _n, getNamespaceName as _t, resolveConfig as a, NATIVE_RESPONSE_TYPE as an, APP_REST_CLIENT_FILE as at, getFileNameWithExtension as b, getParameterEnumNames as bt, getEndpointBody as c, getEndpointTag as cn, MUTATION_EFFECTS as ct, getEndpointPath as d, shouldInlineEndpointsForTag as dn, QUERY_OPTIONS_TYPES as dt, AXIOS_IMPORT as en, getResponseZodSchemaName as et, getImportedEndpointName as f, capitalize as fn, ZOD_EXTENDED as ft, requiresBody as g, snakeToCamel as gn, REST_PACKAGE_IMPORT_PATH as gt, renderMediaUploadMutationBody as h, removeWord as hn, NATIVE_PACKAGE_IMPORT_PATH as ht, shouldUseNativeCodegen as i, JSON_APPLICATION_FORMAT as in, isNamedZodSchema as it, getAbilityConditionsTypes as j, pathToVariableName as jt, getAbilityAction as k, isSortingParameterObject as kt, getEndpointConfig as l, getOperationTag as ln, QUERY_MODULES_FILE as lt, mapEndpointParamsToFunctionParams as m, getMostCommonAdjacentCombinationSplit as mn, CONFIG_PACKAGE_IMPORT_PATH as mt, runGenerate as n, AXIOS_REQUEST_CONFIG_TYPE as nn, getZodSchemaOperationName as nt, getOutputFileName as o, getRequestConfigTypeName as on, APP_REST_CLIENT_NAME as ot, hasEndpointConfig as p, decapitalize as pn, AXIOS_PACKAGE_IMPORT_PATH as pt, iterateSchema as q, NUMBER_SCHEMA as qt, compileNativeData as r, BODY_PARAMETER_NAME as rn, isEnumZodSchema as rt, pick as s, formatTag as sn, DOMAIN_ERRORS_FILE as st, getOpenApiDoc as t, AXIOS_REQUEST_CONFIG_NAME as tn, getZodSchemaName as tt, getEndpointName as u, isTagIncluded as un, QUERY_MODULE_ENUM as ut, getTsTypeBase as v, Profiler as vn, autocorrectRef as vt, getTagImportPath as w, isMainResponseStatus as wt, getQueryModulesImportPath as x, getSchemaNameByRef as xt, getAppRestClientImportPath as y, escapeControlCharacters as yt, renderAclCheckCall as z, ALLOWED_METHODS as zt };
@@ -462,6 +462,8 @@ const removeWord = (source, wordToRemove) => {
462
462
  const pattern = new RegExp(`(${decapitalize(singularWordToRemove)}|${capitalize(singularWordToRemove)})[a-z]*(?=$|[A-Z])`, "g");
463
463
  return source.replace(pattern, "");
464
464
  };
465
+ /** Removes spaces and tabs at the end of every line (formatters such as `bun fmt` keep them in comments). */
466
+ const trimTrailingWhitespace = (text) => text.replace(/[ \t]+$/gm, "");
465
467
  //#endregion
466
468
  //#region src/generators/utils/array.utils.ts
467
469
  const getUniqueArray = (...arrs) => [...new Set(arrs.flat())];
@@ -1984,6 +1986,12 @@ Object.defineProperty(exports, "snakeToCamel", {
1984
1986
  return snakeToCamel;
1985
1987
  }
1986
1988
  });
1989
+ Object.defineProperty(exports, "trimTrailingWhitespace", {
1990
+ enumerable: true,
1991
+ get: function() {
1992
+ return trimTrailingWhitespace;
1993
+ }
1994
+ });
1987
1995
  Object.defineProperty(exports, "unwrapQuotesIfNeeded", {
1988
1996
  enumerable: true,
1989
1997
  get: function() {
@@ -1,4 +1,4 @@
1
- const require_generate_utils = require("./generate.utils-BFeGvk98.cjs");
1
+ const require_generate_utils = require("./generate.utils-yHZiQdu7.cjs");
2
2
  let openapi_types = require("openapi-types");
3
3
  //#region src/generators/const/acl.const.ts
4
4
  const ACL_APP_ABILITY_FILE = {
@@ -3815,7 +3815,10 @@ function generateCodeFromOpenAPIDoc(openApiDoc, options, profiler, nativeSource)
3815
3815
  });
3816
3816
  });
3817
3817
  if (!modelsOnly) generateFilesData.push(...p.runSync("render.AclShared", () => getAclFiles(data, resolver)), ...p.runSync("render.MutationEffects", () => getMutationEffectsFiles(data, resolver)), ...p.runSync("render.ZodExtended", () => getZodExtendedFiles(data, resolver)), ...p.runSync("render.Standalone", () => getAppRestClientFiles(resolver)), ...p.runSync("render.DomainErrors", () => getDomainErrorsFiles(data, resolver)));
3818
- return generateFilesData;
3818
+ return generateFilesData.map((file) => ({
3819
+ ...file,
3820
+ content: require_generate_utils.trimTrailingWhitespace(file.content)
3821
+ }));
3819
3822
  }
3820
3823
  //#endregion
3821
3824
  exports.generateCodeFromOpenAPIDoc = generateCodeFromOpenAPIDoc;
@@ -1,5 +1,5 @@
1
- import { a as isQuery, i as isMutation, n as getDestructuredVariables, r as isInfiniteQuery, s as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-C0iehdg8.mjs";
2
- import { $t as AXIOS_DEFAULT_IMPORT_NAME, A as getAbilityConditionType, B as getImportedZodSchemaInferedTypeName, C as getTagFileName, D as getImportPath, E as getEndpointsImports, Et as isParamMediaTypeAllowed, F as getAbilitySubjectTypes, G as getZodSchemaType, H as getZodSchemaDescription, I as getAclData, J as getUniqueArray, K as getSchemaDescriptions, L as getAppAbilitiesType, Lt as isReferenceObject, M as getAbilityDescription, N as getAbilityFunctionName, O as getModelsImports, P as getAbilitySubject, Pt as wrapWithQuotesIfNeeded, Qt as ZOD_IMPORT, R as hasAbilityConditions, Rt as isSchemaObject, S as getQueryTypesImportPath, T as getAclImports, U as getZodSchemaInferedTypeName, V as getImportedZodSchemaName, W as getZodSchemaPropertyDescriptions, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _n as Profiler, _t as getNamespaceName, an as NATIVE_RESPONSE_TYPE, at as APP_REST_CLIENT_FILE, b as getFileNameWithExtension, c as getEndpointBody, cn as getEndpointTag, ct as MUTATION_EFFECTS, d as getEndpointPath, dn as shouldInlineEndpointsForTag, dt as QUERY_OPTIONS_TYPES, en as AXIOS_IMPORT, f as getImportedEndpointName, fn as capitalize, ft as ZOD_EXTENDED, g as requiresBody, gn as snakeToCamel, gt as REST_PACKAGE_IMPORT_PATH, h as renderMediaUploadMutationBody, ht as NATIVE_PACKAGE_IMPORT_PATH, i as shouldUseNativeCodegen, it as isNamedZodSchema, j as getAbilityConditionsTypes, k as getAbilityAction, l as getEndpointConfig, lt as QUERY_MODULES_FILE, m as mapEndpointParamsToFunctionParams, mt as CONFIG_PACKAGE_IMPORT_PATH, nn as AXIOS_REQUEST_CONFIG_TYPE, o as getOutputFileName, on as getRequestConfigTypeName, ot as APP_REST_CLIENT_NAME, p as hasEndpointConfig, pt as AXIOS_PACKAGE_IMPORT_PATH, r as compileNativeData, rt as isEnumZodSchema, st as DOMAIN_ERRORS_FILE, tn as AXIOS_REQUEST_CONFIG_NAME, u as getEndpointName, ut as QUERY_MODULE_ENUM, w as getTagImportPath, x as getQueryModulesImportPath, y as getAppRestClientImportPath, z as renderAclCheckCall } from "./generate.runner-LDL6Lbgl.mjs";
1
+ import { a as isQuery, i as isMutation, n as getDestructuredVariables, r as isInfiniteQuery, s as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D0C-UY3I.mjs";
2
+ import { $t as AXIOS_DEFAULT_IMPORT_NAME, A as getAbilityConditionType, B as getImportedZodSchemaInferedTypeName, C as getTagFileName, D as getImportPath, E as getEndpointsImports, Et as isParamMediaTypeAllowed, F as getAbilitySubjectTypes, G as getZodSchemaType, H as getZodSchemaDescription, I as getAclData, J as getUniqueArray, K as getSchemaDescriptions, L as getAppAbilitiesType, Lt as isReferenceObject, M as getAbilityDescription, N as getAbilityFunctionName, O as getModelsImports, P as getAbilitySubject, Pt as wrapWithQuotesIfNeeded, Qt as ZOD_IMPORT, R as hasAbilityConditions, Rt as isSchemaObject, S as getQueryTypesImportPath, T as getAclImports, U as getZodSchemaInferedTypeName, V as getImportedZodSchemaName, W as getZodSchemaPropertyDescriptions, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _n as trimTrailingWhitespace, _t as getNamespaceName, an as NATIVE_RESPONSE_TYPE, at as APP_REST_CLIENT_FILE, b as getFileNameWithExtension, c as getEndpointBody, cn as getEndpointTag, ct as MUTATION_EFFECTS, d as getEndpointPath, dn as shouldInlineEndpointsForTag, dt as QUERY_OPTIONS_TYPES, en as AXIOS_IMPORT, f as getImportedEndpointName, fn as capitalize, ft as ZOD_EXTENDED, g as requiresBody, gn as snakeToCamel, gt as REST_PACKAGE_IMPORT_PATH, h as renderMediaUploadMutationBody, ht as NATIVE_PACKAGE_IMPORT_PATH, i as shouldUseNativeCodegen, it as isNamedZodSchema, j as getAbilityConditionsTypes, k as getAbilityAction, l as getEndpointConfig, lt as QUERY_MODULES_FILE, m as mapEndpointParamsToFunctionParams, mt as CONFIG_PACKAGE_IMPORT_PATH, nn as AXIOS_REQUEST_CONFIG_TYPE, o as getOutputFileName, on as getRequestConfigTypeName, ot as APP_REST_CLIENT_NAME, p as hasEndpointConfig, pt as AXIOS_PACKAGE_IMPORT_PATH, r as compileNativeData, rt as isEnumZodSchema, st as DOMAIN_ERRORS_FILE, tn as AXIOS_REQUEST_CONFIG_NAME, u as getEndpointName, ut as QUERY_MODULE_ENUM, vn as Profiler, w as getTagImportPath, x as getQueryModulesImportPath, y as getAppRestClientImportPath, z as renderAclCheckCall } from "./generate.runner-DVW9l3P3.mjs";
3
3
  import "node:module";
4
4
  //#region \0rolldown/runtime.js
5
5
  var __defProp = Object.defineProperty;
@@ -1816,7 +1816,10 @@ function generateCodeFromOpenAPIDoc(openApiDoc, options, profiler, nativeSource)
1816
1816
  });
1817
1817
  });
1818
1818
  if (!modelsOnly) generateFilesData.push(...p.runSync("render.AclShared", () => getAclFiles(data, resolver)), ...p.runSync("render.MutationEffects", () => getMutationEffectsFiles(data, resolver)), ...p.runSync("render.ZodExtended", () => getZodExtendedFiles(data, resolver)), ...p.runSync("render.Standalone", () => getAppRestClientFiles(resolver)), ...p.runSync("render.DomainErrors", () => getDomainErrorsFiles(data, resolver)));
1819
- return generateFilesData;
1819
+ return generateFilesData.map((file) => ({
1820
+ ...file,
1821
+ content: trimTrailingWhitespace(file.content)
1822
+ }));
1820
1823
  }
1821
1824
  //#endregion
1822
1825
  export { generateCodeFromOpenAPIDoc_exports as n, getQueryName as r, generateCodeFromOpenAPIDoc as t };
@@ -1,4 +1,4 @@
1
- import { n as GenerateFileData, t as GenerateOptions } from "./options-B7-eMFcv.mjs";
1
+ import { t as GenerateOptions } from "./options-DQabDsdb.mjs";
2
2
  import { OpenAPIV3 } from "openapi-types";
3
3
  //#region src/generators/types/metadata.d.ts
4
4
  interface GenerateParams {
@@ -53,6 +53,9 @@ interface GenerateMetadata {
53
53
  //#endregion
54
54
  //#region src/generator.d.ts
55
55
  declare function getGenerateMetadata({ input, options: genOptions }: GenerateParams): Promise<GenerateMetadata>;
56
- declare function getGenerateFilesData({ input, options: genOptions }: GenerateParams): Promise<GenerateFileData[]>;
56
+ declare function getGenerateFilesData({ input, options: genOptions }: GenerateParams): Promise<{
57
+ fileName: string;
58
+ content: string;
59
+ }[]>;
57
60
  //#endregion
58
61
  export { getGenerateFilesData, getGenerateMetadata };
@@ -1,6 +1,6 @@
1
- import { r as getQueryName, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-B7VWwIbb.mjs";
2
- import { a as isQuery, i as isMutation, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-C0iehdg8.mjs";
3
- import { Et as isParamMediaTypeAllowed, Tt as isMediaTypeAllowed, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _ as getSchemaTsMetaType, _t as getNamespaceName, sn as formatTag, t as getOpenApiDoc, v as getTsTypeBase, w as getTagImportPath } from "./generate.runner-LDL6Lbgl.mjs";
1
+ import { r as getQueryName, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-CW9i6U7J.mjs";
2
+ import { a as isQuery, i as isMutation, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D0C-UY3I.mjs";
3
+ import { Et as isParamMediaTypeAllowed, Tt as isMediaTypeAllowed, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _ as getSchemaTsMetaType, _t as getNamespaceName, sn as formatTag, t as getOpenApiDoc, v as getTsTypeBase, w as getTagImportPath } from "./generate.runner-DVW9l3P3.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 { $ as getParamZodSchemaName, At as pathParamToVariableName, Bt as ALLOWED_PATH_IN, Ct as isErrorStatus, Dt as isPathExcluded, Et as isParamMediaTypeAllowed, Ft as inferRequiredSchema, Gt as ENUM_SCHEMA, Ht as BLOB_SCHEMA, It as isArraySchemaObject, J as getUniqueArray, Jt as STRING_SCHEMA, Kt as INT_SCHEMA, Lt as isReferenceObject, Mt as replaceHyphenatedPath, Nt as unwrapQuotesIfNeeded, Ot as isPrimitiveType, Pt as wrapWithQuotesIfNeeded, Q as getEnumZodSchemaName, Rt as isSchemaObject, St as getSchemaRef, Tt as isMediaTypeAllowed, Ut as DATETIME_SCHEMA, Vt as ANY_SCHEMA, Wt as EMAIL_SCHEMA, X as invalidVariableNameCharactersToCamel, Xt as UUID_SCHEMA, Yt as URL_SCHEMA, Z as getBodyZodSchemaName, Zt as VOID_SCHEMA, _n as Profiler, _t as getNamespaceName, bt as getParameterEnumNames, cn as getEndpointTag, et as getResponseZodSchemaName, fn as capitalize, gn as snakeToCamel, hn as removeWord, in as JSON_APPLICATION_FORMAT, it as isNamedZodSchema, jt as pathToVariableName, kt as isSortingParameterObject, ln as getOperationTag, m as mapEndpointParamsToFunctionParams, mn as getMostCommonAdjacentCombinationSplit, nt as getZodSchemaOperationName, pn as decapitalize, q as iterateSchema, qt as NUMBER_SCHEMA, rn as BODY_PARAMETER_NAME, s as pick, sn as formatTag, tt as getZodSchemaName, un as isTagIncluded, vt as autocorrectRef, wt as isMainResponseStatus, xt as getSchemaNameByRef, yt as escapeControlCharacters, zt as ALLOWED_METHODS } from "./generate.runner-LDL6Lbgl.mjs";
1
+ import { $ as getParamZodSchemaName, At as pathParamToVariableName, Bt as ALLOWED_PATH_IN, Ct as isErrorStatus, Dt as isPathExcluded, Et as isParamMediaTypeAllowed, Ft as inferRequiredSchema, Gt as ENUM_SCHEMA, Ht as BLOB_SCHEMA, It as isArraySchemaObject, J as getUniqueArray, Jt as STRING_SCHEMA, Kt as INT_SCHEMA, Lt as isReferenceObject, Mt as replaceHyphenatedPath, Nt as unwrapQuotesIfNeeded, Ot as isPrimitiveType, Pt as wrapWithQuotesIfNeeded, Q as getEnumZodSchemaName, Rt as isSchemaObject, St as getSchemaRef, Tt as isMediaTypeAllowed, Ut as DATETIME_SCHEMA, Vt as ANY_SCHEMA, Wt as EMAIL_SCHEMA, X as invalidVariableNameCharactersToCamel, Xt as UUID_SCHEMA, Yt as URL_SCHEMA, Z as getBodyZodSchemaName, Zt as VOID_SCHEMA, _t as getNamespaceName, bt as getParameterEnumNames, cn as getEndpointTag, et as getResponseZodSchemaName, fn as capitalize, gn as snakeToCamel, hn as removeWord, in as JSON_APPLICATION_FORMAT, it as isNamedZodSchema, jt as pathToVariableName, kt as isSortingParameterObject, ln as getOperationTag, m as mapEndpointParamsToFunctionParams, mn as getMostCommonAdjacentCombinationSplit, nt as getZodSchemaOperationName, pn as decapitalize, q as iterateSchema, qt as NUMBER_SCHEMA, rn as BODY_PARAMETER_NAME, s as pick, sn as formatTag, tt as getZodSchemaName, un as isTagIncluded, vn as Profiler, vt as autocorrectRef, wt as isMainResponseStatus, xt as getSchemaNameByRef, yt as escapeControlCharacters, zt as ALLOWED_METHODS } from "./generate.runner-DVW9l3P3.mjs";
2
2
  import { OpenAPIV3 } from "openapi-types";
3
3
  //#region src/generators/const/validation.const.ts
4
4
  const HTTP_STATUS_CODES = {
package/dist/index.d.mts CHANGED
@@ -5,7 +5,7 @@ import { a as RestClient, i as Response, n as RequestConfig, o as RestIntercepto
5
5
  import { n as useWorkspaceContext, r as OpenApiRouter, t as OpenApiWorkspaceContext } from "./workspace.context-isVY9ves.mjs";
6
6
  import { a as MergedMutationVariables, c as OpenApiQueryConfig, i as MergedMutationValues, l as QueryModule, n as InvalidationMapFunc, o as MutationEffectsOf, r as MergedMutationData, s as MutationEffectsTypes, t as InvalidationMap, u as RegisteredQueryModule } from "./queryConfig.context-DwVQWbtL.mjs";
7
7
  import { t as RestUtils } from "./rest.utils-DpiFIdhF.mjs";
8
- import { t as OpenAPICodegenConfig } from "./config-D8ANLlqk.mjs";
8
+ import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
9
9
  import { d as TransportResponse, l as TransportRequest, n as HttpError, p as UploadProgress, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
10
10
  import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-DZxdDcpz.mjs";
11
11
  import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-I4y5WUkj.mjs";
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-BFeGvk98.cjs");
2
+ const require_generate_utils = require("./generate.utils-yHZiQdu7.cjs");
3
3
  let fs = require("fs");
4
4
  fs = require_generate_utils.__toESM(fs, 1);
5
5
  let path = require("path");
@@ -56,7 +56,10 @@ function generateFilesFromNativeOpenAPI(source, yaml, options) {
56
56
  if (!options.restClientImportPath) files.push(outputFile(options, "app-rest-client.ts", `import { ${options.restClient === "native" ? "NativeRestClient" : "RestClient"} } from "@povio/openapi-codegen-cli${options.restClient === "native" ? "/native" : "/axios"}";\n\nexport const AppRestClient = new ${options.restClient === "native" ? "NativeRestClient" : "RestClient"}({\n config: {\n baseURL: "${nativeData.baseUrl}"\n },\n});\n`));
57
57
  if (nativeData.renderedShared.domainErrors) files.push(outputFile(options, "domain-errors.ts", nativeData.renderedShared.domainErrors));
58
58
  }
59
- return files;
59
+ return files.map((file) => ({
60
+ ...file,
61
+ content: require_generate_utils.trimTrailingWhitespace(file.content)
62
+ }));
60
63
  }
61
64
  function supportsCompleteNativeRender(options) {
62
65
  return options.splitByTags && !options.inlineEndpoints && (options.workspaceContext?.length ?? 0) === 0;
@@ -103,7 +106,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
103
106
  const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
104
107
  if (nativeFiles) return nativeFiles;
105
108
  }
106
- const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-CpAdx6I3.cjs"));
109
+ const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-BCtqmKj6.cjs"));
107
110
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
108
111
  source: nativeInput.source,
109
112
  yaml: nativeInput.yaml
package/dist/metro.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { r as GenerateFileFormatter } from "./options-B7-eMFcv.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-D8ANLlqk.mjs";
3
- import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-DES1kzvS.mjs";
1
+ import { n as GenerateFileFormatter } from "./options-DQabDsdb.mjs";
2
+ import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
3
+ import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-CqnGK_rg.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-CmW9oZdT.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-DmN78sag.mjs";
2
2
  import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-DPUNTduQ.mjs";
3
3
  import fs from "fs";
4
4
  import path from "path";
@@ -1,4 +1,4 @@
1
- import { _n as Profiler, n as runGenerate } from "./generate.runner-LDL6Lbgl.mjs";
1
+ import { n as runGenerate, vn as Profiler } from "./generate.runner-DVW9l3P3.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-D8ANLlqk.mjs";
1
+ import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
2
2
  //#region src/tiny/openapi.d.ts
3
3
  interface GenerateOpenApiFileOptions {
4
4
  argv?: readonly string[];
@@ -98,4 +98,4 @@ interface BaseGenerateOptions {
98
98
  }
99
99
  interface GenerateOptions extends BaseGenerateOptions, ZodGenerateOptions, EndpointsGenerateOptions, QueriesGenerateOptions, InfiniteQueriesGenerateOptions, ACLGenerateOptions {}
100
100
  //#endregion
101
- export { GenerateFileData as n, GenerateFileFormatter as r, GenerateOptions as t };
101
+ export { GenerateFileFormatter as n, GenerateOptions as t };
package/dist/sh.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
- import { c as VALIDATION_ERROR_TYPE_TITLE, o as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-C0iehdg8.mjs";
3
- import { C as getTagFileName, _n as Profiler, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc } from "./generate.runner-LDL6Lbgl.mjs";
2
+ import { c as VALIDATION_ERROR_TYPE_TITLE, o as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D0C-UY3I.mjs";
3
+ import { C as getTagFileName, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc, vn as Profiler } from "./generate.runner-DVW9l3P3.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 "4.0.0-rc.5";
34
+ return "4.0.0-rc.6";
35
35
  }
36
36
  //#endregion
37
37
  //#region src/helpers/yargs.helper.ts
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-DES1kzvS.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-CqnGK_rg.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-B7-eMFcv.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-D8ANLlqk.mjs";
3
- import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-DES1kzvS.mjs";
1
+ import { n as GenerateFileFormatter } from "./options-DQabDsdb.mjs";
2
+ import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
3
+ import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-CqnGK_rg.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-CmW9oZdT.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-DmN78sag.mjs";
2
2
  import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-DPUNTduQ.mjs";
3
3
  import path from "path";
4
4
  //#region src/vite/openapi-codegen.plugin.ts
package/package.json CHANGED
@@ -187,5 +187,5 @@
187
187
  "node": ">= 18"
188
188
  },
189
189
  "packageManager": "bun@1.4.4",
190
- "version": "4.0.0-rc.5"
190
+ "version": "4.0.0-rc.6"
191
191
  }