nestjs-openapi 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.mjs +2 -2
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.mjs +1 -1
- package/dist/shared/{nestjs-openapi.CU_zMKfF.mjs → nestjs-openapi.9yw4zAwS.mjs} +45 -5
- package/dist/shared/{nestjs-openapi.CDtSgIYg.d.mts → nestjs-openapi.C1wj3WtU.d.mts} +198 -198
- package/dist/shared/{nestjs-openapi.CDtSgIYg.d.ts → nestjs-openapi.C1wj3WtU.d.ts} +198 -198
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import 'tsx';
|
|
3
3
|
import { Effect, Exit, Cause, Option } from 'effect';
|
|
4
|
-
import { ax as generateEffect, ak as generatorServicesLayer, az as runtimeLayerFor, aw as formatValidationResult } from './shared/nestjs-openapi.
|
|
4
|
+
import { ax as generateEffect, ak as generatorServicesLayer, az as runtimeLayerFor, aw as formatValidationResult } from './shared/nestjs-openapi.9yw4zAwS.mjs';
|
|
5
5
|
import minimist from 'minimist';
|
|
6
6
|
import { relative } from 'node:path';
|
|
7
7
|
import { createRequire } from 'node:module';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError, M as MethodInfo, c as OpenApiPaths, d as OpenApiOperation, e as OpenApiPaths$1, G as GeneratedSchemas, f as OpenApiSchema,
|
|
2
|
-
export { a4 as AnalysisError, aJ as BrokenRef, aK as BrokenRefCategories, az as ClassValidationInfo, n as Config, a3 as ConfigError, X as ConfigLoadError, W as ConfigNotFoundError, Y as ConfigValidationError, o as ContactConfig, Z as DtoGlobResolutionError, U as EntryNotFoundError, E as GenerateOptions, s as GenerateOverrides, l as GenerateResult, a5 as GeneratorError, J as HttpMethod, I as InfoConfig, _ as InvalidMethodError, am as JsonSchema, L as LicenseConfig, $ as MissingGenericSchemaTempFileCleanupError, a0 as MissingGenericSchemaTempFileWriteError, ac as ModuleWithControllers, K as OpenApiGeneratorConfig, t as OpenApiOperation, u as OpenApiParameter, v as OpenApiRequestBody, w as OpenApiResponse, q as OutputFormat, F as ParameterLocation, a8 as ProjectContext, a2 as ProjectError, Q as ProjectInitError, a9 as ProjectOptions, a6 as ProjectServiceLive, ay as PropertyValidationInfo, a1 as PublicApiError, N as ResolvedConfig, R as ResolvedParameter, H as ReturnTypeInfo, ak as SchemaError, aj as SchemaGenerationError, al as SchemaGeneratorOptions, p as ServerConfig, T as TagConfig, r as TelemetryConfig, ax as ValidationConstraints, aI as ValidationResult, au as applyConstraintsToSchema, aG as categorizeBrokenRefs, m as defineConfig, as as extractClassConstraints, aq as extractClassValidationInfo, ar as extractClassValidationInfoEffect, an as extractPropertyConstraints, ap as extractPropertyValidationInfo, aA as findConfigFile, aH as formatValidationResult, k as generate, y as generateAsync, x as generateEffect, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect, ah as generateSchemas, ai as generateSchemasFromFiles, ab as getAllControllers, af as getControllerMethodInfos, ag as getControllerMethodInfosEffect, ad as getMethodInfo, ae as getMethodInfoEffect, aa as getModules, at as getRequiredProperties, ao as isPropertyOptional, aE as loadAndResolveConfig, aC as loadConfig, aB as loadConfigFromFile, a7 as makeProjectContext, av as mergeValidationConstraints, aw as mergeValidationConstraintsEffect, aD as resolveConfig, aF as validateSpec } from './shared/nestjs-openapi.
|
|
1
|
+
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError, M as MethodInfo, c as OpenApiPaths, d as OpenApiOperation, e as OpenApiPaths$1, G as GeneratedSchemas, f as OpenApiSchema, C as ConfigService, g as OutputService, h as SchemaService, i as MethodExtractionService, V as ValidationService, P as ProjectService, j as ModuleTraversalService } from './shared/nestjs-openapi.C1wj3WtU.mjs';
|
|
2
|
+
export { a4 as AnalysisError, aJ as BrokenRef, aK as BrokenRefCategories, az as ClassValidationInfo, n as Config, a3 as ConfigError, X as ConfigLoadError, W as ConfigNotFoundError, Y as ConfigValidationError, o as ContactConfig, Z as DtoGlobResolutionError, U as EntryNotFoundError, E as GenerateOptions, s as GenerateOverrides, l as GenerateResult, a5 as GeneratorError, J as HttpMethod, I as InfoConfig, _ as InvalidMethodError, am as JsonSchema, L as LicenseConfig, $ as MissingGenericSchemaTempFileCleanupError, a0 as MissingGenericSchemaTempFileWriteError, ac as ModuleWithControllers, K as OpenApiGeneratorConfig, t as OpenApiOperation, u as OpenApiParameter, v as OpenApiRequestBody, w as OpenApiResponse, q as OutputFormat, F as ParameterLocation, a8 as ProjectContext, a2 as ProjectError, Q as ProjectInitError, a9 as ProjectOptions, a6 as ProjectServiceLive, ay as PropertyValidationInfo, a1 as PublicApiError, N as ResolvedConfig, R as ResolvedParameter, H as ReturnTypeInfo, ak as SchemaError, aj as SchemaGenerationError, al as SchemaGeneratorOptions, p as ServerConfig, T as TagConfig, r as TelemetryConfig, ax as ValidationConstraints, aI as ValidationResult, au as applyConstraintsToSchema, aG as categorizeBrokenRefs, m as defineConfig, as as extractClassConstraints, aq as extractClassValidationInfo, ar as extractClassValidationInfoEffect, an as extractPropertyConstraints, ap as extractPropertyValidationInfo, aA as findConfigFile, aH as formatValidationResult, k as generate, y as generateAsync, x as generateEffect, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect, ah as generateSchemas, ai as generateSchemasFromFiles, ab as getAllControllers, af as getControllerMethodInfos, ag as getControllerMethodInfosEffect, ad as getMethodInfo, ae as getMethodInfoEffect, aa as getModules, at as getRequiredProperties, ao as isPropertyOptional, aE as loadAndResolveConfig, aC as loadConfig, aB as loadConfigFromFile, a7 as makeProjectContext, av as mergeValidationConstraints, aw as mergeValidationConstraintsEffect, aD as resolveConfig, aF as validateSpec } from './shared/nestjs-openapi.C1wj3WtU.mjs';
|
|
3
3
|
import { DynamicModule } from '@nestjs/common';
|
|
4
4
|
import { Effect, Option, Layer } from 'effect';
|
|
5
5
|
import { ClassDeclaration, MethodDeclaration, Decorator, Symbol, ObjectLiteralExpression, Expression } from 'ts-morph';
|
|
@@ -227,23 +227,27 @@ declare const getHttpDecorator: (method: MethodDeclaration) => Decorator | undef
|
|
|
227
227
|
|
|
228
228
|
declare const transformMethod: (methodInfo: MethodInfo) => OpenApiPaths;
|
|
229
229
|
declare const transformMethodEffect: (methodInfo: {
|
|
230
|
+
readonly security: readonly {
|
|
231
|
+
readonly scopes: readonly string[];
|
|
232
|
+
readonly schemeName: string;
|
|
233
|
+
}[];
|
|
230
234
|
readonly path: string;
|
|
231
|
-
readonly controllerName: string;
|
|
232
|
-
readonly methodName: string;
|
|
233
235
|
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
236
|
+
readonly methodName: string;
|
|
237
|
+
readonly controllerName: string;
|
|
234
238
|
readonly controllerTags: readonly string[];
|
|
235
239
|
readonly returnType: {
|
|
236
|
-
readonly filePath: Option.Option<string>;
|
|
237
240
|
readonly type: Option.Option<string>;
|
|
238
241
|
readonly inline: Option.Option<string>;
|
|
239
242
|
readonly container: Option.Option<"array">;
|
|
243
|
+
readonly filePath: Option.Option<string>;
|
|
240
244
|
};
|
|
241
245
|
readonly parameters: readonly {
|
|
246
|
+
readonly description: Option.Option<string>;
|
|
242
247
|
readonly name: string;
|
|
243
|
-
readonly location: "
|
|
248
|
+
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
244
249
|
readonly tsType: string;
|
|
245
250
|
readonly required: boolean;
|
|
246
|
-
readonly description: Option.Option<string>;
|
|
247
251
|
}[];
|
|
248
252
|
readonly decorators: readonly string[];
|
|
249
253
|
readonly operation: {
|
|
@@ -261,10 +265,6 @@ declare const transformMethodEffect: (methodInfo: {
|
|
|
261
265
|
readonly httpCode: Option.Option<number>;
|
|
262
266
|
readonly consumes: readonly string[];
|
|
263
267
|
readonly produces: readonly string[];
|
|
264
|
-
readonly security: readonly {
|
|
265
|
-
readonly schemeName: string;
|
|
266
|
-
readonly scopes: readonly string[];
|
|
267
|
-
}[];
|
|
268
268
|
}) => Effect.Effect<OpenApiPaths, never, never>;
|
|
269
269
|
type MutableOpenApiPaths = {
|
|
270
270
|
[path: string]: {
|
|
@@ -273,23 +273,27 @@ type MutableOpenApiPaths = {
|
|
|
273
273
|
};
|
|
274
274
|
declare const transformMethods: (methodInfos: readonly MethodInfo[]) => OpenApiPaths;
|
|
275
275
|
declare const transformMethodsEffect: (methodInfos: readonly {
|
|
276
|
+
readonly security: readonly {
|
|
277
|
+
readonly scopes: readonly string[];
|
|
278
|
+
readonly schemeName: string;
|
|
279
|
+
}[];
|
|
276
280
|
readonly path: string;
|
|
277
|
-
readonly controllerName: string;
|
|
278
|
-
readonly methodName: string;
|
|
279
281
|
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
282
|
+
readonly methodName: string;
|
|
283
|
+
readonly controllerName: string;
|
|
280
284
|
readonly controllerTags: readonly string[];
|
|
281
285
|
readonly returnType: {
|
|
282
|
-
readonly filePath: Option.Option<string>;
|
|
283
286
|
readonly type: Option.Option<string>;
|
|
284
287
|
readonly inline: Option.Option<string>;
|
|
285
288
|
readonly container: Option.Option<"array">;
|
|
289
|
+
readonly filePath: Option.Option<string>;
|
|
286
290
|
};
|
|
287
291
|
readonly parameters: readonly {
|
|
292
|
+
readonly description: Option.Option<string>;
|
|
288
293
|
readonly name: string;
|
|
289
|
-
readonly location: "
|
|
294
|
+
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
290
295
|
readonly tsType: string;
|
|
291
296
|
readonly required: boolean;
|
|
292
|
-
readonly description: Option.Option<string>;
|
|
293
297
|
}[];
|
|
294
298
|
readonly decorators: readonly string[];
|
|
295
299
|
readonly operation: {
|
|
@@ -307,10 +311,6 @@ declare const transformMethodsEffect: (methodInfos: readonly {
|
|
|
307
311
|
readonly httpCode: Option.Option<number>;
|
|
308
312
|
readonly consumes: readonly string[];
|
|
309
313
|
readonly produces: readonly string[];
|
|
310
|
-
readonly security: readonly {
|
|
311
|
-
readonly schemeName: string;
|
|
312
|
-
readonly scopes: readonly string[];
|
|
313
|
-
}[];
|
|
314
314
|
}[]) => Effect.Effect<MutableOpenApiPaths, never, never>;
|
|
315
315
|
|
|
316
316
|
/**
|
|
@@ -377,7 +377,7 @@ declare const normalizeStructureRefsEffect: (schemas: GeneratedSchemas) => Effec
|
|
|
377
377
|
/**
|
|
378
378
|
* Shared service dependency graph for generation pipelines.
|
|
379
379
|
*/
|
|
380
|
-
declare const generatorServicesLayer: Layer.Layer<
|
|
380
|
+
declare const generatorServicesLayer: Layer.Layer<ConfigService | OutputService | SchemaService | MethodExtractionService | ValidationService | ProjectService | ModuleTraversalService, never, never>;
|
|
381
381
|
|
|
382
382
|
/** Handles aliased symbols (re-exports) */
|
|
383
383
|
declare const resolveClassFromSymbol: (sym: Symbol) => Option.Option<ClassDeclaration>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError, M as MethodInfo, c as OpenApiPaths, d as OpenApiOperation, e as OpenApiPaths$1, G as GeneratedSchemas, f as OpenApiSchema,
|
|
2
|
-
export { a4 as AnalysisError, aJ as BrokenRef, aK as BrokenRefCategories, az as ClassValidationInfo, n as Config, a3 as ConfigError, X as ConfigLoadError, W as ConfigNotFoundError, Y as ConfigValidationError, o as ContactConfig, Z as DtoGlobResolutionError, U as EntryNotFoundError, E as GenerateOptions, s as GenerateOverrides, l as GenerateResult, a5 as GeneratorError, J as HttpMethod, I as InfoConfig, _ as InvalidMethodError, am as JsonSchema, L as LicenseConfig, $ as MissingGenericSchemaTempFileCleanupError, a0 as MissingGenericSchemaTempFileWriteError, ac as ModuleWithControllers, K as OpenApiGeneratorConfig, t as OpenApiOperation, u as OpenApiParameter, v as OpenApiRequestBody, w as OpenApiResponse, q as OutputFormat, F as ParameterLocation, a8 as ProjectContext, a2 as ProjectError, Q as ProjectInitError, a9 as ProjectOptions, a6 as ProjectServiceLive, ay as PropertyValidationInfo, a1 as PublicApiError, N as ResolvedConfig, R as ResolvedParameter, H as ReturnTypeInfo, ak as SchemaError, aj as SchemaGenerationError, al as SchemaGeneratorOptions, p as ServerConfig, T as TagConfig, r as TelemetryConfig, ax as ValidationConstraints, aI as ValidationResult, au as applyConstraintsToSchema, aG as categorizeBrokenRefs, m as defineConfig, as as extractClassConstraints, aq as extractClassValidationInfo, ar as extractClassValidationInfoEffect, an as extractPropertyConstraints, ap as extractPropertyValidationInfo, aA as findConfigFile, aH as formatValidationResult, k as generate, y as generateAsync, x as generateEffect, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect, ah as generateSchemas, ai as generateSchemasFromFiles, ab as getAllControllers, af as getControllerMethodInfos, ag as getControllerMethodInfosEffect, ad as getMethodInfo, ae as getMethodInfoEffect, aa as getModules, at as getRequiredProperties, ao as isPropertyOptional, aE as loadAndResolveConfig, aC as loadConfig, aB as loadConfigFromFile, a7 as makeProjectContext, av as mergeValidationConstraints, aw as mergeValidationConstraintsEffect, aD as resolveConfig, aF as validateSpec } from './shared/nestjs-openapi.
|
|
1
|
+
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError, M as MethodInfo, c as OpenApiPaths, d as OpenApiOperation, e as OpenApiPaths$1, G as GeneratedSchemas, f as OpenApiSchema, C as ConfigService, g as OutputService, h as SchemaService, i as MethodExtractionService, V as ValidationService, P as ProjectService, j as ModuleTraversalService } from './shared/nestjs-openapi.C1wj3WtU.js';
|
|
2
|
+
export { a4 as AnalysisError, aJ as BrokenRef, aK as BrokenRefCategories, az as ClassValidationInfo, n as Config, a3 as ConfigError, X as ConfigLoadError, W as ConfigNotFoundError, Y as ConfigValidationError, o as ContactConfig, Z as DtoGlobResolutionError, U as EntryNotFoundError, E as GenerateOptions, s as GenerateOverrides, l as GenerateResult, a5 as GeneratorError, J as HttpMethod, I as InfoConfig, _ as InvalidMethodError, am as JsonSchema, L as LicenseConfig, $ as MissingGenericSchemaTempFileCleanupError, a0 as MissingGenericSchemaTempFileWriteError, ac as ModuleWithControllers, K as OpenApiGeneratorConfig, t as OpenApiOperation, u as OpenApiParameter, v as OpenApiRequestBody, w as OpenApiResponse, q as OutputFormat, F as ParameterLocation, a8 as ProjectContext, a2 as ProjectError, Q as ProjectInitError, a9 as ProjectOptions, a6 as ProjectServiceLive, ay as PropertyValidationInfo, a1 as PublicApiError, N as ResolvedConfig, R as ResolvedParameter, H as ReturnTypeInfo, ak as SchemaError, aj as SchemaGenerationError, al as SchemaGeneratorOptions, p as ServerConfig, T as TagConfig, r as TelemetryConfig, ax as ValidationConstraints, aI as ValidationResult, au as applyConstraintsToSchema, aG as categorizeBrokenRefs, m as defineConfig, as as extractClassConstraints, aq as extractClassValidationInfo, ar as extractClassValidationInfoEffect, an as extractPropertyConstraints, ap as extractPropertyValidationInfo, aA as findConfigFile, aH as formatValidationResult, k as generate, y as generateAsync, x as generateEffect, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect, ah as generateSchemas, ai as generateSchemasFromFiles, ab as getAllControllers, af as getControllerMethodInfos, ag as getControllerMethodInfosEffect, ad as getMethodInfo, ae as getMethodInfoEffect, aa as getModules, at as getRequiredProperties, ao as isPropertyOptional, aE as loadAndResolveConfig, aC as loadConfig, aB as loadConfigFromFile, a7 as makeProjectContext, av as mergeValidationConstraints, aw as mergeValidationConstraintsEffect, aD as resolveConfig, aF as validateSpec } from './shared/nestjs-openapi.C1wj3WtU.js';
|
|
3
3
|
import { DynamicModule } from '@nestjs/common';
|
|
4
4
|
import { Effect, Option, Layer } from 'effect';
|
|
5
5
|
import { ClassDeclaration, MethodDeclaration, Decorator, Symbol, ObjectLiteralExpression, Expression } from 'ts-morph';
|
|
@@ -227,23 +227,27 @@ declare const getHttpDecorator: (method: MethodDeclaration) => Decorator | undef
|
|
|
227
227
|
|
|
228
228
|
declare const transformMethod: (methodInfo: MethodInfo) => OpenApiPaths;
|
|
229
229
|
declare const transformMethodEffect: (methodInfo: {
|
|
230
|
+
readonly security: readonly {
|
|
231
|
+
readonly scopes: readonly string[];
|
|
232
|
+
readonly schemeName: string;
|
|
233
|
+
}[];
|
|
230
234
|
readonly path: string;
|
|
231
|
-
readonly controllerName: string;
|
|
232
|
-
readonly methodName: string;
|
|
233
235
|
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
236
|
+
readonly methodName: string;
|
|
237
|
+
readonly controllerName: string;
|
|
234
238
|
readonly controllerTags: readonly string[];
|
|
235
239
|
readonly returnType: {
|
|
236
|
-
readonly filePath: Option.Option<string>;
|
|
237
240
|
readonly type: Option.Option<string>;
|
|
238
241
|
readonly inline: Option.Option<string>;
|
|
239
242
|
readonly container: Option.Option<"array">;
|
|
243
|
+
readonly filePath: Option.Option<string>;
|
|
240
244
|
};
|
|
241
245
|
readonly parameters: readonly {
|
|
246
|
+
readonly description: Option.Option<string>;
|
|
242
247
|
readonly name: string;
|
|
243
|
-
readonly location: "
|
|
248
|
+
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
244
249
|
readonly tsType: string;
|
|
245
250
|
readonly required: boolean;
|
|
246
|
-
readonly description: Option.Option<string>;
|
|
247
251
|
}[];
|
|
248
252
|
readonly decorators: readonly string[];
|
|
249
253
|
readonly operation: {
|
|
@@ -261,10 +265,6 @@ declare const transformMethodEffect: (methodInfo: {
|
|
|
261
265
|
readonly httpCode: Option.Option<number>;
|
|
262
266
|
readonly consumes: readonly string[];
|
|
263
267
|
readonly produces: readonly string[];
|
|
264
|
-
readonly security: readonly {
|
|
265
|
-
readonly schemeName: string;
|
|
266
|
-
readonly scopes: readonly string[];
|
|
267
|
-
}[];
|
|
268
268
|
}) => Effect.Effect<OpenApiPaths, never, never>;
|
|
269
269
|
type MutableOpenApiPaths = {
|
|
270
270
|
[path: string]: {
|
|
@@ -273,23 +273,27 @@ type MutableOpenApiPaths = {
|
|
|
273
273
|
};
|
|
274
274
|
declare const transformMethods: (methodInfos: readonly MethodInfo[]) => OpenApiPaths;
|
|
275
275
|
declare const transformMethodsEffect: (methodInfos: readonly {
|
|
276
|
+
readonly security: readonly {
|
|
277
|
+
readonly scopes: readonly string[];
|
|
278
|
+
readonly schemeName: string;
|
|
279
|
+
}[];
|
|
276
280
|
readonly path: string;
|
|
277
|
-
readonly controllerName: string;
|
|
278
|
-
readonly methodName: string;
|
|
279
281
|
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
282
|
+
readonly methodName: string;
|
|
283
|
+
readonly controllerName: string;
|
|
280
284
|
readonly controllerTags: readonly string[];
|
|
281
285
|
readonly returnType: {
|
|
282
|
-
readonly filePath: Option.Option<string>;
|
|
283
286
|
readonly type: Option.Option<string>;
|
|
284
287
|
readonly inline: Option.Option<string>;
|
|
285
288
|
readonly container: Option.Option<"array">;
|
|
289
|
+
readonly filePath: Option.Option<string>;
|
|
286
290
|
};
|
|
287
291
|
readonly parameters: readonly {
|
|
292
|
+
readonly description: Option.Option<string>;
|
|
288
293
|
readonly name: string;
|
|
289
|
-
readonly location: "
|
|
294
|
+
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
290
295
|
readonly tsType: string;
|
|
291
296
|
readonly required: boolean;
|
|
292
|
-
readonly description: Option.Option<string>;
|
|
293
297
|
}[];
|
|
294
298
|
readonly decorators: readonly string[];
|
|
295
299
|
readonly operation: {
|
|
@@ -307,10 +311,6 @@ declare const transformMethodsEffect: (methodInfos: readonly {
|
|
|
307
311
|
readonly httpCode: Option.Option<number>;
|
|
308
312
|
readonly consumes: readonly string[];
|
|
309
313
|
readonly produces: readonly string[];
|
|
310
|
-
readonly security: readonly {
|
|
311
|
-
readonly schemeName: string;
|
|
312
|
-
readonly scopes: readonly string[];
|
|
313
|
-
}[];
|
|
314
314
|
}[]) => Effect.Effect<MutableOpenApiPaths, never, never>;
|
|
315
315
|
|
|
316
316
|
/**
|
|
@@ -377,7 +377,7 @@ declare const normalizeStructureRefsEffect: (schemas: GeneratedSchemas) => Effec
|
|
|
377
377
|
/**
|
|
378
378
|
* Shared service dependency graph for generation pipelines.
|
|
379
379
|
*/
|
|
380
|
-
declare const generatorServicesLayer: Layer.Layer<
|
|
380
|
+
declare const generatorServicesLayer: Layer.Layer<ConfigService | OutputService | SchemaService | MethodExtractionService | ValidationService | ProjectService | ModuleTraversalService, never, never>;
|
|
381
381
|
|
|
382
382
|
/** Handles aliased symbols (re-exports) */
|
|
383
383
|
declare const resolveClassFromSymbol: (sym: Symbol) => Option.Option<ClassDeclaration>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SpecFileNotFoundError, a as SpecFileParseError, b as SpecFileReadError } from './shared/nestjs-openapi.
|
|
2
|
-
export { c as ConfigLoadError, C as ConfigNotFoundError, ae as ConfigService, e as ConfigValidationError, D as DtoGlobResolutionError, E as EntryNotFoundError, I as InvalidMethodError, B as MethodExtractionService, M as MissingGenericSchemaTempFileCleanupError, f as MissingGenericSchemaTempFileWriteError, n as ModuleTraversalService, ad as OutputService, P as ProjectInitError, i as ProjectService, j as ProjectServiceLive, h as PublicApiError, a0 as SchemaGenerationError, a1 as SchemaService, ac as ValidationService, a9 as applyConstraintsToSchema, av as categorizeBrokenRefs, d as defineConfig, a7 as extractClassConstraints, a5 as extractClassValidationInfo, a6 as extractClassValidationInfoEffect, a2 as extractPropertyConstraints, a4 as extractPropertyValidationInfo, V as filterInternalSchemas, W as filterInternalSchemasEffect, Q as filterSchemas, R as filterSchemasEffect, af as findConfigFile, aw as formatValidationResult, g as generate, _ as generateSchemas, $ as generateSchemasFromFiles, ak as generatorServicesLayer, l as getAllControllers, am as getArrayInitializer, z as getControllerMethodInfos, A as getControllerMethodInfosEffect, p as getControllerName, o as getControllerPrefix, t as getControllerTags, s as getDecoratorName, u as getHttpDecorator, r as getHttpMethods, x as getMethodInfo, y as getMethodInfoEffect, aq as getModuleDecoratorArg, at as getModuleMetadata, k as getModules, a8 as getRequiredProperties, an as getStringLiteralValue, ao as getSymbolFromIdentifier, v as isHttpDecorator, q as isHttpMethod, ap as isModuleClass, a3 as isPropertyOptional, aj as loadAndResolveConfig, ah as loadConfig, ag as loadConfigFromFile, m as makeProjectContext, N as mergeGeneratedSchemas, O as mergeGeneratedSchemasEffect, K as mergeSchemas, L as mergeSchemasEffect, aa as mergeValidationConstraints, ab as mergeValidationConstraintsEffect, w as normalizePath, T as normalizeSchemas, U as normalizeSchemasEffect, X as normalizeStructureRefs, Y as normalizeStructureRefsEffect, as as resolveArrayOfClasses, ar as resolveClassFromExpression, al as resolveClassFromSymbol, ai as resolveConfig, Z as toPascalCase, F as transformMethod, G as transformMethodEffect, H as transformMethods, J as transformMethodsEffect, au as validateSpec } from './shared/nestjs-openapi.
|
|
1
|
+
import { S as SpecFileNotFoundError, a as SpecFileParseError, b as SpecFileReadError } from './shared/nestjs-openapi.9yw4zAwS.mjs';
|
|
2
|
+
export { c as ConfigLoadError, C as ConfigNotFoundError, ae as ConfigService, e as ConfigValidationError, D as DtoGlobResolutionError, E as EntryNotFoundError, I as InvalidMethodError, B as MethodExtractionService, M as MissingGenericSchemaTempFileCleanupError, f as MissingGenericSchemaTempFileWriteError, n as ModuleTraversalService, ad as OutputService, P as ProjectInitError, i as ProjectService, j as ProjectServiceLive, h as PublicApiError, a0 as SchemaGenerationError, a1 as SchemaService, ac as ValidationService, a9 as applyConstraintsToSchema, av as categorizeBrokenRefs, d as defineConfig, a7 as extractClassConstraints, a5 as extractClassValidationInfo, a6 as extractClassValidationInfoEffect, a2 as extractPropertyConstraints, a4 as extractPropertyValidationInfo, V as filterInternalSchemas, W as filterInternalSchemasEffect, Q as filterSchemas, R as filterSchemasEffect, af as findConfigFile, aw as formatValidationResult, g as generate, _ as generateSchemas, $ as generateSchemasFromFiles, ak as generatorServicesLayer, l as getAllControllers, am as getArrayInitializer, z as getControllerMethodInfos, A as getControllerMethodInfosEffect, p as getControllerName, o as getControllerPrefix, t as getControllerTags, s as getDecoratorName, u as getHttpDecorator, r as getHttpMethods, x as getMethodInfo, y as getMethodInfoEffect, aq as getModuleDecoratorArg, at as getModuleMetadata, k as getModules, a8 as getRequiredProperties, an as getStringLiteralValue, ao as getSymbolFromIdentifier, v as isHttpDecorator, q as isHttpMethod, ap as isModuleClass, a3 as isPropertyOptional, aj as loadAndResolveConfig, ah as loadConfig, ag as loadConfigFromFile, m as makeProjectContext, N as mergeGeneratedSchemas, O as mergeGeneratedSchemasEffect, K as mergeSchemas, L as mergeSchemasEffect, aa as mergeValidationConstraints, ab as mergeValidationConstraintsEffect, w as normalizePath, T as normalizeSchemas, U as normalizeSchemasEffect, X as normalizeStructureRefs, Y as normalizeStructureRefsEffect, as as resolveArrayOfClasses, ar as resolveClassFromExpression, al as resolveClassFromSymbol, ai as resolveConfig, Z as toPascalCase, F as transformMethod, G as transformMethodEffect, H as transformMethods, J as transformMethodsEffect, au as validateSpec } from './shared/nestjs-openapi.9yw4zAwS.mjs';
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
|
4
4
|
import { fail } from 'node:assert';
|
|
5
5
|
import { resolve } from 'node:path';
|
package/dist/internal.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { E as GenerateOptions, x as generate, y as generateAsync, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect } from './shared/nestjs-openapi.
|
|
1
|
+
export { E as GenerateOptions, x as generate, y as generateAsync, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect } from './shared/nestjs-openapi.C1wj3WtU.mjs';
|
|
2
2
|
import 'effect';
|
|
3
3
|
import 'ts-morph';
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { E as GenerateOptions, x as generate, y as generateAsync, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect } from './shared/nestjs-openapi.
|
|
1
|
+
export { E as GenerateOptions, x as generate, y as generateAsync, D as generateFromConfigAsync, B as generateFromConfigEffect, A as generatePathsAsync, z as generatePathsEffect } from './shared/nestjs-openapi.C1wj3WtU.js';
|
|
2
2
|
import 'effect';
|
|
3
3
|
import 'ts-morph';
|
package/dist/internal.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
|
-
import { i as ProjectService, n as ModuleTraversalService, B as MethodExtractionService, J as transformMethodsEffect, ax as generateEffect, ay as runProjectApiPromise, ak as generatorServicesLayer, az as runtimeLayerFor, aA as runGeneratorApiPromise } from './shared/nestjs-openapi.
|
|
2
|
+
import { i as ProjectService, n as ModuleTraversalService, B as MethodExtractionService, J as transformMethodsEffect, ax as generateEffect, ay as runProjectApiPromise, ak as generatorServicesLayer, az as runtimeLayerFor, aA as runGeneratorApiPromise } from './shared/nestjs-openapi.9yw4zAwS.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:crypto';
|
|
@@ -954,6 +954,14 @@ const API_BOOLEAN_KEYS = [
|
|
|
954
954
|
"isArray"
|
|
955
955
|
];
|
|
956
956
|
const API_PRIMITIVE_KEYS = ["example", "default"];
|
|
957
|
+
const API_TYPE_IDENTIFIERS = {
|
|
958
|
+
String: { type: "string" },
|
|
959
|
+
Number: { type: "number" },
|
|
960
|
+
Boolean: { type: "boolean" },
|
|
961
|
+
Object: { type: "object" },
|
|
962
|
+
Array: { type: "array" },
|
|
963
|
+
Date: { type: "string", format: "date-time" }
|
|
964
|
+
};
|
|
957
965
|
const buildConstraintsFromKeys = (objectLiteral, keys, read) => Object.fromEntries(
|
|
958
966
|
keys.flatMap((key) => {
|
|
959
967
|
const value = read(objectLiteral, key);
|
|
@@ -984,12 +992,30 @@ const extractApiPropertyEnum = (objLit) => {
|
|
|
984
992
|
}
|
|
985
993
|
return Node.isIdentifier(initializer) ? resolveEnumFromIdentifier(initializer) : void 0;
|
|
986
994
|
};
|
|
995
|
+
const extractApiPropertyType = (objLit) => {
|
|
996
|
+
const initializer = getPropertyInitializer(objLit, "type");
|
|
997
|
+
if (!initializer) return void 0;
|
|
998
|
+
if (Node.isIdentifier(initializer)) {
|
|
999
|
+
return API_TYPE_IDENTIFIERS[initializer.getText()];
|
|
1000
|
+
}
|
|
1001
|
+
const arrayLiteral = initializer.asKind?.(
|
|
1002
|
+
ts.SyntaxKind.ArrayLiteralExpression
|
|
1003
|
+
);
|
|
1004
|
+
const firstArrayElement = arrayLiteral?.getElements()[0];
|
|
1005
|
+
if (firstArrayElement && Node.isIdentifier(firstArrayElement)) {
|
|
1006
|
+
const itemType = API_TYPE_IDENTIFIERS[firstArrayElement.getText()];
|
|
1007
|
+
return itemType ? { ...itemType, isArray: true } : void 0;
|
|
1008
|
+
}
|
|
1009
|
+
return void 0;
|
|
1010
|
+
};
|
|
987
1011
|
const extractApiPropertyConstraints = (decorator) => {
|
|
988
1012
|
const objectLiteral = decorator.getCallExpression()?.getArguments()[0]?.asKind?.(ts.SyntaxKind.ObjectLiteralExpression);
|
|
989
1013
|
if (!objectLiteral) return void 0;
|
|
990
1014
|
const enumValues = extractApiPropertyEnum(objectLiteral);
|
|
1015
|
+
const typeConstraints = extractApiPropertyType(objectLiteral);
|
|
991
1016
|
const result = {
|
|
992
1017
|
...enumValues ? { enum: enumValues } : {},
|
|
1018
|
+
...typeConstraints ?? {},
|
|
993
1019
|
...buildConstraintsFromKeys(
|
|
994
1020
|
objectLiteral,
|
|
995
1021
|
API_STRING_KEYS,
|
|
@@ -1101,18 +1127,32 @@ const collectHiddenProperties = (propertyConstraints) => new Set(
|
|
|
1101
1127
|
);
|
|
1102
1128
|
const applyPropertyConstraintsToSchema = (propertySchema, constraints) => Option.fromNullable(constraints).pipe(
|
|
1103
1129
|
Option.map((propertyConstraints) => {
|
|
1104
|
-
const { hidden: _hidden, ...cleanConstraints } = propertyConstraints;
|
|
1105
|
-
|
|
1106
|
-
|
|
1130
|
+
const { hidden: _hidden, isArray: _isArray, ...cleanConstraints } = propertyConstraints;
|
|
1131
|
+
const {
|
|
1132
|
+
type: typeOverride,
|
|
1133
|
+
enum: enumValues,
|
|
1134
|
+
...restConstraints
|
|
1135
|
+
} = cleanConstraints;
|
|
1136
|
+
const hasItemTypeOverride = propertySchema.type === "array" && typeof typeOverride === "string" && typeOverride !== "array";
|
|
1137
|
+
if (propertySchema.type === "array" && (hasItemTypeOverride || enumValues)) {
|
|
1138
|
+
const itemConstraints = {
|
|
1139
|
+
...hasItemTypeOverride ? { type: typeOverride } : {},
|
|
1140
|
+
...enumValues ? { enum: enumValues } : {}
|
|
1141
|
+
};
|
|
1107
1142
|
return {
|
|
1108
1143
|
...propertySchema,
|
|
1109
1144
|
...restConstraints,
|
|
1110
|
-
items: {
|
|
1145
|
+
items: {
|
|
1146
|
+
...hasItemTypeOverride ? {} : propertySchema.items,
|
|
1147
|
+
...itemConstraints
|
|
1148
|
+
}
|
|
1111
1149
|
};
|
|
1112
1150
|
}
|
|
1113
1151
|
return {
|
|
1114
1152
|
...propertySchema,
|
|
1115
|
-
...
|
|
1153
|
+
...typeOverride === void 0 ? {} : { type: typeOverride },
|
|
1154
|
+
...restConstraints,
|
|
1155
|
+
...enumValues === void 0 ? {} : { enum: enumValues }
|
|
1116
1156
|
};
|
|
1117
1157
|
}),
|
|
1118
1158
|
Option.getOrElse(() => propertySchema)
|