@io-orkes/conductor-javascript 0.0.7

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