@uipath/tasks-tool 1.202.0-preview.140 → 1.202.0-preview.142
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 +1 -1
- package/dist/{tool-4er8cbf1.js → tool-315h4wtj.js} +5 -2
- package/dist/tool.js +1 -1
- package/package.json +5 -2
- package/browser.json +0 -4
- package/src/commands/_shared/catalog-options.spec.ts +0 -114
- package/src/commands/_shared/catalog-options.ts +0 -122
- package/src/commands/_shared/connect.spec.ts +0 -52
- package/src/commands/_shared/connect.ts +0 -31
- package/src/commands/_shared/constants.ts +0 -1
- package/src/commands/_shared/folder-picker-interactive.spec.ts +0 -92
- package/src/commands/_shared/folder-picker-interactive.ts +0 -76
- package/src/commands/_shared/folder-picker.spec.ts +0 -159
- package/src/commands/_shared/folder-picker.ts +0 -113
- package/src/commands/_shared/folder-resolver.spec.ts +0 -152
- package/src/commands/_shared/folder-resolver.ts +0 -113
- package/src/commands/_shared/parse.spec.ts +0 -69
- package/src/commands/_shared/parse.ts +0 -43
- package/src/commands/catalogs.ts +0 -281
- package/src/commands/comments.ts +0 -160
- package/src/commands/data.ts +0 -137
- package/src/commands/labels.ts +0 -93
- package/src/commands/metadata.ts +0 -139
- package/src/commands/tasks.spec.ts +0 -2449
- package/src/commands/tasks.ts +0 -631
- package/src/index.ts +0 -12
- package/src/tool.ts +0 -24
- package/src/utils/sdk-client.ts +0 -30
- package/tests/assign.e2e.test.ts +0 -166
- package/tests/assignable-users.e2e.test.ts +0 -167
- package/tests/catalogs.e2e.test.ts +0 -418
- package/tests/comments.e2e.test.ts +0 -223
- package/tests/complete.e2e.test.ts +0 -207
- package/tests/data.e2e.test.ts +0 -187
- package/tests/get.e2e.test.ts +0 -103
- package/tests/labels.e2e.test.ts +0 -184
- package/tests/list.e2e.test.ts +0 -234
- package/tests/metadata.e2e.test.ts +0 -186
- package/tests/performance.e2e.test.ts +0 -32
- package/tsconfig.json +0 -9
- package/vitest.config.ts +0 -1
package/tests/assign.e2e.test.ts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { RESULTS } from "@uipath/common";
|
|
2
|
-
import { beforeAll, 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/assign.md
|
|
15
|
-
// `uip tasks assign` / `reassign` / `unassign` — assignment lifecycle.
|
|
16
|
-
|
|
17
|
-
interface AssignEnvelope {
|
|
18
|
-
Result: string;
|
|
19
|
-
Code?: string;
|
|
20
|
-
Data?: unknown;
|
|
21
|
-
Message?: string;
|
|
22
|
-
Instructions?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// `tasks list`/`get` pass through the raw SDK task payload, which is
|
|
26
|
-
// PascalCase (Id/FolderId/Status/...) — confirmed against a live tenant.
|
|
27
|
-
interface TaskSummary {
|
|
28
|
-
Id?: number;
|
|
29
|
-
FolderId?: number;
|
|
30
|
-
Status?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const { tempDir } = readManifest<E2EManifest>(MANIFEST_PATH).sharedInstall;
|
|
34
|
-
|
|
35
|
-
describe("tasks assign e2e", () => {
|
|
36
|
-
let taskId: string | undefined;
|
|
37
|
-
let folderId: string | undefined;
|
|
38
|
-
let userIds: string[] = [];
|
|
39
|
-
|
|
40
|
-
beforeAll(() => {
|
|
41
|
-
// Fetch a batch and pick an actually-unassigned task — assigning an
|
|
42
|
-
// already-assigned task is a valid but different code path, and
|
|
43
|
-
// asserting `TaskAssigned` against it would be a flaky fixture choice.
|
|
44
|
-
const listRaw = localCliRaw(
|
|
45
|
-
tempDir,
|
|
46
|
-
"tasks list --limit 50 --output json",
|
|
47
|
-
);
|
|
48
|
-
if (listRaw.exitCode === 0) {
|
|
49
|
-
const listRes = parseOutput(listRaw.stdout, "json") as {
|
|
50
|
-
Data?: TaskSummary[];
|
|
51
|
-
};
|
|
52
|
-
const task = (listRes.Data ?? []).find(
|
|
53
|
-
(t) => t.Status === "Unassigned",
|
|
54
|
-
);
|
|
55
|
-
if (task?.Id !== undefined) {
|
|
56
|
-
taskId = String(task.Id);
|
|
57
|
-
folderId =
|
|
58
|
-
task.FolderId !== undefined
|
|
59
|
-
? String(task.FolderId)
|
|
60
|
-
: undefined;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (folderId) {
|
|
65
|
-
const usersRaw = localCliRaw(
|
|
66
|
-
tempDir,
|
|
67
|
-
`tasks users ${folderId} --output json`,
|
|
68
|
-
);
|
|
69
|
-
if (usersRaw.exitCode === 0) {
|
|
70
|
-
// `tasks users` passes through the raw SDK payload, which is
|
|
71
|
-
// PascalCase (Id/Name/...) — unlike `tasks list`/`tasks get`,
|
|
72
|
-
// which return camelCase. Confirmed against a live tenant.
|
|
73
|
-
const usersRes = parseOutput(usersRaw.stdout, "json") as {
|
|
74
|
-
Data?: Array<{ Id?: number; Type?: string }>;
|
|
75
|
-
};
|
|
76
|
-
userIds = (usersRes.Data ?? [])
|
|
77
|
-
.filter((u) => u.Type === "DirectoryUser")
|
|
78
|
-
.map((u) => u.Id)
|
|
79
|
-
.filter((id): id is number => id !== undefined)
|
|
80
|
-
.map(String);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}, EXEC_TIMEOUT);
|
|
84
|
-
|
|
85
|
-
// ── Deterministic (no tenant) ────────────────────────────────────────────
|
|
86
|
-
|
|
87
|
-
it(
|
|
88
|
-
"S1: assign without --user-id or --user is rejected",
|
|
89
|
-
() => {
|
|
90
|
-
const raw = localCliRaw(tempDir, "tasks assign 5 --output json");
|
|
91
|
-
expect(raw.exitCode).toBe(1);
|
|
92
|
-
const res = parseOutput(raw.stdout, "json") as AssignEnvelope;
|
|
93
|
-
expect(res.Result).toBe(RESULTS.Failure);
|
|
94
|
-
expect(res.Message).toBe("Missing assignee");
|
|
95
|
-
expect(res.Instructions).toBe(
|
|
96
|
-
"Provide either --user-id or --user to specify the assignee.",
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
EXEC_TIMEOUT,
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
it(
|
|
103
|
-
"S2: reassign without --user-id or --user is rejected",
|
|
104
|
-
() => {
|
|
105
|
-
const raw = localCliRaw(tempDir, "tasks reassign 5 --output json");
|
|
106
|
-
expect(raw.exitCode).toBe(1);
|
|
107
|
-
const res = parseOutput(raw.stdout, "json") as AssignEnvelope;
|
|
108
|
-
expect(res.Result).toBe(RESULTS.Failure);
|
|
109
|
-
expect(res.Message).toBe("Missing assignee");
|
|
110
|
-
expect(res.Instructions).toBe(
|
|
111
|
-
"Provide either --user-id or --user to specify the new assignee.",
|
|
112
|
-
);
|
|
113
|
-
},
|
|
114
|
-
EXEC_TIMEOUT,
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
// ── Tenant read/write (guarded — skip if the tenant has no usable fixture) ─
|
|
118
|
-
|
|
119
|
-
it(
|
|
120
|
-
"S3: assigns a task to a user by --user-id",
|
|
121
|
-
() => {
|
|
122
|
-
if (!taskId || userIds.length === 0) return;
|
|
123
|
-
const raw = localCliRaw(
|
|
124
|
-
tempDir,
|
|
125
|
-
`tasks assign ${taskId} --user-id ${userIds[0]} --output json`,
|
|
126
|
-
);
|
|
127
|
-
expect(raw.exitCode).toBe(0);
|
|
128
|
-
const res = parseOutput(raw.stdout, "json") as AssignEnvelope;
|
|
129
|
-
expect(res.Result).toBe(RESULTS.Success);
|
|
130
|
-
expect(res.Code).toBe("TaskAssigned");
|
|
131
|
-
},
|
|
132
|
-
EXEC_TIMEOUT,
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
it(
|
|
136
|
-
"S4: reassigns a task to a different user",
|
|
137
|
-
() => {
|
|
138
|
-
if (!taskId || userIds.length < 2) return;
|
|
139
|
-
const raw = localCliRaw(
|
|
140
|
-
tempDir,
|
|
141
|
-
`tasks reassign ${taskId} --user-id ${userIds[1]} --output json`,
|
|
142
|
-
);
|
|
143
|
-
expect(raw.exitCode).toBe(0);
|
|
144
|
-
const res = parseOutput(raw.stdout, "json") as AssignEnvelope;
|
|
145
|
-
expect(res.Result).toBe(RESULTS.Success);
|
|
146
|
-
expect(res.Code).toBe("TaskReassigned");
|
|
147
|
-
},
|
|
148
|
-
EXEC_TIMEOUT,
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
it(
|
|
152
|
-
"S5: unassign removes the assignee",
|
|
153
|
-
() => {
|
|
154
|
-
if (!taskId || userIds.length === 0) return;
|
|
155
|
-
const raw = localCliRaw(
|
|
156
|
-
tempDir,
|
|
157
|
-
`tasks unassign ${taskId} --output json`,
|
|
158
|
-
);
|
|
159
|
-
expect(raw.exitCode).toBe(0);
|
|
160
|
-
const res = parseOutput(raw.stdout, "json") as AssignEnvelope;
|
|
161
|
-
expect(res.Result).toBe(RESULTS.Success);
|
|
162
|
-
expect(res.Code).toBe("TaskUnassigned");
|
|
163
|
-
},
|
|
164
|
-
EXEC_TIMEOUT,
|
|
165
|
-
);
|
|
166
|
-
});
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { RESULTS } from "@uipath/common";
|
|
2
|
-
import { beforeAll, 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
|
-
localCliRawWithArgs,
|
|
11
|
-
parseOutput,
|
|
12
|
-
readManifest,
|
|
13
|
-
} from "../../../tests/e2e-shared/helpers";
|
|
14
|
-
|
|
15
|
-
// Scenario: scenarios/tasks-tool/assignable-users.md
|
|
16
|
-
// `uip tasks users <folder-id>` — discover assignable users in a folder.
|
|
17
|
-
|
|
18
|
-
interface UsersEnvelope {
|
|
19
|
-
Result: string;
|
|
20
|
-
Code?: string;
|
|
21
|
-
Data?: unknown;
|
|
22
|
-
Message?: string;
|
|
23
|
-
Instructions?: string;
|
|
24
|
-
ErrorCode?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// `tasks list` passes through the raw SDK task payload, which is
|
|
28
|
-
// PascalCase (Id/FolderId/...) — confirmed against a live tenant.
|
|
29
|
-
interface TaskSummary {
|
|
30
|
-
Id?: number;
|
|
31
|
-
FolderId?: number;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const { tempDir } = readManifest<E2EManifest>(MANIFEST_PATH).sharedInstall;
|
|
35
|
-
|
|
36
|
-
describe("tasks users e2e", () => {
|
|
37
|
-
let folderId: string | undefined;
|
|
38
|
-
|
|
39
|
-
beforeAll(() => {
|
|
40
|
-
const listRaw = localCliRaw(
|
|
41
|
-
tempDir,
|
|
42
|
-
"tasks list --limit 1 --output json",
|
|
43
|
-
);
|
|
44
|
-
if (listRaw.exitCode !== 0) return;
|
|
45
|
-
const listRes = parseOutput(listRaw.stdout, "json") as {
|
|
46
|
-
Data?: TaskSummary[];
|
|
47
|
-
};
|
|
48
|
-
const fid = listRes.Data?.[0]?.FolderId;
|
|
49
|
-
folderId = fid !== undefined ? String(fid) : undefined;
|
|
50
|
-
}, EXEC_TIMEOUT);
|
|
51
|
-
|
|
52
|
-
it(
|
|
53
|
-
"S1: missing folder fails loud when not interactive",
|
|
54
|
-
() => {
|
|
55
|
-
const raw = localCliRaw(tempDir, "tasks users --output json");
|
|
56
|
-
expect(raw.exitCode).not.toBe(0);
|
|
57
|
-
const res = parseOutput(raw.stdout, "json") as UsersEnvelope;
|
|
58
|
-
expect(res.Result).toBe(RESULTS.Failure);
|
|
59
|
-
expect(res.Message).toBe("A folder is required");
|
|
60
|
-
expect(res.Instructions).toMatch(/folder-id argument/);
|
|
61
|
-
expect(res.Instructions).toMatch(/--folder-path/);
|
|
62
|
-
expect(res.Instructions).not.toMatch(/--folder-id/);
|
|
63
|
-
},
|
|
64
|
-
EXEC_TIMEOUT,
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
it(
|
|
68
|
-
"S2: lists users with task permissions in a folder",
|
|
69
|
-
() => {
|
|
70
|
-
if (!folderId) return; // no tenant task/folder to discover from
|
|
71
|
-
const raw = localCliRaw(
|
|
72
|
-
tempDir,
|
|
73
|
-
`tasks users ${folderId} --output json`,
|
|
74
|
-
);
|
|
75
|
-
expect(raw.exitCode).toBe(0);
|
|
76
|
-
const res = parseOutput(raw.stdout, "json") as UsersEnvelope;
|
|
77
|
-
expect(res.Result).toBe(RESULTS.Success);
|
|
78
|
-
expect(res.Code).toBe("TaskUserList");
|
|
79
|
-
expect(Array.isArray(res.Data)).toBe(true);
|
|
80
|
-
},
|
|
81
|
-
EXEC_TIMEOUT,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
it(
|
|
85
|
-
"S3: limits the number of returned users",
|
|
86
|
-
() => {
|
|
87
|
-
if (!folderId) return;
|
|
88
|
-
const raw = localCliRaw(
|
|
89
|
-
tempDir,
|
|
90
|
-
`tasks users ${folderId} --limit 1 --output json`,
|
|
91
|
-
);
|
|
92
|
-
expect(raw.exitCode).toBe(0);
|
|
93
|
-
const res = parseOutput(raw.stdout, "json") as UsersEnvelope;
|
|
94
|
-
expect(res.Result).toBe(RESULTS.Success);
|
|
95
|
-
expect(res.Code).toBe("TaskUserList");
|
|
96
|
-
expect((res.Data as unknown[]).length).toBeLessThanOrEqual(1);
|
|
97
|
-
},
|
|
98
|
-
EXEC_TIMEOUT,
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
it(
|
|
102
|
-
"S4: non-numeric folder-id is rejected",
|
|
103
|
-
() => {
|
|
104
|
-
const raw = localCliRaw(
|
|
105
|
-
tempDir,
|
|
106
|
-
"tasks users not-a-number --output json",
|
|
107
|
-
);
|
|
108
|
-
expect(raw.exitCode).not.toBe(0);
|
|
109
|
-
const res = parseOutput(raw.stdout, "json") as UsersEnvelope;
|
|
110
|
-
expect(res.Result).toBe(RESULTS.Failure);
|
|
111
|
-
expect(res.Message).toMatch(/Invalid <folder-id>/);
|
|
112
|
-
expect(res.Instructions).toBe("Must be a positive integer.");
|
|
113
|
-
},
|
|
114
|
-
EXEC_TIMEOUT,
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
it(
|
|
118
|
-
"S5: lists users by folder path",
|
|
119
|
-
() => {
|
|
120
|
-
const foldersRaw = localCliRaw(
|
|
121
|
-
tempDir,
|
|
122
|
-
"or folders list --output json",
|
|
123
|
-
);
|
|
124
|
-
if (foldersRaw.exitCode !== 0) return;
|
|
125
|
-
const foldersRes = parseOutput(foldersRaw.stdout, "json") as {
|
|
126
|
-
Data?: { Path?: string; Name?: string }[];
|
|
127
|
-
};
|
|
128
|
-
const first = foldersRes.Data?.[0];
|
|
129
|
-
const path = first?.Path || first?.Name;
|
|
130
|
-
if (!path) return;
|
|
131
|
-
|
|
132
|
-
// API-derived value — pass as its own argument, never through a
|
|
133
|
-
// shell-interpolated string.
|
|
134
|
-
const raw = localCliRawWithArgs(tempDir, [
|
|
135
|
-
"tasks",
|
|
136
|
-
"users",
|
|
137
|
-
"--folder-path",
|
|
138
|
-
path,
|
|
139
|
-
"--output",
|
|
140
|
-
"json",
|
|
141
|
-
]);
|
|
142
|
-
expect(raw.exitCode).toBe(0);
|
|
143
|
-
const res = parseOutput(raw.stdout, "json") as UsersEnvelope;
|
|
144
|
-
expect(res.Result).toBe(RESULTS.Success);
|
|
145
|
-
expect(res.Code).toBe("TaskUserList");
|
|
146
|
-
expect(Array.isArray(res.Data)).toBe(true);
|
|
147
|
-
},
|
|
148
|
-
EXEC_TIMEOUT,
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
it(
|
|
152
|
-
"S6: the folder-id argument and folder options are mutually exclusive",
|
|
153
|
-
() => {
|
|
154
|
-
const raw = localCliRaw(
|
|
155
|
-
tempDir,
|
|
156
|
-
"tasks users 42 --folder-path Shared --output json",
|
|
157
|
-
);
|
|
158
|
-
expect(raw.exitCode).not.toBe(0);
|
|
159
|
-
const res = parseOutput(raw.stdout, "json") as UsersEnvelope;
|
|
160
|
-
expect(res.Result).toBe(RESULTS.Failure);
|
|
161
|
-
expect(res.Message).toBe(
|
|
162
|
-
"The folder-id argument cannot be used with --folder-path or --folder-key",
|
|
163
|
-
);
|
|
164
|
-
},
|
|
165
|
-
EXEC_TIMEOUT,
|
|
166
|
-
);
|
|
167
|
-
});
|