@asyncapi/generator 2.8.0 → 2.8.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 (186) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/docs/api.md +1 -2
  3. package/lib/templates/BakedInTemplatesList.json +7 -0
  4. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/.ageneratorrc +21 -0
  5. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/README.md +12 -0
  6. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/ClientClass.js +42 -0
  7. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/ClientClass.js.map +1 -0
  8. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/ClientFields.js +21 -0
  9. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/ClientFields.js.map +1 -0
  10. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/Connect.js +60 -0
  11. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/Connect.js.map +1 -0
  12. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/Constructor.js +27 -0
  13. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/Constructor.js.map +1 -0
  14. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/HandleMessage.js +21 -0
  15. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/HandleMessage.js.map +1 -0
  16. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/RegisterErrorHandler.js +21 -0
  17. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/RegisterErrorHandler.js.map +1 -0
  18. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/SendEchoMessage.js +27 -0
  19. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/components/SendEchoMessage.js.map +1 -0
  20. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/template/client.dart.js +181 -0
  21. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/template/client.dart.js.map +1 -0
  22. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/template/pubspec.yaml.js +21 -0
  23. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/__transpiled/template/pubspec.yaml.js.map +1 -0
  24. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/ClientClass.js +32 -0
  25. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/ClientFields.js +12 -0
  26. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/Connect.js +49 -0
  27. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/Constructor.js +16 -0
  28. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/HandleMessage.js +14 -0
  29. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/RegisterErrorHandler.js +14 -0
  30. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/components/SendEchoMessage.js +20 -0
  31. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/example.dart +36 -0
  32. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/package.json +55 -0
  33. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/template/client.dart.js +24 -0
  34. package/lib/templates/bakedInTemplates/core-template-client-websocket-dart/template/pubspec.yaml.js +16 -0
  35. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/.ageneratorrc +25 -0
  36. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/README.md +28 -0
  37. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/ClientConnector.js +27 -0
  38. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/ClientConnector.js.map +1 -0
  39. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/ClientFields.js +19 -0
  40. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/ClientFields.js.map +1 -0
  41. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/ConnectorFields.js +22 -0
  42. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/ConnectorFields.js.map +1 -0
  43. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/EchoWebSocket.js +40 -0
  44. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/EchoWebSocket.js.map +1 -0
  45. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/HandleError.js +20 -0
  46. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/HandleError.js.map +1 -0
  47. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/InitConnector.js +47 -0
  48. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/InitConnector.js.map +1 -0
  49. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/OnClose.js +23 -0
  50. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/OnClose.js.map +1 -0
  51. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/OnOpen.js +25 -0
  52. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/OnOpen.js.map +1 -0
  53. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/OnTextMessageHandler.js +29 -0
  54. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/OnTextMessageHandler.js.map +1 -0
  55. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/dependencies/ClientDependencies.js +29 -0
  56. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/dependencies/ClientDependencies.js.map +1 -0
  57. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/dependencies/ConnectorDependencies.js +27 -0
  58. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/components/dependencies/ConnectorDependencies.js.map +1 -0
  59. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/java/com/asyncapi/client.java.js +154 -0
  60. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/java/com/asyncapi/client.java.js.map +1 -0
  61. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/java/com/asyncapi/connector.java.js +108 -0
  62. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/java/com/asyncapi/connector.java.js.map +1 -0
  63. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/java/com/asyncapi/models/model.js +52 -0
  64. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/java/com/asyncapi/models/model.js.map +1 -0
  65. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/resources/AppProperties.js +27 -0
  66. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/__transpiled/template/src/main/resources/AppProperties.js.map +1 -0
  67. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/ClientConnector.js +17 -0
  68. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/ClientFields.js +10 -0
  69. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/ConnectorFields.js +11 -0
  70. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/EchoWebSocket.js +27 -0
  71. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/HandleError.js +14 -0
  72. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/InitConnector.js +41 -0
  73. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/OnClose.js +16 -0
  74. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/OnOpen.js +16 -0
  75. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/OnTextMessageHandler.js +25 -0
  76. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/dependencies/ClientDependencies.js +23 -0
  77. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/components/dependencies/ConnectorDependencies.js +20 -0
  78. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/package.json +64 -0
  79. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/.dockerignore +5 -0
  80. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/.mvn/wrapper/MavenWrapperDownloader.java +93 -0
  81. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/.mvn/wrapper/maven-wrapper.properties +20 -0
  82. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/README.md +58 -0
  83. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/mvnw +332 -0
  84. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/mvnw.cmd +206 -0
  85. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/pom.xml +125 -0
  86. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/src/main/docker/Dockerfile.jvm +98 -0
  87. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/src/main/java/com/asyncapi/client.java.js +27 -0
  88. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/src/main/java/com/asyncapi/connector.java.js +16 -0
  89. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/src/main/java/com/asyncapi/models/model.js +36 -0
  90. package/lib/templates/bakedInTemplates/core-template-client-websocket-java-quarkus/template/src/main/resources/AppProperties.js +19 -0
  91. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/.ageneratorrc +21 -0
  92. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/README.md +10 -0
  93. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/AvailableOperations.js +34 -0
  94. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/AvailableOperations.js.map +1 -0
  95. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/ClientClass.js +47 -0
  96. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/ClientClass.js.map +1 -0
  97. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/Connect.js +63 -0
  98. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/Connect.js.map +1 -0
  99. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/Constructor.js +29 -0
  100. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/Constructor.js.map +1 -0
  101. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/HandleMessage.js +21 -0
  102. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/HandleMessage.js.map +1 -0
  103. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/MessageExamples.js +29 -0
  104. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/MessageExamples.js.map +1 -0
  105. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/ModuleExport.js +18 -0
  106. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/ModuleExport.js.map +1 -0
  107. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/OperationHeader.js +19 -0
  108. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/OperationHeader.js.map +1 -0
  109. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/RegisterErrorHandler.js +25 -0
  110. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/RegisterErrorHandler.js.map +1 -0
  111. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/SendOperation.js +53 -0
  112. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/components/SendOperation.js.map +1 -0
  113. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/example.js +43 -0
  114. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/example.js.map +1 -0
  115. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/template/README.md.js +166 -0
  116. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/template/README.md.js.map +1 -0
  117. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/template/client.js.js +216 -0
  118. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/__transpiled/template/client.js.js.map +1 -0
  119. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/AvailableOperations.js +20 -0
  120. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/ClientClass.js +32 -0
  121. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/Connect.js +54 -0
  122. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/Constructor.js +21 -0
  123. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/HandleMessage.js +14 -0
  124. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/MessageExamples.js +25 -0
  125. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/ModuleExport.js +11 -0
  126. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/OperationHeader.js +12 -0
  127. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/RegisterErrorHandler.js +18 -0
  128. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/components/SendOperation.js +44 -0
  129. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/example.js +42 -0
  130. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/package.json +55 -0
  131. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/template/README.md.js +106 -0
  132. package/lib/templates/bakedInTemplates/core-template-client-websocket-javascript/template/client.js.js +24 -0
  133. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/.ageneratorrc +21 -0
  134. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/README.md +53 -0
  135. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/ClientClass.js +61 -0
  136. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/ClientClass.js.map +1 -0
  137. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Connect.js +58 -0
  138. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Connect.js.map +1 -0
  139. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Constructor.js +55 -0
  140. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Constructor.js.map +1 -0
  141. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/HandleError.js +25 -0
  142. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/HandleError.js.map +1 -0
  143. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/HandleMessage.js +24 -0
  144. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/HandleMessage.js.map +1 -0
  145. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/InitSignature.js +34 -0
  146. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/InitSignature.js.map +1 -0
  147. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/QueryParamsArgumentsDocs.js +27 -0
  148. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/QueryParamsArgumentsDocs.js.map +1 -0
  149. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/QueryParamsVariables.js +36 -0
  150. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/QueryParamsVariables.js.map +1 -0
  151. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/RegisterErrorHandler.js +23 -0
  152. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/RegisterErrorHandler.js.map +1 -0
  153. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/RegisterOutgoingProcessor.js +26 -0
  154. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/RegisterOutgoingProcessor.js.map +1 -0
  155. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Requires.js +24 -0
  156. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Requires.js.map +1 -0
  157. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Send.js +41 -0
  158. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/Send.js.map +1 -0
  159. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/SendOperation.js +56 -0
  160. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/components/SendOperation.js.map +1 -0
  161. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/template/client.py.js +379 -0
  162. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/template/client.py.js.map +1 -0
  163. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/template/models.js +15 -0
  164. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/template/models.js.map +1 -0
  165. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/template/requirements.txt.js +19 -0
  166. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/__transpiled/template/requirements.txt.js.map +1 -0
  167. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/ClientClass.js +47 -0
  168. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/Connect.js +49 -0
  169. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/Constructor.js +42 -0
  170. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/HandleError.js +18 -0
  171. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/HandleMessage.js +17 -0
  172. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/InitSignature.js +24 -0
  173. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/QueryParamsArgumentsDocs.js +19 -0
  174. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/QueryParamsVariables.js +27 -0
  175. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/RegisterErrorHandler.js +16 -0
  176. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/RegisterOutgoingProcessor.js +19 -0
  177. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/Requires.js +15 -0
  178. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/Send.js +33 -0
  179. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/components/SendOperation.js +50 -0
  180. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/example-slack.py +21 -0
  181. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/example.py +41 -0
  182. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/package.json +55 -0
  183. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/template/client.py.js +23 -0
  184. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/template/models.js +5 -0
  185. package/lib/templates/bakedInTemplates/core-template-client-websocket-python/template/requirements.txt.js +13 -0
  186. package/package.json +6 -3
