@io-orkes/conductor-javascript 2.4.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.mts 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;
@@ -1723,7 +1997,7 @@ type ServiceOptionsOrBuilder = {
1723
1997
  };
1724
1998
  type ServiceRegistry = {
1725
1999
  circuitBreakerEnabled?: boolean;
1726
- config?: Config$2;
2000
+ config?: Config;
1727
2001
  methods?: Array<ServiceMethod>;
1728
2002
  name?: string;
1729
2003
  requestParams?: Array<RequestParam>;
@@ -1795,7 +2069,7 @@ type StartWorkflowRequest = {
1795
2069
  [key: string]: string;
1796
2070
  };
1797
2071
  version?: number;
1798
- workflowDef?: WorkflowDef$1;
2072
+ workflowDef?: WorkflowDef;
1799
2073
  };
1800
2074
  type StateChangeEvent = {
1801
2075
  payload?: {
@@ -2070,12 +2344,12 @@ type Workflow = {
2070
2344
  variables?: {
2071
2345
  [key: string]: unknown;
2072
2346
  };
2073
- workflowDefinition?: WorkflowDef$1;
2347
+ workflowDefinition?: WorkflowDef;
2074
2348
  workflowId?: string;
2075
2349
  workflowName?: string;
2076
2350
  workflowVersion?: number;
2077
2351
  };
2078
- type WorkflowDef$1 = {
2352
+ type WorkflowDef = {
2079
2353
  cacheConfig?: CacheConfig;
2080
2354
  createTime?: number;
2081
2355
  createdBy?: string;
@@ -2276,320 +2550,20 @@ type WorkflowTask = {
2276
2550
  type?: string;
2277
2551
  };
2278
2552
 
2279
- type AuthToken = string | undefined;
2280
- interface Auth {
2281
- /**
2282
- * Which part of the request do we use to send the auth?
2283
- *
2284
- * @default 'header'
2285
- */
2286
- in?: 'header' | 'query' | 'cookie';
2287
- /**
2288
- * Header or query parameter name.
2289
- *
2290
- * @default 'Authorization'
2291
- */
2292
- name?: string;
2293
- scheme?: 'basic' | 'bearer';
2294
- type: 'apiKey' | 'http';
2553
+ interface CommonTaskDef {
2554
+ name: string;
2555
+ taskReferenceName: string;
2295
2556
  }
2296
-
2297
- interface SerializerOptions<T> {
2298
- /**
2299
- * @default true
2300
- */
2301
- explode: boolean;
2302
- style: T;
2557
+ declare enum Consistency {
2558
+ SYNCHRONOUS = "SYNCHRONOUS",
2559
+ DURABLE = "DURABLE",
2560
+ REGION_DURABLE = "REGION_DURABLE"
2303
2561
  }
2304
- type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
2305
- type ObjectStyle = 'form' | 'deepObject';
2306
-
2307
- type QuerySerializer = (query: Record<string, unknown>) => string;
2308
- type BodySerializer = (body: any) => any;
2309
- interface QuerySerializerOptions {
2310
- allowReserved?: boolean;
2311
- array?: SerializerOptions<ArrayStyle>;
2312
- object?: SerializerOptions<ObjectStyle>;
2313
- }
2314
-
2315
- type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
2316
- type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
2317
- /**
2318
- * Returns the final request URL.
2319
- */
2320
- buildUrl: BuildUrlFn;
2321
- getConfig: () => Config;
2322
- request: RequestFn;
2323
- setConfig: (config: Config) => Config;
2324
- } & {
2325
- [K in HttpMethod]: MethodFn;
2326
- } & ([SseFn] extends [never] ? {
2327
- sse?: never;
2328
- } : {
2329
- sse: {
2330
- [K in HttpMethod]: SseFn;
2331
- };
2332
- });
2333
- interface Config$1 {
2334
- /**
2335
- * Auth token or a function returning auth token. The resolved value will be
2336
- * added to the request payload as defined by its `security` array.
2337
- */
2338
- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
2339
- /**
2340
- * A function for serializing request body parameter. By default,
2341
- * {@link JSON.stringify()} will be used.
2342
- */
2343
- bodySerializer?: BodySerializer | null;
2344
- /**
2345
- * An object containing any HTTP headers that you want to pre-populate your
2346
- * `Headers` object with.
2347
- *
2348
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
2349
- */
2350
- headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
2351
- /**
2352
- * The request method.
2353
- *
2354
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
2355
- */
2356
- method?: Uppercase<HttpMethod>;
2357
- /**
2358
- * A function for serializing request query parameters. By default, arrays
2359
- * will be exploded in form style, objects will be exploded in deepObject
2360
- * style, and reserved characters are percent-encoded.
2361
- *
2362
- * This method will have no effect if the native `paramsSerializer()` Axios
2363
- * API function is used.
2364
- *
2365
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
2366
- */
2367
- querySerializer?: QuerySerializer | QuerySerializerOptions;
2368
- /**
2369
- * A function validating request data. This is useful if you want to ensure
2370
- * the request conforms to the desired shape, so it can be safely sent to
2371
- * the server.
2372
- */
2373
- requestValidator?: (data: unknown) => Promise<unknown>;
2374
- /**
2375
- * A function transforming response data before it's returned. This is useful
2376
- * for post-processing data, e.g. converting ISO strings into Date objects.
2377
- */
2378
- responseTransformer?: (data: unknown) => Promise<unknown>;
2379
- /**
2380
- * A function validating response data. This is useful if you want to ensure
2381
- * the response conforms to the desired shape, so it can be safely passed to
2382
- * the transformers and returned to the user.
2383
- */
2384
- responseValidator?: (data: unknown) => Promise<unknown>;
2385
- }
2386
-
2387
- type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
2388
- /**
2389
- * Fetch API implementation. You can use this option to provide a custom
2390
- * fetch instance.
2391
- *
2392
- * @default globalThis.fetch
2393
- */
2394
- fetch?: typeof fetch;
2395
- /**
2396
- * Implementing clients can call request interceptors inside this hook.
2397
- */
2398
- onRequest?: (url: string, init: RequestInit) => Promise<Request>;
2399
- /**
2400
- * Callback invoked when a network or parsing error occurs during streaming.
2401
- *
2402
- * This option applies only if the endpoint returns a stream of events.
2403
- *
2404
- * @param error The error that occurred.
2405
- */
2406
- onSseError?: (error: unknown) => void;
2407
- /**
2408
- * Callback invoked when an event is streamed from the server.
2409
- *
2410
- * This option applies only if the endpoint returns a stream of events.
2411
- *
2412
- * @param event Event streamed from the server.
2413
- * @returns Nothing (void).
2414
- */
2415
- onSseEvent?: (event: StreamEvent<TData>) => void;
2416
- serializedBody?: RequestInit['body'];
2417
- /**
2418
- * Default retry delay in milliseconds.
2419
- *
2420
- * This option applies only if the endpoint returns a stream of events.
2421
- *
2422
- * @default 3000
2423
- */
2424
- sseDefaultRetryDelay?: number;
2425
- /**
2426
- * Maximum number of retry attempts before giving up.
2427
- */
2428
- sseMaxRetryAttempts?: number;
2429
- /**
2430
- * Maximum retry delay in milliseconds.
2431
- *
2432
- * Applies only when exponential backoff is used.
2433
- *
2434
- * This option applies only if the endpoint returns a stream of events.
2435
- *
2436
- * @default 30000
2437
- */
2438
- sseMaxRetryDelay?: number;
2439
- /**
2440
- * Optional sleep function for retry backoff.
2441
- *
2442
- * Defaults to using `setTimeout`.
2443
- */
2444
- sseSleepFn?: (ms: number) => Promise<void>;
2445
- url: string;
2446
- };
2447
- interface StreamEvent<TData = unknown> {
2448
- data: TData;
2449
- event?: string;
2450
- id?: string;
2451
- retry?: number;
2452
- }
2453
- type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
2454
- stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
2455
- };
2456
-
2457
- type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
2458
- type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
2459
- type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
2460
- declare class Interceptors<Interceptor> {
2461
- fns: Array<Interceptor | null>;
2462
- clear(): void;
2463
- eject(id: number | Interceptor): void;
2464
- exists(id: number | Interceptor): boolean;
2465
- getInterceptorIndex(id: number | Interceptor): number;
2466
- update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
2467
- use(fn: Interceptor): number;
2468
- }
2469
- interface Middleware<Req, Res, Err, Options> {
2470
- error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
2471
- request: Interceptors<ReqInterceptor<Req, Options>>;
2472
- response: Interceptors<ResInterceptor<Res, Req, Options>>;
2473
- }
2474
-
2475
- type ResponseStyle = 'data' | 'fields';
2476
- interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
2477
- /**
2478
- * Base URL for all requests made by this client.
2479
- */
2480
- baseUrl?: T['baseUrl'];
2481
- /**
2482
- * Fetch API implementation. You can use this option to provide a custom
2483
- * fetch instance.
2484
- *
2485
- * @default globalThis.fetch
2486
- */
2487
- fetch?: typeof fetch;
2488
- /**
2489
- * Please don't use the Fetch client for Next.js applications. The `next`
2490
- * options won't have any effect.
2491
- *
2492
- * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
2493
- */
2494
- next?: never;
2495
- /**
2496
- * Return the response data parsed in a specified format. By default, `auto`
2497
- * will infer the appropriate method from the `Content-Type` response header.
2498
- * You can override this behavior with any of the {@link Body} methods.
2499
- * Select `stream` if you don't want to parse response data at all.
2500
- *
2501
- * @default 'auto'
2502
- */
2503
- parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
2504
- /**
2505
- * Should we return only data or multiple fields (data, error, response, etc.)?
2506
- *
2507
- * @default 'fields'
2508
- */
2509
- responseStyle?: ResponseStyle;
2510
- /**
2511
- * Throw an error instead of returning it in the response?
2512
- *
2513
- * @default false
2514
- */
2515
- throwOnError?: T['throwOnError'];
2516
- }
2517
- interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
2518
- responseStyle: TResponseStyle;
2519
- throwOnError: ThrowOnError;
2520
- }>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
2521
- /**
2522
- * Any body that you want to add to your request.
2523
- *
2524
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
2525
- */
2526
- body?: unknown;
2527
- path?: Record<string, unknown>;
2528
- query?: Record<string, unknown>;
2529
- /**
2530
- * Security mechanism(s) to use for the request.
2531
- */
2532
- security?: ReadonlyArray<Auth>;
2533
- url: Url;
2534
- }
2535
- interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
2536
- serializedBody?: string;
2537
- }
2538
- 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 : {
2539
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
2540
- request: Request;
2541
- response: Response;
2542
- }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
2543
- data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
2544
- error: undefined;
2545
- } | {
2546
- data: undefined;
2547
- error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
2548
- }) & {
2549
- request: Request;
2550
- response: Response;
2551
- }>;
2552
- interface ClientOptions {
2553
- baseUrl?: string;
2554
- responseStyle?: ResponseStyle;
2555
- throwOnError?: boolean;
2556
- }
2557
- 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>;
2558
- 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>>;
2559
- 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>;
2560
- type BuildUrlFn = <TData extends {
2561
- body?: unknown;
2562
- path?: Record<string, unknown>;
2563
- query?: Record<string, unknown>;
2564
- url: string;
2565
- }>(options: Pick<TData, 'url'> & Options<TData>) => string;
2566
- type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
2567
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
2568
- };
2569
- interface TDataShape {
2570
- body?: unknown;
2571
- headers?: unknown;
2572
- path?: unknown;
2573
- query?: unknown;
2574
- url: string;
2575
- }
2576
- type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
2577
- 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'>;
2578
-
2579
- interface CommonTaskDef {
2580
- name: string;
2581
- taskReferenceName: string;
2582
- }
2583
- declare enum Consistency {
2584
- SYNCHRONOUS = "SYNCHRONOUS",
2585
- DURABLE = "DURABLE",
2586
- REGION_DURABLE = "REGION_DURABLE"
2587
- }
2588
- declare enum ReturnStrategy {
2589
- TARGET_WORKFLOW = "TARGET_WORKFLOW",
2590
- BLOCKING_WORKFLOW = "BLOCKING_WORKFLOW",
2591
- BLOCKING_TASK = "BLOCKING_TASK",
2592
- BLOCKING_TASK_INPUT = "BLOCKING_TASK_INPUT"
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"
2593
2567
  }
