@asyncapi-actions-test/trusted-publishing-test_asyncapi-cli 4.1.3

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 (257) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +117 -0
  3. package/assets/create-template/templates/default/asyncapi.yaml +34 -0
  4. package/assets/create-template/templates/default/package-lock.json +4062 -0
  5. package/assets/create-template/templates/default/package.json +10 -0
  6. package/assets/create-template/templates/default/readme.md +4 -0
  7. package/assets/create-template/templates/default/template/index.js +11 -0
  8. package/assets/examples/adeo-kafka-request-reply-asyncapi.yml +298 -0
  9. package/assets/examples/anyof-asyncapi.yml +36 -0
  10. package/assets/examples/application-headers-asyncapi.yml +86 -0
  11. package/assets/examples/correlation-id-asyncapi.yml +180 -0
  12. package/assets/examples/default-example.json +51 -0
  13. package/assets/examples/default-example.yaml +31 -0
  14. package/assets/examples/examples.json +82 -0
  15. package/assets/examples/gitter-streaming-asyncapi.yml +178 -0
  16. package/assets/examples/kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml +388 -0
  17. package/assets/examples/kraken-websocket-request-reply-multiple-channels-asyncapi.yml +394 -0
  18. package/assets/examples/mercure-asyncapi.yml +58 -0
  19. package/assets/examples/not-asyncapi.yml +29 -0
  20. package/assets/examples/oneof-asyncapi.yml +57 -0
  21. package/assets/examples/operation-security-asyncapi.yml +117 -0
  22. package/assets/examples/rpc-client-asyncapi.yml +72 -0
  23. package/assets/examples/rpc-server-asyncapi.yml +69 -0
  24. package/assets/examples/simple-asyncapi.yml +31 -0
  25. package/assets/examples/slack-rtm-asyncapi.yml +982 -0
  26. package/assets/examples/streetlights-kafka-asyncapi.yml +199 -0
  27. package/assets/examples/streetlights-mqtt-asyncapi.yml +253 -0
  28. package/assets/examples/streetlights-operation-security-asyncapi.yml +240 -0
  29. package/assets/examples/tutorial.yml +41 -0
  30. package/assets/examples/websocket-gemini-asyncapi.yml +301 -0
  31. package/assets/logo.png +0 -0
  32. package/assets/server-api.png +0 -0
  33. package/bin/dev +17 -0
  34. package/bin/dev.cmd +3 -0
  35. package/bin/run +12 -0
  36. package/bin/run.cmd +3 -0
  37. package/bin/run_bin +13 -0
  38. package/bin/run_bin.cmd +3 -0
  39. package/lib/apps/api/app.d.ts +15 -0
  40. package/lib/apps/api/app.js +91 -0
  41. package/lib/apps/api/configs/development.json +16 -0
  42. package/lib/apps/api/configs/production.json +16 -0
  43. package/lib/apps/api/configs/test.json +16 -0
  44. package/lib/apps/api/constants.d.ts +1 -0
  45. package/lib/apps/api/constants.js +4 -0
  46. package/lib/apps/api/controllers/bundle.controller.d.ts +7 -0
  47. package/lib/apps/api/controllers/bundle.controller.js +44 -0
  48. package/lib/apps/api/controllers/convert.controller.d.ts +11 -0
  49. package/lib/apps/api/controllers/convert.controller.js +69 -0
  50. package/lib/apps/api/controllers/diff.controller.d.ts +7 -0
  51. package/lib/apps/api/controllers/diff.controller.js +42 -0
  52. package/lib/apps/api/controllers/docs.controller.d.ts +6 -0
  53. package/lib/apps/api/controllers/docs.controller.js +24 -0
  54. package/lib/apps/api/controllers/generate.controller.d.ts +22 -0
  55. package/lib/apps/api/controllers/generate.controller.js +174 -0
  56. package/lib/apps/api/controllers/help.controller.d.ts +6 -0
  57. package/lib/apps/api/controllers/help.controller.js +101 -0
  58. package/lib/apps/api/controllers/parse.controller.d.ts +10 -0
  59. package/lib/apps/api/controllers/parse.controller.js +35 -0
  60. package/lib/apps/api/controllers/validate.controller.d.ts +10 -0
  61. package/lib/apps/api/controllers/validate.controller.js +50 -0
  62. package/lib/apps/api/controllers/version.controller.d.ts +8 -0
  63. package/lib/apps/api/controllers/version.controller.js +69 -0
  64. package/lib/apps/api/exceptions/problem.exception.d.ts +14 -0
  65. package/lib/apps/api/exceptions/problem.exception.js +10 -0
  66. package/lib/apps/api/index.d.ts +10 -0
  67. package/lib/apps/api/index.js +23 -0
  68. package/lib/apps/api/middlewares/logger.middleware.d.ts +2 -0
  69. package/lib/apps/api/middlewares/logger.middleware.js +12 -0
  70. package/lib/apps/api/middlewares/problem.middleware.d.ts +6 -0
  71. package/lib/apps/api/middlewares/problem.middleware.js +27 -0
  72. package/lib/apps/api/middlewares/validation.middleware.d.ts +12 -0
  73. package/lib/apps/api/middlewares/validation.middleware.js +245 -0
  74. package/lib/apps/api/server.d.ts +3 -0
  75. package/lib/apps/api/server.js +19 -0
  76. package/lib/apps/cli/commands/bundle.d.ts +15 -0
  77. package/lib/apps/cli/commands/bundle.js +75 -0
  78. package/lib/apps/cli/commands/config/analytics.d.ts +11 -0
  79. package/lib/apps/cli/commands/config/analytics.js +61 -0
  80. package/lib/apps/cli/commands/config/auth/add.d.ts +13 -0
  81. package/lib/apps/cli/commands/config/auth/add.js +68 -0
  82. package/lib/apps/cli/commands/config/context/add.d.ts +13 -0
  83. package/lib/apps/cli/commands/config/context/add.js +46 -0
  84. package/lib/apps/cli/commands/config/context/current.d.ts +8 -0
  85. package/lib/apps/cli/commands/config/context/current.js +37 -0
  86. package/lib/apps/cli/commands/config/context/edit.d.ts +12 -0
  87. package/lib/apps/cli/commands/config/context/edit.js +44 -0
  88. package/lib/apps/cli/commands/config/context/index.d.ts +5 -0
  89. package/lib/apps/cli/commands/config/context/index.js +16 -0
  90. package/lib/apps/cli/commands/config/context/init.d.ts +12 -0
  91. package/lib/apps/cli/commands/config/context/init.js +31 -0
  92. package/lib/apps/cli/commands/config/context/list.d.ts +8 -0
  93. package/lib/apps/cli/commands/config/context/list.js +36 -0
  94. package/lib/apps/cli/commands/config/context/remove.d.ts +11 -0
  95. package/lib/apps/cli/commands/config/context/remove.js +39 -0
  96. package/lib/apps/cli/commands/config/context/use.d.ts +11 -0
  97. package/lib/apps/cli/commands/config/context/use.js +40 -0
  98. package/lib/apps/cli/commands/config/index.d.ts +5 -0
  99. package/lib/apps/cli/commands/config/index.js +16 -0
  100. package/lib/apps/cli/commands/config/versions.d.ts +8 -0
  101. package/lib/apps/cli/commands/config/versions.js +56 -0
  102. package/lib/apps/cli/commands/convert.d.ts +21 -0
  103. package/lib/apps/cli/commands/convert.js +85 -0
  104. package/lib/apps/cli/commands/diff.d.ts +36 -0
  105. package/lib/apps/cli/commands/diff.js +335 -0
  106. package/lib/apps/cli/commands/format.d.ts +18 -0
  107. package/lib/apps/cli/commands/format.js +97 -0
  108. package/lib/apps/cli/commands/generate/client.d.ts +30 -0
  109. package/lib/apps/cli/commands/generate/client.js +94 -0
  110. package/lib/apps/cli/commands/generate/fromTemplate.d.ts +29 -0
  111. package/lib/apps/cli/commands/generate/fromTemplate.js +91 -0
  112. package/lib/apps/cli/commands/generate/index.d.ts +5 -0
  113. package/lib/apps/cli/commands/generate/index.js +15 -0
  114. package/lib/apps/cli/commands/generate/models.d.ts +16 -0
  115. package/lib/apps/cli/commands/generate/models.js +166 -0
  116. package/lib/apps/cli/commands/new/file.d.ts +16 -0
  117. package/lib/apps/cli/commands/new/file.js +180 -0
  118. package/lib/apps/cli/commands/new/index.d.ts +5 -0
  119. package/lib/apps/cli/commands/new/index.js +15 -0
  120. package/lib/apps/cli/commands/new/template.d.ts +18 -0
  121. package/lib/apps/cli/commands/new/template.js +102 -0
  122. package/lib/apps/cli/commands/optimize.d.ts +41 -0
  123. package/lib/apps/cli/commands/optimize.js +289 -0
  124. package/lib/apps/cli/commands/pretty.d.ts +12 -0
  125. package/lib/apps/cli/commands/pretty.js +70 -0
  126. package/lib/apps/cli/commands/start/api.d.ts +11 -0
  127. package/lib/apps/cli/commands/start/api.js +23 -0
  128. package/lib/apps/cli/commands/start/index.d.ts +5 -0
  129. package/lib/apps/cli/commands/start/index.js +15 -0
  130. package/lib/apps/cli/commands/start/preview.d.ts +17 -0
  131. package/lib/apps/cli/commands/start/preview.js +41 -0
  132. package/lib/apps/cli/commands/start/studio.d.ts +16 -0
  133. package/lib/apps/cli/commands/start/studio.js +94 -0
  134. package/lib/apps/cli/commands/validate.d.ts +23 -0
  135. package/lib/apps/cli/commands/validate.js +95 -0
  136. package/lib/apps/cli/internal/args/generate.args.d.ts +3 -0
  137. package/lib/apps/cli/internal/args/generate.args.js +10 -0
  138. package/lib/apps/cli/internal/base/BaseGeneratorCommand.d.ts +42 -0
  139. package/lib/apps/cli/internal/base/BaseGeneratorCommand.js +119 -0
  140. package/lib/apps/cli/internal/base.d.ts +20 -0
  141. package/lib/apps/cli/internal/base.js +173 -0
  142. package/lib/apps/cli/internal/flags/bundle.flags.d.ts +7 -0
  143. package/lib/apps/cli/internal/flags/bundle.flags.js +26 -0
  144. package/lib/apps/cli/internal/flags/config/analytics.flags.d.ts +6 -0
  145. package/lib/apps/cli/internal/flags/config/analytics.flags.js +24 -0
  146. package/lib/apps/cli/internal/flags/config/context.flags.d.ts +4 -0
  147. package/lib/apps/cli/internal/flags/config/context.flags.js +16 -0
  148. package/lib/apps/cli/internal/flags/convert.flags.d.ts +7 -0
  149. package/lib/apps/cli/internal/flags/convert.flags.js +32 -0
  150. package/lib/apps/cli/internal/flags/diff.flags.d.ts +13 -0
  151. package/lib/apps/cli/internal/flags/diff.flags.js +29 -0
  152. package/lib/apps/cli/internal/flags/format.flags.d.ts +6 -0
  153. package/lib/apps/cli/internal/flags/format.flags.js +22 -0
  154. package/lib/apps/cli/internal/flags/generate/clients.flags.d.ts +16 -0
  155. package/lib/apps/cli/internal/flags/generate/clients.flags.js +8 -0
  156. package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.d.ts +16 -0
  157. package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.js +8 -0
  158. package/lib/apps/cli/internal/flags/generate/models.flags.d.ts +1 -0
  159. package/lib/apps/cli/internal/flags/generate/models.flags.js +14 -0
  160. package/lib/apps/cli/internal/flags/generate/sharedFlags.d.ts +16 -0
  161. package/lib/apps/cli/internal/flags/generate/sharedFlags.js +57 -0
  162. package/lib/apps/cli/internal/flags/global.flags.d.ts +4 -0
  163. package/lib/apps/cli/internal/flags/global.flags.js +18 -0
  164. package/lib/apps/cli/internal/flags/new/file.flags.d.ts +8 -0
  165. package/lib/apps/cli/internal/flags/new/file.flags.js +20 -0
  166. package/lib/apps/cli/internal/flags/new/template.flags.d.ts +7 -0
  167. package/lib/apps/cli/internal/flags/new/template.flags.js +28 -0
  168. package/lib/apps/cli/internal/flags/optimize.flags.d.ts +21 -0
  169. package/lib/apps/cli/internal/flags/optimize.flags.js +51 -0
  170. package/lib/apps/cli/internal/flags/parser.flags.d.ts +10 -0
  171. package/lib/apps/cli/internal/flags/parser.flags.js +28 -0
  172. package/lib/apps/cli/internal/flags/pretty.flags.d.ts +3 -0
  173. package/lib/apps/cli/internal/flags/pretty.flags.js +13 -0
  174. package/lib/apps/cli/internal/flags/proxy.flags.d.ts +4 -0
  175. package/lib/apps/cli/internal/flags/proxy.flags.js +17 -0
  176. package/lib/apps/cli/internal/flags/start/api.flags.d.ts +5 -0
  177. package/lib/apps/cli/internal/flags/start/api.flags.js +20 -0
  178. package/lib/apps/cli/internal/flags/start/preview.flags.d.ts +9 -0
  179. package/lib/apps/cli/internal/flags/start/preview.flags.js +32 -0
  180. package/lib/apps/cli/internal/flags/start/studio.flags.d.ts +7 -0
  181. package/lib/apps/cli/internal/flags/start/studio.flags.js +25 -0
  182. package/lib/apps/cli/internal/flags/validate.flags.d.ts +11 -0
  183. package/lib/apps/cli/internal/flags/validate.flags.js +22 -0
  184. package/lib/apps/cli/internal/globals.d.ts +10 -0
  185. package/lib/apps/cli/internal/globals.js +46 -0
  186. package/lib/apps/cli/internal/hooks/command_not_found/myhook.d.ts +4 -0
  187. package/lib/apps/cli/internal/hooks/command_not_found/myhook.js +85 -0
  188. package/lib/domains/models/Context.d.ts +21 -0
  189. package/lib/domains/models/Context.js +321 -0
  190. package/lib/domains/models/Preview.d.ts +2 -0
  191. package/lib/domains/models/Preview.js +227 -0
  192. package/lib/domains/models/SpecificationFile.d.ts +40 -0
  193. package/lib/domains/models/SpecificationFile.js +295 -0
  194. package/lib/domains/models/Studio.d.ts +2 -0
  195. package/lib/domains/models/Studio.js +182 -0
  196. package/lib/domains/models/generate/ClientLanguages.d.ts +12 -0
  197. package/lib/domains/models/generate/ClientLanguages.js +17 -0
  198. package/lib/domains/models/generate/Flags.d.ts +9 -0
  199. package/lib/domains/models/generate/Flags.js +2 -0
  200. package/lib/domains/services/archiver.service.d.ts +17 -0
  201. package/lib/domains/services/archiver.service.js +53 -0
  202. package/lib/domains/services/base.service.d.ts +6 -0
  203. package/lib/domains/services/base.service.js +26 -0
  204. package/lib/domains/services/config.service.d.ts +42 -0
  205. package/lib/domains/services/config.service.js +95 -0
  206. package/lib/domains/services/convert.service.d.ts +12 -0
  207. package/lib/domains/services/convert.service.js +65 -0
  208. package/lib/domains/services/generator.service.d.ts +15 -0
  209. package/lib/domains/services/generator.service.js +75 -0
  210. package/lib/domains/services/validation.service.d.ts +54 -0
  211. package/lib/domains/services/validation.service.js +375 -0
  212. package/lib/errors/context-error.d.ts +26 -0
  213. package/lib/errors/context-error.js +71 -0
  214. package/lib/errors/diff-error.d.ts +9 -0
  215. package/lib/errors/diff-error.js +27 -0
  216. package/lib/errors/generator-error.d.ts +3 -0
  217. package/lib/errors/generator-error.js +11 -0
  218. package/lib/errors/specification-file.d.ts +18 -0
  219. package/lib/errors/specification-file.js +65 -0
  220. package/lib/errors/validation-error.d.ts +11 -0
  221. package/lib/errors/validation-error.js +55 -0
  222. package/lib/index.d.ts +1 -0
  223. package/lib/index.js +11 -0
  224. package/lib/interfaces/index.d.ts +87 -0
  225. package/lib/interfaces/index.js +7 -0
  226. package/lib/utils/ajv.d.ts +2 -0
  227. package/lib/utils/ajv.js +18 -0
  228. package/lib/utils/app-openapi.d.ts +4 -0
  229. package/lib/utils/app-openapi.js +28 -0
  230. package/lib/utils/generate/flags.d.ts +2 -0
  231. package/lib/utils/generate/flags.js +14 -0
  232. package/lib/utils/generate/mapBaseUrl.d.ts +6 -0
  233. package/lib/utils/generate/mapBaseUrl.js +34 -0
  234. package/lib/utils/generate/parseParams.d.ts +3 -0
  235. package/lib/utils/generate/parseParams.js +58 -0
  236. package/lib/utils/generate/prompts.d.ts +4 -0
  237. package/lib/utils/generate/prompts.js +77 -0
  238. package/lib/utils/generate/registry.d.ts +2 -0
  239. package/lib/utils/generate/registry.js +30 -0
  240. package/lib/utils/generate/watcher.d.ts +51 -0
  241. package/lib/utils/generate/watcher.js +230 -0
  242. package/lib/utils/logger.d.ts +6 -0
  243. package/lib/utils/logger.js +33 -0
  244. package/lib/utils/retrieve-language.d.ts +1 -0
  245. package/lib/utils/retrieve-language.js +9 -0
  246. package/lib/utils/scoreCalculator.d.ts +2 -0
  247. package/lib/utils/scoreCalculator.js +22 -0
  248. package/lib/utils/temp-dir.d.ts +2 -0
  249. package/lib/utils/temp-dir.js +26 -0
  250. package/oclif.manifest.json +2137 -0
  251. package/openapi.yaml +713 -0
  252. package/package.json +203 -0
  253. package/scripts/enableAutoComplete.js +160 -0
  254. package/scripts/fetch-asyncapi-example.js +126 -0
  255. package/scripts/generateTypesForGenerateCommand.js +40 -0
  256. package/scripts/releasePackagesRename.js +88 -0
  257. package/scripts/updateUsageDocs.js +73 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "myTemplate",
