@acmekit/telemetry 2.13.44 → 2.13.46

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.
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.js"],"names":[],"mappings":";AAOA;IAGM,2CAAyE;IAM3E,qBAAuC;IAEvC,mBAA+D;IAGjE,uBAEC;IAED,wBAEC;IAED,2BAOC;IAED,4CASC;IAED,0BAEC;IAED,qCAEC;CACF;oCArDmC,yBAAyB;wBAHrC,aAAa;wBAKb,qBAAqB"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.js"],"names":[],"mappings":";AAOA;IAGM,2CAAyE;IAM3E,qBAAuC;IAEvC,mBAAgE;IAGlE,uBAEC;IAED,wBAEC;IAED,2BAOC;IAED,4CASC;IAED,0BAEC;IAED,qCAEC;CACF;oCArDmC,yBAAyB;wBAHrC,aAAa;wBAKb,qBAAqB"}
package/dist/store.js CHANGED
@@ -18,7 +18,7 @@ class Store {
18
18
  }
19
19
  const baseDir = path_1.default.dirname(this.config_.path);
20
20
  this.outbox_ = new outbox_store_1.default(baseDir);
21
- this.disabled_ = (0, is_truthy_1.default)(process.env.MEDUSA_DISABLE_TELEMETRY);
21
+ this.disabled_ = (0, is_truthy_1.default)(process.env.ACMEKIT_DISABLE_TELEMETRY);
22
22
  }
23
23
  getQueueSize() {
24
24
  return this.outbox_.getSize();
package/dist/telemeter.js CHANGED
@@ -14,7 +14,7 @@ const get_term_program_1 = __importDefault(require("./util/get-term-program"));
14
14
  const is_ci_1 = require("./util/is-ci");
15
15
  const is_truthy_1 = __importDefault(require("./util/is-truthy"));
16
16
  const show_notification_1 = __importDefault(require("./util/show-notification"));
17
- const MEDUSA_TELEMETRY_VERBOSE = process.env.MEDUSA_TELEMETRY_VERBOSE || false;
17
+ const ACMEKIT_TELEMETRY_VERBOSE = process.env.ACMEKIT_TELEMETRY_VERBOSE || false;
18
18
  class Telemeter {
19
19
  constructor(options = {}) {
20
20
  this.store_ = new store_1.default();
@@ -82,7 +82,7 @@ class Telemeter {
82
82
  return version;
83
83
  }
84
84
  catch (e) {
85
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
85
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
86
86
  console.error("failed to get acmekit version", e);
87
87
  }
88
88
  }
@@ -95,7 +95,7 @@ class Telemeter {
95
95
  return version;
96
96
  }
97
97
  catch (e) {
98
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
98
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
99
99
  console.error("failed to get acmekit version", e);
100
100
  }
101
101
  }
@@ -6,18 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const path_1 = require("path");
7
7
  const child_process_1 = require("child_process");
8
8
  const is_truthy_1 = __importDefault(require("./is-truthy"));
9
- const MEDUSA_TELEMETRY_VERBOSE = process.env.MEDUSA_TELEMETRY_VERBOSE || false;
9
+ const ACMEKIT_TELEMETRY_VERBOSE = process.env.ACMEKIT_TELEMETRY_VERBOSE || false;
10
10
  function createFlush(enabled) {
11
11
  if (!enabled) {
12
12
  return;
13
13
  }
14
14
  return async function flush() {
15
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
15
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
16
16
  console.log("Flushing queue...");
17
17
  }
18
18
  const forked = (0, child_process_1.fork)((0, path_1.join)(__dirname, `send.js`), {
19
19
  detached: true,
20
- stdio: MEDUSA_TELEMETRY_VERBOSE ? `inherit` : `ignore`,
20
+ stdio: ACMEKIT_TELEMETRY_VERBOSE ? `inherit` : `ignore`,
21
21
  execArgv: [],
22
22
  });
23
23
  forked.unref();
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const path_1 = __importDefault(require("path"));
7
7
  const fs_1 = require("fs");
8
8
  const is_truthy_1 = __importDefault(require("./is-truthy"));
9
- const MEDUSA_TELEMETRY_VERBOSE = process.env.MEDUSA_TELEMETRY_VERBOSE || false;
9
+ const ACMEKIT_TELEMETRY_VERBOSE = process.env.ACMEKIT_TELEMETRY_VERBOSE || false;
10
10
  class Outbox {
11
11
  constructor(baseDir) {
12
12
  this.eventsJsonFileName = `events.json`;
@@ -18,7 +18,7 @@ class Outbox {
18
18
  (0, fs_1.appendFileSync)(this.bufferFilePath, event, `utf8`);
19
19
  }
20
20
  catch (e) {
21
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
21
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
22
22
  console.error("Failed to append to buffer", e);
23
23
  }
24
24
  }
@@ -32,7 +32,7 @@ class Outbox {
32
32
  return stats.size;
33
33
  }
34
34
  catch (e) {
35
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
35
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
36
36
  console.error("Failed to get outbox size", e);
37
37
  }
38
38
  }
@@ -49,7 +49,7 @@ class Outbox {
49
49
  return lines.length - 1;
50
50
  }
51
51
  catch (e) {
52
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
52
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
53
53
  console.error("Failed to get outbox count", e);
54
54
  }
55
55
  }
@@ -73,14 +73,14 @@ class Outbox {
73
73
  success = await flushOperation(contents);
74
74
  }
75
75
  catch (e) {
76
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
76
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
77
77
  console.error("Failed to perform file flush", e);
78
78
  }
79
79
  }
