@uipath/rules-tool 1.205.0-preview.281 → 1.206.0-preview.282
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/DmnFactory-L7MABUC6-q2sr3grz.js +10 -0
- package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +8 -0
- package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +8 -0
- package/dist/THIRD-PARTY-NOTICES.md +4 -4
- package/dist/business-rules-z2zw35qd.js +25 -0
- package/dist/{constants-cnn0jfw6.js → constants-1sdwfz26.js} +7 -15
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/first-party-service-hegqxm82.js +8 -0
- package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +12 -0
- package/dist/index-4a4x1ygg.js +24 -0
- package/dist/{index-52h8rpew.js → index-egzwtc07.js} +2 -4
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-xaxgkfez.js +23 -0
- package/dist/{tool-tjcg2xje.js → index-y5yffb2s.js} +3525 -236
- package/dist/index-z4kt2kt6.js +8 -0
- package/dist/{index-bhjt1h5c.js → index-zeszs1ra.js} +23 -66
- package/dist/index.js +8 -9
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/rule-catalog-5qnmp0xp.js +71 -0
- package/dist/rules-command-error-30c8a3n9.js +13 -0
- package/dist/{rules-debug-service-02zf7t4e.js → rules-debug-service-jf46j5g6.js} +37 -38
- package/dist/{rules-init-service-f990fgeb.js → rules-init-service-skes439c.js} +12 -16
- package/dist/{rules-refresh-service-jn6my893.js → rules-refresh-service-18hrs394.js} +13 -14
- package/dist/{rules-validate-service-hfw8m3dm.js → rules-validate-service-s787ehrr.js} +10 -13
- package/dist/{tool-f04pwp3c.js → tool-5exp6zh7.js} +659 -14
- package/dist/{tool-fk8rznma.js → tool-89e90qrm.js} +173 -223
- package/dist/{tool-fbxe48wd.js → tool-8cnhz30a.js} +13991 -15184
- package/dist/{tool-h7gn1rar.js → tool-93hqhaj3.js} +402 -417
- package/dist/{tool-wf2qkrye.js → tool-cs8nyk0r.js} +990 -514
- package/dist/{tool-txp5th7j.js → tool-e23cj2jx.js} +127 -42
- package/dist/{tool-1de529jm.js → tool-epsr41wx.js} +12 -3
- package/dist/{tool-gkbr01gc.js → tool-fkppxa9f.js} +14 -17
- package/dist/{tool-5hek0atf.js → tool-k55fs9aj.js} +32 -34
- package/dist/{tool-86f1xpxn.js → tool-m59a481n.js} +18 -20
- package/dist/tool-mst6a4dr.js +73 -0
- package/dist/{tool-t4k013ex.js → tool-njnhj05q.js} +8 -8
- package/dist/tool-p7hqn93n.js +455 -0
- package/dist/{tool-z1ay3csx.js → tool-sbtf80ft.js} +66 -24
- package/dist/{tool-yq5jph4h.js → tool-vqm4apm6.js} +207 -216
- package/dist/tool.js +7 -8
- package/package.json +2 -2
- package/dist/DmnFactory-L7MABUC6-98k17dkr.js +0 -46
- package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +0 -18
- package/dist/KieDmnMarshaller-LGE63WDG-3vemswef.js +0 -20
- package/dist/business-rules-pm96sefm.js +0 -26
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/hitPolicyResult-CGCR73CW-9bmc4nsr.js +0 -36
- package/dist/index-cpm94vee.js +0 -132
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-x9msn1dj.js +0 -85
- package/dist/index-ybrgtfsg.js +0 -3326
- package/dist/rule-catalog-10fhgevc.js +0 -74
- package/dist/rules-command-error-k6kxwfn7.js +0 -14
- package/dist/tool-1pccj6q3.js +0 -1116
- package/dist/tool-53w8skv5.js +0 -262
- package/dist/tool-7haj67tr.js +0 -19
- package/dist/tool-fbmxx07c.js +0 -73
- package/dist/tool-gdtpsdn7.js +0 -342
- package/dist/tool-jd313s2x.js +0 -10
- package/dist/tool-qgqscsjc.js +0 -46
- /package/dist/{tool-cfrcyxgm.js → tool-2nmqvfmt.js} +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
addSdkUserAgentHeader,
|
|
3
2
|
getFileSystem,
|
|
3
|
+
catchError,
|
|
4
|
+
extractErrorMessage,
|
|
5
|
+
logger,
|
|
4
6
|
getSdkUserAgentToken,
|
|
7
|
+
addSdkUserAgentHeader,
|
|
5
8
|
installSdkUserAgentHeader
|
|
6
|
-
} from "./tool-
|
|
9
|
+
} from "./tool-cs8nyk0r.js";
|
|
7
10
|
import {
|
|
8
11
|
__require
|
|
9
|
-
} from "./tool-
|
|
12
|
+
} from "./tool-epsr41wx.js";
|
|
10
13
|
|
|
11
14
|
// ../auth/src/catch-error.ts
|
|
12
15
|
function isPromiseLike(value) {
|
|
13
16
|
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
14
17
|
}
|
|
15
|
-
function
|
|
18
|
+
function catchError2(fnOrPromise) {
|
|
16
19
|
if (isPromiseLike(fnOrPromise)) {
|
|
17
20
|
return settlePromiseLike(fnOrPromise);
|
|
18
21
|
}
|
|
@@ -53,7 +56,7 @@ function isAuthProfileStorage(value) {
|
|
|
53
56
|
return value !== null && typeof value === "object" && "getStore" in value && "run" in value;
|
|
54
57
|
}
|
|
55
58
|
function createProfileStorage() {
|
|
56
|
-
const [error, mod] =
|
|
59
|
+
const [error, mod] = catchError2(() => __require("node:async_hooks"));
|
|
57
60
|
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
58
61
|
return {
|
|
59
62
|
getStore: () => {
|
|
@@ -150,7 +153,7 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
|
|
|
150
153
|
baseUrl = `https://${baseUrl}`;
|
|
151
154
|
}
|
|
152
155
|
const resolvedBaseUrl = baseUrl;
|
|
153
|
-
const [urlError, url] =
|
|
156
|
+
const [urlError, url] = catchError2(() => new URL(resolvedBaseUrl));
|
|
154
157
|
if (urlError) {
|
|
155
158
|
const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
|
|
156
159
|
throw new InvalidBaseUrlError(baseUrl, `Malformed URL.${shapeHint}`);
|
|
@@ -277,7 +280,7 @@ var getTokenExpiration = (accessToken) => {
|
|
|
277
280
|
// ../auth/src/sessionIdentity.ts
|
|
278
281
|
var parseAuthFlow = (value) => value === "authorization_code" || value === "client_credentials" || value === "federated_credentials" ? value : undefined;
|
|
279
282
|
var decodeClaims = (accessToken) => {
|
|
280
|
-
const [error, claims] =
|
|
283
|
+
const [error, claims] = catchError2(() => parseJWT(accessToken));
|
|
281
284
|
return error ? undefined : claims;
|
|
282
285
|
};
|
|
283
286
|
var asString = (value) => typeof value === "string" && value.length > 0 ? value : undefined;
|
|
@@ -369,6 +372,8 @@ var ENV_AUTH_VARS = {
|
|
|
369
372
|
};
|
|
370
373
|
|
|
371
374
|
class EnvAuthConfigError extends Error {
|
|
375
|
+
errorCode = "configuration_error";
|
|
376
|
+
retry = "RetryWillNotFix";
|
|
372
377
|
constructor(message) {
|
|
373
378
|
super(message);
|
|
374
379
|
this.name = "EnvAuthConfigError";
|
|
@@ -385,7 +390,7 @@ var requireEnv = (name) => {
|
|
|
385
390
|
};
|
|
386
391
|
var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
|
|
387
392
|
var resolveBaseUrl = (rawUrl, failureContext) => {
|
|
388
|
-
const [baseUrlError, baseUrl] =
|
|
393
|
+
const [baseUrlError, baseUrl] = catchError2(() => normalizeAndValidateBaseUrl(rawUrl));
|
|
389
394
|
if (baseUrlError) {
|
|
390
395
|
if (baseUrlError instanceof InvalidBaseUrlError) {
|
|
391
396
|
throw baseUrlError;
|
|
@@ -400,18 +405,18 @@ var readAuthFromEnv = () => {
|
|
|
400
405
|
const organizationId = requireEnv(ENV_AUTH_VARS.organizationId);
|
|
401
406
|
const tenantName = requireEnv(ENV_AUTH_VARS.tenantName);
|
|
402
407
|
const tenantId = requireEnv(ENV_AUTH_VARS.tenantId);
|
|
403
|
-
const [parseError, payload] =
|
|
408
|
+
const [parseError, payload] = catchError2(() => parseJWT(accessToken));
|
|
404
409
|
if (parseError) {
|
|
405
410
|
const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
|
|
406
411
|
const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
|
|
407
412
|
if (!rawUrl) {
|
|
408
413
|
throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
|
|
409
414
|
}
|
|
410
|
-
const
|
|
415
|
+
const baseUrl = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
|
|
411
416
|
return {
|
|
412
417
|
loginStatus: "Logged in",
|
|
413
418
|
accessToken,
|
|
414
|
-
baseUrl
|
|
419
|
+
baseUrl,
|
|
415
420
|
organizationName,
|
|
416
421
|
organizationId,
|
|
417
422
|
tenantName,
|
|
@@ -521,13 +526,13 @@ var defaultIsRobotIpcAvailable = async () => {
|
|
|
521
526
|
if (process.platform === "win32") {
|
|
522
527
|
return true;
|
|
523
528
|
}
|
|
524
|
-
const [pipeNamesError, pipeNames] = await
|
|
529
|
+
const [pipeNamesError, pipeNames] = await catchError2(getRobotIpcPipeNames());
|
|
525
530
|
if (pipeNamesError || !pipeNames) {
|
|
526
531
|
return false;
|
|
527
532
|
}
|
|
528
533
|
const fs = getFileSystem();
|
|
529
534
|
for (const pipeName of pipeNames) {
|
|
530
|
-
const [existsError, exists] = await
|
|
535
|
+
const [existsError, exists] = await catchError2(fs.exists(pipeName));
|
|
531
536
|
if (!existsError && exists === true) {
|
|
532
537
|
return true;
|
|
533
538
|
}
|
|
@@ -545,7 +550,7 @@ var withTimeout = (promise, timeoutMs) => new Promise((resolve, reject) => {
|
|
|
545
550
|
});
|
|
546
551
|
});
|
|
547
552
|
var parseResourceUrl = (url) => {
|
|
548
|
-
const [error, parsed] =
|
|
553
|
+
const [error, parsed] = catchError2(() => new URL(url));
|
|
549
554
|
if (error || !parsed)
|
|
550
555
|
return;
|
|
551
556
|
const segments = parsed.pathname.split("/").filter(Boolean);
|
|
@@ -565,7 +570,7 @@ var defaultLoadModule = async () => {
|
|
|
565
570
|
if (!hostLoader) {
|
|
566
571
|
return;
|
|
567
572
|
}
|
|
568
|
-
const [error, mod] = await
|
|
573
|
+
const [error, mod] = await catchError2(() => hostLoader());
|
|
569
574
|
if (error || !mod) {
|
|
570
575
|
return;
|
|
571
576
|
}
|
|
@@ -591,7 +596,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
591
596
|
const mod = await loadModule();
|
|
592
597
|
if (!mod)
|
|
593
598
|
return;
|
|
594
|
-
const [ctorError, proxy] =
|
|
599
|
+
const [ctorError, proxy] = catchError2(() => new mod.RobotProxyConstructor);
|
|
595
600
|
if (ctorError || !proxy) {
|
|
596
601
|
return;
|
|
597
602
|
}
|
|
@@ -614,7 +619,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
614
619
|
let organizationIdFromToken;
|
|
615
620
|
let tenantIdFromToken;
|
|
616
621
|
let issuerFromToken;
|
|
617
|
-
const [jwtError, claims] =
|
|
622
|
+
const [jwtError, claims] = catchError2(() => parseJWT(accessToken));
|
|
618
623
|
if (!jwtError && claims) {
|
|
619
624
|
const rawOrgId = claims.prtId ?? claims.organizationId ?? claims.prt_id;
|
|
620
625
|
if (typeof rawOrgId === "string" && rawOrgId.length > 0) {
|
|
@@ -641,7 +646,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
641
646
|
} catch {
|
|
642
647
|
return;
|
|
643
648
|
} finally {
|
|
644
|
-
await
|
|
649
|
+
await catchError2(() => withTimeout(proxy.CloseAsync(), CLOSE_TIMEOUT_MS));
|
|
645
650
|
}
|
|
646
651
|
};
|
|
647
652
|
|
|
@@ -672,7 +677,7 @@ var fetchTenantsAndOrganizations = async (baseUrl, accessToken, organizationId,
|
|
|
672
677
|
const message = `Failed to get tenants and organizations: ${response.status} ${errorText}`;
|
|
673
678
|
throw new Error(IDENTIFIER_STATUSES.has(response.status) ? `${message}. ${organizationHint(organizationId)}` : message);
|
|
674
679
|
}
|
|
675
|
-
const [parseError, data] = await
|
|
680
|
+
const [parseError, data] = await catchError2(response.json());
|
|
676
681
|
if (parseError) {
|
|
677
682
|
throw new Error(describeNonJsonResponse(organizationId, response, parseError));
|
|
678
683
|
}
|
|
@@ -711,9 +716,12 @@ var refreshAccessToken = async ({
|
|
|
711
716
|
body: tokenParams
|
|
712
717
|
});
|
|
713
718
|
const tokenData = await tokenResponse.json();
|
|
714
|
-
if (
|
|
719
|
+
if (tokenResponse.status === 400 || tokenResponse.status === 401) {
|
|
715
720
|
throw new TokenRefreshOAuthError;
|
|
716
721
|
}
|
|
722
|
+
if (!tokenResponse.ok) {
|
|
723
|
+
throw new Error(`Token refresh failed: HTTP ${tokenResponse.status}`);
|
|
724
|
+
}
|
|
717
725
|
const newAccessToken = tokenData.access_token;
|
|
718
726
|
const newRefreshToken = tokenData.refresh_token;
|
|
719
727
|
if (typeof newAccessToken !== "string" || typeof newRefreshToken !== "string") {
|
|
@@ -776,20 +784,20 @@ var probeAsync = async (fs, candidate) => {
|
|
|
776
784
|
var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) => {
|
|
777
785
|
const fs = getFileSystem();
|
|
778
786
|
if (fs.path.isAbsolute(envFilePath)) {
|
|
779
|
-
const
|
|
780
|
-
return
|
|
787
|
+
const probe = await probeAsync(fs, envFilePath);
|
|
788
|
+
return probe.exists ? { exists: true, absolutePath: envFilePath, source: "absolute" } : {
|
|
781
789
|
exists: false,
|
|
782
790
|
absolutePath: envFilePath,
|
|
783
791
|
source: "absolute",
|
|
784
|
-
...
|
|
792
|
+
...probe.unusable ? { unusable: probe.unusable } : {}
|
|
785
793
|
};
|
|
786
794
|
}
|
|
787
795
|
const cwd = opts?.cwd ?? fs.env.cwd();
|
|
788
796
|
let searchDir = cwd;
|
|
789
797
|
while (true) {
|
|
790
798
|
const candidate = fs.path.join(searchDir, envFilePath);
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
799
|
+
const probe = await probeAsync(fs, candidate);
|
|
800
|
+
if (probe.exists) {
|
|
793
801
|
return {
|
|
794
802
|
exists: true,
|
|
795
803
|
absolutePath: candidate,
|
|
@@ -1157,7 +1165,7 @@ async function resolveRobotTenantId(robotCreds, deps) {
|
|
|
1157
1165
|
const key = `${baseUrl}|${organization}|${tenantName}|${accessToken}`;
|
|
1158
1166
|
let pending = deps.cache.get(key);
|
|
1159
1167
|
if (!pending) {
|
|
1160
|
-
pending =
|
|
1168
|
+
pending = catchError2(lookupRobotTenantId({ baseUrl, accessToken, organization, tenantName }, deps)).then(([error, resolution]) => {
|
|
1161
1169
|
const settled = error ? { hint: tenantLookupFailureHint(tenantName, error.message) } : resolution;
|
|
1162
1170
|
if (!settled.tenantId) {
|
|
1163
1171
|
deps.cache.delete(key);
|
|
@@ -1170,7 +1178,7 @@ async function resolveRobotTenantId(robotCreds, deps) {
|
|
|
1170
1178
|
}
|
|
1171
1179
|
async function lookupRobotTenantId(target, deps) {
|
|
1172
1180
|
const { baseUrl, accessToken, organization, tenantName } = target;
|
|
1173
|
-
const [error, data] = await
|
|
1181
|
+
const [error, data] = await catchError2(deps.fetchTenantsAndOrgs(baseUrl, accessToken, organization, AbortSignal.timeout(deps.lookupTimeoutMs)));
|
|
1174
1182
|
if (error) {
|
|
1175
1183
|
const reason = error.name === "TimeoutError" ? `the tenant list did not answer within ${deps.lookupTimeoutMs} ms.` : error.message;
|
|
1176
1184
|
return { hint: tenantLookupFailureHint(tenantName, reason) };
|
|
@@ -1192,7 +1200,7 @@ function tenantLookupFailureHint(tenantName, reason) {
|
|
|
1192
1200
|
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.`;
|
|
1193
1201
|
}
|
|
1194
1202
|
function decodePathSegment(segment) {
|
|
1195
|
-
const [error, decoded] =
|
|
1203
|
+
const [error, decoded] = catchError2(() => decodeURIComponent(segment));
|
|
1196
1204
|
return error ? segment : decoded;
|
|
1197
1205
|
}
|
|
1198
1206
|
var isFileNotFoundError = (error) => {
|
|
@@ -1432,26 +1440,38 @@ function errorMessage(error) {
|
|
|
1432
1440
|
}
|
|
1433
1441
|
|
|
1434
1442
|
// ../auth/src/authContext.ts
|
|
1443
|
+
class AuthContextUnavailableError extends Error {
|
|
1444
|
+
instructionContext;
|
|
1445
|
+
sessionHint;
|
|
1446
|
+
errorCode = "authentication_required";
|
|
1447
|
+
retry = "RetryWillNotFix";
|
|
1448
|
+
constructor(message, instructionContext = "auth", sessionHint) {
|
|
1449
|
+
super(message);
|
|
1450
|
+
this.instructionContext = instructionContext;
|
|
1451
|
+
this.sessionHint = sessionHint;
|
|
1452
|
+
this.name = "AuthContextUnavailableError";
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1435
1455
|
var getAuthContext = async (options = {}) => {
|
|
1436
1456
|
const status = await getLoginStatusAsync({
|
|
1437
1457
|
ensureTokenValidityMinutes: options.ensureTokenValidityMinutes,
|
|
1438
1458
|
envFilePath: options.envFilePath
|
|
1439
1459
|
});
|
|
1440
1460
|
if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
|
|
1441
|
-
throw new
|
|
1461
|
+
throw new AuthContextUnavailableError(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.", "auth", status.hint);
|
|
1442
1462
|
}
|
|
1443
|
-
const tenantName = options.tenant
|
|
1463
|
+
const tenantName = options.tenant || status.tenantName;
|
|
1444
1464
|
if (options.requireOrganizationId && !status.organizationId) {
|
|
1445
|
-
throw new
|
|
1465
|
+
throw new AuthContextUnavailableError("Organization ID not available. Ensure you are logged in with an organization context.", "identity");
|
|
1446
1466
|
}
|
|
1447
1467
|
if (options.requireOrganizationName && !status.organizationName) {
|
|
1448
|
-
throw new
|
|
1468
|
+
throw new AuthContextUnavailableError("Organization name not available. Ensure you are logged in with an organization context.", "identity");
|
|
1449
1469
|
}
|
|
1450
1470
|
if (options.requireTenantId && !status.tenantId) {
|
|
1451
|
-
throw new
|
|
1471
|
+
throw new AuthContextUnavailableError(`Tenant ID not available. Ensure UIPATH_TENANT_ID is set.${status.hint ? ` ${status.hint}` : ""}`, "identity", status.hint);
|
|
1452
1472
|
}
|
|
1453
|
-
if (options.requireTenantName && tenantName
|
|
1454
|
-
throw new
|
|
1473
|
+
if (options.requireTenantName && !tenantName) {
|
|
1474
|
+
throw new AuthContextUnavailableError("Tenant not provided and UIPATH_TENANT_NAME not set. Run 'uip login' to select a tenant, or use 'uip login tenant set <tenant>' to switch tenants.", "identity");
|
|
1455
1475
|
}
|
|
1456
1476
|
return {
|
|
1457
1477
|
baseUrl: status.baseUrl,
|
|
@@ -2884,7 +2904,7 @@ var package_default = {
|
|
|
2884
2904
|
name: "@uipath/orchestrator-sdk",
|
|
2885
2905
|
author: "UiPath",
|
|
2886
2906
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2887
|
-
version: "1.
|
|
2907
|
+
version: "1.206.0",
|
|
2888
2908
|
repository: {
|
|
2889
2909
|
type: "git",
|
|
2890
2910
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -2911,6 +2931,10 @@ var package_default = {
|
|
|
2911
2931
|
types: "./dist/src/index.d.ts",
|
|
2912
2932
|
default: "./dist/index.js"
|
|
2913
2933
|
}
|
|
2934
|
+
},
|
|
2935
|
+
"./folder-feed": {
|
|
2936
|
+
types: "./dist/src/folder-feed.d.ts",
|
|
2937
|
+
default: "./dist/folder-feed.js"
|
|
2914
2938
|
}
|
|
2915
2939
|
},
|
|
2916
2940
|
files: [
|
|
@@ -2918,11 +2942,12 @@ var package_default = {
|
|
|
2918
2942
|
],
|
|
2919
2943
|
private: true,
|
|
2920
2944
|
scripts: {
|
|
2921
|
-
build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && bun build ./src/index.browser.ts --outdir dist --format esm --target browser --external @uipath/auth --external @uipath/common --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
2945
|
+
build: "bun build ./src/index.ts ./src/folder-feed.ts --outdir dist --format esm --target node --sourcemap=linked && bun build ./src/index.browser.ts --outdir dist --format esm --target browser --external @uipath/auth --external @uipath/common --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
2922
2946
|
generate: "bun run src/scripts/generate-sdk.ts",
|
|
2923
2947
|
lint: "biome check .",
|
|
2924
2948
|
test: "vitest run",
|
|
2925
|
-
"test:coverage": "vitest run --coverage"
|
|
2949
|
+
"test:coverage": "vitest run --coverage",
|
|
2950
|
+
typecheck: "tsc --noEmit"
|
|
2926
2951
|
},
|
|
2927
2952
|
devDependencies: {
|
|
2928
2953
|
"@uipath/auth": "workspace:*",
|
|
@@ -3490,7 +3515,7 @@ async function resolveFolder(input, options) {
|
|
|
3490
3515
|
}
|
|
3491
3516
|
return resolveByKey(foldersApi, input.folderKey);
|
|
3492
3517
|
}
|
|
3493
|
-
return resolveByPath(foldersApi, input.folderPath);
|
|
3518
|
+
return resolveByPath(config, foldersApi, input.folderPath);
|
|
3494
3519
|
}
|
|
3495
3520
|
async function resolveByKey(foldersApi, folderKey) {
|
|
3496
3521
|
const folder = await foldersApi.foldersGetByKeyByIdentifier({
|
|
@@ -3507,12 +3532,12 @@ async function resolveByKey(foldersApi, folderKey) {
|
|
|
3507
3532
|
feedType: folder.feedType
|
|
3508
3533
|
};
|
|
3509
3534
|
}
|
|
3510
|
-
async function resolveByPath(foldersApi, folderPath) {
|
|
3535
|
+
async function resolveByPath(config, foldersApi, folderPath) {
|
|
3511
3536
|
const response = await foldersApi.foldersGet({
|
|
3512
3537
|
$filter: `FullyQualifiedName eq '${folderPath.replace(/'/g, "''")}'`,
|
|
3513
3538
|
$top: 1
|
|
3514
3539
|
});
|
|
3515
|
-
const folder = response.value?.[0];
|
|
3540
|
+
const folder = response.value?.[0] ?? await resolveInPersonalWorkspace(config, foldersApi, folderPath);
|
|
3516
3541
|
if (!folder?.id || !folder.key || !folder.fullyQualifiedName || !folder.displayName) {
|
|
3517
3542
|
throw new Error(`Folder not found: '${folderPath}'.`);
|
|
3518
3543
|
}
|
|
@@ -3524,6 +3549,66 @@ async function resolveByPath(foldersApi, folderPath) {
|
|
|
3524
3549
|
feedType: folder.feedType
|
|
3525
3550
|
};
|
|
3526
3551
|
}
|
|
3552
|
+
var CURRENT_USER_FOLDER_PAGE_SIZE = 1000;
|
|
3553
|
+
var CURRENT_USER_FOLDER_PAGE_LIMIT = 50;
|
|
3554
|
+
async function resolveInPersonalWorkspace(config, foldersApi, folderPath) {
|
|
3555
|
+
const workspace = await lookupOrMiss("GetPersonalWorkspace", folderPath, () => new PersonalWorkspacesApi(config).personalWorkspacesGetPersonalWorkspace());
|
|
3556
|
+
if (!workspace?.key || !workspace.name) {
|
|
3557
|
+
return;
|
|
3558
|
+
}
|
|
3559
|
+
const wanted = folderPath.toLowerCase();
|
|
3560
|
+
const root = workspace.name.toLowerCase();
|
|
3561
|
+
let key;
|
|
3562
|
+
if (wanted === root) {
|
|
3563
|
+
key = workspace.key;
|
|
3564
|
+
} else if (wanted.startsWith(`${root}/`)) {
|
|
3565
|
+
key = await findKeyInCurrentUserFolders(foldersApi, folderPath);
|
|
3566
|
+
}
|
|
3567
|
+
if (!key) {
|
|
3568
|
+
return;
|
|
3569
|
+
}
|
|
3570
|
+
const folder = await foldersApi.foldersGetByKeyByIdentifier({
|
|
3571
|
+
identifier: key
|
|
3572
|
+
});
|
|
3573
|
+
return folder?.fullyQualifiedName?.toLowerCase() === wanted ? folder : undefined;
|
|
3574
|
+
}
|
|
3575
|
+
async function findKeyInCurrentUserFolders(foldersApi, folderPath) {
|
|
3576
|
+
const wanted = folderPath.toLowerCase();
|
|
3577
|
+
let skip = 0;
|
|
3578
|
+
for (let page = 0;page < CURRENT_USER_FOLDER_PAGE_LIMIT; page++) {
|
|
3579
|
+
const result = await lookupOrMiss("GetAllForCurrentUser", folderPath, () => foldersApi.foldersGetAllForCurrentUser({
|
|
3580
|
+
take: CURRENT_USER_FOLDER_PAGE_SIZE,
|
|
3581
|
+
skip
|
|
3582
|
+
}));
|
|
3583
|
+
const rows = result?.pageItems ?? [];
|
|
3584
|
+
const match = rows.find((row) => row.fullyQualifiedName?.toLowerCase() === wanted);
|
|
3585
|
+
if (match) {
|
|
3586
|
+
return match.key;
|
|
3587
|
+
}
|
|
3588
|
+
skip += rows.length;
|
|
3589
|
+
if (rows.length === 0 || typeof result?.count === "number" && skip >= result.count) {
|
|
3590
|
+
return;
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
logger.debug(`GetAllForCurrentUser: stopped after ${CURRENT_USER_FOLDER_PAGE_LIMIT} pages without finding '${folderPath}'.`);
|
|
3594
|
+
return;
|
|
3595
|
+
}
|
|
3596
|
+
async function lookupOrMiss(endpoint, folderPath, call) {
|
|
3597
|
+
const [error, value] = await catchError(call());
|
|
3598
|
+
if (!error) {
|
|
3599
|
+
return value;
|
|
3600
|
+
}
|
|
3601
|
+
if (!isLookupMiss(error)) {
|
|
3602
|
+
throw error;
|
|
3603
|
+
}
|
|
3604
|
+
logger.debug(`${endpoint} lookup for '${folderPath}' failed: ${await extractErrorMessage(error)}`);
|
|
3605
|
+
return;
|
|
3606
|
+
}
|
|
3607
|
+
function isLookupMiss(error) {
|
|
3608
|
+
const failure = error;
|
|
3609
|
+
const status = failure?.response?.status ?? failure?.status;
|
|
3610
|
+
return typeof status === "number" && status >= 400 && status < 500 && status !== 408 && status !== 429;
|
|
3611
|
+
}
|
|
3527
3612
|
|
|
3528
3613
|
// ../orchestrator-sdk/src/odata.ts
|
|
3529
3614
|
var ODATA_STRING_LITERAL_PATTERN = /^'(?:[^']|'')*'$/;
|
|
@@ -3758,4 +3843,4 @@ var KB_INLINE_LIMITS = {
|
|
|
3758
3843
|
};
|
|
3759
3844
|
export { getLoginStatusAsync, getAuthContext, BusinessRulesApi, PersonalWorkspacesApi, UsersApi, createApiClient, resolveFolder, quoteODataStringLiteral };
|
|
3760
3845
|
|
|
3761
|
-
//# debugId=
|
|
3846
|
+
//# debugId=FCF55219427BCDC464756E2164756E21
|
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
return cached;
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
22
|
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
23
|
for (let key of __getOwnPropNames(mod))
|
|
24
24
|
if (!__hasOwnProp.call(to, key))
|
|
@@ -32,8 +32,17 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
32
32
|
return to;
|
|
33
33
|
};
|
|
34
34
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
+
var __exportCjs = (target, getters, setters) => {
|
|
36
|
+
for (var name in getters)
|
|
37
|
+
__defProp(target, name, {
|
|
38
|
+
get: getters[name],
|
|
39
|
+
set: setters[name],
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
};
|
|
35
44
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
36
45
|
|
|
37
|
-
export { __toESM, __commonJS, __require };
|
|
46
|
+
export { __toESM, __commonJS, __exportCjs, __require };
|
|
38
47
|
|
|
39
|
-
//# debugId=
|
|
48
|
+
//# debugId=6692E9B4C735B07364756E2164756E21
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./tool-
|
|
2
|
+
getFileSystem,
|
|
3
|
+
catchError
|
|
4
|
+
} from "./tool-cs8nyk0r.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./tool-
|
|
9
|
-
import {
|
|
10
|
-
__require
|
|
11
|
-
} from "./tool-1de529jm.js";
|
|
6
|
+
RulesCommandError2,
|
|
7
|
+
isJsonObject2
|
|
8
|
+
} from "./tool-njnhj05q.js";
|
|
12
9
|
|
|
13
10
|
// ../packager/packager-tool-businessrules/src/entry-point-id.ts
|
|
14
11
|
var EntryPointIdSalt = "uipath:business-rules:entry-point";
|
|
@@ -51,7 +48,7 @@ async function readRuleProjectAsync(projectPath) {
|
|
|
51
48
|
contents: await fs.readFile(fs.path.join(projectDir, name), "utf-8") ?? ""
|
|
52
49
|
})));
|
|
53
50
|
if (dmnFiles.length === 0) {
|
|
54
|
-
throw new
|
|
51
|
+
throw new RulesCommandError2(`No .dmn file found in ${projectDir}.`, "not_found", "Add the rule's .dmn file at the top level of the project, or run 'uip rules init <name>' to scaffold one.");
|
|
55
52
|
}
|
|
56
53
|
return {
|
|
57
54
|
projectDir,
|
|
@@ -61,7 +58,7 @@ async function readRuleProjectAsync(projectPath) {
|
|
|
61
58
|
};
|
|
62
59
|
}
|
|
63
60
|
async function buildRuleEntryPointsAsync(dmnFiles, publishedEntryPoints, ruleName) {
|
|
64
|
-
const { buildBusinessRulePackagingFiles } = await import("./index-
|
|
61
|
+
const { buildBusinessRulePackagingFiles } = await import("./index-zeszs1ra.js");
|
|
65
62
|
const packaging = await buildBusinessRulePackagingFiles(dmnFiles, publishedEntryPoints, true);
|
|
66
63
|
if (publishedEntryPoints != null || ruleName === undefined) {
|
|
67
64
|
return packaging;
|
|
@@ -81,10 +78,10 @@ async function readRulesProjectNameAsync(projectDir) {
|
|
|
81
78
|
const raw = await fs.readFile(filePath, "utf-8");
|
|
82
79
|
const project = raw === null ? undefined : parseJson(raw);
|
|
83
80
|
if (raw !== null && project === undefined) {
|
|
84
|
-
throw new
|
|
81
|
+
throw new RulesCommandError2(`Could not read ${filePath}: it is not valid JSON.`, "invalid_argument", "Fix the project file, or run 'uip rules init <name> --force' to recreate it.");
|
|
85
82
|
}
|
|
86
|
-
if (!
|
|
87
|
-
throw new
|
|
83
|
+
if (!isJsonObject2(project) || project.ProjectType !== "BusinessRules") {
|
|
84
|
+
throw new RulesCommandError2(`${projectDir} is not a business rules project.`, "invalid_argument", "Pass the folder that holds the rules project's project.uiproj, created by 'uip rules init'.");
|
|
88
85
|
}
|
|
89
86
|
return typeof project.Name === "string" ? project.Name : "";
|
|
90
87
|
}
|
|
@@ -96,8 +93,8 @@ async function readPublishedEntryPoints(projectDir) {
|
|
|
96
93
|
return;
|
|
97
94
|
}
|
|
98
95
|
const published = parseJson(raw);
|
|
99
|
-
if (!
|
|
100
|
-
throw new
|
|
96
|
+
if (!isJsonObject2(published) || !Array.isArray(published.entryPoints)) {
|
|
97
|
+
throw new RulesCommandError2(`${filePath} is not an entry-points document: it needs an "entryPoints" array.`, "invalid_argument", `Fix or delete ${ENTRY_POINTS_FILE}; deleting it gives every entry point a new uniqueId, which breaks the consumers bound to the old ones.`);
|
|
101
98
|
}
|
|
102
99
|
return published;
|
|
103
100
|
}
|
|
@@ -108,4 +105,4 @@ function parseJson(raw) {
|
|
|
108
105
|
|
|
109
106
|
export { ENTRY_POINTS_FILE, BINDINGS_FILE, readRuleProjectAsync, buildRuleEntryPointsAsync, readRulesProjectNameAsync };
|
|
110
107
|
|
|
111
|
-
//# debugId=
|
|
108
|
+
//# debugId=3C93FC778F7ABEA064756E2164756E21
|