@achinet/nestjs-async 0.0.1 → 0.1.1

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.
Files changed (248) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js +1 -2
  3. package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js.map +1 -1
  4. package/dist/decorators/asyncapi-operation.decorator.js +1 -2
  5. package/dist/decorators/asyncapi-operation.decorator.js.map +1 -1
  6. package/dist/decorators/asyncapi-pub.decorator.js +1 -2
  7. package/dist/decorators/asyncapi-pub.decorator.js.map +1 -1
  8. package/dist/decorators/asyncapi-service.decorator.js +1 -2
  9. package/dist/decorators/asyncapi-service.decorator.js.map +1 -1
  10. package/dist/decorators/asyncapi-sub.decorator.js +1 -2
  11. package/dist/decorators/asyncapi-sub.decorator.js.map +1 -1
  12. package/dist/explorers/asyncapi-operation.explorer.d.ts +8 -8
  13. package/dist/sample/app.module.d.ts +2 -0
  14. package/dist/sample/app.module.js +20 -0
  15. package/dist/sample/app.module.js.map +1 -0
  16. package/dist/sample/common.d.ts +3 -0
  17. package/dist/sample/common.js +40 -0
  18. package/dist/sample/common.js.map +1 -0
  19. package/dist/sample/constants.d.ts +12 -0
  20. package/dist/sample/constants.js +16 -0
  21. package/dist/sample/constants.js.map +1 -0
  22. package/dist/sample/felines/class/cat.class.d.ts +4 -0
  23. package/dist/sample/felines/class/cat.class.js +24 -0
  24. package/dist/sample/felines/class/cat.class.js.map +1 -0
  25. package/dist/sample/felines/class/feline.class.d.ts +19 -0
  26. package/dist/sample/felines/class/feline.class.js +20 -0
  27. package/dist/sample/felines/class/feline.class.js.map +1 -0
  28. package/dist/sample/felines/class/index.d.ts +5 -0
  29. package/dist/sample/felines/class/index.js +22 -0
  30. package/dist/sample/felines/class/index.js.map +1 -0
  31. package/dist/sample/felines/class/lion.class.d.ts +4 -0
  32. package/dist/sample/felines/class/lion.class.js +8 -0
  33. package/dist/sample/felines/class/lion.class.js.map +1 -0
  34. package/dist/sample/felines/class/message.class.d.ts +7 -0
  35. package/dist/sample/felines/class/message.class.js +28 -0
  36. package/dist/sample/felines/class/message.class.js.map +1 -0
  37. package/dist/sample/felines/class/tiger.class.d.ts +4 -0
  38. package/dist/sample/felines/class/tiger.class.js +8 -0
  39. package/dist/sample/felines/class/tiger.class.js.map +1 -0
  40. package/dist/sample/felines/dto/create-feline.dto.d.ts +4 -0
  41. package/dist/sample/felines/dto/create-feline.dto.js +28 -0
  42. package/dist/sample/felines/dto/create-feline.dto.js.map +1 -0
  43. package/dist/sample/felines/dto/index.d.ts +2 -0
  44. package/dist/sample/felines/dto/index.js +19 -0
  45. package/dist/sample/felines/dto/index.js.map +1 -0
  46. package/dist/sample/felines/dto/journaling-data.dto.d.ts +4 -0
  47. package/dist/sample/felines/dto/journaling-data.dto.js +8 -0
  48. package/dist/sample/felines/dto/journaling-data.dto.js.map +1 -0
  49. package/dist/sample/felines/felines.constants.d.ts +1 -0
  50. package/dist/sample/felines/felines.constants.js +5 -0
  51. package/dist/sample/felines/felines.constants.js.map +1 -0
  52. package/dist/sample/felines/felines.controller.d.ts +15 -0
  53. package/dist/sample/felines/felines.controller.js +101 -0
  54. package/dist/sample/felines/felines.controller.js.map +1 -0
  55. package/dist/sample/felines/felines.gateway.d.ts +16 -0
  56. package/dist/sample/felines/felines.gateway.js +90 -0
  57. package/dist/sample/felines/felines.gateway.js.map +1 -0
  58. package/dist/sample/felines/felines.module.d.ts +2 -0
  59. package/dist/sample/felines/felines.module.js +28 -0
  60. package/dist/sample/felines/felines.module.js.map +1 -0
  61. package/dist/sample/felines/felines.service.d.ts +8 -0
  62. package/dist/sample/felines/felines.service.js +33 -0
  63. package/dist/sample/felines/felines.service.js.map +1 -0
  64. package/dist/sample/felines/rto/feline.rto.d.ts +7 -0
  65. package/dist/sample/felines/rto/feline.rto.js +31 -0
  66. package/dist/sample/felines/rto/feline.rto.js.map +1 -0
  67. package/dist/sample/felines/rto/index.d.ts +1 -0
  68. package/dist/sample/felines/rto/index.js +18 -0
  69. package/dist/sample/felines/rto/index.js.map +1 -0
  70. package/dist/sample/index.d.ts +3 -0
  71. package/dist/sample/index.js +20 -0
  72. package/dist/sample/index.js.map +1 -0
  73. package/dist/sample/main.d.ts +1 -0
  74. package/dist/sample/main.js +30 -0
  75. package/dist/sample/main.js.map +1 -0
  76. package/dist/src/asyncapi-document.builder.d.ts +27 -0
  77. package/dist/src/asyncapi-document.builder.js +110 -0
  78. package/dist/src/asyncapi-document.builder.js.map +1 -0
  79. package/dist/src/asyncapi.constants.d.ts +6 -0
  80. package/dist/src/asyncapi.constants.js +11 -0
  81. package/dist/src/asyncapi.constants.js.map +1 -0
  82. package/dist/src/asyncapi.module.d.ts +8 -0
  83. package/dist/src/asyncapi.module.js +47 -0
  84. package/dist/src/asyncapi.module.js.map +1 -0
  85. package/dist/src/binding/asyncapi.amqp.interfaces.d.ts +38 -0
  86. package/dist/src/binding/asyncapi.amqp.interfaces.js +3 -0
  87. package/dist/src/binding/asyncapi.amqp.interfaces.js.map +1 -0
  88. package/dist/src/binding/asyncapi.kafka.interfaces.d.ts +21 -0
  89. package/dist/src/binding/asyncapi.kafka.interfaces.js +3 -0
  90. package/dist/src/binding/asyncapi.kafka.interfaces.js.map +1 -0
  91. package/dist/src/binding/index.d.ts +2 -0
  92. package/dist/src/binding/index.js +19 -0
  93. package/dist/src/binding/index.js.map +1 -0
  94. package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.d.ts +2 -0
  95. package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js +37 -0
  96. package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js.map +1 -0
  97. package/dist/src/decorators/asyncapi-operation.decorator.d.ts +2 -0
  98. package/dist/src/decorators/asyncapi-operation.decorator.js +9 -0
  99. package/dist/src/decorators/asyncapi-operation.decorator.js.map +1 -0
  100. package/dist/src/decorators/asyncapi-pub.decorator.d.ts +2 -0
  101. package/dist/src/decorators/asyncapi-pub.decorator.js +10 -0
  102. package/dist/src/decorators/asyncapi-pub.decorator.js.map +1 -0
  103. package/dist/src/decorators/asyncapi-service.decorator.d.ts +1 -0
  104. package/dist/src/decorators/asyncapi-service.decorator.js +9 -0
  105. package/dist/src/decorators/asyncapi-service.decorator.js.map +1 -0
  106. package/dist/src/decorators/asyncapi-sub.decorator.d.ts +2 -0
  107. package/dist/src/decorators/asyncapi-sub.decorator.js +10 -0
  108. package/dist/src/decorators/asyncapi-sub.decorator.js.map +1 -0
  109. package/dist/src/decorators/index.d.ts +4 -0
  110. package/dist/src/decorators/index.js +21 -0
  111. package/dist/src/decorators/index.js.map +1 -0
  112. package/dist/src/explorers/asyncapi-class.explorer.d.ts +5 -0
  113. package/dist/src/explorers/asyncapi-class.explorer.js +27 -0
  114. package/dist/src/explorers/asyncapi-class.explorer.js.map +1 -0
  115. package/dist/src/explorers/asyncapi-operation.explorer.d.ts +17 -0
  116. package/dist/src/explorers/asyncapi-operation.explorer.js +26 -0
  117. package/dist/src/explorers/asyncapi-operation.explorer.js.map +1 -0
  118. package/dist/src/explorers/index.d.ts +2 -0
  119. package/dist/src/explorers/index.js +19 -0
  120. package/dist/src/explorers/index.js.map +1 -0
  121. package/dist/src/index.d.ts +4 -0
  122. package/dist/src/index.js +21 -0
  123. package/dist/src/index.js.map +1 -0
  124. package/dist/src/interface/asyncapi-common.interfaces.d.ts +126 -0
  125. package/dist/src/interface/asyncapi-common.interfaces.js +3 -0
  126. package/dist/src/interface/asyncapi-common.interfaces.js.map +1 -0
  127. package/dist/src/interface/asyncapi-document-options.interface.d.ts +3 -0
  128. package/dist/src/interface/asyncapi-document-options.interface.js +3 -0
  129. package/dist/src/interface/asyncapi-document-options.interface.js.map +1 -0
  130. package/dist/src/interface/asyncapi-message.interface.d.ts +8 -0
  131. package/dist/src/interface/asyncapi-message.interface.js +3 -0
  132. package/dist/src/interface/asyncapi-message.interface.js.map +1 -0
  133. package/dist/src/interface/asyncapi-operation-headers.interface.d.ts +6 -0
  134. package/dist/src/interface/asyncapi-operation-headers.interface.js +3 -0
  135. package/dist/src/interface/asyncapi-operation-headers.interface.js.map +1 -0
  136. package/dist/src/interface/asyncapi-operation-options-raw.interface.d.ts +21 -0
  137. package/dist/src/interface/asyncapi-operation-options-raw.interface.js +3 -0
  138. package/dist/src/interface/asyncapi-operation-options-raw.interface.js.map +1 -0
  139. package/dist/src/interface/asyncapi-operation-options.interface.d.ts +8 -0
  140. package/dist/src/interface/asyncapi-operation-options.interface.js +3 -0
  141. package/dist/src/interface/asyncapi-operation-options.interface.js.map +1 -0
  142. package/dist/src/interface/asyncapi-operation-payload.interface.d.ts +2 -0
  143. package/dist/src/interface/asyncapi-operation-payload.interface.js +3 -0
  144. package/dist/src/interface/asyncapi-operation-payload.interface.js.map +1 -0
  145. package/dist/src/interface/asyncapi-server.interface.d.ts +10 -0
  146. package/dist/src/interface/asyncapi-server.interface.js +3 -0
  147. package/dist/src/interface/asyncapi-server.interface.js.map +1 -0
  148. package/dist/src/interface/asyncapi-template-options.interface.d.ts +7 -0
  149. package/dist/src/interface/asyncapi-template-options.interface.js +3 -0
  150. package/dist/src/interface/asyncapi-template-options.interface.js.map +1 -0
  151. package/dist/src/interface/denormalized-doc-resolvers.interface.d.ts +6 -0
  152. package/dist/src/interface/denormalized-doc-resolvers.interface.js +3 -0
  153. package/dist/src/interface/denormalized-doc-resolvers.interface.js.map +1 -0
  154. package/dist/src/interface/denormalized-doc.interface.d.ts +10 -0
  155. package/dist/src/interface/denormalized-doc.interface.js +3 -0
  156. package/dist/src/interface/denormalized-doc.interface.js.map +1 -0
  157. package/dist/src/interface/generator-options.interface.d.ts +22 -0
  158. package/dist/src/interface/generator-options.interface.js +3 -0
  159. package/dist/src/interface/generator-options.interface.js.map +1 -0
  160. package/dist/src/interface/index.d.ts +11 -0
  161. package/dist/src/interface/index.js +28 -0
  162. package/dist/src/interface/index.js.map +1 -0
  163. package/dist/src/services/asyncapi.explorer.d.ts +12 -0
  164. package/dist/src/services/asyncapi.explorer.js +69 -0
  165. package/dist/src/services/asyncapi.explorer.js.map +1 -0
  166. package/dist/src/services/asyncapi.generator.d.ts +6 -0
  167. package/dist/src/services/asyncapi.generator.js +68 -0
  168. package/dist/src/services/asyncapi.generator.js.map +1 -0
  169. package/dist/src/services/asyncapi.scanner.d.ts +14 -0
  170. package/dist/src/services/asyncapi.scanner.js +71 -0
  171. package/dist/src/services/asyncapi.scanner.js.map +1 -0
  172. package/dist/src/services/asyncapi.transformer.d.ts +4 -0
  173. package/dist/src/services/asyncapi.transformer.js +33 -0
  174. package/dist/src/services/asyncapi.transformer.js.map +1 -0
  175. package/dist/src/services/index.d.ts +4 -0
  176. package/dist/src/services/index.js +21 -0
  177. package/dist/src/services/index.js.map +1 -0
  178. package/dist/src/services/operation-object.factory.d.ts +9 -0
  179. package/dist/src/services/operation-object.factory.js +37 -0
  180. package/dist/src/services/operation-object.factory.js.map +1 -0
  181. package/dist/test/configs/jest-base.config.d.ts +3 -0
  182. package/dist/test/configs/jest-base.config.js +20 -0
  183. package/dist/test/configs/jest-base.config.js.map +1 -0
  184. package/dist/test/configs/jest-e2e.config.d.ts +3 -0
  185. package/dist/test/configs/jest-e2e.config.js +16 -0
  186. package/dist/test/configs/jest-e2e.config.js.map +1 -0
  187. package/dist/test/express.e2e-spec.d.ts +1 -0
  188. package/dist/test/express.e2e-spec.js +89 -0
  189. package/dist/test/express.e2e-spec.js.map +1 -0
  190. package/dist/test/fastify.e2e-spec.d.ts +1 -0
  191. package/dist/test/fastify.e2e-spec.js +57 -0
  192. package/dist/test/fastify.e2e-spec.js.map +1 -0
  193. package/dist/tsconfig.tsbuildinfo +1 -1
  194. package/eslint.config.mjs +21 -0
  195. package/misc/references/ref.html +303 -0
  196. package/misc/references/ref.json +1 -0
  197. package/misc/references/ref.yaml +292 -0
  198. package/misc/take-snaphots.sh +8 -0
  199. package/package.json +48 -41
  200. package/sample/app.module.ts +7 -0
  201. package/sample/common.ts +49 -0
  202. package/sample/constants.ts +12 -0
  203. package/sample/felines/class/cat.class.ts +9 -0
  204. package/sample/felines/class/feline.class.ts +29 -0
  205. package/sample/felines/class/index.ts +5 -0
  206. package/sample/felines/class/lion.class.ts +5 -0
  207. package/sample/felines/class/message.class.ts +17 -0
  208. package/sample/felines/class/tiger.class.ts +5 -0
  209. package/sample/felines/dto/create-feline.dto.ts +13 -0
  210. package/sample/felines/dto/index.ts +2 -0
  211. package/sample/felines/dto/journaling-data.dto.ts +5 -0
  212. package/sample/felines/felines.constants.ts +1 -0
  213. package/sample/felines/felines.controller.ts +76 -0
  214. package/sample/felines/felines.gateway.ts +76 -0
  215. package/sample/felines/felines.module.ts +15 -0
  216. package/sample/felines/felines.service.ts +24 -0
  217. package/sample/felines/rto/feline.rto.ts +17 -0
  218. package/sample/felines/rto/index.ts +1 -0
  219. package/sample/index.ts +3 -0
  220. package/sample/main.ts +34 -0
  221. package/src/asyncapi-document.builder.ts +5 -19
  222. package/src/asyncapi.module.ts +5 -16
  223. package/src/decorators/asyncapi-operation-for-meta-key.decorator.ts +4 -16
  224. package/src/decorators/asyncapi-operation.decorator.ts +1 -3
  225. package/src/decorators/asyncapi-pub.decorator.ts +6 -13
  226. package/src/decorators/asyncapi-sub.decorator.ts +6 -13
  227. package/src/explorers/asyncapi-class.explorer.ts +2 -6
  228. package/src/explorers/asyncapi-operation.explorer.ts +3 -12
  229. package/src/interface/asyncapi-common.interfaces.ts +1 -4
  230. package/src/interface/asyncapi-operation-options.interface.ts +2 -4
  231. package/src/interface/asyncapi-operation-payload.interface.ts +1 -5
  232. package/src/interface/asyncapi-server.interface.ts +1 -4
  233. package/src/interface/asyncapi-template-options.interface.ts +5 -5
  234. package/src/interface/denormalized-doc.interface.ts +1 -5
  235. package/src/services/asyncapi.explorer.ts +25 -34
  236. package/src/services/asyncapi.generator.ts +28 -16
  237. package/src/services/asyncapi.scanner.ts +39 -89
  238. package/src/services/asyncapi.transformer.ts +2 -8
  239. package/src/services/index.ts +0 -1
  240. package/src/services/operation-object.factory.ts +0 -1
  241. package/test/__mocks__/@asyncapi/generator.js +41 -0
  242. package/test/configs/jest-base.config.ts +19 -0
  243. package/test/configs/jest-e2e.config.js +7 -0
  244. package/test/configs/jest-e2e.config.ts +19 -0
  245. package/test/configs/jest-swagger-plugin.js +16 -0
  246. package/test/express.e2e-spec.ts +64 -0
  247. package/test/fastify.e2e-spec.ts +65 -0
  248. package/.eslintrc.js +0 -9
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AsyncApiModule = void 0;
7
+ const common_1 = require("@nestjs/common");
8
+ const validate_path_util_1 = require("@nestjs/swagger/dist/utils/validate-path.util");
9
+ const js_yaml_1 = __importDefault(require("js-yaml"));
10
+ const services_1 = require("./services");
11
+ class AsyncApiModule {
12
+ static createDocument(app, config, options = {}) {
13
+ const asyncapiScanner = new services_1.AsyncapiScanner();
14
+ const document = asyncapiScanner.scanApplication(app, options);
15
+ document.components = Object.assign(Object.assign({}, (config.components || {})), document.components);
16
+ return Object.assign(Object.assign({}, config), document);
17
+ }
18
+ static async composeHtml(contract, templateOptions) {
19
+ const generator = new services_1.AsyncapiGenerator(templateOptions);
20
+ return generator.generate(contract).catch((err) => {
21
+ this.logger.error(err);
22
+ throw err;
23
+ });
24
+ }
25
+ static async setup(path, app, document, templateOptions) {
26
+ const httpAdapter = app.getHttpAdapter();
27
+ const finalPath = (0, validate_path_util_1.validatePath)(path);
28
+ const html = await this.composeHtml(document, templateOptions);
29
+ const yamlDocument = js_yaml_1.default.dump(document);
30
+ const jsonDocument = JSON.stringify(document);
31
+ httpAdapter.get(finalPath, (req, res) => {
32
+ res.type('text/html');
33
+ res.send(html);
34
+ });
35
+ httpAdapter.get(`${finalPath}-json`, (req, res) => {
36
+ res.type('application/json');
37
+ res.send(jsonDocument);
38
+ });
39
+ httpAdapter.get(`${finalPath}-yaml`, (req, res) => {
40
+ res.type('text/yaml');
41
+ res.send(yamlDocument);
42
+ });
43
+ }
44
+ }
45
+ exports.AsyncApiModule = AsyncApiModule;
46
+ AsyncApiModule.logger = new common_1.Logger(AsyncApiModule.name);
47
+ //# sourceMappingURL=asyncapi.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi.module.js","sourceRoot":"","sources":["../../src/asyncapi.module.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAmF;AACnF,sFAA6E;AAC7E,sDAA6B;AAE7B,yCAAgE;AAEhE,MAAa,cAAc;IAGlB,MAAM,CAAC,cAAc,CAC1B,GAA4B,EAC5B,MAA0C,EAC1C,UAAmC,EAAE;QAErC,MAAM,eAAe,GAAG,IAAI,0BAAe,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE/D,QAAQ,CAAC,UAAU,mCACd,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,GACzB,QAAQ,CAAC,UAAU,CACvB,CAAC;QAEF,uCACK,MAAM,GACN,QAAQ,EACX;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,QAA0B,EAAE,eAAyC;QAC5F,MAAM,SAAS,GAAG,IAAI,4BAAiB,CAAC,eAAe,CAAC,CAAC;QACzD,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,KAAK,CACvB,IAAY,EACZ,GAAqB,EACrB,QAA0B,EAC1B,eAAyC;QAEzC,MAAM,WAAW,GAAG,GAAG,CAAC,cAAc,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,IAAA,iCAAY,EAAC,IAAI,CAAC,CAAC;QAErC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;QAC/D,MAAM,YAAY,GAAG,iBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE9C,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACtC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACtB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAChD,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC7B,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAChD,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACtB,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;;AAzDH,wCA0DC;AAzDyB,qBAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ export interface AmqpServerBinding {
2
+ }
3
+ export interface AmqpChannelBinding {
4
+ is: string;
5
+ exchange?: {
6
+ name: string;
7
+ type: string;
8
+ durable?: boolean;
9
+ autoDelete?: boolean;
10
+ vhost?: string;
11
+ };
12
+ queue?: {
13
+ name: string;
14
+ durable?: boolean;
15
+ exclusive?: boolean;
16
+ autoDelete?: boolean;
17
+ vhost?: string;
18
+ };
19
+ bindingVersion?: string;
20
+ }
21
+ export interface AmqpOperationBinding {
22
+ expiration?: number;
23
+ userId?: string;
24
+ cc?: string[];
25
+ priority?: number;
26
+ deliveryMode?: number;
27
+ mandatory?: boolean;
28
+ bcc?: string[];
29
+ replyTo?: string;
30
+ timestamp?: boolean;
31
+ ack?: boolean;
32
+ bindingVersion?: string;
33
+ }
34
+ export interface AmqpMessageBinding {
35
+ contentEncoding?: string;
36
+ messageType?: string;
37
+ bindingVersion?: string;
38
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=asyncapi.amqp.interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi.amqp.interfaces.js","sourceRoot":"","sources":["../../../src/binding/asyncapi.amqp.interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
2
+ export interface KafkaServerBinding {
3
+ schemaRegistryUrl: string;
4
+ schemaRegistryVendor: string;
5
+ bindingVersion: string;
6
+ }
7
+ export interface KafkaChannelBinding {
8
+ topic: string;
9
+ partitions: number;
10
+ replicas: number;
11
+ bindingVersion: string;
12
+ }
13
+ export interface KafkaOperationBinding {
14
+ groupId?: SchemaObject;
15
+ clientId?: SchemaObject;
16
+ bindingVersion?: string;
17
+ }
18
+ export interface KafkaMessageBinding {
19
+ key?: SchemaObject;
20
+ bindingVersion?: string;
21
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=asyncapi.kafka.interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi.kafka.interfaces.js","sourceRoot":"","sources":["../../../src/binding/asyncapi.kafka.interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './asyncapi.amqp.interfaces';
2
+ export * from './asyncapi.kafka.interfaces';
@@ -0,0 +1,19 @@
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.amqp.interfaces"), exports);
18
+ __exportStar(require("./asyncapi.kafka.interfaces"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/binding/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,8DAA4C"}
@@ -0,0 +1,2 @@
1
+ import { AsyncApiOperationOptions } from '../interface';
2
+ export declare function AsyncApiOperationForMetaKey(metaKey: string, options: AsyncApiOperationOptions[]): MethodDecorator;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncApiOperationForMetaKey = AsyncApiOperationForMetaKey;
4
+ const helpers_1 = require("@nestjs/swagger/dist/decorators/helpers");
5
+ function makeHeaders(headers) {
6
+ return headers
7
+ ? {
8
+ type: 'object',
9
+ properties: Object.entries(headers)
10
+ .map(([key, value]) => ({
11
+ [key]: Object.assign({ type: 'string' }, value),
12
+ }))
13
+ .reduce((acc, j) => (Object.assign(Object.assign({}, acc), j)), {}),
14
+ }
15
+ : undefined;
16
+ }
17
+ function makeMessage(message, defaultName) {
18
+ return Object.assign(Object.assign({}, message), { name: message.name || defaultName, payload: {
19
+ type: message.payload,
20
+ }, headers: makeHeaders(message.headers) });
21
+ }
22
+ function AsyncApiOperationForMetaKey(metaKey, options) {
23
+ return (target, propertyKey, descriptor) => {
24
+ const methodName = `${target.constructor.name}#${String(propertyKey)}`;
25
+ const transformedOptions = options.map((i) => {
26
+ const message = Array.isArray(i.message)
27
+ ? {
28
+ oneOf: i.message.map((j, index) => makeMessage(j, `${methodName}#${index}`)),
29
+ }
30
+ : makeMessage(i.message, methodName);
31
+ const transformedOptionInstance = Object.assign(Object.assign({}, i), { message });
32
+ return transformedOptionInstance;
33
+ });
34
+ return (0, helpers_1.createMethodDecorator)(metaKey, transformedOptions)(target, propertyKey, descriptor);
35
+ };
36
+ }
37
+ //# sourceMappingURL=asyncapi-operation-for-meta-key.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-operation-for-meta-key.decorator.js","sourceRoot":"","sources":["../../../src/decorators/asyncapi-operation-for-meta-key.decorator.ts"],"names":[],"mappings":";;AAoCA,kEAqBC;AAzDD,qEAAgF;AAShF,SAAS,WAAW,CAAC,OAAkC;IACrD,OAAO,OAAO;QACZ,CAAC,CAAC;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;iBAChC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;gBACtB,CAAC,GAAG,CAAC,kBACH,IAAI,EAAE,QAAQ,IACX,KAAK,CACT;aACF,CAAC,CAAC;iBACF,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iCAAM,GAAG,GAAK,CAAC,EAAG,EAAE,EAAE,CAAC;SAC9C;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,OAA2B,EAAE,WAAmB;IACnE,uCACK,OAAO,KACV,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,WAAW,EACjC,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,OAAO;SACtB,EACD,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IACrC;AACJ,CAAC;AAED,SAAgB,2BAA2B,CAAC,OAAe,EAAE,OAAmC;IAC9F,OAAO,CAAC,MAAM,EAAE,WAA4B,EAAE,UAAU,EAAE,EAAE;QAC1D,MAAM,UAAU,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAEvE,MAAM,kBAAkB,GAA2B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACnE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;gBACtC,CAAC,CAAC;oBACE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,UAAU,IAAI,KAAK,EAAE,CAAC,CAAC;iBAC7E;gBACH,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YAEvC,MAAM,yBAAyB,mCAC1B,CAAC,KACJ,OAAO,GACR,CAAC;YAEF,OAAO,yBAAyB,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,OAAO,IAAA,+BAAqB,EAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAC7F,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AsyncApiOperationOptions } from '../interface';
2
+ export declare function AsyncApiOperation(...options: AsyncApiOperationOptions[]): MethodDecorator;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncApiOperation = AsyncApiOperation;
4
+ const asyncapi_constants_1 = require("../asyncapi.constants");
5
+ const asyncapi_operation_for_meta_key_decorator_1 = require("./asyncapi-operation-for-meta-key.decorator");
6
+ function AsyncApiOperation(...options) {
7
+ return (0, asyncapi_operation_for_meta_key_decorator_1.AsyncApiOperationForMetaKey)(asyncapi_constants_1.DECORATORS.AsyncApiOperation, options);
8
+ }
9
+ //# sourceMappingURL=asyncapi-operation.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-operation.decorator.js","sourceRoot":"","sources":["../../../src/decorators/asyncapi-operation.decorator.ts"],"names":[],"mappings":";;AAIA,8CAEC;AAND,8DAAmD;AAEnD,2GAA0F;AAE1F,SAAgB,iBAAiB,CAAC,GAAG,OAAmC;IACtE,OAAO,IAAA,uEAA2B,EAAC,+BAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AsyncApiSpecificOperationOptions } from '../interface';
2
+ export declare function AsyncApiPub(...specificOperationOptions: AsyncApiSpecificOperationOptions[]): MethodDecorator;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncApiPub = AsyncApiPub;
4
+ const asyncapi_constants_1 = require("../asyncapi.constants");
5
+ const asyncapi_operation_for_meta_key_decorator_1 = require("./asyncapi-operation-for-meta-key.decorator");
6
+ function AsyncApiPub(...specificOperationOptions) {
7
+ const options = specificOperationOptions.map((i) => (Object.assign(Object.assign({}, i), { type: 'pub' })));
8
+ return (0, asyncapi_operation_for_meta_key_decorator_1.AsyncApiOperationForMetaKey)(asyncapi_constants_1.DECORATORS.AsyncApiPub, options);
9
+ }
10
+ //# sourceMappingURL=asyncapi-pub.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-pub.decorator.js","sourceRoot":"","sources":["../../../src/decorators/asyncapi-pub.decorator.ts"],"names":[],"mappings":";;AAIA,kCAMC;AAVD,8DAAmD;AAEnD,2GAA0F;AAE1F,SAAgB,WAAW,CAAC,GAAG,wBAA4D;IACzF,MAAM,OAAO,GAA+B,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAC3E,CAAC,KACJ,IAAI,EAAE,KAAK,IACX,CAAC,CAAC;IACJ,OAAO,IAAA,uEAA2B,EAAC,+BAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function AsyncApi(): MethodDecorator & ClassDecorator;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncApi = AsyncApi;
4
+ const helpers_1 = require("@nestjs/swagger/dist/decorators/helpers");
5
+ const asyncapi_constants_1 = require("../asyncapi.constants");
6
+ function AsyncApi() {
7
+ return (0, helpers_1.createMixedDecorator)(asyncapi_constants_1.DECORATORS.AsyncApiClass, true);
8
+ }
9
+ //# sourceMappingURL=asyncapi-service.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-service.decorator.js","sourceRoot":"","sources":["../../../src/decorators/asyncapi-service.decorator.ts"],"names":[],"mappings":";;AAMA,4BAEC;AARD,qEAA+E;AAC/E,8DAAmD;AAKnD,SAAgB,QAAQ;IACtB,OAAO,IAAA,8BAAoB,EAAC,+BAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { AsyncApiSpecificOperationOptions } from '../interface';
2
+ export declare function AsyncApiSub(...specificOperationOptions: AsyncApiSpecificOperationOptions[]): MethodDecorator;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncApiSub = AsyncApiSub;
4
+ const asyncapi_constants_1 = require("../asyncapi.constants");
5
+ const asyncapi_operation_for_meta_key_decorator_1 = require("./asyncapi-operation-for-meta-key.decorator");
6
+ function AsyncApiSub(...specificOperationOptions) {
7
+ const options = specificOperationOptions.map((i) => (Object.assign(Object.assign({}, i), { type: 'sub' })));
8
+ return (0, asyncapi_operation_for_meta_key_decorator_1.AsyncApiOperationForMetaKey)(asyncapi_constants_1.DECORATORS.AsyncApiSub, options);
9
+ }
10
+ //# sourceMappingURL=asyncapi-sub.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-sub.decorator.js","sourceRoot":"","sources":["../../../src/decorators/asyncapi-sub.decorator.ts"],"names":[],"mappings":";;AAIA,kCAMC;AAVD,8DAAmD;AAEnD,2GAA0F;AAE1F,SAAgB,WAAW,CAAC,GAAG,wBAA4D;IACzF,MAAM,OAAO,GAA+B,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAC3E,CAAC,KACJ,IAAI,EAAE,KAAK,IACX,CAAC,CAAC;IACJ,OAAO,IAAA,uEAA2B,EAAC,+BAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './asyncapi-service.decorator';
2
+ export * from './asyncapi-operation.decorator';
3
+ export * from './asyncapi-sub.decorator';
4
+ export * from './asyncapi-pub.decorator';
@@ -0,0 +1,21 @@
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-service.decorator"), exports);
18
+ __exportStar(require("./asyncapi-operation.decorator"), exports);
19
+ __exportStar(require("./asyncapi-sub.decorator"), exports);
20
+ __exportStar(require("./asyncapi-pub.decorator"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,iEAA+C;AAC/C,2DAAyC;AACzC,2DAAyC"}
@@ -0,0 +1,5 @@
1
+ import { Type } from '@nestjs/common';
2
+ export declare const asyncApiClassAnnotationLabels: any[];
3
+ export declare const exploreAsyncapiClassMetadata: (metatype: Type<unknown>) => any;
4
+ export declare const exploreControllerMetadata: (metatype: Type<unknown>) => any;
5
+ export declare const exploreGatewayMetadata: (metatype: Type<unknown>) => any;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exploreGatewayMetadata = exports.exploreControllerMetadata = exports.exploreAsyncapiClassMetadata = exports.asyncApiClassAnnotationLabels = void 0;
4
+ const constants_1 = require("@nestjs/common/constants");
5
+ const asyncapi_constants_1 = require("../asyncapi.constants");
6
+ let GATEWAY_METADATA;
7
+ try {
8
+ const wsConstants = require('@nestjs/websockets/constants');
9
+ GATEWAY_METADATA = wsConstants.GATEWAY_METADATA;
10
+ }
11
+ catch (_a) {
12
+ GATEWAY_METADATA = '__gateway__';
13
+ }
14
+ exports.asyncApiClassAnnotationLabels = [asyncapi_constants_1.DECORATORS.AsyncApiClass, constants_1.CONTROLLER_WATERMARK, GATEWAY_METADATA];
15
+ const exploreAsyncapiClassMetadata = (metatype) => {
16
+ return Reflect.getMetadata(asyncapi_constants_1.DECORATORS.AsyncApiClass, metatype);
17
+ };
18
+ exports.exploreAsyncapiClassMetadata = exploreAsyncapiClassMetadata;
19
+ const exploreControllerMetadata = (metatype) => {
20
+ return Reflect.getMetadata(constants_1.CONTROLLER_WATERMARK, metatype);
21
+ };
22
+ exports.exploreControllerMetadata = exploreControllerMetadata;
23
+ const exploreGatewayMetadata = (metatype) => {
24
+ return Reflect.getMetadata(GATEWAY_METADATA, metatype);
25
+ };
26
+ exports.exploreGatewayMetadata = exploreGatewayMetadata;
27
+ //# sourceMappingURL=asyncapi-class.explorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-class.explorer.js","sourceRoot":"","sources":["../../../src/explorers/asyncapi-class.explorer.ts"],"names":[],"mappings":";;;AACA,wDAAgE;AAChE,8DAAmD;AAEnD,IAAI,gBAAgB,CAAC;AACrB,IAAI,CAAC;IAEH,MAAM,WAAW,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC5D,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;AAClD,CAAC;AAAC,WAAM,CAAC;IACP,gBAAgB,GAAG,aAAa,CAAC;AACnC,CAAC;AAEY,QAAA,6BAA6B,GAAG,CAAC,+BAAU,CAAC,aAAa,EAAE,gCAAoB,EAAE,gBAAgB,CAAC,CAAC;AAEzG,MAAM,4BAA4B,GAAG,CAAC,QAAuB,EAAE,EAAE;IACtE,OAAO,OAAO,CAAC,WAAW,CAAC,+BAAU,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC,CAAC;AAFW,QAAA,4BAA4B,gCAEvC;AAEK,MAAM,yBAAyB,GAAG,CAAC,QAAuB,EAAE,EAAE;IACnE,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAoB,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEK,MAAM,sBAAsB,GAAG,CAAC,QAAuB,EAAE,EAAE;IAChE,OAAO,OAAO,CAAC,WAAW,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC,CAAC;AAFW,QAAA,sBAAsB,0BAEjC"}
@@ -0,0 +1,17 @@
1
+ import { Type } from '@nestjs/common';
2
+ import { SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
3
+ export declare const exploreAsyncApiOperationMetadata: (schemas: Record<string, SchemaObject>, _instance: object, _prototype: Type<unknown>, method: object) => {
4
+ [x: string]: string | {
5
+ channel: undefined;
6
+ type: undefined;
7
+ operationId?: string;
8
+ summary?: string;
9
+ description?: string;
10
+ tags?: import("../interface").AsyncTagObject[];
11
+ externalDocs?: import("../interface").ExternalDocumentationObject;
12
+ bindings?: Record<string, import("../binding").KafkaOperationBinding | import("../binding").AmqpOperationBinding>;
13
+ traits?: Record<string, import("../interface").AsyncOperationTraitObject>;
14
+ message?: import("../interface").AsyncOperationMessage;
15
+ };
16
+ channel: string;
17
+ }[];
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exploreAsyncApiOperationMetadata = void 0;
4
+ const asyncapi_constants_1 = require("../asyncapi.constants");
5
+ const services_1 = require("../services");
6
+ const operationObjectFactory = new services_1.OperationObjectFactory();
7
+ const exploreAsyncApiOperationMetadata = (schemas, _instance, _prototype, method) => {
8
+ const metadataOperations = Reflect.getMetadata(asyncapi_constants_1.DECORATORS.AsyncApiOperation, method);
9
+ const metadataSubs = Reflect.getMetadata(asyncapi_constants_1.DECORATORS.AsyncApiSub, method);
10
+ const metadataPubs = Reflect.getMetadata(asyncapi_constants_1.DECORATORS.AsyncApiPub, method);
11
+ const metadataCombined = [
12
+ ...(metadataOperations ? Object.values(metadataOperations) : []),
13
+ ...(metadataSubs ? Object.values(metadataSubs) : []),
14
+ ...(metadataPubs ? Object.values(metadataPubs) : []),
15
+ ];
16
+ return metadataCombined.map((option) => {
17
+ const { channel, type } = option;
18
+ const methodTypeData = Object.assign(Object.assign(Object.assign({}, option), operationObjectFactory.create(option, ['application/json'], schemas)), { channel: undefined, type: undefined });
19
+ return {
20
+ channel,
21
+ [type]: methodTypeData,
22
+ };
23
+ });
24
+ };
25
+ exports.exploreAsyncApiOperationMetadata = exploreAsyncApiOperationMetadata;
26
+ //# sourceMappingURL=asyncapi-operation.explorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-operation.explorer.js","sourceRoot":"","sources":["../../../src/explorers/asyncapi-operation.explorer.ts"],"names":[],"mappings":";;;AAEA,8DAAmD;AAEnD,0CAAqD;AAErD,MAAM,sBAAsB,GAAG,IAAI,iCAAsB,EAAE,CAAC;AAErD,MAAM,gCAAgC,GAAG,CAC9C,OAAqC,EACrC,SAAiB,EACjB,UAAyB,EACzB,MAAc,EACd,EAAE;IACF,MAAM,kBAAkB,GAAkC,OAAO,CAAC,WAAW,CAAC,+BAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IACpH,MAAM,YAAY,GAAkC,OAAO,CAAC,WAAW,CAAC,+BAAU,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACxG,MAAM,YAAY,GAAkC,OAAO,CAAC,WAAW,CAAC,+BAAU,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAExG,MAAM,gBAAgB,GAAG;QACvB,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACrD,CAAC;IAEF,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAmC,EAAE,EAAE;QAClE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAEjC,MAAM,cAAc,iDACf,MAAM,GACN,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC,KACvE,OAAO,EAAE,SAAS,EAClB,IAAI,EAAE,SAAS,GAChB,CAAC;QAEF,OAAO;YACL,OAAO;YACP,CAAC,IAAI,CAAC,EAAE,cAAc;SACvB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA/BW,QAAA,gCAAgC,oCA+B3C"}
@@ -0,0 +1,2 @@
1
+ export * from './asyncapi-operation.explorer';
2
+ export * from './asyncapi-class.explorer';
@@ -0,0 +1,19 @@
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-operation.explorer"), exports);
18
+ __exportStar(require("./asyncapi-class.explorer"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/explorers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,4DAA0C"}
@@ -0,0 +1,4 @@
1
+ export * from './asyncapi-document.builder';
2
+ export * from './interface';
3
+ export * from './asyncapi.module';
4
+ export * from './decorators';
@@ -0,0 +1,21 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,8CAA4B;AAC5B,oDAAkC;AAClC,+CAA6B"}
@@ -0,0 +1,126 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=asyncapi-common.interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-common.interfaces.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-common.interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { SwaggerDocumentOptions } from '@nestjs/swagger';
2
+ export interface AsyncApiDocumentOptions extends SwaggerDocumentOptions {
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=asyncapi-document-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncapi-document-options.interface.js","sourceRoot":"","sources":["../../../src/interface/asyncapi-document-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
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[];