@uipath/tasks-tool 1.199.0 → 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.
- package/dist/browser-strategy-yccf8mtd.js +99 -0
- package/dist/getMachineId-bsd-wfkxpxjv.js +38 -0
- package/dist/getMachineId-darwin-9asn4zy6.js +38 -0
- package/dist/getMachineId-linux-62t6m027.js +31 -0
- package/dist/getMachineId-unsupported-dfrzeqc3.js +21 -0
- package/dist/getMachineId-win-zgvrp5q3.js +40 -0
- package/dist/index-2fj08e7n.js +2058 -0
- package/dist/index-w03qc9m8.js +634 -0
- package/dist/index.js +14 -2148
- package/dist/js-yaml-4ypbq2tt.js +3145 -0
- package/dist/node-strategy-12qfy0nv.js +348 -0
- package/dist/tool-0v6na3yp.js +37 -0
- package/dist/tool-5arsyj36.js +11 -0
- package/dist/tool-7eva0peq.js +265 -0
- package/dist/tool-9qecd4wb.js +14 -0
- package/dist/tool-h1k9mjs9.js +17 -0
- package/dist/tool-r6rhp5ep.js +1487 -0
- package/dist/tool-vw6gha5d.js +21258 -0
- package/dist/tool.js +10 -46878
- package/package.json +2 -2
- package/src/commands/tasks.ts +3 -2
- package/tests/assign.e2e.test.ts +166 -0
- package/tests/assignable-users.e2e.test.ts +113 -0
- package/tests/complete.e2e.test.ts +207 -0
- package/tests/get.e2e.test.ts +101 -0
- package/tests/list.e2e.test.ts +124 -0
- package/tests/performance.e2e.test.ts +9 -5
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { RESULTS } from "@uipath/common";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import {
|
|
4
|
+
type E2EManifest,
|
|
5
|
+
MANIFEST_PATH,
|
|
6
|
+
} from "../../../tests/e2e-shared/global-setup";
|
|
7
|
+
import {
|
|
8
|
+
EXEC_TIMEOUT,
|
|
9
|
+
localCliRaw,
|
|
10
|
+
parseOutput,
|
|
11
|
+
readManifest,
|
|
12
|
+
} from "../../../tests/e2e-shared/helpers";
|
|
13
|
+
|
|
14
|
+
// Scenario: scenarios/tasks-tool/list.md
|
|
15
|
+
// `uip tasks list` — paginated enumeration of Action Center tasks.
|
|
16
|
+
|
|
17
|
+
interface ListEnvelope {
|
|
18
|
+
Result: string;
|
|
19
|
+
Code?: string;
|
|
20
|
+
Data?: unknown;
|
|
21
|
+
Message?: string;
|
|
22
|
+
Instructions?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// `tasks list` passes through the raw SDK task payload, which is
|
|
26
|
+
// PascalCase (Id/FolderId/...) — confirmed against a live tenant.
|
|
27
|
+
interface TaskSummary {
|
|
28
|
+
FolderId?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const { tempDir } = readManifest<E2EManifest>(MANIFEST_PATH).sharedInstall;
|
|
32
|
+
|
|
33
|
+
/** Discover a real folder ID via `tasks list`, or undefined if none is visible. */
|
|
34
|
+
function discoverFolderId(): string | undefined {
|
|
35
|
+
const raw = localCliRaw(tempDir, "tasks list --limit 1 --output json");
|
|
36
|
+
if (raw.exitCode !== 0) return undefined;
|
|
37
|
+
const res = parseOutput(raw.stdout, "json") as { Data?: TaskSummary[] };
|
|
38
|
+
const folderId = res.Data?.[0]?.FolderId;
|
|
39
|
+
return typeof folderId === "number" ? String(folderId) : undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
describe("tasks list e2e", () => {
|
|
43
|
+
it(
|
|
44
|
+
"S1: lists tasks across all folders",
|
|
45
|
+
() => {
|
|
46
|
+
const raw = localCliRaw(tempDir, "tasks list --output json");
|
|
47
|
+
const res = parseOutput(raw.stdout, "json") as ListEnvelope;
|
|
48
|
+
expect(raw.exitCode, JSON.stringify(res)).toBe(0);
|
|
49
|
+
expect(res.Result).toBe(RESULTS.Success);
|
|
50
|
+
expect(res.Code).toBe("TaskList");
|
|
51
|
+
expect(Array.isArray(res.Data)).toBe(true);
|
|
52
|
+
},
|
|
53
|
+
EXEC_TIMEOUT,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
it(
|
|
57
|
+
"S2: limits the number of returned tasks",
|
|
58
|
+
() => {
|
|
59
|
+
const raw = localCliRaw(
|
|
60
|
+
tempDir,
|
|
61
|
+
"tasks list --limit 1 --output json",
|
|
62
|
+
);
|
|
63
|
+
const res = parseOutput(raw.stdout, "json") as ListEnvelope;
|
|
64
|
+
expect(raw.exitCode, JSON.stringify(res)).toBe(0);
|
|
65
|
+
expect(res.Result).toBe(RESULTS.Success);
|
|
66
|
+
expect(res.Code).toBe("TaskList");
|
|
67
|
+
expect((res.Data as unknown[]).length).toBeLessThanOrEqual(1);
|
|
68
|
+
},
|
|
69
|
+
EXEC_TIMEOUT,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
it(
|
|
73
|
+
"S3: filters by folder ID",
|
|
74
|
+
() => {
|
|
75
|
+
// A hardcoded placeholder folder ID isn't guaranteed to exist —
|
|
76
|
+
// or be accessible to this login — on every tenant. Discover a
|
|
77
|
+
// real one from an actual task instead.
|
|
78
|
+
const folderId = discoverFolderId();
|
|
79
|
+
if (!folderId) return;
|
|
80
|
+
const raw = localCliRaw(
|
|
81
|
+
tempDir,
|
|
82
|
+
`tasks list --folder-id ${folderId} --output json`,
|
|
83
|
+
);
|
|
84
|
+
const res = parseOutput(raw.stdout, "json") as ListEnvelope;
|
|
85
|
+
expect(raw.exitCode, JSON.stringify(res)).toBe(0);
|
|
86
|
+
expect(res.Result).toBe(RESULTS.Success);
|
|
87
|
+
expect(res.Code).toBe("TaskList");
|
|
88
|
+
expect(Array.isArray(res.Data)).toBe(true);
|
|
89
|
+
},
|
|
90
|
+
EXEC_TIMEOUT,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
it(
|
|
94
|
+
"S4: invalid --folder-id reports a validation error",
|
|
95
|
+
() => {
|
|
96
|
+
const raw = localCliRaw(
|
|
97
|
+
tempDir,
|
|
98
|
+
"tasks list --folder-id not-a-number --output json",
|
|
99
|
+
);
|
|
100
|
+
expect(raw.exitCode).not.toBe(0);
|
|
101
|
+
const res = parseOutput(raw.stdout, "json") as ListEnvelope;
|
|
102
|
+
expect(res.Result).toBe(RESULTS.Failure);
|
|
103
|
+
expect(res.Message).toMatch(/Invalid --folder-id/);
|
|
104
|
+
expect(res.Instructions).toBe("Must be a positive integer.");
|
|
105
|
+
},
|
|
106
|
+
EXEC_TIMEOUT,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
it(
|
|
110
|
+
"S5: invalid --limit reports a validation error",
|
|
111
|
+
() => {
|
|
112
|
+
const raw = localCliRaw(
|
|
113
|
+
tempDir,
|
|
114
|
+
"tasks list --limit not-a-number --output json",
|
|
115
|
+
);
|
|
116
|
+
expect(raw.exitCode).not.toBe(0);
|
|
117
|
+
const res = parseOutput(raw.stdout, "json") as ListEnvelope;
|
|
118
|
+
expect(res.Result).toBe(RESULTS.Failure);
|
|
119
|
+
expect(res.Message).toMatch(/Invalid --limit/);
|
|
120
|
+
expect(res.Instructions).toBe("Must be a positive integer.");
|
|
121
|
+
},
|
|
122
|
+
EXEC_TIMEOUT,
|
|
123
|
+
);
|
|
124
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, it } from "vitest";
|
|
2
2
|
import {
|
|
3
3
|
type E2EManifest,
|
|
4
4
|
MANIFEST_PATH,
|
|
5
5
|
} from "../../../tests/e2e-shared/global-setup";
|
|
6
6
|
import {
|
|
7
|
+
assertHelpCommandDuration,
|
|
7
8
|
EXEC_TIMEOUT,
|
|
8
|
-
localCliRaw,
|
|
9
9
|
readManifest,
|
|
10
10
|
} from "../../../tests/e2e-shared/helpers";
|
|
11
11
|
|
|
@@ -19,9 +19,13 @@ describe.skipIf(process.platform === "win32")("tasks performance", () => {
|
|
|
19
19
|
it(
|
|
20
20
|
`uip tasks -h completes within ${HELP_BUDGET_MS}ms`,
|
|
21
21
|
() => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
assertHelpCommandDuration({
|
|
23
|
+
projectDir,
|
|
24
|
+
packageName: "@uipath/tasks-tool",
|
|
25
|
+
args: "tasks -h",
|
|
26
|
+
thresholdMs: HELP_BUDGET_MS,
|
|
27
|
+
testFileUrl: import.meta.url,
|
|
28
|
+
});
|
|
25
29
|
},
|
|
26
30
|
EXEC_TIMEOUT,
|
|
27
31
|
);
|