@achinet/nestjs-async 0.0.1 → 0.1.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/.eslintrc.js +31 -0
- package/CHANGELOG.md +6 -0
- package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js +1 -2
- package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-operation.decorator.js +1 -2
- package/dist/decorators/asyncapi-operation.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-pub.decorator.js +1 -2
- package/dist/decorators/asyncapi-pub.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-service.decorator.js +1 -2
- package/dist/decorators/asyncapi-service.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-sub.decorator.js +1 -2
- package/dist/decorators/asyncapi-sub.decorator.js.map +1 -1
- package/dist/explorers/asyncapi-operation.explorer.d.ts +8 -8
- package/dist/sample/app.module.d.ts +2 -0
- package/dist/sample/app.module.js +20 -0
- package/dist/sample/app.module.js.map +1 -0
- package/dist/sample/common.d.ts +3 -0
- package/dist/sample/common.js +40 -0
- package/dist/sample/common.js.map +1 -0
- package/dist/sample/constants.d.ts +12 -0
- package/dist/sample/constants.js +16 -0
- package/dist/sample/constants.js.map +1 -0
- package/dist/sample/felines/class/cat.class.d.ts +4 -0
- package/dist/sample/felines/class/cat.class.js +24 -0
- package/dist/sample/felines/class/cat.class.js.map +1 -0
- package/dist/sample/felines/class/feline.class.d.ts +19 -0
- package/dist/sample/felines/class/feline.class.js +20 -0
- package/dist/sample/felines/class/feline.class.js.map +1 -0
- package/dist/sample/felines/class/index.d.ts +5 -0
- package/dist/sample/felines/class/index.js +22 -0
- package/dist/sample/felines/class/index.js.map +1 -0
- package/dist/sample/felines/class/lion.class.d.ts +4 -0
- package/dist/sample/felines/class/lion.class.js +8 -0
- package/dist/sample/felines/class/lion.class.js.map +1 -0
- package/dist/sample/felines/class/message.class.d.ts +7 -0
- package/dist/sample/felines/class/message.class.js +28 -0
- package/dist/sample/felines/class/message.class.js.map +1 -0
- package/dist/sample/felines/class/tiger.class.d.ts +4 -0
- package/dist/sample/felines/class/tiger.class.js +8 -0
- package/dist/sample/felines/class/tiger.class.js.map +1 -0
- package/dist/sample/felines/dto/create-feline.dto.d.ts +4 -0
- package/dist/sample/felines/dto/create-feline.dto.js +28 -0
- package/dist/sample/felines/dto/create-feline.dto.js.map +1 -0
- package/dist/sample/felines/dto/index.d.ts +2 -0
- package/dist/sample/felines/dto/index.js +19 -0
- package/dist/sample/felines/dto/index.js.map +1 -0
- package/dist/sample/felines/dto/journaling-data.dto.d.ts +4 -0
- package/dist/sample/felines/dto/journaling-data.dto.js +8 -0
- package/dist/sample/felines/dto/journaling-data.dto.js.map +1 -0
- package/dist/sample/felines/felines.constants.d.ts +1 -0
- package/dist/sample/felines/felines.constants.js +5 -0
- package/dist/sample/felines/felines.constants.js.map +1 -0
- package/dist/sample/felines/felines.controller.d.ts +15 -0
- package/dist/sample/felines/felines.controller.js +101 -0
- package/dist/sample/felines/felines.controller.js.map +1 -0
- package/dist/sample/felines/felines.gateway.d.ts +16 -0
- package/dist/sample/felines/felines.gateway.js +90 -0
- package/dist/sample/felines/felines.gateway.js.map +1 -0
- package/dist/sample/felines/felines.module.d.ts +2 -0
- package/dist/sample/felines/felines.module.js +28 -0
- package/dist/sample/felines/felines.module.js.map +1 -0
- package/dist/sample/felines/felines.service.d.ts +8 -0
- package/dist/sample/felines/felines.service.js +33 -0
- package/dist/sample/felines/felines.service.js.map +1 -0
- package/dist/sample/felines/rto/feline.rto.d.ts +7 -0
- package/dist/sample/felines/rto/feline.rto.js +31 -0
- package/dist/sample/felines/rto/feline.rto.js.map +1 -0
- package/dist/sample/felines/rto/index.d.ts +1 -0
- package/dist/sample/felines/rto/index.js +18 -0
- package/dist/sample/felines/rto/index.js.map +1 -0
- package/dist/sample/index.d.ts +3 -0
- package/dist/sample/index.js +20 -0
- package/dist/sample/index.js.map +1 -0
- package/dist/sample/main.d.ts +1 -0
- package/dist/sample/main.js +30 -0
- package/dist/sample/main.js.map +1 -0
- package/dist/src/asyncapi-document.builder.d.ts +27 -0
- package/dist/src/asyncapi-document.builder.js +110 -0
- package/dist/src/asyncapi-document.builder.js.map +1 -0
- package/dist/src/asyncapi.constants.d.ts +6 -0
- package/dist/src/asyncapi.constants.js +11 -0
- package/dist/src/asyncapi.constants.js.map +1 -0
- package/dist/src/asyncapi.module.d.ts +8 -0
- package/dist/src/asyncapi.module.js +47 -0
- package/dist/src/asyncapi.module.js.map +1 -0
- package/dist/src/binding/asyncapi.amqp.interfaces.d.ts +38 -0
- package/dist/src/binding/asyncapi.amqp.interfaces.js +3 -0
- package/dist/src/binding/asyncapi.amqp.interfaces.js.map +1 -0
- package/dist/src/binding/asyncapi.kafka.interfaces.d.ts +21 -0
- package/dist/src/binding/asyncapi.kafka.interfaces.js +3 -0
- package/dist/src/binding/asyncapi.kafka.interfaces.js.map +1 -0
- package/dist/src/binding/index.d.ts +2 -0
- package/dist/src/binding/index.js +19 -0
- package/dist/src/binding/index.js.map +1 -0
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.d.ts +2 -0
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js +37 -0
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js.map +1 -0
- package/dist/src/decorators/asyncapi-operation.decorator.d.ts +2 -0
- package/dist/src/decorators/asyncapi-operation.decorator.js +9 -0
- package/dist/src/decorators/asyncapi-operation.decorator.js.map +1 -0
- package/dist/src/decorators/asyncapi-pub.decorator.d.ts +2 -0
- package/dist/src/decorators/asyncapi-pub.decorator.js +10 -0
- package/dist/src/decorators/asyncapi-pub.decorator.js.map +1 -0
- package/dist/src/decorators/asyncapi-service.decorator.d.ts +1 -0
- package/dist/src/decorators/asyncapi-service.decorator.js +9 -0
- package/dist/src/decorators/asyncapi-service.decorator.js.map +1 -0
- package/dist/src/decorators/asyncapi-sub.decorator.d.ts +2 -0
- package/dist/src/decorators/asyncapi-sub.decorator.js +10 -0
- package/dist/src/decorators/asyncapi-sub.decorator.js.map +1 -0
- package/dist/src/decorators/index.d.ts +4 -0
- package/dist/src/decorators/index.js +21 -0
- package/dist/src/decorators/index.js.map +1 -0
- package/dist/src/explorers/asyncapi-class.explorer.d.ts +5 -0
- package/dist/src/explorers/asyncapi-class.explorer.js +27 -0
- package/dist/src/explorers/asyncapi-class.explorer.js.map +1 -0
- package/dist/src/explorers/asyncapi-operation.explorer.d.ts +17 -0
- package/dist/src/explorers/asyncapi-operation.explorer.js +26 -0
- package/dist/src/explorers/asyncapi-operation.explorer.js.map +1 -0
- package/dist/src/explorers/index.d.ts +2 -0
- package/dist/src/explorers/index.js +19 -0
- package/dist/src/explorers/index.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +21 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interface/asyncapi-common.interfaces.d.ts +126 -0
- package/dist/src/interface/asyncapi-common.interfaces.js +3 -0
- package/dist/src/interface/asyncapi-common.interfaces.js.map +1 -0
- package/dist/src/interface/asyncapi-document-options.interface.d.ts +3 -0
- package/dist/src/interface/asyncapi-document-options.interface.js +3 -0
- package/dist/src/interface/asyncapi-document-options.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-message.interface.d.ts +8 -0
- package/dist/src/interface/asyncapi-message.interface.js +3 -0
- package/dist/src/interface/asyncapi-message.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-operation-headers.interface.d.ts +6 -0
- package/dist/src/interface/asyncapi-operation-headers.interface.js +3 -0
- package/dist/src/interface/asyncapi-operation-headers.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-operation-options-raw.interface.d.ts +21 -0
- package/dist/src/interface/asyncapi-operation-options-raw.interface.js +3 -0
- package/dist/src/interface/asyncapi-operation-options-raw.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-operation-options.interface.d.ts +8 -0
- package/dist/src/interface/asyncapi-operation-options.interface.js +3 -0
- package/dist/src/interface/asyncapi-operation-options.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-operation-payload.interface.d.ts +2 -0
- package/dist/src/interface/asyncapi-operation-payload.interface.js +3 -0
- package/dist/src/interface/asyncapi-operation-payload.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-server.interface.d.ts +10 -0
- package/dist/src/interface/asyncapi-server.interface.js +3 -0
- package/dist/src/interface/asyncapi-server.interface.js.map +1 -0
- package/dist/src/interface/asyncapi-template-options.interface.d.ts +7 -0
- package/dist/src/interface/asyncapi-template-options.interface.js +3 -0
- package/dist/src/interface/asyncapi-template-options.interface.js.map +1 -0
- package/dist/src/interface/denormalized-doc-resolvers.interface.d.ts +6 -0
- package/dist/src/interface/denormalized-doc-resolvers.interface.js +3 -0
- package/dist/src/interface/denormalized-doc-resolvers.interface.js.map +1 -0
- package/dist/src/interface/denormalized-doc.interface.d.ts +10 -0
- package/dist/src/interface/denormalized-doc.interface.js +3 -0
- package/dist/src/interface/denormalized-doc.interface.js.map +1 -0
- package/dist/src/interface/generator-options.interface.d.ts +22 -0
- package/dist/src/interface/generator-options.interface.js +3 -0
- package/dist/src/interface/generator-options.interface.js.map +1 -0
- package/dist/src/interface/index.d.ts +11 -0
- package/dist/src/interface/index.js +28 -0
- package/dist/src/interface/index.js.map +1 -0
- package/dist/src/services/asyncapi.explorer.d.ts +12 -0
- package/dist/src/services/asyncapi.explorer.js +69 -0
- package/dist/src/services/asyncapi.explorer.js.map +1 -0
- package/dist/src/services/asyncapi.generator.d.ts +6 -0
- package/dist/src/services/asyncapi.generator.js +68 -0
- package/dist/src/services/asyncapi.generator.js.map +1 -0
- package/dist/src/services/asyncapi.scanner.d.ts +14 -0
- package/dist/src/services/asyncapi.scanner.js +71 -0
- package/dist/src/services/asyncapi.scanner.js.map +1 -0
- package/dist/src/services/asyncapi.transformer.d.ts +4 -0
- package/dist/src/services/asyncapi.transformer.js +33 -0
- package/dist/src/services/asyncapi.transformer.js.map +1 -0
- package/dist/src/services/index.d.ts +4 -0
- package/dist/src/services/index.js +21 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/operation-object.factory.d.ts +9 -0
- package/dist/src/services/operation-object.factory.js +37 -0
- package/dist/src/services/operation-object.factory.js.map +1 -0
- package/dist/test/configs/jest-base.config.d.ts +3 -0
- package/dist/test/configs/jest-base.config.js +20 -0
- package/dist/test/configs/jest-base.config.js.map +1 -0
- package/dist/test/configs/jest-e2e.config.d.ts +3 -0
- package/dist/test/configs/jest-e2e.config.js +16 -0
- package/dist/test/configs/jest-e2e.config.js.map +1 -0
- package/dist/test/express.e2e-spec.d.ts +1 -0
- package/dist/test/express.e2e-spec.js +89 -0
- package/dist/test/express.e2e-spec.js.map +1 -0
- package/dist/test/fastify.e2e-spec.d.ts +1 -0
- package/dist/test/fastify.e2e-spec.js +57 -0
- package/dist/test/fastify.e2e-spec.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/misc/references/ref.html +303 -0
- package/misc/references/ref.json +1 -0
- package/misc/references/ref.yaml +292 -0
- package/misc/take-snaphots.sh +8 -0
- package/package.json +18 -11
- package/sample/app.module.ts +7 -0
- package/sample/common.ts +49 -0
- package/sample/constants.ts +12 -0
- package/sample/felines/class/cat.class.ts +9 -0
- package/sample/felines/class/feline.class.ts +29 -0
- package/sample/felines/class/index.ts +5 -0
- package/sample/felines/class/lion.class.ts +5 -0
- package/sample/felines/class/message.class.ts +17 -0
- package/sample/felines/class/tiger.class.ts +5 -0
- package/sample/felines/dto/create-feline.dto.ts +13 -0
- package/sample/felines/dto/index.ts +2 -0
- package/sample/felines/dto/journaling-data.dto.ts +5 -0
- package/sample/felines/felines.constants.ts +1 -0
- package/sample/felines/felines.controller.ts +76 -0
- package/sample/felines/felines.gateway.ts +76 -0
- package/sample/felines/felines.module.ts +15 -0
- package/sample/felines/felines.service.ts +24 -0
- package/sample/felines/rto/feline.rto.ts +17 -0
- package/sample/felines/rto/index.ts +1 -0
- package/sample/index.ts +3 -0
- package/sample/main.ts +34 -0
- package/src/asyncapi-document.builder.ts +5 -19
- package/src/asyncapi.module.ts +5 -16
- package/src/decorators/asyncapi-operation-for-meta-key.decorator.ts +4 -16
- package/src/decorators/asyncapi-operation.decorator.ts +1 -3
- package/src/decorators/asyncapi-pub.decorator.ts +6 -13
- package/src/decorators/asyncapi-sub.decorator.ts +6 -13
- package/src/explorers/asyncapi-class.explorer.ts +2 -6
- package/src/explorers/asyncapi-operation.explorer.ts +3 -12
- package/src/interface/asyncapi-common.interfaces.ts +1 -4
- package/src/interface/asyncapi-operation-options.interface.ts +2 -4
- package/src/interface/asyncapi-operation-payload.interface.ts +1 -5
- package/src/interface/asyncapi-server.interface.ts +1 -4
- package/src/interface/asyncapi-template-options.interface.ts +5 -5
- package/src/interface/denormalized-doc.interface.ts +1 -5
- package/src/services/asyncapi.explorer.ts +25 -34
- package/src/services/asyncapi.generator.ts +28 -16
- package/src/services/asyncapi.scanner.ts +39 -89
- package/src/services/asyncapi.transformer.ts +2 -8
- package/src/services/index.ts +0 -1
- package/test/__mocks__/@asyncapi/generator.js +41 -0
- package/test/configs/jest-base.config.ts +19 -0
- package/test/configs/jest-e2e.config.js +7 -0
- package/test/configs/jest-e2e.config.ts +19 -0
- package/test/configs/jest-swagger-plugin.js +16 -0
- package/test/express.e2e-spec.ts +64 -0
- package/test/fastify.e2e-spec.ts +65 -0
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var FelinesController_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.FelinesController = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
19
|
+
const dto_1 = require("./dto");
|
|
20
|
+
const src_1 = require("../../src");
|
|
21
|
+
const class_1 = require("../../sample/felines/class");
|
|
22
|
+
const journaling_data_dto_1 = require("../../sample/felines/dto/journaling-data.dto");
|
|
23
|
+
const felines_constants_1 = require("../../sample/felines/felines.constants");
|
|
24
|
+
const felines_service_1 = require("../../sample/felines/felines.service");
|
|
25
|
+
const rto_1 = require("../../sample/felines/rto");
|
|
26
|
+
const EventPatternsMS = {
|
|
27
|
+
createFeline: 'ms/create/feline',
|
|
28
|
+
journal: 'ms/journal',
|
|
29
|
+
};
|
|
30
|
+
let FelinesController = FelinesController_1 = class FelinesController {
|
|
31
|
+
constructor(client, felinesService) {
|
|
32
|
+
this.client = client;
|
|
33
|
+
this.felinesService = felinesService;
|
|
34
|
+
this.logger = new common_1.Logger(FelinesController_1.name);
|
|
35
|
+
}
|
|
36
|
+
async journal(dataForJournaling) {
|
|
37
|
+
const dataForJournalingString = JSON.stringify(dataForJournaling, null, 4);
|
|
38
|
+
this.logger.log(`journaling:\n${dataForJournalingString}`);
|
|
39
|
+
}
|
|
40
|
+
async createFeline(createFelineDto) {
|
|
41
|
+
const feline = await this.felinesService.create(createFelineDto);
|
|
42
|
+
this.logger.debug(`feline created:\n${JSON.stringify(feline)}`);
|
|
43
|
+
this.publishCreatedFeline(feline);
|
|
44
|
+
}
|
|
45
|
+
publishCreatedFeline(feline) {
|
|
46
|
+
const felineRto = new rto_1.FelineRto({ payload: feline });
|
|
47
|
+
return this.client.emit(EventPatternsMS.journal, felineRto);
|
|
48
|
+
}
|
|
49
|
+
async do() {
|
|
50
|
+
const cat = new class_1.Cat({
|
|
51
|
+
id: 123,
|
|
52
|
+
name: 'demo',
|
|
53
|
+
});
|
|
54
|
+
const felineRto = new dto_1.CreateFelineDto({ payload: cat });
|
|
55
|
+
await this.createFeline(felineRto);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.FelinesController = FelinesController;
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, src_1.AsyncApiSub)({
|
|
61
|
+
channel: EventPatternsMS.journal,
|
|
62
|
+
message: {
|
|
63
|
+
payload: journaling_data_dto_1.JournalingDataDto,
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
(0, microservices_1.EventPattern)(EventPatternsMS.journal),
|
|
67
|
+
__metadata("design:type", Function),
|
|
68
|
+
__metadata("design:paramtypes", [journaling_data_dto_1.JournalingDataDto]),
|
|
69
|
+
__metadata("design:returntype", Promise)
|
|
70
|
+
], FelinesController.prototype, "journal", null);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, src_1.AsyncApiPub)({
|
|
73
|
+
channel: EventPatternsMS.createFeline,
|
|
74
|
+
message: {
|
|
75
|
+
payload: dto_1.CreateFelineDto,
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
(0, src_1.AsyncApiSub)({
|
|
79
|
+
channel: EventPatternsMS.createFeline,
|
|
80
|
+
message: {
|
|
81
|
+
payload: rto_1.FelineRto,
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
(0, microservices_1.EventPattern)(EventPatternsMS.createFeline),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [dto_1.CreateFelineDto]),
|
|
87
|
+
__metadata("design:returntype", Promise)
|
|
88
|
+
], FelinesController.prototype, "createFeline", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, common_1.Get)(),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", []),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
94
|
+
], FelinesController.prototype, "do", null);
|
|
95
|
+
exports.FelinesController = FelinesController = FelinesController_1 = __decorate([
|
|
96
|
+
(0, common_1.Controller)(),
|
|
97
|
+
__param(0, (0, common_1.Inject)(felines_constants_1.FELINES_MS)),
|
|
98
|
+
__metadata("design:paramtypes", [microservices_1.ClientProxy,
|
|
99
|
+
felines_service_1.FelinesService])
|
|
100
|
+
], FelinesController);
|
|
101
|
+
//# sourceMappingURL=felines.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"felines.controller.js","sourceRoot":"","sources":["../../../sample/felines/felines.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,yDAAkE;AAClE,+BAAwC;AACxC,mCAAqD;AACrD,sDAAyD;AACzD,sFAAiF;AACjF,8EAAoE;AACpE,0EAAsE;AACtE,kDAAqD;AAErD,MAAM,eAAe,GAAG;IACtB,YAAY,EAAE,kBAAkB;IAChC,OAAO,EAAE,YAAY;CACtB,CAAC;AAMK,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAG5B,YAEE,MAAoC,EACnB,cAA8B;QAD9B,WAAM,GAAN,MAAM,CAAa;QACnB,mBAAc,GAAd,cAAc,CAAgB;QALzC,WAAM,GAAW,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAMzD,CAAC;IASE,AAAN,KAAK,CAAC,OAAO,CAAC,iBAAoC;QAChD,MAAM,uBAAuB,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,uBAAuB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAeK,AAAN,KAAK,CAAC,YAAY,CAAC,eAAgC;QACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,oBAAoB,CAAC,MAAc;QACjC,MAAM,SAAS,GAAG,IAAI,eAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;IAGK,AAAN,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG,IAAI,WAAG,CAAC;YAClB,EAAE,EAAE,GAAG;YACP,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,IAAI,qBAAe,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAExD,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AAxDY,8CAAiB;AAgBtB;IAPL,IAAA,iBAAW,EAAC;QACX,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,OAAO,EAAE;YACP,OAAO,EAAE,uCAAiB;SAC3B;KACF,CAAC;IACD,IAAA,4BAAY,EAAC,eAAe,CAAC,OAAO,CAAC;;qCACL,uCAAiB;;gDAGjD;AAeK;IAbL,IAAA,iBAAW,EAAC;QACX,OAAO,EAAE,eAAe,CAAC,YAAY;QACrC,OAAO,EAAE;YACP,OAAO,EAAE,qBAAe;SACzB;KACF,CAAC;IACD,IAAA,iBAAW,EAAC;QACX,OAAO,EAAE,eAAe,CAAC,YAAY;QACrC,OAAO,EAAE;YACP,OAAO,EAAE,eAAS;SACnB;KACF,CAAC;IACD,IAAA,4BAAY,EAAC,eAAe,CAAC,YAAY,CAAC;;qCACP,qBAAe;;qDAIlD;AAQK;IADL,IAAA,YAAG,GAAE;;;;2CAUL;4BAvDU,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,8BAAU,CAAC,CAAA;qCACM,2BAAW;QACH,gCAAc;GANtC,iBAAiB,CAwD7B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnGatewayDisconnect, OnGatewayInit } from '@nestjs/websockets';
|
|
2
|
+
import { Namespace } from 'socket.io';
|
|
3
|
+
import { Socket } from 'socket.io-client';
|
|
4
|
+
import { FelinesService } from './/felines.service';
|
|
5
|
+
import { CreateFelineDto } from './dto';
|
|
6
|
+
import { FelineRto } from './rto';
|
|
7
|
+
export declare class FelinesGateway implements OnGatewayInit, OnGatewayDisconnect {
|
|
8
|
+
private readonly felinesService;
|
|
9
|
+
private readonly server;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
constructor(felinesService: FelinesService);
|
|
12
|
+
afterInit(nsp: Namespace): void;
|
|
13
|
+
handleDisconnect(client: Socket): void;
|
|
14
|
+
createFeline(client: Socket, createFelineDto: CreateFelineDto): Promise<void>;
|
|
15
|
+
emitCreatedFeline(felineRto: FelineRto): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var FelinesGateway_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.FelinesGateway = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const websockets_1 = require("@nestjs/websockets");
|
|
19
|
+
const socket_io_1 = require("socket.io");
|
|
20
|
+
const socket_io_client_1 = require("socket.io-client");
|
|
21
|
+
const felines_service_1 = require(".//felines.service");
|
|
22
|
+
const dto_1 = require("./dto");
|
|
23
|
+
const rto_1 = require("./rto");
|
|
24
|
+
const src_1 = require("../../src");
|
|
25
|
+
const EventPatternsWS = {
|
|
26
|
+
createFeline: 'ws/create/feline',
|
|
27
|
+
};
|
|
28
|
+
let FelinesGateway = FelinesGateway_1 = class FelinesGateway {
|
|
29
|
+
constructor(felinesService) {
|
|
30
|
+
this.felinesService = felinesService;
|
|
31
|
+
this.logger = new common_1.Logger(FelinesGateway_1.name);
|
|
32
|
+
}
|
|
33
|
+
afterInit(nsp) {
|
|
34
|
+
this.logger.log(`Gateway server init: ${nsp === null || nsp === void 0 ? void 0 : nsp.name}`);
|
|
35
|
+
}
|
|
36
|
+
handleDisconnect(client) {
|
|
37
|
+
this.logger.log(`Client disconnected: ${client.id}`);
|
|
38
|
+
}
|
|
39
|
+
async createFeline(client, createFelineDto) {
|
|
40
|
+
this.logger.log(`data from client ${client.id} : ${JSON.stringify(createFelineDto)}`);
|
|
41
|
+
const feline = await this.felinesService.create(createFelineDto);
|
|
42
|
+
await this.emitCreatedFeline(new rto_1.FelineRto({ payload: feline }));
|
|
43
|
+
}
|
|
44
|
+
async emitCreatedFeline(felineRto) {
|
|
45
|
+
this.server.emit(EventPatternsWS.createFeline, felineRto);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.FelinesGateway = FelinesGateway;
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, websockets_1.WebSocketServer)(),
|
|
51
|
+
__metadata("design:type", socket_io_1.Server)
|
|
52
|
+
], FelinesGateway.prototype, "server", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, websockets_1.SubscribeMessage)(EventPatternsWS.createFeline),
|
|
55
|
+
(0, src_1.AsyncApiPub)({
|
|
56
|
+
channel: EventPatternsWS.createFeline,
|
|
57
|
+
message: {
|
|
58
|
+
payload: dto_1.CreateFelineDto,
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
__param(0, (0, websockets_1.ConnectedSocket)()),
|
|
62
|
+
__param(1, (0, websockets_1.MessageBody)()),
|
|
63
|
+
__metadata("design:type", Function),
|
|
64
|
+
__metadata("design:paramtypes", [socket_io_client_1.Socket,
|
|
65
|
+
dto_1.CreateFelineDto]),
|
|
66
|
+
__metadata("design:returntype", Promise)
|
|
67
|
+
], FelinesGateway.prototype, "createFeline", null);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, src_1.AsyncApiSub)({
|
|
70
|
+
channel: EventPatternsWS.createFeline,
|
|
71
|
+
message: [
|
|
72
|
+
{
|
|
73
|
+
name: 'oneOf demo #1',
|
|
74
|
+
payload: rto_1.FelineRto,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'oneOf demo #2',
|
|
78
|
+
payload: rto_1.FelineExtendedRto,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}),
|
|
82
|
+
__metadata("design:type", Function),
|
|
83
|
+
__metadata("design:paramtypes", [rto_1.FelineRto]),
|
|
84
|
+
__metadata("design:returntype", Promise)
|
|
85
|
+
], FelinesGateway.prototype, "emitCreatedFeline", null);
|
|
86
|
+
exports.FelinesGateway = FelinesGateway = FelinesGateway_1 = __decorate([
|
|
87
|
+
(0, websockets_1.WebSocketGateway)({ transports: ['websocket'], namespace: 'ws' }),
|
|
88
|
+
__metadata("design:paramtypes", [felines_service_1.FelinesService])
|
|
89
|
+
], FelinesGateway);
|
|
90
|
+
//# sourceMappingURL=felines.gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"felines.gateway.js","sourceRoot":"","sources":["../../../sample/felines/felines.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,mDAQ4B;AAC5B,yCAA8C;AAC9C,uDAA0C;AAC1C,wDAAoD;AACpD,+BAAwC;AACxC,+BAAqD;AACrD,mCAAqD;AAErD,MAAM,eAAe,GAAG;IACtB,YAAY,EAAE,kBAAkB;CACjC,CAAC;AAMK,IAAM,cAAc,sBAApB,MAAM,cAAc;IAKzB,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QAF1C,WAAM,GAAW,IAAI,eAAM,CAAC,gBAAc,CAAC,IAAI,CAAC,CAAC;IAEJ,CAAC;IAE/D,SAAS,CAAC,GAAc;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,gBAAgB,CAAC,MAAc;QAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;IASK,AAAN,KAAK,CAAC,YAAY,CACG,MAAc,EAClB,eAAgC;QAE/C,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,oBAAoB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,CACrE,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACjE,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,eAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAeK,AAAN,KAAK,CAAC,iBAAiB,CAAC,SAAoB;QAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CACF,CAAA;AAlDY,wCAAc;AAER;IADhB,IAAA,4BAAe,GAAE;8BACO,kBAAM;8CAAC;AAoB1B;IAPL,IAAA,6BAAgB,EAAC,eAAe,CAAC,YAAY,CAAC;IAC9C,IAAA,iBAAW,EAAC;QACX,OAAO,EAAE,eAAe,CAAC,YAAY;QACrC,OAAO,EAAE;YACP,OAAO,EAAE,qBAAe;SACzB;KACF,CAAC;IAEC,WAAA,IAAA,4BAAe,GAAE,CAAA;IACjB,WAAA,IAAA,wBAAW,GAAE,CAAA;;qCADa,yBAAM;QACD,qBAAe;;kDAQhD;AAeK;IAbL,IAAA,iBAAW,EAAC;QACX,OAAO,EAAE,eAAe,CAAC,YAAY;QACrC,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,eAAS;aACnB;YACD;gBACE,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,uBAAiB;aAC3B;SACF;KACF,CAAC;;qCACiC,eAAS;;uDAE3C;yBAjDU,cAAc;IAD1B,IAAA,6BAAgB,EAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCAMlB,gCAAc;GALhD,cAAc,CAkD1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.FelinesModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
const felines_constants_1 = require("./felines.constants");
|
|
13
|
+
const felines_controller_1 = require("./felines.controller");
|
|
14
|
+
const felines_gateway_1 = require("./felines.gateway");
|
|
15
|
+
const felines_service_1 = require("./felines.service");
|
|
16
|
+
let FelinesModule = class FelinesModule {
|
|
17
|
+
};
|
|
18
|
+
exports.FelinesModule = FelinesModule;
|
|
19
|
+
exports.FelinesModule = FelinesModule = __decorate([
|
|
20
|
+
(0, common_1.Module)({
|
|
21
|
+
imports: [
|
|
22
|
+
microservices_1.ClientsModule.register([{ name: felines_constants_1.FELINES_MS, transport: microservices_1.Transport.TCP }]),
|
|
23
|
+
],
|
|
24
|
+
providers: [felines_service_1.FelinesService, felines_gateway_1.FelinesGateway],
|
|
25
|
+
controllers: [felines_controller_1.FelinesController],
|
|
26
|
+
})
|
|
27
|
+
], FelinesModule);
|
|
28
|
+
//# sourceMappingURL=felines.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"felines.module.js","sourceRoot":"","sources":["../../../sample/felines/felines.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAAiE;AACjE,2DAAiD;AACjD,6DAAyD;AACzD,uDAAmD;AACnD,uDAAmD;AAS5C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAPzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,6BAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,8BAAU,EAAE,SAAS,EAAE,yBAAS,CAAC,GAAG,EAAE,CAAC,CAAC;SACzE;QACD,SAAS,EAAE,CAAC,gCAAc,EAAE,gCAAc,CAAC;QAC3C,WAAW,EAAE,CAAC,sCAAiB,CAAC;KACjC,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Feline } from './class';
|
|
2
|
+
import { CreateFelineDto } from './dto';
|
|
3
|
+
export declare class FelinesService {
|
|
4
|
+
private readonly felines;
|
|
5
|
+
get(id: number): Promise<Feline>;
|
|
6
|
+
delete(id: number): Promise<boolean>;
|
|
7
|
+
create(createFelineDto: CreateFelineDto): Promise<Feline>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.FelinesService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let FelinesService = class FelinesService {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.felines = [];
|
|
14
|
+
}
|
|
15
|
+
async get(id) {
|
|
16
|
+
return this.felines[id];
|
|
17
|
+
}
|
|
18
|
+
async delete(id) {
|
|
19
|
+
const felineToDelete = this.get(id);
|
|
20
|
+
delete this.felines[id];
|
|
21
|
+
return !!felineToDelete;
|
|
22
|
+
}
|
|
23
|
+
async create(createFelineDto) {
|
|
24
|
+
const feline = createFelineDto.payload;
|
|
25
|
+
this.felines.push(feline);
|
|
26
|
+
return feline;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.FelinesService = FelinesService;
|
|
30
|
+
exports.FelinesService = FelinesService = __decorate([
|
|
31
|
+
(0, common_1.Injectable)()
|
|
32
|
+
], FelinesService);
|
|
33
|
+
//# sourceMappingURL=felines.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"felines.service.js","sourceRoot":"","sources":["../../../sample/felines/felines.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAKrC,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QACY,YAAO,GAAa,EAAE,CAAC;IAiB1C,CAAC;IAfC,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,CAAC,cAAc,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,eAAgC;QAC3C,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAlBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAkB1B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.FelineExtendedRto = exports.FelineRto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_1 = require("../class");
|
|
15
|
+
class FelineRto extends class_1.Message {
|
|
16
|
+
}
|
|
17
|
+
exports.FelineRto = FelineRto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
oneOf: [
|
|
21
|
+
{ $ref: (0, swagger_1.getSchemaPath)(class_1.Cat) },
|
|
22
|
+
{ $ref: (0, swagger_1.getSchemaPath)(class_1.Lion) },
|
|
23
|
+
{ $ref: (0, swagger_1.getSchemaPath)(class_1.Tiger) },
|
|
24
|
+
],
|
|
25
|
+
}),
|
|
26
|
+
__metadata("design:type", class_1.Feline)
|
|
27
|
+
], FelineRto.prototype, "payload", void 0);
|
|
28
|
+
class FelineExtendedRto extends FelineRto {
|
|
29
|
+
}
|
|
30
|
+
exports.FelineExtendedRto = FelineExtendedRto;
|
|
31
|
+
//# sourceMappingURL=feline.rto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feline.rto.js","sourceRoot":"","sources":["../../../../sample/felines/rto/feline.rto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6D;AAC7D,oCAA6D;AAE7D,MAAa,SAAU,SAAQ,eAAe;CAS7C;AATD,8BASC;AADC;IAPC,IAAA,qBAAW,EAAC;QACX,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,WAAG,CAAC,EAAE;YAC5B,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,YAAI,CAAC,EAAE;YAC7B,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,aAAK,CAAC,EAAE;SAC/B;KACF,CAAC;8BACO,cAAM;0CAAC;AAGlB,MAAa,iBAAkB,SAAQ,SAAS;CAE/C;AAFD,8CAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './feline.rto';
|
|
@@ -0,0 +1,18 @@
|
|
|
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.rto"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../sample/felines/rto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./app.module"), exports);
|
|
18
|
+
__exportStar(require("./common"), exports);
|
|
19
|
+
__exportStar(require("./constants"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../sample/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("@nestjs/common");
|
|
4
|
+
const core_1 = require("@nestjs/core");
|
|
5
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
6
|
+
const platform_express_1 = require("@nestjs/platform-express");
|
|
7
|
+
const platform_fastify_1 = require("@nestjs/platform-fastify");
|
|
8
|
+
const app_module_1 = require("./app.module");
|
|
9
|
+
const common_2 = require("./common");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const src_1 = require("../src");
|
|
12
|
+
const USE_FASTIFY = false;
|
|
13
|
+
const adapter = USE_FASTIFY
|
|
14
|
+
? new platform_fastify_1.FastifyAdapter({
|
|
15
|
+
ignoreTrailingSlash: false,
|
|
16
|
+
})
|
|
17
|
+
: new platform_express_1.ExpressAdapter();
|
|
18
|
+
async function bootstrap() {
|
|
19
|
+
const app = await core_1.NestFactory.create(app_module_1.AppModule, adapter, {});
|
|
20
|
+
const asyncapiDocument = await (0, common_2.makeAsyncapiDocument)(app);
|
|
21
|
+
await src_1.AsyncApiModule.setup(constants_1.DOC_RELATIVE_PATH, app, asyncapiDocument);
|
|
22
|
+
app.connectMicroservice({ transport: microservices_1.Transport.TCP });
|
|
23
|
+
await app.startAllMicroservices();
|
|
24
|
+
await app.listen(constants_1.PORT, constants_1.HOST);
|
|
25
|
+
const baseUrl = `http://${constants_1.HOST}:${constants_1.PORT}`;
|
|
26
|
+
const docUrl = baseUrl + constants_1.DOC_RELATIVE_PATH;
|
|
27
|
+
common_1.Logger.log(`Server started at ${baseUrl}; AsyncApi at ${docUrl};`, constants_1.BOOTSTRAP);
|
|
28
|
+
}
|
|
29
|
+
bootstrap();
|
|
30
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../sample/main.ts"],"names":[],"mappings":";;AAAA,2CAA0D;AAC1D,uCAA2C;AAC3C,yDAAuE;AACvE,+DAA0D;AAC1D,+DAA0D;AAC1D,6CAAyC;AACzC,qCAAgD;AAChD,2CAAuE;AACvE,gCAAwC;AAExC,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,OAAO,GAAG,WAAW;IACzB,CAAC,CAAC,IAAI,iCAAc,CAAC;QACjB,mBAAmB,EAAE,KAAK;KAC3B,CAAC;IACJ,CAAC,CAAC,IAAI,iCAAc,EAAE,CAAC;AAEzB,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAmB,sBAAS,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,MAAM,IAAA,6BAAoB,EAAC,GAAG,CAAC,CAAC;IACzD,MAAM,oBAAc,CAAC,KAAK,CAAC,6BAAiB,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAErE,GAAG,CAAC,mBAAmB,CAAsB,EAAE,SAAS,EAAE,yBAAS,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3E,MAAM,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAClC,MAAM,GAAG,CAAC,MAAM,CAAC,gBAAI,EAAE,gBAAI,CAAC,CAAC;IAE7B,MAAM,OAAO,GAAG,UAAU,gBAAI,IAAI,gBAAI,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,GAAG,6BAAiB,CAAC;IAC3C,eAAM,CAAC,GAAG,CAAC,qBAAqB,OAAO,iBAAiB,MAAM,GAAG,EAAE,qBAAS,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ExternalDocumentationObject, SecuritySchemeObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
|
2
|
+
import { AsyncApiDocument, AsyncSecuritySchemeObject, AsyncServerObject } from './interface';
|
|
3
|
+
export declare class AsyncApiDocumentBuilder {
|
|
4
|
+
private readonly buildDocumentBase;
|
|
5
|
+
private readonly document;
|
|
6
|
+
setTitle(title: string): this;
|
|
7
|
+
setDescription(description: string): this;
|
|
8
|
+
setVersion(version: string): this;
|
|
9
|
+
setTermsOfService(termsOfService: string): this;
|
|
10
|
+
setContact(name: string, url: string, email: string): this;
|
|
11
|
+
setLicense(name: string, url: string): this;
|
|
12
|
+
addServer(name: string, server: AsyncServerObject): this;
|
|
13
|
+
addServers(servers: {
|
|
14
|
+
name: string;
|
|
15
|
+
server: AsyncServerObject;
|
|
16
|
+
}[]): this;
|
|
17
|
+
setExternalDoc(description: string, url: string): this;
|
|
18
|
+
setDefaultContentType(contentType: string): this;
|
|
19
|
+
addTag(name: string, description?: string, externalDocs?: ExternalDocumentationObject): this;
|
|
20
|
+
addSecurity(name: string, options: AsyncSecuritySchemeObject): this;
|
|
21
|
+
addBearerAuth(options?: SecuritySchemeObject, name?: string): this;
|
|
22
|
+
addOAuth2(options?: SecuritySchemeObject, name?: string): this;
|
|
23
|
+
addApiKey(options?: SecuritySchemeObject, name?: string): this;
|
|
24
|
+
addBasicAuth(options?: SecuritySchemeObject, name?: string): this;
|
|
25
|
+
addCookieAuth(cookieName?: string, options?: SecuritySchemeObject, securityName?: string): this;
|
|
26
|
+
build(): Omit<AsyncApiDocument, 'components' | 'channels'>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncApiDocumentBuilder = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
class AsyncApiDocumentBuilder {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.buildDocumentBase = () => ({
|
|
8
|
+
asyncapi: '2.5.0',
|
|
9
|
+
info: {
|
|
10
|
+
title: '',
|
|
11
|
+
description: '',
|
|
12
|
+
version: '1.0.0',
|
|
13
|
+
contact: {},
|
|
14
|
+
},
|
|
15
|
+
tags: [],
|
|
16
|
+
servers: {},
|
|
17
|
+
components: {},
|
|
18
|
+
});
|
|
19
|
+
this.document = this.buildDocumentBase();
|
|
20
|
+
}
|
|
21
|
+
setTitle(title) {
|
|
22
|
+
this.document.info.title = title;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
setDescription(description) {
|
|
26
|
+
this.document.info.description = description;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
setVersion(version) {
|
|
30
|
+
this.document.info.version = version;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
setTermsOfService(termsOfService) {
|
|
34
|
+
this.document.info.termsOfService = termsOfService;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
setContact(name, url, email) {
|
|
38
|
+
this.document.info.contact = { name, url, email };
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
setLicense(name, url) {
|
|
42
|
+
this.document.info.license = { name, url };
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
addServer(name, server) {
|
|
46
|
+
this.document.servers[name] = server;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
addServers(servers) {
|
|
50
|
+
for (const { name, server } of servers) {
|
|
51
|
+
this.addServer(name, server);
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
setExternalDoc(description, url) {
|
|
56
|
+
this.document.externalDocs = { description, url };
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
setDefaultContentType(contentType) {
|
|
60
|
+
this.document.defaultContentType = contentType;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
addTag(name, description = '', externalDocs) {
|
|
64
|
+
this.document.tags = this.document.tags.concat((0, lodash_1.pickBy)({
|
|
65
|
+
name,
|
|
66
|
+
description,
|
|
67
|
+
externalDocs,
|
|
68
|
+
}, (0, lodash_1.negate)(lodash_1.isUndefined)));
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
addSecurity(name, options) {
|
|
72
|
+
this.document.components.securitySchemes = Object.assign(Object.assign({}, (this.document.components.securitySchemes || {})), { [name]: options });
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
addBearerAuth(options = {
|
|
76
|
+
type: 'http',
|
|
77
|
+
}, name = 'bearer') {
|
|
78
|
+
this.addSecurity(name, Object.assign({ scheme: 'bearer', bearerFormat: 'JWT' }, options));
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
addOAuth2(options = {
|
|
82
|
+
type: 'oauth2',
|
|
83
|
+
}, name = 'oauth2') {
|
|
84
|
+
this.addSecurity(name, Object.assign({ flows: {} }, options));
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
addApiKey(options = {
|
|
88
|
+
type: 'apiKey',
|
|
89
|
+
}, name = 'api_key') {
|
|
90
|
+
this.addSecurity(name, Object.assign({ in: 'header', name }, options));
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
addBasicAuth(options = {
|
|
94
|
+
type: 'http',
|
|
95
|
+
}, name = 'basic') {
|
|
96
|
+
this.addSecurity(name, Object.assign({ scheme: 'basic' }, options));
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
addCookieAuth(cookieName = 'connect.sid', options = {
|
|
100
|
+
type: 'apiKey',
|
|
101
|
+
}, securityName = 'cookie') {
|
|
102
|
+
this.addSecurity(securityName, Object.assign({ in: 'cookie', name: cookieName }, options));
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
build() {
|
|
106
|
+
return this.document;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.AsyncApiDocumentBuilder = AsyncApiDocumentBuilder;
|
|
110
|
+
//# sourceMappingURL=asyncapi-document.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncapi-document.builder.js","sourceRoot":"","sources":["../../src/asyncapi-document.builder.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DECORATORS = void 0;
|
|
4
|
+
const DECORATORS_PREFIX = 'asyncapi';
|
|
5
|
+
exports.DECORATORS = {
|
|
6
|
+
AsyncApiClass: `${DECORATORS_PREFIX}/class`,
|
|
7
|
+
AsyncApiOperation: `${DECORATORS_PREFIX}/operation`,
|
|
8
|
+
AsyncApiPub: `${DECORATORS_PREFIX}/pub`,
|
|
9
|
+
AsyncApiSub: `${DECORATORS_PREFIX}/sub`,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=asyncapi.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncapi.constants.js","sourceRoot":"","sources":["../../src/asyncapi.constants.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAExB,QAAA,UAAU,GAAG;IACxB,aAAa,EAAE,GAAG,iBAAiB,QAAQ;IAC3C,iBAAiB,EAAE,GAAG,iBAAiB,YAAY;IACnD,WAAW,EAAE,GAAG,iBAAiB,MAAM;IACvC,WAAW,EAAE,GAAG,iBAAiB,MAAM;CACxC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { INestApplication, INestApplicationContext } from '@nestjs/common';
|
|
2
|
+
import { AsyncApiDocument, AsyncApiDocumentOptions, AsyncApiTemplateOptions } from './interface';
|
|
3
|
+
export declare class AsyncApiModule {
|
|
4
|
+
private static readonly logger;
|
|
5
|
+
static createDocument(app: INestApplicationContext, config: Omit<AsyncApiDocument, 'channels'>, options?: AsyncApiDocumentOptions): AsyncApiDocument;
|
|
6
|
+
static composeHtml(contract: AsyncApiDocument, templateOptions?: AsyncApiTemplateOptions): Promise<string>;
|
|
7
|
+
static setup(path: string, app: INestApplication, document: AsyncApiDocument, templateOptions?: AsyncApiTemplateOptions): Promise<void>;
|
|
8
|
+
}
|