@uipath/codedapp-tool 1.206.0-preview.301 → 1.207.0-preview.305

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.
@@ -1,18 +1,79 @@
1
- import"./packager-tool-0ajs8pnk.js";
2
- import"./packager-tool-z73h4t8a.js";
1
+ import"./packager-tool-9thx6ae9.js";
2
+ import"./packager-tool-511nvmp8.js";
3
+ import"./packager-tool-ywc134a9.js";
3
4
  import {
4
5
  toolsFactoryRepository
5
- } from "./packager-tool-5t7c439j.js";
6
+ } from "./packager-tool-tjb9qmzj.js";
6
7
  import {
7
- WebAppContributingToolFactory
8
- } from "./packager-tool-t0j980y4.js";
8
+ WebAppContributingToolFactory,
9
+ AUTH_CONSTANTS
10
+ } from "./packager-tool-62r4c9hq.js";
11
+ import"./packager-tool-bzcphfa8.js";
12
+ import {
13
+ ENV_AUTH_VARS2
14
+ } from "./packager-tool-rnnkxjfm.js";
15
+
16
+ // src/packager-command-runner.ts
17
+ import { spawn } from "node:child_process";
18
+ var MAX_OUTPUT_CHARS = 64 * 1024;
19
+ function cliCredentialEnvVars() {
20
+ return new Set([
21
+ ENV_AUTH_VARS2.token,
22
+ AUTH_CONSTANTS.ENV_CONFIG.ACCESS_TOKEN.envVar
23
+ ]);
24
+ }
25
+ function buildCommandEnv(env) {
26
+ const credentials = cliCredentialEnvVars();
27
+ return Object.fromEntries(Object.entries(env).filter(([name]) => !credentials.has(name.toUpperCase())));
28
+ }
29
+
30
+ class NodeCommandRunner {
31
+ runAsync(command, args, options) {
32
+ return new Promise((resolve) => {
33
+ const env = buildCommandEnv(process.env);
34
+ const child = process.platform === "win32" ? spawn([command, ...args].join(" "), {
35
+ cwd: options.cwd,
36
+ env,
37
+ shell: true,
38
+ windowsHide: true,
39
+ stdio: ["ignore", "pipe", "pipe"],
40
+ signal: options.signal
41
+ }) : spawn(command, [...args], {
42
+ cwd: options.cwd,
43
+ env,
44
+ stdio: ["ignore", "pipe", "pipe"],
45
+ signal: options.signal
46
+ });
47
+ let output = "";
48
+ const append = (chunk) => {
49
+ output = (output + chunk.toString()).slice(-MAX_OUTPUT_CHARS);
50
+ };
51
+ child.stdout?.on("data", append);
52
+ child.stderr?.on("data", append);
53
+ child.on("error", (error) => {
54
+ resolve(options.signal?.aborted ? { exitCode: null, output } : { exitCode: null, output, startError: error.message });
55
+ });
56
+ child.on("close", (exitCode) => {
57
+ if (process.platform === "win32" && exitCode === 9009) {
58
+ resolve({
59
+ exitCode,
60
+ output,
61
+ startError: output.trim() || `'${command}' not found`
62
+ });
63
+ return;
64
+ }
65
+ resolve({ exitCode, output });
66
+ });
67
+ });
68
+ }
69
+ }
9
70
 
10
71
  // src/packager-tool.ts
11
72
  function registerPackagerFactories() {
12
- toolsFactoryRepository.registerProjectToolFactory(new WebAppContributingToolFactory);
73
+ toolsFactoryRepository.registerProjectToolFactory(new WebAppContributingToolFactory(new NodeCommandRunner));
13
74
  }
14
75
  export {
15
76
  registerPackagerFactories
16
77
  };
17
78
 
18
- //# debugId=6562EA3A76DA0B8E64756E2164756E21
79
+ //# debugId=3B8BBAFE155786D864756E2164756E21
package/dist/tool.js CHANGED
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  metadata2,
3
3
  registerCommands2
4
- } from "./packager-tool-tpa79b11.js";
5
- import"./packager-tool-ew0d2fjb.js";
6
- import"./packager-tool-3ss96mpk.js";
7
- import"./packager-tool-t0j980y4.js";
8
- import"./packager-tool-5t7c439j.js";
9
- import"./packager-tool-z73h4t8a.js";
10
- import"./packager-tool-0ajs8pnk.js";
11
- import"./packager-tool-1qg04b7q.js";
4
+ } from "./packager-tool-g7b4kkqx.js";
5
+ import"./packager-tool-1s4184sh.js";
6
+ import"./packager-tool-62r4c9hq.js";
7
+ import"./packager-tool-tjb9qmzj.js";
8
+ import"./packager-tool-ywc134a9.js";
9
+ import"./packager-tool-511nvmp8.js";
10
+ import"./packager-tool-rnnkxjfm.js";
11
+ import"./packager-tool-9thx6ae9.js";
12
+ import"./packager-tool-bzcphfa8.js";
12
13
  export {
13
14
  metadata2 as metadata,
14
15
  registerCommands2 as registerCommands
15
16
  };
