@asyncapi/cli 0.40.8 → 0.41.0

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.
package/README.md CHANGED
@@ -76,6 +76,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc
76
76
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/sambhavgupta0705"><img src="https://avatars.githubusercontent.com/u/81870866?v=4?s=100" width="100px;" alt="Sambhav Gupta"/><br /><sub><b>Sambhav Gupta</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=sambhavgupta0705" title="Code">💻</a> <a href="https://github.com/asyncapi/cli/commits?author=sambhavgupta0705" title="Tests">⚠️</a></td>
77
77
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/CyberHippo"><img src="https://avatars.githubusercontent.com/u/18269437?v=4?s=100" width="100px;" alt="Hippolyte Vergnol"/><br /><sub><b>Hippolyte Vergnol</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=CyberHippo" title="Code">💻</a> <a href="#infra-CyberHippo" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
78
78
  <td align="center" valign="top" width="14.28%"><a href="https://www.jentevets.com"><img src="https://avatars.githubusercontent.com/u/22449126?v=4?s=100" width="100px;" alt="Jente Vets"/><br /><sub><b>Jente Vets</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=Vetsoo" title="Code">💻</a></td>
79
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/kaushik-rishi"><img src="https://avatars.githubusercontent.com/u/52498617?v=4?s=100" width="100px;" alt="Rishi"/><br /><sub><b>Rishi</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=kaushik-rishi" title="Code">💻</a></td>
79
80
  </tr>
80
81
  </tbody>
81
82
  </table>
@@ -32,9 +32,12 @@ export default class Models extends Command {
32
32
  */
33
33
  packageName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
34
34
  /**
35
- * C# specific options
35
+ * C++ and C# specific namespace to use for the generated models
36
36
  */
37
37
  namespace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
38
+ /**
39
+ * C# specific options
40
+ */
38
41
  csharpAutoImplement: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
39
42
  csharpArrayType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
40
43
  };
@@ -17,6 +17,8 @@ var Languages;
17
17
  Languages["python"] = "python";
18
18
  Languages["rust"] = "rust";
19
19
  Languages["kotlin"] = "kotlin";
20
+ Languages["php"] = "php";
21
+ Languages["cplusplus"] = "cplusplus";
20
22
  })(Languages || (Languages = {}));
21
23
  const possibleLanguageValues = Object.values(Languages).join(', ');
22
24
  class Models extends base_1.default {
@@ -96,6 +98,14 @@ class Models extends base_1.default {
96
98
  namespace
97
99
  };
98
100
  break;
101
+ case Languages.cplusplus:
102
+ if (namespace === undefined) {
103
+ throw new Error('In order to generate models to C++, we need to know which namespace they are under. Add `--namespace=NAMESPACE` to set the desired namespace.');
104
+ }
105
+ fileGenerator = new modelina_1.CplusplusFileGenerator({
106
+ namespace
107
+ });
108
+ break;
99
109
  case Languages.golang:
100
110
  if (packageName === undefined) {
101
111
  throw new Error('In order to generate models to Go, we need to know which package they are under. Add `--packageName=PACKAGENAME` to set the desired package name.');
@@ -135,6 +145,15 @@ class Models extends base_1.default {
135
145
  packageName
136
146
  };
137
147
  break;
148
+ case Languages.php:
149
+ if (namespace === undefined) {
150
+ throw new Error('In order to generate models to PHP, we need to know which namespace they are under. Add `--namespace=NAMESPACE` to set the desired namespace.');
151
+ }
152
+ fileGenerator = new modelina_1.PhpFileGenerator();
153
+ fileOptions = {
154
+ namespace
155
+ };
156
+ break;
138
157
  default:
139
158
  throw new Error(`Could not determine generator for language ${language}, are you using one of the following values ${possibleLanguageValues}?`);
140
159
  }
@@ -215,12 +234,16 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
215
234
  required: false
216
235
  }),
217
236
  /**
218
- * C# specific options
237
+ * C++ and C# specific namespace to use for the generated models
219
238
  */
220
239
  namespace: core_1.Flags.string({
221
- description: 'C# specific, define the namespace to use for the generated models. This is required when language is `csharp`.',
240
+ description: 'C#, C++ and PHP specific, define the namespace to use for the generated models. This is required when language is `csharp`,`c++` or `php`.',
222
241
  required: false
223
- }), csharpAutoImplement: core_1.Flags.boolean({
242
+ }),
243
+ /**
244
+ * C# specific options
245
+ */
246
+ csharpAutoImplement: core_1.Flags.boolean({
224
247
  description: 'C# specific, define whether to generate auto-implemented properties or not.',
225
248
  required: false,
226
249
  default: false
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.40.8",
2
+ "version": "0.41.0",
3
3
  "commands": {
4
4
  "bundle": {
5
5
  "id": "bundle",
@@ -542,7 +542,7 @@
542
542
  "namespace": {
543
543
  "name": "namespace",
544
544
  "type": "option",
545
- "description": "C# specific, define the namespace to use for the generated models. This is required when language is `csharp`.",
545
+ "description": "C#, C++ and PHP specific, define the namespace to use for the generated models. This is required when language is `csharp`,`c++` or `php`.",
546
546
  "required": false,
547
547
  "multiple": false
548
548
  },
@@ -617,7 +617,9 @@
617
617
  "dart",
618
618
  "python",
619
619
  "rust",
620
- "kotlin"
620
+ "kotlin",
621
+ "php",
622
+ "cplusplus"
621
623
  ]
622
624
  },
623
625
  "file": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@asyncapi/cli",
3
3
  "description": "All in one CLI for all AsyncAPI tools",
4
- "version": "0.40.8",
4
+ "version": "0.41.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"
@@ -13,7 +13,7 @@
13
13
  "@asyncapi/converter": "^1.2.0",
14
14
  "@asyncapi/diff": "^0.4.1",
15
15
  "@asyncapi/generator": "^1.10.0",
16
- "@asyncapi/modelina": "^1.6.0",
16
+ "@asyncapi/modelina": "^1.6.1",
17
17
  "@asyncapi/openapi-schema-parser": "^3.0.0",
18
18
  "@asyncapi/optimizer": "^0.1.18",
19
19
  "@asyncapi/parser": "^2.0.0",