@povio/openapi-codegen-cli 3.2.0-rc.11 → 3.2.0-rc.13
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/dist/{generate.runner-CD7mlcJ4.mjs → generate.runner-Caxx62-r.mjs} +2 -2
- package/dist/{generate.utils-CT-LA-gX.cjs → generate.utils-DC1pIuhK.cjs} +3 -3
- package/dist/{generateCodeFromOpenAPIDoc-D9W5BtAt.mjs → generateCodeFromOpenAPIDoc-D9AxX3_a.mjs} +6 -5
- package/dist/{generateCodeFromOpenAPIDoc-DhI7CHeh.cjs → generateCodeFromOpenAPIDoc-DDThW43F.cjs} +7 -5
- package/dist/generator.mjs +4 -4
- package/dist/{getDataFromOpenAPIDoc-D8w0QElH.mjs → getDataFromOpenAPIDoc-Dj0cdt9r.mjs} +3 -2
- package/dist/metro.cjs +2 -2
- package/dist/metro.mjs +1 -1
- package/dist/{native-bindings-BTQGSGhU.mjs → native-bindings-DHQGvV7n.mjs} +3 -3
- 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-C4TIXQNx.mjs → openapi-codegen.runner-Cic6E7Lr.mjs} +2 -2
- package/dist/sh.mjs +4 -4
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as getTagFileName, Wn as Profiler, a as writeGenerateFileData, dt as DEFAULT_GENERATE_OPTIONS, i as removeStaleGeneratedFiles, n as shouldUseNativeCodegen, o as deepMerge, r as getOutputFileName, t as compileNativeData } from "./native-bindings-
|
|
1
|
+
import { D as getTagFileName, Wn as Profiler, a as writeGenerateFileData, dt as DEFAULT_GENERATE_OPTIONS, i as removeStaleGeneratedFiles, n as shouldUseNativeCodegen, o as deepMerge, r as getOutputFileName, t as compileNativeData } from "./native-bindings-DHQGvV7n.mjs";
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
//#region src/generators/core/resolveConfig.ts
|
|
@@ -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-
|
|
96
|
+
const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-D9AxX3_a.mjs").then((n) => n.n);
|
|
97
97
|
return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
|
|
98
98
|
source: nativeInput.source,
|
|
99
99
|
yaml: nativeInput.yaml
|
|
@@ -1145,9 +1145,9 @@ function renderMediaUploadMutationBody({ resolver, endpointFunction, resolvedEnd
|
|
|
1145
1145
|
" let dataToSend: File | FormData = file;",
|
|
1146
1146
|
" if (method === \"post\") {",
|
|
1147
1147
|
" dataToSend = new FormData();",
|
|
1148
|
-
" if (uploadInstructions.fields) {",
|
|
1149
|
-
" for (const [key, value] of uploadInstructions.fields) {",
|
|
1150
|
-
" dataToSend.append(key, value);",
|
|
1148
|
+
" if (\"fields\" in uploadInstructions && uploadInstructions.fields) {",
|
|
1149
|
+
" for (const [key, value] of Object.entries(uploadInstructions.fields)) {",
|
|
1150
|
+
" dataToSend.append(key, String(value));",
|
|
1151
1151
|
" }",
|
|
1152
1152
|
" }",
|
|
1153
1153
|
" dataToSend.append(\"file\", file);",
|
package/dist/{generateCodeFromOpenAPIDoc-D9W5BtAt.mjs → generateCodeFromOpenAPIDoc-D9AxX3_a.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, 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-
|
|
1
|
+
import { r as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-Dj0cdt9r.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, 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-DHQGvV7n.mjs";
|
|
3
3
|
import "node:module";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -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)
|
|
@@ -1447,9 +1447,10 @@ function renderInfiniteQueryOptions({ resolver, endpoint, inlineEndpoints }) {
|
|
|
1447
1447
|
const requestConfigWithSignal = renderRequestConfigWithSignal(hasRequestConfigParam);
|
|
1448
1448
|
lines.push(` queryFn: ({ pageParam, signal }: { pageParam: number; signal: AbortSignal }) => ${endpointFunction}(${endpointArgsWithPage}${hasRequestConfigParam ? `, ${requestConfigWithSignal}` : ""}),`);
|
|
1449
1449
|
lines.push(" initialPageParam: 1,");
|
|
1450
|
-
lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }: Awaited<ReturnType<typeof ${endpointFunction}>>) => {`);
|
|
1450
|
+
lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }: Awaited<ReturnType<typeof ${endpointFunction}>> & Partial<Record<${JSON.stringify(resolver.options.infiniteQueryResponseParamNames.page)} | ${JSON.stringify(resolver.options.infiniteQueryResponseParamNames.totalItems)} | ${JSON.stringify(resolver.options.infiniteQueryResponseParamNames.limit)}, number | null>>) => {`);
|
|
1451
1451
|
lines.push(` const pageParam = ${resolver.options.infiniteQueryResponseParamNames.page} ?? 1;`);
|
|
1452
|
-
lines.push(
|
|
1452
|
+
lines.push(" const pageSize = limitParam ?? 0;");
|
|
1453
|
+
lines.push(` return pageParam * pageSize < (${resolver.options.infiniteQueryResponseParamNames.totalItems} ?? 0) ? pageParam + 1 : null;`);
|
|
1453
1454
|
lines.push(" },");
|
|
1454
1455
|
lines.push("});");
|
|
1455
1456
|
return lines.join("\n");
|
package/dist/{generateCodeFromOpenAPIDoc-DhI7CHeh.cjs → generateCodeFromOpenAPIDoc-DDThW43F.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_generate_utils = require("./generate.utils-
|
|
1
|
+
const require_generate_utils = require("./generate.utils-DC1pIuhK.cjs");
|
|
2
2
|
//#region src/generators/const/acl.const.ts
|
|
3
3
|
const ACL_APP_ABILITY_FILE = {
|
|
4
4
|
fileName: "acl/app.ability",
|
|
@@ -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
|
-
|
|
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)
|
|
@@ -3425,9 +3426,10 @@ function renderInfiniteQueryOptions({ resolver, endpoint, inlineEndpoints }) {
|
|
|
3425
3426
|
const requestConfigWithSignal = renderRequestConfigWithSignal(hasRequestConfigParam);
|
|
3426
3427
|
lines.push(` queryFn: ({ pageParam, signal }: { pageParam: number; signal: AbortSignal }) => ${endpointFunction}(${endpointArgsWithPage}${hasRequestConfigParam ? `, ${requestConfigWithSignal}` : ""}),`);
|
|
3427
3428
|
lines.push(" initialPageParam: 1,");
|
|
3428
|
-
lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }: Awaited<ReturnType<typeof ${endpointFunction}>>) => {`);
|
|
3429
|
+
lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }: Awaited<ReturnType<typeof ${endpointFunction}>> & Partial<Record<${JSON.stringify(resolver.options.infiniteQueryResponseParamNames.page)} | ${JSON.stringify(resolver.options.infiniteQueryResponseParamNames.totalItems)} | ${JSON.stringify(resolver.options.infiniteQueryResponseParamNames.limit)}, number | null>>) => {`);
|
|
3429
3430
|
lines.push(` const pageParam = ${resolver.options.infiniteQueryResponseParamNames.page} ?? 1;`);
|
|
3430
|
-
lines.push(
|
|
3431
|
+
lines.push(" const pageSize = limitParam ?? 0;");
|
|
3432
|
+
lines.push(` return pageParam * pageSize < (${resolver.options.infiniteQueryResponseParamNames.totalItems} ?? 0) ? pageParam + 1 : null;`);
|
|
3431
3433
|
lines.push(" },");
|
|
3432
3434
|
lines.push("});");
|
|
3433
3435
|
return lines.join("\n");
|
package/dist/generator.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, u as isMutation, x as getSchemaTsMetaType } from "./native-bindings-
|
|
4
|
-
import { t as getOpenApiDoc } from "./generate.runner-
|
|
1
|
+
import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-D9AxX3_a.mjs";
|
|
2
|
+
import { t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-Dj0cdt9r.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, u as isMutation, x as getSchemaTsMetaType } from "./native-bindings-DHQGvV7n.mjs";
|
|
4
|
+
import { t as getOpenApiDoc } from "./generate.runner-Caxx62-r.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);
|
|
@@ -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 "./native-bindings-
|
|
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 "./native-bindings-DHQGvV7n.mjs";
|
|
2
2
|
//#region src/generators/const/validation.const.ts
|
|
3
3
|
const HTTP_STATUS_CODES = {
|
|
4
4
|
"100": "Continue",
|
|
@@ -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
|
-
|
|
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
|
@@ -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-DC1pIuhK.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-
|
|
100
|
+
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-DDThW43F.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-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-Cic6E7Lr.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";
|
|
@@ -1260,9 +1260,9 @@ function renderMediaUploadMutationBody({ resolver, endpointFunction, resolvedEnd
|
|
|
1260
1260
|
" let dataToSend: File | FormData = file;",
|
|
1261
1261
|
" if (method === \"post\") {",
|
|
1262
1262
|
" dataToSend = new FormData();",
|
|
1263
|
-
" if (uploadInstructions.fields) {",
|
|
1264
|
-
" for (const [key, value] of uploadInstructions.fields) {",
|
|
1265
|
-
" dataToSend.append(key, value);",
|
|
1263
|
+
" if (\"fields\" in uploadInstructions && uploadInstructions.fields) {",
|
|
1264
|
+
" for (const [key, value] of Object.entries(uploadInstructions.fields)) {",
|
|
1265
|
+
" dataToSend.append(key, String(value));",
|
|
1266
1266
|
" }",
|
|
1267
1267
|
" }",
|
|
1268
1268
|
" dataToSend.append(\"file\", file);",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wn as Profiler } from "./native-bindings-
|
|
2
|
-
import { n as runGenerate } from "./generate.runner-
|
|
1
|
+
import { Wn as Profiler } from "./native-bindings-DHQGvV7n.mjs";
|
|
2
|
+
import { n as runGenerate } from "./generate.runner-Caxx62-r.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-
|
|
3
|
-
import { D as getTagFileName, Wn as Profiler, r as getOutputFileName } from "./native-bindings-
|
|
4
|
-
import { n as runGenerate, r as resolveConfig, t as getOpenApiDoc } from "./generate.runner-
|
|
2
|
+
import { i as VALIDATION_ERROR_TYPE_TITLE, n as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-Dj0cdt9r.mjs";
|
|
3
|
+
import { D as getTagFileName, Wn as Profiler, r as getOutputFileName } from "./native-bindings-DHQGvV7n.mjs";
|
|
4
|
+
import { n as runGenerate, r as resolveConfig, t as getOpenApiDoc } from "./generate.runner-Caxx62-r.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.
|
|
35
|
+
return "3.2.0-rc.13";
|
|
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-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-Cic6E7Lr.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