nestjs-openapi 0.3.2 → 0.4.0
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 +8 -96
- package/dist/index.d.ts +8 -96
- package/dist/index.mjs +2 -2
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.mjs +3 -2
- package/dist/shared/{nestjs-openapi.C1wj3WtU.d.mts → nestjs-openapi.-SW6E7E-.d.mts} +221 -130
- package/dist/shared/{nestjs-openapi.C1wj3WtU.d.ts → nestjs-openapi.-SW6E7E-.d.ts} +221 -130
- package/dist/shared/{nestjs-openapi.9yw4zAwS.mjs → nestjs-openapi.zDlSJGHz.mjs} +496 -399
- 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 {
|
|
4
|
+
import { ay as generateEffect, al as generatorServicesLayer, aA as runtimeLayerFor, ax as formatValidationResult } from './shared/nestjs-openapi.zDlSJGHz.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,7 +1,7 @@
|
|
|
1
|
-
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError,
|
|
2
|
-
export {
|
|
1
|
+
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError, c as OpenApiPaths, G as GeneratedSchemas, d as OpenApiSchema, C as ConfigService, P as ProjectService, M as ModuleTraversalService, e as MethodExtractionService, f as SchemaService, T as TransformerService, V as ValidationMapperService, g as OutputService } from './shared/nestjs-openapi.-SW6E7E-.mjs';
|
|
2
|
+
export { a3 as AnalysisError, aM as BrokenRef, aN as BrokenRefCategories, aC as ClassValidationInfo, k as Config, a2 as ConfigError, W as ConfigLoadError, U as ConfigNotFoundError, X as ConfigValidationError, l as ContactConfig, Y as DtoGlobResolutionError, Q as EntryNotFoundError, B as GenerateOptions, q as GenerateOverrides, i as GenerateResult, a4 as GeneratorError, H as HttpMethod, I as InfoConfig, Z as InvalidMethodError, ap as JsonSchema, L as LicenseConfig, F as MethodInfo, _ as MissingGenericSchemaTempFileCleanupError, $ as MissingGenericSchemaTempFileWriteError, ab as ModuleWithControllers, J as OpenApiGeneratorConfig, r as OpenApiOperation, s as OpenApiParameter, t as OpenApiRequestBody, u as OpenApiResponse, o as OutputFormat, D as ParameterLocation, a7 as ProjectContext, a1 as ProjectError, N as ProjectInitError, a8 as ProjectOptions, a5 as ProjectServiceLive, aB as PropertyValidationInfo, a0 as PublicApiError, K as ResolvedConfig, R as ResolvedParameter, E as ReturnTypeInfo, an as SchemaError, am as SchemaGenerationError, ao as SchemaGeneratorOptions, m as ServerConfig, n as TagConfig, p as TelemetryConfig, aA as ValidationConstraints, aL as ValidationResult, ax as applyConstraintsToSchema, aJ as categorizeBrokenRefs, j as defineConfig, av as extractClassConstraints, at as extractClassValidationInfo, au as extractClassValidationInfoEffect, aq as extractPropertyConstraints, as as extractPropertyValidationInfo, aD as findConfigFile, aK as formatValidationResult, h as generate, w as generateAsync, v as generateEffect, A as generateFromConfigAsync, z as generateFromConfigEffect, y as generatePathsAsync, x as generatePathsEffect, ak as generateSchemas, al as generateSchemasFromFiles, aa as getAllControllers, ae as getControllerMethodInfos, af as getControllerMethodInfosEffect, ac as getMethodInfo, ad as getMethodInfoEffect, a9 as getModules, aw as getRequiredProperties, ar as isPropertyOptional, aH as loadAndResolveConfig, aF as loadConfig, aE as loadConfigFromFile, a6 as makeProjectContext, ay as mergeValidationConstraints, az as mergeValidationConstraintsEffect, aG as resolveConfig, ag as transformMethod, ah as transformMethodEffect, ai as transformMethods, aj as transformMethodsEffect, aI as validateSpec } from './shared/nestjs-openapi.-SW6E7E-.mjs';
|
|
3
3
|
import { DynamicModule } from '@nestjs/common';
|
|
4
|
-
import { Effect,
|
|
4
|
+
import { Effect, Layer, Option } from 'effect';
|
|
5
5
|
import { ClassDeclaration, MethodDeclaration, Decorator, Symbol, ObjectLiteralExpression, Expression } from 'ts-morph';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -225,94 +225,6 @@ declare const getControllerTags: (controller: ClassDeclaration) => readonly stri
|
|
|
225
225
|
declare const isHttpDecorator: (decorator: Decorator) => boolean;
|
|
226
226
|
declare const getHttpDecorator: (method: MethodDeclaration) => Decorator | undefined;
|
|
227
227
|
|
|
228
|
-
declare const transformMethod: (methodInfo: MethodInfo) => OpenApiPaths;
|
|
229
|
-
declare const transformMethodEffect: (methodInfo: {
|
|
230
|
-
readonly security: readonly {
|
|
231
|
-
readonly scopes: readonly string[];
|
|
232
|
-
readonly schemeName: string;
|
|
233
|
-
}[];
|
|
234
|
-
readonly path: string;
|
|
235
|
-
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
236
|
-
readonly methodName: string;
|
|
237
|
-
readonly controllerName: string;
|
|
238
|
-
readonly controllerTags: readonly string[];
|
|
239
|
-
readonly returnType: {
|
|
240
|
-
readonly type: Option.Option<string>;
|
|
241
|
-
readonly inline: Option.Option<string>;
|
|
242
|
-
readonly container: Option.Option<"array">;
|
|
243
|
-
readonly filePath: Option.Option<string>;
|
|
244
|
-
};
|
|
245
|
-
readonly parameters: readonly {
|
|
246
|
-
readonly description: Option.Option<string>;
|
|
247
|
-
readonly name: string;
|
|
248
|
-
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
249
|
-
readonly tsType: string;
|
|
250
|
-
readonly required: boolean;
|
|
251
|
-
}[];
|
|
252
|
-
readonly decorators: readonly string[];
|
|
253
|
-
readonly operation: {
|
|
254
|
-
readonly description: Option.Option<string>;
|
|
255
|
-
readonly summary: Option.Option<string>;
|
|
256
|
-
readonly operationId: Option.Option<string>;
|
|
257
|
-
readonly deprecated: Option.Option<boolean>;
|
|
258
|
-
};
|
|
259
|
-
readonly responses: readonly {
|
|
260
|
-
readonly description: Option.Option<string>;
|
|
261
|
-
readonly type: Option.Option<string>;
|
|
262
|
-
readonly statusCode: number;
|
|
263
|
-
readonly isArray: boolean;
|
|
264
|
-
}[];
|
|
265
|
-
readonly httpCode: Option.Option<number>;
|
|
266
|
-
readonly consumes: readonly string[];
|
|
267
|
-
readonly produces: readonly string[];
|
|
268
|
-
}) => Effect.Effect<OpenApiPaths, never, never>;
|
|
269
|
-
type MutableOpenApiPaths = {
|
|
270
|
-
[path: string]: {
|
|
271
|
-
[method: string]: OpenApiOperation;
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
declare const transformMethods: (methodInfos: readonly MethodInfo[]) => OpenApiPaths;
|
|
275
|
-
declare const transformMethodsEffect: (methodInfos: readonly {
|
|
276
|
-
readonly security: readonly {
|
|
277
|
-
readonly scopes: readonly string[];
|
|
278
|
-
readonly schemeName: string;
|
|
279
|
-
}[];
|
|
280
|
-
readonly path: string;
|
|
281
|
-
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
282
|
-
readonly methodName: string;
|
|
283
|
-
readonly controllerName: string;
|
|
284
|
-
readonly controllerTags: readonly string[];
|
|
285
|
-
readonly returnType: {
|
|
286
|
-
readonly type: Option.Option<string>;
|
|
287
|
-
readonly inline: Option.Option<string>;
|
|
288
|
-
readonly container: Option.Option<"array">;
|
|
289
|
-
readonly filePath: Option.Option<string>;
|
|
290
|
-
};
|
|
291
|
-
readonly parameters: readonly {
|
|
292
|
-
readonly description: Option.Option<string>;
|
|
293
|
-
readonly name: string;
|
|
294
|
-
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
295
|
-
readonly tsType: string;
|
|
296
|
-
readonly required: boolean;
|
|
297
|
-
}[];
|
|
298
|
-
readonly decorators: readonly string[];
|
|
299
|
-
readonly operation: {
|
|
300
|
-
readonly description: Option.Option<string>;
|
|
301
|
-
readonly summary: Option.Option<string>;
|
|
302
|
-
readonly operationId: Option.Option<string>;
|
|
303
|
-
readonly deprecated: Option.Option<boolean>;
|
|
304
|
-
};
|
|
305
|
-
readonly responses: readonly {
|
|
306
|
-
readonly description: Option.Option<string>;
|
|
307
|
-
readonly type: Option.Option<string>;
|
|
308
|
-
readonly statusCode: number;
|
|
309
|
-
readonly isArray: boolean;
|
|
310
|
-
}[];
|
|
311
|
-
readonly httpCode: Option.Option<number>;
|
|
312
|
-
readonly consumes: readonly string[];
|
|
313
|
-
readonly produces: readonly string[];
|
|
314
|
-
}[]) => Effect.Effect<MutableOpenApiPaths, never, never>;
|
|
315
|
-
|
|
316
228
|
/**
|
|
317
229
|
* Schema Merger - Combines DTO schemas with path-referenced schemas
|
|
318
230
|
*
|
|
@@ -325,12 +237,12 @@ declare const transformMethodsEffect: (methodInfos: readonly {
|
|
|
325
237
|
*/
|
|
326
238
|
interface MergedResult {
|
|
327
239
|
/** The paths with updated $ref values */
|
|
328
|
-
readonly paths: OpenApiPaths
|
|
240
|
+
readonly paths: OpenApiPaths;
|
|
329
241
|
/** All schemas to include in components/schemas */
|
|
330
242
|
readonly schemas: Record<string, OpenApiSchema>;
|
|
331
243
|
}
|
|
332
|
-
declare const mergeSchemas: (paths: OpenApiPaths
|
|
333
|
-
declare const mergeSchemasEffect: (paths: OpenApiPaths
|
|
244
|
+
declare const mergeSchemas: (paths: OpenApiPaths, generatedSchemas: GeneratedSchemas) => MergedResult;
|
|
245
|
+
declare const mergeSchemasEffect: (paths: OpenApiPaths, generatedSchemas: GeneratedSchemas) => Effect.Effect<MergedResult, never, never>;
|
|
334
246
|
declare const mergeGeneratedSchemas: (...schemas: GeneratedSchemas[]) => GeneratedSchemas;
|
|
335
247
|
declare const mergeGeneratedSchemasEffect: (...args: GeneratedSchemas[]) => Effect.Effect<GeneratedSchemas, never, never>;
|
|
336
248
|
declare const filterSchemas: (schemas: GeneratedSchemas, include?: readonly string[], exclude?: readonly string[]) => GeneratedSchemas;
|
|
@@ -377,7 +289,7 @@ declare const normalizeStructureRefsEffect: (schemas: GeneratedSchemas) => Effec
|
|
|
377
289
|
/**
|
|
378
290
|
* Shared service dependency graph for generation pipelines.
|
|
379
291
|
*/
|
|
380
|
-
declare const generatorServicesLayer: Layer.Layer<ConfigService |
|
|
292
|
+
declare const generatorServicesLayer: Layer.Layer<ConfigService | ProjectService | ModuleTraversalService | MethodExtractionService | SchemaService | TransformerService | ValidationMapperService | OutputService, never, never>;
|
|
381
293
|
|
|
382
294
|
/** Handles aliased symbols (re-exports) */
|
|
383
295
|
declare const resolveClassFromSymbol: (sym: Symbol) => Option.Option<ClassDeclaration>;
|
|
@@ -396,5 +308,5 @@ interface ModuleMetadata {
|
|
|
396
308
|
}
|
|
397
309
|
declare const getModuleMetadata: (mod: ClassDeclaration) => ModuleMetadata;
|
|
398
310
|
|
|
399
|
-
export { ConfigService, GeneratedSchemas, MethodExtractionService,
|
|
311
|
+
export { ConfigService, GeneratedSchemas, MethodExtractionService, ModuleTraversalService, OPENAPI_MODULE_OPTIONS, OPENAPI_SPEC, OpenApiModule, OpenApiPaths, OpenApiSchema, OpenApiSpec, OutputService, ProjectService, SchemaService, SpecFileNotFoundError, SpecFileParseError, SpecFileReadError, TransformerService, ValidationMapperService, ValidationMapperService as ValidationService, filterInternalSchemas, filterInternalSchemasEffect, filterSchemas, filterSchemasEffect, generateSwaggerUiHtml, generatorServicesLayer, getArrayInitializer, getControllerName, getControllerPrefix, getControllerTags, getDecoratorName, getHttpDecorator, getHttpMethods, getModuleDecoratorArg, getModuleMetadata, getStringLiteralValue, getSymbolFromIdentifier, isHttpDecorator, isHttpMethod, isModuleClass, loadSpecFile, loadSpecFileEffect, mergeGeneratedSchemas, mergeGeneratedSchemasEffect, mergeSchemas, mergeSchemasEffect, normalizePath, normalizeSchemas, normalizeSchemasEffect, normalizeStructureRefs, normalizeStructureRefsEffect, resolveArrayOfClasses, resolveClassFromExpression, resolveClassFromSymbol, resolveOptions, toPascalCase };
|
|
400
312
|
export type { LoadSpecFileOptions, MergedResult, ModuleMetadata, NormalizerOptions, OpenApiDocumentFileSource, OpenApiDocumentSource, OpenApiHttpApplication, OpenApiModuleOptions, OpenApiSetupOptions, ResolvedOpenApiModuleOptions, SwaggerOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError,
|
|
2
|
-
export {
|
|
1
|
+
import { O as OpenApiSpec, S as SpecFileNotFoundError, a as SpecFileReadError, b as SpecFileParseError, c as OpenApiPaths, G as GeneratedSchemas, d as OpenApiSchema, C as ConfigService, P as ProjectService, M as ModuleTraversalService, e as MethodExtractionService, f as SchemaService, T as TransformerService, V as ValidationMapperService, g as OutputService } from './shared/nestjs-openapi.-SW6E7E-.js';
|
|
2
|
+
export { a3 as AnalysisError, aM as BrokenRef, aN as BrokenRefCategories, aC as ClassValidationInfo, k as Config, a2 as ConfigError, W as ConfigLoadError, U as ConfigNotFoundError, X as ConfigValidationError, l as ContactConfig, Y as DtoGlobResolutionError, Q as EntryNotFoundError, B as GenerateOptions, q as GenerateOverrides, i as GenerateResult, a4 as GeneratorError, H as HttpMethod, I as InfoConfig, Z as InvalidMethodError, ap as JsonSchema, L as LicenseConfig, F as MethodInfo, _ as MissingGenericSchemaTempFileCleanupError, $ as MissingGenericSchemaTempFileWriteError, ab as ModuleWithControllers, J as OpenApiGeneratorConfig, r as OpenApiOperation, s as OpenApiParameter, t as OpenApiRequestBody, u as OpenApiResponse, o as OutputFormat, D as ParameterLocation, a7 as ProjectContext, a1 as ProjectError, N as ProjectInitError, a8 as ProjectOptions, a5 as ProjectServiceLive, aB as PropertyValidationInfo, a0 as PublicApiError, K as ResolvedConfig, R as ResolvedParameter, E as ReturnTypeInfo, an as SchemaError, am as SchemaGenerationError, ao as SchemaGeneratorOptions, m as ServerConfig, n as TagConfig, p as TelemetryConfig, aA as ValidationConstraints, aL as ValidationResult, ax as applyConstraintsToSchema, aJ as categorizeBrokenRefs, j as defineConfig, av as extractClassConstraints, at as extractClassValidationInfo, au as extractClassValidationInfoEffect, aq as extractPropertyConstraints, as as extractPropertyValidationInfo, aD as findConfigFile, aK as formatValidationResult, h as generate, w as generateAsync, v as generateEffect, A as generateFromConfigAsync, z as generateFromConfigEffect, y as generatePathsAsync, x as generatePathsEffect, ak as generateSchemas, al as generateSchemasFromFiles, aa as getAllControllers, ae as getControllerMethodInfos, af as getControllerMethodInfosEffect, ac as getMethodInfo, ad as getMethodInfoEffect, a9 as getModules, aw as getRequiredProperties, ar as isPropertyOptional, aH as loadAndResolveConfig, aF as loadConfig, aE as loadConfigFromFile, a6 as makeProjectContext, ay as mergeValidationConstraints, az as mergeValidationConstraintsEffect, aG as resolveConfig, ag as transformMethod, ah as transformMethodEffect, ai as transformMethods, aj as transformMethodsEffect, aI as validateSpec } from './shared/nestjs-openapi.-SW6E7E-.js';
|
|
3
3
|
import { DynamicModule } from '@nestjs/common';
|
|
4
|
-
import { Effect,
|
|
4
|
+
import { Effect, Layer, Option } from 'effect';
|
|
5
5
|
import { ClassDeclaration, MethodDeclaration, Decorator, Symbol, ObjectLiteralExpression, Expression } from 'ts-morph';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -225,94 +225,6 @@ declare const getControllerTags: (controller: ClassDeclaration) => readonly stri
|
|
|
225
225
|
declare const isHttpDecorator: (decorator: Decorator) => boolean;
|
|
226
226
|
declare const getHttpDecorator: (method: MethodDeclaration) => Decorator | undefined;
|
|
227
227
|
|
|
228
|
-
declare const transformMethod: (methodInfo: MethodInfo) => OpenApiPaths;
|
|
229
|
-
declare const transformMethodEffect: (methodInfo: {
|
|
230
|
-
readonly security: readonly {
|
|
231
|
-
readonly scopes: readonly string[];
|
|
232
|
-
readonly schemeName: string;
|
|
233
|
-
}[];
|
|
234
|
-
readonly path: string;
|
|
235
|
-
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
236
|
-
readonly methodName: string;
|
|
237
|
-
readonly controllerName: string;
|
|
238
|
-
readonly controllerTags: readonly string[];
|
|
239
|
-
readonly returnType: {
|
|
240
|
-
readonly type: Option.Option<string>;
|
|
241
|
-
readonly inline: Option.Option<string>;
|
|
242
|
-
readonly container: Option.Option<"array">;
|
|
243
|
-
readonly filePath: Option.Option<string>;
|
|
244
|
-
};
|
|
245
|
-
readonly parameters: readonly {
|
|
246
|
-
readonly description: Option.Option<string>;
|
|
247
|
-
readonly name: string;
|
|
248
|
-
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
249
|
-
readonly tsType: string;
|
|
250
|
-
readonly required: boolean;
|
|
251
|
-
}[];
|
|
252
|
-
readonly decorators: readonly string[];
|
|
253
|
-
readonly operation: {
|
|
254
|
-
readonly description: Option.Option<string>;
|
|
255
|
-
readonly summary: Option.Option<string>;
|
|
256
|
-
readonly operationId: Option.Option<string>;
|
|
257
|
-
readonly deprecated: Option.Option<boolean>;
|
|
258
|
-
};
|
|
259
|
-
readonly responses: readonly {
|
|
260
|
-
readonly description: Option.Option<string>;
|
|
261
|
-
readonly type: Option.Option<string>;
|
|
262
|
-
readonly statusCode: number;
|
|
263
|
-
readonly isArray: boolean;
|
|
264
|
-
}[];
|
|
265
|
-
readonly httpCode: Option.Option<number>;
|
|
266
|
-
readonly consumes: readonly string[];
|
|
267
|
-
readonly produces: readonly string[];
|
|
268
|
-
}) => Effect.Effect<OpenApiPaths, never, never>;
|
|
269
|
-
type MutableOpenApiPaths = {
|
|
270
|
-
[path: string]: {
|
|
271
|
-
[method: string]: OpenApiOperation;
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
declare const transformMethods: (methodInfos: readonly MethodInfo[]) => OpenApiPaths;
|
|
275
|
-
declare const transformMethodsEffect: (methodInfos: readonly {
|
|
276
|
-
readonly security: readonly {
|
|
277
|
-
readonly scopes: readonly string[];
|
|
278
|
-
readonly schemeName: string;
|
|
279
|
-
}[];
|
|
280
|
-
readonly path: string;
|
|
281
|
-
readonly httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD" | "ALL";
|
|
282
|
-
readonly methodName: string;
|
|
283
|
-
readonly controllerName: string;
|
|
284
|
-
readonly controllerTags: readonly string[];
|
|
285
|
-
readonly returnType: {
|
|
286
|
-
readonly type: Option.Option<string>;
|
|
287
|
-
readonly inline: Option.Option<string>;
|
|
288
|
-
readonly container: Option.Option<"array">;
|
|
289
|
-
readonly filePath: Option.Option<string>;
|
|
290
|
-
};
|
|
291
|
-
readonly parameters: readonly {
|
|
292
|
-
readonly description: Option.Option<string>;
|
|
293
|
-
readonly name: string;
|
|
294
|
-
readonly location: "query" | "header" | "cookie" | "path" | "body";
|
|
295
|
-
readonly tsType: string;
|
|
296
|
-
readonly required: boolean;
|
|
297
|
-
}[];
|
|
298
|
-
readonly decorators: readonly string[];
|
|
299
|
-
readonly operation: {
|
|
300
|
-
readonly description: Option.Option<string>;
|
|
301
|
-
readonly summary: Option.Option<string>;
|
|
302
|
-
readonly operationId: Option.Option<string>;
|
|
303
|
-
readonly deprecated: Option.Option<boolean>;
|
|
304
|
-
};
|
|
305
|
-
readonly responses: readonly {
|
|
306
|
-
readonly description: Option.Option<string>;
|
|
307
|
-
readonly type: Option.Option<string>;
|
|
308
|
-
readonly statusCode: number;
|
|
309
|
-
readonly isArray: boolean;
|
|
310
|
-
}[];
|
|
311
|
-
readonly httpCode: Option.Option<number>;
|
|
312
|
-
readonly consumes: readonly string[];
|
|
313
|
-
readonly produces: readonly string[];
|
|
314
|
-
}[]) => Effect.Effect<MutableOpenApiPaths, never, never>;
|
|
315
|
-
|
|
316
228
|
/**
|
|
317
229
|
* Schema Merger - Combines DTO schemas with path-referenced schemas
|
|
318
230
|
*
|
|
@@ -325,12 +237,12 @@ declare const transformMethodsEffect: (methodInfos: readonly {
|
|
|
325
237
|
*/
|
|
326
238
|
interface MergedResult {
|
|
327
239
|
/** The paths with updated $ref values */
|
|
328
|
-
readonly paths: OpenApiPaths
|
|
240
|
+
readonly paths: OpenApiPaths;
|
|
329
241
|
/** All schemas to include in components/schemas */
|
|
330
242
|
readonly schemas: Record<string, OpenApiSchema>;
|
|
331
243
|
}
|
|
332
|
-
declare const mergeSchemas: (paths: OpenApiPaths
|
|
333
|
-
declare const mergeSchemasEffect: (paths: OpenApiPaths
|
|
244
|
+
declare const mergeSchemas: (paths: OpenApiPaths, generatedSchemas: GeneratedSchemas) => MergedResult;
|
|
245
|
+
declare const mergeSchemasEffect: (paths: OpenApiPaths, generatedSchemas: GeneratedSchemas) => Effect.Effect<MergedResult, never, never>;
|
|
334
246
|
declare const mergeGeneratedSchemas: (...schemas: GeneratedSchemas[]) => GeneratedSchemas;
|
|
335
247
|
declare const mergeGeneratedSchemasEffect: (...args: GeneratedSchemas[]) => Effect.Effect<GeneratedSchemas, never, never>;
|
|
336
248
|
declare const filterSchemas: (schemas: GeneratedSchemas, include?: readonly string[], exclude?: readonly string[]) => GeneratedSchemas;
|
|
@@ -377,7 +289,7 @@ declare const normalizeStructureRefsEffect: (schemas: GeneratedSchemas) => Effec
|
|
|
377
289
|
/**
|
|
378
290
|
* Shared service dependency graph for generation pipelines.
|
|
379
291
|
*/
|
|
380
|
-
declare const generatorServicesLayer: Layer.Layer<ConfigService |
|
|
292
|
+
declare const generatorServicesLayer: Layer.Layer<ConfigService | ProjectService | ModuleTraversalService | MethodExtractionService | SchemaService | TransformerService | ValidationMapperService | OutputService, never, never>;
|
|
381
293
|
|
|
382
294
|
/** Handles aliased symbols (re-exports) */
|
|
383
295
|
declare const resolveClassFromSymbol: (sym: Symbol) => Option.Option<ClassDeclaration>;
|
|
@@ -396,5 +308,5 @@ interface ModuleMetadata {
|
|
|
396
308
|
}
|
|
397
309
|
declare const getModuleMetadata: (mod: ClassDeclaration) => ModuleMetadata;
|
|
398
310
|
|
|
399
|
-
export { ConfigService, GeneratedSchemas, MethodExtractionService,
|
|
311
|
+
export { ConfigService, GeneratedSchemas, MethodExtractionService, ModuleTraversalService, OPENAPI_MODULE_OPTIONS, OPENAPI_SPEC, OpenApiModule, OpenApiPaths, OpenApiSchema, OpenApiSpec, OutputService, ProjectService, SchemaService, SpecFileNotFoundError, SpecFileParseError, SpecFileReadError, TransformerService, ValidationMapperService, ValidationMapperService as ValidationService, filterInternalSchemas, filterInternalSchemasEffect, filterSchemas, filterSchemasEffect, generateSwaggerUiHtml, generatorServicesLayer, getArrayInitializer, getControllerName, getControllerPrefix, getControllerTags, getDecoratorName, getHttpDecorator, getHttpMethods, getModuleDecoratorArg, getModuleMetadata, getStringLiteralValue, getSymbolFromIdentifier, isHttpDecorator, isHttpMethod, isModuleClass, loadSpecFile, loadSpecFileEffect, mergeGeneratedSchemas, mergeGeneratedSchemasEffect, mergeSchemas, mergeSchemasEffect, normalizePath, normalizeSchemas, normalizeSchemasEffect, normalizeStructureRefs, normalizeStructureRefsEffect, resolveArrayOfClasses, resolveClassFromExpression, resolveClassFromSymbol, resolveOptions, toPascalCase };
|
|
400
312
|
export type { LoadSpecFileOptions, MergedResult, ModuleMetadata, NormalizerOptions, OpenApiDocumentFileSource, OpenApiDocumentSource, OpenApiHttpApplication, OpenApiModuleOptions, OpenApiSetupOptions, ResolvedOpenApiModuleOptions, SwaggerOptions };
|
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,
|
|
1
|
+
import { S as SpecFileNotFoundError, a as SpecFileParseError, b as SpecFileReadError } from './shared/nestjs-openapi.zDlSJGHz.mjs';
|
|
2
|
+
export { c as ConfigLoadError, C as ConfigNotFoundError, af 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, ae as OutputService, P as ProjectInitError, i as ProjectService, j as ProjectServiceLive, h as PublicApiError, a1 as SchemaGenerationError, a2 as SchemaService, T as TransformerService, a3 as ValidationMapperService, a3 as ValidationService, ab as applyConstraintsToSchema, aw as categorizeBrokenRefs, d as defineConfig, a9 as extractClassConstraints, a7 as extractClassValidationInfo, a8 as extractClassValidationInfoEffect, a4 as extractPropertyConstraints, a6 as extractPropertyValidationInfo, W as filterInternalSchemas, X as filterInternalSchemasEffect, Q as filterSchemas, R as filterSchemasEffect, ag as findConfigFile, ax as formatValidationResult, g as generate, $ as generateSchemas, a0 as generateSchemasFromFiles, al as generatorServicesLayer, l as getAllControllers, an 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, ar as getModuleDecoratorArg, au as getModuleMetadata, k as getModules, aa as getRequiredProperties, ao as getStringLiteralValue, ap as getSymbolFromIdentifier, v as isHttpDecorator, q as isHttpMethod, aq as isModuleClass, a5 as isPropertyOptional, ak as loadAndResolveConfig, ai as loadConfig, ah as loadConfigFromFile, m as makeProjectContext, N as mergeGeneratedSchemas, O as mergeGeneratedSchemasEffect, K as mergeSchemas, L as mergeSchemasEffect, ac as mergeValidationConstraints, ad as mergeValidationConstraintsEffect, w as normalizePath, U as normalizeSchemas, V as normalizeSchemasEffect, Y as normalizeStructureRefs, Z as normalizeStructureRefsEffect, at as resolveArrayOfClasses, as as resolveClassFromExpression, am as resolveClassFromSymbol, aj as resolveConfig, _ as toPascalCase, F as transformMethod, G as transformMethodEffect, H as transformMethods, J as transformMethodsEffect, av as validateSpec } from './shared/nestjs-openapi.zDlSJGHz.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 {
|
|
1
|
+
export { B as GenerateOptions, v as generate, w as generateAsync, A as generateFromConfigAsync, z as generateFromConfigEffect, y as generatePathsAsync, x as generatePathsEffect } from './shared/nestjs-openapi.-SW6E7E-.mjs';
|
|
2
2
|
import 'effect';
|
|
3
3
|
import 'ts-morph';
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { B as GenerateOptions, v as generate, w as generateAsync, A as generateFromConfigAsync, z as generateFromConfigEffect, y as generatePathsAsync, x as generatePathsEffect } from './shared/nestjs-openapi.-SW6E7E-.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,
|
|
2
|
+
import { i as ProjectService, n as ModuleTraversalService, B as MethodExtractionService, T as TransformerService, ay as generateEffect, az as runProjectApiPromise, al as generatorServicesLayer, aA as runtimeLayerFor, aB as runGeneratorApiPromise } from './shared/nestjs-openapi.zDlSJGHz.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:crypto';
|
|
@@ -30,7 +30,8 @@ const generatePathsEffect = Effect.fn("Internal.generatePathsEffect")(
|
|
|
30
30
|
methods: flatMethodInfos.length
|
|
31
31
|
})
|
|
32
32
|
);
|
|
33
|
-
const
|
|
33
|
+
const transformer = yield* TransformerService;
|
|
34
|
+
const paths = yield* transformer.transformMethods(flatMethodInfos);
|
|
34
35
|
yield* Effect.logInfo("OpenAPI generation complete").pipe(
|
|
35
36
|
Effect.annotateLogs({ paths: Object.keys(paths).length })
|
|
36
37
|
);
|