@uipath/ixp-tool 1.206.0-preview.312 → 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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  package_default,
4
4
  Command,
5
5
  registerCommands2
6
- } from "./tool-g03xk46e.js";
6
+ } from "./tool-ay8erkem.js";
7
7
 
8
8
  // src/index.ts
9
9
  var program = new Command;
@@ -2082,7 +2082,7 @@ var package_default = {
2082
2082
  name: "@uipath/ixp-tool",
2083
2083
  author: "UiPath",
2084
2084
  license: "SEE LICENSE IN LICENSE.txt",
2085
- version: "1.206.0-preview.312",
2085
+ version: "1.206.0-preview.323",
2086
2086
  description: "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
2087
2087
  private: false,
2088
2088
  repository: {
@@ -2175,12 +2175,26 @@ class NodeFileSystem {
2175
2175
  throw error;
2176
2176
  }
2177
2177
  }
2178
- async writeFile(filePath, data) {
2178
+ async writeFile(filePath, data, options) {
2179
2179
  const dir = path.dirname(filePath);
2180
2180
  if (dir) {
2181
2181
  await fs.mkdir(dir, { recursive: true });
2182
2182
  }
2183
- await fs.writeFile(filePath, data);
2183
+ if (options?.mode === undefined || process.platform === "win32") {
2184
+ if (options?.exclusive) {
2185
+ await fs.writeFile(filePath, data, { flag: "wx" });
2186
+ } else {
2187
+ await fs.writeFile(filePath, data);
2188
+ }
2189
+ return;
2190
+ }
2191
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
2192
+ try {
2193
+ await handle.chmod(options.mode);
2194
+ await handle.writeFile(data);
2195
+ } finally {
2196
+ await handle.close();
2197
+ }
2184
2198
  }
2185
2199
  async appendFile(filePath, data) {
2186
2200
  const dir = path.dirname(filePath);
@@ -2215,7 +2229,8 @@ class NodeFileSystem {
2215
2229
  isDirectory: () => stats.isDirectory(),
2216
2230
  size: stats.size,
2217
2231
  mtimeMs: stats.mtimeMs,
2218
- ctimeMs: stats.ctimeMs
2232
+ ctimeMs: stats.ctimeMs,
2233
+ mode: stats.mode
2219
2234
  };
2220
2235
  } catch (error) {
2221
2236
  if (this.isEnoent(error))
@@ -2226,8 +2241,13 @@ class NodeFileSystem {
2226
2241
  async exists(filePath) {
2227
2242
  return existsSync(filePath);
2228
2243
  }
2229
- async mkdir(dirPath) {
2230
- await fs.mkdir(dirPath, { recursive: true });
2244
+ async mkdir(dirPath, options) {
2245
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
2246
+ }
2247
+ async chmod(targetPath, mode) {
2248
+ if (process.platform === "win32")
2249
+ return;
2250
+ await fs.chmod(targetPath, mode);
2231
2251
  }
2232
2252
  async acquireLock(lockPath) {
2233
2253
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -7194,6 +7214,8 @@ function settlePromiseLike2(thenable) {
7194
7214
  // ../auth/src/constants.ts
7195
7215
  var UIPATH_HOME_DIR = ".uipath";
7196
7216
  var AUTH_FILENAME = ".auth";
7217
+ var AUTH_FILE_MODE = 384;
7218
+ var AUTH_DIR_MODE = 448;
7197
7219
  var DEFAULT_BASE_URL = "https://cloud.uipath.com";
7198
7220
  var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
7199
7221
 
@@ -8017,6 +8039,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
8017
8039
  }
8018
8040
  return parseEnvContent(content);
8019
8041
  };
8042
+ var findAuthHomeDir = (fs, dir) => {
8043
+ let current = dir;
8044
+ for (;; ) {
8045
+ if (fs.path.basename(current) === UIPATH_HOME_DIR)
8046
+ return current;
8047
+ const parent = fs.path.dirname(current);
8048
+ if (parent === current)
8049
+ return;
8050
+ current = parent;
8051
+ }
8052
+ };
8053
+ var TEMP_FILE_ATTEMPTS = 5;
8054
+ var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
8055
+ var writeTempFile = async (fs, targetPath, content) => {
8056
+ for (let attempt = 1;; attempt++) {
8057
+ const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
8058
+ try {
8059
+ await fs.writeFile(tempPath, content, {
8060
+ mode: AUTH_FILE_MODE,
8061
+ exclusive: true
8062
+ });
8063
+ return tempPath;
8064
+ } catch (error) {
8065
+ if (!isFileExists(error)) {
8066
+ await fs.rm(tempPath).catch(() => {});
8067
+ throw error;
8068
+ }
8069
+ if (attempt === TEMP_FILE_ATTEMPTS)
8070
+ throw error;
8071
+ }
8072
+ }
8073
+ };
8020
8074
  var saveEnvFileAsync = async ({
8021
8075
  envPath,
8022
8076
  data,
@@ -8044,10 +8098,18 @@ var saveEnvFileAsync = async ({
8044
8098
  `)}
8045
8099
  `;
8046
8100
  const dir = fs.path.dirname(absolutePath);
8047
- await fs.mkdir(dir);
8048
- const tempPath = `${absolutePath}.tmp`;
8049
- await fs.writeFile(tempPath, content);
8050
- await fs.rename(tempPath, absolutePath);
8101
+ await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
8102
+ const authHomeDir = findAuthHomeDir(fs, dir);
8103
+ if (authHomeDir !== undefined) {
8104
+ await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
8105
+ }
8106
+ const tempPath = await writeTempFile(fs, absolutePath, content);
8107
+ try {
8108
+ await fs.rename(tempPath, absolutePath);
8109
+ } catch (error) {
8110
+ await fs.rm(tempPath).catch(() => {});
8111
+ throw error;
8112
+ }
8051
8113
  };
8052
8114
 
8053
8115
  // ../auth/src/loginStatus.ts
@@ -8647,7 +8709,7 @@ var package_default2 = {
8647
8709
  name: "@uipath/ixp-sdk",
8648
8710
  author: "UiPath",
8649
8711
  license: "SEE LICENSE IN LICENSE.txt",
8650
- version: "1.206.0-preview.312",
8712
+ version: "1.206.0-preview.323",
8651
8713
  description: "SDK for the UiPath IXP (Intelligent eXtraction Platform) API — projects, taxonomies, prompts, predictions, and model publishing.",
8652
8714
  repository: {
8653
8715
  type: "git",
@@ -11588,4 +11650,4 @@ var registerCommands2 = async (program) => {
11588
11650
 
11589
11651
  export { package_default, Command, metadata2, registerCommands2 };
11590
11652
 
11591
- //# debugId=7A08C3B793F20FAB64756E2164756E21
11653
+ //# debugId=1FA3898BB428F50D64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata2,
3
3
  registerCommands2
4
- } from "./tool-g03xk46e.js";
4
+ } from "./tool-ay8erkem.js";
5
5
  export {
6
6
  metadata2 as metadata,
7
7
  registerCommands2 as registerCommands
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/ixp-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.206.0-preview.312",
5
+ "version": "1.206.0-preview.323",
6
6
  "description": "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
7
7
  "private": false,
8
8
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "gitHead": "ee91749054ba110153977dd920a4c84761ce82cd"
30
+ "gitHead": "a752d8a8d78de138e3be0a19642620fec7893d99"
31
31
  }