@salesforce/telemetry 3.0.1 → 3.2.1

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/CHANGELOG.md CHANGED
@@ -2,201 +2,140 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [3.0.1](https://github.com/forcedotcom/telemetry/compare/v3.0.0...v3.0.1) (2021-11-17)
6
-
5
+ ### [3.2.1](https://github.com/forcedotcom/telemetry/compare/v3.2.0...v3.2.1) (2022-05-06)
7
6
 
8
7
  ### Bug Fixes
9
8
 
10
- * release 3.0.1 ([050953a](https://github.com/forcedotcom/telemetry/commit/050953a117a4f3c6c5a2100d2a47e80719e64976))
11
- * replace homedir ([2bcb2ed](https://github.com/forcedotcom/telemetry/commit/2bcb2ede66dc7ef3c14cb40d530fb34530b84147))
12
- * sanitizing exception strings ([b12c52c](https://github.com/forcedotcom/telemetry/commit/b12c52cad97b736bcb0e5968c8427ae89f0d8397))
13
- * sinon types match sinon ([4cbefbf](https://github.com/forcedotcom/telemetry/commit/4cbefbf4ded50b4fdd1f451e27aba449c886b481))
14
-
15
- ## 3.0.0 (2021-07-08)
9
+ - bump to core 3 ([#42](https://github.com/forcedotcom/telemetry/issues/42)) ([9ab8b09](https://github.com/forcedotcom/telemetry/commit/9ab8b093cc8116bde47e8688298f5ac7742c3944))
16
10
 
11
+ ## [3.2.0](https://github.com/forcedotcom/telemetry/compare/v3.0.0...v3.2.0) (2022-01-06)
17
12
 
18
13
  ### Features
19
14
 
20
- * publish ([9336302](https://github.com/forcedotcom/telemetry/commit/9336302f15b43bd824ec70fe604e05a6bb2f5ba2))
21
-
22
- ## [2.0.6](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.5...@salesforce/telemetry@2.0.6) (2021-05-11)
15
+ - bump version of core and axios ([376ae9c](https://github.com/forcedotcom/telemetry/commit/376ae9c2c2c26517f2ede7e1ac7b065caeca9390))
23
16
 
24
- **Note:** Version bump only for package @salesforce/telemetry
17
+ ### Bug Fixes
25
18
 
19
+ - release 3.0.1 ([050953a](https://github.com/forcedotcom/telemetry/commit/050953a117a4f3c6c5a2100d2a47e80719e64976))
20
+ - replace homedir ([2bcb2ed](https://github.com/forcedotcom/telemetry/commit/2bcb2ede66dc7ef3c14cb40d530fb34530b84147))
21
+ - sanitizing exception strings ([b12c52c](https://github.com/forcedotcom/telemetry/commit/b12c52cad97b736bcb0e5968c8427ae89f0d8397))
22
+ - sinon types match sinon ([4cbefbf](https://github.com/forcedotcom/telemetry/commit/4cbefbf4ded50b4fdd1f451e27aba449c886b481))
23
+ - typescript bump and fixes ([012bcff](https://github.com/forcedotcom/telemetry/commit/012bcffee2655705b0e97684eec20b81d3f9e6f2))
26
24
 
25
+ ## 3.0.0 (2021-07-08)
27
26
 
27
+ ### Features
28
28
 
29
+ - publish ([9336302](https://github.com/forcedotcom/telemetry/commit/9336302f15b43bd824ec70fe604e05a6bb2f5ba2))
29
30
 
30
- ## [2.0.5](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.4...@salesforce/telemetry@2.0.5) (2021-01-22)
31
+ ## [2.0.6](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.5...@salesforce/telemetry@2.0.6) (2021-05-11)
31
32
 
32
33
  **Note:** Version bump only for package @salesforce/telemetry
33
34
 
35
+ ## [2.0.5](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.4...@salesforce/telemetry@2.0.5) (2021-01-22)
34
36
 
35
-
36
-
37
+ **Note:** Version bump only for package @salesforce/telemetry
37
38
 
38
39
  ## [2.0.4](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.3...@salesforce/telemetry@2.0.4) (2020-11-13)
39
40
 
40
41
  **Note:** Version bump only for package @salesforce/telemetry
41
42
 
42
-
43
-
44
-
45
-
46
43
  ## [2.0.3](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.2...@salesforce/telemetry@2.0.3) (2020-11-11)
47
44
 
48
45
  **Note:** Version bump only for package @salesforce/telemetry
49
46
 
50
-
51
-
52
-
53
-
54
47
  ## [2.0.2](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.1...@salesforce/telemetry@2.0.2) (2020-03-02)
55
48
 
56
-
57
49
  ### Bug Fixes
58
50
 
59
- * check connection to app insights ([d4d5748](https://github.com/forcedotcom/cli-packages/commit/d4d5748))
60
-
61
-
62
-
63
-
51
+ - check connection to app insights ([d4d5748](https://github.com/forcedotcom/cli-packages/commit/d4d5748))
64
52
 
65
53
  ## [2.0.1](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.0...@salesforce/telemetry@2.0.1) (2020-01-31)
66
54
 
67
-
68
55
  ### Bug Fixes
69
56
 
70
- * add old envar for backwards compatability ([8a86933](https://github.com/forcedotcom/cli-packages/commit/8a86933))
71
- * use old envar for backwards support ([a2fb4b4](https://github.com/forcedotcom/cli-packages/commit/a2fb4b4))
72
-
73
-
74
-
75
-
57
+ - add old envar for backwards compatability ([8a86933](https://github.com/forcedotcom/cli-packages/commit/8a86933))
58
+ - use old envar for backwards support ([a2fb4b4](https://github.com/forcedotcom/cli-packages/commit/a2fb4b4))
76
59
 
77
60
  # [2.0.0](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.3.0...@salesforce/telemetry@2.0.0) (2020-01-29)
78
61
 
79
-
80
62
  ### Bug Fixes
81
63
 
82
- * add ability to override gdpr keys ([183282a](https://github.com/forcedotcom/cli-packages/commit/183282a))
83
- * cache config and add static for consumers to call ([ab2a5c0](https://github.com/forcedotcom/cli-packages/commit/ab2a5c0))
84
- * **gdpr:** adds logic to clear gdpr sentive tags + test ([5e55c88](https://github.com/forcedotcom/cli-packages/commit/5e55c88))
85
-
64
+ - add ability to override gdpr keys ([183282a](https://github.com/forcedotcom/cli-packages/commit/183282a))
65
+ - cache config and add static for consumers to call ([ab2a5c0](https://github.com/forcedotcom/cli-packages/commit/ab2a5c0))
66
+ - **gdpr:** adds logic to clear gdpr sentive tags + test ([5e55c88](https://github.com/forcedotcom/cli-packages/commit/5e55c88))
86
67
 
87
68
  ### Features
88
69
 
89
- * remove forked process in favor or dispose ([b997f5e](https://github.com/forcedotcom/cli-packages/commit/b997f5e))
90
-
70
+ - remove forked process in favor or dispose ([b997f5e](https://github.com/forcedotcom/cli-packages/commit/b997f5e))
91
71
 
92
72
  ### BREAKING CHANGES
93
73
 
94
- * Refactor/remove the telemetry signatures. Remove the forked process. Requires a
95
-
96
-
97
-
98
-
74
+ - Refactor/remove the telemetry signatures. Remove the forked process. Requires a
99
75
 
100
76
  # [1.3.0](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.5...@salesforce/telemetry@1.3.0) (2020-01-13)
101
77
 
102
-
103
78
  ### Bug Fixes
104
79
 
105
- * alias telemetry types as TelemetryData ([b7e05ff](https://github.com/forcedotcom/cli-packages/commit/b7e05ff))
106
- * fix merge error ([b1be6bd](https://github.com/forcedotcom/cli-packages/commit/b1be6bd))
107
- * flag type when passing data to child process ([0e5204b](https://github.com/forcedotcom/cli-packages/commit/0e5204b))
108
- * misspelled 'exception' ([088b604](https://github.com/forcedotcom/cli-packages/commit/088b604))
109
- * refactor common logic to new function ([1bd097e](https://github.com/forcedotcom/cli-packages/commit/1bd097e))
110
- * use config var to opt out of telemetry ([2f0360d](https://github.com/forcedotcom/cli-packages/commit/2f0360d))
111
-
80
+ - alias telemetry types as TelemetryData ([b7e05ff](https://github.com/forcedotcom/cli-packages/commit/b7e05ff))
81
+ - fix merge error ([b1be6bd](https://github.com/forcedotcom/cli-packages/commit/b1be6bd))
82
+ - flag type when passing data to child process ([0e5204b](https://github.com/forcedotcom/cli-packages/commit/0e5204b))
83
+ - misspelled 'exception' ([088b604](https://github.com/forcedotcom/cli-packages/commit/088b604))
84
+ - refactor common logic to new function ([1bd097e](https://github.com/forcedotcom/cli-packages/commit/1bd097e))
85
+ - use config var to opt out of telemetry ([2f0360d](https://github.com/forcedotcom/cli-packages/commit/2f0360d))
112
86
 
113
87
  ### Features
114
88
 
115
- * add more telemetry types for AppInsights ([7456912](https://github.com/forcedotcom/cli-packages/commit/7456912))
116
-
117
-
118
-
119
-
89
+ - add more telemetry types for AppInsights ([7456912](https://github.com/forcedotcom/cli-packages/commit/7456912))
120
90
 
121
91
  ## [1.2.5](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.4...@salesforce/telemetry@1.2.5) (2019-11-04)
122
92
 
123
-
124
93
  ### Bug Fixes
125
94
 
126
- * poke circle ([849640d](https://github.com/forcedotcom/cli-packages/commit/849640d))
127
-
128
-
129
-
130
-
95
+ - poke circle ([849640d](https://github.com/forcedotcom/cli-packages/commit/849640d))
131
96
 
132
97
  ## [1.2.4](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.3...@salesforce/telemetry@1.2.4) (2019-11-04)
133
98
 
134
99
  **Note:** Version bump only for package @salesforce/telemetry
135
100
 
136
-
137
-
138
-
139
-
140
101
  ## [1.2.3](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.2...@salesforce/telemetry@1.2.3) (2019-11-04)
141
102
 
142
103
  **Note:** Version bump only for package @salesforce/telemetry
143
104
 
144
-
145
-
146
-
147
-
148
105
  ## [1.2.2](https://github.com/forcedotcom/sfdx-telemetry/compare/@salesforce/telemetry@1.2.1...@salesforce/telemetry@1.2.2) (2019-08-08)
149
106
 
150
-
151
107
  ### Bug Fixes
152
108
 
153
- * spawn telemetry reporter in separate process ([5fa3345](https://github.com/forcedotcom/sfdx-telemetry/commit/5fa3345))
154
-
155
-
156
-
157
-
109
+ - spawn telemetry reporter in separate process ([5fa3345](https://github.com/forcedotcom/sfdx-telemetry/commit/5fa3345))
158
110
 
159
111
  ## [1.2.1](https://github.com/forcedotcom/sfdx-telemetry/compare/@salesforce/telemetry@1.2.0...@salesforce/telemetry@1.2.1) (2019-08-01)
160
112
 
161
-
162
113
  ### Bug Fixes
163
114
 
164
- * prettier ([119b1e5](https://github.com/forcedotcom/sfdx-telemetry/commit/119b1e5))
165
- * prettier updates ([735ee52](https://github.com/forcedotcom/sfdx-telemetry/commit/735ee52))
166
- * provide the ability to opt out of insights ([50debf0](https://github.com/forcedotcom/sfdx-telemetry/commit/50debf0))
167
- * remove nested if ([774ae02](https://github.com/forcedotcom/sfdx-telemetry/commit/774ae02))
168
-
169
-
170
-
171
-
115
+ - prettier ([119b1e5](https://github.com/forcedotcom/sfdx-telemetry/commit/119b1e5))
116
+ - prettier updates ([735ee52](https://github.com/forcedotcom/sfdx-telemetry/commit/735ee52))
117
+ - provide the ability to opt out of insights ([50debf0](https://github.com/forcedotcom/sfdx-telemetry/commit/50debf0))
118
+ - remove nested if ([774ae02](https://github.com/forcedotcom/sfdx-telemetry/commit/774ae02))
172
119
 
173
120
  # [1.2.0](https://github.com/forcedotcom/sfdx-telemetry/compare/@salesforce/telemetry@1.1.0...@salesforce/telemetry@1.2.0) (2019-07-17)
174
121
 
175
-
176
122
  ### Bug Fixes
177
123
 
178
- * telemetry test coverage ([0cb7c39](https://github.com/forcedotcom/sfdx-telemetry/commit/0cb7c39))
179
-
124
+ - telemetry test coverage ([0cb7c39](https://github.com/forcedotcom/sfdx-telemetry/commit/0cb7c39))
180
125
 
181
126
  ### Features
182
127
 
183
- * updating core ([cd4e6b0](https://github.com/forcedotcom/sfdx-telemetry/commit/cd4e6b0))
184
- * upgrade core ([4696c5f](https://github.com/forcedotcom/sfdx-telemetry/commit/4696c5f))
185
-
186
-
187
-
188
-
128
+ - updating core ([cd4e6b0](https://github.com/forcedotcom/sfdx-telemetry/commit/cd4e6b0))
129
+ - upgrade core ([4696c5f](https://github.com/forcedotcom/sfdx-telemetry/commit/4696c5f))
189
130
 
190
131
  # 1.1.0 (2019-07-16)
191
132
 
192
-
193
133
  ### Bug Fixes
194
134
 
195
- * adjust water mark ([6c4f213](https://github.com/forcedotcom/sfdx-telemetry/commit/6c4f213))
196
- * lodash security warning ([d6a7f69](https://github.com/forcedotcom/sfdx-telemetry/commit/d6a7f69))
197
- * update test tsconfig ([3773864](https://github.com/forcedotcom/sfdx-telemetry/commit/3773864))
198
-
135
+ - adjust water mark ([6c4f213](https://github.com/forcedotcom/sfdx-telemetry/commit/6c4f213))
136
+ - lodash security warning ([d6a7f69](https://github.com/forcedotcom/sfdx-telemetry/commit/d6a7f69))
137
+ - update test tsconfig ([3773864](https://github.com/forcedotcom/sfdx-telemetry/commit/3773864))
199
138
 
200
139
  ### Features
201
140
 
202
- * new telemetry project ([d29f0c5](https://github.com/forcedotcom/sfdx-telemetry/commit/d29f0c5))
141
+ - new telemetry project ([d29f0c5](https://github.com/forcedotcom/sfdx-telemetry/commit/d29f0c5))
package/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018, Salesforce.com, Inc.
1
+ Copyright (c) 2022, Salesforce.com, Inc.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -62,14 +62,14 @@ export declare class AppInsights extends AsyncCreatable<TelemetryOptions> {
62
62
  /**
63
63
  * Publishes diagnostic information to app insights dashboard
64
64
  *
65
- * @param message {string} - trace message to sen to app insights.
65
+ * @param traceMessage {string} - trace message to sen to app insights.
66
66
  * @param properties {Properties} - map of properties to publish alongside the event.
67
67
  */
68
68
  sendTelemetryTrace(traceMessage: string, properties?: Properties): void;
69
69
  /**
70
70
  * Publishes metric to app insights dashboard
71
71
  *
72
- * @param name {string} - name of the metric you want published
72
+ * @param metricName {string} - name of the metric you want published
73
73
  * @param value {number} - value of the metric
74
74
  * @param properties {Properties} - map of properties to publish alongside the event.
75
75
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppInsights = exports.buildPropertiesAndMeasurements = exports.getCpus = exports.getPlatformVersion = void 0;
3
+ exports.AppInsights = exports.buildPropertiesAndMeasurements = exports.getCpus = exports.getPlatformVersion = exports.TelemetryClient = void 0;
4
4
  /*
5
5
  * Copyright (c) 2021, salesforce.com, inc.
6
6
  * All rights reserved.
@@ -14,7 +14,6 @@ const ts_types_1 = require("@salesforce/ts-types");
14
14
  const appInsights = require("applicationinsights");
15
15
  var applicationinsights_1 = require("applicationinsights");
16
16
  Object.defineProperty(exports, "TelemetryClient", { enumerable: true, get: function () { return applicationinsights_1.TelemetryClient; } });
17
- core_1.Messages.importMessagesDirectory(__dirname);
18
17
  function getPlatformVersion() {
19
18
  return (os.release() || '').replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/, '$1$2$3');
20
19
  }
@@ -54,13 +53,13 @@ function buildPropertiesAndMeasurements(attributes) {
54
53
  const measurements = {};
55
54
  Object.keys(attributes).forEach((key) => {
56
55
  const value = attributes[key];
57
- if (ts_types_1.isString(value)) {
56
+ if ((0, ts_types_1.isString)(value)) {
58
57
  properties[key] = value.replace(homeDir, '~');
59
58
  }
60
- else if (ts_types_1.isNumber(value)) {
59
+ else if ((0, ts_types_1.isNumber)(value)) {
61
60
  measurements[key] = value;
62
61
  }
63
- else if (ts_types_1.isBoolean(value)) {
62
+ else if ((0, ts_types_1.isBoolean)(value)) {
64
63
  properties[key] = value.toString();
65
64
  }
66
65
  });
@@ -119,7 +118,7 @@ class AppInsights extends kit_1.AsyncCreatable {
119
118
  /**
120
119
  * Publishes diagnostic information to app insights dashboard
121
120
  *
122
- * @param message {string} - trace message to sen to app insights.
121
+ * @param traceMessage {string} - trace message to sen to app insights.
123
122
  * @param properties {Properties} - map of properties to publish alongside the event.
124
123
  */
125
124
  sendTelemetryTrace(traceMessage, properties) {
@@ -129,7 +128,7 @@ class AppInsights extends kit_1.AsyncCreatable {
129
128
  /**
130
129
  * Publishes metric to app insights dashboard
131
130
  *
132
- * @param name {string} - name of the metric you want published
131
+ * @param metricName {string} - name of the metric you want published
133
132
  * @param value {number} - value of the metric
134
133
  * @param properties {Properties} - map of properties to publish alongside the event.
135
134
  */
package/lib/exported.js CHANGED
@@ -7,13 +7,17 @@
7
7
  'use strict';
8
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
9
  if (k2 === undefined) k2 = k;
10
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
11
15
  }) : (function(o, m, k, k2) {
12
16
  if (k2 === undefined) k2 = k;
13
17
  o[k2] = m[k];
14
18
  }));
15
19
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
21
  };
18
22
  Object.defineProperty(exports, "__esModule", { value: true });
19
23
  const telemetryReporter_1 = require("./telemetryReporter");
@@ -41,20 +41,20 @@ export declare class TelemetryReporter extends AsyncCreatable<TelemetryOptions>
41
41
  * Sends exception to child process.
42
42
  *
43
43
  * @param exception {Error} - exception you want published.
44
- * @param measurements {Measurements} - map of measurements to publish alongside the event.
44
+ * @param attributes {Attributes} - map of measurements to publish alongside the event.
45
45
  */
46
46
  sendTelemetryException(exception: Error, attributes?: Attributes): void;
47
47
  /**
48
48
  * Publishes diagnostic information to app insights dashboard
49
49
  *
50
- * @param message {string} - trace message to sen to app insights.
50
+ * @param traceMessage {string} - trace message to sen to app insights.
51
51
  * @param properties {Properties} - map of properties to publish alongside the event.
52
52
  */
53
53
  sendTelemetryTrace(traceMessage: string, properties?: Properties): void;
54
54
  /**
55
55
  * Publishes metric to app insights dashboard
56
56
  *
57
- * @param name {string} - name of the metric you want published
57
+ * @param metricName {string} - name of the metric you want published
58
58
  * @param value {number} - value of the metric
59
59
  * @param properties {Properties} - map of properties to publish alongside the event.
60
60
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TelemetryReporter = void 0;
3
+ exports.TelemetryReporter = exports.TelemetryClient = void 0;
4
4
  /*
5
5
  * Copyright (c) 2020, salesforce.com, inc.
6
6
  * All rights reserved.
@@ -29,17 +29,16 @@ class TelemetryReporter extends kit_1.AsyncCreatable {
29
29
  */
30
30
  static async determineSfdxTelemetryEnabled() {
31
31
  if (!TelemetryReporter.config) {
32
- TelemetryReporter.config = await core_1.ConfigAggregator.create({});
32
+ TelemetryReporter.config = await core_1.SfdxConfigAggregator.create({});
33
33
  }
34
34
  const configValue = TelemetryReporter.config.getPropertyValue(DISABLE_TELEMETRY);
35
35
  const sfdxDisableInsights = configValue === 'true' || kit_1.env.getBoolean('SFDX_DISABLE_INSIGHTS');
36
- const isEnabled = !sfdxDisableInsights;
37
- return isEnabled;
36
+ return !sfdxDisableInsights;
38
37
  }
39
38
  async init() {
40
39
  this.logger = await core_1.Logger.child('TelemetryReporter');
41
40
  if (!TelemetryReporter.config) {
42
- TelemetryReporter.config = await core_1.ConfigAggregator.create({});
41
+ TelemetryReporter.config = await core_1.SfdxConfigAggregator.create({});
43
42
  }
44
43
  this.config = TelemetryReporter.config;
45
44
  if (this.options.waitForConnection)
@@ -111,7 +110,7 @@ class TelemetryReporter extends kit_1.AsyncCreatable {
111
110
  * Sends exception to child process.
112
111
  *
113
112
  * @param exception {Error} - exception you want published.
114
- * @param measurements {Measurements} - map of measurements to publish alongside the event.
113
+ * @param attributes {Attributes} - map of measurements to publish alongside the event.
115
114
  */
116
115
  sendTelemetryException(exception, attributes = {}) {
117
116
  if (this.isSfdxTelemetryEnabled()) {
@@ -124,7 +123,7 @@ class TelemetryReporter extends kit_1.AsyncCreatable {
124
123
  /**
125
124
  * Publishes diagnostic information to app insights dashboard
126
125
  *
127
- * @param message {string} - trace message to sen to app insights.
126
+ * @param traceMessage {string} - trace message to sen to app insights.
128
127
  * @param properties {Properties} - map of properties to publish alongside the event.
129
128
  */
130
129
  sendTelemetryTrace(traceMessage, properties) {
@@ -135,7 +134,7 @@ class TelemetryReporter extends kit_1.AsyncCreatable {
135
134
  /**
136
135
  * Publishes metric to app insights dashboard
137
136
  *
138
- * @param name {string} - name of the metric you want published
137
+ * @param metricName {string} - name of the metric you want published
139
138
  * @param value {number} - value of the metric
140
139
  * @param properties {Properties} - map of properties to publish alongside the event.
141
140
  */
@@ -151,8 +150,8 @@ class TelemetryReporter extends kit_1.AsyncCreatable {
151
150
  isSfdxTelemetryEnabled() {
152
151
  const configValue = this.config.getPropertyValue(DISABLE_TELEMETRY);
153
152
  const sfdxDisableInsights = configValue === 'true' || kit_1.env.getBoolean('SFDX_DISABLE_INSIGHTS');
154
- const isEnabled = !sfdxDisableInsights;
155
- return isEnabled;
153
+ // isEnabled = !sfdxDisableInsights
154
+ return !sfdxDisableInsights;
156
155
  }
157
156
  logTelemetryStatus() {
158
157
  const isEnabled = this.isSfdxTelemetryEnabled();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/telemetry",
3
- "version": "3.0.1",
3
+ "version": "3.2.1",
4
4
  "description": "Library for application insights",
5
5
  "main": "lib/exported",
6
6
  "repository": "forcedotcom/telemetry",
@@ -15,8 +15,8 @@
15
15
  "format": "sf-format",
16
16
  "lint": "sf-lint",
17
17
  "lint-fix": "yarn sfdx-lint --fix",
18
- "prepack": "sf-build",
19
- "prepare": "npm run build",
18
+ "prepack": "sf-prepack",
19
+ "prepare": "sf-install",
20
20
  "pretest": "sf-compile-test",
21
21
  "test": "sf-test"
22
22
  },
@@ -33,34 +33,36 @@
33
33
  "!lib/**/*.map"
34
34
  ],
35
35
  "dependencies": {
36
- "@salesforce/core": "^2.15.2",
37
- "@salesforce/ts-types": "^1.2.1",
36
+ "@salesforce/core": "^3.16.0",
37
+ "@salesforce/ts-types": "^1.5.20",
38
38
  "applicationinsights": "^1.4.0",
39
- "axios": "^0.21.1"
39
+ "axios": "^0.27.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@salesforce/dev-config": "^2.0.0",
43
- "@salesforce/dev-scripts": "^0.6.2",
44
- "@salesforce/prettier-config": "^0.0.1",
42
+ "@salesforce/dev-config": "^3.0.1",
43
+ "@salesforce/dev-scripts": "^2.0.2",
44
+ "@salesforce/prettier-config": "^0.0.2",
45
45
  "@salesforce/ts-sinon": "^1.1.0",
46
- "@typescript-eslint/eslint-plugin": "^2.30.0",
47
- "@typescript-eslint/parser": "^2.30.0",
46
+ "@typescript-eslint/eslint-plugin": "^4.2.0",
47
+ "@typescript-eslint/parser": "^4.2.0",
48
48
  "chai": "^4.2.0",
49
- "eslint": "^6.8.0",
49
+ "eslint": "^7.27.0",
50
50
  "eslint-config-prettier": "^6.11.0",
51
- "eslint-config-salesforce": "^0.1.0",
52
- "eslint-config-salesforce-license": "^0.1.0",
53
- "eslint-config-salesforce-typescript": "^0.1.0",
51
+ "eslint-config-salesforce": "^0.1.6",
52
+ "eslint-config-salesforce-license": "^0.1.6",
53
+ "eslint-config-salesforce-typescript": "^0.2.7",
54
54
  "eslint-plugin-header": "^3.0.0",
55
- "eslint-plugin-import": "^2.20.2",
56
- "eslint-plugin-jsdoc": "^27.0.3",
55
+ "eslint-plugin-import": "2.24.2",
56
+ "eslint-plugin-jsdoc": "^35.1.2",
57
57
  "eslint-plugin-prettier": "^3.1.3",
58
- "mocha": "^7.2.0",
58
+ "husky": "^7.0.4",
59
+ "mocha": "^9.1.3",
59
60
  "nyc": "^15.1.0",
60
61
  "prettier": "^2.0.5",
61
- "sinon": "^9.0.2",
62
- "ts-node": "^8.10.2",
63
- "typescript": "^3.9.3"
62
+ "pretty-quick": "^3.1.0",
63
+ "sinon": "10.0.0",
64
+ "ts-node": "^10.0.0",
65
+ "typescript": "^4.1.3"
64
66
  },
65
67
  "types": "lib/exported.d.ts",
66
68
  "publishConfig": {
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- timedOut: "Couldn't contact insights server. This can be disabled by setting SFDX_DISABLE_INSIGHTS=true.",
3
- sendFailed: 'Failed to send telemetry data because the appInsightsClient does not exist.',
4
- unknownError: 'An unknown error occurred.'
5
- };