@uipath/project-packager 1.197.0 → 1.198.0-preview.100
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/browser.js +280 -26
- package/dist/index.js +348 -54
- package/dist/node.js +1475 -922
- package/dist/src/i18n/locales/en.d.ts +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/models/packager-parameters.d.ts +4 -0
- package/dist/src/models/project-cleanup-options.d.ts +14 -0
- package/dist/src/node.d.ts +1 -0
- package/dist/src/services/project-loader.d.ts +4 -2
- package/dist/src/services/project-packager.d.ts +14 -0
- package/dist/src/services/project-tool-executor.d.ts +3 -1
- package/dist/src/telemetry-names.d.ts +2 -0
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -6,7 +6,7 @@ var de_default = {
|
|
|
6
6
|
projectLoader: {
|
|
7
7
|
errors: {
|
|
8
8
|
pathRequired: "Project directory path is required",
|
|
9
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
9
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
10
10
|
readFailed: "Failed to read project file: {path}",
|
|
11
11
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
12
12
|
}
|
|
@@ -89,7 +89,7 @@ var en = {
|
|
|
89
89
|
projectLoader: {
|
|
90
90
|
errors: {
|
|
91
91
|
pathRequired: "Project directory path is required",
|
|
92
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
92
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
93
93
|
readFailed: "Failed to read project file: {path}",
|
|
94
94
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
95
95
|
}
|
|
@@ -171,7 +171,7 @@ var es_default = {
|
|
|
171
171
|
projectLoader: {
|
|
172
172
|
errors: {
|
|
173
173
|
pathRequired: "Project directory path is required",
|
|
174
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
174
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
175
175
|
readFailed: "Failed to read project file: {path}",
|
|
176
176
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
177
177
|
}
|
|
@@ -253,7 +253,7 @@ var es_MX_default = {
|
|
|
253
253
|
projectLoader: {
|
|
254
254
|
errors: {
|
|
255
255
|
pathRequired: "Project directory path is required",
|
|
256
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
256
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
257
257
|
readFailed: "Failed to read project file: {path}",
|
|
258
258
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
259
259
|
}
|
|
@@ -335,7 +335,7 @@ var fr_default = {
|
|
|
335
335
|
projectLoader: {
|
|
336
336
|
errors: {
|
|
337
337
|
pathRequired: "Project directory path is required",
|
|
338
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
338
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
339
339
|
readFailed: "Failed to read project file: {path}",
|
|
340
340
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
341
341
|
}
|
|
@@ -417,7 +417,7 @@ var ja_default = {
|
|
|
417
417
|
projectLoader: {
|
|
418
418
|
errors: {
|
|
419
419
|
pathRequired: "Project directory path is required",
|
|
420
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
420
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
421
421
|
readFailed: "Failed to read project file: {path}",
|
|
422
422
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
423
423
|
}
|
|
@@ -499,7 +499,7 @@ var ko_default = {
|
|
|
499
499
|
projectLoader: {
|
|
500
500
|
errors: {
|
|
501
501
|
pathRequired: "Project directory path is required",
|
|
502
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
502
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
503
503
|
readFailed: "Failed to read project file: {path}",
|
|
504
504
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
505
505
|
}
|
|
@@ -581,7 +581,7 @@ var pt_default = {
|
|
|
581
581
|
projectLoader: {
|
|
582
582
|
errors: {
|
|
583
583
|
pathRequired: "Project directory path is required",
|
|
584
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
584
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
585
585
|
readFailed: "Failed to read project file: {path}",
|
|
586
586
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
587
587
|
}
|
|
@@ -663,7 +663,7 @@ var pt_BR_default = {
|
|
|
663
663
|
projectLoader: {
|
|
664
664
|
errors: {
|
|
665
665
|
pathRequired: "Project directory path is required",
|
|
666
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
666
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
667
667
|
readFailed: "Failed to read project file: {path}",
|
|
668
668
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
669
669
|
}
|
|
@@ -745,7 +745,7 @@ var ro_default = {
|
|
|
745
745
|
projectLoader: {
|
|
746
746
|
errors: {
|
|
747
747
|
pathRequired: "Project directory path is required",
|
|
748
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
748
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
749
749
|
readFailed: "Failed to read project file: {path}",
|
|
750
750
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
751
751
|
}
|
|
@@ -827,7 +827,7 @@ var ru_default = {
|
|
|
827
827
|
projectLoader: {
|
|
828
828
|
errors: {
|
|
829
829
|
pathRequired: "Project directory path is required",
|
|
830
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
830
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
831
831
|
readFailed: "Failed to read project file: {path}",
|
|
832
832
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
833
833
|
}
|
|
@@ -909,7 +909,7 @@ var tr_default = {
|
|
|
909
909
|
projectLoader: {
|
|
910
910
|
errors: {
|
|
911
911
|
pathRequired: "Project directory path is required",
|
|
912
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
912
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
913
913
|
readFailed: "Failed to read project file: {path}",
|
|
914
914
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
915
915
|
}
|
|
@@ -991,7 +991,7 @@ var zh_CN_default = {
|
|
|
991
991
|
projectLoader: {
|
|
992
992
|
errors: {
|
|
993
993
|
pathRequired: "Project directory path is required",
|
|
994
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
994
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
995
995
|
readFailed: "Failed to read project file: {path}",
|
|
996
996
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
997
997
|
}
|
|
@@ -1073,7 +1073,7 @@ var zh_TW_default = {
|
|
|
1073
1073
|
projectLoader: {
|
|
1074
1074
|
errors: {
|
|
1075
1075
|
pathRequired: "Project directory path is required",
|
|
1076
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
1076
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
1077
1077
|
readFailed: "Failed to read project file: {path}",
|
|
1078
1078
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
1079
1079
|
}
|
|
@@ -1155,7 +1155,7 @@ var zu_default = {
|
|
|
1155
1155
|
projectLoader: {
|
|
1156
1156
|
errors: {
|
|
1157
1157
|
pathRequired: "Project directory path is required",
|
|
1158
|
-
noProjectFile: "No {projectFile} or {manifestFile} found in directory: {path}",
|
|
1158
|
+
noProjectFile: "No {projectFile}, {projectJsonFile}, or {manifestFile} found in directory: {path}",
|
|
1159
1159
|
readFailed: "Failed to read project file: {path}",
|
|
1160
1160
|
invalidProject: "Invalid project file: {path}. Missing ProjectType field."
|
|
1161
1161
|
}
|
|
@@ -22494,6 +22494,7 @@ var loggerSingleton = singleton(SimpleLogger);
|
|
|
22494
22494
|
var logger = SimpleLogger.getInstance();
|
|
22495
22495
|
var formatSlot = singleton("OutputFormat");
|
|
22496
22496
|
var formatExplicitSlot = singleton("OutputFormatExplicit");
|
|
22497
|
+
var helpRequestedSlot = singleton("HelpRequested");
|
|
22497
22498
|
var filterSlot = singleton("OutputFilter");
|
|
22498
22499
|
var PollOutcome = {
|
|
22499
22500
|
Completed: "completed",
|
|
@@ -22714,10 +22715,33 @@ class ConsoleTelemetryProvider {
|
|
|
22714
22715
|
console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
|
|
22715
22716
|
}
|
|
22716
22717
|
}
|
|
22718
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
22719
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
22720
|
+
function getProcessEnv() {
|
|
22721
|
+
return globalThis.process?.env;
|
|
22722
|
+
}
|
|
22723
|
+
function parseInboundTraceparent(value) {
|
|
22724
|
+
if (!value) {
|
|
22725
|
+
return;
|
|
22726
|
+
}
|
|
22727
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
22728
|
+
if (!match) {
|
|
22729
|
+
return;
|
|
22730
|
+
}
|
|
22731
|
+
const [, traceId, parentSpanId] = match;
|
|
22732
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
22733
|
+
return;
|
|
22734
|
+
}
|
|
22735
|
+
return { traceId, parentSpanId };
|
|
22736
|
+
}
|
|
22737
|
+
function getInboundTraceContext() {
|
|
22738
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
22739
|
+
}
|
|
22717
22740
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
22718
22741
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
22719
22742
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
22720
|
-
|
|
22743
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
22744
|
+
function getProcessEnv2() {
|
|
22721
22745
|
return globalThis.process?.env;
|
|
22722
22746
|
}
|
|
22723
22747
|
function normalizeSessionId(value) {
|
|
@@ -22728,11 +22752,21 @@ function normalizeSessionId(value) {
|
|
|
22728
22752
|
return trimmed || undefined;
|
|
22729
22753
|
}
|
|
22730
22754
|
function getConfiguredTelemetrySessionId() {
|
|
22731
|
-
return normalizeSessionId(
|
|
22755
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
22732
22756
|
}
|
|
22733
22757
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
22734
22758
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
22735
22759
|
}
|
|
22760
|
+
function getTelemetryOperationId() {
|
|
22761
|
+
const existing = telemetryOperationIdSlot.get();
|
|
22762
|
+
if (existing) {
|
|
22763
|
+
return existing;
|
|
22764
|
+
}
|
|
22765
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
22766
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
22767
|
+
telemetryOperationIdSlot.set(generated);
|
|
22768
|
+
return generated;
|
|
22769
|
+
}
|
|
22736
22770
|
var KNOWN_AGENTS = [
|
|
22737
22771
|
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
22738
22772
|
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
@@ -22859,6 +22893,140 @@ function getExecutionContextTelemetryProperties() {
|
|
|
22859
22893
|
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
22860
22894
|
};
|
|
22861
22895
|
}
|
|
22896
|
+
var REDACTED = "[REDACTED]";
|
|
22897
|
+
var MAX_VALUE_LENGTH = 200;
|
|
22898
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
22899
|
+
"token",
|
|
22900
|
+
"tokens",
|
|
22901
|
+
"secret",
|
|
22902
|
+
"secrets",
|
|
22903
|
+
"password",
|
|
22904
|
+
"passwords",
|
|
22905
|
+
"pwd",
|
|
22906
|
+
"credential",
|
|
22907
|
+
"credentials",
|
|
22908
|
+
"auth",
|
|
22909
|
+
"authentication",
|
|
22910
|
+
"authorization",
|
|
22911
|
+
"authority",
|
|
22912
|
+
"cert",
|
|
22913
|
+
"certificate",
|
|
22914
|
+
"certificates"
|
|
22915
|
+
]);
|
|
22916
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
22917
|
+
"api",
|
|
22918
|
+
"access",
|
|
22919
|
+
"client",
|
|
22920
|
+
"private",
|
|
22921
|
+
"public",
|
|
22922
|
+
"signing",
|
|
22923
|
+
"encryption",
|
|
22924
|
+
"session",
|
|
22925
|
+
"master",
|
|
22926
|
+
"shared",
|
|
22927
|
+
"root",
|
|
22928
|
+
"ssh",
|
|
22929
|
+
"rsa",
|
|
22930
|
+
"aes",
|
|
22931
|
+
"hmac",
|
|
22932
|
+
"oauth"
|
|
22933
|
+
]);
|
|
22934
|
+
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
22935
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
22936
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
22937
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
22938
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
22939
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
22940
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
22941
|
+
function shortHash(input) {
|
|
22942
|
+
let hash = 2166136261;
|
|
22943
|
+
for (let i2 = 0;i2 < input.length; i2++) {
|
|
22944
|
+
hash ^= input.charCodeAt(i2);
|
|
22945
|
+
hash = Math.imul(hash, 16777619);
|
|
22946
|
+
}
|
|
22947
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
22948
|
+
}
|
|
22949
|
+
function redactUrl(raw) {
|
|
22950
|
+
try {
|
|
22951
|
+
const url = new URL(raw);
|
|
22952
|
+
return `${url.protocol}//${url.host}`;
|
|
22953
|
+
} catch {
|
|
22954
|
+
return `url#${shortHash(raw)}`;
|
|
22955
|
+
}
|
|
22956
|
+
}
|
|
22957
|
+
function redactValueDetectors(value) {
|
|
22958
|
+
let out = value;
|
|
22959
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
22960
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
22961
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
22962
|
+
const core = trailing ? match.slice(0, -trailing.length) : match;
|
|
22963
|
+
return `${redactUrl(core)}${trailing}`;
|
|
22964
|
+
});
|
|
22965
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
22966
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
22967
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
22968
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
22969
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
22970
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
22971
|
+
}
|
|
22972
|
+
return out;
|
|
22973
|
+
}
|
|
22974
|
+
function redactValue(value) {
|
|
22975
|
+
return redactValueDetectors(value);
|
|
22976
|
+
}
|
|
22977
|
+
function redactError(error) {
|
|
22978
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
22979
|
+
safe.name = error.name;
|
|
22980
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
22981
|
+
return safe;
|
|
22982
|
+
}
|
|
22983
|
+
function nameTokens(name) {
|
|
22984
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
22985
|
+
}
|
|
22986
|
+
function isSensitiveName(name) {
|
|
22987
|
+
const tokens = nameTokens(name);
|
|
22988
|
+
for (let i2 = 0;i2 < tokens.length; i2++) {
|
|
22989
|
+
const token = tokens[i2];
|
|
22990
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
22991
|
+
return true;
|
|
22992
|
+
}
|
|
22993
|
+
if (token === "key" || token === "keys") {
|
|
22994
|
+
const prev = tokens[i2 - 1];
|
|
22995
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
22996
|
+
return true;
|
|
22997
|
+
}
|
|
22998
|
+
}
|
|
22999
|
+
}
|
|
23000
|
+
return false;
|
|
23001
|
+
}
|
|
23002
|
+
function redactProperty(name, value) {
|
|
23003
|
+
if (value === undefined || value === null) {
|
|
23004
|
+
return;
|
|
23005
|
+
}
|
|
23006
|
+
if (isSensitiveName(name)) {
|
|
23007
|
+
return REDACTED;
|
|
23008
|
+
}
|
|
23009
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
23010
|
+
return value;
|
|
23011
|
+
}
|
|
23012
|
+
if (typeof value !== "string") {
|
|
23013
|
+
return "[OBJECT]";
|
|
23014
|
+
}
|
|
23015
|
+
return redactValueDetectors(value);
|
|
23016
|
+
}
|
|
23017
|
+
function redactProperties(properties) {
|
|
23018
|
+
const out = {};
|
|
23019
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
23020
|
+
const redacted = redactProperty(name, value);
|
|
23021
|
+
if (redacted !== undefined) {
|
|
23022
|
+
out[name] = redacted;
|
|
23023
|
+
}
|
|
23024
|
+
}
|
|
23025
|
+
return out;
|
|
23026
|
+
}
|
|
23027
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
23028
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
23029
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
22862
23030
|
|
|
22863
23031
|
class TelemetryService {
|
|
22864
23032
|
telemetryProvider;
|
|
@@ -22886,11 +23054,15 @@ class TelemetryService {
|
|
|
22886
23054
|
trackException(error, properties) {
|
|
22887
23055
|
const context = this.getCurrentContext();
|
|
22888
23056
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
22889
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
23057
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
22890
23058
|
}
|
|
22891
23059
|
async trackRequest(name, fn, properties) {
|
|
23060
|
+
const parentContext = this.getCurrentContext();
|
|
23061
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
23062
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
22892
23063
|
const context = {
|
|
22893
|
-
operationId
|
|
23064
|
+
operationId,
|
|
23065
|
+
...parentId !== undefined ? { parentId } : {},
|
|
22894
23066
|
id: this.generateId()
|
|
22895
23067
|
};
|
|
22896
23068
|
const startTime = performance.now();
|
|
@@ -22908,6 +23080,45 @@ class TelemetryService {
|
|
|
22908
23080
|
throw error;
|
|
22909
23081
|
}
|
|
22910
23082
|
}
|
|
23083
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
23084
|
+
const requestContext = context ?? {
|
|
23085
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
23086
|
+
id: this.generateId()
|
|
23087
|
+
};
|
|
23088
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
23089
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
23090
|
+
}
|
|
23091
|
+
createRequestContext() {
|
|
23092
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
23093
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
23094
|
+
return {
|
|
23095
|
+
operationId,
|
|
23096
|
+
...parentId !== undefined ? { parentId } : {},
|
|
23097
|
+
id: this.generateId()
|
|
23098
|
+
};
|
|
23099
|
+
}
|
|
23100
|
+
inboundParentIdFor(operationId) {
|
|
23101
|
+
const inbound = getInboundTraceContext();
|
|
23102
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
23103
|
+
}
|
|
23104
|
+
runWithContext(context, fn) {
|
|
23105
|
+
return this.contextStorage.run(context, fn);
|
|
23106
|
+
}
|
|
23107
|
+
createDependencyContext() {
|
|
23108
|
+
const parentContext = this.getCurrentContext();
|
|
23109
|
+
if (!parentContext) {
|
|
23110
|
+
return;
|
|
23111
|
+
}
|
|
23112
|
+
return {
|
|
23113
|
+
operationId: parentContext.operationId,
|
|
23114
|
+
parentId: parentContext.id,
|
|
23115
|
+
id: this.generateId()
|
|
23116
|
+
};
|
|
23117
|
+
}
|
|
23118
|
+
trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
|
|
23119
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
23120
|
+
this.telemetryProvider.trackDependency(redactValue(name), type, durationMs, success, enrichedProperties, resultCode);
|
|
23121
|
+
}
|
|
22911
23122
|
async trackDependencyOperation(name, type, fn, properties) {
|
|
22912
23123
|
const parentContext = this.getCurrentContext();
|
|
22913
23124
|
if (!parentContext) {
|
|
@@ -22944,8 +23155,12 @@ class TelemetryService {
|
|
|
22944
23155
|
...getExecutionContextTelemetryProperties(),
|
|
22945
23156
|
...globalProperties,
|
|
22946
23157
|
...this.defaultProperties,
|
|
22947
|
-
...properties,
|
|
22948
|
-
...context
|
|
23158
|
+
...redactProperties(properties ?? {}),
|
|
23159
|
+
...context ? {
|
|
23160
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
23161
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
23162
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
23163
|
+
} : {}
|
|
22949
23164
|
};
|
|
22950
23165
|
if (sessionId === undefined) {
|
|
22951
23166
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -22955,7 +23170,16 @@ class TelemetryService {
|
|
|
22955
23170
|
return enriched;
|
|
22956
23171
|
}
|
|
22957
23172
|
generateId() {
|
|
22958
|
-
|
|
23173
|
+
const bytes = new Uint8Array(8);
|
|
23174
|
+
let hex = "";
|
|
23175
|
+
do {
|
|
23176
|
+
crypto.getRandomValues(bytes);
|
|
23177
|
+
hex = "";
|
|
23178
|
+
for (const byte of bytes) {
|
|
23179
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
23180
|
+
}
|
|
23181
|
+
} while (/^0+$/.test(hex));
|
|
23182
|
+
return hex;
|
|
22959
23183
|
}
|
|
22960
23184
|
}
|
|
22961
23185
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
@@ -23123,6 +23347,7 @@ import {
|
|
|
23123
23347
|
class PackagerParameters {
|
|
23124
23348
|
inputPath;
|
|
23125
23349
|
downloadUrl;
|
|
23350
|
+
projectId;
|
|
23126
23351
|
logLevel = LogLevel3.Warn;
|
|
23127
23352
|
outputPath;
|
|
23128
23353
|
targetFramework;
|
|
@@ -23422,6 +23647,7 @@ import {
|
|
|
23422
23647
|
class ProjectLoader {
|
|
23423
23648
|
fileSystem;
|
|
23424
23649
|
static WebAppManifestFileName = "webAppManifest.json";
|
|
23650
|
+
static ProjectJsonFileName = "project.json";
|
|
23425
23651
|
constructor(fileSystem) {
|
|
23426
23652
|
this.fileSystem = fileSystem;
|
|
23427
23653
|
}
|
|
@@ -23434,6 +23660,10 @@ class ProjectLoader {
|
|
|
23434
23660
|
if (projectFileExists) {
|
|
23435
23661
|
return await this.loadFromProjectFile(projectPath, projectFilePath);
|
|
23436
23662
|
}
|
|
23663
|
+
const projectJsonPath = Path2.join(projectPath, ProjectLoader.ProjectJsonFileName);
|
|
23664
|
+
if (await this.fileSystem.exists(projectJsonPath)) {
|
|
23665
|
+
return await this.loadFromProjectFile(projectPath, projectJsonPath, true);
|
|
23666
|
+
}
|
|
23437
23667
|
const webAppManifestPath = Path2.join(projectPath, ProjectLoader.WebAppManifestFileName);
|
|
23438
23668
|
const webAppManifestExists = await this.fileSystem.exists(webAppManifestPath);
|
|
23439
23669
|
if (webAppManifestExists) {
|
|
@@ -23441,11 +23671,12 @@ class ProjectLoader {
|
|
|
23441
23671
|
}
|
|
23442
23672
|
throw new Error(translate4.t("solutionpackager.projectLoader.errors.noProjectFile", {
|
|
23443
23673
|
projectFile: ProjectTool.ProjectFileName,
|
|
23674
|
+
projectJsonFile: ProjectLoader.ProjectJsonFileName,
|
|
23444
23675
|
manifestFile: ProjectLoader.WebAppManifestFileName,
|
|
23445
23676
|
path: projectPath
|
|
23446
23677
|
}));
|
|
23447
23678
|
}
|
|
23448
|
-
async loadFromProjectFile(projectPath, projectFilePath) {
|
|
23679
|
+
async loadFromProjectFile(projectPath, projectFilePath, useProjectJson = false) {
|
|
23449
23680
|
const fileContent = await this.fileSystem.readFile(projectFilePath);
|
|
23450
23681
|
if (!fileContent) {
|
|
23451
23682
|
throw new Error(translate4.t("solutionpackager.projectLoader.errors.readFailed", {
|
|
@@ -23454,7 +23685,8 @@ class ProjectLoader {
|
|
|
23454
23685
|
}
|
|
23455
23686
|
const json = typeof fileContent === "string" ? fileContent : new TextDecoder("utf-8").decode(fileContent);
|
|
23456
23687
|
const projectData = JSON.parse(json);
|
|
23457
|
-
const
|
|
23688
|
+
const outputType = useProjectJson ? projectData.designOptions?.outputType : undefined;
|
|
23689
|
+
const projectType = outputType ?? (projectData?.ProjectType || projectData?.type);
|
|
23458
23690
|
if (!projectData || !projectType) {
|
|
23459
23691
|
throw new Error(translate4.t("solutionpackager.projectLoader.errors.invalidProject", {
|
|
23460
23692
|
path: projectFilePath
|
|
@@ -23564,6 +23796,12 @@ class ProjectToolExecutor {
|
|
|
23564
23796
|
projectType: project.Type
|
|
23565
23797
|
}));
|
|
23566
23798
|
}
|
|
23799
|
+
async cleanupAsync(options, project, context, cancellationToken) {
|
|
23800
|
+
return await this.executeToolOperationAsync(project, context, (tool) => this.telemetry.trackDependencyOperation("ProjectPackager.Tool.Cleanup" /* ProjectToolCleanup */, project.Type, async () => tool.cleanupAsync(options, cancellationToken), {
|
|
23801
|
+
projectId: project.Id,
|
|
23802
|
+
projectType: project.Type
|
|
23803
|
+
}));
|
|
23804
|
+
}
|
|
23567
23805
|
async executeToolOperationAsync(project, context, operation) {
|
|
23568
23806
|
try {
|
|
23569
23807
|
const tool = await this.toolsFactory.createProjectToolAsync(project, context);
|
|
@@ -23683,7 +23921,8 @@ class ProjectPackager {
|
|
|
23683
23921
|
logLevel: options.logLevel,
|
|
23684
23922
|
outputPath: options.outputPath
|
|
23685
23923
|
};
|
|
23686
|
-
|
|
23924
|
+
const context = this.createOperationContext(options, uiPathProject);
|
|
23925
|
+
return await this.projectExecutor.restoreAsync(restoreOptions, uiPathProject, context, cancellationToken);
|
|
23687
23926
|
}, cancellationToken);
|
|
23688
23927
|
}
|
|
23689
23928
|
async validateProjectAsync(options, cancellationToken) {
|
|
@@ -23781,6 +24020,20 @@ class ProjectPackager {
|
|
|
23781
24020
|
}
|
|
23782
24021
|
});
|
|
23783
24022
|
}
|
|
24023
|
+
async cleanupProjectAsync(options, cancellationToken) {
|
|
24024
|
+
return await this.executeProjectOperationAsync(options, "Cleanup", "ProjectPackager.Cleanup" /* ProjectPackagerCleanup */, async (uiPathProject, loadedProject) => {
|
|
24025
|
+
const cleanupOptions = {
|
|
24026
|
+
projectPath: loadedProject.projectPath,
|
|
24027
|
+
excludeConfiguredSources: options.excludeConfiguredSources ?? false,
|
|
24028
|
+
nuGetSourcesConfigPath: options.nuGetSourcesConfigPath,
|
|
24029
|
+
logLevel: options.logLevel,
|
|
24030
|
+
dryRun: options.dryRun ?? false,
|
|
24031
|
+
skipImports: options.skipImports ?? false
|
|
24032
|
+
};
|
|
24033
|
+
const context = this.createOperationContext(options, uiPathProject);
|
|
24034
|
+
return await this.projectExecutor.cleanupAsync(cleanupOptions, uiPathProject, context, cancellationToken);
|
|
24035
|
+
}, cancellationToken);
|
|
24036
|
+
}
|
|
23784
24037
|
async getPackageStreamsAsync(result) {
|
|
23785
24038
|
if (!result.isSuccess) {
|
|
23786
24039
|
throw new Error(translate5.t("solutionpackager.packager.errors.failedToGetStreams", {
|
|
@@ -23835,6 +24088,7 @@ class ProjectPackager {
|
|
|
23835
24088
|
id: crypto.randomUUID(),
|
|
23836
24089
|
projects: [uiPathProject],
|
|
23837
24090
|
downloadUrl: options.downloadUrl,
|
|
24091
|
+
projectId: options.projectId,
|
|
23838
24092
|
targetFramework: options.targetFramework ?? TargetFramework.Portable,
|
|
23839
24093
|
connection: options.connection,
|
|
23840
24094
|
logger: this.logger,
|
|
@@ -23899,4 +24153,4 @@ export {
|
|
|
23899
24153
|
BaseBrowserPackagerFactory
|
|
23900
24154
|
};
|
|
23901
24155
|
|
|
23902
|
-
//# debugId=
|
|
24156
|
+
//# debugId=C079BA4B4614343D64756E2164756E21
|