16
17
 
17
- //# debugId=316AD7AA107F583064756E2164756E21
18
+ //# debugId=5763DD0F2A83F65D64756E2164756E21
@@ -0,0 +1,77 @@
1
+ import {
2
+ getFileSystem
3
+ } from "./packager-tool-9thx6ae9.js";
4
+ import {
5
+ unzipSync2
6
+ } from "./packager-tool-ywc134a9.js";
7
+
8
+ // ../common/src/zip.ts
9
+ function resolveZipEntryPath(fs, root, entryName) {
10
+ if (entryName.includes("\x00")) {
11
+ throw new Error(`Invalid zip entry path: ${entryName}`);
12
+ }
13
+ const normalizedEntry = entryName.replace(/\\/g, "/");
14
+ if (normalizedEntry.startsWith("/")) {
15
+ throw new Error(`Unsafe absolute zip entry path: ${entryName}`);
16
+ }
17
+ const target = fs.path.resolve(root, normalizedEntry);
18
+ if (!isUnder(fs, root, target)) {
19
+ throw new Error(`Unsafe zip entry path: ${entryName}`);
20
+ }
21
+ return target;
22
+ }
23
+ function isUnder(fs, root, path) {
24
+ const relative = fs.path.relative(root, path);
25
+ return relative === "" || !relative.startsWith("..") && !fs.path.isAbsolute(relative);
26
+ }
27
+ async function assertNoEscapeThroughSymlink(fs, lexicalRoot, realRoot, path, entryName) {
28
+ const resolved = await fs.realpath(path);
29
+ if (isUnder(fs, realRoot, resolved) || isUnder(fs, lexicalRoot, resolved)) {
30
+ return;
31
+ }
32
+ throw new Error(`Unsafe zip entry path (escapes via a symlink at the destination): ${entryName}`);
33
+ }
34
+ async function mkdirUnderRoot(fs, lexicalRoot, realRoot, dir, entryName) {
35
+ const relative = fs.path.relative(lexicalRoot, dir);
36
+ if (relative === "") {
37
+ return;
38
+ }
39
+ let current = lexicalRoot;
40
+ for (const segment of relative.split(/[\\/]/)) {
41
+ if (segment === "") {
42
+ continue;
43
+ }
44
+ current = fs.path.join(current, segment);
45
+ await fs.mkdir(current);
46
+ await assertNoEscapeThroughSymlink(fs, lexicalRoot, realRoot, current, entryName);
47
+ }
48
+ }
49
+ async function extractZipDataToDir(fs, zipData, destinationDir) {
50
+ await fs.mkdir(destinationDir);
51
+ const lexicalRoot = fs.path.resolve(destinationDir);
52
+ const realRoot = await fs.realpath(lexicalRoot);
53
+ const entries = unzipSync2(zipData);
54
+ for (const [entryName, content] of Object.entries(entries)) {
55
+ const target = resolveZipEntryPath(fs, lexicalRoot, entryName);
56
+ if (entryName.endsWith("/")) {
57
+ await mkdirUnderRoot(fs, lexicalRoot, realRoot, target, entryName);
58
+ continue;
59
+ }
60
+ await mkdirUnderRoot(fs, lexicalRoot, realRoot, fs.path.dirname(target), entryName);
61
+ await assertNoEscapeThroughSymlink(fs, lexicalRoot, realRoot, target, entryName);
62
+ await fs.writeFile(target, content);
63
+ }
64
+ }
65
+ async function extractArchive(archivePath, destinationDir) {
66
+ const fs = getFileSystem();
67
+ const data = await fs.readFile(archivePath);
68
+ if (data === null) {
69
+ throw new Error(`Archive not found: ${archivePath}`);
70
+ }
71
+ await extractZipDataToDir(fs, data, destinationDir);
72
+ }
73
+ export {
74
+ extractArchive
75
+ };
76
+
77
+ //# debugId=8E164BB334F0324264756E2164756E21
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/codedapp-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.206.0-preview.301",
5
+ "version": "1.207.0-preview.305",
6
6
  "description": "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
7
7
  "keywords": [
8
8
  "cli-tool",
@@ -30,7 +30,7 @@
30
30
  "registry": "https://registry.npmjs.org/"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@uipath/codedapp-convert-sdk": "0.1.0-beta.2"
33
+ "@uipath/codedapp-convert-sdk": "0.1.0-beta.3"
34
34
  },
35
- "gitHead": "078afc3ef7ebf4c38353ee0059e321acf16a350d"
35
+ "gitHead": "1600aa89255c37c1b8bc68d9882c3395c1d5bff4"
36
36
  }