@uipath/agent-tool 1.200.0-preview.120 → 1.201.0-preview.121
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/{agent-project-service-j3sst5cf.js → agent-project-service-j4pgc7gk.js} +3 -3
- package/dist/agent-tool-OK5DK57D-mxt5stp9.js +12 -0
- package/dist/{browser-strategy-v4n9zxyf.js → browser-strategy-16yagjhr.js} +1 -1
- package/dist/{de-LVBY3VVG-tc58p3x6.js → de-WMKOGI7B-r1821wpe.js} +16 -7
- package/dist/{en-4UFXRW7N-mqabr9tf.js → en-X4DLPKLJ-dt1wtdm7.js} +17 -5
- package/dist/{es-CI4AE5B5-55sgqk64.js → es-BVPGJUWA-9gk2g9yb.js} +16 -7
- package/dist/{es-MX-OLZNAYY5-30cmv1dx.js → es-MX-U6YL5KQX-ynwxdjr8.js} +16 -7
- package/dist/executor-tool.js +297 -0
- package/dist/{fr-CCN6ZO5E-x2akzsjt.js → fr-EKTTDR7Z-bmpwp31r.js} +16 -7
- package/dist/index-26bymy67.js +17359 -0
- package/dist/index-9f8q2ege.js +2058 -0
- package/dist/{index-b13x0rpx.js → index-byw2z4xp.js} +12 -9
- package/dist/{index-m7vpyg6b.js → index-f97359cb.js} +5 -5
- package/dist/{packager-tool-mf36zc9b.js → index-hsadteg4.js} +41 -253
- package/dist/{index-w23k88b5.js → index-p50kx6jv.js} +202 -64
- package/dist/{index-08fsnqg0.js → index-rqfxg3fq.js} +1 -1
- package/dist/index.js +15 -12
- package/dist/{integration-tool-service-z414k85p.js → integration-tool-service-n214kzdn.js} +4 -4
- package/dist/{is-client-y2fkfgb9.js → is-client-9b6sp9ag.js} +3 -3
- package/dist/{ja-O2NEV5D6-nt9rhd8c.js → ja-Y2YBTXNN-96cvy5av.js} +16 -7
- package/dist/js-yaml-cggj6w7q.js +3145 -0
- package/dist/{ko-7XWV2SEQ-chk3y7aj.js → ko-S33XAV26-cxf4dn2t.js} +16 -7
- package/dist/{packager-tool-jmzese1s.js → node-strategy-1r3qegaf.js} +62 -32
- package/dist/{packager-tool-973f0r2g.js → packager-tool-1yy9x4vk.js} +17 -5
- package/dist/packager-tool-4fge2k9c.js +419 -0
- package/dist/{packager-tool-yet9qmnt.js → packager-tool-5xdkh3vm.js} +110 -24
- package/dist/{packager-tool-9tv93r4w.js → packager-tool-b098y4a2.js} +2 -418
- package/dist/packager-tool-bpegrcj1.js +5336 -0
- package/dist/{packager-tool-dcazs5r7.js → packager-tool-expj850v.js} +6 -4
- package/dist/packager-tool-fhrpdder.js +4492 -0
- package/dist/{packager-tool-99cr74s9.js → packager-tool-fpj7v9y3.js} +7 -7
- package/dist/{packager-tool-k52eeaqa.js → packager-tool-ggg5bx2h.js} +42767 -28246
- package/dist/{packager-tool-wfbw3w4y.js → packager-tool-gkvdytpj.js} +282 -5275
- package/dist/{packager-tool-1snc64g4.js → packager-tool-q42rrs00.js} +3 -2
- package/dist/packager-tool-qa9gftnj.js +31 -0
- package/dist/{packager-tool-fzq5y98q.js → packager-tool-wzknj3dr.js} +2 -2
- package/dist/packager-tool-yv3rvyas.js +239 -0
- package/dist/packager-tool.js +5 -4
- package/dist/{pt-BR-Z4J3LEEO-cf33d2zv.js → pt-BR-JO45SCNI-4kbfnzc4.js} +16 -7
- package/dist/{pt-CRSN3TCU-txxbbcxm.js → pt-W3NA4LIZ-f02gapvs.js} +16 -7
- package/dist/{ro-WMQEVD7D-6mtq0e6b.js → ro-WLKX6HF5-fcbe2zz8.js} +16 -7
- package/dist/tool.js +15 -12
- package/dist/{tr-UCMB7W3T-xmxp2naq.js → tr-3U2W2XCA-zg3zcmq3.js} +15 -6
- package/dist/{zh-CN-2QOHEFC5-ryjb2byk.js → zh-CN-IPZYQR3P-1h76csc4.js} +16 -7
- package/dist/{zh-TW-Q5QSSTS6-6y7yjbbn.js → zh-TW-YPVSQVGT-wbybwpwt.js} +16 -7
- package/package.json +4 -3
- package/dist/agent-tool-OK5DK57D-8nt05j7t.js +0 -11
- package/dist/node-strategy-cvesesna.js +0 -65
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
AUTH_FLOW_ENV_VAR,
|
|
3
3
|
AuthProfileValidationError,
|
|
4
4
|
ClientCredentialsAuthenticationError,
|
|
5
|
+
CredentialSource,
|
|
5
6
|
DEFAULT_AUTH_FILENAME,
|
|
6
7
|
DEFAULT_AUTH_PROFILE,
|
|
7
8
|
DEFAULT_ENV_FILENAME,
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
InvalidBaseUrlError,
|
|
15
16
|
InvalidTenantError,
|
|
16
17
|
JWT_BEARER_ASSERTION_TYPE,
|
|
17
|
-
LoginStatusSource,
|
|
18
18
|
TENANT_SELECTION_REQUIRED_CODE,
|
|
19
19
|
TenantSelectionError,
|
|
20
20
|
TenantSelectionRequiredError,
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
logout,
|
|
43
43
|
logoutWithDeps,
|
|
44
44
|
normalizeAuthProfileName,
|
|
45
|
+
parseAuthFlow,
|
|
45
46
|
parseJWT,
|
|
46
47
|
readAuthFromEnv,
|
|
47
48
|
refreshAccessToken,
|
|
@@ -50,25 +51,25 @@ import {
|
|
|
50
51
|
resolveAuthProfileFilePath,
|
|
51
52
|
resolveEnvFileLocationAsync,
|
|
52
53
|
resolveEnvFilePathAsync,
|
|
54
|
+
resolveSessionIdentity,
|
|
53
55
|
runWithAuthProfile,
|
|
54
56
|
saveEnvFileAsync,
|
|
55
57
|
saveRefreshBreaker,
|
|
56
58
|
selectTenantWithDeps,
|
|
57
59
|
setActiveAuthProfile,
|
|
58
60
|
setAuthFileConfig
|
|
59
|
-
} from "./packager-tool-
|
|
61
|
+
} from "./packager-tool-5xdkh3vm.js";
|
|
60
62
|
import {
|
|
61
63
|
isBrowser,
|
|
62
64
|
isNode
|
|
63
65
|
} from "./packager-tool-0gctz400.js";
|
|
64
|
-
import
|
|
65
|
-
|
|
66
|
-
} from "./packager-tool-jmzese1s.js";
|
|
67
|
-
import"./packager-tool-mf36zc9b.js";
|
|
66
|
+
import"./packager-tool-qa9gftnj.js";
|
|
67
|
+
import"./packager-tool-yv3rvyas.js";
|
|
68
68
|
import {
|
|
69
69
|
AUTH_CANCELLED_ERROR_CODE,
|
|
70
|
+
AUTH_TIMEOUT_ERROR_CODE,
|
|
70
71
|
DEFAULT_AUTH_TIMEOUT_MS
|
|
71
|
-
} from "./packager-tool-
|
|
72
|
+
} from "./packager-tool-q42rrs00.js";
|
|
72
73
|
import"./packager-tool-wckvcay0.js";
|
|
73
74
|
export {
|
|
74
75
|
setAuthFileConfig,
|
|
@@ -77,6 +78,7 @@ export {
|
|
|
77
78
|
saveRefreshBreaker,
|
|
78
79
|
saveEnvFileAsync,
|
|
79
80
|
runWithAuthProfile,
|
|
81
|
+
resolveSessionIdentity,
|
|
80
82
|
resolveEnvFilePathAsync,
|
|
81
83
|
resolveEnvFileLocationAsync,
|
|
82
84
|
resolveAuthProfileFilePath,
|
|
@@ -85,6 +87,7 @@ export {
|
|
|
85
87
|
refreshAccessToken,
|
|
86
88
|
readAuthFromEnv,
|
|
87
89
|
parseJWT,
|
|
90
|
+
parseAuthFlow,
|
|
88
91
|
normalizeAuthProfileName,
|
|
89
92
|
logoutWithDeps,
|
|
90
93
|
logout,
|
|
@@ -114,7 +117,6 @@ export {
|
|
|
114
117
|
TenantSelectionRequiredError,
|
|
115
118
|
TenantSelectionError,
|
|
116
119
|
TENANT_SELECTION_REQUIRED_CODE,
|
|
117
|
-
LoginStatusSource,
|
|
118
120
|
JWT_BEARER_ASSERTION_TYPE,
|
|
119
121
|
InvalidTenantError,
|
|
120
122
|
InvalidBaseUrlError,
|
|
@@ -128,6 +130,7 @@ export {
|
|
|
128
130
|
DEFAULT_AUTH_TIMEOUT_MS,
|
|
129
131
|
DEFAULT_AUTH_PROFILE,
|
|
130
132
|
DEFAULT_AUTH_FILENAME,
|
|
133
|
+
CredentialSource,
|
|
131
134
|
ClientCredentialsAuthenticationError,
|
|
132
135
|
AuthProfileValidationError,
|
|
133
136
|
AUTH_TIMEOUT_ERROR_CODE,
|
|
@@ -135,4 +138,4 @@ export {
|
|
|
135
138
|
AUTH_CANCELLED_ERROR_CODE
|
|
136
139
|
};
|
|
137
140
|
|
|
138
|
-
//# debugId=
|
|
141
|
+
//# debugId=33F3EC28BA86732264756E2164756E21
|
|
@@ -1459,13 +1459,13 @@ import {
|
|
|
1459
1459
|
validateRequiredEventParameters,
|
|
1460
1460
|
validateRequiredFields,
|
|
1461
1461
|
validateRequiredParameters
|
|
1462
|
-
} from "./packager-tool-
|
|
1463
|
-
import"./packager-tool-
|
|
1462
|
+
} from "./packager-tool-fpj7v9y3.js";
|
|
1463
|
+
import"./packager-tool-5xdkh3vm.js";
|
|
1464
1464
|
import"./packager-tool-nsrs2tm5.js";
|
|
1465
1465
|
import"./packager-tool-0gctz400.js";
|
|
1466
|
-
import"./packager-tool-
|
|
1467
|
-
import"./packager-tool-
|
|
1468
|
-
import"./packager-tool-
|
|
1466
|
+
import"./packager-tool-qa9gftnj.js";
|
|
1467
|
+
import"./packager-tool-yv3rvyas.js";
|
|
1468
|
+
import"./packager-tool-q42rrs00.js";
|
|
1469
1469
|
import"./packager-tool-wckvcay0.js";
|
|
1470
1470
|
export {
|
|
1471
1471
|
validateRequiredParameters,
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import * as fs6 from "node:fs/promises";
|
|
5
|
-
import * as os2 from "node:os";
|
|
6
|
-
import * as path2 from "node:path";
|
|
1
|
+
import"./packager-tool-wckvcay0.js";
|
|
7
2
|
|
|
8
3
|
// ../../node_modules/open/index.js
|
|
9
|
-
import
|
|
4
|
+
import process7 from "node:process";
|
|
10
5
|
import path from "node:path";
|
|
11
6
|
import { fileURLToPath } from "node:url";
|
|
12
7
|
import childProcess3 from "node:child_process";
|
|
@@ -18,7 +13,7 @@ import childProcess2 from "node:child_process";
|
|
|
18
13
|
import fs4, { constants as fsConstants } from "node:fs/promises";
|
|
19
14
|
|
|
20
15
|
// ../../node_modules/wsl-utils/node_modules/is-wsl/index.js
|
|
21
|
-
import
|
|
16
|
+
import process from "node:process";
|
|
22
17
|
import os from "node:os";
|
|
23
18
|
import fs3 from "node:fs";
|
|
24
19
|
|
|
@@ -69,7 +64,7 @@ function isInsideContainer() {
|
|
|
69
64
|
|
|
70
65
|
// ../../node_modules/wsl-utils/node_modules/is-wsl/index.js
|
|
71
66
|
var isWsl = () => {
|
|
72
|
-
if (
|
|
67
|
+
if (process.platform !== "linux") {
|
|
73
68
|
return false;
|
|
74
69
|
}
|
|
75
70
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
@@ -88,15 +83,15 @@ var isWsl = () => {
|
|
|
88
83
|
}
|
|
89
84
|
return false;
|
|
90
85
|
};
|
|
91
|
-
var is_wsl_default =
|
|
86
|
+
var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
92
87
|
|
|
93
88
|
// ../../node_modules/powershell-utils/index.js
|
|
94
|
-
import
|
|
89
|
+
import process2 from "node:process";
|
|
95
90
|
import { Buffer } from "node:buffer";
|
|
96
91
|
import { promisify } from "node:util";
|
|
97
92
|
import childProcess from "node:child_process";
|
|
98
93
|
var execFile = promisify(childProcess.execFile);
|
|
99
|
-
var powerShellPath = () => `${
|
|
94
|
+
var powerShellPath = () => `${process2.env.SYSTEMROOT || process2.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
100
95
|
var executePowerShell = async (command, options = {}) => {
|
|
101
96
|
const {
|
|
102
97
|
powerShellPath: psPath,
|
|
@@ -220,16 +215,16 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
220
215
|
|
|
221
216
|
// ../../node_modules/default-browser/index.js
|
|
222
217
|
import { promisify as promisify6 } from "node:util";
|
|
223
|
-
import
|
|
218
|
+
import process5 from "node:process";
|
|
224
219
|
import { execFile as execFile6 } from "node:child_process";
|
|
225
220
|
|
|
226
221
|
// ../../node_modules/default-browser-id/index.js
|
|
227
222
|
import { promisify as promisify3 } from "node:util";
|
|
228
|
-
import
|
|
223
|
+
import process3 from "node:process";
|
|
229
224
|
import { execFile as execFile3 } from "node:child_process";
|
|
230
225
|
var execFileAsync = promisify3(execFile3);
|
|
231
226
|
async function defaultBrowserId() {
|
|
232
|
-
if (
|
|
227
|
+
if (process3.platform !== "darwin") {
|
|
233
228
|
throw new Error("macOS only");
|
|
234
229
|
}
|
|
235
230
|
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
@@ -242,12 +237,12 @@ async function defaultBrowserId() {
|
|
|
242
237
|
}
|
|
243
238
|
|
|
244
239
|
// ../../node_modules/run-applescript/index.js
|
|
245
|
-
import
|
|
240
|
+
import process4 from "node:process";
|
|
246
241
|
import { promisify as promisify4 } from "node:util";
|
|
247
242
|
import { execFile as execFile4, execFileSync } from "node:child_process";
|
|
248
243
|
var execFileAsync2 = promisify4(execFile4);
|
|
249
244
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
250
|
-
if (
|
|
245
|
+
if (process4.platform !== "darwin") {
|
|
251
246
|
throw new Error("macOS only");
|
|
252
247
|
}
|
|
253
248
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
@@ -314,33 +309,33 @@ async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
|
314
309
|
var execFileAsync4 = promisify6(execFile6);
|
|
315
310
|
var titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
316
311
|
async function defaultBrowser2() {
|
|
317
|
-
if (
|
|
312
|
+
if (process5.platform === "darwin") {
|
|
318
313
|
const id = await defaultBrowserId();
|
|
319
314
|
const name = await bundleName(id);
|
|
320
315
|
return { name, id };
|
|
321
316
|
}
|
|
322
|
-
if (
|
|
317
|
+
if (process5.platform === "linux") {
|
|
323
318
|
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
324
319
|
const id = stdout.trim();
|
|
325
320
|
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
326
321
|
return { name, id };
|
|
327
322
|
}
|
|
328
|
-
if (
|
|
323
|
+
if (process5.platform === "win32") {
|
|
329
324
|
return defaultBrowser();
|
|
330
325
|
}
|
|
331
326
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
332
327
|
}
|
|
333
328
|
|
|
334
329
|
// ../../node_modules/is-in-ssh/index.js
|
|
335
|
-
import
|
|
336
|
-
var isInSsh = Boolean(
|
|
330
|
+
import process6 from "node:process";
|
|
331
|
+
var isInSsh = Boolean(process6.env.SSH_CONNECTION || process6.env.SSH_CLIENT || process6.env.SSH_TTY);
|
|
337
332
|
var is_in_ssh_default = isInSsh;
|
|
338
333
|
|
|
339
334
|
// ../../node_modules/open/index.js
|
|
340
335
|
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
341
336
|
var __dirname2 = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
342
337
|
var localXdgOpenPath = path.join(__dirname2, "xdg-open");
|
|
343
|
-
var { platform, arch } =
|
|
338
|
+
var { platform, arch } = process7;
|
|
344
339
|
var tryEachApp = async (apps, opener) => {
|
|
345
340
|
if (apps.length === 0) {
|
|
346
341
|
return;
|
|
@@ -489,7 +484,7 @@ var baseOpen = async (options) => {
|
|
|
489
484
|
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
490
485
|
exeLocalXdgOpen = true;
|
|
491
486
|
} catch {}
|
|
492
|
-
const useSystemXdgOpen =
|
|
487
|
+
const useSystemXdgOpen = process7.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
493
488
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
494
489
|
}
|
|
495
490
|
if (appArguments.length > 0) {
|
|
@@ -553,6 +548,22 @@ var open = (target, options) => {
|
|
|
553
548
|
target
|
|
554
549
|
});
|
|
555
550
|
};
|
|
551
|
+
var openApp = (name, options) => {
|
|
552
|
+
if (typeof name !== "string" && !Array.isArray(name)) {
|
|
553
|
+
throw new TypeError("Expected a valid `name`");
|
|
554
|
+
}
|
|
555
|
+
const { arguments: appArguments = [] } = options ?? {};
|
|
556
|
+
if (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {
|
|
557
|
+
throw new TypeError("Expected `appArguments` as Array type");
|
|
558
|
+
}
|
|
559
|
+
return baseOpen({
|
|
560
|
+
...options,
|
|
561
|
+
app: {
|
|
562
|
+
name,
|
|
563
|
+
arguments: appArguments
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
};
|
|
556
567
|
function detectArchBinary(binary) {
|
|
557
568
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
558
569
|
return binary;
|
|
@@ -614,233 +625,10 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
|
614
625
|
darwin: "Safari"
|
|
615
626
|
}));
|
|
616
627
|
var open_default = open;
|
|
628
|
+
export {
|
|
629
|
+
openApp,
|
|
630
|
+
open_default as default,
|
|
631
|
+
apps
|
|
632
|
+
};
|
|
617
633
|
|
|
618
|
-
|
|
619
|
-
var LOCK_HEARTBEAT_MS = 5000;
|
|
620
|
-
var LOCK_STALE_MS = 15000;
|
|
621
|
-
var LOCK_MAX_WAIT_MS = 20000;
|
|
622
|
-
var LOCK_MAX_HOLD_MS = 60000;
|
|
623
|
-
var LOCK_RETRY_MIN_MS = 100;
|
|
624
|
-
var LOCK_RETRY_JITTER_MS = 200;
|
|
625
|
-
|
|
626
|
-
class NodeFileSystem {
|
|
627
|
-
path = {
|
|
628
|
-
join: path2.join,
|
|
629
|
-
resolve: path2.resolve,
|
|
630
|
-
relative: path2.relative,
|
|
631
|
-
dirname: path2.dirname,
|
|
632
|
-
isAbsolute: path2.isAbsolute,
|
|
633
|
-
basename: path2.basename
|
|
634
|
-
};
|
|
635
|
-
env = {
|
|
636
|
-
cwd: process.cwd,
|
|
637
|
-
homedir: os2.homedir,
|
|
638
|
-
tmpdir: os2.tmpdir,
|
|
639
|
-
getenv: (key) => process.env[key]
|
|
640
|
-
};
|
|
641
|
-
utils = {
|
|
642
|
-
open: async (url) => {
|
|
643
|
-
await open_default(url);
|
|
644
|
-
}
|
|
645
|
-
};
|
|
646
|
-
async readFile(path3, options) {
|
|
647
|
-
try {
|
|
648
|
-
if (options) {
|
|
649
|
-
return await fs6.readFile(path3, "utf-8");
|
|
650
|
-
}
|
|
651
|
-
return await fs6.readFile(path3);
|
|
652
|
-
} catch (error) {
|
|
653
|
-
if (this.isEnoent(error))
|
|
654
|
-
return null;
|
|
655
|
-
throw error;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
async writeFile(filePath, data) {
|
|
659
|
-
const dir = path2.dirname(filePath);
|
|
660
|
-
if (dir) {
|
|
661
|
-
await fs6.mkdir(dir, { recursive: true });
|
|
662
|
-
}
|
|
663
|
-
await fs6.writeFile(filePath, data);
|
|
664
|
-
}
|
|
665
|
-
async appendFile(filePath, data) {
|
|
666
|
-
const dir = path2.dirname(filePath);
|
|
667
|
-
if (dir) {
|
|
668
|
-
await fs6.mkdir(dir, { recursive: true });
|
|
669
|
-
}
|
|
670
|
-
await fs6.appendFile(filePath, data);
|
|
671
|
-
}
|
|
672
|
-
async readdir(dirPath) {
|
|
673
|
-
try {
|
|
674
|
-
return await fs6.readdir(dirPath);
|
|
675
|
-
} catch (error) {
|
|
676
|
-
if (this.isEnoent(error))
|
|
677
|
-
return [];
|
|
678
|
-
throw error;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
async stat(filePath) {
|
|
682
|
-
try {
|
|
683
|
-
const stats = await fs6.stat(filePath);
|
|
684
|
-
return {
|
|
685
|
-
isFile: () => stats.isFile(),
|
|
686
|
-
isDirectory: () => stats.isDirectory(),
|
|
687
|
-
size: stats.size,
|
|
688
|
-
mtimeMs: stats.mtimeMs
|
|
689
|
-
};
|
|
690
|
-
} catch (error) {
|
|
691
|
-
if (this.isEnoent(error))
|
|
692
|
-
return null;
|
|
693
|
-
throw error;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
async exists(filePath) {
|
|
697
|
-
return existsSync(filePath);
|
|
698
|
-
}
|
|
699
|
-
async mkdir(dirPath) {
|
|
700
|
-
await fs6.mkdir(dirPath, { recursive: true });
|
|
701
|
-
}
|
|
702
|
-
async acquireLock(lockPath) {
|
|
703
|
-
const canonicalPath = await this.canonicalizeLockTarget(lockPath);
|
|
704
|
-
const lockFile = `${canonicalPath}.lock`;
|
|
705
|
-
const ownerId = randomUUID();
|
|
706
|
-
const start = Date.now();
|
|
707
|
-
while (true) {
|
|
708
|
-
try {
|
|
709
|
-
await fs6.writeFile(lockFile, ownerId, { flag: "wx" });
|
|
710
|
-
return this.createLockRelease(lockFile, ownerId);
|
|
711
|
-
} catch (error) {
|
|
712
|
-
if (!this.hasErrnoCode(error, "EEXIST")) {
|
|
713
|
-
throw error;
|
|
714
|
-
}
|
|
715
|
-
const stats = await fs6.stat(lockFile).catch(() => null);
|
|
716
|
-
if (stats && Date.now() - stats.mtimeMs > LOCK_STALE_MS) {
|
|
717
|
-
const reclaimed = await fs6.rm(lockFile, { force: true }).then(() => true).catch(() => false);
|
|
718
|
-
if (reclaimed)
|
|
719
|
-
continue;
|
|
720
|
-
}
|
|
721
|
-
if (Date.now() - start > LOCK_MAX_WAIT_MS) {
|
|
722
|
-
throw new Error(`ELOCKED: timed out waiting for lock on ${canonicalPath}`);
|
|
723
|
-
}
|
|
724
|
-
await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MIN_MS + Math.random() * LOCK_RETRY_JITTER_MS));
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
async canonicalizeLockTarget(lockPath) {
|
|
729
|
-
const absolute = path2.resolve(lockPath);
|
|
730
|
-
const fullReal = await fs6.realpath(absolute).catch(() => null);
|
|
731
|
-
if (fullReal)
|
|
732
|
-
return fullReal;
|
|
733
|
-
const parent = path2.dirname(absolute);
|
|
734
|
-
const base = path2.basename(absolute);
|
|
735
|
-
const canonicalParent = await fs6.realpath(parent).catch(() => parent);
|
|
736
|
-
return path2.join(canonicalParent, base);
|
|
737
|
-
}
|
|
738
|
-
createLockRelease(lockFile, ownerId) {
|
|
739
|
-
const heartbeatStart = Date.now();
|
|
740
|
-
let heartbeatTimer;
|
|
741
|
-
let stopped = false;
|
|
742
|
-
const stopHeartbeat = () => {
|
|
743
|
-
stopped = true;
|
|
744
|
-
if (heartbeatTimer)
|
|
745
|
-
clearTimeout(heartbeatTimer);
|
|
746
|
-
};
|
|
747
|
-
const scheduleNextHeartbeat = () => {
|
|
748
|
-
if (stopped)
|
|
749
|
-
return;
|
|
750
|
-
if (Date.now() - heartbeatStart >= LOCK_MAX_HOLD_MS) {
|
|
751
|
-
stopped = true;
|
|
752
|
-
return;
|
|
753
|
-
}
|
|
754
|
-
heartbeatTimer = setTimeout(() => {
|
|
755
|
-
runHeartbeat();
|
|
756
|
-
}, LOCK_HEARTBEAT_MS);
|
|
757
|
-
heartbeatTimer.unref?.();
|
|
758
|
-
};
|
|
759
|
-
const runHeartbeat = async () => {
|
|
760
|
-
if (stopped)
|
|
761
|
-
return;
|
|
762
|
-
const current = await fs6.readFile(lockFile, "utf-8").catch(() => null);
|
|
763
|
-
if (stopped)
|
|
764
|
-
return;
|
|
765
|
-
if (current !== ownerId) {
|
|
766
|
-
stopped = true;
|
|
767
|
-
return;
|
|
768
|
-
}
|
|
769
|
-
const now = Date.now() / 1000;
|
|
770
|
-
await fs6.utimes(lockFile, now, now).catch(() => {});
|
|
771
|
-
scheduleNextHeartbeat();
|
|
772
|
-
};
|
|
773
|
-
scheduleNextHeartbeat();
|
|
774
|
-
let released = false;
|
|
775
|
-
return async () => {
|
|
776
|
-
if (released)
|
|
777
|
-
return;
|
|
778
|
-
released = true;
|
|
779
|
-
stopHeartbeat();
|
|
780
|
-
const current = await fs6.readFile(lockFile, "utf-8").catch(() => null);
|
|
781
|
-
if (current === ownerId) {
|
|
782
|
-
await fs6.rm(lockFile, { force: true });
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
async rm(filePath) {
|
|
787
|
-
await fs6.rm(filePath, { recursive: true, force: true });
|
|
788
|
-
}
|
|
789
|
-
async rename(oldPath, newPath) {
|
|
790
|
-
await fs6.rename(oldPath, newPath);
|
|
791
|
-
}
|
|
792
|
-
async realpath(filePath) {
|
|
793
|
-
try {
|
|
794
|
-
return await fs6.realpath(filePath);
|
|
795
|
-
} catch (error) {
|
|
796
|
-
if (this.isEnoent(error))
|
|
797
|
-
return filePath;
|
|
798
|
-
throw error;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
async getTempDir() {
|
|
802
|
-
return await fs6.mkdtemp(path2.join(os2.tmpdir(), "uipath-fs-"));
|
|
803
|
-
}
|
|
804
|
-
async copyDirectory(sourcePath, destPath) {
|
|
805
|
-
const sourceStats = await this.stat(sourcePath);
|
|
806
|
-
if (!sourceStats) {
|
|
807
|
-
throw new Error(`Source directory does not exist: ${sourcePath}`);
|
|
808
|
-
}
|
|
809
|
-
if (!sourceStats.isDirectory()) {
|
|
810
|
-
throw new Error(`Source path is not a directory: ${sourcePath}`);
|
|
811
|
-
}
|
|
812
|
-
await this.mkdir(destPath);
|
|
813
|
-
const entries = await this.readdir(sourcePath);
|
|
814
|
-
for (const entry of entries) {
|
|
815
|
-
const srcEntry = path2.join(sourcePath, entry);
|
|
816
|
-
const destEntry = path2.join(destPath, entry);
|
|
817
|
-
const entryStats = await this.stat(srcEntry);
|
|
818
|
-
if (!entryStats)
|
|
819
|
-
continue;
|
|
820
|
-
if (entryStats.isDirectory()) {
|
|
821
|
-
await this.copyDirectory(srcEntry, destEntry);
|
|
822
|
-
} else if (entryStats.isFile()) {
|
|
823
|
-
const content = await this.readFile(srcEntry);
|
|
824
|
-
if (content !== null) {
|
|
825
|
-
await this.writeFile(destEntry, content);
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
isEnoent(error) {
|
|
831
|
-
return this.hasErrnoCode(error, "ENOENT");
|
|
832
|
-
}
|
|
833
|
-
hasErrnoCode(error, code) {
|
|
834
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
// ../filesystem/src/index.ts
|
|
839
|
-
var fsInstance = new NodeFileSystem;
|
|
840
|
-
var setFileSystem = (_fs) => () => {};
|
|
841
|
-
var getFileSystem = () => fsInstance;
|
|
842
|
-
var getFileSystemAsync = async () => fsInstance;
|
|
843
|
-
|
|
844
|
-
export { NodeFileSystem, setFileSystem, getFileSystem, getFileSystemAsync };
|
|
845
|
-
|
|
846
|
-
//# debugId=67167B0CEB671DC164756E2164756E21
|
|
634
|
+
//# debugId=75EAFE8AF98B350C64756E2164756E21
|