2594
2568
  declare enum TaskResultStatusEnum {
2595
2569
  IN_PROGRESS = "IN_PROGRESS",
@@ -2892,735 +2866,777 @@ declare abstract class BaseHttpRequest {
2892
2866
  abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
2893
2867
  }
2894
2868
 
2895
- /**
2896
- * Functional interface for defining a worker implementation that processes tasks from a conductor queue.
2897
- *
2898
- * @remarks
2899
- * Optional items allow overriding properties on a per-worker basis. Items not overridden
2900
- * here will be inherited from the `TaskManager` options.
2901
- */
2902
- interface ConductorWorker {
2903
- taskDefName: string;
2904
- execute: (task: Task) => Promise<Omit<TaskResult, "workflowInstanceId" | "taskId">>;
2905
- domain?: string;
2906
- concurrency?: number;
2907
- pollInterval?: number;
2908
- }
2909
-
2910
- type TaskErrorHandler = (error: Error, task?: Task) => void;
2911
- interface TaskRunnerOptions {
2912
- workerID: string;
2913
- domain: string | undefined;
2914
- pollInterval?: number;
2915
- concurrency?: number;
2916
- batchPollingTimeout?: number;
2917
- }
2918
- interface RunnerArgs {
2919
- worker: ConductorWorker;
2920
- client: Client;
2921
- options: TaskRunnerOptions;
2922
- logger?: ConductorLogger;
2923
- onError?: TaskErrorHandler;
2924
- concurrency?: number;
2925
- 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;
2926
2878
  }
2927
2879
 
2928
- declare const MAX_RETRIES = 3;
2929
- declare const noopErrorHandler: TaskErrorHandler;
2930
2880
  /**
2931
- * Responsible for polling and executing tasks from a queue.
2932
- *
2933
- * Because a `poll` in conductor "pops" a task off of a conductor queue,
2934
- * each runner participates in the poll -> work -> update loop.
2935
- * We could potentially split this work into a separate "poller" and "worker" pools
2936
- * 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
2937
2882
  *
2883
+ * @param config (optional) OrkesApiConfig with keyId and keySecret
2884
+ * @param customFetch (optional) custom fetch function
2885
+ * @returns Client
2938
2886
  */
2939
- declare class TaskRunner {
2940
- _client: Client;
2941
- worker: ConductorWorker;
2942
- private logger;
2943
- private options;
2944
- errorHandler: TaskErrorHandler;
2945
- private poller;
2946
- private maxRetries;
2947
- constructor({ worker, client, options, logger, onError: errorHandler, maxRetries, }: RunnerArgs);
2948
- get isPolling(): boolean;
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
+ }>;
3088
+
3089
+ declare class ApplicationClient {
3090
+ readonly _client: Client;
3091
+ constructor(client: Client);
2949
3092
  /**
2950
- * Starts polling for work
3093
+ * Get all applications
3094
+ * @returns {Promise<ExtendedConductorApplication[]>}
3095
+ * @throws {ConductorSdkError}
2951
3096
  */
2952
- startPolling: () => void;
3097
+ getAllApplications(): Promise<ExtendedConductorApplication[]>;
2953
3098
  /**
2954
- * Stops Polling for work
3099
+ * Create an application
3100
+ * @param {string} applicationName
3101
+ * @returns {Promise<ExtendedConductorApplication>}
3102
+ * @throws {ConductorSdkError}
2955
3103
  */
2956
- stopPolling: () => Promise<void>;
2957
- updateOptions(options: Partial<TaskRunnerOptions>): void;
2958
- get getOptions(): TaskRunnerOptions;
2959
- private batchPoll;
2960
- updateTaskWithRetry: (task: Task, taskResult: TaskResult) => Promise<void>;
2961
- private executeTask;
2962
- handleUnknownError: (unknownError: unknown) => void;
2963
- }
2964
-
2965
- type TaskManagerOptions = TaskRunnerOptions;
2966
- interface TaskManagerConfig {
2967
- logger?: ConductorLogger;
2968
- options?: Partial<TaskManagerOptions>;
2969
- onError?: TaskErrorHandler;
2970
- maxRetries?: number;
2971
- }
2972
- /**
2973
- * Responsible for initializing and managing the runners that poll and work different task queues.
2974
- */
2975
- declare class TaskManager {
2976
- private workerRunners;
2977
- private readonly client;
2978
- private readonly logger;
2979
- private readonly errorHandler;
2980
- private workers;
2981
- readonly options: Required<TaskManagerOptions>;
2982
- private polling;
2983
- private maxRetries;
2984
- constructor(client: Client, workers: ConductorWorker[], config?: TaskManagerConfig);
2985
- private workerManagerWorkerOptions;
2986
- get isPolling(): boolean;
2987
- updatePollingOptionForWorker: (workerTaskDefName: string, options: Partial<TaskManagerOptions>) => void;
3104
+ createApplication(applicationName: string): Promise<ExtendedConductorApplication>;
2988
3105
  /**
2989
- * new options will get merged to existing options
2990
- * @param options new options to update polling options
3106
+ * Get application by access key id
3107
+ * @param {string} accessKeyId
3108
+ * @returns {Promise<ExtendedConductorApplication>}
3109
+ * @throws {ConductorSdkError}
2991
3110
  */
2992
- updatePollingOptions: (options: Partial<TaskManagerOptions>) => void;
2993
- sanityCheck: () => void;
3111
+ getAppByAccessKeyId(accessKeyId: string): Promise<ExtendedConductorApplication>;
2994
3112
  /**
2995
- * Start polling for tasks
3113
+ * Delete an access key
3114
+ * @param {string} applicationId
3115
+ * @param {string} keyId
3116
+ * @returns {Promise<void>}
3117
+ * @throws {ConductorSdkError}
2996
3118
  */
2997
- startPolling: () => void;
3119
+ deleteAccessKey(applicationId: string, keyId: string): Promise<void>;
2998
3120
  /**
2999
- * Stops polling for tasks
3121
+ * Toggle the status of an access key
3122
+ * @param {string} applicationId
3123
+ * @param {string} keyId
3124
+ * @returns {Promise<AccessKeyInfo>}
3125
+ * @throws {ConductorSdkError}
3000
3126
  */
3001
- stopPolling: () => Promise<void>;
3002
- }
3003
-
3004
- declare class ConductorSdkError extends Error {
3005
- private _trace;
3006
- private __proto__;
3007
- constructor(message?: string, innerError?: Error);
3008
- }
3009
- type TaskResultStatus = NonNullable<TaskResult["status"]>;
3010
- type TaskResultOutputData = NonNullable<TaskResult["outputData"]>;
3011
- interface EnhancedSignalResponse extends SignalResponse {
3012
- isTargetWorkflow(): boolean;
3013
- isBlockingWorkflow(): boolean;
3014
- isBlockingTask(): boolean;
3015
- isBlockingTaskInput(): boolean;
3016
- getWorkflow(): Workflow;
3017
- getBlockingTask(): Task;
3018
- getTaskInput(): Record<string, unknown>;
3019
- getWorkflowId(): string;
3020
- getTargetWorkflowId(): string;
3021
- hasWorkflowData(): boolean;
3022
- hasTaskData(): boolean;
3023
- getResponseType(): string;
3024
- isTerminal(): boolean;
3025
- isRunning(): boolean;
3026
- isPaused(): boolean;
3027
- getSummary(): string;
3028
- toDebugJSON(): Record<string, unknown>;
3029
- toString(): string;
3030
- }
3031
-
3032
- type TaskFinderPredicate = (task: Task) => boolean;
3033
- declare const completedTaskMatchingType: (taskType: string) => TaskFinderPredicate;
3034
- declare class WorkflowExecutor {
3035
- readonly _client: Client;
3036
- constructor(client: Client);
3127
+ toggleAccessKeyStatus(applicationId: string, keyId: string): Promise<AccessKeyInfo>;
3037
3128
  /**
3038
- * Will persist a workflow in conductor
3039
- * @param override If true will override the existing workflow with the definition
3040
- * @param workflow Complete workflow definition
3041
- * @returns null
3129
+ * Remove role from application user
3130
+ * @param {string} applicationId
3131
+ * @param {string} role
3132
+ * @returns {Promise<void>}
3133
+ * @throws {ConductorSdkError}
3042
3134
  */
3043
- registerWorkflow(override: boolean, workflow: WorkflowDef$1): Promise<void>;
3135
+ removeRoleFromApplicationUser(applicationId: string, role: string): Promise<void>;
3044
3136
  /**
3045
- * Takes a StartWorkflowRequest. returns a Promise<string> with the workflowInstanceId of the running workflow
3046
- * @param workflowRequest
3047
- * @returns
3137
+ * Add role to application
3138
+ * @param {string} applicationId
3139
+ * @param {ApplicationRole} role
3140
+ * @returns {Promise<void>}
3141
+ * @throws {ConductorSdkError}
3048
3142
  */
3049
- startWorkflow(workflowRequest: StartWorkflowRequest): Promise<string>;
3143
+ addApplicationRole(applicationId: string, role: ApplicationRole): Promise<void>;
3050
3144
  /**
3051
- * Execute a workflow synchronously (original method - backward compatible)
3145
+ * Delete an application
3146
+ * @param {string} applicationId
3147
+ * @returns {Promise<void>}
3148
+ * @throws {ConductorSdkError}
3052
3149
  */
3053
- executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef?: string): Promise<WorkflowRun>;
3150
+ deleteApplication(applicationId: string): Promise<void>;
3054
3151
  /**
3055
- * Execute a workflow with return strategy support (new method)
3152
+ * Get an application by id
3153
+ * @param {string} applicationId
3154
+ * @returns {Promise<ExtendedConductorApplication>}
3155
+ * @throws {ConductorSdkError}
3056
3156
  */
3057
- executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef: string, waitForSeconds: number, consistency: Consistency, returnStrategy: ReturnStrategy): Promise<EnhancedSignalResponse>;
3058
- startWorkflows(workflowsRequest: StartWorkflowRequest[]): Promise<string>[];
3059
- goBackToTask(workflowInstanceId: string, taskFinderPredicate: TaskFinderPredicate, rerunWorkflowRequestOverrides?: Partial<RerunWorkflowRequest>): Promise<void>;
3060
- goBackToFirstTaskMatchingType(workflowInstanceId: string, taskType: string): Promise<void>;
3157
+ getApplication(applicationId: string): Promise<ExtendedConductorApplication>;
3061
3158
  /**
3062
- * Takes an workflowInstanceId and an includeTasks and an optional retry parameter returns the whole execution status.
3063
- * If includeTasks flag is provided. Details of tasks execution will be returned as well,
3064
- * retry specifies the amount of retrys before throwing an error.
3065
- *
3066
- * @param workflowInstanceId
3067
- * @param includeTasks
3068
- * @param retry
3069
- * @returns
3159
+ * Update an application
3160
+ * @param {string} applicationId
3161
+ * @param {string} newApplicationName
3162
+ * @returns {Promise<ExtendedConductorApplication>}
3163
+ * @throws {ConductorSdkError}
3070
3164
  */
3071
- getWorkflow(workflowInstanceId: string, includeTasks: boolean, retry?: number): Promise<Workflow>;
3165
+ updateApplication(applicationId: string, newApplicationName: string): Promise<ExtendedConductorApplication>;
3072
3166
  /**
3073
- * Returns a summary of the current workflow status.
3074
- *
3075
- * @param workflowInstanceId current running workflow
3076
- * @param includeOutput flag to include output
3077
- * @param includeVariables flag to include variable
3078
- * @returns Promise<WorkflowStatus>
3167
+ * Get application's access keys
3168
+ * @param {string} applicationId
3169
+ * @returns {Promise<AccessKeyInfo[]>}
3170
+ * @throws {ConductorSdkError}
3079
3171
  */
