@uipath/solution-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.
Files changed (37) hide show
  1. package/dist/{browser-strategy-brs3w53e.js → browser-strategy-yccf8mtd.js} +1 -1
  2. package/dist/deploy.js +8 -6
  3. package/dist/index-2fj08e7n.js +2058 -0
  4. package/dist/index-w03qc9m8.js +634 -0
  5. package/dist/index.js +15 -12
  6. package/dist/init.d.ts +6 -8
  7. package/dist/init.js +7 -6
  8. package/dist/js-yaml-4ypbq2tt.js +3145 -0
  9. package/dist/list-kbscmb2k.js +378 -0
  10. package/dist/node-strategy-12qfy0nv.js +348 -0
  11. package/dist/pack.js +9 -20
  12. package/dist/{packager-tool-v3bmxrve.js → packager-tool-112c30jx.js} +806 -93
  13. package/dist/{packager-tool-9j8d0ts5.js → packager-tool-550smwcc.js} +431 -1645
  14. package/dist/{packager-tool-1ps2qeqg.js → packager-tool-5arsyj36.js} +3 -2
  15. package/dist/{packager-tool-kfzzznjr.js → packager-tool-67ssxgph.js} +2 -2
  16. package/dist/packager-tool-7eva0peq.js +265 -0
  17. package/dist/{packager-tool-r1hk3s30.js → packager-tool-95fz7yd0.js} +72 -11
  18. package/dist/{packager-tool-sdhdmkt8.js → packager-tool-9vehmnke.js} +2 -1
  19. package/dist/packager-tool-bcpknnr8.js +6724 -0
  20. package/dist/packager-tool-fzwxq48d.js +4225 -0
  21. package/dist/{packager-tool-37g19zk3.js → packager-tool-krd5v2r5.js} +8 -6
  22. package/dist/{packager-tool-epwm26av.js → packager-tool-nkgvv7yh.js} +6249 -5847
  23. package/dist/{packager-tool-dmdgqh56.js → packager-tool-v33bpncw.js} +87 -31
  24. package/dist/packager-tool-va301fjh.js +1477 -0
  25. package/dist/packager-tool-yktm4v4r.js +67 -0
  26. package/dist/packager-tool.js +1 -1
  27. package/dist/publish.js +8 -6
  28. package/dist/resource.d.ts +2 -3
  29. package/dist/resource.js +6 -5
  30. package/dist/services/deployment-search.d.ts +1 -1
  31. package/dist/services/feed-resolver.d.ts +4 -5
  32. package/dist/templates/AGENTS.md +2 -1
  33. package/dist/tool.js +15 -12
  34. package/package.json +2 -2
  35. package/dist/node-strategy-a4n0d6dx.js +0 -63
  36. package/dist/packager-tool-q90kqh83.js +0 -1161
  37. package/dist/packager-tool-y4wacqkp.js +0 -15811
@@ -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=6DCB1840782D2B3E64756E2164756E21
11
+ //# debugId=E98AE5255EE78AC164756E2164756E21
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  catchError
3
- } from "./packager-tool-y4wacqkp.js";
3
+ } from "./packager-tool-bcpknnr8.js";
4
4
  import {
5
5
  getFileSystem
6
- } from "./packager-tool-q90kqh83.js";
6
+ } from "./packager-tool-7eva0peq.js";
7
7
 
8
8
  // src/services/solution-init-service.ts
9
9
  var AGENTS_FILENAME = "AGENTS.md";
