@uipath/solution-tool 1.203.0-preview.212 → 1.204.0-preview.211
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/README.md +2 -2
- package/dist/THIRD-PARTY-NOTICES.md +4 -4
- package/dist/deploy-delete-service-gg00vadc.js +22 -0
- package/dist/deploy-status-service-cqfrvxpz.js +256 -0
- package/dist/deploy.d.ts +11 -4
- package/dist/deploy.js +19 -7
- package/dist/deployment-search-j34w33b2.js +49 -0
- package/dist/{embedded-file-reader-xxqe8vs8.js → embedded-file-reader-rf2g1kfj.js} +2 -2
- package/dist/feed-resolver-31gcvnnk.js +27 -0
- package/dist/feed-scope-failure-fwtdvvrh.js +18 -0
- package/dist/feed-session-sxga31vn.js +17 -0
- package/dist/index.js +27 -18
- package/dist/init.js +10 -7
- package/dist/{list-xjdnbyka.js → list-q4dzkv45.js} +9 -6
- package/dist/pack.js +14 -11
- package/dist/{packager-tool-7qmx64kz.js → packager-tool-00vh1ktg.js} +1022 -1342
- package/dist/packager-tool-1phh2rfx.js +37 -0
- package/dist/{packager-tool-vas0xg5h.js → packager-tool-2cntqvdv.js} +5 -3
- package/dist/{packager-tool-1haahq17.js → packager-tool-3enm2h28.js} +5 -5
- package/dist/{packager-tool-2syrt51a.js → packager-tool-3fv6zc86.js} +1062 -825
- package/dist/{packager-tool-grtmkd54.js → packager-tool-3m36mxn7.js} +16 -74
- package/dist/packager-tool-40vcj4wv.js +172 -0
- package/dist/packager-tool-482eg22x.js +322 -0
- package/dist/{packager-tool-k4mskzww.js → packager-tool-5dzjsw5q.js} +3 -3
- package/dist/{packager-tool-0f0wt9vh.js → packager-tool-5fjp60dk.js} +3071 -2794
- package/dist/{packager-tool-bkwnetqn.js → packager-tool-83rzavkx.js} +383 -88
- package/dist/{packager-tool-f423v35w.js → packager-tool-9hj0cfd0.js} +756 -359
- package/dist/{packager-tool-7znqtw3f.js → packager-tool-9vvdgbay.js} +8 -6
- package/dist/packager-tool-bqre28m1.js +43 -0
- package/dist/packager-tool-f5gq77m5.js +28 -0
- package/dist/{packager-tool-nzghfa48.js → packager-tool-fv7xyzg2.js} +550 -2
- package/dist/{packager-tool-3jrq7smt.js → packager-tool-gb35b4qs.js} +206 -289
- package/dist/{packager-tool-4kdt8mys.js → packager-tool-j30xck4w.js} +1008 -647
- package/dist/packager-tool-ks8spnq8.js +166 -0
- package/dist/packager-tool-q3tgpemc.js +113 -0
- package/dist/packager-tool-qdtjywsk.js +173 -0
- package/dist/{packager-tool-2p5yh1q9.js → packager-tool-qgaqqq41.js} +320 -151
- package/dist/packager-tool-qm24rbae.js +5889 -0
- package/dist/{packager-tool-resolver-fmjr60x8.js → packager-tool-resolver-2cbxyq6k.js} +6 -5
- package/dist/{packager-tool-znakt6yw.js → packager-tool-vh4ng74p.js} +8 -6
- package/dist/packager-tool-vmsxq1pc.js +104 -0
- package/dist/packager-tool-zf3929se.js +237 -0
- package/dist/packager-tool-zns6n8zp.js +837 -0
- package/dist/packager-tool.js +2 -2
- package/dist/prepare-solution-resources-p3gzdecy.js +25 -0
- package/dist/{project-contributions-cvttys34.js → project-contributions-txe8v6sm.js} +12 -9
- package/dist/publish.js +12 -7
- package/dist/resource.js +9 -6
- package/dist/services/activation.d.ts +17 -2
- package/dist/services/deploy-activate-service.d.ts +10 -0
- package/dist/services/deploy-delete-service.d.ts +82 -0
- package/dist/services/deploy-list-service.d.ts +15 -45
- package/dist/services/deploy-run-service.d.ts +36 -23
- package/dist/services/deploy-upgrade-service.d.ts +198 -39
- package/dist/services/deployment-feed-locator.d.ts +50 -12
- package/dist/services/deployment-search-client.d.ts +55 -0
- package/dist/services/deployment-search.d.ts +87 -34
- package/dist/services/deployment-state.d.ts +119 -0
- package/dist/services/feed-resolver.d.ts +31 -0
- package/dist/services/feed-session.d.ts +70 -0
- package/dist/services/folder-helper.d.ts +4 -27
- package/dist/services/http-status.d.ts +9 -0
- package/dist/services/incomplete-feed-sweep.d.ts +77 -0
- package/dist/services/legacy-deployment-search-v3.d.ts +23 -0
- package/dist/services/packages-list-service.d.ts +5 -0
- package/dist/services/pipeline-deploy-poll.d.ts +69 -0
- package/dist/services/publish-service.d.ts +14 -16
- package/dist/services/search-failure.d.ts +27 -0
- package/dist/templates/AGENTS.md +60 -20
- package/dist/tool.js +27 -18
- package/dist/utils/deployment-errors.d.ts +57 -0
- package/package.json +2 -2
- package/dist/packager-tool-jz2wbfjz.js +0 -2275
- package/dist/packager-tool-wtpe9285.js +0 -51960
- package/dist/prepare-solution-resources-wds3r8bq.js +0 -22
- package/dist/services/personal-workspace-deploy.d.ts +0 -49
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
ensurePackagerTools,
|
|
4
4
|
isUnpackableProjectTypeError,
|
|
5
5
|
toolVerbForProjectType
|
|
6
|
-
} from "./packager-tool-
|
|
7
|
-
import"./packager-tool-
|
|
8
|
-
import"./packager-tool-
|
|
9
|
-
import"./packager-tool-
|
|
6
|
+
} from "./packager-tool-5dzjsw5q.js";
|
|
7
|
+
import"./packager-tool-zns6n8zp.js";
|
|
8
|
+
import"./packager-tool-fv7xyzg2.js";
|
|
9
|
+
import"./packager-tool-5fjp60dk.js";
|
|
10
|
+
import"./packager-tool-zf3929se.js";
|
|
10
11
|
import"./packager-tool-dfrk01gn.js";
|
|
11
12
|
import"./packager-tool-1de529jm.js";
|
|
12
13
|
export {
|
|
@@ -16,4 +17,4 @@ export {
|
|
|
16
17
|
toolVerbForProjectType
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
//# debugId=
|
|
20
|
+
//# debugId=C6DDCB8627A7967264756E2164756E21
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolVerbForProjectType
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-5dzjsw5q.js";
|
|
4
4
|
import {
|
|
5
5
|
computeEntryPointSpec,
|
|
6
6
|
createResourceBuilderServices,
|
|
7
7
|
hasAnyTemplateRow,
|
|
8
8
|
hasBareTemplateRow,
|
|
9
9
|
readUipxProjects
|
|
10
|
-
} from "./packager-tool-
|
|
10
|
+
} from "./packager-tool-83rzavkx.js";
|
|
11
11
|
import {
|
|
12
12
|
toolsFactoryRepository
|
|
13
|
-
} from "./packager-tool-
|
|
13
|
+
} from "./packager-tool-fv7xyzg2.js";
|
|
14
14
|
import {
|
|
15
15
|
catchError,
|
|
16
|
-
getFileSystem,
|
|
17
16
|
logger
|
|
18
|
-
} from "./packager-tool-
|
|
17
|
+
} from "./packager-tool-5fjp60dk.js";
|
|
18
|
+
import {
|
|
19
|
+
getFileSystem
|
|
20
|
+
} from "./packager-tool-zf3929se.js";
|
|
19
21
|
|
|
20
22
|
// src/services/project-contributions.ts
|
|
21
23
|
var ENTRY_POINT_RESOURCE_KIND = "process";
|
|
@@ -185,4 +187,4 @@ function isSameSpecValue(a, b) {
|
|
|
185
187
|
|
|
186
188
|
export { ProjectContributionsError, collectProjectContributions, assertNoContributionErrors, contributionErrorMessages, applyProjectContributions };
|
|
187
189
|
|
|
188
|
-
//# debugId=
|
|
190
|
+
//# debugId=44C1EE84E4A52AC964756E2164756E21
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError,
|
|
3
|
+
logger
|
|
4
|
+
} from "./packager-tool-5fjp60dk.js";
|
|
5
|
+
|
|
6
|
+
// ../solution-sdk/src/solution-file.ts
|
|
7
|
+
var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
|
|
8
|
+
ProcessOrchestration: "processOrchestration"
|
|
9
|
+
};
|
|
10
|
+
function normalizeProjectType(projectType) {
|
|
11
|
+
return STUDIO_WEB_PROJECT_TYPE_OVERRIDES[projectType] ?? projectType;
|
|
12
|
+
}
|
|
13
|
+
function toPortableRelativePath(relativePath) {
|
|
14
|
+
return relativePath.replace(/\\/g, "/");
|
|
15
|
+
}
|
|
16
|
+
async function readUipxFile(fs, solutionDir) {
|
|
17
|
+
const dirEntries = await fs.readdir(solutionDir);
|
|
18
|
+
const uipxFileName = dirEntries.find((f) => f.endsWith(".uipx"));
|
|
19
|
+
if (!uipxFileName) {
|
|
20
|
+
throw new Error(`No .uipx file found in ${solutionDir}. Run 'uip solution init' first.`);
|
|
21
|
+
}
|
|
22
|
+
const uipxContent = await fs.readFile(fs.path.join(solutionDir, uipxFileName), "utf-8");
|
|
23
|
+
if (!uipxContent) {
|
|
24
|
+
throw new Error(`Could not read .uipx file: ${uipxFileName} is empty or missing.`);
|
|
25
|
+
}
|
|
26
|
+
const [parseError, parsed] = catchError(() => JSON.parse(uipxContent));
|
|
27
|
+
if (parseError) {
|
|
28
|
+
throw new Error(`Invalid .uipx file: could not parse JSON in ${uipxFileName}.`);
|
|
29
|
+
}
|
|
30
|
+
const uipx = validateUipxFile(parsed, uipxFileName);
|
|
31
|
+
return { uipx, uipxFileName };
|
|
32
|
+
}
|
|
33
|
+
function validateUipxFile(parsed, uipxFileName) {
|
|
34
|
+
if (!isRecord(parsed)) {
|
|
35
|
+
throw new Error(`Invalid .uipx file: ${uipxFileName} must contain a JSON object.`);
|
|
36
|
+
}
|
|
37
|
+
if (typeof parsed.SolutionId !== "string" || !parsed.SolutionId.trim()) {
|
|
38
|
+
throw new Error("Invalid .uipx file: missing SolutionId.");
|
|
39
|
+
}
|
|
40
|
+
if (!Array.isArray(parsed.Projects) || parsed.Projects.length === 0) {
|
|
41
|
+
throw new Error("Invalid .uipx file: missing Projects.");
|
|
42
|
+
}
|
|
43
|
+
for (const [index, project] of parsed.Projects.entries()) {
|
|
44
|
+
if (!isRecord(project)) {
|
|
45
|
+
throw new Error(`Invalid .uipx file: Projects[${index}] must be an object.`);
|
|
46
|
+
}
|
|
47
|
+
if (typeof project.ProjectRelativePath !== "string" || !project.ProjectRelativePath.trim()) {
|
|
48
|
+
const pathHint = typeof project.Path === "string" ? " Found Path, but .uipx uses ProjectRelativePath." : "";
|
|
49
|
+
throw new Error(`Invalid .uipx file: Projects[${index}] is missing ProjectRelativePath.${pathHint} Use 'uip solution projects add' to add projects, or set ProjectRelativePath to the project file path, for example "Foo/project.uiproj".`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
function isRecord(value) {
|
|
55
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56
|
+
}
|
|
57
|
+
function resolveSolutionDir(fs, inputPath) {
|
|
58
|
+
const resolved = fs.path.resolve(inputPath);
|
|
59
|
+
if (resolved.endsWith(".uipx")) {
|
|
60
|
+
return fs.path.dirname(resolved);
|
|
61
|
+
}
|
|
62
|
+
return resolved;
|
|
63
|
+
}
|
|
64
|
+
async function updateUipxSolutionId(fs, uipxPath, newSolutionId) {
|
|
65
|
+
const [readError, content] = await catchError(fs.readFile(uipxPath, "utf-8"));
|
|
66
|
+
if (readError || !content) {
|
|
67
|
+
logger.error(`Could not read .uipx file for update: ${readError?.message ?? "empty file"}`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const [parseError, parsed] = catchError(() => JSON.parse(content));
|
|
71
|
+
if (parseError) {
|
|
72
|
+
logger.error(`Could not parse .uipx file for update: ${parseError.message}`);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
parsed.SolutionId = newSolutionId;
|
|
76
|
+
const [writeError] = await catchError(fs.writeFile(uipxPath, JSON.stringify(parsed, null, 4)));
|
|
77
|
+
if (writeError) {
|
|
78
|
+
logger.error(`Could not update .uipx with new SolutionId: ${writeError.message}`);
|
|
79
|
+
} else {
|
|
80
|
+
logger.info(`Updated .uipx with Studio Web SolutionId: ${newSolutionId}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function findSolutionFileUpward(fs, startDir) {
|
|
84
|
+
let dir = startDir;
|
|
85
|
+
while (true) {
|
|
86
|
+
const entries = await fs.readdir(dir);
|
|
87
|
+
const files = entries.filter((f) => f.endsWith(".uipx"));
|
|
88
|
+
if (files.length === 1) {
|
|
89
|
+
return fs.path.join(dir, files[0]);
|
|
90
|
+
}
|
|
91
|
+
if (files.length > 1) {
|
|
92
|
+
throw new Error(`Multiple .uipx files found in ${dir}. Please specify which solution file to use.`);
|
|
93
|
+
}
|
|
94
|
+
const parent = fs.path.dirname(dir);
|
|
95
|
+
if (parent === dir) {
|
|
96
|
+
throw new Error(`No .uipx solution file found (searched from ${startDir} to filesystem root)`);
|
|
97
|
+
}
|
|
98
|
+
dir = parent;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { normalizeProjectType, toPortableRelativePath, readUipxFile, resolveSolutionDir, updateUipxSolutionId, findSolutionFileUpward };
|
|
103
|
+
|
|
104
|
+
//# debugId=FD084AD2795A138064756E2164756E21
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "./packager-tool-1de529jm.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-sby22td6.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
|
+
export { NodeFileSystem, getFileSystem };
|
|
236
|
+
|
|
237
|
+
//# debugId=E06D65CFBE49DC8C64756E2164756E21
|