@asyncapi/cli 1.9.3 → 1.10.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.
@@ -5,6 +5,7 @@ export default class Analytics extends Command {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
6
  disable: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  enable: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ status: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
9
  };
9
10
  run(): Promise<void>;
10
11
  }
@@ -16,17 +16,25 @@ class Analytics extends base_1.default {
16
16
  const analyticsConfigFileContent = JSON.parse(yield readFile((0, path_1.resolve)(analyticsConfigFile), { encoding: 'utf8' }));
17
17
  if (flags.disable) {
18
18
  analyticsConfigFileContent.analyticsEnabled = 'false';
19
- this.log('Analytics disabled.');
19
+ this.log('\nAnalytics disabled.\n');
20
20
  }
21
21
  else if (flags.enable) {
22
22
  analyticsConfigFileContent.analyticsEnabled = 'true';
23
- this.log('Analytics enabled.');
23
+ this.log('\nAnalytics enabled.\n');
24
24
  }
25
- else {
26
- this.log('\nPlease append the "--disable" flag to the command in case you prefer to disable analytics, or use the "--enable" flag if you want to enable analytics back again.\n');
25
+ else if (!flags.status) {
26
+ this.log('\nPlease append the "--disable" flag to the command in case you prefer to disable analytics, or use the "--enable" flag if you want to enable analytics back again. In case you do not know the analytics current status, then you can append the "--status" flag to be aware of it.\n');
27
27
  return;
28
28
  }
29
29
  yield writeFile(analyticsConfigFile, JSON.stringify(analyticsConfigFileContent), { encoding: 'utf8' });
30
+ if (flags.status) {
31
+ if (analyticsConfigFileContent.analyticsEnabled === 'true') {
32
+ this.log('\nAnalytics are enabled.\n');
33
+ }
34
+ else {
35
+ this.log('\nAnalytics are disabled. Please append the "--enable" flag to the command in case you prefer to enable analytics.\n');
36
+ }
37
+ }
30
38
  }
31
39
  catch (e) {
32
40
  switch (e.code) {
@@ -49,4 +57,5 @@ Analytics.flags = {
49
57
  help: core_1.Flags.help({ char: 'h' }),
50
58
  disable: core_1.Flags.boolean({ char: 'd', description: 'disable analytics', default: false }),
51
59
  enable: core_1.Flags.boolean({ char: 'e', description: 'enable analytics', default: false }),
60
+ status: core_1.Flags.boolean({ char: 's', description: 'show current status of analytics' }),
52
61
  };
@@ -427,6 +427,13 @@
427
427
  "name": "enable",
428
428
  "allowNo": false,
429
429
  "type": "boolean"
430
+ },
431
+ "status": {
432
+ "char": "s",
433
+ "description": "show current status of analytics",
434
+ "name": "status",
435
+ "allowNo": false,
436
+ "type": "boolean"
430
437
  }
431
438
  },
432
439
  "hasDynamicHelp": false,
@@ -1429,5 +1436,5 @@
1429
1436
  ]
1430
1437
  }
1431
1438
  },
1432
- "version": "1.9.3"
1439
+ "version": "1.10.0"
1433
1440
  }
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": "1.9.3",
4
+ "version": "1.10.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run_bin"