@theia/telemetry 1.74.0-next.68
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/README.md +66 -0
- package/lib/browser/browser-telemetry-service.d.ts +16 -0
- package/lib/browser/browser-telemetry-service.d.ts.map +1 -0
- package/lib/browser/browser-telemetry-service.js +68 -0
- package/lib/browser/browser-telemetry-service.js.map +1 -0
- package/lib/browser/browser-telemetry-service.spec.d.ts +2 -0
- package/lib/browser/browser-telemetry-service.spec.d.ts.map +1 -0
- package/lib/browser/browser-telemetry-service.spec.js +163 -0
- package/lib/browser/browser-telemetry-service.spec.js.map +1 -0
- package/lib/browser/index.d.ts +2 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +20 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/telemetry-frontend-module.d.ts +4 -0
- package/lib/browser/telemetry-frontend-module.d.ts.map +1 -0
- package/lib/browser/telemetry-frontend-module.js +35 -0
- package/lib/browser/telemetry-frontend-module.js.map +1 -0
- package/lib/browser-only/browser-only-telemetry-service.d.ts +5 -0
- package/lib/browser-only/browser-only-telemetry-service.d.ts.map +1 -0
- package/lib/browser-only/browser-only-telemetry-service.js +28 -0
- package/lib/browser-only/browser-only-telemetry-service.js.map +1 -0
- package/lib/browser-only/browser-only-telemetry-service.spec.d.ts +2 -0
- package/lib/browser-only/browser-only-telemetry-service.spec.d.ts.map +1 -0
- package/lib/browser-only/browser-only-telemetry-service.spec.js +42 -0
- package/lib/browser-only/browser-only-telemetry-service.spec.js.map +1 -0
- package/lib/browser-only/telemetry-frontend-only-module.d.ts +4 -0
- package/lib/browser-only/telemetry-frontend-only-module.d.ts.map +1 -0
- package/lib/browser-only/telemetry-frontend-only-module.js +30 -0
- package/lib/browser-only/telemetry-frontend-only-module.js.map +1 -0
- package/lib/common/index.d.ts +7 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +25 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/telemetry-consent-provider.d.ts +24 -0
- package/lib/common/telemetry-consent-provider.d.ts.map +1 -0
- package/lib/common/telemetry-consent-provider.js +73 -0
- package/lib/common/telemetry-consent-provider.js.map +1 -0
- package/lib/common/telemetry-consent-provider.spec.d.ts +2 -0
- package/lib/common/telemetry-consent-provider.spec.d.ts.map +1 -0
- package/lib/common/telemetry-consent-provider.spec.js +87 -0
- package/lib/common/telemetry-consent-provider.spec.js.map +1 -0
- package/lib/common/telemetry-preferences.d.ts +29 -0
- package/lib/common/telemetry-preferences.d.ts.map +1 -0
- package/lib/common/telemetry-preferences.js +77 -0
- package/lib/common/telemetry-preferences.js.map +1 -0
- package/lib/common/telemetry-preferences.spec.d.ts +2 -0
- package/lib/common/telemetry-preferences.spec.d.ts.map +1 -0
- package/lib/common/telemetry-preferences.spec.js +50 -0
- package/lib/common/telemetry-preferences.spec.js.map +1 -0
- package/lib/common/telemetry-protocol.d.ts +30 -0
- package/lib/common/telemetry-protocol.d.ts.map +1 -0
- package/lib/common/telemetry-protocol.js +78 -0
- package/lib/common/telemetry-protocol.js.map +1 -0
- package/lib/common/telemetry-service.d.ts +28 -0
- package/lib/common/telemetry-service.d.ts.map +1 -0
- package/lib/common/telemetry-service.js +65 -0
- package/lib/common/telemetry-service.js.map +1 -0
- package/lib/common/telemetry-service.spec.d.ts +2 -0
- package/lib/common/telemetry-service.spec.d.ts.map +1 -0
- package/lib/common/telemetry-service.spec.js +128 -0
- package/lib/common/telemetry-service.spec.js.map +1 -0
- package/lib/common/telemetry-topic.d.ts +9 -0
- package/lib/common/telemetry-topic.d.ts.map +1 -0
- package/lib/common/telemetry-topic.js +61 -0
- package/lib/common/telemetry-topic.js.map +1 -0
- package/lib/common/telemetry-topic.spec.d.ts +2 -0
- package/lib/common/telemetry-topic.spec.d.ts.map +1 -0
- package/lib/common/telemetry-topic.spec.js +67 -0
- package/lib/common/telemetry-topic.spec.js.map +1 -0
- package/lib/common/telemetry-types.d.ts +5 -0
- package/lib/common/telemetry-types.d.ts.map +1 -0
- package/lib/common/telemetry-types.js +21 -0
- package/lib/common/telemetry-types.js.map +1 -0
- package/lib/common/test/recording-logger.d.ts +9 -0
- package/lib/common/test/recording-logger.d.ts.map +1 -0
- package/lib/common/test/recording-logger.js +36 -0
- package/lib/common/test/recording-logger.js.map +1 -0
- package/lib/node/index.d.ts +3 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +21 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/telemetry-backend-module.d.ts +4 -0
- package/lib/node/telemetry-backend-module.d.ts.map +1 -0
- package/lib/node/telemetry-backend-module.js +37 -0
- package/lib/node/telemetry-backend-module.js.map +1 -0
- package/lib/node/telemetry-service-impl.d.ts +36 -0
- package/lib/node/telemetry-service-impl.d.ts.map +1 -0
- package/lib/node/telemetry-service-impl.js +208 -0
- package/lib/node/telemetry-service-impl.js.map +1 -0
- package/lib/node/telemetry-service-impl.spec.d.ts +2 -0
- package/lib/node/telemetry-service-impl.spec.d.ts.map +1 -0
- package/lib/node/telemetry-service-impl.spec.js +411 -0
- package/lib/node/telemetry-service-impl.spec.js.map +1 -0
- package/lib/node/telemetry-sink.d.ts +31 -0
- package/lib/node/telemetry-sink.d.ts.map +1 -0
- package/lib/node/telemetry-sink.js +21 -0
- package/lib/node/telemetry-sink.js.map +1 -0
- package/package.json +52 -0
- package/src/browser/browser-telemetry-service.spec.ts +193 -0
- package/src/browser/browser-telemetry-service.ts +69 -0
- package/src/browser/index.ts +17 -0
- package/src/browser/telemetry-frontend-module.ts +34 -0
- package/src/browser-only/browser-only-telemetry-service.spec.ts +44 -0
- package/src/browser-only/browser-only-telemetry-service.ts +23 -0
- package/src/browser-only/telemetry-frontend-only-module.ts +28 -0
- package/src/common/index.ts +22 -0
- package/src/common/telemetry-consent-provider.spec.ts +95 -0
- package/src/common/telemetry-consent-provider.ts +72 -0
- package/src/common/telemetry-preferences.spec.ts +56 -0
- package/src/common/telemetry-preferences.ts +91 -0
- package/src/common/telemetry-protocol.ts +100 -0
- package/src/common/telemetry-service.spec.ts +152 -0
- package/src/common/telemetry-service.ts +90 -0
- package/src/common/telemetry-topic.spec.ts +78 -0
- package/src/common/telemetry-topic.ts +60 -0
- package/src/common/telemetry-types.ts +21 -0
- package/src/common/test/recording-logger.ts +33 -0
- package/src/node/index.ts +18 -0
- package/src/node/telemetry-backend-module.ts +40 -0
- package/src/node/telemetry-service-impl.spec.ts +500 -0
- package/src/node/telemetry-service-impl.ts +214 -0
- package/src/node/telemetry-sink.ts +48 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
tslib_1.__exportStar(require("./telemetry-consent-provider"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./telemetry-preferences"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./telemetry-protocol"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./telemetry-service"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./telemetry-topic"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./telemetry-types"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,uEAA6C;AAC7C,kEAAwC;AACxC,+DAAqC;AACrC,8DAAoC;AACpC,4DAAkC;AAClC,4DAAkC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Emitter, Event } from '@theia/core/lib/common';
|
|
2
|
+
import { TelemetryPreferences } from './telemetry-preferences';
|
|
3
|
+
import { TelemetryEventKind } from './telemetry-service';
|
|
4
|
+
import { TelemetryLevel } from './telemetry-types';
|
|
5
|
+
/** @experimental */
|
|
6
|
+
export declare const TelemetryConsentProvider: unique symbol;
|
|
7
|
+
/** @experimental */
|
|
8
|
+
export interface TelemetryConsentProvider {
|
|
9
|
+
readonly level: TelemetryLevel;
|
|
10
|
+
readonly onDidChangeTelemetryLevel: Event<TelemetryLevel>;
|
|
11
|
+
}
|
|
12
|
+
/** @experimental */
|
|
13
|
+
export declare function isKindAllowedByLevel(level: TelemetryLevel, kind: TelemetryEventKind): boolean;
|
|
14
|
+
/** @experimental */
|
|
15
|
+
export declare class PreferenceTelemetryConsentProvider implements TelemetryConsentProvider {
|
|
16
|
+
protected currentLevel: TelemetryLevel;
|
|
17
|
+
protected readonly onDidChangeTelemetryLevelEmitter: Emitter<TelemetryLevel>;
|
|
18
|
+
readonly onDidChangeTelemetryLevel: Event<TelemetryLevel>;
|
|
19
|
+
protected readonly preferences: TelemetryPreferences;
|
|
20
|
+
protected init(): void;
|
|
21
|
+
protected setLevel(level: TelemetryLevel): void;
|
|
22
|
+
get level(): TelemetryLevel;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=telemetry-consent-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-consent-provider.d.ts","sourceRoot":"","sources":["../../src/common/telemetry-consent-provider.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,oBAAoB;AACpB,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAE3E,oBAAoB;AACpB,MAAM,WAAW,wBAAwB;IACrC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;CAC7D;AAED,oBAAoB;AACpB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAI7F;AAED,oBAAoB;AACpB,qBACa,kCAAmC,YAAW,wBAAwB;IAE/E,SAAS,CAAC,YAAY,EAAE,cAAc,CAAS;IAC/C,SAAS,CAAC,QAAQ,CAAC,gCAAgC,0BAAiC;IACpF,QAAQ,CAAC,yBAAyB,wBAA+C;IAGjF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,IAAI,IAAI,IAAI;IAWtB,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAO/C,IAAI,KAAK,IAAI,cAAc,CAE1B;CACJ"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PreferenceTelemetryConsentProvider = exports.TelemetryConsentProvider = void 0;
|
|
19
|
+
exports.isKindAllowedByLevel = isKindAllowedByLevel;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const common_1 = require("@theia/core/lib/common");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const telemetry_preferences_1 = require("./telemetry-preferences");
|
|
24
|
+
/** @experimental */
|
|
25
|
+
exports.TelemetryConsentProvider = Symbol('TelemetryConsentProvider');
|
|
26
|
+
/** @experimental */
|
|
27
|
+
function isKindAllowedByLevel(level, kind) {
|
|
28
|
+
return level === 'all'
|
|
29
|
+
|| level === 'error' && (kind === 'error' || kind === 'crash')
|
|
30
|
+
|| level === 'crash' && kind === 'crash';
|
|
31
|
+
}
|
|
32
|
+
/** @experimental */
|
|
33
|
+
let PreferenceTelemetryConsentProvider = class PreferenceTelemetryConsentProvider {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.currentLevel = 'off';
|
|
36
|
+
this.onDidChangeTelemetryLevelEmitter = new common_1.Emitter();
|
|
37
|
+
this.onDidChangeTelemetryLevel = this.onDidChangeTelemetryLevelEmitter.event;
|
|
38
|
+
}
|
|
39
|
+
init() {
|
|
40
|
+
this.preferences.onPreferenceChanged(change => {
|
|
41
|
+
if (change.preferenceName === telemetry_preferences_1.TELEMETRY_LEVEL) {
|
|
42
|
+
this.setLevel(this.preferences[telemetry_preferences_1.TELEMETRY_LEVEL]);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
this.preferences.ready.then(() => {
|
|
46
|
+
this.setLevel(this.preferences[telemetry_preferences_1.TELEMETRY_LEVEL]);
|
|
47
|
+
}, () => undefined);
|
|
48
|
+
}
|
|
49
|
+
setLevel(level) {
|
|
50
|
+
if (level !== this.currentLevel) {
|
|
51
|
+
this.currentLevel = level;
|
|
52
|
+
this.onDidChangeTelemetryLevelEmitter.fire(level);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
get level() {
|
|
56
|
+
return this.currentLevel;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.PreferenceTelemetryConsentProvider = PreferenceTelemetryConsentProvider;
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, inversify_1.inject)(telemetry_preferences_1.TelemetryPreferences),
|
|
62
|
+
tslib_1.__metadata("design:type", Object)
|
|
63
|
+
], PreferenceTelemetryConsentProvider.prototype, "preferences", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, inversify_1.postConstruct)(),
|
|
66
|
+
tslib_1.__metadata("design:type", Function),
|
|
67
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
68
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
69
|
+
], PreferenceTelemetryConsentProvider.prototype, "init", null);
|
|
70
|
+
exports.PreferenceTelemetryConsentProvider = PreferenceTelemetryConsentProvider = tslib_1.__decorate([
|
|
71
|
+
(0, inversify_1.injectable)()
|
|
72
|
+
], PreferenceTelemetryConsentProvider);
|
|
73
|
+
//# sourceMappingURL=telemetry-consent-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-consent-provider.js","sourceRoot":"","sources":["../../src/common/telemetry-consent-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAkBhF,oDAIC;;AApBD,mDAAwD;AACxD,4DAAiF;AACjF,mEAAgF;AAIhF,oBAAoB;AACP,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAQ3E,oBAAoB;AACpB,SAAgB,oBAAoB,CAAC,KAAqB,EAAE,IAAwB;IAChF,OAAO,KAAK,KAAK,KAAK;WACf,KAAK,KAAK,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,CAAC;WAC3D,KAAK,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,CAAC;AACjD,CAAC;AAED,oBAAoB;AAEb,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAAxC;QAEO,iBAAY,GAAmB,KAAK,CAAC;QAC5B,qCAAgC,GAAG,IAAI,gBAAO,EAAkB,CAAC;QAC3E,8BAAyB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC;IA2BrF,CAAC;IArBa,IAAI;QACV,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE;YAC1C,IAAI,MAAM,CAAC,cAAc,KAAK,uCAAe,EAAE,CAAC;gBAC5C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,uCAAe,CAAC,CAAC,CAAC;YACrD,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,uCAAe,CAAC,CAAC,CAAC;QACrD,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;IAES,QAAQ,CAAC,KAAqB;QACpC,IAAI,KAAK,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;CACJ,CAAA;AA/BY,gFAAkC;AAOxB;IADlB,IAAA,kBAAM,EAAC,4CAAoB,CAAC;;uEACwB;AAG3C;IADT,IAAA,yBAAa,GAAE;;;;8DAUf;6CAnBQ,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;GACA,kCAAkC,CA+B9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-consent-provider.spec.d.ts","sourceRoot":"","sources":["../../src/common/telemetry-consent-provider.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const common_1 = require("@theia/core/lib/common");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const telemetry_consent_provider_1 = require("./telemetry-consent-provider");
|
|
22
|
+
const telemetry_preferences_1 = require("./telemetry-preferences");
|
|
23
|
+
describe('telemetry consent provider', () => {
|
|
24
|
+
it('maps telemetry levels to event kinds', () => {
|
|
25
|
+
const kinds = ['usage', 'error', 'crash'];
|
|
26
|
+
const levels = ['off', 'crash', 'error', 'all'];
|
|
27
|
+
(0, chai_1.expect)(levels.map(level => kinds.filter(kind => (0, telemetry_consent_provider_1.isKindAllowedByLevel)(level, kind)))).to.deep.equal([
|
|
28
|
+
[],
|
|
29
|
+
['crash'],
|
|
30
|
+
['error', 'crash'],
|
|
31
|
+
['usage', 'error', 'crash']
|
|
32
|
+
]);
|
|
33
|
+
});
|
|
34
|
+
it('applies and reports preference changes before readiness', () => {
|
|
35
|
+
const changes = new common_1.Emitter();
|
|
36
|
+
const ready = new Promise(() => undefined);
|
|
37
|
+
let level = 'off';
|
|
38
|
+
const preferences = {
|
|
39
|
+
get [telemetry_preferences_1.TELEMETRY_LEVEL]() {
|
|
40
|
+
return level;
|
|
41
|
+
},
|
|
42
|
+
[telemetry_preferences_1.TELEMETRY_FILTERS]: {},
|
|
43
|
+
ready,
|
|
44
|
+
onPreferenceChanged: changes.event
|
|
45
|
+
};
|
|
46
|
+
const container = new inversify_1.Container();
|
|
47
|
+
container.bind(telemetry_preferences_1.TelemetryPreferences).toConstantValue(preferences);
|
|
48
|
+
container.bind(telemetry_consent_provider_1.TelemetryConsentProvider).to(telemetry_consent_provider_1.PreferenceTelemetryConsentProvider).inSingletonScope();
|
|
49
|
+
const provider = container.get(telemetry_consent_provider_1.TelemetryConsentProvider);
|
|
50
|
+
const observed = [];
|
|
51
|
+
provider.onDidChangeTelemetryLevel(value => observed.push(value));
|
|
52
|
+
level = 'error';
|
|
53
|
+
changes.fire({ preferenceName: telemetry_preferences_1.TELEMETRY_LEVEL });
|
|
54
|
+
(0, chai_1.expect)(provider.level).to.equal('error');
|
|
55
|
+
(0, chai_1.expect)(observed).to.deep.equal(['error']);
|
|
56
|
+
});
|
|
57
|
+
it('starts off, then reads the preference after readiness and fires on changes', async () => {
|
|
58
|
+
const changes = new common_1.Emitter();
|
|
59
|
+
let resolveReady;
|
|
60
|
+
const ready = new Promise(resolve => resolveReady = resolve);
|
|
61
|
+
let level = 'error';
|
|
62
|
+
const preferences = {
|
|
63
|
+
get [telemetry_preferences_1.TELEMETRY_LEVEL]() {
|
|
64
|
+
return level;
|
|
65
|
+
},
|
|
66
|
+
[telemetry_preferences_1.TELEMETRY_FILTERS]: {},
|
|
67
|
+
ready,
|
|
68
|
+
onPreferenceChanged: changes.event
|
|
69
|
+
};
|
|
70
|
+
const container = new inversify_1.Container();
|
|
71
|
+
container.bind(telemetry_preferences_1.TelemetryPreferences).toConstantValue(preferences);
|
|
72
|
+
container.bind(telemetry_consent_provider_1.TelemetryConsentProvider).to(telemetry_consent_provider_1.PreferenceTelemetryConsentProvider).inSingletonScope();
|
|
73
|
+
const provider = container.get(telemetry_consent_provider_1.TelemetryConsentProvider);
|
|
74
|
+
const observed = [];
|
|
75
|
+
provider.onDidChangeTelemetryLevel(value => observed.push(value));
|
|
76
|
+
(0, chai_1.expect)(provider.level).to.equal('off');
|
|
77
|
+
resolveReady();
|
|
78
|
+
await preferences.ready;
|
|
79
|
+
await Promise.resolve();
|
|
80
|
+
(0, chai_1.expect)(provider.level).to.equal('error');
|
|
81
|
+
level = 'all';
|
|
82
|
+
changes.fire({ preferenceName: telemetry_preferences_1.TELEMETRY_LEVEL });
|
|
83
|
+
(0, chai_1.expect)(provider.level).to.equal('all');
|
|
84
|
+
(0, chai_1.expect)(observed).to.deep.equal(['error', 'all']);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=telemetry-consent-provider.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-consent-provider.spec.js","sourceRoot":"","sources":["../../src/common/telemetry-consent-provider.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,+BAA8B;AAC9B,mDAAiD;AACjD,4DAAyD;AACzD,6EAEsC;AACtC,mEAAmG;AAGnG,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;QACnD,MAAM,MAAM,GAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAClE,IAAA,aAAM,EAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,iDAAoB,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAC/F,EAAE;YACF,CAAC,OAAO,CAAC;YACT,CAAC,OAAO,EAAE,OAAO,CAAC;YAClB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;SAC9B,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QAC/D,MAAM,OAAO,GAAG,IAAI,gBAAO,EAAS,CAAC;QACrC,MAAM,KAAK,GA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,CAAC;QACvC,IAAA,aAAM,EAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PreferenceProxy } from '@theia/core/lib/common/preferences/preference-proxy';
|
|
2
|
+
import { PreferenceSchema } from '@theia/core/lib/common/preferences/preference-schema';
|
|
3
|
+
import { PreferenceService } from '@theia/core/lib/common/preferences/preference-service';
|
|
4
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
5
|
+
import { TelemetryLevel } from './telemetry-types';
|
|
6
|
+
/** @experimental */
|
|
7
|
+
export declare const TELEMETRY_LEVEL = "telemetry.telemetryLevel";
|
|
8
|
+
/** @experimental */
|
|
9
|
+
export declare const TELEMETRY_FILTERS = "telemetry.filters";
|
|
10
|
+
/** @experimental */
|
|
11
|
+
export type TelemetryFilters = Record<string, string[]>;
|
|
12
|
+
/** @experimental */
|
|
13
|
+
export interface TelemetryConfiguration {
|
|
14
|
+
[TELEMETRY_LEVEL]: TelemetryLevel;
|
|
15
|
+
[TELEMETRY_FILTERS]: TelemetryFilters;
|
|
16
|
+
}
|
|
17
|
+
/** @experimental */
|
|
18
|
+
export declare const TelemetryPreferenceSchema: PreferenceSchema;
|
|
19
|
+
/** @experimental */
|
|
20
|
+
export declare const TelemetryPreferenceContribution: unique symbol;
|
|
21
|
+
/** @experimental */
|
|
22
|
+
export declare const TelemetryPreferences: unique symbol;
|
|
23
|
+
/** @experimental */
|
|
24
|
+
export type TelemetryPreferences = PreferenceProxy<TelemetryConfiguration>;
|
|
25
|
+
/** @experimental */
|
|
26
|
+
export declare function createTelemetryPreferences(preferences: PreferenceService, schema?: PreferenceSchema): TelemetryPreferences;
|
|
27
|
+
/** @experimental */
|
|
28
|
+
export declare function bindTelemetryPreferences(bind: interfaces.Bind): void;
|
|
29
|
+
//# sourceMappingURL=telemetry-preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-preferences.d.ts","sourceRoot":"","sources":["../../src/common/telemetry-preferences.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAyB,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAC7G,OAAO,EAA0B,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,oBAAoB;AACpB,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,oBAAoB;AACpB,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,oBAAoB;AACpB,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAExD,oBAAoB;AACpB,MAAM,WAAW,sBAAsB;IACnC,CAAC,eAAe,CAAC,EAAE,cAAc,CAAC;IAClC,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;CACzC;AAED,oBAAoB;AACpB,eAAO,MAAM,yBAAyB,EAAE,gBA4BvC,CAAC;AAEF,oBAAoB;AACpB,eAAO,MAAM,+BAA+B,eAA4C,CAAC;AACzF,oBAAoB;AACpB,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,oBAAoB;AACpB,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AAE3E,oBAAoB;AACpB,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,iBAAiB,EAAE,MAAM,GAAE,gBAA4C,GAAG,oBAAoB,CAErJ;AAED,oBAAoB;AACpB,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAQpE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TelemetryPreferences = exports.TelemetryPreferenceContribution = exports.TelemetryPreferenceSchema = exports.TELEMETRY_FILTERS = exports.TELEMETRY_LEVEL = void 0;
|
|
19
|
+
exports.createTelemetryPreferences = createTelemetryPreferences;
|
|
20
|
+
exports.bindTelemetryPreferences = bindTelemetryPreferences;
|
|
21
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
22
|
+
const preference_scope_1 = require("@theia/core/lib/common/preferences/preference-scope");
|
|
23
|
+
const preference_proxy_1 = require("@theia/core/lib/common/preferences/preference-proxy");
|
|
24
|
+
const preference_schema_1 = require("@theia/core/lib/common/preferences/preference-schema");
|
|
25
|
+
const preference_service_1 = require("@theia/core/lib/common/preferences/preference-service");
|
|
26
|
+
/** @experimental */
|
|
27
|
+
exports.TELEMETRY_LEVEL = 'telemetry.telemetryLevel';
|
|
28
|
+
/** @experimental */
|
|
29
|
+
exports.TELEMETRY_FILTERS = 'telemetry.filters';
|
|
30
|
+
/** @experimental */
|
|
31
|
+
exports.TelemetryPreferenceSchema = {
|
|
32
|
+
scope: preference_scope_1.PreferenceScope.User,
|
|
33
|
+
properties: {
|
|
34
|
+
[exports.TELEMETRY_LEVEL]: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
enum: ['off', 'crash', 'error', 'all'],
|
|
37
|
+
enumDescriptions: [
|
|
38
|
+
nls_1.nls.localizeByDefault('Disables all product telemetry.'),
|
|
39
|
+
nls_1.nls.localizeByDefault('Sends OS level crash reports.'),
|
|
40
|
+
nls_1.nls.localizeByDefault('Sends general error telemetry and crash reports.'),
|
|
41
|
+
nls_1.nls.localizeByDefault('Sends usage data, errors, and crash reports.')
|
|
42
|
+
],
|
|
43
|
+
default: 'off',
|
|
44
|
+
description: nls_1.nls.localizeByDefault('Controls the level of telemetry.')
|
|
45
|
+
},
|
|
46
|
+
[exports.TELEMETRY_FILTERS]: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
additionalProperties: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
items: {
|
|
51
|
+
type: 'string'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
default: {},
|
|
55
|
+
description: nls_1.nls.localize('theia/telemetry/filters', 'Restrict the topic patterns delivered to each telemetry sink. Missing entries allow all sink interests; empty arrays disable a sink.')
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/** @experimental */
|
|
60
|
+
exports.TelemetryPreferenceContribution = Symbol('TelemetryPreferenceContribution');
|
|
61
|
+
/** @experimental */
|
|
62
|
+
exports.TelemetryPreferences = Symbol('TelemetryPreferences');
|
|
63
|
+
/** @experimental */
|
|
64
|
+
function createTelemetryPreferences(preferences, schema = exports.TelemetryPreferenceSchema) {
|
|
65
|
+
return (0, preference_proxy_1.createPreferenceProxy)(preferences, schema);
|
|
66
|
+
}
|
|
67
|
+
/** @experimental */
|
|
68
|
+
function bindTelemetryPreferences(bind) {
|
|
69
|
+
bind(exports.TelemetryPreferences).toDynamicValue(ctx => {
|
|
70
|
+
const preferences = ctx.container.get(preference_service_1.PreferenceService);
|
|
71
|
+
const contribution = ctx.container.get(exports.TelemetryPreferenceContribution);
|
|
72
|
+
return createTelemetryPreferences(preferences, contribution.schema);
|
|
73
|
+
}).inSingletonScope();
|
|
74
|
+
bind(exports.TelemetryPreferenceContribution).toConstantValue({ schema: exports.TelemetryPreferenceSchema });
|
|
75
|
+
bind(preference_schema_1.PreferenceContribution).toService(exports.TelemetryPreferenceContribution);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=telemetry-preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-preferences.js","sourceRoot":"","sources":["../../src/common/telemetry-preferences.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AA+DhF,gEAEC;AAGD,4DAQC;AA1ED,oDAAiD;AACjD,0FAAsF;AACtF,0FAA6G;AAC7G,4FAAgH;AAChH,8FAA0F;AAI1F,oBAAoB;AACP,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC1D,oBAAoB;AACP,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAWrD,oBAAoB;AACP,QAAA,yBAAyB,GAAqB;IACvD,KAAK,EAAE,kCAAe,CAAC,IAAI;IAC3B,UAAU,EAAE;QACR,CAAC,uBAAe,CAAC,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;YACtC,gBAAgB,EAAE;gBACd,SAAG,CAAC,iBAAiB,CAAC,iCAAiC,CAAC;gBACxD,SAAG,CAAC,iBAAiB,CAAC,+BAA+B,CAAC;gBACtD,SAAG,CAAC,iBAAiB,CAAC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AAC,0CAAsB,CAAC,CAAC,SAAS,CAAC,uCAA+B,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-preferences.spec.d.ts","sourceRoot":"","sources":["../../src/common/telemetry-preferences.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const preference_scope_1 = require("@theia/core/lib/common/preferences/preference-scope");
|
|
20
|
+
const telemetry_preferences_1 = require("./telemetry-preferences");
|
|
21
|
+
describe('telemetry preferences', () => {
|
|
22
|
+
it('defines only the level and filters preference keys', () => {
|
|
23
|
+
(0, chai_1.expect)(Object.keys(telemetry_preferences_1.TelemetryPreferenceSchema.properties)).to.deep.equal([telemetry_preferences_1.TELEMETRY_LEVEL, telemetry_preferences_1.TELEMETRY_FILTERS]);
|
|
24
|
+
});
|
|
25
|
+
it('limits telemetry preferences to user scope', () => {
|
|
26
|
+
(0, chai_1.expect)(telemetry_preferences_1.TelemetryPreferenceSchema.scope).to.equal(preference_scope_1.PreferenceScope.User);
|
|
27
|
+
});
|
|
28
|
+
it('uses safe defaults and describes each telemetry level', () => {
|
|
29
|
+
(0, chai_1.expect)(telemetry_preferences_1.TelemetryPreferenceSchema.properties[telemetry_preferences_1.TELEMETRY_LEVEL]).to.deep.include({
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: ['off', 'crash', 'error', 'all'],
|
|
32
|
+
enumDescriptions: [
|
|
33
|
+
'Disables all product telemetry.',
|
|
34
|
+
'Sends OS level crash reports.',
|
|
35
|
+
'Sends general error telemetry and crash reports.',
|
|
36
|
+
'Sends usage data, errors, and crash reports.'
|
|
37
|
+
],
|
|
38
|
+
default: 'off'
|
|
39
|
+
});
|
|
40
|
+
(0, chai_1.expect)(telemetry_preferences_1.TelemetryPreferenceSchema.properties[telemetry_preferences_1.TELEMETRY_FILTERS].default).to.deep.equal({});
|
|
41
|
+
});
|
|
42
|
+
it('defines filters as sink IDs mapped to arrays of topic patterns', () => {
|
|
43
|
+
(0, chai_1.expect)(telemetry_preferences_1.TelemetryPreferenceSchema.properties[telemetry_preferences_1.TELEMETRY_FILTERS]).to.include({ type: 'object' });
|
|
44
|
+
(0, chai_1.expect)(telemetry_preferences_1.TelemetryPreferenceSchema.properties[telemetry_preferences_1.TELEMETRY_FILTERS].additionalProperties).to.deep.equal({
|
|
45
|
+
type: 'array',
|
|
46
|
+
items: { type: 'string' }
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=telemetry-preferences.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-preferences.spec.js","sourceRoot":"","sources":["../../src/common/telemetry-preferences.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E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,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/F,IAAA,aAAM,EAAC,iDAAyB,CAAC,UAAU,CAAC,yCAAiB,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAC/F,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TelemetryData, TelemetryEventKind, TelemetryReportOptions, TelemetryValue } from './telemetry-service';
|
|
2
|
+
/** @experimental */
|
|
3
|
+
export interface TelemetryEvent<T extends object = Record<string, TelemetryValue>> {
|
|
4
|
+
readonly topic: string;
|
|
5
|
+
readonly kind: TelemetryEventKind;
|
|
6
|
+
readonly data?: TelemetryData<T>;
|
|
7
|
+
readonly attributes?: TelemetryData<Record<string, TelemetryValue>>;
|
|
8
|
+
readonly session: string;
|
|
9
|
+
readonly timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
/** @experimental */
|
|
12
|
+
export declare function isValidTelemetryEvent(event: unknown): event is TelemetryEvent;
|
|
13
|
+
/** @experimental */
|
|
14
|
+
export declare function describeTelemetryTopic(topic: unknown): string;
|
|
15
|
+
/** @experimental */
|
|
16
|
+
export declare function describeTelemetryEventTopic(event: unknown): string;
|
|
17
|
+
/** @experimental */
|
|
18
|
+
export declare function createTelemetryEvent<T extends object>(topic: string, session: string, data?: TelemetryData<T>, options?: TelemetryReportOptions): TelemetryEvent<T>;
|
|
19
|
+
/** @experimental */
|
|
20
|
+
export declare function snapshotTelemetryEvent(event: TelemetryEvent): TelemetryEvent;
|
|
21
|
+
/** @experimental */
|
|
22
|
+
export declare const telemetryServicePath = "/services/telemetry";
|
|
23
|
+
/** @experimental */
|
|
24
|
+
export declare const TelemetryRpc: unique symbol;
|
|
25
|
+
/** @experimental */
|
|
26
|
+
export interface TelemetryRpc {
|
|
27
|
+
notifyEvent(event: TelemetryEvent): void;
|
|
28
|
+
getLocalSinkInterests(): Promise<string[]>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=telemetry-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-protocol.d.ts","sourceRoot":"","sources":["../../src/common/telemetry-protocol.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,aAAa,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,cAAc,EAC5E,MAAM,qBAAqB,CAAC;AAG7B,oBAAoB;AACpB,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAED,oBAAoB;AACpB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAY7E;AAED,oBAAoB;AACpB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7D;AAED,oBAAoB;AACpB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKlE;AAED,oBAAoB;AACpB,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EACjD,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,EAAE,sBAAsB,GACjC,cAAc,CAAC,CAAC,CAAC,CASnB;AAED,oBAAoB;AACpB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAS5E;AAED,oBAAoB;AACpB,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAE1D,oBAAoB;AACpB,eAAO,MAAM,YAAY,eAAyB,CAAC;AAEnD,oBAAoB;AACpB,MAAM,WAAW,YAAY;IACzB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC9C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TelemetryRpc = exports.telemetryServicePath = void 0;
|
|
19
|
+
exports.isValidTelemetryEvent = isValidTelemetryEvent;
|
|
20
|
+
exports.describeTelemetryTopic = describeTelemetryTopic;
|
|
21
|
+
exports.describeTelemetryEventTopic = describeTelemetryEventTopic;
|
|
22
|
+
exports.createTelemetryEvent = createTelemetryEvent;
|
|
23
|
+
exports.snapshotTelemetryEvent = snapshotTelemetryEvent;
|
|
24
|
+
const types_1 = require("@theia/core/lib/common/types");
|
|
25
|
+
const telemetry_service_1 = require("./telemetry-service");
|
|
26
|
+
const telemetry_topic_1 = require("./telemetry-topic");
|
|
27
|
+
/** @experimental */
|
|
28
|
+
function isValidTelemetryEvent(event) {
|
|
29
|
+
if (!(0, types_1.isObject)(event)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return (0, telemetry_topic_1.isValidTelemetryTopic)(event.topic)
|
|
33
|
+
&& (0, telemetry_service_1.isTelemetryEventKind)(event.kind)
|
|
34
|
+
&& typeof event.session === 'string'
|
|
35
|
+
&& event.session.length > 0
|
|
36
|
+
&& typeof event.timestamp === 'number'
|
|
37
|
+
&& Number.isFinite(event.timestamp)
|
|
38
|
+
&& (event.data === undefined || (0, telemetry_service_1.isTelemetryData)(event.data))
|
|
39
|
+
&& (event.attributes === undefined || (0, telemetry_service_1.isTelemetryData)(event.attributes));
|
|
40
|
+
}
|
|
41
|
+
/** @experimental */
|
|
42
|
+
function describeTelemetryTopic(topic) {
|
|
43
|
+
return typeof topic === 'string' ? topic : '<invalid>';
|
|
44
|
+
}
|
|
45
|
+
/** @experimental */
|
|
46
|
+
function describeTelemetryEventTopic(event) {
|
|
47
|
+
if (!(0, types_1.isObject)(event)) {
|
|
48
|
+
return '<invalid>';
|
|
49
|
+
}
|
|
50
|
+
return describeTelemetryTopic(event.topic);
|
|
51
|
+
}
|
|
52
|
+
/** @experimental */
|
|
53
|
+
function createTelemetryEvent(topic, session, data, options) {
|
|
54
|
+
return {
|
|
55
|
+
topic,
|
|
56
|
+
kind: options?.kind ?? 'usage',
|
|
57
|
+
data,
|
|
58
|
+
attributes: options?.attributes,
|
|
59
|
+
session,
|
|
60
|
+
timestamp: Date.now()
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** @experimental */
|
|
64
|
+
function snapshotTelemetryEvent(event) {
|
|
65
|
+
return Object.freeze({
|
|
66
|
+
topic: event.topic,
|
|
67
|
+
kind: event.kind,
|
|
68
|
+
data: (0, telemetry_service_1.snapshotTelemetryData)(event.data),
|
|
69
|
+
attributes: (0, telemetry_service_1.snapshotTelemetryData)(event.attributes),
|
|
70
|
+
session: event.session,
|
|
71
|
+
timestamp: event.timestamp
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/** @experimental */
|
|
75
|
+
exports.telemetryServicePath = '/services/telemetry';
|
|
76
|
+
/** @experimental */
|
|
77
|
+
exports.TelemetryRpc = Symbol('TelemetryRpc');
|
|
78
|
+
//# sourceMappingURL=telemetry-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-protocol.js","sourceRoot":"","sources":["../../src/common/telemetry-protocol.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAmBhF,sDAYC;AAGD,wDAEC;AAGD,kEAKC;AAGD,oDAcC;AAGD,wDASC;AAvED,wDAAwD;AACxD,2DAE6B;AAC7B,uDAA0D;AAY1D,oBAAoB;AACpB,SAAgB,qBAAqB,CAAC,KAAc;IAChD,IAAI,CAAC,IAAA,gBAAQ,EAAiB,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,IAAA,uCAAqB,EAAC,KAAK,CAAC,KAAK,CAAC;WAClC,IAAA,wCAAoB,EAAC,KAAK,CAAC,IAAI,CAAC;WAChC,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;WACjC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;WACxB,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;QACnD,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,SAAS;KAC7B,CAAC,CAAC;AACP,CAAC;AAED,oBAAoB;AACP,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAE1D,oBAAoB;AACP,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @experimental */
|
|
2
|
+
export type TelemetryPrimitive = string | number | boolean;
|
|
3
|
+
/** @experimental */
|
|
4
|
+
export type TelemetryValue = TelemetryPrimitive | readonly string[] | readonly number[] | readonly boolean[];
|
|
5
|
+
/** @experimental */
|
|
6
|
+
export type TelemetryData<T extends object> = {
|
|
7
|
+
[K in keyof T]: T[K] extends TelemetryValue ? T[K] : never;
|
|
8
|
+
};
|
|
9
|
+
/** @experimental */
|
|
10
|
+
export declare function isTelemetryData(data: unknown): data is Record<string, TelemetryValue>;
|
|
11
|
+
/** @experimental */
|
|
12
|
+
export declare function snapshotTelemetryData<T extends object>(data: TelemetryData<T> | undefined): TelemetryData<T> | undefined;
|
|
13
|
+
/** @experimental */
|
|
14
|
+
export type TelemetryEventKind = 'usage' | 'error' | 'crash';
|
|
15
|
+
/** @experimental */
|
|
16
|
+
export declare function isTelemetryEventKind(value: unknown): value is TelemetryEventKind;
|
|
17
|
+
/** @experimental */
|
|
18
|
+
export interface TelemetryReportOptions {
|
|
19
|
+
readonly kind?: TelemetryEventKind;
|
|
20
|
+
readonly attributes?: TelemetryData<Record<string, TelemetryValue>>;
|
|
21
|
+
}
|
|
22
|
+
/** @experimental */
|
|
23
|
+
export declare const TelemetryService: unique symbol;
|
|
24
|
+
/** @experimental */
|
|
25
|
+
export interface TelemetryService {
|
|
26
|
+
report<T extends object>(topic: string, data?: TelemetryData<T>, options?: TelemetryReportOptions): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=telemetry-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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