3080
- getWorkflowStatus(workflowInstanceId: string, includeOutput: boolean, includeVariables: boolean): Promise<WorkflowStatus>;
3172
+ getAccessKeys(applicationId: string): Promise<AccessKeyInfo[]>;
3081
3173
  /**
3082
- * Returns a summary of the current workflow status.
3083
- *
3084
- * @param workflowInstanceId current running workflow
3085
- * @param includeOutput flag to include output
3086
- * @param includeVariables flag to include variable
3087
- * @returns Promise<WorkflowStatus>
3174
+ * Create an access key for an application
3175
+ * @param {string} applicationId
3176
+ * @returns {Promise<AccessKey>}
3177
+ * @throws {ConductorSdkError}
3088
3178
  */
3089
- getExecution(workflowInstanceId: string, includeTasks?: boolean): Promise<Workflow>;
3179
+ createAccessKey(applicationId: string): Promise<AccessKey>;
3090
3180
  /**
3091
- * Pauses a running workflow
3092
- * @param workflowInstanceId current workflow execution
3093
- * @returns
3181
+ * Delete application tags
3182
+ * @param {string} applicationId
3183
+ * @param {Tag[]} tags
3184
+ * @returns {Promise<void>}
3185
+ * @throws {ConductorSdkError}
3094
3186
  */
3095
- pause(workflowInstanceId: string): Promise<void>;
3187
+ deleteApplicationTags(applicationId: string, tags: Tag[]): Promise<void>;
3096
3188
  /**
3097
- * Reruns workflowInstanceId workflow. with new parameters
3098
- *
3099
- * @param workflowInstanceId current workflow execution
3100
- * @param rerunWorkflowRequest Rerun Workflow Execution Request
3101
- * @returns
3189
+ * Delete a single application tag
3190
+ * @param {string} applicationId
3191
+ * @param {Tag} tag
3192
+ * @returns {Promise<void>}
3193
+ * @throws {ConductorSdkError}
3102
3194
  */
3103
- reRun(workflowInstanceId: string, rerunWorkflowRequest?: Partial<RerunWorkflowRequest>): Promise<string>;
3195
+ deleteApplicationTag(applicationId: string, tag: Tag): Promise<void>;
3104
3196
  /**
3105
- * Restarts workflow with workflowInstanceId, if useLatestDefinition uses last defintion
3106
- * @param workflowInstanceId
3107
- * @param useLatestDefinitions
3108
- * @returns
3197
+ * Get application tags
3198
+ * @param {string} applicationId
3199
+ * @returns {Promise<Tag[]>}
3200
+ * @throws {ConductorSdkError}
3109
3201
  */
3110
- restart(workflowInstanceId: string, useLatestDefinitions: boolean): Promise<void>;
3202
+ getApplicationTags(applicationId: string): Promise<Tag[]>;
3111
3203
  /**
3112
- * Resumes a previously paused execution
3113
- *
3114
- * @param workflowInstanceId Running workflow workflowInstanceId
3115
- * @returns
3204
+ * Add application tags
3205
+ * @param {string} applicationId
3206
+ * @param {Tag[]} tags
3207
+ * @returns {Promise<void>}
3208
+ * @throws {ConductorSdkError}
3116
3209
  */
3117
- resume(workflowInstanceId: string): Promise<void>;
3210
+ addApplicationTags(applicationId: string, tags: Tag[]): Promise<void>;
3118
3211
  /**
3119
- * Retrys workflow from last failing task
3120
- * if resumeSubworkflowTasks is true will resume tasks in spawned subworkflows
3121
- *
3122
- * @param workflowInstanceId
3123
- * @param resumeSubworkflowTasks
3124
- * @returns
3212
+ * Add a single application tag
3213
+ * @param {string} applicationId
3214
+ * @param {Tag} tag
3215
+ * @returns {Promise<void>}
3216
+ * @throws {ConductorSdkError}
3125
3217
  */
3126
- retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): Promise<void>;
3218
+ addApplicationTag(applicationId: string, tag: Tag): Promise<void>;
3219
+ }
3220
+
3221
+ declare class EventClient {
3222
+ readonly _client: Client;
3223
+ constructor(client: Client);
3127
3224
  /**
3128
- * Searches for existing workflows given the following querys
3129
- *
3130
- * @param start
3131
- * @param size
3132
- * @param query
3133
- * @param freeText
3134
- * @param sort
3135
- * @param skipCache
3136
- * @returns
3225
+ * Get all the event handlers
3226
+ * @returns {Promise<EventHandler[]>}
3227
+ * @throws {ConductorSdkError}
3137
3228
  */
3138
- search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): Promise<ScrollableSearchResultWorkflowSummary>;
3229
+ getAllEventHandlers(): Promise<EventHandler[]>;
3139
3230
  /**
3140
- * Skips a task of a running workflow.
3141
- * by providing a skipTaskRequest you can set the input and the output of the skipped tasks
3142
- * @param workflowInstanceId
3143
- * @param taskReferenceName
3144
- * @param skipTaskRequest
3145
- * @returns
3146
- */
3147
- skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): Promise<void>;
3231
+ * Add event handlers
3232
+ * @param {EventHandler[]} eventHandlers
3233
+ * @returns {Promise<void>}
3234
+ * @throws {ConductorSdkError}
3235
+ */
3236
+ addEventHandlers(eventHandlers: EventHandler[]): Promise<void>;
3148
3237
  /**
3149
- * Takes an workflowInstanceId, and terminates a running workflow
3150
- * @param workflowInstanceId
3151
- * @param reason
3152
- * @returns
3238
+ * Add an event handler
3239
+ * @param {EventHandler} eventHandler
3240
+ * @returns {Promise<void>}
3241
+ * @throws {ConductorSdkError}
3153
3242
  */
3154
- terminate(workflowInstanceId: string, reason: string): Promise<void>;
3243
+ addEventHandler(eventHandler: EventHandler): Promise<void>;
3155
3244
  /**
3156
- * Takes a taskId and a workflowInstanceId. Will update the task for the corresponding taskId
3157
- * @param taskId
3158
- * @param workflowInstanceId
3159
- * @param taskStatus
3160
- * @param taskOutput
3161
- * @returns
3245
+ * Update an event handler
3246
+ * @param {EventHandler} eventHandler
3247
+ * @returns {Promise<void>}
3248
+ * @throws {ConductorSdkError}
3162
3249
  */
3163
- updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: TaskResultOutputData): Promise<string>;
3250
+ updateEventHandler(eventHandler: EventHandler): Promise<void>;
3164
3251
  /**
3165
- * Updates a task by reference Name
3166
- * @param taskReferenceName
3167
- * @param workflowInstanceId
3168
- * @param status
3169
- * @param taskOutput
3170
- * @returns
3252
+ * Handle an incoming event
3253
+ * @param {Record<string, string>} data
3254
+ * @returns {Promise<void>}
3255
+ * @throws {ConductorSdkError}
3171
3256
  */
3172
- updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: TaskResultOutputData): Promise<string>;
3257
+ handleIncomingEvent(data: Record<string, string>): Promise<void>;
3173
3258
  /**
3174
- *
3175
- * @param taskId
3176
- * @returns
3259
+ * Get an event handler by name
3260
+ * @param {string} eventHandlerName
3261
+ * @returns {Promise<EventHandler>}
3262
+ * @throws {ConductorSdkError}
3177
3263
  */
3178
- getTask(taskId: string): Promise<Task>;
3264
+ getEventHandlerByName(eventHandlerName: string): Promise<EventHandler>;
3179
3265
  /**
3180
- * Updates a task by reference name synchronously and returns the complete workflow
3181
- * @param taskReferenceName
3182
- * @param workflowInstanceId
3183
- * @param status
3184
- * @param taskOutput
3185
- * @param workerId - Optional
3186
- * @returns Promise<Workflow>
3266
+ * Get all queue configs
3267
+ * @returns {Promise<Record<string, string>>}
3268
+ * @throws {ConductorSdkError}
3187
3269
  */
3188
- updateTaskSync(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, workerId?: string): Promise<Workflow>;
3270
+ getAllQueueConfigs(): Promise<Record<string, string>>;
3189
3271
  /**
3190
- * Signals a workflow task and returns data based on the specified return strategy
3191
- * @param workflowInstanceId - Workflow instance ID to signal
3192
- * @param status - Task status to set
3193
- * @param taskOutput - Output data for the task
3194
- * @param returnStrategy - Optional strategy for what data to return (defaults to TARGET_WORKFLOW)
3195
- * @returns Promise<SignalResponse> with data based on the return strategy
3272
+ * Delete queue config
3273
+ * @param {string} queueType
3274
+ * @param {string} queueName
3275
+ * @returns {Promise<void>}
3276
+ * @throws {ConductorSdkError}
3196
3277
  */
3197
- signal(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, returnStrategy?: ReturnStrategy): Promise<EnhancedSignalResponse>;
3278
+ deleteQueueConfig(queueType: string, queueName: string): Promise<void>;
3198
3279
  /**
3199
- * Signals a workflow task asynchronously (fire-and-forget)
3200
- * @param workflowInstanceId - Workflow instance ID to signal
3201
- * @param status - Task status to set
3202
- * @param taskOutput - Output data for the task
3203
- * @returns Promise<void>
3280
+ * Get queue config
3281
+ * @param {string} queueType
3282
+ * @param {string} queueName
3283
+ * @returns {Promise<Record<string, unknown>>}
3284
+ * @throws {ConductorSdkError}
3204
3285
  */
