@uipath/api-workflow-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/{browser-xef2n2gy.js → browser-hrvppyg6.js} +1 -1
- package/dist/{browser-strategy-d4zm14fb.js → browser-strategy-rkcvc6tn.js} +1 -1
- package/dist/executor-tool.js +256 -0
- package/dist/{index-8xj2420r.js → index-0wh8evkn.js} +3 -3
- package/dist/index-9f8q2ege.js +2058 -0
- package/dist/{index-45nhp2zp.js → index-hb9evmrt.js} +202 -64
- package/dist/index-hsadteg4.js +634 -0
- package/dist/index.js +10 -7
- package/dist/js-yaml-y3qtemk5.js +37 -0
- package/dist/{node-85w7w9a7.js → node-prf57hpz.js} +7872 -7486
- package/dist/node-strategy-nrq2egrd.js +348 -0
- package/dist/{packager-tool-9yfnj0t1.js → packager-tool-2zhkjkmy.js} +7607 -7316
- package/dist/packager-tool-4pvh3k50.js +265 -0
- package/dist/{packager-tool-1ps2qeqg.js → packager-tool-5arsyj36.js} +3 -2
- package/dist/packager-tool-bprnbg91.js +19190 -0
- package/dist/packager-tool-evraq47v.js +16522 -0
- package/dist/packager-tool-t01cjyjh.js +3127 -0
- package/dist/tool.js +8 -6
- package/package.json +4 -3
- package/dist/node-strategy-7bvg07kx.js +0 -63
- package/dist/packager-tool-4f38v0ry.js +0 -1161
- package/dist/packager-tool-9cz2z4tn.js +0 -40566
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "./packager-tool-wckvcay0.js";
|
|
4
|
+
|
|
5
|
+
// ../filesystem/src/node.ts
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import * as fs from "node:fs/promises";
|
|
9
|
+
import * as os from "node:os";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
var LOCK_HEARTBEAT_MS = 5000;
|
|
12
|
+
var LOCK_STALE_MS = 15000;
|
|
13
|
+
var LOCK_MAX_WAIT_MS = 20000;
|
|
14
|
+
var LOCK_MAX_HOLD_MS = 60000;
|
|
15
|
+
var LOCK_RETRY_MIN_MS = 100;
|
|
16
|
+
var LOCK_RETRY_JITTER_MS = 200;
|
|
17
|
+
|
|
18
|
+
class NodeFileSystem {
|
|
19
|
+
path = {
|
|
20
|
+
join: path.join,
|
|
21
|
+
resolve: path.resolve,
|
|
22
|
+
relative: path.relative,
|
|
23
|
+
dirname: path.dirname,
|
|
24
|
+
isAbsolute: path.isAbsolute,
|
|
25
|
+
basename: path.basename
|
|
26
|
+
};
|
|
27
|
+
env = {
|
|
28
|
+
cwd: process.cwd,
|
|
29
|
+
homedir: os.homedir,
|
|
30
|
+
tmpdir: os.tmpdir,
|
|
31
|
+
getenv: (key) => process.env[key]
|
|
32
|
+
};
|
|
33
|
+
utils = {
|
|
34
|
+
open: async (url) => {
|
|
35
|
+
const { default: open } = await import("./index-hsadteg4.js");
|
|
36
|
+
await open(url);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
async readFile(path2, options) {
|
|
40
|
+
try {
|
|
41
|
+
if (options) {
|
|
42
|
+
return await fs.readFile(path2, "utf-8");
|
|
43
|
+
}
|
|
44
|
+
return await fs.readFile(path2);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
if (this.isEnoent(error))
|
|
47
|
+
return null;
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async writeFile(filePath, data) {
|
|
52
|
+
const dir = path.dirname(filePath);
|
|
53
|
+
if (dir) {
|
|
54
|
+
await fs.mkdir(dir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
await fs.writeFile(filePath, data);
|
|
57
|
+
}
|
|
58
|
+
async appendFile(filePath, data) {
|
|
59
|
+
const dir = path.dirname(filePath);
|
|
60
|
+
if (dir) {
|
|
61
|
+
await fs.mkdir(dir, { recursive: true });
|
|
62
|
+
}
|
|
63
|
+
await fs.appendFile(filePath, data);
|
|
64
|
+
}
|
|
65
|
+
async readdir(dirPath) {
|
|
66
|
+
try {
|
|
67
|
+
return await fs.readdir(dirPath);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (this.isEnoent(error))
|
|
70
|
+
return [];
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async stat(filePath) {
|
|
75
|
+
try {
|
|
76
|
+
const stats = await fs.stat(filePath);
|
|
77
|
+
return {
|
|
78
|
+
isFile: () => stats.isFile(),
|
|
79
|
+
isDirectory: () => stats.isDirectory(),
|
|
80
|
+
size: stats.size,
|
|
81
|
+
mtimeMs: stats.mtimeMs
|
|
82
|
+
};
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (this.isEnoent(error))
|
|
85
|
+
return null;
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async exists(filePath) {
|
|
90
|
+
return existsSync(filePath);
|
|
91
|
+
}
|
|
92
|
+
async mkdir(dirPath) {
|
|
93
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
94
|
+
}
|
|
95
|
+
async acquireLock(lockPath) {
|
|
96
|
+
const canonicalPath = await this.canonicalizeLockTarget(lockPath);
|
|
97
|
+
const lockFile = `${canonicalPath}.lock`;
|
|
98
|
+
const ownerId = randomUUID();
|
|
99
|
+
const start = Date.now();
|
|
100
|
+
while (true) {
|
|
101
|
+
try {
|
|
102
|
+
await fs.writeFile(lockFile, ownerId, { flag: "wx" });
|
|
103
|
+
return this.createLockRelease(lockFile, ownerId);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
if (!this.hasErrnoCode(error, "EEXIST")) {
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
const stats = await fs.stat(lockFile).catch(() => null);
|
|
109
|
+
if (stats && Date.now() - stats.mtimeMs > LOCK_STALE_MS) {
|
|
110
|
+
const reclaimed = await fs.rm(lockFile, { force: true }).then(() => true).catch(() => false);
|
|
111
|
+
if (reclaimed)
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (Date.now() - start > LOCK_MAX_WAIT_MS) {
|
|
115
|
+
throw new Error(`ELOCKED: timed out waiting for lock on ${canonicalPath}`);
|
|
116
|
+
}
|
|
117
|
+
await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MIN_MS + Math.random() * LOCK_RETRY_JITTER_MS));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async canonicalizeLockTarget(lockPath) {
|
|
122
|
+
const absolute = path.resolve(lockPath);
|
|
123
|
+
const fullReal = await fs.realpath(absolute).catch(() => null);
|
|
124
|
+
if (fullReal)
|
|
125
|
+
return fullReal;
|
|
126
|
+
const parent = path.dirname(absolute);
|
|
127
|
+
const base = path.basename(absolute);
|
|
128
|
+
const canonicalParent = await fs.realpath(parent).catch(() => parent);
|
|
129
|
+
return path.join(canonicalParent, base);
|
|
130
|
+
}
|
|
131
|
+
createLockRelease(lockFile, ownerId) {
|
|
132
|
+
const heartbeatStart = Date.now();
|
|
133
|
+
let heartbeatTimer;
|
|
134
|
+
let stopped = false;
|
|
135
|
+
const stopHeartbeat = () => {
|
|
136
|
+
stopped = true;
|
|
137
|
+
if (heartbeatTimer)
|
|
138
|
+
clearTimeout(heartbeatTimer);
|
|
139
|
+
};
|
|
140
|
+
const scheduleNextHeartbeat = () => {
|
|
141
|
+
if (stopped)
|
|
142
|
+
return;
|
|
143
|
+
if (Date.now() - heartbeatStart >= LOCK_MAX_HOLD_MS) {
|
|
144
|
+
stopped = true;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
heartbeatTimer = setTimeout(() => {
|
|
148
|
+
runHeartbeat();
|
|
149
|
+
}, LOCK_HEARTBEAT_MS);
|
|
150
|
+
heartbeatTimer.unref?.();
|
|
151
|
+
};
|
|
152
|
+
const runHeartbeat = async () => {
|
|
153
|
+
if (stopped)
|
|
154
|
+
return;
|
|
155
|
+
const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
|
|
156
|
+
if (stopped)
|
|
157
|
+
return;
|
|
158
|
+
if (current !== ownerId) {
|
|
159
|
+
stopped = true;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const now = Date.now() / 1000;
|
|
163
|
+
await fs.utimes(lockFile, now, now).catch(() => {});
|
|
164
|
+
scheduleNextHeartbeat();
|
|
165
|
+
};
|
|
166
|
+
scheduleNextHeartbeat();
|
|
167
|
+
let released = false;
|
|
168
|
+
return async () => {
|
|
169
|
+
if (released)
|
|
170
|
+
return;
|
|
171
|
+
released = true;
|
|
172
|
+
stopHeartbeat();
|
|
173
|
+
const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
|
|
174
|
+
if (current === ownerId) {
|
|
175
|
+
await fs.rm(lockFile, { force: true });
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
async rm(filePath) {
|
|
180
|
+
await fs.rm(filePath, { recursive: true, force: true });
|
|
181
|
+
}
|
|
182
|
+
async rename(oldPath, newPath) {
|
|
183
|
+
await fs.rename(oldPath, newPath);
|
|
184
|
+
}
|
|
185
|
+
async realpath(filePath) {
|
|
186
|
+
try {
|
|
187
|
+
return await fs.realpath(filePath);
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (this.isEnoent(error))
|
|
190
|
+
return filePath;
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async getTempDir() {
|
|
195
|
+
return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
|
|
196
|
+
}
|
|
197
|
+
async copyDirectory(sourcePath, destPath) {
|
|
198
|
+
const sourceStats = await this.stat(sourcePath);
|
|
199
|
+
if (!sourceStats) {
|
|
200
|
+
throw new Error(`Source directory does not exist: ${sourcePath}`);
|
|
201
|
+
}
|
|
202
|
+
if (!sourceStats.isDirectory()) {
|
|
203
|
+
throw new Error(`Source path is not a directory: ${sourcePath}`);
|
|
204
|
+
}
|
|
205
|
+
await this.mkdir(destPath);
|
|
206
|
+
const entries = await this.readdir(sourcePath);
|
|
207
|
+
for (const entry of entries) {
|
|
208
|
+
const srcEntry = path.join(sourcePath, entry);
|
|
209
|
+
const destEntry = path.join(destPath, entry);
|
|
210
|
+
const entryStats = await this.stat(srcEntry);
|
|
211
|
+
if (!entryStats)
|
|
212
|
+
continue;
|
|
213
|
+
if (entryStats.isDirectory()) {
|
|
214
|
+
await this.copyDirectory(srcEntry, destEntry);
|
|
215
|
+
} else if (entryStats.isFile()) {
|
|
216
|
+
const content = await this.readFile(srcEntry);
|
|
217
|
+
if (content !== null) {
|
|
218
|
+
await this.writeFile(destEntry, content);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
isEnoent(error) {
|
|
224
|
+
return this.hasErrnoCode(error, "ENOENT");
|
|
225
|
+
}
|
|
226
|
+
hasErrnoCode(error, code) {
|
|
227
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// ../filesystem/src/index.ts
|
|
232
|
+
var fsInstance = new NodeFileSystem;
|
|
233
|
+
var getFileSystem = () => fsInstance;
|
|
234
|
+
|
|
235
|
+
// ../auth/src/catch-error.ts
|
|
236
|
+
function isPromiseLike(value) {
|
|
237
|
+
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
238
|
+
}
|
|
239
|
+
function catchError(fnOrPromise) {
|
|
240
|
+
if (isPromiseLike(fnOrPromise)) {
|
|
241
|
+
return settlePromiseLike(fnOrPromise);
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
const result = fnOrPromise();
|
|
245
|
+
if (isPromiseLike(result)) {
|
|
246
|
+
return settlePromiseLike(result);
|
|
247
|
+
}
|
|
248
|
+
return [undefined, result];
|
|
249
|
+
} catch (error) {
|
|
250
|
+
return [
|
|
251
|
+
error instanceof Error ? error : new Error(String(error)),
|
|
252
|
+
undefined
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function settlePromiseLike(thenable) {
|
|
257
|
+
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [
|
|
258
|
+
error instanceof Error ? error : new Error(String(error)),
|
|
259
|
+
undefined
|
|
260
|
+
]);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export { getFileSystem, catchError };
|
|
264
|
+
|
|
265
|
+
//# debugId=7C969342331D7A5864756E2164756E21
|
|
@@ -3,8 +3,9 @@ var UIPATH_HOME_DIR = ".uipath";
|
|
|
3
3
|
var AUTH_FILENAME = ".auth";
|
|
4
4
|
var DEFAULT_BASE_URL = "https://cloud.uipath.com";
|
|
5
5
|
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
6
|
+
var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT";
|
|
6
7
|
var AUTH_CANCELLED_ERROR_CODE = "EAUTHCANCELLED";
|
|
7
8
|
|
|
8
|
-
export { UIPATH_HOME_DIR, AUTH_FILENAME, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS, AUTH_CANCELLED_ERROR_CODE };
|
|
9
|
+
export { UIPATH_HOME_DIR, AUTH_FILENAME, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS, AUTH_TIMEOUT_ERROR_CODE, AUTH_CANCELLED_ERROR_CODE };
|
|
9
10
|
|
|
10
|
-
//# debugId=
|
|
11
|
+
//# debugId=E98AE5255EE78AC164756E2164756E21
|