@@ -0,0 +1,206 @@
1
+ @REM ----------------------------------------------------------------------------
2
+ @REM Licensed to the Apache Software Foundation (ASF) under one
3
+ @REM or more contributor license agreements. See the NOTICE file
4
+ @REM distributed with this work for additional information
5
+ @REM regarding copyright ownership. The ASF licenses this file
6
+ @REM to you under the Apache License, Version 2.0 (the
7
+ @REM "License"); you may not use this file except in compliance
8
+ @REM with the License. You may obtain a copy of the License at
9
+ @REM
10
+ @REM http://www.apache.org/licenses/LICENSE-2.0
11
+ @REM
12
+ @REM Unless required by applicable law or agreed to in writing,
13
+ @REM software distributed under the License is distributed on an
14
+ @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ @REM KIND, either express or implied. See the License for the
16
+ @REM specific language governing permissions and limitations
17
+ @REM under the License.
18
+ @REM ----------------------------------------------------------------------------
19
+
20
+ @REM ----------------------------------------------------------------------------
21
+ @REM Apache Maven Wrapper startup batch script, version 3.3.2
22
+ @REM
23
+ @REM Required ENV vars:
24
+ @REM JAVA_HOME - location of a JDK home dir
25
+ @REM
26
+ @REM Optional ENV vars
27
+ @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
28
+ @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
29
+ @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
30
+ @REM e.g. to debug Maven itself, use
31
+ @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
32
+ @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
33
+ @REM ----------------------------------------------------------------------------
34
+
35
+ @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
36
+ @echo off
37
+ @REM set title of command window
38
+ title %0
39
+ @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
40
+ @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
41
+
42
+ @REM set %HOME% to equivalent of $HOME
43
+ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
44
+
45
+ @REM Execute a user defined script before this one
46
+ if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
47
+ @REM check for pre script, once with legacy .bat ending and once with .cmd ending
48
+ if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
49
+ if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
50
+ :skipRcPre
51
+
52
+ @setlocal
53
+
54
+ set ERROR_CODE=0
55
+
56
+ @REM To isolate internal variables from possible post scripts, we use another setlocal
57
+ @setlocal
58
+
59
+ @REM ==== START VALIDATION ====
60
+ if not "%JAVA_HOME%" == "" goto OkJHome
61
+
62
+ echo. >&2
63
+ echo Error: JAVA_HOME not found in your environment. >&2
64
+ echo Please set the JAVA_HOME variable in your environment to match the >&2
65
+ echo location of your Java installation. >&2
66
+ echo. >&2
67
+ goto error
68
+
69
+ :OkJHome
70
+ if exist "%JAVA_HOME%\bin\java.exe" goto init
71
+
72
+ echo. >&2
73
+ echo Error: JAVA_HOME is set to an invalid directory. >&2
74
+ echo JAVA_HOME = "%JAVA_HOME%" >&2
75
+ echo Please set the JAVA_HOME variable in your environment to match the >&2
76
+ echo location of your Java installation. >&2
77
+ echo. >&2
78
+ goto error
79
+
80
+ @REM ==== END VALIDATION ====
81
+
82
+ :init
83
+
84
+ @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
85
+ @REM Fallback to current working directory if not found.
86
+
87
+ set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
88
+ IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
89
+
90
+ set EXEC_DIR=%CD%
91
+ set WDIR=%EXEC_DIR%
92
+ :findBaseDir
93
+ IF EXIST "%WDIR%"\.mvn goto baseDirFound
94
+ cd ..
95
+ IF "%WDIR%"=="%CD%" goto baseDirNotFound
96
+ set WDIR=%CD%
97
+ goto findBaseDir
98
+
99
+ :baseDirFound
100
+ set MAVEN_PROJECTBASEDIR=%WDIR%
101
+ cd "%EXEC_DIR%"
102
+ goto endDetectBaseDir
103
+
104
+ :baseDirNotFound
105
+ set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
106
+ cd "%EXEC_DIR%"
107
+
108
+ :endDetectBaseDir
109
+
110
+ IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
111
+
112
+ @setlocal EnableExtensions EnableDelayedExpansion
113
+ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
114
+ @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
115
+
116
+ :endReadAdditionalConfig
117
+
118
+ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
119
+ set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
120
+ set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
121
+
122
+ set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"
123
+
124
+ FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
125
+ IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
126
+ )
127
+
128
+ @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129
+ @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130
+ if exist %WRAPPER_JAR% (
131
+ if "%MVNW_VERBOSE%" == "true" (
132
+ echo Found %WRAPPER_JAR%
133
+ )
134
+ ) else (
135
+ if not "%MVNW_REPOURL%" == "" (
136
+ SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar"
137
+ )
138
+ if "%MVNW_VERBOSE%" == "true" (
139
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
140
+ echo Downloading from: %WRAPPER_URL%
141
+ )
142
+
143
+ powershell -Command "&{"^
144
+ "$webclient = new-object System.Net.WebClient;"^
145
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
146
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
147
+ "}"^
148
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
149
+ "}"
150
+ if "%MVNW_VERBOSE%" == "true" (
151
+ echo Finished downloading %WRAPPER_JAR%
152
+ )
153
+ )
154
+ @REM End of extension
155
+
156
+ @REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
157
+ SET WRAPPER_SHA_256_SUM=""
158
+ FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
159
+ IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
160
+ )
161
+ IF NOT %WRAPPER_SHA_256_SUM%=="" (
162
+ powershell -Command "&{"^
163
+ "Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash;"^
164
+ "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
165
+ "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
166
+ " Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
167
+ " Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
168
+ " Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
169
+ " exit 1;"^
170
+ "}"^
171
+ "}"
172
+ if ERRORLEVEL 1 goto error
173
+ )
174
+
175
+ @REM Provide a "standardized" way to retrieve the CLI args that will
176
+ @REM work with both Windows and non-Windows executions.
177
+ set MAVEN_CMD_LINE_ARGS=%*
178
+
179
+ %MAVEN_JAVA_EXE% ^
180
+ %JVM_CONFIG_MAVEN_PROPS% ^
181
+ %MAVEN_OPTS% ^
182
+ %MAVEN_DEBUG_OPTS% ^
183
+ -classpath %WRAPPER_JAR% ^
184
+ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
185
+ %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
186
+ if ERRORLEVEL 1 goto error
187
+ goto end
188
+
189
+ :error
190
+ set ERROR_CODE=1
191
+
192
+ :end
193
+ @endlocal & set ERROR_CODE=%ERROR_CODE%
194
+
195
+ if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
196
+ @REM check for post script, once with legacy .bat ending and once with .cmd ending
197
+ if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
198
+ if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
199
+ :skipRcPost
200
+
201
+ @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
202
+ if "%MAVEN_BATCH_PAUSE%"=="on" pause
203
+
204
+ if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
205
+
206
+ cmd /C exit /B %ERROR_CODE%
@@ -0,0 +1,125 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>com.asyncapi</groupId>
5
+ <artifactId>quarkus-websocket</artifactId>
6
+ <version>1.0.0-SNAPSHOT</version>
7
+
8
+ <properties>
9
+ <compiler-plugin.version>3.14.0</compiler-plugin.version>
10
+ <maven.compiler.release>21</maven.compiler.release>
11
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
13
+ <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
14
+ <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
15
+ <quarkus.platform.version>3.23.0</quarkus.platform.version>
16
+ <skipITs>true</skipITs>
17
+ <surefire-plugin.version>3.5.2</surefire-plugin.version>
18
+ </properties>
19
+
20
+ <dependencyManagement>
21
+ <dependencies>
22
+ <dependency>
23
+ <groupId>${quarkus.platform.group-id}</groupId>
24
+ <artifactId>${quarkus.platform.artifact-id}</artifactId>
25
+ <version>${quarkus.platform.version}</version>
26
+ <type>pom</type>
27
+ <scope>import</scope>
28
+ </dependency>
29
+ </dependencies>
30
+ </dependencyManagement>
31
+
32
+ <dependencies>
33
+ <dependency>
34
+ <groupId>io.quarkus</groupId>
35
+ <artifactId>quarkus-websockets-next</artifactId>
36
+ </dependency>
37
+ <dependency>
38
+ <groupId>jakarta.ws.rs</groupId>
39
+ <artifactId>jakarta.ws.rs-api</artifactId>
40
+ <version>3.1.0</version>
41
+ <scope>provided</scope>
42
+ </dependency>
43
+ <dependency>
44
+ <groupId>io.quarkus</groupId>
45
+ <artifactId>quarkus-arc</artifactId>
46
+ </dependency>
47
+ <dependency>
48
+ <groupId>io.quarkus</groupId>
49
+ <artifactId>quarkus-junit5</artifactId>
50
+ <scope>test</scope>
51
+ </dependency>
52
+ </dependencies>
53
+
54
+ <build>
55
+ <plugins>
56
+ <plugin>
57
+ <groupId>${quarkus.platform.group-id}</groupId>
58
+ <artifactId>quarkus-maven-plugin</artifactId>
59
+ <version>${quarkus.platform.version}</version>
60
+ <extensions>true</extensions>
61
+ <executions>
62
+ <execution>
63
+ <goals>
64
+ <goal>build</goal>
65
+ <goal>generate-code</goal>
66
+ <goal>generate-code-tests</goal>
67
+ <goal>native-image-agent</goal>
68
+ </goals>
69
+ </execution>
70
+ </executions>
71
+ </plugin>
72
+ <plugin>
73
+ <artifactId>maven-compiler-plugin</artifactId>
74
+ <version>${compiler-plugin.version}</version>
75
+ <configuration>
76
+ <parameters>true</parameters>
77
+ </configuration>
78
+ </plugin>
79
+ <plugin>
80
+ <artifactId>maven-surefire-plugin</artifactId>
81
+ <version>${surefire-plugin.version}</version>
82
+ <configuration>
83
+ <systemPropertyVariables>
84
+ <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
85
+ <maven.home>${maven.home}</maven.home>
86
+ </systemPropertyVariables>
87
+ </configuration>
88
+ </plugin>
89
+ <plugin>
90
+ <artifactId>maven-failsafe-plugin</artifactId>
91
+ <version>${surefire-plugin.version}</version>
92
+ <executions>
93
+ <execution>
94
+ <goals>
95
+ <goal>integration-test</goal>
96
+ <goal>verify</goal>
97
+ </goals>
98
+ </execution>
99
+ </executions>
100
+ <configuration>
101
+ <systemPropertyVariables>
102
+ <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
103
+ <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
104
+ <maven.home>${maven.home}</maven.home>
105
+ </systemPropertyVariables>
106
+ </configuration>
107
+ </plugin>
108
+ </plugins>
109
+ </build>
110
+
111
+ <profiles>
112
+ <profile>
113
+ <id>native</id>
114
+ <activation>
115
+ <property>
116
+ <name>native</name>
117
+ </property>
118
+ </activation>
119
+ <properties>
120
+ <skipITs>false</skipITs>
121
+ <quarkus.native.enabled>true</quarkus.native.enabled>
122
+ </properties>
123
+ </profile>
124
+ </profiles>
125
+ </project>
@@ -0,0 +1,98 @@
1
+ ####
2
+ # This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
3
+ #
4
+ # Before building the container image run:
5
+ #
6
+ # ./mvnw package
7
+ #
8
+ # Then, build the image with:
9
+ #
10
+ # docker build -f src/main/docker/Dockerfile.jvm -t quarkus/quarkus-websocket-jvm .
11
+ #
12
+ # Then run the container using:
13
+ #
14
+ # docker run -i --rm -p 8080:8080 quarkus/quarkus-websocket-jvm
15
+ #
16
+ # If you want to include the debug port into your docker image
17
+ # you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
18
+ # Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
19
+ # when running the container
20
+ #
21
+ # Then run the container using :
22
+ #
23
+ # docker run -i --rm -p 8080:8080 quarkus/quarkus-websocket-jvm
24
+ #
25
+ # This image uses the `run-java.sh` script to run the application.
26
+ # This scripts computes the command line to execute your Java application, and
27
+ # includes memory/GC tuning.
28
+ # You can configure the behavior using the following environment properties:
29
+ # - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") - Be aware that this will override
30
+ # the default JVM options, use `JAVA_OPTS_APPEND` to append options
31
+ # - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
32
+ # in JAVA_OPTS (example: "-Dsome.property=foo")
33
+ # - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
34
+ # used to calculate a default maximal heap memory based on a containers restriction.
35
+ # If used in a container without any memory constraints for the container then this
36
+ # option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
37
+ # of the container available memory as set here. The default is `50` which means 50%
38
+ # of the available memory is used as an upper boundary. You can skip this mechanism by
39
+ # setting this value to `0` in which case no `-Xmx` option is added.
40
+ # - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
41
+ # is used to calculate a default initial heap memory based on the maximum heap memory.
42
+ # If used in a container without any memory constraints for the container then this
43
+ # option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
44
+ # of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
45
+ # is used as the initial heap size. You can skip this mechanism by setting this value
46
+ # to `0` in which case no `-Xms` option is added (example: "25")
47
+ # - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
48
+ # This is used to calculate the maximum value of the initial heap memory. If used in
49
+ # a container without any memory constraints for the container then this option has
50
+ # no effect. If there is a memory constraint then `-Xms` is limited to the value set
51
+ # here. The default is 4096MB which means the calculated value of `-Xms` never will
52
+ # be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
53
+ # - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
54
+ # when things are happening. This option, if set to true, will set
55
+ # `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
56
+ # - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
57
+ # true").
58
+ # - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
59
+ # - CONTAINER_CORE_LIMIT: A calculated core limit as described in
60
+ # https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
61
+ # - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
62
+ # - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
63
+ # (example: "20")
64
+ # - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
65
+ # (example: "40")
66
+ # - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
67
+ # (example: "4")
68
+ # - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
69
+ # previous GC times. (example: "90")
70
+ # - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
71
+ # - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
72
+ # - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
73
+ # contain the necessary JRE command-line options to specify the required GC, which
74
+ # will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
75
+ # - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
76
+ # - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
77
+ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
78
+ # accessed directly. (example: "foo.example.com,bar.example.com")
79
+ #
80
+ ###
81
+ FROM registry.access.redhat.com/ubi9/openjdk-21:1.21
82
+
83
+ ENV LANGUAGE='en_US:en'
84
+
85
+
86
+ # We make four distinct layers so if there are application changes the library layers can be re-used
87
+ COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
88
+ COPY --chown=185 target/quarkus-app/*.jar /deployments/
89
+ COPY --chown=185 target/quarkus-app/app/ /deployments/app/
90
+ COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
91
+
92
+ EXPOSE 8080
93
+ USER 185
94
+ ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
95
+ ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
96
+
97
+ ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
98
+
@@ -0,0 +1,27 @@
1
+ import { getClientName, getInfo, getServer, getTitle } from '@asyncapi/generator-helpers';
2
+ import { File } from '@asyncapi/generator-react-sdk';
3
+ import { FileHeaderInfo } from '@asyncapi/generator-components';
4
+ import { ClientDependencies } from '../../../../../../components/dependencies/ClientDependencies.js';
5
+ import { EchoWebSocket } from '../../../../../../components/EchoWebSocket.js';
6
+
7
+ export default async function ({ asyncapi, params }) {
8
+ const server = getServer(asyncapi.servers(), params.server);
9
+ const info = getInfo(asyncapi);
10
+ const title = getTitle(asyncapi);
11
+ const clientName = getClientName(asyncapi, params.appendClientSuffix, params.customClientName);
12
+ const operations = asyncapi.operations();
13
+ const clientJavaName = `${clientName}.java`;
14
+ const pathName = server.pathname();
15
+
16
+ return (
17
+ <File name={clientJavaName}>
18
+ <FileHeaderInfo
19
+ info={info}
20
+ server={server}
21
+ language="java"
22
+ />
23
+ <ClientDependencies/>
24
+ <EchoWebSocket clientName={clientName} pathName={pathName} title={title} operations={operations} />
25
+ </File>
26
+ );
27
+ }
@@ -0,0 +1,16 @@
1
+ import { getClientName } from '@asyncapi/generator-helpers';
2
+ import { File } from '@asyncapi/generator-react-sdk';
3
+ import { ConnectorDependencies } from '../../../../../../components/dependencies/ConnectorDependencies.js';
4
+ import ClientConnector from '../../../../../../components/ClientConnector.js';
5
+
6
+ export default async function ({ asyncapi, params }) {
7
+ const clientName = getClientName(asyncapi, params.appendClientSuffix, params.customClientName);
8
+ const clientConnectorName = `${clientName}Connector.java`;
9
+
10
+ return (
11
+ <File name={clientConnectorName}>
12
+ <ConnectorDependencies/>
13
+ <ClientConnector clientName={clientName} />
14
+ </File>
15
+ );
16
+ }
@@ -0,0 +1,36 @@
1
+ import { JAVA_COMMON_PRESET } from '@asyncapi/modelina';
2
+ import { Models } from '@asyncapi/generator-components';
3
+
4
+ export default async function({ asyncapi }) {
5
+ const websocketJavaPreset = {
6
+ class: {
7
+ self({ content, dependencyManager }) {
8
+ return `package com.asyncapi.models;\n\n${content}`;
9
+ },
10
+ property({ content, property }) {
11
+ if (property.property && property.property.type === 'Integer') {
12
+ return `@Service\n${content}`;
13
+ }
14
+ return content;
15
+ },
16
+ additionalContent({ content }) {
17
+ return content;
18
+ }
19
+ }
20
+ };
21
+
22
+ const combinedPresets = [
23
+ {
24
+ preset: JAVA_COMMON_PRESET,
25
+ options: {
26
+ equal: true,
27
+ hashCode: false,
28
+ classToString: true,
29
+ marshalling: false
30
+ }
31
+ },
32
+ websocketJavaPreset
33
+ ];
34
+
35
+ return await Models({ asyncapi, language: 'java', format: 'toPascalCase', presets: combinedPresets});
36
+ }
@@ -0,0 +1,19 @@
1
+ import { getClientName, getServer, getServerHost} from '@asyncapi/generator-helpers';
2
+ import { Text, File } from '@asyncapi/generator-react-sdk';
3
+
4
+ export default function AppProperties({ asyncapi, params }) {
5
+ const server = getServer(asyncapi.servers(), params.server);
6
+ const clientName = getClientName(asyncapi, params.appendClientSuffix, params.customClientName);
7
+ const serverHost = getServerHost(server);
8
+
9
+ return (
10
+ <File name="application.properties">
11
+ <Text>
12
+ {`# application.properties
13
+
14
+ # Define a named base-uri for ${clientName}
15
+ com.asyncapi.${clientName}.base-uri=wss://${serverHost}`}
16
+ </Text>
17
+ </File>
18
+ );
19
+ }
@@ -0,0 +1,21 @@
1
+ renderer: react
2
+ apiVersion: v3
3
+ parameters:
4
+ server:
5
+ description: The name of the server described in AsyncAPI document
6
+ required: true
7
+ clientFileName:
8
+ description: The name of the generated client file
9
+ required: false
10
+ default: client.js
11
+ appendClientSuffix:
12
+ description: Add 'Client' suffix at the end of the class name. This option has no effect if 'customClientName' is specified.
13
+ required: false
14
+ default: false
15
+ customClientName:
16
+ description: The custom name for the generated client class
17
+ required: false
18
+ metadata:
19
+ type: client
20
+ protocol: websocket
21
+ target: javascript
@@ -0,0 +1,10 @@
1
+ ## JavaScript WebSocket Client
2
+
3
+ You can test this template:
4
+ 1. Clone the project and run `npm install`
5
+ 2. Navigate to `packages/templates/clients/websocket/test/integration-test` and run the tests with `npm run test` to generate WebSocket clients
6
+ 3. Navigate to `packages/templates/clients/websocket/javascript`
7
+ 4. Install with `npm install` and run test with `npm run test`
8
+ 5. Start example script that uses a client library generated by the test: `node example.js`
9
+
10
+ > By default this is testing against Hoppscotch echo service. You can modify `packages/templates/clients/websocket/javascript/example.js` and change first line to `const WSClient = require('./tests/temp/snapshotTestResult/client_postman/client.js');` and run `node example.js` again. You will see example still works but now it is using a different API. This is possible since both AsyncAPI documents define the same name of operation for sending messages: `sendEchoMessage` so each client generated has the same API.
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('source-map-support/register');
6
+ var generatorReactSdk = require('@asyncapi/generator-react-sdk');
7
+ var OperationHeader = require('./OperationHeader.js');
8
+ var MessageExamples = require('./MessageExamples.js');
9
+ var jsxRuntime = require('/home/runner/work/generator/generator/node_modules/react/cjs/react-jsx-runtime.production.min.js');
10
+ require('@asyncapi/generator-helpers');
11
+
12
+ function AvailableOperations({
13
+ operations
14
+ }) {
15
+ if (!operations || operations.length === 0) {
16
+ return null;
17
+ }
18
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
19
+ children: [/*#__PURE__*/jsxRuntime.jsx(generatorReactSdk.Text, {
20
+ newLines: 2,
21
+ children: "### Available Operations"
22
+ }), operations.map(operation => /*#__PURE__*/jsxRuntime.jsxs(generatorReactSdk.Text, {
23
+ newLines: 2,
24
+ children: [/*#__PURE__*/jsxRuntime.jsx(OperationHeader, {
25
+ operation: operation
26
+ }), /*#__PURE__*/jsxRuntime.jsx(MessageExamples, {
27
+ operation: operation
28
+ })]
29
+ }))]
30
+ });
31
+ }
32
+
33
+ exports.AvailableOperations = AvailableOperations;
34
+ //# sourceMappingURL=AvailableOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvailableOperations.js","sources":["../../../../../../../../packages/templates/clients/websocket/javascript/components/AvailableOperations.js"],"sourcesContent":["import { Text } from '@asyncapi/generator-react-sdk';\nimport OperationHeader from './OperationHeader';\nimport MessageExamples from './MessageExamples';\n\nexport function AvailableOperations({ operations }) {\n if (!operations || operations.length === 0) {\n return null;\n }\n return (\n <>\n <Text newLines={2}>### Available Operations</Text>\n {operations.map((operation) => (\n <Text newLines={2}>\n <OperationHeader operation={operation} />\n <MessageExamples operation={operation} />\n </Text>\n ))}\n </>\n );\n}\n"],"names":["AvailableOperations","operations","length","_jsxs","_Fragment","children","_jsx","Text","newLines","map","operation","OperationHeader","MessageExamples"],"mappings":";;;;;;;;;;;AAIO,SAASA,mBAAmBA,CAAC;AAAEC,EAAAA,UAAAA;AAAW,CAAC,EAAE;EAClD,IAAI,CAACA,UAAU,IAAIA,UAAU,CAACC,MAAM,KAAK,CAAC,EAAE;AAC1C,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;EACA,oBACEC,eAAA,CAAAC,mBAAA,EAAA;IAAAC,QAAA,EAAA,cACEC,cAAA,CAACC,sBAAI,EAAA;AAACC,MAAAA,QAAQ,EAAE,CAAE;AAAAH,MAAAA,QAAA,EAAC,0BAAA;KAA8B,CAAC,EACjDJ,UAAU,CAACQ,GAAG,CAAEC,SAAS,iBACxBP,eAAA,CAACI,sBAAI,EAAA;AAACC,MAAAA,QAAQ,EAAE,CAAE;MAAAH,QAAA,EAAA,cAChBC,cAAA,CAACK,eAAe,EAAA;AAACD,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OAAE,CAAC,eACzCJ,cAAA,CAACM,eAAe,EAAA;AAACF,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OAAE,CAAC,CAAA;AAAA,KACrC,CACP,CAAC,CAAA;AAAA,GACF,CAAC,CAAA;AAEP;;;;"}
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('source-map-support/register');
6
+ var generatorReactSdk = require('@asyncapi/generator-react-sdk');
7
+ var Constructor = require('./Constructor.js');
8
+ var Connect = require('./Connect.js');
9
+ var RegisterErrorHandler = require('./RegisterErrorHandler.js');
10
+ var HandleMessage = require('./HandleMessage.js');
11
+ var SendOperation = require('./SendOperation.js');
12
+ var generatorComponents = require('@asyncapi/generator-components');
13
+ var ModuleExport = require('./ModuleExport.js');
14
+ var jsxRuntime = require('/home/runner/work/generator/generator/node_modules/react/cjs/react-jsx-runtime.production.min.js');
15
+
16
+ function ClientClass({
17
+ clientName,
18
+ serverUrl,
19
+ title,
20
+ sendOperations
21
+ }) {
22
+ return /*#__PURE__*/jsxRuntime.jsxs(generatorReactSdk.Text, {
23
+ children: [/*#__PURE__*/jsxRuntime.jsx(generatorReactSdk.Text, {
24
+ newLines: 2,
25
+ children: `class ${clientName} {`
26
+ }), /*#__PURE__*/jsxRuntime.jsx(Constructor.Constructor, {
27
+ serverUrl: serverUrl
28
+ }), /*#__PURE__*/jsxRuntime.jsx(Connect.Connect, {
29
+ title: title
30
+ }), /*#__PURE__*/jsxRuntime.jsx(generatorComponents.RegisterMessageHandler, {
31
+ language: "javascript",
32
+ methodParams: ['handler']
33
+ }), /*#__PURE__*/jsxRuntime.jsx(RegisterErrorHandler.RegisterErrorHandler, {}), /*#__PURE__*/jsxRuntime.jsx(HandleMessage.HandleMessage, {}), /*#__PURE__*/jsxRuntime.jsx(SendOperation.SendOperation, {
34
+ sendOperations: sendOperations,
35
+ clientName: clientName
36
+ }), /*#__PURE__*/jsxRuntime.jsx(generatorComponents.CloseConnection, {
37
+ language: "javascript"
38
+ }), /*#__PURE__*/jsxRuntime.jsx(generatorReactSdk.Text, {
39
+ children: '}'
40
+ }), /*#__PURE__*/jsxRuntime.jsx(ModuleExport.ModuleExport, {
41
+ clientName: clientName
42
+ })]
43
+ });
44
+ }
45
+
46
+ exports.ClientClass = ClientClass;
47
+ //# sourceMappingURL=ClientClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientClass.js","sources":["../../../../../../../../packages/templates/clients/websocket/javascript/components/ClientClass.js"],"sourcesContent":["import { Text } from '@asyncapi/generator-react-sdk';\nimport { Constructor } from './Constructor';\nimport { Connect } from './Connect';\nimport { RegisterErrorHandler } from './RegisterErrorHandler';\nimport { HandleMessage } from './HandleMessage';\nimport { SendOperation } from './SendOperation';\nimport { CloseConnection, RegisterMessageHandler } from '@asyncapi/generator-components';\nimport { ModuleExport } from './ModuleExport';\n\nexport function ClientClass({ clientName, serverUrl, title, sendOperations}) {\n return (\n <Text>\n <Text newLines={2}>\n {`class ${clientName} {`}\n </Text>\n <Constructor serverUrl={serverUrl} />\n <Connect title={title} />\n <RegisterMessageHandler \n language=\"javascript\" \n methodParams={['handler']}\n />\n <RegisterErrorHandler />\n <HandleMessage />\n <SendOperation sendOperations={sendOperations} clientName={clientName} />\n <CloseConnection language=\"javascript\" />\n <Text>\n {'}'}\n </Text>\n <ModuleExport clientName={clientName} />\n </Text>\n );\n}\n"],"names":["ClientClass","clientName","serverUrl","title","sendOperations","_jsxs","Text","children","_jsx","newLines","Constructor","Connect","RegisterMessageHandler","language","methodParams","RegisterErrorHandler","HandleMessage","SendOperation","CloseConnection","ModuleExport"],"mappings":";;;;;;;;;;;;;;;AASO,SAASA,WAAWA,CAAC;EAAEC,UAAU;EAAEC,SAAS;EAAEC,KAAK;AAAEC,EAAAA,cAAAA;AAAc,CAAC,EAAE;EAC3E,oBACEC,eAAA,CAACC,sBAAI,EAAA;IAAAC,QAAA,EAAA,cACHC,cAAA,CAACF,sBAAI,EAAA;AAACG,MAAAA,QAAQ,EAAE,CAAE;MAAAF,QAAA,EACf,SAASN,UAAU,CAAA,EAAA,CAAA;AAAI,KACpB,CAAC,eACPO,cAAA,CAACE,uBAAW,EAAA;AAACR,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KAAE,CAAC,eACrCM,cAAA,CAACG,eAAO,EAAA;AAACR,MAAAA,KAAK,EAAEA,KAAAA;AAAM,KAAE,CAAC,eACzBK,cAAA,CAACI,0CAAsB,EAAA;AACrBC,MAAAA,QAAQ,EAAC,YAAY;MACrBC,YAAY,EAAE,CAAC,SAAS,CAAA;AAAE,KAC3B,CAAC,eACFN,cAAA,CAACO,yCAAoB,IAAE,CAAC,eACxBP,cAAA,CAACQ,2BAAa,EAAE,EAAA,CAAC,eACjBR,cAAA,CAACS,2BAAa,EAAA;AAACb,MAAAA,cAAc,EAAEA,cAAe;AAACH,MAAAA,UAAU,EAAEA,UAAAA;AAAW,KAAE,CAAC,eACzEO,cAAA,CAACU,mCAAe,EAAA;AAACL,MAAAA,QAAQ,EAAC,YAAA;AAAY,KAAE,CAAC,eACzCL,cAAA,CAACF,sBAAI,EAAA;AAAAC,MAAAA,QAAA,EACF,GAAA;AAAG,KACA,CAAC,eACPC,cAAA,CAACW,yBAAY,EAAA;AAAClB,MAAAA,UAAU,EAAEA,UAAAA;AAAW,KAAE,CAAC,CAAA;AAAA,GACpC,CAAC,CAAA;AAEX;;;;"}