3205
- signalAsync(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData): Promise<void>;
3206
- }
3207
-
3208
- interface PollIntervalOptions {
3209
- pollInterval: number;
3210
- maxPollTimes: number;
3211
- }
3212
- declare class HumanExecutor {
3213
- readonly _client: Client;
3214
- constructor(client: Client);
3286
+ getQueueConfig(queueType: string, queueName: string): Promise<Record<string, unknown>>;
3215
3287
  /**
3216
- * @deprecated use search instead
3217
- * Takes a set of filter parameters. return matches of human tasks for that set of parameters
3218
- * @param state
3219
- * @param assignee
3220
- * @param assigneeType
3221
- * @param claimedBy
3222
- * @param taskName
3223
- * @param freeText
3224
- * @param includeInputOutput
3225
- * @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}
3226
3293
  */
3227
- 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[]>;
3294
+ getEventHandlersForEvent(event: string, activeOnly?: boolean): Promise<EventHandler[]>;
3228
3295
  /**
3229
- * Takes a set of filter parameters. return matches of human tasks for that set of parameters
3230
- * @param state
3231
- * @param assignee
3232
- * @param assigneeType
3233
- * @param claimedBy
3234
- * @param taskName
3235
- * @param freeText
3236
- * @param includeInputOutput
3237
- * @returns Promise<HumanTaskEntry[]>
3296
+ * Remove an event handler by name
3297
+ * @param {string} name
3298
+ * @returns {Promise<void>}
3299
+ * @throws {ConductorSdkError}
3238
3300
  */
3239
- search(searchParams: Partial<HumanTaskSearch>): Promise<HumanTaskEntry[]>;
3301
+ removeEventHandler(name: string): Promise<void>;
3240
3302
  /**
3241
- * Takes a set of filter parameters. An polling interval options. will poll until the task returns a result
3242
- * @param state
3243
- * @param assignee
3244
- * @param assigneeType
3245
- * @param claimedBy
3246
- * @param taskName
3247
- * @param freeText
3248
- * @param includeInputOutput
3249
- * @returns Promise<HumanTaskEntry[]>
3303
+ * Get tags for an event handler
3304
+ * @param {string} name
3305
+ * @returns {Promise<Tag[]>}
3306
+ * @throws {ConductorSdkError}
3250
3307
  */
3251
- pollSearch(searchParams: Partial<HumanTaskSearch>, { pollInterval, maxPollTimes, }?: PollIntervalOptions): Promise<HumanTaskEntry[]>;
3308
+ getTagsForEventHandler(name: string): Promise<Tag[]>;
3252
3309
  /**
3253
- * Returns task for a given task id
3254
- * @param taskId
3255
- * @returns
3310
+ * Put tags for an event handler
3311
+ * @param {string} name
3312
+ * @param {Tag[]} tags
3313
+ * @returns {Promise<void>}
3314
+ * @throws {ConductorSdkError}
3256
3315
  */
3257
- getTaskById(taskId: string): Promise<HumanTaskEntry>;
3316
+ putTagForEventHandler(name: string, tags: Tag[]): Promise<void>;
3258
3317
  /**
3259
- * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
3260
- * @param taskId
3261
- * @param assignee
3262
- * @returns
3318
+ * Delete tags for an event handler
3319
+ * @param {string} name
3320
+ * @param {Tag[]} tags
3321
+ * @returns {Promise<void>}
3322
+ * @throws {ConductorSdkError}
3263
3323
  */
3264
- claimTaskAsExternalUser(taskId: string, assignee: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3324
+ deleteTagsForEventHandler(name: string, tags: Tag[]): Promise<void>;
3265
3325
  /**
3266
- * Claim task as conductor user
3267
- * @param taskId
3268
- * @returns
3326
+ * Delete a tag for an event handler
3327
+ * @param {string} name
3328
+ * @param {Tag} tag
3329
+ * @returns {Promise<void>}
3330
+ * @throws {ConductorSdkError}
3269
3331
  */
3270
- claimTaskAsConductorUser(taskId: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3332
+ deleteTagForEventHandler(name: string, tag: Tag): Promise<void>;
3271
3333
  /**
3272
- * Claim task as conductor user
3273
- * @param taskId
3274
- * @param assignee
3275
- * @returns
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}
3276
3338
  */
3277
- releaseTask(taskId: string): Promise<void>;
3339
+ testConnectivity(input: ConnectivityTestInput): Promise<ConnectivityTestResult>;
3278
3340
  /**
3279
- * Returns a HumanTaskTemplateEntry for a given name and version
3280
- * @param templateId
3281
- * @returns
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}
3282
3348
  */
3283
- getTemplateByNameVersion(name: string, version: number): Promise<HumanTaskTemplate>;
3349
+ putQueueConfig(queueType: string, queueName: string, config: string): Promise<void>;
3284
3350
  /**
3285
- * @deprecated use getTemplate instead. name will be used as id here with version 1
3286
- * Returns a HumanTaskTemplateEntry for a given templateId
3287
- * @param templateId
3288
- * @returns
3351
+ * Test endpoint (as exposed by API)
3352
+ * @returns {Promise<EventHandler>}
3353
+ * @throws {ConductorSdkError}
3289
3354
  */
3290
- getTemplateById(templateNameVersionOne: string): Promise<HumanTaskTemplate>;
3355
+ test(): Promise<EventHandler>;
3291
3356
  /**
3292
- * Takes a taskId and a partial body. will update with given body
3293
- * @param taskId
3294
- * @param requestBody
3357
+ * Get all active event handlers (execution view)
3358
+ * @returns {Promise<SearchResultHandledEventResponse>}
3359
+ * @throws {ConductorSdkError}
3295
3360
  */
3296
- updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, unknown>>): Promise<void>;
3361
+ getAllActiveEventHandlers(): Promise<SearchResultHandledEventResponse>;
3297
3362
  /**
3298
- * Takes a taskId and an optional partial body. will complete the task with the given body
3299
- * @param taskId
3300
- * @param requestBody
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}
3301
3368
  */
3302
- completeTask(taskId: string, requestBody?: Record<string, Record<string, unknown>>): Promise<void>;
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[]>;
3303
3385
  }
3304
3386
 
3305
- declare const doWhileTask: (taskRefName: string, terminationCondition: string, tasks: TaskDefTypes[], optional?: boolean) => DoWhileTaskDef;
3306
- declare const newLoopTask: (taskRefName: string, iterations: number, tasks: TaskDefTypes[], optional?: boolean) => DoWhileTaskDef;
3307
-
3308
- declare const dynamicForkTask: (taskReferenceName: string, preForkTasks?: TaskDefTypes[], dynamicTasksInput?: string, optional?: boolean) => ForkJoinDynamicDef;
3309
-
3310
- declare const eventTask: (taskReferenceName: string, eventPrefix: string, eventSuffix: string, optional?: boolean) => EventTaskDef;
3311
- declare const sqsEventTask: (taskReferenceName: string, queueName: string, optional?: boolean) => EventTaskDef;
3312
- declare const conductorEventTask: (taskReferenceName: string, eventName: string, optional?: boolean) => EventTaskDef;
3313
-
3314
- declare const forkTask: (taskReferenceName: string, forkTasks: TaskDefTypes[]) => ForkJoinTaskDef;
3315
- declare const forkTaskJoin: (taskReferenceName: string, forkTasks: TaskDefTypes[], optional?: boolean) => [ForkJoinTaskDef, JoinTaskDef];
3316
-
3317
- declare const httpTask: (taskReferenceName: string, inputParameters: HttpInputParameters, asyncComplete?: boolean, optional?: boolean) => HttpTaskDef;
3318
-
3319
- declare const inlineTask: (taskReferenceName: string, script: string, evaluatorType?: "javascript" | "graaljs", optional?: boolean) => InlineTaskDef;
3320
-
3321
- declare const joinTask: (taskReferenceName: string, joinOn: string[], optional?: boolean) => JoinTaskDef;
3322
-
3323
- declare const jsonJqTask: (taskReferenceName: string, script: string, optional?: boolean) => JsonJQTransformTaskDef;
3324
-
3325
- declare const kafkaPublishTask: (taskReferenceName: string, kafka_request: KafkaPublishInputParameters, optional?: boolean) => KafkaPublishTaskDef;
3326
-
3327
- declare const setVariableTask: (taskReferenceName: string, inputParameters: Record<string, unknown>, optional?: boolean) => SetVariableTaskDef;
3328
-
3329
- declare const simpleTask: (taskReferenceName: string, name: string, inputParameters: Record<string, unknown>, optional?: boolean) => SimpleTaskDef;
3330
-
3331
- declare const subWorkflowTask: (taskReferenceName: string, workflowName: string, version?: number, optional?: boolean) => SubWorkflowTaskDef;
3332
-
3333
- declare const switchTask: (taskReferenceName: string, expression: string, decisionCases?: Record<string, TaskDefTypes[]>, defaultCase?: TaskDefTypes[], optional?: boolean) => SwitchTaskDef;
3334
-
3335
- declare const taskDefinition: ({ name, ownerApp, description, retryCount, timeoutSeconds, inputKeys, outputKeys, timeoutPolicy, retryLogic, retryDelaySeconds, responseTimeoutSeconds, concurrentExecLimit, inputTemplate, rateLimitPerFrequency, rateLimitFrequencyInSeconds, ownerEmail, pollTimeoutSeconds, backoffScaleFactor, }: ExtendedTaskDef) => TaskDef;
3336
-
3337
- declare const terminateTask: (taskReferenceName: string, status: "COMPLETED" | "FAILED", terminationReason?: string) => TerminateTaskDef;
3338
-
3339
- declare const waitTaskDuration: (taskReferenceName: string, duration: string, optional?: boolean) => WaitTaskDef;
3340
- declare const waitTaskUntil: (taskReferenceName: string, until: string, optional?: boolean) => WaitTaskDef;
3341
-
3342
- declare const workflow: (name: string, tasks: TaskDefTypes[]) => WorkflowDef$1;
3343
-
3344
- /**
3345
- * Takes an optional partial SimpleTaskDef
3346
- * generates a task replacing default values with provided overrides
3347
- *
3348
- * @param overrides overrides for defaults
3349
- * @returns a fully defined task
3350
- */
3351
- declare const generateSimpleTask: (overrides?: Partial<SimpleTaskDef>) => SimpleTaskDef;
3352
-
3353
- /**
3354
- * Takes an optional partial EventTaskDef
3355
- * generates a task replacing default/fake values with provided overrides
3356
- *
3357
- * @param overrides overrides for defaults
3358
- * @returns a fully defined task
3359
- */
3360
- declare const generateEventTask: (overrides?: Partial<EventTaskDef>) => EventTaskDef;
3361
-
3362
- type TaskDefTypesGen = SimpleTaskDef | DoWhileTaskDefGen | EventTaskDef | ForkJoinTaskDefGen | ForkJoinDynamicDef | HttpTaskDef | InlineTaskDefGen | JsonJQTransformTaskDef | KafkaPublishTaskDef | SetVariableTaskDef | SubWorkflowTaskDef | SwitchTaskDefGen | TerminateTaskDef | JoinTaskDef | WaitTaskDef;
3363
- interface WorkflowDefGen extends Omit<WorkflowDef$1, "tasks"> {
3364
- tasks: Partial<TaskDefTypesGen>[];
3387
+ interface ConductorLogger {
3388
+ info(...args: unknown[]): void;
3389
+ error(...args: unknown[]): void;
3390
+ debug(...args: unknown[]): void;
3365
3391
  }
3366
- type ForkJoinTaskDefGen = Omit<ForkJoinTaskDef, "forkTasks"> & {
3367
- forkTasks: Partial<TaskDefTypesGen>[][];
3368
- };
3369
- type SwitchTaskDefGen = Omit<SwitchTaskDef, "decisionCases" | "defaultCase"> & {
3370
- decisionCases: Record<string, Partial<TaskDefTypesGen>[]>;
3371
- defaultCase: Partial<TaskDefTypesGen>[];
3372
- };
3373
- type DoWhileTaskDefGen = Omit<DoWhileTaskDef, "loopOver"> & {
3374
- loopOver: Partial<TaskDefTypesGen>[];
3375
- };
3376
- interface InlineTaskInputParametersGen extends Omit<InlineTaskInputParameters, "expression"> {
3377
- expression: string | ((...args: never[]) => unknown);
3392
+ type ConductorLogLevel = keyof typeof LOG_LEVELS;
3393
+ interface DefaultLoggerConfig {
3394
+ level?: ConductorLogLevel;
3395
+ tags?: object[];
3378
3396
  }
3379
- interface InlineTaskDefGen extends Omit<InlineTaskDef, "inputParameters"> {
3380
- 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;
3381
3410
  }
3382
- type NestedTaskMapper = (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
3383
-
3384
- declare const generateJoinTask: (overrides?: Partial<JoinTaskDef>) => JoinTaskDef;
3385
-
3386
- /**
3387
- * Takes an optional partial HttpTaskDef
3388
- * generates a task replacing default/fake values with provided overrides
3389
- *
3390
- * @param overrides overrides for defaults
3391
- * @returns a fully defined task
3392
- */
3393
- declare const generateHTTPTask: (overrides?: Partial<HttpTaskDef>) => HttpTaskDef;
3394
-
3395
- /**
3396
- * Takes an optional partial InlineTaskDefGen
3397
- * generates a task replacing default/fake values with provided overrides
3398
- *
3399
- * <b>note</b> that the inputParameters.expression can be either a string containing javascript
3400
- * or a function thar returns an ES5 function
3401
- *
3402
- * @param overrides overrides for defaults
3403
- * @returns a fully defined task
3404
- */
3405
- declare const generateInlineTask: (override?: Partial<InlineTaskDefGen>) => InlineTaskDef;
3411
+ declare const noopLogger: ConductorLogger;
3406
3412
 
3407
- /**
3408
- * Takes an optional partial JsonJQTransformTaskDef
3409
- * generates a task replacing default/fake values with provided overrides
3410
- *
3411
- * @param overrides overrides for defaults
3412
- * @returns a fully defined task
3413
- */
3414
- declare const generateJQTransformTask: (overrides?: Partial<JsonJQTransformTaskDef>) => JsonJQTransformTaskDef;
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
+ }
3415
3449
 
3416
3450
  /**
3417
- * Takes an optional partial KafkaPublishTaskDef
3418
- * generates a task replacing default/fake values with provided overrides
3419
- *
3420
- * @param overrides overrides for defaults
3421
- * @returns a fully defined task
3451
+ * Responsible for initializing and managing the runners that poll and work different task queues.
3422
3452
  */
3423
- declare const generateKafkaPublishTask: (overrides?: Partial<KafkaPublishTaskDef>) => KafkaPublishTaskDef;
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
+ }
3424
3481
 
3425
3482
  /**
3426
- * Takes an optional partial SubWorkflowTaskDef
3427
- * generates a task replacing default/fake values with provided overrides
3483
+ * Responsible for polling and executing tasks from a queue.
3428
3484
  *
3429
- * @param overrides overrides for defaults
3430
- * @returns a fully defined task
3431
- */
3432
- declare const generateSubWorkflowTask: (overrides?: Partial<SubWorkflowTaskDef>) => SubWorkflowTaskDef;
3433
-
3434
- /**
3435
- * Takes an optional partial SetVariableTaskDef
3436
- * generates a task replacing default/fake values with provided overrides
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.
3437
3489
  *
3438
- * @param overrides overrides for defaults
3439
- * @returns a fully defined task
3440
3490
  */
3441
- declare const generateSetVariableTask: (overrides?: Partial<SetVariableTaskDef>) => SetVariableTaskDef;
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
+ }
3442
3516
 
3443
- /**
3444
- * Takes an optional partial TerminateTaskDef
3445
- * generates a task replacing default/fake values with provided overrides
3446
- *
3447
- * @param overrides overrides for defaults
3448
- * @returns a fully defined task
3449
- */
3450
- 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
+ }
3451
3542
 
