@povio/openapi-codegen-cli 3.1.0-rc.2 → 3.1.0-rc.4

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/metro.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { r as GenerateFileFormatter } from "./options-CE4Koxof.mjs";
2
2
  import { t as OpenAPICodegenConfig } from "./config-BU7wVf7U.mjs";
3
- import { a as GenerateOpenApiFile } from "./openapi-D9apjIRy.mjs";
3
+ import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-BSIrB6ny.mjs";
4
4
  import { IncomingMessage, ServerResponse } from "http";
5
5
 
6
6
  //#region src/metro/openapi-codegen.plugin.d.ts
@@ -35,7 +35,9 @@ interface TinyOpenApiCodegenMetroOptions extends OpenApiCodegenMetroOptions {
35
35
  apiMode?: string;
36
36
  cwd?: string;
37
37
  env?: NodeJS.ProcessEnv;
38
- generateOpenApiFile: GenerateOpenApiFile;
38
+ generateOpenApiFile?: GenerateOpenApiFile;
39
+ generateOpenApiSpec?: GenerateOpenApiSpec;
40
+ generateOpenApiSpecModule?: string | TinyOpenApiSpecModuleConfig;
39
41
  watchFolders: readonly string[];
40
42
  watchTinyOpenApiInput?: boolean;
41
43
  }
package/dist/metro.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./generateCodeFromOpenAPIDoc-C-n0Knj8.mjs";
2
2
  import "./generate.runner-BXTc97I0.mjs";
3
3
  import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-QGd35-a3.mjs";
4
- import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-D19XnvMe.mjs";
4
+ import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-wLs5vqw6.mjs";
5
5
  import fs from "fs";
6
6
  import path from "path";
7
7
 
@@ -97,6 +97,8 @@ function withResolvedTinyOpenApiCodegen(metroConfig, codegenConfig, options) {
97
97
  cwd: options.cwd,
98
98
  env: options.env,
99
99
  generateOpenApiFile: options.generateOpenApiFile,
100
+ generateOpenApiSpec: options.generateOpenApiSpec,
101
+ generateOpenApiSpecModule: options.generateOpenApiSpecModule,
100
102
  input: codegenConfig.input,
101
103
  root
102
104
  });
@@ -1,3 +1,5 @@
1
+ import { t as OpenAPICodegenConfig } from "./config-BU7wVf7U.mjs";
2
+
1
3
  //#region src/tiny/openapi.d.ts
2
4
  interface GenerateOpenApiFileOptions {
3
5
  argv?: readonly string[];
@@ -12,6 +14,7 @@ interface GenerateOpenApiFileResult {
12
14
  changed: boolean;
13
15
  outputPath: string;
14
16
  }
17
+ type GenerateOpenApiSpec = () => Promise<unknown> | unknown;
15
18
  type GenerateOpenApiFile = (options: GenerateOpenApiFileOptions) => Promise<unknown> | unknown;
16
19
  type JsonObject = Record<string, unknown>;
17
20
  type AnySchema = unknown;
@@ -107,18 +110,14 @@ declare function operationKey(method: string, routePath: string): string;
107
110
  declare function toPascalCase(value: string): string;
108
111
  declare function isZodSchema(value: unknown): value is ZodSchema;
109
112
  declare function schemaExportName(moduleName: string, exportName: string, schema: ZodSchema, getSchemaName?: typeof getOpenApiSchemaName): string;
113
+ declare function modelSchemaExportName(exportName: string): string;
110
114
  declare function sharedSchemaExportName(exportName: string): string;
111
115
  declare function collectModelSchemaExports(options: {
112
116
  apiRoot?: string;
113
117
  dbTablesRoot?: string;
114
- getOpenApiSchemaName?: (schema: unknown) => string | undefined;
115
- }): Promise<ModelSchemaExport[]>;
116
- declare function collectApiModelSchemaExports(apiRoot: string, options?: {
117
- getOpenApiSchemaName?: (schema: unknown) => string | undefined;
118
- }): Promise<ModelSchemaExport[]>;
119
- declare function collectModuleModelSchemaExports(apiRoot: string, moduleName: string, options?: {
120
- getOpenApiSchemaName?: (schema: unknown) => string | undefined;
121
118
  }): Promise<ModelSchemaExport[]>;
119
+ declare function collectApiModelSchemaExports(apiRoot: string): Promise<ModelSchemaExport[]>;
120
+ declare function collectModuleModelSchemaExports(apiRoot: string, moduleName: string): Promise<ModelSchemaExport[]>;
122
121
  declare function collectDbTableModelSchemaExports(tablesRoot: string): Promise<ModelSchemaExport[]>;
123
122
  declare function collectDbTableModelSchemaExport(tablesRoot: string, tableName: string): Promise<ModelSchemaExport[]>;
124
123
  declare function toOpenAPIAclRule(rule: string): JsonObject;
@@ -136,11 +135,14 @@ declare function visitZodSchema(schema: ZodSchema, visit: (schema: ZodSchema) =>
136
135
  };
137
136
  }>): void;
