@salesforce/telemetry 5.0.18 → 5.0.20
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/lib/appInsights.d.ts +1 -2
- package/lib/appInsights.js +3 -4
- package/lib/telemetryReporter.js +1 -1
- package/package.json +5 -5
package/lib/appInsights.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AsyncCreatable, Env } from '@salesforce/kit';
|
|
2
|
-
import { JsonPrimitive } from '@salesforce/ts-types';
|
|
3
2
|
import * as appInsights from 'applicationinsights';
|
|
4
3
|
export { TelemetryClient } from 'applicationinsights';
|
|
5
4
|
export type Properties = {
|
|
@@ -9,7 +8,7 @@ export type Measurements = {
|
|
|
9
8
|
[key: string]: number;
|
|
10
9
|
};
|
|
11
10
|
export type Attributes = {
|
|
12
|
-
[key: string]:
|
|
11
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
13
12
|
};
|
|
14
13
|
export interface TelemetryOptions {
|
|
15
14
|
project: string;
|
package/lib/appInsights.js
CHANGED
|
@@ -33,7 +33,6 @@ exports.AppInsights = exports.buildPropertiesAndMeasurements = exports.getCpus =
|
|
|
33
33
|
const os = __importStar(require("node:os"));
|
|
34
34
|
const core_1 = require("@salesforce/core");
|
|
35
35
|
const kit_1 = require("@salesforce/kit");
|
|
36
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
37
36
|
const appInsights = __importStar(require("applicationinsights"));
|
|
38
37
|
var applicationinsights_1 = require("applicationinsights");
|
|
39
38
|
Object.defineProperty(exports, "TelemetryClient", { enumerable: true, get: function () { return applicationinsights_1.TelemetryClient; } });
|
|
@@ -76,13 +75,13 @@ function buildPropertiesAndMeasurements(attributes) {
|
|
|
76
75
|
const measurements = {};
|
|
77
76
|
Object.keys(attributes).forEach((key) => {
|
|
78
77
|
const value = attributes[key];
|
|
79
|
-
if (
|
|
78
|
+
if (typeof value === 'string') {
|
|
80
79
|
properties[key] = value.replace(homeDir, '~');
|
|
81
80
|
}
|
|
82
|
-
else if (
|
|
81
|
+
else if (typeof value === 'number') {
|
|
83
82
|
measurements[key] = value;
|
|
84
83
|
}
|
|
85
|
-
else if (
|
|
84
|
+
else if (typeof value === 'boolean') {
|
|
86
85
|
properties[key] = value.toString();
|
|
87
86
|
}
|
|
88
87
|
});
|
package/lib/telemetryReporter.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/telemetry",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.20",
|
|
4
4
|
"description": "Library for application insights",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"exports": {
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"!lib/**/*.map"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@salesforce/core": "^6.7.
|
|
44
|
-
"@salesforce/
|
|
43
|
+
"@salesforce/core": "^6.7.3",
|
|
44
|
+
"@salesforce/kit": "^3.1.0",
|
|
45
45
|
"applicationinsights": "^2.9.5",
|
|
46
46
|
"got": "^11",
|
|
47
47
|
"proxy-agent": "^6.4.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@salesforce/dev-scripts": "^8.4.
|
|
50
|
+
"@salesforce/dev-scripts": "^8.4.2",
|
|
51
51
|
"ts-node": "^10.9.2",
|
|
52
|
-
"typescript": "^5.4.
|
|
52
|
+
"typescript": "^5.4.3"
|
|
53
53
|
},
|
|
54
54
|
"types": "lib/exported.d.ts",
|
|
55
55
|
"publishConfig": {
|