3452
- /**
3453
- * Takes an optional partial WaitTaskDef
3454
- * generates a task replacing default/fake values with provided overrides
3455
- *
3456
- * @param overrides overrides for defaults
3457
- * @returns a fully defined task
3458
- */
3459
- 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
+ }
3460
3548
 
3461
- declare const taskGenMapper: (tasks: Partial<TaskDefTypesGen>[]) => TaskDefTypes[];
3462
- /**
3463
- * Takes an optional partial WorkflowDefGen
3464
- * generates a workflow replacing default/fake values with provided overrides
3465
- *
3466
- * @param overrides overrides for defaults
3467
- * @returns a fully defined task
3468
- */
3469
- declare const generate: (overrides: Partial<WorkflowDefGen>) => WorkflowDef;
3470
-
3471
- /**
3472
- * Takes an optional partial SwitchTaskDefGen and an optional nestedMapper
3473
- * generates a task replacing default/fake values with provided overrides
3474
- *
3475
- * @param overrides overrides for defaults
3476
- * @param nestedTasksMapper function to run on array of nested tasks
3477
- * @returns a fully defined task
3478
- */
3479
- declare const generateSwitchTask: (overrides?: Partial<SwitchTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => SwitchTaskDef;
3480
- /**
3481
- * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
3482
- * generates a task replacing default/fake values with provided overrides
3483
- *
3484
- * @param overrides overrides for defaults
3485
- * @param nestedTasksMapper function to run on array of nested tasks
3486
- * @returns a fully defined task
3487
- */
3488
- declare const generateDoWhileTask: (overrides?: Partial<DoWhileTaskDefGen>, nestedTasksMapper?: NestedTaskMapper) => DoWhileTaskDef;
3489
- /**
3490
- * Takes an optional partial DoWhileTaskDefGen and an optional nestedMapper
3491
- * generates a task replacing default/fake values with provided overrides
3492
- *
3493
- * @param overrides overrides for defaults
3494
- * @param nestedTasksMapper function to run on array of nested tasks
3495
- * @returns a fully defined task
3496
- */
3497
- declare const generateForkJoinTask: (overrides?: Partial<ForkJoinTaskDefGen>, nestedMapper?: NestedTaskMapper) => ForkJoinTaskDef;
3498
-
3499
- declare class SchedulerClient {
3549
+ declare class HumanExecutor {
3500
3550
  readonly _client: Client;
3501
3551
  constructor(client: Client);
3502
3552
  /**
3503
- * Create or update a schedule for a specified workflow with a corresponding start workflow request
3504
- * @param requestBody
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
3505
3562
  * @returns
3506
3563
  */
3507
- saveSchedule(param: SaveScheduleRequest): Promise<void>;
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[]>;
3508
3565
  /**
3509
- * Searches for existing scheduler execution based on below parameters
3510
- *
3511
- * @param start
3512
- * @param size
3513
- * @param sort
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
3514
3572
  * @param freeText
3515
- * @param query
3516
- * @returns SearchResultWorkflowScheduleExecutionModel
3573
+ * @param includeInputOutput
3574
+ * @returns Promise<HumanTaskEntry[]>
3517
3575
  */
3518
- search(start: number, size?: number, sort?: string, freeText?: string, query?: string): Promise<SearchResultWorkflowScheduleExecutionModel>;
3576
+ search(searchParams: Partial<HumanTaskSearch>): Promise<HumanTaskEntry[]>;
3519
3577
  /**
3520
- * Get an existing schedule by name
3521
- * @param name
3522
- * @returns WorkflowSchedule
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[]>
3523
3587
  */
3524
- getSchedule(name: string): Promise<WorkflowSchedule>;
3588
+ pollSearch(searchParams: Partial<HumanTaskSearch>, { pollInterval, maxPollTimes, }?: PollIntervalOptions): Promise<HumanTaskEntry[]>;
3525
3589
  /**
3526
- * Pauses an existing schedule by name
3527
- * @param name
3590
+ * Returns task for a given task id
3591
+ * @param taskId
3528
3592
  * @returns
3529
3593
  */
3530
- pauseSchedule(name: string): Promise<void>;
3594
+ getTaskById(taskId: string): Promise<HumanTaskEntry>;
3531
3595
  /**
3532
- * Resume a paused schedule by name
3533
- *
3534
- * @param name
3596
+ * Assigns taskId to assignee. If the task is already assigned to another user, this will fail.
3597
+ * @param taskId
3598
+ * @param assignee
3535
3599
  * @returns
3536
3600
  */
3537
- resumeSchedule(name: string): Promise<void>;
3601
+ claimTaskAsExternalUser(taskId: string, assignee: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3538
3602
  /**
3539
- * Deletes an existing scheduler execution by name
3540
- *
3541
- * @param name
3603
+ * Claim task as conductor user
3604
+ * @param taskId
3542
3605
  * @returns
3543
3606
  */
3544
- deleteSchedule(name: string): Promise<void>;
3545
- /**
3546
- * Get all existing workflow schedules and optionally filter by workflow name
3547
- * @param workflowName
3548
- * @returns Array<WorkflowScheduleModel>
3549
- */
3550
- getAllSchedules(workflowName?: string): Promise<WorkflowScheduleModel[]>;
3551
- /**
3552
- * Get list of the next x (default 3, max 5) execution times for a scheduler
3553
- * @param cronExpression
3554
- * @param scheduleStartTime
3555
- * @param scheduleEndTime
3556
- * @param limit
3557
- * @returns number OK
3558
- * @throws ApiError
3559
- */
3560
- getNextFewSchedules(cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, limit?: number): Promise<number[]>;
3561
- /**
3562
- * Pause all scheduling in a single conductor server instance (for debugging only)
3563
- * @returns any OK
3564
- * @throws ApiError
3565
- */
3566
- pauseAllSchedules(): Promise<void>;
3607
+ claimTaskAsConductorUser(taskId: string, options?: Record<string, boolean>): Promise<HumanTaskEntry>;
3567
3608
  /**
3568
- * Requeue all execution records
3569
- * @returns any OK
3570
- * @throws ApiError
3609
+ * Claim task as conductor user
3610
+ * @param taskId
3611
+ * @param assignee
3612
+ * @returns
3571
3613
  */
3572
- requeueAllExecutionRecords(): Promise<void>;
3614
+ releaseTask(taskId: string): Promise<void>;
3573
3615
  /**
3574
- * Resume all scheduling
3575
- * @returns any OK
3576
- * @throws ApiError
3616
+ * Returns a HumanTaskTemplateEntry for a given name and version
3617
+ * @param templateId
3618
+ * @returns
3577
3619
  */
3578
- resumeAllSchedules(): Promise<void>;
3579
- }
3580
-
3581
- declare class TaskClient {
3582
- readonly _client: Client;
3583
- constructor(client: Client);
3620
+ getTemplateByNameVersion(name: string, version: number): Promise<HumanTaskTemplate>;
3584
3621
  /**
3585
- * Searches for existing scheduler execution based on below parameters
3586
- *
3587
- * @param start
3588
- * @param size
3589
- * @param sort
3590
- * @param freeText
3591
- * @param query
3592
- * @returns SearchResultWorkflowScheduleExecutionModel
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
3593
3626
  */
3594
- search(start: number, size: number, sort: string | undefined, freeText: string, query: string): Promise<SearchResultTaskSummary>;
3627
+ getTemplateById(templateNameVersionOne: string): Promise<HumanTaskTemplate>;
3595
3628
  /**
3596
- * Get an existing schedule by Id
3629
+ * Takes a taskId and a partial body. will update with given body
3597
3630
  * @param taskId
3598
- * @returns Task
3599
- */
3600
- getTask(taskId: string): Promise<Task>;
3601
- /**
3602
- * Update task result status
3603
- *
3604
- * @param workflowId
3605
- * @param taskReferenceName
3606
- * @param status
3607
- * @param outputData
3608
- * @param workerId
3609
- * @returns
3631
+ * @param requestBody
3610
3632
  */
3611
- updateTaskResult(workflowId: string, taskRefName: string, status: TaskResultStatus, outputData: Record<string, unknown>): Promise<string>;
3612
- }
3613
-
3614
- declare class TemplateClient {
3615
- readonly _client: Client;
3616
- constructor(client: Client);
3633
+ updateTaskOutput(taskId: string, requestBody: Record<string, Record<string, unknown>>): Promise<void>;
3617
3634
  /**
3618
- * Register a new human task template
3619
- *
3620
- * @param template
3621
- * @returns
3635
+ * Takes a taskId and an optional partial body. will complete the task with the given body
3636
+ * @param taskId
3637
+ * @param requestBody
3622
3638
  */
3623
- registerTemplate(template: HumanTaskTemplate, asNewVersion?: boolean): Promise<HumanTaskTemplate>;
3639
+ completeTask(taskId: string, requestBody?: Record<string, Record<string, unknown>>): Promise<void>;
3624
3640
  }
3625
3641
 
3626
3642
  declare class MetadataClient {
@@ -3676,7 +3692,7 @@ declare class MetadataClient {
3676
3692
  * @param overwrite
3677
3693
  * @returns
3678
3694
  */
3679
- getWorkflowDef(name: string, version?: number, metadata?: boolean): Promise<WorkflowDef$1>;
3695
+ getWorkflowDef(name: string, version?: number, metadata?: boolean): Promise<WorkflowDef>;
3680
3696
  /**
3681
3697
  * Unregister (overwrite: true) a workflow definition
3682
3698
  *
@@ -3687,170 +3703,86 @@ declare class MetadataClient {
3687
3703
  unregisterWorkflow(workflowName: string, version?: number): Promise<void>;
3688
3704
  }
3689
3705
 
3690
- declare class EventClient {
3706
+ declare class SchedulerClient {
3691
3707
  readonly _client: Client;
3692
3708
  constructor(client: Client);
3693
3709
  /**
3694
- * Get all the event handlers
3695
- * @returns {Promise<EventHandler[]>}
3696
- * @throws {ConductorSdkError}
3710
+ * Create or update a schedule for a specified workflow with a corresponding start workflow request
3711
+ * @param requestBody
3712
+ * @returns
3697
3713
  */
3698
- getAllEventHandlers(): Promise<EventHandler[]>;
3714
+ saveSchedule(param: SaveScheduleRequest): Promise<void>;
3699
3715
  /**
3700
- * Add event handlers
3701
- * @param {EventHandler[]} eventHandlers
3702
- * @returns {Promise<void>}
3703
- * @throws {ConductorSdkError}
3716
+ * Searches for existing scheduler execution based on below parameters
3717
+ *
3718
+ * @param start
3719
+ * @param size
3720
+ * @param sort
3721
+ * @param freeText
3722
+ * @param query
3723
+ * @returns SearchResultWorkflowScheduleExecutionModel
3704
3724
  */
3705
- addEventHandlers(eventHandlers: EventHandler[]): Promise<void>;
3725
+ search(start: number, size?: number, sort?: string, freeText?: string, query?: string): Promise<SearchResultWorkflowScheduleExecutionModel>;
3706
3726
  /**
3707
- * Add an event handler
3708
- * @param {EventHandler} eventHandler
3709
- * @returns {Promise<void>}
3710
- * @throws {ConductorSdkError}
3727
+ * Get an existing schedule by name
3728
+ * @param name
3729
+ * @returns WorkflowSchedule
3711
3730
  */
3712
- addEventHandler(eventHandler: EventHandler): Promise<void>;
3731
+ getSchedule(name: string): Promise<WorkflowSchedule>;
3713
3732
  /**
3714
- * Update an event handler
3715
- * @param {EventHandler} eventHandler
3716
- * @returns {Promise<void>}
3717
- * @throws {ConductorSdkError}
3733
+ * Pauses an existing schedule by name
3734
+ * @param name
3735
+ * @returns
3718
3736
  */
3719
- updateEventHandler(eventHandler: EventHandler): Promise<void>;
3737
+ pauseSchedule(name: string): Promise<void>;
3720
3738
  /**
3721
- * Handle an incoming event
3722
- * @param {Record<string, string>} data
3723
- * @returns {Promise<void>}
3724
- * @throws {ConductorSdkError}
3739
+ * Resume a paused schedule by name
3740
+ *
3741
+ * @param name
3742
+ * @returns
3725
3743
  */
3726
- handleIncomingEvent(data: Record<string, string>): Promise<void>;
3744
+ resumeSchedule(name: string): Promise<void>;
3727
3745
  /**
3728
- * Get an event handler by name
3729
- * @param {string} eventHandlerName
3730
- * @returns {Promise<EventHandler>}
3731
- * @throws {ConductorSdkError}
3746
+ * Deletes an existing scheduler execution by name
3747
+ *
3748
+ * @param name
3749
+ * @returns
3732
3750
  */
3733
- getEventHandlerByName(eventHandlerName: string): Promise<EventHandler>;
3751
+ deleteSchedule(name: string): Promise<void>;
3734
3752
  /**
3735
- * Get all queue configs
3736
- * @returns {Promise<Record<string, string>>}
3737
- * @throws {ConductorSdkError}
3753
+ * Get all existing workflow schedules and optionally filter by workflow name
3754
+ * @param workflowName
3755
+ * @returns Array<WorkflowScheduleModel>
3738
3756
  */
3739
- getAllQueueConfigs(): Promise<Record<string, string>>;
3740
- /**
3741
- * Delete queue config
3742
- * @param {string} queueType
3743
- * @param {string} queueName
3744
- * @returns {Promise<void>}
3745
- * @throws {ConductorSdkError}
3746
- */
3747
- deleteQueueConfig(queueType: string, queueName: string): Promise<void>;
3748
- /**
3749
- * Get queue config
3750
- * @param {string} queueType
3751
- * @param {string} queueName
3752
- * @returns {Promise<Record<string, unknown>>}
3753
- * @throws {ConductorSdkError}
3754
- */
3755
- getQueueConfig(queueType: string, queueName: string): Promise<Record<string, unknown>>;
3756
- /**
3757
- * Get event handlers for a given event
3758
- * @param {string} event
3759
- * @param {boolean} [activeOnly=false] Only return active handlers.
3760
- * @returns {Promise<EventHandler[]>}
3761
- * @throws {ConductorSdkError}
3762
- */
3763
- getEventHandlersForEvent(event: string, activeOnly?: boolean): Promise<EventHandler[]>;
3764
- /**
3765
- * Remove an event handler by name
3766
- * @param {string} name
3767
- * @returns {Promise<void>}
3768
- * @throws {ConductorSdkError}
3769
- */
3770
- removeEventHandler(name: string): Promise<void>;
3771
- /**
3772
- * Get tags for an event handler
3773
- * @param {string} name
3774
- * @returns {Promise<Tag[]>}
3775
- * @throws {ConductorSdkError}
3776
- */
3777
- getTagsForEventHandler(name: string): Promise<Tag[]>;
3778
- /**
3779
- * Put tags for an event handler
3780
- * @param {string} name
3781
- * @param {Tag[]} tags
3782
- * @returns {Promise<void>}
3783
- * @throws {ConductorSdkError}
3784
- */
3785
- putTagForEventHandler(name: string, tags: Tag[]): Promise<void>;
3786
- /**
3787
- * Delete tags for an event handler
3788
- * @param {string} name
3789
- * @param {Tag[]} tags
3790
- * @returns {Promise<void>}
3791
- * @throws {ConductorSdkError}
3792
- */
3793
- deleteTagsForEventHandler(name: string, tags: Tag[]): Promise<void>;
3794
- /**
3795
- * Delete a tag for an event handler
3796
- * @param {string} name
3797
- * @param {Tag} tag
3798
- * @returns {Promise<void>}
3799
- * @throws {ConductorSdkError}
3800
- */
3801
- deleteTagForEventHandler(name: string, tag: Tag): Promise<void>;
3802
- /**
3803
- * Test connectivity for a given queue using a workflow with EVENT task and an EventHandler
3804
- * @param {ConnectivityTestInput} input
3805
- * @returns {Promise<ConnectivityTestResult>}
3806
- * @throws {ConductorSdkError}
3807
- */
3808
- testConnectivity(input: ConnectivityTestInput): Promise<ConnectivityTestResult>;
3809
- /**
3810
- * Create or update queue config by name
3811
- * @deprecated Prefer server's newer endpoints if available
3812
- * @param {string} queueType
3813
- * @param {string} queueName
3814
- * @param {string} config
3815
- * @returns {Promise<void>}
3816
- * @throws {ConductorSdkError}
3817
- */
3818
- putQueueConfig(queueType: string, queueName: string, config: string): Promise<void>;
3819
- /**
3820
- * Test endpoint (as exposed by API)
3821
- * @returns {Promise<EventHandler>}
3822
- * @throws {ConductorSdkError}
3823
- */
3824
- test(): Promise<EventHandler>;
3757
+ getAllSchedules(workflowName?: string): Promise<WorkflowScheduleModel[]>;
3825
3758
  /**
3826
- * Get all active event handlers (execution view)
3827
- * @returns {Promise<SearchResultHandledEventResponse>}
3828
- * @throws {ConductorSdkError}
3759
+ * Get list of the next x (default 3, max 5) execution times for a scheduler
3760
+ * @param cronExpression
3761
+ * @param scheduleStartTime
3762
+ * @param scheduleEndTime
3763
+ * @param limit
3764
+ * @returns number OK
3765
+ * @throws ApiError
3829
3766
  */
3830
- getAllActiveEventHandlers(): Promise<SearchResultHandledEventResponse>;
3767
+ getNextFewSchedules(cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, limit?: number): Promise<number[]>;
3831
3768
  /**
3832
- * Get event executions for a specific handler
3833
- * @param {string} eventHandlerName
3834
- * @param {number} [from] Pagination cursor
3835
- * @returns {Promise<ExtendedEventExecution[]>}
3836
- * @throws {ConductorSdkError}
3769
+ * Pause all scheduling in a single conductor server instance (for debugging only)
3770
+ * @returns any OK
3771
+ * @throws ApiError
3837
3772
  */
3838
- getEventExecutions(eventHandlerName: string, from?: number): Promise<ExtendedEventExecution[]>;
3773
+ pauseAllSchedules(): Promise<void>;
3839
3774
  /**
3840
- * Get all event handlers with statistics (messages view)
3841
- * @param {number} [from] Pagination cursor
3842
- * @returns {Promise<SearchResultHandledEventResponse>}
3843
- * @throws {ConductorSdkError}
3775
+ * Requeue all execution records
3776
+ * @returns any OK
3777
+ * @throws ApiError
3844
3778
  */
3845
- getEventHandlersWithStats(from?: number): Promise<SearchResultHandledEventResponse>;
3779
+ requeueAllExecutionRecords(): Promise<void>;
3846
3780
  /**
3847
- * Get event messages for a given event
3848
- * @param {string} event
3849
- * @param {number} [from] Pagination cursor
3850
- * @returns {Promise<EventMessage[]>}
3851
- * @throws {ConductorSdkError}
3781
+ * Resume all scheduling
3782
+ * @returns any OK
3783
+ * @throws ApiError
3852
3784
  */
3853
- getEventMessages(event: string, from?: number): Promise<EventMessage[]>;
3785
+ resumeAllSchedules(): Promise<void>;
3854
3786
  }
3855
3787
 
3856
3788
  /**
@@ -3953,355 +3885,445 @@ declare class ServiceRegistryClient {
3953
3885
  discover(name: string, create?: boolean): Promise<ServiceMethod[]>;
3954
3886
  }
3955
3887
 
3956
- declare class ApplicationClient {
3888
+ declare class TaskClient {
3957
3889
  readonly _client: Client;
3958
3890
  constructor(client: Client);
3959
3891
  /**
3960
- * Get all applications
3961
- * @returns {Promise<ExtendedConductorApplication[]>}
3962
- * @throws {ConductorSdkError}
3963
- */
3964
- getAllApplications(): Promise<ExtendedConductorApplication[]>;
3965
- /**
3966
- * Create an application
3967
- * @param {string} applicationName
3968
- * @returns {Promise<ExtendedConductorApplication>}
3969
- * @throws {ConductorSdkError}
3892
+ * Searches for existing scheduler execution based on below parameters
3893
+ *
3894
+ * @param start
3895
+ * @param size
3896
+ * @param sort
3897
+ * @param freeText
3898
+ * @param query
3899
+ * @returns SearchResultWorkflowScheduleExecutionModel
3970
3900
  */
3971
- createApplication(applicationName: string): Promise<ExtendedConductorApplication>;
3901
+ search(start: number, size: number, sort: string | undefined, freeText: string, query: string): Promise<SearchResultTaskSummary>;
3972
3902
  /**
3973
- * Get application by access key id
3974
- * @param {string} accessKeyId
3975
- * @returns {Promise<ExtendedConductorApplication>}
3976
- * @throws {ConductorSdkError}
3903
+ * Get an existing schedule by Id
3904
+ * @param taskId
3905
+ * @returns Task
3977
3906
  */
3978
- getAppByAccessKeyId(accessKeyId: string): Promise<ExtendedConductorApplication>;
3907
+ getTask(taskId: string): Promise<Task>;
3979
3908
  /**
3980
- * Delete an access key
3981
- * @param {string} applicationId
3982
- * @param {string} keyId
3983
- * @returns {Promise<void>}
3984
- * @throws {ConductorSdkError}
3909
+ * Update task result status
3910
+ *
3911
+ * @param workflowId
3912
+ * @param taskReferenceName
3913
+ * @param status
3914
+ * @param outputData
3915
+ * @param workerId
3916
+ * @returns
3985
3917
  */
3986
- deleteAccessKey(applicationId: string, keyId: string): Promise<void>;
3918
+ updateTaskResult(workflowId: string, taskRefName: string, status: TaskResultStatus, outputData: Record<string, unknown>): Promise<string>;
3919
+ }
3920
+
3921
+ declare class TemplateClient {
3922
+ readonly _client: Client;
3923
+ constructor(client: Client);
3987
3924
  /**
3988
- * Toggle the status of an access key
3989
- * @param {string} applicationId
3990
- * @param {string} keyId
3991
- * @returns {Promise<AccessKeyInfo>}
3992
- * @throws {ConductorSdkError}
3925
+ * Register a new human task template
3926
+ *
3927
+ * @param template
3928
+ * @returns
3993
3929
  */
3994
- toggleAccessKeyStatus(applicationId: string, keyId: string): Promise<AccessKeyInfo>;
3930
+ registerTemplate(template: HumanTaskTemplate, asNewVersion?: boolean): Promise<HumanTaskTemplate>;
3931
+ }
3932
+
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 {
3956
+ readonly _client: Client;
3957
+ constructor(client: Client);
3995
3958
  /**
3996
- * Remove role from application user
3997
- * @param {string} applicationId
3998
- * @param {string} role
3999
- * @returns {Promise<void>}
4000
- * @throws {ConductorSdkError}
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
4001
3963
  */
4002
- removeRoleFromApplicationUser(applicationId: string, role: string): Promise<void>;
3964
+ registerWorkflow(override: boolean, workflow: WorkflowDef): Promise<void>;
4003
3965
  /**
4004
- * Add role to application
4005
- * @param {string} applicationId
4006
- * @param {ApplicationRole} role
4007
- * @returns {Promise<void>}
4008
- * @throws {ConductorSdkError}
3966
+ * Takes a StartWorkflowRequest. returns a Promise<string> with the workflowInstanceId of the running workflow
3967
+ * @param workflowRequest
3968
+ * @returns
4009
3969
  */
4010
- addApplicationRole(applicationId: string, role: ApplicationRole): Promise<void>;
3970
+ startWorkflow(workflowRequest: StartWorkflowRequest): Promise<string>;
4011
3971
  /**
4012
- * Delete an application
4013
- * @param {string} applicationId
4014
- * @returns {Promise<void>}
4015
- * @throws {ConductorSdkError}
3972
+ * Execute a workflow synchronously (original method - backward compatible)
4016
3973
  */
4017
- deleteApplication(applicationId: string): Promise<void>;
3974
+ executeWorkflow(workflowRequest: StartWorkflowRequest, name: string, version: number, requestId: string, waitUntilTaskRef?: string): Promise<WorkflowRun>;
4018
3975
  /**
4019
- * Get an application by id
4020
- * @param {string} applicationId
4021
- * @returns {Promise<ExtendedConductorApplication>}
4022
- * @throws {ConductorSdkError}
3976
+ * Execute a workflow with return strategy support (new method)
4023
3977
  */
4024
- getApplication(applicationId: string): Promise<ExtendedConductorApplication>;
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>;
4025
3982
  /**
4026
- * Update an application
4027
- * @param {string} applicationId
4028
- * @param {string} newApplicationName
4029
- * @returns {Promise<ExtendedConductorApplication>}
4030
- * @throws {ConductorSdkError}
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.
3986
+ *
3987
+ * @param workflowInstanceId
3988
+ * @param includeTasks
3989
+ * @param retry
3990
+ * @returns
4031
3991
  */
4032
- updateApplication(applicationId: string, newApplicationName: string): Promise<ExtendedConductorApplication>;
3992
+ getWorkflow(workflowInstanceId: string, includeTasks: boolean, retry?: number): Promise<Workflow>;
4033
3993
  /**
4034
- * Get application's access keys
4035
- * @param {string} applicationId
4036
- * @returns {Promise<AccessKeyInfo[]>}
4037
- * @throws {ConductorSdkError}
3994
+ * Returns a summary of the current workflow status.
3995
+ *
3996
+ * @param workflowInstanceId current running workflow
3997
+ * @param includeOutput flag to include output
3998
+ * @param includeVariables flag to include variable
3999
+ * @returns Promise<WorkflowStatus>
4038
4000
  */
4039
- getAccessKeys(applicationId: string): Promise<AccessKeyInfo[]>;
4001
+ getWorkflowStatus(workflowInstanceId: string, includeOutput: boolean, includeVariables: boolean): Promise<WorkflowStatus>;
4040
4002
  /**
4041
- * Create an access key for an application
4042
- * @param {string} applicationId
4043
- * @returns {Promise<AccessKey>}
4044
- * @throws {ConductorSdkError}
4003
+ * Returns a summary of the current workflow status.
4004
+ *
4005
+ * @param workflowInstanceId current running workflow
4006
+ * @param includeOutput flag to include output
4007
+ * @param includeVariables flag to include variable
4008
+ * @returns Promise<WorkflowStatus>
4045
4009
  */
4046
- createAccessKey(applicationId: string): Promise<AccessKey>;
4010
+ getExecution(workflowInstanceId: string, includeTasks?: boolean): Promise<Workflow>;
4047
4011
  /**
4048
- * Delete application tags
4049
- * @param {string} applicationId
4050
- * @param {Tag[]} tags
4051
- * @returns {Promise<void>}
4052
- * @throws {ConductorSdkError}
4012
+ * Pauses a running workflow
4013
+ * @param workflowInstanceId current workflow execution
4014
+ * @returns
4053
4015
  */
4054
- deleteApplicationTags(applicationId: string, tags: Tag[]): Promise<void>;
4016
+ pause(workflowInstanceId: string): Promise<void>;
4055
4017
  /**
4056
- * Delete a single application tag
4057
- * @param {string} applicationId
4058
- * @param {Tag} tag
4059
- * @returns {Promise<void>}
4060
- * @throws {ConductorSdkError}
4018
+ * Reruns workflowInstanceId workflow. with new parameters
4019
+ *
4020
+ * @param workflowInstanceId current workflow execution
4021
+ * @param rerunWorkflowRequest Rerun Workflow Execution Request
4022
+ * @returns
4061
4023
  */
4062
- deleteApplicationTag(applicationId: string, tag: Tag): Promise<void>;
4024
+ reRun(workflowInstanceId: string, rerunWorkflowRequest?: Partial<RerunWorkflowRequest>): Promise<string>;
4063
4025
  /**
4064
- * Get application tags
4065
- * @param {string} applicationId
4066
- * @returns {Promise<Tag[]>}
4067
- * @throws {ConductorSdkError}
4026
+ * Restarts workflow with workflowInstanceId, if useLatestDefinition uses last defintion
4027
+ * @param workflowInstanceId
4028
+ * @param useLatestDefinitions
4029
+ * @returns
4068
4030
  */
4069
- getApplicationTags(applicationId: string): Promise<Tag[]>;
4031
+ restart(workflowInstanceId: string, useLatestDefinitions: boolean): Promise<void>;
4070
4032
  /**
4071
- * Add application tags
4072
- * @param {string} applicationId
4073
- * @param {Tag[]} tags
4074
- * @returns {Promise<void>}
4075
- * @throws {ConductorSdkError}
4033
+ * Resumes a previously paused execution
4034
+ *
4035
+ * @param workflowInstanceId Running workflow workflowInstanceId
4036
+ * @returns
4076
4037
  */
4077
- addApplicationTags(applicationId: string, tags: Tag[]): Promise<void>;
4038
+ resume(workflowInstanceId: string): Promise<void>;
4078
4039
  /**
4079
- * Add a single application tag
4080
- * @param {string} applicationId
4081
- * @param {Tag} tag
4082
- * @returns {Promise<void>}
4083
- * @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
4084
4046
  */
4085
- addApplicationTag(applicationId: string, tag: Tag): Promise<void>;
4047
+ retry(workflowInstanceId: string, resumeSubworkflowTasks: boolean): Promise<void>;
4048
+ /**
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
4058
+ */
4059
+ search(start: number, size: number, query: string, freeText: string, sort?: string, skipCache?: boolean): Promise<ScrollableSearchResultWorkflowSummary>;
4060
+ /**
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
4067
+ */
4068
+ skipTasksFromWorkflow(workflowInstanceId: string, taskReferenceName: string, skipTaskRequest: Partial<SkipTaskRequest>): Promise<void>;
4069
+ /**
4070
+ * Takes an workflowInstanceId, and terminates a running workflow
4071
+ * @param workflowInstanceId
4072
+ * @param reason
4073
+ * @returns
4074
+ */
4075
+ terminate(workflowInstanceId: string, reason: string): Promise<void>;
4076
+ /**
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
4083
+ */
4084
+ updateTask(taskId: string, workflowInstanceId: string, taskStatus: TaskResultStatus, outputData: TaskResultOutputData): Promise<string>;
4085
+ /**
4086
+ * Updates a task by reference Name
4087
+ * @param taskReferenceName
4088
+ * @param workflowInstanceId
4089
+ * @param status
4090
+ * @param taskOutput
4091
+ * @returns
4092
+ */
4093
+ updateTaskByRefName(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatus, taskOutput: TaskResultOutputData): Promise<string>;
4094
+ /**
4095
+ *
4096
+ * @param taskId
4097
+ * @returns
4098
+ */
4099
+ getTask(taskId: string): Promise<Task>;
4100
+ /**
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>
4108
+ */
4109
+ updateTaskSync(taskReferenceName: string, workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, workerId?: string): Promise<Workflow>;
4110
+ /**
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
4117
+ */
4118
+ signal(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData, returnStrategy?: ReturnStrategy): Promise<EnhancedSignalResponse>;
4119
+ /**
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>
4125
+ */
4126
+ signalAsync(workflowInstanceId: string, status: TaskResultStatusEnum, taskOutput: TaskResultOutputData): Promise<void>;
4086
4127
  }
4087
4128
 
4088
- interface OrkesApiConfig {
4089
- serverUrl?: string;
4090
- keyId?: string;
4091
- keySecret?: string;
4092
- refreshTokenInterval?: number;
4093
- useEnvVars?: boolean;
4094
- maxHttp2Connections?: number;
4095
- }
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;
4096
4167
 
4097
4168
  /**
4098
- * Takes a config with keyId and keySecret returns a promise with an instance of Client
4169
+ * Takes an optional partial SimpleTaskDef
4170
+ * generates a task replacing default values with provided overrides
4099
4171
  *
4100
- * @param config (optional) OrkesApiConfig with keyId and keySecret
4101
- * @param customFetch (optional) custom fetch function
4102
- * @param requestHandler DEPRECATED! (optional) ConductorHttpRequest handler, replaced with customFetch
4103
- * @returns Client
4172
+ * @param overrides overrides for defaults
4173
+ * @returns a fully defined task
4104
4174
  */
4105
- declare const orkesConductorClient: (config?: OrkesApiConfig, customFetch?: typeof fetch) => Promise<{
4106
- eventResource: {
4107
- getQueueConfig: (queueType: string, queueName: string) => Promise<{
4108
- [key: string]: unknown;
4109
- }>;
4110
- putQueueConfig: (queueType: string, queueName: string, body: string) => Promise<void>;
4111
- deleteQueueConfig: (queueType: string, queueName: string) => Promise<void>;
4112
- getEventHandlers: () => Promise<EventHandler[]>;
4113
- updateEventHandler: (body: any) => Promise<void>;
4114
- addEventHandler: (body: any) => Promise<void>;
4115
- getQueueNames: () => Promise<{
4116
- [key: string]: string;
4117
- }>;
4118
- removeEventHandlerStatus: (name: string) => Promise<void>;
4119
- getEventHandlersForEvent: (event: string, activeOnly?: boolean) => Promise<EventHandler[]>;
4120
- deleteTagForEventHandler: (name: string, body: any[]) => Promise<void>;
4121
- getTagsForEventHandler: (name: string) => Promise<Tag[]>;
4122
- putTagForEventHandler: (name: string, body: any[]) => Promise<void>;
4123
- };
4124
- healthCheckResource: {
4125
- doCheck: () => Promise<{
4126
- [key: string]: unknown;
4127
- }>;
4128
- };
4129
- metadataResource: {
4130
- getTaskDef: (tasktype: string, metadata?: boolean) => Promise<{
4131
- [key: string]: unknown;
4132
- }>;
4133
- unregisterTaskDef: (tasktype: string) => Promise<void>;
4134
- getAllWorkflows: (access?: string, metadata?: boolean, tagKey?: string, tagValue?: string) => Promise<WorkflowDef$1[]>;
4135
- update: (requestBody: any[], overwrite?: boolean) => Promise<void>;
4136
- create: (requestBody: any, overwrite?: boolean) => Promise<void>;
4137
- getTaskDefs: (access?: string, metadata?: boolean, tagKey?: string, tagValue?: string) => Promise<TaskDef[]>;
4138
- updateTaskDef: (requestBody: any) => Promise<void>;
4139
- registerTaskDef: (requestBody: any[]) => Promise<void>;
4140
- unregisterWorkflowDef: (name: string, version: number) => Promise<void>;
4141
- get: (name: string, version?: number, metadata?: boolean) => Promise<WorkflowDef$1>;
4142
- };
4143
- schedulerResource: {
4144
- getSchedule: (name: string) => Promise<WorkflowSchedule>;
4145
- deleteSchedule: (name: string) => Promise<void>;
4146
- getNextFewSchedules: (cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, limit?: number) => Promise<number[]>;
4147
- pauseSchedule: (name: string) => Promise<void>;
4148
- pauseAllSchedules: () => Promise<{
4149
- [key: string]: unknown;
4150
- }>;
4151
- resumeSchedule: (name: string) => Promise<void>;
4152
- requeueAllExecutionRecords: () => Promise<{
4153
- [key: string]: unknown;
4154
- }>;
4155
- resumeAllSchedules: () => Promise<{
4156
- [key: string]: unknown;
4157
- }>;
4158
- getAllSchedules: (workflowName?: string) => Promise<WorkflowScheduleModel[]>;
4159
- saveSchedule: (requestBody: any) => Promise<void>;
4160
- searchV21: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<SearchResultWorkflowScheduleExecutionModel>;
4161
- testTimeout: () => Promise<any>;
4162
- };
4163
- tokenResource: {
4164
- generateToken: (requestBody: any) => Promise<Response$1>;
4165
- getUserInfo: (claims?: boolean) => Promise<{
4166
- [key: string]: unknown;
4167
- }>;
4168
- };
4169
- workflowBulkResource: {
4170
- retry: (requestBody: any[]) => Promise<BulkResponse>;
4171
- restart: (requestBody: any[], useLatestDefinitions?: boolean) => Promise<BulkResponse>;
4172
- terminate: (requestBody: any[], reason?: string) => Promise<BulkResponse>;
4173
- resumeWorkflow: (requestBody: any[]) => Promise<BulkResponse>;
4174
- pauseWorkflow1: (requestBody: any[]) => Promise<BulkResponse>;
4175
- };
4176
- workflowResource: {
4177
- getRunningWorkflow: (name: string, version?: number, startTime?: number, endTime?: number) => Promise<string[]>;
4178
- executeWorkflow: (body: any, name: string, version: number, requestId?: string, waitUntilTaskRef?: string, waitForSeconds?: number, consistency?: any, returnStrategy?: any) => Promise<SignalResponse$1>;
4179
- startWorkflow: (requestBody: any) => Promise<string>;
4180
- decide: (workflowId: string) => Promise<void>;
4181
- rerun: (workflowId: string, requestBody: any) => Promise<string>;
4182
- searchV21: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
4183
- pauseWorkflow: (workflowId: string) => Promise<void>;
4184
- skipTaskFromWorkflow: (workflowId: string, taskReferenceName: string, requestBody?: any) => Promise<void>;
4185
- getWorkflows: (name: string, requestBody: any[], includeClosed?: boolean, includeTasks?: boolean) => Promise<{
4186
- [key: string]: Workflow[];
4187
- }>;
4188
- getWorkflowStatusSummary: (workflowId: string, includeOutput?: boolean, includeVariables?: boolean) => Promise<WorkflowStatus>;
4189
- getWorkflows1: (name: string, correlationId: string, includeClosed?: boolean, includeTasks?: boolean) => Promise<Workflow[]>;
4190
- retry1: (workflowId: string, resumeSubworkflowTasks?: boolean) => Promise<void>;
4191
- getExecutionStatus: (workflowId: string, includeTasks?: boolean) => Promise<Workflow>;
4192
- terminate1: (workflowId: string, reason?: string) => Promise<void>;
4193
- resumeWorkflow: (workflowId: string) => Promise<void>;
4194
- delete: (workflowId: string, archiveWorkflow?: boolean) => Promise<void>;
4195
- searchWorkflowsByTasks: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
4196
- getExternalStorageLocation: (path: string, operation: string, payloadType: string) => Promise<any>;
4197
- startWorkflow1: (name: string, requestBody: any, version?: number, correlationId?: string, priority?: number) => Promise<string>;
4198
- restart1: (workflowId: string, useLatestDefinitions?: boolean) => Promise<void>;
4199
- search1: (queryId?: string, start?: number, size?: number, sort?: string, freeText?: string, query?: string, skipCache?: boolean) => Promise<any>;
4200
- searchWorkflowsByTasksV2: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
4201
- resetWorkflow: (workflowId: string) => Promise<void>;
4202
- testWorkflow: (requestBody: any) => Promise<Workflow>;
4203
- };
4204
- serviceRegistryResource: {
4205
- getRegisteredServices: () => Promise<ServiceRegistry[]>;
4206
- removeService: (name: string) => Promise<void>;
4207
- getService: (name: string) => Promise<ServiceRegistry>;
4208
- openCircuitBreaker: (name: string) => Promise<CircuitBreakerTransitionResponse>;
4209
- closeCircuitBreaker: (name: string) => Promise<CircuitBreakerTransitionResponse>;
4210
- getCircuitBreakerStatus: (name: string) => Promise<CircuitBreakerTransitionResponse>;
4211
- addOrUpdateService: (serviceRegistry: any) => Promise<void>;
4212
- addOrUpdateServiceMethod: (registryName: string, method: any) => Promise<void>;
4213
- removeMethod: (registryName: string, serviceName: string, method: string, methodType: string) => Promise<void>;
4214
- getProtoData: (registryName: string, filename: string) => Promise<string>;
4215
- setProtoData: (registryName: string, filename: string, data: any) => Promise<void>;
4216
- deleteProto: (registryName: string, filename: string) => Promise<void>;
4217
- getAllProtos: (registryName: string) => Promise<ProtoRegistryEntry[]>;
4218
- discover: (name: string, create?: boolean) => Promise<ServiceMethod[]>;
4219
- };
4220
- humanTaskResource: {
4221
- getConductorTaskById: (taskId: string) => Promise<Task>;
4222
- };
4223
- humanTask: {
4224
- deleteTaskFromHumanTaskRecords: (requestBody: any[]) => Promise<void>;
4225
- deleteTaskFromHumanTaskRecords1: (taskId: string) => Promise<void>;
4226
- search: (requestBody: any) => Promise<HumanTaskSearchResult>;
4227
- updateTaskOutputByRef: (workflowId: string, taskRefName: string, requestBody: any, complete?: boolean, iteration?: any[]) => Promise<any>;
4228
- getTask1: (taskId: string) => Promise<HumanTaskEntry>;
4229
- claimTask: (taskId: string, overrideAssignment?: boolean, withTemplate?: boolean) => Promise<HumanTaskEntry>;
4230
- assignAndClaim: (taskId: string, userId: string, overrideAssignment?: boolean, withTemplate?: boolean) => Promise<HumanTaskEntry>;
4231
- reassignTask: (taskId: string, requestBody: any[]) => Promise<void>;
4232
- releaseTask: (taskId: string) => Promise<void>;
4233
- skipTask: (taskId: string, reason?: string) => Promise<void>;
4234
- updateTaskOutput: (taskId: string, requestBody: any, complete?: boolean) => Promise<void>;
4235
- getAllTemplates: (name?: string, version?: number) => Promise<HumanTaskTemplate[]>;
4236
- saveTemplate: (requestBody: any, newVersion?: boolean) => Promise<HumanTaskTemplate>;
4237
- saveTemplates: (requestBody: any[], newVersion?: boolean) => Promise<HumanTaskTemplate[]>;
4238
- deleteTemplateByName: (name: string) => Promise<void>;
4239
- deleteTemplatesByNameAndVersion: (name: string, version: number) => Promise<void>;
4240
- getTemplateByNameAndVersion: (name: string, version: number) => Promise<HumanTaskTemplate>;
4241
- };
4242
- taskResource: {
4243
- poll: (tasktype: string, workerid?: string, domain?: string) => Promise<Task>;
4244
- allVerbose: () => Promise<{
4245
- [key: string]: {
4246
- [key: string]: {
4247
- [key: string]: number;
4248
- };
4249
- };
4250
- }>;
4251
- updateTask: (workflowId: string, taskRefName: string, status: "IN_PROGRESS" | "FAILED" | "FAILED_WITH_TERMINAL_ERROR" | "COMPLETED", requestBody: any) => Promise<string>;
4252
- getTask: (taskId: string) => Promise<Task>;
4253
- all: () => Promise<{
4254
- [key: string]: number;
4255
- }>;
4256
- requeuePendingTask: (taskType: string) => Promise<string>;
4257
- search: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<SearchResultTaskSummary>;
4258
- searchV22: (start?: number, size?: number, sort?: string, freeText?: string, query?: string) => Promise<any>;
4259
- getPollData: (taskType: string) => Promise<PollData[]>;
4260
- getTaskLogs: (taskId: string) => Promise<TaskExecLog[]>;
4261
- log: (taskId: string, requestBody: string) => Promise<void>;
4262
- getAllPollData: () => Promise<{
4263
- [key: string]: unknown;
4264
- }>;
4265
- batchPoll: (tasktype: string, workerid?: string, domain?: string, count?: number, timeout?: number) => Promise<Task[]>;
4266
- updateTask1: (requestBody: any) => Promise<string>;
4267
- size1: (taskType?: string[]) => Promise<{
4268
- [key: string]: number;
4269
- }>;
4270
- getExternalStorageLocation1: (path: string, operation: string, payloadType: string) => Promise<any>;
4271
- updateTaskSync: (workflowId: string, taskRefName: string, status: any, output: any, workerId?: string) => Promise<Workflow>;
4272
- signal: (workflowId: string, status: any, output: any, returnStrategy?: any) => Promise<SignalResponse$1>;
4273
- signalAsync: (workflowId: string, status: any, output: any) => Promise<SignalResponse>;
4274
- };
4275
- buildUrl: <TData extends {
4276
- body?: unknown;
4277
- path?: Record<string, unknown>;
4278
- query?: Record<string, unknown>;
4279
- url: string;
4280
- }>(options: Pick<TData, "url"> & Options<TData>) => string;
4281
- getConfig: () => Config<ClientOptions>;
4282
- 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>;
4283
- setConfig: (config: Config<ClientOptions>) => Config<ClientOptions>;
4284
- 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>;
4285
- 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>;
4286
- 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>;
4287
- 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>;
4288
- 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>;
4289
- 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>;
4290
- 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>;
4291
- 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>;
4292
- 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>;
4293
- sse: {
4294
- connect: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4295
- delete: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4296
- get: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4297
- head: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4298
- options: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4299
- patch: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4300
- post: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4301
- put: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4302
- trace: <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
4303
- };
4304
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
4305
- }>;
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>[];
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;
4209
+
4210
+ /**
4211
+ * Takes an optional partial HttpTaskDef
4212
+ * generates a task replacing default/fake values with provided overrides
4213
+ *
4214
+ * @param overrides overrides for defaults
4215
+ * @returns a fully defined task
4216
+ */
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
+ }
4306
4328
 
4307
- 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 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 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, 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, 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 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 };