@mablhq/mabl-cli 2.31.44 → 2.34.5

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/util/analytics.js CHANGED
@@ -31,9 +31,10 @@ const pureUtil_1 = require("./pureUtil");
31
31
  const os = __importStar(require("os"));
32
32
  const types_1 = require("../api/types");
33
33
  const loggingProvider_1 = require("../providers/logging/loggingProvider");
34
+ const configKeys_1 = require("../commands/config/config_cmds/configKeys");
34
35
  const Analytics = require('analytics-node');
35
36
  async function getTrackingInfo() {
36
- var _a, _b, _c;
37
+ var _a, _b, _c, _d;
37
38
  const config = await cliConfigProvider_1.CliConfigProvider.getCliConfig();
38
39
  if (config.authentication.authType === undefined) {
39
40
  return {};
@@ -45,9 +46,13 @@ async function getTrackingInfo() {
45
46
  else {
46
47
  userId = config.userId;
47
48
  }
49
+ const scmDetectionEnabled = (_c = (await cliConfigProvider_1.CliConfigProvider.getConfigProperty(configKeys_1.configKeys.enableSourceControlMetadataCollection))) !== null && _c !== void 0 ? _c : false;
48
50
  return {
49
51
  userId,
50
- workspaceId: (_c = config.workspace) === null || _c === void 0 ? void 0 : _c.id,
52
+ workspaceId: (_d = config.workspace) === null || _d === void 0 ? void 0 : _d.id,
53
+ features: {
54
+ scm_metadata: scmDetectionEnabled,
55
+ },
51
56
  };
52
57
  }
53
58
  async function trackCliEvent(commands, argumentCountMap) {
@@ -61,6 +66,7 @@ async function trackCliEvent(commands, argumentCountMap) {
61
66
  workspaceId: trackingInfo.workspaceId,
62
67
  environment: env_1.ENV,
63
68
  argumentCountMap,
69
+ features: trackingInfo.features,
64
70
  };
65
71
  await trackEvent(event, trackingInfo.userId, properties);
66
72
  }