@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,31 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: Account Service
4
+ version: 1.0.0
5
+ description: This service is in charge of processing user signups
6
+ channels:
7
+ userSignedUp:
8
+ address: user/signedup
9
+ messages:
10
+ UserSignedUp:
11
+ $ref: '#/components/messages/UserSignedUp'
12
+ operations:
13
+ onUserSignUp:
14
+ action: receive
15
+ channel:
16
+ $ref: '#/channels/userSignedUp'
17
+ messages:
18
+ - $ref: '#/channels/userSignedUp/messages/UserSignedUp'
19
+ components:
20
+ messages:
21
+ UserSignedUp:
22
+ payload:
23
+ type: object
24
+ properties:
25
+ displayName:
26
+ type: string
27
+ description: Name of the user
28
+ email:
29
+ type: string
30
+ format: email
31
+ description: Email of the user
@@ -0,0 +1,82 @@
1
+ [
2
+ {
3
+ "name": "Account Service",
4
+ "value": "simple-asyncapi.yml"
5
+ },
6
+ {
7
+ "name": "Adeo AsyncAPI Case Study - (protocols: kafka,kafka,kafka)",
8
+ "value": "adeo-kafka-request-reply-asyncapi.yml"
9
+ },
10
+ {
11
+ "name": "AnyOf example",
12
+ "value": "anyof-asyncapi.yml"
13
+ },
14
+ {
15
+ "name": "Application Headers example - (protocols: mqtt)",
16
+ "value": "application-headers-asyncapi.yml"
17
+ },
18
+ {
19
+ "name": "Correlation ID Example - (protocols: mqtt)",
20
+ "value": "correlation-id-asyncapi.yml"
21
+ },
22
+ {
23
+ "name": "Gemini Market Data Websocket API - (protocols: wss)",
24
+ "value": "websocket-gemini-asyncapi.yml"
25
+ },
26
+ {
27
+ "name": "Gitter Streaming API - (protocols: https)",
28
+ "value": "gitter-streaming-asyncapi.yml"
29
+ },
30
+ {
31
+ "name": "Kraken Websockets API",
32
+ "value": "kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml"
33
+ },
34
+ {
35
+ "name": "Kraken Websockets API",
36
+ "value": "kraken-websocket-request-reply-multiple-channels-asyncapi.yml"
37
+ },
38
+ {
39
+ "name": "Mercure Hub Example - (protocols: mercure)",
40
+ "value": "mercure-asyncapi.yml"
41
+ },
42
+ {
43
+ "name": "Not example",
44
+ "value": "not-asyncapi.yml"
45
+ },
46
+ {
47
+ "name": "Notifications",
48
+ "value": "operation-security-asyncapi.yml"
49
+ },
50
+ {
51
+ "name": "OneOf example",
52
+ "value": "oneof-asyncapi.yml"
53
+ },
54
+ {
55
+ "name": "RPC Client Example - (protocols: amqp)",
56
+ "value": "rpc-client-asyncapi.yml"
57
+ },
58
+ {
59
+ "name": "RPC Server Example - (protocols: amqp)",
60
+ "value": "rpc-server-asyncapi.yml"
61
+ },
62
+ {
63
+ "name": "Slack Real Time Messaging API - (protocols: https)",
64
+ "value": "slack-rtm-asyncapi.yml"
65
+ },
66
+ {
67
+ "name": "Streetlights App - (protocols: mqtt)",
68
+ "value": "tutorial.yml"
69
+ },
70
+ {
71
+ "name": "Streetlights Kafka API - (protocols: kafka-secure,kafka-secure)",
72
+ "value": "streetlights-kafka-asyncapi.yml"
73
+ },
74
+ {
75
+ "name": "Streetlights Kafka API - (protocols: kafka-secure,kafka-secure)",
76
+ "value": "streetlights-operation-security-asyncapi.yml"
77
+ },
78
+ {
79
+ "name": "Streetlights MQTT API - (protocols: mqtt)",
80
+ "value": "streetlights-mqtt-asyncapi.yml"
81
+ }
82
+ ]
@@ -0,0 +1,178 @@
1
+ asyncapi: 3.0.0
2
+ id: 'tag:stream.gitter.im,2022:api'
3
+ info:
4
+ title: Gitter Streaming API
5
+ version: 1.0.0
6
+ servers:
7
+ production:
8
+ host: stream.gitter.im
9
+ pathname: /v1
10
+ protocol: https
11
+ protocolVersion: '1.1'
12
+ security:
13
+ - $ref: '#/components/securitySchemes/httpBearerToken'
14
+ channels:
15
+ rooms:
16
+ address: '/rooms/{roomId}/{resource}'
17
+ messages:
18
+ chatMessage:
19
+ $ref: '#/components/messages/chatMessage'
20
+ heartbeat:
21
+ $ref: '#/components/messages/heartbeat'
22
+ parameters:
23
+ roomId:
24
+ description: Id of the Gitter room.
25
+ examples:
26
+ - 53307860c3599d1de448e19d
27
+ resource:
28
+ enum:
29
+ - chatMessages
30
+ - events
31
+ description: The resource to consume.
32
+ operations:
33
+ sendRoomInfo:
34
+ action: send
35
+ channel:
36
+ $ref: '#/channels/rooms'
37
+ bindings:
38
+ http:
39
+ method: POST
40
+ messages:
41
+ - $ref: '#/channels/rooms/messages/chatMessage'
42
+ - $ref: '#/channels/rooms/messages/heartbeat'
43
+ components:
44
+ securitySchemes:
45
+ httpBearerToken:
46
+ type: http
47
+ scheme: bearer
48
+ messages:
49
+ chatMessage:
50
+ summary: >-
51
+ A message represents an individual chat message sent to a room. They are
52
+ a sub-resource of a room.
53
+ payload:
54
+ schemaFormat: application/schema+yaml;version=draft-07
55
+ schema:
56
+ type: object
57
+ properties:
58
+ id:
59
+ type: string
60
+ description: ID of the message.
61
+ text:
62
+ type: string
63
+ description: Original message in plain-text/markdown.
64
+ html:
65
+ type: string
66
+ description: HTML formatted message.
67
+ sent:
68
+ type: string
69
+ format: date-time
70
+ description: ISO formatted date of the message.
71
+ fromUser:
72
+ type: object
73
+ description: User that sent the message.
74
+ properties:
75
+ id:
76
+ type: string
77
+ description: Gitter User ID.
78
+ username:
79
+ type: string
80
+ description: Gitter/GitHub username.
81
+ displayName:
82
+ type: string
83
+ description: Gitter/GitHub user real name.
84
+ url:
85
+ type: string
86
+ description: Path to the user on Gitter.
87
+ avatarUrl:
88
+ type: string
89
+ format: uri
90
+ description: User avatar URI.
91
+ avatarUrlSmall:
92
+ type: string
93
+ format: uri
94
+ description: User avatar URI (small).
95
+ avatarUrlMedium:
96
+ type: string
97
+ format: uri
98
+ description: User avatar URI (medium).
99
+ v:
100
+ type: number
101
+ description: Version.
102
+ gv:
103
+ type: string
104
+ description: Stands for "Gravatar version" and is used for cache busting.
105
+ unread:
106
+ type: boolean
107
+ description: Boolean that indicates if the current user has read the message.
108
+ readBy:
109
+ type: number
110
+ description: Number of users that have read the message.
111
+ urls:
112
+ type: array
113
+ description: List of URLs present in the message.
114
+ items:
115
+ type: string
116
+ format: uri
117
+ mentions:
118
+ type: array
119
+ description: List of @Mentions in the message.
120
+ items:
121
+ type: object
122
+ properties:
123
+ screenName:
124
+ type: string
125
+ userId:
126
+ type: string
127
+ userIds:
128
+ type: array
129
+ items:
130
+ type: string
131
+ issues:
132
+ type: array
133
+ description: 'List of #Issues referenced in the message.'
134
+ items:
135
+ type: object
136
+ properties:
137
+ number:
138
+ type: string
139
+ meta:
140
+ type: array
141
+ description: Metadata. This is currently not used for anything.
142
+ items: {}
143
+ v:
144
+ type: number
145
+ description: Version.
146
+ gv:
147
+ type: string
148
+ description: Stands for "Gravatar version" and is used for cache busting.
149
+ bindings:
150
+ http:
151
+ headers:
152
+ type: object
153
+ properties:
154
+ Transfer-Encoding:
155
+ type: string
156
+ const: chunked
157
+ Trailer:
158
+ type: string
159
+ const: \r\n
160
+ heartbeat:
161
+ summary: Its purpose is to keep the connection alive.
162
+ payload:
163
+ schemaFormat: application/schema+yaml;version=draft-07
164
+ schema:
165
+ type: string
166
+ enum:
167
+ - "\r\n"
168
+ bindings:
169
+ http:
170
+ headers:
171
+ type: object
172
+ properties:
173
+ Transfer-Encoding:
174
+ type: string
175
+ const: chunked
176
+ Trailer:
177
+ type: string
178
+ const: \r\n
@@ -0,0 +1,388 @@
1
+ asyncapi: 3.0.0
2
+
3
+ info:
4
+ title: Kraken Websockets API
5
+ version: '1.8.0'
6
+ description: |
7
+ WebSockets API offers real-time market data updates. WebSockets is a bidirectional protocol offering fastest real-time data, helping you build real-time applications. The public message types presented below do not require authentication. Private-data messages can be subscribed on a separate authenticated endpoint.
8
+
9
+ ### General Considerations
10
+
11
+ - TLS with SNI (Server Name Indication) is required in order to establish a Kraken WebSockets API connection. See Cloudflare's [What is SNI?](https://www.cloudflare.com/learning/ssl/what-is-sni/) guide for more details.
12
+ - All messages sent and received via WebSockets are encoded in JSON format
13
+ - All decimal fields (including timestamps) are quoted to preserve precision.
14
+ - Timestamps should not be considered unique and not be considered as aliases for transaction IDs. Also, the granularity of timestamps is not representative of transaction rates.
15
+ - At least one private message should be subscribed to keep the authenticated client connection open.
16
+ - Please use REST API endpoint [AssetPairs](https://www.kraken.com/features/api#get-tradable-pairs) to fetch the list of pairs which can be subscribed via WebSockets API. For example, field 'wsname' gives the supported pairs name which can be used to subscribe.
17
+ - Cloudflare imposes a connection/re-connection rate limit (per IP address) of approximately 150 attempts per rolling 10 minutes. If this is exceeded, the IP is banned for 10 minutes.
18
+ - Recommended reconnection behaviour is to (1) attempt reconnection instantly up to a handful of times if the websocket is dropped randomly during normal operation but (2) after maintenance or extended downtime, attempt to reconnect no more quickly than once every 5 seconds. There is no advantage to reconnecting more rapidly after maintenance during cancel_only mode.
19
+
20
+
21
+ channels:
22
+ currencyExchange:
23
+ address: /
24
+ messages:
25
+ ping:
26
+ $ref: '#/components/messages/ping'
27
+ pong:
28
+ $ref: '#/components/messages/pong'
29
+ heartbeat:
30
+ $ref: '#/components/messages/heartbeat'
31
+ systemStatus:
32
+ $ref: '#/components/messages/systemStatus'
33
+ subscriptionStatus:
34
+ $ref: '#/components/messages/subscriptionStatus'
35
+ subscribe:
36
+ $ref: '#/components/messages/subscribe'
37
+ unsubscribe:
38
+ $ref: '#/components/messages/unsubscribe'
39
+ dummyCurrencyInfo:
40
+ $ref: '#/components/messages/dummyCurrencyInfo'
41
+
42
+
43
+ operations:
44
+ receivePing:
45
+ action: receive
46
+ channel:
47
+ $ref: '#/channels/currencyExchange'
48
+ reply:
49
+ channel:
50
+ $ref: '#/channels/currencyExchange'
51
+ messages:
52
+ - $ref: '#/channels/currencyExchange/messages/pong'
53
+ messages:
54
+ - $ref: '#/channels/currencyExchange/messages/ping'
55
+ sendHeartbeat:
56
+ action: send
57
+ channel:
58
+ $ref: '#/channels/currencyExchange'
59
+ messages:
60
+ - $ref: '#/channels/currencyExchange/messages/heartbeat'
61
+ systemStatus:
62
+ action: send
63
+ channel:
64
+ $ref: '#/channels/currencyExchange'
65
+ messages:
66
+ - $ref: '#/channels/currencyExchange/messages/systemStatus'
67
+ receiveSubscribeRequest:
68
+ action: receive
69
+ channel:
70
+ $ref: '#/channels/currencyExchange'
71
+ reply:
72
+ channel:
73
+ $ref: '#/channels/currencyExchange'
74
+ messages:
75
+ - $ref: '#/channels/currencyExchange/messages/subscriptionStatus'
76
+ - $ref: '#/channels/currencyExchange/messages/dummyCurrencyInfo'
77
+ messages:
78
+ - $ref: '#/channels/currencyExchange/messages/subscribe'
79
+ receiveUnsubscribeRequest:
80
+ action: receive
81
+ channel:
82
+ $ref: '#/channels/currencyExchange'
83
+ reply:
84
+ channel:
85
+ $ref: '#/channels/currencyExchange'
86
+ messages:
87
+ - $ref: '#/channels/currencyExchange/messages/subscriptionStatus'
88
+ messages:
89
+ - $ref: '#/channels/currencyExchange/messages/unsubscribe'
90
+
91
+
92
+ components:
93
+ messages:
94
+ dummyCurrencyInfo:
95
+ summary: Dummy message with no real life details
96
+ description: It is here in this example to showcase that there is an additional message that normally is of a complex structure. It represents actually currency exchange value to show a reply to operation receiveSubscribeRequest with more than one possible message.
97
+ payload:
98
+ type: object
99
+ properties:
100
+ event:
101
+ type: string
102
+ const: currencyInfo
103
+ reqid:
104
+ $ref: '#/components/schemas/reqid'
105
+ data:
106
+ type: object
107
+ required:
108
+ - event
109
+ correlationId:
110
+ location: '$message.payload#/reqid'
111
+
112
+ ping:
113
+ summary: Ping server to determine whether connection is alive
114
+ description: Client can ping server to determine whether connection is alive, server responds with pong. This is an application level ping as opposed to default ping in websockets standard which is server initiated
115
+ payload:
116
+ $ref: '#/components/schemas/ping'
117
+ correlationId:
118
+ location: '$message.payload#/reqid'
119
+
120
+ pong:
121
+ summary: Pong is a response to ping message
122
+ description: Server pong response to a ping to determine whether connection is alive. This is an application level pong as opposed to default pong in websockets standard which is sent by client in response to a ping
123
+ payload:
124
+ $ref: '#/components/schemas/pong'
125
+ correlationId:
126
+ location: '$message.payload#/reqid'
127
+
128
+ subscribe:
129
+ description: Subscribe to a topic on a single or multiple currency pairs.
130
+ payload:
131
+ $ref: '#/components/schemas/subscribe'
132
+ correlationId:
133
+ location: '$message.payload#/reqid'
134
+ unsubscribe:
135
+ description: Unsubscribe, can specify a channelID or multiple currency pairs.
136
+ payload:
137
+ $ref: '#/components/schemas/unsubscribe'
138
+ correlationId:
139
+ location: '$message.payload#/reqid'
140
+ subscriptionStatus:
141
+ description: Subscription status response to subscribe, unsubscribe or exchange initiated unsubscribe.
142
+ payload:
143
+ $ref: '#/components/schemas/subscriptionStatus'
144
+ examples:
145
+ - payload:
146
+ channelID: 10001
147
+ channelName: ohlc-5
148
+ event: subscriptionStatus
149
+ pair: XBT/EUR
150
+ reqid: 42
151
+ status: unsubscribed
152
+ subscription:
153
+ interval: 5
154
+ name: ohlc
155
+ - payload:
156
+ errorMessage: Subscription depth not supported
157
+ event: subscriptionStatus
158
+ pair: XBT/USD
159
+ status: error
160
+ subscription:
161
+ depth: 42
162
+ name: book
163
+
164
+ systemStatus:
165
+ description: Status sent on connection or system status changes.
166
+ payload:
167
+ $ref: '#/components/schemas/systemStatus'
168
+
169
+ heartbeat:
170
+ description: Server heartbeat sent if no subscription traffic within 1 second (approximately)
171
+ payload:
172
+ $ref: '#/components/schemas/heartbeat'
173
+
174
+
175
+ schemas:
176
+ ping:
177
+ type: object
178
+ properties:
179
+ event:
180
+ type: string
181
+ const: ping
182
+ reqid:
183
+ $ref: '#/components/schemas/reqid'
184
+ required:
185
+ - event
186
+ heartbeat:
187
+ type: object
188
+ properties:
189
+ event:
190
+ type: string
191
+ const: heartbeat
192
+ pong:
193
+ type: object
194
+ properties:
195
+ event:
196
+ type: string
197
+ const: pong
198
+ reqid:
199
+ $ref: '#/components/schemas/reqid'
200
+ systemStatus:
201
+ type: object
202
+ properties:
203
+ event:
204
+ type: string
205
+ const: systemStatus
206
+ connectionID:
207
+ type: integer
208
+ description: The ID of the connection
209
+ status:
210
+ $ref: '#/components/schemas/status'
211
+ version:
212
+ type: string
213
+ status:
214
+ type: string
215
+ enum:
216
+ - online
217
+ - maintenance
218
+ - cancel_only
219
+ - limit_only
220
+ - post_only
221
+ subscribe:
222
+ type: object
223
+ properties:
224
+ event:
225
+ type: string
226
+ const: subscribe
227
+ reqid:
228
+ $ref: '#/components/schemas/reqid'
229
+ pair:
230
+ $ref: '#/components/schemas/pair'
231
+ subscription:
232
+ type: object
233
+ properties:
234
+ depth:
235
+ $ref: '#/components/schemas/depth'
236
+ interval:
237
+ $ref: '#/components/schemas/interval'
238
+ name:
239
+ $ref: '#/components/schemas/name'
240
+ ratecounter:
241
+ $ref: '#/components/schemas/ratecounter'
242
+ snapshot:
243
+ $ref: '#/components/schemas/snapshot'
244
+ token:
245
+ $ref: '#/components/schemas/token'
246
+ required:
247
+ - name
248
+ required:
249
+ - event
250
+ unsubscribe:
251
+ type: object
252
+ properties:
253
+ event:
254
+ type: string
255
+ const: unsubscribe
256
+ reqid:
257
+ $ref: '#/components/schemas/reqid'
258
+ pair:
259
+ $ref: '#/components/schemas/pair'
260
+ subscription:
261
+ type: object
262
+ properties:
263
+ depth:
264
+ $ref: '#/components/schemas/depth'
265
+ interval:
266
+ $ref: '#/components/schemas/interval'
267
+ name:
268
+ $ref: '#/components/schemas/name'
269
+ token:
270
+ $ref: '#/components/schemas/token'
271
+ required:
272
+ - name
273
+ required:
274
+ - event
275
+ subscriptionStatus:
276
+ type: object
277
+ oneOf:
278
+ - $ref: '#/components/schemas/subscriptionStatusError'
279
+ - $ref: '#/components/schemas/subscriptionStatusSuccess'
280
+ subscriptionStatusError:
281
+ allOf:
282
+ - properties:
283
+ errorMessage:
284
+ type: string
285
+ required:
286
+ - errorMessage
287
+ - $ref: '#/components/schemas/subscriptionStatusCommon'
288
+ subscriptionStatusSuccess:
289
+ allOf:
290
+ - properties:
291
+ channelID:
292
+ type: integer
293
+ description: ChannelID on successful subscription, applicable to public messages only.
294
+ channelName:
295
+ type: string
296
+ description: Channel Name on successful subscription. For payloads 'ohlc' and 'book', respective interval or depth will be added as suffix.
297
+ required:
298
+ - channelID
299
+ - channelName
300
+ - $ref: '#/components/schemas/subscriptionStatusCommon'
301
+ subscriptionStatusCommon:
302
+ type: object
303
+ required:
304
+ - event
305
+ properties:
306
+ event:
307
+ type: string
308
+ const: subscriptionStatus
309
+ reqid:
310
+ $ref: '#/components/schemas/reqid'
311
+ pair:
312
+ $ref: '#/components/schemas/pair'
313
+ status:
314
+ $ref: '#/components/schemas/status'
315
+ subscription:
316
+ required:
317
+ - name
318
+ type: object
319
+ properties:
320
+ depth:
321
+ $ref: '#/components/schemas/depth'
322
+ interval:
323
+ $ref: '#/components/schemas/interval'
324
+ maxratecount:
325
+ $ref: '#/components/schemas/maxratecount'
326
+ name:
327
+ $ref: '#/components/schemas/name'
328
+ token:
329
+ $ref: '#/components/schemas/token'
330
+ interval:
331
+ type: integer
332
+ description: Time interval associated with ohlc subscription in minutes.
333
+ default: 1
334
+ enum:
335
+ - 1
336
+ - 5
337
+ - 15
338
+ - 30
339
+ - 60
340
+ - 240
341
+ - 1440
342
+ - 10080
343
+ - 21600
344
+ name:
345
+ type: string
346
+ description: The name of the channel you subscribe too.
347
+ enum:
348
+ - book
349
+ - ohlc
350
+ - openOrders
351
+ - ownTrades
352
+ - spread
353
+ - ticker
354
+ - trade
355
+ token:
356
+ type: string
357
+ description: base64-encoded authentication token for private-data endpoints.
358
+ depth:
359
+ type: integer
360
+ default: 10
361
+ enum:
362
+ - 10
363
+ - 25
364
+ - 100
365
+ - 500
366
+ - 1000
367
+ description: Depth associated with book subscription in number of levels each side.
368
+ maxratecount:
369
+ type: integer
370
+ description: Max rate-limit budget. Compare to the ratecounter field in the openOrders updates to check whether you are approaching the rate limit.
371
+ ratecounter:
372
+ type: boolean
373
+ default: false
374
+ description: Whether to send rate-limit counter in updates (supported only for openOrders subscriptions)
375
+ snapshot:
376
+ type: boolean
377
+ default: true
378
+ description: Whether to send historical feed data snapshot upon subscription (supported only for ownTrades subscriptions)
379
+ reqid:
380
+ type: integer
381
+ description: client originated ID reflected in response message.
382
+ pair:
383
+ type: array
384
+ description: Array of currency pairs.
385
+ items:
386
+ type: string
387
+ description: Format of each pair is "A/B", where A and B are ISO 4217-A3 for standardized assets and popular unique symbol if not standardized.
388
+ pattern: '[A-Z\s]+\/[A-Z\s]+'