@povio/openapi-codegen-cli 3.3.0-rc.1 → 3.3.0-rc.2
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-BeCGJ1ar.mjs → generate.runner-B0Zm3pIl.mjs} +1 -1
- package/dist/{generateCodeFromOpenAPIDoc-KQT4kYxY.mjs → generateCodeFromOpenAPIDoc-SYuVswEJ.mjs} +3 -2
- package/dist/generator.mjs +1 -1
- package/dist/metro.cjs +3 -2
- package/dist/metro.mjs +1 -1
- package/dist/{openapi-codegen.runner-nPBssrBL.mjs → openapi-codegen.runner-CCXQsUum.mjs} +2 -2
- package/dist/sh.mjs +3 -3
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as deepMerge, i as writeGenerateFileData, p as DEFAULT_GENERATE_OPTIONS, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc, x as Profiler } from "./generateCodeFromOpenAPIDoc-
|
|
1
|
+
import { h as deepMerge, i as writeGenerateFileData, p as DEFAULT_GENERATE_OPTIONS, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc, x as Profiler } from "./generateCodeFromOpenAPIDoc-SYuVswEJ.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
4
4
|
//#region src/generators/core/resolveConfig.ts
|
package/dist/{generateCodeFromOpenAPIDoc-KQT4kYxY.mjs → generateCodeFromOpenAPIDoc-SYuVswEJ.mjs}
RENAMED
|
@@ -694,7 +694,7 @@ function getZodSchema({ schema, resolver, meta: inheritedMeta, tag }) {
|
|
|
694
694
|
propZodSchema,
|
|
695
695
|
isCircular
|
|
696
696
|
];
|
|
697
|
-
}).map(([prop, propSchema, isCircular]) => isCircular ?
|
|
697
|
+
}).map(([prop, propSchema, isCircular]) => isCircular ? `${wrapWithQuotesIfNeeded(prop)}: z.lazy(() => ${propSchema})` : `${wrapWithQuotesIfNeeded(prop)}: ${propSchema}`).join(", ")} }`;
|
|
698
698
|
let additionalPropsSchema = "";
|
|
699
699
|
if (schema.additionalProperties) additionalPropsSchema = `.catchall(${typeof schema.additionalProperties === "object" && Object.keys(schema.additionalProperties).length > 0 ? getZodSchema({
|
|
700
700
|
...params,
|
|
@@ -3975,7 +3975,8 @@ function generateModels({ resolver, data, tag }) {
|
|
|
3975
3975
|
const inferredTypeName = getZodSchemaInferedTypeName(name, resolver.options);
|
|
3976
3976
|
if (zodSchema.isCircular && zodSchema.schemaObj) lines.push(`export type ${inferredTypeName} = ${renderSchemaType(zodSchema.schemaObj, resolver)};`);
|
|
3977
3977
|
const typeAnnotation = zodSchema.isCircular ? `: z.ZodObject<z.ZodRawShape> & z.ZodType<${inferredTypeName}>` : "";
|
|
3978
|
-
|
|
3978
|
+
const schemaCode = zodSchema.isCircular ? zodSchema.code : `z.compile(${zodSchema.code})`;
|
|
3979
|
+
lines.push(`export const ${name}${typeAnnotation} = ${schemaCode};`);
|
|
3979
3980
|
if (!zodSchema.isCircular) lines.push(`export type ${inferredTypeName} = z.infer<typeof ${name}>;`);
|
|
3980
3981
|
if (zodSchema.isEnum) lines.push(`export const ${getZodSchemaInferedTypeName(name, resolver.options)} = ${name}.enum;`);
|
|
3981
3982
|
lines.push("");
|
package/dist/generator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as formatTag, c as getSchemaTsMetaType, d as getTagImportPath, f as getQueryName, g as invalidVariableNameCharactersToCamel, l as getTsTypeBase, o as isMutation, p as DEFAULT_GENERATE_OPTIONS, s as isQuery, t as generateCodeFromOpenAPIDoc, v as isMediaTypeAllowed, y as isParamMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-
|
|
1
|
+
import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as formatTag, c as getSchemaTsMetaType, d as getTagImportPath, f as getQueryName, g as invalidVariableNameCharactersToCamel, l as getTsTypeBase, o as isMutation, p as DEFAULT_GENERATE_OPTIONS, s as isQuery, t as generateCodeFromOpenAPIDoc, v as isMediaTypeAllowed, y as isParamMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-SYuVswEJ.mjs";
|
|
2
2
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
3
3
|
//#region src/generators/core/getMetadataFromOpenAPIDoc.ts
|
|
4
4
|
async function getMetadataFromOpenAPIDoc(openApiDoc, options) {
|
package/dist/metro.cjs
CHANGED
|
@@ -820,7 +820,7 @@ function getZodSchema({ schema, resolver, meta: inheritedMeta, tag }) {
|
|
|
820
820
|
propZodSchema,
|
|
821
821
|
isCircular
|
|
822
822
|
];
|
|
823
|
-
}).map(([prop, propSchema, isCircular]) => isCircular ?
|
|
823
|
+
}).map(([prop, propSchema, isCircular]) => isCircular ? `${wrapWithQuotesIfNeeded(prop)}: z.lazy(() => ${propSchema})` : `${wrapWithQuotesIfNeeded(prop)}: ${propSchema}`).join(", ")} }`;
|
|
824
824
|
let additionalPropsSchema = "";
|
|
825
825
|
if (schema.additionalProperties) additionalPropsSchema = `.catchall(${typeof schema.additionalProperties === "object" && Object.keys(schema.additionalProperties).length > 0 ? getZodSchema({
|
|
826
826
|
...params,
|
|
@@ -3780,7 +3780,8 @@ function generateModels({ resolver, data, tag }) {
|
|
|
3780
3780
|
const inferredTypeName = getZodSchemaInferedTypeName(name, resolver.options);
|
|
3781
3781
|
if (zodSchema.isCircular && zodSchema.schemaObj) lines.push(`export type ${inferredTypeName} = ${renderSchemaType(zodSchema.schemaObj, resolver)};`);
|
|
3782
3782
|
const typeAnnotation = zodSchema.isCircular ? `: z.ZodObject<z.ZodRawShape> & z.ZodType<${inferredTypeName}>` : "";
|
|
3783
|
-
|
|
3783
|
+
const schemaCode = zodSchema.isCircular ? zodSchema.code : `z.compile(${zodSchema.code})`;
|
|
3784
|
+
lines.push(`export const ${name}${typeAnnotation} = ${schemaCode};`);
|
|
3784
3785
|
if (!zodSchema.isCircular) lines.push(`export type ${inferredTypeName} = z.infer<typeof ${name}>;`);
|
|
3785
3786
|
if (zodSchema.isEnum) lines.push(`export const ${getZodSchemaInferedTypeName(name, resolver.options)} = ${name}.enum;`);
|
|
3786
3787
|
lines.push("");
|
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-CCXQsUum.mjs";
|
|
2
2
|
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-8kCe-g9S.mjs";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as Profiler } from "./generateCodeFromOpenAPIDoc-
|
|
2
|
-
import { t as runGenerate } from "./generate.runner-
|
|
1
|
+
import { x as Profiler } from "./generateCodeFromOpenAPIDoc-SYuVswEJ.mjs";
|
|
2
|
+
import { t as runGenerate } from "./generate.runner-B0Zm3pIl.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,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { S as VALIDATION_ERROR_TYPE_TITLE, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, x as Profiler } from "./generateCodeFromOpenAPIDoc-
|
|
3
|
-
import { n as resolveConfig, t as runGenerate } from "./generate.runner-
|
|
2
|
+
import { S as VALIDATION_ERROR_TYPE_TITLE, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, x as Profiler } from "./generateCodeFromOpenAPIDoc-SYuVswEJ.mjs";
|
|
3
|
+
import { n as resolveConfig, t as runGenerate } from "./generate.runner-B0Zm3pIl.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import yargs from "yargs";
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
@@ -36,7 +36,7 @@ function logBanner(message) {
|
|
|
36
36
|
* Fetch the version from package.json
|
|
37
37
|
*/
|
|
38
38
|
function getVersion() {
|
|
39
|
-
return "3.3.0-rc.
|
|
39
|
+
return "3.3.0-rc.2";
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#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-CCXQsUum.mjs";
|
|
2
2
|
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-8kCe-g9S.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
//#region src/vite/openapi-codegen.plugin.ts
|
package/package.json
CHANGED