@sap-ux/telemetry 0.6.92 → 0.6.94
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/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/tooling-telemetry/data-processor.d.ts +18 -1
- package/dist/tooling-telemetry/data-processor.js +78 -0
- package/dist/tooling-telemetry/index.d.ts +1 -1
- package/dist/tooling-telemetry/index.js +2 -1
- package/dist/tooling-telemetry/types.d.ts +8 -1
- package/dist/tooling-telemetry/types.js +1 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { EventHeader } from './base/types/event-header';
|
|
|
5
5
|
export { EventName } from './base/types/event-name';
|
|
6
6
|
export { SampleRate } from './base/types/sample-rate';
|
|
7
7
|
export { TelemetryMeasurements, TelemetryProperties } from './base/types/event';
|
|
8
|
-
export { initTelemetrySettings, setEnableTelemetry, getTelemetrySetting, ToolsSuiteTelemetryClient, ToolsSuiteTelemetryInitSettings, TelemetryHelperProperties, TelemetryEvent, ToolsId } from './tooling-telemetry';
|
|
8
|
+
export { initTelemetrySettings, setEnableTelemetry, getTelemetrySetting, ToolsSuiteTelemetryClient, ToolsSuiteTelemetryInitSettings, TelemetryHelperProperties, TelemetryEvent, ToolsId, getIdeType } from './tooling-telemetry';
|
|
9
9
|
export { InterceptorTypes } from './base/interceptor/config';
|
|
10
10
|
export { PerformanceMeasurementAPI } from './base/performance/api';
|
|
11
11
|
export { ParamRecordConfig, ParamRecordConfigField } from './base/utils/param-processing';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logTelemetryAsync = exports.logTelemetry = exports.ParamRecordConfigField = exports.ParamRecordConfig = exports.PerformanceMeasurementAPI = exports.InterceptorTypes = exports.ToolsId = exports.ToolsSuiteTelemetryClient = exports.getTelemetrySetting = exports.setEnableTelemetry = exports.initTelemetrySettings = exports.SampleRate = exports.EventName = exports.EventHeader = exports.ApplicationInsightClient = exports.Client = exports.ClientFactory = void 0;
|
|
3
|
+
exports.logTelemetryAsync = exports.logTelemetry = exports.ParamRecordConfigField = exports.ParamRecordConfig = exports.PerformanceMeasurementAPI = exports.InterceptorTypes = exports.getIdeType = exports.ToolsId = exports.ToolsSuiteTelemetryClient = exports.getTelemetrySetting = exports.setEnableTelemetry = exports.initTelemetrySettings = exports.SampleRate = exports.EventName = exports.EventHeader = exports.ApplicationInsightClient = exports.Client = exports.ClientFactory = void 0;
|
|
4
4
|
/* Types and classes */
|
|
5
5
|
var index_1 = require("./base/client/index");
|
|
6
6
|
Object.defineProperty(exports, "ClientFactory", { enumerable: true, get: function () { return index_1.ClientFactory; } });
|
|
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "setEnableTelemetry", { enumerable: true, get: fu
|
|
|
21
21
|
Object.defineProperty(exports, "getTelemetrySetting", { enumerable: true, get: function () { return tooling_telemetry_1.getTelemetrySetting; } });
|
|
22
22
|
Object.defineProperty(exports, "ToolsSuiteTelemetryClient", { enumerable: true, get: function () { return tooling_telemetry_1.ToolsSuiteTelemetryClient; } });
|
|
23
23
|
Object.defineProperty(exports, "ToolsId", { enumerable: true, get: function () { return tooling_telemetry_1.ToolsId; } });
|
|
24
|
+
Object.defineProperty(exports, "getIdeType", { enumerable: true, get: function () { return tooling_telemetry_1.getIdeType; } });
|
|
24
25
|
/* Decorator and measurements utils */
|
|
25
26
|
var config_1 = require("./base/interceptor/config");
|
|
26
27
|
Object.defineProperty(exports, "InterceptorTypes", { enumerable: true, get: function () { return config_1.InterceptorTypes; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommonFioriProjectProperties } from './types';
|
|
1
|
+
import type { CommonFioriProjectProperties, IdeType } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Collect commone properties that needs to be added to telemetry event.
|
|
4
4
|
*
|
|
@@ -12,4 +12,21 @@ export declare function processToolsSuiteTelemetry(telemetryHelperProperties: Re
|
|
|
12
12
|
* @returns Common properties
|
|
13
13
|
*/
|
|
14
14
|
export declare function getCommonProperties(): Promise<CommonFioriProjectProperties>;
|
|
15
|
+
/**
|
|
16
|
+
* Detect the IDE/editor hosting the extension.
|
|
17
|
+
* Identifies VSCode, VSCode Insiders, Cursor, Windsurf, Antigravity, Trae, Kiro,
|
|
18
|
+
* VSCodium, code-server, SAP Business Application Studio, and standalone Node.js processes (CLI, MCP servers).
|
|
19
|
+
*
|
|
20
|
+
* Note: AppStudio is checked first because it is a VS Code fork that sets VSCODE_PID.
|
|
21
|
+
* Without the early return, it would fall through to 'vscode'.
|
|
22
|
+
*
|
|
23
|
+
* Detection priority: VSCODE_APPNAME is checked as an opportunistic hint — it is set by some
|
|
24
|
+
* VS Code forks (e.g. Cursor, Windsurf) that expose their Electron productName via this variable,
|
|
25
|
+
* but it is not a standard VS Code environment variable and may be absent in plain VS Code or CLI
|
|
26
|
+
* contexts. Fork-specific env vars (e.g. CURSOR_TRACE_ID) and VSCODE_CWD path matching are used
|
|
27
|
+
* as complementary fallbacks.
|
|
28
|
+
*
|
|
29
|
+
* @returns The detected IDE type
|
|
30
|
+
*/
|
|
31
|
+
export declare function getIdeType(): IdeType;
|
|
15
32
|
//# sourceMappingURL=data-processor.d.ts.map
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.processToolsSuiteTelemetry = processToolsSuiteTelemetry;
|
|
7
7
|
exports.getCommonProperties = getCommonProperties;
|
|
8
|
+
exports.getIdeType = getIdeType;
|
|
8
9
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
9
10
|
const nodejs_utils_1 = require("@sap-ux/nodejs-utils");
|
|
10
11
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
@@ -43,6 +44,7 @@ async function getCommonProperties() {
|
|
|
43
44
|
commonProperties[types_1.CommonProperties.InternlVsExternalBackwardCompatible] =
|
|
44
45
|
commonProperties[types_1.CommonProperties.InternlVsExternal];
|
|
45
46
|
commonProperties[types_1.CommonProperties.NodeVersion] = await getOSNodeVersion();
|
|
47
|
+
commonProperties[types_1.CommonProperties.IdeType] = getIdeType();
|
|
46
48
|
return commonProperties;
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
@@ -305,4 +307,80 @@ async function getOSNodeVersion() {
|
|
|
305
307
|
return 'unknown';
|
|
306
308
|
}
|
|
307
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Detect the IDE/editor hosting the extension.
|
|
312
|
+
* Identifies VSCode, VSCode Insiders, Cursor, Windsurf, Antigravity, Trae, Kiro,
|
|
313
|
+
* VSCodium, code-server, SAP Business Application Studio, and standalone Node.js processes (CLI, MCP servers).
|
|
314
|
+
*
|
|
315
|
+
* Note: AppStudio is checked first because it is a VS Code fork that sets VSCODE_PID.
|
|
316
|
+
* Without the early return, it would fall through to 'vscode'.
|
|
317
|
+
*
|
|
318
|
+
* Detection priority: VSCODE_APPNAME is checked as an opportunistic hint — it is set by some
|
|
319
|
+
* VS Code forks (e.g. Cursor, Windsurf) that expose their Electron productName via this variable,
|
|
320
|
+
* but it is not a standard VS Code environment variable and may be absent in plain VS Code or CLI
|
|
321
|
+
* contexts. Fork-specific env vars (e.g. CURSOR_TRACE_ID) and VSCODE_CWD path matching are used
|
|
322
|
+
* as complementary fallbacks.
|
|
323
|
+
*
|
|
324
|
+
* @returns The detected IDE type
|
|
325
|
+
*/
|
|
326
|
+
function getIdeType() {
|
|
327
|
+
// AppStudio is a VS Code fork that sets VSCODE_PID — check first to avoid misdetection as 'vscode'
|
|
328
|
+
if ((0, btp_utils_1.isAppStudio)()) {
|
|
329
|
+
return 'appstudio';
|
|
330
|
+
}
|
|
331
|
+
const vscodeCwd = process.env.VSCODE_CWD?.toLowerCase() ?? '';
|
|
332
|
+
const vscodePid = process.env.VSCODE_PID;
|
|
333
|
+
const termProgram = process.env.TERM_PROGRAM ?? '';
|
|
334
|
+
const appName = process.env.VSCODE_APPNAME?.toLowerCase() ?? '';
|
|
335
|
+
// No VS Code environment detected — none of VSCODE_PID, VSCODE_CWD, or a vscode-related
|
|
336
|
+
// TERM_PROGRAM are set. This is likely a standalone Node.js process (CLI, MCP server, etc.)
|
|
337
|
+
if (!vscodePid && !vscodeCwd && termProgram !== 'vscode' && termProgram !== 'vscode-insiders') {
|
|
338
|
+
return 'unknown';
|
|
339
|
+
}
|
|
340
|
+
// Cursor detection — dedicated env var or VSCODE_APPNAME / CWD fallback
|
|
341
|
+
if (process.env.CURSOR_TRACE_ID || appName.includes('cursor') || vscodeCwd.includes('cursor')) {
|
|
342
|
+
return 'cursor';
|
|
343
|
+
}
|
|
344
|
+
// Windsurf detection (Codeium's IDE)
|
|
345
|
+
if (appName.includes('windsurf') || vscodeCwd.includes('windsurf') || vscodeCwd.includes('codeium')) {
|
|
346
|
+
return 'windsurf';
|
|
347
|
+
}
|
|
348
|
+
// Antigravity detection (Google's IDE)
|
|
349
|
+
if (appName.includes('antigravity') || vscodeCwd.includes('antigravity')) {
|
|
350
|
+
return 'antigravity';
|
|
351
|
+
}
|
|
352
|
+
// Trae detection (ByteDance's IDE)
|
|
353
|
+
if (appName.includes('trae') || vscodeCwd.includes('trae')) {
|
|
354
|
+
return 'trae';
|
|
355
|
+
}
|
|
356
|
+
// Kiro detection (AWS's IDE)
|
|
357
|
+
if (appName.includes('kiro') || vscodeCwd.includes('kiro')) {
|
|
358
|
+
return 'kiro';
|
|
359
|
+
}
|
|
360
|
+
// VSCodium detection (open-source VS Code without MS telemetry)
|
|
361
|
+
if (appName.includes('vscodium') ||
|
|
362
|
+
appName.includes('codium') ||
|
|
363
|
+
vscodeCwd.includes('vscodium') ||
|
|
364
|
+
vscodeCwd.includes('codium')) {
|
|
365
|
+
return 'vscodium';
|
|
366
|
+
}
|
|
367
|
+
// code-server detection (browser-based VS Code)
|
|
368
|
+
if (appName.includes('code-server') || vscodeCwd.includes('code-server') || process.env.CODE_SERVER_SESSION) {
|
|
369
|
+
return 'code-server';
|
|
370
|
+
}
|
|
371
|
+
// VSCode Insiders detection — match specific product names to avoid false positives
|
|
372
|
+
// from paths that merely contain the substring "insiders"
|
|
373
|
+
if (appName.includes('insiders') ||
|
|
374
|
+
vscodeCwd.includes('code - insiders') ||
|
|
375
|
+
vscodeCwd.includes('code insiders') ||
|
|
376
|
+
vscodeCwd.includes('vscode-insiders') ||
|
|
377
|
+
termProgram === 'vscode-insiders') {
|
|
378
|
+
return 'vscode-insiders';
|
|
379
|
+
}
|
|
380
|
+
// Standard VSCode detection
|
|
381
|
+
if (vscodePid || termProgram === 'vscode') {
|
|
382
|
+
return 'vscode';
|
|
383
|
+
}
|
|
384
|
+
return 'unknown';
|
|
385
|
+
}
|
|
308
386
|
//# sourceMappingURL=data-processor.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './telemetry-client';
|
|
2
|
-
export { processToolsSuiteTelemetry } from './data-processor';
|
|
2
|
+
export { processToolsSuiteTelemetry, getIdeType } from './data-processor';
|
|
3
3
|
export * from './telemetry-settings';
|
|
4
4
|
export * from './types';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,10 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.processToolsSuiteTelemetry = void 0;
|
|
17
|
+
exports.getIdeType = exports.processToolsSuiteTelemetry = void 0;
|
|
18
18
|
__exportStar(require("./telemetry-client"), exports);
|
|
19
19
|
var data_processor_1 = require("./data-processor");
|
|
20
20
|
Object.defineProperty(exports, "processToolsSuiteTelemetry", { enumerable: true, get: function () { return data_processor_1.processToolsSuiteTelemetry; } });
|
|
21
|
+
Object.defineProperty(exports, "getIdeType", { enumerable: true, get: function () { return data_processor_1.getIdeType; } });
|
|
21
22
|
__exportStar(require("./telemetry-settings"), exports);
|
|
22
23
|
__exportStar(require("./types"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -35,6 +35,11 @@ export declare enum DeployTarget {
|
|
|
35
35
|
UNKNOWN_DEPLOY_CONFIG = "UNKNOWN_DEPLOY_CONFIG",
|
|
36
36
|
NO_DEPLOY_CONFIG = "NO_DEPLOY_CONFIG"
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* IDE/editor types that can host the telemetry client.
|
|
40
|
+
* Used to identify VSCode, its forks (Cursor, Windsurf, etc..), and other environments.
|
|
41
|
+
*/
|
|
42
|
+
export type IdeType = 'vscode' | 'vscode-insiders' | 'cursor' | 'windsurf' | 'antigravity' | 'trae' | 'kiro' | 'vscodium' | 'code-server' | 'appstudio' | 'unknown';
|
|
38
43
|
export declare enum CommonProperties {
|
|
39
44
|
DevSpace = "cmn.devspace",
|
|
40
45
|
AppStudio = "cmn.appstudio",
|
|
@@ -49,7 +54,8 @@ export declare enum CommonProperties {
|
|
|
49
54
|
AppProgrammingLanguage = "cmn.appLanguage",
|
|
50
55
|
TemplateId = "cmn.templateId",
|
|
51
56
|
TemplateVersion = "cmn.templateVersion",
|
|
52
|
-
ApplicationType = "cmn.applicationType"
|
|
57
|
+
ApplicationType = "cmn.applicationType",
|
|
58
|
+
IdeType = "cmn.ideType"
|
|
53
59
|
}
|
|
54
60
|
export type InternalFeature = 'internal' | 'external';
|
|
55
61
|
export interface CommonTelemetryProperties extends TelemetryProperties {
|
|
@@ -71,6 +77,7 @@ export interface CommonFioriProjectProperties extends TelemetryProperties {
|
|
|
71
77
|
[CommonProperties.TemplateId]: string;
|
|
72
78
|
[CommonProperties.TemplateVersion]: string;
|
|
73
79
|
[CommonProperties.ApplicationType]: AppType;
|
|
80
|
+
[CommonProperties.IdeType]: IdeType;
|
|
74
81
|
}
|
|
75
82
|
export type TelemetryEvent = {
|
|
76
83
|
eventName: string;
|
|
@@ -36,5 +36,6 @@ var CommonProperties;
|
|
|
36
36
|
CommonProperties["TemplateId"] = "cmn.templateId";
|
|
37
37
|
CommonProperties["TemplateVersion"] = "cmn.templateVersion";
|
|
38
38
|
CommonProperties["ApplicationType"] = "cmn.applicationType";
|
|
39
|
+
CommonProperties["IdeType"] = "cmn.ideType";
|
|
39
40
|
})(CommonProperties || (exports.CommonProperties = CommonProperties = {}));
|
|
40
41
|
//# sourceMappingURL=types.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/telemetry",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.94",
|
|
4
4
|
"description": "Library for sending usage telemetry data",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"axios": "1.13.6",
|
|
19
19
|
"performance-now": "2.1.0",
|
|
20
20
|
"yaml": "2.8.3",
|
|
21
|
-
"@sap-ux/store": "1.5.
|
|
22
|
-
"@sap-ux/project-access": "1.35.17",
|
|
21
|
+
"@sap-ux/store": "1.5.12",
|
|
23
22
|
"@sap-ux/btp-utils": "1.1.12",
|
|
23
|
+
"@sap-ux/project-access": "1.35.17",
|
|
24
24
|
"@sap-ux/ui5-config": "0.30.1",
|
|
25
|
-
"@sap-ux/logger": "0.8.
|
|
25
|
+
"@sap-ux/logger": "0.8.4",
|
|
26
26
|
"@sap-ux/nodejs-utils": "0.2.19"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"jest-extended": "
|
|
29
|
+
"jest-extended": "7.0.0",
|
|
30
30
|
"memfs": "3.4.13",
|
|
31
31
|
"unionfs": "4.6.0",
|
|
32
32
|
"dotenv": "17.3.1"
|