@povio/openapi-codegen-cli 4.0.0-rc.7 → 4.0.0-rc.9

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 CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  Axios is required when using the Axios transport (the default) or the `/axios` entry point. Projects using the native transport can omit Axios: generate with `--restClient native` and import `NativeRestClient` from `@povio/openapi-codegen-cli/native`. The root exports remain available for compatibility and support tree-shaking in consumer bundles. For direct runtime imports without bundling, use `/native` and `/errors` to avoid loading the Axios client. The `/axios` entry point is also available for Axios-specific imports. CLI-only usage and the `/generator`, `/tiny`, `/vite`, and `/metro` entry points do not require Axios.
10
10
 
11
+ ACL features require `@casl/ability@^7.1.1` and `@casl/react@^7.1.0`. When migrating to CASL 7, regenerate the client so `AppAbility` uses `Ability` instead of `PureAbility`, and update any handwritten CASL types. The runtime continues to use `createMongoAbility` for condition matching. CASL 7 treats empty conditions (`{}`) as matching everything. The `Can` helper keeps its `use` tuple and `(isAllowed, ability)` render callback.
12
+
11
13
  Use this tool to generate code (Zod schemas, TypeScript types, API definitions, and React queries) from an OpenAPI v3 specification. API definitions use a REST client wrapper with either Axios or the native transport. React queries are generated in alignment with our code standards, without the need for explicit types.
12
14
 