3
+ "generator": {
4
+ "renderer": "react",
5
+ "supportedProtocols": []
6
+ },
7
+ "dependencies": {
8
+ "@asyncapi/generator-react-sdk": "^1.1.2"
9
+ }
10
+ }
@@ -0,0 +1,4 @@
1
+ ### First install all the dependencies for template using below command:
2
+ npm install
3
+ ### Run the template using for a specific asyncapi document
4
+ asyncapi generate fromTemplate <templateName> ../asyncapi-template
@@ -0,0 +1,11 @@
1
+ import { File, Text } from '@asyncapi/generator-react-sdk';
2
+
3
+ // Pass the others parameters to get the specificatin of the asyncapi document
4
+ export default function ({ asyncapi }) {
5
+ return (
6
+ <File name="asyncapi.md">
7
+ <Text>My application's markdown file.</Text>
8
+ <Text>App name: **{asyncapi.info().title()}**</Text>
9
+ </File>
10
+ );
11
+ }
@@ -0,0 +1,298 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: Adeo AsyncAPI Case Study
4
+ version: '%REPLACED_BY_MAVEN%'
5
+ description: >
6
+ This Adeo specification illustrates how ADEO uses AsyncAPI to document some
7
+ of their exchanges.
8
+ contact:
9
+ name: AsyncAPI Community
10
+ email: case-study@asyncapi.com
11
+ tags:
12
+ - name: costing
13
+ description: Costing channels, used by Costing clients.
14
+ servers:
15
+ production:
16
+ host: prod.url:9092
17
+ protocol: kafka
18
+ description: Kafka PRODUCTION cluster
19
+ security:
20
+ - $ref: '#/components/securitySchemes/sasl-ssl'
21
+ bindings:
22
+ kafka:
23
+ schemaRegistryUrl: https://schema-registry.prod.url/
24
+ staging:
25
+ host: staging.url:9092
26
+ protocol: kafka
27
+ description: Kafka STAGING cluster for `uat` and `preprod` environments
28
+ security:
29
+ - $ref: '#/components/securitySchemes/sasl-ssl'
30
+ bindings:
31
+ kafka:
32
+ schemaRegistryUrl: https://schema-registry.prod.url/
33
+ dev:
34
+ host: dev.url:9092
35
+ protocol: kafka
36
+ description: Kafka DEV cluster for `dev` and `sit` environments
37
+ security:
38
+ - $ref: '#/components/securitySchemes/sasl-ssl'
39
+ bindings:
40
+ kafka:
41
+ schemaRegistryUrl: https://schema-registry.prod.url/
42
+ channels:
43
+ costingRequestChannel:
44
+ address: adeo-{env}-case-study-COSTING-REQUEST-{version}
45
+ description: >
46
+ Use this topic to do a Costing Request to Costing product. We use the
47
+ [**RecordNameStrategy**](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy)
48
+ to infer the messages schema. You have to define
49
+ `value.subject.name.strategy` to
50
+ `io.confluent.kafka.serializers.subject.RecordNameStrategy` in your
51
+ producer to use the schema we manage. The schema below illustrates how
52
+ Costing Request messages are handled.
53
+ ![](https://user-images.githubusercontent.com/5501911/188920831-689cec5f-8dc3-460b-8794-0b54ec8b0ac8.png)
54
+ parameters:
55
+ env:
56
+ $ref: '#/components/parameters/Env'
57
+ version:
58
+ $ref: '#/components/parameters/Version'
59
+ bindings:
60
+ kafka:
61
+ replicas: 3
62
+ partitions: 3
63
+ topicConfiguration:
64
+ cleanup.policy:
65
+ - delete
66
+ retention.ms: 60000000
67
+ messages:
68
+ CostingRequest:
69
+ $ref: '#/components/messages/costingRequestV1'
70
+ costingResponseChannel:
71
+ address: null
72
+ description: >
73
+ This topic is used to REPLY Costing Requests and is targeted by the
74
+ `REPLY_TOPIC` header. **You must grant PUBLISH access to our `svc-ccr-app`
75
+ service account.**. We use the
76
+ [**RecordNameStrategy**](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy)
77
+ to infer the messages schema.
78
+
79
+ Topic should follow pattern "adeo-{env}-case-study-COSTING-RESPONSE-{version}"
80
+
81
+ You have to define
82
+ `key.subject.name.strategy` and `value.subject.name.strategy` to
83
+ `io.confluent.kafka.serializers.subject.RecordNameStrategy` in your
84
+ consumer. The schema below illustrates how Costing Response messages are
85
+ handled.
86
+ ![](https://user-images.githubusercontent.com/5501911/188920831-689cec5f-8dc3-460b-8794-0b54ec8b0ac8.png)
87
+
88
+ bindings:
89
+ kafka:
90
+ x-key.subject.name.strategy:
91
+ type: string
92
+ description: >
93
+ We use the RecordNameStrategy to infer the messages schema. Use
94
+ `key.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
95
+ in your consumer configuration.
96
+ x-value.subject.name.strategy:
97
+ type: string
98
+ description: >
99
+ We use the RecordNameStrategy to infer the messages schema. Use
100
+ `value.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
101
+ in your consumer configuration.
102
+ tags:
103
+ - name: costing
104
+ messages:
105
+ costingResponse:
106
+ $ref: '#/components/messages/costingResponse'
107
+ operations:
108
+ receiveACostingRequest:
109
+ action: receive
110
+ channel:
111
+ $ref: '#/channels/costingRequestChannel'
112
+ reply:
113
+ channel:
114
+ $ref: '#/channels/costingResponseChannel'
115
+ address:
116
+ location: $message.header#/REPLY_TOPIC
117
+ summary: |
118
+ [COSTING] Request one or more Costing calculation for any product
119
+ description: >
120
+ You can try a costing request using our [Conduktor producer
121
+ template](https://conduktor.url/)
122
+ tags:
123
+ - name: costing
124
+ bindings:
125
+ kafka:
126
+ groupId:
127
+ type: string
128
+ description: >
129
+ The groupId must be prefixed by your `svc` account, deliver by the
130
+ Adeo Kafka team. This `svc` must have the write access to the topic.
131
+ x-value.subject.name.strategy:
132
+ type: string
133
+ description: >
134
+ We use the RecordNameStrategy to infer the messages schema. Use
135
+ `value.subject.name.strategy=io.confluent.kafka.serializers.subject.RecordNameStrategy`
136
+ in your producer configuration.
137
+
138
+ components:
139
+ correlationIds:
140
+ costingCorrelationId:
141
+ description: >
142
+ This correlation ID is used for message tracing and messages
143
+ correlation. This correlation ID is generated at runtime based on the
144
+ `REQUEST_ID` and sent to the RESPONSE message.
145
+ location: $message.header#/REQUEST_ID
146
+ messages:
147
+ costingRequestV1:
148
+ name: CostingRequestV1
149
+ title: Costing Request V1
150
+ summary: Costing Request V1 inputs.
151
+ tags:
152
+ - name: costing
153
+ correlationId:
154
+ $ref: '#/components/correlationIds/costingCorrelationId'
155
+ headers:
156
+ type: object
157
+ required:
158
+ - REQUESTER_ID
159
+ - REQUESTER_CODE
160
+ - REQUEST_ID
161
+ - REPLY_TOPIC
162
+ properties:
163
+ REQUEST_ID:
164
+ $ref: '#/components/schemas/RequestId'
165
+ REPLY_TOPIC:
166
+ $ref: '#/components/schemas/ReplyTopic'
167
+ REQUESTER_ID:
168
+ $ref: '#/components/schemas/RequesterId'
169
+ REQUESTER_CODE:
170
+ $ref: '#/components/schemas/RequesterCode'
171
+ payload:
172
+ schemaFormat: application/vnd.apache.avro;version=1.9.0
173
+ schema:
174
+ $ref: https://www.asyncapi.com/resources/casestudies/adeo/CostingRequestPayload.avsc
175
+ costingResponse:
176
+ name: CostingResponse
177
+ title: Costing Response
178
+ summary: Costing Response ouputs.
179
+ tags:
180
+ - name: costing
181
+ description: >
182
+ Please refer to the `CostingResponseKey.avsc` schema, available on [our
183
+ github project](https://github.url/).
184
+ correlationId:
185
+ $ref: '#/components/correlationIds/costingCorrelationId'
186
+ headers:
187
+ type: object
188
+ properties:
189
+ CALCULATION_ID:
190
+ $ref: '#/components/schemas/MessageId'
191
+ CORRELATION_ID:
192
+ $ref: '#/components/schemas/CorrelationId'
193
+ REQUEST_TIMESTAMP:
194
+ type: string
195
+ format: date-time
196
+ description: Timestamp of the costing request
197
+ CALCULATION_TIMESTAMP:
198
+ type: string
199
+ format: date-time
200
+ description: Technical timestamp for the costing calculation
201
+ payload:
202
+ schemaFormat: application/vnd.apache.avro;version=1.9.0
203
+ schema:
204
+ $ref: https://www.asyncapi.com/resources/casestudies/adeo/CostingResponsePayload.avsc
205
+ schemas:
206
+ RequesterId:
207
+ type: string
208
+ description: The Costing requester service account used to produce costing request.
209
+ examples:
210
+ - svc-ecollect-app
211
+ RequesterCode:
212
+ type: string
213
+ description: >-
214
+ The Costing requester code (generally the BU Code). The requester code
215
+ is useful to get the dedicated context (tenant).
216
+ examples:
217
+ - 1
218
+ MessageId:
219
+ type: string
220
+ format: uuid
221
+ description: A unique Message ID.
222
+ examples:
223
+ - 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
224
+ RequestId:
225
+ type: string
226
+ format: uuid
227
+ description: >-
228
+ A unique Request ID needed to define a `CORRELATION_ID` for exchanges,
229
+ which will be sent back in the Costing Responses.
230
+ examples:
231
+ - 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
232
+ CorrelationId:
233
+ type: string
234
+ format: uuid
235
+ description: >-
236
+ A unique Correlation ID defined from the `REQUEST_ID` or the
237
+ `MESSAGE_ID` provided in the Costing Request.
238
+ examples:
239
+ - 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef
240
+ BuCode:
241
+ type: string
242
+ description: The Business Unit code for which data are applicable.
243
+ examples:
244
+ - 1
245
+ ReplyTopic:
246
+ type: string
247
+ description: >
248
+ The Kafka topic where to send the Costing Response. This is required for
249
+ the [Return Address EIP
250
+ pattern](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ReturnAddress.html).
251
+ **You must grant WRITE access to our `svc-ccr-app` service account.**
252
+ examples:
253
+ - adeo-case-study-COSTING-RESPONSE-V1
254
+ ErrorStep:
255
+ type: string
256
+ description: |
257
+ The woker that has thrown the error.
258
+ examples:
259
+ - EXPOSE_RESULT
260
+ ErrorMessage:
261
+ type: string
262
+ description: |
263
+ The error message describing the error.
264
+ examples:
265
+ - Error message
266
+ ErrorCode:
267
+ type: string
268
+ description: |
269
+ The error code.
270
+ examples:
271
+ - CURRENCY_NOT_FOUND
272
+ parameters:
273
+ Env:
274
+ description: Adeo Kafka Environement for messages publications.
275
+ enum:
276
+ - dev
277
+ - sit
278
+ - uat1
279
+ - preprod
280
+ - prod
281
+ Version:
282
+ description: the topic version you want to use
283
+ examples:
284
+ - V1
285
+ default: V1
286
+ securitySchemes:
287
+ sasl-ssl:
288
+ type: plain
289
+ x-sasl.jaas.config: >-
290
+ org.apache.kafka.common.security.plain.PlainLoginModule required
291
+ username="<CLUSTER_API_KEY>" password="<CLUSTER_API_SECRET>";
292
+ x-security.protocol: SASL_SSL
293
+ x-ssl.endpoint.identification.algorithm: https
294
+ x-sasl.mechanism: PLAIN
295
+ description: >
296
+ Use [SASL authentication with SSL
297
+ encryption](https://docs.confluent.io/platform/current/security/security_tutorial.html#configure-clients)
298
+ to connect to the ADEO Broker.
@@ -0,0 +1,36 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: AnyOf example
4
+ version: 1.0.0
5
+ channels:
6
+ test:
7
+ address: test
8
+ messages:
9
+ testMessages:
10
+ $ref: '#/components/messages/testMessages'
11
+ operations:
12
+ test:
13
+ action: receive
14
+ channel:
15
+ $ref: '#/channels/test'
16
+ messages:
17
+ - $ref: '#/channels/test/messages/testMessages'
18
+ components:
19
+ messages:
20
+ testMessages:
21
+ payload:
22
+ anyOf:
23
+ - $ref: '#/components/schemas/objectWithKey'
24
+ - $ref: '#/components/schemas/objectWithKey2'
25
+ schemas:
26
+ objectWithKey:
27
+ type: object
28
+ properties:
29
+ key:
30
+ type: string
31
+ additionalProperties: false
32
+ objectWithKey2:
33
+ type: object
34
+ properties:
35
+ key2:
36
+ type: string
@@ -0,0 +1,86 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: Application Headers example
4
+ version: 1.0.0
5
+ description: A cut of the Streetlights API to test application header changes supporting
6
+ license:
7
+ name: Apache 2.0
8
+ url: 'https://www.apache.org/licenses/LICENSE-2.0'
9
+ defaultContentType: application/json
10
+ servers:
11
+ production:
12
+ host: 'test.mosquitto.org:{port}'
13
+ protocol: mqtt
14
+ description: Test broker
15
+ variables:
16
+ port:
17
+ description: Secure connection (TLS) is available through port 8883.
18
+ default: '1883'
19
+ enum:
20
+ - '1883'
21
+ - '8883'
22
+ channels:
23
+ lightingMeasured:
24
+ address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
25
+ messages:
26
+ lightMeasured:
27
+ $ref: '#/components/messages/lightMeasured'
28
+ parameters:
29
+ streetlightId:
30
+ $ref: '#/components/parameters/streetlightId'
31
+ operations:
32
+ receiveLightMeasurement:
33
+ action: receive
34
+ channel:
35
+ $ref: '#/channels/lightingMeasured'
36
+ summary: >-
37
+ Inform about environmental lighting conditions of a particular
38
+ streetlight.
39
+ messages:
40
+ - $ref: '#/channels/lightingMeasured/messages/lightMeasured'
41
+ components:
42
+ messages:
43
+ lightMeasured:
44
+ name: lightMeasured
45
+ title: Light measured
46
+ summary: >-
47
+ Inform about environmental lighting conditions of a particular
48
+ streetlight.
49
+ correlationId:
50
+ location: $message.header#/MQMD/CorrelId
51
+ contentType: application/json
52
+ headers:
53
+ type: object
54
+ properties:
55
+ MQMD:
56
+ type: object
57
+ properties:
58
+ CorrelId:
59
+ type: string
60
+ minLength: 24
61
+ maxLength: 24
62
+ format: binary
63
+ applicationInstanceId:
64
+ $ref: '#/components/schemas/applicationInstanceId'
65
+ payload:
66
+ $ref: '#/components/schemas/lightMeasuredPayload'
67
+ schemas:
68
+ lightMeasuredPayload:
69
+ type: object
70
+ properties:
71
+ lumens:
72
+ type: integer
73
+ minimum: 0
74
+ description: Light intensity measured in lumens.
75
+ sentAt:
76
+ $ref: '#/components/schemas/sentAt'
77
+ sentAt:
78
+ type: string
79
+ format: date-time
80
+ description: Date and time when the message was sent.
81
+ applicationInstanceId:
82
+ description: Unique identifier for a given instance of the publishing application
83
+ type: string
84
+ parameters:
85
+ streetlightId:
86
+ description: The ID of the streetlight.
@@ -0,0 +1,180 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: Correlation ID Example
4
+ version: 1.0.0
5
+ description: A cut of the Streetlights API to test Correlation ID
6
+ license:
7
+ name: Apache 2.0
8
+ url: 'https://www.apache.org/licenses/LICENSE-2.0'
9
+ defaultContentType: application/json
10
+ servers:
11
+ production:
12
+ host: 'test.mosquitto.org:{port}'
13
+ protocol: mqtt
14
+ description: Test broker
15
+ variables:
16
+ port:
17
+ description: Secure connection (TLS) is available through port 8883.
18
+ default: '1883'
19
+ enum:
20
+ - '1883'
21
+ - '8883'
22
+ security:
23
+ - $ref: '#/components/securitySchemes/apiKey'
24
+ - type: oauth2
25
+ description: Flows to support OAuth 2.0
26
+ flows:
27
+ implicit:
28
+ authorizationUrl: 'https://authserver.example/auth'
29
+ availableScopes:
30
+ 'streetlights:on': Ability to switch lights on
31
+ 'streetlights:off': Ability to switch lights off
32
+ 'streetlights:dim': Ability to dim the lights
33
+ password:
34
+ tokenUrl: 'https://authserver.example/token'
35
+ availableScopes:
36
+ 'streetlights:on': Ability to switch lights on
37
+ 'streetlights:off': Ability to switch lights off
38
+ 'streetlights:dim': Ability to dim the lights
39
+ clientCredentials:
40
+ tokenUrl: 'https://authserver.example/token'
41
+ availableScopes:
42
+ 'streetlights:on': Ability to switch lights on
43
+ 'streetlights:off': Ability to switch lights off
44
+ 'streetlights:dim': Ability to dim the lights
45
+ authorizationCode:
46
+ authorizationUrl: 'https://authserver.example/auth'
47
+ tokenUrl: 'https://authserver.example/token'
48
+ refreshUrl: 'https://authserver.example/refresh'
49
+ availableScopes:
50
+ 'streetlights:on': Ability to switch lights on
51
+ 'streetlights:off': Ability to switch lights off
52
+ 'streetlights:dim': Ability to dim the lights
53
+ scopes:
54
+ - 'streetlights:on'
55
+ - 'streetlights:off'
56
+ - 'streetlights:dim'
57
+ - $ref: '#/components/securitySchemes/openIdConnectWellKnown'
58
+ channels:
59
+ lightingMeasured:
60
+ address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured'
61
+ messages:
62
+ lightMeasured:
63
+ $ref: '#/components/messages/lightMeasured'
64
+ parameters:
65
+ streetlightId:
66
+ $ref: '#/components/parameters/streetlightId'
67
+ lightsDim:
68
+ address: 'smartylighting/streetlights/1/0/action/{streetlightId}/dim'
69
+ messages:
70
+ dimLight:
71
+ $ref: '#/components/messages/dimLight'
72
+ parameters:
73
+ streetlightId:
74
+ $ref: '#/components/parameters/streetlightId'
75
+ operations:
76
+ receiveLightMeasurement:
77
+ action: receive
78
+ channel:
79
+ $ref: '#/channels/lightingMeasured'
80
+ summary: >-
81
+ Inform about environmental lighting conditions of a particular
82
+ streetlight.
83
+ messages:
84
+ - $ref: '#/channels/lightingMeasured/messages/lightMeasured'
85
+ dimLight:
86
+ action: send
87
+ channel:
88
+ $ref: '#/channels/lightsDim'
89
+ messages:
90
+ - $ref: '#/channels/lightsDim/messages/dimLight'
91
+ components:
92
+ messages:
93
+ lightMeasured:
94
+ name: lightMeasured
95
+ title: Light measured
96
+ summary: >-
97
+ Inform about environmental lighting conditions of a particular
98
+ streetlight.
99
+ correlationId:
100
+ location: $message.header#/MQMD/CorrelId
101
+ contentType: application/json
102
+ payload:
103
+ $ref: '#/components/schemas/lightMeasuredPayload'
104
+ dimLight:
105
+ name: dimLight
106
+ title: Dim light
107
+ summary: Command a particular streetlight to dim the lights.
108
+ correlationId:
109
+ $ref: '#/components/correlationIds/sentAtCorrelator'
110
+ payload:
111
+ $ref: '#/components/schemas/dimLightPayload'
112
+ schemas:
113
+ lightMeasuredPayload:
114
+ type: object
115
+ properties:
116
+ lumens:
117
+ type: integer
118
+ minimum: 0
119
+ description: Light intensity measured in lumens.
120
+ sentAt:
121
+ $ref: '#/components/schemas/sentAt'
122
+ dimLightPayload:
123
+ type: object
124
+ properties:
125
+ percentage:
126
+ type: integer
127
+ description: Percentage to which the light should be dimmed to.
128
+ minimum: 0
129
+ maximum: 100
130
+ sentAt:
131
+ $ref: '#/components/schemas/sentAt'
132
+ sentAt:
133
+ type: string
134
+ format: date-time
135
+ description: Date and time when the message was sent.
136
+ parameters:
137
+ streetlightId:
138
+ description: The ID of the streetlight.
139
+ correlationIds:
140
+ sentAtCorrelator:
141
+ description: Data from message payload used as correlation ID
142
+ location: $message.payload#/sentAt
143
+ securitySchemes:
144
+ apiKey:
145
+ type: apiKey
146
+ in: user
147
+ description: Provide your API key as the user and leave the password empty.
148
+ supportedOauthFlows:
149
+ type: oauth2
150
+ description: Flows to support OAuth 2.0
151
+ flows:
152
+ implicit:
153
+ authorizationUrl: 'https://authserver.example/auth'
154
+ availableScopes:
155
+ 'streetlights:on': Ability to switch lights on
156
+ 'streetlights:off': Ability to switch lights off
157
+ 'streetlights:dim': Ability to dim the lights
158
+ password:
159
+ tokenUrl: 'https://authserver.example/token'
160
+ availableScopes:
161
+ 'streetlights:on': Ability to switch lights on
162
+ 'streetlights:off': Ability to switch lights off
163
+ 'streetlights:dim': Ability to dim the lights
164
+ clientCredentials:
165
+ tokenUrl: 'https://authserver.example/token'
166
+ availableScopes:
167
+ 'streetlights:on': Ability to switch lights on
168
+ 'streetlights:off': Ability to switch lights off
169
+ 'streetlights:dim': Ability to dim the lights
170
+ authorizationCode:
171
+ authorizationUrl: 'https://authserver.example/auth'
172
+ tokenUrl: 'https://authserver.example/token'
173
+ refreshUrl: 'https://authserver.example/refresh'
174
+ availableScopes:
175
+ 'streetlights:on': Ability to switch lights on
176
+ 'streetlights:off': Ability to switch lights off
177
+ 'streetlights:dim': Ability to dim the lights
178
+ openIdConnectWellKnown:
179
+ type: openIdConnect
180
+ openIdConnectUrl: 'https://authserver.example/.well-known'
@@ -0,0 +1,51 @@
1
+ {
2
+ "asyncapi": "3.0.0",
3
+ "info": {
4
+ "title": "Account Service",
5
+ "version": "1.0.0",
6
+ "description": "This service is in charge of processing user signups"
7
+ },
8
+ "channels": {
9
+ "userSignedUp": {
10
+ "address": "user/signedup",
11
+ "messages": {
12
+ "UserSignedUp": {
13
+ "$ref": "#/components/messages/UserSignedUp"
14
+ }
15
+ }
16
+ }
17
+ },
18
+ "operations": {
19
+ "onUserSignUp": {
20
+ "action": "receive",
21
+ "channel": {
22
+ "$ref": "#/channels/userSignedUp"
23
+ },
24
+ "messages": [
25
+ {
26
+ "$ref": "#/channels/userSignedUp/messages/UserSignedUp"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ "components": {
32
+ "messages": {
33
+ "UserSignedUp": {
34
+ "payload": {
35
+ "type": "object",
36
+ "properties": {
37
+ "displayName": {
38
+ "type": "string",
39
+ "description": "Name of the user"
40
+ },
41
+ "email": {
42
+ "type": "string",
43
+ "format": "email",
44
+ "description": "Email of the user"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }