@uipath/orchestrator-tool 1.206.0-preview.311 → 1.206.0-preview.323

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,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./tool-bhbmn53g.js";
3
+ } from "./tool-91e9n6z7.js";
4
4
  export {
5
5
  getFileSystem2 as getFileSystem
6
6
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  Command
4
- } from "./tool-kabfszcg.js";
5
- import"./tool-bhbmn53g.js";
4
+ } from "./tool-7jm6dh39.js";
5
+ import"./tool-91e9n6z7.js";
6
6
  import {
7
7
  metadata2,
8
8
  registerCommands2
9
- } from "./tool-evfkyyvc.js";
9
+ } from "./tool-hert9chm.js";
10
10
 
11
11
  // src/index.ts
12
12
  var program = new Command;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./tool-bhbmn53g.js";
3
+ } from "./tool-91e9n6z7.js";
4
4
  import {
5
5
  catchError,
6
6
  RESULTS,
@@ -38,7 +38,7 @@ import {
38
38
  inlinePartFramingBound,
39
39
  reportFailure,
40
40
  unzipSync
41
- } from "./tool-kabfszcg.js";
41
+ } from "./tool-7jm6dh39.js";
42
42
 
43
43
  // ../common/src/zip.ts
44
44
  function resolveZipEntryPath(fs, root, entryName) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./tool-bhbmn53g.js";
3
+ } from "./tool-91e9n6z7.js";
4
4
  import {
5
5
  __toESM,
6
6
  __commonJS,
@@ -14295,6 +14295,8 @@ function settlePromiseLike2(thenable) {
14295
14295
  // ../auth/src/constants.ts
14296
14296
  var UIPATH_HOME_DIR = ".uipath";
14297
14297
  var AUTH_FILENAME = ".auth";
14298
+ var AUTH_FILE_MODE = 384;
14299
+ var AUTH_DIR_MODE = 448;
14298
14300
  var DEFAULT_BASE_URL = "https://cloud.uipath.com";
14299
14301
  var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
14300
14302
 
@@ -15118,6 +15120,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
15118
15120
  }
15119
15121
  return parseEnvContent(content);
15120
15122
  };
