@salesforce/telemetry 3.2.1 → 3.2.2

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.
@@ -38,7 +38,7 @@ const sanitizeError = (err) => {
38
38
  }
39
39
  if (err.stack) {
40
40
  // there might be lots of this one
41
- err.stack = err.stack.replace(new RegExp(`\\b${homeDir}\\b`, 'gi'), '~');
41
+ err.stack = err.stack.replace(new RegExp(`\b${homeDir}\b`, 'gi'), '~');
42
42
  }
43
43
  return err;
44
44
  };
@@ -46,7 +46,7 @@ function getSystemMemory() {
46
46
  return `${(os.totalmem() / (1024 * 1024 * 1024)).toFixed(2)} GB`;
47
47
  }
48
48
  function isAsimovKey(key) {
49
- return !!(key && key.startsWith('AIF-'));
49
+ return !!key?.startsWith('AIF-');
50
50
  }
51
51
  function buildPropertiesAndMeasurements(attributes) {
52
52
  const properties = {};
@@ -77,7 +77,7 @@ class AppInsights extends kit_1.AsyncCreatable {
77
77
  super(options);
78
78
  this.gdprSensitiveKeys = [];
79
79
  this.options = options;
80
- this.env = this.options.env || new kit_1.Env();
80
+ this.env = this.options.env ?? new kit_1.Env();
81
81
  if (this.options.gdprSensitiveKeys) {
82
82
  this.gdprSensitiveKeys = this.options.gdprSensitiveKeys;
83
83
  }
@@ -136,6 +136,7 @@ class AppInsights extends kit_1.AsyncCreatable {
136
136
  this.logger.debug(`Sending telemetry metric: ${metricName}`);
137
137
  this.appInsightsClient.trackMetric({ name: metricName, value, properties });
138
138
  }
139
+ // eslint-disable-next-line class-methods-use-this
139
140
  start() {
140
141
  // Start data collection services
141
142
  appInsights.start();
@@ -174,7 +175,7 @@ class AppInsights extends kit_1.AsyncCreatable {
174
175
  'common.os': os.platform(),
175
176
  'common.platformversion': getPlatformVersion(),
176
177
  'common.systemmemory': getSystemMemory(),
177
- 'common.usertype': this.env.getString('SFDX_USER_TYPE') || 'normal',
178
+ 'common.usertype': this.env.getString('SFDX_USER_TYPE') ?? 'normal',
178
179
  };
179
180
  return Object.assign(baseProperties, this.options.commonProperties);
180
181
  }
@@ -115,8 +115,7 @@ class TelemetryReporter extends kit_1.AsyncCreatable {
115
115
  sendTelemetryException(exception, attributes = {}) {
116
116
  if (this.isSfdxTelemetryEnabled()) {
117
117
  // Scrub stack for GDPR
118
- exception.stack =
119
- exception.stack && exception.stack.replace(new RegExp(os.homedir(), 'g'), appInsights_1.AppInsights.GDPR_HIDDEN);
118
+ exception.stack = exception.stack?.replace(new RegExp(os.homedir(), 'g'), appInsights_1.AppInsights.GDPR_HIDDEN);
120
119
  this.reporter.sendTelemetryException(exception, attributes);
121
120
  }
122
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/telemetry",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Library for application insights",
5
5
  "main": "lib/exported",
6
6
  "repository": "forcedotcom/telemetry",
@@ -33,39 +33,38 @@
33
33
  "!lib/**/*.map"
34
34
  ],
35
35
  "dependencies": {
36
- "@salesforce/core": "^3.16.0",
36
+ "@salesforce/core": "^3.31.10",
37
37
  "@salesforce/ts-types": "^1.5.20",
38
38
  "applicationinsights": "^1.4.0",
39
39
  "axios": "^0.27.2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@salesforce/dev-config": "^3.0.1",
43
- "@salesforce/dev-scripts": "^2.0.2",
43
+ "@salesforce/dev-scripts": "^3.1.0",
44
44
  "@salesforce/prettier-config": "^0.0.2",
45
- "@salesforce/ts-sinon": "^1.1.0",
46
- "@typescript-eslint/eslint-plugin": "^4.2.0",
47
- "@typescript-eslint/parser": "^4.2.0",
45
+ "@salesforce/ts-sinon": "^1.4.0",
46
+ "@typescript-eslint/eslint-plugin": "^5.40.0",
47
+ "@typescript-eslint/parser": "^5.40.0",
48
48
  "chai": "^4.2.0",
49
- "eslint": "^7.27.0",
50
- "eslint-config-prettier": "^6.11.0",
51
- "eslint-config-salesforce": "^0.1.6",
49
+ "eslint": "^8.25.0",
50
+ "eslint-config-prettier": "^8.5.0",
51
+ "eslint-config-salesforce": "^1.1.0",
52
52
  "eslint-config-salesforce-license": "^0.1.6",
53
- "eslint-config-salesforce-typescript": "^0.2.7",
53
+ "eslint-config-salesforce-typescript": "^1.1.1",
54
54
  "eslint-plugin-header": "^3.0.0",
55
- "eslint-plugin-import": "2.24.2",
56
- "eslint-plugin-jsdoc": "^35.1.2",
57
- "eslint-plugin-prettier": "^3.1.3",
55
+ "eslint-plugin-import": "2.26.0",
56
+ "eslint-plugin-jsdoc": "^39.3.6",
58
57
  "husky": "^7.0.4",
59
58
  "mocha": "^9.1.3",
60
59
  "nyc": "^15.1.0",
61
- "prettier": "^2.0.5",
60
+ "prettier": "^2.7.1",
62
61
  "pretty-quick": "^3.1.0",
63
62
  "sinon": "10.0.0",
64
63
  "ts-node": "^10.0.0",
65
- "typescript": "^4.1.3"
64
+ "typescript": "^4.8.4"
66
65
  },
67
66
  "types": "lib/exported.d.ts",
68
67
  "publishConfig": {
69
68
  "access": "public"
70
69
  }
71
- }
70
+ }
package/CHANGELOG.md DELETED
@@ -1,141 +0,0 @@
1
- # Changelog
2
-
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
-
5
- ### [3.2.1](https://github.com/forcedotcom/telemetry/compare/v3.2.0...v3.2.1) (2022-05-06)
6
-
7
- ### Bug Fixes
8
-
9
- - bump to core 3 ([#42](https://github.com/forcedotcom/telemetry/issues/42)) ([9ab8b09](https://github.com/forcedotcom/telemetry/commit/9ab8b093cc8116bde47e8688298f5ac7742c3944))
10
-
11
- ## [3.2.0](https://github.com/forcedotcom/telemetry/compare/v3.0.0...v3.2.0) (2022-01-06)
12
-
13
- ### Features
14
-
15
- - bump version of core and axios ([376ae9c](https://github.com/forcedotcom/telemetry/commit/376ae9c2c2c26517f2ede7e1ac7b065caeca9390))
16
-
17
- ### Bug Fixes
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))
24
-
25
- ## 3.0.0 (2021-07-08)
26
-
27
- ### Features
28
-
29
- - publish ([9336302](https://github.com/forcedotcom/telemetry/commit/9336302f15b43bd824ec70fe604e05a6bb2f5ba2))
30
-
31
- ## [2.0.6](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.5...@salesforce/telemetry@2.0.6) (2021-05-11)
32
-
33
- **Note:** Version bump only for package @salesforce/telemetry
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)
36
-
37
- **Note:** Version bump only for package @salesforce/telemetry
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)
40
-
41
- **Note:** Version bump only for package @salesforce/telemetry
42
-
43
- ## [2.0.3](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.2...@salesforce/telemetry@2.0.3) (2020-11-11)
44
-
45
- **Note:** Version bump only for package @salesforce/telemetry
46
-
47
- ## [2.0.2](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.1...@salesforce/telemetry@2.0.2) (2020-03-02)
48
-
49
- ### Bug Fixes
50
-
51
- - check connection to app insights ([d4d5748](https://github.com/forcedotcom/cli-packages/commit/d4d5748))
52
-
53
- ## [2.0.1](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@2.0.0...@salesforce/telemetry@2.0.1) (2020-01-31)
54
-
55
- ### Bug Fixes
56
-
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))
59
-
60
- # [2.0.0](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.3.0...@salesforce/telemetry@2.0.0) (2020-01-29)
61
-
62
- ### Bug Fixes
63
-
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))
67
-
68
- ### Features
69
-
70
- - remove forked process in favor or dispose ([b997f5e](https://github.com/forcedotcom/cli-packages/commit/b997f5e))
71
-
72
- ### BREAKING CHANGES
73
-
74
- - Refactor/remove the telemetry signatures. Remove the forked process. Requires a
75
-
76
- # [1.3.0](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.5...@salesforce/telemetry@1.3.0) (2020-01-13)
77
-
78
- ### Bug Fixes
79
-
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))
86
-
87
- ### Features
88
-
89
- - add more telemetry types for AppInsights ([7456912](https://github.com/forcedotcom/cli-packages/commit/7456912))
90
-
91
- ## [1.2.5](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.4...@salesforce/telemetry@1.2.5) (2019-11-04)
92
-
93
- ### Bug Fixes
94
-
95
- - poke circle ([849640d](https://github.com/forcedotcom/cli-packages/commit/849640d))
96
-
97
- ## [1.2.4](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.3...@salesforce/telemetry@1.2.4) (2019-11-04)
98
-
99
- **Note:** Version bump only for package @salesforce/telemetry
100
-
101
- ## [1.2.3](https://github.com/forcedotcom/cli-packages/compare/@salesforce/telemetry@1.2.2...@salesforce/telemetry@1.2.3) (2019-11-04)
102
-
103
- **Note:** Version bump only for package @salesforce/telemetry
104
-
105
- ## [1.2.2](https://github.com/forcedotcom/sfdx-telemetry/compare/@salesforce/telemetry@1.2.1...@salesforce/telemetry@1.2.2) (2019-08-08)
106
-
107
- ### Bug Fixes
108
-
109
- - spawn telemetry reporter in separate process ([5fa3345](https://github.com/forcedotcom/sfdx-telemetry/commit/5fa3345))
110
-
111
- ## [1.2.1](https://github.com/forcedotcom/sfdx-telemetry/compare/@salesforce/telemetry@1.2.0...@salesforce/telemetry@1.2.1) (2019-08-01)
112
-
113
- ### Bug Fixes
114
-
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))
119
-
120
- # [1.2.0](https://github.com/forcedotcom/sfdx-telemetry/compare/@salesforce/telemetry@1.1.0...@salesforce/telemetry@1.2.0) (2019-07-17)
121
-
122
- ### Bug Fixes
123
-
124
- - telemetry test coverage ([0cb7c39](https://github.com/forcedotcom/sfdx-telemetry/commit/0cb7c39))
125
-
126
- ### Features
127
-
128
- - updating core ([cd4e6b0](https://github.com/forcedotcom/sfdx-telemetry/commit/cd4e6b0))
129
- - upgrade core ([4696c5f](https://github.com/forcedotcom/sfdx-telemetry/commit/4696c5f))
130
-
131
- # 1.1.0 (2019-07-16)
132
-
133
- ### Bug Fixes
134
-
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))
138
-
139
- ### Features
140
-
141
- - new telemetry project ([d29f0c5](https://github.com/forcedotcom/sfdx-telemetry/commit/d29f0c5))