@sap-ux/telemetry 0.3.0 → 0.4.0
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.
|
@@ -115,17 +115,21 @@ function watchTelemetrySettingStore(storeService) {
|
|
|
115
115
|
* @param options Settings pass from the consumer module.
|
|
116
116
|
*/
|
|
117
117
|
const initTelemetrySettings = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
118
|
-
var _a
|
|
118
|
+
var _a;
|
|
119
119
|
try {
|
|
120
120
|
config_state_1.TelemetrySettings.consumerModuleName = options.consumerModule.name;
|
|
121
121
|
config_state_1.TelemetrySettings.consumerModuleVersion = options.consumerModule.version;
|
|
122
122
|
config_state_2.ToolingTelemetrySettings.internalFeature = (_a = options.internalFeature) !== null && _a !== void 0 ? _a : false;
|
|
123
|
-
|
|
123
|
+
if (options.resourceId) {
|
|
124
|
+
config_state_1.TelemetrySettings.azureInstrumentationKey = options.resourceId;
|
|
125
|
+
}
|
|
124
126
|
const storeService = yield (0, store_1.getService)({
|
|
125
127
|
entityName: 'telemetrySetting'
|
|
126
128
|
});
|
|
127
129
|
yield readEnableTelemetry(storeService);
|
|
128
|
-
watchTelemetrySettingStore
|
|
130
|
+
if (options.watchTelemetrySettingStore) {
|
|
131
|
+
watchTelemetrySettingStore(storeService);
|
|
132
|
+
}
|
|
129
133
|
}
|
|
130
134
|
catch (err) {
|
|
131
135
|
(0, reporting_1.reportRuntimeError)(err);
|
|
@@ -9,12 +9,14 @@ export type TelemetryHelperProperties = {
|
|
|
9
9
|
*
|
|
10
10
|
* - consumerModule: name and version of module that uses telemetry library
|
|
11
11
|
* - internalFeature: if UX tooling InternalFeature is enabled
|
|
12
|
+
* - watchTelemetrySettingStore: watch changes to telemetry setting in the store and update runtime settings accordingly (recommended for extensions)
|
|
12
13
|
* - resourceId: Id of cloud telemetry resource (e.g. Azure application insights resource is supported).
|
|
13
14
|
*
|
|
14
15
|
*/
|
|
15
16
|
export type ToolsSuiteTelemetryInitSettings = {
|
|
16
17
|
consumerModule: ProjectInfo;
|
|
17
18
|
internalFeature: boolean;
|
|
19
|
+
watchTelemetrySettingStore: boolean;
|
|
18
20
|
resourceId?: string;
|
|
19
21
|
};
|
|
20
22
|
export declare enum ToolsId {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/telemetry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Library for sending usage telemetry data",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@sap/ux-specification": "1.108.18",
|
|
18
|
-
"applicationinsights": "2.9.
|
|
18
|
+
"applicationinsights": "2.9.2",
|
|
19
19
|
"axios": "1.6.0",
|
|
20
20
|
"performance-now": "2.1.0",
|
|
21
21
|
"yaml": "2.3.3",
|
|
22
|
-
"@sap-ux/store": "0.4.3",
|
|
23
22
|
"@sap-ux/btp-utils": "0.14.2",
|
|
24
23
|
"@sap-ux/project-access": "1.17.5",
|
|
24
|
+
"@sap-ux/store": "0.4.3",
|
|
25
25
|
"@sap-ux/ui5-config": "0.21.1",
|
|
26
26
|
"@sap-ux/logger": "0.5.1"
|
|
27
27
|
},
|