@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.
@@ -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);
@@ -249,7 +269,7 @@ class NodeFileSystem {
249
269
  async getTempDir() {
250
270
  return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
251
271
  }
252
- async copyDirectory(sourcePath, destPath) {
272
+ async copyDirectory(sourcePath, destPath, options) {
253
273
  const sourceStats = await this.stat(sourcePath);
254
274
  if (!sourceStats) {
255
275
  throw new Error(`Source directory does not exist: ${sourcePath}`);
@@ -266,7 +286,9 @@ class NodeFileSystem {
266
286
  if (!entryStats)
267
287
  continue;
268
288
  if (entryStats.isDirectory()) {
269
- await this.copyDirectory(srcEntry, destEntry);
289
+ if (options?.skipDirectoryNames?.includes(entry))
290
+ continue;
291
+ await this.copyDirectory(srcEntry, destEntry, options);
270
292
  } else if (entryStats.isFile()) {
271
293
  const content = await this.readFile(srcEntry);
272
294
  if (content !== null) {
@@ -289,4 +311,4 @@ var getFileSystem = () => fsInstance;
289
311
 
290
312
  export { getFileSystem };
291
313
 
292
- //# debugId=26FA437280C22B0A64756E2164756E21
314
+ //# debugId=3CC285A0C149904864756E2164756E21
@@ -1,6 +1,8 @@
1
1
  // ../auth/src/constants.ts
2
2
  var UIPATH_HOME_DIR = ".uipath";
3
3
  var AUTH_FILENAME = ".auth";
4
+ var AUTH_FILE_MODE = 384;
5
+ var AUTH_DIR_MODE = 448;
4
6
  var DEFAULT_BASE_URL = "https://cloud.uipath.com";
5
7
  var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
6
8
  var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT";
@@ -8,6 +10,6 @@ var AUTH_CANCELLED_ERROR_CODE = "EAUTHCANCELLED";
8
10
  var AUTH_RECLAIMED_ERROR_CODE = "EAUTHRECLAIMED";
9
11
  var DEFAULT_REDIRECT_URI = "http://localhost:8104/oidc/login";
10
12
 
11
- export { UIPATH_HOME_DIR, AUTH_FILENAME, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS, AUTH_TIMEOUT_ERROR_CODE, AUTH_CANCELLED_ERROR_CODE, AUTH_RECLAIMED_ERROR_CODE, DEFAULT_REDIRECT_URI };
13
+ export { UIPATH_HOME_DIR, AUTH_FILENAME, AUTH_FILE_MODE, AUTH_DIR_MODE, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS, AUTH_TIMEOUT_ERROR_CODE, AUTH_CANCELLED_ERROR_CODE, AUTH_RECLAIMED_ERROR_CODE, DEFAULT_REDIRECT_URI };
12
14
 
13
- //# debugId=75C147C6FAA3208364756E2164756E21
15
+ //# debugId=FE857CCE09A5879F64756E2164756E21