@uipath/case-tool 1.200.0-preview.109 → 1.201.0-preview.115

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.
@@ -0,0 +1,31 @@
1
+ // ../auth/src/catch-error.ts
2
+ function isPromiseLike(value) {
3
+ return value !== null && typeof value === "object" && typeof value.then === "function";
4
+ }
5
+ function catchError(fnOrPromise) {
6
+ if (isPromiseLike(fnOrPromise)) {
7
+ return settlePromiseLike(fnOrPromise);
8
+ }
9
+ try {
10
+ const result = fnOrPromise();
11
+ if (isPromiseLike(result)) {
12
+ return settlePromiseLike(result);
13
+ }
14
+ return [undefined, result];
15
+ } catch (error) {
16
+ return [
17
+ error instanceof Error ? error : new Error(String(error)),
18
+ undefined
19
+ ];
20
+ }
21
+ }
22
+ function settlePromiseLike(thenable) {
23
+ return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [
24
+ error instanceof Error ? error : new Error(String(error)),
25
+ undefined
26
+ ]);
27
+ }
28
+
29
+ export { catchError };
30
+
31
+ //# debugId=CD090F76722F72E364756E2164756E21
package/dist/tool.js CHANGED
@@ -1,19 +1,21 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./packager-tool-6c5a7pex.js";
5
- import"./packager-tool-qz3cg5tg.js";
4
+ } from "./packager-tool-pj8j9a59.js";
5
+ import"./packager-tool-pcd0vhvd.js";
6
+ import"./packager-tool-kvgt1s4z.js";
6
7
  import"./packager-tool-sc961w0q.js";
7
- import"./packager-tool-8eennarq.js";
8
- import"./packager-tool-9qecd4wb.js";
9
- import"./packager-tool-4f38v0ry.js";
10
- import"./packager-tool-1ps2qeqg.js";
11
8
  import"./packager-tool-973f0r2g.js";
12
9
  import"./packager-tool-c23zrhj8.js";
10
+ import"./packager-tool-8eennarq.js";
11
+ import"./packager-tool-9qecd4wb.js";
12
+ import"./packager-tool-qa9gftnj.js";
13
+ import"./packager-tool-1cb0d5e0.js";
14
+ import"./packager-tool-5arsyj36.js";
13
15
  import"./packager-tool-wckvcay0.js";
14
16
  export {
15
17
  registerCommands,
16
18
  metadata
17
19
  };
18
20
 
19
- //# debugId=5FBBAAC25D1BBA2A64756E2164756E21
21
+ //# debugId=F5FDED0F3E3B063764756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/case-tool",
3
3
  "license": "MIT",
4
- "version": "1.200.0-preview.109",
4
+ "version": "1.201.0-preview.115",
5
5
  "description": "Manage Case Management instances, processes, and incidents.",
6
6
  "private": false,
7
7
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "gitHead": "fcc01cdae81bbd0c25d3d4fc287537a9d19d99f4"
30
+ "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
31
31
  }
@@ -1,63 +0,0 @@
1
- import {
2
- catchError,
3
- getFileSystem,
4
- startServer
5
- } from "./packager-tool-4f38v0ry.js";
6
- import"./packager-tool-1ps2qeqg.js";
7
- import"./packager-tool-wckvcay0.js";
8
-
9
- // ../auth/src/strategies/node-strategy.ts
10
- class NodeAuthStrategy {
11
- async execute(url, redirectUri, expectedState, opts) {
12
- const fs = getFileSystem();
13
- const callbackUrl = await startServer({
14
- redirectUri,
15
- timeoutMs: opts?.timeoutMs,
16
- signal: opts?.signal,
17
- onListening: async () => {
18
- let safeUrl = "";
19
- for (const ch of url) {
20
- const c = ch.charCodeAt(0);
21
- if (c > 31 && (c < 128 || c > 159))
22
- safeUrl += ch;
23
- }
24
- if (opts?.noBrowser) {
25
- if (!opts.onAuthUrl) {
26
- throw new Error("Headless login (noBrowser) requires an onAuthUrl handler " + "to surface the authorize URL, but none was provided.");
27
- }
28
- opts.onAuthUrl(safeUrl);
29
- return;
30
- }
31
- const [openError] = await catchError(fs.utils.open(url));
32
- if (!openError)
33
- return;
34
- const isSpawnError = "code" in openError && openError.code === "ENOENT";
35
- if (isSpawnError) {
36
- throw new Error("Could not open a browser. No supported browser launcher was found. " + `On a headless or minimal system, use non-interactive login instead:
37
-
38
- ` + ` uip login --client-id <id> --client-secret <secret> -t <tenant>
39
-
40
- ` + "Or install a browser opener for your OS (e.g. xdg-utils on Linux).", { cause: openError });
41
- }
42
- throw new Error("Could not open the browser automatically. " + `Visit this URL to authenticate:
43
-
44
- ${safeUrl}
45
- `, { cause: openError });
46
- }
47
- });
48
- const returnedState = callbackUrl.searchParams.get("state");
49
- if (returnedState !== expectedState) {
50
- throw new Error("OAuth state mismatch — the callback state does not match the expected value. " + "This may indicate a CSRF attack. Please try signing in again.");
51
- }
52
- const code = callbackUrl.searchParams.get("code");
53
- if (!code) {
54
- throw new Error("No authorization code received");
55
- }
56
- return code;
57
- }
58
- }
59
- export {
60
- NodeAuthStrategy
61
- };
62
-
63
- //# debugId=E5B2BD2B3B179D3D64756E2164756E21