@react-native-windows/telemetry 0.73.2 → 0.74.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/lib-commonjs/e2etest/telemetry.test.d.ts +28 -28
- package/lib-commonjs/e2etest/telemetry.test.js +496 -496
- package/lib-commonjs/index.d.ts +11 -11
- package/lib-commonjs/index.js +26 -26
- package/lib-commonjs/telemetry.d.ts +84 -84
- package/lib-commonjs/telemetry.js +370 -370
- package/lib-commonjs/telemetry.js.map +1 -1
- package/lib-commonjs/test/basePropUtils.test.d.ts +7 -7
- package/lib-commonjs/test/basePropUtils.test.js +137 -137
- package/lib-commonjs/test/errorUtils.test.d.ts +7 -7
- package/lib-commonjs/test/errorUtils.test.js +159 -159
- package/lib-commonjs/test/projectUtils.test.d.ts +7 -7
- package/lib-commonjs/test/projectUtils.test.js +87 -87
- package/lib-commonjs/test/sanitizeUtils.test.d.ts +7 -7
- package/lib-commonjs/test/sanitizeUtils.test.js +97 -97
- package/lib-commonjs/test/versionUtils.test.d.ts +7 -7
- package/lib-commonjs/test/versionUtils.test.js +114 -114
- package/lib-commonjs/utils/basePropUtils.d.ts +81 -81
- package/lib-commonjs/utils/basePropUtils.js +173 -173
- package/lib-commonjs/utils/errorUtils.d.ts +87 -87
- package/lib-commonjs/utils/errorUtils.js +178 -178
- package/lib-commonjs/utils/optionUtils.d.ts +45 -45
- package/lib-commonjs/utils/optionUtils.js +95 -95
- package/lib-commonjs/utils/projectUtils.d.ts +50 -50
- package/lib-commonjs/utils/projectUtils.js +186 -186
- package/lib-commonjs/utils/sanitizeUtils.d.ts +12 -12
- package/lib-commonjs/utils/sanitizeUtils.js +81 -81
- package/lib-commonjs/utils/versionUtils.d.ts +38 -38
- package/lib-commonjs/utils/versionUtils.js +155 -155
- package/package.json +13 -15
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.getSessionId = exports.isCliTest = exports.isMsftInternal = exports.ciType = exports.isCI = exports.captureCI = exports.sampleRate = exports.deviceDiskFreeSpace = exports.deviceTotalMemory = exports.deviceNumCPUs = exports.deviceLocale = exports.devicePlatform = exports.nodeArchitecture = exports.deviceArchitecture = exports.deviceId = void 0;
|
|
12
|
-
const child_process_1 = require("child_process");
|
|
13
|
-
const os_1 = require("os");
|
|
14
|
-
const ci_info_1 = __importDefault(require("ci-info"));
|
|
15
|
-
const crypto_1 = require("crypto");
|
|
16
|
-
const os_locale_1 = __importDefault(require("os-locale"));
|
|
17
|
-
const DeviceIdRegPath = 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\SQMClient';
|
|
18
|
-
const DeviceIdRegKey = 'MachineId';
|
|
19
|
-
/**
|
|
20
|
-
* Gets a telemetry-safe stable device ID.
|
|
21
|
-
* @returns A telemetry-safe stable device ID.
|
|
22
|
-
*/
|
|
23
|
-
async function deviceId() {
|
|
24
|
-
try {
|
|
25
|
-
let regCommand = `${process.env.windir}\\System32\\reg.exe query ${DeviceIdRegPath} /v ${DeviceIdRegKey}`;
|
|
26
|
-
if (deviceArchitecture() === 'x64') {
|
|
27
|
-
// Ensure we query the correct registry
|
|
28
|
-
regCommand += ' /reg:64';
|
|
29
|
-
}
|
|
30
|
-
const output = (0, child_process_1.execSync)(regCommand).toString();
|
|
31
|
-
const result = output.match(/\{([0-9A-Fa-f-]{36})\}/);
|
|
32
|
-
if (result && result.length > 1) {
|
|
33
|
-
return `s:${result[1]}`;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch (_a) { }
|
|
37
|
-
return '';
|
|
38
|
-
}
|
|
39
|
-
exports.deviceId = deviceId;
|
|
40
|
-
/**
|
|
41
|
-
* Gets the device architecture, like x86/x64/arm64.
|
|
42
|
-
* @returns The device architecture.
|
|
43
|
-
*/
|
|
44
|
-
function deviceArchitecture() {
|
|
45
|
-
const nodeArch = nodeArchitecture();
|
|
46
|
-
// Check if we're running x86 node on x64 hardware
|
|
47
|
-
if (nodeArch === 'x86' && process.env.PROCESSOR_ARCHITEW6432 === 'AMD64') {
|
|
48
|
-
return 'x64';
|
|
49
|
-
}
|
|
50
|
-
return nodeArch;
|
|
51
|
-
}
|
|
52
|
-
exports.deviceArchitecture = deviceArchitecture;
|
|
53
|
-
/**
|
|
54
|
-
* Gets the node architecture, like x86/x64/arm64.
|
|
55
|
-
* @returns The node architecture.
|
|
56
|
-
*/
|
|
57
|
-
function nodeArchitecture() {
|
|
58
|
-
return process.arch === 'ia32' ? 'x86' : process.arch;
|
|
59
|
-
}
|
|
60
|
-
exports.nodeArchitecture = nodeArchitecture;
|
|
61
|
-
/**
|
|
62
|
-
* Gets the device platform, like darwin/linux/win32.
|
|
63
|
-
* @returns The device platform.
|
|
64
|
-
*/
|
|
65
|
-
function devicePlatform() {
|
|
66
|
-
return (0, os_1.platform)();
|
|
67
|
-
}
|
|
68
|
-
exports.devicePlatform = devicePlatform;
|
|
69
|
-
/**
|
|
70
|
-
* Gets the device locale.
|
|
71
|
-
* @returns The device locale.
|
|
72
|
-
*/
|
|
73
|
-
async function deviceLocale() {
|
|
74
|
-
return await (0, os_locale_1.default)();
|
|
75
|
-
}
|
|
76
|
-
exports.deviceLocale = deviceLocale;
|
|
77
|
-
/**
|
|
78
|
-
* Gets the device's number of CPUs.
|
|
79
|
-
* @returns The device's number of CPUs.
|
|
80
|
-
*/
|
|
81
|
-
function deviceNumCPUs() {
|
|
82
|
-
return (0, os_1.cpus)().length;
|
|
83
|
-
}
|
|
84
|
-
exports.deviceNumCPUs = deviceNumCPUs;
|
|
85
|
-
/**
|
|
86
|
-
* Gets the device's total memory in bytes.
|
|
87
|
-
* @returns The device's total memory in bytes.
|
|
88
|
-
*/
|
|
89
|
-
function deviceTotalMemory() {
|
|
90
|
-
return (0, os_1.totalmem)();
|
|
91
|
-
}
|
|
92
|
-
exports.deviceTotalMemory = deviceTotalMemory;
|
|
93
|
-
/**
|
|
94
|
-
* Gets the free space of the give drive in bytes.
|
|
95
|
-
* @param drivePath A path on the drive to check.
|
|
96
|
-
* @returns The free space of the give drive in bytes.
|
|
97
|
-
*/
|
|
98
|
-
function deviceDiskFreeSpace(drivePath) {
|
|
99
|
-
try {
|
|
100
|
-
const out = (0, child_process_1.execSync)(`dir /-C ${drivePath !== null && drivePath !== void 0 ? drivePath : process.cwd()}`)
|
|
101
|
-
.toString()
|
|
102
|
-
.split('\r\n');
|
|
103
|
-
const line = out[out.length - 2];
|
|
104
|
-
const result = line.match(/(\d+) [^\d]+(\d+) /);
|
|
105
|
-
if (result && result.length > 2) {
|
|
106
|
-
return Number(result[2]);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch (_a) { }
|
|
110
|
-
return -1;
|
|
111
|
-
}
|
|
112
|
-
exports.deviceDiskFreeSpace = deviceDiskFreeSpace;
|
|
113
|
-
/**
|
|
114
|
-
* Gets the telemetry sample rate.
|
|
115
|
-
* @returns The telemetry sample rate.
|
|
116
|
-
*/
|
|
117
|
-
function sampleRate() {
|
|
118
|
-
return 100;
|
|
119
|
-
}
|
|
120
|
-
exports.sampleRate = sampleRate;
|
|
121
|
-
/**
|
|
122
|
-
* Gets whether or not telemetry events are captured when running in CI.
|
|
123
|
-
* @returns Whether or not telemetry events are captured when running in CI.
|
|
124
|
-
*/
|
|
125
|
-
function captureCI() {
|
|
126
|
-
// Only capture events in CI if running tests
|
|
127
|
-
return isCliTest();
|
|
128
|
-
}
|
|
129
|
-
exports.captureCI = captureCI;
|
|
130
|
-
/**
|
|
131
|
-
* Gets the whether the process is currently running in CI.
|
|
132
|
-
* @returns Whether the process is currently running in CI.
|
|
133
|
-
*/
|
|
134
|
-
function isCI() {
|
|
135
|
-
return ci_info_1.default.isCI;
|
|
136
|
-
}
|
|
137
|
-
exports.isCI = isCI;
|
|
138
|
-
/**
|
|
139
|
-
* Gets the type of CI the process is running under.
|
|
140
|
-
* @returns The type of CI the process is running under.
|
|
141
|
-
*/
|
|
142
|
-
function ciType() {
|
|
143
|
-
var _a;
|
|
144
|
-
return ci_info_1.default.isCI ? (_a = ci_info_1.default.name) !== null && _a !== void 0 ? _a : 'Unknown' : 'None';
|
|
145
|
-
}
|
|
146
|
-
exports.ciType = ciType;
|
|
147
|
-
/**
|
|
148
|
-
* Gets whether the process is running on a Microsoft owned machine.
|
|
149
|
-
* @returns Whether the process is running on a Microsoft owned machine.
|
|
150
|
-
*/
|
|
151
|
-
function isMsftInternal() {
|
|
152
|
-
return (process.env.UserDNSDomain !== undefined &&
|
|
153
|
-
process.env.UserDNSDomain.toLowerCase().endsWith('corp.microsoft.com'));
|
|
154
|
-
}
|
|
155
|
-
exports.isMsftInternal = isMsftInternal;
|
|
156
|
-
/**
|
|
157
|
-
* Gets whether the process is running as part of our CLI tests.
|
|
158
|
-
* @returns Whether the process is running as part of our CLI tests.
|
|
159
|
-
*/
|
|
160
|
-
function isCliTest() {
|
|
161
|
-
return (process.env.RNW_CLI_TEST !== undefined &&
|
|
162
|
-
process.env.RNW_CLI_TEST.toLowerCase().trim() === 'true');
|
|
163
|
-
}
|
|
164
|
-
exports.isCliTest = isCliTest;
|
|
165
|
-
let sessionId;
|
|
166
|
-
/**
|
|
167
|
-
* Gets a stable session ID for correlating telemetry events.
|
|
168
|
-
* @returns A stable session ID for correlating telemetry events.
|
|
169
|
-
*/
|
|
170
|
-
function getSessionId() {
|
|
171
|
-
return (sessionId !== null && sessionId !== void 0 ? sessionId : (sessionId = (0, crypto_1.randomBytes)(16).toString('hex').padStart(32, '0')));
|
|
172
|
-
}
|
|
173
|
-
exports.getSessionId = getSessionId;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.getSessionId = exports.isCliTest = exports.isMsftInternal = exports.ciType = exports.isCI = exports.captureCI = exports.sampleRate = exports.deviceDiskFreeSpace = exports.deviceTotalMemory = exports.deviceNumCPUs = exports.deviceLocale = exports.devicePlatform = exports.nodeArchitecture = exports.deviceArchitecture = exports.deviceId = void 0;
|
|
12
|
+
const child_process_1 = require("child_process");
|
|
13
|
+
const os_1 = require("os");
|
|
14
|
+
const ci_info_1 = __importDefault(require("ci-info"));
|
|
15
|
+
const crypto_1 = require("crypto");
|
|
16
|
+
const os_locale_1 = __importDefault(require("os-locale"));
|
|
17
|
+
const DeviceIdRegPath = 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\SQMClient';
|
|
18
|
+
const DeviceIdRegKey = 'MachineId';
|
|
19
|
+
/**
|
|
20
|
+
* Gets a telemetry-safe stable device ID.
|
|
21
|
+
* @returns A telemetry-safe stable device ID.
|
|
22
|
+
*/
|
|
23
|
+
async function deviceId() {
|
|
24
|
+
try {
|
|
25
|
+
let regCommand = `${process.env.windir}\\System32\\reg.exe query ${DeviceIdRegPath} /v ${DeviceIdRegKey}`;
|
|
26
|
+
if (deviceArchitecture() === 'x64') {
|
|
27
|
+
// Ensure we query the correct registry
|
|
28
|
+
regCommand += ' /reg:64';
|
|
29
|
+
}
|
|
30
|
+
const output = (0, child_process_1.execSync)(regCommand).toString();
|
|
31
|
+
const result = output.match(/\{([0-9A-Fa-f-]{36})\}/);
|
|
32
|
+
if (result && result.length > 1) {
|
|
33
|
+
return `s:${result[1]}`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (_a) { }
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
exports.deviceId = deviceId;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the device architecture, like x86/x64/arm64.
|
|
42
|
+
* @returns The device architecture.
|
|
43
|
+
*/
|
|
44
|
+
function deviceArchitecture() {
|
|
45
|
+
const nodeArch = nodeArchitecture();
|
|
46
|
+
// Check if we're running x86 node on x64 hardware
|
|
47
|
+
if (nodeArch === 'x86' && process.env.PROCESSOR_ARCHITEW6432 === 'AMD64') {
|
|
48
|
+
return 'x64';
|
|
49
|
+
}
|
|
50
|
+
return nodeArch;
|
|
51
|
+
}
|
|
52
|
+
exports.deviceArchitecture = deviceArchitecture;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the node architecture, like x86/x64/arm64.
|
|
55
|
+
* @returns The node architecture.
|
|
56
|
+
*/
|
|
57
|
+
function nodeArchitecture() {
|
|
58
|
+
return process.arch === 'ia32' ? 'x86' : process.arch;
|
|
59
|
+
}
|
|
60
|
+
exports.nodeArchitecture = nodeArchitecture;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the device platform, like darwin/linux/win32.
|
|
63
|
+
* @returns The device platform.
|
|
64
|
+
*/
|
|
65
|
+
function devicePlatform() {
|
|
66
|
+
return (0, os_1.platform)();
|
|
67
|
+
}
|
|
68
|
+
exports.devicePlatform = devicePlatform;
|
|
69
|
+
/**
|
|
70
|
+
* Gets the device locale.
|
|
71
|
+
* @returns The device locale.
|
|
72
|
+
*/
|
|
73
|
+
async function deviceLocale() {
|
|
74
|
+
return await (0, os_locale_1.default)();
|
|
75
|
+
}
|
|
76
|
+
exports.deviceLocale = deviceLocale;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the device's number of CPUs.
|
|
79
|
+
* @returns The device's number of CPUs.
|
|
80
|
+
*/
|
|
81
|
+
function deviceNumCPUs() {
|
|
82
|
+
return (0, os_1.cpus)().length;
|
|
83
|
+
}
|
|
84
|
+
exports.deviceNumCPUs = deviceNumCPUs;
|
|
85
|
+
/**
|
|
86
|
+
* Gets the device's total memory in bytes.
|
|
87
|
+
* @returns The device's total memory in bytes.
|
|
88
|
+
*/
|
|
89
|
+
function deviceTotalMemory() {
|
|
90
|
+
return (0, os_1.totalmem)();
|
|
91
|
+
}
|
|
92
|
+
exports.deviceTotalMemory = deviceTotalMemory;
|
|
93
|
+
/**
|
|
94
|
+
* Gets the free space of the give drive in bytes.
|
|
95
|
+
* @param drivePath A path on the drive to check.
|
|
96
|
+
* @returns The free space of the give drive in bytes.
|
|
97
|
+
*/
|
|
98
|
+
function deviceDiskFreeSpace(drivePath) {
|
|
99
|
+
try {
|
|
100
|
+
const out = (0, child_process_1.execSync)(`dir /-C ${drivePath !== null && drivePath !== void 0 ? drivePath : process.cwd()}`)
|
|
101
|
+
.toString()
|
|
102
|
+
.split('\r\n');
|
|
103
|
+
const line = out[out.length - 2];
|
|
104
|
+
const result = line.match(/(\d+) [^\d]+(\d+) /);
|
|
105
|
+
if (result && result.length > 2) {
|
|
106
|
+
return Number(result[2]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (_a) { }
|
|
110
|
+
return -1;
|
|
111
|
+
}
|
|
112
|
+
exports.deviceDiskFreeSpace = deviceDiskFreeSpace;
|
|
113
|
+
/**
|
|
114
|
+
* Gets the telemetry sample rate.
|
|
115
|
+
* @returns The telemetry sample rate.
|
|
116
|
+
*/
|
|
117
|
+
function sampleRate() {
|
|
118
|
+
return 100;
|
|
119
|
+
}
|
|
120
|
+
exports.sampleRate = sampleRate;
|
|
121
|
+
/**
|
|
122
|
+
* Gets whether or not telemetry events are captured when running in CI.
|
|
123
|
+
* @returns Whether or not telemetry events are captured when running in CI.
|
|
124
|
+
*/
|
|
125
|
+
function captureCI() {
|
|
126
|
+
// Only capture events in CI if running tests
|
|
127
|
+
return isCliTest();
|
|
128
|
+
}
|
|
129
|
+
exports.captureCI = captureCI;
|
|
130
|
+
/**
|
|
131
|
+
* Gets the whether the process is currently running in CI.
|
|
132
|
+
* @returns Whether the process is currently running in CI.
|
|
133
|
+
*/
|
|
134
|
+
function isCI() {
|
|
135
|
+
return ci_info_1.default.isCI;
|
|
136
|
+
}
|
|
137
|
+
exports.isCI = isCI;
|
|
138
|
+
/**
|
|
139
|
+
* Gets the type of CI the process is running under.
|
|
140
|
+
* @returns The type of CI the process is running under.
|
|
141
|
+
*/
|
|
142
|
+
function ciType() {
|
|
143
|
+
var _a;
|
|
144
|
+
return ci_info_1.default.isCI ? (_a = ci_info_1.default.name) !== null && _a !== void 0 ? _a : 'Unknown' : 'None';
|
|
145
|
+
}
|
|
146
|
+
exports.ciType = ciType;
|
|
147
|
+
/**
|
|
148
|
+
* Gets whether the process is running on a Microsoft owned machine.
|
|
149
|
+
* @returns Whether the process is running on a Microsoft owned machine.
|
|
150
|
+
*/
|
|
151
|
+
function isMsftInternal() {
|
|
152
|
+
return (process.env.UserDNSDomain !== undefined &&
|
|
153
|
+
process.env.UserDNSDomain.toLowerCase().endsWith('corp.microsoft.com'));
|
|
154
|
+
}
|
|
155
|
+
exports.isMsftInternal = isMsftInternal;
|
|
156
|
+
/**
|
|
157
|
+
* Gets whether the process is running as part of our CLI tests.
|
|
158
|
+
* @returns Whether the process is running as part of our CLI tests.
|
|
159
|
+
*/
|
|
160
|
+
function isCliTest() {
|
|
161
|
+
return (process.env.RNW_CLI_TEST !== undefined &&
|
|
162
|
+
process.env.RNW_CLI_TEST.toLowerCase().trim() === 'true');
|
|
163
|
+
}
|
|
164
|
+
exports.isCliTest = isCliTest;
|
|
165
|
+
let sessionId;
|
|
166
|
+
/**
|
|
167
|
+
* Gets a stable session ID for correlating telemetry events.
|
|
168
|
+
* @returns A stable session ID for correlating telemetry events.
|
|
169
|
+
*/
|
|
170
|
+
function getSessionId() {
|
|
171
|
+
return (sessionId !== null && sessionId !== void 0 ? sessionId : (sessionId = (0, crypto_1.randomBytes)(16).toString('hex').padStart(32, '0')));
|
|
172
|
+
}
|
|
173
|
+
exports.getSessionId = getSessionId;
|
|
174
174
|
//# sourceMappingURL=basePropUtils.js.map
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
import * as appInsights from 'applicationinsights';
|
|
7
|
-
export declare const CodedErrors: {
|
|
8
|
-
Success: number;
|
|
9
|
-
Unknown: number;
|
|
10
|
-
UnsupportedReactNativeVersion: number;
|
|
11
|
-
UserCancel: number;
|
|
12
|
-
NoReactNativeFound: number;
|
|
13
|
-
NoPackageJson: number;
|
|
14
|
-
NoLatestReactNativeWindows: number;
|
|
15
|
-
NoAutoMatchingReactNativeWindows: number;
|
|
16
|
-
IncompatibleOptions: number;
|
|
17
|
-
NoReactNativeDependencies: number;
|
|
18
|
-
NoMatchingPackageVersion: number;
|
|
19
|
-
NoSolution: number;
|
|
20
|
-
NoPropertyInProject: number;
|
|
21
|
-
CopyProjectTemplateNoSourcePath: number;
|
|
22
|
-
CopyProjectTemplateNoDestPath: number;
|
|
23
|
-
CopyProjectTemplateNoProjectName: number;
|
|
24
|
-
MinSDKVersionNotMet: number;
|
|
25
|
-
BadSDKVersionFormat: number;
|
|
26
|
-
NoSDK: number;
|
|
27
|
-
NoMSBuild: number;
|
|
28
|
-
NoVSWhere: number;
|
|
29
|
-
MSBuildError: number;
|
|
30
|
-
NoAppPackage: number;
|
|
31
|
-
NoAppxManifest: number;
|
|
32
|
-
NoDevice: number;
|
|
33
|
-
AppDidNotDeploy: number;
|
|
34
|
-
InvalidDevicesOutput: number;
|
|
35
|
-
RemoveOldAppVersionFailure: number;
|
|
36
|
-
EnableDevModeFailure: number;
|
|
37
|
-
InstallAppFailure: number;
|
|
38
|
-
InstallAppDependenciesFailure: number;
|
|
39
|
-
CheckNetIsolationFailure: number;
|
|
40
|
-
InstallAppToDeviceFailure: number;
|
|
41
|
-
UninstallAppOnDeviceFailure: number;
|
|
42
|
-
DeployRecipeFailure: number;
|
|
43
|
-
AppStartupFailure: number;
|
|
44
|
-
NoWindowsConfig: number;
|
|
45
|
-
IncompleteConfig: number;
|
|
46
|
-
InvalidConfig: number;
|
|
47
|
-
NeedAutolinking: number;
|
|
48
|
-
AddProjectToSolution: number;
|
|
49
|
-
Autolinking: number;
|
|
50
|
-
NeedCodegen: number;
|
|
51
|
-
InvalidCodegenConfig: number;
|
|
52
|
-
NoTemplatesFound: number;
|
|
53
|
-
NoDefaultTemplate: number;
|
|
54
|
-
InvalidTemplateName: number;
|
|
55
|
-
NoProjectName: number;
|
|
56
|
-
InvalidProjectName: number;
|
|
57
|
-
};
|
|
58
|
-
export type CodedErrorType = keyof typeof CodedErrors;
|
|
59
|
-
/**
|
|
60
|
-
* Represents an error whose message might contain user-originating content,
|
|
61
|
-
* therefore when transmitting telemetry, only the type should be sent.
|
|
62
|
-
* @param type a stable ID identifying the type of error.
|
|
63
|
-
* @param message the error text. This should only be used for display to the user.
|
|
64
|
-
* @param data any additional metadata that is safe to collect for telemetry purposes.
|
|
65
|
-
*/
|
|
66
|
-
export declare class CodedError extends Error {
|
|
67
|
-
readonly type: CodedErrorType;
|
|
68
|
-
readonly data?: Record<string, any> | undefined;
|
|
69
|
-
constructor(type: CodedErrorType, message: string, data?: Record<string, any> | undefined);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Tries to parse an error code out of an error message.
|
|
73
|
-
* @param msg An error message to process.
|
|
74
|
-
* @returns The parsed error code.
|
|
75
|
-
*/
|
|
76
|
-
export declare function tryGetErrorCode(msg: string): string | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Sanitize an error message by anonymizing any paths that appear between quotes (''), brackets ([]), or double quotes ("").
|
|
79
|
-
* @param msg The error message to sanitize.
|
|
80
|
-
* @return The message with any paths anonymized.
|
|
81
|
-
*/
|
|
82
|
-
export declare function sanitizeErrorMessage(msg: string): string;
|
|
83
|
-
/**
|
|
84
|
-
* Sanitizes an error stack frame.
|
|
85
|
-
* @param frame
|
|
86
|
-
*/
|
|
87
|
-
export declare function sanitizeErrorStackFrame(frame: appInsights.Contracts.StackFrame): void;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
* @format
|
|
5
|
+
*/
|
|
6
|
+
import * as appInsights from 'applicationinsights';
|
|
7
|
+
export declare const CodedErrors: {
|
|
8
|
+
Success: number;
|
|
9
|
+
Unknown: number;
|
|
10
|
+
UnsupportedReactNativeVersion: number;
|
|
11
|
+
UserCancel: number;
|
|
12
|
+
NoReactNativeFound: number;
|
|
13
|
+
NoPackageJson: number;
|
|
14
|
+
NoLatestReactNativeWindows: number;
|
|
15
|
+
NoAutoMatchingReactNativeWindows: number;
|
|
16
|
+
IncompatibleOptions: number;
|
|
17
|
+
NoReactNativeDependencies: number;
|
|
18
|
+
NoMatchingPackageVersion: number;
|
|
19
|
+
NoSolution: number;
|
|
20
|
+
NoPropertyInProject: number;
|
|
21
|
+
CopyProjectTemplateNoSourcePath: number;
|
|
22
|
+
CopyProjectTemplateNoDestPath: number;
|
|
23
|
+
CopyProjectTemplateNoProjectName: number;
|
|
24
|
+
MinSDKVersionNotMet: number;
|
|
25
|
+
BadSDKVersionFormat: number;
|
|
26
|
+
NoSDK: number;
|
|
27
|
+
NoMSBuild: number;
|
|
28
|
+
NoVSWhere: number;
|
|
29
|
+
MSBuildError: number;
|
|
30
|
+
NoAppPackage: number;
|
|
31
|
+
NoAppxManifest: number;
|
|
32
|
+
NoDevice: number;
|
|
33
|
+
AppDidNotDeploy: number;
|
|
34
|
+
InvalidDevicesOutput: number;
|
|
35
|
+
RemoveOldAppVersionFailure: number;
|
|
36
|
+
EnableDevModeFailure: number;
|
|
37
|
+
InstallAppFailure: number;
|
|
38
|
+
InstallAppDependenciesFailure: number;
|
|
39
|
+
CheckNetIsolationFailure: number;
|
|
40
|
+
InstallAppToDeviceFailure: number;
|
|
41
|
+
UninstallAppOnDeviceFailure: number;
|
|
42
|
+
DeployRecipeFailure: number;
|
|
43
|
+
AppStartupFailure: number;
|
|
44
|
+
NoWindowsConfig: number;
|
|
45
|
+
IncompleteConfig: number;
|
|
46
|
+
InvalidConfig: number;
|
|
47
|
+
NeedAutolinking: number;
|
|
48
|
+
AddProjectToSolution: number;
|
|
49
|
+
Autolinking: number;
|
|
50
|
+
NeedCodegen: number;
|
|
51
|
+
InvalidCodegenConfig: number;
|
|
52
|
+
NoTemplatesFound: number;
|
|
53
|
+
NoDefaultTemplate: number;
|
|
54
|
+
InvalidTemplateName: number;
|
|
55
|
+
NoProjectName: number;
|
|
56
|
+
InvalidProjectName: number;
|
|
57
|
+
};
|
|
58
|
+
export type CodedErrorType = keyof typeof CodedErrors;
|
|
59
|
+
/**
|
|
60
|
+
* Represents an error whose message might contain user-originating content,
|
|
61
|
+
* therefore when transmitting telemetry, only the type should be sent.
|
|
62
|
+
* @param type a stable ID identifying the type of error.
|
|
63
|
+
* @param message the error text. This should only be used for display to the user.
|
|
64
|
+
* @param data any additional metadata that is safe to collect for telemetry purposes.
|
|
65
|
+
*/
|
|
66
|
+
export declare class CodedError extends Error {
|
|
67
|
+
readonly type: CodedErrorType;
|
|
68
|
+
readonly data?: Record<string, any> | undefined;
|
|
69
|
+
constructor(type: CodedErrorType, message: string, data?: Record<string, any> | undefined);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Tries to parse an error code out of an error message.
|
|
73
|
+
* @param msg An error message to process.
|
|
74
|
+
* @returns The parsed error code.
|
|
75
|
+
*/
|
|
76
|
+
export declare function tryGetErrorCode(msg: string): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Sanitize an error message by anonymizing any paths that appear between quotes (''), brackets ([]), or double quotes ("").
|
|
79
|
+
* @param msg The error message to sanitize.
|
|
80
|
+
* @return The message with any paths anonymized.
|
|
81
|
+
*/
|
|
82
|
+
export declare function sanitizeErrorMessage(msg: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Sanitizes an error stack frame.
|
|
85
|
+
* @param frame
|
|
86
|
+
*/
|
|
87
|
+
export declare function sanitizeErrorStackFrame(frame: appInsights.Contracts.StackFrame): void;
|