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