@io-orkes/conductor-javascript 1.2.3 → 2.0.0-rc1

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.
@@ -1177,170 +1177,116 @@ declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) =>
1177
1177
  declare type RequestType = typeof request;
1178
1178
  declare type ConductorHttpRequest = <T>(request: RequestType, config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
1179
1179
 
1180
- declare type AssignmentPolicy = {
1181
- type: string;
1180
+ declare type HumanTaskUser = {
1181
+ user?: string;
1182
+ userType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1182
1183
  };
1183
1184
 
1184
- declare type FFAAssignment = AssignmentPolicy;
1185
-
1186
- declare type Fixed = (AssignmentPolicy & {
1187
- assignee?: string;
1188
- assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1189
- });
1190
-
1191
- declare type TimeoutPolicy = {
1192
- type: string;
1185
+ declare type HumanTaskAssignment = {
1186
+ assignee?: HumanTaskUser;
1187
+ slaMinutes?: number;
1193
1188
  };
1194
1189
 
1195
- declare type BackToAssigment = (TimeoutPolicy & {
1196
- timeoutSeconds?: number;
1197
- });
1198
-
1199
- declare type ClearAssigment = (TimeoutPolicy & {
1200
- timeoutSeconds?: number;
1201
- });
1202
-
1203
- declare type Escalate = (TimeoutPolicy & {
1204
- subjects?: Array<string>;
1205
- timeoutSeconds?: number;
1206
- } & {
1207
- subjects: Array<string>;
1208
- });
1209
-
1210
- declare type LeastBusyGroupMemberAssignment = (AssignmentPolicy & {
1211
- groupId?: string;
1212
- });
1190
+ declare type HumanTaskTrigger = {
1191
+ startWorkflowRequest?: StartWorkflowRequest;
1192
+ triggerType?: 'ASSIGNEE_CHANGED' | 'PENDING' | 'IN_PROGRESS' | 'ASSIGNED' | 'COMPLETED' | 'TIMED_OUT';
1193
+ };
1213
1194
 
1214
- declare type Never = TimeoutPolicy;
1195
+ declare type UserFormTemplate = {
1196
+ name?: string;
1197
+ version?: number;
1198
+ };
1215
1199
 
1216
- declare type Terminate = (TimeoutPolicy & {
1217
- timeoutSeconds?: number;
1218
- });
1200
+ declare type HumanTaskDefinition = {
1201
+ assignmentCompletionStrategy?: 'LEAVE_OPEN' | 'TERMINATE';
1202
+ assignments?: Array<HumanTaskAssignment>;
1203
+ taskTriggers?: Array<HumanTaskTrigger>;
1204
+ userFormTemplate?: UserFormTemplate;
1205
+ };
1219
1206
 
1220
1207
  declare type HumanTaskEntry = {
1221
- assignee?: string;
1222
- assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1223
- assignmentPolicy?: (FFAAssignment | Fixed | LeastBusyGroupMemberAssignment);
1224
- claimedBy?: string;
1208
+ assignee?: HumanTaskUser;
1209
+ claimant?: HumanTaskUser;
1225
1210
  createdBy?: string;
1226
1211
  createdOn?: number;
1227
- escalatedAt?: number;
1228
- output?: Record<string, Record<string, any>>;
1229
- owners?: Array<string>;
1230
- predefinedInput?: Record<string, Record<string, any>>;
1231
- state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT';
1232
- taskId?: string;
1233
- taskName?: string;
1234
- taskRefName?: string;
1235
- templateId?: string;
1236
- timeoutPolicy?: (BackToAssigment | ClearAssigment | Escalate | Never | Terminate);
1237
- workflowId?: string;
1238
- workflowName?: string;
1239
- };
1240
-
1241
- declare type HTScrollableSearchResultHumanTaskEntry = {
1242
- queryId?: string;
1243
- results?: Array<HumanTaskEntry>;
1244
- };
1245
-
1246
- declare type HumanTaskActionLogEntry = {
1247
- action?: string;
1248
- actionTime?: number;
1249
- cause?: string;
1250
- id?: string;
1212
+ definitionName?: string;
1213
+ humanTaskDef?: HumanTaskDefinition;
1214
+ input?: Record<string, any>;
1215
+ output?: Record<string, any>;
1216
+ state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT' | 'DELETED';
1251
1217
  taskId?: string;
1252
1218
  taskRefName?: string;
1219
+ updatedBy?: string;
1220
+ updatedOn?: number;
1253
1221
  workflowId?: string;
1254
1222
  workflowName?: string;
1255
1223
  };
1256
1224
 
1257
- declare type HumanTaskLoad = {
1258
- assignedUser?: string;
1259
- count?: number;
1260
- taskRefName?: string;
1261
- workflowName?: string;
1225
+ declare type HumanTaskSearch = {
1226
+ assignees?: Array<HumanTaskUser>;
1227
+ claimants?: Array<HumanTaskUser>;
1228
+ definitionNames?: Array<string>;
1229
+ taskOutputQuery?: string;
1230
+ taskInputQuery?: string;
1231
+ searchType?: 'ADMIN' | 'INBOX';
1232
+ size?: number;
1233
+ start?: number;
1234
+ states?: Array<'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT' | 'DELETED'>;
1235
+ taskRefNames?: Array<string>;
1236
+ workflowNames?: Array<string>;
1262
1237
  };
1263
1238
 
1264
- declare type HumanTaskStateLogEntry = {
1265
- assignee?: string;
1266
- assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1267
- claimedBy?: string;
1268
- id?: string;
1269
- state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT';
1270
- stateEnd?: number;
1271
- stateStart?: number;
1272
- taskId?: string;
1273
- taskRefName?: string;
1274
- workflowId?: string;
1275
- workflowName?: string;
1239
+ declare type HumanTaskSearchResult = {
1240
+ results?: Array<HumanTaskEntry>;
1241
+ totalHits?: number;
1276
1242
  };
1277
1243
 
1278
1244
  declare type HumanTaskTemplate = {
1279
- jsonSchema: Record<string, Record<string, any>>;
1280
- name: string;
1281
- templateUI: Record<string, Record<string, any>>;
1282
- version?: number;
1283
- };
1284
-
1285
- declare type HumanTaskTemplateEntry = {
1286
1245
  createdBy?: string;
1287
1246
  createdOn?: number;
1288
- id?: string;
1289
- jsonSchema?: Record<string, Record<string, any>>;
1290
- name?: string;
1291
- templateUI?: Record<string, Record<string, any>>;
1247
+ jsonSchema: Record<string, any>;
1248
+ name: string;
1249
+ templateUI: Record<string, any>;
1292
1250
  updatedBy?: string;
1293
1251
  updatedOn?: number;
1294
- version?: number;
1295
- };
1296
-
1297
- declare type SearchResultHumanTaskEntry = {
1298
- results?: Array<HumanTaskEntry>;
1299
- totalHits?: number;
1252
+ version: number;
1300
1253
  };
1301
1254
 
1302
1255
  declare class HumanTaskService {
1303
1256
  readonly httpRequest: BaseHttpRequest;
1304
1257
  constructor(httpRequest: BaseHttpRequest);
1305
1258
  /**
1306
- * List tasks by filters - task name, state, assignee, assignee type, claimed
1307
- * @param state
1308
- * @param assignee
1309
- * @param assigneeType
1310
- * @param claimedBy
1311
- * @param taskName
1312
- * @param freeText
1313
- * @param includeInputOutput
1314
- * @returns SearchResultHumanTaskEntry OK
1259
+ * If the workflow is disconnected from tasks, this API can be used to clean up (in bulk)
1260
+ * @param requestBody
1261
+ * @returns any OK
1315
1262
  * @throws ApiError
1316
1263
  */
1317
- 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>;
1264
+ deleteTaskFromHumanTaskRecords(requestBody: Array<string>): CancelablePromise<any>;
1318
1265
  /**
1319
- * Get task load grouped by workflow name and task ref name per user
1320
- * @returns HumanTaskLoad OK
1266
+ * If the workflow is disconnected from tasks, this API can be used to clean up
1267
+ * @param taskId
1268
+ * @returns any OK
1321
1269
  * @throws ApiError
1322
1270
  */
1323
- getTaskLoad(): CancelablePromise<Array<HumanTaskLoad>>;
1271
+ deleteTaskFromHumanTaskRecords1(taskId: string): CancelablePromise<any>;
1324
1272
  /**
1325
1273
  * Search human tasks
1326
- * @param queryId
1327
- * @param start
1328
- * @param size
1329
- * @param freeText
1330
- * @param query
1331
- * @param jsonQuery
1332
- * @param includeInputOutput
1333
- * @returns HTScrollableSearchResultHumanTaskEntry OK
1274
+ * @param requestBody
1275
+ * @returns HumanTaskSearchResult OK
1334
1276
  * @throws ApiError
1335
1277
  */
1336
- search1(queryId?: string, start?: number, size?: number, freeText?: string, query?: string, jsonQuery?: string, includeInputOutput?: boolean): CancelablePromise<HTScrollableSearchResultHumanTaskEntry>;
1278
+ search(requestBody: HumanTaskSearch): CancelablePromise<HumanTaskSearchResult>;
1337
1279
  /**
1338
- * If the workflow is disconnected from tasks, this API can be used to clean up
1339
- * @param taskId
1280
+ * Update task output, optionally complete
1281
+ * @param workflowId
1282
+ * @param taskRefName
1283
+ * @param requestBody
1284
+ * @param complete
1285
+ * @param iteration Populate this value if your task is in a loop and you want to update a specific iteration. If its not in a loop OR if you want to just update the latest iteration, leave this as empty
1340
1286
  * @returns any OK
1341
1287
  * @throws ApiError
1342
1288
  */
1343
- updateTaskOutput1(taskId: string): CancelablePromise<any>;
1289
+ updateTaskOutputByRef(workflowId: string, taskRefName: string, requestBody: Record<string, any>, complete?: boolean, iteration?: Array<number>): CancelablePromise<any>;
1344
1290
  /**
1345
1291
  * Get a task
1346
1292
  * @param taskId
@@ -1348,28 +1294,23 @@ declare class HumanTaskService {
1348
1294
  * @throws ApiError
1349
1295
  */
1350
1296
  getTask1(taskId: string): CancelablePromise<HumanTaskEntry>;
1351
- /**
1352
- * Get human task action log entries by task id
1353
- * @param taskId
1354
- * @returns HumanTaskActionLogEntry OK
1355
- * @throws ApiError
1356
- */
1357
- getActionLogs(taskId: string): CancelablePromise<Array<HumanTaskActionLogEntry>>;
1358
1297
  /**
1359
1298
  * Claim a task by authenticated Conductor user
1360
1299
  * @param taskId
1300
+ * @param overrideAssignment
1361
1301
  * @returns any OK
1362
1302
  * @throws ApiError
1363
1303
  */
1364
- claimTask(taskId: string): CancelablePromise<any>;
1304
+ claimTask(taskId: string, overrideAssignment?: boolean): CancelablePromise<HumanTaskEntry>;
1365
1305
  /**
1366
1306
  * Claim a task to an external user
1367
1307
  * @param taskId
1368
1308
  * @param userId
1309
+ * @param overrideAssignment
1369
1310
  * @returns any OK
1370
1311
  * @throws ApiError
1371
1312
  */
1372
- assignAndClaim(taskId: string, userId: string): CancelablePromise<any>;
1313
+ assignAndClaim(taskId: string, userId: string, overrideAssignment?: boolean): CancelablePromise<HumanTaskEntry>;
1373
1314
  /**
1374
1315
  * Release a task without completing it
1375
1316
  * @param taskId
@@ -1377,7 +1318,7 @@ declare class HumanTaskService {
1377
1318
  * @returns any OK
1378
1319
  * @throws ApiError
1379
1320
  */
1380
- reassignTask(taskId: string, requestBody: (FFAAssignment | Fixed | LeastBusyGroupMemberAssignment)): CancelablePromise<any>;
1321
+ reassignTask(taskId: string, requestBody: Array<HumanTaskAssignment>): CancelablePromise<any>;
1381
1322
  /**
1382
1323
  * Release a task without completing it
1383
1324
  * @param taskId
@@ -1386,12 +1327,13 @@ declare class HumanTaskService {
1386
1327
  */
1387
1328
  releaseTask(taskId: string): CancelablePromise<any>;
1388
1329
  /**
1389
- * Get human task state log entries by task id
1330
+ * If a task is assigned to a user, this API can be used to skip that assignment and move to the next assignee
1390
1331
  * @param taskId
1391
- * @returns HumanTaskStateLogEntry OK
1332
+ * @param reason
1333
+ * @returns any OK
1392
1334
  * @throws ApiError
1393
1335
  */
1394
- getStateLogs(taskId: string): CancelablePromise<Array<HumanTaskStateLogEntry>>;
1336
+ skipTask(taskId: string, reason?: string): CancelablePromise<any>;
1395
1337
  /**
1396
1338
  * Update task output, optionally complete
1397
1339
  * @param taskId
@@ -1400,44 +1342,54 @@ declare class HumanTaskService {
1400
1342
  * @returns any OK
1401
1343
  * @throws ApiError
1402
1344
  */
1403
- updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, any>>, complete?: boolean): CancelablePromise<any>;
1345
+ updateTaskOutput(taskId: string, requestBody: Record<string, any>, complete?: boolean): CancelablePromise<any>;
1404
1346
  /**
1405
- * Delete human task templates by name
1347
+ * List all user form templates or get templates by name, or a template by name and version
1406
1348
  * @param name
1407
- * @returns any OK
1349
+ * @param version
1350
+ * @returns HumanTaskTemplate OK
1408
1351
  * @throws ApiError
1409
1352
  */
1410
- deleteTemplatesByName(name: string): CancelablePromise<any>;
1353
+ getAllTemplates(name?: string, version?: number): CancelablePromise<Array<HumanTaskTemplate>>;
1411
1354
  /**
1412
- * List all human task templates or get templates by name, or a template by name and version
1413
- * @param name
1414
- * @param version
1415
- * @returns HumanTaskTemplateEntry OK
1355
+ * Save user form template
1356
+ * @param requestBody
1357
+ * @param newVersion
1358
+ * @returns HumanTaskTemplate OK
1416
1359
  * @throws ApiError
1417
1360
  */
1418
- getAllTemplates(name?: string, version?: number): CancelablePromise<Array<HumanTaskTemplateEntry>>;
1361
+ saveTemplate(requestBody: HumanTaskTemplate, newVersion?: boolean): CancelablePromise<HumanTaskTemplate>;
1419
1362
  /**
1420
- * Save human task template
1363
+ * Save user form template
1421
1364
  * @param requestBody
1422
1365
  * @param newVersion
1423
- * @returns string OK
1366
+ * @returns HumanTaskTemplate OK
1424
1367
  * @throws ApiError
1425
1368
  */
1426
- saveTemplate(requestBody: HumanTaskTemplate, newVersion?: boolean): CancelablePromise<string>;
1369
+ saveTemplates(requestBody: Array<HumanTaskTemplate>, newVersion?: boolean): CancelablePromise<Array<HumanTaskTemplate>>;
1427
1370
  /**
1428
- * Delete human task template
1429
- * @param id
1371
+ * Delete all versions of user form template by name
1372
+ * @param name
1430
1373
  * @returns any OK
1431
1374
  * @throws ApiError
1432
1375
  */
1433
- deleteTemplateById(id: string): CancelablePromise<any>;
1376
+ deleteTemplateByName(name: string): CancelablePromise<any>;
1434
1377
  /**
1435
- * Get human task template by id
1436
- * @param id
1437
- * @returns HumanTaskTemplateEntry OK
1378
+ * Delete a version of form template by name
1379
+ * @param name
1380
+ * @param version
1381
+ * @returns any OK
1438
1382
  * @throws ApiError
1439
1383
  */
1440
- getTemplateById(id: string): CancelablePromise<HumanTaskTemplateEntry>;
1384
+ deleteTemplatesByNameAndVersion(name: string, version: number): CancelablePromise<any>;
1385
+ /**
1386
+ * Get user form template by name and version
1387
+ * @param name
1388
+ * @param version
1389
+ * @returns HumanTaskTemplate OK
1390
+ * @throws ApiError
1391
+ */
1392
+ getTemplateByNameAndVersion(name: string, version: number): CancelablePromise<HumanTaskTemplate>;
1441
1393
  }
1442
1394
 
1443
1395
  declare class HumanTaskResourceService {
@@ -1489,6 +1441,19 @@ declare class ApiError extends Error {
1489
1441
  constructor(request: ApiRequestOptions, response: ApiResult, message: string);
1490
1442
  }
1491
1443
 
1444
+ declare type HTScrollableSearchResultHumanTaskEntry = {
1445
+ queryId?: string;
1446
+ results?: Array<HumanTaskEntry>;
1447
+ };
1448
+
1449
+ declare type TimeoutPolicy = {
1450
+ type: string;
1451
+ };
1452
+
1453
+ declare type Terminate = (TimeoutPolicy & {
1454
+ timeoutSeconds?: number;
1455
+ });
1456
+
1492
1457
  /**
1493
1458
  * Functional interface for defining a worker implementation that processes tasks from a conductor queue.
1494
1459
  *
@@ -1789,6 +1754,8 @@ declare class ConductorError extends Error {
1789
1754
  }
1790
1755
  declare type TaskResultStatus = NonNullable<TaskResult['status']>;
1791
1756
 
1757
+ declare type TaskFinderPredicate = (task: Task) => boolean;
1758
+ declare const completedTaskMatchingType: (taskType: string) => TaskFinderPredicate;
1792
1759
  declare class WorkflowExecutor {
1793
1760
  readonly _client: ConductorClient;
1794
1761
  constructor(client: ConductorClient);
@@ -1798,7 +1765,7 @@ declare class WorkflowExecutor {
1798
1765
  * @param workflow Complete workflow definition
1799
1766
  * @returns null
1800
1767
  */
1801
- registerWorkflow(override: boolean, workflow: WorkflowDef): any;
1768
+ registerWorkflow(override: boolean, workflow: WorkflowDef): Promise<void>;
1802
1769
  /**
1803
1770
  * Takes a StartWorkflowRequest. returns a Promise<string> with the workflowInstanceId of the running workflow
1804
1771
  * @param workflowRequest
@@ -1812,6 +1779,8 @@ declare class WorkflowExecutor {
1812
1779
  */
1813
1780
  executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef?: string): Promise<WorkflowRun>;
1814
1781
  startWorkflows(workflowsRequest: StartWorkflowRequest[]): Promise<string>[];
1782
+ goBackToTask(workflowInstanceId: string, taskFinderPredicate: TaskFinderPredicate, rerunWorkflowRequestOverrides?: Partial<RerunWorkflowRequest>): Promise<void>;
1783
+ goBackToFirstTaskMatchingType(workflowInstanceId: string, taskType: string): Promise<void>;
1815
1784
  /**
1816
1785
  * Takes an workflowInstanceId and an includeTasks and an optional retry parameter returns the whole execution status.
1817
1786
  * If includeTasks flag is provided. Details of tasks execution will be returned as well,
@@ -1832,12 +1801,21 @@ declare class WorkflowExecutor {
1832
1801
  * @returns Promise<WorkflowStatus>
1833
1802
  */
1834
1803
  getWorkflowStatus(workflowInstanceId: string, includeOutput: boolean, includeVariables: boolean): Promise<WorkflowStatus>;
1804
+ /**
1805
+ * Returns a summary of the current workflow status.
1806
+ *
1807
+ * @param workflowInstanceId current running workflow
1808
+ * @param includeOutput flag to include output
1809
+ * @param includeVariables flag to include variable
1810
+ * @returns Promise<WorkflowStatus>
1811
+ */
1812
+ getExecution(workflowInstanceId: string, includeTasks?: boolean): Promise<Workflow>;
1835
1813
  /**
1836
1814
  * Pauses a running workflow
1837
1815
  * @param workflowInstanceId current workflow execution
1838
1816
  * @returns
1839
1817
  */
1840
- pause(workflowInstanceId: string): any;
1818
+ pause(workflowInstanceId: string): Promise<void>;
1841
1819
  /**
1842
1820
  * Reruns workflowInstanceId workflow. with new parameters
1843
1821
  *
@@ -1852,14 +1830,14 @@ declare class WorkflowExecutor {
1852
1830
  * @param useLatestDefinitions
1853
1831
  * @returns
1854
1832
  */
1855
- restart(workflowInstanceId: string, useLatestDefinitions: boolean): any;
1833
+ restart(workflowInstanceId: string, useLatestDefinitions: boolean): Promise<void>;
1856
1834
  /**
1857
1835
  * Resumes a previously paused execution
1858
1836
  *
1859
1837
  * @param workflowInstanceId Running workflow workflowInstanceId
1860
1838
  * @returns
1861
1839
  */
1862
- resume(workflowInstanceId: string): any;
1840
+ resume(workflowInstanceId: string): Promise<void>;
1863
1841
  /**
1864
1842
  * Retrys workflow from last failing task
1865
1843
  * if resumeSubworkflowTasks is true will resume tasks in spawned subworkflows
@@ -1868,7 +1846,7 @@ declare class WorkflowExecutor {
1868
1846
  * @param resumeSubworkflowTasks
1869
1847
  * @returns
1870
1848
  */
1871
- retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): any;
1849
+ retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): Promise<void>;
1872
1850
  /**
1873
1851
  * Searches for existing workflows given the following querys
1874
1852
  *
@@ -1880,7 +1858,7 @@ declare class WorkflowExecutor {
1880
1858
  * @param skipCache
1881
1859
  * @returns
1882
1860
  */
1883
- search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): any;
1861
+ search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): Promise<ScrollableSearchResultWorkflowSummary>;
1884
1862
  /**
1885
1863
  * Skips a task of a running workflow.
1886
1864
  * by providing a skipTaskRequest you can set the input and the output of the skipped tasks
@@ -1889,14 +1867,14 @@ declare class WorkflowExecutor {
1889
1867
  * @param skipTaskRequest
1890
1868
  * @returns
1891
1869
  */