15123
+ var findAuthHomeDir = (fs, dir) => {
15124
+ let current = dir;
15125
+ for (;; ) {
15126
+ if (fs.path.basename(current) === UIPATH_HOME_DIR)
15127
+ return current;
15128
+ const parent = fs.path.dirname(current);
15129
+ if (parent === current)
15130
+ return;
15131
+ current = parent;
15132
+ }
15133
+ };
15134
+ var TEMP_FILE_ATTEMPTS = 5;
15135
+ var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
15136
+ var writeTempFile = async (fs, targetPath, content) => {
15137
+ for (let attempt = 1;; attempt++) {
15138
+ const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
15139
+ try {
15140
+ await fs.writeFile(tempPath, content, {
15141
+ mode: AUTH_FILE_MODE,
15142
+ exclusive: true
15143
+ });
15144
+ return tempPath;
15145
+ } catch (error) {
15146
+ if (!isFileExists(error)) {
15147
+ await fs.rm(tempPath).catch(() => {});
15148
+ throw error;
15149
+ }
15150
+ if (attempt === TEMP_FILE_ATTEMPTS)
15151
+ throw error;
15152
+ }
15153
+ }
15154
+ };
15121
15155
  var saveEnvFileAsync = async ({
15122
15156
  envPath,
15123
15157
  data,
@@ -15145,10 +15179,18 @@ var saveEnvFileAsync = async ({
15145
15179
  `)}
15146
15180
  `;
15147
15181
  const dir = fs.path.dirname(absolutePath);
15148
- await fs.mkdir(dir);
15149
- const tempPath = `${absolutePath}.tmp`;
15150
- await fs.writeFile(tempPath, content);
15151
- await fs.rename(tempPath, absolutePath);
15182
+ await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
15183
+ const authHomeDir = findAuthHomeDir(fs, dir);
15184
+ if (authHomeDir !== undefined) {
15185
+ await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
15186
+ }
15187
+ const tempPath = await writeTempFile(fs, absolutePath, content);
15188
+ try {
15189
+ await fs.rename(tempPath, absolutePath);
15190
+ } catch (error) {
15191
+ await fs.rm(tempPath).catch(() => {});
15192
+ throw error;
15193
+ }
15152
15194
  };
15153
15195
 
15154
15196
  // ../auth/src/loginStatus.ts
@@ -23151,4 +23193,4 @@ function unzipSync(data, opts) {
23151
23193
 
23152
23194
  export { CommandDimensions, ShipDimensions, catchError, carriedErrorCode, carriedRetry, parseHttpStatusFromMessage, extractErrorDetails, extractErrorMessage, extractErrorMessageSync, RESULTS, classifiedFailure, InvalidArgumentError, Command, Option, isPreviewBuild, getOutputSink, logger, EXIT_CODES, Pagination, OutputFormatter, processContext, mapWithConcurrency, requireConfirmation, DEFAULT_PAGE_SIZE, isGuid, warnDeprecatedOptionAlias, addDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, pollUntil, ScreenLogger, trackShipSucceeded, AssetDtoValueTypeEnum, JobDtoToJSONTyped, PackageFeedDtoPurposeEnum, ApiTriggersApi, AssetsApi, AttachmentsApi, AuditLogsApi, AutopilotForRobotsDataApi, BucketsApi, CalendarsApi, ChangeProposalCommentsApi, ChangeProposalsApi, CredentialStoresApi, ExportsApi, FoldersApi, FoldersNavigationApi, HttpTriggersApi, JobAttachmentsApi, JobsApi, KnowledgeBundleContentApi, KnowledgeBundlesApi, LibrariesApi, LicensesNamedUserApi, LicensesRuntimeApi, MachinesApi, PackageFeedsApi, PermissionsApi, PersonalWorkspacesApi, ProcessSchedulesApi, ProcessesApi, QueueDefinitionsApi, QueueItemsApi, QueueProcessingRecordsApi, QueuesApi, ReleasesApi, RobotLogsApi, RobotsApi, RolesApi, SessionsApi, SettingsApi, TriggerLogsApi, UsersApi, WebhooksApi, createOrchestratorConfig, createApiClient, resolveFolder, requireFolder, uploadJobAttachment, hashKnowledgeBundleObject, uploadKnowledgeBundleObject, readKnowledgeBundleFile, readKnowledgeBundleBuildArtifact, downloadKnowledgeBundleArchive, getKnowledgeBundleFileHistory, KB_INLINE_LIMITS, readKnowledgeBundleMissingObjects, publishKnowledgeBundleVersionWithObjects, createKnowledgeBundleProposalWithObjects, updateKnowledgeBundleProposalWithObjects, inlinePartFramingBound, nullArrayToEmptyMiddleware, quoteODataStringLiteral, ReleaseNotFoundError, resolveRelease, resolveReleaseReference, ROI_TIME_UNITS, ROI_VOLUME_PERIODS, ROI_EMPLOYEE_COST_PERIODS, RoiConfigurationApi, reportFailure, reportNotFound, strFromU8, unzipSync };
23153
23195
 
23154
- //# debugId=BBB2CC1A1723C61664756E2164756E21
23196
+ //# debugId=067B2D780806184A64756E2164756E21
@@ -47,12 +47,26 @@ class NodeFileSystem {
47
47
  throw error;
48
48
  }
49
49
  }
50
- async writeFile(filePath, data) {
50
+ async writeFile(filePath, data, options) {
51
51
  const dir = path.dirname(filePath);
52
52
  if (dir) {
53
53
  await fs.mkdir(dir, { recursive: true });
54
54
  }
55
- await fs.writeFile(filePath, data);
55
+ if (options?.mode === undefined || process.platform === "win32") {
56
+ if (options?.exclusive) {
57
+ await fs.writeFile(filePath, data, { flag: "wx" });
58
+ } else {
59
+ await fs.writeFile(filePath, data);
60
+ }
61
+ return;
62
+ }
63
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
64
+ try {
65
+ await handle.chmod(options.mode);
66
+ await handle.writeFile(data);
67
+ } finally {
68
+ await handle.close();
69
+ }
56
70
  }
57
71
  async appendFile(filePath, data) {
58
72
  const dir = path.dirname(filePath);
@@ -87,7 +101,8 @@ class NodeFileSystem {
87
101
  isDirectory: () => stats.isDirectory(),
88
102
  size: stats.size,
89
103
  mtimeMs: stats.mtimeMs,
90
- ctimeMs: stats.ctimeMs
104
+ ctimeMs: stats.ctimeMs,
105
+ mode: stats.mode
91
106
  };
92
107
  } catch (error) {
93
108
  if (this.isEnoent(error))
@@ -98,8 +113,13 @@ class NodeFileSystem {
98
113
  async exists(filePath) {
99
114
  return existsSync(filePath);
100
115
  }
101
- async mkdir(dirPath) {
102
- await fs.mkdir(dirPath, { recursive: true });
116
+ async mkdir(dirPath, options) {
117
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
118
+ }
119
+ async chmod(targetPath, mode) {
120
+ if (process.platform === "win32")
121
+ return;
122
+ await fs.chmod(targetPath, mode);
103
123
  }
104
124
  async acquireLock(lockPath) {
105
125
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -288,4 +308,4 @@ var fsInstance = new NodeFileSystem;
288
308
  var getFileSystem2 = () => fsInstance;
289
309
  export { getFileSystem2 };
290
310
 
291
- //# debugId=01EED73CB398060E64756E2164756E21
311
+ //# debugId=D68E42A3D23DBAFF64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./tool-bhbmn53g.js";
3
+ } from "./tool-91e9n6z7.js";
4
4
  import {
5
5
  CommandDimensions,
6
6
  ShipDimensions,
@@ -85,13 +85,13 @@ import {
85
85
  reportNotFound,
86
86
  strFromU8,
87
87
  unzipSync
88
- } from "./tool-kabfszcg.js";
88
+ } from "./tool-7jm6dh39.js";
89
89
  // package.json
90
90
  var package_default = {
91
91
  name: "@uipath/orchestrator-tool",
92
92
  author: "UiPath",
93
93
  license: "SEE LICENSE IN LICENSE.txt",
94
- version: "1.206.0-preview.311",
94
+ version: "1.206.0-preview.323",
95
95
  description: "Manage Orchestrator folders, jobs, processes, and releases.",
96
96
  private: false,
97
97
  repository: {
@@ -1444,7 +1444,7 @@ var registerAttachmentsCommand = (program) => {
1444
1444
  return;
1445
1445
  }
1446
1446
  const fileName = options.destination || `attachment-${attachmentId}`;
1447
- const { getFileSystem } = await import("./index-xcedjjv9.js");
1447
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
1448
1448
  const fs = getFileSystem();
1449
1449
  const [writeError] = await catchError(fs.writeFile(fileName, Buffer.from(buffer)));
1450
1450
  if (writeError) {
@@ -4184,7 +4184,7 @@ async function downloadAttachment(attachmentId, outputPath, options) {
4184
4184
  if (bufferError) {
4185
4185
  throw new Error(`Failed to read attachment data: ${bufferError.message}`);
4186
4186
  }
4187
- const { getFileSystem } = await import("./index-xcedjjv9.js");
4187
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
4188
4188
  const fs = getFileSystem();
4189
4189
  const [writeError] = await catchError(fs.writeFile(outputPath, Buffer.from(buffer)));
4190
4190
  if (writeError) {
@@ -4199,7 +4199,7 @@ async function downloadAttachment(attachmentId, outputPath, options) {
4199
4199
 
4200
4200
  // src/utils/attachment-uploader.ts
4201
4201
  async function uploadAttachment(filePath, name, options) {
4202
- const { getFileSystem } = await import("./index-xcedjjv9.js");
4202
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
4203
4203
  const fs = getFileSystem();
4204
4204
  const [readError, fileBuffer] = await catchError(fs.readFile(filePath));
4205
4205
  if (readError) {
@@ -4243,7 +4243,7 @@ async function parseAttachmentArg(arg) {
4243
4243
  }
4244
4244
  return { name, path };
4245
4245
  }
4246
- const { getFileSystem } = await import("./index-xcedjjv9.js");
4246
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
4247
4247
  const fs = getFileSystem();
4248
4248
  return { name: fs.path.basename(arg), path: arg };
4249
4249
  }
@@ -5562,7 +5562,7 @@ var registerJobsCommand = (program) => {
5562
5562
  return;
5563
5563
  }
5564
5564
  const fileName = options.destination || `healing-agent-data-${jobKey}.zip`;
5565
- const { getFileSystem } = await import("./index-xcedjjv9.js");
5565
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
5566
5566
  const fs = getFileSystem();
5567
5567
  const [writeError] = await catchError(fs.writeFile(fileName, Buffer.from(buffer)));
5568
5568
  if (writeError) {
@@ -5624,7 +5624,7 @@ async function buildJobCompletionOutput(job, elapsedMs, options) {
5624
5624
  data.Duration = `${Math.round(elapsedMs / 1000)}s`;
5625
5625
  }
5626
5626
  if (job.outputFile && options.download !== false) {
5627
- const { getFileSystem } = await import("./index-xcedjjv9.js");
5627
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
5628
5628
  const fsHelper = getFileSystem();
5629
5629
  const outputDir = options.outputDir || ".";
5630
5630
  const fileName = fsHelper.path.join(outputDir, `output-${job.key || "job"}.dat`);
@@ -7616,7 +7616,7 @@ var registerPackagesCommand = (program) => {
7616
7616
  processContext.exit(1);
7617
7617
  return;
7618
7618
  }
7619
- const { getFileSystem } = await import("./index-xcedjjv9.js");
7619
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
7620
7620
  const fs = getFileSystem();
7621
7621
  const [readError, fileBuffer] = await catchError(fs.readFile(filePath));
7622
7622
  if (readError || fileBuffer === null) {
@@ -7793,7 +7793,7 @@ var registerPackagesCommand = (program) => {
7793
7793
  await reportFailure("Error downloading package", bufferError);
7794
7794
  return;
7795
7795
  }
7796
- const { getFileSystem } = await import("./index-xcedjjv9.js");
7796
+ const { getFileSystem } = await import("./index-zbmcnkyy.js");
7797
7797
  const fs = getFileSystem();
7798
7798
  const buffer = new Uint8Array(arrayBuffer);
7799
7799
  const [writeError] = await catchError(fs.writeFile(options.destination, buffer));
@@ -16395,7 +16395,7 @@ var registerCommands2 = async (program) => {
16395
16395
  registerFoldersCommand(program);
16396
16396
  registerJobsCommand(program);
16397
16397
  if (isPreviewBuild()) {
16398
- const { registerKbCommand } = await import("./kb-9hac1xg9.js");
16398
+ const { registerKbCommand } = await import("./kb-y2nsxf1b.js");
16399
16399
  registerKbCommand(program);
16400
16400
  }
16401
16401
  registerLibrariesCommand(program);
@@ -16417,4 +16417,4 @@ var registerCommands2 = async (program) => {
16417
16417
 
16418
16418
  export { metadata2, registerCommands2 };
16419
16419
 
16420
- //# debugId=8C38DAC30991CBEA64756E2164756E21
16420
+ //# debugId=67231D1C7F4CEAB664756E2164756E21
package/dist/tool.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  metadata2,
3
3
  registerCommands2
4
- } from "./tool-evfkyyvc.js";
5
- import"./tool-kabfszcg.js";
6
- import"./tool-bhbmn53g.js";
4
+ } from "./tool-hert9chm.js";
5
+ import"./tool-7jm6dh39.js";
6
+ import"./tool-91e9n6z7.js";
7
7
  export {
8
8
  metadata2 as metadata,
9
9
  registerCommands2 as registerCommands
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/orchestrator-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.206.0-preview.311",
5
+ "version": "1.206.0-preview.323",
6
6
  "description": "Manage Orchestrator folders, jobs, processes, and releases.",
7
7
  "private": false,
8
8
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "gitHead": "562a7f94aae12bb340f2b18932e8809c3d76a3e0"
30
+ "gitHead": "a752d8a8d78de138e3be0a19642620fec7893d99"
31
31
  }