80
80
  finally {
81
81
  // if sending fails, we write the data back to the log
82
82
  if (!success) {
83
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
83
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
84
84
  console.error("File flush did not succeed - writing back to file", success);
85
85
  }
86
86
  this.appendToBuffer(contents);
@@ -99,7 +99,7 @@ class Outbox {
99
99
  return true;
100
100
  }
101
101
  catch (e) {
102
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
102
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
103
103
  console.error("Failed to perform flush", e);
104
104
  }
105
105
  }
package/dist/util/send.js CHANGED
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const telemetry_dispatcher_1 = __importDefault(require("./telemetry-dispatcher"));
7
- const MEDUSA_TELEMETRY_HOST = process.env.MEDUSA_TELEMETRY_HOST || "";
8
- const MEDUSA_TELEMETRY_PATH = process.env.MEDUSA_TELEMETRY_PATH || "";
7
+ const ACMEKIT_TELEMETRY_HOST = process.env.ACMEKIT_TELEMETRY_HOST || "";
8
+ const ACMEKIT_TELEMETRY_PATH = process.env.ACMEKIT_TELEMETRY_PATH || "";
9
9
  const dispatcher = new telemetry_dispatcher_1.default({
10
- host: MEDUSA_TELEMETRY_HOST,
11
- path: MEDUSA_TELEMETRY_PATH,
10
+ host: ACMEKIT_TELEMETRY_HOST,
11
+ path: ACMEKIT_TELEMETRY_PATH,
12
12
  });
13
13
  dispatcher.dispatch();
@@ -9,7 +9,7 @@ const axios_retry_1 = __importDefault(require("axios-retry"));
9
9
  const show_notification_1 = __importDefault(require("./show-notification"));
10
10
  const store_1 = __importDefault(require("../store"));
11
11
  const is_truthy_1 = __importDefault(require("./is-truthy"));
12
- const MEDUSA_TELEMETRY_VERBOSE = process.env.MEDUSA_TELEMETRY_VERBOSE || false;
12
+ const ACMEKIT_TELEMETRY_VERBOSE = process.env.ACMEKIT_TELEMETRY_VERBOSE || false;
13
13
  class TelemetryDispatcher {
14
14
  constructor(options) {
15
15
  this.store_ = new store_1.default();
@@ -48,7 +48,7 @@ class TelemetryDispatcher {
48
48
  }
49
49
  await this.store_.flushEvents(async (events) => {
50
50
  if (!events.length) {
51
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
51
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
52
52
  console.log("No events to POST - skipping");
53
53
  }
54
54
  return true;
@@ -63,13 +63,13 @@ class TelemetryDispatcher {
63
63
  return await this.axiosInstance
64
64
  .post(`${this.host}${this.path}`, data, req)
65
65
  .then(() => {
66
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
66
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
67
67
  console.log("POSTing batch succeeded");
68
68
  }
69
69
  return true;
70
70
  })
71
71
  .catch(e => {
72
- if ((0, is_truthy_1.default)(MEDUSA_TELEMETRY_VERBOSE)) {
72
+ if ((0, is_truthy_1.default)(ACMEKIT_TELEMETRY_VERBOSE)) {
73
73
  console.error("Failed to POST event batch", e);
74
74
  }
75
75
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acmekit/telemetry",
3
- "version": "2.13.44",
3
+ "version": "2.13.46",
4
4
  "description": "Telemetry for AcmeKit",
5
5
  "main": "dist/index.js",
6
6
  "repository": {