@povio/openapi-codegen-cli 3.0.0-rc.7 → 3.0.0-rc.8

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 { S as Profiler, h as deepMerge, i as writeGenerateFileData, p as DEFAULT_GENERATE_OPTIONS, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-CZBaxU5n.mjs";
1
+ import { S as Profiler, h as deepMerge, i as writeGenerateFileData, p as DEFAULT_GENERATE_OPTIONS, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-DGox5gzo.mjs";
2
2
  import path from "path";
3
3
  import SwaggerParser from "@apidevtools/swagger-parser";
4
4
 
@@ -1574,7 +1574,7 @@ function getSchemaDescriptions(schemaObj) {
1574
1574
  const getZodSchemaInferedTypeName = (zodSchemaName, options) => removeSuffix(zodSchemaName, options.schemaSuffix);
1575
1575
  const getImportedZodSchemaName = (resolver, zodSchemaName, namespaceTag) => {
1576
1576
  if (!isNamedZodSchema(zodSchemaName)) return zodSchemaName;
1577
- const tag = namespaceTag ?? resolver.getTagByZodSchemaName(zodSchemaName);
1577
+ const tag = namespaceTag && resolver.options.modelsInCommon && resolver.options.splitByTags ? namespaceTag : resolver.getTagByZodSchemaName(zodSchemaName);
1578
1578
  return `${resolver.options.tsNamespaces ? `${getNamespaceName({
1579
1579
  type: GenerateType.Models,
1580
1580
  tag,
@@ -3851,7 +3851,7 @@ function generateEndpoints({ resolver, data, tag }) {
3851
3851
  const endpointConfig = renderEndpointConfig(resolver, endpoint, tag);
3852
3852
  lines.push(`export const ${getEndpointName(endpoint)} = (${endpointParams}${hasAxiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
3853
3853
  lines.push(` return ${APP_REST_CLIENT_NAME}.${endpoint.method}(`);
3854
- lines.push(` { resSchema: ${getImportedZodSchemaName(resolver, endpoint.response)} },`);
3854
+ lines.push(` { resSchema: ${getImportedZodSchemaName(resolver, endpoint.response, tag)} },`);
3855
3855
  lines.push(` \`${getEndpointPath(endpoint)}\`,`);
3856
3856
  if (endpointBody) lines.push(` ${generateParse ? renderEndpointParamParse(resolver, endpointBody, endpointBody.name, tag) : endpointBody.name},`);
3857
3857
  else if (hasUndefinedEndpointBody) lines.push(" undefined,");
@@ -4400,7 +4400,7 @@ function renderInlineEndpoints({ resolver, endpoints, tag }) {
4400
4400
  const endpointConfig = renderInlineEndpointConfig(resolver, endpoint, tag);
4401
4401
  lines.push(`const ${getEndpointName(endpoint)} = (${endpointParams}${resolver.options.axiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
4402
4402
  lines.push(` return ${APP_REST_CLIENT_NAME}.${endpoint.method}(`);
4403
- lines.push(` { resSchema: ${getImportedZodSchemaName(resolver, endpoint.response)} },`);
4403
+ lines.push(` { resSchema: ${getImportedZodSchemaName(resolver, endpoint.response, tag)} },`);
4404
4404
  lines.push(` \`${getEndpointPath(endpoint)}\`,`);
4405
4405
  if (endpointBody) lines.push(` ${resolver.options.parseRequestParams ? renderInlineEndpointParamParse(resolver, endpointBody, endpointBody.name, tag) : endpointBody.name},`);
4406
4406
  else if (hasUndefinedEndpointBody) lines.push(" undefined,");
@@ -1,4 +1,4 @@
1
- import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as isParamMediaTypeAllowed, 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 GenerateType, x as formatTag, y as isMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-CZBaxU5n.mjs";
1
+ import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as isParamMediaTypeAllowed, 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 GenerateType, x as formatTag, y as isMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-DGox5gzo.mjs";
2
2
  import SwaggerParser from "@apidevtools/swagger-parser";
3
3
 
4
4
  //#region src/generators/core/getMetadataFromOpenAPIDoc.ts
package/dist/sh.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { C as VALIDATION_ERROR_TYPE_TITLE, S as Profiler, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, v as GenerateType } from "./generateCodeFromOpenAPIDoc-CZBaxU5n.mjs";
3
- import { n as resolveConfig, t as runGenerate } from "./generate.runner-Cisrr7pl.mjs";
2
+ import { C as VALIDATION_ERROR_TYPE_TITLE, S as Profiler, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, v as GenerateType } from "./generateCodeFromOpenAPIDoc-DGox5gzo.mjs";
3
+ import { n as resolveConfig, t as runGenerate } from "./generate.runner-C94-P4xF.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import yargs from "yargs";
6
6
  import { hideBin } from "yargs/helpers";
@@ -39,7 +39,7 @@ function logBanner(message) {
39
39
  * Fetch the version from package.json
40
40
  */
41
41
  function getVersion() {
42
- return "3.0.0-rc.7";
42
+ return "3.0.0-rc.8";
43
43
  }
44
44
 
45
45
  //#endregion
package/dist/vite.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Profiler } from "./generateCodeFromOpenAPIDoc-CZBaxU5n.mjs";
2
- import { t as runGenerate } from "./generate.runner-Cisrr7pl.mjs";
1
+ import { S as Profiler } from "./generateCodeFromOpenAPIDoc-DGox5gzo.mjs";
2
+ import { t as runGenerate } from "./generate.runner-C94-P4xF.mjs";
3
3
  import path from "path";
4
4
 
5
5
  //#region src/vite/openapi-codegen.plugin.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "3.0.0-rc.7",
3
+ "version": "3.0.0-rc.8",
4
4
  "keywords": [
5
5
  "codegen",
6
6
  "openapi",