@asyncapi/cli 0.49.0 → 0.50.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.
@@ -27,6 +27,7 @@ export default class Models extends Command {
27
27
  tsIncludeComments: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
28
28
  tsExportType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
29
29
  tsJsonBinPack: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
30
+ tsMarshalling: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
30
31
  /**
31
32
  * Go and Java specific package name to use for the generated models
32
33
  */
@@ -26,7 +26,7 @@ class Models extends base_1.default {
26
26
  run() {
27
27
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
28
  const { args, flags } = yield this.parse(Models);
29
- const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, namespace, csharpAutoImplement, csharpArrayType, csharpNewtonsoft, csharpHashcode, csharpEqual, csharpSystemJson, packageName, output } = flags;
29
+ const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, tsMarshalling, namespace, csharpAutoImplement, csharpArrayType, csharpNewtonsoft, csharpHashcode, csharpEqual, csharpSystemJson, packageName, output } = flags;
30
30
  const { language, file } = args;
31
31
  const inputFile = (yield (0, SpecificationFile_1.load)(file)) || (yield (0, SpecificationFile_1.load)());
32
32
  const { document, diagnostics, status } = yield (0, parser_1.parse)(this, inputFile, flags);
@@ -65,6 +65,14 @@ class Models extends base_1.default {
65
65
  }
66
66
  }, modelina_1.TS_JSONBINPACK_PRESET);
67
67
  }
68
+ if (tsMarshalling) {
69
+ presets.push({
70
+ preset: modelina_1.TS_COMMON_PRESET,
71
+ options: {
72
+ marshalling: true
73
+ }
74
+ });
75
+ }
68
76
  fileGenerator = new modelina_1.TypeScriptFileGenerator({
69
77
  modelType: tsModelType,
70
78
  enumType: tsEnumType,
@@ -243,6 +251,10 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
243
251
  description: 'TypeScript specific, define basic support for serializing to and from binary with jsonbinpack.',
244
252
  required: false,
245
253
  default: false,
254
+ }), tsMarshalling: core_1.Flags.boolean({
255
+ description: 'TypeScript specific, generate the models with marshalling functions.',
256
+ required: false,
257
+ default: false,
246
258
  }),
247
259
  /**
248
260
  * Go and Java specific package name to use for the generated models
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.49.0",
2
+ "version": "0.50.0",
3
3
  "commands": {
4
4
  "bundle": {
5
5
  "id": "bundle",
@@ -569,6 +569,13 @@
569
569
  "required": false,
570
570
  "allowNo": false
571
571
  },
572
+ "tsMarshalling": {
573
+ "name": "tsMarshalling",
574
+ "type": "boolean",
575
+ "description": "TypeScript specific, generate the models with marshalling functions.",
576
+ "required": false,
577
+ "allowNo": false
578
+ },
572
579
  "packageName": {
573
580
  "name": "packageName",
574
581
  "type": "option",
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.49.0",
4
+ "version": "0.50.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"