@io-orkes/conductor-javascript 1.0.0 → 1.1.0
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 +2 -2
- package/dist/index.d.ts +383 -42
- package/dist/index.js +392 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +391 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Netflix Conductor Javascript SDK
|
|
1
|
+
# Netflix Conductor Javascript/Typescript SDK
|
|
2
2
|
|
|
3
3
|
The `conductor-javascript` repository provides the client SDKs to build task workers in javascript/typescript.
|
|
4
4
|
|
|
@@ -52,4 +52,4 @@ orkesConductorClient(config).then(client => ..... );
|
|
|
52
52
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
### Next: [Create and run task workers](workers_sdk.md)
|
|
55
|
+
### Next: [Create and run task workers](workers_sdk.md)
|
package/dist/index.d.ts
CHANGED
|
@@ -1201,6 +1201,281 @@ declare class WorkflowResourceService {
|
|
|
1201
1201
|
resetWorkflow(workflowId: string): CancelablePromise<void>;
|
|
1202
1202
|
}
|
|
1203
1203
|
|
|
1204
|
+
declare type AssignmentPolicy = {
|
|
1205
|
+
type: string;
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
declare type FFAAssignment = AssignmentPolicy;
|
|
1209
|
+
|
|
1210
|
+
declare type Fixed = (AssignmentPolicy & {
|
|
1211
|
+
assignee?: string;
|
|
1212
|
+
assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
|
|
1213
|
+
});
|
|
1214
|
+
|
|
1215
|
+
declare type TimeoutPolicy = {
|
|
1216
|
+
type: string;
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
declare type BackToAssigment = (TimeoutPolicy & {
|
|
1220
|
+
timeoutSeconds?: number;
|
|
1221
|
+
});
|
|
1222
|
+
|
|
1223
|
+
declare type ClearAssigment = (TimeoutPolicy & {
|
|
1224
|
+
timeoutSeconds?: number;
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
declare type Escalate = (TimeoutPolicy & {
|
|
1228
|
+
subjects?: Array<string>;
|
|
1229
|
+
timeoutSeconds?: number;
|
|
1230
|
+
} & {
|
|
1231
|
+
subjects: Array<string>;
|
|
1232
|
+
});
|
|
1233
|
+
|
|
1234
|
+
declare type LeastBusyGroupMemberAssignment = (AssignmentPolicy & {
|
|
1235
|
+
groupId?: string;
|
|
1236
|
+
});
|
|
1237
|
+
|
|
1238
|
+
declare type Never = TimeoutPolicy;
|
|
1239
|
+
|
|
1240
|
+
declare type Terminate = (TimeoutPolicy & {
|
|
1241
|
+
timeoutSeconds?: number;
|
|
1242
|
+
});
|
|
1243
|
+
|
|
1244
|
+
declare type HumanTaskEntry = {
|
|
1245
|
+
assignee?: string;
|
|
1246
|
+
assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
|
|
1247
|
+
assignmentPolicy?: (FFAAssignment | Fixed | LeastBusyGroupMemberAssignment);
|
|
1248
|
+
claimedBy?: string;
|
|
1249
|
+
createdBy?: string;
|
|
1250
|
+
createdOn?: number;
|
|
1251
|
+
escalatedAt?: number;
|
|
1252
|
+
output?: Record<string, Record<string, any>>;
|
|
1253
|
+
owners?: Array<string>;
|
|
1254
|
+
predefinedInput?: Record<string, Record<string, any>>;
|
|
1255
|
+
state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT';
|
|
1256
|
+
taskId?: string;
|
|
1257
|
+
taskName?: string;
|
|
1258
|
+
taskRefName?: string;
|
|
1259
|
+
templateId?: string;
|
|
1260
|
+
timeoutPolicy?: (BackToAssigment | ClearAssigment | Escalate | Never | Terminate);
|
|
1261
|
+
workflowId?: string;
|
|
1262
|
+
workflowName?: string;
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
declare type HTScrollableSearchResultHumanTaskEntry = {
|
|
1266
|
+
queryId?: string;
|
|
1267
|
+
results?: Array<HumanTaskEntry>;
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
declare type HumanTaskActionLogEntry = {
|
|
1271
|
+
action?: string;
|
|
1272
|
+
actionTime?: number;
|
|
1273
|
+
cause?: string;
|
|
1274
|
+
id?: string;
|
|
1275
|
+
taskId?: string;
|
|
1276
|
+
taskRefName?: string;
|
|
1277
|
+
workflowId?: string;
|
|
1278
|
+
workflowName?: string;
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
declare type HumanTaskLoad = {
|
|
1282
|
+
assignedUser?: string;
|
|
1283
|
+
count?: number;
|
|
1284
|
+
taskRefName?: string;
|
|
1285
|
+
workflowName?: string;
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
declare type HumanTaskStateLogEntry = {
|
|
1289
|
+
assignee?: string;
|
|
1290
|
+
assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
|
|
1291
|
+
claimedBy?: string;
|
|
1292
|
+
id?: string;
|
|
1293
|
+
state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT';
|
|
1294
|
+
stateEnd?: number;
|
|
1295
|
+
stateStart?: number;
|
|
1296
|
+
taskId?: string;
|
|
1297
|
+
taskRefName?: string;
|
|
1298
|
+
workflowId?: string;
|
|
1299
|
+
workflowName?: string;
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
declare type HumanTaskTemplate = {
|
|
1303
|
+
jsonSchema: Record<string, Record<string, any>>;
|
|
1304
|
+
name: string;
|
|
1305
|
+
templateUI: Record<string, Record<string, any>>;
|
|
1306
|
+
version?: number;
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
declare type HumanTaskTemplateEntry = {
|
|
1310
|
+
createdBy?: string;
|
|
1311
|
+
createdOn?: number;
|
|
1312
|
+
id?: string;
|
|
1313
|
+
jsonSchema?: Record<string, Record<string, any>>;
|
|
1314
|
+
name?: string;
|
|
1315
|
+
templateUI?: Record<string, Record<string, any>>;
|
|
1316
|
+
updatedBy?: string;
|
|
1317
|
+
updatedOn?: number;
|
|
1318
|
+
version?: number;
|
|
1319
|
+
};
|
|
1320
|
+
|
|
1321
|
+
declare type SearchResultHumanTaskEntry = {
|
|
1322
|
+
results?: Array<HumanTaskEntry>;
|
|
1323
|
+
totalHits?: number;
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1326
|
+
declare class HumanTaskService {
|
|
1327
|
+
readonly httpRequest: BaseHttpRequest;
|
|
1328
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
1329
|
+
/**
|
|
1330
|
+
* List tasks by filters - task name, state, assignee, assignee type, claimed
|
|
1331
|
+
* @param state
|
|
1332
|
+
* @param assignee
|
|
1333
|
+
* @param assigneeType
|
|
1334
|
+
* @param claimedBy
|
|
1335
|
+
* @param taskName
|
|
1336
|
+
* @param freeText
|
|
1337
|
+
* @param includeInputOutput
|
|
1338
|
+
* @returns SearchResultHumanTaskEntry OK
|
|
1339
|
+
* @throws ApiError
|
|
1340
|
+
*/
|
|
1341
|
+
getTasksByFilter(state: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT', assignee?: string, assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP', claimedBy?: string, taskName?: string, freeText?: string, includeInputOutput?: boolean): CancelablePromise<SearchResultHumanTaskEntry>;
|
|
1342
|
+
/**
|
|
1343
|
+
* Get task load grouped by workflow name and task ref name per user
|
|
1344
|
+
* @returns HumanTaskLoad OK
|
|
1345
|
+
* @throws ApiError
|
|
1346
|
+
*/
|
|
1347
|
+
getTaskLoad(): CancelablePromise<Array<HumanTaskLoad>>;
|
|
1348
|
+
/**
|
|
1349
|
+
* Search human tasks
|
|
1350
|
+
* @param queryId
|
|
1351
|
+
* @param start
|
|
1352
|
+
* @param size
|
|
1353
|
+
* @param freeText
|
|
1354
|
+
* @param query
|
|
1355
|
+
* @param jsonQuery
|
|
1356
|
+
* @param includeInputOutput
|
|
1357
|
+
* @returns HTScrollableSearchResultHumanTaskEntry OK
|
|
1358
|
+
* @throws ApiError
|
|
1359
|
+
*/
|
|
1360
|
+
search1(queryId?: string, start?: number, size?: number, freeText?: string, query?: string, jsonQuery?: string, includeInputOutput?: boolean): CancelablePromise<HTScrollableSearchResultHumanTaskEntry>;
|
|
1361
|
+
/**
|
|
1362
|
+
* If the workflow is disconnected from tasks, this API can be used to clean up
|
|
1363
|
+
* @param taskId
|
|
1364
|
+
* @returns any OK
|
|
1365
|
+
* @throws ApiError
|
|
1366
|
+
*/
|
|
1367
|
+
updateTaskOutput1(taskId: string): CancelablePromise<any>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Get a task
|
|
1370
|
+
* @param taskId
|
|
1371
|
+
* @returns HumanTaskEntry OK
|
|
1372
|
+
* @throws ApiError
|
|
1373
|
+
*/
|
|
1374
|
+
getTask1(taskId: string): CancelablePromise<HumanTaskEntry>;
|
|
1375
|
+
/**
|
|
1376
|
+
* Get human task action log entries by task id
|
|
1377
|
+
* @param taskId
|
|
1378
|
+
* @returns HumanTaskActionLogEntry OK
|
|
1379
|
+
* @throws ApiError
|
|
1380
|
+
*/
|
|
1381
|
+
getActionLogs(taskId: string): CancelablePromise<Array<HumanTaskActionLogEntry>>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Claim a task by authenticated Conductor user
|
|
1384
|
+
* @param taskId
|
|
1385
|
+
* @returns any OK
|
|
1386
|
+
* @throws ApiError
|
|
1387
|
+
*/
|
|
1388
|
+
claimTask(taskId: string): CancelablePromise<any>;
|
|
1389
|
+
/**
|
|
1390
|
+
* Claim a task to an external user
|
|
1391
|
+
* @param taskId
|
|
1392
|
+
* @param userId
|
|
1393
|
+
* @returns any OK
|
|
1394
|
+
* @throws ApiError
|
|
1395
|
+
*/
|
|
1396
|
+
assignAndClaim(taskId: string, userId: string): CancelablePromise<any>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Release a task without completing it
|
|
1399
|
+
* @param taskId
|
|
1400
|
+
* @param requestBody
|
|
1401
|
+
* @returns any OK
|
|
1402
|
+
* @throws ApiError
|
|
1403
|
+
*/
|
|
1404
|
+
reassignTask(taskId: string, requestBody: (FFAAssignment | Fixed | LeastBusyGroupMemberAssignment)): CancelablePromise<any>;
|
|
1405
|
+
/**
|
|
1406
|
+
* Release a task without completing it
|
|
1407
|
+
* @param taskId
|
|
1408
|
+
* @returns any OK
|
|
1409
|
+
* @throws ApiError
|
|
1410
|
+
*/
|
|
1411
|
+
releaseTask(taskId: string): CancelablePromise<any>;
|
|
1412
|
+
/**
|
|
1413
|
+
* Get human task state log entries by task id
|
|
1414
|
+
* @param taskId
|
|
1415
|
+
* @returns HumanTaskStateLogEntry OK
|
|
1416
|
+
* @throws ApiError
|
|
1417
|
+
*/
|
|
1418
|
+
getStateLogs(taskId: string): CancelablePromise<Array<HumanTaskStateLogEntry>>;
|
|
1419
|
+
/**
|
|
1420
|
+
* Update task output, optionally complete
|
|
1421
|
+
* @param taskId
|
|
1422
|
+
* @param requestBody
|
|
1423
|
+
* @param complete
|
|
1424
|
+
* @returns any OK
|
|
1425
|
+
* @throws ApiError
|
|
1426
|
+
*/
|
|
1427
|
+
updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, any>>, complete?: boolean): CancelablePromise<any>;
|
|
1428
|
+
/**
|
|
1429
|
+
* Delete human task templates by name
|
|
1430
|
+
* @param name
|
|
1431
|
+
* @returns any OK
|
|
1432
|
+
* @throws ApiError
|
|
1433
|
+
*/
|
|
1434
|
+
deleteTemplatesByName(name: string): CancelablePromise<any>;
|
|
1435
|
+
/**
|
|
1436
|
+
* List all human task templates or get templates by name, or a template by name and version
|
|
1437
|
+
* @param name
|
|
1438
|
+
* @param version
|
|
1439
|
+
* @returns HumanTaskTemplateEntry OK
|
|
1440
|
+
* @throws ApiError
|
|
1441
|
+
*/
|
|
1442
|
+
getAllTemplates(name?: string, version?: number): CancelablePromise<Array<HumanTaskTemplateEntry>>;
|
|
1443
|
+
/**
|
|
1444
|
+
* Save human task template
|
|
1445
|
+
* @param requestBody
|
|
1446
|
+
* @param newVersion
|
|
1447
|
+
* @returns string OK
|
|
1448
|
+
* @throws ApiError
|
|
1449
|
+
*/
|
|
1450
|
+
saveTemplate(requestBody: HumanTaskTemplate, newVersion?: boolean): CancelablePromise<string>;
|
|
1451
|
+
/**
|
|
1452
|
+
* Delete human task template
|
|
1453
|
+
* @param id
|
|
1454
|
+
* @returns any OK
|
|
1455
|
+
* @throws ApiError
|
|
1456
|
+
*/
|
|
1457
|
+
deleteTemplateById(id: string): CancelablePromise<any>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Get human task template by id
|
|
1460
|
+
* @param id
|
|
1461
|
+
* @returns HumanTaskTemplateEntry OK
|
|
1462
|
+
* @throws ApiError
|
|
1463
|
+
*/
|
|
1464
|
+
getTemplateById(id: string): CancelablePromise<HumanTaskTemplateEntry>;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
declare class HumanTaskResourceService {
|
|
1468
|
+
readonly httpRequest: BaseHttpRequest;
|
|
1469
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
1470
|
+
/**
|
|
1471
|
+
* Get Conductor task by id (for human tasks only)
|
|
1472
|
+
* @param taskId
|
|
1473
|
+
* @returns Task OK
|
|
1474
|
+
* @throws ApiError
|
|
1475
|
+
*/
|
|
1476
|
+
getConductorTaskById(taskId: string): CancelablePromise<Task>;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1204
1479
|
interface ConductorClientAPIConfig extends Omit<OpenAPIConfig, "BASE"> {
|
|
1205
1480
|
serverUrl: string;
|
|
1206
1481
|
}
|
|
@@ -1213,6 +1488,8 @@ declare class ConductorClient {
|
|
|
1213
1488
|
readonly tokenResource: TokenResourceService;
|
|
1214
1489
|
readonly workflowBulkResource: WorkflowBulkResourceService;
|
|
1215
1490
|
readonly workflowResource: WorkflowResourceService;
|
|
1491
|
+
readonly humanTask: HumanTaskService;
|
|
1492
|
+
readonly humanTaskResource: HumanTaskResourceService;
|
|
1216
1493
|
readonly request: BaseHttpRequest;
|
|
1217
1494
|
readonly token?: string | Resolver<string>;
|
|
1218
1495
|
constructor(config?: Partial<ConductorClientAPIConfig>, requestHandler?: ConductorHttpRequest);
|
|
@@ -1402,13 +1679,6 @@ interface WaitTaskDef extends CommonTaskDef {
|
|
|
1402
1679
|
until?: string;
|
|
1403
1680
|
};
|
|
1404
1681
|
}
|
|
1405
|
-
declare type U2O<U extends string> = {
|
|
1406
|
-
[key in U]: U2O<Exclude<U, key>>;
|
|
1407
|
-
};
|
|
1408
|
-
declare type O2T<O extends {}> = {} extends O ? [] : {
|
|
1409
|
-
[key in keyof O]: [key, ...O2T<O[key]>];
|
|
1410
|
-
}[keyof O];
|
|
1411
|
-
declare type WorkflowInputParameters<T extends string> = O2T<U2O<T>>;
|
|
1412
1682
|
interface WorkflowDef extends Omit<WorkflowDef$1, "tasks" | "version" | "inputParameters"> {
|
|
1413
1683
|
inputParameters: string[];
|
|
1414
1684
|
version: number;
|
|
@@ -1623,45 +1893,20 @@ interface ConductorWorker {
|
|
|
1623
1893
|
concurrency?: number;
|
|
1624
1894
|
}
|
|
1625
1895
|
|
|
1626
|
-
|
|
1896
|
+
declare type TaskErrorHandler = (error: Error, task?: Task) => void;
|
|
1897
|
+
interface TaskRunnerOptions {
|
|
1627
1898
|
workerID: string;
|
|
1628
1899
|
domain: string | undefined;
|
|
1629
1900
|
pollInterval?: number;
|
|
1630
1901
|
concurrency?: number;
|
|
1631
1902
|
}
|
|
1632
|
-
interface TaskManagerConfig {
|
|
1633
|
-
logger?: ConductorLogger;
|
|
1634
|
-
options?: Partial<TaskManagerOptions>;
|
|
1635
|
-
onError?: TaskErrorHandler;
|
|
1636
|
-
}
|
|
1637
|
-
/**
|
|
1638
|
-
* Responsible for initializing and managing the runners that poll and work different task queues.
|
|
1639
|
-
*/
|
|
1640
|
-
declare class TaskManager {
|
|
1641
|
-
private tasks;
|
|
1642
|
-
private readonly client;
|
|
1643
|
-
private readonly logger;
|
|
1644
|
-
private readonly errorHandler;
|
|
1645
|
-
private workers;
|
|
1646
|
-
private readonly taskManageOptions;
|
|
1647
|
-
constructor(client: ConductorClient, workers: Array<ConductorWorker>, config?: TaskManagerConfig);
|
|
1648
|
-
/**
|
|
1649
|
-
* Start polling for tasks
|
|
1650
|
-
*/
|
|
1651
|
-
startPolling: () => void;
|
|
1652
|
-
/**
|
|
1653
|
-
* Stops polling for tasks
|
|
1654
|
-
*/
|
|
1655
|
-
stopPolling: () => void;
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
declare type TaskErrorHandler = (error: Error, task?: Task) => void;
|
|
1659
1903
|
interface RunnerArgs {
|
|
1660
1904
|
worker: ConductorWorker;
|
|
1661
1905
|
taskResource: TaskResourceService;
|
|
1662
|
-
options: Required<
|
|
1906
|
+
options: Required<TaskRunnerOptions>;
|
|
1663
1907
|
logger?: ConductorLogger;
|
|
1664
1908
|
onError?: TaskErrorHandler;
|
|
1909
|
+
concurrency?: number;
|
|
1665
1910
|
}
|
|
1666
1911
|
declare const noopErrorHandler: TaskErrorHandler;
|
|
1667
1912
|
/**
|
|
@@ -1674,27 +1919,62 @@ declare const noopErrorHandler: TaskErrorHandler;
|
|
|
1674
1919
|
*
|
|
1675
1920
|
*/
|
|
1676
1921
|
declare class TaskRunner {
|
|
1677
|
-
isPolling: boolean;
|
|
1678
1922
|
taskResource: TaskResourceService;
|
|
1679
1923
|
worker: ConductorWorker;
|
|
1680
|
-
logger
|
|
1681
|
-
options
|
|
1924
|
+
private logger;
|
|
1925
|
+
private options;
|
|
1682
1926
|
errorHandler: TaskErrorHandler;
|
|
1927
|
+
private poller;
|
|
1683
1928
|
constructor({ worker, taskResource, options, logger, onError: errorHandler, }: RunnerArgs);
|
|
1684
1929
|
/**
|
|
1685
1930
|
* Starts polling for work
|
|
1686
1931
|
*/
|
|
1687
|
-
startPolling: () =>
|
|
1932
|
+
startPolling: () => void;
|
|
1688
1933
|
/**
|
|
1689
1934
|
* Stops Polling for work
|
|
1690
1935
|
*/
|
|
1691
1936
|
stopPolling: () => void;
|
|
1692
|
-
|
|
1937
|
+
updateOptions(options: Partial<TaskRunnerOptions>): void;
|
|
1938
|
+
get getOptions(): TaskRunnerOptions;
|
|
1939
|
+
private pollAndExecute;
|
|
1693
1940
|
updateTaskWithRetry: (task: Task, taskResult: TaskResult) => Promise<void>;
|
|
1694
1941
|
executeTask: (task: Task) => Promise<void>;
|
|
1695
1942
|
handleUnknownError: (unknownError: unknown) => void;
|
|
1696
1943
|
}
|
|
1697
1944
|
|
|
1945
|
+
declare type TaskManagerOptions = TaskRunnerOptions;
|
|
1946
|
+
interface TaskManagerConfig {
|
|
1947
|
+
logger?: ConductorLogger;
|
|
1948
|
+
options?: Partial<TaskManagerOptions>;
|
|
1949
|
+
onError?: TaskErrorHandler;
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* Responsible for initializing and managing the runners that poll and work different task queues.
|
|
1953
|
+
*/
|
|
1954
|
+
declare class TaskManager {
|
|
1955
|
+
private tasks;
|
|
1956
|
+
private readonly client;
|
|
1957
|
+
private readonly logger;
|
|
1958
|
+
private readonly errorHandler;
|
|
1959
|
+
private workers;
|
|
1960
|
+
private readonly taskManageOptions;
|
|
1961
|
+
constructor(client: ConductorClient, workers: Array<ConductorWorker>, config?: TaskManagerConfig);
|
|
1962
|
+
private workerManagerWorkerOptions;
|
|
1963
|
+
/**
|
|
1964
|
+
* new options will get merged to existing options
|
|
1965
|
+
* @param options new options to update polling options
|
|
1966
|
+
*/
|
|
1967
|
+
updatePollingOptions: (options: Partial<TaskManagerOptions>) => void;
|
|
1968
|
+
/**
|
|
1969
|
+
* Start polling for tasks
|
|
1970
|
+
*/
|
|
1971
|
+
startPolling: () => void;
|
|
1972
|
+
/**
|
|
1973
|
+
* Stops polling for tasks
|
|
1974
|
+
*/
|
|
1975
|
+
stopPolling: () => void;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1698
1978
|
declare class ConductorError extends Error {
|
|
1699
1979
|
private _trace;
|
|
1700
1980
|
private __proto__;
|
|
@@ -1836,4 +2116,65 @@ declare class WorkflowExecutor {
|
|
|
1836
2116
|
getTask(taskId: string): Promise<Task>;
|
|
1837
2117
|
}
|
|
1838
2118
|
|
|
1839
|
-
|
|
2119
|
+
declare class HumanExecutor {
|
|
2120
|
+
readonly _client: ConductorClient;
|
|
2121
|
+
constructor(client: ConductorClient);
|
|
2122
|
+
/**
|
|
2123
|
+
* Takes a set of filter parameters. return matches of human tasks for that set of parameters
|
|
2124
|
+
* @param state
|
|
2125
|
+
* @param assignee
|
|
2126
|
+
* @param assigneeType
|
|
2127
|
+
* @param claimedBy
|
|
2128
|
+
* @param taskName
|
|
2129
|
+
* @param freeText
|
|
2130
|
+
* @param includeInputOutput
|
|
2131
|
+
* @returns
|
|
2132
|
+
*/
|
|
2133
|
+
getTasksByFilter(state: "PENDING" | "ASSIGNED" | "IN_PROGRESS" | "COMPLETED" | "TIMED_OUT", assignee?: string, assigneeType?: "EXTERNAL_USER" | "EXTERNAL_GROUP" | "CONDUCTOR_USER" | "CONDUCTOR_GROUP", claimedBy?: string, taskName?: string, freeText?: string, includeInputOutput?: boolean): Promise<HumanTaskEntry[]>;
|
|
2134
|
+
/**
|
|
2135
|
+
* Returns task for a given task id
|
|
2136
|
+
* @param taskId
|
|
2137
|
+
* @returns
|
|
2138
|
+
*/
|
|
2139
|
+
getTaskById(taskId: string): Promise<HumanTaskEntry>;
|
|
2140
|
+
/**
|
|
2141
|
+
* Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
|
|
2142
|
+
* @param taskId
|
|
2143
|
+
* @param assignee
|
|
2144
|
+
* @returns
|
|
2145
|
+
*/
|
|
2146
|
+
claimTaskAsExternalUser(taskId: string, assignee: string): Promise<void>;
|
|
2147
|
+
/**
|
|
2148
|
+
* Claim task as conductor user
|
|
2149
|
+
* @param taskId
|
|
2150
|
+
* @returns
|
|
2151
|
+
*/
|
|
2152
|
+
claimTaskAsConductorUser(taskId: string): Promise<void>;
|
|
2153
|
+
/**
|
|
2154
|
+
* Claim task as conductor user
|
|
2155
|
+
* @param taskId
|
|
2156
|
+
* @param assignee
|
|
2157
|
+
* @returns
|
|
2158
|
+
*/
|
|
2159
|
+
releaseTask(taskId: string): Promise<void>;
|
|
2160
|
+
/**
|
|
2161
|
+
* Returns a HumanTaskTemplateEntry for a given templateId
|
|
2162
|
+
* @param templateId
|
|
2163
|
+
* @returns
|
|
2164
|
+
*/
|
|
2165
|
+
getTemplateById(templateId: string): Promise<HumanTaskTemplateEntry>;
|
|
2166
|
+
/**
|
|
2167
|
+
* Takes a taskId and a partial body. will update with given body
|
|
2168
|
+
* @param taskId
|
|
2169
|
+
* @param requestBody
|
|
2170
|
+
*/
|
|
2171
|
+
updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, any>>): Promise<void>;
|
|
2172
|
+
/**
|
|
2173
|
+
* Takes a taskId and an optional partial body. will complete the task with the given body
|
|
2174
|
+
* @param taskId
|
|
2175
|
+
* @param requestBody
|
|
2176
|
+
*/
|
|
2177
|
+
completeTask(taskId: string, requestBody?: Record<string, Record<string, any>>): Promise<void>;
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
export { Action, ApiError, AssignmentPolicy, BackToAssigment, BaseHttpRequest, CancelError, CancelablePromise, ClearAssigment, CommonTaskDef, ConductorClient, ConductorError, ConductorHttpRequest, ConductorLogLevel, ConductorLogger, ConductorWorker, DefaultLogger, DefaultLoggerConfig, DoWhileTaskDef, Escalate, EventHandler, EventResourceService, EventTaskDef, ExternalStorageLocation, FFAAssignment, Fixed, ForkJoinDynamicDef, ForkJoinTaskDef, GenerateTokenRequest, HTScrollableSearchResultHumanTaskEntry, HealthCheckResourceService, HttpInputParameters, HttpTaskDef, HumanExecutor, HumanTaskActionLogEntry, HumanTaskEntry, HumanTaskLoad, HumanTaskStateLogEntry, HumanTaskTemplate, HumanTaskTemplateEntry, InlineTaskDef, InlineTaskInputParameters, JoinTaskDef, JsonJQTransformTaskDef, KafkaPublishInputParameters, KafkaPublishTaskDef, LeastBusyGroupMemberAssignment, MetadataResourceService, Never, OnCancel, OpenAPIConfig, OrkesApiConfig, PollData, RequestType, RerunWorkflowRequest, Response, RunnerArgs, SaveScheduleRequest, SchedulerResourceService, ScrollableSearchResultWorkflowSummary, SearchResultHumanTaskEntry, SearchResultTask, SearchResultTaskSummary, SearchResultWorkflow, SearchResultWorkflowScheduleExecutionModel, SearchResultWorkflowSummary, SetVariableTaskDef, SimpleTaskDef, SkipTaskRequest, StartWorkflow, StartWorkflowRequest, SubWorkflowParams, SubWorkflowTaskDef, SwitchTaskDef, Task, TaskDef, TaskDefTypes, TaskDetails, TaskErrorHandler, TaskExecLog, TaskManager, TaskManagerConfig, TaskManagerOptions, TaskResourceService, TaskResult, TaskResultStatus, TaskRunner, TaskRunnerOptions, TaskSummary, TaskType, Terminate, TerminateTaskDef, TimeoutPolicy, TokenResourceService, WaitTaskDef, Workflow, WorkflowBulkResourceService, WorkflowDef, WorkflowExecutor, WorkflowResourceService, WorkflowSchedule, WorkflowScheduleExecutionModel, WorkflowStatus, WorkflowSummary, WorkflowTask, conductorEventTask, doWhileTask, dynamicForkTask, eventTask, forkTask, forkTaskJoin, generate, generateDoWhileTask, generateEventTask, generateForkJoinTask, generateHTTPTask, generateInlineTask, generateJQTransformTask, generateJoinTask, generateKafkaPublishTask, generateSetVariableTask, generateSimpleTask, generateSubWorkflowTask, generateSwitchTask, generateTerminateTask, generateWaitTask, httpTask, inlineTask, joinTask, jsonJqTask, kafkaPublishTask, newLoopTask, noopErrorHandler, orkesConductorClient, setVariableTask, simpleTask, sqsEventTask, subWorkflowTask, switchTask, taskGenMapper, terminateTask, waitTaskDuration, waitTaskUntil, workflow };
|