1892
- skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): any;
1870
+ skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): Promise<void>;
1893
1871
  /**
1894
1872
  * Takes an workflowInstanceId, and terminates a running workflow
1895
1873
  * @param workflowInstanceId
1896
1874
  * @param reason
1897
1875
  * @returns
1898
1876
  */
1899
- terminate(workflowInstanceId: string, reason: string): any;
1877
+ terminate(workflowInstanceId: string, reason: string): Promise<void>;
1900
1878
  /**
1901
1879
  * Takes a taskId and a workflowInstanceId. Will update the task for the corresponding taskId
1902
1880
  * @param taskId
@@ -1905,7 +1883,7 @@ declare class WorkflowExecutor {
1905
1883
  * @param taskOutput
1906
1884
  * @returns
1907
1885
  */
1908
- updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: Record<string, any>): any;
1886
+ updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: Record<string, any>): Promise<string>;
1909
1887
  /**
1910
1888
  * Updates a task by reference Name
1911
1889
  * @param taskReferenceName
@@ -1914,7 +1892,7 @@ declare class WorkflowExecutor {
1914
1892
  * @param taskOutput
1915
1893
  * @returns
1916
1894
  */
1917
- updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: Record<string, any>): any;
1895
+ updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: Record<string, any>): Promise<string>;
1918
1896
  /**
1919
1897
  *
1920
1898
  * @param taskId
@@ -1923,10 +1901,15 @@ declare class WorkflowExecutor {
1923
1901
  getTask(taskId: string): Promise<Task>;
1924
1902
  }
1925
1903
 
1904
+ declare type PollIntervalOptions = {
1905
+ pollInterval: number;
1906
+ maxPollTimes: number;
1907
+ };
1926
1908
  declare class HumanExecutor {
1927
1909
  readonly _client: ConductorClient;
1928
1910
  constructor(client: ConductorClient);
1929
1911
  /**
1912
+ * @deprecated use search instead
1930
1913
  * Takes a set of filter parameters. return matches of human tasks for that set of parameters
1931
1914
  * @param state
1932
1915
  * @param assignee
@@ -1937,7 +1920,31 @@ declare class HumanExecutor {
1937
1920
  * @param includeInputOutput
1938
1921
  * @returns
1939
1922
  */
