@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/src/index.d.ts
DELETED
package/dist/src/index.js
DELETED
|
@@ -1,21 +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("./asyncapi-document.builder"), exports);
|
|
18
|
-
__exportStar(require("./interface"), exports);
|
|
19
|
-
__exportStar(require("./asyncapi.module"), exports);
|
|
20
|
-
__exportStar(require("./decorators"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,8CAA4B;AAC5B,oDAAkC;AAClC,+CAA6B"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { InfoObject, ReferenceObject, SchemaObject, ServerVariableObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
|
2
|
-
import { AmqpChannelBinding, AmqpMessageBinding, AmqpOperationBinding, AmqpServerBinding, KafkaChannelBinding, KafkaMessageBinding, KafkaOperationBinding, KafkaServerBinding } from '../binding';
|
|
3
|
-
import { AsyncOperationPayload } from './asyncapi-operation-payload.interface';
|
|
4
|
-
import { AsyncServerObject } from './asyncapi-server.interface';
|
|
5
|
-
export interface AsyncApiDocument {
|
|
6
|
-
asyncapi: string;
|
|
7
|
-
id?: string;
|
|
8
|
-
info: InfoObject;
|
|
9
|
-
servers?: Record<string, AsyncServerObject>;
|
|
10
|
-
channels: AsyncChannelsObject;
|
|
11
|
-
components?: AsyncComponentsObject;
|
|
12
|
-
tags?: AsyncTagObject[];
|
|
13
|
-
externalDocs?: ExternalDocumentationObject;
|
|
14
|
-
defaultContentType?: string;
|
|
15
|
-
}
|
|
16
|
-
export type AsyncChannelsObject = Record<string, AsyncChannelObject>;
|
|
17
|
-
export interface AsyncChannelObject {
|
|
18
|
-
description?: string;
|
|
19
|
-
subscribe?: AsyncOperationObject;
|
|
20
|
-
publish?: AsyncOperationObject;
|
|
21
|
-
parameters?: Record<string, ParameterObject>;
|
|
22
|
-
bindings?: Record<string, KafkaChannelBinding | AmqpChannelBinding>;
|
|
23
|
-
}
|
|
24
|
-
export interface AsyncServerVariableObject extends ServerVariableObject {
|
|
25
|
-
examples?: string[];
|
|
26
|
-
}
|
|
27
|
-
export type SecurityObject = Record<string, string[]>;
|
|
28
|
-
export interface AsyncComponentsObject {
|
|
29
|
-
schemas?: Record<string, SchemaObject>;
|
|
30
|
-
messages?: Record<string, AsyncMessageObject>;
|
|
31
|
-
securitySchemes?: Record<string, AsyncSecuritySchemeObject>;
|
|
32
|
-
parameters?: Record<string, ParameterObject>;
|
|
33
|
-
correlationIds?: Record<string, AsyncCorrelationObject>;
|
|
34
|
-
operationTraits?: Record<string, AsyncOperationTraitObject>;
|
|
35
|
-
messageTraits?: Record<string, AsyncMessageTraitObject>;
|
|
36
|
-
serverBindings?: Record<string, KafkaServerBinding | AmqpServerBinding>;
|
|
37
|
-
channelBindings?: Record<string, KafkaChannelBinding | AmqpChannelBinding>;
|
|
38
|
-
operationBindings?: Record<string, KafkaOperationBinding | AmqpOperationBinding>;
|
|
39
|
-
messageBindings?: Record<string, KafkaMessageBinding | AmqpMessageBinding>;
|
|
40
|
-
}
|
|
41
|
-
export interface AsyncMessageObject extends AsyncMessageTraitObject {
|
|
42
|
-
payload?: {
|
|
43
|
-
type?: AsyncOperationPayload;
|
|
44
|
-
$ref?: AsyncOperationPayload;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export type MessageType = AsyncMessageObject | ReferenceObject;
|
|
48
|
-
export interface OneOfMessageType {
|
|
49
|
-
oneOf: MessageType[];
|
|
50
|
-
}
|
|
51
|
-
export type AsyncOperationMessage = OneOfMessageType | MessageType;
|
|
52
|
-
export interface AsyncOperationObject {
|
|
53
|
-
channel: string;
|
|
54
|
-
operationId?: string;
|
|
55
|
-
summary?: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
tags?: AsyncTagObject[];
|
|
58
|
-
externalDocs?: ExternalDocumentationObject;
|
|
59
|
-
bindings?: Record<string, KafkaOperationBinding | AmqpOperationBinding>;
|
|
60
|
-
traits?: Record<string, AsyncOperationTraitObject>;
|
|
61
|
-
message?: AsyncOperationMessage;
|
|
62
|
-
}
|
|
63
|
-
export interface AsyncOperationTraitObject {
|
|
64
|
-
operationId?: string;
|
|
65
|
-
summary?: string;
|
|
66
|
-
description?: string;
|
|
67
|
-
tags?: AsyncTagObject[];
|
|
68
|
-
externalDocs?: ExternalDocumentationObject;
|
|
69
|
-
bindings?: Record<string, KafkaOperationBinding | AmqpOperationBinding>;
|
|
70
|
-
}
|
|
71
|
-
export interface AsyncMessageTraitObject {
|
|
72
|
-
headers?: SchemaObject;
|
|
73
|
-
correlationId?: AsyncCorrelationObject;
|
|
74
|
-
schemaFormat?: string;
|
|
75
|
-
contentType?: string;
|
|
76
|
-
name?: string;
|
|
77
|
-
title?: string;
|
|
78
|
-
summary?: string;
|
|
79
|
-
description?: string;
|
|
80
|
-
tags?: AsyncTagObject[];
|
|
81
|
-
externalDocs?: ExternalDocumentationObject;
|
|
82
|
-
bindings?: Record<string, KafkaMessageBinding | AmqpMessageBinding>;
|
|
83
|
-
}
|
|
84
|
-
export interface AsyncCorrelationObject {
|
|
85
|
-
description?: string;
|
|
86
|
-
location: string;
|
|
87
|
-
}
|
|
88
|
-
export interface AsyncTagObject {
|
|
89
|
-
name: string;
|
|
90
|
-
description?: string;
|
|
91
|
-
externalDocs?: ExternalDocumentationObject;
|
|
92
|
-
}
|
|
93
|
-
export interface AsyncSecuritySchemeObject {
|
|
94
|
-
type: SecuritySchemeType;
|
|
95
|
-
description?: string;
|
|
96
|
-
name?: string;
|
|
97
|
-
in?: string;
|
|
98
|
-
scheme?: string;
|
|
99
|
-
bearerFormat?: string;
|
|
100
|
-
flows?: OAuthFlowsObject;
|
|
101
|
-
openIdConnectUrl?: string;
|
|
102
|
-
}
|
|
103
|
-
export declare type SecuritySchemeType = 'userPassword' | 'apiKey' | 'X509' | 'symmetricEncryption' | 'asymmetricEncryption' | 'http' | 'oauth2' | 'openIdConnect';
|
|
104
|
-
export interface OAuthFlowsObject {
|
|
105
|
-
implicit?: OAuthFlowObject;
|
|
106
|
-
password?: OAuthFlowObject;
|
|
107
|
-
clientCredentials?: OAuthFlowObject;
|
|
108
|
-
authorizationCode?: OAuthFlowObject;
|
|
109
|
-
}
|
|
110
|
-
export interface OAuthFlowObject {
|
|
111
|
-
authorizationUrl?: string;
|
|
112
|
-
tokenUrl?: string;
|
|
113
|
-
refreshUrl?: string;
|
|
114
|
-
scopes: ScopesObject;
|
|
115
|
-
}
|
|
116
|
-
export type ScopesObject = Record<string, unknown>;
|
|
117
|
-
export type ParameterObject = BaseParameterObject;
|
|
118
|
-
export interface BaseParameterObject {
|
|
119
|
-
description?: string;
|
|
120
|
-
schema?: SchemaObject | ReferenceObject;
|
|
121
|
-
location?: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ExternalDocumentationObject {
|
|
124
|
-
description?: string;
|
|
125
|
-
url: string;
|
|
126
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-common.interfaces.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-common.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-document-options.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-document-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AsyncApiOperationHeaders } from './asyncapi-operation-headers.interface';
|
|
2
|
-
import { AsyncOperationPayload } from './asyncapi-operation-payload.interface';
|
|
3
|
-
export interface OneAsyncApiMessage {
|
|
4
|
-
name?: string;
|
|
5
|
-
payload: AsyncOperationPayload;
|
|
6
|
-
headers?: AsyncApiOperationHeaders;
|
|
7
|
-
}
|
|
8
|
-
export type AsyncApiMessage = OneAsyncApiMessage | OneAsyncApiMessage[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-message.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-message.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-operation-headers.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-operation-headers.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AsyncOperationObject } from './asyncapi-common.interfaces';
|
|
2
|
-
import { AsyncOperationPayload } from './asyncapi-operation-payload.interface';
|
|
3
|
-
export interface RawAsyncApiMessage {
|
|
4
|
-
name?: string;
|
|
5
|
-
payload: {
|
|
6
|
-
type: AsyncOperationPayload;
|
|
7
|
-
};
|
|
8
|
-
headers?: {
|
|
9
|
-
type: 'object';
|
|
10
|
-
properties: {
|
|
11
|
-
[key: string]: {
|
|
12
|
-
description: string;
|
|
13
|
-
type: 'string';
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface AsyncApiOperationOptionsRaw extends AsyncOperationObject {
|
|
20
|
-
type: 'sub' | 'pub';
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-operation-options-raw.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-operation-options-raw.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AsyncOperationObject } from './asyncapi-common.interfaces';
|
|
2
|
-
import { AsyncApiMessage } from './asyncapi-message.interface';
|
|
3
|
-
export interface AsyncApiSpecificOperationOptions extends Omit<AsyncOperationObject, 'message'> {
|
|
4
|
-
message: AsyncApiMessage;
|
|
5
|
-
}
|
|
6
|
-
export interface AsyncApiOperationOptions extends AsyncApiSpecificOperationOptions {
|
|
7
|
-
type: 'pub' | 'sub';
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-operation-options.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-operation-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-operation-payload.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-operation-payload.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ServerObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
|
2
|
-
import { AmqpServerBinding, KafkaServerBinding } from '../binding';
|
|
3
|
-
import { AsyncServerVariableObject, SecurityObject } from './asyncapi-common.interfaces';
|
|
4
|
-
export interface AsyncServerObject extends Omit<ServerObject, 'variables'> {
|
|
5
|
-
variables?: Record<string, AsyncServerVariableObject>;
|
|
6
|
-
protocol: string;
|
|
7
|
-
protocolVersion?: string;
|
|
8
|
-
security?: SecurityObject[];
|
|
9
|
-
bindings?: Record<string, KafkaServerBinding | AmqpServerBinding>;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-server.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-server.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi-template-options.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-template-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"denormalized-doc-resolvers.interface.js","sourceRoot":"","sources":["../../../src/interface/denormalized-doc-resolvers.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AsyncApiDocument, AsyncChannelObject, AsyncOperationObject } from './asyncapi-common.interfaces';
|
|
2
|
-
export interface DenormalizedDoc extends Partial<AsyncApiDocument> {
|
|
3
|
-
root?: {
|
|
4
|
-
name: string;
|
|
5
|
-
} & AsyncChannelObject;
|
|
6
|
-
operations?: {
|
|
7
|
-
pub: AsyncOperationObject;
|
|
8
|
-
sub: AsyncOperationObject;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"denormalized-doc.interface.js","sourceRoot":"","sources":["../../../src/interface/denormalized-doc.interface.ts"],"names":[],"mappings":""}
|
|
@@ -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,11 +0,0 @@
|
|
|
1
|
-
export * from './asyncapi-common.interfaces';
|
|
2
|
-
export * from './asyncapi-template-options.interface';
|
|
3
|
-
export * from './asyncapi-operation-headers.interface';
|
|
4
|
-
export * from './asyncapi-operation-payload.interface';
|
|
5
|
-
export * from './asyncapi-operation-options.interface';
|
|
6
|
-
export * from './asyncapi-document-options.interface';
|
|
7
|
-
export * from './asyncapi-server.interface';
|
|
8
|
-
export * from './denormalized-doc.interface';
|
|
9
|
-
export * from './denormalized-doc-resolvers.interface';
|
|
10
|
-
export * from './generator-options.interface';
|
|
11
|
-
export * from './asyncapi-operation-options-raw.interface';
|
|
@@ -1,28 +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("./asyncapi-common.interfaces"), exports);
|
|
18
|
-
__exportStar(require("./asyncapi-template-options.interface"), exports);
|
|
19
|
-
__exportStar(require("./asyncapi-operation-headers.interface"), exports);
|
|
20
|
-
__exportStar(require("./asyncapi-operation-payload.interface"), exports);
|
|
21
|
-
__exportStar(require("./asyncapi-operation-options.interface"), exports);
|
|
22
|
-
__exportStar(require("./asyncapi-document-options.interface"), exports);
|
|
23
|
-
__exportStar(require("./asyncapi-server.interface"), exports);
|
|
24
|
-
__exportStar(require("./denormalized-doc.interface"), exports);
|
|
25
|
-
__exportStar(require("./denormalized-doc-resolvers.interface"), exports);
|
|
26
|
-
__exportStar(require("./generator-options.interface"), exports);
|
|
27
|
-
__exportStar(require("./asyncapi-operation-options-raw.interface"), exports);
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,wEAAsD;AACtD,yEAAuD;AACvD,yEAAuD;AACvD,yEAAuD;AACvD,wEAAsD;AACtD,8DAA4C;AAC5C,+DAA6C;AAC7C,yEAAuD;AACvD,gEAA8C;AAE9C,6EAA2D"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
|
|
2
|
-
import { SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
|
3
|
-
import { DenormalizedDoc } from '../interface';
|
|
4
|
-
export declare class AsyncApiExplorer {
|
|
5
|
-
private readonly metadataScanner;
|
|
6
|
-
private readonly schemas;
|
|
7
|
-
private readonly schemaRefsStack;
|
|
8
|
-
private operationIdFactory;
|
|
9
|
-
explorerAsyncapiServices(wrapper: InstanceWrapper, modulePath?: string, globalPrefix?: string, operationIdFactory?: (controllerKey: string, methodKey: string) => string): DenormalizedDoc[];
|
|
10
|
-
getSchemas(): Record<string, SchemaObject>;
|
|
11
|
-
private generateDenormalizedDocument;
|
|
12
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncApiExplorer = void 0;
|
|
4
|
-
const core_1 = require("@nestjs/core");
|
|
5
|
-
const lodash_1 = require("lodash");
|
|
6
|
-
const explorers_1 = require("../explorers");
|
|
7
|
-
class AsyncApiExplorer {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.metadataScanner = new core_1.MetadataScanner();
|
|
10
|
-
this.schemas = [];
|
|
11
|
-
this.schemaRefsStack = [];
|
|
12
|
-
this.operationIdFactory = (controllerKey, methodKey) => controllerKey ? `${controllerKey}_${methodKey}` : methodKey;
|
|
13
|
-
}
|
|
14
|
-
explorerAsyncapiServices(wrapper, modulePath, globalPrefix, operationIdFactory) {
|
|
15
|
-
if (operationIdFactory) {
|
|
16
|
-
this.operationIdFactory = operationIdFactory;
|
|
17
|
-
}
|
|
18
|
-
const { instance, metatype } = wrapper;
|
|
19
|
-
if (!instance ||
|
|
20
|
-
!metatype ||
|
|
21
|
-
!Reflect.getMetadataKeys(metatype).find((label) => explorers_1.asyncApiClassAnnotationLabels.includes(label))) {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
const prototype = Object.getPrototypeOf(instance);
|
|
25
|
-
const documentResolvers = {
|
|
26
|
-
root: [explorers_1.exploreAsyncapiClassMetadata, explorers_1.exploreControllerMetadata, explorers_1.exploreGatewayMetadata],
|
|
27
|
-
security: [],
|
|
28
|
-
tags: [],
|
|
29
|
-
operations: [explorers_1.exploreAsyncApiOperationMetadata],
|
|
30
|
-
};
|
|
31
|
-
return this.generateDenormalizedDocument(metatype, prototype, instance, documentResolvers, modulePath, globalPrefix);
|
|
32
|
-
}
|
|
33
|
-
getSchemas() {
|
|
34
|
-
const ret = Object.assign({}, this.schemas);
|
|
35
|
-
return ret;
|
|
36
|
-
}
|
|
37
|
-
generateDenormalizedDocument(metatype, prototype, instance, documentResolvers, _modulePath, _globalPrefix) {
|
|
38
|
-
const denormalizedAsyncapiServices = this.metadataScanner.scanFromPrototype(instance, prototype, (name) => {
|
|
39
|
-
const targetCallback = prototype[name];
|
|
40
|
-
const methodMetadata = documentResolvers.root.reduce((_metadata, fn) => {
|
|
41
|
-
const serviceMetadata = fn(metatype);
|
|
42
|
-
const channels = documentResolvers.operations.reduce((operationsParam, exploreOperationsMeta) => {
|
|
43
|
-
const operations = operationsParam;
|
|
44
|
-
const meta = exploreOperationsMeta(this.schemas, instance, prototype, targetCallback);
|
|
45
|
-
if (!meta) {
|
|
46
|
-
return operations;
|
|
47
|
-
}
|
|
48
|
-
meta.forEach((op) => {
|
|
49
|
-
if (Object.prototype.hasOwnProperty.call(operations, op.channel)) {
|
|
50
|
-
operations[op.channel] = Object.assign(Object.assign({}, operations[op.channel]), op);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
operations[op.channel] = op;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
return operations;
|
|
57
|
-
}, {});
|
|
58
|
-
return Object.keys(channels).map((channel) => ({
|
|
59
|
-
root: Object.assign(Object.assign({}, serviceMetadata), { name: channel }),
|
|
60
|
-
operations: channels[channel],
|
|
61
|
-
}));
|
|
62
|
-
}, []);
|
|
63
|
-
return methodMetadata;
|
|
64
|
-
});
|
|
65
|
-
return (0, lodash_1.flatten)(denormalizedAsyncapiServices);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.AsyncApiExplorer = AsyncApiExplorer;
|
|
69
|
-
//# sourceMappingURL=asyncapi.explorer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi.explorer.js","sourceRoot":"","sources":["../../../src/services/asyncapi.explorer.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AsyncApiDocument, AsyncApiTemplateOptions } from '../interface';
|
|
2
|
-
export declare class AsyncapiGenerator {
|
|
3
|
-
private readonly templateOptions?;
|
|
4
|
-
constructor(templateOptions?: AsyncApiTemplateOptions);
|
|
5
|
-
generate(contract: AsyncApiDocument): Promise<string>;
|
|
6
|
-
}
|
|
@@ -1,68 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.AsyncapiGenerator = void 0;
|
|
40
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
41
|
-
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
42
|
-
const os_1 = __importDefault(require("os"));
|
|
43
|
-
const path_1 = __importDefault(require("path"));
|
|
44
|
-
class AsyncapiGenerator {
|
|
45
|
-
constructor(templateOptions) {
|
|
46
|
-
this.templateOptions = templateOptions;
|
|
47
|
-
}
|
|
48
|
-
async generate(contract) {
|
|
49
|
-
const { default: Generator } = await Promise.resolve().then(() => __importStar(require('@asyncapi/generator')));
|
|
50
|
-
const yaml = js_yaml_1.default.dump(contract);
|
|
51
|
-
const tmpDir = path_1.default.join(os_1.default.tmpdir(), `asyncapi-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
52
|
-
const generator = new Generator('@asyncapi/html-template', tmpDir, {
|
|
53
|
-
forceWrite: true,
|
|
54
|
-
templateParams: Object.assign({ singleFile: true }, this.templateOptions),
|
|
55
|
-
});
|
|
56
|
-
await generator.generateFromString(yaml, {
|
|
57
|
-
resolve: {
|
|
58
|
-
file: false,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
const htmlPath = path_1.default.join(tmpDir, 'index.html');
|
|
62
|
-
const html = await promises_1.default.readFile(htmlPath, 'utf-8');
|
|
63
|
-
await promises_1.default.rm(tmpDir, { recursive: true, force: true }).catch(() => { });
|
|
64
|
-
return html;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.AsyncapiGenerator = AsyncapiGenerator;
|
|
68
|
-
//# sourceMappingURL=asyncapi.generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncapi.generator.js","sourceRoot":"","sources":["../../../src/services/asyncapi.generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA6B;AAC7B,sDAA6B;AAC7B,4CAAoB;AACpB,gDAAwB;AAGxB,MAAa,iBAAiB;IAG5B,YAAY,eAAyC;QACnD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,QAA0B;QAI9C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,wDAAa,qBAAqB,GAAC,CAAC;QAEnE,MAAM,IAAI,GAAG,iBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,YAAY,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAEvG,MAAM,SAAS,GAAqB,IAAI,SAAS,CAAC,yBAAyB,EAAE,MAAM,EAAE;YACnF,UAAU,EAAE,IAAI;YAChB,cAAc,kBACZ,UAAU,EAAE,IAAI,IACb,IAAI,CAAC,eAAe,CACxB;SACF,CAAC,CAAC;QAEH,MAAM,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE;YACvC,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK;aACZ;SACF,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAGlD,MAAM,kBAAE,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAEtE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtCD,8CAsCC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { INestApplicationContext } from '@nestjs/common';
|
|
2
|
-
import { AsyncApiDocument, AsyncApiDocumentOptions } from '../interface';
|
|
3
|
-
export declare class AsyncapiScanner {
|
|
4
|
-
private readonly transformer;
|
|
5
|
-
private readonly explorer;
|
|
6
|
-
private readonly modelPropertiesAccessor;
|
|
7
|
-
private readonly swaggerTypesMapper;
|
|
8
|
-
private readonly schemaObjectFactory;
|
|
9
|
-
scanApplication(app: INestApplicationContext, options: AsyncApiDocumentOptions): Omit<AsyncApiDocument, 'asyncapi' | 'info'>;
|
|
10
|
-
private scanModuleProviders;
|
|
11
|
-
private getModules;
|
|
12
|
-
private getGlobalPrefix;
|
|
13
|
-
private addExtraModels;
|
|
14
|
-
}
|