@@ -0,0 +1,265 @@
1
+ import {
2
+ __require
3
+ } from "./packager-tool-0v6na3yp.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-w03qc9m8.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
@@ -1,22 +1,26 @@
1
1
  import {
2
2
  Configuration,
3
- Configuration1 as Configuration2,
4
- PackagesApi,
5
3
  PipelinesApi,
6
4
  resolveFeedScope
7
- } from "./packager-tool-9j8d0ts5.js";
5
+ } from "./packager-tool-va301fjh.js";
6
+ import {
7
+ Configuration as Configuration2,
8
+ PackagesApi
9
+ } from "./packager-tool-550smwcc.js";
10
+ import {
11
+ getSolutionAuthContext
12
+ } from "./packager-tool-fzwxq48d.js";
8
13
  import {
9
14
  PollOutcome,
10
15
  catchError,
11
16
  extractErrorDetails,
12
- getSolutionAuthContext,
13
17
  logger,
14
18
  mapPollFailure,
15
19
  pollUntil
16
- } from "./packager-tool-y4wacqkp.js";
20
+ } from "./packager-tool-bcpknnr8.js";
17
21
  import {
18
22
  getFileSystem
19
- } from "./packager-tool-q90kqh83.js";
23
+ } from "./packager-tool-7eva0peq.js";
20
24
  import {
21
25
  strFromU8,
22
26
  strToU8,
@@ -95,6 +99,60 @@ var isVersionConflictError = (message, details) => {
95
99
  const errorText = `${message} ${details ?? ""}`;
96
100
  return VERSION_CONFLICT_PATTERNS.some((pattern) => pattern.test(errorText));
97
101
  };
102
+ var HTTP_STATUS_PATTERNS = [
103
+ /^HTTP\s+(\d{3})(?::|\s|-|$)/i,
104
+ /["']httpStatus["']\s*:\s*(\d{3})\b/i,
105
+ /["']statusCode["']\s*:\s*(\d{3})\b/i,
106
+ /["']status["']\s*:\s*(\d{3})\b/i,
107
+ /\bhttpStatus\s*[:=]\s*(\d{3})\b/i,
108
+ /\bstatusCode\s*[:=]\s*(\d{3})\b/i
109
+ ];
110
+ var ERROR_CODE_PATTERNS = [
111
+ /["']errorCode["']\s*:\s*["']([^"']+)["']/i,
112
+ /["']errorCode["']\s*:\s*(\d+)\b/i,
113
+ /\berrorCode\s*[:=]\s*["']?([A-Za-z0-9_.-]+)["']?/i,
114
+ /["']code["']\s*:\s*["']([^"']+)["']/i,
115
+ /["']code["']\s*:\s*(\d+)\b/i
116
+ ];
117
+ function extractFirstPatternValue(text, patterns) {
118
+ if (!text)
119
+ return;
120
+ for (const pattern of patterns) {
121
+ const match = pattern.exec(text);
122
+ if (match?.[1])
123
+ return match[1];
124
+ }
125
+ return;
126
+ }
127
+ function extractUploadHttpStatus(message, details) {
128
+ const rawStatus = extractFirstPatternValue(message, HTTP_STATUS_PATTERNS) ?? extractFirstPatternValue(details, HTTP_STATUS_PATTERNS);
129
+ if (!rawStatus)
130
+ return;
131
+ const status = Number(rawStatus);
132
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
133
+ }
134
+ function extractUploadErrorCode(message, details) {
135
+ return extractFirstPatternValue(details, ERROR_CODE_PATTERNS) ?? extractFirstPatternValue(message, ERROR_CODE_PATTERNS);
136
+ }
137
+ function retryHintForUploadStatus(httpStatus) {
138
+ if (httpStatus === 400 || httpStatus === 409 || httpStatus === 422) {
139
+ return "RetryWillNotFix";
140
+ }
141
+ if (httpStatus === 408 || httpStatus === 429 || httpStatus !== undefined && httpStatus >= 500 && httpStatus < 600) {
142
+ return "RetryLater";
143
+ }
144
+ return;
145
+ }
146
+ function mergeUploadErrorContext(context, httpStatus, errorCode) {
147
+ if (!context && httpStatus === undefined && errorCode === undefined) {
148
+ return;
149
+ }
150
+ return {
151
+ ...context ?? {},
152
+ ...httpStatus !== undefined ? { httpStatus } : {},
153
+ ...errorCode !== undefined ? { errorCode } : {}
154
+ };
155
+ }
98
156
  async function publishSolutionAsync(packagePath, options = {}) {
99
157
  const [authError, auth] = await catchError(getSolutionAuthContext({
100
158
  tenant: options.tenant,
@@ -299,9 +357,12 @@ async function publishToFeed(auth, fileBuffer, scope, options) {
299
357
  }
300
358
  async function mapUploadError(uploadError) {
301
359
  const { message, details, context, retry } = await extractErrorDetails(uploadError);
360
+ const httpStatus = context?.httpStatus ?? extractUploadHttpStatus(message, details);
361
+ const errorCode = context?.errorCode ?? extractUploadErrorCode(message, details);
362
+ const resolvedContext = mergeUploadErrorContext(context, httpStatus, errorCode);
363
+ const resolvedRetry = context?.httpStatus === undefined ? retryHintForUploadStatus(httpStatus) ?? retry : retry;
302
364
  const fetchCause = uploadError instanceof Error && uploadError.name === "FetchError" && uploadError.cause instanceof Error ? uploadError.cause : null;
303
365
  const surfacedMessage = fetchCause ? `Failed to upload package: ${fetchCause.message}` : message;
304
- const httpStatus = context?.httpStatus;
305
366
  let reason = "upload_failed";
306
367
  if (isVersionConflictError(message, details)) {
307
368
  reason = "upload_version_conflict";
@@ -315,12 +376,12 @@ async function mapUploadError(uploadError) {
315
376
  reason,
316
377
  message: surfacedMessage,
317
378
  details,
318
- errorCode: context?.errorCode,
319
- retry,
320
- context
379
+ errorCode,
380
+ retry: resolvedRetry,
381
+ context: resolvedContext
321
382
  };
322
383
  }
323
384
 
324
385
  export { publishSolutionAsync };
325
386
 
326
- //# debugId=696E04915672C64A64756E2164756E21
387
+ //# debugId=F5A8606772C19F7264756E2164756E21
@@ -1793,6 +1793,7 @@ class CodedAppStrategy {
1793
1793
  }
1794
1794
  const bindingsV2Path = Path.join(contentFolder, "bindings_v2.json");
1795
1795
  const bindingsCandidatePaths = [
1796
+ Path.join(projectPath, "source", "bindings_v2.json"),
1796
1797
  Path.join(projectPath, "source", "bindings.json"),
1797
1798
  Path.join(projectPath, "bindings.json"),
1798
1799
  Path.join(projectPath, "bindings_v2.json")
@@ -2924,4 +2925,4 @@ function registerPackagerFactories() {
2924
2925
 
2925
2926
  export { Path, TemporaryStorageService, ZipService, I18nManager, translate, BuildConfiguration, LogLevel, LogMessage, TargetFramework, ToolErrorCodes, ToolResult, toolsFactoryRepository2 as toolsFactoryRepository, registerPackagerFactories };
2926
2927
 
2927
- //# debugId=721052D57B911C2E64756E2164756E21
2928
+ //# debugId=D265E2C64CC7BFA064756E2164756E21