1940
- 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[]>;
1923
+ getTasksByFilter(state: "PENDING" | "ASSIGNED" | "IN_PROGRESS" | "COMPLETED" | "TIMED_OUT", assignee?: string, assigneeType?: "EXTERNAL_USER" | "EXTERNAL_GROUP" | "CONDUCTOR_USER" | "CONDUCTOR_GROUP", claimedBy?: string, taskName?: string, taskInputQuery?: string, taskOutputQuery?: string): Promise<HumanTaskEntry[]>;
1924
+ /**
1925
+ * Takes a set of filter parameters. return matches of human tasks for that set of parameters
1926
+ * @param state
1927
+ * @param assignee
1928
+ * @param assigneeType
1929
+ * @param claimedBy
1930
+ * @param taskName
1931
+ * @param freeText
1932
+ * @param includeInputOutput
1933
+ * @returns Promise<HumanTaskEntry[]>
1934
+ */
1935
+ search(searchParams: Partial<HumanTaskSearch>): Promise<HumanTaskEntry[]>;
1936
+ /**
1937
+ * Takes a set of filter parameters. An polling interval options. will poll until the task returns a result
1938
+ * @param state
1939
+ * @param assignee
1940
+ * @param assigneeType
1941
+ * @param claimedBy
1942
+ * @param taskName
1943
+ * @param freeText
1944
+ * @param includeInputOutput
1945
+ * @returns Promise<HumanTaskEntry[]>
1946
+ */
1947
+ pollSearch(searchParams: Partial<HumanTaskSearch>, { pollInterval, maxPollTimes, }?: PollIntervalOptions): Promise<HumanTaskEntry[]>;
1941
1948
  /**
1942
1949
  * Returns task for a given task id
1943
1950
  * @param taskId
@@ -1950,13 +1957,13 @@ declare class HumanExecutor {
1950
1957
  * @param assignee
1951
1958
  * @returns
1952
1959
  */
