@codingame/monaco-vscode-telemetry-service-override 25.1.2 → 26.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-telemetry-service-override",
3
- "version": "25.1.2",
3
+ "version": "26.0.1",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - telemetry service-override",
6
6
  "keywords": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "25.1.2",
18
+ "@codingame/monaco-vscode-api": "26.0.1",
19
19
  "@microsoft/1ds-core-js": "3.2.18",
20
20
  "@microsoft/1ds-post-js": "3.2.18"
21
21
  },
@@ -3,8 +3,8 @@ import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/c
3
3
  import { mixin } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
4
4
  import { validateTelemetryData } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
5
5
 
6
- const endpointUrl = 'https://mobile.events.data.microsoft.com/OneCollector/1.0';
7
- const endpointHealthUrl = 'https://mobile.events.data.microsoft.com/ping';
6
+ const endpointUrl = "https://mobile.events.data.microsoft.com/OneCollector/1.0";
7
+ const endpointHealthUrl = "https://mobile.events.data.microsoft.com/ping";
8
8
  async function getClient(instrumentationKey, addInternalFlag, xhrOverride) {
9
9
  const oneDs = await import('@microsoft/1ds-core-js');
10
10
  const postPlugin = await import('@microsoft/1ds-post-js');
@@ -18,9 +18,7 @@ async function getClient(instrumentationKey, addInternalFlag, xhrOverride) {
18
18
  disableCookiesUsage: true,
19
19
  disableDbgExt: true,
20
20
  disableInstrumentationKeyValidation: true,
21
- channels: [[
22
- collectorChannelPlugin
23
- ]]
21
+ channels: [[collectorChannelPlugin]]
24
22
  };
25
23
  if (xhrOverride) {
26
24
  coreConfig.extensionConfig = {};
@@ -32,20 +30,25 @@ async function getClient(instrumentationKey, addInternalFlag, xhrOverride) {
32
30
  coreConfig.extensionConfig[collectorChannelPlugin.identifier] = channelConfig;
33
31
  }
34
32
  appInsightsCore.initialize(coreConfig, []);
35
- appInsightsCore.addTelemetryInitializer((envelope) => {
36
- envelope['ext'] = envelope['ext'] ?? {};
37
- envelope['ext']['web'] = envelope['ext']['web'] ?? {};
38
- envelope['ext']['web']['consentDetails'] = '{"GPC_DataSharingOptIn":false}';
33
+ appInsightsCore.addTelemetryInitializer(envelope => {
34
+ envelope["ext"] = envelope["ext"] ?? {};
35
+ envelope["ext"]["web"] = envelope["ext"]["web"] ?? {};
36
+ envelope["ext"]["web"]["consentDetails"] = "{\"GPC_DataSharingOptIn\":false}";
39
37
  if (addInternalFlag) {
40
- envelope['ext']['utc'] = envelope['ext']['utc'] ?? {};
41
- envelope['ext']['utc']['flags'] = 0x0000811ECD;
38
+ envelope["ext"]["utc"] = envelope["ext"]["utc"] ?? {};
39
+ envelope["ext"]["utc"]["flags"] = 0x0000811ECD;
42
40
  }
43
41
  });
44
42
  return appInsightsCore;
45
43
  }
46
44
  class AbstractOneDataSystemAppender {
47
- constructor(_isInternalTelemetry, _eventPrefix, _defaultData, iKeyOrClientFactory,
48
- _xhrOverride) {
45
+ constructor(
46
+ _isInternalTelemetry,
47
+ _eventPrefix,
48
+ _defaultData,
49
+ iKeyOrClientFactory,
50
+ _xhrOverride
51
+ ) {
49
52
  this._isInternalTelemetry = _isInternalTelemetry;
50
53
  this._eventPrefix = _eventPrefix;
51
54
  this._defaultData = _defaultData;
@@ -55,10 +58,9 @@ class AbstractOneDataSystemAppender {
55
58
  if (!this._defaultData) {
56
59
  this._defaultData = {};
57
60
  }
58
- if (typeof iKeyOrClientFactory === 'function') {
61
+ if (typeof iKeyOrClientFactory === "function") {
59
62
  this._aiCoreOrKey = iKeyOrClientFactory();
60
- }
61
- else {
63
+ } else {
62
64
  this._aiCoreOrKey = iKeyOrClientFactory;
63
65
  }
64
66
  this._asyncAiCore = null;
@@ -67,16 +69,16 @@ class AbstractOneDataSystemAppender {
67
69
  if (!this._aiCoreOrKey) {
68
70
  return;
69
71
  }
70
- if (typeof this._aiCoreOrKey !== 'string') {
72
+ if (typeof this._aiCoreOrKey !== "string") {
71
73
  callback(this._aiCoreOrKey);
72
74
  return;
73
75
  }
74
76
  if (!this._asyncAiCore) {
75
77
  this._asyncAiCore = getClient(this._aiCoreOrKey, this._isInternalTelemetry, this._xhrOverride);
76
78
  }
77
- this._asyncAiCore.then((aiClient) => {
79
+ this._asyncAiCore.then(aiClient => {
78
80
  callback(aiClient);
79
- }, (err) => {
81
+ }, err => {
80
82
  onUnexpectedError(err);
81
83
  console.error(err);
82
84
  });
@@ -87,22 +89,25 @@ class AbstractOneDataSystemAppender {
87
89
  }
88
90
  data = mixin(data, this._defaultData);
89
91
  const validatedData = validateTelemetryData(data);
90
- const name = this._eventPrefix + '/' + eventName;
92
+ const name = this._eventPrefix + "/" + eventName;
91
93
  try {
92
- this._withAIClient((aiClient) => {
93
- aiClient.pluginVersionString = validatedData?.properties.version ?? 'Unknown';
94
+ this._withAIClient(aiClient => {
95
+ aiClient.pluginVersionString = validatedData?.properties.version ?? "Unknown";
94
96
  aiClient.track({
95
97
  name,
96
- baseData: { name, properties: validatedData?.properties, measurements: validatedData?.measurements }
98
+ baseData: {
99
+ name,
100
+ properties: validatedData?.properties,
101
+ measurements: validatedData?.measurements
102
+ }
97
103
  });
98
104
  });
99
- }
100
- catch { }
105
+ } catch {}
101
106
  }
102
107
  flush() {
103
108
  if (this._aiCoreOrKey) {
104
109
  return ( new Promise(resolve => {
105
- this._withAIClient((aiClient) => {
110
+ this._withAIClient(aiClient => {
106
111
  aiClient.unload(true, () => {
107
112
  this._aiCoreOrKey = undefined;
108
113
  resolve(undefined);
@@ -6,12 +6,11 @@ import { safeStringify } from '@codingame/monaco-vscode-api/vscode/vs/base/commo
6
6
  import { FileOperationError } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
7
7
 
8
8
  var ErrorEvent;
9
- (function (ErrorEvent) {
9
+ (function(ErrorEvent) {
10
10
  function compare(a, b) {
11
11
  if (a.callstack < b.callstack) {
12
12
  return -1;
13
- }
14
- else if (a.callstack > b.callstack) {
13
+ } else if (a.callstack > b.callstack) {
15
14
  return 1;
16
15
  }
17
16
  return 0;
@@ -19,14 +18,16 @@ var ErrorEvent;
19
18
  ErrorEvent.compare = compare;
20
19
  })(ErrorEvent || (ErrorEvent = {}));
21
20
  class BaseErrorTelemetry {
22
- static { this.ERROR_FLUSH_TIMEOUT = 5 * 1000; }
21
+ static {
22
+ this.ERROR_FLUSH_TIMEOUT = 5 * 1000;
23
+ }
23
24
  constructor(telemetryService, flushDelay = BaseErrorTelemetry.ERROR_FLUSH_TIMEOUT) {
24
25
  this._flushHandle = undefined;
25
26
  this._buffer = [];
26
27
  this._disposables = ( new DisposableStore());
27
28
  this._telemetryService = telemetryService;
28
29
  this._flushDelay = flushDelay;
29
- const unbind = errorHandler.addListener((err) => this._onErrorEvent(err));
30
+ const unbind = errorHandler.addListener(err => this._onErrorEvent(err));
30
31
  this._disposables.add(toDisposable(unbind));
31
32
  this.installErrorListeners();
32
33
  }
@@ -35,8 +36,7 @@ class BaseErrorTelemetry {
35
36
  this._flushBuffer();
36
37
  this._disposables.dispose();
37
38
  }
38
- installErrorListeners() {
39
- }
39
+ installErrorListeners() {}
40
40
  _onErrorEvent(err) {
41
41
  if (!err || err.code) {
42
42
  return;
@@ -44,23 +44,25 @@ class BaseErrorTelemetry {
44
44
  if (err.detail && err.detail.stack) {
45
45
  err = err.detail;
46
46
  }
47
- if (ErrorNoTelemetry.isErrorNoTelemetry(err) || err instanceof FileOperationError || PendingMigrationError.is(err) || (typeof err?.message === 'string' && err.message.includes('Unable to read file'))) {
47
+ if (ErrorNoTelemetry.isErrorNoTelemetry(err) || err instanceof FileOperationError || PendingMigrationError.is(err) || (typeof err?.message === "string" && err.message.includes("Unable to read file"))) {
48
48
  return;
49
49
  }
50
- const callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack;
50
+ const callstack = Array.isArray(err.stack) ? err.stack.join("\n") : err.stack;
51
51
  const msg = err.message ? err.message : safeStringify(err);
52
52
  if (!callstack) {
53
53
  return;
54
54
  }
55
- this._enqueue({ msg, callstack });
55
+ this._enqueue({
56
+ msg,
57
+ callstack
58
+ });
56
59
  }
57
60
  _enqueue(e) {
58
61
  const idx = binarySearch(this._buffer, e, ErrorEvent.compare);
59
62
  if (idx < 0) {
60
63
  e.count = 1;
61
64
  this._buffer.splice(~idx, 0, e);
62
- }
63
- else {
65
+ } else {
64
66
  if (!this._buffer[idx].count) {
65
67
  this._buffer[idx].count = 0;
66
68
  }
@@ -75,7 +77,7 @@ class BaseErrorTelemetry {
75
77
  }
76
78
  _flushBuffer() {
77
79
  for (const error of this._buffer) {
78
- this._telemetryService.publicLogError2('UnhandledError', error);
80
+ this._telemetryService.publicLogError2("UnhandledError", error);
79
81
  }
80
82
  this._buffer.length = 0;
81
83
  }
@@ -11,16 +11,15 @@ let TelemetryLogAppender = class TelemetryLogAppender extends Disposable {
11
11
  constructor(prefix, remote, loggerService, environmentService, productService) {
12
12
  super();
13
13
  this.prefix = prefix;
14
- const id = remote ? 'remoteTelemetry' : telemetryLogId;
14
+ const id = remote ? "remoteTelemetry" : telemetryLogId;
15
15
  const logger = loggerService.getLogger(id);
16
16
  if (logger) {
17
17
  this.logger = this._register(logger);
18
- }
19
- else {
18
+ } else {
20
19
  const justLoggingAndNotSending = isLoggingOnly(productService, environmentService);
21
- const logSuffix = justLoggingAndNotSending ? ' (Not Sent)' : '';
20
+ const logSuffix = justLoggingAndNotSending ? " (Not Sent)" : "";
22
21
  this.logger = this._register(loggerService.createLogger(id, {
23
- name: ( localize(2062, "Telemetry{0}", logSuffix)),
22
+ name: ( localize(2064, "Telemetry{0}", logSuffix)),
24
23
  group: TelemetryLogGroup,
25
24
  hidden: true
26
25
  }));
@@ -33,10 +32,6 @@ let TelemetryLogAppender = class TelemetryLogAppender extends Disposable {
33
32
  this.logger.trace(`${this.prefix}telemetry/${eventName}`, validateTelemetryData(data));
34
33
  }
35
34
  };
36
- TelemetryLogAppender = ( __decorate([
37
- ( __param(2, ILoggerService)),
38
- ( __param(3, IEnvironmentService)),
39
- ( __param(4, IProductService))
40
- ], TelemetryLogAppender));
35
+ TelemetryLogAppender = ( __decorate([( __param(2, ILoggerService)), ( __param(3, IEnvironmentService)), ( __param(4, IProductService))], TelemetryLogAppender));
41
36
 
42
37
  export { TelemetryLogAppender };
@@ -16,11 +16,21 @@ import { getTelemetryLevel, cleanData } from '@codingame/monaco-vscode-api/vscod
16
16
 
17
17
  var TelemetryService_1;
18
18
  let TelemetryService = class TelemetryService {
19
- static { TelemetryService_1 = this; }
20
- static { this.IDLE_START_EVENT_NAME = 'UserIdleStart'; }
21
- static { this.IDLE_STOP_EVENT_NAME = 'UserIdleStop'; }
22
- static { this.BUFFER_FLUSH_TIMEOUT = 10000; }
23
- static { this.MAX_BUFFER_SIZE = 1000; }
19
+ static {
20
+ TelemetryService_1 = this;
21
+ }
22
+ static {
23
+ this.IDLE_START_EVENT_NAME = "UserIdleStart";
24
+ }
25
+ static {
26
+ this.IDLE_STOP_EVENT_NAME = "UserIdleStop";
27
+ }
28
+ static {
29
+ this.BUFFER_FLUSH_TIMEOUT = 10000;
30
+ }
31
+ static {
32
+ this.MAX_BUFFER_SIZE = 1000;
33
+ }
24
34
  constructor(config, _configurationService, _productService) {
25
35
  this._configurationService = _configurationService;
26
36
  this._productService = _productService;
@@ -31,35 +41,32 @@ let TelemetryService = class TelemetryService {
31
41
  this._cleanupPatterns = [];
32
42
  this._appenders = config.appenders;
33
43
  this._commonProperties = config.commonProperties ?? Object.create(null);
34
- this.sessionId = this._commonProperties['sessionID'];
35
- this.machineId = this._commonProperties['common.machineId'];
36
- this.sqmId = this._commonProperties['common.sqmId'];
37
- this.devDeviceId = this._commonProperties['common.devDeviceId'];
38
- this.firstSessionDate = this._commonProperties['common.firstSessionDate'];
39
- this.msftInternal = this._commonProperties['common.msftInternal'];
44
+ this.sessionId = this._commonProperties["sessionID"];
45
+ this.machineId = this._commonProperties["common.machineId"];
46
+ this.sqmId = this._commonProperties["common.sqmId"];
47
+ this.devDeviceId = this._commonProperties["common.devDeviceId"];
48
+ this.firstSessionDate = this._commonProperties["common.firstSessionDate"];
49
+ this.msftInternal = this._commonProperties["common.msftInternal"];
40
50
  this._piiPaths = config.piiPaths || [];
41
51
  this._telemetryLevel = TelemetryLevel.USAGE;
42
52
  this._sendErrorTelemetry = !!config.sendErrorTelemetry;
43
53
  this._cleanupPatterns = [/(vscode-)?file:\/\/.*?\/resources\/app\//gi];
44
54
  for (const piiPath of this._piiPaths) {
45
- this._cleanupPatterns.push(( new RegExp(escapeRegExpCharacters(piiPath), 'gi')));
46
- if (piiPath.indexOf('\\') >= 0) {
47
- this._cleanupPatterns.push(( new RegExp(escapeRegExpCharacters(piiPath.replace(/\\/g, '/')), 'gi')));
55
+ this._cleanupPatterns.push(( new RegExp(escapeRegExpCharacters(piiPath), "gi")));
56
+ if (piiPath.indexOf("\\") >= 0) {
57
+ this._cleanupPatterns.push(( new RegExp(escapeRegExpCharacters(piiPath.replace(/\\/g, "/")), "gi")));
48
58
  }
49
59
  }
50
60
  this._updateTelemetryLevel();
51
61
  this._disposables.add(this._configurationService.onDidChangeConfiguration(e => {
52
- const affectsTelemetryConfig = e.affectsConfiguration(TELEMETRY_SETTING_ID)
53
- || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID)
54
- || e.affectsConfiguration(TELEMETRY_CRASH_REPORTER_SETTING_ID);
62
+ const affectsTelemetryConfig = e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID) || e.affectsConfiguration(TELEMETRY_CRASH_REPORTER_SETTING_ID);
55
63
  if (affectsTelemetryConfig) {
56
64
  this._updateTelemetryLevel();
57
65
  }
58
66
  }));
59
67
  if (config.waitForExperimentProperties) {
60
68
  this._flushTimeout = setTimeout(() => this._flushPendingEvents(), TelemetryService_1.BUFFER_FLUSH_TIMEOUT);
61
- }
62
- else {
69
+ } else {
63
70
  this._isExperimentPropertySet = true;
64
71
  }
65
72
  }
@@ -109,7 +116,11 @@ let TelemetryService = class TelemetryService {
109
116
  }
110
117
  if (!this._isExperimentPropertySet) {
111
118
  if (this._pendingEvents.length < TelemetryService_1.MAX_BUFFER_SIZE) {
112
- this._pendingEvents.push({ eventName, eventLevel, data });
119
+ this._pendingEvents.push({
120
+ eventName,
121
+ eventLevel,
122
+ data
123
+ });
113
124
  }
114
125
  return;
115
126
  }
@@ -137,36 +148,31 @@ let TelemetryService = class TelemetryService {
137
148
  this.publicLogError(eventName, data);
138
149
  }
139
150
  };
140
- TelemetryService = TelemetryService_1 = ( __decorate([
141
- ( __param(1, IConfigurationService)),
142
- ( __param(2, IProductService))
143
- ], TelemetryService));
151
+ TelemetryService = TelemetryService_1 = ( __decorate([( __param(1, IConfigurationService)), ( __param(2, IProductService))], TelemetryService));
144
152
  function getTelemetryLevelSettingDescription() {
145
153
  const telemetryText = ( localize(
146
- 2063,
154
+ 2065,
147
155
  "Controls {0} telemetry, first-party extension telemetry, and participating third-party extension telemetry. Some third party extensions might not respect this setting. Consult the specific extension's documentation to be sure. Telemetry helps us better understand how {0} is performing, where improvements need to be made, and how features are being used.",
148
156
  product.nameLong
149
157
  ));
150
- const externalLinksStatement = !product.privacyStatementUrl ?
151
- ( localize(
152
- 2064,
158
+ const externalLinksStatement = !product.privacyStatementUrl ? ( localize(
159
+ 2066,
153
160
  "Read more about the [data we collect]({0}).",
154
- 'https://aka.ms/vscode-telemetry'
155
- )) :
156
- ( localize(
157
- 2065,
161
+ "https://aka.ms/vscode-telemetry"
162
+ )) : ( localize(
163
+ 2067,
158
164
  "Read more about the [data we collect]({0}) and our [privacy statement]({1}).",
159
- 'https://aka.ms/vscode-telemetry',
165
+ "https://aka.ms/vscode-telemetry",
160
166
  product.privacyStatementUrl
161
167
  ));
162
168
  const restartString = !isWeb ? ( localize(
163
- 2066,
164
- 'A full restart of the application is necessary for crash reporting changes to take effect.'
165
- )) : '';
166
- const crashReportsHeader = ( localize(2067, "Crash Reports"));
167
- const errorsHeader = ( localize(2068, "Error Telemetry"));
168
- const usageHeader = ( localize(2069, "Usage Data"));
169
- const telemetryTableDescription = ( localize(2070, "The following table outlines the data sent with each setting:"));
169
+ 2068,
170
+ "A full restart of the application is necessary for crash reporting changes to take effect."
171
+ )) : "";
172
+ const crashReportsHeader = ( localize(2069, "Crash Reports"));
173
+ const errorsHeader = ( localize(2070, "Error Telemetry"));
174
+ const usageHeader = ( localize(2071, "Usage Data"));
175
+ const telemetryTableDescription = ( localize(2072, "The following table outlines the data sent with each setting:"));
170
176
  const telemetryTable = `
171
177
  | | ${crashReportsHeader} | ${errorsHeader} | ${usageHeader} |
172
178
  |:------|:-------------:|:---------------:|:----------:|
@@ -176,7 +182,7 @@ function getTelemetryLevelSettingDescription() {
176
182
  | off | - | - | - |
177
183
  `;
178
184
  const deprecatedSettingNote = ( localize(
179
- 2071,
185
+ 2073,
180
186
  "****Note:*** If this setting is 'off', no telemetry will be sent regardless of other telemetry settings. If this setting is set to anything except 'off' and telemetry is disabled with deprecated settings, no telemetry will be sent.*"
181
187
  ));
182
188
  const telemetryDescription = `
@@ -195,97 +201,95 @@ ${deprecatedSettingNote}
195
201
  }
196
202
  const configurationRegistry = ( Registry.as(Extensions.Configuration));
197
203
  configurationRegistry.registerConfiguration({
198
- 'id': TELEMETRY_SECTION_ID,
199
- 'order': 1,
200
- 'type': 'object',
201
- 'title': ( localize(2072, "Telemetry")),
202
- 'properties': {
204
+ "id": TELEMETRY_SECTION_ID,
205
+ "order": 1,
206
+ "type": "object",
207
+ "title": ( localize(2074, "Telemetry")),
208
+ "properties": {
203
209
  [TELEMETRY_SETTING_ID]: {
204
- 'type': 'string',
205
- 'enum': [TelemetryConfiguration.ON, TelemetryConfiguration.ERROR, TelemetryConfiguration.CRASH, TelemetryConfiguration.OFF],
206
- 'enumDescriptions': [
207
- ( localize(2073, "Sends usage data, errors, and crash reports.")),
208
- ( localize(2074, "Sends general error telemetry and crash reports.")),
209
- ( localize(2075, "Sends OS level crash reports.")),
210
- ( localize(2076, "Disables all product telemetry."))
210
+ "type": "string",
211
+ "enum": [
212
+ TelemetryConfiguration.ON,
213
+ TelemetryConfiguration.ERROR,
214
+ TelemetryConfiguration.CRASH,
215
+ TelemetryConfiguration.OFF
211
216
  ],
212
- 'markdownDescription': getTelemetryLevelSettingDescription(),
213
- 'default': TelemetryConfiguration.ON,
214
- 'restricted': true,
215
- 'scope': ConfigurationScope.APPLICATION,
216
- 'tags': ['usesOnlineServices', 'telemetry'],
217
- 'policy': {
218
- name: 'TelemetryLevel',
217
+ "enumDescriptions": [( localize(2075, "Sends usage data, errors, and crash reports.")), ( localize(2076, "Sends general error telemetry and crash reports.")), ( localize(2077, "Sends OS level crash reports.")), ( localize(2078, "Disables all product telemetry."))],
218
+ "markdownDescription": getTelemetryLevelSettingDescription(),
219
+ "default": TelemetryConfiguration.ON,
220
+ "restricted": true,
221
+ "scope": ConfigurationScope.APPLICATION,
222
+ "tags": ["usesOnlineServices", "telemetry"],
223
+ "policy": {
224
+ name: "TelemetryLevel",
219
225
  category: PolicyCategory.Telemetry,
220
- minimumVersion: '1.99',
226
+ minimumVersion: "1.99",
221
227
  localization: {
222
228
  description: {
223
- key: 'telemetry.telemetryLevel.policyDescription',
224
- value: ( localize(2077, "Controls the level of telemetry.")),
229
+ key: "telemetry.telemetryLevel.policyDescription",
230
+ value: ( localize(2079, "Controls the level of telemetry."))
225
231
  },
226
- enumDescriptions: [
227
- {
228
- key: 'telemetry.telemetryLevel.default',
229
- value: ( localize(2073, "Sends usage data, errors, and crash reports.")),
230
- },
231
- {
232
- key: 'telemetry.telemetryLevel.error',
233
- value: ( localize(2074, "Sends general error telemetry and crash reports.")),
234
- },
235
- {
236
- key: 'telemetry.telemetryLevel.crash',
237
- value: ( localize(2075, "Sends OS level crash reports.")),
238
- },
239
- {
240
- key: 'telemetry.telemetryLevel.off',
241
- value: ( localize(2076, "Disables all product telemetry.")),
242
- }
243
- ]
232
+ enumDescriptions: [{
233
+ key: "telemetry.telemetryLevel.default",
234
+ value: ( localize(2075, "Sends usage data, errors, and crash reports."))
235
+ }, {
236
+ key: "telemetry.telemetryLevel.error",
237
+ value: ( localize(2076, "Sends general error telemetry and crash reports."))
238
+ }, {
239
+ key: "telemetry.telemetryLevel.crash",
240
+ value: ( localize(2077, "Sends OS level crash reports."))
241
+ }, {
242
+ key: "telemetry.telemetryLevel.off",
243
+ value: ( localize(2078, "Disables all product telemetry."))
244
+ }]
244
245
  }
245
246
  }
246
247
  },
247
- 'telemetry.feedback.enabled': {
248
- type: 'boolean',
248
+ "telemetry.feedback.enabled": {
249
+ type: "boolean",
249
250
  default: true,
250
251
  description: ( localize(
251
- 2078,
252
+ 2080,
252
253
  "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
253
254
  )),
254
255
  policy: {
255
- name: 'EnableFeedback',
256
+ name: "EnableFeedback",
256
257
  category: PolicyCategory.Telemetry,
257
- minimumVersion: '1.99',
258
- localization: { description: { key: 'telemetry.feedback.enabled', value: ( localize(
259
- 2078,
260
- "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
261
- )) } },
258
+ minimumVersion: "1.99",
259
+ localization: {
260
+ description: {
261
+ key: "telemetry.feedback.enabled",
262
+ value: ( localize(
263
+ 2080,
264
+ "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
265
+ ))
266
+ }
267
+ }
262
268
  }
263
269
  },
264
270
  [TELEMETRY_OLD_SETTING_ID]: {
265
- 'type': 'boolean',
266
- 'markdownDescription': !product.privacyStatementUrl ?
267
- ( localize(
268
- 2079,
271
+ "type": "boolean",
272
+ "markdownDescription": !product.privacyStatementUrl ? ( localize(
273
+ 2081,
269
274
  "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.",
270
275
  product.nameLong
271
- )) :
272
- ( localize(
273
- 2080,
276
+ )) : ( localize(
277
+ 2082,
274
278
  "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made. [Read more]({1}) about what we collect and our privacy statement.",
275
279
  product.nameLong,
276
280
  product.privacyStatementUrl
277
281
  )),
278
- 'default': true,
279
- 'restricted': true,
280
- 'markdownDeprecationMessage': ( localize(
281
- 2081,
282
+ "default": true,
283
+ "restricted": true,
284
+ "markdownDeprecationMessage": ( localize(
285
+ 2083,
282
286
  "If this setting is false, no telemetry will be sent regardless of the new setting's value. Deprecated in favor of the {0} setting.",
283
287
  `\`#${TELEMETRY_SETTING_ID}#\``
284
288
  )),
285
- 'scope': ConfigurationScope.APPLICATION,
286
- 'tags': ['usesOnlineServices', 'telemetry']
289
+ "scope": ConfigurationScope.APPLICATION,
290
+ "tags": ["usesOnlineServices", "telemetry"]
287
291
  }
288
- },
292
+ }
289
293
  });
290
294
 
291
295
  export { TelemetryService };
@@ -44,24 +44,62 @@ import { TerminalContribSettingId } from '@codingame/monaco-vscode-api/vscode/vs
44
44
 
45
45
  var TelemetryContribution_1;
46
46
  let TelemetryContribution = class TelemetryContribution extends Disposable {
47
- static { TelemetryContribution_1 = this; }
48
- static { this.ALLOWLIST_JSON = ['package.json', 'package-lock.json', 'tsconfig.json', 'jsconfig.json', 'bower.json', '.eslintrc.json', 'tslint.json', 'composer.json']; }
49
- static { this.ALLOWLIST_WORKSPACE_JSON = ['settings.json', 'extensions.json', 'tasks.json', 'launch.json']; }
50
- constructor(telemetryService, contextService, lifecycleService, editorService, keybindingsService, themeService, environmentService, userDataProfileService, paneCompositeService, productService, loggerService, outputService, textFileService) {
47
+ static {
48
+ TelemetryContribution_1 = this;
49
+ }
50
+ static {
51
+ this.ALLOWLIST_JSON = [
52
+ "package.json",
53
+ "package-lock.json",
54
+ "tsconfig.json",
55
+ "jsconfig.json",
56
+ "bower.json",
57
+ ".eslintrc.json",
58
+ "tslint.json",
59
+ "composer.json"
60
+ ];
61
+ }
62
+ static {
63
+ this.ALLOWLIST_WORKSPACE_JSON = ["settings.json", "extensions.json", "tasks.json", "launch.json"];
64
+ }
65
+ constructor(
66
+ telemetryService,
67
+ contextService,
68
+ lifecycleService,
69
+ editorService,
70
+ keybindingsService,
71
+ themeService,
72
+ environmentService,
73
+ userDataProfileService,
74
+ paneCompositeService,
75
+ productService,
76
+ loggerService,
77
+ outputService,
78
+ textFileService
79
+ ) {
51
80
  super();
52
81
  this.telemetryService = telemetryService;
53
82
  this.contextService = contextService;
54
83
  this.userDataProfileService = userDataProfileService;
55
84
  this.loggerService = loggerService;
56
85
  this.outputService = outputService;
57
- const { filesToOpenOrCreate, filesToDiff, filesToMerge } = environmentService;
86
+ const {
87
+ filesToOpenOrCreate,
88
+ filesToDiff,
89
+ filesToMerge
90
+ } = environmentService;
58
91
  const activeViewlet = paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar);
59
- telemetryService.publicLog2('workspaceLoad', {
60
- windowSize: { innerHeight: mainWindow.innerHeight, innerWidth: mainWindow.innerWidth, outerHeight: mainWindow.outerHeight, outerWidth: mainWindow.outerWidth },
92
+ telemetryService.publicLog2("workspaceLoad", {
93
+ windowSize: {
94
+ innerHeight: mainWindow.innerHeight,
95
+ innerWidth: mainWindow.innerWidth,
96
+ outerHeight: mainWindow.outerHeight,
97
+ outerWidth: mainWindow.outerWidth
98
+ },
61
99
  emptyWorkbench: contextService.getWorkbenchState() === WorkbenchState.EMPTY,
62
- 'workbench.filesToOpenOrCreate': filesToOpenOrCreate && filesToOpenOrCreate.length || 0,
63
- 'workbench.filesToDiff': filesToDiff && filesToDiff.length || 0,
64
- 'workbench.filesToMerge': filesToMerge && filesToMerge.length || 0,
100
+ "workbench.filesToOpenOrCreate": filesToOpenOrCreate && filesToOpenOrCreate.length || 0,
101
+ "workbench.filesToDiff": filesToDiff && filesToDiff.length || 0,
102
+ "workbench.filesToMerge": filesToMerge && filesToMerge.length || 0,
65
103
  customKeybindingsCount: keybindingsService.customKeybindingsCount(),
66
104
  theme: themeService.getColorTheme().id,
67
105
  language,
@@ -81,54 +119,54 @@ let TelemetryContribution = class TelemetryContribution extends Disposable {
81
119
  onTextFileModelResolved(e) {
82
120
  const settingsType = this.getTypeIfSettings(e.model.resource);
83
121
  if (!settingsType) {
84
- this.telemetryService.publicLog2('fileGet', this.getTelemetryData(e.model.resource, e.reason));
122
+ this.telemetryService.publicLog2("fileGet", this.getTelemetryData(e.model.resource, e.reason));
85
123
  }
86
124
  }
87
125
  onTextFileModelSaved(e) {
88
126
  const settingsType = this.getTypeIfSettings(e.model.resource);
89
127
  if (!settingsType) {
90
- this.telemetryService.publicLog2('filePUT', this.getTelemetryData(e.model.resource, e.reason));
128
+ this.telemetryService.publicLog2("filePUT", this.getTelemetryData(e.model.resource, e.reason));
91
129
  }
92
130
  }
93
131
  getTypeIfSettings(resource) {
94
- if (extname(resource) !== '.json') {
95
- return '';
132
+ if (extname(resource) !== ".json") {
133
+ return "";
96
134
  }
97
135
  if (isEqual(resource, this.userDataProfileService.currentProfile.settingsResource)) {
98
- return 'global-settings';
136
+ return "global-settings";
99
137
  }
100
138
  if (isEqual(resource, this.userDataProfileService.currentProfile.keybindingsResource)) {
101
- return 'keybindings';
139
+ return "keybindings";
102
140
  }
103
141
  if (isEqualOrParent(resource, this.userDataProfileService.currentProfile.snippetsHome)) {
104
- return 'snippets';
142
+ return "snippets";
105
143
  }
106
144
  const folders = this.contextService.getWorkspace().folders;
107
145
  for (const folder of folders) {
108
- if (isEqualOrParent(resource, folder.toResource('.vscode'))) {
146
+ if (isEqualOrParent(resource, folder.toResource(".vscode"))) {
109
147
  const filename = basename(resource);
110
148
  if (TelemetryContribution_1.ALLOWLIST_WORKSPACE_JSON.indexOf(filename) > -1) {
111
149
  return `.vscode/${filename}`;
112
150
  }
113
151
  }
114
152
  }
115
- return '';
153
+ return "";
116
154
  }
117
155
  getTelemetryData(resource, reason) {
118
156
  let ext = extname(resource);
119
- const queryStringLocation = ext.indexOf('?');
157
+ const queryStringLocation = ext.indexOf("?");
120
158
  ext = queryStringLocation !== -1 ? ext.substr(0, queryStringLocation) : ext;
121
159
  const fileName = basename(resource);
122
160
  const path = resource.scheme === Schemas.file ? resource.fsPath : resource.path;
123
161
  const telemetryData = {
124
- mimeType: ( new TelemetryTrustedValue(getMimeTypes(resource).join(', '))),
162
+ mimeType: ( new TelemetryTrustedValue(getMimeTypes(resource).join(", "))),
125
163
  ext,
126
164
  path: hash(path),
127
165
  reason,
128
166
  allowlistedjson: undefined
129
167
  };
130
- if (ext === '.json' && TelemetryContribution_1.ALLOWLIST_JSON.indexOf(fileName) > -1) {
131
- telemetryData['allowlistedjson'] = fileName;
168
+ if (ext === ".json" && TelemetryContribution_1.ALLOWLIST_JSON.indexOf(fileName) > -1) {
169
+ telemetryData["allowlistedjson"] = fileName;
132
170
  }
133
171
  return telemetryData;
134
172
  }
@@ -137,8 +175,8 @@ let TelemetryContribution = class TelemetryContribution extends Disposable {
137
175
  this._register(registerAction2(class extends Action2 {
138
176
  constructor() {
139
177
  super({
140
- id: 'workbench.action.showTelemetry',
141
- title: ( localize2(11489, "Show Telemetry")),
178
+ id: "workbench.action.showTelemetry",
179
+ title: ( localize2(11815, "Show Telemetry")),
142
180
  category: Categories.Developer,
143
181
  f1: true
144
182
  });
@@ -167,7 +205,7 @@ let TelemetryContribution = class TelemetryContribution extends Disposable {
167
205
  }
168
206
  }
169
207
  if (showTelemetry) {
170
- const showExtensionTelemetry = (loggers) => {
208
+ const showExtensionTelemetry = loggers => {
171
209
  for (const logger of loggers) {
172
210
  if (logger.group?.id === TelemetryLogGroup.id) {
173
211
  that.loggerService.setLogLevel(logger.resource, LogLevel.Trace);
@@ -176,25 +214,13 @@ let TelemetryContribution = class TelemetryContribution extends Disposable {
176
214
  }
177
215
  };
178
216
  showExtensionTelemetry(this.loggerService.getRegisteredLoggers());
179
- this._register(this.loggerService.onDidChangeLoggers(e => showExtensionTelemetry(e.added)));
217
+ this._register(
218
+ this.loggerService.onDidChangeLoggers(e => showExtensionTelemetry(e.added))
219
+ );
180
220
  }
181
221
  }
182
222
  };
183
- TelemetryContribution = TelemetryContribution_1 = ( __decorate([
184
- ( __param(0, ITelemetryService)),
185
- ( __param(1, IWorkspaceContextService)),
186
- ( __param(2, ILifecycleService)),
187
- ( __param(3, IEditorService)),
188
- ( __param(4, IKeybindingService)),
189
- ( __param(5, IWorkbenchThemeService)),
190
- ( __param(6, IWorkbenchEnvironmentService)),
191
- ( __param(7, IUserDataProfileService)),
192
- ( __param(8, IPaneCompositePartService)),
193
- ( __param(9, IProductService)),
194
- ( __param(10, ILoggerService)),
195
- ( __param(11, IOutputService)),
196
- ( __param(12, ITextFileService))
197
- ], TelemetryContribution));
223
+ TelemetryContribution = TelemetryContribution_1 = ( __decorate([( __param(0, ITelemetryService)), ( __param(1, IWorkspaceContextService)), ( __param(2, ILifecycleService)), ( __param(3, IEditorService)), ( __param(4, IKeybindingService)), ( __param(5, IWorkbenchThemeService)), ( __param(6, IWorkbenchEnvironmentService)), ( __param(7, IUserDataProfileService)), ( __param(8, IPaneCompositePartService)), ( __param(9, IProductService)), ( __param(10, ILoggerService)), ( __param(11, IOutputService)), ( __param(12, ITextFileService))], TelemetryContribution));
198
224
  let ConfigurationTelemetryContribution = class ConfigurationTelemetryContribution extends Disposable {
199
225
  constructor(configurationService, userDataProfilesService, telemetryService) {
200
226
  super();
@@ -202,7 +228,10 @@ let ConfigurationTelemetryContribution = class ConfigurationTelemetryContributio
202
228
  this.userDataProfilesService = userDataProfilesService;
203
229
  this.telemetryService = telemetryService;
204
230
  this.configurationRegistry = ( Registry.as(Extensions.Configuration));
205
- const { user, workspace } = ( configurationService.keys());
231
+ const {
232
+ user,
233
+ workspace
234
+ } = ( configurationService.keys());
206
235
  for (const setting of user) {
207
236
  this.reportTelemetry(setting, ConfigurationTarget.USER_LOCAL);
208
237
  }
@@ -224,7 +253,9 @@ let ConfigurationTelemetryContribution = class ConfigurationTelemetryContributio
224
253
  return undefined;
225
254
  }
226
255
  if (Array.isArray(value)) {
227
- if (value.every(v => isNumber(v) || isBoolean(v) || (isString(v) && schema?.enum?.includes(v)))) {
256
+ if (value.every(
257
+ v => isNumber(v) || isBoolean(v) || (isString(v) && schema?.enum?.includes(v))
258
+ )) {
228
259
  return JSON.stringify(value);
229
260
  }
230
261
  }
@@ -233,54 +264,80 @@ let ConfigurationTelemetryContribution = class ConfigurationTelemetryContributio
233
264
  reportTelemetry(key, target) {
234
265
  const source = ConfigurationTargetToString(target);
235
266
  switch (key) {
236
- case LayoutSettings.ACTIVITY_BAR_LOCATION:
237
- this.telemetryService.publicLog2('workbench.activityBar.location', { settingValue: this.getValueToReport(key, target), source });
238
- return;
239
- case AutoUpdateConfigurationKey:
240
- this.telemetryService.publicLog2('extensions.autoUpdate', { settingValue: this.getValueToReport(key, target), source });
241
- return;
242
- case 'editor.stickyScroll.enabled':
243
- this.telemetryService.publicLog2('editor.stickyScroll.enabled', { settingValue: this.getValueToReport(key, target), source });
244
- return;
245
- case 'typescript.experimental.expandableHover':
246
- this.telemetryService.publicLog2('typescript.experimental.expandableHover', { settingValue: this.getValueToReport(key, target), source });
247
- return;
248
- case 'window.titleBarStyle':
249
- this.telemetryService.publicLog2('window.titleBarStyle', { settingValue: this.getValueToReport(key, target), source });
250
- return;
251
- case 'workbench.secondarySideBar.defaultVisibility':
252
- this.telemetryService.publicLog2('workbench.secondarySideBar.defaultVisibility', { settingValue: this.getValueToReport(key, target), source });
253
- return;
254
- case VerifyExtensionSignatureConfigKey:
255
- this.telemetryService.publicLog2('extensions.verifySignature', { settingValue: this.getValueToReport(key, target), source });
256
- return;
257
- case 'window.newWindowProfile':
258
- {
259
- const valueToReport = this.getValueToReport(key, target);
260
- const settingValue = valueToReport === null ? 'null'
261
- : valueToReport === this.userDataProfilesService.defaultProfile.name
262
- ? 'default'
263
- : 'custom';
264
- this.telemetryService.publicLog2('window.newWindowProfile', { settingValue, source });
265
- return;
266
- }
267
- case AutoRestartConfigurationKey:
268
- this.telemetryService.publicLog2('extensions.autoRestart', { settingValue: this.getValueToReport(key, target), source });
269
- return;
270
- case TerminalContribSettingId.OutputLocation:
271
- this.telemetryService.publicLog2('terminal.integrated.chatAgentTools.outputLocation', { settingValue: this.getValueToReport(key, target), source });
272
- return;
273
- case TerminalContribSettingId.SuggestEnabled:
274
- this.telemetryService.publicLog2('terminal.integrated.suggest.enabled', { settingValue: this.getValueToReport(key, target), source });
267
+ case LayoutSettings.ACTIVITY_BAR_LOCATION:
268
+ this.telemetryService.publicLog2("workbench.activityBar.location", {
269
+ settingValue: this.getValueToReport(key, target),
270
+ source
271
+ });
272
+ return;
273
+ case AutoUpdateConfigurationKey:
274
+ this.telemetryService.publicLog2("extensions.autoUpdate", {
275
+ settingValue: this.getValueToReport(key, target),
276
+ source
277
+ });
278
+ return;
279
+ case "editor.stickyScroll.enabled":
280
+ this.telemetryService.publicLog2("editor.stickyScroll.enabled", {
281
+ settingValue: this.getValueToReport(key, target),
282
+ source
283
+ });
284
+ return;
285
+ case "typescript.experimental.expandableHover":
286
+ this.telemetryService.publicLog2("typescript.experimental.expandableHover", {
287
+ settingValue: this.getValueToReport(key, target),
288
+ source
289
+ });
290
+ return;
291
+ case "window.titleBarStyle":
292
+ this.telemetryService.publicLog2("window.titleBarStyle", {
293
+ settingValue: this.getValueToReport(key, target),
294
+ source
295
+ });
296
+ return;
297
+ case "workbench.secondarySideBar.defaultVisibility":
298
+ this.telemetryService.publicLog2("workbench.secondarySideBar.defaultVisibility", {
299
+ settingValue: this.getValueToReport(key, target),
300
+ source
301
+ });
302
+ return;
303
+ case VerifyExtensionSignatureConfigKey:
304
+ this.telemetryService.publicLog2("extensions.verifySignature", {
305
+ settingValue: this.getValueToReport(key, target),
306
+ source
307
+ });
308
+ return;
309
+ case "window.newWindowProfile":
310
+ {
311
+ const valueToReport = this.getValueToReport(key, target);
312
+ const settingValue = valueToReport === null ? "null" : valueToReport === this.userDataProfilesService.defaultProfile.name ? "default" : "custom";
313
+ this.telemetryService.publicLog2("window.newWindowProfile", {
314
+ settingValue,
315
+ source
316
+ });
275
317
  return;
318
+ }
319
+ case AutoRestartConfigurationKey:
320
+ this.telemetryService.publicLog2("extensions.autoRestart", {
321
+ settingValue: this.getValueToReport(key, target),
322
+ source
323
+ });
324
+ return;
325
+ case TerminalContribSettingId.OutputLocation:
326
+ this.telemetryService.publicLog2("terminal.integrated.chatAgentTools.outputLocation", {
327
+ settingValue: this.getValueToReport(key, target),
328
+ source
329
+ });
330
+ return;
331
+ case TerminalContribSettingId.SuggestEnabled:
332
+ this.telemetryService.publicLog2("terminal.integrated.suggest.enabled", {
333
+ settingValue: this.getValueToReport(key, target),
334
+ source
335
+ });
336
+ return;
276
337
  }
277
338
  }
278
339
  };
279
- ConfigurationTelemetryContribution = ( __decorate([
280
- ( __param(0, IConfigurationService)),
281
- ( __param(1, IUserDataProfilesService)),
282
- ( __param(2, ITelemetryService))
283
- ], ConfigurationTelemetryContribution));
340
+ ConfigurationTelemetryContribution = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IUserDataProfilesService)), ( __param(2, ITelemetryService))], ConfigurationTelemetryContribution));
284
341
  const workbenchContributionRegistry = ( Registry.as(Extensions$1.Workbench));
285
342
  workbenchContributionRegistry.registerWorkbenchContribution(TelemetryContribution, LifecyclePhase.Restored);
286
343
  workbenchContributionRegistry.registerWorkbenchContribution(ConfigurationTelemetryContribution, LifecyclePhase.Eventually);
@@ -18,24 +18,68 @@ import { resolveWorkbenchCommonProperties } from './workbenchCommonProperties.js
18
18
  import { experimentsEnabled } from '../common/workbenchTelemetryUtils.js';
19
19
 
20
20
  let TelemetryService = class TelemetryService extends Disposable {
21
- get sessionId() { return this.impl.sessionId; }
22
- get machineId() { return this.impl.machineId; }
23
- get sqmId() { return this.impl.sqmId; }
24
- get devDeviceId() { return this.impl.devDeviceId; }
25
- get firstSessionDate() { return this.impl.firstSessionDate; }
26
- get msftInternal() { return this.impl.msftInternal; }
27
- constructor(environmentService, logService, loggerService, configurationService, storageService, productService, remoteAgentService) {
21
+ get sessionId() {
22
+ return this.impl.sessionId;
23
+ }
24
+ get machineId() {
25
+ return this.impl.machineId;
26
+ }
27
+ get sqmId() {
28
+ return this.impl.sqmId;
29
+ }
30
+ get devDeviceId() {
31
+ return this.impl.devDeviceId;
32
+ }
33
+ get firstSessionDate() {
34
+ return this.impl.firstSessionDate;
35
+ }
36
+ get msftInternal() {
37
+ return this.impl.msftInternal;
38
+ }
39
+ constructor(
40
+ environmentService,
41
+ logService,
42
+ loggerService,
43
+ configurationService,
44
+ storageService,
45
+ productService,
46
+ remoteAgentService
47
+ ) {
28
48
  super();
29
49
  this.impl = NullTelemetryService;
30
50
  this.sendErrorTelemetry = true;
31
- this.impl = this.initializeService(environmentService, logService, loggerService, configurationService, storageService, productService, remoteAgentService);
51
+ this.impl = this.initializeService(
52
+ environmentService,
53
+ logService,
54
+ loggerService,
55
+ configurationService,
56
+ storageService,
57
+ productService,
58
+ remoteAgentService
59
+ );
32
60
  this._register(configurationService.onDidChangeConfiguration(e => {
33
61
  if (e.affectsConfiguration(TELEMETRY_SETTING_ID)) {
34
- this.impl = this.initializeService(environmentService, logService, loggerService, configurationService, storageService, productService, remoteAgentService);
62
+ this.impl = this.initializeService(
63
+ environmentService,
64
+ logService,
65
+ loggerService,
66
+ configurationService,
67
+ storageService,
68
+ productService,
69
+ remoteAgentService
70
+ );
35
71
  }
36
72
  }));
37
73
  }
38
- initializeService(environmentService, logService, loggerService, configurationService, storageService, productService, remoteAgentService) {
74
+ initializeService(
75
+ environmentService,
76
+ logService,
77
+ loggerService,
78
+ configurationService,
79
+ storageService,
80
+ productService,
81
+ remoteAgentService
82
+ ) {
39
83
  const telemetrySupported = supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey;
40
84
  if (telemetrySupported && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE && this.impl === NullTelemetryService) {
41
85
  const appenders = [];
@@ -47,17 +91,22 @@ let TelemetryService = class TelemetryService extends Disposable {
47
91
  flush: remoteAgentService.flushTelemetry.bind(remoteAgentService)
48
92
  };
49
93
  appenders.push(remoteTelemetryProvider);
50
- }
51
- else {
52
- appenders.push(( new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey)));
94
+ } else {
95
+ appenders.push(( new OneDataSystemWebAppender(isInternal, "monacoworkbench", null, productService.aiConfig?.ariaKey)));
53
96
  }
54
97
  }
55
- appenders.push(( new TelemetryLogAppender('', false, loggerService, environmentService, productService)));
98
+ appenders.push(( new TelemetryLogAppender("", false, loggerService, environmentService, productService)));
56
99
  const config = {
57
100
  appenders,
58
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService, isInternal, environmentService.remoteAuthority, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
101
+ commonProperties: resolveWorkbenchCommonProperties(
102
+ storageService,
103
+ productService,
104
+ isInternal,
105
+ environmentService.remoteAuthority,
106
+ environmentService.options && environmentService.options.resolveCommonTelemetryProperties
107
+ ),
59
108
  sendErrorTelemetry: this.sendErrorTelemetry,
60
- waitForExperimentProperties: experimentsEnabled(configurationService, productService, environmentService),
109
+ waitForExperimentProperties: experimentsEnabled(configurationService, productService, environmentService)
61
110
  };
62
111
  return this._register(( new TelemetryService$1(config, configurationService, productService)));
63
112
  }
@@ -82,14 +131,6 @@ let TelemetryService = class TelemetryService extends Disposable {
82
131
  this.publicLogError(eventName, data);
83
132
  }
84
133
  };
85
- TelemetryService = ( __decorate([
86
- ( __param(0, IBrowserWorkbenchEnvironmentService)),
87
- ( __param(1, ILogService)),
88
- ( __param(2, ILoggerService)),
89
- ( __param(3, IConfigurationService)),
90
- ( __param(4, IStorageService)),
91
- ( __param(5, IProductService)),
92
- ( __param(6, IRemoteAgentService))
93
- ], TelemetryService));
134
+ TelemetryService = ( __decorate([( __param(0, IBrowserWorkbenchEnvironmentService)), ( __param(1, ILogService)), ( __param(2, ILoggerService)), ( __param(3, IConfigurationService)), ( __param(4, IStorageService)), ( __param(5, IProductService)), ( __param(6, IRemoteAgentService))], TelemetryService));
94
135
 
95
136
  export { TelemetryService };
@@ -8,10 +8,21 @@ import { firstSessionDateStorageKey, lastSessionDateStorageKey, machineIdKey } f
8
8
  import { Gesture } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/touch';
9
9
 
10
10
  function cleanUserAgent(userAgent) {
11
- return userAgent.replace(/(\d+\.\d+)(\.\d+)+/g, '$1');
11
+ return userAgent.replace(/(\d+\.\d+)(\.\d+)+/g, "$1");
12
12
  }
13
- function resolveWorkbenchCommonProperties(storageService, productService, isInternalTelemetry, remoteAuthority, resolveAdditionalProperties) {
14
- const { commit, version, embedderIdentifier: productIdentifier, removeTelemetryMachineId: removeMachineId } = productService ?? {};
13
+ function resolveWorkbenchCommonProperties(
14
+ storageService,
15
+ productService,
16
+ isInternalTelemetry,
17
+ remoteAuthority,
18
+ resolveAdditionalProperties
19
+ ) {
20
+ const {
21
+ commit,
22
+ version,
23
+ embedderIdentifier: productIdentifier,
24
+ removeTelemetryMachineId: removeMachineId
25
+ } = productService ?? {};
15
26
  const result = Object.create(null);
16
27
  const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.APPLICATION);
17
28
  const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.APPLICATION);
@@ -22,37 +33,36 @@ function resolveWorkbenchCommonProperties(storageService, productService, isInte
22
33
  machineId = generateUuid();
23
34
  storageService.store(machineIdKey, machineId, StorageScope.APPLICATION, StorageTarget.MACHINE);
24
35
  }
36
+ } else {
37
+ machineId = `Redacted-${productIdentifier ?? "web"}`;
25
38
  }
26
- else {
27
- machineId = `Redacted-${productIdentifier ?? 'web'}`;
28
- }
29
- result['common.firstSessionDate'] = firstSessionDate;
30
- result['common.lastSessionDate'] = lastSessionDate || '';
31
- result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
32
- result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority, productService);
33
- result['common.machineId'] = machineId;
34
- result['sessionID'] = generateUuid() + Date.now();
35
- result['commitHash'] = commit;
36
- result['version'] = version;
37
- result['common.platform'] = PlatformToString(platform);
38
- result['common.product'] = productIdentifier ?? 'web';
39
- result['common.userAgent'] = userAgent ? cleanUserAgent(userAgent) : undefined;
40
- result['common.isTouchDevice'] = String(Gesture.isTouchDevice());
39
+ result["common.firstSessionDate"] = firstSessionDate;
40
+ result["common.lastSessionDate"] = lastSessionDate || "";
41
+ result["common.isNewSession"] = !lastSessionDate ? "1" : "0";
42
+ result["common.remoteAuthority"] = cleanRemoteAuthority(remoteAuthority, productService);
43
+ result["common.machineId"] = machineId;
44
+ result["sessionID"] = generateUuid() + Date.now();
45
+ result["commitHash"] = commit;
46
+ result["version"] = version;
47
+ result["common.platform"] = PlatformToString(platform);
48
+ result["common.product"] = productIdentifier ?? "web";
49
+ result["common.userAgent"] = userAgent ? cleanUserAgent(userAgent) : undefined;
50
+ result["common.isTouchDevice"] = String(Gesture.isTouchDevice());
41
51
  if (isInternalTelemetry) {
42
- result['common.msftInternal'] = isInternalTelemetry;
52
+ result["common.msftInternal"] = isInternalTelemetry;
43
53
  }
44
54
  let seq = 0;
45
55
  const startTime = Date.now();
46
56
  Object.defineProperties(result, {
47
- 'timestamp': {
57
+ "timestamp": {
48
58
  get: () => ( new Date()),
49
59
  enumerable: true
50
60
  },
51
- 'common.timesincesessionstart': {
61
+ "common.timesincesessionstart": {
52
62
  get: () => Date.now() - startTime,
53
63
  enumerable: true
54
64
  },
55
- 'common.sequence': {
65
+ "common.sequence": {
56
66
  get: () => seq++,
57
67
  enumerable: true
58
68
  }