@alagoni97/cli 0.72.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +336 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/dev.mjs +3 -0
  5. package/bin/run.cmd +3 -0
  6. package/bin/run.mjs +4 -0
  7. package/dist/LoggingInterface.d.ts +123 -0
  8. package/dist/LoggingInterface.js +300 -0
  9. package/dist/PersistedConfig.d.ts +46 -0
  10. package/dist/PersistedConfig.js +94 -0
  11. package/dist/browser/adapters/output.d.ts +69 -0
  12. package/dist/browser/adapters/output.js +91 -0
  13. package/dist/browser/config.d.ts +18 -0
  14. package/dist/browser/config.js +59 -0
  15. package/dist/browser/generate.d.ts +20 -0
  16. package/dist/browser/generate.js +129 -0
  17. package/dist/browser/index.d.ts +17 -0
  18. package/dist/browser/index.js +26 -0
  19. package/dist/browser/parser.d.ts +9 -0
  20. package/dist/browser/parser.js +61 -0
  21. package/dist/browser/shims/asyncapi-parser.d.ts +30 -0
  22. package/dist/browser/shims/asyncapi-parser.js +52 -0
  23. package/dist/browser/shims/fs.d.ts +190 -0
  24. package/dist/browser/shims/fs.js +188 -0
  25. package/dist/browser/shims/json-schema-ref-parser.d.ts +73 -0
  26. package/dist/browser/shims/json-schema-ref-parser.js +246 -0
  27. package/dist/browser/shims/swagger-parser.d.ts +20 -0
  28. package/dist/browser/shims/swagger-parser.js +40 -0
  29. package/dist/codegen/configurationSchemaBuilder.d.ts +15 -0
  30. package/dist/codegen/configurationSchemaBuilder.js +48 -0
  31. package/dist/codegen/configurations.d.ts +29 -0
  32. package/dist/codegen/configurations.js +260 -0
  33. package/dist/codegen/detection.d.ts +19 -0
  34. package/dist/codegen/detection.js +174 -0
  35. package/dist/codegen/errors.d.ts +111 -0
  36. package/dist/codegen/errors.js +352 -0
  37. package/dist/codegen/generators/generic/custom.d.ts +75 -0
  38. package/dist/codegen/generators/generic/custom.js +66 -0
  39. package/dist/codegen/generators/index.d.ts +14 -0
  40. package/dist/codegen/generators/index.js +42 -0
  41. package/dist/codegen/generators/typescript/channels/asyncapi.d.ts +10 -0
  42. package/dist/codegen/generators/typescript/channels/asyncapi.js +131 -0
  43. package/dist/codegen/generators/typescript/channels/index.d.ts +8 -0
  44. package/dist/codegen/generators/typescript/channels/index.js +142 -0
  45. package/dist/codegen/generators/typescript/channels/openapi.d.ts +9 -0
  46. package/dist/codegen/generators/typescript/channels/openapi.js +168 -0
  47. package/dist/codegen/generators/typescript/channels/protocols/amqp/index.d.ts +7 -0
  48. package/dist/codegen/generators/typescript/channels/protocols/amqp/index.js +149 -0
  49. package/dist/codegen/generators/typescript/channels/protocols/amqp/publishExchange.d.ts +5 -0
  50. package/dist/codegen/generators/typescript/channels/protocols/amqp/publishExchange.js +106 -0
  51. package/dist/codegen/generators/typescript/channels/protocols/amqp/publishQueue.d.ts +3 -0
  52. package/dist/codegen/generators/typescript/channels/protocols/amqp/publishQueue.js +102 -0
  53. package/dist/codegen/generators/typescript/channels/protocols/amqp/subscribeQueue.d.ts +3 -0
  54. package/dist/codegen/generators/typescript/channels/protocols/amqp/subscribeQueue.js +133 -0
  55. package/dist/codegen/generators/typescript/channels/protocols/eventsource/express.d.ts +3 -0
  56. package/dist/codegen/generators/typescript/channels/protocols/eventsource/express.js +100 -0
  57. package/dist/codegen/generators/typescript/channels/protocols/eventsource/fetch.d.ts +5 -0
  58. package/dist/codegen/generators/typescript/channels/protocols/eventsource/fetch.js +144 -0
  59. package/dist/codegen/generators/typescript/channels/protocols/eventsource/index.d.ts +6 -0
  60. package/dist/codegen/generators/typescript/channels/protocols/eventsource/index.js +132 -0
  61. package/dist/codegen/generators/typescript/channels/protocols/http/client.d.ts +10 -0
  62. package/dist/codegen/generators/typescript/channels/protocols/http/client.js +224 -0
  63. package/dist/codegen/generators/typescript/channels/protocols/http/common-types.d.ts +14 -0
  64. package/dist/codegen/generators/typescript/channels/protocols/http/common-types.js +800 -0
  65. package/dist/codegen/generators/typescript/channels/protocols/http/index.d.ts +8 -0
  66. package/dist/codegen/generators/typescript/channels/protocols/http/index.js +96 -0
  67. package/dist/codegen/generators/typescript/channels/protocols/http/security.d.ts +48 -0
  68. package/dist/codegen/generators/typescript/channels/protocols/http/security.js +491 -0
  69. package/dist/codegen/generators/typescript/channels/protocols/kafka/index.d.ts +6 -0
  70. package/dist/codegen/generators/typescript/channels/protocols/kafka/index.js +127 -0
  71. package/dist/codegen/generators/typescript/channels/protocols/kafka/publish.d.ts +3 -0
  72. package/dist/codegen/generators/typescript/channels/protocols/kafka/publish.js +108 -0
  73. package/dist/codegen/generators/typescript/channels/protocols/kafka/subscribe.d.ts +3 -0
  74. package/dist/codegen/generators/typescript/channels/protocols/kafka/subscribe.js +154 -0
  75. package/dist/codegen/generators/typescript/channels/protocols/kafka/utils.d.ts +11 -0
  76. package/dist/codegen/generators/typescript/channels/protocols/kafka/utils.js +58 -0
  77. package/dist/codegen/generators/typescript/channels/protocols/mqtt/index.d.ts +6 -0
  78. package/dist/codegen/generators/typescript/channels/protocols/mqtt/index.js +113 -0
  79. package/dist/codegen/generators/typescript/channels/protocols/mqtt/publish.d.ts +3 -0
  80. package/dist/codegen/generators/typescript/channels/protocols/mqtt/publish.js +99 -0
  81. package/dist/codegen/generators/typescript/channels/protocols/mqtt/subscribe.d.ts +3 -0
  82. package/dist/codegen/generators/typescript/channels/protocols/mqtt/subscribe.js +186 -0
  83. package/dist/codegen/generators/typescript/channels/protocols/nats/corePublish.d.ts +3 -0
  84. package/dist/codegen/generators/typescript/channels/protocols/nats/corePublish.js +90 -0
  85. package/dist/codegen/generators/typescript/channels/protocols/nats/coreReply.d.ts +3 -0
  86. package/dist/codegen/generators/typescript/channels/protocols/nats/coreReply.js +142 -0
  87. package/dist/codegen/generators/typescript/channels/protocols/nats/coreRequest.d.ts +3 -0
  88. package/dist/codegen/generators/typescript/channels/protocols/nats/coreRequest.js +100 -0
  89. package/dist/codegen/generators/typescript/channels/protocols/nats/coreSubscribe.d.ts +3 -0
  90. package/dist/codegen/generators/typescript/channels/protocols/nats/coreSubscribe.js +143 -0
  91. package/dist/codegen/generators/typescript/channels/protocols/nats/index.d.ts +11 -0
  92. package/dist/codegen/generators/typescript/channels/protocols/nats/index.js +224 -0
  93. package/dist/codegen/generators/typescript/channels/protocols/nats/jetstreamPublish.d.ts +3 -0
  94. package/dist/codegen/generators/typescript/channels/protocols/nats/jetstreamPublish.js +89 -0
  95. package/dist/codegen/generators/typescript/channels/protocols/nats/jetstreamPullSubscribe.d.ts +3 -0
  96. package/dist/codegen/generators/typescript/channels/protocols/nats/jetstreamPullSubscribe.js +146 -0
  97. package/dist/codegen/generators/typescript/channels/protocols/nats/jetstreamPushSubscription.d.ts +3 -0
  98. package/dist/codegen/generators/typescript/channels/protocols/nats/jetstreamPushSubscription.js +149 -0
  99. package/dist/codegen/generators/typescript/channels/protocols/nats/utils.d.ts +35 -0
  100. package/dist/codegen/generators/typescript/channels/protocols/nats/utils.js +120 -0
  101. package/dist/codegen/generators/typescript/channels/protocols/websocket/index.d.ts +7 -0
  102. package/dist/codegen/generators/typescript/channels/protocols/websocket/index.js +152 -0
  103. package/dist/codegen/generators/typescript/channels/protocols/websocket/publish.d.ts +3 -0
  104. package/dist/codegen/generators/typescript/channels/protocols/websocket/publish.js +64 -0
  105. package/dist/codegen/generators/typescript/channels/protocols/websocket/register.d.ts +3 -0
  106. package/dist/codegen/generators/typescript/channels/protocols/websocket/register.js +115 -0
  107. package/dist/codegen/generators/typescript/channels/protocols/websocket/subscribe.d.ts +3 -0
  108. package/dist/codegen/generators/typescript/channels/protocols/websocket/subscribe.js +151 -0
  109. package/dist/codegen/generators/typescript/channels/types.d.ts +181 -0
  110. package/dist/codegen/generators/typescript/channels/types.js +131 -0
  111. package/dist/codegen/generators/typescript/channels/utils.d.ts +64 -0
  112. package/dist/codegen/generators/typescript/channels/utils.js +163 -0
  113. package/dist/codegen/generators/typescript/client/index.d.ts +8 -0
  114. package/dist/codegen/generators/typescript/client/index.js +61 -0
  115. package/dist/codegen/generators/typescript/client/protocols/nats/corePublish.d.ts +6 -0
  116. package/dist/codegen/generators/typescript/client/protocols/nats/corePublish.js +53 -0
  117. package/dist/codegen/generators/typescript/client/protocols/nats/coreSubscribe.d.ts +6 -0
  118. package/dist/codegen/generators/typescript/client/protocols/nats/coreSubscribe.js +90 -0
  119. package/dist/codegen/generators/typescript/client/protocols/nats/jetStreamPullSubscription.d.ts +6 -0
  120. package/dist/codegen/generators/typescript/client/protocols/nats/jetStreamPullSubscription.js +83 -0
  121. package/dist/codegen/generators/typescript/client/protocols/nats/jetstreamPublish.d.ts +6 -0
  122. package/dist/codegen/generators/typescript/client/protocols/nats/jetstreamPublish.js +54 -0
  123. package/dist/codegen/generators/typescript/client/protocols/nats/jetstreamPushSubscription.d.ts +6 -0
  124. package/dist/codegen/generators/typescript/client/protocols/nats/jetstreamPushSubscription.js +82 -0
  125. package/dist/codegen/generators/typescript/client/protocols/nats.d.ts +2 -0
  126. package/dist/codegen/generators/typescript/client/protocols/nats.js +182 -0
  127. package/dist/codegen/generators/typescript/client/types.d.ts +49 -0
  128. package/dist/codegen/generators/typescript/client/types.js +37 -0
  129. package/dist/codegen/generators/typescript/headers.d.ts +54 -0
  130. package/dist/codegen/generators/typescript/headers.js +138 -0
  131. package/dist/codegen/generators/typescript/index.d.ts +7 -0
  132. package/dist/codegen/generators/typescript/index.js +38 -0
  133. package/dist/codegen/generators/typescript/models.d.ts +21761 -0
  134. package/dist/codegen/generators/typescript/models.js +64 -0
  135. package/dist/codegen/generators/typescript/parameters.d.ts +37 -0
  136. package/dist/codegen/generators/typescript/parameters.js +101 -0
  137. package/dist/codegen/generators/typescript/payloads.d.ts +73 -0
  138. package/dist/codegen/generators/typescript/payloads.js +250 -0
  139. package/dist/codegen/generators/typescript/types.d.ts +34 -0
  140. package/dist/codegen/generators/typescript/types.js +70 -0
  141. package/dist/codegen/generators/typescript/utils.d.ts +38 -0
  142. package/dist/codegen/generators/typescript/utils.js +195 -0
  143. package/dist/codegen/index.d.ts +7 -0
  144. package/dist/codegen/index.js +38 -0
  145. package/dist/codegen/inputs/asyncapi/generators/headers.d.ts +3 -0
  146. package/dist/codegen/inputs/asyncapi/generators/headers.js +41 -0
  147. package/dist/codegen/inputs/asyncapi/generators/parameters.d.ts +14 -0
  148. package/dist/codegen/inputs/asyncapi/generators/parameters.js +120 -0
  149. package/dist/codegen/inputs/asyncapi/generators/payloads.d.ts +16 -0
  150. package/dist/codegen/inputs/asyncapi/generators/payloads.js +124 -0
  151. package/dist/codegen/inputs/asyncapi/generators/types.d.ts +9 -0
  152. package/dist/codegen/inputs/asyncapi/generators/types.js +61 -0
  153. package/dist/codegen/inputs/asyncapi/index.d.ts +1 -0
  154. package/dist/codegen/inputs/asyncapi/index.js +7 -0
  155. package/dist/codegen/inputs/asyncapi/parser.d.ts +4 -0
  156. package/dist/codegen/inputs/asyncapi/parser.js +90 -0
  157. package/dist/codegen/inputs/index.d.ts +3 -0
  158. package/dist/codegen/inputs/index.js +19 -0
  159. package/dist/codegen/inputs/jsonschema/generators/index.d.ts +1 -0
  160. package/dist/codegen/inputs/jsonschema/generators/index.js +5 -0
  161. package/dist/codegen/inputs/jsonschema/generators/models.d.ts +7 -0
  162. package/dist/codegen/inputs/jsonschema/generators/models.js +26 -0
  163. package/dist/codegen/inputs/jsonschema/index.d.ts +1 -0
  164. package/dist/codegen/inputs/jsonschema/index.js +7 -0
  165. package/dist/codegen/inputs/jsonschema/parser.d.ts +31 -0
  166. package/dist/codegen/inputs/jsonschema/parser.js +128 -0
  167. package/dist/codegen/inputs/openapi/generators/headers.d.ts +3 -0
  168. package/dist/codegen/inputs/openapi/generators/headers.js +101 -0
  169. package/dist/codegen/inputs/openapi/generators/parameters.d.ts +10 -0
  170. package/dist/codegen/inputs/openapi/generators/parameters.js +852 -0
  171. package/dist/codegen/inputs/openapi/generators/payloads.d.ts +3 -0
  172. package/dist/codegen/inputs/openapi/generators/payloads.js +231 -0
  173. package/dist/codegen/inputs/openapi/generators/types.d.ts +9 -0
  174. package/dist/codegen/inputs/openapi/generators/types.js +86 -0
  175. package/dist/codegen/inputs/openapi/index.d.ts +2 -0
  176. package/dist/codegen/inputs/openapi/index.js +8 -0
  177. package/dist/codegen/inputs/openapi/parser.d.ts +4 -0
  178. package/dist/codegen/inputs/openapi/parser.js +115 -0
  179. package/dist/codegen/inputs/openapi/security.d.ts +56 -0
  180. package/dist/codegen/inputs/openapi/security.js +193 -0
  181. package/dist/codegen/modelina/index.d.ts +2 -0
  182. package/dist/codegen/modelina/index.js +20 -0
  183. package/dist/codegen/modelina/presets/index.d.ts +3 -0
  184. package/dist/codegen/modelina/presets/index.js +14 -0
  185. package/dist/codegen/modelina/presets/primitives.d.ts +34 -0
  186. package/dist/codegen/modelina/presets/primitives.js +211 -0
  187. package/dist/codegen/modelina/presets/union.d.ts +33 -0
  188. package/dist/codegen/modelina/presets/union.js +197 -0
  189. package/dist/codegen/modelina/presets/validation.d.ts +66 -0
  190. package/dist/codegen/modelina/presets/validation.js +183 -0
  191. package/dist/codegen/modelina/types.d.ts +61845 -0
  192. package/dist/codegen/modelina/types.js +412 -0
  193. package/dist/codegen/output/filesystem.d.ts +30 -0
  194. package/dist/codegen/output/filesystem.js +61 -0
  195. package/dist/codegen/output/index.d.ts +16 -0
  196. package/dist/codegen/output/index.js +57 -0
  197. package/dist/codegen/output/memory.d.ts +54 -0
  198. package/dist/codegen/output/memory.js +81 -0
  199. package/dist/codegen/output/modelina.d.ts +30 -0
  200. package/dist/codegen/output/modelina.js +30 -0
  201. package/dist/codegen/output/types.d.ts +47 -0
  202. package/dist/codegen/output/types.js +6 -0
  203. package/dist/codegen/renderer.d.ts +13 -0
  204. package/dist/codegen/renderer.js +309 -0
  205. package/dist/codegen/schemaPostProcess.d.ts +25 -0
  206. package/dist/codegen/schemaPostProcess.js +38 -0
  207. package/dist/codegen/types.d.ts +285187 -0
  208. package/dist/codegen/types.js +177 -0
  209. package/dist/codegen/utils.d.ts +126 -0
  210. package/dist/codegen/utils.js +373 -0
  211. package/dist/commands/base.d.ts +18 -0
  212. package/dist/commands/base.js +59 -0
  213. package/dist/commands/generate.d.ts +46 -0
  214. package/dist/commands/generate.js +305 -0
  215. package/dist/commands/init.d.ts +55 -0
  216. package/dist/commands/init.js +544 -0
  217. package/dist/commands/telemetry.d.ts +25 -0
  218. package/dist/commands/telemetry.js +115 -0
  219. package/dist/index.d.ts +29 -0
  220. package/dist/index.js +35 -0
  221. package/dist/telemetry/anonymize.d.ts +19 -0
  222. package/dist/telemetry/anonymize.js +73 -0
  223. package/dist/telemetry/collector.d.ts +26 -0
  224. package/dist/telemetry/collector.js +57 -0
  225. package/dist/telemetry/config.d.ts +32 -0
  226. package/dist/telemetry/config.js +97 -0
  227. package/dist/telemetry/events.d.ts +72 -0
  228. package/dist/telemetry/events.js +5 -0
  229. package/dist/telemetry/index.d.ts +46 -0
  230. package/dist/telemetry/index.js +91 -0
  231. package/dist/telemetry/notice.d.ts +8 -0
  232. package/dist/telemetry/notice.js +50 -0
  233. package/dist/telemetry/sender.d.ts +14 -0
  234. package/dist/telemetry/sender.js +125 -0
  235. package/dist/utils/gitignore.d.ts +66 -0
  236. package/dist/utils/gitignore.js +111 -0
  237. package/dist/utils/inputSource.d.ts +3 -0
  238. package/dist/utils/inputSource.js +26 -0
  239. package/dist/utils/refResolvers.d.ts +29 -0
  240. package/dist/utils/refResolvers.js +83 -0
  241. package/dist/utils/remoteFetch.d.ts +18 -0
  242. package/dist/utils/remoteFetch.js +64 -0
  243. package/oclif.manifest.json +510 -0
  244. package/package.json +155 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright The Linux Foundation
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,336 @@
1
+ ![The Codegen Project banner](https://github.com/user-attachments/assets/5a839f64-8ed3-49fe-84e2-899cbd7d5027)
2
+
3
+ <div align="center">
4
+
5
+ <h1>⚡️The Codegen Project⚡️</h1>
6
+
7
+ [![License](https://img.shields.io/github/license/the-codegen-project/cli)](https://github.com/the-codegen-project/cli/blob/master/LICENSE)
8
+ [![Npm latest version](https://img.shields.io/npm/v/@the-codegen-project/cli)](https://www.npmjs.com/package/@the-codegen-project/cli)
9
+ ![NPM Downloads](https://img.shields.io/npm/dw/%40the-codegen-project%2Fcli)
10
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/the-codegen-project/cli/.github%2Fworkflows%2Fruntime-testing.yml?label=runtime%20testing)
11
+ ![GitHub last commit](https://img.shields.io/github/last-commit/the-codegen-project/cli)
12
+ ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/the-codegen-project/cli/codegen.x64.pkg?label=MacOS)
13
+ ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/the-codegen-project/cli/codegen.arm64.pkg?label=MacOS)
14
+ ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/the-codegen-project/cli/codegen.x86.exe?label=Win)
15
+ ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/the-codegen-project/cli/codegen.x64.exe?label=Win)
16
+ ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/the-codegen-project/cli/codegen.tar.gz?label=Linux)
17
+ ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/the-codegen-project/cli/codegen.deb?label=Linux)
18
+ ![homebrew downloads](https://img.shields.io/homebrew/installs/dm/codegen?label=Brew%20(SOON))
19
+ ![Chocolatey Downloads](https://img.shields.io/chocolatey/dt/codegen?label=Chocolatey%20(SOON))<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
20
+ [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
21
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
22
+
23
+ <h4>Generate payload models, parameters, headers, messages, communication support functions, and much more...</h4>
24
+
25
+ [Read the Docs](https://the-codegen-project.org/docs/) | [View Demos](./examples/README.md)
26
+
27
+ </div>
28
+
29
+ <table>
30
+ <thead>
31
+ <tr>
32
+ <th width="600px"></th>
33
+ <th width="600px"></th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <tr width="600px">
38
+ <td>
39
+ <a href="./assets/videos/generate-nextjs.gif"><img src="./assets/videos/generate-nextjs.gif" width="100%"/></a>
40
+ </td>
41
+ <td>
42
+ <a href="./assets/videos/generate-typescript.gif"><img src="./assets/videos/generate-typescript.gif" width="100%"/></a>
43
+ </td>
44
+ </tr>
45
+ </tbody>
46
+ </table>
47
+
48
+ # Core Features
49
+ - 📃 From your [AsyncAPI v2 and v3](https://the-codegen-project.org/docs/inputs/asyncapi) documents, generate [payloads](https://the-codegen-project.org/docs/generators/payloads), [headers](https://the-codegen-project.org/docs/generators/headers), [parameters](https://the-codegen-project.org/docs/generators/parameters), [protocol helpers](https://the-codegen-project.org/docs/generators/channels), [full clients](https://the-codegen-project.org/docs/generators/client), [models](https://the-codegen-project.org/docs/generators/models), [simple types](https://the-codegen-project.org/docs/generators/types), or all of the above.
50
+ - 📃 From your [Swagger 2.0, or OpenAPI 3.0, and 3.1](https://the-codegen-project.org/docs/inputs/openapi) documents, generate [payloads](https://the-codegen-project.org/docs/generators/payloads), [headers](https://the-codegen-project.org/docs/generators/headers), [parameters](https://the-codegen-project.org/docs/generators/parameters), [models](https://the-codegen-project.org/docs/generators/models), [simple types](https://the-codegen-project.org/docs/generators/types), or all of the above.
51
+ - 📃 From your [JSON Schema Draft-4, Draft-6 and Draft-7](https://the-codegen-project.org/docs/inputs/jsonschema) schemas, generate [models](https://the-codegen-project.org/docs/generators/models) or [completely customize it](https://the-codegen-project.org/docs/generators/custom).
52
+ - 📊 Every generator fully customizable to fit your hearts desire
53
+ - 👀 Integrate it into any project (Demos in [Next.JS](./examples/typescript-nextjs), [TypeScript Libraries](./examples/typescript-library))
54
+ - 💅 [Create custom generators to your use-case](https://the-codegen-project.org/docs/generators/custom)
55
+ - 🗄️ Protocol agnostic generator ([NATS](https://the-codegen-project.org/docs/protocols/nats), [Kafka](https://the-codegen-project.org/docs/protocols/kafka), [MQTT](https://the-codegen-project.org/docs/protocols/mqtt), [AMQP](https://the-codegen-project.org/docs/protocols/amqp), [event-source](https://the-codegen-project.org/docs/protocols/eventsource), [HTTP Client](https://the-codegen-project.org/docs/protocols/http_client), [WebSocket](https://the-codegen-project.org/docs/protocols/websocket), read the [docs](https://the-codegen-project.org/docs#protocols) for the full list and information)
56
+ - ⭐ And much more...
57
+
58
+ # How it works
59
+ The Codegen Project is a generator that is built to live alongside your projects to help you save time in the development phase, ensuring you spend as much time on the business logic as possible. It works by using your configuration file to know what it needs to generate.
60
+
61
+ Each input has different generators and [all of them can be customized](https://the-codegen-project.org/docs/generators), or you can build your own generator [right in the configuration file](https://the-codegen-project.org/docs/generators/custom).
62
+ ```ts
63
+ export default {
64
+ inputType: 'asyncapi',
65
+ inputPath: './asyncapi.json',
66
+ language: 'typescript',
67
+ generators: [
68
+ {
69
+ preset: 'payloads',
70
+ outputPath: './src/payloads',
71
+ serializationType: 'json',
72
+ },
73
+ ...
74
+ ]
75
+ };
76
+ ```
77
+
78
+ In this example, the generator will read the AsyncAPI document located in same directory as the configuration file, and generate TypeScript models for all the payload including code to serialize the models to JSON.
79
+
80
+ # 💎 Sponsors
81
+
82
+ <div align="center">
83
+
84
+ <table>
85
+ <tr>
86
+ <td align="center" width="33%">
87
+ <a href="https://code-forge.net/" target="_blank">
88
+ <img width="200" alt="CodeForge ./assets/images/sponsors/CodeForge.png" src="https://github.com/user-attachments/assets/97afc2db-f556-4b3d-9e96-979c1fc74959" />
89
+ </a>
90
+ <br />
91
+ <strong><a href="https://code-forge.net/" target="_blank">CodeForge</a></strong>
92
+ <br />
93
+ <em>Automated SDK generation platform built on The Codegen Project</em>
94
+ </td>
95
+ </tr>
96
+ </table>
97
+
98
+ </div>
99
+
100
+ ---
101
+
102
+ # Getting started
103
+ Its simple, [install the CLI](#install) into your project or machine, [setup the Codegen configuration file](#initialize) to include all the code your heart desire, customize it, and generate it at build time or whenever you feel like it.
104
+
105
+ ## Install
106
+ Installing the CLI can be done inside a project or within your system.
107
+
108
+ <table style="table-layout: fixed;">
109
+ <tr style="height: 50px;">
110
+ <th>Package manager</th>
111
+ <th>MacOS x64</th>
112
+ <th>MacOS arm64</th>
113
+ <th>Windows x64</th>
114
+ <th>Windows x32</th>
115
+ <th>Linux (Debian)</th>
116
+ <th>Linux (Others)</th>
117
+ </tr>
118
+ <tr>
119
+ <td style="vertical-align: top; min-width: 300px;">
120
+ <div>
121
+
122
+ #### NPM
123
+
124
+ ```sh
125
+ npm install --save-dev @the-codegen-project/cli
126
+
127
+ npm install -g @the-codegen-project/cli
128
+ ```
129
+
130
+ #### Yarn
131
+
132
+ ```sh
133
+ yarn add @the-codegen-project/cli
134
+ ```
135
+
136
+ #### Pnpm
137
+
138
+ ```sh
139
+ pnpm add @the-codegen-project/cli
140
+ ```
141
+
142
+ #### Bun
143
+
144
+ ```sh
145
+ bun add @the-codegen-project/cli
146
+ ```
147
+
148
+ </div>
149
+ </td>
150
+ <td style="vertical-align: top;">
151
+ <div>
152
+
153
+ #### Download
154
+ ```sh
155
+ curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.x64.pkg
156
+ ```
157
+
158
+ #### Install
159
+ ```sh
160
+ sudo installer -pkg codegen.x64.pkg -target /
161
+ ```
162
+
163
+ </div>
164
+ </td>
165
+ <td style="vertical-align: top;">
166
+ <div>
167
+
168
+ #### Download
169
+ ```sh
170
+ curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.arm64.pkg
171
+ ```
172
+ #### Install
173
+
174
+ ```sh
175
+ sudo installer -pkg codegen.arm64.pkg -target /
176
+ ```
177
+ </div>
178
+ </td>
179
+ <td style="vertical-align: top;">
180
+ <div>
181
+ <a href="https://github.com/the-codegen-project/cli/releases/latest/download/codegen.x64.exe">Download and run codegen.x64.exe</a>
182
+ </div>
183
+ </td>
184
+ <td style="vertical-align: top;">
185
+ <div>
186
+ <a href="https://github.com/the-codegen-project/cli/releases/latest/download/codegen.x86.exe">Download and run codegen.x86.exe</a>
187
+ </div>
188
+ </td>
189
+ <td style="vertical-align: top;">
190
+ <div>
191
+
192
+ #### Download
193
+ ```sh
194
+ curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.deb
195
+ ```
196
+
197
+ #### Install
198
+ ```sh
199
+ sudo apt install ./codegen.deb
200
+ ```
201
+ </div>
202
+ </td>
203
+ <td style="vertical-align: top;">
204
+ <div>
205
+
206
+ #### Download
207
+ ```sh
208
+ curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.tar.gz
209
+ ```
210
+
211
+ #### Install
212
+
213
+ ```sh
214
+ tar -xzf codegen.tar.gz
215
+ ```
216
+
217
+ #### Symlink
218
+ ```sh
219
+ ln -s <absolute-path>/bin/codegen /usr/local/bin/codegen
220
+ ```
221
+
222
+ </div>
223
+ </td>
224
+ </tr>
225
+ </table>
226
+
227
+ You can find all the possible commands in [the usage documentation](https://the-codegen-project.org/docs/usage).
228
+
229
+ ## Initialize
230
+ Add a configuration file, either manually or through the CLI;
231
+ ```sh
232
+ codegen init
233
+ ```
234
+
235
+ <div align="center">
236
+
237
+
238
+ [![Initialize The Codegen Project](./assets/videos/initialize.gif)](./assets/videos/initialize.gif)
239
+
240
+ [Customize it to your heart's desire!](https://the-codegen-project.org/docs/generators)
241
+
242
+ </div>
243
+
244
+ ## Generate
245
+ With your configuration file in hand, time to generate the code and use it! This can be done manually or integrate into your build process. Checkout [all the examples](./examples/) for inspiration on how to do it.
246
+
247
+ ### Basic Generation
248
+ ```sh
249
+ # Generate code once
250
+ codegen generate
251
+
252
+ # Generate with specific config file
253
+ codegen generate ./my-config.js
254
+ ```
255
+
256
+ ### Watch Mode (Development)
257
+ For development workflows, use watch mode to automatically regenerate code when your input files change:
258
+
259
+ ```sh
260
+ # Watch for changes in the input file specified in your config
261
+ codegen generate --watch
262
+
263
+ # Watch for changes in a specific file or directory
264
+ codegen generate --watch --watchPath ./asyncapi
265
+
266
+ # Short form
267
+ codegen generate -w -p ./schemas/
268
+ ```
269
+
270
+ Watch mode is perfect for development environments where you want your generated code to stay in sync with your API specifications as you make changes.
271
+
272
+ # 👀 Goals
273
+ Besides the [milestones](https://github.com/the-codegen-project/cli/milestones), we have certain goals that we want to reach for various reasons;
274
+ - [ ] ⭐ Reach 50 stars - So we can publish the CLI on Brew and Chocolatey
275
+ - [X] 📃 3 Published resources (blog post, video, etc)
276
+
277
+ # 📃 Resources
278
+ People who have been so kind to write or talk about The Codegen Project;
279
+ - [AsyncAPI - Simplifying Channels Into One](https://the-codegen-project.org/blog/asyncapi-client-generator/)
280
+ - [AsyncAPI - Protocol-Specific Messaging Functions](https://the-codegen-project.org/blog/asyncapi-channel-generator/)
281
+ - [AsyncAPI - Dynamic Channel Routing Made Type-Safe](https://the-codegen-project.org/blog/asyncapi-parameters-generator/)
282
+ - [AsyncAPI - Type safety Never Publish to Wrong Channels Again](https://the-codegen-project.org/blog/asyncapi-types-generator/)
283
+ - [AsyncAPI - Type-Safe Headers](https://the-codegen-project.org/blog/asyncapi-headers-generator/)
284
+ - [AsyncAPI - Stop wasting time on payloads](https://the-codegen-project.org/blog/asyncapi-payload-generator)
285
+ - [The Codegen Project - 1 Months of Progress](https://the-codegen-project.org/blog/update-2)
286
+ - [The Codegen Project - AsyncAPI Extensions](https://the-codegen-project.org/blog/asyncapi-customizing-outputs)
287
+ - [The Codegen Project - 5 Months of Progress](https://the-codegen-project.org/blog/update-1)
288
+
289
+
290
+ # Telemetry
291
+
292
+ The Codegen Project CLI collects **anonymous** usage data to help us understand how the tool is being used and make data-driven improvements. We take your privacy seriously:
293
+
294
+ - ✅ **What we collect**: Command usage, generator types, input source types (not actual paths), error categories
295
+ - ❌ **What we DON'T collect**: File paths, file contents, personal information, project names
296
+
297
+ **To disable telemetry**:
298
+ ```bash
299
+ codegen telemetry disable
300
+ ```
301
+
302
+ Or set an environment variable:
303
+ ```bash
304
+ export CODEGEN_TELEMETRY_DISABLED=1
305
+ # or
306
+ export DO_NOT_TRACK=1
307
+ ```
308
+
309
+ [Learn more about telemetry →](https://the-codegen-project.org/docs/telemetry)
310
+
311
+ # Contribution Guidelines
312
+
313
+ We have made quite a [comprehensive contribution guide](https://the-codegen-project.org/docs/contributing) to give you a lending hand in how the project is structured and how to contribute to it.
314
+
315
+ ## Contributors
316
+
317
+ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
318
+
319
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
320
+ <!-- prettier-ignore-start -->
321
+ <!-- markdownlint-disable -->
322
+ <table>
323
+ <tbody>
324
+ <tr>
325
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/jonaslagoni"><img src="https://avatars.githubusercontent.com/u/13396189?v=4?s=100" width="100px;" alt="Jonas Lagoni"/><br /><sub><b>Jonas Lagoni</b></sub></a><br /><a href="https://github.com/the-codegen-project/cli/issues?q=author%3Ajonaslagoni" title="Bug reports">🐛</a> <a href="https://github.com/the-codegen-project/cli/commits?author=jonaslagoni" title="Code">💻</a> <a href="https://github.com/the-codegen-project/cli/commits?author=jonaslagoni" title="Documentation">📖</a> <a href="#ideas-jonaslagoni" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-jonaslagoni" title="Maintenance">🚧</a> <a href="#question-jonaslagoni" title="Answering Questions">💬</a> <a href="https://github.com/the-codegen-project/cli/commits?author=jonaslagoni" title="Tests">⚠️</a> <a href="https://github.com/the-codegen-project/cli/pulls?q=is%3Apr+reviewed-by%3Ajonaslagoni" title="Reviewed Pull Requests">👀</a></td>
326
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/ALagoni97"><img src="https://avatars.githubusercontent.com/u/68890168?v=4?s=100" width="100px;" alt="Lagoni"/><br /><sub><b>Lagoni</b></sub></a><br /><a href="https://github.com/the-codegen-project/cli/issues?q=author%3AALagoni97" title="Bug reports">🐛</a> <a href="#maintenance-ALagoni97" title="Maintenance">🚧</a> <a href="#projectManagement-ALagoni97" title="Project Management">📆</a> <a href="https://github.com/the-codegen-project/cli/pulls?q=is%3Apr+reviewed-by%3AALagoni97" title="Reviewed Pull Requests">👀</a></td>
327
+ </tr>
328
+ </tbody>
329
+ </table>
330
+
331
+ <!-- markdownlint-restore -->
332
+ <!-- prettier-ignore-end -->
333
+
334
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
335
+
336
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!
package/bin/dev.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev.mjs" %*
package/bin/dev.mjs ADDED
@@ -0,0 +1,3 @@
1
+
2
+ import {execute} from '@oclif/core';
3
+ await execute({development: true, dir: import.meta.url});
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run.mjs" %*
package/bin/run.mjs ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {execute} from '@oclif/core';
4
+ await execute({dir: import.meta.url});