@io-orkes/conductor-javascript 2.3.0 → 2.4.1-beta

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,99 +1,373 @@
1
- interface ConductorLogger {
2
- info(...args: unknown[]): void;
3
- error(...args: unknown[]): void;
4
- debug(...args: unknown[]): void;
1
+ type AuthToken = string | undefined;
2
+ interface Auth {
3
+ /**
4
+ * Which part of the request do we use to send the auth?
5
+ *
6
+ * @default 'header'
7
+ */
8
+ in?: 'header' | 'query' | 'cookie';
9
+ /**
10
+ * Header or query parameter name.
11
+ *
12
+ * @default 'Authorization'
13
+ */
14
+ name?: string;
15
+ scheme?: 'basic' | 'bearer';
16
+ type: 'apiKey' | 'http';
5
17
  }
6
- type ConductorLogLevel = keyof typeof LOG_LEVELS;
7
- interface DefaultLoggerConfig {
8
- level?: ConductorLogLevel;
9
- tags?: object[];
18
+
19
+ interface SerializerOptions<T> {
20
+ /**
21
+ * @default true
22
+ */
23
+ explode: boolean;
24
+ style: T;
10
25
  }
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: unknown[]) => void;
22
- debug: (...args: unknown[]) => void;
23
- error: (...args: unknown[]) => void;
26
+ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
27
+ type ObjectStyle = 'form' | 'deepObject';
28
+
29
+ type QuerySerializer = (query: Record<string, unknown>) => string;
30
+ type BodySerializer = (body: any) => any;
31
+ interface QuerySerializerOptions {
32
+ allowReserved?: boolean;
33
+ array?: SerializerOptions<ArrayStyle>;
34
+ object?: SerializerOptions<ObjectStyle>;
24
35
  }
25
- declare const noopLogger: ConductorLogger;
26
36
 
27
- type Action = {
28
- action?: 'start_workflow' | 'complete_task' | 'fail_task' | 'terminate_workflow' | 'update_workflow_variables';
29
- complete_task?: TaskDetails;
30
- expandInlineJSON?: boolean;
31
- fail_task?: TaskDetails;
32
- start_workflow?: StartWorkflowRequest;
33
- terminate_workflow?: TerminateWorkflow;
34
- update_workflow_variables?: UpdateWorkflowVariables;
35
- };
36
- type Any = {
37
- allFields?: {
38
- [key: string]: unknown;
39
- };
40
- defaultInstanceForType?: Any;
41
- descriptorForType?: Descriptor;
42
- initializationErrorString?: string;
43
- initialized?: boolean;
44
- parserForType?: ParserAny;
45
- serializedSize?: number;
46
- typeUrl?: string;
47
- typeUrlBytes?: ByteString;
48
- unknownFields?: UnknownFieldSet;
49
- value?: ByteString;
50
- };
51
- type BulkResponse = {
52
- bulkErrorResults?: {
53
- [key: string]: string;
54
- };
55
- bulkSuccessfulResults?: Array<{
56
- [key: string]: unknown;
57
- }>;
58
- };
59
- type ByteString = {
60
- empty?: boolean;
61
- validUtf8?: boolean;
62
- };
63
- type CacheConfig = {
64
- key?: string;
65
- ttlInSecond?: number;
66
- };
67
- type CircuitBreakerTransitionResponse = {
68
- currentState?: string;
69
- message?: string;
70
- previousState?: string;
71
- service?: string;
72
- transitionTimestamp?: number;
73
- };
74
- type Config$2 = {
75
- circuitBreakerConfig?: OrkesCircuitBreakerConfig;
76
- };
77
- type ConnectivityTestInput = {
78
- input?: {
79
- [key: string]: unknown;
37
+ type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
38
+ type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
39
+ /**
40
+ * Returns the final request URL.
41
+ */
42
+ buildUrl: BuildUrlFn;
43
+ getConfig: () => Config;
44
+ request: RequestFn;
45
+ setConfig: (config: Config) => Config;
46
+ } & {
47
+ [K in HttpMethod]: MethodFn;
48
+ } & ([SseFn] extends [never] ? {
49
+ sse?: never;
50
+ } : {
51
+ sse: {
52
+ [K in HttpMethod]: SseFn;
80
53
  };
81
- sink: string;
54
+ });
55
+ interface Config$2 {
56
+ /**
57
+ * Auth token or a function returning auth token. The resolved value will be
58
+ * added to the request payload as defined by its `security` array.
59
+ */
60
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
61
+ /**
62
+ * A function for serializing request body parameter. By default,
63
+ * {@link JSON.stringify()} will be used.
64
+ */
65
+ bodySerializer?: BodySerializer | null;
66
+ /**
67
+ * An object containing any HTTP headers that you want to pre-populate your
68
+ * `Headers` object with.
69
+ *
70
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
71
+ */
72
+ headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
73
+ /**
74
+ * The request method.
75
+ *
76
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
77
+ */
78
+ method?: Uppercase<HttpMethod>;
79
+ /**
80
+ * A function for serializing request query parameters. By default, arrays
81
+ * will be exploded in form style, objects will be exploded in deepObject
82
+ * style, and reserved characters are percent-encoded.
83
+ *
84
+ * This method will have no effect if the native `paramsSerializer()` Axios
85
+ * API function is used.
86
+ *
87
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
88
+ */
89
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
90
+ /**
91
+ * A function validating request data. This is useful if you want to ensure
92
+ * the request conforms to the desired shape, so it can be safely sent to
93
+ * the server.
94
+ */
95
+ requestValidator?: (data: unknown) => Promise<unknown>;
96
+ /**
97
+ * A function transforming response data before it's returned. This is useful
98
+ * for post-processing data, e.g. converting ISO strings into Date objects.
99
+ */
100
+ responseTransformer?: (data: unknown) => Promise<unknown>;
101
+ /**
102
+ * A function validating response data. This is useful if you want to ensure
103
+ * the response conforms to the desired shape, so it can be safely passed to
104
+ * the transformers and returned to the user.
105
+ */
106
+ responseValidator?: (data: unknown) => Promise<unknown>;
107
+ }
108
+
109
+ type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$2, 'method' | 'responseTransformer' | 'responseValidator'> & {
110
+ /**
111
+ * Fetch API implementation. You can use this option to provide a custom
112
+ * fetch instance.
113
+ *
114
+ * @default globalThis.fetch
115
+ */
116
+ fetch?: typeof fetch;
117
+ /**
118
+ * Implementing clients can call request interceptors inside this hook.
119
+ */
120
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
121
+ /**
122
+ * Callback invoked when a network or parsing error occurs during streaming.
123
+ *
124
+ * This option applies only if the endpoint returns a stream of events.
125
+ *
126
+ * @param error The error that occurred.
127
+ */
128
+ onSseError?: (error: unknown) => void;
129
+ /**
130
+ * Callback invoked when an event is streamed from the server.
131
+ *
132
+ * This option applies only if the endpoint returns a stream of events.
133
+ *
134
+ * @param event Event streamed from the server.
135
+ * @returns Nothing (void).
136
+ */
137
+ onSseEvent?: (event: StreamEvent<TData>) => void;
138
+ serializedBody?: RequestInit['body'];
139
+ /**
140
+ * Default retry delay in milliseconds.
141
+ *
142
+ * This option applies only if the endpoint returns a stream of events.
143
+ *
144
+ * @default 3000
145
+ */
146
+ sseDefaultRetryDelay?: number;
147
+ /**
148
+ * Maximum number of retry attempts before giving up.
149
+ */
150
+ sseMaxRetryAttempts?: number;
151
+ /**
152
+ * Maximum retry delay in milliseconds.
153
+ *
154
+ * Applies only when exponential backoff is used.
155
+ *
156
+ * This option applies only if the endpoint returns a stream of events.
157
+ *
158
+ * @default 30000
159
+ */
160
+ sseMaxRetryDelay?: number;
161
+ /**
162
+ * Optional sleep function for retry backoff.
163
+ *
164
+ * Defaults to using `setTimeout`.
165
+ */
166
+ sseSleepFn?: (ms: number) => Promise<void>;
167
+ url: string;
82
168
  };
83
- type ConnectivityTestResult = {
84
- reason?: string;
85
- successful?: boolean;
86
- workflowId?: string;
169
+ interface StreamEvent<TData = unknown> {
170
+ data: TData;
171
+ event?: string;
172
+ id?: string;
173
+ retry?: number;
174
+ }
175
+ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
176
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
87
177
  };
88
- type Declaration = {
89
- allFields?: {
90
- [key: string]: unknown;
91
- };
92
- defaultInstanceForType?: Declaration;
93
- descriptorForType?: Descriptor;
94
- fullName?: string;
95
- fullNameBytes?: ByteString;
96
- initializationErrorString?: string;
178
+
179
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
180
+ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
181
+ type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
182
+ declare class Interceptors<Interceptor> {
183
+ fns: Array<Interceptor | null>;
184
+ clear(): void;
185
+ eject(id: number | Interceptor): void;
186
+ exists(id: number | Interceptor): boolean;
187
+ getInterceptorIndex(id: number | Interceptor): number;
188
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
189
+ use(fn: Interceptor): number;
190
+ }
191
+ interface Middleware<Req, Res, Err, Options> {
192
+ error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
193
+ request: Interceptors<ReqInterceptor<Req, Options>>;
194
+ response: Interceptors<ResInterceptor<Res, Req, Options>>;
195
+ }
196
+
197
+ type ResponseStyle = 'data' | 'fields';
198
+ interface Config$1<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$2 {
199
+ /**
200
+ * Base URL for all requests made by this client.
201
+ */
202
+ baseUrl?: T['baseUrl'];
203
+ /**
204
+ * Fetch API implementation. You can use this option to provide a custom
205
+ * fetch instance.
206
+ *
207
+ * @default globalThis.fetch
208
+ */
209
+ fetch?: typeof fetch;
210
+ /**
211
+ * Please don't use the Fetch client for Next.js applications. The `next`
212
+ * options won't have any effect.
213
+ *
214
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
215
+ */
216
+ next?: never;
217
+ /**
218
+ * Return the response data parsed in a specified format. By default, `auto`
219
+ * will infer the appropriate method from the `Content-Type` response header.
220
+ * You can override this behavior with any of the {@link Body} methods.
221
+ * Select `stream` if you don't want to parse response data at all.
222
+ *
223
+ * @default 'auto'
224
+ */
225
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
226
+ /**
227
+ * Should we return only data or multiple fields (data, error, response, etc.)?
228
+ *
229
+ * @default 'fields'
230
+ */
231
+ responseStyle?: ResponseStyle;
232
+ /**
233
+ * Throw an error instead of returning it in the response?
234
+ *
235
+ * @default false
236
+ */
237
+ throwOnError?: T['throwOnError'];
238
+ }
239
+ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$1<{
240
+ responseStyle: TResponseStyle;
241
+ throwOnError: ThrowOnError;
242
+ }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
243
+ /**
244
+ * Any body that you want to add to your request.
245
+ *
246
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
247
+ */
248
+ body?: unknown;
249
+ path?: Record<string, unknown>;
250
+ query?: Record<string, unknown>;
251
+ /**
252
+ * Security mechanism(s) to use for the request.
253
+ */
254
+ security?: ReadonlyArray<Auth>;
255
+ url: Url;
256
+ }
257
+ interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
258
+ serializedBody?: string;
259
+ }
260
+ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
261
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
262
+ request: Request;
263
+ response: Response;
264
+ }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
265
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
266
+ error: undefined;
267
+ } | {
268
+ data: undefined;
269
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
270
+ }) & {
271
+ request: Request;
272
+ response: Response;
273
+ }>;
274
+ interface ClientOptions {
275
+ baseUrl?: string;
276
+ responseStyle?: ResponseStyle;
277
+ throwOnError?: boolean;
278
+ }
279
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
280
+ type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
281
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
282
+ type BuildUrlFn = <TData extends {
283
+ body?: unknown;
284
+ path?: Record<string, unknown>;
285
+ query?: Record<string, unknown>;
286
+ url: string;
287
+ }>(options: Pick<TData, 'url'> & Options<TData>) => string;
288
+ type Client = Client$1<RequestFn, Config$1, MethodFn, BuildUrlFn, SseFn> & {
289
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
290
+ };
291
+ interface TDataShape {
292
+ body?: unknown;
293
+ headers?: unknown;
294
+ path?: unknown;
295
+ query?: unknown;
296
+ url: string;
297
+ }
298
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
299
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & Omit<TData, 'url'>;
300
+
301
+ type Action = {
302
+ action?: 'start_workflow' | 'complete_task' | 'fail_task' | 'terminate_workflow' | 'update_workflow_variables';
303
+ complete_task?: TaskDetails;
304
+ expandInlineJSON?: boolean;
305
+ fail_task?: TaskDetails;
306
+ start_workflow?: StartWorkflowRequest;
307
+ terminate_workflow?: TerminateWorkflow;
308
+ update_workflow_variables?: UpdateWorkflowVariables;
309
+ };
310
+ type Any = {
311
+ allFields?: {
312
+ [key: string]: unknown;
313
+ };
314
+ defaultInstanceForType?: Any;
315
+ descriptorForType?: Descriptor;
316
+ initializationErrorString?: string;
317
+ initialized?: boolean;
318
+ parserForType?: ParserAny;
319
+ serializedSize?: number;
320
+ typeUrl?: string;
321
+ typeUrlBytes?: ByteString;
322
+ unknownFields?: UnknownFieldSet;
323
+ value?: ByteString;
324
+ };
325
+ type BulkResponse = {
326
+ bulkErrorResults?: {
327
+ [key: string]: string;
328
+ };
329
+ bulkSuccessfulResults?: Array<{
330
+ [key: string]: unknown;
331
+ }>;
332
+ };
333
+ type ByteString = {
334
+ empty?: boolean;
335
+ validUtf8?: boolean;
336
+ };
337
+ type CacheConfig = {
338
+ key?: string;
339
+ ttlInSecond?: number;
340
+ };
341
+ type CircuitBreakerTransitionResponse = {
342
+ currentState?: string;
343
+ message?: string;
344
+ previousState?: string;
345
+ service?: string;
346
+ transitionTimestamp?: number;
347
+ };
348
+ type Config = {
349
+ circuitBreakerConfig?: OrkesCircuitBreakerConfig;
350
+ };
351
+ type ConnectivityTestInput = {
352
+ input?: {
353
+ [key: string]: unknown;
354
+ };
355
+ sink: string;
356
+ };
357
+ type ConnectivityTestResult = {
358
+ reason?: string;
359
+ successful?: boolean;
360
+ workflowId?: string;
361
+ };
362
+ type Declaration = {
363
+ allFields?: {
364
+ [key: string]: unknown;
365
+ };
366
+ defaultInstanceForType?: Declaration;
367
+ descriptorForType?: Descriptor;
368
+ fullName?: string;
369
+ fullNameBytes?: ByteString;
370
+ initializationErrorString?: string;
97
371
  initialized?: boolean;
98
372
  number?: number;
99
373
  parserForType?: ParserDeclaration;
@@ -477,6 +751,15 @@ type EventMessage = {
477
751
  status?: 'RECEIVED' | 'HANDLED' | 'REJECTED';
478
752
  statusDescription?: string;
479
753
  };
754
+ type ExtendedConductorApplication$1 = {
755
+ createTime?: number;
756
+ createdBy?: string;
757
+ id?: string;
758
+ name?: string;
759
+ tags?: Array<Tag>;
760
+ updateTime?: number;
761
+ updatedBy?: string;
762
+ };
480
763
  type ExtendedEventExecution = {
481
764
  action?: 'start_workflow' | 'complete_task' | 'fail_task' | 'terminate_workflow' | 'update_workflow_variables';
482
765
  created?: number;
@@ -1714,7 +1997,7 @@ type ServiceOptionsOrBuilder = {
1714
1997
  };
1715
1998
  type ServiceRegistry = {
1716
1999
  circuitBreakerEnabled?: boolean;
1717
- config?: Config$2;
2000
+ config?: Config;
1718
2001
  methods?: Array<ServiceMethod>;
1719
2002
  name?: string;
1720
2003
  requestParams?: Array<RequestParam>;
@@ -1786,7 +2069,7 @@ type StartWorkflowRequest = {
1786
2069
  [key: string]: string;
1787
2070
  };
1788
2071
  version?: number;
1789
- workflowDef?: WorkflowDef$1;
2072
+ workflowDef?: WorkflowDef;
1790
2073
  };
1791
2074
  type StateChangeEvent = {
1792
2075
  payload?: {
@@ -2061,12 +2344,12 @@ type Workflow = {
2061
2344
  variables?: {
2062
2345
  [key: string]: unknown;
2063
2346
  };
2064
- workflowDefinition?: WorkflowDef$1;
2347
+ workflowDefinition?: WorkflowDef;
2065
2348
  workflowId?: string;
2066
2349
  workflowName?: string;
2067
2350
  workflowVersion?: number;
2068
2351
  };
2069
- type WorkflowDef$1 = {
2352
+ type WorkflowDef = {
2070
2353
  cacheConfig?: CacheConfig;
2071
2354
  createTime?: number;
2072
2355
  createdBy?: string;
@@ -2267,383 +2550,83 @@ type WorkflowTask = {
2267
2550
  type?: string;
2268
2551
  };
2269
2552
 
2270
- type AuthToken = string | undefined;
2271
- interface Auth {
2272
- /**
2273
- * Which part of the request do we use to send the auth?
2274
- *
2275
- * @default 'header'
2276
- */
2277
- in?: 'header' | 'query' | 'cookie';
2278
- /**
2279
- * Header or query parameter name.
2280
- *
2281
- * @default 'Authorization'
2282
- */
2283
- name?: string;
2284
- scheme?: 'basic' | 'bearer';
2285
- type: 'apiKey' | 'http';
2553
+ interface CommonTaskDef {
2554
+ name: string;
2555
+ taskReferenceName: string;
2286
2556
  }
2287
-
2288
- interface SerializerOptions<T> {
2289
- /**
2290
- * @default true
2291
- */
2292
- explode: boolean;
2293
- style: T;
2557
+ declare enum Consistency {
2558
+ SYNCHRONOUS = "SYNCHRONOUS",
2559
+ DURABLE = "DURABLE",
2560
+ REGION_DURABLE = "REGION_DURABLE"
2294
2561
  }
2295
- type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
2296
- type ObjectStyle = 'form' | 'deepObject';
2297
-
2298
- type QuerySerializer = (query: Record<string, unknown>) => string;
2299
- type BodySerializer = (body: any) => any;
2300
- interface QuerySerializerOptions {
2301
- allowReserved?: boolean;
2302
- array?: SerializerOptions<ArrayStyle>;
2303
- object?: SerializerOptions<ObjectStyle>;
2562
+ declare enum ReturnStrategy {
2563
+ TARGET_WORKFLOW = "TARGET_WORKFLOW",
2564
+ BLOCKING_WORKFLOW = "BLOCKING_WORKFLOW",
2565
+ BLOCKING_TASK = "BLOCKING_TASK",
2566
+ BLOCKING_TASK_INPUT = "BLOCKING_TASK_INPUT"
2304
2567
  }
2305
-
2306
- type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
2307
- type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
2308
- /**
2309
- * Returns the final request URL.
2310
- */
2311
- buildUrl: BuildUrlFn;
2312
- getConfig: () => Config;
2313
- request: RequestFn;
2314
- setConfig: (config: Config) => Config;
2315
- } & {
2316
- [K in HttpMethod]: MethodFn;
2317
- } & ([SseFn] extends [never] ? {
2318
- sse?: never;
2319
- } : {
2320
- sse: {
2321
- [K in HttpMethod]: SseFn;
2322
- };
2323
- });
2324
- interface Config$1 {
2325
- /**
2326
- * Auth token or a function returning auth token. The resolved value will be
2327
- * added to the request payload as defined by its `security` array.
2328
- */
2329
- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
2330
- /**
2331
- * A function for serializing request body parameter. By default,
2332
- * {@link JSON.stringify()} will be used.
2333
- */
2334
- bodySerializer?: BodySerializer | null;
2335
- /**
2336
- * An object containing any HTTP headers that you want to pre-populate your
2337
- * `Headers` object with.
2338
- *
2339
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
2340
- */
2341
- headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
2342
- /**
2343
- * The request method.
2344
- *
2345
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
2346
- */
2347
- method?: Uppercase<HttpMethod>;
2348
- /**
2349
- * A function for serializing request query parameters. By default, arrays
2350
- * will be exploded in form style, objects will be exploded in deepObject
2351
- * style, and reserved characters are percent-encoded.
2352
- *
2353
- * This method will have no effect if the native `paramsSerializer()` Axios
2354
- * API function is used.
2355
- *
2356
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
2357
- */
2358
- querySerializer?: QuerySerializer | QuerySerializerOptions;
2359
- /**
2360
- * A function validating request data. This is useful if you want to ensure
2361
- * the request conforms to the desired shape, so it can be safely sent to
2362
- * the server.
2363
- */
2364
- requestValidator?: (data: unknown) => Promise<unknown>;
2365
- /**
2366
- * A function transforming response data before it's returned. This is useful
2367
- * for post-processing data, e.g. converting ISO strings into Date objects.
2368
- */
2369
- responseTransformer?: (data: unknown) => Promise<unknown>;
2370
- /**
2371
- * A function validating response data. This is useful if you want to ensure
2372
- * the response conforms to the desired shape, so it can be safely passed to
2373
- * the transformers and returned to the user.
2374
- */
2375
- responseValidator?: (data: unknown) => Promise<unknown>;
2568
+ declare enum TaskResultStatusEnum {
2569
+ IN_PROGRESS = "IN_PROGRESS",
2570
+ FAILED = "FAILED",
2571
+ FAILED_WITH_TERMINAL_ERROR = "FAILED_WITH_TERMINAL_ERROR",
2572
+ COMPLETED = "COMPLETED"
2376
2573
  }
2377
-
2378
- type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
2379
- /**
2380
- * Fetch API implementation. You can use this option to provide a custom
2381
- * fetch instance.
2382
- *
2383
- * @default globalThis.fetch
2384
- */
2385
- fetch?: typeof fetch;
2386
- /**
2387
- * Implementing clients can call request interceptors inside this hook.
2388
- */
2389
- onRequest?: (url: string, init: RequestInit) => Promise<Request>;
2390
- /**
2391
- * Callback invoked when a network or parsing error occurs during streaming.
2392
- *
2393
- * This option applies only if the endpoint returns a stream of events.
2394
- *
2395
- * @param error The error that occurred.
2396
- */
2397
- onSseError?: (error: unknown) => void;
2398
- /**
2399
- * Callback invoked when an event is streamed from the server.
2400
- *
2401
- * This option applies only if the endpoint returns a stream of events.
2402
- *
2403
- * @param event Event streamed from the server.
2404
- * @returns Nothing (void).
2405
- */
2406
- onSseEvent?: (event: StreamEvent<TData>) => void;
2407
- serializedBody?: RequestInit['body'];
2408
- /**
2409
- * Default retry delay in milliseconds.
2410
- *
2411
- * This option applies only if the endpoint returns a stream of events.
2412
- *
2413
- * @default 3000
2414
- */
2415
- sseDefaultRetryDelay?: number;
2416
- /**
2417
- * Maximum number of retry attempts before giving up.
2418
- */
2419
- sseMaxRetryAttempts?: number;
2420
- /**
2421
- * Maximum retry delay in milliseconds.
2422
- *
2423
- * Applies only when exponential backoff is used.
2424
- *
2425
- * This option applies only if the endpoint returns a stream of events.
2426
- *
2427
- * @default 30000
2428
- */
2429
- sseMaxRetryDelay?: number;
2430
- /**
2431
- * Optional sleep function for retry backoff.
2432
- *
2433
- * Defaults to using `setTimeout`.
2434
- */
2435
- sseSleepFn?: (ms: number) => Promise<void>;
2436
- url: string;
2437
- };
2438
- interface StreamEvent<TData = unknown> {
2439
- data: TData;
2440
- event?: string;
2441
- id?: string;
2442
- retry?: number;
2574
+ declare enum TaskType {
2575
+ START = "START",
2576
+ SIMPLE = "SIMPLE",
2577
+ DYNAMIC = "DYNAMIC",
2578
+ FORK_JOIN = "FORK_JOIN",
2579
+ FORK_JOIN_DYNAMIC = "FORK_JOIN_DYNAMIC",
2580
+ DECISION = "DECISION",
2581
+ SWITCH = "SWITCH",
2582
+ JOIN = "JOIN",
2583
+ DO_WHILE = "DO_WHILE",
2584
+ SUB_WORKFLOW = "SUB_WORKFLOW",
2585
+ EVENT = "EVENT",
2586
+ WAIT = "WAIT",
2587
+ USER_DEFINED = "USER_DEFINED",
2588
+ HTTP = "HTTP",
2589
+ LAMBDA = "LAMBDA",
2590
+ INLINE = "INLINE",
2591
+ EXCLUSIVE_JOIN = "EXCLUSIVE_JOIN",
2592
+ TERMINAL = "TERMINAL",
2593
+ TERMINATE = "TERMINATE",
2594
+ KAFKA_PUBLISH = "KAFKA_PUBLISH",
2595
+ JSON_JQ_TRANSFORM = "JSON_JQ_TRANSFORM",
2596
+ SET_VARIABLE = "SET_VARIABLE"
2443
2597
  }
2444
- type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
2445
- stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
2446
- };
2447
-
2448
- type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
2449
- type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
2450
- type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
2451
- declare class Interceptors<Interceptor> {
2452
- fns: Array<Interceptor | null>;
2453
- clear(): void;
2454
- eject(id: number | Interceptor): void;
2455
- exists(id: number | Interceptor): boolean;
2456
- getInterceptorIndex(id: number | Interceptor): number;
2457
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
2458
- use(fn: Interceptor): number;
2598
+ declare enum ServiceType {
2599
+ HTTP = "HTTP",
2600
+ MCP_REMOTE = "MCP_REMOTE",
2601
+ gRPC = "gRPC"
2459
2602
  }
2460
- interface Middleware<Req, Res, Err, Options> {
2461
- error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
2462
- request: Interceptors<ReqInterceptor<Req, Options>>;
2463
- response: Interceptors<ResInterceptor<Res, Req, Options>>;
2603
+ type TaskDefTypes = SimpleTaskDef | DoWhileTaskDef | EventTaskDef | ForkJoinTaskDef | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDef | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDef | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
2604
+ interface DoWhileTaskDef extends CommonTaskDef {
2605
+ inputParameters: Record<string, unknown>;
2606
+ type: TaskType.DO_WHILE;
2607
+ startDelay?: number;
2608
+ optional?: boolean;
2609
+ asyncComplete?: boolean;
2610
+ loopCondition: string;
2611
+ loopOver: TaskDefTypes[];
2464
2612
  }
2465
-
2466
- type ResponseStyle = 'data' | 'fields';
2467
- interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
2468
- /**
2469
- * Base URL for all requests made by this client.
2470
- */
2471
- baseUrl?: T['baseUrl'];
2472
- /**
2473
- * Fetch API implementation. You can use this option to provide a custom
2474
- * fetch instance.
2475
- *
2476
- * @default globalThis.fetch
2477
- */
2478
- fetch?: typeof fetch;
2479
- /**
2480
- * Please don't use the Fetch client for Next.js applications. The `next`
2481
- * options won't have any effect.
2482
- *
2483
- * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
2484
- */
2485
- next?: never;
2486
- /**
2487
- * Return the response data parsed in a specified format. By default, `auto`
2488
- * will infer the appropriate method from the `Content-Type` response header.
2489
- * You can override this behavior with any of the {@link Body} methods.
2490
- * Select `stream` if you don't want to parse response data at all.
2491
- *
2492
- * @default 'auto'
2493
- */
2494
- parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
2495
- /**
2496
- * Should we return only data or multiple fields (data, error, response, etc.)?
2497
- *
2498
- * @default 'fields'
2499
- */
2500
- responseStyle?: ResponseStyle;
2501
- /**
2502
- * Throw an error instead of returning it in the response?
2503
- *
2504
- * @default false
2505
- */
2506
- throwOnError?: T['throwOnError'];
2613
+ interface EventTaskDef extends CommonTaskDef {
2614
+ type: TaskType.EVENT;
2615
+ sink: string;
2616
+ asyncComplete?: boolean;
2617
+ optional?: boolean;
2507
2618
  }
2508
- interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
2509
- responseStyle: TResponseStyle;
2510
- throwOnError: ThrowOnError;
2511
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
2512
- /**
2513
- * Any body that you want to add to your request.
2514
- *
2515
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
2516
- */
2517
- body?: unknown;
2518
- path?: Record<string, unknown>;
2519
- query?: Record<string, unknown>;
2520
- /**
2521
- * Security mechanism(s) to use for the request.
2522
- */
2523
- security?: ReadonlyArray<Auth>;
2524
- url: Url;
2619
+ interface ForkJoinTaskDef extends CommonTaskDef {
2620
+ type: TaskType.FORK_JOIN;
2621
+ inputParameters?: Record<string, string>;
2622
+ forkTasks: TaskDefTypes[][];
2525
2623
  }
2526
- interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
2527
- serializedBody?: string;
2528
- }
2529
- type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
2530
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
2531
- request: Request;
2532
- response: Response;
2533
- }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
2534
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
2535
- error: undefined;
2536
- } | {
2537
- data: undefined;
2538
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
2539
- }) & {
2540
- request: Request;
2541
- response: Response;
2542
- }>;
2543
- interface ClientOptions {
2544
- baseUrl?: string;
2545
- responseStyle?: ResponseStyle;
2546
- throwOnError?: boolean;
2547
- }
2548
- type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
2549
- type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
2550
- type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
2551
- type BuildUrlFn = <TData extends {
2552
- body?: unknown;
2553
- path?: Record<string, unknown>;
2554
- query?: Record<string, unknown>;
2555
- url: string;
2556
- }>(options: Pick<TData, 'url'> & Options<TData>) => string;
2557
- type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
2558
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
2559
- };
2560
- interface TDataShape {
2561
- body?: unknown;
2562
- headers?: unknown;
2563
- path?: unknown;
2564
- query?: unknown;
2565
- url: string;
2566
- }
2567
- type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
2568
- type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & Omit<TData, 'url'>;
2569
-
2570
- interface CommonTaskDef {
2571
- name: string;
2572
- taskReferenceName: string;
2573
- }
2574
- declare enum Consistency {
2575
- SYNCHRONOUS = "SYNCHRONOUS",
2576
- DURABLE = "DURABLE",
2577
- REGION_DURABLE = "REGION_DURABLE"
2578
- }
2579
- declare enum ReturnStrategy {
2580
- TARGET_WORKFLOW = "TARGET_WORKFLOW",
2581
- BLOCKING_WORKFLOW = "BLOCKING_WORKFLOW",
2582
- BLOCKING_TASK = "BLOCKING_TASK",
2583
- BLOCKING_TASK_INPUT = "BLOCKING_TASK_INPUT"
2584
- }
2585
- declare enum TaskResultStatusEnum {
2586
- IN_PROGRESS = "IN_PROGRESS",
2587
- FAILED = "FAILED",
2588
- FAILED_WITH_TERMINAL_ERROR = "FAILED_WITH_TERMINAL_ERROR",
2589
- COMPLETED = "COMPLETED"
2590
- }
2591
- declare enum TaskType {
2592
- START = "START",
2593
- SIMPLE = "SIMPLE",
2594
- DYNAMIC = "DYNAMIC",
2595
- FORK_JOIN = "FORK_JOIN",
2596
- FORK_JOIN_DYNAMIC = "FORK_JOIN_DYNAMIC",
2597
- DECISION = "DECISION",
2598
- SWITCH = "SWITCH",
2599
- JOIN = "JOIN",
2600
- DO_WHILE = "DO_WHILE",
2601
- SUB_WORKFLOW = "SUB_WORKFLOW",
2602
- EVENT = "EVENT",
2603
- WAIT = "WAIT",
2604
- USER_DEFINED = "USER_DEFINED",
2605
- HTTP = "HTTP",
2606
- LAMBDA = "LAMBDA",
2607
- INLINE = "INLINE",
2608
- EXCLUSIVE_JOIN = "EXCLUSIVE_JOIN",
2609
- TERMINAL = "TERMINAL",
2610
- TERMINATE = "TERMINATE",
2611
- KAFKA_PUBLISH = "KAFKA_PUBLISH",
2612
- JSON_JQ_TRANSFORM = "JSON_JQ_TRANSFORM",
2613
- SET_VARIABLE = "SET_VARIABLE"
2614
- }
2615
- declare enum ServiceType {
2616
- HTTP = "HTTP",
2617
- MCP_REMOTE = "MCP_REMOTE",
2618
- gRPC = "gRPC"
2619
- }
2620
- type TaskDefTypes = SimpleTaskDef | DoWhileTaskDef | EventTaskDef | ForkJoinTaskDef | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDef | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDef | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
2621
- interface DoWhileTaskDef extends CommonTaskDef {
2622
- inputParameters: Record<string, unknown>;
2623
- type: TaskType.DO_WHILE;
2624
- startDelay?: number;
2625
- optional?: boolean;
2626
- asyncComplete?: boolean;
2627
- loopCondition: string;
2628
- loopOver: TaskDefTypes[];
2629
- }
2630
- interface EventTaskDef extends CommonTaskDef {
2631
- type: TaskType.EVENT;
2632
- sink: string;
2633
- asyncComplete?: boolean;
2634
- optional?: boolean;
2635
- }
2636
- interface ForkJoinTaskDef extends CommonTaskDef {
2637
- type: TaskType.FORK_JOIN;
2638
- inputParameters?: Record<string, string>;
2639
- forkTasks: TaskDefTypes[][];
2640
- }
2641
- interface JoinTaskDef extends CommonTaskDef {
2642
- type: TaskType.JOIN;
2643
- inputParameters?: Record<string, string>;
2644
- joinOn: string[];
2645
- optional?: boolean;
2646
- asyncComplete?: boolean;
2624
+ interface JoinTaskDef extends CommonTaskDef {
2625
+ type: TaskType.JOIN;
2626
+ inputParameters?: Record<string, string>;
2627
+ joinOn: string[];
2628
+ optional?: boolean;
2629
+ asyncComplete?: boolean;
2647
2630
  }
2648
2631
  interface ForkJoinDynamicDef extends CommonTaskDef {
2649
2632
  inputParameters: {
@@ -2775,6 +2758,19 @@ interface SignalResponse extends SignalResponse$1 {
2775
2758
  taskDefName?: string;
2776
2759
  workflowType?: string;
2777
2760
  }
2761
+ interface AccessKey {
2762
+ id: string;
2763
+ secret: string;
2764
+ }
2765
+ interface AccessKeyInfo {
2766
+ id: string;
2767
+ createdAt: number;
2768
+ status: "ACTIVE" | "INACTIVE";
2769
+ }
2770
+ type ApplicationRole = "ADMIN" | "UNRESTRICTED_WORKER" | "METADATA_MANAGER" | "WORKFLOW_MANAGER" | "APPLICATION_MANAGER" | "USER" | "USER_READ_ONLY" | "WORKER" | "APPLICATION_CREATOR" | "METADATA_API" | "PROMPT_MANAGER";
2771
+ interface ExtendedConductorApplication extends Required<Omit<ExtendedConductorApplication$1, "tags">> {
2772
+ tags?: Tag[];
2773
+ }
2778
2774
 
2779
2775
  type TimeoutPolicy = {
2780
2776
  type: string;
@@ -2870,609 +2866,842 @@ declare abstract class BaseHttpRequest {
2870
2866
  abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
2871
2867
  }
2872
2868
 
2873
- /**
2874
- * Functional interface for defining a worker implementation that processes tasks from a conductor queue.
2875
- *
2876
- * @remarks
2877
- * Optional items allow overriding properties on a per-worker basis. Items not overridden
2878
- * here will be inherited from the `TaskManager` options.
2879
- */
2880
- interface ConductorWorker {
2881
- taskDefName: string;
2882
- execute: (task: Task) => Promise<Omit<TaskResult, "workflowInstanceId" | "taskId">>;
2883
- domain?: string;
2884
- concurrency?: number;
2885
- pollInterval?: number;
2886
- }
2887
-
2888
- type TaskErrorHandler = (error: Error, task?: Task) => void;
2889
- interface TaskRunnerOptions {
2890
- workerID: string;
2891
- domain: string | undefined;
2892
- pollInterval?: number;
2893
- concurrency?: number;
2894
- batchPollingTimeout?: number;
2895
- }
2896
- interface RunnerArgs {
2897
- worker: ConductorWorker;
2898
- client: Client;
2899
- options: TaskRunnerOptions;
2900
- logger?: ConductorLogger;
2901
- onError?: TaskErrorHandler;
2902
- concurrency?: number;
2903
- maxRetries?: number;
2869
+ type TaskResultStatus = NonNullable<TaskResult["status"]>;
2870
+ type TaskResultOutputData = NonNullable<TaskResult["outputData"]>;
2871
+ interface OrkesApiConfig {
2872
+ serverUrl?: string;
2873
+ keyId?: string;
2874
+ keySecret?: string;
2875
+ refreshTokenInterval?: number;
2876
+ useEnvVars?: boolean;
2877
+ maxHttp2Connections?: number;
2904
2878
  }
2905
2879
 
2906
- declare const MAX_RETRIES = 3;
2907
- declare const noopErrorHandler: TaskErrorHandler;
2908
2880
  /**
2909
- * Responsible for polling and executing tasks from a queue.
2910
- *
2911
- * Because a `poll` in conductor "pops" a task off of a conductor queue,
2912
- * each runner participates in the poll -> work -> update loop.
2913
- * We could potentially split this work into a separate "poller" and "worker" pools
2914
- * but that could lead to picking up more work than the pool of workers are actually able to handle.
2881
+ * Creates a Conductor client with authentication and configuration
2915
2882
  *
2883
+ * @param config (optional) OrkesApiConfig with keyId and keySecret
2884
+ * @param customFetch (optional) custom fetch function
2885
+ * @returns Client
2916
2886
  */
2917
- declare class TaskRunner {
2918
- _client: Client;
2919
- worker: ConductorWorker;
2920
- private logger;
2921
- private options;
2922
- errorHandler: TaskErrorHandler;
2923
- private poller;
2924
- private maxRetries;
2925
- constructor({ worker, client, options, logger, onError: errorHandler, maxRetries, }: RunnerArgs);
2926
- get isPolling(): boolean;
2927
- /**
2928
- * Starts polling for work
2929
- */
2930
- startPolling: () => void;
2931
- /**
2932
- * Stops Polling for work
2933
- */
2934
- stopPolling: () => Promise<void>;
2935
- updateOptions(options: Partial<TaskRunnerOptions>): void;
2936
- get getOptions(): TaskRunnerOptions;
2937
- private batchPoll;
2938
- updateTaskWithRetry: (task: Task, taskResult: TaskResult) => Promise<void>;
2939
- private executeTask;
2940
- handleUnknownError: (unknownError: unknown) => void;
2941
- }
2942
-
2943
- type TaskManagerOptions = TaskRunnerOptions;
2944
- interface TaskManagerConfig {
2945
- logger?: ConductorLogger;
2946
- options?: Partial<TaskManagerOptions>;
2947
- onError?: TaskErrorHandler;
2948
- maxRetries?: number;
2949
- }
2950
- /**
2951
- * Responsible for initializing and managing the runners that poll and work different task queues.
2952
- */
2953
- declare class TaskManager {
2954
- private workerRunners;
2955
- private readonly client;
2956
- private readonly logger;
2957
- private readonly errorHandler;
2958
- private workers;
2959
- readonly options: Required<TaskManagerOptions>;
2960
- private polling;
2961
- private maxRetries;
2962
- constructor(client: Client, workers: ConductorWorker[], config?: TaskManagerConfig);
2963
- private workerManagerWorkerOptions;
2964
- get isPolling(): boolean;
2965
- updatePollingOptionForWorker: (workerTaskDefName: string, options: Partial<TaskManagerOptions>) => void;
2966
- /**
2967
- * new options will get merged to existing options
2968
- * @param options new options to update polling options
2969
- */
2970
- updatePollingOptions: (options: Partial<TaskManagerOptions>) => void;
2971
- sanityCheck: () => void;
2972
- /**
2973
- * Start polling for tasks
2974
- */
2975
- startPolling: () => void;
2976
- /**
2977
- * Stops polling for tasks
2978
- */
2979
- stopPolling: () => Promise<void>;
2980
- }
2981
-
2982
- declare class ConductorSdkError extends Error {
2983
- private _trace;
2984
- private __proto__;
2985
- constructor(message?: string, innerError?: Error);
2986
- }
2987
- type TaskResultStatus = NonNullable<TaskResult["status"]>;
2988
- type TaskResultOutputData = NonNullable<TaskResult["outputData"]>;
2989
- interface EnhancedSignalResponse extends SignalResponse {
2990
- isTargetWorkflow(): boolean;
2991
- isBlockingWorkflow(): boolean;
2992
- isBlockingTask(): boolean;
2993
- isBlockingTaskInput(): boolean;
2994
- getWorkflow(): Workflow;
2995
- getBlockingTask(): Task;
2996
- getTaskInput(): Record<string, unknown>;
2997
- getWorkflowId(): string;
2998
- getTargetWorkflowId(): string;
2999
- hasWorkflowData(): boolean;
3000
- hasTaskData(): boolean;
3001
- getResponseType(): string;
3002
- isTerminal(): boolean;
3003
- isRunning(): boolean;
3004
- isPaused(): boolean;
3005
- getSummary(): string;
3006
- toDebugJSON(): Record<string, unknown>;
3007
- toString(): string;
3008
- }
2887
+ declare const createConductorClient: (config?: OrkesApiConfig, customFetch?: typeof fetch) => Promise<{
2888
+ eventResource: {
2889
+ getQueueConfig: (queueType: string, queueName: string) => Promise<{
2890
+ [key: string]: unknown;
2891
+ }>;
2892
+ putQueueConfig: (queueType: string, queueName: string, body: string) => Promise<void>;
2893
+ deleteQueueConfig: (queueType: string, queueName: string) => Promise<void>;
2894
+ getEventHandlers: () => Promise<EventHandler[]>;
2895
+ updateEventHandler: (body: any) => Promise<void>;
2896
+ addEventHandler: (body: any) => Promise<void>;
2897
+ getQueueNames: () => Promise<{
2898
+ [key: string]: string;
2899
+ }>;
2900
+ removeEventHandlerStatus: (name: string) => Promise<void>;
2901
+ getEventHandlersForEvent: (event: string, activeOnly?: boolean) => Promise<EventHandler[]>;
2902
+ deleteTagForEventHandler: (name: string, body: any[]) => Promise<void>;
2903
+ getTagsForEventHandler: (name: string) => Promise<Tag[]>;
2904
+ putTagForEventHandler: (name: string, body: any[]) => Promise<void>;
2905
+ };
2906
+ healthCheckResource: {
2907
+ doCheck: () => Promise<{
2908
+ [key: string]: unknown;
2909
+ }>;
2910
+ };
2911
+ metadataResource: {
2912
+ getTaskDef: (tasktype: string, metadata?: boolean) => Promise<{
2913
+ [key: string]: unknown;
2914
+ }>;
2915
+ unregisterTaskDef: (tasktype: string) => Promise<void>;
2916
+ getAllWorkflows: (access?: string, metadata?: boolean, tagKey?: string, tagValue?: string) => Promise<WorkflowDef[]>;
2917
+ update: (requestBody: any[], overwrite?: boolean) => Promise<void>;
2918
+ create: (requestBody: any, overwrite?: boolean) => Promise<void>;
2919
+ getTaskDefs: (access?: string, metadata?: boolean, tagKey?: string, tagValue?: string) => Promise<TaskDef[]>;
2920
+ updateTaskDef: (requestBody: any) => Promise<void>;
2921
+ registerTaskDef: (requestBody: any[]) => Promise<void>;
2922
+ unregisterWorkflowDef: (name: string, version: number) => Promise<void>;
2923
+ get: (name: string, version?: number, metadata?: boolean) => Promise<WorkflowDef>;
2924
+ };
2925
+ schedulerResource: {
2926
+ getSchedule: (name: string) => Promise<WorkflowSchedule>;
2927
+ deleteSchedule: (name: string) => Promise<void>;
2928
+ getNextFewSchedules: (cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, limit?: number) => Promise<number[]>;
2929
+ pauseSchedule: (name: string) => Promise<void>;
2930
+ pauseAllSchedules: () => Promise<{
2931
+ [key: string]: unknown;
2932
+ }>;
2933
+ resumeSchedule: (name: string) => Promise<void>;
2934
+ requeueAllExecutionRecords: () => Promise<{
2935
+ [key: string]: unknown;
2936
+ }>;
2937
+ resumeAllSchedules: () => Promise<{
2938
+ [key: string]: unknown;
2939
+ }>;
2940
+ getAllSchedules: (workflowName?: string) => Promise<WorkflowScheduleModel[]>;
2941
+ saveSchedule: (requestBody: any) => Promise<void>;
2942
+ searchV21: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<SearchResultWorkflowScheduleExecutionModel>;
2943
+ testTimeout: () => Promise<any>;
2944
+ };
2945
+ tokenResource: {
2946
+ generateToken: (requestBody: any) => Promise<Response$1>;
2947
+ getUserInfo: (claims?: boolean) => Promise<{
2948
+ [key: string]: unknown;
2949
+ }>;
2950
+ };
2951
+ workflowBulkResource: {
2952
+ retry: (requestBody: any[]) => Promise<BulkResponse>;
2953
+ restart: (requestBody: any[], useLatestDefinitions?: boolean) => Promise<BulkResponse>;
2954
+ terminate: (requestBody: any[], reason?: string) => Promise<BulkResponse>;
2955
+ resumeWorkflow: (requestBody: any[]) => Promise<BulkResponse>;
2956
+ pauseWorkflow1: (requestBody: any[]) => Promise<BulkResponse>;
2957
+ };
2958
+ workflowResource: {
2959
+ getRunningWorkflow: (name: string, version?: number, startTime?: number, endTime?: number) => Promise<string[]>;
2960
+ executeWorkflow: (body: any, name: string, version: number, requestId?: string, waitUntilTaskRef?: string, waitForSeconds?: number, consistency?: any, returnStrategy?: any) => Promise<SignalResponse$1>;
2961
+ startWorkflow: (requestBody: any) => Promise<string>;
2962
+ decide: (workflowId: string) => Promise<void>;
2963
+ rerun: (workflowId: string, requestBody: any) => Promise<string>;
2964
+ searchV21: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
2965
+ pauseWorkflow: (workflowId: string) => Promise<void>;
2966
+ skipTaskFromWorkflow: (workflowId: string, taskReferenceName: string, requestBody?: any) => Promise<void>;
2967
+ getWorkflows: (name: string, requestBody: any[], includeClosed?: boolean, includeTasks?: boolean) => Promise<{
2968
+ [key: string]: Workflow[];
2969
+ }>;
2970
+ getWorkflowStatusSummary: (workflowId: string, includeOutput?: boolean, includeVariables?: boolean) => Promise<WorkflowStatus>;
2971
+ getWorkflows1: (name: string, correlationId: string, includeClosed?: boolean, includeTasks?: boolean) => Promise<Workflow[]>;
2972
+ retry1: (workflowId: string, resumeSubworkflowTasks?: boolean) => Promise<void>;
2973
+ getExecutionStatus: (workflowId: string, includeTasks?: boolean) => Promise<Workflow>;
2974
+ terminate1: (workflowId: string, reason?: string) => Promise<void>;
2975
+ resumeWorkflow: (workflowId: string) => Promise<void>;
2976
+ delete: (workflowId: string, archiveWorkflow?: boolean) => Promise<void>;
2977
+ searchWorkflowsByTasks: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
2978
+ getExternalStorageLocation: (path: string, operation: string, payloadType: string) => Promise<any>;
2979
+ startWorkflow1: (name: string, requestBody: any, version?: number, correlationId?: string, priority?: number) => Promise<string>;
2980
+ restart1: (workflowId: string, useLatestDefinitions?: boolean) => Promise<void>;
2981
+ search1: (queryId?: string, start?: number, size?: number, sort?: string, freeText?: string, query?: string, skipCache?: boolean) => Promise<any>;
2982
+ searchWorkflowsByTasksV2: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
2983
+ resetWorkflow: (workflowId: string) => Promise<void>;
2984
+ testWorkflow: (requestBody: any) => Promise<Workflow>;
2985
+ };
2986
+ serviceRegistryResource: {
2987
+ getRegisteredServices: () => Promise<ServiceRegistry[]>;
2988
+ removeService: (name: string) => Promise<void>;
2989
+ getService: (name: string) => Promise<ServiceRegistry>;
2990
+ openCircuitBreaker: (name: string) => Promise<CircuitBreakerTransitionResponse>;
2991
+ closeCircuitBreaker: (name: string) => Promise<CircuitBreakerTransitionResponse>;
2992
+ getCircuitBreakerStatus: (name: string) => Promise<CircuitBreakerTransitionResponse>;
2993
+ addOrUpdateService: (serviceRegistry: any) => Promise<void>;
2994
+ addOrUpdateServiceMethod: (registryName: string, method: any) => Promise<void>;
2995
+ removeMethod: (registryName: string, serviceName: string, method: string, methodType: string) => Promise<void>;
2996
+ getProtoData: (registryName: string, filename: string) => Promise<string>;
2997
+ setProtoData: (registryName: string, filename: string, data: any) => Promise<void>;
2998
+ deleteProto: (registryName: string, filename: string) => Promise<void>;
2999
+ getAllProtos: (registryName: string) => Promise<ProtoRegistryEntry[]>;
3000
+ discover: (name: string, create?: boolean) => Promise<ServiceMethod[]>;
3001
+ };
3002
+ humanTaskResource: {
3003
+ getConductorTaskById: (taskId: string) => Promise<Task>;
3004
+ };
3005
+ humanTask: {
3006
+ deleteTaskFromHumanTaskRecords: (requestBody: any[]) => Promise<void>;
3007
+ deleteTaskFromHumanTaskRecords1: (taskId: string) => Promise<void>;
3008
+ search: (requestBody: any) => Promise<HumanTaskSearchResult>;
3009
+ updateTaskOutputByRef: (workflowId: string, taskRefName: string, requestBody: any, complete?: boolean, iteration?: any[]) => Promise<any>;
3010
+ getTask1: (taskId: string) => Promise<HumanTaskEntry>;
3011
+ claimTask: (taskId: string, overrideAssignment?: boolean, withTemplate?: boolean) => Promise<HumanTaskEntry>;
3012
+ assignAndClaim: (taskId: string, userId: string, overrideAssignment?: boolean, withTemplate?: boolean) => Promise<HumanTaskEntry>;
3013
+ reassignTask: (taskId: string, requestBody: any[]) => Promise<void>;
3014
+ releaseTask: (taskId: string) => Promise<void>;
3015
+ skipTask: (taskId: string, reason?: string) => Promise<void>;
3016
+ updateTaskOutput: (taskId: string, requestBody: any, complete?: boolean) => Promise<void>;
3017
+ getAllTemplates: (name?: string, version?: number) => Promise<HumanTaskTemplate[]>;
3018
+ saveTemplate: (requestBody: any, newVersion?: boolean) => Promise<HumanTaskTemplate>;
3019
+ saveTemplates: (requestBody: any[], newVersion?: boolean) => Promise<HumanTaskTemplate[]>;
3020
+ deleteTemplateByName: (name: string) => Promise<void>;
3021
+ deleteTemplatesByNameAndVersion: (name: string, version: number) => Promise<void>;
3022
+ getTemplateByNameAndVersion: (name: string, version: number) => Promise<HumanTaskTemplate>;
3023
+ };
3024
+ taskResource: {
3025
+ poll: (tasktype: string, workerid?: string, domain?: string) => Promise<Task>;
3026
+ allVerbose: () => Promise<{
3027
+ [key: string]: {
3028
+ [key: string]: {
3029
+ [key: string]: number;
3030
+ };
3031
+ };
3032
+ }>;
3033
+ updateTask: (workflowId: string, taskRefName: string, status: "IN_PROGRESS" | "FAILED" | "FAILED_WITH_TERMINAL_ERROR" | "COMPLETED", requestBody: any) => Promise<string>;
3034
+ getTask: (taskId: string) => Promise<Task>;
3035
+ all: () => Promise<{
3036
+ [key: string]: number;
3037
+ }>;
3038
+ requeuePendingTask: (taskType: string) => Promise<string>;
3039
+ search: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<SearchResultTaskSummary>;
3040
+ searchV22: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
3041
+ getPollData: (taskType: string) => Promise<PollData[]>;
3042
+ getTaskLogs: (taskId: string) => Promise<TaskExecLog[]>;
3043
+ log: (taskId: string, requestBody: string) => Promise<void>;
3044
+ getAllPollData: () => Promise<{
3045
+ [key: string]: unknown;
3046
+ }>;
3047
+ batchPoll: (tasktype: string, workerid?: string, domain?: string, count?: number, timeout?: number) => Promise<Task[]>;
3048
+ updateTask1: (requestBody: any) => Promise<string>;
3049
+ size1: (taskType?: string[]) => Promise<{
3050
+ [key: string]: number;
3051
+ }>;
3052
+ getExternalStorageLocation1: (path: string, operation: string, payloadType: string) => Promise<any>;
3053
+ updateTaskSync: (workflowId: string, taskRefName: string, status: any, output: any, workerId?: string) => Promise<Workflow>;
3054
+ signal: (workflowId: string, status: any, output: any, returnStrategy?: any) => Promise<SignalResponse$1>;
3055
+ signalAsync: (workflowId: string, status: any, output: any) => Promise<SignalResponse>;
3056
+ };
3057
+ buildUrl: <TData extends {
3058
+ body?: unknown;
3059
+ path?: Record<string, unknown>;
3060
+ query?: Record<string, unknown>;
3061
+ url: string;
3062
+ }>(options: Pick<TData, "url"> & Options<TData>) => string;
3063
+ getConfig: () => Config$1<ClientOptions>;
3064
+ request: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3065
+ setConfig: (config: Config$1<ClientOptions>) => Config$1<ClientOptions>;
3066
+ connect: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3067
+ delete: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3068
+ get: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3069
+ head: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3070
+ options: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3071
+ patch: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3072
+ post: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3073
+ put: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3074
+ trace: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
3075
+ sse: {
3076
+ connect: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3077
+ delete: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3078
+ get: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3079
+ head: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3080
+ options: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3081
+ patch: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3082
+ post: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3083
+ put: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3084
+ trace: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
3085
+ };
3086
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
3087
+ }>;
3009
3088
 
3010
- type TaskFinderPredicate = (task: Task) => boolean;
3011
- declare const completedTaskMatchingType: (taskType: string) => TaskFinderPredicate;
3012
- declare class WorkflowExecutor {
3089
+ declare class ApplicationClient {
3013
3090
  readonly _client: Client;
3014
3091
  constructor(client: Client);
3015
3092
  /**
3016
- * Will persist a workflow in conductor
3017
- * @param override If true will override the existing workflow with the definition
3018
- * @param workflow Complete workflow definition
3019
- * @returns null
3093
+ * Get all applications
3094
+ * @returns {Promise<ExtendedConductorApplication[]>}
3095
+ * @throws {ConductorSdkError}
3020
3096
  */
3021
- registerWorkflow(override: boolean, workflow: WorkflowDef$1): Promise<void>;
3097
+ getAllApplications(): Promise<ExtendedConductorApplication[]>;
3022
3098
  /**
3023
- * Takes a StartWorkflowRequest. returns a Promise<string> with the workflowInstanceId of the running workflow
3024
- * @param workflowRequest
3025
- * @returns
3099
+ * Create an application
3100
+ * @param {string} applicationName
3101
+ * @returns {Promise<ExtendedConductorApplication>}
3102
+ * @throws {ConductorSdkError}
3026
3103
  */
3027
- startWorkflow(workflowRequest: StartWorkflowRequest): Promise<string>;
3104
+ createApplication(applicationName: string): Promise<ExtendedConductorApplication>;
3028
3105
  /**
3029
- * Execute a workflow synchronously (original method - backward compatible)
3106
+ * Get application by access key id
3107
+ * @param {string} accessKeyId
3108
+ * @returns {Promise<ExtendedConductorApplication>}
3109
+ * @throws {ConductorSdkError}
3030
3110
  */
3031
- executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef?: string): Promise<WorkflowRun>;
3111
+ getAppByAccessKeyId(accessKeyId: string): Promise<ExtendedConductorApplication>;
3032
3112
  /**
3033
- * Execute a workflow with return strategy support (new method)
3113
+ * Delete an access key
3114
+ * @param {string} applicationId
3115
+ * @param {string} keyId
3116
+ * @returns {Promise<void>}
3117
+ * @throws {ConductorSdkError}
3034
3118
  */
3035
- executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef: string, waitForSeconds: number, consistency: Consistency, returnStrategy: ReturnStrategy): Promise<EnhancedSignalResponse>;
3036
- startWorkflows(workflowsRequest: StartWorkflowRequest[]): Promise<string>[];
3037
- goBackToTask(workflowInstanceId: string, taskFinderPredicate: TaskFinderPredicate, rerunWorkflowRequestOverrides?: Partial<RerunWorkflowRequest>): Promise<void>;
3038
- goBackToFirstTaskMatchingType(workflowInstanceId: string, taskType: string): Promise<void>;
3119
+ deleteAccessKey(applicationId: string, keyId: string): Promise<void>;
3039
3120
  /**
3040
- * Takes an workflowInstanceId and an includeTasks and an optional retry parameter returns the whole execution status.
3041
- * If includeTasks flag is provided. Details of tasks execution will be returned as well,
3042
- * retry specifies the amount of retrys before throwing an error.
3043
- *
3044
- * @param workflowInstanceId
3045
- * @param includeTasks
3046
- * @param retry
3047
- * @returns
3121
+ * Toggle the status of an access key
3122
+ * @param {string} applicationId
3123
+ * @param {string} keyId
3124
+ * @returns {Promise<AccessKeyInfo>}
3125
+ * @throws {ConductorSdkError}
3048
3126
  */
3049
- getWorkflow(workflowInstanceId: string, includeTasks: boolean, retry?: number): Promise<Workflow>;
3127
+ toggleAccessKeyStatus(applicationId: string, keyId: string): Promise<AccessKeyInfo>;
3050
3128
  /**
3051
- * Returns a summary of the current workflow status.
3052
- *
3053
- * @param workflowInstanceId current running workflow
3054
- * @param includeOutput flag to include output
3055
- * @param includeVariables flag to include variable
3056
- * @returns Promise<WorkflowStatus>
3129
+ * Remove role from application user
3130
+ * @param {string} applicationId
3131
+ * @param {string} role
3132
+ * @returns {Promise<void>}
3133
+ * @throws {ConductorSdkError}
3057
3134
  */
3058
- getWorkflowStatus(workflowInstanceId: string, includeOutput: boolean, includeVariables: boolean): Promise<WorkflowStatus>;
3135
+ removeRoleFromApplicationUser(applicationId: string, role: string): Promise<void>;
3059
3136
  /**
3060
- * Returns a summary of the current workflow status.
3061
- *
3062
- * @param workflowInstanceId current running workflow
3063
- * @param includeOutput flag to include output
3064
- * @param includeVariables flag to include variable
3065
- * @returns Promise<WorkflowStatus>
3137
+ * Add role to application
3138
+ * @param {string} applicationId
3139
+ * @param {ApplicationRole} role
3140
+ * @returns {Promise<void>}
3141
+ * @throws {ConductorSdkError}
3066
3142
  */
3067
- getExecution(workflowInstanceId: string, includeTasks?: boolean): Promise<Workflow>;
3143
+ addApplicationRole(applicationId: string, role: ApplicationRole): Promise<void>;
3068
3144
  /**
3069
- * Pauses a running workflow
3070
- * @param workflowInstanceId current workflow execution
3071
- * @returns
3145
+ * Delete an application
3146
+ * @param {string} applicationId
3147
+ * @returns {Promise<void>}
3148
+ * @throws {ConductorSdkError}
3072
3149
  */
3073
- pause(workflowInstanceId: string): Promise<void>;
3150
+ deleteApplication(applicationId: string): Promise<void>;
3074
3151
  /**
3075
- * Reruns workflowInstanceId workflow. with new parameters
3076
- *
3077
- * @param workflowInstanceId current workflow execution
3078
- * @param rerunWorkflowRequest Rerun Workflow Execution Request
3079
- * @returns
3152
+ * Get an application by id
3153
+ * @param {string} applicationId
3154
+ * @returns {Promise<ExtendedConductorApplication>}
3155
+ * @throws {ConductorSdkError}
3080
3156
  */
3081
- reRun(workflowInstanceId: string, rerunWorkflowRequest?: Partial<RerunWorkflowRequest>): Promise<string>;
3157
+ getApplication(applicationId: string): Promise<ExtendedConductorApplication>;
3082
3158
  /**
3083
- * Restarts workflow with workflowInstanceId, if useLatestDefinition uses last defintion
3084
- * @param workflowInstanceId
3085
- * @param useLatestDefinitions
3086
- * @returns
3159
+ * Update an application
3160
+ * @param {string} applicationId
3161
+ * @param {string} newApplicationName
3162
+ * @returns {Promise<ExtendedConductorApplication>}
3163
+ * @throws {ConductorSdkError}
3087
3164
  */
3088
- restart(workflowInstanceId: string, useLatestDefinitions: boolean): Promise<void>;
3165
+ updateApplication(applicationId: string, newApplicationName: string): Promise<ExtendedConductorApplication>;
3089
3166
  /**
3090
- * Resumes a previously paused execution
3091
- *
3092
- * @param workflowInstanceId Running workflow workflowInstanceId
3093
- * @returns
3167
+ * Get application's access keys
3168
+ * @param {string} applicationId
3169
+ * @returns {Promise<AccessKeyInfo[]>}
3170
+ * @throws {ConductorSdkError}
3094
3171
  */
3095
- resume(workflowInstanceId: string): Promise<void>;
3172
+ getAccessKeys(applicationId: string): Promise<AccessKeyInfo[]>;
3096
3173
  /**
3097
- * Retrys workflow from last failing task
3098
- * if resumeSubworkflowTasks is true will resume tasks in spawned subworkflows
3099
- *
3100
- * @param workflowInstanceId
3101
- * @param resumeSubworkflowTasks
3102
- * @returns
3174
+ * Create an access key for an application
3175
+ * @param {string} applicationId
3176
+ * @returns {Promise<AccessKey>}
3177
+ * @throws {ConductorSdkError}
3103
3178
  */
3104
- retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): Promise<void>;
3179
+ createAccessKey(applicationId: string): Promise<AccessKey>;
3105
3180
  /**
3106
- * Searches for existing workflows given the following querys
3107
- *
3108
- * @param start
3109
- * @param size
3110
- * @param query
3111
- * @param freeText
3112
- * @param sort
3113
- * @param skipCache
3114
- * @returns
3181
+ * Delete application tags
3182
+ * @param {string} applicationId
3183
+ * @param {Tag[]} tags
3184
+ * @returns {Promise<void>}
3185
+ * @throws {ConductorSdkError}
3115
3186
  */
3116
- search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): Promise<ScrollableSearchResultWorkflowSummary>;
3187
+ deleteApplicationTags(applicationId: string, tags: Tag[]): Promise<void>;
3117
3188
  /**
3118
- * Skips a task of a running workflow.
3119
- * by providing a skipTaskRequest you can set the input and the output of the skipped tasks
3120
- * @param workflowInstanceId
3121
- * @param taskReferenceName
3122
- * @param skipTaskRequest
3123
- * @returns
3189
+ * Delete a single application tag
3190
+ * @param {string} applicationId
3191
+ * @param {Tag} tag
3192
+ * @returns {Promise<void>}
3193
+ * @throws {ConductorSdkError}
3124
3194
  */
3125
- skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): Promise<void>;
3195
+ deleteApplicationTag(applicationId: string, tag: Tag): Promise<void>;
3126
3196
  /**
3127
- * Takes an workflowInstanceId, and terminates a running workflow
3128
- * @param workflowInstanceId
3129
- * @param reason
3130
- * @returns
3197
+ * Get application tags
3198
+ * @param {string} applicationId
3199
+ * @returns {Promise<Tag[]>}
3200
+ * @throws {ConductorSdkError}
3131
3201
  */
3132
- terminate(workflowInstanceId: string, reason: string): Promise<void>;
3202
+ getApplicationTags(applicationId: string): Promise<Tag[]>;
3133
3203
  /**
3134
- * Takes a taskId and a workflowInstanceId. Will update the task for the corresponding taskId
3135
- * @param taskId
3136
- * @param workflowInstanceId
3137
- * @param taskStatus
3138
- * @param taskOutput
3139
- * @returns
3204
+ * Add application tags
3205
+ * @param {string} applicationId
3206
+ * @param {Tag[]} tags
3207
+ * @returns {Promise<void>}
3208
+ * @throws {ConductorSdkError}
3140
3209
  */
3141
- updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: TaskResultOutputData): Promise<string>;
3210
+ addApplicationTags(applicationId: string, tags: Tag[]): Promise<void>;
3142
3211
  /**
3143
- * Updates a task by reference Name
3144
- * @param taskReferenceName
3145
- * @param workflowInstanceId
3146
- * @param status
3147
- * @param taskOutput
3148
- * @returns
3212
+ * Add a single application tag
3213
+ * @param {string} applicationId
3214
+ * @param {Tag} tag
3215
+ * @returns {Promise<void>}
3216
+ * @throws {ConductorSdkError}
3149
3217
  */
3150
- updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: TaskResultOutputData): Promise<string>;
3218
+ addApplicationTag(applicationId: string, tag: Tag): Promise<void>;
3219
+ }
3220
+
3221
+ declare class EventClient {
3222
+ readonly _client: Client;
3223
+ constructor(client: Client);
3151
3224
  /**
3152
- *
3153
- * @param taskId
3154
- * @returns
3225
+ * Get all the event handlers
3226
+ * @returns {Promise<EventHandler[]>}
3227
+ * @throws {ConductorSdkError}
3155
3228
  */
3156
- getTask(taskId: string): Promise<Task>;
3229
+ getAllEventHandlers(): Promise<EventHandler[]>;
3157
3230
  /**
3158
- * Updates a task by reference name synchronously and returns the complete workflow
3159
- * @param taskReferenceName
3160
- * @param workflowInstanceId
3161
- * @param status
3162
- * @param taskOutput
3163
- * @param workerId - Optional
3164
- * @returns Promise<Workflow>
3231
+ * Add event handlers
3232
+ * @param {EventHandler[]} eventHandlers
3233
+ * @returns {Promise<void>}
3234
+ * @throws {ConductorSdkError}
3165
3235
  */
3166
- updateTaskSync(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, workerId?: string): Promise<Workflow>;
3236
+ addEventHandlers(eventHandlers: EventHandler[]): Promise<void>;
3167
3237
  /**
3168
- * Signals a workflow task and returns data based on the specified return strategy
3169
- * @param workflowInstanceId - Workflow instance ID to signal
3170
- * @param status - Task status to set
3171
- * @param taskOutput - Output data for the task
3172
- * @param returnStrategy - Optional strategy for what data to return (defaults to TARGET_WORKFLOW)
3173
- * @returns Promise<SignalResponse> with data based on the return strategy
3238
+ * Add an event handler
3239
+ * @param {EventHandler} eventHandler
3240
+ * @returns {Promise<void>}
3241
+ * @throws {ConductorSdkError}
3174
3242
  */
3175
- signal(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, returnStrategy?: ReturnStrategy): Promise<EnhancedSignalResponse>;
3243
+ addEventHandler(eventHandler: EventHandler): Promise<void>;
3176
3244
  /**
3177
- * Signals a workflow task asynchronously (fire-and-forget)
3178
- * @param workflowInstanceId - Workflow instance ID to signal
3179
- * @param status - Task status to set
3180
- * @param taskOutput - Output data for the task
3181
- * @returns Promise<void>
3245
+ * Update an event handler
3246
+ * @param {EventHandler} eventHandler
3247
+ * @returns {Promise<void>}
3248
+ * @throws {ConductorSdkError}
3182
3249
  */
3183
- signalAsync(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData): Promise<void>;
3184
- }
3185
-
3186
- interface PollIntervalOptions {
3187
- pollInterval: number;
3188
- maxPollTimes: number;
3189
- }
3190
- declare class HumanExecutor {
3191
- readonly _client: Client;
3192
- constructor(client: Client);
3250
+ updateEventHandler(eventHandler: EventHandler): Promise<void>;
3193
3251
  /**
3194
- * @deprecated use search instead
3195
- * Takes a set of filter parameters. return matches of human tasks for that set of parameters
3196
- * @param state
3197
- * @param assignee
3198
- * @param assigneeType
3199
- * @param claimedBy
3200
- * @param taskName
3201
- * @param freeText
3202
- * @param includeInputOutput
3203
- * @returns
3252
+ * Handle an incoming event
3253
+ * @param {Record<string, string>} data
3254
+ * @returns {Promise<void>}
3255
+ * @throws {ConductorSdkError}
3204
3256
  */
3205
- getTasksByFilter(state: "PENDING" | "ASSIGNED" | "IN_PROGRESS" | "COMPLETED" | "TIMED_OUT", assignee?: string, assigneeType?: "EXTERNAL_USER" | "EXTERNAL_GROUP" | "CONDUCTOR_USER" | "CONDUCTOR_GROUP", claimedBy?: string, taskName?: string, taskInputQuery?: string, taskOutputQuery?: string): Promise<HumanTaskEntry[]>;
3257
+ handleIncomingEvent(data: Record<string, string>): Promise<void>;
3206
3258
  /**
3207
- * Takes a set of filter parameters. return matches of human tasks for that set of parameters
3208
- * @param state
3209
- * @param assignee
3210
- * @param assigneeType
3211
- * @param claimedBy
3212
- * @param taskName
3213
- * @param freeText
3214
- * @param includeInputOutput
3215
- * @returns Promise<HumanTaskEntry[]>
3259
+ * Get an event handler by name
3260
+ * @param {string} eventHandlerName
3261
+ * @returns {Promise<EventHandler>}
3262
+ * @throws {ConductorSdkError}
3216
3263
  */
3217
- search(searchParams: Partial<HumanTaskSearch>): Promise<HumanTaskEntry[]>;
3264
+ getEventHandlerByName(eventHandlerName: string): Promise<EventHandler>;
3218
3265
  /**
3219
- * Takes a set of filter parameters. An polling interval options. will poll until the task returns a result
3220
- * @param state
3221
- * @param assignee
3222
- * @param assigneeType
3223
- * @param claimedBy
3224
- * @param taskName
3225
- * @param freeText
3226
- * @param includeInputOutput
3227
- * @returns Promise<HumanTaskEntry[]>
3266
+ * Get all queue configs
3267
+ * @returns {Promise<Record<string, string>>}
3268
+ * @throws {ConductorSdkError}
3228
3269
  */
3229
- pollSearch(searchParams: Partial<HumanTaskSearch>, { pollInterval, maxPollTimes, }?: PollIntervalOptions): Promise<HumanTaskEntry[]>;
3270
+ getAllQueueConfigs(): Promise<Record<string, string>>;
3230
3271
  /**
3231
- * Returns task for a given task id
3232
- * @param taskId
3233
- * @returns
3272
+ * Delete queue config
3273
+ * @param {string} queueType
3274
+ * @param {string} queueName
3275
+ * @returns {Promise<void>}
3276
+ * @throws {ConductorSdkError}
3234
3277
  */
3235
- getTaskById(taskId: string): Promise<HumanTaskEntry>;
3278
+ deleteQueueConfig(queueType: string, queueName: string): Promise<void>;
3236
3279
  /**
3237
- * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
3238
- * @param taskId
3239
- * @param assignee
3240
- * @returns
3280
+ * Get queue config
3281
+ * @param {string} queueType
3282
+ * @param {string} queueName
3283
+ * @returns {Promise<Record<string, unknown>>}
3284
+ * @throws {ConductorSdkError}
3241
3285
  */
3242
- claimTaskAsExternalUser(taskId: string, assignee: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3286
+ getQueueConfig(queueType: string, queueName: string): Promise<Record<string, unknown>>;
3243
3287
  /**
3244
- * Claim task as conductor user
3245
- * @param taskId
3246
- * @returns
3288
+ * Get event handlers for a given event
3289
+ * @param {string} event
3290
+ * @param {boolean} [activeOnly=false] Only return active handlers.
3291
+ * @returns {Promise<EventHandler[]>}
3292
+ * @throws {ConductorSdkError}
3247
3293
  */
3248
- claimTaskAsConductorUser(taskId: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3294
+ getEventHandlersForEvent(event: string, activeOnly?: boolean): Promise<EventHandler[]>;
3249
3295
  /**
3250
- * Claim task as conductor user
3251
- * @param taskId
3252
- * @param assignee
3253
- * @returns
3296
+ * Remove an event handler by name
3297
+ * @param {string} name
3298
+ * @returns {Promise<void>}
3299
+ * @throws {ConductorSdkError}
3254
3300
  */
3255
- releaseTask(taskId: string): Promise<void>;
3301
+ removeEventHandler(name: string): Promise<void>;
3256
3302
  /**
3257
- * Returns a HumanTaskTemplateEntry for a given name and version
3258
- * @param templateId
3259
- * @returns
3303
+ * Get tags for an event handler
3304
+ * @param {string} name
3305
+ * @returns {Promise<Tag[]>}
3306
+ * @throws {ConductorSdkError}
3260
3307
  */
3261
- getTemplateByNameVersion(name: string, version: number): Promise<HumanTaskTemplate>;
3308
+ getTagsForEventHandler(name: string): Promise<Tag[]>;
3262
3309
  /**
3263
- * @deprecated use getTemplate instead. name will be used as id here with version 1
3264
- * Returns a HumanTaskTemplateEntry for a given templateId
3265
- * @param templateId
3266
- * @returns
3310
+ * Put tags for an event handler
3311
+ * @param {string} name
3312
+ * @param {Tag[]} tags
3313
+ * @returns {Promise<void>}
3314
+ * @throws {ConductorSdkError}
3267
3315
  */
3268
- getTemplateById(templateNameVersionOne: string): Promise<HumanTaskTemplate>;
3316
+ putTagForEventHandler(name: string, tags: Tag[]): Promise<void>;
3269
3317
  /**
3270
- * Takes a taskId and a partial body. will update with given body
3271
- * @param taskId
3272
- * @param requestBody
3318
+ * Delete tags for an event handler
3319
+ * @param {string} name
3320
+ * @param {Tag[]} tags
3321
+ * @returns {Promise<void>}
3322
+ * @throws {ConductorSdkError}
3273
3323
  */
3274
- updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, unknown>>): Promise<void>;
3324
+ deleteTagsForEventHandler(name: string, tags: Tag[]): Promise<void>;
3275
3325
  /**
3276
- * Takes a taskId and an optional partial body. will complete the task with the given body
3277
- * @param taskId
3278
- * @param requestBody
3326
+ * Delete a tag for an event handler
3327
+ * @param {string} name
3328
+ * @param {Tag} tag
3329
+ * @returns {Promise<void>}
3330
+ * @throws {ConductorSdkError}
3279
3331
  */
3280
- completeTask(taskId: string, requestBody?: Record<string, Record<string, unknown>>): Promise<void>;
3332
+ deleteTagForEventHandler(name: string, tag: Tag): Promise<void>;
3333
+ /**
3334
+ * Test connectivity for a given queue using a workflow with EVENT task and an EventHandler
3335
+ * @param {ConnectivityTestInput} input
3336
+ * @returns {Promise<ConnectivityTestResult>}
3337
+ * @throws {ConductorSdkError}
3338
+ */
3339
+ testConnectivity(input: ConnectivityTestInput): Promise<ConnectivityTestResult>;
3340
+ /**
3341
+ * Create or update queue config by name
3342
+ * @deprecated Prefer server's newer endpoints if available
3343
+ * @param {string} queueType
3344
+ * @param {string} queueName
3345
+ * @param {string} config
3346
+ * @returns {Promise<void>}
3347
+ * @throws {ConductorSdkError}
3348
+ */
3349
+ putQueueConfig(queueType: string, queueName: string, config: string): Promise<void>;
3350
+ /**
3351
+ * Test endpoint (as exposed by API)
3352
+ * @returns {Promise<EventHandler>}
3353
+ * @throws {ConductorSdkError}
3354
+ */
3355
+ test(): Promise<EventHandler>;
3356
+ /**
3357
+ * Get all active event handlers (execution view)
3358
+ * @returns {Promise<SearchResultHandledEventResponse>}
3359
+ * @throws {ConductorSdkError}
3360
+ */
3361
+ getAllActiveEventHandlers(): Promise<SearchResultHandledEventResponse>;
3362
+ /**
3363
+ * Get event executions for a specific handler
3364
+ * @param {string} eventHandlerName
3365
+ * @param {number} [from] Pagination cursor
3366
+ * @returns {Promise<ExtendedEventExecution[]>}
3367
+ * @throws {ConductorSdkError}
3368
+ */
3369
+ getEventExecutions(eventHandlerName: string, from?: number): Promise<ExtendedEventExecution[]>;
3370
+ /**
3371
+ * Get all event handlers with statistics (messages view)
3372
+ * @param {number} [from] Pagination cursor
3373
+ * @returns {Promise<SearchResultHandledEventResponse>}
3374
+ * @throws {ConductorSdkError}
3375
+ */
3376
+ getEventHandlersWithStats(from?: number): Promise<SearchResultHandledEventResponse>;
3377
+ /**
3378
+ * Get event messages for a given event
3379
+ * @param {string} event
3380
+ * @param {number} [from] Pagination cursor
3381
+ * @returns {Promise<EventMessage[]>}
3382
+ * @throws {ConductorSdkError}
3383
+ */
3384
+ getEventMessages(event: string, from?: number): Promise<EventMessage[]>;
3281
3385
  }
3282
3386
 
3283
- declare const doWhileTask: (taskRefName: string, terminationCondition: string, tasks: TaskDefTypes[], optional?: boolean) => DoWhileTaskDef;
3284
- declare const newLoopTask: (taskRefName: string, iterations: number, tasks: TaskDefTypes[], optional?: boolean) => DoWhileTaskDef;
3285
-
3286
- declare const dynamicForkTask: (taskReferenceName: string, preForkTasks?: TaskDefTypes[], dynamicTasksInput?: string, optional?: boolean) => ForkJoinDynamicDef;
3287
-
3288
- declare const eventTask: (taskReferenceName: string, eventPrefix: string, eventSuffix: string, optional?: boolean) => EventTaskDef;
3289
- declare const sqsEventTask: (taskReferenceName: string, queueName: string, optional?: boolean) => EventTaskDef;
3290
- declare const conductorEventTask: (taskReferenceName: string, eventName: string, optional?: boolean) => EventTaskDef;
3291
-
3292
- declare const forkTask: (taskReferenceName: string, forkTasks: TaskDefTypes[]) => ForkJoinTaskDef;
3293
- declare const forkTaskJoin: (taskReferenceName: string, forkTasks: TaskDefTypes[], optional?: boolean) => [ForkJoinTaskDef, JoinTaskDef];
3294
-
3295
- declare const httpTask: (taskReferenceName: string, inputParameters: HttpInputParameters, asyncComplete?: boolean, optional?: boolean) => HttpTaskDef;
3296
-
3297
- declare const inlineTask: (taskReferenceName: string, script: string, evaluatorType?: "javascript" | "graaljs", optional?: boolean) => InlineTaskDef;
3298
-
3299
- declare const joinTask: (taskReferenceName: string, joinOn: string[], optional?: boolean) => JoinTaskDef;
3300
-
3301
- declare const jsonJqTask: (taskReferenceName: string, script: string, optional?: boolean) => JsonJQTransformTaskDef;
3302
-
3303
- declare const kafkaPublishTask: (taskReferenceName: string, kafka_request: KafkaPublishInputParameters, optional?: boolean) => KafkaPublishTaskDef;
3304
-
3305
- declare const setVariableTask: (taskReferenceName: string, inputParameters: Record<string, unknown>, optional?: boolean) => SetVariableTaskDef;
3306
-
3307
- declare const simpleTask: (taskReferenceName: string, name: string, inputParameters: Record<string, unknown>, optional?: boolean) => SimpleTaskDef;
3308
-
3309
- declare const subWorkflowTask: (taskReferenceName: string, workflowName: string, version?: number, optional?: boolean) => SubWorkflowTaskDef;
3310
-
3311
- declare const switchTask: (taskReferenceName: string, expression: string, decisionCases?: Record<string, TaskDefTypes[]>, defaultCase?: TaskDefTypes[], optional?: boolean) => SwitchTaskDef;
3312
-
3313
- declare const taskDefinition: ({ name, ownerApp, description, retryCount, timeoutSeconds, inputKeys, outputKeys, timeoutPolicy, retryLogic, retryDelaySeconds, responseTimeoutSeconds, concurrentExecLimit, inputTemplate, rateLimitPerFrequency, rateLimitFrequencyInSeconds, ownerEmail, pollTimeoutSeconds, backoffScaleFactor, }: ExtendedTaskDef) => TaskDef;
3314
-
3315
- declare const terminateTask: (taskReferenceName: string, status: "COMPLETED" | "FAILED", terminationReason?: string) => TerminateTaskDef;
3316
-
3317
- declare const waitTaskDuration: (taskReferenceName: string, duration: string, optional?: boolean) => WaitTaskDef;
3318
- declare const waitTaskUntil: (taskReferenceName: string, until: string, optional?: boolean) => WaitTaskDef;
3319
-
3320
- declare const workflow: (name: string, tasks: TaskDefTypes[]) => WorkflowDef$1;
3321
-
3322
- /**
3323
- * Takes an optional partial SimpleTaskDef
3324
- * generates a task replacing default values with provided overrides
3325
- *
3326
- * @param overrides overrides for defaults
3327
- * @returns a fully defined task
3328
- */
3329
- declare const generateSimpleTask: (overrides?: Partial<SimpleTaskDef>) => SimpleTaskDef;
3330
-
3331
- /**
3332
- * Takes an optional partial EventTaskDef
3333
- * generates a task replacing default/fake values with provided overrides
3334
- *
3335
- * @param overrides overrides for defaults
3336
- * @returns a fully defined task
3337
- */
3338
- declare const generateEventTask: (overrides?: Partial<EventTaskDef>) => EventTaskDef;
3339
-
3340
- type TaskDefTypesGen = SimpleTaskDef | DoWhileTaskDefGen | EventTaskDef | ForkJoinTaskDefGen | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDefGen | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDefGen | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
3341
- interface WorkflowDefGen extends Omit<WorkflowDef$1, "tasks"> {
3342
- tasks: Partial<TaskDefTypesGen>[];
3387
+ interface ConductorLogger {
3388
+ info(...args: unknown[]): void;
3389
+ error(...args: unknown[]): void;
3390
+ debug(...args: unknown[]): void;
3343
3391
  }
3344
- type ForkJoinTaskDefGen = Omit<ForkJoinTaskDef, "forkTasks"> & {
3345
- forkTasks: Partial<TaskDefTypesGen>[][];
3346
- };
3347
- type SwitchTaskDefGen = Omit<SwitchTaskDef, "decisionCases" | "defaultCase"> & {
3348
- decisionCases: Record<string, Partial<TaskDefTypesGen>[]>;
3349
- defaultCase: Partial<TaskDefTypesGen>[];
3350
- };
3351
- type DoWhileTaskDefGen = Omit<DoWhileTaskDef, "loopOver"> & {
3352
- loopOver: Partial<TaskDefTypesGen>[];
3353
- };
3354
- interface InlineTaskInputParametersGen extends Omit<InlineTaskInputParameters, "expression"> {
3355
- expression: string | ((...args: never[]) => unknown);
3392
+ type ConductorLogLevel = keyof typeof LOG_LEVELS;
3393
+ interface DefaultLoggerConfig {
3394
+ level?: ConductorLogLevel;
3395
+ tags?: object[];
3356
3396
  }
3357
- interface InlineTaskDefGen extends Omit<InlineTaskDef, "inputParameters"> {
3358
- inputParameters: InlineTaskInputParametersGen;
3397
+ declare const LOG_LEVELS: {
3398
+ readonly DEBUG: 10;
3399
+ readonly INFO: 30;
3400
+ readonly ERROR: 60;
3401
+ };
3402
+ declare class DefaultLogger implements ConductorLogger {
3403
+ private readonly tags;
3404
+ private readonly level;
3405
+ constructor(config?: DefaultLoggerConfig);
3406
+ private log;
3407
+ info: (...args: unknown[]) => void;
3408
+ debug: (...args: unknown[]) => void;
3409
+ error: (...args: unknown[]) => void;
3359
3410
  }
3360
- type NestedTaskMapper = (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
3411
+ declare const noopLogger: ConductorLogger;
3361
3412
 
3362
- declare const generateJoinTask: (overrides?: Partial<JoinTaskDef>) => JoinTaskDef;
3413
+ type TaskErrorHandler = (error: Error, task?: Task) => void;
3414
+ interface ConductorWorker {
3415
+ taskDefName: string;
3416
+ execute: (task: Task) => Promise<Omit<TaskResult, "workflowInstanceId" | "taskId">>;
3417
+ domain?: string;
3418
+ concurrency?: number;
3419
+ pollInterval?: number;
3420
+ }
3421
+ interface TaskRunnerOptions {
3422
+ workerID: string;
3423
+ domain: string | undefined;
3424
+ pollInterval?: number;
3425
+ concurrency?: number;
3426
+ batchPollingTimeout?: number;
3427
+ }
3428
+ interface RunnerArgs {
3429
+ worker: ConductorWorker;
3430
+ client: Client;
3431
+ options: TaskRunnerOptions;
3432
+ logger?: ConductorLogger;
3433
+ onError?: TaskErrorHandler;
3434
+ concurrency?: number;
3435
+ maxRetries?: number;
3436
+ }
3437
+ interface PollerOptions {
3438
+ pollInterval?: number;
3439
+ concurrency: number;
3440
+ warnAtO?: number;
3441
+ }
3442
+ type TaskManagerOptions = TaskRunnerOptions;
3443
+ interface TaskManagerConfig {
3444
+ logger?: ConductorLogger;
3445
+ options?: Partial<TaskManagerOptions>;
3446
+ onError?: TaskErrorHandler;
3447
+ maxRetries?: number;
3448
+ }
3363
3449
 
3364
3450
  /**
3365
- * Takes an optional partial HttpTaskDef
3366
- * generates a task replacing default/fake values with provided overrides
3367
- *
3368
- * @param overrides overrides for defaults
3369
- * @returns a fully defined task
3451
+ * Responsible for initializing and managing the runners that poll and work different task queues.
3370
3452
  */
3371
- declare const generateHTTPTask: (overrides?: Partial<HttpTaskDef>) => HttpTaskDef;
3453
+ declare class TaskManager {
3454
+ private workerRunners;
3455
+ private readonly client;
3456
+ private readonly logger;
3457
+ private readonly errorHandler;
3458
+ private workers;
3459
+ readonly options: Required<TaskManagerOptions>;
3460
+ private polling;
3461
+ private maxRetries;
3462
+ constructor(client: Client, workers: ConductorWorker[], config?: TaskManagerConfig);
3463
+ private workerManagerWorkerOptions;
3464
+ get isPolling(): boolean;
3465
+ updatePollingOptionForWorker: (workerTaskDefName: string, options: Partial<TaskManagerOptions>) => void;
3466
+ /**
3467
+ * new options will get merged to existing options
3468
+ * @param options new options to update polling options
3469
+ */
3470
+ updatePollingOptions: (options: Partial<TaskManagerOptions>) => void;
3471
+ sanityCheck: () => void;
3472
+ /**
3473
+ * Start polling for tasks
3474
+ */
3475
+ startPolling: () => void;
3476
+ /**
3477
+ * Stops polling for tasks
3478
+ */
3479
+ stopPolling: () => Promise<void>;
3480
+ }
3372
3481
 
3373
3482
  /**
3374
- * Takes an optional partial InlineTaskDefGen
3375
- * generates a task replacing default/fake values with provided overrides
3483
+ * Responsible for polling and executing tasks from a queue.
3376
3484
  *
3377
- * <b>note</b> that the inputParameters.expression can be either a string containing javascript
3378
- * or a function thar returns an ES5 function
3485
+ * Because a `poll` in conductor "pops" a task off of a conductor queue,
3486
+ * each runner participates in the poll -> work -> update loop.
3487
+ * We could potentially split this work into a separate "poller" and "worker" pools
3488
+ * but that could lead to picking up more work than the pool of workers are actually able to handle.
3379
3489
  *
3380
- * @param overrides overrides for defaults
3381
- * @returns a fully defined task
3382
3490
  */
3383
- declare const generateInlineTask: (override?: Partial<InlineTaskDefGen>) => InlineTaskDef;
3491
+ declare class TaskRunner {
3492
+ _client: Client;
3493
+ worker: ConductorWorker;
3494
+ private logger;
3495
+ private options;
3496
+ errorHandler: TaskErrorHandler;
3497
+ private poller;
3498
+ private maxRetries;
3499
+ constructor({ worker, client, options, logger, onError: errorHandler, maxRetries, }: RunnerArgs);
3500
+ get isPolling(): boolean;
3501
+ /**
3502
+ * Starts polling for work
3503
+ */
3504
+ startPolling: () => void;
3505
+ /**
3506
+ * Stops Polling for work
3507
+ */
3508
+ stopPolling: () => Promise<void>;
3509
+ updateOptions(options: Partial<TaskRunnerOptions>): void;
3510
+ get getOptions(): TaskRunnerOptions;
3511
+ private batchPoll;
3512
+ updateTaskWithRetry: (task: Task, taskResult: TaskResult) => Promise<void>;
3513
+ private executeTask;
3514
+ handleUnknownError: (unknownError: unknown) => void;
3515
+ }
3384
3516
 
3385
- /**
3386
- * Takes an optional partial JsonJQTransformTaskDef
3387
- * generates a task replacing default/fake values with provided overrides
3388
- *
3389
- * @param overrides overrides for defaults
3390
- * @returns a fully defined task
3391
- */
3392
- declare const generateJQTransformTask: (overrides?: Partial<JsonJQTransformTaskDef>) => JsonJQTransformTaskDef;
3393
-
3394
- /**
3395
- * Takes an optional partial KafkaPublishTaskDef
3396
- * generates a task replacing default/fake values with provided overrides
3397
- *
3398
- * @param overrides overrides for defaults
3399
- * @returns a fully defined task
3400
- */
3401
- declare const generateKafkaPublishTask: (overrides?: Partial<KafkaPublishTaskDef>) => KafkaPublishTaskDef;
3402
-
3403
- /**
3404
- * Takes an optional partial SubWorkflowTaskDef
3405
- * generates a task replacing default/fake values with provided overrides
3406
- *
3407
- * @param overrides overrides for defaults
3408
- * @returns a fully defined task
3409
- */
3410
- declare const generateSubWorkflowTask: (overrides?: Partial<SubWorkflowTaskDef>) => SubWorkflowTaskDef;
3411
-
3412
- /**
3413
- * Takes an optional partial SetVariableTaskDef
3414
- * generates a task replacing default/fake values with provided overrides
3415
- *
3416
- * @param overrides overrides for defaults
3417
- * @returns a fully defined task
3418
- */
3419
- declare const generateSetVariableTask: (overrides?: Partial<SetVariableTaskDef>) => SetVariableTaskDef;
3420
-
3421
- /**
3422
- * Takes an optional partial TerminateTaskDef
3423
- * generates a task replacing default/fake values with provided overrides
3424
- *
3425
- * @param overrides overrides for defaults
3426
- * @returns a fully defined task
3427
- */
3428
- declare const generateTerminateTask: (overrides?: Partial<TerminateTaskDef>) => TerminateTaskDef;
3517
+ declare class Poller<T> {
3518
+ private timeoutHandler?;
3519
+ private pollFunction;
3520
+ private performWorkFunction;
3521
+ private polling;
3522
+ private _tasksInProcess;
3523
+ private _counterAtO;
3524
+ private _pollerId;
3525
+ options: PollerOptions;
3526
+ logger: ConductorLogger;
3527
+ constructor(pollerId: string, pollFunction: (count: number) => Promise<T[] | undefined>, performWorkFunction: (work: T) => Promise<void>, pollerOptions?: Partial<PollerOptions>, logger?: ConductorLogger);
3528
+ get isPolling(): boolean;
3529
+ get tasksInProcess(): number;
3530
+ /**
3531
+ * Starts polling for work
3532
+ */
3533
+ startPolling: () => void;
3534
+ /**
3535
+ * Stops Polling for work
3536
+ */
3537
+ stopPolling: () => Promise<void>;
3538
+ private performWork;
3539
+ updateOptions(options: Partial<PollerOptions>): void;
3540
+ private poll;
3541
+ }
3429
3542
 
3430
- /**
3431
- * Takes an optional partial WaitTaskDef
3432
- * generates a task replacing default/fake values with provided overrides
3433
- *
3434
- * @param overrides overrides for defaults
3435
- * @returns a fully defined task
3436
- */
3437
- declare const generateWaitTask: (overrides?: Partial<WaitTaskDef>) => WaitTaskDef;
3543
+ type UserType = "EXTERNAL_USER" | "EXTERNAL_GROUP" | "CONDUCTOR_USER" | "CONDUCTOR_GROUP";
3544
+ interface PollIntervalOptions {
3545
+ pollInterval: number;
3546
+ maxPollTimes: number;
3547
+ }
3438
3548
 
3439
- declare const taskGenMapper: (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
3440
- /**
3441
- * Takes an optional partial WorkflowDefGen
3442
- * generates a workflow replacing default/fake values with provided overrides
3443
- *
3444
- * @param overrides overrides for defaults
3445
- * @returns a fully defined task
3446
- */
3447
- declare const generate: (overrides: Partial<WorkflowDefGen>) => WorkflowDef;
3549
+ declare class HumanExecutor {
3550
+ readonly _client: Client;
3551
+ constructor(client: Client);
3552
+ /**
3553
+ * @deprecated use search instead
3554
+ * Takes a set of filter parameters. return matches of human tasks for that set of parameters
3555
+ * @param state
3556
+ * @param assignee
3557
+ * @param assigneeType
3558
+ * @param claimedBy
3559
+ * @param taskName
3560
+ * @param freeText
3561
+ * @param includeInputOutput
3562
+ * @returns
3563
+ */
3564
+ getTasksByFilter(state: "PENDING" | "ASSIGNED" | "IN_PROGRESS" | "COMPLETED" | "TIMED_OUT", assignee?: string, assigneeType?: "EXTERNAL_USER" | "EXTERNAL_GROUP" | "CONDUCTOR_USER" | "CONDUCTOR_GROUP", claimedBy?: string, taskName?: string, taskInputQuery?: string, taskOutputQuery?: string): Promise<HumanTaskEntry[]>;
3565
+ /**
3566
+ * Takes a set of filter parameters. return matches of human tasks for that set of parameters
3567
+ * @param state
3568
+ * @param assignee
3569
+ * @param assigneeType
3570
+ * @param claimedBy
3571
+ * @param taskName
3572
+ * @param freeText
3573
+ * @param includeInputOutput
3574
+ * @returns Promise<HumanTaskEntry[]>
3575
+ */
3576
+ search(searchParams: Partial<HumanTaskSearch>): Promise<HumanTaskEntry[]>;
3577
+ /**
3578
+ * Takes a set of filter parameters. An polling interval options. will poll until the task returns a result
3579
+ * @param state
3580
+ * @param assignee
3581
+ * @param assigneeType
3582
+ * @param claimedBy
3583
+ * @param taskName
3584
+ * @param freeText
3585
+ * @param includeInputOutput
3586
+ * @returns Promise<HumanTaskEntry[]>
3587
+ */
3588
+ pollSearch(searchParams: Partial<HumanTaskSearch>, { pollInterval, maxPollTimes, }?: PollIntervalOptions): Promise<HumanTaskEntry[]>;
3589
+ /**
3590
+ * Returns task for a given task id
3591
+ * @param taskId
3592
+ * @returns
3593
+ */
3594
+ getTaskById(taskId: string): Promise<HumanTaskEntry>;
3595
+ /**
3596
+ * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
3597
+ * @param taskId
3598
+ * @param assignee
3599
+ * @returns
3600
+ */
3601
+ claimTaskAsExternalUser(taskId: string, assignee: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3602
+ /**
3603
+ * Claim task as conductor user
3604
+ * @param taskId
3605
+ * @returns
3606
+ */
3607
+ claimTaskAsConductorUser(taskId: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3608
+ /**
3609
+ * Claim task as conductor user
3610
+ * @param taskId
3611
+ * @param assignee
3612
+ * @returns
3613
+ */
3614
+ releaseTask(taskId: string): Promise<void>;
3615
+ /**
3616
+ * Returns a HumanTaskTemplateEntry for a given name and version
3617
+ * @param templateId
3618
+ * @returns
3619
+ */
3620
+ getTemplateByNameVersion(name: string, version: number): Promise<HumanTaskTemplate>;
3621
+ /**
3622
+ * @deprecated use getTemplate instead. name will be used as id here with version 1
3623
+ * Returns a HumanTaskTemplateEntry for a given templateId
3624
+ * @param templateId
3625
+ * @returns
3626
+ */
3627
+ getTemplateById(templateNameVersionOne: string): Promise<HumanTaskTemplate>;
3628
+ /**
3629
+ * Takes a taskId and a partial body. will update with given body
3630
+ * @param taskId
3631
+ * @param requestBody
3632
+ */
3633
+ updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, unknown>>): Promise<void>;
3634
+ /**
3635
+ * Takes a taskId and an optional partial body. will complete the task with the given body
3636
+ * @param taskId
3637
+ * @param requestBody
3638
+ */
3639
+ completeTask(taskId: string, requestBody?: Record<string, Record<string, unknown>>): Promise<void>;
3640
+ }
3448
3641
 
3449
- /**
3450
- * Takes an optional partial SwitchTaskDefGen and an optional nestedMapper
3451
- * generates a task replacing default/fake values with provided overrides
3452
- *
3453
- * @param overrides overrides for defaults
3454
- * @param nestedTasksMapper function to run on array of nested tasks
3455
- * @returns a fully defined task
3456
- */
3457
- declare const generateSwitchTask: (overrides?: Partial<SwitchTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => SwitchTaskDef;
3458
- /**
3459
- * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
3460
- * generates a task replacing default/fake values with provided overrides
3461
- *
3462
- * @param overrides overrides for defaults
3463
- * @param nestedTasksMapper function to run on array of nested tasks
3464
- * @returns a fully defined task
3465
- */
3466
- declare const generateDoWhileTask: (overrides?: Partial<DoWhileTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => DoWhileTaskDef;
3467
- /**
3468
- * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
3469
- * generates a task replacing default/fake values with provided overrides
3470
- *
3471
- * @param overrides overrides for defaults
3472
- * @param nestedTasksMapper function to run on array of nested tasks
3473
- * @returns a fully defined task
3474
- */
3475
- declare const generateForkJoinTask: (overrides?: Partial<ForkJoinTaskDefGen>, nestedMapper?: NestedTaskMapper) => ForkJoinTaskDef;
3642
+ declare class MetadataClient {
3643
+ readonly _client: Client;
3644
+ constructor(client: Client);
3645
+ /**
3646
+ * Unregisters an existing task definition by name
3647
+ *
3648
+ * @param name
3649
+ * @returns
3650
+ */
3651
+ unregisterTask(name: string): Promise<void>;
3652
+ /**
3653
+ * Registers a new task definition
3654
+ *
3655
+ * @param taskDef
3656
+ * @returns
3657
+ */
3658
+ registerTask(taskDef: ExtendedTaskDef): Promise<void>;
3659
+ /**
3660
+ * Registers multiple task definitions (array)
3661
+ *
3662
+ * @param taskDefs
3663
+ * @returns
3664
+ */
3665
+ registerTasks(taskDefs: ExtendedTaskDef[]): Promise<void>;
3666
+ /**
3667
+ * Update an existing task definition
3668
+ *
3669
+ * @param taskDef
3670
+ * @returns
3671
+ */
3672
+ updateTask(taskDef: ExtendedTaskDef): Promise<void>;
3673
+ /**
3674
+ * Get an existing task definition
3675
+ *
3676
+ * @param taskName
3677
+ * @returns
3678
+ */
3679
+ getTask(taskName: string): Promise<TaskDef>;
3680
+ /**
3681
+ * Creates or updates (overwrite: true) a workflow definition
3682
+ *
3683
+ * @param workflowDef
3684
+ * @param overwrite
3685
+ * @returns
3686
+ */
3687
+ registerWorkflowDef(workflowDef: ExtendedWorkflowDef, overwrite?: boolean): Promise<void>;
3688
+ /**
3689
+ * Creates or updates (overwrite: true) a workflow definition
3690
+ *
3691
+ * @param workflowDef
3692
+ * @param overwrite
3693
+ * @returns
3694
+ */
3695
+ getWorkflowDef(name: string, version?: number, metadata?: boolean): Promise<WorkflowDef>;
3696
+ /**
3697
+ * Unregister (overwrite: true) a workflow definition
3698
+ *
3699
+ * @param workflowDef
3700
+ * @param overwrite
3701
+ * @returns
3702
+ */
3703
+ unregisterWorkflow(workflowName: string, version?: number): Promise<void>;
3704
+ }
3476
3705
 
3477
3706
  declare class SchedulerClient {
3478
3707
  readonly _client: Client;
@@ -3556,7 +3785,107 @@ declare class SchedulerClient {
3556
3785
  resumeAllSchedules(): Promise<void>;
3557
3786
  }
3558
3787
 
3559
- declare class TaskClient {
3788
+ /**
3789
+ * Client for interacting with the Service Registry API
3790
+ */
3791
+ declare class ServiceRegistryClient {
3792
+ readonly _client: Client;
3793
+ constructor(client: Client);
3794
+ /**
3795
+ * Retrieve all registered services
3796
+ * @returns Array of all registered services
3797
+ */
3798
+ getRegisteredServices(): Promise<ServiceRegistry[]>;
3799
+ /**
3800
+ * Remove a service by name
3801
+ * @param name The name of the service to remove
3802
+ * @returns Promise that resolves when service is removed
3803
+ */
3804
+ removeService(name: string): Promise<void>;
3805
+ /**
3806
+ * Get a service by name
3807
+ * @param name The name of the service to retrieve
3808
+ * @returns The requested service registry
3809
+ */
3810
+ getService(name: string): Promise<ServiceRegistry | undefined>;
3811
+ /**
3812
+ * Open the circuit breaker for a service
3813
+ * @param name The name of the service
3814
+ * @returns Response with circuit breaker status
3815
+ */
3816
+ openCircuitBreaker(name: string): Promise<CircuitBreakerTransitionResponse>;
3817
+ /**
3818
+ * Close the circuit breaker for a service
3819
+ * @param name The name of the service
3820
+ * @returns Response with circuit breaker status
3821
+ */
3822
+ closeCircuitBreaker(name: string): Promise<CircuitBreakerTransitionResponse>;
3823
+ /**
3824
+ * Get circuit breaker status for a service
3825
+ * @param name The name of the service
3826
+ * @returns Response with circuit breaker status
3827
+ */
3828
+ getCircuitBreakerStatus(name: string): Promise<CircuitBreakerTransitionResponse>;
3829
+ /**
3830
+ * Add or update a service registry
3831
+ * @param serviceRegistry The service registry to add or update
3832
+ * @returns Promise that resolves when service is added or updated
3833
+ */
3834
+ addOrUpdateService(serviceRegistry: ServiceRegistry): Promise<void>;
3835
+ /**
3836
+ * Add or update a service method
3837
+ * @param registryName The name of the registry
3838
+ * @param method The service method to add or update
3839
+ * @returns Promise that resolves when method is added or updated
3840
+ */
3841
+ addOrUpdateServiceMethod(registryName: string, method: ServiceMethod): Promise<void>;
3842
+ /**
3843
+ * Remove a service method
3844
+ * @param registryName The name of the registry
3845
+ * @param serviceName The name of the service
3846
+ * @param method The name of the method
3847
+ * @param methodType The type of the method
3848
+ * @returns Promise that resolves when method is removed
3849
+ */
3850
+ removeMethod(registryName: string, serviceName: string, method: string, methodType: string): Promise<void>;
3851
+ /**
3852
+ * Get proto data
3853
+ * @param registryName The name of the registry
3854
+ * @param filename The name of the proto file
3855
+ * @returns The proto file data as a Blob
3856
+ */
3857
+ getProtoData(registryName: string, filename: string): Promise<Blob>;
3858
+ /**
3859
+ * Set proto data
3860
+ * @param registryName The name of the registry
3861
+ * @param filename The name of the proto file
3862
+ * @param data The proto file data
3863
+ * @returns Promise that resolves when proto data is set
3864
+ */
3865
+ setProtoData(registryName: string, filename: string, data: Blob): Promise<void>;
3866
+ /**
3867
+ * Delete a proto file
3868
+ * @param registryName The name of the registry
3869
+ * @param filename The name of the proto file
3870
+ * @returns Promise that resolves when proto file is deleted
3871
+ */
3872
+ deleteProto(registryName: string, filename: string): Promise<void>;
3873
+ /**
3874
+ * Get all proto files for a registry
3875
+ * @param registryName The name of the registry
3876
+ * @returns List of proto registry entries
3877
+ */
3878
+ getAllProtos(registryName: string): Promise<ProtoRegistryEntry[]>;
3879
+ /**
3880
+ * Discover service methods
3881
+ * @param name The name of the service
3882
+ * @param create Whether to create the discovered methods (defaults to false)
3883
+ * @returns The discovered service methods
3884
+ */
3885
+ discover(name: string, create?: boolean): Promise<ServiceMethod[]>;
3886
+ }
3887
+
3888
+ declare class TaskClient {
3560
3889
  readonly _client: Client;
3561
3890
  constructor(client: Client);
3562
3891
  /**
@@ -3601,453 +3930,400 @@ declare class TemplateClient {
3601
3930
  registerTemplate(template: HumanTaskTemplate, asNewVersion?: boolean): Promise<HumanTaskTemplate>;
3602
3931
  }
3603
3932
 
3604
- declare class MetadataClient {
3933
+ interface EnhancedSignalResponse extends SignalResponse {
3934
+ isTargetWorkflow(): boolean;
3935
+ isBlockingWorkflow(): boolean;
3936
+ isBlockingTask(): boolean;
3937
+ isBlockingTaskInput(): boolean;
3938
+ getWorkflow(): Workflow;
3939
+ getBlockingTask(): Task;
3940
+ getTaskInput(): Record<string, unknown>;
3941
+ getWorkflowId(): string;
3942
+ getTargetWorkflowId(): string;
3943
+ hasWorkflowData(): boolean;
3944
+ hasTaskData(): boolean;
3945
+ getResponseType(): string;
3946
+ isTerminal(): boolean;
3947
+ isRunning(): boolean;
3948
+ isPaused(): boolean;
3949
+ getSummary(): string;
3950
+ toDebugJSON(): Record<string, unknown>;
3951
+ toString(): string;
3952
+ }
3953
+ type TaskFinderPredicate = (task: Task) => boolean;
3954
+
3955
+ declare class WorkflowExecutor {
3605
3956
  readonly _client: Client;
3606
3957
  constructor(client: Client);
3607
3958
  /**
3608
- * Unregisters an existing task definition by name
3609
- *
3610
- * @param name
3611
- * @returns
3959
+ * Will persist a workflow in conductor
3960
+ * @param override If true will override the existing workflow with the definition
3961
+ * @param workflow Complete workflow definition
3962
+ * @returns null
3612
3963
  */
3613
- unregisterTask(name: string): Promise<void>;
3964
+ registerWorkflow(override: boolean, workflow: WorkflowDef): Promise<void>;
3614
3965
  /**
3615
- * Registers a new task definition
3616
- *
3617
- * @param taskDef
3966
+ * Takes a StartWorkflowRequest. returns a Promise<string> with the workflowInstanceId of the running workflow
3967
+ * @param workflowRequest
3618
3968
  * @returns
3619
3969
  */
3620
- registerTask(taskDef: ExtendedTaskDef): Promise<void>;
3970
+ startWorkflow(workflowRequest: StartWorkflowRequest): Promise<string>;
3621
3971
  /**
3622
- * Registers multiple task definitions (array)
3972
+ * Execute a workflow synchronously (original method - backward compatible)
3973
+ */
3974
+ executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef?: string): Promise<WorkflowRun>;
3975
+ /**
3976
+ * Execute a workflow with return strategy support (new method)
3977
+ */
3978
+ executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef: string, waitForSeconds: number, consistency: Consistency, returnStrategy: ReturnStrategy): Promise<EnhancedSignalResponse>;
3979
+ startWorkflows(workflowsRequest: StartWorkflowRequest[]): Promise<string>[];
3980
+ goBackToTask(workflowInstanceId: string, taskFinderPredicate: TaskFinderPredicate, rerunWorkflowRequestOverrides?: Partial<RerunWorkflowRequest>): Promise<void>;
3981
+ goBackToFirstTaskMatchingType(workflowInstanceId: string, taskType: string): Promise<void>;
3982
+ /**
3983
+ * Takes an workflowInstanceId and an includeTasks and an optional retry parameter returns the whole execution status.
3984
+ * If includeTasks flag is provided. Details of tasks execution will be returned as well,
3985
+ * retry specifies the amount of retrys before throwing an error.
3623
3986
  *
3624
- * @param taskDefs
3987
+ * @param workflowInstanceId
3988
+ * @param includeTasks
3989
+ * @param retry
3625
3990
  * @returns
3626
3991
  */
3627
- registerTasks(taskDefs: ExtendedTaskDef[]): Promise<void>;
3992
+ getWorkflow(workflowInstanceId: string, includeTasks: boolean, retry?: number): Promise<Workflow>;
3628
3993
  /**
3629
- * Update an existing task definition
3994
+ * Returns a summary of the current workflow status.
3630
3995
  *
3631
- * @param taskDef
3632
- * @returns
3996
+ * @param workflowInstanceId current running workflow
3997
+ * @param includeOutput flag to include output
3998
+ * @param includeVariables flag to include variable
3999
+ * @returns Promise<WorkflowStatus>
3633
4000
  */
3634
- updateTask(taskDef: ExtendedTaskDef): Promise<void>;
4001
+ getWorkflowStatus(workflowInstanceId: string, includeOutput: boolean, includeVariables: boolean): Promise<WorkflowStatus>;
3635
4002
  /**
3636
- * Get an existing task definition
4003
+ * Returns a summary of the current workflow status.
3637
4004
  *
3638
- * @param taskName
4005
+ * @param workflowInstanceId current running workflow
4006
+ * @param includeOutput flag to include output
4007
+ * @param includeVariables flag to include variable
4008
+ * @returns Promise<WorkflowStatus>
4009
+ */
4010
+ getExecution(workflowInstanceId: string, includeTasks?: boolean): Promise<Workflow>;
4011
+ /**
4012
+ * Pauses a running workflow
4013
+ * @param workflowInstanceId current workflow execution
3639
4014
  * @returns
3640
4015
  */
3641
- getTask(taskName: string): Promise<TaskDef>;
4016
+ pause(workflowInstanceId: string): Promise<void>;
3642
4017
  /**
3643
- * Creates or updates (overwrite: true) a workflow definition
4018
+ * Reruns workflowInstanceId workflow. with new parameters
3644
4019
  *
3645
- * @param workflowDef
3646
- * @param overwrite
4020
+ * @param workflowInstanceId current workflow execution
4021
+ * @param rerunWorkflowRequest Rerun Workflow Execution Request
3647
4022
  * @returns
3648
4023
  */
3649
- registerWorkflowDef(workflowDef: ExtendedWorkflowDef, overwrite?: boolean): Promise<void>;
4024
+ reRun(workflowInstanceId: string, rerunWorkflowRequest?: Partial<RerunWorkflowRequest>): Promise<string>;
3650
4025
  /**
3651
- * Creates or updates (overwrite: true) a workflow definition
3652
- *
3653
- * @param workflowDef
3654
- * @param overwrite
4026
+ * Restarts workflow with workflowInstanceId, if useLatestDefinition uses last defintion
4027
+ * @param workflowInstanceId
4028
+ * @param useLatestDefinitions
3655
4029
  * @returns
3656
4030
  */
3657
- getWorkflowDef(name: string, version?: number, metadata?: boolean): Promise<WorkflowDef$1>;
4031
+ restart(workflowInstanceId: string, useLatestDefinitions: boolean): Promise<void>;
3658
4032
  /**
3659
- * Unregister (overwrite: true) a workflow definition
4033
+ * Resumes a previously paused execution
3660
4034
  *
3661
- * @param workflowDef
3662
- * @param overwrite
4035
+ * @param workflowInstanceId Running workflow workflowInstanceId
3663
4036
  * @returns
3664
4037
  */
3665
- unregisterWorkflow(workflowName: string, version?: number): Promise<void>;
3666
- }
3667
-
3668
- declare class EventClient {
3669
- readonly _client: Client;
3670
- constructor(client: Client);
4038
+ resume(workflowInstanceId: string): Promise<void>;
3671
4039
  /**
3672
- * Get all the event handlers
3673
- * @returns {Promise<EventHandler[]>}
3674
- * @throws {ConductorSdkError}
4040
+ * Retrys workflow from last failing task
4041
+ * if resumeSubworkflowTasks is true will resume tasks in spawned subworkflows
4042
+ *
4043
+ * @param workflowInstanceId
4044
+ * @param resumeSubworkflowTasks
4045
+ * @returns
3675
4046
  */
3676
- getAllEventHandlers(): Promise<EventHandler[]>;
4047
+ retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): Promise<void>;
3677
4048
  /**
3678
- * Add event handlers
3679
- * @param {EventHandler[]} eventHandlers
3680
- * @returns {Promise<void>}
3681
- * @throws {ConductorSdkError}
4049
+ * Searches for existing workflows given the following querys
4050
+ *
4051
+ * @param start
4052
+ * @param size
4053
+ * @param query
4054
+ * @param freeText
4055
+ * @param sort
4056
+ * @param skipCache
4057
+ * @returns
3682
4058
  */
3683
- addEventHandlers(eventHandlers: EventHandler[]): Promise<void>;
4059
+ search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): Promise<ScrollableSearchResultWorkflowSummary>;
3684
4060
  /**
3685
- * Add an event handler
3686
- * @param {EventHandler} eventHandler
3687
- * @returns {Promise<void>}
3688
- * @throws {ConductorSdkError}
4061
+ * Skips a task of a running workflow.
4062
+ * by providing a skipTaskRequest you can set the input and the output of the skipped tasks
4063
+ * @param workflowInstanceId
4064
+ * @param taskReferenceName
4065
+ * @param skipTaskRequest
4066
+ * @returns
3689
4067
  */
3690
- addEventHandler(eventHandler: EventHandler): Promise<void>;
4068
+ skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): Promise<void>;
3691
4069
  /**
3692
- * Update an event handler
3693
- * @param {EventHandler} eventHandler
3694
- * @returns {Promise<void>}
3695
- * @throws {ConductorSdkError}
4070
+ * Takes an workflowInstanceId, and terminates a running workflow
4071
+ * @param workflowInstanceId
4072
+ * @param reason
4073
+ * @returns
3696
4074
  */
3697
- updateEventHandler(eventHandler: EventHandler): Promise<void>;
4075
+ terminate(workflowInstanceId: string, reason: string): Promise<void>;
3698
4076
  /**
3699
- * Handle an incoming event
3700
- * @param {Record<string, string>} data
3701
- * @returns {Promise<void>}
3702
- * @throws {ConductorSdkError}
4077
+ * Takes a taskId and a workflowInstanceId. Will update the task for the corresponding taskId
4078
+ * @param taskId
4079
+ * @param workflowInstanceId
4080
+ * @param taskStatus
4081
+ * @param taskOutput
4082
+ * @returns
3703
4083
  */
3704
- handleIncomingEvent(data: Record<string, string>): Promise<void>;
4084
+ updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: TaskResultOutputData): Promise<string>;
3705
4085
  /**
3706
- * Get an event handler by name
3707
- * @param {string} eventHandlerName
3708
- * @returns {Promise<EventHandler>}
3709
- * @throws {ConductorSdkError}
4086
+ * Updates a task by reference Name
4087
+ * @param taskReferenceName
4088
+ * @param workflowInstanceId
4089
+ * @param status
4090
+ * @param taskOutput
4091
+ * @returns
3710
4092
  */
3711
- getEventHandlerByName(eventHandlerName: string): Promise<EventHandler>;
4093
+ updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: TaskResultOutputData): Promise<string>;
3712
4094
  /**
3713
- * Get all queue configs
3714
- * @returns {Promise<Record<string, string>>}
3715
- * @throws {ConductorSdkError}
4095
+ *
4096
+ * @param taskId
4097
+ * @returns
3716
4098
  */
3717
- getAllQueueConfigs(): Promise<Record<string, string>>;
4099
+ getTask(taskId: string): Promise<Task>;
3718
4100
  /**
3719
- * Delete queue config
3720
- * @param {string} queueType
3721
- * @param {string} queueName
3722
- * @returns {Promise<void>}
3723
- * @throws {ConductorSdkError}
4101
+ * Updates a task by reference name synchronously and returns the complete workflow
4102
+ * @param taskReferenceName
4103
+ * @param workflowInstanceId
4104
+ * @param status
4105
+ * @param taskOutput
4106
+ * @param workerId - Optional
4107
+ * @returns Promise<Workflow>
3724
4108
  */
3725
- deleteQueueConfig(queueType: string, queueName: string): Promise<void>;
4109
+ updateTaskSync(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, workerId?: string): Promise<Workflow>;
3726
4110
  /**
3727
- * Get queue config
3728
- * @param {string} queueType
3729
- * @param {string} queueName
3730
- * @returns {Promise<Record<string, unknown>>}
3731
- * @throws {ConductorSdkError}
4111
+ * Signals a workflow task and returns data based on the specified return strategy
4112
+ * @param workflowInstanceId - Workflow instance ID to signal
4113
+ * @param status - Task status to set
4114
+ * @param taskOutput - Output data for the task
4115
+ * @param returnStrategy - Optional strategy for what data to return (defaults to TARGET_WORKFLOW)
4116
+ * @returns Promise<SignalResponse> with data based on the return strategy
3732
4117
  */
3733
- getQueueConfig(queueType: string, queueName: string): Promise<Record<string, unknown>>;
4118
+ signal(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, returnStrategy?: ReturnStrategy): Promise<EnhancedSignalResponse>;
3734
4119
  /**
3735
- * Get event handlers for a given event
3736
- * @param {string} event
3737
- * @param {boolean} [activeOnly=false] Only return active handlers.
3738
- * @returns {Promise<EventHandler[]>}
3739
- * @throws {ConductorSdkError}
3740
- */
3741
- getEventHandlersForEvent(event: string, activeOnly?: boolean): Promise<EventHandler[]>;
3742
- /**
3743
- * Remove an event handler by name
3744
- * @param {string} name
3745
- * @returns {Promise<void>}
3746
- * @throws {ConductorSdkError}
3747
- */
3748
- removeEventHandler(name: string): Promise<void>;
3749
- /**
3750
- * Get tags for an event handler
3751
- * @param {string} name
3752
- * @returns {Promise<Tag[]>}
3753
- * @throws {ConductorSdkError}
3754
- */
3755
- getTagsForEventHandler(name: string): Promise<Tag[]>;
3756
- /**
3757
- * Put tags for an event handler
3758
- * @param {string} name
3759
- * @param {Tag[]} tags
3760
- * @returns {Promise<void>}
3761
- * @throws {ConductorSdkError}
3762
- */
3763
- putTagForEventHandler(name: string, tags: Tag[]): Promise<void>;
3764
- /**
3765
- * Delete tags for an event handler
3766
- * @param {string} name
3767
- * @param {Tag[]} tags
3768
- * @returns {Promise<void>}
3769
- * @throws {ConductorSdkError}
3770
- */
3771
- deleteTagsForEventHandler(name: string, tags: Tag[]): Promise<void>;
3772
- /**
3773
- * Delete a tag for an event handler
3774
- * @param {string} name
3775
- * @param {Tag} tag
3776
- * @returns {Promise<void>}
3777
- * @throws {ConductorSdkError}
3778
- */
3779
- deleteTagForEventHandler(name: string, tag: Tag): Promise<void>;
3780
- /**
3781
- * Test connectivity for a given queue using a workflow with EVENT task and an EventHandler
3782
- * @param {ConnectivityTestInput} input
3783
- * @returns {Promise<ConnectivityTestResult>}
3784
- * @throws {ConductorSdkError}
3785
- */
3786
- testConnectivity(input: ConnectivityTestInput): Promise<ConnectivityTestResult>;
3787
- /**
3788
- * Create or update queue config by name
3789
- * @deprecated Prefer server's newer endpoints if available
3790
- * @param {string} queueType
3791
- * @param {string} queueName
3792
- * @param {string} config
3793
- * @returns {Promise<void>}
3794
- * @throws {ConductorSdkError}
3795
- */
3796
- putQueueConfig(queueType: string, queueName: string, config: string): Promise<void>;
3797
- /**
3798
- * Test endpoint (as exposed by API)
3799
- * @returns {Promise<EventHandler>}
3800
- * @throws {ConductorSdkError}
3801
- */
3802
- test(): Promise<EventHandler>;
3803
- /**
3804
- * Get all active event handlers (execution view)
3805
- * @returns {Promise<SearchResultHandledEventResponse>}
3806
- * @throws {ConductorSdkError}
3807
- */
3808
- getAllActiveEventHandlers(): Promise<SearchResultHandledEventResponse>;
3809
- /**
3810
- * Get event executions for a specific handler
3811
- * @param {string} eventHandlerName
3812
- * @param {number} [from] Pagination cursor
3813
- * @returns {Promise<ExtendedEventExecution[]>}
3814
- * @throws {ConductorSdkError}
3815
- */
3816
- getEventExecutions(eventHandlerName: string, from?: number): Promise<ExtendedEventExecution[]>;
3817
- /**
3818
- * Get all event handlers with statistics (messages view)
3819
- * @param {number} [from] Pagination cursor
3820
- * @returns {Promise<SearchResultHandledEventResponse>}
3821
- * @throws {ConductorSdkError}
3822
- */
3823
- getEventHandlersWithStats(from?: number): Promise<SearchResultHandledEventResponse>;
3824
- /**
3825
- * Get event messages for a given event
3826
- * @param {string} event
3827
- * @param {number} [from] Pagination cursor
3828
- * @returns {Promise<EventMessage[]>}
3829
- * @throws {ConductorSdkError}
4120
+ * Signals a workflow task asynchronously (fire-and-forget)
4121
+ * @param workflowInstanceId - Workflow instance ID to signal
4122
+ * @param status - Task status to set
4123
+ * @param taskOutput - Output data for the task
4124
+ * @returns Promise<void>
3830
4125
  */
3831
- getEventMessages(event: string, from?: number): Promise<EventMessage[]>;
4126
+ signalAsync(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData): Promise<void>;
3832
4127
  }
3833
4128
 
3834
- interface OrkesApiConfig {
3835
- serverUrl?: string;
3836
- keyId?: string;
3837
- keySecret?: string;
3838
- refreshTokenInterval?: number;
3839
- useEnvVars?: boolean;
3840
- maxHttp2Connections?: number;
4129
+ declare const doWhileTask: (taskRefName: string, terminationCondition: string, tasks: TaskDefTypes[], optional?: boolean) => DoWhileTaskDef;
4130
+ declare const newLoopTask: (taskRefName: string, iterations: number, tasks: TaskDefTypes[], optional?: boolean) => DoWhileTaskDef;
4131
+
4132
+ declare const dynamicForkTask: (taskReferenceName: string, preForkTasks?: TaskDefTypes[], dynamicTasksInput?: string, optional?: boolean) => ForkJoinDynamicDef;
4133
+
4134
+ declare const eventTask: (taskReferenceName: string, eventPrefix: string, eventSuffix: string, optional?: boolean) => EventTaskDef;
4135
+ declare const sqsEventTask: (taskReferenceName: string, queueName: string, optional?: boolean) => EventTaskDef;
4136
+ declare const conductorEventTask: (taskReferenceName: string, eventName: string, optional?: boolean) => EventTaskDef;
4137
+
4138
+ declare const forkTask: (taskReferenceName: string, forkTasks: TaskDefTypes[]) => ForkJoinTaskDef;
4139
+ declare const forkTaskJoin: (taskReferenceName: string, forkTasks: TaskDefTypes[], optional?: boolean) => [ForkJoinTaskDef, JoinTaskDef];
4140
+
4141
+ declare const httpTask: (taskReferenceName: string, inputParameters: HttpInputParameters, asyncComplete?: boolean, optional?: boolean) => HttpTaskDef;
4142
+
4143
+ declare const inlineTask: (taskReferenceName: string, script: string, evaluatorType?: "javascript" | "graaljs", optional?: boolean) => InlineTaskDef;
4144
+
4145
+ declare const joinTask: (taskReferenceName: string, joinOn: string[], optional?: boolean) => JoinTaskDef;
4146
+
4147
+ declare const jsonJqTask: (taskReferenceName: string, script: string, optional?: boolean) => JsonJQTransformTaskDef;
4148
+
4149
+ declare const kafkaPublishTask: (taskReferenceName: string, kafka_request: KafkaPublishInputParameters, optional?: boolean) => KafkaPublishTaskDef;
4150
+
4151
+ declare const setVariableTask: (taskReferenceName: string, inputParameters: Record<string, unknown>, optional?: boolean) => SetVariableTaskDef;
4152
+
4153
+ declare const simpleTask: (taskReferenceName: string, name: string, inputParameters: Record<string, unknown>, optional?: boolean) => SimpleTaskDef;
4154
+
4155
+ declare const subWorkflowTask: (taskReferenceName: string, workflowName: string, version?: number, optional?: boolean) => SubWorkflowTaskDef;
4156
+
4157
+ declare const switchTask: (taskReferenceName: string, expression: string, decisionCases?: Record<string, TaskDefTypes[]>, defaultCase?: TaskDefTypes[], optional?: boolean) => SwitchTaskDef;
4158
+
4159
+ declare const terminateTask: (taskReferenceName: string, status: "COMPLETED" | "FAILED", terminationReason?: string) => TerminateTaskDef;
4160
+
4161
+ declare const waitTaskDuration: (taskReferenceName: string, duration: string, optional?: boolean) => WaitTaskDef;
4162
+ declare const waitTaskUntil: (taskReferenceName: string, until: string, optional?: boolean) => WaitTaskDef;
4163
+
4164
+ declare const workflow: (name: string, tasks: TaskDefTypes[]) => WorkflowDef;
4165
+
4166
+ declare const taskDefinition: ({ name, ownerApp, description, retryCount, timeoutSeconds, inputKeys, outputKeys, timeoutPolicy, retryLogic, retryDelaySeconds, responseTimeoutSeconds, concurrentExecLimit, inputTemplate, rateLimitPerFrequency, rateLimitFrequencyInSeconds, ownerEmail, pollTimeoutSeconds, backoffScaleFactor, }: ExtendedTaskDef) => TaskDef;
4167
+
4168
+ /**
4169
+ * Takes an optional partial SimpleTaskDef
4170
+ * generates a task replacing default values with provided overrides
4171
+ *
4172
+ * @param overrides overrides for defaults
4173
+ * @returns a fully defined task
4174
+ */
4175
+ declare const generateSimpleTask: (overrides?: Partial<SimpleTaskDef>) => SimpleTaskDef;
4176
+
4177
+ /**
4178
+ * Takes an optional partial EventTaskDef
4179
+ * generates a task replacing default/fake values with provided overrides
4180
+ *
4181
+ * @param overrides overrides for defaults
4182
+ * @returns a fully defined task
4183
+ */
4184
+ declare const generateEventTask: (overrides?: Partial<EventTaskDef>) => EventTaskDef;
4185
+
4186
+ type TaskDefTypesGen = SimpleTaskDef | DoWhileTaskDefGen | EventTaskDef | ForkJoinTaskDefGen | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDefGen | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDefGen | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
4187
+ interface WorkflowDefGen extends Omit<WorkflowDef, "tasks"> {
4188
+ tasks: Partial<TaskDefTypesGen>[];
3841
4189
  }
4190
+ type ForkJoinTaskDefGen = Omit<ForkJoinTaskDef, "forkTasks"> & {
4191
+ forkTasks: Partial<TaskDefTypesGen>[][];
4192
+ };
4193
+ type SwitchTaskDefGen = Omit<SwitchTaskDef, "decisionCases" | "defaultCase"> & {
4194
+ decisionCases: Record<string, Partial<TaskDefTypesGen>[]>;
4195
+ defaultCase: Partial<TaskDefTypesGen>[];
4196
+ };
4197
+ type DoWhileTaskDefGen = Omit<DoWhileTaskDef, "loopOver"> & {
4198
+ loopOver: Partial<TaskDefTypesGen>[];
4199
+ };
4200
+ interface InlineTaskInputParametersGen extends Omit<InlineTaskInputParameters, "expression"> {
4201
+ expression: string | ((...args: never[]) => unknown);
4202
+ }
4203
+ interface InlineTaskDefGen extends Omit<InlineTaskDef, "inputParameters"> {
4204
+ inputParameters: InlineTaskInputParametersGen;
4205
+ }
4206
+ type NestedTaskMapper = (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
4207
+
4208
+ declare const generateJoinTask: (overrides?: Partial<JoinTaskDef>) => JoinTaskDef;
3842
4209
 
3843
4210
  /**
3844
- * Takes a config with keyId and keySecret returns a promise with an instance of Client
4211
+ * Takes an optional partial HttpTaskDef
4212
+ * generates a task replacing default/fake values with provided overrides
3845
4213
  *
3846
- * @param config (optional) OrkesApiConfig with keyId and keySecret
3847
- * @param customFetch (optional) custom fetch function
3848
- * @param requestHandler DEPRECATED! (optional) ConductorHttpRequest handler, replaced with customFetch
3849
- * @returns Client
4214
+ * @param overrides overrides for defaults
4215
+ * @returns a fully defined task
3850
4216
  */
3851
- declare const orkesConductorClient: (config?: OrkesApiConfig, customFetch?: typeof fetch) => Promise<{
3852
- eventResource: {
3853
- getQueueConfig: (queueType: string, queueName: string) => Promise<{
3854
- [key: string]: unknown;
3855
- }>;
3856
- putQueueConfig: (queueType: string, queueName: string, body: string) => Promise<void>;
3857
- deleteQueueConfig: (queueType: string, queueName: string) => Promise<void>;
3858
- getEventHandlers: () => Promise<EventHandler[]>;
3859
- updateEventHandler: (body: any) => Promise<void>;
3860
- addEventHandler: (body: any) => Promise<void>;
3861
- getQueueNames: () => Promise<{
3862
- [key: string]: string;
3863
- }>;
3864
- removeEventHandlerStatus: (name: string) => Promise<void>;
3865
- getEventHandlersForEvent: (event: string, activeOnly?: boolean) => Promise<EventHandler[]>;
3866
- deleteTagForEventHandler: (name: string, body: any[]) => Promise<void>;
3867
- getTagsForEventHandler: (name: string) => Promise<Tag[]>;
3868
- putTagForEventHandler: (name: string, body: any[]) => Promise<void>;
3869
- };
3870
- healthCheckResource: {
3871
- doCheck: () => Promise<{
3872
- [key: string]: unknown;
3873
- }>;
3874
- };
3875
- metadataResource: {
3876
- getTaskDef: (tasktype: string, metadata?: boolean) => Promise<{
3877
- [key: string]: unknown;
3878
- }>;
3879
- unregisterTaskDef: (tasktype: string) => Promise<void>;
3880
- getAllWorkflows: (access?: string, metadata?: boolean, tagKey?: string, tagValue?: string) => Promise<WorkflowDef$1[]>;
3881
- update: (requestBody: any[], overwrite?: boolean) => Promise<void>;
3882
- create: (requestBody: any, overwrite?: boolean) => Promise<void>;
3883
- getTaskDefs: (access?: string, metadata?: boolean, tagKey?: string, tagValue?: string) => Promise<TaskDef[]>;
3884
- updateTaskDef: (requestBody: any) => Promise<void>;
3885
- registerTaskDef: (requestBody: any[]) => Promise<void>;
3886
- unregisterWorkflowDef: (name: string, version: number) => Promise<void>;
3887
- get: (name: string, version?: number, metadata?: boolean) => Promise<WorkflowDef$1>;
3888
- };
3889
- schedulerResource: {
3890
- getSchedule: (name: string) => Promise<WorkflowSchedule>;
3891
- deleteSchedule: (name: string) => Promise<void>;
3892
- getNextFewSchedules: (cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, limit?: number) => Promise<number[]>;
3893
- pauseSchedule: (name: string) => Promise<void>;
3894
- pauseAllSchedules: () => Promise<{
3895
- [key: string]: unknown;
3896
- }>;
3897
- resumeSchedule: (name: string) => Promise<void>;
3898
- requeueAllExecutionRecords: () => Promise<{
3899
- [key: string]: unknown;
3900
- }>;
3901
- resumeAllSchedules: () => Promise<{
3902
- [key: string]: unknown;
3903
- }>;
3904
- getAllSchedules: (workflowName?: string) => Promise<WorkflowScheduleModel[]>;
3905
- saveSchedule: (requestBody: any) => Promise<void>;
3906
- searchV21: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<SearchResultWorkflowScheduleExecutionModel>;
3907
- testTimeout: () => Promise<any>;
3908
- };
3909
- tokenResource: {
3910
- generateToken: (requestBody: any) => Promise<Response$1>;
3911
- getUserInfo: (claims?: boolean) => Promise<{
3912
- [key: string]: unknown;
3913
- }>;
3914
- };
3915
- workflowBulkResource: {
3916
- retry: (requestBody: any[]) => Promise<BulkResponse>;
3917
- restart: (requestBody: any[], useLatestDefinitions?: boolean) => Promise<BulkResponse>;
3918
- terminate: (requestBody: any[], reason?: string) => Promise<BulkResponse>;
3919
- resumeWorkflow: (requestBody: any[]) => Promise<BulkResponse>;
3920
- pauseWorkflow1: (requestBody: any[]) => Promise<BulkResponse>;
3921
- };
3922
- workflowResource: {
3923
- getRunningWorkflow: (name: string, version?: number, startTime?: number, endTime?: number) => Promise<string[]>;
3924
- executeWorkflow: (body: any, name: string, version: number, requestId?: string, waitUntilTaskRef?: string, waitForSeconds?: number, consistency?: any, returnStrategy?: any) => Promise<SignalResponse$1>;
3925
- startWorkflow: (requestBody: any) => Promise<string>;
3926
- decide: (workflowId: string) => Promise<void>;
3927
- rerun: (workflowId: string, requestBody: any) => Promise<string>;
3928
- searchV21: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
3929
- pauseWorkflow: (workflowId: string) => Promise<void>;
3930
- skipTaskFromWorkflow: (workflowId: string, taskReferenceName: string, requestBody?: any) => Promise<void>;
3931
- getWorkflows: (name: string, requestBody: any[], includeClosed?: boolean, includeTasks?: boolean) => Promise<{
3932
- [key: string]: Workflow[];
3933
- }>;
3934
- getWorkflowStatusSummary: (workflowId: string, includeOutput?: boolean, includeVariables?: boolean) => Promise<WorkflowStatus>;
3935
- getWorkflows1: (name: string, correlationId: string, includeClosed?: boolean, includeTasks?: boolean) => Promise<Workflow[]>;
3936
- retry1: (workflowId: string, resumeSubworkflowTasks?: boolean) => Promise<void>;
3937
- getExecutionStatus: (workflowId: string, includeTasks?: boolean) => Promise<Workflow>;
3938
- terminate1: (workflowId: string, reason?: string) => Promise<void>;
3939
- resumeWorkflow: (workflowId: string) => Promise<void>;
3940
- delete: (workflowId: string, archiveWorkflow?: boolean) => Promise<void>;
3941
- searchWorkflowsByTasks: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
3942
- getExternalStorageLocation: (path: string, operation: string, payloadType: string) => Promise<any>;
3943
- startWorkflow1: (name: string, requestBody: any, version?: number, correlationId?: string, priority?: number) => Promise<string>;
3944
- restart1: (workflowId: string, useLatestDefinitions?: boolean) => Promise<void>;
3945
- search1: (queryId?: string, start?: number, size?: number, sort?: string, freeText?: string, query?: string, skipCache?: boolean) => Promise<any>;
3946
- searchWorkflowsByTasksV2: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
3947
- resetWorkflow: (workflowId: string) => Promise<void>;
3948
- testWorkflow: (requestBody: any) => Promise<Workflow>;
3949
- };
3950
- serviceRegistryResource: {
3951
- getRegisteredServices: () => Promise<ServiceRegistry[]>;
3952
- removeService: (name: string) => Promise<void>;
3953
- getService: (name: string) => Promise<ServiceRegistry>;
3954
- openCircuitBreaker: (name: string) => Promise<CircuitBreakerTransitionResponse>;
3955
- closeCircuitBreaker: (name: string) => Promise<CircuitBreakerTransitionResponse>;
3956
- getCircuitBreakerStatus: (name: string) => Promise<CircuitBreakerTransitionResponse>;
3957
- addOrUpdateService: (serviceRegistry: any) => Promise<void>;
3958
- addOrUpdateServiceMethod: (registryName: string, method: any) => Promise<void>;
3959
- removeMethod: (registryName: string, serviceName: string, method: string, methodType: string) => Promise<void>;
3960
- getProtoData: (registryName: string, filename: string) => Promise<string>;
3961
- setProtoData: (registryName: string, filename: string, data: any) => Promise<void>;
3962
- deleteProto: (registryName: string, filename: string) => Promise<void>;
3963
- getAllProtos: (registryName: string) => Promise<ProtoRegistryEntry[]>;
3964
- discover: (name: string, create?: boolean) => Promise<ServiceMethod[]>;
3965
- };
3966
- humanTaskResource: {
3967
- getConductorTaskById: (taskId: string) => Promise<Task>;
3968
- };
3969
- humanTask: {
3970
- deleteTaskFromHumanTaskRecords: (requestBody: any[]) => Promise<void>;
3971
- deleteTaskFromHumanTaskRecords1: (taskId: string) => Promise<void>;
3972
- search: (requestBody: any) => Promise<HumanTaskSearchResult>;
3973
- updateTaskOutputByRef: (workflowId: string, taskRefName: string, requestBody: any, complete?: boolean, iteration?: any[]) => Promise<any>;
3974
- getTask1: (taskId: string) => Promise<HumanTaskEntry>;
3975
- claimTask: (taskId: string, overrideAssignment?: boolean, withTemplate?: boolean) => Promise<HumanTaskEntry>;
3976
- assignAndClaim: (taskId: string, userId: string, overrideAssignment?: boolean, withTemplate?: boolean) => Promise<HumanTaskEntry>;
3977
- reassignTask: (taskId: string, requestBody: any[]) => Promise<void>;
3978
- releaseTask: (taskId: string) => Promise<void>;
3979
- skipTask: (taskId: string, reason?: string) => Promise<void>;
3980
- updateTaskOutput: (taskId: string, requestBody: any, complete?: boolean) => Promise<void>;
3981
- getAllTemplates: (name?: string, version?: number) => Promise<HumanTaskTemplate[]>;
3982
- saveTemplate: (requestBody: any, newVersion?: boolean) => Promise<HumanTaskTemplate>;
3983
- saveTemplates: (requestBody: any[], newVersion?: boolean) => Promise<HumanTaskTemplate[]>;
3984
- deleteTemplateByName: (name: string) => Promise<void>;
3985
- deleteTemplatesByNameAndVersion: (name: string, version: number) => Promise<void>;
3986
- getTemplateByNameAndVersion: (name: string, version: number) => Promise<HumanTaskTemplate>;
3987
- };
3988
- taskResource: {
3989
- poll: (tasktype: string, workerid?: string, domain?: string) => Promise<Task>;
3990
- allVerbose: () => Promise<{
3991
- [key: string]: {
3992
- [key: string]: {
3993
- [key: string]: number;
3994
- };
3995
- };
3996
- }>;
3997
- updateTask: (workflowId: string, taskRefName: string, status: "IN_PROGRESS" | "FAILED" | "FAILED_WITH_TERMINAL_ERROR" | "COMPLETED", requestBody: any) => Promise<string>;
3998
- getTask: (taskId: string) => Promise<Task>;
3999
- all: () => Promise<{
4000
- [key: string]: number;
4001
- }>;
4002
- requeuePendingTask: (taskType: string) => Promise<string>;
4003
- search: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<SearchResultTaskSummary>;
4004
- searchV22: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
4005
- getPollData: (taskType: string) => Promise<PollData[]>;
4006
- getTaskLogs: (taskId: string) => Promise<TaskExecLog[]>;
4007
- log: (taskId: string, requestBody: string) => Promise<void>;
4008
- getAllPollData: () => Promise<{
4009
- [key: string]: unknown;
4010
- }>;
4011
- batchPoll: (tasktype: string, workerid?: string, domain?: string, count?: number, timeout?: number) => Promise<Task[]>;
4012
- updateTask1: (requestBody: any) => Promise<string>;
4013
- size1: (taskType?: string[]) => Promise<{
4014
- [key: string]: number;
4015
- }>;
4016
- getExternalStorageLocation1: (path: string, operation: string, payloadType: string) => Promise<any>;
4017
- updateTaskSync: (workflowId: string, taskRefName: string, status: any, output: any, workerId?: string) => Promise<Workflow>;
4018
- signal: (workflowId: string, status: any, output: any, returnStrategy?: any) => Promise<SignalResponse$1>;
4019
- signalAsync: (workflowId: string, status: any, output: any) => Promise<SignalResponse>;
4020
- };
4021
- buildUrl: <TData extends {
4022
- body?: unknown;
4023
- path?: Record<string, unknown>;
4024
- query?: Record<string, unknown>;
4025
- url: string;
4026
- }>(options: Pick<TData, "url"> & Options<TData>) => string;
4027
- getConfig: () => Config<ClientOptions>;
4028
- request: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4029
- setConfig: (config: Config<ClientOptions>) => Config<ClientOptions>;
4030
- connect: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4031
- delete: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4032
- get: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4033
- head: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4034
- options: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4035
- patch: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4036
- post: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4037
- put: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4038
- trace: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
4039
- sse: {
4040
- connect: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4041
- delete: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4042
- get: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4043
- head: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4044
- options: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4045
- patch: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4046
- post: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4047
- put: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4048
- trace: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4049
- };
4050
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
4051
- }>;
4217
+ declare const generateHTTPTask: (overrides?: Partial<HttpTaskDef>) => HttpTaskDef;
4218
+
4219
+ /**
4220
+ * Takes an optional partial InlineTaskDefGen
4221
+ * generates a task replacing default/fake values with provided overrides
4222
+ *
4223
+ * <b>note</b> that the inputParameters.expression can be either a string containing javascript
4224
+ * or a function thar returns an ES5 function
4225
+ *
4226
+ * @param overrides overrides for defaults
4227
+ * @returns a fully defined task
4228
+ */
4229
+ declare const generateInlineTask: (override?: Partial<InlineTaskDefGen>) => InlineTaskDef;
4230
+
4231
+ /**
4232
+ * Takes an optional partial JsonJQTransformTaskDef
4233
+ * generates a task replacing default/fake values with provided overrides
4234
+ *
4235
+ * @param overrides overrides for defaults
4236
+ * @returns a fully defined task
4237
+ */
4238
+ declare const generateJQTransformTask: (overrides?: Partial<JsonJQTransformTaskDef>) => JsonJQTransformTaskDef;
4239
+
4240
+ /**
4241
+ * Takes an optional partial KafkaPublishTaskDef
4242
+ * generates a task replacing default/fake values with provided overrides
4243
+ *
4244
+ * @param overrides overrides for defaults
4245
+ * @returns a fully defined task
4246
+ */
4247
+ declare const generateKafkaPublishTask: (overrides?: Partial<KafkaPublishTaskDef>) => KafkaPublishTaskDef;
4248
+
4249
+ /**
4250
+ * Takes an optional partial SubWorkflowTaskDef
4251
+ * generates a task replacing default/fake values with provided overrides
4252
+ *
4253
+ * @param overrides overrides for defaults
4254
+ * @returns a fully defined task
4255
+ */
4256
+ declare const generateSubWorkflowTask: (overrides?: Partial<SubWorkflowTaskDef>) => SubWorkflowTaskDef;
4257
+
4258
+ /**
4259
+ * Takes an optional partial SetVariableTaskDef
4260
+ * generates a task replacing default/fake values with provided overrides
4261
+ *
4262
+ * @param overrides overrides for defaults
4263
+ * @returns a fully defined task
4264
+ */
4265
+ declare const generateSetVariableTask: (overrides?: Partial<SetVariableTaskDef>) => SetVariableTaskDef;
4266
+
4267
+ /**
4268
+ * Takes an optional partial TerminateTaskDef
4269
+ * generates a task replacing default/fake values with provided overrides
4270
+ *
4271
+ * @param overrides overrides for defaults
4272
+ * @returns a fully defined task
4273
+ */
4274
+ declare const generateTerminateTask: (overrides?: Partial<TerminateTaskDef>) => TerminateTaskDef;
4275
+
4276
+ /**
4277
+ * Takes an optional partial WaitTaskDef
4278
+ * generates a task replacing default/fake values with provided overrides
4279
+ *
4280
+ * @param overrides overrides for defaults
4281
+ * @returns a fully defined task
4282
+ */
4283
+ declare const generateWaitTask: (overrides?: Partial<WaitTaskDef>) => WaitTaskDef;
4284
+
4285
+ declare const taskGenMapper: (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
4286
+ /**
4287
+ * Takes an optional partial WorkflowDefGen
4288
+ * generates a workflow replacing default/fake values with provided overrides
4289
+ *
4290
+ * @param overrides overrides for defaults
4291
+ * @returns a fully defined task
4292
+ */
4293
+ declare const generate: (overrides: Partial<WorkflowDefGen>) => WorkflowDef;
4294
+
4295
+ /**
4296
+ * Takes an optional partial SwitchTaskDefGen and an optional nestedMapper
4297
+ * generates a task replacing default/fake values with provided overrides
4298
+ *
4299
+ * @param overrides overrides for defaults
4300
+ * @param nestedTasksMapper function to run on array of nested tasks
4301
+ * @returns a fully defined task
4302
+ */
4303
+ declare const generateSwitchTask: (overrides?: Partial<SwitchTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => SwitchTaskDef;
4304
+ /**
4305
+ * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
4306
+ * generates a task replacing default/fake values with provided overrides
4307
+ *
4308
+ * @param overrides overrides for defaults
4309
+ * @param nestedTasksMapper function to run on array of nested tasks
4310
+ * @returns a fully defined task
4311
+ */
4312
+ declare const generateDoWhileTask: (overrides?: Partial<DoWhileTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => DoWhileTaskDef;
4313
+ /**
4314
+ * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
4315
+ * generates a task replacing default/fake values with provided overrides
4316
+ *
4317
+ * @param overrides overrides for defaults
4318
+ * @param nestedTasksMapper function to run on array of nested tasks
4319
+ * @returns a fully defined task
4320
+ */
4321
+ declare const generateForkJoinTask: (overrides?: Partial<ForkJoinTaskDefGen>, nestedMapper?: NestedTaskMapper) => ForkJoinTaskDef;
4322
+
4323
+ declare class ConductorSdkError extends Error {
4324
+ private _trace;
4325
+ private __proto__;
4326
+ constructor(message?: string, innerError?: Error);
4327
+ }
4052
4328
 
4053
- export { type Action, ApiError, type ApiRequestOptions, type ApiResult, type Auth, BaseHttpRequest, CancelError, CancelablePromise, type CircuitBreakerTransitionResponse, type Client, type ClientOptions, type CommonTaskDef, type ConductorClient, type ConductorLogLevel, type ConductorLogger, ConductorSdkError, type ConductorWorker, type Config, type ConnectivityTestInput, type ConnectivityTestResult, Consistency, DefaultLogger, type DefaultLoggerConfig, type DoWhileTaskDef, type EnhancedSignalResponse, EventClient, type EventHandler, type EventMessage, type EventTaskDef, type ExtendedEventExecution, type ExtendedTaskDef, type ExtendedWorkflowDef, type ExternalStorageLocation, type ForkJoinDynamicDef, type ForkJoinTaskDef, type GenerateTokenRequest, type HTScrollableSearchResultHumanTaskEntry, type HttpInputParameters, type HttpTaskDef, HumanExecutor, type HumanTaskAssignment, type HumanTaskDefinition, type HumanTaskEntry, type HumanTaskSearch, type HumanTaskSearchResult, type HumanTaskTemplate, type HumanTaskTrigger, type HumanTaskUser, type InlineTaskDef, type InlineTaskInputParameters, type JoinTaskDef, type JsonJQTransformTaskDef, type KafkaPublishInputParameters, type KafkaPublishTaskDef, MAX_RETRIES, MetadataClient, type Middleware, type OnCancel, type OpenAPIConfig, type OrkesApiConfig, type PollData, type ProtoRegistryEntry, type QuerySerializerOptions, type RequestOptions, type RerunWorkflowRequest, type ResolvedRequestOptions, type Response$1 as Response, ReturnStrategy, type RunnerArgs, type SaveScheduleRequest, SchedulerClient, type ScrollableSearchResultWorkflowSummary, type SearchResultHandledEventResponse, type SearchResultTask, type SearchResultTaskSummary, type SearchResultWorkflow, type SearchResultWorkflowScheduleExecutionModel, type SearchResultWorkflowSummary, type ServiceMethod, type ServiceRegistry, ServiceType, type SetVariableTaskDef, type SignalResponse, type SimpleTaskDef, type SkipTaskRequest, type StartWorkflow, type StartWorkflowRequest, type StreamEvent, type SubWorkflowParams, type SubWorkflowTaskDef, type SwitchTaskDef, type Tag, type Task, TaskClient, type TaskDef, type TaskDefTypes, type TaskDetails, type TaskErrorHandler, type TaskExecLog, type TaskFinderPredicate, type TaskListSearchResultSummary, TaskManager, type TaskManagerConfig, type TaskManagerOptions, type TaskResult, type TaskResultOutputData, type TaskResultStatus, TaskResultStatusEnum, TaskRunner, type TaskRunnerOptions, type TaskSummary, TaskType, TemplateClient, type Terminate, type TerminateTaskDef, type TimeoutPolicy, type UserFormTemplate, type WaitTaskDef, type Workflow, type WorkflowDef$1 as WorkflowDef, WorkflowExecutor, type WorkflowRun, type WorkflowSchedule, type WorkflowScheduleExecutionModel, type WorkflowScheduleModel, type WorkflowStatus, type WorkflowSummary, type WorkflowTask, completedTaskMatchingType, 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, noopLogger, orkesConductorClient, setVariableTask, simpleTask, sqsEventTask, subWorkflowTask, switchTask, taskDefinition, taskGenMapper, terminateTask, waitTaskDuration, waitTaskUntil, workflow };
4329
+ export { type AccessKey, type AccessKeyInfo, type Action, ApiError, type ApiRequestOptions, type ApiResult, ApplicationClient, type ApplicationRole, type Auth, BaseHttpRequest, CancelError, CancelablePromise, type CircuitBreakerTransitionResponse, type Client, type ClientOptions, type CommonTaskDef, type ConductorClient, type ConductorLogger, ConductorSdkError, type ConductorWorker, type Config$1 as Config, type ConnectivityTestInput, type ConnectivityTestResult, Consistency, DefaultLogger, type DoWhileTaskDef, type EnhancedSignalResponse, EventClient, type EventHandler, type EventMessage, type EventTaskDef, type ExtendedConductorApplication, type ExtendedEventExecution, type ExtendedTaskDef, type ExtendedWorkflowDef, type ExternalStorageLocation, type ForkJoinDynamicDef, type ForkJoinTaskDef, type GenerateTokenRequest, type HTScrollableSearchResultHumanTaskEntry, type HttpInputParameters, type HttpTaskDef, HumanExecutor, type HumanTaskAssignment, type HumanTaskDefinition, type HumanTaskEntry, type HumanTaskSearch, type HumanTaskSearchResult, type HumanTaskTemplate, type HumanTaskTrigger, type HumanTaskUser, type InlineTaskDef, type InlineTaskInputParameters, type JoinTaskDef, type JsonJQTransformTaskDef, type KafkaPublishInputParameters, type KafkaPublishTaskDef, MetadataClient, type Middleware, type OnCancel, type OpenAPIConfig, type OrkesApiConfig, type PollData, type PollIntervalOptions, Poller, type ProtoRegistryEntry, type QuerySerializerOptions, type RequestOptions, type RerunWorkflowRequest, type ResolvedRequestOptions, type Response$1 as Response, ReturnStrategy, type RunnerArgs, type SaveScheduleRequest, SchedulerClient, type ScrollableSearchResultWorkflowSummary, type SearchResultHandledEventResponse, type SearchResultTask, type SearchResultTaskSummary, type SearchResultWorkflow, type SearchResultWorkflowScheduleExecutionModel, type SearchResultWorkflowSummary, type ServiceMethod, type ServiceRegistry, ServiceRegistryClient, ServiceType, type SetVariableTaskDef, type SignalResponse, type SimpleTaskDef, type SkipTaskRequest, type StartWorkflow, type StartWorkflowRequest, type StreamEvent, type SubWorkflowParams, type SubWorkflowTaskDef, type SwitchTaskDef, type Tag, type Task, TaskClient, type TaskDef, type TaskDefTypes, type TaskDetails, type TaskErrorHandler, type TaskExecLog, type TaskFinderPredicate, type TaskListSearchResultSummary, TaskManager, type TaskResult, type TaskResultOutputData, type TaskResultStatus, TaskResultStatusEnum, TaskRunner, type TaskRunnerOptions, type TaskSummary, TaskType, TemplateClient, type Terminate, type TerminateTaskDef, type TimeoutPolicy, type UserFormTemplate, type UserType, type WaitTaskDef, type Workflow, type WorkflowDef, WorkflowExecutor, type WorkflowRun, type WorkflowSchedule, type WorkflowScheduleExecutionModel, type WorkflowScheduleModel, type WorkflowStatus, type WorkflowSummary, type WorkflowTask, conductorEventTask, createConductorClient, 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, noopLogger, createConductorClient as orkesConductorClient, setVariableTask, simpleTask, sqsEventTask, subWorkflowTask, switchTask, taskDefinition, taskGenMapper, terminateTask, waitTaskDuration, waitTaskUntil, workflow };