1953
- claimTaskAsExternalUser(taskId: string, assignee: string): Promise<void>;
1960
+ claimTaskAsExternalUser(taskId: string, assignee: string): Promise<HumanTaskEntry>;
1954
1961
  /**
1955
1962
  * Claim task as conductor user
1956
1963
  * @param taskId
1957
1964
  * @returns
1958
1965
  */
1959
- claimTaskAsConductorUser(taskId: string): Promise<void>;
1966
+ claimTaskAsConductorUser(taskId: string): Promise<HumanTaskEntry>;
1960
1967
  /**
1961
1968
  * Claim task as conductor user
1962
1969
  * @param taskId
@@ -1965,11 +1972,18 @@ declare class HumanExecutor {
1965
1972
  */
1966
1973
  releaseTask(taskId: string): Promise<void>;
1967
1974
  /**
1975
+ * Returns a HumanTaskTemplateEntry for a given name and version
1976
+ * @param templateId
1977
+ * @returns
1978
+ */
1979
+ getTemplateByNameVersion(name: string, version: number): Promise<HumanTaskTemplate>;
1980
+ /**
1981
+ * @deprecated use getTemplate instead. name will be used as id here with version 1
1968
1982
  * Returns a HumanTaskTemplateEntry for a given templateId
1969
1983
  * @param templateId
1970
1984
  * @returns
1971
1985
  */
