@achinet/nestjs-async 0.1.1 → 0.3.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/asyncapi-document.builder.d.ts +1 -1
- package/dist/asyncapi-document.builder.js.map +1 -1
- package/dist/asyncapi.module.js +8 -5
- package/dist/asyncapi.module.js.map +1 -1
- package/dist/binding/asyncapi.kafka.interfaces.d.ts +1 -1
- package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js +3 -3
- package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-operation.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-pub.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-service.decorator.d.ts +1 -1
- package/dist/decorators/asyncapi-service.decorator.js +2 -2
- package/dist/decorators/asyncapi-service.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-sub.decorator.js.map +1 -1
- package/dist/explorers/asyncapi-class.explorer.js +1 -5
- package/dist/explorers/asyncapi-class.explorer.js.map +1 -1
- package/dist/explorers/asyncapi-operation.explorer.d.ts +1 -2
- package/dist/explorers/asyncapi-operation.explorer.js +2 -2
- package/dist/explorers/asyncapi-operation.explorer.js.map +1 -1
- package/dist/interface/asyncapi-common.interfaces.d.ts +1 -1
- package/dist/interface/asyncapi-server.interface.d.ts +1 -1
- package/dist/interface/asyncapi-template-options.interface.d.ts +2 -3
- package/dist/interface/index.d.ts +0 -1
- package/dist/interface/index.js +0 -1
- package/dist/interface/index.js.map +1 -1
- package/dist/services/asyncapi.explorer.d.ts +2 -4
- package/dist/services/asyncapi.explorer.js +8 -13
- package/dist/services/asyncapi.explorer.js.map +1 -1
- package/dist/services/asyncapi.generator.d.ts +4 -3
- package/dist/services/asyncapi.generator.js +72 -17
- package/dist/services/asyncapi.generator.js.map +1 -1
- package/dist/services/asyncapi.scanner.d.ts +1 -4
- package/dist/services/asyncapi.scanner.js +10 -31
- package/dist/services/asyncapi.scanner.js.map +1 -1
- package/dist/services/asyncapi.transformer.js.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/operation-object.factory.d.ts +2 -6
- package/dist/services/operation-object.factory.js +7 -14
- package/dist/services/operation-object.factory.js.map +1 -1
- package/dist/services/swagger-schema.factory.d.ts +6 -0
- package/dist/services/swagger-schema.factory.js +27 -0
- package/dist/services/swagger-schema.factory.js.map +1 -0
- package/dist/utils/decorator.utils.d.ts +2 -0
- package/dist/utils/decorator.utils.js +26 -0
- package/dist/utils/decorator.utils.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/{sample/felines/rto → utils}/index.js +2 -1
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/path.utils.d.ts +2 -0
- package/dist/utils/path.utils.js +8 -0
- package/dist/utils/path.utils.js.map +1 -0
- package/package.json +57 -37
- package/.prettierrc +0 -5
- package/CHANGELOG.md +0 -20
- package/dist/interface/generator-options.interface.d.ts +0 -22
- package/dist/interface/generator-options.interface.js +0 -3
- package/dist/interface/generator-options.interface.js.map +0 -1
- package/dist/sample/app.module.d.ts +0 -2
- package/dist/sample/app.module.js +0 -20
- package/dist/sample/app.module.js.map +0 -1
- package/dist/sample/common.d.ts +0 -3
- package/dist/sample/common.js +0 -40
- package/dist/sample/common.js.map +0 -1
- package/dist/sample/constants.d.ts +0 -12
- package/dist/sample/constants.js +0 -16
- package/dist/sample/constants.js.map +0 -1
- package/dist/sample/felines/class/cat.class.d.ts +0 -4
- package/dist/sample/felines/class/cat.class.js +0 -24
- package/dist/sample/felines/class/cat.class.js.map +0 -1
- package/dist/sample/felines/class/feline.class.d.ts +0 -19
- package/dist/sample/felines/class/feline.class.js +0 -20
- package/dist/sample/felines/class/feline.class.js.map +0 -1
- package/dist/sample/felines/class/index.d.ts +0 -5
- package/dist/sample/felines/class/index.js +0 -22
- package/dist/sample/felines/class/index.js.map +0 -1
- package/dist/sample/felines/class/lion.class.d.ts +0 -4
- package/dist/sample/felines/class/lion.class.js +0 -8
- package/dist/sample/felines/class/lion.class.js.map +0 -1
- package/dist/sample/felines/class/message.class.d.ts +0 -7
- package/dist/sample/felines/class/message.class.js +0 -28
- package/dist/sample/felines/class/message.class.js.map +0 -1
- package/dist/sample/felines/class/tiger.class.d.ts +0 -4
- package/dist/sample/felines/class/tiger.class.js +0 -8
- package/dist/sample/felines/class/tiger.class.js.map +0 -1
- package/dist/sample/felines/dto/create-feline.dto.d.ts +0 -4
- package/dist/sample/felines/dto/create-feline.dto.js +0 -28
- package/dist/sample/felines/dto/create-feline.dto.js.map +0 -1
- package/dist/sample/felines/dto/index.d.ts +0 -2
- package/dist/sample/felines/dto/index.js +0 -19
- package/dist/sample/felines/dto/index.js.map +0 -1
- package/dist/sample/felines/dto/journaling-data.dto.d.ts +0 -4
- package/dist/sample/felines/dto/journaling-data.dto.js +0 -8
- package/dist/sample/felines/dto/journaling-data.dto.js.map +0 -1
- package/dist/sample/felines/felines.constants.d.ts +0 -1
- package/dist/sample/felines/felines.constants.js +0 -5
- package/dist/sample/felines/felines.constants.js.map +0 -1
- package/dist/sample/felines/felines.controller.d.ts +0 -15
- package/dist/sample/felines/felines.controller.js +0 -101
- package/dist/sample/felines/felines.controller.js.map +0 -1
- package/dist/sample/felines/felines.gateway.d.ts +0 -16
- package/dist/sample/felines/felines.gateway.js +0 -90
- package/dist/sample/felines/felines.gateway.js.map +0 -1
- package/dist/sample/felines/felines.module.d.ts +0 -2
- package/dist/sample/felines/felines.module.js +0 -28
- package/dist/sample/felines/felines.module.js.map +0 -1
- package/dist/sample/felines/felines.service.d.ts +0 -8
- package/dist/sample/felines/felines.service.js +0 -33
- package/dist/sample/felines/felines.service.js.map +0 -1
- package/dist/sample/felines/rto/feline.rto.d.ts +0 -7
- package/dist/sample/felines/rto/feline.rto.js +0 -31
- package/dist/sample/felines/rto/feline.rto.js.map +0 -1
- package/dist/sample/felines/rto/index.d.ts +0 -1
- package/dist/sample/felines/rto/index.js.map +0 -1
- package/dist/sample/index.d.ts +0 -3
- package/dist/sample/index.js +0 -20
- package/dist/sample/index.js.map +0 -1
- package/dist/sample/main.d.ts +0 -1
- package/dist/sample/main.js +0 -30
- package/dist/sample/main.js.map +0 -1
- package/dist/src/asyncapi-document.builder.d.ts +0 -27
- package/dist/src/asyncapi-document.builder.js +0 -110
- package/dist/src/asyncapi-document.builder.js.map +0 -1
- package/dist/src/asyncapi.constants.d.ts +0 -6
- package/dist/src/asyncapi.constants.js +0 -11
- package/dist/src/asyncapi.constants.js.map +0 -1
- package/dist/src/asyncapi.module.d.ts +0 -8
- package/dist/src/asyncapi.module.js +0 -47
- package/dist/src/asyncapi.module.js.map +0 -1
- package/dist/src/binding/asyncapi.amqp.interfaces.d.ts +0 -38
- package/dist/src/binding/asyncapi.amqp.interfaces.js +0 -3
- package/dist/src/binding/asyncapi.amqp.interfaces.js.map +0 -1
- package/dist/src/binding/asyncapi.kafka.interfaces.d.ts +0 -21
- package/dist/src/binding/asyncapi.kafka.interfaces.js +0 -3
- package/dist/src/binding/asyncapi.kafka.interfaces.js.map +0 -1
- package/dist/src/binding/index.d.ts +0 -2
- package/dist/src/binding/index.js +0 -19
- package/dist/src/binding/index.js.map +0 -1
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js +0 -37
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-operation.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-operation.decorator.js +0 -9
- package/dist/src/decorators/asyncapi-operation.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-pub.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-pub.decorator.js +0 -10
- package/dist/src/decorators/asyncapi-pub.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-service.decorator.d.ts +0 -1
- package/dist/src/decorators/asyncapi-service.decorator.js +0 -9
- package/dist/src/decorators/asyncapi-service.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-sub.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-sub.decorator.js +0 -10
- package/dist/src/decorators/asyncapi-sub.decorator.js.map +0 -1
- package/dist/src/decorators/index.d.ts +0 -4
- package/dist/src/decorators/index.js +0 -21
- package/dist/src/decorators/index.js.map +0 -1
- package/dist/src/explorers/asyncapi-class.explorer.d.ts +0 -5
- package/dist/src/explorers/asyncapi-class.explorer.js +0 -27
- package/dist/src/explorers/asyncapi-class.explorer.js.map +0 -1
- package/dist/src/explorers/asyncapi-operation.explorer.d.ts +0 -17
- package/dist/src/explorers/asyncapi-operation.explorer.js +0 -26
- package/dist/src/explorers/asyncapi-operation.explorer.js.map +0 -1
- package/dist/src/explorers/index.d.ts +0 -2
- package/dist/src/explorers/index.js +0 -19
- package/dist/src/explorers/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -21
- package/dist/src/index.js.map +0 -1
- package/dist/src/interface/asyncapi-common.interfaces.d.ts +0 -126
- package/dist/src/interface/asyncapi-common.interfaces.js +0 -3
- package/dist/src/interface/asyncapi-common.interfaces.js.map +0 -1
- package/dist/src/interface/asyncapi-document-options.interface.d.ts +0 -3
- package/dist/src/interface/asyncapi-document-options.interface.js +0 -3
- package/dist/src/interface/asyncapi-document-options.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-message.interface.d.ts +0 -8
- package/dist/src/interface/asyncapi-message.interface.js +0 -3
- package/dist/src/interface/asyncapi-message.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-headers.interface.d.ts +0 -6
- package/dist/src/interface/asyncapi-operation-headers.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-headers.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-options-raw.interface.d.ts +0 -21
- package/dist/src/interface/asyncapi-operation-options-raw.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-options-raw.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-options.interface.d.ts +0 -8
- package/dist/src/interface/asyncapi-operation-options.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-options.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-payload.interface.d.ts +0 -2
- package/dist/src/interface/asyncapi-operation-payload.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-payload.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-server.interface.d.ts +0 -10
- package/dist/src/interface/asyncapi-server.interface.js +0 -3
- package/dist/src/interface/asyncapi-server.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-template-options.interface.d.ts +0 -7
- package/dist/src/interface/asyncapi-template-options.interface.js +0 -3
- package/dist/src/interface/asyncapi-template-options.interface.js.map +0 -1
- package/dist/src/interface/denormalized-doc-resolvers.interface.d.ts +0 -6
- package/dist/src/interface/denormalized-doc-resolvers.interface.js +0 -3
- package/dist/src/interface/denormalized-doc-resolvers.interface.js.map +0 -1
- package/dist/src/interface/denormalized-doc.interface.d.ts +0 -10
- package/dist/src/interface/denormalized-doc.interface.js +0 -3
- package/dist/src/interface/denormalized-doc.interface.js.map +0 -1
- package/dist/src/interface/generator-options.interface.d.ts +0 -22
- package/dist/src/interface/generator-options.interface.js +0 -3
- package/dist/src/interface/generator-options.interface.js.map +0 -1
- package/dist/src/interface/index.d.ts +0 -11
- package/dist/src/interface/index.js +0 -28
- package/dist/src/interface/index.js.map +0 -1
- package/dist/src/services/asyncapi.explorer.d.ts +0 -12
- package/dist/src/services/asyncapi.explorer.js +0 -69
- package/dist/src/services/asyncapi.explorer.js.map +0 -1
- package/dist/src/services/asyncapi.generator.d.ts +0 -6
- package/dist/src/services/asyncapi.generator.js +0 -68
- package/dist/src/services/asyncapi.generator.js.map +0 -1
- package/dist/src/services/asyncapi.scanner.d.ts +0 -14
- package/dist/src/services/asyncapi.scanner.js +0 -71
- package/dist/src/services/asyncapi.scanner.js.map +0 -1
- package/dist/src/services/asyncapi.transformer.d.ts +0 -4
- package/dist/src/services/asyncapi.transformer.js +0 -33
- package/dist/src/services/asyncapi.transformer.js.map +0 -1
- package/dist/src/services/index.d.ts +0 -4
- package/dist/src/services/index.js +0 -21
- package/dist/src/services/index.js.map +0 -1
- package/dist/src/services/operation-object.factory.d.ts +0 -9
- package/dist/src/services/operation-object.factory.js +0 -37
- package/dist/src/services/operation-object.factory.js.map +0 -1
- package/dist/test/configs/jest-base.config.d.ts +0 -3
- package/dist/test/configs/jest-base.config.js +0 -20
- package/dist/test/configs/jest-base.config.js.map +0 -1
- package/dist/test/configs/jest-e2e.config.d.ts +0 -3
- package/dist/test/configs/jest-e2e.config.js +0 -16
- package/dist/test/configs/jest-e2e.config.js.map +0 -1
- package/dist/test/express.e2e-spec.d.ts +0 -1
- package/dist/test/express.e2e-spec.js +0 -89
- package/dist/test/express.e2e-spec.js.map +0 -1
- package/dist/test/fastify.e2e-spec.d.ts +0 -1
- package/dist/test/fastify.e2e-spec.js +0 -57
- package/dist/test/fastify.e2e-spec.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/eslint.config.mjs +0 -21
- package/misc/references/ref.html +0 -303
- package/misc/references/ref.json +0 -1
- package/misc/references/ref.yaml +0 -292
- package/misc/take-snaphots.sh +0 -8
- package/sample/app.module.ts +0 -7
- package/sample/common.ts +0 -49
- package/sample/constants.ts +0 -12
- package/sample/felines/class/cat.class.ts +0 -9
- package/sample/felines/class/feline.class.ts +0 -29
- package/sample/felines/class/index.ts +0 -5
- package/sample/felines/class/lion.class.ts +0 -5
- package/sample/felines/class/message.class.ts +0 -17
- package/sample/felines/class/tiger.class.ts +0 -5
- package/sample/felines/dto/create-feline.dto.ts +0 -13
- package/sample/felines/dto/index.ts +0 -2
- package/sample/felines/dto/journaling-data.dto.ts +0 -5
- package/sample/felines/felines.constants.ts +0 -1
- package/sample/felines/felines.controller.ts +0 -76
- package/sample/felines/felines.gateway.ts +0 -76
- package/sample/felines/felines.module.ts +0 -15
- package/sample/felines/felines.service.ts +0 -24
- package/sample/felines/rto/feline.rto.ts +0 -17
- package/sample/felines/rto/index.ts +0 -1
- package/sample/index.ts +0 -3
- package/sample/main.ts +0 -34
- package/src/asyncapi-document.builder.ts +0 -172
- package/src/asyncapi.constants.ts +0 -8
- package/src/asyncapi.module.ts +0 -65
- package/src/binding/asyncapi.amqp.interfaces.ts +0 -48
- package/src/binding/asyncapi.kafka.interfaces.ts +0 -35
- package/src/binding/index.ts +0 -2
- package/src/decorators/asyncapi-operation-for-meta-key.decorator.ts +0 -58
- package/src/decorators/asyncapi-operation.decorator.ts +0 -7
- package/src/decorators/asyncapi-pub.decorator.ts +0 -11
- package/src/decorators/asyncapi-service.decorator.ts +0 -9
- package/src/decorators/asyncapi-sub.decorator.ts +0 -11
- package/src/decorators/index.ts +0 -4
- package/src/explorers/asyncapi-class.explorer.ts +0 -26
- package/src/explorers/asyncapi-operation.explorer.ts +0 -40
- package/src/explorers/index.ts +0 -2
- package/src/index.ts +0 -4
- package/src/interface/asyncapi-common.interfaces.ts +0 -169
- package/src/interface/asyncapi-document-options.interface.ts +0 -3
- package/src/interface/asyncapi-message.interface.ts +0 -10
- package/src/interface/asyncapi-operation-headers.interface.ts +0 -6
- package/src/interface/asyncapi-operation-options-raw.interface.ts +0 -23
- package/src/interface/asyncapi-operation-options.interface.ts +0 -10
- package/src/interface/asyncapi-operation-payload.interface.ts +0 -3
- package/src/interface/asyncapi-server.interface.ts +0 -11
- package/src/interface/asyncapi-template-options.interface.ts +0 -20
- package/src/interface/denormalized-doc-resolvers.interface.ts +0 -6
- package/src/interface/denormalized-doc.interface.ts +0 -6
- package/src/interface/generator-options.interface.ts +0 -21
- package/src/interface/index.ts +0 -12
- package/src/services/asyncapi.explorer.ts +0 -112
- package/src/services/asyncapi.generator.ts +0 -45
- package/src/services/asyncapi.scanner.ts +0 -105
- package/src/services/asyncapi.transformer.ts +0 -33
- package/src/services/index.ts +0 -4
- package/src/services/operation-object.factory.ts +0 -55
- package/test/__mocks__/@asyncapi/generator.js +0 -41
- package/test/configs/jest-base.config.ts +0 -19
- package/test/configs/jest-e2e.config.js +0 -7
- package/test/configs/jest-e2e.config.ts +0 -19
- package/test/configs/jest-swagger-plugin.js +0 -16
- package/test/express.e2e-spec.ts +0 -64
- package/test/fastify.e2e-spec.ts +0 -65
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -8
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -18,5 +18,5 @@ __exportStar(require("./asyncapi.generator"), exports);
|
|
|
18
18
|
__exportStar(require("./operation-object.factory"), exports);
|
|
19
19
|
__exportStar(require("./asyncapi.explorer"), exports);
|
|
20
20
|
__exportStar(require("./asyncapi.scanner"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./swagger-schema.factory"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,6DAA2C;AAC3C,sDAAoC;AACpC,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,6DAA2C;AAC3C,sDAAoC;AACpC,qDAAmC;AACnC,2DAAyC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
|
2
1
|
import { AsyncApiOperationOptionsRaw, AsyncOperationObject } from '../interface';
|
|
3
2
|
export declare class OperationObjectFactory {
|
|
4
|
-
|
|
5
|
-
private
|
|
6
|
-
private readonly schemaObjectFactory;
|
|
7
|
-
create(operation: AsyncApiOperationOptionsRaw, produces: string[], schemas: Record<string, SchemaObject>): AsyncOperationObject;
|
|
8
|
-
private getDtoName;
|
|
3
|
+
create(operation: AsyncApiOperationOptionsRaw, produces: string[], models: Set<Function>): AsyncOperationObject;
|
|
4
|
+
private registerPayloadModel;
|
|
9
5
|
}
|
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OperationObjectFactory = void 0;
|
|
4
|
-
const
|
|
5
|
-
const schema_object_factory_1 = require("@nestjs/swagger/dist/services/schema-object-factory");
|
|
6
|
-
const swagger_types_mapper_1 = require("@nestjs/swagger/dist/services/swagger-types-mapper");
|
|
7
|
-
const utils_1 = require("@nestjs/swagger/dist/utils");
|
|
4
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
8
5
|
class OperationObjectFactory {
|
|
9
|
-
|
|
10
|
-
this.modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor();
|
|
11
|
-
this.swaggerTypesMapper = new swagger_types_mapper_1.SwaggerTypesMapper();
|
|
12
|
-
this.schemaObjectFactory = new schema_object_factory_1.SchemaObjectFactory(this.modelPropertiesAccessor, this.swaggerTypesMapper);
|
|
13
|
-
}
|
|
14
|
-
create(operation, produces, schemas) {
|
|
6
|
+
create(operation, produces, models) {
|
|
15
7
|
const { message } = operation;
|
|
16
8
|
const { oneOf } = message;
|
|
17
9
|
if (oneOf) {
|
|
18
10
|
return Object.assign(Object.assign({}, operation), { message: {
|
|
19
11
|
oneOf: oneOf.map((i) => (Object.assign(Object.assign({}, i), { payload: {
|
|
20
|
-
$ref:
|
|
12
|
+
$ref: this.registerPayloadModel(i, models),
|
|
21
13
|
} }))),
|
|
22
14
|
} });
|
|
23
15
|
}
|
|
24
16
|
return Object.assign(Object.assign({}, operation), { message: Object.assign(Object.assign({}, operation.message), { payload: {
|
|
25
|
-
$ref:
|
|
17
|
+
$ref: this.registerPayloadModel(message, models),
|
|
26
18
|
} }) });
|
|
27
19
|
}
|
|
28
|
-
|
|
20
|
+
registerPayloadModel(message, models) {
|
|
29
21
|
if (!message.payload || !message.payload.type) {
|
|
30
22
|
throw new Error('Async message payload or payload.type is undefined; ensure message.payload is provided.');
|
|
31
23
|
}
|
|
32
24
|
const messagePayloadType = message.payload.type;
|
|
33
|
-
|
|
25
|
+
models.add(messagePayloadType);
|
|
26
|
+
return (0, swagger_1.getSchemaPath)(messagePayloadType);
|
|
34
27
|
}
|
|
35
28
|
}
|
|
36
29
|
exports.OperationObjectFactory = OperationObjectFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-object.factory.js","sourceRoot":"","sources":["../../src/services/operation-object.factory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"operation-object.factory.js","sourceRoot":"","sources":["../../src/services/operation-object.factory.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAGhD,MAAa,sBAAsB;IACjC,MAAM,CACJ,SAAsC,EACtC,QAAkB,EAClB,MAAqB;QAErB,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;QAC9B,MAAM,EAAE,KAAK,EAAE,GAAG,OAA2B,CAAC;QAE9C,IAAI,KAAK,EAAE,CAAC;YACV,uCACK,SAAS,KACZ,OAAO,EAAE;oBACP,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCACnB,CAAC,KACJ,OAAO,EAAE;4BACP,IAAI,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAuB,EAAE,MAAM,CAAC;yBACjE,IACD,CAAC;iBACJ,IACD;QACJ,CAAC;QAED,uCACK,SAAS,KACZ,OAAO,kCACF,SAAS,CAAC,OAAO,KACpB,OAAO,EAAE;oBACP,IAAI,EAAE,IAAI,CAAC,oBAAoB,CAAC,OAA6B,EAAE,MAAM,CAAC;iBACvE,OAEH;IACJ,CAAC;IAKO,oBAAoB,CAAC,OAA2B,EAAE,MAAqB;QAC7E,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC,CAAC;QAC7G,CAAC;QACD,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,IAAgB,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC/B,OAAO,IAAA,uBAAa,EAAC,kBAAkB,CAAC,CAAC;IAC3C,CAAC;CACF;AA7CD,wDA6CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { INestApplicationContext } from '@nestjs/common';
|
|
2
|
+
import { SchemaObject, SwaggerDocumentOptions } from '@nestjs/swagger';
|
|
3
|
+
export declare class SwaggerSchemaFactory {
|
|
4
|
+
generate(app: INestApplicationContext, models: Function[], options?: SwaggerDocumentOptions): Record<string, SchemaObject>;
|
|
5
|
+
private toSwaggerHost;
|
|
6
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwaggerSchemaFactory = void 0;
|
|
4
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
5
|
+
class NoRoutesSentinelModule {
|
|
6
|
+
}
|
|
7
|
+
class SwaggerSchemaFactory {
|
|
8
|
+
generate(app, models, options = {}) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
if (models.length === 0) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
const document = swagger_1.SwaggerModule.createDocument(this.toSwaggerHost(app), new swagger_1.DocumentBuilder().build(), Object.assign(Object.assign({}, options), { include: [NoRoutesSentinelModule], extraModels: models, deepScanRoutes: false }));
|
|
14
|
+
return ((_b = (_a = document.components) === null || _a === void 0 ? void 0 : _a.schemas) !== null && _b !== void 0 ? _b : {});
|
|
15
|
+
}
|
|
16
|
+
toSwaggerHost(app) {
|
|
17
|
+
if (typeof app.getHttpAdapter === 'function') {
|
|
18
|
+
return app;
|
|
19
|
+
}
|
|
20
|
+
const stubAdapter = { getType: () => 'none' };
|
|
21
|
+
return new Proxy(app, {
|
|
22
|
+
get: (target, prop) => prop === 'getHttpAdapter' ? () => stubAdapter : Reflect.get(target, prop, target),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.SwaggerSchemaFactory = SwaggerSchemaFactory;
|
|
27
|
+
//# sourceMappingURL=swagger-schema.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swagger-schema.factory.js","sourceRoot":"","sources":["../../src/services/swagger-schema.factory.ts"],"names":[],"mappings":";;;AACA,6CAAuG;AAMvG,MAAM,sBAAsB;CAAG;AAM/B,MAAa,oBAAoB;IACxB,QAAQ,CACb,GAA4B,EAC5B,MAAkB,EAClB,UAAkC,EAAE;;QAEpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,yBAAe,EAAE,CAAC,KAAK,EAAE,kCAC/F,OAAO,KACV,OAAO,EAAE,CAAC,sBAAsB,CAAC,EACjC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,KAAK,IACrB,CAAC;QAEH,OAAO,CAAC,MAAA,MAAA,QAAQ,CAAC,UAAU,0CAAE,OAAO,mCAAI,EAAE,CAAiC,CAAC;IAC9E,CAAC;IAMO,aAAa,CAAC,GAA4B;QAChD,IAAI,OAAQ,GAAiC,CAAC,cAAc,KAAK,UAAU,EAAE,CAAC;YAC5E,OAAO,GAAuB,CAAC;QACjC,CAAC;QAED,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,GAAW,EAAE,CAAC,MAAM,EAAE,CAAC;QACtD,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE;YACpB,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAW,EAAE,CAC7B,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,GAAuB,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;SACxG,CAAqB,CAAC;IACzB,CAAC;CACF;AAnCD,oDAmCC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMethodDecorator = createMethodDecorator;
|
|
4
|
+
exports.createMixedDecorator = createMixedDecorator;
|
|
5
|
+
function createMethodDecorator(metakey, metadata) {
|
|
6
|
+
return (_target, _key, descriptor) => {
|
|
7
|
+
if (typeof metadata === 'object') {
|
|
8
|
+
const prevValue = Reflect.getMetadata(metakey, descriptor.value);
|
|
9
|
+
Reflect.defineMetadata(metakey, Object.assign(Object.assign({}, prevValue), metadata), descriptor.value);
|
|
10
|
+
return descriptor;
|
|
11
|
+
}
|
|
12
|
+
Reflect.defineMetadata(metakey, metadata, descriptor.value);
|
|
13
|
+
return descriptor;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function createMixedDecorator(metakey, metadata) {
|
|
17
|
+
return ((target, _key, descriptor) => {
|
|
18
|
+
const metadataTarget = descriptor ? descriptor.value : target;
|
|
19
|
+
const merged = Array.isArray(metadata)
|
|
20
|
+
? [...(Reflect.getMetadata(metakey, metadataTarget) || []), ...metadata]
|
|
21
|
+
: Object.assign(Object.assign({}, (Reflect.getMetadata(metakey, metadataTarget) || {})), metadata);
|
|
22
|
+
Reflect.defineMetadata(metakey, merged, metadataTarget);
|
|
23
|
+
return descriptor !== null && descriptor !== void 0 ? descriptor : target;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=decorator.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator.utils.js","sourceRoot":"","sources":["../../src/utils/decorator.utils.ts"],"names":[],"mappings":";;AAKA,sDAUC;AAED,oDAUC;AAtBD,SAAgB,qBAAqB,CAAc,OAAe,EAAE,QAAW;IAC7E,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,UAA8B,EAAE,EAAE;QACvD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;YACjE,OAAO,CAAC,cAAc,CAAC,OAAO,kCAAO,SAAS,GAAK,QAAQ,GAAI,UAAU,CAAC,KAAK,CAAC,CAAC;YACjF,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC5D,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAAc,OAAe,EAAE,QAAW;IAC5E,OAAO,CAAC,CAAC,MAAc,EAAE,IAAsB,EAAE,UAA+B,EAAE,EAAE;QAClF,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YACpC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC;YACxE,CAAC,iCAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,GAAM,QAAmB,CAAE,CAAC;QAEzF,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;QACxD,OAAO,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,MAAM,CAAC;IAC9B,CAAC,CAAqC,CAAC;AACzC,CAAC"}
|
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./decorator.utils"), exports);
|
|
18
|
+
__exportStar(require("./path.utils"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,+CAA6B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripLastSlash = exports.validatePath = void 0;
|
|
4
|
+
const validatePath = (inputPath) => (inputPath.charAt(0) !== '/' ? `/${inputPath}` : inputPath);
|
|
5
|
+
exports.validatePath = validatePath;
|
|
6
|
+
const stripLastSlash = (path) => path && path[path.length - 1] === '/' ? path.slice(0, path.length - 1) : path;
|
|
7
|
+
exports.stripLastSlash = stripLastSlash;
|
|
8
|
+
//# sourceMappingURL=path.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.utils.js","sourceRoot":"","sources":["../../src/utils/path.utils.ts"],"names":[],"mappings":";;;AAGO,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAU,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAA1G,QAAA,YAAY,gBAA8F;AAKhH,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CACrD,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AADnE,QAAA,cAAc,kBACqD"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@achinet/nestjs-async",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/jelcaf/achinet.git",
|
|
10
|
+
"directory": "packages/nestjs-asyncapi"
|
|
11
|
+
},
|
|
7
12
|
"main": "dist/index.js",
|
|
8
13
|
"types": "dist/index.d.ts",
|
|
9
14
|
"scripts": {
|
|
10
|
-
"build": "tsc",
|
|
15
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
11
16
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
12
17
|
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
13
18
|
"clean": "rimraf dist",
|
|
14
19
|
"test": "jest --passWithNoTests",
|
|
15
|
-
"test:e2e": "jest --runInBand --config test/configs/jest-e2e.config.js"
|
|
20
|
+
"test:e2e": "jest --runInBand --config test/configs/jest-e2e.config.js",
|
|
21
|
+
"start:sample": "nest start",
|
|
22
|
+
"start:sample:watch": "nest start --watch",
|
|
23
|
+
"prepublishOnly": "yarn build"
|
|
16
24
|
},
|
|
17
25
|
"jest": {
|
|
18
26
|
"moduleFileExtensions": [
|
|
@@ -42,9 +50,6 @@
|
|
|
42
50
|
}
|
|
43
51
|
]
|
|
44
52
|
},
|
|
45
|
-
"moduleNameMapper": {
|
|
46
|
-
"^@asyncapi/generator$": "<rootDir>/test/__mocks__/@asyncapi/generator.js"
|
|
47
|
-
},
|
|
48
53
|
"collectCoverageFrom": [
|
|
49
54
|
"**/*.(t|j)s"
|
|
50
55
|
],
|
|
@@ -52,50 +57,65 @@
|
|
|
52
57
|
"testEnvironment": "node"
|
|
53
58
|
},
|
|
54
59
|
"devDependencies": {
|
|
55
|
-
"@nestjs/cli": "11.0.
|
|
56
|
-
"@nestjs/
|
|
57
|
-
"@nestjs/
|
|
58
|
-
"@nestjs/
|
|
59
|
-
"@nestjs/platform-
|
|
60
|
-
"@nestjs/
|
|
61
|
-
"@nestjs/
|
|
60
|
+
"@nestjs/cli": "11.0.24",
|
|
61
|
+
"@nestjs/common": "11.2.8",
|
|
62
|
+
"@nestjs/core": "11.2.8",
|
|
63
|
+
"@nestjs/microservices": "11.2.8",
|
|
64
|
+
"@nestjs/platform-express": "11.2.8",
|
|
65
|
+
"@nestjs/platform-fastify": "11.2.8",
|
|
66
|
+
"@nestjs/platform-socket.io": "11.2.8",
|
|
67
|
+
"@nestjs/schematics": "11.1.0",
|
|
68
|
+
"@nestjs/swagger": "11.4.8",
|
|
69
|
+
"@nestjs/testing": "11.2.8",
|
|
70
|
+
"@nestjs/websockets": "11.2.8",
|
|
62
71
|
"@types/express": "5.0.6",
|
|
63
72
|
"@types/jest": "30.0.0",
|
|
64
73
|
"@types/js-yaml": "4.0.9",
|
|
65
|
-
"@types/lodash": "^4.17.
|
|
66
|
-
"@types/node": "25.
|
|
74
|
+
"@types/lodash": "^4.17.27",
|
|
75
|
+
"@types/node": "25.9.9",
|
|
67
76
|
"@types/supertest": "6.0.3",
|
|
68
77
|
"@types/url-join": "5.0.0",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
70
|
-
"@typescript-eslint/parser": "8.
|
|
71
|
-
"eslint": "10.
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "8.72.1",
|
|
79
|
+
"@typescript-eslint/parser": "8.72.1",
|
|
80
|
+
"eslint": "10.14.0",
|
|
72
81
|
"eslint-config-prettier": "10.1.8",
|
|
73
82
|
"eslint-plugin-import": "2.32.0",
|
|
74
|
-
"eslint-plugin-prettier": "5.5.
|
|
83
|
+
"eslint-plugin-prettier": "5.5.7",
|
|
75
84
|
"husky": "9.1.7",
|
|
76
|
-
"jest": "30.2
|
|
77
|
-
"lint-staged": "16.
|
|
78
|
-
"prettier": "3.
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"socket.io
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"ts-
|
|
85
|
+
"jest": "30.5.2",
|
|
86
|
+
"lint-staged": "16.4.0",
|
|
87
|
+
"prettier": "3.9.10",
|
|
88
|
+
"reflect-metadata": "0.2.2",
|
|
89
|
+
"rimraf": "^6.1.4",
|
|
90
|
+
"socket.io": "4.8.4",
|
|
91
|
+
"socket.io-client": "4.8.4",
|
|
92
|
+
"supertest": "7.3.2",
|
|
93
|
+
"ts-jest": "^29.4.15",
|
|
94
|
+
"ts-loader": "9.6.2",
|
|
85
95
|
"ts-node": "^10.9.2",
|
|
86
96
|
"tsconfig-paths": "4.2.0",
|
|
87
97
|
"typescript": "5.9.3"
|
|
88
98
|
},
|
|
89
99
|
"dependencies": {
|
|
90
|
-
"@asyncapi/
|
|
91
|
-
"@
|
|
92
|
-
"
|
|
93
|
-
"
|
|
100
|
+
"@asyncapi/react-component": "^3.2.3",
|
|
101
|
+
"@swc/core": "1.16.22",
|
|
102
|
+
"js-yaml": "5.4.1",
|
|
103
|
+
"lodash": "^4.18.1"
|
|
104
|
+
},
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"@nestjs/common": "^11.1.14",
|
|
107
|
+
"@nestjs/core": "^11.1.14",
|
|
94
108
|
"@nestjs/swagger": "^11.2.6",
|
|
95
|
-
"@nestjs/websockets": "^11.1.
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
109
|
+
"@nestjs/websockets": "^11.1.14",
|
|
110
|
+
"reflect-metadata": "^0.1.12 || ^0.2.0"
|
|
111
|
+
},
|
|
112
|
+
"files": [
|
|
113
|
+
"dist",
|
|
114
|
+
"!dist/**/*.tsbuildinfo"
|
|
115
|
+
],
|
|
116
|
+
"peerDependenciesMeta": {
|
|
117
|
+
"@nestjs/websockets": {
|
|
118
|
+
"optional": true
|
|
119
|
+
}
|
|
100
120
|
}
|
|
101
121
|
}
|
package/.prettierrc
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# @achinet/nestjs-async
|
|
2
|
-
|
|
3
|
-
## 0.1.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- b32903e: Upgrade dependencies
|
|
8
|
-
- 436f491: Upgrade dependencies
|
|
9
|
-
|
|
10
|
-
## 0.1.0
|
|
11
|
-
|
|
12
|
-
### Minor Changes
|
|
13
|
-
|
|
14
|
-
- ef21291: Upgrade `@asyncapi` dependencies and adjust code
|
|
15
|
-
|
|
16
|
-
## 0.0.1
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- 7ca0b6b: First version of the package
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AsyncApiDocument } from './asyncapi-common.interfaces';
|
|
2
|
-
import { AsyncApiTemplateOptions } from './asyncapi-template-options.interface';
|
|
3
|
-
export interface GeneratorOptions {
|
|
4
|
-
templateName: string;
|
|
5
|
-
targetDir: string;
|
|
6
|
-
entrypoint?: string;
|
|
7
|
-
noOverwriteGlobs: string[];
|
|
8
|
-
disabledHooks: {
|
|
9
|
-
[key: string]: string | boolean | string[];
|
|
10
|
-
};
|
|
11
|
-
output: 'string' | 'fs';
|
|
12
|
-
forceWrite: boolean;
|
|
13
|
-
debug: boolean;
|
|
14
|
-
install: boolean;
|
|
15
|
-
templateConfig: Record<string, unknown>;
|
|
16
|
-
hooks: Record<string, unknown>;
|
|
17
|
-
templateParams: AsyncApiTemplateOptions;
|
|
18
|
-
generate: (document: AsyncApiDocument) => Promise<void>;
|
|
19
|
-
generateFromURL: (url: string) => Promise<void>;
|
|
20
|
-
generateFromFile: (path: string) => Promise<void>;
|
|
21
|
-
generateFromString: (yaml: string, args?: unknown) => Promise<string>;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator-options.interface.js","sourceRoot":"","sources":["../../src/interface/generator-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AppModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const felines_module_1 = require("./felines/felines.module");
|
|
12
|
-
let AppModule = class AppModule {
|
|
13
|
-
};
|
|
14
|
-
exports.AppModule = AppModule;
|
|
15
|
-
exports.AppModule = AppModule = __decorate([
|
|
16
|
-
(0, common_1.Module)({
|
|
17
|
-
imports: [felines_module_1.FelinesModule],
|
|
18
|
-
})
|
|
19
|
-
], AppModule);
|
|
20
|
-
//# sourceMappingURL=app.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../sample/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6DAAyD;AAKlD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAHrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,SAAS,CAAG"}
|
package/dist/sample/common.d.ts
DELETED
package/dist/sample/common.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeAsyncapiDocument = makeAsyncapiDocument;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const class_1 = require("./felines/class");
|
|
6
|
-
const felines_module_1 = require("./felines/felines.module");
|
|
7
|
-
const src_1 = require("../src");
|
|
8
|
-
async function makeAsyncapiDocument(app) {
|
|
9
|
-
const asyncApiServer = {
|
|
10
|
-
url: `ws://${constants_1.HOST}:${constants_1.PORT}`,
|
|
11
|
-
protocol: 'socket.io',
|
|
12
|
-
protocolVersion: '4',
|
|
13
|
-
description: 'Allows you to connect using the websocket protocol to our Socket.io server.',
|
|
14
|
-
security: [{ 'user-password': [] }],
|
|
15
|
-
variables: {
|
|
16
|
-
port: {
|
|
17
|
-
description: 'Secure connection (TLS) is available through port 443.',
|
|
18
|
-
default: '443',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
bindings: {},
|
|
22
|
-
};
|
|
23
|
-
const servers = Object.keys(constants_1.SERVER).map((i) => ({
|
|
24
|
-
name: constants_1.SERVER[i],
|
|
25
|
-
server: asyncApiServer,
|
|
26
|
-
}));
|
|
27
|
-
const asyncApiOptions = new src_1.AsyncApiDocumentBuilder()
|
|
28
|
-
.setTitle('Feline')
|
|
29
|
-
.setDescription('Feline server description here')
|
|
30
|
-
.setVersion('1.0')
|
|
31
|
-
.setDefaultContentType('application/json')
|
|
32
|
-
.addSecurity('user-password', { type: 'userPassword' })
|
|
33
|
-
.addServers(servers)
|
|
34
|
-
.build();
|
|
35
|
-
return src_1.AsyncApiModule.createDocument(app, asyncApiOptions, {
|
|
36
|
-
include: [felines_module_1.FelinesModule],
|
|
37
|
-
extraModels: [class_1.Cat, class_1.Lion, class_1.Tiger, class_1.Feline],
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../sample/common.ts"],"names":[],"mappings":";;AAWA,oDAqCC;AA/CD,2CAAiD;AACjD,2CAA2D;AAC3D,6DAAyD;AACzD,gCAKgB;AAET,KAAK,UAAU,oBAAoB,CACxC,GAA4B;IAE5B,MAAM,cAAc,GAAsB;QACxC,GAAG,EAAE,QAAQ,gBAAI,IAAI,gBAAI,EAAE;QAC3B,QAAQ,EAAE,WAAW;QACrB,eAAe,EAAE,GAAG;QACpB,WAAW,EACT,6EAA6E;QAC/E,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC;QACnC,SAAS,EAAE;YACT,IAAI,EAAE;gBACJ,WAAW,EAAE,wDAAwD;gBACrE,OAAO,EAAE,KAAK;aACf;SACF;QACD,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,EAAE,kBAAM,CAAC,CAAC,CAAC;QACf,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC,CAAC;IAEJ,MAAM,eAAe,GAAG,IAAI,6BAAuB,EAAE;SAClD,QAAQ,CAAC,QAAQ,CAAC;SAClB,cAAc,CAAC,gCAAgC,CAAC;SAChD,UAAU,CAAC,KAAK,CAAC;SACjB,qBAAqB,CAAC,kBAAkB,CAAC;SACzC,WAAW,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;SACtD,UAAU,CAAC,OAAO,CAAC;SACnB,KAAK,EAAE,CAAC;IAEX,OAAO,oBAAc,CAAC,cAAc,CAAC,GAAG,EAAE,eAAe,EAAE;QACzD,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,WAAG,EAAE,YAAI,EAAE,aAAK,EAAE,cAAM,CAAC;KACxC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const DOC_RELATIVE_PATH = "/async-api";
|
|
2
|
-
export declare const BOOTSTRAP = "Bootstrap";
|
|
3
|
-
export declare const PORT = 4001;
|
|
4
|
-
export declare const HOST = "0.0.0.0";
|
|
5
|
-
export declare const SERVER: {
|
|
6
|
-
europe: string;
|
|
7
|
-
asia: string;
|
|
8
|
-
northAmerica: string;
|
|
9
|
-
southAmerica: string;
|
|
10
|
-
africa: string;
|
|
11
|
-
australia: string;
|
|
12
|
-
};
|
package/dist/sample/constants.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SERVER = exports.HOST = exports.PORT = exports.BOOTSTRAP = exports.DOC_RELATIVE_PATH = void 0;
|
|
4
|
-
exports.DOC_RELATIVE_PATH = '/async-api';
|
|
5
|
-
exports.BOOTSTRAP = 'Bootstrap';
|
|
6
|
-
exports.PORT = 4001;
|
|
7
|
-
exports.HOST = '0.0.0.0';
|
|
8
|
-
exports.SERVER = {
|
|
9
|
-
europe: 'europe',
|
|
10
|
-
asia: 'asia',
|
|
11
|
-
northAmerica: 'north-america',
|
|
12
|
-
southAmerica: 'south-america',
|
|
13
|
-
africa: 'africa',
|
|
14
|
-
australia: 'australia',
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../sample/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,YAAY,CAAC;AACjC,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,IAAI,GAAG,IAAI,CAAC;AACZ,QAAA,IAAI,GAAG,SAAS,CAAC;AACjB,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Cat = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
const feline_class_1 = require("./feline.class");
|
|
15
|
-
class Cat extends feline_class_1.Feline {
|
|
16
|
-
}
|
|
17
|
-
exports.Cat = Cat;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, swagger_1.ApiProperty)({
|
|
20
|
-
example: 'Maine Coon',
|
|
21
|
-
}),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], Cat.prototype, "breed", void 0);
|
|
24
|
-
//# sourceMappingURL=cat.class.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat.class.js","sourceRoot":"","sources":["../../../../sample/felines/class/cat.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,iDAAwC;AAExC,MAAa,GAAI,SAAQ,qBAAM;CAK9B;AALD,kBAKC;AADC;IAHC,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,YAAY;KACtB,CAAC;;kCACY"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare enum PawsEnum {
|
|
2
|
-
left = "left",
|
|
3
|
-
right = "right"
|
|
4
|
-
}
|
|
5
|
-
declare enum GendersEnum {
|
|
6
|
-
male = "male",
|
|
7
|
-
female = "female"
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class Feline {
|
|
10
|
-
id: number;
|
|
11
|
-
name: string;
|
|
12
|
-
age: number;
|
|
13
|
-
gender: GendersEnum;
|
|
14
|
-
dominantPaw: PawsEnum;
|
|
15
|
-
tags: string[];
|
|
16
|
-
birthDatetime: Date;
|
|
17
|
-
constructor(initializer: Record<string, unknown>);
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Feline = void 0;
|
|
4
|
-
var PawsEnum;
|
|
5
|
-
(function (PawsEnum) {
|
|
6
|
-
PawsEnum["left"] = "left";
|
|
7
|
-
PawsEnum["right"] = "right";
|
|
8
|
-
})(PawsEnum || (PawsEnum = {}));
|
|
9
|
-
var GendersEnum;
|
|
10
|
-
(function (GendersEnum) {
|
|
11
|
-
GendersEnum["male"] = "male";
|
|
12
|
-
GendersEnum["female"] = "female";
|
|
13
|
-
})(GendersEnum || (GendersEnum = {}));
|
|
14
|
-
class Feline {
|
|
15
|
-
constructor(initializer) {
|
|
16
|
-
Object.assign(this, initializer);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.Feline = Feline;
|
|
20
|
-
//# sourceMappingURL=feline.class.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feline.class.js","sourceRoot":"","sources":["../../../../sample/felines/class/feline.class.ts"],"names":[],"mappings":";;;AAAA,IAAK,QAGJ;AAHD,WAAK,QAAQ;IACX,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EAHI,QAAQ,KAAR,QAAQ,QAGZ;AAED,IAAK,WAGJ;AAHD,WAAK,WAAW;IACd,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAHI,WAAW,KAAX,WAAW,QAGf;AAED,MAAsB,MAAM;IAe1B,YAAY,WAAoC;QAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC;CACF;AAlBD,wBAkBC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./feline.class"), exports);
|
|
18
|
-
__exportStar(require("./cat.class"), exports);
|
|
19
|
-
__exportStar(require("./lion.class"), exports);
|
|
20
|
-
__exportStar(require("./tiger.class"), exports);
|
|
21
|
-
__exportStar(require("./message.class"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|