@povio/openapi-codegen-cli 3.2.0-rc.11 → 3.2.0-rc.12

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.
@@ -93,7 +93,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
93
93
  const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
94
94
  if (nativeFiles) return nativeFiles;
95
95
  }
96
- const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-D9W5BtAt.mjs").then((n) => n.n);
96
+ const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-DN2g91cW.mjs").then((n) => n.n);
97
97
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
98
98
  source: nativeInput.source,
99
99
  yaml: nativeInput.yaml
@@ -554,7 +554,8 @@ function getEnumZodSchema({ resolver, schema, zodSchema, meta, tag }) {
554
554
  return zodSchema.assign(`${namespacePrefix}${extractedEnumZodSchema.zodSchemaName}`);
555
555
  }
556
556
  function getEnumZodSchemaCode(schema) {
557
- return `${require_generate_utils.ENUM_SCHEMA}([${schema.enum?.map((value) => value === null ? "null" : `"${value}"`).join(", ")}])`;
557
+ const values = schema.enum?.filter((value) => value !== null) ?? [];
558
+ return `${require_generate_utils.ENUM_SCHEMA}([${values.map((value) => `"${value}"`).join(", ")}])`;
558
559
  }
559
560
  function getEnumZodSchemaCodeFromEnumNames(enumNames) {
560
561
  return `${require_generate_utils.ENUM_SCHEMA}([${enumNames.map((value) => `"${value}"`).join(", ")}])`;
@@ -2802,7 +2803,7 @@ function generateModels({ resolver, data, tag }) {
2802
2803
  for (const [key, code] of Object.entries(zodSchemas)) {
2803
2804
  const schemaRef = resolver.getRefByZodSchemaName(key);
2804
2805
  zodSchemasData[key] = {
2805
- code,
2806
+ code: resolver.options.modelsInModules ? code.replace(/\b[A-Z][A-Za-z0-9]*Models\./g, "") : code,
2806
2807
  isCircular: schemaRef ? resolver.isSchemaCircular(schemaRef) : false,
2807
2808
  isEnum: require_generate_utils.isEnumZodSchema(code),
2808
2809
  schemaObj: resolver.getZodSchemaObj(key)
@@ -1,4 +1,4 @@
1
- import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D8w0QElH.mjs";
1
+ import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-hQ6YoDgR.mjs";
2
2
  import { $ as getImportedAbilityFunctionName, A as getEndpointsImports, An as NATIVE_RESPONSE_TYPE, At as APP_REST_CLIENT_NAME, B as getPrefetchInfiniteQueryName, Bt as PACKAGE_IMPORT_PATH, C as getAppRestClientImportPath, Cn as ZOD_IMPORT, D as getTagFileName, Dn as AXIOS_REQUEST_CONFIG_TYPE, Dt as isEnumZodSchema, E as getQueryTypesImportPath, En as AXIOS_REQUEST_CONFIG_NAME, F as mergeImports, Ft as QUERY_MODULE_ENUM, G as getAbilityConditionType, H as getQueryName, Ht as getNamespaceName, I as getImportedInfiniteQueryName, In as shouldInlineEndpointsForTag, It as QUERY_OPTIONS_TYPES, J as getAbilityFunctionName, K as getAbilityConditionsTypes, L as getImportedQueryName, Ln as camelToSpaceSeparated, Lt as ZOD_EXTENDED, M as getInfiniteQueriesImports, Mt as DOMAIN_ERRORS_FILE, N as getModelsImports, Nn as getEndpointTag, Nt as MUTATION_EFFECTS, O as getTagImportPath, Ot as isNamedZodSchema, P as getQueriesImports, Pt as QUERY_MODULES_FILE, Q as getAppAbilitiesType, R as getInfiniteQueryName, Rn as capitalize, Rt as CONFIG_PACKAGE_IMPORT_PATH, T as getQueryModulesImportPath, Tn as AXIOS_IMPORT, U as getQueryOptionsName, V as getPrefetchQueryName, Vn as kebabToCamel, Vt as REST_PACKAGE_IMPORT_PATH, W as getAbilityAction, Wn as Profiler, X as getAbilitySubjectTypes, Y as getAbilitySubject, Z as getAclData, Zt as isParamMediaTypeAllowed, _ as hasEndpointConfig, _t as isReadAllEndpoint, an as wrapWithQuotesIfNeeded, at as getZodSchemaInferedTypeName, b as requiresBody, bt as invalidVariableNameCharactersToCamel, c as getDestructuredVariables, cn as isReferenceObject, ct as getSchemaDescriptions, d as isQuery, dt as DEFAULT_GENERATE_OPTIONS, et as hasAbilityConditions, f as getEndpointBody, fn as ANY_SCHEMA, ft as getPathSegments, g as getImportedEndpointName, gt as isPathSegmentParam, h as getEndpointPath, ht as isDeleteEndpoint, it as getZodSchemaDescription, j as getImportPath, jn as getRequestConfigTypeName, jt as BUILDERS_UTILS, k as getAclImports, kn as JSON_APPLICATION_FORMAT, kt as APP_REST_CLIENT_FILE, l as isInfiniteQuery, ln as isSchemaObject, m as getEndpointName, mt as isCreateEndpoint, n as shouldUseNativeCodegen, nt as getImportedZodSchemaInferedTypeName, ot as getZodSchemaPropertyDescriptions, p as getEndpointConfig, pt as isBulkDeleteEndpoint, q as getAbilityDescription, r as getOutputFileName, rt as getImportedZodSchemaName, st as getZodSchemaType, t as compileNativeData, tt as renderAclCheckCall, u as isMutation, ut as getUniqueArray, v as mapEndpointParamsToFunctionParams, vt as isReadEndpoint, w as getFileNameWithExtension, wn as AXIOS_DEFAULT_IMPORT_NAME, y as renderMediaUploadMutationBody, yt as isUpdateEndpoint, z as getInfiniteQueryOptionsName, zt as NATIVE_PACKAGE_IMPORT_PATH } from "./native-bindings-BTQGSGhU.mjs";
3
3
  import "node:module";
4
4
  //#region \0rolldown/runtime.js
@@ -824,7 +824,7 @@ function generateModels({ resolver, data, tag }) {
824
824
  for (const [key, code] of Object.entries(zodSchemas)) {
825
825
  const schemaRef = resolver.getRefByZodSchemaName(key);
826
826
  zodSchemasData[key] = {
827
- code,
827
+ code: resolver.options.modelsInModules ? code.replace(/\b[A-Z][A-Za-z0-9]*Models\./g, "") : code,
828
828
  isCircular: schemaRef ? resolver.isSchemaCircular(schemaRef) : false,
829
829
  isEnum: isEnumZodSchema(code),
830
830
  schemaObj: resolver.getZodSchemaObj(key)
@@ -1,7 +1,7 @@
1
- import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-D9W5BtAt.mjs";
2
- import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D8w0QElH.mjs";
1
+ import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-DN2g91cW.mjs";
2
+ import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-hQ6YoDgR.mjs";
3
3
  import { H as getQueryName, Ht as getNamespaceName, Mn as formatTag, O as getTagImportPath, S as getTsTypeBase, Xt as isMediaTypeAllowed, Zt as isParamMediaTypeAllowed, bt as invalidVariableNameCharactersToCamel, d as isQuery, dt as DEFAULT_GENERATE_OPTIONS, u as isMutation, x as getSchemaTsMetaType } from "./native-bindings-BTQGSGhU.mjs";
4
- import { t as getOpenApiDoc } from "./generate.runner-CD7mlcJ4.mjs";
4
+ import { t as getOpenApiDoc } from "./generate.runner-BgWuy2Tf.mjs";
5
5
  //#region src/generators/core/getMetadataFromOpenAPIDoc.ts
6
6
  async function getMetadataFromOpenAPIDoc(openApiDoc, options) {
7
7
  const { resolver, data } = await getDataFromOpenAPIDoc(openApiDoc, options);
@@ -592,7 +592,8 @@ function getEnumZodSchema({ resolver, schema, zodSchema, meta, tag }) {
592
592
  return zodSchema.assign(`${namespacePrefix}${extractedEnumZodSchema.zodSchemaName}`);
593
593
  }
594
594
  function getEnumZodSchemaCode(schema) {
595
- return `${ENUM_SCHEMA}([${schema.enum?.map((value) => value === null ? "null" : `"${value}"`).join(", ")}])`;
595
+ const values = schema.enum?.filter((value) => value !== null) ?? [];
596
+ return `${ENUM_SCHEMA}([${values.map((value) => `"${value}"`).join(", ")}])`;
596
597
  }
597
598
  function getEnumZodSchemaCodeFromEnumNames(enumNames) {
598
599
  return `${ENUM_SCHEMA}([${enumNames.map((value) => `"${value}"`).join(", ")}])`;
package/dist/metro.cjs CHANGED
@@ -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-DhI7CHeh.cjs"));
100
+ const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-CPXeK8nd.cjs"));
101
101
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
102
102
  source: nativeInput.source,
103
103
  yaml: nativeInput.yaml
package/dist/metro.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-C4TIXQNx.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-Cmx1wT2n.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,5 +1,5 @@
1
1
  import { Wn as Profiler } from "./native-bindings-BTQGSGhU.mjs";
2
- import { n as runGenerate } from "./generate.runner-CD7mlcJ4.mjs";
2
+ import { n as runGenerate } from "./generate.runner-BgWuy2Tf.mjs";
3
3
  import path from "path";
4
4
  //#region src/plugins/openapi-codegen.runner.ts
5
5
  function createOpenApiCodegenRunner(config, options = {}) {
package/dist/sh.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
- import { i as VALIDATION_ERROR_TYPE_TITLE, n as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D8w0QElH.mjs";
2
+ import { i as VALIDATION_ERROR_TYPE_TITLE, n as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-hQ6YoDgR.mjs";
3
3
  import { D as getTagFileName, Wn as Profiler, r as getOutputFileName } from "./native-bindings-BTQGSGhU.mjs";
4
- import { n as runGenerate, r as resolveConfig, t as getOpenApiDoc } from "./generate.runner-CD7mlcJ4.mjs";
4
+ import { n as runGenerate, r as resolveConfig, t as getOpenApiDoc } from "./generate.runner-BgWuy2Tf.mjs";
5
5
  import yargs from "yargs";
6
6
  import { hideBin } from "yargs/helpers";
7
7
  import { styleText } from "node:util";
@@ -32,7 +32,7 @@ function logBanner(message) {
32
32
  * Fetch the version from package.json
33
33
  */
34
34
  function getVersion() {
35
- return "3.2.0-rc.11";
35
+ return "3.2.0-rc.12";
36
36
  }
37
37
  //#endregion
38
38
  //#region src/helpers/yargs.helper.ts
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-C4TIXQNx.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-Cmx1wT2n.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
@@ -186,5 +186,5 @@
186
186
  "node": ">= 18"
187
187
  },
188
188
  "packageManager": "bun@1.3.14",
189
- "version": "3.2.0-rc.11"
189
+ "version": "3.2.0-rc.12"
190
190
  }