@dudousxd/nestjs-codegen 0.20.0 → 0.21.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/CHANGELOG.md +27 -0
- package/dist/cli/main.cjs +6 -6
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +6 -6
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +6 -6
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -382,6 +382,6 @@ interface FastDiscoveryOptions {
|
|
|
382
382
|
}
|
|
383
383
|
declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
|
|
384
384
|
|
|
385
|
-
declare const VERSION = "0.
|
|
385
|
+
declare const VERSION = "0.21.0";
|
|
386
386
|
|
|
387
387
|
export { type ChainModuleRendererOptions, CodegenError, type CodegenManifest, ConfigError, DriftGuardError, type EntryPoint, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type WatchOptions, type Watcher, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
|
package/dist/index.d.ts
CHANGED
|
@@ -382,6 +382,6 @@ interface FastDiscoveryOptions {
|
|
|
382
382
|
}
|
|
383
383
|
declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
|
|
384
384
|
|
|
385
|
-
declare const VERSION = "0.
|
|
385
|
+
declare const VERSION = "0.21.0";
|
|
386
386
|
|
|
387
387
|
export { type ChainModuleRendererOptions, CodegenError, type CodegenManifest, ConfigError, DriftGuardError, type EntryPoint, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type WatchOptions, type Watcher, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
|
package/dist/index.js
CHANGED
|
@@ -3725,7 +3725,7 @@ function extractFilterForHints(classDecl, project) {
|
|
|
3725
3725
|
}
|
|
3726
3726
|
return hints;
|
|
3727
3727
|
}
|
|
3728
|
-
function extractApplyFilterInfo(method, sourceFile, project, mixin) {
|
|
3728
|
+
function extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass) {
|
|
3729
3729
|
const declFile = method.getSourceFile();
|
|
3730
3730
|
const mixinEntity = resolveMixinEntityClass(mixin, project);
|
|
3731
3731
|
for (const param of method.getParameters()) {
|
|
@@ -3751,7 +3751,7 @@ function extractApplyFilterInfo(method, sourceFile, project, mixin) {
|
|
|
3751
3751
|
const filterClassName = filterClassArg.getText();
|
|
3752
3752
|
const resolved = factoryStaticClass ? void 0 : findType(filterClassName, declFile, project);
|
|
3753
3753
|
const declaredClass = factoryStaticClass ?? (resolved?.kind === "class" ? resolved.decl : resolveLocalClassDeclaration(filterClassArg));
|
|
3754
|
-
const ownRoute = !mixin || declFile.getFilePath() !== mixin.factoryFilePath;
|
|
3754
|
+
const ownRoute = !mixin || (controllerClass ? method.getParent() === controllerClass : declFile.getFilePath() !== mixin.factoryFilePath);
|
|
3755
3755
|
const namedByRoute = ownRoute && Node6.isIdentifier(filterClassArg) ? declaredClass : void 0;
|
|
3756
3756
|
for (const candidate of orderFilterCandidates({
|
|
3757
3757
|
namedByRoute,
|
|
@@ -4342,9 +4342,9 @@ function unwrapNamedContainer(node, names) {
|
|
|
4342
4342
|
}
|
|
4343
4343
|
return node;
|
|
4344
4344
|
}
|
|
4345
|
-
function extractDtoContract(method, sourceFile, project, mixin) {
|
|
4345
|
+
function extractDtoContract(method, sourceFile, project, mixin, controllerClass) {
|
|
4346
4346
|
let body = extractBodyType(method, sourceFile, project);
|
|
4347
|
-
const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin);
|
|
4347
|
+
const filterInfo = extractApplyFilterInfo(method, sourceFile, project, mixin, controllerClass);
|
|
4348
4348
|
const query = extractQueryType(method, sourceFile, project);
|
|
4349
4349
|
const uploads = extractUploadedFiles(method);
|
|
4350
4350
|
const multipartBody = uploads.fields ? `{ ${uploads.fields} }` : null;
|
|
@@ -4907,7 +4907,7 @@ function extractDtoRoute(args) {
|
|
|
4907
4907
|
const methodName = method.getName();
|
|
4908
4908
|
const classAs = readAsDecorator(cls, `class ${className}`);
|
|
4909
4909
|
const methodAs = readAsDecorator(method, `${className}.${methodName}`);
|
|
4910
|
-
const dtoContract = extractDtoContract(method, sourceFile, project, mixin);
|
|
4910
|
+
const dtoContract = extractDtoContract(method, sourceFile, project, mixin, cls);
|
|
4911
4911
|
const mixinResponse = mixin ? resolveInstantiatedReturnType(cls, methodName) : void 0;
|
|
4912
4912
|
return buildRoute({
|
|
4913
4913
|
className,
|
|
@@ -5271,7 +5271,7 @@ function createChainModuleRenderer(opts) {
|
|
|
5271
5271
|
}
|
|
5272
5272
|
|
|
5273
5273
|
// src/index.ts
|
|
5274
|
-
var VERSION = "0.
|
|
5274
|
+
var VERSION = "0.21.0";
|
|
5275
5275
|
export {
|
|
5276
5276
|
CodegenError,
|
|
5277
5277
|
ConfigError,
|