@povio/openapi-codegen-cli 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/{generate.runner-BD9BbYIx.mjs → generate.runner-Cdv3h6-o.mjs} +11 -6
- package/dist/{generate.utils-BqlgVd-i.cjs → generate.utils-3gEG3cUe.cjs} +5 -5
- package/dist/{generateCodeFromOpenAPIDoc-idp1RVDa.mjs → generateCodeFromOpenAPIDoc-C1L8i0qt.mjs} +5 -5
- package/dist/{generateCodeFromOpenAPIDoc-CkVgg5Zy.cjs → generateCodeFromOpenAPIDoc-D7670R9U.cjs} +4 -4
- package/dist/generator.mjs +3 -3
- package/dist/{getDataFromOpenAPIDoc-Cyrm3VKA.mjs → getDataFromOpenAPIDoc-BeEB6M3K.mjs} +1 -1
- package/dist/metro.cjs +7 -2
- package/dist/metro.mjs +1 -1
- package/dist/openapi-codegen-native-darwin-arm64.node +0 -0
- package/dist/openapi-codegen-native-linux-x64.node +0 -0
- package/dist/openapi-codegen-native-win32-x64.node +0 -0
- package/dist/{openapi-codegen.runner-BZH4V6rq.mjs → openapi-codegen.runner-QIabSZVk.mjs} +1 -1
- package/dist/sh.mjs +3 -3
- package/dist/vite.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -159,6 +159,10 @@ Set `OPENAPI_CODEGEN_NATIVE=0` to force the TypeScript path, or `OPENAPI_CODEGEN
|
|
|
159
159
|
|
|
160
160
|
Release packages include native binaries for Linux x64, macOS arm64, and Windows x64. Build a binary for the current platform with `bun run build:native`.
|
|
161
161
|
|
|
162
|
+
Run `bun run test:parity` after building the addon to compare every generated file across 64 layout combinations and representative values for every other renderer option. The matrix uses both `test/petstore.yaml` and `test/configuration.yaml`, exercises complete native and hybrid native generation, and loads generated models to check runtime references. The contradictory combination `modelsInCommon: true` with `modelsInModules: true` is rejected explicitly. Arbitrary strings and lists are covered by representative cases, not every possible value.
|
|
163
|
+
|
|
164
|
+
The separate Renderer parity workflow generates this matrix with JavaScript and native on Linux and macOS, then compares exact file lists and SHA-256 hashes. Artifacts include route reports identifying complete versus hybrid native generation. Runner integration tests cover input/output, stale-file cleanup, and unchanged files; `incremental` is currently retained as a compatibility option and does not change the writer's unchanged-file optimization.
|
|
165
|
+
|
|
162
166
|
## Common Issues
|
|
163
167
|
|
|
164
168
|
### App REST Client Interceptors
|
|
@@ -617,10 +617,10 @@ function getSchemaDescriptions(schemaObj) {
|
|
|
617
617
|
}
|
|
618
618
|
//#endregion
|
|
619
619
|
//#region src/generators/utils/generate/generate.zod.utils.ts
|
|
620
|
-
const getZodSchemaInferedTypeName = (zodSchemaName, options) => removeSuffix(zodSchemaName, options.schemaSuffix);
|
|
620
|
+
const getZodSchemaInferedTypeName = (zodSchemaName, options) => removeSuffix(isNamedZodSchema(zodSchemaName) ? zodSchemaName.split(".")[0] : zodSchemaName, options.schemaSuffix);
|
|
621
621
|
const getImportedZodSchemaName = (resolver, zodSchemaName, namespaceTag) => {
|
|
622
622
|
if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName;
|
|
623
|
-
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag);
|
|
623
|
+
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName.split(".")[0], namespaceTag);
|
|
624
624
|
return `${resolver.options.tsNamespaces ? `${getNamespaceName({
|
|
625
625
|
type: "models",
|
|
626
626
|
tag,
|
|
@@ -633,7 +633,7 @@ function getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag) {
|
|
|
633
633
|
}
|
|
634
634
|
const getImportedZodSchemaInferedTypeName = (resolver, zodSchemaName, currentTag, namespaceTag) => {
|
|
635
635
|
if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName === "z.void()" ? "void" : zodSchemaName;
|
|
636
|
-
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag);
|
|
636
|
+
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName.split(".")[0], namespaceTag);
|
|
637
637
|
return `${resolver.options.tsNamespaces && (Boolean(namespaceTag) || tag !== currentTag) ? `${getNamespaceName({
|
|
638
638
|
type: "models",
|
|
639
639
|
tag,
|
|
@@ -834,13 +834,13 @@ const getImportedInfiniteQueryName = (endpoint, options) => {
|
|
|
834
834
|
//#region src/generators/utils/generate/generate.imports.utils.ts
|
|
835
835
|
function getModelsImports({ resolver, tag, zodSchemas = [], zodSchemasAsTypes = [] }) {
|
|
836
836
|
const type = "models";
|
|
837
|
-
const getTag = (zodSchemaName) => resolver.getTagByZodSchemaName(zodSchemaName);
|
|
837
|
+
const getTag = (zodSchemaName) => resolver.getTagByZodSchemaName(zodSchemaName.split(".")[0]);
|
|
838
838
|
const zodSchemaImports = getImports({
|
|
839
839
|
type,
|
|
840
840
|
tag,
|
|
841
841
|
entities: zodSchemas,
|
|
842
842
|
getTag,
|
|
843
|
-
getEntityName: (zodSchema) => zodSchema,
|
|
843
|
+
getEntityName: (zodSchema) => zodSchema.split(".")[0],
|
|
844
844
|
options: resolver.options
|
|
845
845
|
});
|
|
846
846
|
const zodSchemaTypeImports = getImports({
|
|
@@ -1446,6 +1446,7 @@ function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, in
|
|
|
1446
1446
|
inlineEndpointsExcludeModules: inlineEndpointsExcludeModules?.split(","),
|
|
1447
1447
|
workspaceContext: workspaceContext?.split(",")
|
|
1448
1448
|
});
|
|
1449
|
+
if (resolvedConfig.modelsInCommon && resolvedConfig.modelsInModules) throw new Error("modelsInCommon and modelsInModules cannot both be enabled");
|
|
1449
1450
|
resolvedConfig.checkAcl = resolvedConfig.acl && resolvedConfig.checkAcl;
|
|
1450
1451
|
resolvedConfig.workspaceContext = Array.from(new Set((resolvedConfig.workspaceContext ?? []).map((value) => value.trim()).filter(Boolean)));
|
|
1451
1452
|
return resolvedConfig;
|
|
@@ -1493,6 +1494,10 @@ function compileNativeData(source, yaml, optionsJson) {
|
|
|
1493
1494
|
//#endregion
|
|
1494
1495
|
//#region src/native/generateFilesFromNativeOpenAPI.ts
|
|
1495
1496
|
function generateFilesFromNativeOpenAPI(source, yaml, options) {
|
|
1497
|
+
if (options.standalone && options.importPath === "ts") options = {
|
|
1498
|
+
...options,
|
|
1499
|
+
importPath: "relative"
|
|
1500
|
+
};
|
|
1496
1501
|
if (!supportsCompleteNativeRender(options)) {
|
|
1497
1502
|
if (process.env.OPENAPI_CODEGEN_REQUIRE_FULL_NATIVE === "1") throw new Error("The selected options are not supported by the full native renderer");
|
|
1498
1503
|
return;
|
|
@@ -1569,7 +1574,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
|
|
|
1569
1574
|
const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
|
|
1570
1575
|
if (nativeFiles) return nativeFiles;
|
|
1571
1576
|
}
|
|
1572
|
-
const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-
|
|
1577
|
+
const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-C1L8i0qt.mjs").then((n) => n.n);
|
|
1573
1578
|
return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
|
|
1574
1579
|
source: nativeInput.source,
|
|
1575
1580
|
yaml: nativeInput.yaml
|
|
@@ -790,10 +790,10 @@ function getSchemaDescriptions(schemaObj) {
|
|
|
790
790
|
}
|
|
791
791
|
//#endregion
|
|
792
792
|
//#region src/generators/utils/generate/generate.zod.utils.ts
|
|
793
|
-
const getZodSchemaInferedTypeName = (zodSchemaName, options) => removeSuffix(zodSchemaName, options.schemaSuffix);
|
|
793
|
+
const getZodSchemaInferedTypeName = (zodSchemaName, options) => removeSuffix(isNamedZodSchema(zodSchemaName) ? zodSchemaName.split(".")[0] : zodSchemaName, options.schemaSuffix);
|
|
794
794
|
const getImportedZodSchemaName = (resolver, zodSchemaName, namespaceTag) => {
|
|
795
795
|
if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName;
|
|
796
|
-
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag);
|
|
796
|
+
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName.split(".")[0], namespaceTag);
|
|
797
797
|
return `${resolver.options.tsNamespaces ? `${getNamespaceName({
|
|
798
798
|
type: "models",
|
|
799
799
|
tag,
|
|
@@ -806,7 +806,7 @@ function getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag) {
|
|
|
806
806
|
}
|
|
807
807
|
const getImportedZodSchemaInferedTypeName = (resolver, zodSchemaName, currentTag, namespaceTag) => {
|
|
808
808
|
if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName === "z.void()" ? "void" : zodSchemaName;
|
|
809
|
-
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName, namespaceTag);
|
|
809
|
+
const tag = getOwningOrLocalProxyTag(resolver, zodSchemaName.split(".")[0], namespaceTag);
|
|
810
810
|
return `${resolver.options.tsNamespaces && (Boolean(namespaceTag) || tag !== currentTag) ? `${getNamespaceName({
|
|
811
811
|
type: "models",
|
|
812
812
|
tag,
|
|
@@ -1212,13 +1212,13 @@ const getImportedInfiniteQueryName = (endpoint, options) => {
|
|
|
1212
1212
|
//#region src/generators/utils/generate/generate.imports.utils.ts
|
|
1213
1213
|
function getModelsImports({ resolver, tag, zodSchemas = [], zodSchemasAsTypes = [] }) {
|
|
1214
1214
|
const type = "models";
|
|
1215
|
-
const getTag = (zodSchemaName) => resolver.getTagByZodSchemaName(zodSchemaName);
|
|
1215
|
+
const getTag = (zodSchemaName) => resolver.getTagByZodSchemaName(zodSchemaName.split(".")[0]);
|
|
1216
1216
|
const zodSchemaImports = getImports({
|
|
1217
1217
|
type,
|
|
1218
1218
|
tag,
|
|
1219
1219
|
entities: zodSchemas,
|
|
1220
1220
|
getTag,
|
|
1221
|
-
getEntityName: (zodSchema) => zodSchema,
|
|
1221
|
+
getEntityName: (zodSchema) => zodSchema.split(".")[0],
|
|
1222
1222
|
options: resolver.options
|
|
1223
1223
|
});
|
|
1224
1224
|
const zodSchemaTypeImports = getImports({
|
package/dist/{generateCodeFromOpenAPIDoc-idp1RVDa.mjs → generateCodeFromOpenAPIDoc-C1L8i0qt.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-
|
|
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, i as shouldUseNativeCodegen, 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, nt as getImportedZodSchemaInferedTypeName, o as getOutputFileName, ot as getZodSchemaPropertyDescriptions, p as getEndpointConfig, pt as isBulkDeleteEndpoint, q as getAbilityDescription, r as compileNativeData, rt as getImportedZodSchemaName, st as getZodSchemaType, 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 "./generate.runner-
|
|
1
|
+
import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BeEB6M3K.mjs";
|
|
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, i as shouldUseNativeCodegen, 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, nt as getImportedZodSchemaInferedTypeName, o as getOutputFileName, ot as getZodSchemaPropertyDescriptions, p as getEndpointConfig, pt as isBulkDeleteEndpoint, q as getAbilityDescription, r as compileNativeData, rt as getImportedZodSchemaName, st as getZodSchemaType, 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 "./generate.runner-Cdv3h6-o.mjs";
|
|
3
3
|
import "node:module";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -1916,7 +1916,7 @@ var NativeSchemaResolver = class {
|
|
|
1916
1916
|
return this.nameByRef.get(normalizeRef(ref));
|
|
1917
1917
|
}
|
|
1918
1918
|
getTagByZodSchemaName(name) {
|
|
1919
|
-
return this.options.modelsInCommon ? this.options.defaultTag : this.nativeData.schemaOwners[name];
|
|
1919
|
+
return !this.options.splitByTags || this.options.modelsInCommon ? this.options.defaultTag : this.nativeData.schemaOwners[name] ?? this.options.defaultTag;
|
|
1920
1920
|
}
|
|
1921
1921
|
isSchemaCircular(ref) {
|
|
1922
1922
|
const name = this.nameByRef.get(normalizeRef(ref));
|
|
@@ -2032,8 +2032,8 @@ function getDataFromNativeOpenAPIDoc(openApiDoc, options, nativeSource) {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
for (const endpoint of nativeData.endpoints) getTagElement(getEndpointTag(endpoint, options), data).endpoints.push(endpoint);
|
|
2034
2034
|
for (const [name, code] of Object.entries(nativeData.schemas)) {
|
|
2035
|
-
const
|
|
2036
|
-
if (tag) getTagElement(tag, data).zodSchemas[name] = code;
|
|
2035
|
+
const tags = options.modelsInModules ? nativeData.schemaUsageTags[name] ?? [options.defaultTag] : [options.modelsInCommon ? options.defaultTag : nativeData.schemaOwners[name]];
|
|
2036
|
+
for (const tag of tags) if (tag) getTagElement(tag, data).zodSchemas[name] = code;
|
|
2037
2037
|
}
|
|
2038
2038
|
if (process.env.OPENAPI_NATIVE_PROFILE === "1") console.error(`native bridge load=${(afterLoad - started).toFixed(1)}ms call=${(afterNative - afterLoad).toFixed(1)}ms parse=${(afterParse - afterNative).toFixed(1)}ms facade=${(afterResolver - afterParse).toFixed(1)}ms split=${(performance.now() - afterResolver).toFixed(1)}ms`);
|
|
2039
2039
|
return {
|
package/dist/{generateCodeFromOpenAPIDoc-CkVgg5Zy.cjs → generateCodeFromOpenAPIDoc-D7670R9U.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_generate_utils = require("./generate.utils-
|
|
1
|
+
const require_generate_utils = require("./generate.utils-3gEG3cUe.cjs");
|
|
2
2
|
//#region src/generators/const/acl.const.ts
|
|
3
3
|
const ACL_APP_ABILITY_FILE = {
|
|
4
4
|
fileName: "acl/app.ability",
|
|
@@ -3899,7 +3899,7 @@ var NativeSchemaResolver = class {
|
|
|
3899
3899
|
return this.nameByRef.get(normalizeRef(ref));
|
|
3900
3900
|
}
|
|
3901
3901
|
getTagByZodSchemaName(name) {
|
|
3902
|
-
return this.options.modelsInCommon ? this.options.defaultTag : this.nativeData.schemaOwners[name];
|
|
3902
|
+
return !this.options.splitByTags || this.options.modelsInCommon ? this.options.defaultTag : this.nativeData.schemaOwners[name] ?? this.options.defaultTag;
|
|
3903
3903
|
}
|
|
3904
3904
|
isSchemaCircular(ref) {
|
|
3905
3905
|
const name = this.nameByRef.get(normalizeRef(ref));
|
|
@@ -4015,8 +4015,8 @@ function getDataFromNativeOpenAPIDoc(openApiDoc, options, nativeSource) {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
for (const endpoint of nativeData.endpoints) getTagElement(require_generate_utils.getEndpointTag(endpoint, options), data).endpoints.push(endpoint);
|
|
4017
4017
|
for (const [name, code] of Object.entries(nativeData.schemas)) {
|
|
4018
|
-
const
|
|
4019
|
-
if (tag) getTagElement(tag, data).zodSchemas[name] = code;
|
|
4018
|
+
const tags = options.modelsInModules ? nativeData.schemaUsageTags[name] ?? [options.defaultTag] : [options.modelsInCommon ? options.defaultTag : nativeData.schemaOwners[name]];
|
|
4019
|
+
for (const tag of tags) if (tag) getTagElement(tag, data).zodSchemas[name] = code;
|
|
4020
4020
|
}
|
|
4021
4021
|
if (process.env.OPENAPI_NATIVE_PROFILE === "1") console.error(`native bridge load=${(afterLoad - started).toFixed(1)}ms call=${(afterNative - afterLoad).toFixed(1)}ms parse=${(afterParse - afterNative).toFixed(1)}ms facade=${(afterResolver - afterParse).toFixed(1)}ms split=${(performance.now() - afterResolver).toFixed(1)}ms`);
|
|
4022
4022
|
return {
|
package/dist/generator.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-
|
|
2
|
-
import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-
|
|
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, t as getOpenApiDoc, u as isMutation, x as getSchemaTsMetaType } from "./generate.runner-
|
|
1
|
+
import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-C1L8i0qt.mjs";
|
|
2
|
+
import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BeEB6M3K.mjs";
|
|
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, t as getOpenApiDoc, u as isMutation, x as getSchemaTsMetaType } from "./generate.runner-Cdv3h6-o.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 isPrimitiveType, Bn as getMostCommonAdjacentCombinationSplit, Ct as getParamZodSchemaName, Et as getZodSchemaOperationName, Fn as isTagIncluded, Gt as getParameterEnumNames, Hn as removeWord, Ht as getNamespaceName, Jt as isErrorStatus, Kt as getSchemaNameByRef, Mn as formatTag, Nn as getEndpointTag, On as BODY_PARAMETER_NAME, Ot as isNamedZodSchema, Pn as getOperationTag, Qt as isPathExcluded, Rn as capitalize, Sn as VOID_SCHEMA, St as getEnumZodSchemaName, Tt as getZodSchemaName, Un as snakeToCamel, Ut as autocorrectRef, Wn as Profiler, Wt as escapeControlCharacters, Xt as isMediaTypeAllowed, Yt as isMainResponseStatus, Zt as isParamMediaTypeAllowed, _n as INT_SCHEMA, an as wrapWithQuotesIfNeeded, bn as URL_SCHEMA, bt as invalidVariableNameCharactersToCamel, cn as isReferenceObject, d as isQuery, dn as ALLOWED_PATH_IN, en as isSortingParameterObject, fn as ANY_SCHEMA, gn as ENUM_SCHEMA, hn as EMAIL_SCHEMA, in as unwrapQuotesIfNeeded, kn as JSON_APPLICATION_FORMAT, ln as isSchemaObject, lt as iterateSchema, mn as DATETIME_SCHEMA, nn as pathToVariableName, on as inferRequiredSchema, pn as BLOB_SCHEMA, qt as getSchemaRef, rn as replaceHyphenatedPath, s as pick, sn as isArraySchemaObject, tn as pathParamToVariableName, un as ALLOWED_METHODS, ut as getUniqueArray, vn as NUMBER_SCHEMA, wt as getResponseZodSchemaName, xn as UUID_SCHEMA, xt as getBodyZodSchemaName, yn as STRING_SCHEMA, zn as decapitalize } from "./generate.runner-
|
|
1
|
+
import { $t as isPrimitiveType, Bn as getMostCommonAdjacentCombinationSplit, Ct as getParamZodSchemaName, Et as getZodSchemaOperationName, Fn as isTagIncluded, Gt as getParameterEnumNames, Hn as removeWord, Ht as getNamespaceName, Jt as isErrorStatus, Kt as getSchemaNameByRef, Mn as formatTag, Nn as getEndpointTag, On as BODY_PARAMETER_NAME, Ot as isNamedZodSchema, Pn as getOperationTag, Qt as isPathExcluded, Rn as capitalize, Sn as VOID_SCHEMA, St as getEnumZodSchemaName, Tt as getZodSchemaName, Un as snakeToCamel, Ut as autocorrectRef, Wn as Profiler, Wt as escapeControlCharacters, Xt as isMediaTypeAllowed, Yt as isMainResponseStatus, Zt as isParamMediaTypeAllowed, _n as INT_SCHEMA, an as wrapWithQuotesIfNeeded, bn as URL_SCHEMA, bt as invalidVariableNameCharactersToCamel, cn as isReferenceObject, d as isQuery, dn as ALLOWED_PATH_IN, en as isSortingParameterObject, fn as ANY_SCHEMA, gn as ENUM_SCHEMA, hn as EMAIL_SCHEMA, in as unwrapQuotesIfNeeded, kn as JSON_APPLICATION_FORMAT, ln as isSchemaObject, lt as iterateSchema, mn as DATETIME_SCHEMA, nn as pathToVariableName, on as inferRequiredSchema, pn as BLOB_SCHEMA, qt as getSchemaRef, rn as replaceHyphenatedPath, s as pick, sn as isArraySchemaObject, tn as pathParamToVariableName, un as ALLOWED_METHODS, ut as getUniqueArray, vn as NUMBER_SCHEMA, wt as getResponseZodSchemaName, xn as UUID_SCHEMA, xt as getBodyZodSchemaName, yn as STRING_SCHEMA, zn as decapitalize } from "./generate.runner-Cdv3h6-o.mjs";
|
|
2
2
|
//#region src/generators/const/validation.const.ts
|
|
3
3
|
const HTTP_STATUS_CODES = {
|
|
4
4
|
"100": "Continue",
|
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-
|
|
2
|
+
const require_generate_utils = require("./generate.utils-3gEG3cUe.cjs");
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
fs = require_generate_utils.__toESM(fs, 1);
|
|
5
5
|
let path = require("path");
|
|
@@ -14,6 +14,7 @@ function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, in
|
|
|
14
14
|
inlineEndpointsExcludeModules: inlineEndpointsExcludeModules?.split(","),
|
|
15
15
|
workspaceContext: workspaceContext?.split(",")
|
|
16
16
|
});
|
|
17
|
+
if (resolvedConfig.modelsInCommon && resolvedConfig.modelsInModules) throw new Error("modelsInCommon and modelsInModules cannot both be enabled");
|
|
17
18
|
resolvedConfig.checkAcl = resolvedConfig.acl && resolvedConfig.checkAcl;
|
|
18
19
|
resolvedConfig.workspaceContext = Array.from(new Set((resolvedConfig.workspaceContext ?? []).map((value) => value.trim()).filter(Boolean)));
|
|
19
20
|
return resolvedConfig;
|
|
@@ -21,6 +22,10 @@ function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, in
|
|
|
21
22
|
//#endregion
|
|
22
23
|
//#region src/native/generateFilesFromNativeOpenAPI.ts
|
|
23
24
|
function generateFilesFromNativeOpenAPI(source, yaml, options) {
|
|
25
|
+
if (options.standalone && options.importPath === "ts") options = {
|
|
26
|
+
...options,
|
|
27
|
+
importPath: "relative"
|
|
28
|
+
};
|
|
24
29
|
if (!supportsCompleteNativeRender(options)) {
|
|
25
30
|
if (process.env.OPENAPI_CODEGEN_REQUIRE_FULL_NATIVE === "1") throw new Error("The selected options are not supported by the full native renderer");
|
|
26
31
|
return;
|
|
@@ -97,7 +102,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
|
|
|
97
102
|
const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
|
|
98
103
|
if (nativeFiles) return nativeFiles;
|
|
99
104
|
}
|
|
100
|
-
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-
|
|
105
|
+
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-D7670R9U.cjs"));
|
|
101
106
|
return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
|
|
102
107
|
source: nativeInput.source,
|
|
103
108
|
yaml: nativeInput.yaml
|
package/dist/metro.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-QIabSZVk.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";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wn as Profiler, n as runGenerate } from "./generate.runner-
|
|
1
|
+
import { Wn as Profiler, n as runGenerate } from "./generate.runner-Cdv3h6-o.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
//#region src/plugins/openapi-codegen.runner.ts
|
|
4
4
|
function createOpenApiCodegenRunner(config, options = {}) {
|
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-
|
|
3
|
-
import { D as getTagFileName, Wn as Profiler, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc } from "./generate.runner-
|
|
2
|
+
import { i as VALIDATION_ERROR_TYPE_TITLE, n as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BeEB6M3K.mjs";
|
|
3
|
+
import { D as getTagFileName, Wn as Profiler, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc } from "./generate.runner-Cdv3h6-o.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.
|
|
34
|
+
return "3.2.3";
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/helpers/yargs.helper.ts
|
package/dist/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-QIabSZVk.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
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"test": "bun run build:native && bun run test:ts && bun run test:native",
|
|
92
92
|
"test:ts": "OPENAPI_CODEGEN_NATIVE=0 vitest run",
|
|
93
93
|
"test:native": "OPENAPI_CODEGEN_NATIVE=1 OPENAPI_CODEGEN_REQUIRE_FULL_NATIVE=1 vitest run",
|
|
94
|
-
"test:parity": "vitest run src/native/renderer-parity.test.ts src/native/renderer-parity-manifest.test.ts",
|
|
94
|
+
"test:parity": "vitest run src/native/renderer-parity.test.ts src/native/renderer-parity-manifest.test.ts src/native/model-imports.test.ts src/native/configuration-parity.test.ts src/native/configuration-runtime.test.ts src/native/configuration-lifecycle.test.ts",
|
|
95
95
|
"test:watch": "vitest",
|
|
96
96
|
"build": "tsdown && bun run build:native",
|
|
97
97
|
"build:ts": "tsdown",
|
|
@@ -187,5 +187,5 @@
|
|
|
187
187
|
"node": ">= 18"
|
|
188
188
|
},
|
|
189
189
|
"packageManager": "bun@1.4.1",
|
|
190
|
-
"version": "3.2.
|
|
190
|
+
"version": "3.2.3"
|
|
191
191
|
}
|