@povio/openapi-codegen-cli 4.0.0-rc.7 → 4.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.
- package/README.md +2 -0
- package/dist/{config-YNXbfpMR.d.mts → config-B0p5wSgi.d.mts} +1 -1
- package/dist/{generate.runner-DVW9l3P3.mjs → generate.runner-uogwMUwr.mjs} +4 -2
- package/dist/{generate.utils-yHZiQdu7.cjs → generate.utils-bln6dgvK.cjs} +1 -0
- package/dist/{generateCodeFromOpenAPIDoc-CW9i6U7J.mjs → generateCodeFromOpenAPIDoc-C820Kywh.mjs} +2 -2
- package/dist/{generateCodeFromOpenAPIDoc-BCtqmKj6.cjs → generateCodeFromOpenAPIDoc-CbO_HdGQ.cjs} +13 -2
- package/dist/generator.d.mts +1 -1
- package/dist/generator.mjs +3 -3
- package/dist/{getDataFromOpenAPIDoc-D0C-UY3I.mjs → getDataFromOpenAPIDoc-DpynDOX1.mjs} +13 -2
- package/dist/index.d.mts +1 -1
- package/dist/metro.cjs +4 -3
- package/dist/metro.d.mts +3 -3
- 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-DmN78sag.mjs → openapi-codegen.runner-C5hSAqn_.mjs} +1 -1
- package/dist/{openapi-source.runner-CqnGK_rg.d.mts → openapi-source.runner-2eigV8ed.d.mts} +1 -1
- package/dist/{options-DQabDsdb.d.mts → options--j07yHYW.d.mts} +2 -0
- package/dist/sh.mjs +7 -3
- package/dist/tiny.d.mts +1 -1
- package/dist/vite.d.mts +3 -3
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,7 @@ bunx openapi-codegen generate --config my-config.ts
|
|
|
119
119
|
--excludeTags Comma-separated list of tags to exclude from generation
|
|
120
120
|
--excludePathRegex Exclude operations whose paths match the given regular expression
|
|
121
121
|
--excludeRedundantZodSchemas Exclude any redundant Zod schemas (default: true)
|
|
122
|
+
--includeSchemas Comma-separated component schemas to generate even when no operation uses them
|
|
122
123
|
|
|
123
124
|
--tsNamespaces Wrap generated files in TypeScript namespaces (default: true)
|
|
124
125
|
--importPath Module import style for generated files (default: 'ts'; options: 'ts' | 'relative' | 'absolute')
|
|
@@ -166,6 +167,7 @@ bunx openapi-codegen generate --config my-config.ts
|
|
|
166
167
|
--excludeTags Comma-separated list of tags to exclude from generation
|
|
167
168
|
--excludePathRegex Exclude operations whose paths match the given regular expression
|
|
168
169
|
--excludeRedundantZodSchemas Exclude any redundant Zod schemas (default: true)
|
|
170
|
+
--includeSchemas Comma-separated component schemas to generate even when no operation uses them
|
|
169
171
|
```
|
|
170
172
|
|
|
171
173
|
## Development
|
|
@@ -447,6 +447,7 @@ const DEFAULT_GENERATE_OPTIONS = {
|
|
|
447
447
|
excludeTags: [],
|
|
448
448
|
excludePathRegex: "",
|
|
449
449
|
excludeRedundantZodSchemas: true,
|
|
450
|
+
includeSchemas: [],
|
|
450
451
|
tsNamespaces: true,
|
|
451
452
|
treeShakeableNamespaces: false,
|
|
452
453
|
tsPath: "@/data",
|
|
@@ -1339,11 +1340,12 @@ function removeEmptyDirectories(root) {
|
|
|
1339
1340
|
}
|
|
1340
1341
|
//#endregion
|
|
1341
1342
|
//#region src/generators/core/resolveConfig.ts
|
|
1342
|
-
function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, inlineEndpointsExcludeModules, workspaceContext, ...options } }) {
|
|
1343
|
+
function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, includeSchemas, inlineEndpointsExcludeModules, workspaceContext, ...options } }) {
|
|
1343
1344
|
const resolvedConfig = deepMerge(DEFAULT_GENERATE_OPTIONS, fileConfig ?? {}, {
|
|
1344
1345
|
...options,
|
|
1345
1346
|
includeTags: includeTags?.split(","),
|
|
1346
1347
|
excludeTags: excludeTags?.split(","),
|
|
1348
|
+
includeSchemas: includeSchemas?.split(","),
|
|
1347
1349
|
inlineEndpointsExcludeModules: inlineEndpointsExcludeModules?.split(","),
|
|
1348
1350
|
workspaceContext: workspaceContext?.split(",")
|
|
1349
1351
|
});
|
|
@@ -1479,7 +1481,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
|
|
|
1479
1481
|
const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
|
|
1480
1482
|
if (nativeFiles) return nativeFiles;
|
|
1481
1483
|
}
|
|
1482
|
-
const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-
|
|
1484
|
+
const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-C820Kywh.mjs").then((n) => n.n);
|
|
1483
1485
|
return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
|
|
1484
1486
|
source: nativeInput.source,
|
|
1485
1487
|
yaml: nativeInput.yaml
|
package/dist/{generateCodeFromOpenAPIDoc-CW9i6U7J.mjs → generateCodeFromOpenAPIDoc-C820Kywh.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as isQuery, i as isMutation, n as getDestructuredVariables, r as isInfiniteQuery, s as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-
|
|
2
|
-
import { $t as AXIOS_DEFAULT_IMPORT_NAME, A as getAbilityConditionType, B as getImportedZodSchemaInferedTypeName, C as getTagFileName, D as getImportPath, E as getEndpointsImports, Et as isParamMediaTypeAllowed, F as getAbilitySubjectTypes, G as getZodSchemaType, H as getZodSchemaDescription, I as getAclData, J as getUniqueArray, K as getSchemaDescriptions, L as getAppAbilitiesType, Lt as isReferenceObject, M as getAbilityDescription, N as getAbilityFunctionName, O as getModelsImports, P as getAbilitySubject, Pt as wrapWithQuotesIfNeeded, Qt as ZOD_IMPORT, R as hasAbilityConditions, Rt as isSchemaObject, S as getQueryTypesImportPath, T as getAclImports, U as getZodSchemaInferedTypeName, V as getImportedZodSchemaName, W as getZodSchemaPropertyDescriptions, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _n as trimTrailingWhitespace, _t as getNamespaceName, an as NATIVE_RESPONSE_TYPE, at as APP_REST_CLIENT_FILE, b as getFileNameWithExtension, c as getEndpointBody, cn as getEndpointTag, ct as MUTATION_EFFECTS, d as getEndpointPath, dn as shouldInlineEndpointsForTag, dt as QUERY_OPTIONS_TYPES, en as AXIOS_IMPORT, f as getImportedEndpointName, fn as capitalize, ft as ZOD_EXTENDED, g as requiresBody, gn as snakeToCamel, gt as REST_PACKAGE_IMPORT_PATH, h as renderMediaUploadMutationBody, ht as NATIVE_PACKAGE_IMPORT_PATH, i as shouldUseNativeCodegen, it as isNamedZodSchema, j as getAbilityConditionsTypes, k as getAbilityAction, l as getEndpointConfig, lt as QUERY_MODULES_FILE, m as mapEndpointParamsToFunctionParams, mt as CONFIG_PACKAGE_IMPORT_PATH, nn as AXIOS_REQUEST_CONFIG_TYPE, o as getOutputFileName, on as getRequestConfigTypeName, ot as APP_REST_CLIENT_NAME, p as hasEndpointConfig, pt as AXIOS_PACKAGE_IMPORT_PATH, r as compileNativeData, rt as isEnumZodSchema, st as DOMAIN_ERRORS_FILE, tn as AXIOS_REQUEST_CONFIG_NAME, u as getEndpointName, ut as QUERY_MODULE_ENUM, vn as Profiler, w as getTagImportPath, x as getQueryModulesImportPath, y as getAppRestClientImportPath, z as renderAclCheckCall } from "./generate.runner-
|
|
1
|
+
import { a as isQuery, i as isMutation, n as getDestructuredVariables, r as isInfiniteQuery, s as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-DpynDOX1.mjs";
|
|
2
|
+
import { $t as AXIOS_DEFAULT_IMPORT_NAME, A as getAbilityConditionType, B as getImportedZodSchemaInferedTypeName, C as getTagFileName, D as getImportPath, E as getEndpointsImports, Et as isParamMediaTypeAllowed, F as getAbilitySubjectTypes, G as getZodSchemaType, H as getZodSchemaDescription, I as getAclData, J as getUniqueArray, K as getSchemaDescriptions, L as getAppAbilitiesType, Lt as isReferenceObject, M as getAbilityDescription, N as getAbilityFunctionName, O as getModelsImports, P as getAbilitySubject, Pt as wrapWithQuotesIfNeeded, Qt as ZOD_IMPORT, R as hasAbilityConditions, Rt as isSchemaObject, S as getQueryTypesImportPath, T as getAclImports, U as getZodSchemaInferedTypeName, V as getImportedZodSchemaName, W as getZodSchemaPropertyDescriptions, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _n as trimTrailingWhitespace, _t as getNamespaceName, an as NATIVE_RESPONSE_TYPE, at as APP_REST_CLIENT_FILE, b as getFileNameWithExtension, c as getEndpointBody, cn as getEndpointTag, ct as MUTATION_EFFECTS, d as getEndpointPath, dn as shouldInlineEndpointsForTag, dt as QUERY_OPTIONS_TYPES, en as AXIOS_IMPORT, f as getImportedEndpointName, fn as capitalize, ft as ZOD_EXTENDED, g as requiresBody, gn as snakeToCamel, gt as REST_PACKAGE_IMPORT_PATH, h as renderMediaUploadMutationBody, ht as NATIVE_PACKAGE_IMPORT_PATH, i as shouldUseNativeCodegen, it as isNamedZodSchema, j as getAbilityConditionsTypes, k as getAbilityAction, l as getEndpointConfig, lt as QUERY_MODULES_FILE, m as mapEndpointParamsToFunctionParams, mt as CONFIG_PACKAGE_IMPORT_PATH, nn as AXIOS_REQUEST_CONFIG_TYPE, o as getOutputFileName, on as getRequestConfigTypeName, ot as APP_REST_CLIENT_NAME, p as hasEndpointConfig, pt as AXIOS_PACKAGE_IMPORT_PATH, r as compileNativeData, rt as isEnumZodSchema, st as DOMAIN_ERRORS_FILE, tn as AXIOS_REQUEST_CONFIG_NAME, u as getEndpointName, ut as QUERY_MODULE_ENUM, vn as Profiler, w as getTagImportPath, x as getQueryModulesImportPath, y as getAppRestClientImportPath, z as renderAclCheckCall } from "./generate.runner-uogwMUwr.mjs";
|
|
3
3
|
import "node:module";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
5
|
var __defProp = Object.defineProperty;
|
package/dist/{generateCodeFromOpenAPIDoc-BCtqmKj6.cjs → generateCodeFromOpenAPIDoc-CbO_HdGQ.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_generate_utils = require("./generate.utils-
|
|
1
|
+
const require_generate_utils = require("./generate.utils-bln6dgvK.cjs");
|
|
2
2
|
let openapi_types = require("openapi-types");
|
|
3
3
|
//#region src/generators/const/acl.const.ts
|
|
4
4
|
const ACL_APP_ABILITY_FILE = {
|
|
@@ -1515,9 +1515,10 @@ function getZodSchemasFromOpenAPIDoc(resolver, profiler) {
|
|
|
1515
1515
|
const p = profiler ?? new require_generate_utils.Profiler(false);
|
|
1516
1516
|
const zodSchemas = {};
|
|
1517
1517
|
const enumZodSchemas = {};
|
|
1518
|
+
const includedSchemaRefs = getIncludedSchemaRefs(resolver);
|
|
1518
1519
|
Object.entries(resolver.openApiDoc.components?.schemas ?? {}).forEach(([name, schema]) => p.runSync("zod.extract.schemaEntry", () => {
|
|
1519
1520
|
const schemaData = resolver.getSchemaDataByName(name);
|
|
1520
|
-
if (resolver.options.excludeRedundantZodSchemas && (!schemaData || schemaData.deepRefOperations.length === 0 && schemaData.tags.length === 0)) return;
|
|
1521
|
+
if (resolver.options.excludeRedundantZodSchemas && !includedSchemaRefs.has(`#/components/schemas/${name}`) && (!schemaData || schemaData.deepRefOperations.length === 0 && schemaData.tags.length === 0)) return;
|
|
1521
1522
|
const zodSchemaName = require_generate_utils.getZodSchemaName(name, resolver.options.schemaSuffix);
|
|
1522
1523
|
if (zodSchemas[zodSchemaName]) return;
|
|
1523
1524
|
const tag = resolver.getTagByZodSchemaName(zodSchemaName);
|
|
@@ -1541,6 +1542,16 @@ function getZodSchemasFromOpenAPIDoc(resolver, profiler) {
|
|
|
1541
1542
|
enumZodSchemas
|
|
1542
1543
|
};
|
|
1543
1544
|
}
|
|
1545
|
+
/** The `includeSchemas` components and every schema they depend on. */
|
|
1546
|
+
function getIncludedSchemaRefs(resolver) {
|
|
1547
|
+
const refs = /* @__PURE__ */ new Set();
|
|
1548
|
+
for (const name of resolver.options.includeSchemas) {
|
|
1549
|
+
const ref = `#/components/schemas/${name}`;
|
|
1550
|
+
refs.add(ref);
|
|
1551
|
+
resolver.dependencyGraph.deepDependencyGraph[ref]?.forEach((dependency) => refs.add(dependency));
|
|
1552
|
+
}
|
|
1553
|
+
return refs;
|
|
1554
|
+
}
|
|
1544
1555
|
function getEnumZodSchemasFromOpenAPIDoc(resolver) {
|
|
1545
1556
|
const enumZodSchemas = [];
|
|
1546
1557
|
Object.entries(resolver.openApiDoc.components?.schemas ?? {}).forEach(([name, schema]) => {
|
package/dist/generator.d.mts
CHANGED
package/dist/generator.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as getQueryName, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-
|
|
2
|
-
import { a as isQuery, i as isMutation, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-
|
|
3
|
-
import { Et as isParamMediaTypeAllowed, Tt as isMediaTypeAllowed, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _ as getSchemaTsMetaType, _t as getNamespaceName, sn as formatTag, t as getOpenApiDoc, v as getTsTypeBase, w as getTagImportPath } from "./generate.runner-
|
|
1
|
+
import { r as getQueryName, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-C820Kywh.mjs";
|
|
2
|
+
import { a as isQuery, i as isMutation, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-DpynDOX1.mjs";
|
|
3
|
+
import { Et as isParamMediaTypeAllowed, Tt as isMediaTypeAllowed, X as invalidVariableNameCharactersToCamel, Y as DEFAULT_GENERATE_OPTIONS, _ as getSchemaTsMetaType, _t as getNamespaceName, sn as formatTag, t as getOpenApiDoc, v as getTsTypeBase, w as getTagImportPath } from "./generate.runner-uogwMUwr.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 { $ as getParamZodSchemaName, At as pathParamToVariableName, Bt as ALLOWED_PATH_IN, Ct as isErrorStatus, Dt as isPathExcluded, Et as isParamMediaTypeAllowed, Ft as inferRequiredSchema, Gt as ENUM_SCHEMA, Ht as BLOB_SCHEMA, It as isArraySchemaObject, J as getUniqueArray, Jt as STRING_SCHEMA, Kt as INT_SCHEMA, Lt as isReferenceObject, Mt as replaceHyphenatedPath, Nt as unwrapQuotesIfNeeded, Ot as isPrimitiveType, Pt as wrapWithQuotesIfNeeded, Q as getEnumZodSchemaName, Rt as isSchemaObject, St as getSchemaRef, Tt as isMediaTypeAllowed, Ut as DATETIME_SCHEMA, Vt as ANY_SCHEMA, Wt as EMAIL_SCHEMA, X as invalidVariableNameCharactersToCamel, Xt as UUID_SCHEMA, Yt as URL_SCHEMA, Z as getBodyZodSchemaName, Zt as VOID_SCHEMA, _t as getNamespaceName, bt as getParameterEnumNames, cn as getEndpointTag, et as getResponseZodSchemaName, fn as capitalize, gn as snakeToCamel, hn as removeWord, in as JSON_APPLICATION_FORMAT, it as isNamedZodSchema, jt as pathToVariableName, kt as isSortingParameterObject, ln as getOperationTag, m as mapEndpointParamsToFunctionParams, mn as getMostCommonAdjacentCombinationSplit, nt as getZodSchemaOperationName, pn as decapitalize, q as iterateSchema, qt as NUMBER_SCHEMA, rn as BODY_PARAMETER_NAME, s as pick, sn as formatTag, tt as getZodSchemaName, un as isTagIncluded, vn as Profiler, vt as autocorrectRef, wt as isMainResponseStatus, xt as getSchemaNameByRef, yt as escapeControlCharacters, zt as ALLOWED_METHODS } from "./generate.runner-
|
|
1
|
+
import { $ as getParamZodSchemaName, At as pathParamToVariableName, Bt as ALLOWED_PATH_IN, Ct as isErrorStatus, Dt as isPathExcluded, Et as isParamMediaTypeAllowed, Ft as inferRequiredSchema, Gt as ENUM_SCHEMA, Ht as BLOB_SCHEMA, It as isArraySchemaObject, J as getUniqueArray, Jt as STRING_SCHEMA, Kt as INT_SCHEMA, Lt as isReferenceObject, Mt as replaceHyphenatedPath, Nt as unwrapQuotesIfNeeded, Ot as isPrimitiveType, Pt as wrapWithQuotesIfNeeded, Q as getEnumZodSchemaName, Rt as isSchemaObject, St as getSchemaRef, Tt as isMediaTypeAllowed, Ut as DATETIME_SCHEMA, Vt as ANY_SCHEMA, Wt as EMAIL_SCHEMA, X as invalidVariableNameCharactersToCamel, Xt as UUID_SCHEMA, Yt as URL_SCHEMA, Z as getBodyZodSchemaName, Zt as VOID_SCHEMA, _t as getNamespaceName, bt as getParameterEnumNames, cn as getEndpointTag, et as getResponseZodSchemaName, fn as capitalize, gn as snakeToCamel, hn as removeWord, in as JSON_APPLICATION_FORMAT, it as isNamedZodSchema, jt as pathToVariableName, kt as isSortingParameterObject, ln as getOperationTag, m as mapEndpointParamsToFunctionParams, mn as getMostCommonAdjacentCombinationSplit, nt as getZodSchemaOperationName, pn as decapitalize, q as iterateSchema, qt as NUMBER_SCHEMA, rn as BODY_PARAMETER_NAME, s as pick, sn as formatTag, tt as getZodSchemaName, un as isTagIncluded, vn as Profiler, vt as autocorrectRef, wt as isMainResponseStatus, xt as getSchemaNameByRef, yt as escapeControlCharacters, zt as ALLOWED_METHODS } from "./generate.runner-uogwMUwr.mjs";
|
|
2
2
|
import { OpenAPIV3 } from "openapi-types";
|
|
3
3
|
//#region src/generators/const/validation.const.ts
|
|
4
4
|
const HTTP_STATUS_CODES = {
|
|
@@ -1507,9 +1507,10 @@ function getZodSchemasFromOpenAPIDoc(resolver, profiler) {
|
|
|
1507
1507
|
const p = profiler ?? new Profiler(false);
|
|
1508
1508
|
const zodSchemas = {};
|
|
1509
1509
|
const enumZodSchemas = {};
|
|
1510
|
+
const includedSchemaRefs = getIncludedSchemaRefs(resolver);
|
|
1510
1511
|
Object.entries(resolver.openApiDoc.components?.schemas ?? {}).forEach(([name, schema]) => p.runSync("zod.extract.schemaEntry", () => {
|
|
1511
1512
|
const schemaData = resolver.getSchemaDataByName(name);
|
|
1512
|
-
if (resolver.options.excludeRedundantZodSchemas && (!schemaData || schemaData.deepRefOperations.length === 0 && schemaData.tags.length === 0)) return;
|
|
1513
|
+
if (resolver.options.excludeRedundantZodSchemas && !includedSchemaRefs.has(`#/components/schemas/${name}`) && (!schemaData || schemaData.deepRefOperations.length === 0 && schemaData.tags.length === 0)) return;
|
|
1513
1514
|
const zodSchemaName = getZodSchemaName(name, resolver.options.schemaSuffix);
|
|
1514
1515
|
if (zodSchemas[zodSchemaName]) return;
|
|
1515
1516
|
const tag = resolver.getTagByZodSchemaName(zodSchemaName);
|
|
@@ -1533,6 +1534,16 @@ function getZodSchemasFromOpenAPIDoc(resolver, profiler) {
|
|
|
1533
1534
|
enumZodSchemas
|
|
1534
1535
|
};
|
|
1535
1536
|
}
|
|
1537
|
+
/** The `includeSchemas` components and every schema they depend on. */
|
|
1538
|
+
function getIncludedSchemaRefs(resolver) {
|
|
1539
|
+
const refs = /* @__PURE__ */ new Set();
|
|
1540
|
+
for (const name of resolver.options.includeSchemas) {
|
|
1541
|
+
const ref = `#/components/schemas/${name}`;
|
|
1542
|
+
refs.add(ref);
|
|
1543
|
+
resolver.dependencyGraph.deepDependencyGraph[ref]?.forEach((dependency) => refs.add(dependency));
|
|
1544
|
+
}
|
|
1545
|
+
return refs;
|
|
1546
|
+
}
|
|
1536
1547
|
function getEnumZodSchemasFromOpenAPIDoc(resolver) {
|
|
1537
1548
|
const enumZodSchemas = [];
|
|
1538
1549
|
Object.entries(resolver.openApiDoc.components?.schemas ?? {}).forEach(([name, schema]) => {
|
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { a as RestClient, i as Response, n as RequestConfig, o as RestIntercepto
|
|
|
5
5
|
import { n as useWorkspaceContext, r as OpenApiRouter, t as OpenApiWorkspaceContext } from "./workspace.context-isVY9ves.mjs";
|
|
6
6
|
import { a as MergedMutationVariables, c as OpenApiQueryConfig, i as MergedMutationValues, l as QueryModule, n as InvalidationMapFunc, o as MutationEffectsOf, r as MergedMutationData, s as MutationEffectsTypes, t as InvalidationMap, u as RegisteredQueryModule } from "./queryConfig.context-DwVQWbtL.mjs";
|
|
7
7
|
import { t as RestUtils } from "./rest.utils-DpiFIdhF.mjs";
|
|
8
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
8
|
+
import { t as OpenAPICodegenConfig } from "./config-B0p5wSgi.mjs";
|
|
9
9
|
import { d as TransportResponse, l as TransportRequest, n as HttpError, p as UploadProgress, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
|
|
10
10
|
import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-DZxdDcpz.mjs";
|
|
11
11
|
import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-I4y5WUkj.mjs";
|
package/dist/metro.cjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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-bln6dgvK.cjs");
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
fs = require_generate_utils.__toESM(fs, 1);
|
|
5
5
|
let path = require("path");
|
|
6
6
|
path = require_generate_utils.__toESM(path, 1);
|
|
7
7
|
let url = require("url");
|
|
8
8
|
//#region src/generators/core/resolveConfig.ts
|
|
9
|
-
function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, inlineEndpointsExcludeModules, workspaceContext, ...options } }) {
|
|
9
|
+
function resolveConfig({ fileConfig = {}, params: { includeTags, excludeTags, includeSchemas, inlineEndpointsExcludeModules, workspaceContext, ...options } }) {
|
|
10
10
|
const resolvedConfig = require_generate_utils.deepMerge(require_generate_utils.DEFAULT_GENERATE_OPTIONS, fileConfig ?? {}, {
|
|
11
11
|
...options,
|
|
12
12
|
includeTags: includeTags?.split(","),
|
|
13
13
|
excludeTags: excludeTags?.split(","),
|
|
14
|
+
includeSchemas: includeSchemas?.split(","),
|
|
14
15
|
inlineEndpointsExcludeModules: inlineEndpointsExcludeModules?.split(","),
|
|
15
16
|
workspaceContext: workspaceContext?.split(",")
|
|
16
17
|
});
|
|
@@ -106,7 +107,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
|
|
|
106
107
|
const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
|
|
107
108
|
if (nativeFiles) return nativeFiles;
|
|
108
109
|
}
|
|
109
|
-
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-
|
|
110
|
+
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-CbO_HdGQ.cjs"));
|
|
110
111
|
return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
|
|
111
112
|
source: nativeInput.source,
|
|
112
113
|
yaml: nativeInput.yaml
|
package/dist/metro.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as GenerateFileFormatter } from "./options
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-
|
|
1
|
+
import { n as GenerateFileFormatter } from "./options--j07yHYW.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-B0p5wSgi.mjs";
|
|
3
|
+
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-2eigV8ed.mjs";
|
|
4
4
|
import { IncomingMessage, ServerResponse } from "http";
|
|
5
5
|
//#region src/metro/openapi-codegen.plugin.d.ts
|
|
6
6
|
type OpenApiCodegenMetroConfig = OpenAPICodegenConfig & {
|
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-C5hSAqn_.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 { n as runGenerate, vn as Profiler } from "./generate.runner-
|
|
1
|
+
import { n as runGenerate, vn as Profiler } from "./generate.runner-uogwMUwr.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
//#region src/plugins/openapi-codegen.runner.ts
|
|
4
4
|
function createOpenApiCodegenRunner(config, options = {}) {
|
|
@@ -87,6 +87,8 @@ interface BaseGenerateOptions {
|
|
|
87
87
|
excludeTags: string[];
|
|
88
88
|
excludePathRegex: string;
|
|
89
89
|
excludeRedundantZodSchemas: boolean;
|
|
90
|
+
/** Component schemas to generate even when no included operation uses them, with their dependencies. */
|
|
91
|
+
includeSchemas: string[];
|
|
90
92
|
tsNamespaces: boolean;
|
|
91
93
|
treeShakeableNamespaces?: boolean;
|
|
92
94
|
tsPath: string;
|
package/dist/sh.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { c as VALIDATION_ERROR_TYPE_TITLE, o as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-
|
|
3
|
-
import { C as getTagFileName, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc, vn as Profiler } from "./generate.runner-
|
|
2
|
+
import { c as VALIDATION_ERROR_TYPE_TITLE, o as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-DpynDOX1.mjs";
|
|
3
|
+
import { C as getTagFileName, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc, vn as Profiler } from "./generate.runner-uogwMUwr.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 "4.0.0-rc.
|
|
34
|
+
return "4.0.0-rc.8";
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/helpers/yargs.helper.ts
|
|
@@ -183,6 +183,7 @@ var CheckOptions = class {
|
|
|
183
183
|
excludeTags;
|
|
184
184
|
excludePathRegex;
|
|
185
185
|
excludeRedundantZodSchemas;
|
|
186
|
+
includeSchemas;
|
|
186
187
|
verbose;
|
|
187
188
|
};
|
|
188
189
|
__decorate([YargOption({ envAlias: "config" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "config", void 0);
|
|
@@ -199,6 +200,7 @@ __decorate([YargOption({
|
|
|
199
200
|
envAlias: "excludeRedundantZodSchemas",
|
|
200
201
|
type: "boolean"
|
|
201
202
|
}), __decorateMetadata("design:type", Boolean)], CheckOptions.prototype, "excludeRedundantZodSchemas", void 0);
|
|
203
|
+
__decorate([YargOption({ envAlias: "includeSchemas" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "includeSchemas", void 0);
|
|
202
204
|
__decorate([YargOption({
|
|
203
205
|
envAlias: "verbose",
|
|
204
206
|
default: false,
|
|
@@ -266,6 +268,7 @@ var GenerateOptions = class {
|
|
|
266
268
|
excludeTags;
|
|
267
269
|
excludePathRegex;
|
|
268
270
|
excludeRedundantZodSchemas;
|
|
271
|
+
includeSchemas;
|
|
269
272
|
importPath;
|
|
270
273
|
compileSchemas;
|
|
271
274
|
lazySchemas;
|
|
@@ -326,6 +329,7 @@ __decorate([YargOption({
|
|
|
326
329
|
envAlias: "excludeRedundantZodSchemas",
|
|
327
330
|
type: "boolean"
|
|
328
331
|
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "excludeRedundantZodSchemas", void 0);
|
|
332
|
+
__decorate([YargOption({ envAlias: "includeSchemas" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "includeSchemas", void 0);
|
|
329
333
|
__decorate([YargOption({ envAlias: "importPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "importPath", void 0);
|
|
330
334
|
__decorate([YargOption({
|
|
331
335
|
envAlias: "compileSchemas",
|
package/dist/tiny.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-
|
|
1
|
+
import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-2eigV8ed.mjs";
|
|
2
2
|
export { AclRule, AnyContractRouter, AnySchema, GenerateORPCOpenAPISpecOptions, GenerateOpenApiFile, GenerateOpenApiFileOptions, GenerateOpenApiFileResult, GenerateOpenApiSpec, GenerateTinyOpenApiFileOptions, JsonObject, OpenApiSchemaRegistry, ProcedureMeta, TinyOpenApiModule, type TinyOpenApiSourceRunnerConfig, TinyOpenApiUserRole, ZodSchema, addContractSchema, applyEnumExtensions, applyOperationMeta, applyPaginatedItemSchemas, applyParameterExtensions, applyRobodevModuleExtensions, applyRobodevUserRolesExtension, asStringArray, collectApiModelSchemaExports, collectContractSchemaRoots, collectContractSchemas, collectDbTableModelSchemaExport, collectDbTableModelSchemaExports, collectExtraSchemas, collectModelSchemaExports, collectModuleModelSchemaExports, collectOperationMeta, collectOperationTags, collectReachableModelSchemas, collectSchemaRegistryRoots, compactTagName, createModelSchemaNameGetter, createTinyOpenApiSourceRunner, defineOpenApiSchemas, findComponentEnumNames, findEnumNames, generateORPCOpenAPISpec, generateOpenApiFile, getComponentSchemas, getContractProcedureData, getDerivedOperationId, getModuleOpenApiController, getModuleOpenApiTag, getObjectPropertySchema, getOpenApiSchemaName, getOperationAction, getOperationController, getPaginatedItemSchema, getProcedureInputSchemaRole, getRobodevModuleRoles, getStringEnumValues, getLocalInputPath as getTinyOpenApiLocalInputPath, isContractProcedure, isNullSchema, isNullableOnlySchema, isObject, isProcedureMeta, isTinyOpenApiFakeMode, isZodSchema, modelSchemaExportName, modelSchemaNameEntries, namedControllerActionInputDtoSchema, namedControllerActionSchema, namedOpenApiOutputSchema, namedOpenApiRequestSchema, namedOpenApiResponseSchema, namedOpenApiSchema, normalizeWatchFolders as normalizeTinyOpenApiWatchFolders, operationKey, procedureSchemaName, resolveOpenApiOutputPath, routeHasPathParameters, schemaComponentRef, schemaExportName, sharedSchemaExportName, stripNoContentResponseBodies, toOpenAPI30Document, toOpenAPI30Schema, toOpenAPIAclRule, toPascalCase, visitZodSchema };
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as GenerateFileFormatter } from "./options
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-
|
|
1
|
+
import { n as GenerateFileFormatter } from "./options--j07yHYW.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-B0p5wSgi.mjs";
|
|
3
|
+
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-2eigV8ed.mjs";
|
|
4
4
|
import { Plugin, PluginOption } from "vite";
|
|
5
5
|
//#region src/plugins/openapi-codegen.runner.d.ts
|
|
6
6
|
type OpenApiCodegenPluginConfig = OpenAPICodegenConfig & {
|
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-C5hSAqn_.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