138
137
  declare function collectSchemaRegistryRoots(registry: OpenApiSchemaRegistry): Set<AnySchema>;
138
+ declare function modelSchemaNameEntries(modelSchemas: ModelSchemaExport[]): Map<ZodSchema, string>;
139
+ declare function createModelSchemaNameGetter(modelSchemas: ModelSchemaExport[], getSchemaName?: typeof getOpenApiSchemaName): (schema: unknown) => string | undefined;
139
140
  declare function collectReachableModelSchemas(router: AnyContractRouter, options?: {
140
141
  apiRoot?: string;
141
142
  dbTablesRoot?: string;
142
143
  excludedSchemas?: Set<AnySchema>;
143
144
  getOpenApiSchemaName?: (schema: unknown) => string | undefined;
145
+ modelSchemas?: ModelSchemaExport[];
144
146
  }): Promise<OpenApiSchemaRegistry>;
145
147
  declare function compactTagName(value: string): string;
146
148
  declare function getModuleOpenApiController(apiModules: Record<string, TinyOpenApiModule>, moduleName: string): string;
@@ -169,4 +171,26 @@ declare function applyPaginatedItemSchemas(spec: JsonObject): void;
169
171
  declare function toOpenAPI30Document(spec: JsonObject): JsonObject;
170
172
  declare function generateORPCOpenAPISpec(options: GenerateORPCOpenAPISpecOptions): Promise<JsonObject>;
171
173
  //#endregion
