@io-orkes/conductor-javascript 1.0.1 → 1.2.0-rc.1

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.
@@ -0,0 +1,2179 @@
1
+ interface ConductorLogger {
2
+ info(...args: any): void;
3
+ error(...args: any): void;
4
+ debug(...args: any): void;
5
+ }
6
+ declare type ConductorLogLevel = keyof typeof LOG_LEVELS;
7
+ interface DefaultLoggerConfig {
8
+ level?: ConductorLogLevel;
9
+ tags?: Object[];
10
+ }
11
+ declare const LOG_LEVELS: {
12
+ readonly DEBUG: 10;
13
+ readonly INFO: 30;
14
+ readonly ERROR: 60;
15
+ };
16
+ declare class DefaultLogger implements ConductorLogger {
17
+ private readonly tags;
18
+ private readonly level;
19
+ constructor(config?: DefaultLoggerConfig);
20
+ private log;
21
+ info: (...args: any) => void;
22
+ debug: (...args: any) => void;
23
+ error: (...args: any) => void;
24
+ }
25
+ declare const noopLogger: ConductorLogger;
26
+
27
+ declare type ApiRequestOptions = {
28
+ readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
29
+ readonly url: string;
30
+ readonly path?: Record<string, any>;
31
+ readonly cookies?: Record<string, any>;
32
+ readonly headers?: Record<string, any>;
33
+ readonly query?: Record<string, any>;
34
+ readonly formData?: Record<string, any>;
35
+ readonly body?: any;
36
+ readonly mediaType?: string;
37
+ readonly responseHeader?: string;
38
+ readonly errors?: Record<number, string>;
39
+ };
40
+
41
+ declare class CancelError extends Error {
42
+ constructor(message: string);
43
+ get isCancelled(): boolean;
44
+ }
45
+ interface OnCancel {
46
+ readonly isResolved: boolean;
47
+ readonly isRejected: boolean;
48
+ readonly isCancelled: boolean;
49
+ (cancelHandler: () => void): void;
50
+ }
51
+ declare class CancelablePromise<T> implements Promise<T> {
52
+ readonly [Symbol.toStringTag]: string;
53
+ private _isResolved;
54
+ private _isRejected;
55
+ private _isCancelled;
56
+ private readonly _cancelHandlers;
57
+ private readonly _promise;
58
+ private _resolve?;
59
+ private _reject?;
60
+ constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
61
+ then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
62
+ catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
63
+ finally(onFinally?: (() => void) | null): Promise<T>;
64
+ cancel(): void;
65
+ get isCancelled(): boolean;
66
+ }
67
+
68
+ declare type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
69
+ declare type Headers$1 = Record<string, string>;
70
+ declare type OpenAPIConfig = {
71
+ BASE: string;
72
+ VERSION: string;
73
+ WITH_CREDENTIALS: boolean;
74
+ CREDENTIALS: 'include' | 'omit' | 'same-origin';
75
+ TOKEN?: string | Resolver<string>;
76
+ USERNAME?: string | Resolver<string>;
77
+ PASSWORD?: string | Resolver<string>;
78
+ HEADERS?: Headers$1 | Resolver<Headers$1>;
79
+ ENCODE_PATH?: (path: string) => string;
80
+ };
81
+
82
+ /**
83
+ * Request method
84
+ * @param config The OpenAPI configuration object
85
+ * @param options The request options from the service
86
+ * @returns CancelablePromise<T>
87
+ * @throws ApiError
88
+ */
89
+ declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
90
+
91
+ /**
92
+ * A handler to modify requests made by ConductorClient. Useful for metrics/option transformation/etc.
93
+ *
94
+ * @remarks
95
+ * Example: Customizing the request URL
96
+ * ```
97
+ *
98
+ * const requestCustomizer = (request, config, options) => {
99
+ * const url = options.url.replace(/^\/api/, '')
100
+ * return request(config, {...options, url });
101
+ * }
102
+ * const config = { BASE: "https://my-api.com"}
103
+ * const client = new ConductorClient(config, requestCustomizer)
104
+ * ```
105
+ *
106
+ * @param request the underlying node-fetch powered function
107
+ * @param config @see OpenAPIConfig
108
+ * @param options {see ApiRequestOptions}
109
+ */
110
+ declare type RequestType = typeof request;
111
+ declare type ConductorHttpRequest = <T>(request: RequestType, config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
112
+
113
+ declare type SubWorkflowParams = {
114
+ name: string;
115
+ version?: number;
116
+ taskToDomain?: Record<string, string>;
117
+ workflowDefinition?: WorkflowDef$1;
118
+ };
119
+
120
+ declare type TaskDef = {
121
+ ownerApp?: string;
122
+ createTime?: number;
123
+ updateTime?: number;
124
+ createdBy?: string;
125
+ updatedBy?: string;
126
+ name: string;
127
+ description?: string;
128
+ retryCount?: number;
129
+ timeoutSeconds: number;
130
+ inputKeys?: Array<string>;
131
+ outputKeys?: Array<string>;
132
+ timeoutPolicy?: 'RETRY' | 'TIME_OUT_WF' | 'ALERT_ONLY';
133
+ retryLogic?: 'FIXED' | 'EXPONENTIAL_BACKOFF' | 'LINEAR_BACKOFF';
134
+ retryDelaySeconds?: number;
135
+ responseTimeoutSeconds?: number;
136
+ concurrentExecLimit?: number;
137
+ inputTemplate?: Record<string, any>;
138
+ rateLimitPerFrequency?: number;
139
+ rateLimitFrequencyInSeconds?: number;
140
+ isolationGroupId?: string;
141
+ executionNameSpace?: string;
142
+ ownerEmail?: string;
143
+ pollTimeoutSeconds?: number;
144
+ backoffScaleFactor?: number;
145
+ };
146
+
147
+ declare type WorkflowTask = {
148
+ name: string;
149
+ taskReferenceName: string;
150
+ description?: string;
151
+ inputParameters?: Record<string, any>;
152
+ type?: string;
153
+ dynamicTaskNameParam?: string;
154
+ /**
155
+ * @deprecated
156
+ */
157
+ caseValueParam?: string;
158
+ /**
159
+ * @deprecated
160
+ */
161
+ caseExpression?: string;
162
+ scriptExpression?: string;
163
+ decisionCases?: Record<string, Array<WorkflowTask>>;
164
+ /**
165
+ * @deprecated
166
+ */
167
+ dynamicForkJoinTasksParam?: string;
168
+ dynamicForkTasksParam?: string;
169
+ dynamicForkTasksInputParamName?: string;
170
+ defaultCase?: Array<WorkflowTask>;
171
+ forkTasks?: Array<Array<WorkflowTask>>;
172
+ startDelay?: number;
173
+ subWorkflowParam?: SubWorkflowParams;
174
+ joinOn?: Array<string>;
175
+ sink?: string;
176
+ optional?: boolean;
177
+ taskDefinition?: TaskDef;
178
+ rateLimited?: boolean;
179
+ defaultExclusiveJoinTask?: Array<string>;
180
+ asyncComplete?: boolean;
181
+ loopCondition?: string;
182
+ loopOver?: Array<WorkflowTask>;
183
+ retryCount?: number;
184
+ evaluatorType?: string;
185
+ expression?: string;
186
+ workflowTaskType?: 'SIMPLE' | 'DYNAMIC' | 'FORK_JOIN' | 'FORK_JOIN_DYNAMIC' | 'DECISION' | 'SWITCH' | 'JOIN' | 'DO_WHILE' | 'SUB_WORKFLOW' | 'START_WORKFLOW' | 'EVENT' | 'WAIT' | 'HUMAN' | 'USER_DEFINED' | 'HTTP' | 'LAMBDA' | 'INLINE' | 'EXCLUSIVE_JOIN' | 'TERMINATE' | 'KAFKA_PUBLISH' | 'JSON_JQ_TRANSFORM' | 'SET_VARIABLE';
187
+ };
188
+
189
+ declare type WorkflowDef$1 = {
190
+ ownerApp?: string;
191
+ createTime?: number;
192
+ updateTime?: number;
193
+ createdBy?: string;
194
+ updatedBy?: string;
195
+ name: string;
196
+ description?: string;
197
+ version?: number;
198
+ tasks: Array<WorkflowTask>;
199
+ inputParameters?: Array<string>;
200
+ outputParameters?: Record<string, any>;
201
+ failureWorkflow?: string;
202
+ schemaVersion?: number;
203
+ restartable?: boolean;
204
+ workflowStatusListenerEnabled?: boolean;
205
+ ownerEmail?: string;
206
+ timeoutPolicy?: 'TIME_OUT_WF' | 'ALERT_ONLY';
207
+ timeoutSeconds: number;
208
+ variables?: Record<string, any>;
209
+ inputTemplate?: Record<string, any>;
210
+ };
211
+
212
+ interface CommonTaskDef {
213
+ name: string;
214
+ taskReferenceName: string;
215
+ }
216
+ declare enum TaskType {
217
+ START = "START",
218
+ SIMPLE = "SIMPLE",
219
+ DYNAMIC = "DYNAMIC",
220
+ FORK_JOIN = "FORK_JOIN",
221
+ FORK_JOIN_DYNAMIC = "FORK_JOIN_DYNAMIC",
222
+ DECISION = "DECISION",
223
+ SWITCH = "SWITCH",
224
+ JOIN = "JOIN",
225
+ DO_WHILE = "DO_WHILE",
226
+ SUB_WORKFLOW = "SUB_WORKFLOW",
227
+ EVENT = "EVENT",
228
+ WAIT = "WAIT",
229
+ USER_DEFINED = "USER_DEFINED",
230
+ HTTP = "HTTP",
231
+ LAMBDA = "LAMBDA",
232
+ INLINE = "INLINE",
233
+ EXCLUSIVE_JOIN = "EXCLUSIVE_JOIN",
234
+ TERMINAL = "TERMINAL",
235
+ TERMINATE = "TERMINATE",
236
+ KAFKA_PUBLISH = "KAFKA_PUBLISH",
237
+ JSON_JQ_TRANSFORM = "JSON_JQ_TRANSFORM",
238
+ SET_VARIABLE = "SET_VARIABLE"
239
+ }
240
+ declare type TaskDefTypes = SimpleTaskDef | DoWhileTaskDef | EventTaskDef | ForkJoinTaskDef | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDef | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDef | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
241
+ interface DoWhileTaskDef extends CommonTaskDef {
242
+ inputParameters: Record<string, unknown>;
243
+ type: TaskType.DO_WHILE;
244
+ startDelay?: number;
245
+ optional?: boolean;
246
+ asyncComplete?: boolean;
247
+ loopCondition: string;
248
+ loopOver: TaskDefTypes[];
249
+ }
250
+ interface EventTaskDef extends CommonTaskDef {
251
+ type: TaskType.EVENT;
252
+ sink: string;
253
+ asyncComplete?: boolean;
254
+ }
255
+ interface ForkJoinTaskDef extends CommonTaskDef {
256
+ type: TaskType.FORK_JOIN;
257
+ inputParameters?: Record<string, string>;
258
+ forkTasks: Array<Array<TaskDefTypes>>;
259
+ }
260
+ interface JoinTaskDef extends CommonTaskDef {
261
+ type: TaskType.JOIN;
262
+ inputParameters?: Record<string, string>;
263
+ joinOn: string[];
264
+ optional?: boolean;
265
+ asyncComplete?: boolean;
266
+ }
267
+ interface ForkJoinDynamicDef extends CommonTaskDef {
268
+ inputParameters: {
269
+ dynamicTasks: any;
270
+ dynamicTasksInput: any;
271
+ };
272
+ type: TaskType.FORK_JOIN_DYNAMIC;
273
+ dynamicForkTasksParam: string;
274
+ dynamicForkTasksInputParamName: string;
275
+ startDelay?: number;
276
+ optional?: boolean;
277
+ asyncComplete?: boolean;
278
+ }
279
+ interface HttpInputParameters {
280
+ uri: string;
281
+ method: "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD";
282
+ accept?: string;
283
+ contentType?: string;
284
+ headers?: Record<string, string>;
285
+ body?: unknown;
286
+ connectionTimeOut?: number;
287
+ readTimeOut?: string;
288
+ }
289
+ interface HttpTaskDef extends CommonTaskDef {
290
+ inputParameters: {
291
+ [x: string]: unknown;
292
+ http_request: HttpInputParameters;
293
+ };
294
+ type: TaskType.HTTP;
295
+ }
296
+ interface InlineTaskInputParameters {
297
+ evaluatorType: "javascript" | "graaljs";
298
+ expression: string;
299
+ [x: string]: unknown;
300
+ }
301
+ interface InlineTaskDef extends CommonTaskDef {
302
+ type: TaskType.INLINE;
303
+ inputParameters: InlineTaskInputParameters;
304
+ }
305
+ interface ContainingQueryExpression {
306
+ queryExpression: string;
307
+ [x: string | number | symbol]: unknown;
308
+ }
309
+ interface JsonJQTransformTaskDef extends CommonTaskDef {
310
+ type: TaskType.JSON_JQ_TRANSFORM;
311
+ inputParameters: ContainingQueryExpression;
312
+ }
313
+ interface KafkaPublishInputParameters {
314
+ topic: string;
315
+ value: string;
316
+ bootStrapServers: string;
317
+ headers: Record<string, string>;
318
+ key: string;
319
+ keySerializer: string;
320
+ }
321
+ interface KafkaPublishTaskDef extends CommonTaskDef {
322
+ inputParameters: {
323
+ kafka_request: KafkaPublishInputParameters;
324
+ };
325
+ type: TaskType.KAFKA_PUBLISH;
326
+ }
327
+ interface SetVariableTaskDef extends CommonTaskDef {
328
+ type: TaskType.SET_VARIABLE;
329
+ inputParameters: Record<string, unknown>;
330
+ }
331
+ interface SimpleTaskDef extends CommonTaskDef {
332
+ type: TaskType.SIMPLE;
333
+ inputParameters?: Record<string, unknown>;
334
+ }
335
+ interface SubWorkflowTaskDef extends CommonTaskDef {
336
+ type: TaskType.SUB_WORKFLOW;
337
+ inputParameters?: Record<string, unknown>;
338
+ subWorkflowParam: {
339
+ name: string;
340
+ version?: number;
341
+ taskToDomain?: Record<string, string>;
342
+ };
343
+ }
344
+ interface SwitchTaskDef extends CommonTaskDef {
345
+ inputParameters: Record<string, unknown>;
346
+ type: TaskType.SWITCH;
347
+ decisionCases: Record<string, TaskDefTypes[]>;
348
+ defaultCase: TaskDefTypes[];
349
+ evaluatorType: "value-param" | "javascript";
350
+ expression: string;
351
+ }
352
+ interface TerminateTaskDef extends CommonTaskDef {
353
+ inputParameters: {
354
+ terminationStatus: "COMPLETED" | "FAILED";
355
+ workflowOutput?: Record<string, string>;
356
+ terminationReason?: string;
357
+ };
358
+ type: TaskType.TERMINATE;
359
+ startDelay?: number;
360
+ optional?: boolean;
361
+ }
362
+ interface WaitTaskDef extends CommonTaskDef {
363
+ type: TaskType.WAIT;
364
+ inputParameters: {
365
+ duration?: string;
366
+ until?: string;
367
+ };
368
+ }
369
+ interface WorkflowDef extends Omit<WorkflowDef$1, "tasks" | "version" | "inputParameters"> {
370
+ inputParameters: string[];
371
+ version: number;
372
+ tasks: TaskDefTypes[];
373
+ }
374
+
375
+ declare abstract class BaseHttpRequest {
376
+ readonly config: OpenAPIConfig;
377
+ constructor(config: OpenAPIConfig);
378
+ abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
379
+ }
380
+
381
+ declare type StartWorkflow = {
382
+ name?: string;
383
+ version?: number;
384
+ correlationId?: string;
385
+ input?: Record<string, any>;
386
+ taskToDomain?: Record<string, string>;
387
+ };
388
+
389
+ declare type TaskDetails = {
390
+ workflowId?: string;
391
+ taskRefName?: string;
392
+ output?: Record<string, any>;
393
+ taskId?: string;
394
+ };
395
+
396
+ declare type Action = {
397
+ action?: 'start_workflow' | 'complete_task' | 'fail_task';
398
+ start_workflow?: StartWorkflow;
399
+ complete_task?: TaskDetails;
400
+ fail_task?: TaskDetails;
401
+ expandInlineJSON?: boolean;
402
+ };
403
+
404
+ declare type EventHandler = {
405
+ name: string;
406
+ event: string;
407
+ condition?: string;
408
+ actions: Array<Action>;
409
+ active?: boolean;
410
+ evaluatorType?: string;
411
+ };
412
+
413
+ declare class EventResourceService {
414
+ readonly httpRequest: BaseHttpRequest;
415
+ constructor(httpRequest: BaseHttpRequest);
416
+ /**
417
+ * Get queue config by name
418
+ * @param queueType
419
+ * @param queueName
420
+ * @returns any OK
421
+ * @throws ApiError
422
+ */
423
+ getQueueConfig(queueType: string, queueName: string): CancelablePromise<any>;
424
+ /**
425
+ * Create or update queue config by name
426
+ * @param queueType
427
+ * @param queueName
428
+ * @param requestBody
429
+ * @returns any OK
430
+ * @throws ApiError
431
+ */
432
+ putQueueConfig(queueType: string, queueName: string, requestBody: string): CancelablePromise<any>;
433
+ /**
434
+ * Delete queue config by name
435
+ * @param queueType
436
+ * @param queueName
437
+ * @returns any OK
438
+ * @throws ApiError
439
+ */
440
+ deleteQueueConfig(queueType: string, queueName: string): CancelablePromise<any>;
441
+ /**
442
+ * Get all the event handlers
443
+ * @returns EventHandler OK
444
+ * @throws ApiError
445
+ */
446
+ getEventHandlers(): CancelablePromise<Array<EventHandler>>;
447
+ /**
448
+ * Update an existing event handler.
449
+ * @param requestBody
450
+ * @returns any OK
451
+ * @throws ApiError
452
+ */
453
+ updateEventHandler(requestBody: EventHandler): CancelablePromise<any>;
454
+ /**
455
+ * Add a new event handler.
456
+ * @param requestBody
457
+ * @returns any OK
458
+ * @throws ApiError
459
+ */
460
+ addEventHandler(requestBody: EventHandler): CancelablePromise<any>;
461
+ /**
462
+ * Get all queue configs
463
+ * @returns any OK
464
+ * @throws ApiError
465
+ */
466
+ getQueueNames(): CancelablePromise<any>;
467
+ /**
468
+ * Remove an event handler
469
+ * @param name
470
+ * @returns any OK
471
+ * @throws ApiError
472
+ */
473
+ removeEventHandlerStatus(name: string): CancelablePromise<any>;
474
+ /**
475
+ * Get event handlers for a given event
476
+ * @param event
477
+ * @param activeOnly
478
+ * @returns EventHandler OK
479
+ * @throws ApiError
480
+ */
481
+ getEventHandlersForEvent(event: string, activeOnly?: boolean): CancelablePromise<Array<EventHandler>>;
482
+ }
483
+
484
+ declare class HealthCheckResourceService {
485
+ readonly httpRequest: BaseHttpRequest;
486
+ constructor(httpRequest: BaseHttpRequest);
487
+ /**
488
+ * @returns any OK
489
+ * @throws ApiError
490
+ */
491
+ doCheck(): CancelablePromise<Record<string, any>>;
492
+ }
493
+
494
+ declare class MetadataResourceService {
495
+ readonly httpRequest: BaseHttpRequest;
496
+ constructor(httpRequest: BaseHttpRequest);
497
+ /**
498
+ * Gets the task definition
499
+ * @param tasktype
500
+ * @param metadata
501
+ * @returns TaskDef OK
502
+ * @throws ApiError
503
+ */
504
+ getTaskDef(tasktype: string, metadata?: boolean): CancelablePromise<TaskDef>;
505
+ /**
506
+ * Remove a task definition
507
+ * @param tasktype
508
+ * @returns any OK
509
+ * @throws ApiError
510
+ */
511
+ unregisterTaskDef(tasktype: string): CancelablePromise<any>;
512
+ /**
513
+ * Retrieves all workflow definition along with blueprint
514
+ * @param access
515
+ * @param metadata
516
+ * @param tagKey
517
+ * @param tagValue
518
+ * @returns WorkflowDef OK
519
+ * @throws ApiError
520
+ */
521
+ getAllWorkflows(access?: string, metadata?: boolean, tagKey?: string, tagValue?: string): CancelablePromise<Array<WorkflowDef$1>>;
522
+ /**
523
+ * Create or update workflow definition(s)
524
+ * @param requestBody
525
+ * @param overwrite
526
+ * @returns any OK
527
+ * @throws ApiError
528
+ */
529
+ update(requestBody: Array<WorkflowDef$1>, overwrite?: boolean): CancelablePromise<any>;
530
+ /**
531
+ * Create a new workflow definition
532
+ * @param requestBody
533
+ * @param overwrite
534
+ * @returns any OK
535
+ * @throws ApiError
536
+ */
537
+ create(requestBody: WorkflowDef$1, overwrite?: boolean): CancelablePromise<any>;
538
+ /**
539
+ * Gets all task definition
540
+ * @param access
541
+ * @param metadata
542
+ * @param tagKey
543
+ * @param tagValue
544
+ * @returns TaskDef OK
545
+ * @throws ApiError
546
+ */
547
+ getTaskDefs(access?: string, metadata?: boolean, tagKey?: string, tagValue?: string): CancelablePromise<Array<TaskDef>>;
548
+ /**
549
+ * Update an existing task
550
+ * @param requestBody
551
+ * @returns any OK
552
+ * @throws ApiError
553
+ */
554
+ updateTaskDef(requestBody: TaskDef): CancelablePromise<any>;
555
+ /**
556
+ * Create or update task definition(s)
557
+ * @param requestBody
558
+ * @returns any OK
559
+ * @throws ApiError
560
+ */
561
+ registerTaskDef(requestBody: Array<TaskDef>): CancelablePromise<any>;
562
+ /**
563
+ * Removes workflow definition. It does not remove workflows associated with the definition.
564
+ * @param name
565
+ * @param version
566
+ * @returns any OK
567
+ * @throws ApiError
568
+ */
569
+ unregisterWorkflowDef(name: string, version: number): CancelablePromise<any>;
570
+ /**
571
+ * Retrieves workflow definition along with blueprint
572
+ * @param name
573
+ * @param version
574
+ * @param metadata
575
+ * @returns WorkflowDef OK
576
+ * @throws ApiError
577
+ */
578
+ get(name: string, version?: number, metadata?: boolean): CancelablePromise<WorkflowDef$1>;
579
+ }
580
+
581
+ declare type StartWorkflowRequest = {
582
+ name: string;
583
+ version?: number;
584
+ correlationId?: string;
585
+ input?: Record<string, any>;
586
+ taskToDomain?: Record<string, string>;
587
+ workflowDef?: WorkflowDef$1;
588
+ externalInputPayloadStoragePath?: string;
589
+ priority?: number;
590
+ createdBy?: string;
591
+ };
592
+
593
+ declare type SaveScheduleRequest = {
594
+ name: string;
595
+ cronExpression: string;
596
+ runCatchupScheduleInstances?: boolean;
597
+ paused?: boolean;
598
+ startWorkflowRequest?: StartWorkflowRequest;
599
+ createdBy?: string;
600
+ updatedBy?: string;
601
+ scheduleStartTime?: number;
602
+ scheduleEndTime?: number;
603
+ };
604
+
605
+ declare type WorkflowScheduleExecutionModel = {
606
+ executionId?: string;
607
+ scheduleName?: string;
608
+ scheduledTime?: number;
609
+ executionTime?: number;
610
+ workflowName?: string;
611
+ workflowId?: string;
612
+ reason?: string;
613
+ stackTrace?: string;
614
+ startWorkflowRequest?: StartWorkflowRequest;
615
+ state?: 'POLLED' | 'FAILED' | 'EXECUTED';
616
+ };
617
+
618
+ declare type SearchResultWorkflowScheduleExecutionModel = {
619
+ totalHits?: number;
620
+ results?: Array<WorkflowScheduleExecutionModel>;
621
+ };
622
+
623
+ declare type WorkflowSchedule = {
624
+ name?: string;
625
+ cronExpression?: string;
626
+ runCatchupScheduleInstances?: boolean;
627
+ paused?: boolean;
628
+ startWorkflowRequest?: StartWorkflowRequest;
629
+ scheduleStartTime?: number;
630
+ scheduleEndTime?: number;
631
+ createTime?: number;
632
+ updatedTime?: number;
633
+ createdBy?: string;
634
+ updatedBy?: string;
635
+ };
636
+
637
+ declare class SchedulerResourceService {
638
+ readonly httpRequest: BaseHttpRequest;
639
+ constructor(httpRequest: BaseHttpRequest);
640
+ /**
641
+ * Get an existing workflow schedule by name
642
+ * @param name
643
+ * @returns any OK
644
+ * @throws ApiError
645
+ */
646
+ getSchedule(name: string): CancelablePromise<any>;
647
+ /**
648
+ * Deletes an existing workflow schedule by name
649
+ * @param name
650
+ * @returns any OK
651
+ * @throws ApiError
652
+ */
653
+ deleteSchedule(name: string): CancelablePromise<any>;
654
+ /**
655
+ * Get list of the next x (default 3, max 5) execution times for a scheduler
656
+ * @param cronExpression
657
+ * @param scheduleStartTime
658
+ * @param scheduleEndTime
659
+ * @param limit
660
+ * @returns number OK
661
+ * @throws ApiError
662
+ */
663
+ getNextFewSchedules(cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, limit?: number): CancelablePromise<Array<number>>;
664
+ /**
665
+ * Pauses an existing schedule by name
666
+ * @param name
667
+ * @returns any OK
668
+ * @throws ApiError
669
+ */
670
+ pauseSchedule(name: string): CancelablePromise<any>;
671
+ /**
672
+ * Pause all scheduling in a single conductor server instance (for debugging only)
673
+ * @returns any OK
674
+ * @throws ApiError
675
+ */
676
+ pauseAllSchedules(): CancelablePromise<Record<string, any>>;
677
+ /**
678
+ * Resume a paused schedule by name
679
+ * @param name
680
+ * @returns any OK
681
+ * @throws ApiError
682
+ */
683
+ resumeSchedule(name: string): CancelablePromise<any>;
684
+ /**
685
+ * Requeue all execution records
686
+ * @returns any OK
687
+ * @throws ApiError
688
+ */
689
+ requeueAllExecutionRecords(): CancelablePromise<Record<string, any>>;
690
+ /**
691
+ * Resume all scheduling
692
+ * @returns any OK
693
+ * @throws ApiError
694
+ */
695
+ resumeAllSchedules(): CancelablePromise<Record<string, any>>;
696
+ /**
697
+ * Get all existing workflow schedules and optionally filter by workflow name
698
+ * @param workflowName
699
+ * @returns WorkflowSchedule OK
700
+ * @throws ApiError
701
+ */
702
+ getAllSchedules(workflowName?: string): CancelablePromise<Array<WorkflowSchedule>>;
703
+ /**
704
+ * Create or update a schedule for a specified workflow with a corresponding start workflow request
705
+ * @param requestBody
706
+ * @returns any OK
707
+ * @throws ApiError
708
+ */
709
+ saveSchedule(requestBody: SaveScheduleRequest): CancelablePromise<any>;
710
+ /**
711
+ * Test timeout - do not use in production
712
+ * @returns any OK
713
+ * @throws ApiError
714
+ */
715
+ testTimeout(): CancelablePromise<any>;
716
+ /**
717
+ * Search for workflows based on payload and other parameters
718
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC.
719
+ * @param start
720
+ * @param size
721
+ * @param sort
722
+ * @param freeText
723
+ * @param query
724
+ * @returns SearchResultWorkflowScheduleExecutionModel OK
725
+ * @throws ApiError
726
+ */
727
+ searchV21(start?: number, size?: number, sort?: string, freeText?: string, query?: string): CancelablePromise<SearchResultWorkflowScheduleExecutionModel>;
728
+ }
729
+
730
+ declare type ExternalStorageLocation = {
731
+ uri?: string;
732
+ path?: string;
733
+ };
734
+
735
+ declare type PollData = {
736
+ queueName?: string;
737
+ domain?: string;
738
+ workerId?: string;
739
+ lastPollTime?: number;
740
+ };
741
+
742
+ declare type Task = {
743
+ taskType?: string;
744
+ status?: 'IN_PROGRESS' | 'CANCELED' | 'FAILED' | 'FAILED_WITH_TERMINAL_ERROR' | 'COMPLETED' | 'COMPLETED_WITH_ERRORS' | 'SCHEDULED' | 'TIMED_OUT' | 'SKIPPED';
745
+ inputData?: Record<string, any>;
746
+ referenceTaskName?: string;
747
+ retryCount?: number;
748
+ seq?: number;
749
+ correlationId?: string;
750
+ pollCount?: number;
751
+ taskDefName?: string;
752
+ scheduledTime?: number;
753
+ startTime?: number;
754
+ endTime?: number;
755
+ updateTime?: number;
756
+ startDelayInSeconds?: number;
757
+ retriedTaskId?: string;
758
+ retried?: boolean;
759
+ executed?: boolean;
760
+ callbackFromWorker?: boolean;
761
+ responseTimeoutSeconds?: number;
762
+ workflowInstanceId?: string;
763
+ workflowType?: string;
764
+ taskId?: string;
765
+ reasonForIncompletion?: string;
766
+ callbackAfterSeconds?: number;
767
+ workerId?: string;
768
+ outputData?: Record<string, any>;
769
+ workflowTask?: WorkflowTask;
770
+ domain?: string;
771
+ rateLimitPerFrequency?: number;
772
+ rateLimitFrequencyInSeconds?: number;
773
+ externalInputPayloadStoragePath?: string;
774
+ externalOutputPayloadStoragePath?: string;
775
+ workflowPriority?: number;
776
+ executionNameSpace?: string;
777
+ isolationGroupId?: string;
778
+ iteration?: number;
779
+ subWorkflowId?: string;
780
+ subworkflowChanged?: boolean;
781
+ queueWaitTime?: number;
782
+ taskDefinition?: TaskDef;
783
+ loopOverTask?: boolean;
784
+ };
785
+
786
+ declare type SearchResultTask = {
787
+ totalHits?: number;
788
+ results?: Array<Task>;
789
+ };
790
+
791
+ declare type TaskSummary = {
792
+ workflowId?: string;
793
+ workflowType?: string;
794
+ correlationId?: string;
795
+ scheduledTime?: string;
796
+ startTime?: string;
797
+ updateTime?: string;
798
+ endTime?: string;
799
+ status?: 'IN_PROGRESS' | 'CANCELED' | 'FAILED' | 'FAILED_WITH_TERMINAL_ERROR' | 'COMPLETED' | 'COMPLETED_WITH_ERRORS' | 'SCHEDULED' | 'TIMED_OUT' | 'SKIPPED';
800
+ reasonForIncompletion?: string;
801
+ executionTime?: number;
802
+ queueWaitTime?: number;
803
+ taskDefName?: string;
804
+ taskType?: string;
805
+ input?: string;
806
+ output?: string;
807
+ taskId?: string;
808
+ externalInputPayloadStoragePath?: string;
809
+ externalOutputPayloadStoragePath?: string;
810
+ workflowPriority?: number;
811
+ };
812
+
813
+ declare type SearchResultTaskSummary = {
814
+ totalHits?: number;
815
+ results?: Array<TaskSummary>;
816
+ };
817
+
818
+ declare type TaskExecLog = {
819
+ log?: string;
820
+ taskId?: string;
821
+ createdTime?: number;
822
+ };
823
+
824
+ declare type TaskResult = {
825
+ workflowInstanceId: string;
826
+ taskId: string;
827
+ reasonForIncompletion?: string;
828
+ callbackAfterSeconds?: number;
829
+ workerId?: string;
830
+ status?: 'IN_PROGRESS' | 'FAILED' | 'FAILED_WITH_TERMINAL_ERROR' | 'COMPLETED';
831
+ outputData?: Record<string, any>;
832
+ logs?: Array<TaskExecLog>;
833
+ externalOutputPayloadStoragePath?: string;
834
+ subWorkflowId?: string;
835
+ };
836
+
837
+ declare class TaskResourceService {
838
+ readonly httpRequest: BaseHttpRequest;
839
+ constructor(httpRequest: BaseHttpRequest);
840
+ /**
841
+ * Poll for a task of a certain type
842
+ * @param tasktype
843
+ * @param workerid
844
+ * @param domain
845
+ * @returns Task OK
846
+ * @throws ApiError
847
+ */
848
+ poll(tasktype: string, workerid?: string, domain?: string): CancelablePromise<Task>;
849
+ /**
850
+ * Get the details about each queue
851
+ * @returns number OK
852
+ * @throws ApiError
853
+ */
854
+ allVerbose(): CancelablePromise<Record<string, Record<string, Record<string, number>>>>;
855
+ /**
856
+ * Update a task By Ref Name
857
+ * @param workflowId
858
+ * @param taskRefName
859
+ * @param status
860
+ * @param requestBody
861
+ * @returns string OK
862
+ * @throws ApiError
863
+ */
864
+ updateTask(workflowId: string, taskRefName: string, status: 'IN_PROGRESS' | 'FAILED' | 'FAILED_WITH_TERMINAL_ERROR' | 'COMPLETED', requestBody: Record<string, any>): CancelablePromise<string>;
865
+ /**
866
+ * Get task by Id
867
+ * @param taskId
868
+ * @returns Task OK
869
+ * @throws ApiError
870
+ */
871
+ getTask(taskId: string): CancelablePromise<Task>;
872
+ /**
873
+ * Get the details about each queue
874
+ * @returns number OK
875
+ * @throws ApiError
876
+ */
877
+ all(): CancelablePromise<Record<string, number>>;
878
+ /**
879
+ * Requeue pending tasks
880
+ * @param taskType
881
+ * @returns string OK
882
+ * @throws ApiError
883
+ */
884
+ requeuePendingTask(taskType: string): CancelablePromise<string>;
885
+ /**
886
+ * Search for tasks based in payload and other parameters
887
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC
888
+ * @param start
889
+ * @param size
890
+ * @param sort
891
+ * @param freeText
892
+ * @param query
893
+ * @returns SearchResultTaskSummary OK
894
+ * @throws ApiError
895
+ */
896
+ search(start?: number, size?: number, sort?: string, freeText?: string, query?: string): CancelablePromise<SearchResultTaskSummary>;
897
+ /**
898
+ * Search for tasks based in payload and other parameters
899
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC
900
+ * @param start
901
+ * @param size
902
+ * @param sort
903
+ * @param freeText
904
+ * @param query
905
+ * @returns SearchResultTask OK
906
+ * @throws ApiError
907
+ */
908
+ searchV22(start?: number, size?: number, sort?: string, freeText?: string, query?: string): CancelablePromise<SearchResultTask>;
909
+ /**
910
+ * Get the last poll data for a given task type
911
+ * @param taskType
912
+ * @returns PollData OK
913
+ * @throws ApiError
914
+ */
915
+ getPollData(taskType: string): CancelablePromise<Array<PollData>>;
916
+ /**
917
+ * Get Task Execution Logs
918
+ * @param taskId
919
+ * @returns TaskExecLog OK
920
+ * @throws ApiError
921
+ */
922
+ getTaskLogs(taskId: string): CancelablePromise<Array<TaskExecLog>>;
923
+ /**
924
+ * Log Task Execution Details
925
+ * @param taskId
926
+ * @param requestBody
927
+ * @returns any OK
928
+ * @throws ApiError
929
+ */
930
+ log(taskId: string, requestBody: string): CancelablePromise<any>;
931
+ /**
932
+ * Get the last poll data for all task types
933
+ * @returns PollData OK
934
+ * @throws ApiError
935
+ */
936
+ getAllPollData(): CancelablePromise<Array<PollData>>;
937
+ /**
938
+ * Batch poll for a task of a certain type
939
+ * @param tasktype
940
+ * @param workerid
941
+ * @param domain
942
+ * @param count
943
+ * @param timeout
944
+ * @returns Task OK
945
+ * @throws ApiError
946
+ */
947
+ batchPoll(tasktype: string, workerid?: string, domain?: string, count?: number, timeout?: number): CancelablePromise<Array<Task>>;
948
+ /**
949
+ * Update a task
950
+ * @param requestBody
951
+ * @returns string OK
952
+ * @throws ApiError
953
+ */
954
+ updateTask1(requestBody: TaskResult): CancelablePromise<string>;
955
+ /**
956
+ * Get Task type queue sizes
957
+ * @param taskType
958
+ * @returns number OK
959
+ * @throws ApiError
960
+ */
961
+ size1(taskType?: Array<string>): CancelablePromise<Record<string, number>>;
962
+ /**
963
+ * Get the external uri where the task payload is to be stored
964
+ * @param path
965
+ * @param operation
966
+ * @param payloadType
967
+ * @returns ExternalStorageLocation OK
968
+ * @throws ApiError
969
+ */
970
+ getExternalStorageLocation1(path: string, operation: string, payloadType: string): CancelablePromise<ExternalStorageLocation>;
971
+ }
972
+
973
+ declare type GenerateTokenRequest = {
974
+ keyId: string;
975
+ keySecret: string;
976
+ };
977
+
978
+ declare type Response$1 = {};
979
+
980
+ declare class TokenResourceService {
981
+ readonly httpRequest: BaseHttpRequest;
982
+ constructor(httpRequest: BaseHttpRequest);
983
+ /**
984
+ * Generate JWT with the given access key
985
+ * @param requestBody
986
+ * @returns Response OK
987
+ * @throws ApiError
988
+ */
989
+ generateToken(requestBody: GenerateTokenRequest): CancelablePromise<Response$1>;
990
+ /**
991
+ * Get the user info from the token
992
+ * @returns any OK
993
+ * @throws ApiError
994
+ */
995
+ getUserInfo(): CancelablePromise<any>;
996
+ }
997
+
998
+ declare type BulkResponse = {
999
+ bulkErrorResults?: Record<string, string>;
1000
+ bulkSuccessfulResults?: Array<string>;
1001
+ };
1002
+
1003
+ declare class WorkflowBulkResourceService {
1004
+ readonly httpRequest: BaseHttpRequest;
1005
+ constructor(httpRequest: BaseHttpRequest);
1006
+ /**
1007
+ * Retry the last failed task for each workflow from the list
1008
+ * @param requestBody
1009
+ * @returns BulkResponse OK
1010
+ * @throws ApiError
1011
+ */
1012
+ retry(requestBody: Array<string>): CancelablePromise<BulkResponse>;
1013
+ /**
1014
+ * Restart the list of completed workflow
1015
+ * @param requestBody
1016
+ * @param useLatestDefinitions
1017
+ * @returns BulkResponse OK
1018
+ * @throws ApiError
1019
+ */
1020
+ restart(requestBody: Array<string>, useLatestDefinitions?: boolean): CancelablePromise<BulkResponse>;
1021
+ /**
1022
+ * Terminate workflows execution
1023
+ * @param requestBody
1024
+ * @param reason
1025
+ * @returns BulkResponse OK
1026
+ * @throws ApiError
1027
+ */
1028
+ terminate(requestBody: Array<string>, reason?: string): CancelablePromise<BulkResponse>;
1029
+ /**
1030
+ * Resume the list of workflows
1031
+ * @param requestBody
1032
+ * @returns BulkResponse OK
1033
+ * @throws ApiError
1034
+ */
1035
+ resumeWorkflow(requestBody: Array<string>): CancelablePromise<BulkResponse>;
1036
+ /**
1037
+ * Pause the list of workflows
1038
+ * @param requestBody
1039
+ * @returns BulkResponse OK
1040
+ * @throws ApiError
1041
+ */
1042
+ pauseWorkflow1(requestBody: Array<string>): CancelablePromise<BulkResponse>;
1043
+ }
1044
+
1045
+ declare type RerunWorkflowRequest = {
1046
+ reRunFromWorkflowId?: string;
1047
+ workflowInput?: Record<string, any>;
1048
+ reRunFromTaskId?: string;
1049
+ taskInput?: Record<string, any>;
1050
+ correlationId?: string;
1051
+ };
1052
+
1053
+ declare type WorkflowSummary = {
1054
+ workflowType?: string;
1055
+ version?: number;
1056
+ workflowId?: string;
1057
+ correlationId?: string;
1058
+ startTime?: string;
1059
+ updateTime?: string;
1060
+ endTime?: string;
1061
+ status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'TERMINATED' | 'PAUSED';
1062
+ input?: string;
1063
+ output?: string;
1064
+ reasonForIncompletion?: string;
1065
+ executionTime?: number;
1066
+ event?: string;
1067
+ failedReferenceTaskNames?: string;
1068
+ externalInputPayloadStoragePath?: string;
1069
+ externalOutputPayloadStoragePath?: string;
1070
+ priority?: number;
1071
+ createdBy?: string;
1072
+ outputSize?: number;
1073
+ inputSize?: number;
1074
+ };
1075
+
1076
+ declare type ScrollableSearchResultWorkflowSummary = {
1077
+ results?: Array<WorkflowSummary>;
1078
+ queryId?: string;
1079
+ };
1080
+
1081
+ declare type Workflow = {
1082
+ ownerApp?: string;
1083
+ createTime?: number;
1084
+ updateTime?: number;
1085
+ createdBy?: string;
1086
+ updatedBy?: string;
1087
+ status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'TERMINATED' | 'PAUSED';
1088
+ endTime?: number;
1089
+ workflowId?: string;
1090
+ parentWorkflowId?: string;
1091
+ parentWorkflowTaskId?: string;
1092
+ tasks?: Array<Task>;
1093
+ input?: Record<string, any>;
1094
+ output?: Record<string, any>;
1095
+ correlationId?: string;
1096
+ reRunFromWorkflowId?: string;
1097
+ reasonForIncompletion?: string;
1098
+ event?: string;
1099
+ taskToDomain?: Record<string, string>;
1100
+ failedReferenceTaskNames?: Array<string>;
1101
+ workflowDefinition?: WorkflowDef$1;
1102
+ externalInputPayloadStoragePath?: string;
1103
+ externalOutputPayloadStoragePath?: string;
1104
+ priority?: number;
1105
+ variables?: Record<string, any>;
1106
+ lastRetriedTime?: number;
1107
+ startTime?: number;
1108
+ workflowVersion?: number;
1109
+ workflowName?: string;
1110
+ };
1111
+
1112
+ declare type SearchResultWorkflow = {
1113
+ totalHits?: number;
1114
+ results?: Array<Workflow>;
1115
+ };
1116
+
1117
+ declare type SearchResultWorkflowSummary = {
1118
+ totalHits?: number;
1119
+ results?: Array<WorkflowSummary>;
1120
+ };
1121
+
1122
+ declare type SkipTaskRequest = {
1123
+ taskInput?: Record<string, any>;
1124
+ taskOutput?: Record<string, any>;
1125
+ };
1126
+
1127
+ declare type WorkflowRun = {
1128
+ correlationId?: string;
1129
+ createTime?: number;
1130
+ createdBy?: string;
1131
+ priority?: number;
1132
+ requestId?: string;
1133
+ status?: string;
1134
+ tasks?: Array<Task>;
1135
+ updateTime?: number;
1136
+ workflowId?: string;
1137
+ variables?: Record<string, object>;
1138
+ input?: Record<string, object>;
1139
+ output?: Record<string, object>;
1140
+ };
1141
+
1142
+ declare type WorkflowStatus = {
1143
+ workflowId?: string;
1144
+ correlationId?: string;
1145
+ output?: Record<string, any>;
1146
+ variables?: Record<string, any>;
1147
+ status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'TERMINATED' | 'PAUSED';
1148
+ };
1149
+
1150
+ declare class WorkflowResourceService {
1151
+ readonly httpRequest: BaseHttpRequest;
1152
+ constructor(httpRequest: BaseHttpRequest);
1153
+ /**
1154
+ * Retrieve all the running workflows
1155
+ * @param name
1156
+ * @param version
1157
+ * @param startTime
1158
+ * @param endTime
1159
+ * @returns string OK
1160
+ * @throws ApiError
1161
+ */
1162
+ getRunningWorkflow(name: string, version?: number, startTime?: number, endTime?: number): CancelablePromise<Array<string>>;
1163
+ /**
1164
+ * Execute a workflow synchronously
1165
+ * @param body
1166
+ * @param name
1167
+ * @param version
1168
+ * @param requestId
1169
+ * @param waitUntilTaskRef
1170
+ * @param callback
1171
+ * @returns workflowRun
1172
+ * @throws ApiError
1173
+ */
1174
+ executeWorkflow(body: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef: string): CancelablePromise<WorkflowRun>;
1175
+ /**
1176
+ * Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain
1177
+ * @param requestBody
1178
+ * @returns string OK
1179
+ * @throws ApiError
1180
+ */
1181
+ startWorkflow(requestBody: StartWorkflowRequest): CancelablePromise<string>;
1182
+ /**
1183
+ * Starts the decision task for a workflow
1184
+ * @param workflowId
1185
+ * @returns any OK
1186
+ * @throws ApiError
1187
+ */
1188
+ decide(workflowId: string): CancelablePromise<any>;
1189
+ /**
1190
+ * Reruns the workflow from a specific task
1191
+ * @param workflowId
1192
+ * @param requestBody
1193
+ * @returns string OK
1194
+ * @throws ApiError
1195
+ */
1196
+ rerun(workflowId: string, requestBody: RerunWorkflowRequest): CancelablePromise<string>;
1197
+ /**
1198
+ * Search for workflows based on payload and other parameters
1199
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC.
1200
+ * @param start
1201
+ * @param size
1202
+ * @param sort
1203
+ * @param freeText
1204
+ * @param query
1205
+ * @returns SearchResultWorkflow OK
1206
+ * @throws ApiError
1207
+ */
1208
+ searchV21(start?: number, size?: number, sort?: string, freeText?: string, query?: string): CancelablePromise<SearchResultWorkflow>;
1209
+ /**
1210
+ * Pauses the workflow
1211
+ * @param workflowId
1212
+ * @returns any OK
1213
+ * @throws ApiError
1214
+ */
1215
+ pauseWorkflow(workflowId: string): CancelablePromise<any>;
1216
+ /**
1217
+ * Skips a given task from a current running workflow
1218
+ * @param workflowId
1219
+ * @param taskReferenceName
1220
+ * @param requestBody
1221
+ * @returns any OK
1222
+ * @throws ApiError
1223
+ */
1224
+ skipTaskFromWorkflow(workflowId: string, taskReferenceName: string, requestBody?: SkipTaskRequest): CancelablePromise<any>;
1225
+ /**
1226
+ * Lists workflows for the given correlation id list
1227
+ * @param name
1228
+ * @param requestBody
1229
+ * @param includeClosed
1230
+ * @param includeTasks
1231
+ * @returns Workflow OK
1232
+ * @throws ApiError
1233
+ */
1234
+ getWorkflows(name: string, requestBody: Array<string>, includeClosed?: boolean, includeTasks?: boolean): CancelablePromise<Record<string, Array<Workflow>>>;
1235
+ /**
1236
+ * Gets the workflow by workflow id
1237
+ * @param workflowId
1238
+ * @param includeOutput
1239
+ * @param includeVariables
1240
+ * @returns WorkflowStatus OK
1241
+ * @throws ApiError
1242
+ */
1243
+ getWorkflowStatusSummary(workflowId: string, includeOutput?: boolean, includeVariables?: boolean): CancelablePromise<WorkflowStatus>;
1244
+ /**
1245
+ * Lists workflows for the given correlation id
1246
+ * @param name
1247
+ * @param correlationId
1248
+ * @param includeClosed
1249
+ * @param includeTasks
1250
+ * @returns Workflow OK
1251
+ * @throws ApiError
1252
+ */
1253
+ getWorkflows1(name: string, correlationId: string, includeClosed?: boolean, includeTasks?: boolean): CancelablePromise<Array<Workflow>>;
1254
+ /**
1255
+ * Retries the last failed task
1256
+ * @param workflowId
1257
+ * @param resumeSubworkflowTasks
1258
+ * @returns void
1259
+ * @throws ApiError
1260
+ */
1261
+ retry1(workflowId: string, resumeSubworkflowTasks?: boolean): CancelablePromise<void>;
1262
+ /**
1263
+ * Gets the workflow by workflow id
1264
+ * @param workflowId
1265
+ * @param includeTasks
1266
+ * @returns Workflow OK
1267
+ * @throws ApiError
1268
+ */
1269
+ getExecutionStatus(workflowId: string, includeTasks?: boolean): CancelablePromise<Workflow>;
1270
+ /**
1271
+ * Terminate workflow execution
1272
+ * @param workflowId
1273
+ * @param reason
1274
+ * @returns any OK
1275
+ * @throws ApiError
1276
+ */
1277
+ terminate1(workflowId: string, reason?: string): CancelablePromise<any>;
1278
+ /**
1279
+ * Resumes the workflow
1280
+ * @param workflowId
1281
+ * @returns any OK
1282
+ * @throws ApiError
1283
+ */
1284
+ resumeWorkflow(workflowId: string): CancelablePromise<any>;
1285
+ /**
1286
+ * Removes the workflow from the system
1287
+ * @param workflowId
1288
+ * @param archiveWorkflow
1289
+ * @returns any OK
1290
+ * @throws ApiError
1291
+ */
1292
+ delete(workflowId: string, archiveWorkflow?: boolean): CancelablePromise<any>;
1293
+ /**
1294
+ * Search for workflows based on task parameters
1295
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC
1296
+ * @param start
1297
+ * @param size
1298
+ * @param sort
1299
+ * @param freeText
1300
+ * @param query
1301
+ * @returns SearchResultWorkflowSummary OK
1302
+ * @throws ApiError
1303
+ */
1304
+ searchWorkflowsByTasks(start?: number, size?: number, sort?: string, freeText?: string, query?: string): CancelablePromise<SearchResultWorkflowSummary>;
1305
+ /**
1306
+ * Get the uri and path of the external storage where the workflow payload is to be stored
1307
+ * @param path
1308
+ * @param operation
1309
+ * @param payloadType
1310
+ * @returns ExternalStorageLocation OK
1311
+ * @throws ApiError
1312
+ */
1313
+ getExternalStorageLocation(path: string, operation: string, payloadType: string): CancelablePromise<ExternalStorageLocation>;
1314
+ /**
1315
+ * Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking
1316
+ * @param name
1317
+ * @param requestBody
1318
+ * @param version
1319
+ * @param correlationId
1320
+ * @param priority
1321
+ * @returns string OK
1322
+ * @throws ApiError
1323
+ */
1324
+ startWorkflow1(name: string, requestBody: Record<string, any>, version?: number, correlationId?: string, priority?: number): CancelablePromise<string>;
1325
+ /**
1326
+ * Restarts a completed workflow
1327
+ * @param workflowId
1328
+ * @param useLatestDefinitions
1329
+ * @returns void
1330
+ * @throws ApiError
1331
+ */
1332
+ restart1(workflowId: string, useLatestDefinitions?: boolean): CancelablePromise<void>;
1333
+ /**
1334
+ * Search for workflows based on payload and other parameters
1335
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC.
1336
+ * @param queryId
1337
+ * @param start
1338
+ * @param size
1339
+ * @param sort
1340
+ * @param freeText
1341
+ * @param query
1342
+ * @param skipCache
1343
+ * @returns ScrollableSearchResultWorkflowSummary OK
1344
+ * @throws ApiError
1345
+ */
1346
+ search1(queryId?: string, start?: number, size?: number, sort?: string, freeText?: string, query?: string, skipCache?: boolean): CancelablePromise<ScrollableSearchResultWorkflowSummary>;
1347
+ /**
1348
+ * Search for workflows based on task parameters
1349
+ * use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC
1350
+ * @param start
1351
+ * @param size
1352
+ * @param sort
1353
+ * @param freeText
1354
+ * @param query
1355
+ * @returns SearchResultWorkflow OK
1356
+ * @throws ApiError
1357
+ */
1358
+ searchWorkflowsByTasksV2(start?: number, size?: number, sort?: string, freeText?: string, query?: string): CancelablePromise<SearchResultWorkflow>;
1359
+ /**
1360
+ * Resets callback times of all non-terminal SIMPLE tasks to 0
1361
+ * @param workflowId
1362
+ * @returns void
1363
+ * @throws ApiError
1364
+ */
1365
+ resetWorkflow(workflowId: string): CancelablePromise<void>;
1366
+ }
1367
+
1368
+ declare type AssignmentPolicy = {
1369
+ type: string;
1370
+ };
1371
+
1372
+ declare type FFAAssignment = AssignmentPolicy;
1373
+
1374
+ declare type Fixed = (AssignmentPolicy & {
1375
+ assignee?: string;
1376
+ assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1377
+ });
1378
+
1379
+ declare type TimeoutPolicy = {
1380
+ type: string;
1381
+ };
1382
+
1383
+ declare type BackToAssigment = (TimeoutPolicy & {
1384
+ timeoutSeconds?: number;
1385
+ });
1386
+
1387
+ declare type ClearAssigment = (TimeoutPolicy & {
1388
+ timeoutSeconds?: number;
1389
+ });
1390
+
1391
+ declare type Escalate = (TimeoutPolicy & {
1392
+ subjects?: Array<string>;
1393
+ timeoutSeconds?: number;
1394
+ } & {
1395
+ subjects: Array<string>;
1396
+ });
1397
+
1398
+ declare type LeastBusyGroupMemberAssignment = (AssignmentPolicy & {
1399
+ groupId?: string;
1400
+ });
1401
+
1402
+ declare type Never = TimeoutPolicy;
1403
+
1404
+ declare type Terminate = (TimeoutPolicy & {
1405
+ timeoutSeconds?: number;
1406
+ });
1407
+
1408
+ declare type HumanTaskEntry = {
1409
+ assignee?: string;
1410
+ assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1411
+ assignmentPolicy?: (FFAAssignment | Fixed | LeastBusyGroupMemberAssignment);
1412
+ claimedBy?: string;
1413
+ createdBy?: string;
1414
+ createdOn?: number;
1415
+ escalatedAt?: number;
1416
+ output?: Record<string, Record<string, any>>;
1417
+ owners?: Array<string>;
1418
+ predefinedInput?: Record<string, Record<string, any>>;
1419
+ state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT';
1420
+ taskId?: string;
1421
+ taskName?: string;
1422
+ taskRefName?: string;
1423
+ templateId?: string;
1424
+ timeoutPolicy?: (BackToAssigment | ClearAssigment | Escalate | Never | Terminate);
1425
+ workflowId?: string;
1426
+ workflowName?: string;
1427
+ };
1428
+
1429
+ declare type HTScrollableSearchResultHumanTaskEntry = {
1430
+ queryId?: string;
1431
+ results?: Array<HumanTaskEntry>;
1432
+ };
1433
+
1434
+ declare type HumanTaskActionLogEntry = {
1435
+ action?: string;
1436
+ actionTime?: number;
1437
+ cause?: string;
1438
+ id?: string;
1439
+ taskId?: string;
1440
+ taskRefName?: string;
1441
+ workflowId?: string;
1442
+ workflowName?: string;
1443
+ };
1444
+
1445
+ declare type HumanTaskLoad = {
1446
+ assignedUser?: string;
1447
+ count?: number;
1448
+ taskRefName?: string;
1449
+ workflowName?: string;
1450
+ };
1451
+
1452
+ declare type HumanTaskStateLogEntry = {
1453
+ assignee?: string;
1454
+ assigneeType?: 'EXTERNAL_USER' | 'EXTERNAL_GROUP' | 'CONDUCTOR_USER' | 'CONDUCTOR_GROUP';
1455
+ claimedBy?: string;
1456
+ id?: string;
1457
+ state?: 'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT';
1458
+ stateEnd?: number;
1459
+ stateStart?: number;
1460
+ taskId?: string;
1461
+ taskRefName?: string;
1462
+ workflowId?: string;
1463
+ workflowName?: string;
1464
+ };
1465
+
1466
+ declare type HumanTaskTemplate = {
1467
+ jsonSchema: Record<string, Record<string, any>>;
1468
+ name: string;
1469
+ templateUI: Record<string, Record<string, any>>;
1470
+ version?: number;
1471
+ };
1472
+
1473
+ declare type HumanTaskTemplateEntry = {
1474
+ createdBy?: string;
1475
+ createdOn?: number;
1476
+ id?: string;
1477
+ jsonSchema?: Record<string, Record<string, any>>;
1478
+ name?: string;
1479
+ templateUI?: Record<string, Record<string, any>>;
1480
+ updatedBy?: string;
1481
+ updatedOn?: number;
1482
+ version?: number;
1483
+ };
1484
+
1485
+ declare type SearchResultHumanTaskEntry = {
1486
+ results?: Array<HumanTaskEntry>;
1487
+ totalHits?: number;
1488
+ };
1489
+
1490
+ declare class HumanTaskService {
1491
+ readonly httpRequest: BaseHttpRequest;
1492
+ constructor(httpRequest: BaseHttpRequest);
1493
+ /**
1494
+ * List tasks by filters - task name, state, assignee, assignee type, claimed
1495
+ * @param state
1496
+ * @param assignee
1497
+ * @param assigneeType
1498
+ * @param claimedBy
1499
+ * @param taskName
1500
+ * @param freeText
1501
+ * @param includeInputOutput
1502
+ * @returns SearchResultHumanTaskEntry OK
1503
+ * @throws ApiError
1504
+ */
1505
+ 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>;
1506
+ /**
1507
+ * Get task load grouped by workflow name and task ref name per user
1508
+ * @returns HumanTaskLoad OK
1509
+ * @throws ApiError
1510
+ */
1511
+ getTaskLoad(): CancelablePromise<Array<HumanTaskLoad>>;
1512
+ /**
1513
+ * Search human tasks
1514
+ * @param queryId
1515
+ * @param start
1516
+ * @param size
1517
+ * @param freeText
1518
+ * @param query
1519
+ * @param jsonQuery
1520
+ * @param includeInputOutput
1521
+ * @returns HTScrollableSearchResultHumanTaskEntry OK
1522
+ * @throws ApiError
1523
+ */
1524
+ search1(queryId?: string, start?: number, size?: number, freeText?: string, query?: string, jsonQuery?: string, includeInputOutput?: boolean): CancelablePromise<HTScrollableSearchResultHumanTaskEntry>;
1525
+ /**
1526
+ * If the workflow is disconnected from tasks, this API can be used to clean up
1527
+ * @param taskId
1528
+ * @returns any OK
1529
+ * @throws ApiError
1530
+ */
1531
+ updateTaskOutput1(taskId: string): CancelablePromise<any>;
1532
+ /**
1533
+ * Get a task
1534
+ * @param taskId
1535
+ * @returns HumanTaskEntry OK
1536
+ * @throws ApiError
1537
+ */
1538
+ getTask1(taskId: string): CancelablePromise<HumanTaskEntry>;
1539
+ /**
1540
+ * Get human task action log entries by task id
1541
+ * @param taskId
1542
+ * @returns HumanTaskActionLogEntry OK
1543
+ * @throws ApiError
1544
+ */
1545
+ getActionLogs(taskId: string): CancelablePromise<Array<HumanTaskActionLogEntry>>;
1546
+ /**
1547
+ * Claim a task by authenticated Conductor user
1548
+ * @param taskId
1549
+ * @returns any OK
1550
+ * @throws ApiError
1551
+ */
1552
+ claimTask(taskId: string): CancelablePromise<any>;
1553
+ /**
1554
+ * Claim a task to an external user
1555
+ * @param taskId
1556
+ * @param userId
1557
+ * @returns any OK
1558
+ * @throws ApiError
1559
+ */
1560
+ assignAndClaim(taskId: string, userId: string): CancelablePromise<any>;
1561
+ /**
1562
+ * Release a task without completing it
1563
+ * @param taskId
1564
+ * @param requestBody
1565
+ * @returns any OK
1566
+ * @throws ApiError
1567
+ */
1568
+ reassignTask(taskId: string, requestBody: (FFAAssignment | Fixed | LeastBusyGroupMemberAssignment)): CancelablePromise<any>;
1569
+ /**
1570
+ * Release a task without completing it
1571
+ * @param taskId
1572
+ * @returns any OK
1573
+ * @throws ApiError
1574
+ */
1575
+ releaseTask(taskId: string): CancelablePromise<any>;
1576
+ /**
1577
+ * Get human task state log entries by task id
1578
+ * @param taskId
1579
+ * @returns HumanTaskStateLogEntry OK
1580
+ * @throws ApiError
1581
+ */
1582
+ getStateLogs(taskId: string): CancelablePromise<Array<HumanTaskStateLogEntry>>;
1583
+ /**
1584
+ * Update task output, optionally complete
1585
+ * @param taskId
1586
+ * @param requestBody
1587
+ * @param complete
1588
+ * @returns any OK
1589
+ * @throws ApiError
1590
+ */
1591
+ updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, any>>, complete?: boolean): CancelablePromise<any>;
1592
+ /**
1593
+ * Delete human task templates by name
1594
+ * @param name
1595
+ * @returns any OK
1596
+ * @throws ApiError
1597
+ */
1598
+ deleteTemplatesByName(name: string): CancelablePromise<any>;
1599
+ /**
1600
+ * List all human task templates or get templates by name, or a template by name and version
1601
+ * @param name
1602
+ * @param version
1603
+ * @returns HumanTaskTemplateEntry OK
1604
+ * @throws ApiError
1605
+ */
1606
+ getAllTemplates(name?: string, version?: number): CancelablePromise<Array<HumanTaskTemplateEntry>>;
1607
+ /**
1608
+ * Save human task template
1609
+ * @param requestBody
1610
+ * @param newVersion
1611
+ * @returns string OK
1612
+ * @throws ApiError
1613
+ */
1614
+ saveTemplate(requestBody: HumanTaskTemplate, newVersion?: boolean): CancelablePromise<string>;
1615
+ /**
1616
+ * Delete human task template
1617
+ * @param id
1618
+ * @returns any OK
1619
+ * @throws ApiError
1620
+ */
1621
+ deleteTemplateById(id: string): CancelablePromise<any>;
1622
+ /**
1623
+ * Get human task template by id
1624
+ * @param id
1625
+ * @returns HumanTaskTemplateEntry OK
1626
+ * @throws ApiError
1627
+ */
1628
+ getTemplateById(id: string): CancelablePromise<HumanTaskTemplateEntry>;
1629
+ }
1630
+
1631
+ declare class HumanTaskResourceService {
1632
+ readonly httpRequest: BaseHttpRequest;
1633
+ constructor(httpRequest: BaseHttpRequest);
1634
+ /**
1635
+ * Get Conductor task by id (for human tasks only)
1636
+ * @param taskId
1637
+ * @returns Task OK
1638
+ * @throws ApiError
1639
+ */
1640
+ getConductorTaskById(taskId: string): CancelablePromise<Task>;
1641
+ }
1642
+
1643
+ interface ConductorClientAPIConfig extends Omit<OpenAPIConfig, "BASE"> {
1644
+ serverUrl: string;
1645
+ }
1646
+ declare class ConductorClient {
1647
+ readonly eventResource: EventResourceService;
1648
+ readonly healthCheckResource: HealthCheckResourceService;
1649
+ readonly metadataResource: MetadataResourceService;
1650
+ readonly schedulerResource: SchedulerResourceService;
1651
+ readonly taskResource: TaskResourceService;
1652
+ readonly tokenResource: TokenResourceService;
1653
+ readonly workflowBulkResource: WorkflowBulkResourceService;
1654
+ readonly workflowResource: WorkflowResourceService;
1655
+ readonly humanTask: HumanTaskService;
1656
+ readonly humanTaskResource: HumanTaskResourceService;
1657
+ readonly request: BaseHttpRequest;
1658
+ readonly token?: string | Resolver<string>;
1659
+ constructor(config?: Partial<ConductorClientAPIConfig>, requestHandler?: ConductorHttpRequest);
1660
+ }
1661
+
1662
+ declare type ApiResult = {
1663
+ readonly url: string;
1664
+ readonly ok: boolean;
1665
+ readonly status: number;
1666
+ readonly statusText: string;
1667
+ readonly body: any;
1668
+ };
1669
+
1670
+ declare class ApiError extends Error {
1671
+ readonly url: string;
1672
+ readonly status: number;
1673
+ readonly statusText: string;
1674
+ readonly body: any;
1675
+ readonly request: ApiRequestOptions;
1676
+ constructor(request: ApiRequestOptions, response: ApiResult, message: string);
1677
+ }
1678
+
1679
+ /**
1680
+ * Functional interface for defining a worker implementation that processes tasks from a conductor queue.
1681
+ *
1682
+ * @remarks
1683
+ * Optional items allow overriding properties on a per-worker basis. Items not overridden
1684
+ * here will be inherited from the `TaskManager` options.
1685
+ */
1686
+ interface ConductorWorker {
1687
+ taskDefName: string;
1688
+ execute: (task: Task) => Promise<Omit<TaskResult, "workflowInstanceId" | "taskId">>;
1689
+ domain?: string;
1690
+ concurrency?: number;
1691
+ }
1692
+
1693
+ declare type TaskErrorHandler = (error: Error, task?: Task) => void;
1694
+ interface TaskRunnerOptions {
1695
+ workerID: string;
1696
+ domain: string | undefined;
1697
+ pollInterval?: number;
1698
+ concurrency?: number;
1699
+ }
1700
+ interface RunnerArgs {
1701
+ worker: ConductorWorker;
1702
+ taskResource: TaskResourceService;
1703
+ options: Required<TaskRunnerOptions>;
1704
+ logger?: ConductorLogger;
1705
+ onError?: TaskErrorHandler;
1706
+ concurrency?: number;
1707
+ }
1708
+ declare const noopErrorHandler: TaskErrorHandler;
1709
+ /**
1710
+ * Responsible for polling and executing tasks from a queue.
1711
+ *
1712
+ * Because a `poll` in conductor "pops" a task off of a conductor queue,
1713
+ * each runner participates in the poll -> work -> update loop.
1714
+ * We could potentially split this work into a separate "poller" and "worker" pools
1715
+ * but that could lead to picking up more work than the pool of workers are actually able to handle.
1716
+ *
1717
+ */
1718
+ declare class TaskRunner {
1719
+ taskResource: TaskResourceService;
1720
+ worker: ConductorWorker;
1721
+ private logger;
1722
+ private options;
1723
+ errorHandler: TaskErrorHandler;
1724
+ private poller;
1725
+ constructor({ worker, taskResource, options, logger, onError: errorHandler, }: RunnerArgs);
1726
+ get isPolling(): boolean;
1727
+ /**
1728
+ * Starts polling for work
1729
+ */
1730
+ startPolling: () => void;
1731
+ /**
1732
+ * Stops Polling for work
1733
+ */
1734
+ stopPolling: () => void;
1735
+ updateOptions(options: Partial<TaskRunnerOptions>): void;
1736
+ get getOptions(): TaskRunnerOptions;
1737
+ private pollAndExecute;
1738
+ updateTaskWithRetry: (task: Task, taskResult: TaskResult) => Promise<void>;
1739
+ executeTask: (task: Task) => Promise<void>;
1740
+ handleUnknownError: (unknownError: unknown) => void;
1741
+ }
1742
+
1743
+ declare type TaskManagerOptions = TaskRunnerOptions;
1744
+ interface TaskManagerConfig {
1745
+ logger?: ConductorLogger;
1746
+ options?: Partial<TaskManagerOptions>;
1747
+ onError?: TaskErrorHandler;
1748
+ }
1749
+ /**
1750
+ * Responsible for initializing and managing the runners that poll and work different task queues.
1751
+ */
1752
+ declare class TaskManager {
1753
+ private tasks;
1754
+ private readonly client;
1755
+ private readonly logger;
1756
+ private readonly errorHandler;
1757
+ private workers;
1758
+ readonly options: Required<TaskManagerOptions>;
1759
+ private polling;
1760
+ constructor(client: ConductorClient, workers: Array<ConductorWorker>, config?: TaskManagerConfig);
1761
+ private workerManagerWorkerOptions;
1762
+ get isPolling(): boolean;
1763
+ /**
1764
+ * new options will get merged to existing options
1765
+ * @param options new options to update polling options
1766
+ */
1767
+ updatePollingOptions: (options: Partial<TaskManagerOptions>) => void;
1768
+ /**
1769
+ * Start polling for tasks
1770
+ */
1771
+ startPolling: () => void;
1772
+ /**
1773
+ * Stops polling for tasks
1774
+ */
1775
+ stopPolling: () => void;
1776
+ }
1777
+
1778
+ declare class ConductorError extends Error {
1779
+ private _trace;
1780
+ private __proto__;
1781
+ constructor(message?: string, innerError?: Error);
1782
+ }
1783
+ declare type TaskResultStatus = NonNullable<TaskResult['status']>;
1784
+
1785
+ declare class WorkflowExecutor {
1786
+ readonly _client: ConductorClient;
1787
+ constructor(client: ConductorClient);
1788
+ /**
1789
+ * Will persist a workflow in conductor
1790
+ * @param override If true will override the existing workflow with the definition
1791
+ * @param workflow Complete workflow definition
1792
+ * @returns null
1793
+ */
1794
+ registerWorkflow(override: boolean, workflow: WorkflowDef): any;
1795
+ /**
1796
+ * Takes a StartWorkflowRequest. returns a Promise<string> with the workflowInstanceId of the running workflow
1797
+ * @param workflowRequest
1798
+ * @returns
1799
+ */
1800
+ startWorkflow(workflowRequest: StartWorkflowRequest): Promise<string>;
1801
+ /**
1802
+ * Execute a workflow synchronously. returns a Promise<WorkflowRun> with details of the running workflow
1803
+ * @param workflowRequest
1804
+ * @returns
1805
+ */
1806
+ executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef?: string): Promise<WorkflowRun>;
1807
+ startWorkflows(workflowsRequest: StartWorkflowRequest[]): Promise<string>[];
1808
+ /**
1809
+ * Takes an workflowInstanceId and an includeTasks and an optional retry parameter returns the whole execution status.
1810
+ * If includeTasks flag is provided. Details of tasks execution will be returned as well,
1811
+ * retry specifies the amount of retrys before throwing an error.
1812
+ *
1813
+ * @param workflowInstanceId
1814
+ * @param includeTasks
1815
+ * @param retry
1816
+ * @returns
1817
+ */
1818
+ getWorkflow(workflowInstanceId: string, includeTasks: boolean, retry?: number): Promise<Workflow>;
1819
+ /**
1820
+ * Returns a summary of the current workflow status.
1821
+ *
1822
+ * @param workflowInstanceId current running workflow
1823
+ * @param includeOutput flag to include output
1824
+ * @param includeVariables flag to include variable
1825
+ * @returns Promise<WorkflowStatus>
1826
+ */
1827
+ getWorkflowStatus(workflowInstanceId: string, includeOutput: boolean, includeVariables: boolean): any;
1828
+ /**
1829
+ * Pauses a running workflow
1830
+ * @param workflowInstanceId current workflow execution
1831
+ * @returns
1832
+ */
1833
+ pause(workflowInstanceId: string): any;
1834
+ /**
1835
+ * Reruns workflowInstanceId workflow. with new parameters
1836
+ *
1837
+ * @param workflowInstanceId current workflow execution
1838
+ * @param rerunWorkflowRequest Rerun Workflow Execution Request
1839
+ * @returns
1840
+ */
1841
+ reRun(workflowInstanceId: string, rerunWorkflowRequest?: Partial<RerunWorkflowRequest>): any;
1842
+ /**
1843
+ * Restarts workflow with workflowInstanceId, if useLatestDefinition uses last defintion
1844
+ * @param workflowInstanceId
1845
+ * @param useLatestDefinitions
1846
+ * @returns
1847
+ */
1848
+ restart(workflowInstanceId: string, useLatestDefinitions: boolean): any;
1849
+ /**
1850
+ * Resumes a previously paused execution
1851
+ *
1852
+ * @param workflowInstanceId Running workflow workflowInstanceId
1853
+ * @returns
1854
+ */
1855
+ resume(workflowInstanceId: string): any;
1856
+ /**
1857
+ * Retrys workflow from last failing task
1858
+ * if resumeSubworkflowTasks is true will resume tasks in spawned subworkflows
1859
+ *
1860
+ * @param workflowInstanceId
1861
+ * @param resumeSubworkflowTasks
1862
+ * @returns
1863
+ */
1864
+ retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): any;
1865
+ /**
1866
+ * Searches for existing workflows given the following querys
1867
+ *
1868
+ * @param start
1869
+ * @param size
1870
+ * @param query
1871
+ * @param freeText
1872
+ * @param sort
1873
+ * @param skipCache
1874
+ * @returns
1875
+ */
1876
+ search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): any;
1877
+ /**
1878
+ * Skips a task of a running workflow.
1879
+ * by providing a skipTaskRequest you can set the input and the output of the skipped tasks
1880
+ * @param workflowInstanceId
1881
+ * @param taskReferenceName
1882
+ * @param skipTaskRequest
1883
+ * @returns
1884
+ */
1885
+ skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): any;
1886
+ /**
1887
+ * Takes an workflowInstanceId, and terminates a running workflow
1888
+ * @param workflowInstanceId
1889
+ * @param reason
1890
+ * @returns
1891
+ */
1892
+ terminate(workflowInstanceId: string, reason: string): any;
1893
+ /**
1894
+ * Takes a taskId and a workflowInstanceId. Will update the task for the corresponding taskId
1895
+ * @param taskId
1896
+ * @param workflowInstanceId
1897
+ * @param taskStatus
1898
+ * @param taskOutput
1899
+ * @returns
1900
+ */
1901
+ updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: Record<string, any>): any;
1902
+ /**
1903
+ * Updates a task by reference Name
1904
+ * @param taskReferenceName
1905
+ * @param workflowInstanceId
1906
+ * @param status
1907
+ * @param taskOutput
1908
+ * @returns
1909
+ */
1910
+ updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: Record<string, any>): any;
1911
+ /**
1912
+ *
1913
+ * @param taskId
1914
+ * @returns
1915
+ */
1916
+ getTask(taskId: string): Promise<Task>;
1917
+ }
1918
+
1919
+ declare class HumanExecutor {
1920
+ readonly _client: ConductorClient;
1921
+ constructor(client: ConductorClient);
1922
+ /**
1923
+ * Takes a set of filter parameters. return matches of human tasks for that set of parameters
1924
+ * @param state
1925
+ * @param assignee
1926
+ * @param assigneeType
1927
+ * @param claimedBy
1928
+ * @param taskName
1929
+ * @param freeText
1930
+ * @param includeInputOutput
1931
+ * @returns
1932
+ */
1933
+ 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[]>;
1934
+ /**
1935
+ * Returns task for a given task id
1936
+ * @param taskId
1937
+ * @returns
1938
+ */
1939
+ getTaskById(taskId: string): Promise<HumanTaskEntry>;
1940
+ /**
1941
+ * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
1942
+ * @param taskId
1943
+ * @param assignee
1944
+ * @returns
1945
+ */
1946
+ claimTaskAsExternalUser(taskId: string, assignee: string): Promise<void>;
1947
+ /**
1948
+ * Claim task as conductor user
1949
+ * @param taskId
1950
+ * @returns
1951
+ */
1952
+ claimTaskAsConductorUser(taskId: string): Promise<void>;
1953
+ /**
1954
+ * Claim task as conductor user
1955
+ * @param taskId
1956
+ * @param assignee
1957
+ * @returns
1958
+ */
1959
+ releaseTask(taskId: string): Promise<void>;
1960
+ /**
1961
+ * Returns a HumanTaskTemplateEntry for a given templateId
1962
+ * @param templateId
1963
+ * @returns
1964
+ */
1965
+ getTemplateById(templateId: string): Promise<HumanTaskTemplateEntry>;
1966
+ /**
1967
+ * Takes a taskId and a partial body. will update with given body
1968
+ * @param taskId
1969
+ * @param requestBody
1970
+ */
1971
+ updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, any>>): Promise<void>;
1972
+ /**
1973
+ * Takes a taskId and an optional partial body. will complete the task with the given body
1974
+ * @param taskId
1975
+ * @param requestBody
1976
+ */
1977
+ completeTask(taskId: string, requestBody?: Record<string, Record<string, any>>): Promise<void>;
1978
+ }
1979
+
1980
+ declare const doWhileTask: (taskRefName: string, terminationCondition: string, tasks: TaskDefTypes[]) => DoWhileTaskDef;
1981
+ declare const newLoopTask: (taskRefName: string, iterations: number, tasks: TaskDefTypes[]) => DoWhileTaskDef;
1982
+
1983
+ declare const dynamicForkTask: (taskReferenceName: string, preForkTasks?: TaskDefTypes[], dynamicTasksInput?: string) => ForkJoinDynamicDef;
1984
+
1985
+ declare const eventTask: (taskReferenceName: string, eventPrefix: string, eventSuffix: string) => EventTaskDef;
1986
+ declare const sqsEventTask: (taskReferenceName: string, queueName: string) => EventTaskDef;
1987
+ declare const conductorEventTask: (taskReferenceName: string, eventName: string) => EventTaskDef;
1988
+
1989
+ declare const forkTask: (taskReferenceName: string, forkTasks: TaskDefTypes[]) => ForkJoinTaskDef;
1990
+ declare const forkTaskJoin: (taskReferenceName: string, forkTasks: TaskDefTypes[]) => [ForkJoinTaskDef, JoinTaskDef];
1991
+
1992
+ declare const httpTask: (taskReferenceName: string, inputParameters: HttpInputParameters) => HttpTaskDef;
1993
+
1994
+ declare const inlineTask: (taskReferenceName: string, script: string, evaluatorType?: "javascript" | "graaljs") => InlineTaskDef;
1995
+
1996
+ declare const joinTask: (taskReferenceName: string, joinOn: string[]) => JoinTaskDef;
1997
+
1998
+ declare const jsonJqTask: (taskReferenceName: string, script: string) => JsonJQTransformTaskDef;
1999
+
2000
+ declare const kafkaPublishTask: (taskReferenceName: string, kafka_request: KafkaPublishInputParameters) => KafkaPublishTaskDef;
2001
+
2002
+ declare const setVariableTask: (taskReferenceName: string, inputParameters: Record<string, unknown>) => SetVariableTaskDef;
2003
+
2004
+ declare const simpleTask: (taskReferenceName: string, name: string, inputParameters: Record<string, unknown>) => SimpleTaskDef;
2005
+
2006
+ declare const subWorkflowTask: (taskReferenceName: string, workflowName: string, version?: number | undefined) => SubWorkflowTaskDef;
2007
+
2008
+ declare const switchTask: (taskReferenceName: string, expression: string, decisionCases?: Record<string, TaskDefTypes[]>, defaultCase?: TaskDefTypes[]) => SwitchTaskDef;
2009
+
2010
+ declare const terminateTask: (taskReferenceName: string, status: "COMPLETED" | "FAILED", terminationReason?: string | undefined) => TerminateTaskDef;
2011
+
2012
+ declare const waitTaskDuration: (taskReferenceName: string, duration: string) => WaitTaskDef;
2013
+ declare const waitTaskUntil: (taskReferenceName: string, until: string) => WaitTaskDef;
2014
+
2015
+ declare const workflow: (name: string, tasks: TaskDefTypes[]) => WorkflowDef;
2016
+
2017
+ /**
2018
+ * Takes an optional partial SimpleTaskDef
2019
+ * generates a task replacing default values with provided overrides
2020
+ *
2021
+ * @param overrides overrides for defaults
2022
+ * @returns a fully defined task
2023
+ */
2024
+ declare const generateSimpleTask: (overrides?: Partial<SimpleTaskDef>) => SimpleTaskDef;
2025
+
2026
+ /**
2027
+ * Takes an optional partial EventTaskDef
2028
+ * generates a task replacing default/fake values with provided overrides
2029
+ *
2030
+ * @param overrides overrides for defaults
2031
+ * @returns a fully defined task
2032
+ */
2033
+ declare const generateEventTask: (overrides?: Partial<EventTaskDef>) => EventTaskDef;
2034
+
2035
+ declare type TaskDefTypesGen = SimpleTaskDef | DoWhileTaskDefGen | EventTaskDef | ForkJoinTaskDefGen | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDefGen | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDefGen | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
2036
+ interface WorkflowDefGen extends Omit<WorkflowDef, "tasks"> {
2037
+ tasks: Partial<TaskDefTypesGen>[];
2038
+ }
2039
+ declare type ForkJoinTaskDefGen = Omit<ForkJoinTaskDef, "forkTasks"> & {
2040
+ forkTasks: Array<Array<Partial<TaskDefTypesGen>>>;
2041
+ };
2042
+ declare type SwitchTaskDefGen = Omit<SwitchTaskDef, "decisionCases" | "defaultCase"> & {
2043
+ decisionCases: Record<string, Partial<TaskDefTypesGen>[]>;
2044
+ defaultCase: Partial<TaskDefTypesGen>[];
2045
+ };
2046
+ declare type DoWhileTaskDefGen = Omit<DoWhileTaskDef, "loopOver"> & {
2047
+ loopOver: Partial<TaskDefTypesGen>[];
2048
+ };
2049
+ interface InlineTaskInputParametersGen extends Omit<InlineTaskInputParameters, "expression"> {
2050
+ expression: string | Function;
2051
+ }
2052
+ interface InlineTaskDefGen extends Omit<InlineTaskDef, "inputParameters"> {
2053
+ inputParameters: InlineTaskInputParametersGen;
2054
+ }
2055
+ declare type NestedTaskMapper = {
2056
+ (tasks: Partial<TaskDefTypesGen>[]): TaskDefTypes[];
2057
+ };
2058
+
2059
+ declare const generateJoinTask: (overrides?: Partial<JoinTaskDef>) => JoinTaskDef;
2060
+
2061
+ /**
2062
+ * Takes an optional partial HttpTaskDef
2063
+ * generates a task replacing default/fake values with provided overrides
2064
+ *
2065
+ * @param overrides overrides for defaults
2066
+ * @returns a fully defined task
2067
+ */
2068
+ declare const generateHTTPTask: (overrides?: Partial<HttpTaskDef>) => HttpTaskDef;
2069
+
2070
+ /**
2071
+ * Takes an optional partial InlineTaskDefGen
2072
+ * generates a task replacing default/fake values with provided overrides
2073
+ *
2074
+ * <b>note</b> that the inputParameters.expression can be either a string containing javascript
2075
+ * or a function thar returns an ES5 function
2076
+ *
2077
+ * @param overrides overrides for defaults
2078
+ * @returns a fully defined task
2079
+ */
2080
+ declare const generateInlineTask: (override?: Partial<InlineTaskDefGen>) => InlineTaskDef;
2081
+
2082
+ /**
2083
+ * Takes an optional partial JsonJQTransformTaskDef
2084
+ * generates a task replacing default/fake values with provided overrides
2085
+ *
2086
+ * @param overrides overrides for defaults
2087
+ * @returns a fully defined task
2088
+ */
2089
+ declare const generateJQTransformTask: (overrides?: Partial<JsonJQTransformTaskDef>) => JsonJQTransformTaskDef;
2090
+
2091
+ /**
2092
+ * Takes an optional partial KafkaPublishTaskDef
2093
+ * generates a task replacing default/fake values with provided overrides
2094
+ *
2095
+ * @param overrides overrides for defaults
2096
+ * @returns a fully defined task
2097
+ */
2098
+ declare const generateKafkaPublishTask: (overrides?: Partial<KafkaPublishTaskDef>) => KafkaPublishTaskDef;
2099
+
2100
+ /**
2101
+ * Takes an optional partial SubWorkflowTaskDef
2102
+ * generates a task replacing default/fake values with provided overrides
2103
+ *
2104
+ * @param overrides overrides for defaults
2105
+ * @returns a fully defined task
2106
+ */
2107
+ declare const generateSubWorkflowTask: (overrides?: Partial<SubWorkflowTaskDef>) => SubWorkflowTaskDef;
2108
+
2109
+ /**
2110
+ * Takes an optional partial SetVariableTaskDef
2111
+ * generates a task replacing default/fake values with provided overrides
2112
+ *
2113
+ * @param overrides overrides for defaults
2114
+ * @returns a fully defined task
2115
+ */
2116
+ declare const generateSetVariableTask: (overrides?: Partial<SetVariableTaskDef>) => SetVariableTaskDef;
2117
+
2118
+ /**
2119
+ * Takes an optional partial TerminateTaskDef
2120
+ * generates a task replacing default/fake values with provided overrides
2121
+ *
2122
+ * @param overrides overrides for defaults
2123
+ * @returns a fully defined task
2124
+ */
2125
+ declare const generateTerminateTask: (overrides?: Partial<TerminateTaskDef>) => TerminateTaskDef;
2126
+
2127
+ /**
2128
+ * Takes an optional partial WaitTaskDef
2129
+ * generates a task replacing default/fake values with provided overrides
2130
+ *
2131
+ * @param overrides overrides for defaults
2132
+ * @returns a fully defined task
2133
+ */
2134
+ declare const generateWaitTask: (overrides?: Partial<WaitTaskDef>) => WaitTaskDef;
2135
+
2136
+ declare const taskGenMapper: (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
2137
+ /**
2138
+ * Takes an optional partial WorkflowDefGen
2139
+ * generates a workflow replacing default/fake values with provided overrides
2140
+ *
2141
+ * @param overrides overrides for defaults
2142
+ * @returns a fully defined task
2143
+ */
2144
+ declare const generate: (overrides: Partial<WorkflowDefGen>) => WorkflowDef;
2145
+
2146
+ /**
2147
+ * Takes an optional partial SwitchTaskDefGen and an optional nestedMapper
2148
+ * generates a task replacing default/fake values with provided overrides
2149
+ *
2150
+ * @param overrides overrides for defaults
2151
+ * @param nestedTasksMapper function to run on array of nested tasks
2152
+ * @returns a fully defined task
2153
+ */
2154
+ declare const generateSwitchTask: (overrides?: Partial<SwitchTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => SwitchTaskDef;
2155
+ /**
2156
+ * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
2157
+ * generates a task replacing default/fake values with provided overrides
2158
+ *
2159
+ * @param overrides overrides for defaults
2160
+ * @param nestedTasksMapper function to run on array of nested tasks
2161
+ * @returns a fully defined task
2162
+ */
2163
+ declare const generateDoWhileTask: (overrides?: Partial<DoWhileTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => DoWhileTaskDef;
2164
+ /**
2165
+ * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
2166
+ * generates a task replacing default/fake values with provided overrides
2167
+ *
2168
+ * @param overrides overrides for defaults
2169
+ * @param nestedTasksMapper function to run on array of nested tasks
2170
+ * @returns a fully defined task
2171
+ */
2172
+ declare const generateForkJoinTask: (overrides?: Partial<ForkJoinTaskDefGen>, nestedMapper?: NestedTaskMapper) => ForkJoinTaskDef;
2173
+
2174
+ declare type FetchFn<T = RequestInit, R extends {
2175
+ json: () => Promise<any>;
2176
+ } = Response> = (input: RequestInfo, init?: T) => Promise<R>;
2177
+ declare type OrkesApiConfig = ConductorClientAPIConfig & GenerateTokenRequest;
2178
+
2179
+ 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, TaskErrorHandler 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, OpenAPIConfig 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, CancelablePromise as c, TaskRunnerOptions as d, TaskRunner as e, TaskManagerOptions as f, TaskManagerConfig as g, TaskManager as h, ConductorWorker as i, ApiResult as j, ConductorClientAPIConfig 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 };