1972
- getTemplateById(templateId: string): Promise<HumanTaskTemplateEntry>;
1986
+ getTemplateById(templateNameVersionOne: string): Promise<HumanTaskTemplate>;
1973
1987
  /**
1974
1988
  * Takes a taskId and a partial body. will update with given body
1975
1989
  * @param taskId
@@ -2183,4 +2197,4 @@ declare type FetchFn<T = RequestInit, R extends {
2183
2197
  } = Response> = (input: RequestInfo, init?: T) => Promise<R>;
2184
2198
  declare type OrkesApiConfig = ConductorClientAPIConfig & GenerateTokenRequest;
2185
2199
 
2186
- export { HealthCheckResourceService as $, ApiRequestOptions as A, BaseHttpRequest as B, ConductorHttpRequest as C, StartWorkflow as D, EventHandler as E, FetchFn as F, GenerateTokenRequest as G, StartWorkflowRequest as H, SubWorkflowParams as I, Task as J, TaskDef as K, TaskDetails as L, TaskExecLog as M, TaskResult as N, OrkesApiConfig as O, PollData as P, TaskSummary as Q, RunnerArgs as R, SaveScheduleRequest as S, TaskRunner as T, WorkflowSchedule as U, WorkflowScheduleExecutionModel as V, Workflow as W, WorkflowStatus as X, WorkflowSummary as Y, WorkflowTask as Z, EventResourceService as _, ConductorClient as a, forkTaskJoin as a$, MetadataResourceService as a0, SchedulerResourceService as a1, TaskResourceService as a2, TokenResourceService as a3, WorkflowBulkResourceService as a4, WorkflowResourceService as a5, AssignmentPolicy as a6, Fixed as a7, BackToAssigment as a8, ClearAssigment as a9, JoinTaskDef as aA, ForkJoinDynamicDef as aB, HttpInputParameters as aC, HttpTaskDef as aD, InlineTaskInputParameters as aE, InlineTaskDef as aF, JsonJQTransformTaskDef as aG, KafkaPublishInputParameters as aH, KafkaPublishTaskDef as aI, SetVariableTaskDef as aJ, SimpleTaskDef as aK, SubWorkflowTaskDef as aL, SwitchTaskDef as aM, TerminateTaskDef as aN, WaitTaskDef as aO, WorkflowDef as aP, WorkflowExecutor as aQ, ConductorError as aR, TaskResultStatus as aS, HumanExecutor as aT, doWhileTask as aU, newLoopTask as aV, dynamicForkTask as aW, eventTask as aX, sqsEventTask as aY, conductorEventTask as aZ, forkTask as a_, Escalate as aa, FFAAssignment as ab, HTScrollableSearchResultHumanTaskEntry as ac, HumanTaskActionLogEntry as ad, HumanTaskEntry as ae, HumanTaskLoad as af, HumanTaskStateLogEntry as ag, HumanTaskTemplate as ah, HumanTaskTemplateEntry as ai, LeastBusyGroupMemberAssignment as aj, Never as ak, SearchResultHumanTaskEntry as al, Terminate as am, TimeoutPolicy as an, ConductorLogger as ao, ConductorLogLevel as ap, DefaultLoggerConfig as aq, DefaultLogger as ar, noopLogger as as, RequestType as at, CommonTaskDef as au, TaskType as av, TaskDefTypes as aw, DoWhileTaskDef as ax, EventTaskDef as ay, ForkJoinTaskDef as az, ConductorClientAPIConfig as b, httpTask as b0, inlineTask as b1, joinTask as b2, jsonJqTask as b3, kafkaPublishTask as b4, setVariableTask as b5, simpleTask as b6, subWorkflowTask as b7, switchTask as b8, terminateTask as b9, waitTaskDuration as ba, waitTaskUntil as bb, workflow as bc, generateSimpleTask as bd, generateDoWhileTask as be, generateEventTask as bf, generateForkJoinTask as bg, generateJoinTask as bh, generateHTTPTask as bi, generateInlineTask as bj, generateJQTransformTask as bk, generateKafkaPublishTask as bl, generateSubWorkflowTask as bm, generateSetVariableTask as bn, generateTerminateTask as bo, generateWaitTask as bp, generateSwitchTask as bq, generate as br, taskGenMapper as bs, OpenAPIConfig as c, CancelablePromise as d, TaskManagerOptions as e, TaskManagerConfig as f, TaskManager as g, ConductorWorker as h, TaskErrorHandler as i, TaskRunnerOptions as j, ApiResult as k, OnCancel as l, ApiError as m, noopErrorHandler as n, CancelError as o, Action as p, ExternalStorageLocation as q, RerunWorkflowRequest as r, Response$1 as s, ScrollableSearchResultWorkflowSummary as t, SearchResultTask as u, SearchResultTaskSummary as v, SearchResultWorkflow as w, SearchResultWorkflowScheduleExecutionModel as x, SearchResultWorkflowSummary as y, SkipTaskRequest as z };
2200
+ export { HealthCheckResourceService as $, ApiRequestOptions as A, BaseHttpRequest as B, ConductorHttpRequest as C, StartWorkflow as D, EventHandler as E, FetchFn as F, GenerateTokenRequest as G, StartWorkflowRequest as H, SubWorkflowParams as I, Task as J, TaskDef as K, TaskDetails as L, TaskExecLog as M, TaskResult as N, OrkesApiConfig as O, PollData as P, TaskSummary as Q, RunnerArgs as R, SaveScheduleRequest as S, TaskRunner as T, WorkflowSchedule as U, WorkflowScheduleExecutionModel as V, Workflow as W, WorkflowStatus as X, WorkflowSummary as Y, WorkflowTask as Z, EventResourceService as _, ConductorClient as a, jsonJqTask as a$, MetadataResourceService as a0, SchedulerResourceService as a1, TaskResourceService as a2, TokenResourceService as a3, WorkflowBulkResourceService as a4, WorkflowResourceService as a5, HTScrollableSearchResultHumanTaskEntry as a6, Terminate as a7, TimeoutPolicy as a8, HumanTaskUser as a9, JsonJQTransformTaskDef as aA, KafkaPublishInputParameters as aB, KafkaPublishTaskDef as aC, SetVariableTaskDef as aD, SimpleTaskDef as aE, SubWorkflowTaskDef as aF, SwitchTaskDef as aG, TerminateTaskDef as aH, WaitTaskDef as aI, WorkflowDef as aJ, TaskFinderPredicate as aK, completedTaskMatchingType as aL, WorkflowExecutor as aM, ConductorError as aN, TaskResultStatus as aO, HumanExecutor as aP, doWhileTask as aQ, newLoopTask as aR, dynamicForkTask as aS, eventTask as aT, sqsEventTask as aU, conductorEventTask as aV, forkTask as aW, forkTaskJoin as aX, httpTask as aY, inlineTask as aZ, joinTask as a_, HumanTaskDefinition as aa, HumanTaskAssignment as ab, HumanTaskTrigger as ac, UserFormTemplate as ad, HumanTaskTemplate as ae, HumanTaskSearchResult as af, HumanTaskSearch as ag, HumanTaskEntry as ah, ConductorLogger as ai, ConductorLogLevel as aj, DefaultLoggerConfig as ak, DefaultLogger as al, noopLogger as am, RequestType as an, CommonTaskDef as ao, TaskType as ap, TaskDefTypes as aq, DoWhileTaskDef as ar, EventTaskDef as as, ForkJoinTaskDef as at, JoinTaskDef as au, ForkJoinDynamicDef as av, HttpInputParameters as aw, HttpTaskDef as ax, InlineTaskInputParameters as ay, InlineTaskDef as az, ConductorClientAPIConfig as b, kafkaPublishTask as b0, setVariableTask as b1, simpleTask as b2, subWorkflowTask as b3, switchTask as b4, terminateTask as b5, waitTaskDuration as b6, waitTaskUntil as b7, workflow as b8, generateSimpleTask as b9, generateDoWhileTask as ba, generateEventTask as bb, generateForkJoinTask as bc, generateJoinTask as bd, generateHTTPTask as be, generateInlineTask as bf, generateJQTransformTask as bg, generateKafkaPublishTask as bh, generateSubWorkflowTask as bi, generateSetVariableTask as bj, generateTerminateTask as bk, generateWaitTask as bl, generateSwitchTask as bm, generate as bn, taskGenMapper as bo, OpenAPIConfig as c, CancelablePromise as d, TaskManagerOptions as e, TaskManagerConfig as f, TaskManager as g, ConductorWorker as h, TaskErrorHandler as i, TaskRunnerOptions as j, ApiResult as k, OnCancel as l, ApiError as m, noopErrorHandler as n, CancelError as o, Action as p, ExternalStorageLocation as q, RerunWorkflowRequest as r, Response$1 as s, ScrollableSearchResultWorkflowSummary as t, SearchResultTask as u, SearchResultTaskSummary as v, SearchResultWorkflow as w, SearchResultWorkflowScheduleExecutionModel as x, SearchResultWorkflowSummary as y, SkipTaskRequest as z };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@io-orkes/conductor-javascript",
3
3
  "description": "Typescript Client for Netflix Conductor",
4
- "version": "v1.2.3",
4
+ "version": "v2.0.0-rc1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "require": "./dist/index.js",