13
15
  The tool partially leverages code from [openapi-zod-client](https://github.com/astahmer/openapi-zod-client) repository.
@@ -119,6 +121,7 @@ bunx openapi-codegen generate --config my-config.ts
119
121
  --excludeTags Comma-separated list of tags to exclude from generation
120
122
  --excludePathRegex Exclude operations whose paths match the given regular expression
121
123
  --excludeRedundantZodSchemas Exclude any redundant Zod schemas (default: true)
124
+ --includeSchemas Comma-separated component schemas to generate even when no operation uses them
122
125
 
123
126
  --tsNamespaces Wrap generated files in TypeScript namespaces (default: true)
124
127
  --importPath Module import style for generated files (default: 'ts'; options: 'ts' | 'relative' | 'absolute')
@@ -166,6 +169,7 @@ bunx openapi-codegen generate --config my-config.ts
166
169
  --excludeTags Comma-separated list of tags to exclude from generation
167
170
  --excludePathRegex Exclude operations whose paths match the given regular expression
168
171
  --excludeRedundantZodSchemas Exclude any redundant Zod schemas (default: true)
172
+ --includeSchemas Comma-separated component schemas to generate even when no operation uses them
169
173
  ```
170
174
 
171
175
  ## Development
package/dist/acl.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { a as ErrorHandler } from "./error-handling-BpAQHWrU.mjs";
2
- import { PropsWithChildren } from "react";
3
- import { AbilityTuple, PureAbility, RawRuleOf, Subject } from "@casl/ability";
2
+ import { PropsWithChildren, ReactNode } from "react";
3
+ import { Ability, AbilityTuple, RawRuleOf, Subject } from "@casl/ability";
4
4
  import { PackRule } from "@casl/ability/extra";
5
- import { BoundCanProps } from "@casl/react";
5
+ import { CanProps } from "@casl/react";
6
6
  //#region src/lib/acl/appAbility.types.d.ts
7
7
  type AppAbilities = AbilityTuple<string, Subject>;
8
- type AppAbility = PureAbility<AppAbilities>;
8
+ type AppAbility = Ability<AppAbilities>;
9
9
  //#endregion
10
10
  //#region src/lib/acl/ability.context.d.ts
11
11
  declare namespace AbilityContext {
@@ -16,7 +16,7 @@ declare namespace AbilityContext {
16
16
  } | null;
17
17
  }
18
18
  export const Provider: ({ children }: PropsWithChildren<ProviderProps>) => import("react").JSX.Element;
19
- export const useAbility: <TAppAbilities extends AppAbilities = AppAbilities>() => PureAbility<TAppAbilities>;
19
+ export const useAbility: <TAppAbilities extends AppAbilities = AppAbilities>() => Ability<TAppAbilities>;
20
20
  export {};
21
21
  }
22
22
  //#endregion
@@ -28,11 +28,11 @@ interface AclGuardProps<TAppAbilities extends AppAbilities = AppAbilities> {
28
28
  declare const createAclGuard: <TAppAbilities extends AppAbilities = AppAbilities>() => ({ canUse, redirectTo, children }: PropsWithChildren<AclGuardProps<TAppAbilities>>) => import("react").ReactNode;
29
29
  //#endregion
30
30
  //#region src/lib/acl/Can.d.ts
31
- type CanAbility = PureAbility<AbilityTuple<AppAbilities[0], AppAbilities[1]>>;
32
- type CanProps<TAppAbilities extends AppAbilities = AppAbilities> = {
31
+ type CanProps$1<TAppAbilities extends AppAbilities = AppAbilities> = {
33
32
  use: TAppAbilities;
34
- } & Omit<BoundCanProps<CanAbility>, "do" | "I" | "on" | "a" | "an" | "this">;
35
- declare const Can: <TAppAbilities extends AppAbilities = AppAbilities>({ use, ...props }: CanProps<TAppAbilities>) => import("react").JSX.Element;
33
+ children: ReactNode | ((isAllowed: boolean, ability: AppAbility) => ReactNode);
34
+ } & Omit<CanProps<AppAbility>, "do" | "I" | "on" | "a" | "an" | "this" | "children">;
35
+ declare const Can: <TAppAbilities extends AppAbilities = AppAbilities>({ use, children, ...props }: CanProps$1<TAppAbilities>) => import("react").JSX.Element;
36
36
  //#endregion
37
37
  //#region src/lib/acl/useAclCheck.d.ts
38
38
  interface UseAclCheckProps {
package/dist/acl.mjs CHANGED
@@ -5,7 +5,7 @@ import { createContext, useCallback, useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { AbilityBuilder, createMongoAbility } from "@casl/ability";
7
7
  import { unpackRules } from "@casl/ability/extra";
8
- import { createContextualCan, useAbility } from "@casl/react";
8
+ import { AbilityProvider, Can as Can$1, useAbility } from "@casl/react";
9
9
  //#region src/lib/acl/ability.context.tsx
10
10
  let AbilityContext;
11
11
  (function(_AbilityContext) {
@@ -27,11 +27,14 @@ let AbilityContext;
27
27
  }, [user]);
28
28
  return /* @__PURE__ */ jsx(Context.Provider, {
29
29
  value: ability,
30
- children
30
+ children: /* @__PURE__ */ jsx(AbilityProvider, {
31
+ value: ability,
32
+ children
33
+ })
31
34
  });
32
35
  };
33
36
  _AbilityContext.useAbility = () => {
34
- return useAbility(Context);
37
+ return useAbility();
35
38
  };
36
39
  })(AbilityContext || (AbilityContext = {}));
37
40
  //#endregion
@@ -47,13 +50,13 @@ const createAclGuard = () => ({ canUse, redirectTo = "/", children }) => {
47
50
  };
48
51
  //#endregion
49
52
  //#region src/lib/acl/Can.tsx
50
- const ContextualCan = createContextualCan(AbilityContext.Consumer);
51
- const Can = ({ use, ...props }) => {
53
+ const Can = ({ use, children, ...props }) => {
52
54
  const [action, subject] = use;
53
- return /* @__PURE__ */ jsx(ContextualCan, {
55
+ return /* @__PURE__ */ jsx(Can$1, {
54
56
  ...props,
55
57
  do: action,
56
- on: subject
58
+ on: subject,
59
+ children: typeof children === "function" ? ({ isAllowed, ability }) => props.passThrough || isAllowed ? children(isAllowed, ability) : null : children
57
60
  });
58
61
  };
59
62
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as GenerateOptions } from "./options-DQabDsdb.mjs";
1
+ import { t as GenerateOptions } from "./options--j07yHYW.mjs";
2
2
  //#region src/generators/types/config.d.ts
3
3
  type OpenAPICodegenConfig = Partial<GenerateOptions>;
4
4
  //#endregion
@@ -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-CW9i6U7J.mjs").then((n) => n.n);
1484
+ const { generateCodeFromOpenAPIDoc } = await import("./generateCodeFromOpenAPIDoc-uswCSFZ_.mjs").then((n) => n.n);
1483
1485
  return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
1484
1486
  source: nativeInput.source,
1485
1487
  yaml: nativeInput.yaml
@@ -74,6 +74,7 @@ const DEFAULT_GENERATE_OPTIONS = {
74
74
  excludeTags: [],
75
75
  excludePathRegex: "",
76
76
  excludeRedundantZodSchemas: true,
77
+ includeSchemas: [],
77
78
  tsNamespaces: true,
78
79
  treeShakeableNamespaces: false,
79
80
  tsPath: "@/data",
@@ -1,4 +1,4 @@
1
- const require_generate_utils = require("./generate.utils-yHZiQdu7.cjs");
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 = {
@@ -9,7 +9,7 @@ const ACL_APP_ABILITIES = "AppAbilities";
9
9
  const ACL_CHECK_HOOK = "useAclCheck";
10
10
  const CASL_ABILITY_BINDING = {
11
11
  abilityTuple: "AbilityTuple",
12
- pureAbility: "PureAbility",
12
+ ability: "Ability",
13
13
  forcedSubject: "ForcedSubject",
14
14
  subjectType: "Subject",
15
15
  subject: "subject"
@@ -17,7 +17,7 @@ const CASL_ABILITY_BINDING = {
17
17
  const CASL_ABILITY_IMPORT = {
18
18
  bindings: [
19
19
  CASL_ABILITY_BINDING.abilityTuple,
20
- CASL_ABILITY_BINDING.pureAbility,
20
+ CASL_ABILITY_BINDING.ability,
21
21
  CASL_ABILITY_BINDING.forcedSubject,
22
22
  CASL_ABILITY_BINDING.subjectType,
23
23
  CASL_ABILITY_BINDING.subject
@@ -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]) => {
@@ -2118,7 +2129,7 @@ function generateAppAcl({ resolver, data }) {
2118
2129
  const caslAbilityTupleImport = {
2119
2130
  bindings: [],
2120
2131
  typeBindings: [
2121
- CASL_ABILITY_BINDING.pureAbility,
2132
+ CASL_ABILITY_BINDING.ability,
2122
2133
  CASL_ABILITY_BINDING.abilityTuple,
2123
2134
  ...!appAbilitiesType ? [CASL_ABILITY_BINDING.subjectType] : [],
2124
2135
  ...hasAdditionalAbilityImports ? [CASL_ABILITY_BINDING.forcedSubject] : []
@@ -2135,7 +2146,7 @@ function generateAppAcl({ resolver, data }) {
2135
2146
  for (const [action, subjects] of Object.entries(appAbilitiesType)) lines.push(`| ${CASL_ABILITY_BINDING.abilityTuple}<"${action}", ${subjects.join(" | ")}>`);
2136
2147
  } else lines.push(`export type ${ACL_APP_ABILITIES} = ${CASL_ABILITY_BINDING.abilityTuple}<string, ${CASL_ABILITY_BINDING.subjectType}>;`);
2137
2148
  lines.push("");
2138
- lines.push(`export type AppAbility = PureAbility<${ACL_APP_ABILITIES}>;`);
2149
+ lines.push(`export type AppAbility = ${CASL_ABILITY_BINDING.ability}<${ACL_APP_ABILITIES}>;`);
2139
2150
  return lines.join("\n");
2140
2151
  }
2141
2152
  function renderImport$3(importData) {
@@ -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-D0C-UY3I.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-DVW9l3P3.mjs";
1
+ import { a as isQuery, i as isMutation, n as getDestructuredVariables, r as isInfiniteQuery, s as getZodSchemaRefs, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BPAbzWrC.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-CkDuXst9.mjs";
3
3
  import "node:module";
4
4
  //#region \0rolldown/runtime.js
5
5
  var __defProp = Object.defineProperty;
@@ -22,7 +22,7 @@ const ACL_APP_ABILITIES = "AppAbilities";
22
22
  const ACL_CHECK_HOOK = "useAclCheck";
23
23
  const CASL_ABILITY_BINDING = {
24
24
  abilityTuple: "AbilityTuple",
25
- pureAbility: "PureAbility",
25
+ ability: "Ability",
26
26
  forcedSubject: "ForcedSubject",
27
27
  subjectType: "Subject",
28
28
  subject: "subject"
@@ -30,7 +30,7 @@ const CASL_ABILITY_BINDING = {
30
30
  const CASL_ABILITY_IMPORT = {
31
31
  bindings: [
32
32
  CASL_ABILITY_BINDING.abilityTuple,
33
- CASL_ABILITY_BINDING.pureAbility,
33
+ CASL_ABILITY_BINDING.ability,
34
34
  CASL_ABILITY_BINDING.forcedSubject,
35
35
  CASL_ABILITY_BINDING.subjectType,
36
36
  CASL_ABILITY_BINDING.subject
@@ -118,7 +118,7 @@ function generateAppAcl({ resolver, data }) {
118
118
  const caslAbilityTupleImport = {
119
119
  bindings: [],
120
120
  typeBindings: [
121
- CASL_ABILITY_BINDING.pureAbility,
121
+ CASL_ABILITY_BINDING.ability,
122
122
  CASL_ABILITY_BINDING.abilityTuple,
123
123
  ...!appAbilitiesType ? [CASL_ABILITY_BINDING.subjectType] : [],
124
124
  ...hasAdditionalAbilityImports ? [CASL_ABILITY_BINDING.forcedSubject] : []
@@ -135,7 +135,7 @@ function generateAppAcl({ resolver, data }) {
135
135
  for (const [action, subjects] of Object.entries(appAbilitiesType)) lines.push(`| ${CASL_ABILITY_BINDING.abilityTuple}<"${action}", ${subjects.join(" | ")}>`);
136
136
  } else lines.push(`export type ${ACL_APP_ABILITIES} = ${CASL_ABILITY_BINDING.abilityTuple}<string, ${CASL_ABILITY_BINDING.subjectType}>;`);
137
137
  lines.push("");
138
- lines.push(`export type AppAbility = PureAbility<${ACL_APP_ABILITIES}>;`);
138
+ lines.push(`export type AppAbility = ${CASL_ABILITY_BINDING.ability}<${ACL_APP_ABILITIES}>;`);
139
139
  return lines.join("\n");
140
140
  }
141
141
  function renderImport$3(importData) {
@@ -1,4 +1,4 @@
1
- import { t as GenerateOptions } from "./options-DQabDsdb.mjs";
1
+ import { t as GenerateOptions } from "./options--j07yHYW.mjs";
2
2
  import { OpenAPIV3 } from "openapi-types";
3
3
  //#region src/generators/types/metadata.d.ts
4
4
  interface GenerateParams {
@@ -1,6 +1,6 @@
1
- import { r as getQueryName, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-CW9i6U7J.mjs";
2
- import { a as isQuery, i as isMutation, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-D0C-UY3I.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-DVW9l3P3.mjs";
1
+ import { r as getQueryName, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-uswCSFZ_.mjs";
2
+ import { a as isQuery, i as isMutation, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BPAbzWrC.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-CkDuXst9.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-DVW9l3P3.mjs";
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-CkDuXst9.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-YNXbfpMR.mjs";
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-yHZiQdu7.cjs");
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-BCtqmKj6.cjs"));
110
+ const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-BJb0sGXk.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-DQabDsdb.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
3
- import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-CqnGK_rg.mjs";
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-DmN78sag.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-CZg1oKLX.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";
@@ -1,4 +1,4 @@
1
- import { n as runGenerate, vn as Profiler } from "./generate.runner-DVW9l3P3.mjs";
1
+ import { n as runGenerate, vn as Profiler } from "./generate.runner-CkDuXst9.mjs";
2
2
  import path from "path";
3
3
  //#region src/plugins/openapi-codegen.runner.ts
4
4
  function createOpenApiCodegenRunner(config, options = {}) {
@@ -1,4 +1,4 @@
1
- import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
1
+ import { t as OpenAPICodegenConfig } from "./config-B0p5wSgi.mjs";
2
2
  //#region src/tiny/openapi.d.ts
3
3
  interface GenerateOpenApiFileOptions {
4
4
  argv?: readonly string[];
@@ -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-D0C-UY3I.mjs";
3
- import { C as getTagFileName, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc, vn as Profiler } from "./generate.runner-DVW9l3P3.mjs";
2
+ import { c as VALIDATION_ERROR_TYPE_TITLE, o as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BPAbzWrC.mjs";
3
+ import { C as getTagFileName, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc, vn as Profiler } from "./generate.runner-CkDuXst9.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.7";
34
+ return "4.0.0-rc.9";
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-CqnGK_rg.mjs";
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-DQabDsdb.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-YNXbfpMR.mjs";
3
- import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-CqnGK_rg.mjs";
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-DmN78sag.mjs";
1
+ import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-CZg1oKLX.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
@@ -125,13 +125,14 @@
125
125
  "yargs": "^18.0.0"
126
126
  },
127
127
  "devDependencies": {
128
- "@casl/ability": "6.8.0",
129
- "@casl/react": "5.0.1",
128
+ "@casl/ability": "7.1.1",
129
+ "@casl/react": "7.1.0",
130
130
  "@tanstack/react-query": "~5.90.21",
131
131
  "@types/bun": "1.4.4",
132
132
  "@types/node": "^25.3.0",
133
133
  "@types/prompt-sync": "^4.2.3",
134
134
  "@types/react": "^19.2.14",
135
+ "@types/react-test-renderer": "^19.1.0",
135
136
  "@types/yargs": "^17.0.35",
136
137
  "@vitejs/plugin-react": "^5.1.4",
137
138
  "axios": "^1.13.1",
@@ -140,6 +141,7 @@
140
141
  "oxlint": "1.50.0",
141
142
  "oxlint-tsgolint": "^0.15.0",
142
143
  "react": "^19.2.4",
144
+ "react-test-renderer": "19.2.4",
143
145
  "tsdown": "^0.22.14",
144
146
  "tsrs": "0.18.0-ts7.1.0-dev.20260929",
145
147
  "type-fest": "^5.4.4",
@@ -150,8 +152,8 @@
150
152
  "zod": "^4.5.0"
151
153
  },
152
154
  "peerDependencies": {
153
- "@casl/ability": "^6.7.3",
154
- "@casl/react": "^5.0.0",
155
+ "@casl/ability": "^7.1.1",
156
+ "@casl/react": "^7.1.0",
155
157
  "@tanstack/react-query": "^5.90.21",
156
158
  "axios": "^1.13.1",
157
159
  "i18next": "^25.8.11",
@@ -187,5 +189,5 @@
187
189
  "node": ">= 18"
188
190
  },
189
191
  "packageManager": "bun@1.4.4",
190
- "version": "4.0.0-rc.7"
192
+ "version": "4.0.0-rc.9"
191
193
  }