172
- export { getStringEnumValues as $, collectModuleModelSchemaExports as A, generateOpenApiFile as B, collectApiModelSchemaExports as C, toPascalCase as Ct, collectDbTableModelSchemaExports as D, collectDbTableModelSchemaExport as E, compactTagName as F, getModuleOpenApiTag as G, getContractProcedureData as H, defineOpenApiSchemas as I, getOperationAction as J, getObjectPropertySchema as K, findComponentEnumNames as L, collectOperationTags as M, collectReachableModelSchemas as N, collectExtraSchemas as O, collectSchemaRegistryRoots as P, getRobodevModuleRoles as Q, findEnumNames as R, asStringArray as S, toOpenAPIAclRule as St, collectContractSchemas as T, getDerivedOperationId as U, getComponentSchemas as V, getModuleOpenApiController as W, getPaginatedItemSchema as X, getOperationController as Y, getProcedureInputSchemaRole as Z, applyOperationMeta as _, schemaExportName as _t, GenerateOpenApiFile as a, isZodSchema as at, applyRobodevModuleExtensions as b, toOpenAPI30Document as bt, GenerateTinyOpenApiFileOptions as c, namedOpenApiOutputSchema as ct, ProcedureMeta as d, namedOpenApiSchema as dt, isContractProcedure as et, TinyOpenApiModule as f, operationKey as ft, applyEnumExtensions as g, schemaComponentRef as gt, addContractSchema as h, routeHasPathParameters as ht, GenerateORPCOpenAPISpecOptions as i, isProcedureMeta as it, collectOperationMeta as j, collectModelSchemaExports as k, JsonObject as l, namedOpenApiRequestSchema as lt, ZodSchema as m, resolveOpenApiOutputPath as mt, AnyContractRouter as n, isNullableOnlySchema as nt, GenerateOpenApiFileOptions as o, namedControllerActionInputDtoSchema as ot, TinyOpenApiUserRole as p, procedureSchemaName as pt, getOpenApiSchemaName as q, AnySchema as r, isObject as rt, GenerateOpenApiFileResult as s, namedControllerActionSchema as st, AclRule as t, isNullSchema as tt, OpenApiSchemaRegistry as u, namedOpenApiResponseSchema as ut, applyPaginatedItemSchemas as v, sharedSchemaExportName as vt, collectContractSchemaRoots as w, visitZodSchema as wt, applyRobodevUserRolesExtension as x, toOpenAPI30Schema as xt, applyParameterExtensions as y, stripNoContentResponseBodies as yt, generateORPCOpenAPISpec as z };
174
+ //#region src/tiny/openapi-source.runner.d.ts
175
+ interface TinyOpenApiSpecModuleConfig {
176
+ exportName?: string;
177
+ path: string;
178
+ }
179
+ interface TinyOpenApiSourceRunnerConfig {
180
+ cwd?: string;
181
+ env?: NodeJS.ProcessEnv;
182
+ generateOpenApiFile?: GenerateOpenApiFile;
183
+ generateOpenApiSpec?: GenerateOpenApiSpec;
184
+ generateOpenApiSpecModule?: string | TinyOpenApiSpecModuleConfig;
185
+ input: OpenAPICodegenConfig["input"];
186
+ root: string;
187
+ }
188
+ declare function createTinyOpenApiSourceRunner(config: TinyOpenApiSourceRunnerConfig): {
189
+ enqueueGenerate: () => Promise<void>;
190
+ getOutputPath: () => string | undefined;
191
+ };
192
+ declare function isTinyOpenApiFakeMode(apiMode?: string | undefined): boolean;
193
+ declare function getLocalInputPath(input: OpenAPICodegenConfig["input"], root: string): string | undefined;
194
+ declare function normalizeWatchFolders(root: string, watchFolders?: readonly string[]): string[];
195
+ //#endregion
196
+ export { getModuleOpenApiTag as $, collectApiModelSchemaExports as A, toOpenAPI30Document as At, collectReachableModelSchemas as B, applyEnumExtensions as C, procedureSchemaName as Ct, applyRobodevModuleExtensions as D, schemaExportName as Dt, applyParameterExtensions as E, schemaComponentRef as Et, collectExtraSchemas as F, findComponentEnumNames as G, compactTagName as H, collectModelSchemaExports as I, generateOpenApiFile as J, findEnumNames as K, collectModuleModelSchemaExports as L, collectContractSchemas as M, toOpenAPIAclRule as Mt, collectDbTableModelSchemaExport as N, toPascalCase as Nt, applyRobodevUserRolesExtension as O, sharedSchemaExportName as Ot, collectDbTableModelSchemaExports as P, visitZodSchema as Pt, getModuleOpenApiController as Q, collectOperationMeta as R, addContractSchema as S, operationKey as St, applyPaginatedItemSchemas as T, routeHasPathParameters as Tt, createModelSchemaNameGetter as U, collectSchemaRegistryRoots as V, defineOpenApiSchemas as W, getContractProcedureData as X, getComponentSchemas as Y, getDerivedOperationId as Z, OpenApiSchemaRegistry as _, namedControllerActionSchema as _t, isTinyOpenApiFakeMode as a, getProcedureInputSchemaRole as at, TinyOpenApiUserRole as b, namedOpenApiResponseSchema as bt, AnyContractRouter as c, isContractProcedure as ct, GenerateOpenApiFile as d, isObject as dt, getObjectPropertySchema as et, GenerateOpenApiFileOptions as f, isProcedureMeta as ft, JsonObject as g, namedControllerActionInputDtoSchema as gt, GenerateTinyOpenApiFileOptions as h, modelSchemaNameEntries as ht, getLocalInputPath as i, getPaginatedItemSchema as it, collectContractSchemaRoots as j, toOpenAPI30Schema as jt, asStringArray as k, stripNoContentResponseBodies as kt, AnySchema as l, isNullSchema as lt, GenerateOpenApiSpec as m, modelSchemaExportName as mt, TinyOpenApiSpecModuleConfig as n, getOperationAction as nt, normalizeWatchFolders as o, getRobodevModuleRoles as ot, GenerateOpenApiFileResult as p, isZodSchema as pt, generateORPCOpenAPISpec as q, createTinyOpenApiSourceRunner as r, getOperationController as rt, AclRule as s, getStringEnumValues as st, TinyOpenApiSourceRunnerConfig as t, getOpenApiSchemaName as tt, GenerateORPCOpenAPISpecOptions as u, isNullableOnlySchema as ut, ProcedureMeta as v, namedOpenApiOutputSchema as vt, applyOperationMeta as w, resolveOpenApiOutputPath as wt, ZodSchema as x, namedOpenApiSchema as xt, TinyOpenApiModule as y, namedOpenApiRequestSchema as yt, collectOperationTags as z };