@uipath/rpa-legacy-tool 1.204.0 → 1.205.0-preview.258
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-s8nmdry8.js → index-6gmvgyv6.js} +123 -57
- package/dist/index.js +2 -2
- package/dist/{node-strategy-e5xy4ztb.js → node-strategy-nmepnk2k.js} +1 -1
- package/dist/{tool-bpj5z0x2.js → tool-8ah05y84.js} +52 -11
- package/dist/{tool-g0hcxnae.js → tool-y4vgqz1w.js} +11 -1
- package/dist/tool.js +2 -2
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./tool-qa9gftnj.js";
|
|
9
9
|
import {
|
|
10
10
|
getFileSystem
|
|
11
|
-
} from "./tool-
|
|
11
|
+
} from "./tool-y4vgqz1w.js";
|
|
12
12
|
import {
|
|
13
13
|
AUTH_CANCELLED_ERROR_CODE,
|
|
14
14
|
AUTH_FILENAME,
|
|
@@ -101,22 +101,12 @@ var resolveConfigAsync = async ({
|
|
|
101
101
|
baseUrl = DEFAULT_BASE_URL;
|
|
102
102
|
}
|
|
103
103
|
baseUrl = normalizeAndValidateBaseUrl(baseUrl);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
clientId = fileAuth.clientId;
|
|
107
|
-
}
|
|
108
|
-
if (!clientId) {
|
|
109
|
-
clientId = DEFAULT_CLIENT_ID;
|
|
110
|
-
}
|
|
111
|
-
let clientSecret = customClientSecret;
|
|
112
|
-
if (!clientSecret && fileAuth.clientSecret) {
|
|
113
|
-
clientSecret = fileAuth.clientSecret;
|
|
114
|
-
}
|
|
115
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
104
|
+
const clientId = customClientId || DEFAULT_CLIENT_ID;
|
|
105
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(customClientSecret) || Boolean(customClientAssertion));
|
|
116
106
|
const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
117
107
|
return {
|
|
118
108
|
clientId,
|
|
119
|
-
clientSecret,
|
|
109
|
+
clientSecret: customClientSecret,
|
|
120
110
|
scopes,
|
|
121
111
|
baseUrl,
|
|
122
112
|
authorizationEndpoint: `${baseUrl}/identity_/connect/authorize`,
|
|
@@ -724,6 +714,16 @@ var resolveIdentityType = (claims, authFlow, email) => {
|
|
|
724
714
|
}
|
|
725
715
|
return;
|
|
726
716
|
};
|
|
717
|
+
var resolveApplicationSubtype = (claims, authFlow) => {
|
|
718
|
+
switch (asString(claims?.sub_type)) {
|
|
719
|
+
case "service.external":
|
|
720
|
+
return "External";
|
|
721
|
+
case "service.internal":
|
|
722
|
+
return "Internal";
|
|
723
|
+
default:
|
|
724
|
+
return authFlow === "client_credentials" || authFlow === "federated_credentials" ? "External" : undefined;
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
727
|
var looksLikeEmail = (value) => value?.includes("@") ?? false;
|
|
728
728
|
var pickEmail = (claims) => {
|
|
729
729
|
for (const candidate of [claims?.email, claims?.preferred_username]) {
|
|
@@ -765,6 +765,12 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
|
765
765
|
const clientId = asString(claims?.client_id);
|
|
766
766
|
if (clientId)
|
|
767
767
|
identity.clientId = clientId;
|
|
768
|
+
const subType = asString(claims?.sub_type);
|
|
769
|
+
if (subType)
|
|
770
|
+
identity.subType = subType;
|
|
771
|
+
const applicationSubtype = resolveApplicationSubtype(claims, authFlow);
|
|
772
|
+
if (applicationSubtype)
|
|
773
|
+
identity.applicationSubtype = applicationSubtype;
|
|
768
774
|
return identity;
|
|
769
775
|
};
|
|
770
776
|
var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
|
|
@@ -1060,6 +1066,40 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
1060
1066
|
}
|
|
1061
1067
|
};
|
|
1062
1068
|
|
|
1069
|
+
// ../auth/src/tenantSelection.ts
|
|
1070
|
+
var LOGIN_STATUS_HINT = "Run 'uip login status' to see the organization the CLI is signed in to.";
|
|
1071
|
+
var organizationHint = (organizationId) => `The request used '${organizationId}' as the organization. ${LOGIN_STATUS_HINT}`;
|
|
1072
|
+
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
1073
|
+
var describeNonJsonResponse = (organizationId, response, parseError) => {
|
|
1074
|
+
if (response.redirected) {
|
|
1075
|
+
return `Could not find organization '${organizationId}': the request was ` + `redirected to a sign-in page instead of the organization's tenant ` + `list. ${LOGIN_STATUS_HINT}`;
|
|
1076
|
+
}
|
|
1077
|
+
const contentType = response.headers.get("content-type") ?? "unknown";
|
|
1078
|
+
return `The organization service returned a '${contentType}' response instead ` + `of JSON: ${parseError.message}. ${organizationHint(organizationId)}`;
|
|
1079
|
+
};
|
|
1080
|
+
var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId, signal) => {
|
|
1081
|
+
const url = `${baseUrl}/${organizationId}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo`;
|
|
1082
|
+
const response = await fetch(url, {
|
|
1083
|
+
headers: {
|
|
1084
|
+
Authorization: `Bearer ${accessToken}`
|
|
1085
|
+
},
|
|
1086
|
+
...signal ? { signal } : {}
|
|
1087
|
+
});
|
|
1088
|
+
if (!response.ok) {
|
|
1089
|
+
if (response.status === 401) {
|
|
1090
|
+
throw new Error(`Unauthorized: the access token was rejected, it was not ` + `issued for organization '${organizationId}', or ` + `'${organizationId}' was not accepted as an organization ` + `URL segment in this environment. ` + LOGIN_STATUS_HINT);
|
|
1091
|
+
}
|
|
1092
|
+
const errorText = await response.text();
|
|
1093
|
+
const message = `Failed to get tenants and organizations: ${response.status} ${errorText}`;
|
|
1094
|
+
throw new Error(IDENTIFIER_STATUSES.has(response.status) ? `${message}. ${organizationHint(organizationId)}` : message);
|
|
1095
|
+
}
|
|
1096
|
+
const [parseError, data] = await catchError(response.json());
|
|
1097
|
+
if (parseError) {
|
|
1098
|
+
throw new Error(describeNonJsonResponse(organizationId, response, parseError));
|
|
1099
|
+
}
|
|
1100
|
+
return data;
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1063
1103
|
// ../auth/src/tokenRefresh.ts
|
|
1064
1104
|
var TOKEN_REFRESH_REAUTHENTICATE_MESSAGE = "Token refresh failed. Run 'uip login' to re-authenticate.";
|
|
1065
1105
|
|
|
@@ -1279,6 +1319,8 @@ var CredentialSource;
|
|
|
1279
1319
|
CredentialSource2["Robot"] = "robot";
|
|
1280
1320
|
CredentialSource2["EnvironmentVariables"] = "env-vars";
|
|
1281
1321
|
})(CredentialSource ||= {});
|
|
1322
|
+
var defaultRobotTenantIdCache = new Map;
|
|
1323
|
+
var ROBOT_TENANT_LOOKUP_TIMEOUT_MS = 5000;
|
|
1282
1324
|
var getLoginStatusAsync = async (options = {}) => {
|
|
1283
1325
|
return getLoginStatusWithDeps(options);
|
|
1284
1326
|
};
|
|
@@ -1291,12 +1333,20 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
1291
1333
|
refreshToken: refreshTokenFn = refreshAccessToken,
|
|
1292
1334
|
resolveConfig = resolveConfigAsync,
|
|
1293
1335
|
robotFallback = tryRobotClientFallback,
|
|
1336
|
+
fetchTenantsAndOrgs = fetchTenantsAndOrganizations,
|
|
1337
|
+
robotTenantIdCache = defaultRobotTenantIdCache,
|
|
1338
|
+
robotTenantLookupTimeoutMs = ROBOT_TENANT_LOOKUP_TIMEOUT_MS,
|
|
1294
1339
|
loadBreaker = loadRefreshBreaker,
|
|
1295
1340
|
saveBreaker = saveRefreshBreaker,
|
|
1296
1341
|
clearBreaker = clearRefreshBreaker
|
|
1297
1342
|
} = deps;
|
|
1343
|
+
const robotDeps = {
|
|
1344
|
+
fetchTenantsAndOrgs,
|
|
1345
|
+
cache: robotTenantIdCache,
|
|
1346
|
+
lookupTimeoutMs: robotTenantLookupTimeoutMs
|
|
1347
|
+
};
|
|
1298
1348
|
if (isRobotAuthEnforced()) {
|
|
1299
|
-
return resolveRobotEnforcedStatus(robotFallback);
|
|
1349
|
+
return resolveRobotEnforcedStatus(robotFallback, robotDeps);
|
|
1300
1350
|
}
|
|
1301
1351
|
if (isEnvAuthEnabled()) {
|
|
1302
1352
|
return readAuthFromEnv();
|
|
@@ -1314,7 +1364,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
1314
1364
|
hint: `No credentials found for profile "${activeProfile}". Run 'uip login --profile ${activeProfile}' to authenticate this profile.`
|
|
1315
1365
|
};
|
|
1316
1366
|
}
|
|
1317
|
-
return resolveBorrowedRobotStatus(robotFallback);
|
|
1367
|
+
return resolveBorrowedRobotStatus(robotFallback, robotDeps);
|
|
1318
1368
|
}
|
|
1319
1369
|
const loaded = await loadFileCredentials(loadEnvFile, absolutePath);
|
|
1320
1370
|
if ("status" in loaded) {
|
|
@@ -1356,7 +1406,7 @@ var getLoginStatusWithDeps = async (options = {}, deps = {}) => {
|
|
|
1356
1406
|
}
|
|
1357
1407
|
return buildFileStatus(tokens, credentials, globalHint);
|
|
1358
1408
|
};
|
|
1359
|
-
async function resolveRobotEnforcedStatus(robotFallback) {
|
|
1409
|
+
async function resolveRobotEnforcedStatus(robotFallback, deps) {
|
|
1360
1410
|
if (isEnvAuthEnabled()) {
|
|
1361
1411
|
throw new EnvAuthConfigError(`${ENV_AUTH_ENABLE_VAR}=true and ${ENFORCE_ROBOT_AUTH_VAR}=true ` + `are mutually exclusive. Unset one of them and re-run.`);
|
|
1362
1412
|
}
|
|
@@ -1367,11 +1417,11 @@ async function resolveRobotEnforcedStatus(robotFallback) {
|
|
|
1367
1417
|
hint: `${ENFORCE_ROBOT_AUTH_VAR}=true but the UiPath Robot ` + `session is unavailable. Start and sign in to the Assistant, ` + `or unset ${ENFORCE_ROBOT_AUTH_VAR} to fall back to file or ` + `env-var authentication.`
|
|
1368
1418
|
};
|
|
1369
1419
|
}
|
|
1370
|
-
return buildRobotStatus(robotCreds);
|
|
1420
|
+
return buildRobotStatus(robotCreds, deps);
|
|
1371
1421
|
}
|
|
1372
|
-
async function resolveBorrowedRobotStatus(robotFallback) {
|
|
1422
|
+
async function resolveBorrowedRobotStatus(robotFallback, deps) {
|
|
1373
1423
|
const robotCreds = await robotFallback();
|
|
1374
|
-
return robotCreds ? buildRobotStatus(robotCreds) : { loginStatus: "Not logged in" };
|
|
1424
|
+
return robotCreds ? buildRobotStatus(robotCreds, deps) : { loginStatus: "Not logged in" };
|
|
1375
1425
|
}
|
|
1376
1426
|
async function loadFileCredentials(loadEnvFile, absolutePath) {
|
|
1377
1427
|
let credentials;
|
|
@@ -1506,9 +1556,10 @@ function identityFields(accessToken, credentials) {
|
|
|
1506
1556
|
...scopes ? { scopes } : {}
|
|
1507
1557
|
};
|
|
1508
1558
|
}
|
|
1509
|
-
function buildRobotStatus(robotCreds) {
|
|
1559
|
+
async function buildRobotStatus(robotCreds, deps) {
|
|
1510
1560
|
const identity = resolveSessionIdentity(robotCreds.accessToken);
|
|
1511
1561
|
const scopes = readTokenScopes(robotCreds.accessToken);
|
|
1562
|
+
const tenant = robotCreds.tenantId ? { tenantId: robotCreds.tenantId } : await resolveRobotTenantId(robotCreds, deps);
|
|
1512
1563
|
return {
|
|
1513
1564
|
loginStatus: "Logged in",
|
|
1514
1565
|
accessToken: robotCreds.accessToken,
|
|
@@ -1516,14 +1567,62 @@ function buildRobotStatus(robotCreds) {
|
|
|
1516
1567
|
organizationName: robotCreds.organizationName,
|
|
1517
1568
|
organizationId: robotCreds.organizationId,
|
|
1518
1569
|
tenantName: robotCreds.tenantName,
|
|
1519
|
-
tenantId:
|
|
1570
|
+
tenantId: tenant.tenantId,
|
|
1520
1571
|
issuer: robotCreds.issuer,
|
|
1521
1572
|
expiration: getTokenExpiration(robotCreds.accessToken),
|
|
1522
1573
|
source: "robot" /* Robot */,
|
|
1574
|
+
...tenant.hint ? { hint: tenant.hint } : {},
|
|
1523
1575
|
...identity ? { identity } : {},
|
|
1524
1576
|
...scopes ? { scopes } : {}
|
|
1525
1577
|
};
|
|
1526
1578
|
}
|
|
1579
|
+
async function resolveRobotTenantId(robotCreds, deps) {
|
|
1580
|
+
const { baseUrl, accessToken, tenantName } = robotCreds;
|
|
1581
|
+
const organization = robotCreds.organizationName ?? robotCreds.organizationId;
|
|
1582
|
+
if (!tenantName || !organization) {
|
|
1583
|
+
return {};
|
|
1584
|
+
}
|
|
1585
|
+
const key = `${baseUrl}|${organization}|${tenantName}|${accessToken}`;
|
|
1586
|
+
let pending = deps.cache.get(key);
|
|
1587
|
+
if (!pending) {
|
|
1588
|
+
pending = catchError(lookupRobotTenantId({ baseUrl, accessToken, organization, tenantName }, deps)).then(([error, resolution]) => {
|
|
1589
|
+
const settled = error ? { hint: tenantLookupFailureHint(tenantName, error.message) } : resolution;
|
|
1590
|
+
if (!settled.tenantId) {
|
|
1591
|
+
deps.cache.delete(key);
|
|
1592
|
+
}
|
|
1593
|
+
return settled;
|
|
1594
|
+
});
|
|
1595
|
+
deps.cache.set(key, pending);
|
|
1596
|
+
}
|
|
1597
|
+
return pending;
|
|
1598
|
+
}
|
|
1599
|
+
async function lookupRobotTenantId(target, deps) {
|
|
1600
|
+
const { baseUrl, accessToken, organization, tenantName } = target;
|
|
1601
|
+
const [error, data] = await catchError(deps.fetchTenantsAndOrgs(baseUrl, accessToken, organization, AbortSignal.timeout(deps.lookupTimeoutMs)));
|
|
1602
|
+
if (error) {
|
|
1603
|
+
const reason = error.name === "TimeoutError" ? `the tenant list did not answer within ${deps.lookupTimeoutMs} ms.` : error.message;
|
|
1604
|
+
return { hint: tenantLookupFailureHint(tenantName, reason) };
|
|
1605
|
+
}
|
|
1606
|
+
const rows = data?.tenants;
|
|
1607
|
+
const tenants = Array.isArray(rows) ? rows.filter((tenant) => typeof tenant?.id === "string" && typeof tenant?.name === "string") : [];
|
|
1608
|
+
const wantedName = decodePathSegment(tenantName);
|
|
1609
|
+
const wanted = wantedName.toLowerCase();
|
|
1610
|
+
const match = tenants.find((tenant) => tenant.name === wantedName) ?? tenants.find((tenant) => tenant.name.toLowerCase() === wanted);
|
|
1611
|
+
if (!match) {
|
|
1612
|
+
const names = tenants.map((tenant) => tenant.name).join(", ");
|
|
1613
|
+
return {
|
|
1614
|
+
hint: `The Robot session targets tenant '${tenantName}', but ` + `organization '${organization}' lists no tenant of that name` + `${names ? ` (available: ${names})` : ""}. Commands that need ` + `the tenant id will fail until it can be resolved.`
|
|
1615
|
+
};
|
|
1616
|
+
}
|
|
1617
|
+
return { tenantId: match.id };
|
|
1618
|
+
}
|
|
1619
|
+
function tenantLookupFailureHint(tenantName, reason) {
|
|
1620
|
+
return `Could not resolve the id of tenant '${tenantName}' from the ` + `Robot session: ${reason} Commands that need the tenant id will ` + `fail until it can be resolved.`;
|
|
1621
|
+
}
|
|
1622
|
+
function decodePathSegment(segment) {
|
|
1623
|
+
const [error, decoded] = catchError(() => decodeURIComponent(segment));
|
|
1624
|
+
return error ? segment : decoded;
|
|
1625
|
+
}
|
|
1527
1626
|
var isFileNotFoundError = (error) => {
|
|
1528
1627
|
if (!(error instanceof Object))
|
|
1529
1628
|
return false;
|
|
@@ -2045,39 +2144,6 @@ var federatedCredentialsLogin = async ({
|
|
|
2045
2144
|
buildError: buildFederatedError
|
|
2046
2145
|
});
|
|
2047
2146
|
};
|
|
2048
|
-
// ../auth/src/tenantSelection.ts
|
|
2049
|
-
var LOGIN_STATUS_HINT = "Run 'uip login status' to see the organization the CLI is signed in to.";
|
|
2050
|
-
var organizationHint = (organizationId) => `The request used '${organizationId}' as the organization. ${LOGIN_STATUS_HINT}`;
|
|
2051
|
-
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
2052
|
-
var describeNonJsonResponse = (organizationId, response, parseError) => {
|
|
2053
|
-
if (response.redirected) {
|
|
2054
|
-
return `Could not find organization '${organizationId}': the request was ` + `redirected to a sign-in page instead of the organization's tenant ` + `list. ${LOGIN_STATUS_HINT}`;
|
|
2055
|
-
}
|
|
2056
|
-
const contentType = response.headers.get("content-type") ?? "unknown";
|
|
2057
|
-
return `The organization service returned a '${contentType}' response instead ` + `of JSON: ${parseError.message}. ${organizationHint(organizationId)}`;
|
|
2058
|
-
};
|
|
2059
|
-
var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId) => {
|
|
2060
|
-
const url = `${baseUrl}/${organizationId}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo`;
|
|
2061
|
-
const response = await fetch(url, {
|
|
2062
|
-
headers: {
|
|
2063
|
-
Authorization: `Bearer ${accessToken}`
|
|
2064
|
-
}
|
|
2065
|
-
});
|
|
2066
|
-
if (!response.ok) {
|
|
2067
|
-
if (response.status === 401) {
|
|
2068
|
-
throw new Error(`Unauthorized: the access token was rejected, it was not ` + `issued for organization '${organizationId}', or ` + `'${organizationId}' was not accepted as an organization ` + `URL segment in this environment. ` + LOGIN_STATUS_HINT);
|
|
2069
|
-
}
|
|
2070
|
-
const errorText = await response.text();
|
|
2071
|
-
const message = `Failed to get tenants and organizations: ${response.status} ${errorText}`;
|
|
2072
|
-
throw new Error(IDENTIFIER_STATUSES.has(response.status) ? `${message}. ${organizationHint(organizationId)}` : message);
|
|
2073
|
-
}
|
|
2074
|
-
const [parseError, data] = await catchError(response.json());
|
|
2075
|
-
if (parseError) {
|
|
2076
|
-
throw new Error(describeNonJsonResponse(organizationId, response, parseError));
|
|
2077
|
-
}
|
|
2078
|
-
return data;
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
2147
|
// ../auth/src/selectTenant.ts
|
|
2082
2148
|
var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
|
|
2083
2149
|
var INVALID_TENANT_CODE = "INVALID_TENANT";
|
|
@@ -2437,7 +2503,7 @@ var authenticate = async ({
|
|
|
2437
2503
|
const { BrowserAuthStrategy } = await import("./browser-strategy-tyy1nbjg.js");
|
|
2438
2504
|
strategy = new BrowserAuthStrategy;
|
|
2439
2505
|
} else {
|
|
2440
|
-
const { NodeAuthStrategy } = await import("./node-strategy-
|
|
2506
|
+
const { NodeAuthStrategy } = await import("./node-strategy-nmepnk2k.js");
|
|
2441
2507
|
strategy = new NodeAuthStrategy;
|
|
2442
2508
|
}
|
|
2443
2509
|
const code = await strategy.execute(authUrl, effectiveRedirectUriUrl, state, {
|
|
@@ -2531,4 +2597,4 @@ export {
|
|
|
2531
2597
|
setAuthFileConfig
|
|
2532
2598
|
};
|
|
2533
2599
|
|
|
2534
|
-
//# debugId=
|
|
2600
|
+
//# debugId=41F0B64CEBF71AB464756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFileSystem
|
|
3
|
-
} from "./tool-
|
|
3
|
+
} from "./tool-y4vgqz1w.js";
|
|
4
4
|
import {
|
|
5
5
|
__commonJS,
|
|
6
6
|
__require,
|
|
@@ -2104,7 +2104,7 @@ var package_default = {
|
|
|
2104
2104
|
name: "@uipath/rpa-legacy-tool",
|
|
2105
2105
|
author: "UiPath",
|
|
2106
2106
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2107
|
-
version: "1.
|
|
2107
|
+
version: "1.205.0-preview.258",
|
|
2108
2108
|
description: "uipcli plugin for validating, analyzing and building RPA projects using the legacy UiPath CLI",
|
|
2109
2109
|
private: false,
|
|
2110
2110
|
maintainers: [
|
|
@@ -2823,7 +2823,7 @@ function setGlobalLogFilePath(path) {
|
|
|
2823
2823
|
function getGlobalLogFilePath() {
|
|
2824
2824
|
return logFilePathSlot.get("");
|
|
2825
2825
|
}
|
|
2826
|
-
var DEFAULT_LOG_LEVEL =
|
|
2826
|
+
var DEFAULT_LOG_LEVEL = 2 /* WARN */;
|
|
2827
2827
|
|
|
2828
2828
|
class SimpleLogger {
|
|
2829
2829
|
__brand = "SimpleLogger";
|
|
@@ -3090,7 +3090,9 @@ var ErrorDimensions = {
|
|
|
3090
3090
|
Result: "Result",
|
|
3091
3091
|
ErrorCode: "ErrorCode",
|
|
3092
3092
|
Retry: "Retry",
|
|
3093
|
-
ErrorMessage: "ErrorMessage"
|
|
3093
|
+
ErrorMessage: "ErrorMessage",
|
|
3094
|
+
HttpStatus: "HttpStatus",
|
|
3095
|
+
UpstreamErrorCode: "UpstreamErrorCode"
|
|
3094
3096
|
};
|
|
3095
3097
|
var AuthDimensions = {
|
|
3096
3098
|
AuthenticationMethod: "AuthenticationMethod",
|
|
@@ -4078,7 +4080,9 @@ var CLI_ERROR_CODES = [
|
|
|
4078
4080
|
"timeout",
|
|
4079
4081
|
"server_error",
|
|
4080
4082
|
"method_not_allowed",
|
|
4083
|
+
"not_supported",
|
|
4081
4084
|
"configuration_error",
|
|
4085
|
+
"execution_failed",
|
|
4082
4086
|
"unknown_error"
|
|
4083
4087
|
];
|
|
4084
4088
|
var RETRY_HINTS = [
|
|
@@ -5035,7 +5039,9 @@ var OutputFormatter;
|
|
|
5035
5039
|
[ErrorDimensions.Result]: data.Result,
|
|
5036
5040
|
[ErrorDimensions.ErrorCode]: data.ErrorCode,
|
|
5037
5041
|
[ErrorDimensions.Retry]: data.Retry,
|
|
5038
|
-
[ErrorDimensions.ErrorMessage]: data.Message
|
|
5042
|
+
[ErrorDimensions.ErrorMessage]: data.Message,
|
|
5043
|
+
[ErrorDimensions.HttpStatus]: data.Context?.httpStatus?.toString(),
|
|
5044
|
+
[ErrorDimensions.UpstreamErrorCode]: data.Context?.errorCode
|
|
5039
5045
|
});
|
|
5040
5046
|
}
|
|
5041
5047
|
logOutput(normalizeOutputKeys(envelope), getOutputFormat());
|
|
@@ -5829,6 +5835,40 @@ var MIME_TYPES_BY_EXTENSION = Object.freeze({
|
|
|
5829
5835
|
wav: "audio/wav",
|
|
5830
5836
|
mp4: "video/mp4"
|
|
5831
5837
|
});
|
|
5838
|
+
// ../common/src/option-aliases.ts
|
|
5839
|
+
function warnDeprecatedOptionAlias(deprecatedFlag, preferredFlag) {
|
|
5840
|
+
getOutputSink().writeErr(`[WARN] ${deprecatedFlag} is deprecated. Use ${preferredFlag} instead.
|
|
5841
|
+
`);
|
|
5842
|
+
}
|
|
5843
|
+
function addDeprecatedOptionAlias(command, deprecatedFlags, preferredLong) {
|
|
5844
|
+
const preferred = command.options.find((option) => option.long === preferredLong);
|
|
5845
|
+
if (preferred === undefined) {
|
|
5846
|
+
throw new Error(`${preferredLong} must be registered before its deprecated alias`);
|
|
5847
|
+
}
|
|
5848
|
+
const deprecated = new Option(deprecatedFlags, `Deprecated alias for ${preferredLong}`).hideHelp();
|
|
5849
|
+
const preferredKey = preferred.attributeName();
|
|
5850
|
+
const deprecatedLabel = [deprecated.short, deprecated.long].filter((flag) => flag !== undefined).join("/");
|
|
5851
|
+
let aliasUsed = false;
|
|
5852
|
+
const conflict = () => command.error(`error: option '${deprecated.flags}' cannot be used with option '${preferred.flags}'`, {
|
|
5853
|
+
code: "commander.conflictingOption",
|
|
5854
|
+
exitCode: EXIT_CODES.ValidationError
|
|
5855
|
+
});
|
|
5856
|
+
command.on(`option:${preferred.name()}`, () => {
|
|
5857
|
+
if (aliasUsed)
|
|
5858
|
+
conflict();
|
|
5859
|
+
});
|
|
5860
|
+
command.on(`option:${deprecated.name()}`, (value) => {
|
|
5861
|
+
if (!aliasUsed) {
|
|
5862
|
+
if (command.getOptionValueSource(preferredKey) === "cli") {
|
|
5863
|
+
conflict();
|
|
5864
|
+
}
|
|
5865
|
+
warnDeprecatedOptionAlias(deprecatedLabel, preferredLong);
|
|
5866
|
+
aliasUsed = true;
|
|
5867
|
+
}
|
|
5868
|
+
command.setOptionValueWithSource(preferredKey, value, "cli");
|
|
5869
|
+
});
|
|
5870
|
+
return command.addOption(deprecated);
|
|
5871
|
+
}
|
|
5832
5872
|
// ../common/src/polling/types.ts
|
|
5833
5873
|
var PollOutcome = {
|
|
5834
5874
|
Completed: "completed",
|
|
@@ -6500,7 +6540,7 @@ async function injectOrchestratorAuth(args) {
|
|
|
6500
6540
|
if (!hasAuth) {
|
|
6501
6541
|
return;
|
|
6502
6542
|
}
|
|
6503
|
-
const { getLoginStatusAsync } = await import("./index-
|
|
6543
|
+
const { getLoginStatusAsync } = await import("./index-6gmvgyv6.js");
|
|
6504
6544
|
const [, loginStatus] = await catchError(getLoginStatusAsync({}));
|
|
6505
6545
|
if (loginStatus?.loginStatus === "Logged in" && loginStatus.accessToken && loginStatus.baseUrl) {
|
|
6506
6546
|
addOption(args, "--orchestratorUrl", loginStatus.baseUrl);
|
|
@@ -7965,7 +8005,7 @@ var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
|
7965
8005
|
var PACKAGE_EXAMPLES = [
|
|
7966
8006
|
{
|
|
7967
8007
|
Description: "Pack an RPA project into a .nupkg",
|
|
7968
|
-
Command: "uip rpa-legacy pack ./MyProject --output ./out",
|
|
8008
|
+
Command: "uip rpa-legacy pack ./MyProject --output-dir ./out",
|
|
7969
8009
|
Output: {
|
|
7970
8010
|
Code: "RpaLegacyPackage",
|
|
7971
8011
|
Data: {
|
|
@@ -7977,7 +8017,7 @@ var PACKAGE_EXAMPLES = [
|
|
|
7977
8017
|
}
|
|
7978
8018
|
];
|
|
7979
8019
|
var registerPackageCommand = (program2) => {
|
|
7980
|
-
program2.command("pack").description("Pack an RPA project into a deployable .nupkg file").argument("<project-path>", "Path to the RPA project or project.json").requiredOption("-o, --output <path>", "Output directory for the generated .nupkg").option("-v, --version <version>", "Package version").option("--auto-version", "Auto-generate package version").option("--output-type <type>", "Force output type (Process|Library|Tests|Objects)").option("--split-output", "Split output into runtime and design libraries").option("--repository-url <url>", "Source repository URL").option("--repository-commit <sha>", "Source repository commit SHA").option("--repository-branch <branch>", "Source repository branch").option("--repository-type <type>", "Source repository type").option("--project-url <url>", "Automation Hub project URL").option("--release-notes <text>", "Release notes for the package").option("--timeout <seconds>", "Timeout in seconds for the operation").examples(PACKAGE_EXAMPLES).trackedAction(processContext, async (projectPath, options) => {
|
|
8020
|
+
const pack = program2.command("pack").description("Pack an RPA project into a deployable .nupkg file").argument("<project-path>", "Path to the RPA project or project.json").requiredOption("-o, --output-dir <path>", "Output directory for the generated .nupkg").option("-v, --version <version>", "Package version").option("--auto-version", "Auto-generate package version").option("--output-type <type>", "Force output type (Process|Library|Tests|Objects)").option("--split-output", "Split output into runtime and design libraries").option("--repository-url <url>", "Source repository URL").option("--repository-commit <sha>", "Source repository commit SHA").option("--repository-branch <branch>", "Source repository branch").option("--repository-type <type>", "Source repository type").option("--project-url <url>", "Automation Hub project URL").option("--release-notes <text>", "Release notes for the package").option("--timeout <seconds>", "Timeout in seconds for the operation").examples(PACKAGE_EXAMPLES).trackedAction(processContext, async (projectPath, options) => {
|
|
7981
8021
|
assertWindows();
|
|
7982
8022
|
const cliPath = await resolveLegacyCliPath();
|
|
7983
8023
|
const fs = getFileSystem();
|
|
@@ -7993,7 +8033,7 @@ var registerPackageCommand = (program2) => {
|
|
|
7993
8033
|
"pack",
|
|
7994
8034
|
projectPath,
|
|
7995
8035
|
"--output",
|
|
7996
|
-
options.
|
|
8036
|
+
options.outputDir
|
|
7997
8037
|
];
|
|
7998
8038
|
addOption(args, "--version", options.version);
|
|
7999
8039
|
addFlag(args, "--autoVersion", options.autoVersion);
|
|
@@ -8034,11 +8074,12 @@ var registerPackageCommand = (program2) => {
|
|
|
8034
8074
|
Code: "RpaLegacyPackage",
|
|
8035
8075
|
Data: {
|
|
8036
8076
|
ProjectPath: projectPath,
|
|
8037
|
-
OutputPath: options.
|
|
8077
|
+
OutputPath: options.outputDir,
|
|
8038
8078
|
Status: "Packaging succeeded"
|
|
8039
8079
|
}
|
|
8040
8080
|
});
|
|
8041
8081
|
});
|
|
8082
|
+
addDeprecatedOptionAlias(pack, "--output <path>", "--output-dir");
|
|
8042
8083
|
};
|
|
8043
8084
|
|
|
8044
8085
|
// src/commands/type-definition.ts
|
|
@@ -8200,4 +8241,4 @@ var registerCommands = async (program2) => {
|
|
|
8200
8241
|
|
|
8201
8242
|
export { Command, metadata, registerCommands };
|
|
8202
8243
|
|
|
8203
|
-
//# debugId=
|
|
8244
|
+
//# debugId=C403F5084EC6FFA864756E2164756E21
|
|
@@ -182,6 +182,16 @@ class NodeFileSystem {
|
|
|
182
182
|
async rename(oldPath, newPath) {
|
|
183
183
|
await fs.rename(oldPath, newPath);
|
|
184
184
|
}
|
|
185
|
+
async isSymbolicLink(filePath) {
|
|
186
|
+
try {
|
|
187
|
+
return (await fs.lstat(filePath)).isSymbolicLink();
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (this.isEnoent(error) || this.hasErrnoCode(error, "ENOTDIR")) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
185
195
|
async realpath(filePath) {
|
|
186
196
|
try {
|
|
187
197
|
return await fs.realpath(filePath);
|
|
@@ -234,4 +244,4 @@ var getFileSystem = () => fsInstance;
|
|
|
234
244
|
|
|
235
245
|
export { getFileSystem };
|
|
236
246
|
|
|
237
|
-
//# debugId=
|
|
247
|
+
//# debugId=82E3494FD83B7EB464756E2164756E21
|
package/dist/tool.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uipath/rpa-legacy-tool",
|
|
3
3
|
"author": "UiPath",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.205.0-preview.258",
|
|
6
6
|
"description": "uipcli plugin for validating, analyzing and building RPA projects using the legacy UiPath CLI",
|
|
7
7
|
"private": false,
|
|
8
8
|
"maintainers": [
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"files": [
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "8f629ee9fa89abf94f197436a60cb3b9620f8b27"
|
|
34
34
|
}
|