@bpmnkit/cli 0.0.9
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/README.md +113 -0
- package/dist/args.js +101 -0
- package/dist/client.js +19 -0
- package/dist/color.js +50 -0
- package/dist/commands/admin-shared.js +180 -0
- package/dist/commands/bpmn.js +143 -0
- package/dist/commands/completion.js +52 -0
- package/dist/commands/connector.js +172 -0
- package/dist/commands/index.js +47 -0
- package/dist/commands/profile.js +325 -0
- package/dist/commands/relations.js +28 -0
- package/dist/commands/settings.js +138 -0
- package/dist/commands/shared.js +196 -0
- package/dist/commands/worker.js +135 -0
- package/dist/completion.js +89 -0
- package/dist/generated/admin-commands.js +407 -0
- package/dist/generated/commands.js +2101 -0
- package/dist/help.js +117 -0
- package/dist/index.js +4 -0
- package/dist/output.js +262 -0
- package/dist/profile-tui.js +229 -0
- package/dist/profile.js +103 -0
- package/dist/run.js +210 -0
- package/dist/settings-tui.js +195 -0
- package/dist/tui.js +2544 -0
- package/dist/types.js +2 -0
- package/package.json +32 -0
|
@@ -0,0 +1,2101 @@
|
|
|
1
|
+
// This file is auto-generated by packages/api/scripts/generate.mjs
|
|
2
|
+
// Do not edit manually.
|
|
3
|
+
import { dateTransform } from "../output.js";
|
|
4
|
+
import { DATA_FLAG, DATA_OPT_FLAG, makeListCmd, makeGetCmd, makeCreateCmd, makeUpdateCmd, makeDeleteCmd, parseJson, } from "../commands/shared.js";
|
|
5
|
+
// ── Audit Log ──
|
|
6
|
+
export const auditLogGroup = {
|
|
7
|
+
name: "audit-log",
|
|
8
|
+
description: "Audit Log",
|
|
9
|
+
commands: [
|
|
10
|
+
makeListCmd({
|
|
11
|
+
description: "Search audit logs",
|
|
12
|
+
columns: [
|
|
13
|
+
{ key: "auditLogKey", header: "AUDIT LOG KEY" },
|
|
14
|
+
{ key: "entityKey", header: "ENTITY KEY" },
|
|
15
|
+
{ key: "batchOperationKey", header: "BATCH OPERATION KEY" },
|
|
16
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
17
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
18
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
19
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
20
|
+
],
|
|
21
|
+
filterFields: [{ name: "auditLogKey", type: "object", description: "The audit log key search filter." }, { name: "processDefinitionKey", type: "object", description: "The process definition key search filter." }, { name: "processInstanceKey", type: "object", description: "The process instance key search filter." }, { name: "elementInstanceKey", type: "object", description: "The element instance key search filter." }, { name: "operationType", type: "object", description: "The operation type search filter." }, { name: "result", type: "object", description: "The result search filter." }, { name: "timestamp", type: "object", description: "The timestamp search filter." }, { name: "actorId", type: "object", description: "The actor ID search filter." }, { name: "actorType", type: "object", description: "The actor type search filter." }, { name: "agentElementId", type: "object", description: "The agent element ID search filter." }, { name: "entityKey", type: "object", description: "The entity key search filter." }, { name: "entityType", type: "object", description: "The entity type search filter." }, { name: "tenantId", type: "object", description: "The tenant ID search filter." }, { name: "category", type: "object", description: "The category search filter." }, { name: "deploymentKey", type: "object", description: "The deployment key search filter." }, { name: "formKey", type: "object", description: "The form key search filter." }, { name: "resourceKey", type: "object", description: "The resource key search filter." }, { name: "batchOperationType", type: "object", description: "The batch operation type search filter." }, { name: "processDefinitionId", type: "object", description: "The process definition ID search filter." }, { name: "jobKey", type: "object", description: "The job key search filter." }, { name: "userTaskKey", type: "object", description: "The user task key search filter." }, { name: "decisionRequirementsId", type: "object", description: "The decision requirements ID search filter." }, { name: "decisionRequirementsKey", type: "object", description: "The decision requirements key search filter." }, { name: "decisionDefinitionId", type: "object", description: "The decision definition ID search filter." }, { name: "decisionDefinitionKey", type: "object", description: "The decision definition key search filter." }, { name: "decisionEvaluationKey", type: "object", description: "The decision evaluation key search filter." }, { name: "relatedEntityKey", type: "object", description: "The related entity key search filter." }, { name: "relatedEntityType", type: "object", description: "The related entity type search filter." }, { name: "entityDescription", type: "object", description: "The entity description filter." }],
|
|
22
|
+
search: (client, body) => client.auditLog.searchAuditLogs(body),
|
|
23
|
+
}),
|
|
24
|
+
makeGetCmd({
|
|
25
|
+
description: "Get audit log",
|
|
26
|
+
argName: "auditLogKey",
|
|
27
|
+
get: (client, key) => client.auditLog.getAuditLog(key),
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
// ── Authentication ──
|
|
32
|
+
export const authenticationGroup = {
|
|
33
|
+
name: "authentication",
|
|
34
|
+
description: "Authentication",
|
|
35
|
+
commands: [
|
|
36
|
+
{
|
|
37
|
+
name: "get",
|
|
38
|
+
description: "Get current user",
|
|
39
|
+
async run(ctx) {
|
|
40
|
+
const client = await ctx.getClient();
|
|
41
|
+
const result = await client.authentication.getAuthentication();
|
|
42
|
+
ctx.output.printItem(result);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
// ── Authorization ──
|
|
48
|
+
export const authorizationGroup = {
|
|
49
|
+
name: "authorization",
|
|
50
|
+
aliases: ["auth"],
|
|
51
|
+
description: "Authorization",
|
|
52
|
+
commands: [
|
|
53
|
+
makeCreateCmd({
|
|
54
|
+
description: "Create authorization",
|
|
55
|
+
create: (client, body) => client.authorization.createAuthorization(body),
|
|
56
|
+
}),
|
|
57
|
+
makeListCmd({
|
|
58
|
+
description: "Search authorizations",
|
|
59
|
+
columns: [
|
|
60
|
+
{ key: "authorizationKey", header: "AUTHORIZATION KEY" },
|
|
61
|
+
{ key: "ownerId", header: "OWNER ID" },
|
|
62
|
+
{ key: "resourceId", header: "RESOURCE ID" },
|
|
63
|
+
{ key: "resourcePropertyName", header: "RESOURCE PROPERTY NAME", maxWidth: 30 },
|
|
64
|
+
{ key: "ownerType", header: "OWNER TYPE", maxWidth: 30 },
|
|
65
|
+
{ key: "resourceType", header: "RESOURCE TYPE", maxWidth: 30 },
|
|
66
|
+
{ key: "permissionTypes", header: "PERMISSION TYPES" },
|
|
67
|
+
],
|
|
68
|
+
filterFields: [{ name: "ownerId", type: "string", description: "The ID of the owner of permissions." }, { name: "ownerType", type: "string", description: "The type of the owner of permissions.", enum: ["USER", "CLIENT", "ROLE", "GROUP", "MAPPING_RULE", "UNSPECIFIED"] }, { name: "resourceIds", type: "array", description: "The IDs of the resource to search permissions for." }, { name: "resourcePropertyNames", type: "array", description: "The names of the resource properties to search permissions for." }, { name: "resourceType", type: "string", description: "The type of resource to search permissions for." }],
|
|
69
|
+
search: (client, body) => client.authorization.searchAuthorizations(body),
|
|
70
|
+
}),
|
|
71
|
+
makeGetCmd({
|
|
72
|
+
description: "Get authorization",
|
|
73
|
+
argName: "authorizationKey",
|
|
74
|
+
get: (client, key) => client.authorization.getAuthorization(key),
|
|
75
|
+
}),
|
|
76
|
+
makeUpdateCmd({
|
|
77
|
+
description: "Update authorization",
|
|
78
|
+
argName: "authorizationKey",
|
|
79
|
+
update: (client, key, body) => client.authorization.updateAuthorization(key, body),
|
|
80
|
+
}),
|
|
81
|
+
makeDeleteCmd({
|
|
82
|
+
description: "Delete authorization",
|
|
83
|
+
argName: "authorizationKey",
|
|
84
|
+
delete: (client, key) => client.authorization.deleteAuthorization(key),
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
// ── Batch operation ──
|
|
89
|
+
export const batchOperationGroup = {
|
|
90
|
+
name: "batch-operation",
|
|
91
|
+
aliases: ["batch"],
|
|
92
|
+
description: "Batch operation",
|
|
93
|
+
commands: [
|
|
94
|
+
makeListCmd({
|
|
95
|
+
name: "list-items",
|
|
96
|
+
description: "Search batch operation items",
|
|
97
|
+
columns: [
|
|
98
|
+
{ key: "batchOperationKey", header: "BATCH OPERATION KEY" },
|
|
99
|
+
{ key: "itemKey", header: "ITEM KEY" },
|
|
100
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
101
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
102
|
+
{ key: "state", header: "STATE", maxWidth: 30 },
|
|
103
|
+
{ key: "operationType", header: "OPERATION TYPE", maxWidth: 30 },
|
|
104
|
+
{ key: "errorMessage", header: "ERROR MESSAGE", maxWidth: 30 },
|
|
105
|
+
],
|
|
106
|
+
filterFields: [{ name: "batchOperationKey", type: "object", description: "The key (or operate legacy ID) of the batch operation." }, { name: "itemKey", type: "object", description: "The key of the item, e.g. a process instance key." }, { name: "processInstanceKey", type: "object", description: "The process instance key of the processed item." }, { name: "state", type: "string", description: "The state of the batch operation." }, { name: "operationType", type: "object", description: "The type of the batch operation." }],
|
|
107
|
+
search: (client, body) => client.batchOperation.searchBatchOperationItems(body),
|
|
108
|
+
}),
|
|
109
|
+
makeListCmd({
|
|
110
|
+
description: "Search batch operations",
|
|
111
|
+
columns: [
|
|
112
|
+
{ key: "batchOperationKey", header: "BATCH OPERATION KEY" },
|
|
113
|
+
{ key: "state", header: "STATE", maxWidth: 30 },
|
|
114
|
+
{ key: "actorId", header: "ACTOR ID" },
|
|
115
|
+
{ key: "batchOperationType", header: "BATCH OPERATION TYPE", maxWidth: 30 },
|
|
116
|
+
{ key: "actorType", header: "ACTOR TYPE" },
|
|
117
|
+
{ key: "operationsTotalCount", header: "OPERATIONS TOTAL COUNT" },
|
|
118
|
+
{ key: "operationsFailedCount", header: "OPERATIONS FAILED COUNT" },
|
|
119
|
+
],
|
|
120
|
+
filterFields: [{ name: "batchOperationKey", type: "object", description: "The key (or operate legacy ID) of the batch operation." }, { name: "operationType", type: "object", description: "The type of the batch operation." }, { name: "state", type: "object", description: "The state of the batch operation." }, { name: "actorType", type: "string", description: "The type of the actor who performed the operation.", enum: ["ANONYMOUS", "CLIENT", "UNKNOWN", "USER"] }, { name: "actorId", type: "object", description: "The ID of the actor who performed the operation." }],
|
|
121
|
+
search: (client, body) => client.batchOperation.searchBatchOperations(body),
|
|
122
|
+
}),
|
|
123
|
+
makeGetCmd({
|
|
124
|
+
description: "Get batch operation",
|
|
125
|
+
argName: "batchOperationKey",
|
|
126
|
+
get: (client, key) => client.batchOperation.getBatchOperation(key),
|
|
127
|
+
}),
|
|
128
|
+
{
|
|
129
|
+
name: "cancel",
|
|
130
|
+
description: "Cancel Batch operation",
|
|
131
|
+
args: [{ name: "batchOperationKey", description: "batchOperationKey", required: true }],
|
|
132
|
+
async run(ctx) {
|
|
133
|
+
const batchOperationKey = ctx.positional[0];
|
|
134
|
+
if (!batchOperationKey)
|
|
135
|
+
throw new Error("Missing required argument: <batchOperationKey>");
|
|
136
|
+
const client = await ctx.getClient();
|
|
137
|
+
await client.batchOperation.cancelBatchOperation(batchOperationKey);
|
|
138
|
+
ctx.output.ok("cancel completed.");
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "resume",
|
|
143
|
+
description: "Resume Batch operation",
|
|
144
|
+
args: [{ name: "batchOperationKey", description: "batchOperationKey", required: true }],
|
|
145
|
+
async run(ctx) {
|
|
146
|
+
const batchOperationKey = ctx.positional[0];
|
|
147
|
+
if (!batchOperationKey)
|
|
148
|
+
throw new Error("Missing required argument: <batchOperationKey>");
|
|
149
|
+
const client = await ctx.getClient();
|
|
150
|
+
await client.batchOperation.resumeBatchOperation(batchOperationKey);
|
|
151
|
+
ctx.output.ok("resume completed.");
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "suspend",
|
|
156
|
+
description: "Suspend Batch operation",
|
|
157
|
+
args: [{ name: "batchOperationKey", description: "batchOperationKey", required: true }],
|
|
158
|
+
async run(ctx) {
|
|
159
|
+
const batchOperationKey = ctx.positional[0];
|
|
160
|
+
if (!batchOperationKey)
|
|
161
|
+
throw new Error("Missing required argument: <batchOperationKey>");
|
|
162
|
+
const client = await ctx.getClient();
|
|
163
|
+
await client.batchOperation.suspendBatchOperation(batchOperationKey);
|
|
164
|
+
ctx.output.ok("suspend completed.");
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
// ── Clock ──
|
|
170
|
+
export const clockGroup = {
|
|
171
|
+
name: "clock",
|
|
172
|
+
description: "Clock",
|
|
173
|
+
commands: [
|
|
174
|
+
{
|
|
175
|
+
name: "pin",
|
|
176
|
+
description: "Pin internal clock (alpha)",
|
|
177
|
+
flags: [DATA_FLAG],
|
|
178
|
+
async run(ctx) {
|
|
179
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
180
|
+
const client = await ctx.getClient();
|
|
181
|
+
await client.clock.pinClock(body);
|
|
182
|
+
ctx.output.ok("pin completed.");
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
makeCreateCmd({
|
|
186
|
+
name: "reset",
|
|
187
|
+
description: "Reset internal clock (alpha)",
|
|
188
|
+
create: (client, body) => client.clock.resetClock(),
|
|
189
|
+
}),
|
|
190
|
+
],
|
|
191
|
+
};
|
|
192
|
+
// ── Cluster Variable ──
|
|
193
|
+
export const clusterVariableGroup = {
|
|
194
|
+
name: "cluster-variable",
|
|
195
|
+
description: "Cluster Variable",
|
|
196
|
+
commands: [
|
|
197
|
+
makeCreateCmd({
|
|
198
|
+
name: "createglobal",
|
|
199
|
+
description: "Create a global-scoped cluster variable",
|
|
200
|
+
create: (client, body) => client.clusterVariable.createGlobalClusterVariable(body),
|
|
201
|
+
bodyFields: [{ name: "name", type: "string", description: "The name of the cluster variable. Must be unique within its scope (global or tenant-specific).", required: true }, { name: "value", type: "object", description: "The value of the cluster variable. Can be any JSON object or primitive value. Will be serialized as a JSON string in responses.", required: true }],
|
|
202
|
+
}),
|
|
203
|
+
makeGetCmd({
|
|
204
|
+
name: "getglobal",
|
|
205
|
+
description: "Get a global-scoped cluster variable",
|
|
206
|
+
argName: "name",
|
|
207
|
+
get: (client, key) => client.clusterVariable.getGlobalClusterVariable(key),
|
|
208
|
+
}),
|
|
209
|
+
makeUpdateCmd({
|
|
210
|
+
name: "updateglobal",
|
|
211
|
+
description: "Update a global-scoped cluster variable",
|
|
212
|
+
argName: "name",
|
|
213
|
+
update: (client, key, body) => client.clusterVariable.updateGlobalClusterVariable(key, body),
|
|
214
|
+
bodyFields: [{ name: "value", type: "object", description: "The new value of the cluster variable. Can be any JSON object or primitive value. Will be serialized as a JSON string in responses.", required: true }],
|
|
215
|
+
}),
|
|
216
|
+
makeDeleteCmd({
|
|
217
|
+
name: "deleteglobal",
|
|
218
|
+
description: "Delete a global-scoped cluster variable",
|
|
219
|
+
argName: "name",
|
|
220
|
+
delete: (client, key) => client.clusterVariable.deleteGlobalClusterVariable(key),
|
|
221
|
+
}),
|
|
222
|
+
makeListCmd({
|
|
223
|
+
description: "Search for cluster variables based on given criteria. By default, long variable values in the response are truncated.",
|
|
224
|
+
columns: [
|
|
225
|
+
{ key: "value", header: "VALUE", maxWidth: 30 },
|
|
226
|
+
{ key: "isTruncated", header: "IS TRUNCATED" },
|
|
227
|
+
],
|
|
228
|
+
filterFields: [{ name: "name", type: "object", description: "Name of the cluster variable." }, { name: "value", type: "object", description: "The value of the cluster variable." }, { name: "scope", type: "object", description: "The scope filter for cluster variables." }, { name: "tenantId", type: "object", description: "Tenant ID of this variable." }, { name: "isTruncated", type: "boolean", description: " Filter cluster variables by truncation status of their stored values. When true, returns only variables whose stored values are truncated (i.e., the value exceeds the storage size limit and is truncated in storage). When false, returns only variables with non-truncated stored values. This filter is based on the underlying storage characteristic, not the response format." }],
|
|
229
|
+
search: (client, body) => client.clusterVariable.searchClusterVariables(body),
|
|
230
|
+
}),
|
|
231
|
+
{
|
|
232
|
+
name: "createtenant",
|
|
233
|
+
description: "Create a tenant-scoped cluster variable",
|
|
234
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }],
|
|
235
|
+
flags: [DATA_FLAG],
|
|
236
|
+
async run(ctx) {
|
|
237
|
+
const tenantId = ctx.positional[0];
|
|
238
|
+
if (!tenantId)
|
|
239
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
240
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
241
|
+
const client = await ctx.getClient();
|
|
242
|
+
const result = await client.clusterVariable.createTenantClusterVariable(tenantId, body);
|
|
243
|
+
ctx.output.printItem(result);
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "gettenant",
|
|
248
|
+
description: "Get a tenant-scoped cluster variable",
|
|
249
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "name", description: "name", required: true }],
|
|
250
|
+
async run(ctx) {
|
|
251
|
+
const tenantId = ctx.positional[0];
|
|
252
|
+
if (!tenantId)
|
|
253
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
254
|
+
const name = ctx.positional[1];
|
|
255
|
+
if (!name)
|
|
256
|
+
throw new Error("Missing required argument: <name>");
|
|
257
|
+
const client = await ctx.getClient();
|
|
258
|
+
const result = await client.clusterVariable.getTenantClusterVariable(tenantId, name);
|
|
259
|
+
ctx.output.printItem(result);
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: "updatetenant",
|
|
264
|
+
description: "Update a tenant-scoped cluster variable",
|
|
265
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "name", description: "name", required: true }],
|
|
266
|
+
flags: [DATA_FLAG],
|
|
267
|
+
async run(ctx) {
|
|
268
|
+
const tenantId = ctx.positional[0];
|
|
269
|
+
if (!tenantId)
|
|
270
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
271
|
+
const name = ctx.positional[1];
|
|
272
|
+
if (!name)
|
|
273
|
+
throw new Error("Missing required argument: <name>");
|
|
274
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
275
|
+
const client = await ctx.getClient();
|
|
276
|
+
const result = await client.clusterVariable.updateTenantClusterVariable(tenantId, name, body);
|
|
277
|
+
ctx.output.printItem(result);
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "deletetenant",
|
|
282
|
+
description: "Delete a tenant-scoped cluster variable",
|
|
283
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "name", description: "name", required: true }],
|
|
284
|
+
async run(ctx) {
|
|
285
|
+
const tenantId = ctx.positional[0];
|
|
286
|
+
if (!tenantId)
|
|
287
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
288
|
+
const name = ctx.positional[1];
|
|
289
|
+
if (!name)
|
|
290
|
+
throw new Error("Missing required argument: <name>");
|
|
291
|
+
const client = await ctx.getClient();
|
|
292
|
+
await client.clusterVariable.deleteTenantClusterVariable(tenantId, name);
|
|
293
|
+
ctx.output.ok("deletetenant completed.");
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
};
|
|
298
|
+
// ── Conditional ──
|
|
299
|
+
export const conditionalGroup = {
|
|
300
|
+
name: "conditional",
|
|
301
|
+
description: "Conditional",
|
|
302
|
+
commands: [
|
|
303
|
+
makeCreateCmd({
|
|
304
|
+
name: "evaluate",
|
|
305
|
+
description: "Evaluate root level conditional start events",
|
|
306
|
+
create: (client, body) => client.conditional.evaluateConditionals(body),
|
|
307
|
+
bodyFields: [{ name: "tenantId", type: "string", description: " Used to evaluate root-level conditional start events for a tenant with the given ID.\n This will only evaluate root-level conditional start events of process definitions which belong to the tenant." }, { name: "processDefinitionKey", type: "string", description: " Used to evaluate root-level conditional start events of the process definition with the given key." }, { name: "variables", type: "object", description: " JSON object representing the variables to use for evaluation of the conditions and to pass to the process instances that have been triggered.", required: true }],
|
|
308
|
+
}),
|
|
309
|
+
],
|
|
310
|
+
};
|
|
311
|
+
// ── Message subscription ──
|
|
312
|
+
export const messageSubscriptionGroup = {
|
|
313
|
+
name: "message-subscription",
|
|
314
|
+
description: "Message subscription",
|
|
315
|
+
commands: [
|
|
316
|
+
makeListCmd({
|
|
317
|
+
name: "searchcorrelated",
|
|
318
|
+
description: "Search correlated message subscriptions",
|
|
319
|
+
columns: [
|
|
320
|
+
{ key: "correlationKey", header: "CORRELATION KEY" },
|
|
321
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
322
|
+
{ key: "messageKey", header: "MESSAGE KEY" },
|
|
323
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
324
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
325
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
326
|
+
{ key: "subscriptionKey", header: "SUBSCRIPTION KEY" },
|
|
327
|
+
],
|
|
328
|
+
filterFields: [{ name: "correlationKey", type: "object", description: "The correlation key of the message." }, { name: "correlationTime", type: "object", description: "The time when the message was correlated." }, { name: "elementId", type: "object", description: "The element ID that received the message." }, { name: "elementInstanceKey", type: "object", description: "The element instance key that received the message." }, { name: "messageKey", type: "object", description: "The message key." }, { name: "messageName", type: "object", description: "The name of the message." }, { name: "partitionId", type: "object", description: "The partition ID that correlated the message." }, { name: "processDefinitionId", type: "object", description: "The process definition ID associated with this correlated message subscription." }, { name: "processDefinitionKey", type: "object", description: "The process definition key associated with this correlated message subscription. For intermediate message events, this only works for data created with 8.9 and later." }, { name: "processInstanceKey", type: "object", description: "The process instance key associated with this correlated message subscription." }, { name: "subscriptionKey", type: "object", description: "The subscription key that received the message." }, { name: "tenantId", type: "object", description: "The tenant ID associated with this correlated message subscription." }],
|
|
329
|
+
search: (client, body) => client.messageSubscription.searchCorrelatedMessageSubscriptions(body),
|
|
330
|
+
}),
|
|
331
|
+
makeListCmd({
|
|
332
|
+
description: "Search message subscriptions",
|
|
333
|
+
columns: [
|
|
334
|
+
{ key: "messageSubscriptionKey", header: "MESSAGE SUBSCRIPTION KEY" },
|
|
335
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
336
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
337
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
338
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
339
|
+
{ key: "correlationKey", header: "CORRELATION KEY" },
|
|
340
|
+
{ key: "processDefinitionId", header: "PROCESS DEFINITION ID" },
|
|
341
|
+
],
|
|
342
|
+
filterFields: [{ name: "messageSubscriptionKey", type: "object", description: "The message subscription key associated with this message subscription." }, { name: "processDefinitionKey", type: "object", description: "The process definition key associated with this correlated message subscription. This only works for data created with 8.9 and later." }, { name: "processDefinitionId", type: "object", description: "The process definition ID associated with this message subscription." }, { name: "processInstanceKey", type: "object", description: "The process instance key associated with this message subscription." }, { name: "elementId", type: "object", description: "The element ID associated with this message subscription." }, { name: "elementInstanceKey", type: "object", description: "The element instance key associated with this message subscription." }, { name: "messageSubscriptionState", type: "object", description: "The message subscription state." }, { name: "lastUpdatedDate", type: "object", description: "The last updated date of the message subscription." }, { name: "messageName", type: "object", description: "The name of the message associated with the message subscription." }, { name: "correlationKey", type: "object", description: "The correlation key of the message subscription." }, { name: "tenantId", type: "object", description: "The unique external tenant ID." }],
|
|
343
|
+
search: (client, body) => client.messageSubscription.searchMessageSubscriptions(body),
|
|
344
|
+
}),
|
|
345
|
+
],
|
|
346
|
+
};
|
|
347
|
+
// ── Decision definition ──
|
|
348
|
+
export const decisionDefinitionGroup = {
|
|
349
|
+
name: "decision-definition",
|
|
350
|
+
aliases: ["dd"],
|
|
351
|
+
description: "Decision definition",
|
|
352
|
+
commands: [
|
|
353
|
+
makeCreateCmd({
|
|
354
|
+
name: "evaluate",
|
|
355
|
+
description: "Evaluate decision",
|
|
356
|
+
create: (client, body) => client.decisionDefinition.evaluateDecision(body),
|
|
357
|
+
}),
|
|
358
|
+
makeListCmd({
|
|
359
|
+
description: "Search decision definitions",
|
|
360
|
+
columns: [
|
|
361
|
+
{ key: "decisionDefinitionKey", header: "DECISION DEFINITION KEY" },
|
|
362
|
+
{ key: "decisionRequirementsKey", header: "DECISION REQUIREMENTS KEY" },
|
|
363
|
+
{ key: "decisionDefinitionId", header: "DECISION DEFINITION ID" },
|
|
364
|
+
{ key: "decisionRequirementsId", header: "DECISION REQUIREMENTS ID" },
|
|
365
|
+
{ key: "tenantId", header: "TENANT ID" },
|
|
366
|
+
{ key: "decisionRequirementsName", header: "DECISION REQUIREMENTS NAME", maxWidth: 30 },
|
|
367
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
368
|
+
],
|
|
369
|
+
filterFields: [{ name: "decisionDefinitionId", type: "string", description: "The DMN ID of the decision definition." }, { name: "name", type: "string", description: "The DMN name of the decision definition." }, { name: "isLatestVersion", type: "boolean", description: " Whether to only return the latest version of each decision definition.\n When using this filter, pagination functionality is limited, you can only paginate forward using `after` and `limit`.\n The response contains no `startCursor` in the `page`, and requests ignore the `from` and `before` in the `page`." }, { name: "version", type: "string", description: "The assigned version of the decision definition." }, { name: "decisionRequirementsId", type: "string", description: "the DMN ID of the decision requirements graph that the decision definition is part of." }, { name: "tenantId", type: "string", description: "The tenant ID of the decision definition." }, { name: "decisionDefinitionKey", type: "string", description: "The assigned key, which acts as a unique identifier for this decision definition." }, { name: "decisionRequirementsKey", type: "string", description: "The assigned key of the decision requirements graph that the decision definition is part of." }, { name: "decisionRequirementsName", type: "string", description: "The DMN name of the decision requirements that the decision definition is part of." }, { name: "decisionRequirementsVersion", type: "string", description: "The assigned version of the decision requirements that the decision definition is part of." }],
|
|
370
|
+
search: (client, body) => client.decisionDefinition.searchDecisionDefinitions(body),
|
|
371
|
+
}),
|
|
372
|
+
makeGetCmd({
|
|
373
|
+
description: "Get decision definition",
|
|
374
|
+
argName: "decisionDefinitionKey",
|
|
375
|
+
get: (client, key) => client.decisionDefinition.getDecisionDefinition(key),
|
|
376
|
+
}),
|
|
377
|
+
makeGetCmd({
|
|
378
|
+
name: "get-x-m-l",
|
|
379
|
+
description: "Get decision definition XML",
|
|
380
|
+
argName: "decisionDefinitionKey",
|
|
381
|
+
get: (client, key) => client.decisionDefinition.getDecisionDefinitionXML(key),
|
|
382
|
+
}),
|
|
383
|
+
],
|
|
384
|
+
};
|
|
385
|
+
// ── Decision instance ──
|
|
386
|
+
export const decisionInstanceGroup = {
|
|
387
|
+
name: "decision-instance",
|
|
388
|
+
description: "Decision instance",
|
|
389
|
+
commands: [
|
|
390
|
+
makeListCmd({
|
|
391
|
+
description: "Search decision instances",
|
|
392
|
+
columns: [
|
|
393
|
+
{ key: "decisionEvaluationInstanceKey", header: "DECISION EVALUATION INSTANCE KEY" },
|
|
394
|
+
{ key: "decisionEvaluationKey", header: "DECISION EVALUATION KEY" },
|
|
395
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
396
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
397
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
398
|
+
{ key: "decisionDefinitionKey", header: "DECISION DEFINITION KEY" },
|
|
399
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
400
|
+
],
|
|
401
|
+
filterFields: [{ name: "decisionEvaluationInstanceKey", type: "object", description: "The key of the decision evaluation instance." }, { name: "state", type: "object", description: "The state of the decision instance." }, { name: "evaluationFailure", type: "string", description: "The evaluation failure of the decision instance." }, { name: "evaluationDate", type: "object", description: "The evaluation date of the decision instance." }, { name: "decisionDefinitionId", type: "string", description: "The ID of the DMN decision." }, { name: "decisionDefinitionName", type: "string", description: "The name of the DMN decision." }, { name: "decisionDefinitionVersion", type: "string", description: "The version of the decision." }, { name: "decisionDefinitionType", type: "string", description: "The type of the decision. UNSPECIFIED is deprecated and should not be used anymore, for removal in 8.10", enum: ["DECISION_TABLE", "LITERAL_EXPRESSION", "UNSPECIFIED", "UNKNOWN"] }, { name: "tenantId", type: "string", description: "The tenant ID of the decision instance." }, { name: "decisionEvaluationKey", type: "string", description: "The key of the parent decision evaluation. Note that this is not the identifier of an individual decision instance; the `decisionEvaluationInstanceKey` is the identifier for a decision instance." }, { name: "processDefinitionKey", type: "string", description: "The key of the process definition." }, { name: "processInstanceKey", type: "string", description: "The key of the process instance." }, { name: "decisionDefinitionKey", type: "object", description: "The key of the decision." }, { name: "elementInstanceKey", type: "object", description: "The key of the element instance this decision instance is linked to." }, { name: "rootDecisionDefinitionKey", type: "object", description: "The key of the root decision definition." }, { name: "decisionRequirementsKey", type: "object", description: "The key of the decision requirements definition." }],
|
|
402
|
+
search: (client, body) => client.decisionInstance.searchDecisionInstances(body),
|
|
403
|
+
}),
|
|
404
|
+
makeGetCmd({
|
|
405
|
+
description: "Get decision instance",
|
|
406
|
+
argName: "decisionEvaluationInstanceKey",
|
|
407
|
+
get: (client, key) => client.decisionInstance.getDecisionInstance(key),
|
|
408
|
+
}),
|
|
409
|
+
{
|
|
410
|
+
name: "delete",
|
|
411
|
+
description: "Delete decision instance",
|
|
412
|
+
args: [{ name: "decisionInstanceKey", description: "decisionInstanceKey", required: true }],
|
|
413
|
+
flags: [DATA_OPT_FLAG],
|
|
414
|
+
async run(ctx) {
|
|
415
|
+
const decisionInstanceKey = ctx.positional[0];
|
|
416
|
+
if (!decisionInstanceKey)
|
|
417
|
+
throw new Error("Missing required argument: <decisionInstanceKey>");
|
|
418
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
419
|
+
const client = await ctx.getClient();
|
|
420
|
+
await client.decisionInstance.deleteDecisionInstance(decisionInstanceKey, body);
|
|
421
|
+
ctx.output.ok("delete completed.");
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
makeCreateCmd({
|
|
425
|
+
name: "delete-batch-operation",
|
|
426
|
+
description: "Delete decision instances (batch)",
|
|
427
|
+
create: (client, body) => client.decisionInstance.deleteDecisionInstancesBatchOperation(body),
|
|
428
|
+
bodyFields: [{ name: "filter", type: "object", description: "The decision instance filter.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
429
|
+
}),
|
|
430
|
+
],
|
|
431
|
+
};
|
|
432
|
+
// ── Decision requirements ──
|
|
433
|
+
export const decisionRequirementsGroup = {
|
|
434
|
+
name: "decision-requirements",
|
|
435
|
+
description: "Decision requirements",
|
|
436
|
+
commands: [
|
|
437
|
+
makeListCmd({
|
|
438
|
+
description: "Search decision requirements",
|
|
439
|
+
columns: [
|
|
440
|
+
{ key: "decisionRequirementsKey", header: "DECISION REQUIREMENTS KEY" },
|
|
441
|
+
{ key: "decisionRequirementsId", header: "DECISION REQUIREMENTS ID" },
|
|
442
|
+
{ key: "tenantId", header: "TENANT ID" },
|
|
443
|
+
{ key: "decisionRequirementsName", header: "DECISION REQUIREMENTS NAME", maxWidth: 30 },
|
|
444
|
+
{ key: "resourceName", header: "RESOURCE NAME", maxWidth: 30 },
|
|
445
|
+
{ key: "version", header: "VERSION" },
|
|
446
|
+
],
|
|
447
|
+
filterFields: [{ name: "decisionRequirementsName", type: "string", description: "The DMN name of the decision requirements." }, { name: "decisionRequirementsId", type: "string", description: "the DMN ID of the decision requirements." }, { name: "decisionRequirementsKey", type: "string", description: "System-generated key for a deployed decision requirements definition." }, { name: "version", type: "string", description: "The assigned version of the decision requirements." }, { name: "tenantId", type: "string", description: "The tenant ID of the decision requirements." }, { name: "resourceName", type: "string", description: "The name of the resource from which the decision requirements were parsed" }],
|
|
448
|
+
search: (client, body) => client.decisionRequirements.searchDecisionRequirements(body),
|
|
449
|
+
}),
|
|
450
|
+
makeGetCmd({
|
|
451
|
+
description: "Get decision requirements",
|
|
452
|
+
argName: "decisionRequirementsKey",
|
|
453
|
+
get: (client, key) => client.decisionRequirements.getDecisionRequirements(key),
|
|
454
|
+
}),
|
|
455
|
+
makeGetCmd({
|
|
456
|
+
name: "get-x-m-l",
|
|
457
|
+
description: "Get decision requirements XML",
|
|
458
|
+
argName: "decisionRequirementsKey",
|
|
459
|
+
get: (client, key) => client.decisionRequirements.getDecisionRequirementsXML(key),
|
|
460
|
+
}),
|
|
461
|
+
],
|
|
462
|
+
};
|
|
463
|
+
// ── Resource ──
|
|
464
|
+
export const resourceGroup = {
|
|
465
|
+
name: "resource",
|
|
466
|
+
description: "Resource",
|
|
467
|
+
commands: [
|
|
468
|
+
makeCreateCmd({
|
|
469
|
+
name: "create-deployment",
|
|
470
|
+
description: "Deploy resources",
|
|
471
|
+
create: (client, body) => client.resource.createDeployment(),
|
|
472
|
+
}),
|
|
473
|
+
makeGetCmd({
|
|
474
|
+
description: "Get resource",
|
|
475
|
+
argName: "resourceKey",
|
|
476
|
+
get: (client, key) => client.resource.getResource(key),
|
|
477
|
+
}),
|
|
478
|
+
makeGetCmd({
|
|
479
|
+
name: "get-content",
|
|
480
|
+
description: "Get resource content",
|
|
481
|
+
argName: "resourceKey",
|
|
482
|
+
get: (client, key) => client.resource.getResourceContent(key),
|
|
483
|
+
}),
|
|
484
|
+
{
|
|
485
|
+
name: "delete",
|
|
486
|
+
description: "Delete resource",
|
|
487
|
+
args: [{ name: "resourceKey", description: "resourceKey", required: true }],
|
|
488
|
+
flags: [DATA_OPT_FLAG],
|
|
489
|
+
async run(ctx) {
|
|
490
|
+
const resourceKey = ctx.positional[0];
|
|
491
|
+
if (!resourceKey)
|
|
492
|
+
throw new Error("Missing required argument: <resourceKey>");
|
|
493
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
494
|
+
const client = await ctx.getClient();
|
|
495
|
+
const result = await client.resource.deleteResource(resourceKey, body);
|
|
496
|
+
ctx.output.printItem(result);
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
],
|
|
500
|
+
};
|
|
501
|
+
// ── Document ──
|
|
502
|
+
export const documentGroup = {
|
|
503
|
+
name: "document",
|
|
504
|
+
description: "Document",
|
|
505
|
+
commands: [
|
|
506
|
+
makeCreateCmd({
|
|
507
|
+
description: "Upload document",
|
|
508
|
+
create: (client, body) => client.document.createDocument(),
|
|
509
|
+
}),
|
|
510
|
+
makeCreateCmd({
|
|
511
|
+
name: "create-2",
|
|
512
|
+
description: "Upload multiple documents",
|
|
513
|
+
create: (client, body) => client.document.createDocuments(),
|
|
514
|
+
}),
|
|
515
|
+
makeGetCmd({
|
|
516
|
+
description: "Download document",
|
|
517
|
+
argName: "documentId",
|
|
518
|
+
get: (client, key) => client.document.getDocument(key),
|
|
519
|
+
}),
|
|
520
|
+
makeDeleteCmd({
|
|
521
|
+
description: "Delete document",
|
|
522
|
+
argName: "documentId",
|
|
523
|
+
delete: (client, key) => client.document.deleteDocument(key),
|
|
524
|
+
}),
|
|
525
|
+
{
|
|
526
|
+
name: "create-link",
|
|
527
|
+
description: "Create document link",
|
|
528
|
+
args: [{ name: "documentId", description: "documentId", required: true }],
|
|
529
|
+
flags: [DATA_OPT_FLAG],
|
|
530
|
+
async run(ctx) {
|
|
531
|
+
const documentId = ctx.positional[0];
|
|
532
|
+
if (!documentId)
|
|
533
|
+
throw new Error("Missing required argument: <documentId>");
|
|
534
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
535
|
+
const client = await ctx.getClient();
|
|
536
|
+
const result = await client.document.createDocumentLink(documentId, body);
|
|
537
|
+
ctx.output.printItem(result);
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
],
|
|
541
|
+
};
|
|
542
|
+
// ── Ad-hoc sub-process ──
|
|
543
|
+
export const adHocSubProcessGroup = {
|
|
544
|
+
name: "ad-hoc-sub-process",
|
|
545
|
+
description: "Ad-hoc sub-process",
|
|
546
|
+
commands: [
|
|
547
|
+
{
|
|
548
|
+
name: "activate-activities",
|
|
549
|
+
description: "Activate activities within an ad-hoc sub-process",
|
|
550
|
+
args: [{ name: "adHocSubProcessInstanceKey", description: "adHocSubProcessInstanceKey", required: true }],
|
|
551
|
+
flags: [DATA_FLAG],
|
|
552
|
+
async run(ctx) {
|
|
553
|
+
const adHocSubProcessInstanceKey = ctx.positional[0];
|
|
554
|
+
if (!adHocSubProcessInstanceKey)
|
|
555
|
+
throw new Error("Missing required argument: <adHocSubProcessInstanceKey>");
|
|
556
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
557
|
+
const client = await ctx.getClient();
|
|
558
|
+
await client.adHocSubProcess.activateAdHocSubProcessActivities(adHocSubProcessInstanceKey, body);
|
|
559
|
+
ctx.output.ok("activate-activities completed.");
|
|
560
|
+
},
|
|
561
|
+
},
|
|
562
|
+
],
|
|
563
|
+
};
|
|
564
|
+
// ── Element instance ──
|
|
565
|
+
export const elementInstanceGroup = {
|
|
566
|
+
name: "element-instance",
|
|
567
|
+
aliases: ["element"],
|
|
568
|
+
description: "Element instance",
|
|
569
|
+
commands: [
|
|
570
|
+
makeListCmd({
|
|
571
|
+
description: "Search element instances",
|
|
572
|
+
columns: [
|
|
573
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
574
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
575
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
576
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
577
|
+
{ key: "incidentKey", header: "INCIDENT KEY" },
|
|
578
|
+
{ key: "state", header: "STATE" },
|
|
579
|
+
{ key: "processDefinitionId", header: "PROCESS DEFINITION ID" },
|
|
580
|
+
],
|
|
581
|
+
filterFields: [{ name: "processDefinitionId", type: "string", description: "The process definition ID associated to this element instance." }, { name: "state", type: "object", description: "State of element instance as defined set of values." }, { name: "type", type: "string", description: "Type of element as defined set of values.", enum: ["UNSPECIFIED", "PROCESS", "SUB_PROCESS", "EVENT_SUB_PROCESS", "AD_HOC_SUB_PROCESS", "AD_HOC_SUB_PROCESS_INNER_INSTANCE", "START_EVENT", "INTERMEDIATE_CATCH_EVENT", "INTERMEDIATE_THROW_EVENT", "BOUNDARY_EVENT", "END_EVENT", "SERVICE_TASK", "RECEIVE_TASK", "USER_TASK", "MANUAL_TASK", "TASK", "EXCLUSIVE_GATEWAY", "INCLUSIVE_GATEWAY", "PARALLEL_GATEWAY", "EVENT_BASED_GATEWAY", "SEQUENCE_FLOW", "MULTI_INSTANCE_BODY", "CALL_ACTIVITY", "BUSINESS_RULE_TASK", "SCRIPT_TASK", "SEND_TASK", "UNKNOWN"] }, { name: "elementId", type: "string", description: "The element ID for this element instance." }, { name: "elementName", type: "string", description: "The element name. This only works for data created with 8.8 and onwards. Instances from prior versions don't contain this data and cannot be found." }, { name: "hasIncident", type: "boolean", description: "Shows whether this element instance has an incident related to." }, { name: "tenantId", type: "string", description: "The unique identifier of the tenant." }, { name: "elementInstanceKey", type: "string", description: "The assigned key, which acts as a unique identifier for this element instance." }, { name: "processInstanceKey", type: "string", description: "The process instance key associated to this element instance." }, { name: "processDefinitionKey", type: "string", description: "The process definition key associated to this element instance." }, { name: "incidentKey", type: "string", description: "The key of incident if field incident is true." }, { name: "startDate", type: "object", description: "The start date of this element instance." }, { name: "endDate", type: "object", description: "The end date of this element instance." }, { name: "elementInstanceScopeKey", type: "string", description: "The scope key of this element instance. If provided with a process instance key it will return element instances that are immediate children of the process instance. If provided with an element instance key it will return element instances that are immediate children of the element instance." }],
|
|
582
|
+
search: (client, body) => client.elementInstance.searchElementInstances(body),
|
|
583
|
+
}),
|
|
584
|
+
makeGetCmd({
|
|
585
|
+
description: "Get element instance",
|
|
586
|
+
argName: "elementInstanceKey",
|
|
587
|
+
get: (client, key) => client.elementInstance.getElementInstance(key),
|
|
588
|
+
}),
|
|
589
|
+
{
|
|
590
|
+
name: "list-incidents",
|
|
591
|
+
description: "Search for incidents of a specific element instance",
|
|
592
|
+
args: [{ name: "elementInstanceKey", description: "elementInstanceKey", required: true }],
|
|
593
|
+
flags: [DATA_FLAG],
|
|
594
|
+
async run(ctx) {
|
|
595
|
+
const elementInstanceKey = ctx.positional[0];
|
|
596
|
+
if (!elementInstanceKey)
|
|
597
|
+
throw new Error("Missing required argument: <elementInstanceKey>");
|
|
598
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
599
|
+
const client = await ctx.getClient();
|
|
600
|
+
const result = await client.elementInstance.searchElementInstanceIncidents(elementInstanceKey, body);
|
|
601
|
+
ctx.output.printItem(result);
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
makeUpdateCmd({
|
|
605
|
+
name: "create-variables",
|
|
606
|
+
description: "Update element instance variables",
|
|
607
|
+
argName: "elementInstanceKey",
|
|
608
|
+
update: (client, key, body) => client.elementInstance.createElementInstanceVariables(key, body),
|
|
609
|
+
bodyFields: [{ name: "variables", type: "object", description: "JSON object representing the variables to set in the element’s scope.", required: true }, { name: "local", type: "boolean", description: " If set to `true`, the variables are merged strictly into the local scope (as specified\n by the `elementInstanceKey`). Otherwise, the variables are propagated to upper scopes\n and set at the outermost one.\n\n Let's consider the following example:\n There are two scopes '1' and '2'. Scope '1' is the parent scope of '2'. The effective\n variables of the scopes are:\n 1 => { \"foo\" : 2 }\n 2 => { \"bar\" : 1 }\n\n An update request with elementInstanceKey as '2', variables { \"foo\": 5 }, and local set\n to `true` leaves scope '1' unchanged and adjusts scope '2' to { \"bar\": 1, \"foo\": 5 }. By\n default, with local set to `false`, scope '1' will be { \"foo\": 5 } and scope '2' will be\n { \"bar\": 1 }." }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
610
|
+
}),
|
|
611
|
+
],
|
|
612
|
+
};
|
|
613
|
+
// ── Expression ──
|
|
614
|
+
export const expressionGroup = {
|
|
615
|
+
name: "expression",
|
|
616
|
+
description: "Expression",
|
|
617
|
+
commands: [
|
|
618
|
+
makeCreateCmd({
|
|
619
|
+
name: "evaluate",
|
|
620
|
+
description: "Evaluate an expression",
|
|
621
|
+
create: (client, body) => client.expression.evaluateExpression(body),
|
|
622
|
+
bodyFields: [{ name: "expression", type: "string", description: "The expression to evaluate (e.g., \"=x + y\")", required: true }, { name: "tenantId", type: "string", description: "Required when the expression references tenant-scoped cluster variables" }, { name: "variables", type: "object", description: "Optional variables for expression evaluation. These variables are only used for the current evaluation and do not persist beyond it." }],
|
|
623
|
+
}),
|
|
624
|
+
],
|
|
625
|
+
};
|
|
626
|
+
// ── Global listener ──
|
|
627
|
+
export const globalListenerGroup = {
|
|
628
|
+
name: "global-listener",
|
|
629
|
+
description: "Global listener",
|
|
630
|
+
commands: [
|
|
631
|
+
makeCreateCmd({
|
|
632
|
+
name: "create-task-listener",
|
|
633
|
+
description: "Create global user task listener",
|
|
634
|
+
create: (client, body) => client.globalListener.createGlobalTaskListener(body),
|
|
635
|
+
bodyFields: [{ name: "id", type: "string", description: "The user-defined id for the global listener", required: true }, { name: "eventTypes", type: "array", description: "List of user task event types that trigger the listener.", required: true }, { name: "type", type: "string", description: "The name of the job type, used as a reference to specify which job workers request the respective listener job.", required: true }, { name: "retries", type: "string", description: "Number of retries for the listener job." }, { name: "afterNonGlobal", type: "boolean", description: "Whether the listener should run after model-level listeners." }, { name: "priority", type: "string", description: "The priority of the listener. Higher priority listeners are executed before lower priority ones." }],
|
|
636
|
+
}),
|
|
637
|
+
makeGetCmd({
|
|
638
|
+
name: "get-task-listener",
|
|
639
|
+
description: "Get global user task listener",
|
|
640
|
+
argName: "id",
|
|
641
|
+
get: (client, key) => client.globalListener.getGlobalTaskListener(key),
|
|
642
|
+
}),
|
|
643
|
+
makeUpdateCmd({
|
|
644
|
+
name: "update-task-listener",
|
|
645
|
+
description: "Update global user task listener",
|
|
646
|
+
argName: "id",
|
|
647
|
+
update: (client, key, body) => client.globalListener.updateGlobalTaskListener(key, body),
|
|
648
|
+
bodyFields: [{ name: "eventTypes", type: "array", description: "List of user task event types that trigger the listener.", required: true }, { name: "type", type: "string", description: "The name of the job type, used as a reference to specify which job workers request the respective listener job.", required: true }, { name: "retries", type: "string", description: "Number of retries for the listener job." }, { name: "afterNonGlobal", type: "boolean", description: "Whether the listener should run after model-level listeners." }, { name: "priority", type: "string", description: "The priority of the listener. Higher priority listeners are executed before lower priority ones." }],
|
|
649
|
+
}),
|
|
650
|
+
makeDeleteCmd({
|
|
651
|
+
name: "delete-task-listener",
|
|
652
|
+
description: "Delete global user task listener",
|
|
653
|
+
argName: "id",
|
|
654
|
+
delete: (client, key) => client.globalListener.deleteGlobalTaskListener(key),
|
|
655
|
+
}),
|
|
656
|
+
makeListCmd({
|
|
657
|
+
name: "list-task-listeners",
|
|
658
|
+
description: "Search global user task listeners",
|
|
659
|
+
columns: [
|
|
660
|
+
{ key: "id", header: "ID", maxWidth: 30 },
|
|
661
|
+
{ key: "source", header: "SOURCE", maxWidth: 30 },
|
|
662
|
+
],
|
|
663
|
+
filterFields: [{ name: "id", type: "object", description: "Id of the global listener." }, { name: "type", type: "object", description: "Job type of the global listener." }, { name: "retries", type: "object", description: "Number of retries of the global listener." }, { name: "eventTypes", type: "array", description: "Event types of the global listener." }, { name: "afterNonGlobal", type: "boolean", description: "Whether the listener runs after model-level listeners." }, { name: "priority", type: "object", description: "Priority of the global listener." }, { name: "source", type: "object", description: "How the global listener was defined." }],
|
|
664
|
+
search: (client, body) => client.globalListener.searchGlobalTaskListeners(body),
|
|
665
|
+
}),
|
|
666
|
+
],
|
|
667
|
+
};
|
|
668
|
+
// ── Group ──
|
|
669
|
+
export const groupGroup = {
|
|
670
|
+
name: "group",
|
|
671
|
+
description: "Group",
|
|
672
|
+
commands: [
|
|
673
|
+
makeCreateCmd({
|
|
674
|
+
description: "Create group",
|
|
675
|
+
create: (client, body) => client.group.createGroup(body),
|
|
676
|
+
bodyFields: [{ name: "groupId", type: "string", description: "The ID of the new group.", required: true }, { name: "name", type: "string", description: "The display name of the new group.", required: true }, { name: "description", type: "string", description: "The description of the new group." }],
|
|
677
|
+
}),
|
|
678
|
+
makeListCmd({
|
|
679
|
+
description: "Search groups",
|
|
680
|
+
columns: [
|
|
681
|
+
{ key: "groupId", header: "GROUP ID" },
|
|
682
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
683
|
+
{ key: "description", header: "DESCRIPTION", maxWidth: 30 },
|
|
684
|
+
],
|
|
685
|
+
filterFields: [{ name: "groupId", type: "object", description: "The group ID search filters." }, { name: "name", type: "string", description: "The group name search filters." }],
|
|
686
|
+
search: (client, body) => client.group.searchGroups(body),
|
|
687
|
+
}),
|
|
688
|
+
makeGetCmd({
|
|
689
|
+
description: "Get group",
|
|
690
|
+
argName: "groupId",
|
|
691
|
+
get: (client, key) => client.group.getGroup(key),
|
|
692
|
+
}),
|
|
693
|
+
makeUpdateCmd({
|
|
694
|
+
description: "Update group",
|
|
695
|
+
argName: "groupId",
|
|
696
|
+
update: (client, key, body) => client.group.updateGroup(key, body),
|
|
697
|
+
bodyFields: [{ name: "name", type: "string", description: "The new name of the group.", required: true }, { name: "description", type: "string", description: "The new description of the group." }],
|
|
698
|
+
}),
|
|
699
|
+
makeDeleteCmd({
|
|
700
|
+
description: "Delete group",
|
|
701
|
+
argName: "groupId",
|
|
702
|
+
delete: (client, key) => client.group.deleteGroup(key),
|
|
703
|
+
}),
|
|
704
|
+
{
|
|
705
|
+
name: "searchclientsfor",
|
|
706
|
+
description: "Search group clients",
|
|
707
|
+
args: [{ name: "groupId", description: "groupId", required: true }],
|
|
708
|
+
flags: [DATA_OPT_FLAG],
|
|
709
|
+
async run(ctx) {
|
|
710
|
+
const groupId = ctx.positional[0];
|
|
711
|
+
if (!groupId)
|
|
712
|
+
throw new Error("Missing required argument: <groupId>");
|
|
713
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
714
|
+
const client = await ctx.getClient();
|
|
715
|
+
const result = await client.group.searchClientsForGroup(groupId, body);
|
|
716
|
+
ctx.output.printItem(result);
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
name: "assignclientto",
|
|
721
|
+
description: "Assign a client to a group",
|
|
722
|
+
args: [{ name: "groupId", description: "groupId", required: true }, { name: "clientId", description: "clientId", required: true }],
|
|
723
|
+
async run(ctx) {
|
|
724
|
+
const groupId = ctx.positional[0];
|
|
725
|
+
if (!groupId)
|
|
726
|
+
throw new Error("Missing required argument: <groupId>");
|
|
727
|
+
const clientId = ctx.positional[1];
|
|
728
|
+
if (!clientId)
|
|
729
|
+
throw new Error("Missing required argument: <clientId>");
|
|
730
|
+
const client = await ctx.getClient();
|
|
731
|
+
await client.group.assignClientToGroup(groupId, clientId);
|
|
732
|
+
ctx.output.ok("assignclientto completed.");
|
|
733
|
+
},
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
name: "unassignclientfrom",
|
|
737
|
+
description: "Unassign a client from a group",
|
|
738
|
+
args: [{ name: "groupId", description: "groupId", required: true }, { name: "clientId", description: "clientId", required: true }],
|
|
739
|
+
async run(ctx) {
|
|
740
|
+
const groupId = ctx.positional[0];
|
|
741
|
+
if (!groupId)
|
|
742
|
+
throw new Error("Missing required argument: <groupId>");
|
|
743
|
+
const clientId = ctx.positional[1];
|
|
744
|
+
if (!clientId)
|
|
745
|
+
throw new Error("Missing required argument: <clientId>");
|
|
746
|
+
const client = await ctx.getClient();
|
|
747
|
+
await client.group.unassignClientFromGroup(groupId, clientId);
|
|
748
|
+
ctx.output.ok("unassignclientfrom completed.");
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
name: "searchmappingrulesfor",
|
|
753
|
+
description: "Search group mapping rules",
|
|
754
|
+
args: [{ name: "groupId", description: "groupId", required: true }],
|
|
755
|
+
flags: [DATA_OPT_FLAG],
|
|
756
|
+
async run(ctx) {
|
|
757
|
+
const groupId = ctx.positional[0];
|
|
758
|
+
if (!groupId)
|
|
759
|
+
throw new Error("Missing required argument: <groupId>");
|
|
760
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
761
|
+
const client = await ctx.getClient();
|
|
762
|
+
const result = await client.group.searchMappingRulesForGroup(groupId, body);
|
|
763
|
+
ctx.output.printItem(result);
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: "assignmappingruleto",
|
|
768
|
+
description: "Assign a mapping rule to a group",
|
|
769
|
+
args: [{ name: "groupId", description: "groupId", required: true }, { name: "mappingRuleId", description: "mappingRuleId", required: true }],
|
|
770
|
+
async run(ctx) {
|
|
771
|
+
const groupId = ctx.positional[0];
|
|
772
|
+
if (!groupId)
|
|
773
|
+
throw new Error("Missing required argument: <groupId>");
|
|
774
|
+
const mappingRuleId = ctx.positional[1];
|
|
775
|
+
if (!mappingRuleId)
|
|
776
|
+
throw new Error("Missing required argument: <mappingRuleId>");
|
|
777
|
+
const client = await ctx.getClient();
|
|
778
|
+
await client.group.assignMappingRuleToGroup(groupId, mappingRuleId);
|
|
779
|
+
ctx.output.ok("assignmappingruleto completed.");
|
|
780
|
+
},
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
name: "unassignmappingrulefrom",
|
|
784
|
+
description: "Unassign a mapping rule from a group",
|
|
785
|
+
args: [{ name: "groupId", description: "groupId", required: true }, { name: "mappingRuleId", description: "mappingRuleId", required: true }],
|
|
786
|
+
async run(ctx) {
|
|
787
|
+
const groupId = ctx.positional[0];
|
|
788
|
+
if (!groupId)
|
|
789
|
+
throw new Error("Missing required argument: <groupId>");
|
|
790
|
+
const mappingRuleId = ctx.positional[1];
|
|
791
|
+
if (!mappingRuleId)
|
|
792
|
+
throw new Error("Missing required argument: <mappingRuleId>");
|
|
793
|
+
const client = await ctx.getClient();
|
|
794
|
+
await client.group.unassignMappingRuleFromGroup(groupId, mappingRuleId);
|
|
795
|
+
ctx.output.ok("unassignmappingrulefrom completed.");
|
|
796
|
+
},
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: "searchrolesfor",
|
|
800
|
+
description: "Search group roles",
|
|
801
|
+
args: [{ name: "groupId", description: "groupId", required: true }],
|
|
802
|
+
flags: [DATA_OPT_FLAG],
|
|
803
|
+
async run(ctx) {
|
|
804
|
+
const groupId = ctx.positional[0];
|
|
805
|
+
if (!groupId)
|
|
806
|
+
throw new Error("Missing required argument: <groupId>");
|
|
807
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
808
|
+
const client = await ctx.getClient();
|
|
809
|
+
const result = await client.group.searchRolesForGroup(groupId, body);
|
|
810
|
+
ctx.output.printItem(result);
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
name: "searchusersfor",
|
|
815
|
+
description: "Search group users",
|
|
816
|
+
args: [{ name: "groupId", description: "groupId", required: true }],
|
|
817
|
+
flags: [DATA_OPT_FLAG],
|
|
818
|
+
async run(ctx) {
|
|
819
|
+
const groupId = ctx.positional[0];
|
|
820
|
+
if (!groupId)
|
|
821
|
+
throw new Error("Missing required argument: <groupId>");
|
|
822
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
823
|
+
const client = await ctx.getClient();
|
|
824
|
+
const result = await client.group.searchUsersForGroup(groupId, body);
|
|
825
|
+
ctx.output.printItem(result);
|
|
826
|
+
},
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
name: "assignuserto",
|
|
830
|
+
description: "Assign a user to a group",
|
|
831
|
+
args: [{ name: "groupId", description: "groupId", required: true }, { name: "username", description: "username", required: true }],
|
|
832
|
+
async run(ctx) {
|
|
833
|
+
const groupId = ctx.positional[0];
|
|
834
|
+
if (!groupId)
|
|
835
|
+
throw new Error("Missing required argument: <groupId>");
|
|
836
|
+
const username = ctx.positional[1];
|
|
837
|
+
if (!username)
|
|
838
|
+
throw new Error("Missing required argument: <username>");
|
|
839
|
+
const client = await ctx.getClient();
|
|
840
|
+
await client.group.assignUserToGroup(groupId, username);
|
|
841
|
+
ctx.output.ok("assignuserto completed.");
|
|
842
|
+
},
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
name: "unassignuserfrom",
|
|
846
|
+
description: "Unassign a user from a group",
|
|
847
|
+
args: [{ name: "groupId", description: "groupId", required: true }, { name: "username", description: "username", required: true }],
|
|
848
|
+
async run(ctx) {
|
|
849
|
+
const groupId = ctx.positional[0];
|
|
850
|
+
if (!groupId)
|
|
851
|
+
throw new Error("Missing required argument: <groupId>");
|
|
852
|
+
const username = ctx.positional[1];
|
|
853
|
+
if (!username)
|
|
854
|
+
throw new Error("Missing required argument: <username>");
|
|
855
|
+
const client = await ctx.getClient();
|
|
856
|
+
await client.group.unassignUserFromGroup(groupId, username);
|
|
857
|
+
ctx.output.ok("unassignuserfrom completed.");
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
],
|
|
861
|
+
};
|
|
862
|
+
// ── Incident ──
|
|
863
|
+
export const incidentGroup = {
|
|
864
|
+
name: "incident",
|
|
865
|
+
description: "Incident",
|
|
866
|
+
commands: [
|
|
867
|
+
makeListCmd({
|
|
868
|
+
description: "Search incidents",
|
|
869
|
+
columns: [
|
|
870
|
+
{ key: "incidentKey", header: "INCIDENT KEY" },
|
|
871
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
872
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
873
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
874
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
875
|
+
{ key: "jobKey", header: "JOB KEY" },
|
|
876
|
+
{ key: "state", header: "STATE" },
|
|
877
|
+
],
|
|
878
|
+
filterFields: [{ name: "processDefinitionId", type: "object", description: "The process definition ID associated to this incident." }, { name: "errorType", type: "object", description: "Incident error type with a defined set of values." }, { name: "errorMessage", type: "object", description: "The error message of this incident." }, { name: "elementId", type: "object", description: "The element ID associated to this incident." }, { name: "creationTime", type: "object", description: "Date of incident creation." }, { name: "state", type: "object", description: "State of this incident with a defined set of values." }, { name: "tenantId", type: "object", description: "The tenant ID of the incident." }, { name: "incidentKey", type: "object", description: "The assigned key, which acts as a unique identifier for this incident." }, { name: "processDefinitionKey", type: "object", description: "The process definition key associated to this incident." }, { name: "processInstanceKey", type: "object", description: "The process instance key associated to this incident." }, { name: "elementInstanceKey", type: "object", description: "The element instance key associated to this incident." }, { name: "jobKey", type: "object", description: "The job key, if exists, associated with this incident." }],
|
|
879
|
+
search: (client, body) => client.incident.searchIncidents(body),
|
|
880
|
+
}),
|
|
881
|
+
makeGetCmd({
|
|
882
|
+
description: "Get incident",
|
|
883
|
+
argName: "incidentKey",
|
|
884
|
+
get: (client, key) => client.incident.getIncident(key),
|
|
885
|
+
}),
|
|
886
|
+
{
|
|
887
|
+
name: "resolve",
|
|
888
|
+
description: "Resolve incident",
|
|
889
|
+
args: [{ name: "incidentKey", description: "incidentKey", required: true }],
|
|
890
|
+
flags: [DATA_OPT_FLAG],
|
|
891
|
+
async run(ctx) {
|
|
892
|
+
const incidentKey = ctx.positional[0];
|
|
893
|
+
if (!incidentKey)
|
|
894
|
+
throw new Error("Missing required argument: <incidentKey>");
|
|
895
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
896
|
+
const client = await ctx.getClient();
|
|
897
|
+
await client.incident.resolveIncident(incidentKey, body);
|
|
898
|
+
ctx.output.ok("resolve completed.");
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
makeCreateCmd({
|
|
902
|
+
name: "get-process-instance-statistics-by-definition",
|
|
903
|
+
description: "Get process instance statistics by definition",
|
|
904
|
+
create: (client, body) => client.incident.getProcessInstanceStatisticsByDefinition(body),
|
|
905
|
+
bodyFields: [{ name: "filter", type: "object", description: "Filter criteria for the aggregated process instance statistics.", required: true }, { name: "page", type: "object", description: "Pagination parameters for the aggregated process instance statistics." }, { name: "sort", type: "array", description: "Sorting criteria for process instance statistics grouped by process definition." }],
|
|
906
|
+
}),
|
|
907
|
+
makeCreateCmd({
|
|
908
|
+
name: "get-process-instance-statistics-by-error",
|
|
909
|
+
description: "Get process instance statistics by error",
|
|
910
|
+
create: (client, body) => client.incident.getProcessInstanceStatisticsByError(body),
|
|
911
|
+
bodyFields: [{ name: "page", type: "object", description: " Pagination parameters for process instance statistics grouped by incident error." }, { name: "sort", type: "array", description: "Sorting criteria for process instance statistics grouped by incident error." }],
|
|
912
|
+
}),
|
|
913
|
+
],
|
|
914
|
+
};
|
|
915
|
+
// ── Job ──
|
|
916
|
+
export const jobGroup = {
|
|
917
|
+
name: "job",
|
|
918
|
+
description: "Job",
|
|
919
|
+
commands: [
|
|
920
|
+
makeCreateCmd({
|
|
921
|
+
name: "activate",
|
|
922
|
+
description: "Activate jobs",
|
|
923
|
+
create: (client, body) => client.job.activateJobs(body),
|
|
924
|
+
bodyFields: [{ name: "type", type: "string", description: "The job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition type=\"payment-service\" />)", required: true }, { name: "worker", type: "string", description: "The name of the worker activating the jobs, mostly used for logging purposes." }, { name: "timeout", type: "string", description: "A job returned after this call will not be activated by another call until the timeout (in ms) has been reached.", required: true }, { name: "maxJobsToActivate", type: "string", description: "The maximum jobs to activate by this request.", required: true }, { name: "fetchVariable", type: "array", description: "A list of variables to fetch as the job variables; if empty, all visible variables at the time of activation for the scope of the job will be returned." }, { name: "requestTimeout", type: "string", description: "The request will be completed when at least one job is activated or after the requestTimeout (in ms). If the requestTimeout = 0, a default timeout is used. If the requestTimeout < 0, long polling is disabled and the request is completed immediately, even when no job is activated." }, { name: "tenantIds", type: "array", description: "A list of IDs of tenants for which to activate jobs." }, { name: "tenantFilter", type: "string", description: "The tenant filtering strategy - determines whether to use provided tenant IDs or assigned tenant IDs from the authenticated principal's authorized tenants.", enum: ["PROVIDED", "ASSIGNED"] }],
|
|
925
|
+
}),
|
|
926
|
+
makeListCmd({
|
|
927
|
+
description: "Search jobs",
|
|
928
|
+
columns: [
|
|
929
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
930
|
+
{ key: "jobKey", header: "JOB KEY" },
|
|
931
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
932
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
933
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
934
|
+
{ key: "state", header: "STATE", maxWidth: 30 },
|
|
935
|
+
{ key: "elementId", header: "ELEMENT ID" },
|
|
936
|
+
],
|
|
937
|
+
filterFields: [{ name: "deadline", type: "object", description: "When the job can next be activated." }, { name: "deniedReason", type: "object", description: "The reason provided by the user task listener for denying the work." }, { name: "elementId", type: "object", description: "The element ID associated with the job." }, { name: "elementInstanceKey", type: "object", description: "The element instance key associated with the job." }, { name: "endTime", type: "object", description: "When the job ended." }, { name: "errorCode", type: "object", description: "The error code provided for the failed job." }, { name: "errorMessage", type: "object", description: "The error message that provides additional context for a failed job." }, { name: "hasFailedWithRetriesLeft", type: "boolean", description: "Indicates whether the job has failed with retries left." }, { name: "isDenied", type: "boolean", description: "Indicates whether the user task listener denies the work." }, { name: "jobKey", type: "object", description: "The key, a unique identifier for the job." }, { name: "kind", type: "object", description: "The kind of the job." }, { name: "listenerEventType", type: "object", description: "The listener event type of the job." }, { name: "processDefinitionId", type: "object", description: "The process definition ID associated with the job." }, { name: "processDefinitionKey", type: "object", description: "The process definition key associated with the job." }, { name: "processInstanceKey", type: "object", description: "The process instance key associated with the job." }, { name: "retries", type: "object", description: "The number of retries left." }, { name: "state", type: "object", description: "The state of the job." }, { name: "tenantId", type: "object", description: "The tenant ID." }, { name: "type", type: "object", description: "The type of the job." }, { name: "worker", type: "object", description: "The name of the worker for this job." }, { name: "creationTime", type: "object", description: "When the job was created. Field is present for jobs created after 8.9." }, { name: "lastUpdateTime", type: "object", description: "When the job was last updated. Field is present for jobs created after 8.9." }],
|
|
938
|
+
search: (client, body) => client.job.searchJobs(body),
|
|
939
|
+
}),
|
|
940
|
+
makeUpdateCmd({
|
|
941
|
+
description: "Update job",
|
|
942
|
+
argName: "jobKey",
|
|
943
|
+
update: (client, key, body) => client.job.updateJob(key, body),
|
|
944
|
+
bodyFields: [{ name: "changeset", type: "object", description: "JSON object with changed job attribute values. The job cannot be completed or failed with this endpoint, use the complete job or fail job endpoints instead.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
945
|
+
}),
|
|
946
|
+
{
|
|
947
|
+
name: "complete",
|
|
948
|
+
description: "Complete job",
|
|
949
|
+
args: [{ name: "jobKey", description: "jobKey", required: true }],
|
|
950
|
+
flags: [DATA_OPT_FLAG],
|
|
951
|
+
async run(ctx) {
|
|
952
|
+
const jobKey = ctx.positional[0];
|
|
953
|
+
if (!jobKey)
|
|
954
|
+
throw new Error("Missing required argument: <jobKey>");
|
|
955
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
956
|
+
const client = await ctx.getClient();
|
|
957
|
+
await client.job.completeJob(jobKey, body);
|
|
958
|
+
ctx.output.ok("complete completed.");
|
|
959
|
+
},
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
name: "throw-error",
|
|
963
|
+
description: "Throw error for job",
|
|
964
|
+
args: [{ name: "jobKey", description: "jobKey", required: true }],
|
|
965
|
+
flags: [DATA_FLAG],
|
|
966
|
+
async run(ctx) {
|
|
967
|
+
const jobKey = ctx.positional[0];
|
|
968
|
+
if (!jobKey)
|
|
969
|
+
throw new Error("Missing required argument: <jobKey>");
|
|
970
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
971
|
+
const client = await ctx.getClient();
|
|
972
|
+
await client.job.throwJobError(jobKey, body);
|
|
973
|
+
ctx.output.ok("throw-error completed.");
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
name: "fail",
|
|
978
|
+
description: "Fail job",
|
|
979
|
+
args: [{ name: "jobKey", description: "jobKey", required: true }],
|
|
980
|
+
flags: [DATA_OPT_FLAG],
|
|
981
|
+
async run(ctx) {
|
|
982
|
+
const jobKey = ctx.positional[0];
|
|
983
|
+
if (!jobKey)
|
|
984
|
+
throw new Error("Missing required argument: <jobKey>");
|
|
985
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
986
|
+
const client = await ctx.getClient();
|
|
987
|
+
await client.job.failJob(jobKey, body);
|
|
988
|
+
ctx.output.ok("fail completed.");
|
|
989
|
+
},
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
name: "getglobal-statistics",
|
|
993
|
+
description: "Global job statistics",
|
|
994
|
+
async run(ctx) {
|
|
995
|
+
const client = await ctx.getClient();
|
|
996
|
+
const result = await client.job.getGlobalJobStatistics();
|
|
997
|
+
ctx.output.printItem(result);
|
|
998
|
+
},
|
|
999
|
+
},
|
|
1000
|
+
makeCreateCmd({
|
|
1001
|
+
name: "get-type-statistics",
|
|
1002
|
+
description: "Get job statistics by type",
|
|
1003
|
+
create: (client, body) => client.job.getJobTypeStatistics(body),
|
|
1004
|
+
bodyFields: [{ name: "filter", type: "object", description: "Job type statistics search filter." }, { name: "page", type: "object", description: "Search cursor pagination." }],
|
|
1005
|
+
}),
|
|
1006
|
+
makeCreateCmd({
|
|
1007
|
+
name: "get-worker-statistics",
|
|
1008
|
+
description: "Get job statistics by worker",
|
|
1009
|
+
create: (client, body) => client.job.getJobWorkerStatistics(body),
|
|
1010
|
+
bodyFields: [{ name: "filter", type: "object", description: "Job worker statistics search filter.", required: true }, { name: "page", type: "object", description: "Search cursor pagination." }],
|
|
1011
|
+
}),
|
|
1012
|
+
makeCreateCmd({
|
|
1013
|
+
name: "get-time-series-statistics",
|
|
1014
|
+
description: "Get time-series metrics for a job type",
|
|
1015
|
+
create: (client, body) => client.job.getJobTimeSeriesStatistics(body),
|
|
1016
|
+
bodyFields: [{ name: "filter", type: "object", description: "Job time-series statistics search filter.", required: true }, { name: "page", type: "object", description: "Search cursor pagination." }],
|
|
1017
|
+
}),
|
|
1018
|
+
],
|
|
1019
|
+
};
|
|
1020
|
+
// ── License ──
|
|
1021
|
+
export const licenseGroup = {
|
|
1022
|
+
name: "license",
|
|
1023
|
+
description: "License",
|
|
1024
|
+
commands: [
|
|
1025
|
+
{
|
|
1026
|
+
name: "get",
|
|
1027
|
+
description: "Get license status",
|
|
1028
|
+
async run(ctx) {
|
|
1029
|
+
const client = await ctx.getClient();
|
|
1030
|
+
const result = await client.license.getLicense();
|
|
1031
|
+
ctx.output.printItem(result);
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1034
|
+
],
|
|
1035
|
+
};
|
|
1036
|
+
// ── Mapping rule ──
|
|
1037
|
+
export const mappingRuleGroup = {
|
|
1038
|
+
name: "mapping-rule",
|
|
1039
|
+
aliases: ["mapping"],
|
|
1040
|
+
description: "Mapping rule",
|
|
1041
|
+
commands: [
|
|
1042
|
+
makeCreateCmd({
|
|
1043
|
+
description: "Create mapping rule",
|
|
1044
|
+
create: (client, body) => client.mappingRule.createMappingRule(body),
|
|
1045
|
+
bodyFields: [{ name: "mappingRuleId", type: "string", description: "The unique ID of the mapping rule.", required: true }, { name: "claimName", type: "string", description: "The name of the claim to map.", required: true }, { name: "claimValue", type: "string", description: "The value of the claim to map.", required: true }, { name: "name", type: "string", description: "The name of the mapping rule.", required: true }],
|
|
1046
|
+
}),
|
|
1047
|
+
makeListCmd({
|
|
1048
|
+
description: "Search mapping rules",
|
|
1049
|
+
columns: [
|
|
1050
|
+
{ key: "mappingRuleId", header: "MAPPING RULE ID" },
|
|
1051
|
+
{ key: "claimName", header: "CLAIM NAME", maxWidth: 30 },
|
|
1052
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
1053
|
+
{ key: "claimValue", header: "CLAIM VALUE", maxWidth: 30 },
|
|
1054
|
+
],
|
|
1055
|
+
filterFields: [{ name: "claimName", type: "string", description: "The claim name to match against a token." }, { name: "claimValue", type: "string", description: "The value of the claim to match." }, { name: "name", type: "string", description: "The name of the mapping rule." }, { name: "mappingRuleId", type: "string", description: "The ID of the mapping rule." }],
|
|
1056
|
+
search: (client, body) => client.mappingRule.searchMappingRule(body),
|
|
1057
|
+
}),
|
|
1058
|
+
makeGetCmd({
|
|
1059
|
+
description: "Get a mapping rule",
|
|
1060
|
+
argName: "mappingRuleId",
|
|
1061
|
+
get: (client, key) => client.mappingRule.getMappingRule(key),
|
|
1062
|
+
}),
|
|
1063
|
+
makeUpdateCmd({
|
|
1064
|
+
description: "Update mapping rule",
|
|
1065
|
+
argName: "mappingRuleId",
|
|
1066
|
+
update: (client, key, body) => client.mappingRule.updateMappingRule(key, body),
|
|
1067
|
+
bodyFields: [{ name: "claimName", type: "string", description: "The name of the claim to map.", required: true }, { name: "claimValue", type: "string", description: "The value of the claim to map.", required: true }, { name: "name", type: "string", description: "The name of the mapping rule.", required: true }],
|
|
1068
|
+
}),
|
|
1069
|
+
makeDeleteCmd({
|
|
1070
|
+
description: "Delete a mapping rule",
|
|
1071
|
+
argName: "mappingRuleId",
|
|
1072
|
+
delete: (client, key) => client.mappingRule.deleteMappingRule(key),
|
|
1073
|
+
}),
|
|
1074
|
+
],
|
|
1075
|
+
};
|
|
1076
|
+
// ── Message ──
|
|
1077
|
+
export const messageGroup = {
|
|
1078
|
+
name: "message",
|
|
1079
|
+
description: "Message",
|
|
1080
|
+
commands: [
|
|
1081
|
+
makeCreateCmd({
|
|
1082
|
+
name: "correlate",
|
|
1083
|
+
description: "Correlate message",
|
|
1084
|
+
create: (client, body) => client.message.correlateMessage(body),
|
|
1085
|
+
bodyFields: [{ name: "name", type: "string", description: "The message name as defined in the BPMN process", required: true }, { name: "correlationKey", type: "string", description: "The correlation key of the message." }, { name: "variables", type: "object", description: "The message variables as JSON document" }, { name: "tenantId", type: "string", description: "the tenant for which the message is published" }],
|
|
1086
|
+
}),
|
|
1087
|
+
makeCreateCmd({
|
|
1088
|
+
name: "publish",
|
|
1089
|
+
description: "Publish message",
|
|
1090
|
+
create: (client, body) => client.message.publishMessage(body),
|
|
1091
|
+
bodyFields: [{ name: "name", type: "string", description: "The name of the message.", required: true }, { name: "correlationKey", type: "string", description: "The correlation key of the message." }, { name: "timeToLive", type: "string", description: "Timespan (in ms) to buffer the message on the broker." }, { name: "messageId", type: "string", description: " The unique ID of the message. This is used to ensure only one message with the given ID\n will be published during the lifetime of the message (if `timeToLive` is set)." }, { name: "variables", type: "object", description: "The message variables as JSON document." }, { name: "tenantId", type: "string", description: "The tenant of the message sender." }],
|
|
1092
|
+
}),
|
|
1093
|
+
],
|
|
1094
|
+
};
|
|
1095
|
+
// ── Process definition ──
|
|
1096
|
+
export const processDefinitionGroup = {
|
|
1097
|
+
name: "process-definition",
|
|
1098
|
+
aliases: ["pd"],
|
|
1099
|
+
description: "Process definition",
|
|
1100
|
+
commands: [
|
|
1101
|
+
makeListCmd({
|
|
1102
|
+
description: "Search process definitions",
|
|
1103
|
+
columns: [
|
|
1104
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
1105
|
+
{ key: "processDefinitionId", header: "PROCESS DEFINITION ID" },
|
|
1106
|
+
{ key: "tenantId", header: "TENANT ID" },
|
|
1107
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
1108
|
+
{ key: "resourceName", header: "RESOURCE NAME", maxWidth: 30 },
|
|
1109
|
+
{ key: "version", header: "VERSION" },
|
|
1110
|
+
{ key: "versionTag", header: "VERSION TAG", maxWidth: 30 },
|
|
1111
|
+
],
|
|
1112
|
+
filterFields: [{ name: "name", type: "object", description: "Name of this process definition." }, { name: "isLatestVersion", type: "boolean", description: " Whether to only return the latest version of each process definition.\n When using this filter, pagination functionality is limited, you can only paginate forward using `after` and `limit`.\n The response contains no `startCursor` in the `page`, and requests ignore the `from` and `before` in the `page`." }, { name: "resourceName", type: "string", description: "Resource name of this process definition." }, { name: "version", type: "string", description: "Version of this process definition." }, { name: "versionTag", type: "string", description: "Version tag of this process definition." }, { name: "processDefinitionId", type: "object", description: "Process definition ID of this process definition." }, { name: "tenantId", type: "string", description: "Tenant ID of this process definition." }, { name: "processDefinitionKey", type: "string", description: "The key for this process definition." }, { name: "hasStartForm", type: "boolean", description: "Indicates whether the start event of the process has an associated Form Key." }],
|
|
1113
|
+
search: (client, body) => client.processDefinition.searchProcessDefinitions(body),
|
|
1114
|
+
}),
|
|
1115
|
+
makeCreateCmd({
|
|
1116
|
+
name: "get-message-subscription-statistics",
|
|
1117
|
+
description: "Get message subscription statistics",
|
|
1118
|
+
create: (client, body) => client.processDefinition.getProcessDefinitionMessageSubscriptionStatistics(body),
|
|
1119
|
+
bodyFields: [{ name: "page", type: "object", description: "Search cursor pagination." }, { name: "filter", type: "object", description: "The message subscription filters." }],
|
|
1120
|
+
}),
|
|
1121
|
+
makeCreateCmd({
|
|
1122
|
+
name: "get-instance-statistics",
|
|
1123
|
+
description: "Get process instance statistics",
|
|
1124
|
+
create: (client, body) => client.processDefinition.getProcessDefinitionInstanceStatistics(body),
|
|
1125
|
+
bodyFields: [{ name: "page", type: "object", description: "Search cursor pagination." }, { name: "sort", type: "array", description: "Sort field criteria." }],
|
|
1126
|
+
}),
|
|
1127
|
+
makeGetCmd({
|
|
1128
|
+
description: "Get process definition",
|
|
1129
|
+
argName: "processDefinitionKey",
|
|
1130
|
+
get: (client, key) => client.processDefinition.getProcessDefinition(key),
|
|
1131
|
+
}),
|
|
1132
|
+
makeGetCmd({
|
|
1133
|
+
name: "getstart-form",
|
|
1134
|
+
description: "Get process start form",
|
|
1135
|
+
argName: "processDefinitionKey",
|
|
1136
|
+
get: (client, key) => client.processDefinition.getStartProcessForm(key),
|
|
1137
|
+
}),
|
|
1138
|
+
{
|
|
1139
|
+
name: "get-statistics",
|
|
1140
|
+
description: "Get process definition statistics",
|
|
1141
|
+
args: [{ name: "processDefinitionKey", description: "processDefinitionKey", required: true }],
|
|
1142
|
+
flags: [DATA_OPT_FLAG],
|
|
1143
|
+
async run(ctx) {
|
|
1144
|
+
const processDefinitionKey = ctx.positional[0];
|
|
1145
|
+
if (!processDefinitionKey)
|
|
1146
|
+
throw new Error("Missing required argument: <processDefinitionKey>");
|
|
1147
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1148
|
+
const client = await ctx.getClient();
|
|
1149
|
+
const result = await client.processDefinition.getProcessDefinitionStatistics(processDefinitionKey, body);
|
|
1150
|
+
ctx.output.printItem(result);
|
|
1151
|
+
},
|
|
1152
|
+
},
|
|
1153
|
+
makeGetCmd({
|
|
1154
|
+
name: "get-x-m-l",
|
|
1155
|
+
description: "Get process definition XML",
|
|
1156
|
+
argName: "processDefinitionKey",
|
|
1157
|
+
get: (client, key) => client.processDefinition.getProcessDefinitionXML(key),
|
|
1158
|
+
}),
|
|
1159
|
+
makeCreateCmd({
|
|
1160
|
+
name: "get-instance-version-statistics",
|
|
1161
|
+
description: "Get process instance statistics by version",
|
|
1162
|
+
create: (client, body) => client.processDefinition.getProcessDefinitionInstanceVersionStatistics(body),
|
|
1163
|
+
bodyFields: [{ name: "page", type: "object", description: "Pagination criteria." }, { name: "sort", type: "array", description: "Sort field criteria." }, { name: "filter", type: "object", description: "The process definition instance version statistics search filters.", required: true }],
|
|
1164
|
+
}),
|
|
1165
|
+
],
|
|
1166
|
+
};
|
|
1167
|
+
// ── Process instance ──
|
|
1168
|
+
export const processInstanceGroup = {
|
|
1169
|
+
name: "process-instance",
|
|
1170
|
+
aliases: ["pi"],
|
|
1171
|
+
description: "Process instance",
|
|
1172
|
+
commands: [
|
|
1173
|
+
makeCreateCmd({
|
|
1174
|
+
description: "Create process instance",
|
|
1175
|
+
create: (client, body) => client.processInstance.createProcessInstance(body),
|
|
1176
|
+
}),
|
|
1177
|
+
makeCreateCmd({
|
|
1178
|
+
name: "cancel-batch-operation",
|
|
1179
|
+
description: "Cancel process instances (batch)",
|
|
1180
|
+
create: (client, body) => client.processInstance.cancelProcessInstancesBatchOperation(body),
|
|
1181
|
+
bodyFields: [{ name: "filter", type: "string", description: "The process instance filter.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
1182
|
+
}),
|
|
1183
|
+
makeCreateCmd({
|
|
1184
|
+
name: "delete-batch-operation",
|
|
1185
|
+
description: "Delete process instances (batch)",
|
|
1186
|
+
create: (client, body) => client.processInstance.deleteProcessInstancesBatchOperation(body),
|
|
1187
|
+
bodyFields: [{ name: "filter", type: "string", description: "The process instance filter.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
1188
|
+
}),
|
|
1189
|
+
makeCreateCmd({
|
|
1190
|
+
name: "resolve-incidents-batch-operation",
|
|
1191
|
+
description: "Resolve related incidents (batch)",
|
|
1192
|
+
create: (client, body) => client.processInstance.resolveIncidentsBatchOperation(body),
|
|
1193
|
+
bodyFields: [{ name: "filter", type: "string", description: "The process instance filter.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
1194
|
+
}),
|
|
1195
|
+
makeCreateCmd({
|
|
1196
|
+
name: "migrate-batch-operation",
|
|
1197
|
+
description: "Migrate process instances (batch)",
|
|
1198
|
+
create: (client, body) => client.processInstance.migrateProcessInstancesBatchOperation(body),
|
|
1199
|
+
bodyFields: [{ name: "filter", type: "string", description: "The process instance filter.", required: true }, { name: "migrationPlan", type: "object", description: "The migration plan.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
1200
|
+
}),
|
|
1201
|
+
makeCreateCmd({
|
|
1202
|
+
name: "modify-batch-operation",
|
|
1203
|
+
description: "Modify process instances (batch)",
|
|
1204
|
+
create: (client, body) => client.processInstance.modifyProcessInstancesBatchOperation(body),
|
|
1205
|
+
bodyFields: [{ name: "filter", type: "string", description: "The process instance filter.", required: true }, { name: "moveInstructions", type: "array", description: "Instructions for moving tokens between elements.", required: true }, { name: "operationReference", type: "string", description: " A reference key chosen by the user that will be part of all records resulting from this operation.\n Must be > 0 if provided." }],
|
|
1206
|
+
}),
|
|
1207
|
+
makeListCmd({
|
|
1208
|
+
description: "Search process instances",
|
|
1209
|
+
columns: [
|
|
1210
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
1211
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
1212
|
+
{ key: "parentProcessInstanceKey", header: "PARENT PROCESS INSTANCE KEY" },
|
|
1213
|
+
{ key: "parentElementInstanceKey", header: "PARENT ELEMENT INSTANCE KEY" },
|
|
1214
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
1215
|
+
{ key: "state", header: "STATE", maxWidth: 30 },
|
|
1216
|
+
{ key: "processDefinitionId", header: "PROCESS DEFINITION ID" },
|
|
1217
|
+
],
|
|
1218
|
+
filterFields: [{ name: "processDefinitionId", type: "object", description: "The process definition id." }, { name: "processDefinitionName", type: "object", description: "The process definition name." }, { name: "processDefinitionVersion", type: "object", description: "The process definition version." }, { name: "processDefinitionVersionTag", type: "object", description: "The process definition version tag." }, { name: "processDefinitionKey", type: "object", description: "The process definition key." }, { name: "startDate", type: "object", description: "The start date." }, { name: "endDate", type: "object", description: "The end date." }, { name: "state", type: "object", description: "The process instance state." }, { name: "hasIncident", type: "boolean", description: "Whether this process instance has a related incident or not." }, { name: "tenantId", type: "object", description: "The tenant id." }, { name: "variables", type: "array", description: "The process instance variables." }, { name: "processInstanceKey", type: "object", description: "The key of this process instance." }, { name: "parentProcessInstanceKey", type: "object", description: "The parent process instance key." }, { name: "parentElementInstanceKey", type: "object", description: "The parent element instance key." }, { name: "batchOperationId", type: "object", description: "The batch operation id." }, { name: "errorMessage", type: "object", description: "The error message related to the process." }, { name: "hasRetriesLeft", type: "boolean", description: "Whether the process has failed jobs with retries left." }, { name: "elementInstanceState", type: "object", description: "The state of the element instances associated with the process instance." }, { name: "elementId", type: "object", description: "The element id associated with the process instance." }, { name: "hasElementInstanceIncident", type: "boolean", description: "Whether the element instance has an incident or not." }, { name: "incidentErrorHashCode", type: "object", description: "The incident error hash code, associated with this process." }, { name: "tags", type: "array", description: "List of tags. Tags need to start with a letter; then alphanumerics, `_`, `-`, `:`, or `.`; length ≤ 100." }, { name: "$or", type: "array", description: " Defines a list of alternative filter groups combined using OR logic. Each object in the array is evaluated independently, and the filter matches if any one of them is satisfied.\n\n Top-level fields and the `$or` clause are combined using AND logic — meaning: (top-level filters) AND (any of the `$or` filters) must match.\n <br>\n <em>Example:</em>\n\n ```json\n {\n \"state\": \"ACTIVE\",\n \"tenantId\": 123,\n \"$or\": [\n { \"processDefinitionId\": \"process_v1\" },\n { \"processDefinitionId\": \"process_v2\", \"hasIncident\": true }\n ]\n }\n ```\n This matches process instances that:\n\n <ul style=\"padding-left: 20px; margin-left: 20px;\">\n <li style=\"list-style-type: disc;\">are in <em>ACTIVE</em> state</li>\n <li style=\"list-style-type: disc;\">have tenant id equal to <em>123</em></li>\n <li style=\"list-style-type: disc;\">and match either:\n <ul style=\"padding-left: 20px; margin-left: 20px;\">\n <li style=\"list-style-type: circle;\"><code>processDefinitionId</code> is <em>process_v1</em>, or</li>\n <li style=\"list-style-type: circle;\"><code>processDefinitionId</code> is <em>process_v2</em> and <code>hasIncident</code> is <em>true</em></li>\n </ul>\n </li>\n </ul>\n <br>\n <p>Note: Using complex <code>$or</code> conditions may impact performance, use with caution in high-volume environments." }],
|
|
1219
|
+
search: (client, body) => client.processInstance.searchProcessInstances(body),
|
|
1220
|
+
}),
|
|
1221
|
+
makeGetCmd({
|
|
1222
|
+
description: "Get process instance",
|
|
1223
|
+
argName: "processInstanceKey",
|
|
1224
|
+
get: (client, key) => client.processInstance.getProcessInstance(key),
|
|
1225
|
+
}),
|
|
1226
|
+
makeGetCmd({
|
|
1227
|
+
name: "get-call-hierarchy",
|
|
1228
|
+
description: "Get call hierarchy",
|
|
1229
|
+
argName: "processInstanceKey",
|
|
1230
|
+
get: (client, key) => client.processInstance.getProcessInstanceCallHierarchy(key),
|
|
1231
|
+
}),
|
|
1232
|
+
{
|
|
1233
|
+
name: "cancel",
|
|
1234
|
+
description: "Cancel process instance",
|
|
1235
|
+
args: [{ name: "processInstanceKey", description: "processInstanceKey", required: true }],
|
|
1236
|
+
flags: [DATA_OPT_FLAG],
|
|
1237
|
+
async run(ctx) {
|
|
1238
|
+
const processInstanceKey = ctx.positional[0];
|
|
1239
|
+
if (!processInstanceKey)
|
|
1240
|
+
throw new Error("Missing required argument: <processInstanceKey>");
|
|
1241
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1242
|
+
const client = await ctx.getClient();
|
|
1243
|
+
await client.processInstance.cancelProcessInstance(processInstanceKey, body);
|
|
1244
|
+
ctx.output.ok("cancel completed.");
|
|
1245
|
+
},
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
name: "delete",
|
|
1249
|
+
description: "Delete process instance",
|
|
1250
|
+
args: [{ name: "processInstanceKey", description: "processInstanceKey", required: true }],
|
|
1251
|
+
flags: [DATA_OPT_FLAG],
|
|
1252
|
+
async run(ctx) {
|
|
1253
|
+
const processInstanceKey = ctx.positional[0];
|
|
1254
|
+
if (!processInstanceKey)
|
|
1255
|
+
throw new Error("Missing required argument: <processInstanceKey>");
|
|
1256
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1257
|
+
const client = await ctx.getClient();
|
|
1258
|
+
await client.processInstance.deleteProcessInstance(processInstanceKey, body);
|
|
1259
|
+
ctx.output.ok("delete completed.");
|
|
1260
|
+
},
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
name: "resolve-incidents",
|
|
1264
|
+
description: "Resolve related incidents",
|
|
1265
|
+
args: [{ name: "processInstanceKey", description: "processInstanceKey", required: true }],
|
|
1266
|
+
async run(ctx) {
|
|
1267
|
+
const processInstanceKey = ctx.positional[0];
|
|
1268
|
+
if (!processInstanceKey)
|
|
1269
|
+
throw new Error("Missing required argument: <processInstanceKey>");
|
|
1270
|
+
const client = await ctx.getClient();
|
|
1271
|
+
const result = await client.processInstance.resolveProcessInstanceIncidents(processInstanceKey);
|
|
1272
|
+
ctx.output.printItem(result);
|
|
1273
|
+
},
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
name: "list-incidents",
|
|
1277
|
+
description: "Search related incidents",
|
|
1278
|
+
args: [{ name: "processInstanceKey", description: "processInstanceKey", required: true }],
|
|
1279
|
+
flags: [DATA_OPT_FLAG],
|
|
1280
|
+
async run(ctx) {
|
|
1281
|
+
const processInstanceKey = ctx.positional[0];
|
|
1282
|
+
if (!processInstanceKey)
|
|
1283
|
+
throw new Error("Missing required argument: <processInstanceKey>");
|
|
1284
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1285
|
+
const client = await ctx.getClient();
|
|
1286
|
+
const result = await client.processInstance.searchProcessInstanceIncidents(processInstanceKey, body);
|
|
1287
|
+
ctx.output.printItem(result);
|
|
1288
|
+
},
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
name: "migrate",
|
|
1292
|
+
description: "Migrate process instance",
|
|
1293
|
+
args: [{ name: "processInstanceKey", description: "processInstanceKey", required: true }],
|
|
1294
|
+
flags: [DATA_FLAG],
|
|
1295
|
+
async run(ctx) {
|
|
1296
|
+
const processInstanceKey = ctx.positional[0];
|
|
1297
|
+
if (!processInstanceKey)
|
|
1298
|
+
throw new Error("Missing required argument: <processInstanceKey>");
|
|
1299
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1300
|
+
const client = await ctx.getClient();
|
|
1301
|
+
await client.processInstance.migrateProcessInstance(processInstanceKey, body);
|
|
1302
|
+
ctx.output.ok("migrate completed.");
|
|
1303
|
+
},
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
name: "modify",
|
|
1307
|
+
description: "Modify process instance",
|
|
1308
|
+
args: [{ name: "processInstanceKey", description: "processInstanceKey", required: true }],
|
|
1309
|
+
flags: [DATA_FLAG],
|
|
1310
|
+
async run(ctx) {
|
|
1311
|
+
const processInstanceKey = ctx.positional[0];
|
|
1312
|
+
if (!processInstanceKey)
|
|
1313
|
+
throw new Error("Missing required argument: <processInstanceKey>");
|
|
1314
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1315
|
+
const client = await ctx.getClient();
|
|
1316
|
+
await client.processInstance.modifyProcessInstance(processInstanceKey, body);
|
|
1317
|
+
ctx.output.ok("modify completed.");
|
|
1318
|
+
},
|
|
1319
|
+
},
|
|
1320
|
+
makeGetCmd({
|
|
1321
|
+
name: "get-sequence-flows",
|
|
1322
|
+
description: "Get sequence flows",
|
|
1323
|
+
argName: "processInstanceKey",
|
|
1324
|
+
get: (client, key) => client.processInstance.getProcessInstanceSequenceFlows(key),
|
|
1325
|
+
}),
|
|
1326
|
+
makeGetCmd({
|
|
1327
|
+
name: "get-statistics",
|
|
1328
|
+
description: "Get element instance statistics",
|
|
1329
|
+
argName: "processInstanceKey",
|
|
1330
|
+
get: (client, key) => client.processInstance.getProcessInstanceStatistics(key),
|
|
1331
|
+
}),
|
|
1332
|
+
],
|
|
1333
|
+
};
|
|
1334
|
+
// ── Role ──
|
|
1335
|
+
export const roleGroup = {
|
|
1336
|
+
name: "role",
|
|
1337
|
+
description: "Role",
|
|
1338
|
+
commands: [
|
|
1339
|
+
makeCreateCmd({
|
|
1340
|
+
description: "Create role",
|
|
1341
|
+
create: (client, body) => client.role.createRole(body),
|
|
1342
|
+
bodyFields: [{ name: "roleId", type: "string", description: "The ID of the new role.", required: true }, { name: "name", type: "string", description: "The display name of the new role.", required: true }, { name: "description", type: "string", description: "The description of the new role." }],
|
|
1343
|
+
}),
|
|
1344
|
+
makeListCmd({
|
|
1345
|
+
description: "Search roles",
|
|
1346
|
+
columns: [
|
|
1347
|
+
{ key: "roleId", header: "ROLE ID" },
|
|
1348
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
1349
|
+
{ key: "description", header: "DESCRIPTION", maxWidth: 30 },
|
|
1350
|
+
],
|
|
1351
|
+
filterFields: [{ name: "roleId", type: "string", description: "The role ID search filters." }, { name: "name", type: "string", description: "The role name search filters." }],
|
|
1352
|
+
search: (client, body) => client.role.searchRoles(body),
|
|
1353
|
+
}),
|
|
1354
|
+
makeGetCmd({
|
|
1355
|
+
description: "Get role",
|
|
1356
|
+
argName: "roleId",
|
|
1357
|
+
get: (client, key) => client.role.getRole(key),
|
|
1358
|
+
}),
|
|
1359
|
+
makeUpdateCmd({
|
|
1360
|
+
description: "Update role",
|
|
1361
|
+
argName: "roleId",
|
|
1362
|
+
update: (client, key, body) => client.role.updateRole(key, body),
|
|
1363
|
+
bodyFields: [{ name: "name", type: "string", description: "The display name of the new role.", required: true }, { name: "description", type: "string", description: "The description of the new role." }],
|
|
1364
|
+
}),
|
|
1365
|
+
makeDeleteCmd({
|
|
1366
|
+
description: "Delete role",
|
|
1367
|
+
argName: "roleId",
|
|
1368
|
+
delete: (client, key) => client.role.deleteRole(key),
|
|
1369
|
+
}),
|
|
1370
|
+
{
|
|
1371
|
+
name: "searchclientsfor",
|
|
1372
|
+
description: "Search role clients",
|
|
1373
|
+
args: [{ name: "roleId", description: "roleId", required: true }],
|
|
1374
|
+
flags: [DATA_OPT_FLAG],
|
|
1375
|
+
async run(ctx) {
|
|
1376
|
+
const roleId = ctx.positional[0];
|
|
1377
|
+
if (!roleId)
|
|
1378
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1379
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1380
|
+
const client = await ctx.getClient();
|
|
1381
|
+
const result = await client.role.searchClientsForRole(roleId, body);
|
|
1382
|
+
ctx.output.printItem(result);
|
|
1383
|
+
},
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
name: "assign-to-client",
|
|
1387
|
+
description: "Assign a role to a client",
|
|
1388
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "clientId", description: "clientId", required: true }],
|
|
1389
|
+
async run(ctx) {
|
|
1390
|
+
const roleId = ctx.positional[0];
|
|
1391
|
+
if (!roleId)
|
|
1392
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1393
|
+
const clientId = ctx.positional[1];
|
|
1394
|
+
if (!clientId)
|
|
1395
|
+
throw new Error("Missing required argument: <clientId>");
|
|
1396
|
+
const client = await ctx.getClient();
|
|
1397
|
+
await client.role.assignRoleToClient(roleId, clientId);
|
|
1398
|
+
ctx.output.ok("assign-to-client completed.");
|
|
1399
|
+
},
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
name: "unassign-from-client",
|
|
1403
|
+
description: "Unassign a role from a client",
|
|
1404
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "clientId", description: "clientId", required: true }],
|
|
1405
|
+
async run(ctx) {
|
|
1406
|
+
const roleId = ctx.positional[0];
|
|
1407
|
+
if (!roleId)
|
|
1408
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1409
|
+
const clientId = ctx.positional[1];
|
|
1410
|
+
if (!clientId)
|
|
1411
|
+
throw new Error("Missing required argument: <clientId>");
|
|
1412
|
+
const client = await ctx.getClient();
|
|
1413
|
+
await client.role.unassignRoleFromClient(roleId, clientId);
|
|
1414
|
+
ctx.output.ok("unassign-from-client completed.");
|
|
1415
|
+
},
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
name: "searchgroupsfor",
|
|
1419
|
+
description: "Search role groups",
|
|
1420
|
+
args: [{ name: "roleId", description: "roleId", required: true }],
|
|
1421
|
+
flags: [DATA_OPT_FLAG],
|
|
1422
|
+
async run(ctx) {
|
|
1423
|
+
const roleId = ctx.positional[0];
|
|
1424
|
+
if (!roleId)
|
|
1425
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1426
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1427
|
+
const client = await ctx.getClient();
|
|
1428
|
+
const result = await client.role.searchGroupsForRole(roleId, body);
|
|
1429
|
+
ctx.output.printItem(result);
|
|
1430
|
+
},
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
name: "assign-to-group",
|
|
1434
|
+
description: "Assign a role to a group",
|
|
1435
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "groupId", description: "groupId", required: true }],
|
|
1436
|
+
async run(ctx) {
|
|
1437
|
+
const roleId = ctx.positional[0];
|
|
1438
|
+
if (!roleId)
|
|
1439
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1440
|
+
const groupId = ctx.positional[1];
|
|
1441
|
+
if (!groupId)
|
|
1442
|
+
throw new Error("Missing required argument: <groupId>");
|
|
1443
|
+
const client = await ctx.getClient();
|
|
1444
|
+
await client.role.assignRoleToGroup(roleId, groupId);
|
|
1445
|
+
ctx.output.ok("assign-to-group completed.");
|
|
1446
|
+
},
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
name: "unassign-from-group",
|
|
1450
|
+
description: "Unassign a role from a group",
|
|
1451
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "groupId", description: "groupId", required: true }],
|
|
1452
|
+
async run(ctx) {
|
|
1453
|
+
const roleId = ctx.positional[0];
|
|
1454
|
+
if (!roleId)
|
|
1455
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1456
|
+
const groupId = ctx.positional[1];
|
|
1457
|
+
if (!groupId)
|
|
1458
|
+
throw new Error("Missing required argument: <groupId>");
|
|
1459
|
+
const client = await ctx.getClient();
|
|
1460
|
+
await client.role.unassignRoleFromGroup(roleId, groupId);
|
|
1461
|
+
ctx.output.ok("unassign-from-group completed.");
|
|
1462
|
+
},
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
name: "searchmappingrulesfor",
|
|
1466
|
+
description: "Search role mapping rules",
|
|
1467
|
+
args: [{ name: "roleId", description: "roleId", required: true }],
|
|
1468
|
+
flags: [DATA_OPT_FLAG],
|
|
1469
|
+
async run(ctx) {
|
|
1470
|
+
const roleId = ctx.positional[0];
|
|
1471
|
+
if (!roleId)
|
|
1472
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1473
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1474
|
+
const client = await ctx.getClient();
|
|
1475
|
+
const result = await client.role.searchMappingRulesForRole(roleId, body);
|
|
1476
|
+
ctx.output.printItem(result);
|
|
1477
|
+
},
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
name: "assign-to-mapping-rule",
|
|
1481
|
+
description: "Assign a role to a mapping rule",
|
|
1482
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "mappingRuleId", description: "mappingRuleId", required: true }],
|
|
1483
|
+
async run(ctx) {
|
|
1484
|
+
const roleId = ctx.positional[0];
|
|
1485
|
+
if (!roleId)
|
|
1486
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1487
|
+
const mappingRuleId = ctx.positional[1];
|
|
1488
|
+
if (!mappingRuleId)
|
|
1489
|
+
throw new Error("Missing required argument: <mappingRuleId>");
|
|
1490
|
+
const client = await ctx.getClient();
|
|
1491
|
+
await client.role.assignRoleToMappingRule(roleId, mappingRuleId);
|
|
1492
|
+
ctx.output.ok("assign-to-mapping-rule completed.");
|
|
1493
|
+
},
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
name: "unassign-from-mapping-rule",
|
|
1497
|
+
description: "Unassign a role from a mapping rule",
|
|
1498
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "mappingRuleId", description: "mappingRuleId", required: true }],
|
|
1499
|
+
async run(ctx) {
|
|
1500
|
+
const roleId = ctx.positional[0];
|
|
1501
|
+
if (!roleId)
|
|
1502
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1503
|
+
const mappingRuleId = ctx.positional[1];
|
|
1504
|
+
if (!mappingRuleId)
|
|
1505
|
+
throw new Error("Missing required argument: <mappingRuleId>");
|
|
1506
|
+
const client = await ctx.getClient();
|
|
1507
|
+
await client.role.unassignRoleFromMappingRule(roleId, mappingRuleId);
|
|
1508
|
+
ctx.output.ok("unassign-from-mapping-rule completed.");
|
|
1509
|
+
},
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
name: "searchusersfor",
|
|
1513
|
+
description: "Search role users",
|
|
1514
|
+
args: [{ name: "roleId", description: "roleId", required: true }],
|
|
1515
|
+
flags: [DATA_OPT_FLAG],
|
|
1516
|
+
async run(ctx) {
|
|
1517
|
+
const roleId = ctx.positional[0];
|
|
1518
|
+
if (!roleId)
|
|
1519
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1520
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1521
|
+
const client = await ctx.getClient();
|
|
1522
|
+
const result = await client.role.searchUsersForRole(roleId, body);
|
|
1523
|
+
ctx.output.printItem(result);
|
|
1524
|
+
},
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
name: "assign-to-user",
|
|
1528
|
+
description: "Assign a role to a user",
|
|
1529
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "username", description: "username", required: true }],
|
|
1530
|
+
async run(ctx) {
|
|
1531
|
+
const roleId = ctx.positional[0];
|
|
1532
|
+
if (!roleId)
|
|
1533
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1534
|
+
const username = ctx.positional[1];
|
|
1535
|
+
if (!username)
|
|
1536
|
+
throw new Error("Missing required argument: <username>");
|
|
1537
|
+
const client = await ctx.getClient();
|
|
1538
|
+
await client.role.assignRoleToUser(roleId, username);
|
|
1539
|
+
ctx.output.ok("assign-to-user completed.");
|
|
1540
|
+
},
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
name: "unassign-from-user",
|
|
1544
|
+
description: "Unassign a role from a user",
|
|
1545
|
+
args: [{ name: "roleId", description: "roleId", required: true }, { name: "username", description: "username", required: true }],
|
|
1546
|
+
async run(ctx) {
|
|
1547
|
+
const roleId = ctx.positional[0];
|
|
1548
|
+
if (!roleId)
|
|
1549
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1550
|
+
const username = ctx.positional[1];
|
|
1551
|
+
if (!username)
|
|
1552
|
+
throw new Error("Missing required argument: <username>");
|
|
1553
|
+
const client = await ctx.getClient();
|
|
1554
|
+
await client.role.unassignRoleFromUser(roleId, username);
|
|
1555
|
+
ctx.output.ok("unassign-from-user completed.");
|
|
1556
|
+
},
|
|
1557
|
+
},
|
|
1558
|
+
],
|
|
1559
|
+
};
|
|
1560
|
+
// ── Setup ──
|
|
1561
|
+
export const setupGroup = {
|
|
1562
|
+
name: "setup",
|
|
1563
|
+
description: "Setup",
|
|
1564
|
+
commands: [
|
|
1565
|
+
makeCreateCmd({
|
|
1566
|
+
name: "create-admin-user",
|
|
1567
|
+
description: "Create admin user",
|
|
1568
|
+
create: (client, body) => client.setup.createAdminUser(body),
|
|
1569
|
+
bodyFields: [{ name: "password", type: "string", description: "The password of the user.", required: true }, { name: "username", type: "string", description: "The username of the user.", required: true }, { name: "name", type: "string", description: "The name of the user." }, { name: "email", type: "string", description: "The email of the user." }],
|
|
1570
|
+
}),
|
|
1571
|
+
],
|
|
1572
|
+
};
|
|
1573
|
+
// ── Signal ──
|
|
1574
|
+
export const signalGroup = {
|
|
1575
|
+
name: "signal",
|
|
1576
|
+
description: "Signal",
|
|
1577
|
+
commands: [
|
|
1578
|
+
makeCreateCmd({
|
|
1579
|
+
name: "broadcast",
|
|
1580
|
+
description: "Broadcast signal",
|
|
1581
|
+
create: (client, body) => client.signal.broadcastSignal(body),
|
|
1582
|
+
bodyFields: [{ name: "signalName", type: "string", description: "The name of the signal to broadcast.", required: true }, { name: "variables", type: "object", description: "The signal variables as a JSON object." }, { name: "tenantId", type: "string", description: "The ID of the tenant that owns the signal." }],
|
|
1583
|
+
}),
|
|
1584
|
+
],
|
|
1585
|
+
};
|
|
1586
|
+
// ── Cluster ──
|
|
1587
|
+
export const clusterGroup = {
|
|
1588
|
+
name: "cluster",
|
|
1589
|
+
description: "Cluster",
|
|
1590
|
+
commands: [
|
|
1591
|
+
{
|
|
1592
|
+
name: "get-status",
|
|
1593
|
+
description: "Get cluster status",
|
|
1594
|
+
async run(ctx) {
|
|
1595
|
+
const client = await ctx.getClient();
|
|
1596
|
+
await client.cluster.getStatus();
|
|
1597
|
+
ctx.output.ok("get-status completed.");
|
|
1598
|
+
},
|
|
1599
|
+
},
|
|
1600
|
+
{
|
|
1601
|
+
name: "get-topology",
|
|
1602
|
+
description: "Get cluster topology",
|
|
1603
|
+
async run(ctx) {
|
|
1604
|
+
const client = await ctx.getClient();
|
|
1605
|
+
const result = await client.cluster.getTopology();
|
|
1606
|
+
ctx.output.printItem(result);
|
|
1607
|
+
},
|
|
1608
|
+
},
|
|
1609
|
+
],
|
|
1610
|
+
};
|
|
1611
|
+
// ── System ──
|
|
1612
|
+
export const systemGroup = {
|
|
1613
|
+
name: "system",
|
|
1614
|
+
description: "System",
|
|
1615
|
+
commands: [
|
|
1616
|
+
{
|
|
1617
|
+
name: "get-usage-metrics",
|
|
1618
|
+
description: "Get usage metrics",
|
|
1619
|
+
async run(ctx) {
|
|
1620
|
+
const client = await ctx.getClient();
|
|
1621
|
+
const result = await client.system.getUsageMetrics();
|
|
1622
|
+
ctx.output.printItem(result);
|
|
1623
|
+
},
|
|
1624
|
+
},
|
|
1625
|
+
],
|
|
1626
|
+
};
|
|
1627
|
+
// ── Tenant ──
|
|
1628
|
+
export const tenantGroup = {
|
|
1629
|
+
name: "tenant",
|
|
1630
|
+
description: "Tenant",
|
|
1631
|
+
commands: [
|
|
1632
|
+
makeCreateCmd({
|
|
1633
|
+
description: "Create tenant",
|
|
1634
|
+
create: (client, body) => client.tenant.createTenant(body),
|
|
1635
|
+
bodyFields: [{ name: "tenantId", type: "string", description: "The unique ID for the tenant. Must be 255 characters or less. Can contain letters, numbers, [`_`, `-`, `+`, `.`, `@`].", required: true }, { name: "name", type: "string", description: "The name of the tenant.", required: true }, { name: "description", type: "string", description: "The description of the tenant." }],
|
|
1636
|
+
}),
|
|
1637
|
+
makeListCmd({
|
|
1638
|
+
description: "Search tenants",
|
|
1639
|
+
columns: [
|
|
1640
|
+
{ key: "tenantId", header: "TENANT ID" },
|
|
1641
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
1642
|
+
{ key: "description", header: "DESCRIPTION", maxWidth: 30 },
|
|
1643
|
+
],
|
|
1644
|
+
filterFields: [{ name: "tenantId", type: "string", description: "The unique identifier of the tenant." }, { name: "name", type: "string", description: "The name of the tenant." }],
|
|
1645
|
+
search: (client, body) => client.tenant.searchTenants(body),
|
|
1646
|
+
}),
|
|
1647
|
+
makeGetCmd({
|
|
1648
|
+
description: "Get tenant",
|
|
1649
|
+
argName: "tenantId",
|
|
1650
|
+
get: (client, key) => client.tenant.getTenant(key),
|
|
1651
|
+
}),
|
|
1652
|
+
makeUpdateCmd({
|
|
1653
|
+
description: "Update tenant",
|
|
1654
|
+
argName: "tenantId",
|
|
1655
|
+
update: (client, key, body) => client.tenant.updateTenant(key, body),
|
|
1656
|
+
bodyFields: [{ name: "name", type: "string", description: "The new name of the tenant.", required: true }, { name: "description", type: "string", description: "The new description of the tenant." }],
|
|
1657
|
+
}),
|
|
1658
|
+
makeDeleteCmd({
|
|
1659
|
+
description: "Delete tenant",
|
|
1660
|
+
argName: "tenantId",
|
|
1661
|
+
delete: (client, key) => client.tenant.deleteTenant(key),
|
|
1662
|
+
}),
|
|
1663
|
+
{
|
|
1664
|
+
name: "searchclientsfor",
|
|
1665
|
+
description: "Search clients for tenant",
|
|
1666
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }],
|
|
1667
|
+
flags: [DATA_OPT_FLAG],
|
|
1668
|
+
async run(ctx) {
|
|
1669
|
+
const tenantId = ctx.positional[0];
|
|
1670
|
+
if (!tenantId)
|
|
1671
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1672
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1673
|
+
const client = await ctx.getClient();
|
|
1674
|
+
const result = await client.tenant.searchClientsForTenant(tenantId, body);
|
|
1675
|
+
ctx.output.printItem(result);
|
|
1676
|
+
},
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
name: "assignclientto",
|
|
1680
|
+
description: "Assign a client to a tenant",
|
|
1681
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "clientId", description: "clientId", required: true }],
|
|
1682
|
+
async run(ctx) {
|
|
1683
|
+
const tenantId = ctx.positional[0];
|
|
1684
|
+
if (!tenantId)
|
|
1685
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1686
|
+
const clientId = ctx.positional[1];
|
|
1687
|
+
if (!clientId)
|
|
1688
|
+
throw new Error("Missing required argument: <clientId>");
|
|
1689
|
+
const client = await ctx.getClient();
|
|
1690
|
+
await client.tenant.assignClientToTenant(tenantId, clientId);
|
|
1691
|
+
ctx.output.ok("assignclientto completed.");
|
|
1692
|
+
},
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
name: "unassignclientfrom",
|
|
1696
|
+
description: "Unassign a client from a tenant",
|
|
1697
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "clientId", description: "clientId", required: true }],
|
|
1698
|
+
async run(ctx) {
|
|
1699
|
+
const tenantId = ctx.positional[0];
|
|
1700
|
+
if (!tenantId)
|
|
1701
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1702
|
+
const clientId = ctx.positional[1];
|
|
1703
|
+
if (!clientId)
|
|
1704
|
+
throw new Error("Missing required argument: <clientId>");
|
|
1705
|
+
const client = await ctx.getClient();
|
|
1706
|
+
await client.tenant.unassignClientFromTenant(tenantId, clientId);
|
|
1707
|
+
ctx.output.ok("unassignclientfrom completed.");
|
|
1708
|
+
},
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
name: "searchgroupidsfor",
|
|
1712
|
+
description: "Search groups for tenant",
|
|
1713
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }],
|
|
1714
|
+
flags: [DATA_OPT_FLAG],
|
|
1715
|
+
async run(ctx) {
|
|
1716
|
+
const tenantId = ctx.positional[0];
|
|
1717
|
+
if (!tenantId)
|
|
1718
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1719
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1720
|
+
const client = await ctx.getClient();
|
|
1721
|
+
const result = await client.tenant.searchGroupIdsForTenant(tenantId, body);
|
|
1722
|
+
ctx.output.printItem(result);
|
|
1723
|
+
},
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
name: "assigngroupto",
|
|
1727
|
+
description: "Assign a group to a tenant",
|
|
1728
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "groupId", description: "groupId", required: true }],
|
|
1729
|
+
async run(ctx) {
|
|
1730
|
+
const tenantId = ctx.positional[0];
|
|
1731
|
+
if (!tenantId)
|
|
1732
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1733
|
+
const groupId = ctx.positional[1];
|
|
1734
|
+
if (!groupId)
|
|
1735
|
+
throw new Error("Missing required argument: <groupId>");
|
|
1736
|
+
const client = await ctx.getClient();
|
|
1737
|
+
await client.tenant.assignGroupToTenant(tenantId, groupId);
|
|
1738
|
+
ctx.output.ok("assigngroupto completed.");
|
|
1739
|
+
},
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
name: "unassigngroupfrom",
|
|
1743
|
+
description: "Unassign a group from a tenant",
|
|
1744
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "groupId", description: "groupId", required: true }],
|
|
1745
|
+
async run(ctx) {
|
|
1746
|
+
const tenantId = ctx.positional[0];
|
|
1747
|
+
if (!tenantId)
|
|
1748
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1749
|
+
const groupId = ctx.positional[1];
|
|
1750
|
+
if (!groupId)
|
|
1751
|
+
throw new Error("Missing required argument: <groupId>");
|
|
1752
|
+
const client = await ctx.getClient();
|
|
1753
|
+
await client.tenant.unassignGroupFromTenant(tenantId, groupId);
|
|
1754
|
+
ctx.output.ok("unassigngroupfrom completed.");
|
|
1755
|
+
},
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
name: "searchmappingrulesfor",
|
|
1759
|
+
description: "Search mapping rules for tenant",
|
|
1760
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }],
|
|
1761
|
+
flags: [DATA_OPT_FLAG],
|
|
1762
|
+
async run(ctx) {
|
|
1763
|
+
const tenantId = ctx.positional[0];
|
|
1764
|
+
if (!tenantId)
|
|
1765
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1766
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1767
|
+
const client = await ctx.getClient();
|
|
1768
|
+
const result = await client.tenant.searchMappingRulesForTenant(tenantId, body);
|
|
1769
|
+
ctx.output.printItem(result);
|
|
1770
|
+
},
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
name: "assignmappingruleto",
|
|
1774
|
+
description: "Assign a mapping rule to a tenant",
|
|
1775
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "mappingRuleId", description: "mappingRuleId", required: true }],
|
|
1776
|
+
async run(ctx) {
|
|
1777
|
+
const tenantId = ctx.positional[0];
|
|
1778
|
+
if (!tenantId)
|
|
1779
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1780
|
+
const mappingRuleId = ctx.positional[1];
|
|
1781
|
+
if (!mappingRuleId)
|
|
1782
|
+
throw new Error("Missing required argument: <mappingRuleId>");
|
|
1783
|
+
const client = await ctx.getClient();
|
|
1784
|
+
await client.tenant.assignMappingRuleToTenant(tenantId, mappingRuleId);
|
|
1785
|
+
ctx.output.ok("assignmappingruleto completed.");
|
|
1786
|
+
},
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
name: "unassignmappingrulefrom",
|
|
1790
|
+
description: "Unassign a mapping rule from a tenant",
|
|
1791
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "mappingRuleId", description: "mappingRuleId", required: true }],
|
|
1792
|
+
async run(ctx) {
|
|
1793
|
+
const tenantId = ctx.positional[0];
|
|
1794
|
+
if (!tenantId)
|
|
1795
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1796
|
+
const mappingRuleId = ctx.positional[1];
|
|
1797
|
+
if (!mappingRuleId)
|
|
1798
|
+
throw new Error("Missing required argument: <mappingRuleId>");
|
|
1799
|
+
const client = await ctx.getClient();
|
|
1800
|
+
await client.tenant.unassignMappingRuleFromTenant(tenantId, mappingRuleId);
|
|
1801
|
+
ctx.output.ok("unassignmappingrulefrom completed.");
|
|
1802
|
+
},
|
|
1803
|
+
},
|
|
1804
|
+
{
|
|
1805
|
+
name: "searchrolesfor",
|
|
1806
|
+
description: "Search roles for tenant",
|
|
1807
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }],
|
|
1808
|
+
flags: [DATA_OPT_FLAG],
|
|
1809
|
+
async run(ctx) {
|
|
1810
|
+
const tenantId = ctx.positional[0];
|
|
1811
|
+
if (!tenantId)
|
|
1812
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1813
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1814
|
+
const client = await ctx.getClient();
|
|
1815
|
+
const result = await client.tenant.searchRolesForTenant(tenantId, body);
|
|
1816
|
+
ctx.output.printItem(result);
|
|
1817
|
+
},
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
name: "assignroleto",
|
|
1821
|
+
description: "Assign a role to a tenant",
|
|
1822
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "roleId", description: "roleId", required: true }],
|
|
1823
|
+
async run(ctx) {
|
|
1824
|
+
const tenantId = ctx.positional[0];
|
|
1825
|
+
if (!tenantId)
|
|
1826
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1827
|
+
const roleId = ctx.positional[1];
|
|
1828
|
+
if (!roleId)
|
|
1829
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1830
|
+
const client = await ctx.getClient();
|
|
1831
|
+
await client.tenant.assignRoleToTenant(tenantId, roleId);
|
|
1832
|
+
ctx.output.ok("assignroleto completed.");
|
|
1833
|
+
},
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
name: "unassignrolefrom",
|
|
1837
|
+
description: "Unassign a role from a tenant",
|
|
1838
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "roleId", description: "roleId", required: true }],
|
|
1839
|
+
async run(ctx) {
|
|
1840
|
+
const tenantId = ctx.positional[0];
|
|
1841
|
+
if (!tenantId)
|
|
1842
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1843
|
+
const roleId = ctx.positional[1];
|
|
1844
|
+
if (!roleId)
|
|
1845
|
+
throw new Error("Missing required argument: <roleId>");
|
|
1846
|
+
const client = await ctx.getClient();
|
|
1847
|
+
await client.tenant.unassignRoleFromTenant(tenantId, roleId);
|
|
1848
|
+
ctx.output.ok("unassignrolefrom completed.");
|
|
1849
|
+
},
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
name: "searchusersfor",
|
|
1853
|
+
description: "Search users for tenant",
|
|
1854
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }],
|
|
1855
|
+
flags: [DATA_OPT_FLAG],
|
|
1856
|
+
async run(ctx) {
|
|
1857
|
+
const tenantId = ctx.positional[0];
|
|
1858
|
+
if (!tenantId)
|
|
1859
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1860
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1861
|
+
const client = await ctx.getClient();
|
|
1862
|
+
const result = await client.tenant.searchUsersForTenant(tenantId, body);
|
|
1863
|
+
ctx.output.printItem(result);
|
|
1864
|
+
},
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
name: "assignuserto",
|
|
1868
|
+
description: "Assign a user to a tenant",
|
|
1869
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "username", description: "username", required: true }],
|
|
1870
|
+
async run(ctx) {
|
|
1871
|
+
const tenantId = ctx.positional[0];
|
|
1872
|
+
if (!tenantId)
|
|
1873
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1874
|
+
const username = ctx.positional[1];
|
|
1875
|
+
if (!username)
|
|
1876
|
+
throw new Error("Missing required argument: <username>");
|
|
1877
|
+
const client = await ctx.getClient();
|
|
1878
|
+
await client.tenant.assignUserToTenant(tenantId, username);
|
|
1879
|
+
ctx.output.ok("assignuserto completed.");
|
|
1880
|
+
},
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
name: "unassignuserfrom",
|
|
1884
|
+
description: "Unassign a user from a tenant",
|
|
1885
|
+
args: [{ name: "tenantId", description: "tenantId", required: true }, { name: "username", description: "username", required: true }],
|
|
1886
|
+
async run(ctx) {
|
|
1887
|
+
const tenantId = ctx.positional[0];
|
|
1888
|
+
if (!tenantId)
|
|
1889
|
+
throw new Error("Missing required argument: <tenantId>");
|
|
1890
|
+
const username = ctx.positional[1];
|
|
1891
|
+
if (!username)
|
|
1892
|
+
throw new Error("Missing required argument: <username>");
|
|
1893
|
+
const client = await ctx.getClient();
|
|
1894
|
+
await client.tenant.unassignUserFromTenant(tenantId, username);
|
|
1895
|
+
ctx.output.ok("unassignuserfrom completed.");
|
|
1896
|
+
},
|
|
1897
|
+
},
|
|
1898
|
+
],
|
|
1899
|
+
};
|
|
1900
|
+
// ── User ──
|
|
1901
|
+
export const userGroup = {
|
|
1902
|
+
name: "user",
|
|
1903
|
+
description: "User",
|
|
1904
|
+
commands: [
|
|
1905
|
+
makeCreateCmd({
|
|
1906
|
+
description: "Create user",
|
|
1907
|
+
create: (client, body) => client.user.createUser(body),
|
|
1908
|
+
bodyFields: [{ name: "password", type: "string", description: "The password of the user.", required: true }, { name: "username", type: "string", description: "The username of the user.", required: true }, { name: "name", type: "string", description: "The name of the user." }, { name: "email", type: "string", description: "The email of the user." }],
|
|
1909
|
+
}),
|
|
1910
|
+
makeListCmd({
|
|
1911
|
+
description: "Search users",
|
|
1912
|
+
columns: [
|
|
1913
|
+
{ key: "username", header: "USERNAME", maxWidth: 30 },
|
|
1914
|
+
{ key: "name", header: "NAME", maxWidth: 30 },
|
|
1915
|
+
{ key: "email", header: "EMAIL", maxWidth: 30 },
|
|
1916
|
+
],
|
|
1917
|
+
filterFields: [{ name: "username", type: "object", description: "The username of the user." }, { name: "name", type: "object", description: "The name of the user." }, { name: "email", type: "object", description: "The email of the user." }],
|
|
1918
|
+
search: (client, body) => client.user.searchUsers(body),
|
|
1919
|
+
}),
|
|
1920
|
+
makeGetCmd({
|
|
1921
|
+
description: "Get user",
|
|
1922
|
+
argName: "username",
|
|
1923
|
+
get: (client, key) => client.user.getUser(key),
|
|
1924
|
+
}),
|
|
1925
|
+
makeUpdateCmd({
|
|
1926
|
+
description: "Update user",
|
|
1927
|
+
argName: "username",
|
|
1928
|
+
update: (client, key, body) => client.user.updateUser(key, body),
|
|
1929
|
+
bodyFields: [{ name: "password", type: "string", description: "The password of the user. If blank, the password is unchanged." }, { name: "name", type: "string", description: "The name of the user." }, { name: "email", type: "string", description: "The email of the user." }],
|
|
1930
|
+
}),
|
|
1931
|
+
makeDeleteCmd({
|
|
1932
|
+
description: "Delete user",
|
|
1933
|
+
argName: "username",
|
|
1934
|
+
delete: (client, key) => client.user.deleteUser(key),
|
|
1935
|
+
}),
|
|
1936
|
+
],
|
|
1937
|
+
};
|
|
1938
|
+
// ── User task ──
|
|
1939
|
+
export const userTaskGroup = {
|
|
1940
|
+
name: "user-task",
|
|
1941
|
+
aliases: ["ut"],
|
|
1942
|
+
description: "User task",
|
|
1943
|
+
commands: [
|
|
1944
|
+
makeListCmd({
|
|
1945
|
+
description: "Search user tasks",
|
|
1946
|
+
columns: [
|
|
1947
|
+
{ key: "userTaskKey", header: "USER TASK KEY" },
|
|
1948
|
+
{ key: "elementInstanceKey", header: "ELEMENT INSTANCE KEY" },
|
|
1949
|
+
{ key: "processDefinitionKey", header: "PROCESS DEFINITION KEY" },
|
|
1950
|
+
{ key: "processInstanceKey", header: "PROCESS INSTANCE KEY" },
|
|
1951
|
+
{ key: "rootProcessInstanceKey", header: "ROOT PROCESS INSTANCE KEY" },
|
|
1952
|
+
{ key: "formKey", header: "FORM KEY" },
|
|
1953
|
+
{ key: "state", header: "STATE", maxWidth: 30 },
|
|
1954
|
+
],
|
|
1955
|
+
filterFields: [{ name: "state", type: "object", description: "The user task state." }, { name: "assignee", type: "object", description: "The assignee of the user task." }, { name: "priority", type: "object", description: "The priority of the user task." }, { name: "elementId", type: "string", description: "The element ID of the user task." }, { name: "name", type: "object", description: "The task name. This only works for data created with 8.8 and onwards. Instances from prior versions don't contain this data and cannot be found." }, { name: "candidateGroup", type: "object", description: "The candidate group for this user task." }, { name: "candidateUser", type: "object", description: "The candidate user for this user task." }, { name: "tenantId", type: "object", description: "Tenant ID of this user task." }, { name: "processDefinitionId", type: "string", description: "The ID of the process definition." }, { name: "creationDate", type: "object", description: "The user task creation date." }, { name: "completionDate", type: "object", description: "The user task completion date." }, { name: "followUpDate", type: "object", description: "The user task follow-up date." }, { name: "dueDate", type: "object", description: "The user task due date." }, { name: "processInstanceVariables", type: "array", description: "The variables of the process instance." }, { name: "localVariables", type: "array", description: "The local variables of the user task." }, { name: "userTaskKey", type: "string", description: "The key for this user task." }, { name: "processDefinitionKey", type: "string", description: "The key of the process definition." }, { name: "processInstanceKey", type: "string", description: "The key of the process instance." }, { name: "elementInstanceKey", type: "string", description: "The key of the element instance." }, { name: "tags", type: "array", description: "List of tags. Tags need to start with a letter; then alphanumerics, `_`, `-`, `:`, or `.`; length ≤ 100." }],
|
|
1956
|
+
search: (client, body) => client.userTask.searchUserTasks(body),
|
|
1957
|
+
}),
|
|
1958
|
+
makeGetCmd({
|
|
1959
|
+
description: "Get user task",
|
|
1960
|
+
argName: "userTaskKey",
|
|
1961
|
+
get: (client, key) => client.userTask.getUserTask(key),
|
|
1962
|
+
}),
|
|
1963
|
+
makeUpdateCmd({
|
|
1964
|
+
description: "Update user task",
|
|
1965
|
+
argName: "userTaskKey",
|
|
1966
|
+
update: (client, key, body) => client.userTask.updateUserTask(key, body),
|
|
1967
|
+
bodyFields: [{ name: "changeset", type: "object", description: " JSON object with changed task attribute values.\n\n The following attributes can be adjusted with this endpoint, additional attributes\n will be ignored:\n\n * `candidateGroups` - reset by providing an empty list\n * `candidateUsers` - reset by providing an empty list\n * `dueDate` - reset by providing an empty String\n * `followUpDate` - reset by providing an empty String\n * `priority` - minimum 0, maximum 100, default 50\n\n Providing any of those attributes with a `null` value or omitting it preserves\n the persisted attribute's value.\n\n The assignee cannot be adjusted with this endpoint, use the Assign task endpoint.\n This ensures correct event emission for assignee changes." }, { name: "action", type: "string", description: "A custom action value that will be accessible from user task events resulting from this endpoint invocation. If not provided, it will default to \"update\"." }],
|
|
1968
|
+
}),
|
|
1969
|
+
makeDeleteCmd({
|
|
1970
|
+
name: "unassign",
|
|
1971
|
+
description: "Unassign user task",
|
|
1972
|
+
argName: "userTaskKey",
|
|
1973
|
+
delete: (client, key) => client.userTask.unassignUserTask(key),
|
|
1974
|
+
}),
|
|
1975
|
+
{
|
|
1976
|
+
name: "assign",
|
|
1977
|
+
description: "Assign user task",
|
|
1978
|
+
args: [{ name: "userTaskKey", description: "userTaskKey", required: true }],
|
|
1979
|
+
flags: [DATA_FLAG],
|
|
1980
|
+
async run(ctx) {
|
|
1981
|
+
const userTaskKey = ctx.positional[0];
|
|
1982
|
+
if (!userTaskKey)
|
|
1983
|
+
throw new Error("Missing required argument: <userTaskKey>");
|
|
1984
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
1985
|
+
const client = await ctx.getClient();
|
|
1986
|
+
await client.userTask.assignUserTask(userTaskKey, body);
|
|
1987
|
+
ctx.output.ok("assign completed.");
|
|
1988
|
+
},
|
|
1989
|
+
},
|
|
1990
|
+
{
|
|
1991
|
+
name: "list-audit-logs",
|
|
1992
|
+
description: "Search user task audit logs",
|
|
1993
|
+
args: [{ name: "userTaskKey", description: "userTaskKey", required: true }],
|
|
1994
|
+
flags: [DATA_OPT_FLAG],
|
|
1995
|
+
async run(ctx) {
|
|
1996
|
+
const userTaskKey = ctx.positional[0];
|
|
1997
|
+
if (!userTaskKey)
|
|
1998
|
+
throw new Error("Missing required argument: <userTaskKey>");
|
|
1999
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
2000
|
+
const client = await ctx.getClient();
|
|
2001
|
+
const result = await client.userTask.searchUserTaskAuditLogs(userTaskKey, body);
|
|
2002
|
+
ctx.output.printItem(result);
|
|
2003
|
+
},
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
name: "complete",
|
|
2007
|
+
description: "Complete user task",
|
|
2008
|
+
args: [{ name: "userTaskKey", description: "userTaskKey", required: true }],
|
|
2009
|
+
flags: [DATA_OPT_FLAG],
|
|
2010
|
+
async run(ctx) {
|
|
2011
|
+
const userTaskKey = ctx.positional[0];
|
|
2012
|
+
if (!userTaskKey)
|
|
2013
|
+
throw new Error("Missing required argument: <userTaskKey>");
|
|
2014
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
2015
|
+
const client = await ctx.getClient();
|
|
2016
|
+
await client.userTask.completeUserTask(userTaskKey, body);
|
|
2017
|
+
ctx.output.ok("complete completed.");
|
|
2018
|
+
},
|
|
2019
|
+
},
|
|
2020
|
+
makeGetCmd({
|
|
2021
|
+
name: "get-form",
|
|
2022
|
+
description: "Get user task form",
|
|
2023
|
+
argName: "userTaskKey",
|
|
2024
|
+
get: (client, key) => client.userTask.getUserTaskForm(key),
|
|
2025
|
+
}),
|
|
2026
|
+
{
|
|
2027
|
+
name: "list-variables",
|
|
2028
|
+
description: "Search user task variables",
|
|
2029
|
+
args: [{ name: "userTaskKey", description: "userTaskKey", required: true }],
|
|
2030
|
+
flags: [DATA_OPT_FLAG],
|
|
2031
|
+
async run(ctx) {
|
|
2032
|
+
const userTaskKey = ctx.positional[0];
|
|
2033
|
+
if (!userTaskKey)
|
|
2034
|
+
throw new Error("Missing required argument: <userTaskKey>");
|
|
2035
|
+
const body = parseJson(ctx.flags.data, "data");
|
|
2036
|
+
const client = await ctx.getClient();
|
|
2037
|
+
const result = await client.userTask.searchUserTaskVariables(userTaskKey, body);
|
|
2038
|
+
ctx.output.printItem(result);
|
|
2039
|
+
},
|
|
2040
|
+
},
|
|
2041
|
+
],
|
|
2042
|
+
};
|
|
2043
|
+
// ── Variable ──
|
|
2044
|
+
export const variableGroup = {
|
|
2045
|
+
name: "variable",
|
|
2046
|
+
aliases: ["var"],
|
|
2047
|
+
description: "Variable",
|
|
2048
|
+
commands: [
|
|
2049
|
+
makeListCmd({
|
|
2050
|
+
description: "Search variables",
|
|
2051
|
+
columns: [
|
|
2052
|
+
{ key: "value", header: "VALUE", maxWidth: 30 },
|
|
2053
|
+
{ key: "isTruncated", header: "IS TRUNCATED" },
|
|
2054
|
+
],
|
|
2055
|
+
filterFields: [{ name: "name", type: "object", description: "Name of the variable." }, { name: "value", type: "object", description: " The value of the variable.\n Variable values in filters need to be in serialized JSON format. For example, a variable\n with string value `myValue` can be found with the filter value `\"myValue\"`. Consider\n appropriate escaping for special characters in JSON strings when constructing filter values." }, { name: "tenantId", type: "string", description: "Tenant ID of this variable." }, { name: "isTruncated", type: "boolean", description: "Whether the value is truncated or not." }, { name: "variableKey", type: "object", description: "The key for this variable." }, { name: "scopeKey", type: "object", description: " The key of the scope that defines where this variable is directly defined. This can be a\n process instance key (for process-level variables) or an element instance key (for local\n variables scoped to tasks, subprocesses, gateways, events, etc.). Use this filter to\n find variables directly defined in specific scopes. Note that this does not include\n variables from parent scopes that would be visible through the scope hierarchy." }, { name: "processInstanceKey", type: "string", description: "The key of the process instance of this variable." }],
|
|
2056
|
+
search: (client, body) => client.variable.searchVariables(body),
|
|
2057
|
+
}),
|
|
2058
|
+
makeGetCmd({
|
|
2059
|
+
description: "Get variable",
|
|
2060
|
+
argName: "variableKey",
|
|
2061
|
+
get: (client, key) => client.variable.getVariable(key),
|
|
2062
|
+
}),
|
|
2063
|
+
],
|
|
2064
|
+
};
|
|
2065
|
+
export const generatedCommandGroups = [
|
|
2066
|
+
auditLogGroup,
|
|
2067
|
+
authenticationGroup,
|
|
2068
|
+
authorizationGroup,
|
|
2069
|
+
batchOperationGroup,
|
|
2070
|
+
clockGroup,
|
|
2071
|
+
clusterVariableGroup,
|
|
2072
|
+
conditionalGroup,
|
|
2073
|
+
messageSubscriptionGroup,
|
|
2074
|
+
decisionDefinitionGroup,
|
|
2075
|
+
decisionInstanceGroup,
|
|
2076
|
+
decisionRequirementsGroup,
|
|
2077
|
+
resourceGroup,
|
|
2078
|
+
documentGroup,
|
|
2079
|
+
adHocSubProcessGroup,
|
|
2080
|
+
elementInstanceGroup,
|
|
2081
|
+
expressionGroup,
|
|
2082
|
+
globalListenerGroup,
|
|
2083
|
+
groupGroup,
|
|
2084
|
+
incidentGroup,
|
|
2085
|
+
jobGroup,
|
|
2086
|
+
licenseGroup,
|
|
2087
|
+
mappingRuleGroup,
|
|
2088
|
+
messageGroup,
|
|
2089
|
+
processDefinitionGroup,
|
|
2090
|
+
processInstanceGroup,
|
|
2091
|
+
roleGroup,
|
|
2092
|
+
setupGroup,
|
|
2093
|
+
signalGroup,
|
|
2094
|
+
clusterGroup,
|
|
2095
|
+
systemGroup,
|
|
2096
|
+
tenantGroup,
|
|
2097
|
+
userGroup,
|
|
2098
|
+
userTaskGroup,
|
|
2099
|
+
variableGroup,
|
|
2100
|
+
];
|
|
2101
|
+
//# sourceMappingURL=commands.js.map
|