@codingame/monaco-vscode-telemetry-service-override 22.1.9 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -5,13 +5,16 @@ import '@codingame/monaco-vscode-api/services';
5
5
  import { TelemetryService } from './vscode/src/vs/workbench/services/telemetry/browser/telemetryService.js';
6
6
  import { IDataChannelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service';
7
7
  import { DataChannelService } from './vscode/src/vs/workbench/services/dataChannel/browser/dataChannelService.js';
8
+ import { IRandomService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/randomService.service';
9
+ import { RandomService } from './vscode/src/vs/workbench/contrib/editTelemetry/browser/randomService.js';
8
10
  import './vscode/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.js';
9
11
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
10
12
 
11
13
  function getServiceOverride() {
12
14
  return {
13
15
  [ITelemetryService.toString()]: new SyncDescriptor(TelemetryService, [], true),
14
- [IDataChannelService.toString()]: new SyncDescriptor(DataChannelService, [], true)
16
+ [IDataChannelService.toString()]: new SyncDescriptor(DataChannelService, [], true),
17
+ [IRandomService.toString()]: new SyncDescriptor(RandomService, [], true)
15
18
  };
16
19
  }
17
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-telemetry-service-override",
3
- "version": "22.1.9",
3
+ "version": "23.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - telemetry service-override",
6
6
  "keywords": [],
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "22.1.9",
19
- "@codingame/monaco-vscode-api": "22.1.9",
18
+ "@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "23.0.0",
19
+ "@codingame/monaco-vscode-api": "23.0.0",
20
20
  "@microsoft/1ds-core-js": "3.2.18",
21
21
  "@microsoft/1ds-post-js": "3.2.18"
22
22
  },
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { binarySearch } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
3
- import { errorHandler, ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
3
+ import { errorHandler, ErrorNoTelemetry, PendingMigrationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
4
4
  import { DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
5
  import { safeStringify } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
6
6
  import { FileOperationError } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
@@ -44,7 +44,7 @@ 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 || (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
50
  const callstack = Array.isArray(err.stack) ? err.stack.join('\n') : err.stack;
@@ -20,7 +20,7 @@ let TelemetryLogAppender = class TelemetryLogAppender extends Disposable {
20
20
  const justLoggingAndNotSending = isLoggingOnly(productService, environmentService);
21
21
  const logSuffix = justLoggingAndNotSending ? ' (Not Sent)' : '';
22
22
  this.logger = this._register(loggerService.createLogger(id, {
23
- name: ( localize(2032, "Telemetry{0}", logSuffix)),
23
+ name: ( localize(2042, "Telemetry{0}", logSuffix)),
24
24
  group: TelemetryLogGroup,
25
25
  hidden: true
26
26
  }));
@@ -3,6 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
3
3
  import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
4
  import { mixin } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
5
5
  import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
6
+ import { PolicyCategory } from '@codingame/monaco-vscode-api/vscode/vs/base/common/policy';
6
7
  import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
7
8
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
8
9
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
@@ -103,30 +104,30 @@ TelemetryService = ( __decorate([
103
104
  ], TelemetryService));
104
105
  function getTelemetryLevelSettingDescription() {
105
106
  const telemetryText = ( localize(
106
- 2033,
107
+ 2043,
107
108
  "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.",
108
109
  product.nameLong
109
110
  ));
110
111
  const externalLinksStatement = !product.privacyStatementUrl ?
111
112
  ( localize(
112
- 2034,
113
+ 2044,
113
114
  "Read more about the [data we collect]({0}).",
114
115
  'https://aka.ms/vscode-telemetry'
115
116
  )) :
116
117
  ( localize(
117
- 2035,
118
+ 2045,
118
119
  "Read more about the [data we collect]({0}) and our [privacy statement]({1}).",
119
120
  'https://aka.ms/vscode-telemetry',
120
121
  product.privacyStatementUrl
121
122
  ));
122
123
  const restartString = !isWeb ? ( localize(
123
- 2036,
124
+ 2046,
124
125
  'A full restart of the application is necessary for crash reporting changes to take effect.'
125
126
  )) : '';
126
- const crashReportsHeader = ( localize(2037, "Crash Reports"));
127
- const errorsHeader = ( localize(2038, "Error Telemetry"));
128
- const usageHeader = ( localize(2039, "Usage Data"));
129
- const telemetryTableDescription = ( localize(2040, "The following table outlines the data sent with each setting:"));
127
+ const crashReportsHeader = ( localize(2047, "Crash Reports"));
128
+ const errorsHeader = ( localize(2048, "Error Telemetry"));
129
+ const usageHeader = ( localize(2049, "Usage Data"));
130
+ const telemetryTableDescription = ( localize(2050, "The following table outlines the data sent with each setting:"));
130
131
  const telemetryTable = `
131
132
  | | ${crashReportsHeader} | ${errorsHeader} | ${usageHeader} |
132
133
  |:------|:-------------:|:---------------:|:----------:|
@@ -136,7 +137,7 @@ function getTelemetryLevelSettingDescription() {
136
137
  | off | - | - | - |
137
138
  `;
138
139
  const deprecatedSettingNote = ( localize(
139
- 2041,
140
+ 2051,
140
141
  "****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.*"
141
142
  ));
142
143
  const telemetryDescription = `
@@ -158,16 +159,16 @@ configurationRegistry.registerConfiguration({
158
159
  'id': TELEMETRY_SECTION_ID,
159
160
  'order': 1,
160
161
  'type': 'object',
161
- 'title': ( localize(2042, "Telemetry")),
162
+ 'title': ( localize(2052, "Telemetry")),
162
163
  'properties': {
163
164
  [TELEMETRY_SETTING_ID]: {
164
165
  'type': 'string',
165
166
  'enum': [TelemetryConfiguration.ON, TelemetryConfiguration.ERROR, TelemetryConfiguration.CRASH, TelemetryConfiguration.OFF],
166
167
  'enumDescriptions': [
167
- ( localize(2043, "Sends usage data, errors, and crash reports.")),
168
- ( localize(2044, "Sends general error telemetry and crash reports.")),
169
- ( localize(2045, "Sends OS level crash reports.")),
170
- ( localize(2046, "Disables all product telemetry."))
168
+ ( localize(2053, "Sends usage data, errors, and crash reports.")),
169
+ ( localize(2054, "Sends general error telemetry and crash reports.")),
170
+ ( localize(2055, "Sends OS level crash reports.")),
171
+ ( localize(2056, "Disables all product telemetry."))
171
172
  ],
172
173
  'markdownDescription': getTelemetryLevelSettingDescription(),
173
174
  'default': TelemetryConfiguration.ON,
@@ -176,32 +177,61 @@ configurationRegistry.registerConfiguration({
176
177
  'tags': ['usesOnlineServices', 'telemetry'],
177
178
  'policy': {
178
179
  name: 'TelemetryLevel',
180
+ category: PolicyCategory.Telemetry,
179
181
  minimumVersion: '1.99',
180
- description: ( localize(2047, "Controls the level of telemetry.")),
182
+ localization: {
183
+ description: {
184
+ key: 'telemetry.telemetryLevel.policyDescription',
185
+ value: ( localize(2057, "Controls the level of telemetry.")),
186
+ },
187
+ enumDescriptions: [
188
+ {
189
+ key: 'telemetry.telemetryLevel.default',
190
+ value: ( localize(2053, "Sends usage data, errors, and crash reports.")),
191
+ },
192
+ {
193
+ key: 'telemetry.telemetryLevel.error',
194
+ value: ( localize(2054, "Sends general error telemetry and crash reports.")),
195
+ },
196
+ {
197
+ key: 'telemetry.telemetryLevel.crash',
198
+ value: ( localize(2055, "Sends OS level crash reports.")),
199
+ },
200
+ {
201
+ key: 'telemetry.telemetryLevel.off',
202
+ value: ( localize(2056, "Disables all product telemetry.")),
203
+ }
204
+ ]
205
+ }
181
206
  }
182
207
  },
183
208
  'telemetry.feedback.enabled': {
184
209
  type: 'boolean',
185
210
  default: true,
186
211
  description: ( localize(
187
- 2048,
212
+ 2058,
188
213
  "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
189
214
  )),
190
215
  policy: {
191
216
  name: 'EnableFeedback',
217
+ category: PolicyCategory.Telemetry,
192
218
  minimumVersion: '1.99',
219
+ localization: { description: { key: 'telemetry.feedback.enabled', value: ( localize(
220
+ 2058,
221
+ "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
222
+ )) } },
193
223
  }
194
224
  },
195
225
  [TELEMETRY_OLD_SETTING_ID]: {
196
226
  'type': 'boolean',
197
227
  'markdownDescription': !product.privacyStatementUrl ?
198
228
  ( localize(
199
- 2049,
229
+ 2059,
200
230
  "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.",
201
231
  product.nameLong
202
232
  )) :
203
233
  ( localize(
204
- 2050,
234
+ 2060,
205
235
  "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.",
206
236
  product.nameLong,
207
237
  product.privacyStatementUrl
@@ -209,7 +239,7 @@ configurationRegistry.registerConfiguration({
209
239
  'default': true,
210
240
  'restricted': true,
211
241
  'markdownDeprecationMessage': ( localize(
212
- 2051,
242
+ 2061,
213
243
  "If this setting is false, no telemetry will be sent regardless of the new setting's value. Deprecated in favor of the {0} setting.",
214
244
  `\`#${TELEMETRY_SETTING_ID}#\``
215
245
  )),
@@ -0,0 +1,7 @@
1
+ import { IRandomService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/randomService.service";
2
+ export declare class RandomService implements IRandomService {
3
+ readonly _serviceBrand: undefined;
4
+ generateUuid(): string;
5
+ /** Namespace should be 3 letter. */
6
+ generatePrefixedUuid(namespace: string): string;
7
+ }
@@ -0,0 +1,13 @@
1
+
2
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
3
+
4
+ class RandomService {
5
+ generateUuid() {
6
+ return generateUuid();
7
+ }
8
+ generatePrefixedUuid(namespace) {
9
+ return `${namespace}-${this.generateUuid()}`;
10
+ }
11
+ }
12
+
13
+ export { RandomService };
@@ -137,7 +137,7 @@ let TelemetryContribution = class TelemetryContribution extends Disposable {
137
137
  constructor() {
138
138
  super({
139
139
  id: 'workbench.action.showTelemetry',
140
- title: ( localize2(11050, "Show Telemetry")),
140
+ title: ( localize2(11303, "Show Telemetry")),
141
141
  category: Categories.Developer,
142
142
  f1: true
143
143
  });
@@ -1,5 +1,5 @@
1
1
  import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
2
2
  import { ICommonProperties } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry";
3
3
  export declare function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, isInternalTelemetry: boolean, remoteAuthority?: string, productIdentifier?: string, removeMachineId?: boolean, resolveAdditionalProperties?: () => {
4
- [key: string]: any;
4
+ [key: string]: unknown;
5
5
  }): ICommonProperties;