@frankieone/workflow-api 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,911 @@
1
+ import w from "axios";
2
+ const E = "http://localhost:8080".replace(/\/+$/, "");
3
+ class C {
4
+ constructor(e, o = E, n = w) {
5
+ this.basePath = o, this.axios = n, e && (this.configuration = e, this.basePath = e.basePath ?? o);
6
+ }
7
+ configuration;
8
+ }
9
+ class v extends Error {
10
+ constructor(e, o) {
11
+ super(o), this.field = e, this.name = "RequiredError";
12
+ }
13
+ }
14
+ const O = {}, W = "https://example.com", x = function(t, e, o) {
15
+ if (o == null)
16
+ throw new v(e, `Required parameter ${e} was null or undefined when calling ${t}.`);
17
+ }, D = async function(t, e) {
18
+ if (e && e.accessToken) {
19
+ const o = typeof e.accessToken == "function" ? await e.accessToken() : await e.accessToken;
20
+ t.Authorization = "Bearer " + o;
21
+ }
22
+ };
23
+ function I(t, e, o = "") {
24
+ e != null && (typeof e == "object" ? Array.isArray(e) ? e.forEach((n) => I(t, n, o)) : Object.keys(e).forEach(
25
+ (n) => I(t, e[n], `${o}${o !== "" ? "." : ""}${n}`)
26
+ ) : t.has(o) ? t.append(o, e) : t.set(o, e));
27
+ }
28
+ const A = function(t, ...e) {
29
+ const o = new URLSearchParams(t.search);
30
+ I(o, e), t.search = o.toString();
31
+ }, V = function(t, e, o) {
32
+ const n = typeof t != "string";
33
+ return (n && o && o.isJsonMime ? o.isJsonMime(e.headers["Content-Type"]) : n) ? JSON.stringify(t !== void 0 ? t : {}) : t || "";
34
+ }, P = function(t) {
35
+ return t.pathname + t.search + t.hash;
36
+ }, S = function(t, e, o, n) {
37
+ return (s = e, i = o) => {
38
+ const r = { ...t.options, url: (s.defaults.baseURL ? "" : n?.basePath ?? i) + t.url };
39
+ return s.request(r);
40
+ };
41
+ }, b = {
42
+ Openai: "OPENAI",
43
+ Claude: "CLAUDE",
44
+ Frankieone: "FRANKIEONE"
45
+ }, U = {
46
+ Http: "HTTP",
47
+ Branch: "BRANCH",
48
+ Loop: "LOOP",
49
+ Log: "LOG",
50
+ Wait: "WAIT",
51
+ SetState: "SET_STATE",
52
+ Step: "STEP",
53
+ Parallel: "PARALLEL",
54
+ RunWorkflow: "RUN_WORKFLOW",
55
+ Notification: "NOTIFICATION",
56
+ Agent: "AGENT",
57
+ Subflow: "SUBFLOW",
58
+ Form: "FORM"
59
+ }, g = {
60
+ Simple: "SIMPLE",
61
+ Complex: "COMPLEX"
62
+ }, F = {
63
+ Eq: "EQ",
64
+ Neq: "NEQ",
65
+ Gt: "GT",
66
+ Gte: "GTE",
67
+ Lt: "LT",
68
+ Lte: "LTE",
69
+ Exists: "EXISTS",
70
+ NotExists: "NOT_EXISTS"
71
+ }, B = {
72
+ Left: "left",
73
+ Center: "center",
74
+ Right: "right"
75
+ }, j = {
76
+ Text: "TEXT",
77
+ Email: "EMAIL",
78
+ Phone: "PHONE",
79
+ Number: "NUMBER",
80
+ Date: "DATE",
81
+ Select: "SELECT",
82
+ Checkbox: "CHECKBOX",
83
+ Textarea: "TEXTAREA",
84
+ File: "FILE",
85
+ Country: "COUNTRY",
86
+ Address: "ADDRESS",
87
+ Checklist: "CHECKLIST",
88
+ Header: "HEADER",
89
+ Textblock: "TEXTBLOCK",
90
+ Image: "IMAGE",
91
+ Consent: "CONSENT"
92
+ }, H = {
93
+ Welcome: "WELCOME",
94
+ Consent: "CONSENT",
95
+ PersonalInfo: "PERSONAL_INFO",
96
+ Address: "ADDRESS",
97
+ DocumentUpload: "DOCUMENT_UPLOAD",
98
+ Review: "REVIEW",
99
+ Custom: "CUSTOM"
100
+ }, G = {
101
+ Get: "GET",
102
+ Post: "POST",
103
+ Put: "PUT",
104
+ Delete: "DELETE",
105
+ Patch: "PATCH",
106
+ Head: "HEAD",
107
+ Options: "OPTIONS"
108
+ }, M = {
109
+ Info: "INFO",
110
+ Warn: "WARN",
111
+ Error: "ERROR",
112
+ Debug: "DEBUG"
113
+ }, X = {
114
+ Email: "EMAIL",
115
+ Slack: "SLACK"
116
+ }, q = {
117
+ Text: "text",
118
+ Html: "html"
119
+ }, Q = {
120
+ Individuals: "individuals",
121
+ Organizations: "organizations"
122
+ }, $ = {
123
+ Pending: "PENDING",
124
+ Running: "RUNNING",
125
+ Completed: "COMPLETED",
126
+ Failed: "FAILED",
127
+ Paused: "PAUSED",
128
+ Skipped: "SKIPPED"
129
+ }, K = {
130
+ String: "STRING",
131
+ Number: "NUMBER",
132
+ Boolean: "BOOLEAN",
133
+ Object: "OBJECT",
134
+ Array: "ARRAY"
135
+ }, _ = {
136
+ Pending: "PENDING",
137
+ Running: "RUNNING",
138
+ Completed: "COMPLETED",
139
+ Failed: "FAILED",
140
+ Paused: "PAUSED",
141
+ Cancelled: "CANCELLED"
142
+ }, z = {
143
+ Pending: "PENDING",
144
+ Running: "RUNNING",
145
+ Completed: "COMPLETED",
146
+ Failed: "FAILED",
147
+ Paused: "PAUSED",
148
+ Cancelled: "CANCELLED"
149
+ }, L = function(t) {
150
+ return {
151
+ /**
152
+ * Creates a new workflow definition with tasks and their dependencies
153
+ * @summary Create a new workflow definition
154
+ * @param {NewWorkflowDefinition} newWorkflowDefinition Workflow definition to create
155
+ * @param {*} [options] Override http request option.
156
+ * @throws {RequiredError}
157
+ */
158
+ createWorkflowDefinition: async (e, o = {}) => {
159
+ x("createWorkflowDefinition", "newWorkflowDefinition", e);
160
+ const n = "/v2/definitions", s = new URL(n, W);
161
+ let i;
162
+ t && (i = t.baseOptions);
163
+ const r = { method: "POST", ...i, ...o }, a = {}, l = {};
164
+ await D(a, t), a["Content-Type"] = "application/json", a.Accept = "application/json", A(s, l);
165
+ let c = i && i.headers ? i.headers : {};
166
+ return r.headers = { ...a, ...c, ...o.headers }, r.data = V(e, r, t), {
167
+ url: P(s),
168
+ options: r
169
+ };
170
+ },
171
+ /**
172
+ * Deletes a workflow definition by its ID
173
+ * @summary Delete a workflow definition
174
+ * @param {string} workflowDefinitionId ID of the workflow definition
175
+ * @param {string} [xFrankieRequestID] Request ID
176
+ * @param {*} [options] Override http request option.
177
+ * @throws {RequiredError}
178
+ */
179
+ deleteWorkflowDefinition: async (e, o, n = {}) => {
180
+ x("deleteWorkflowDefinition", "workflowDefinitionId", e);
181
+ const s = "/v2/definitions/{workflowDefinitionId}".replace("{workflowDefinitionId}", encodeURIComponent(String(e))), i = new URL(s, W);
182
+ let r;
183
+ t && (r = t.baseOptions);
184
+ const a = { method: "DELETE", ...r, ...n }, l = {}, c = {};
185
+ await D(l, t), l.Accept = "application/json", o != null && (l["X-Frankie-RequestID"] = String(o)), A(i, c);
186
+ let f = r && r.headers ? r.headers : {};
187
+ return a.headers = { ...l, ...f, ...n.headers }, {
188
+ url: P(i),
189
+ options: a
190
+ };
191
+ },
192
+ /**
193
+ * Returns a workflow definition by its ID
194
+ * @summary Get a workflow definition by ID
195
+ * @param {string} workflowDefinitionId ID of the workflow definition
196
+ * @param {string} [xFrankieRequestID] Request ID
197
+ * @param {number} [version] Version of the workflow definition to retrieve. If not provided, the latest version will be returned.
198
+ * @param {*} [options] Override http request option.
199
+ * @throws {RequiredError}
200
+ */
201
+ getWorkflowDefinition: async (e, o, n, s = {}) => {
202
+ x("getWorkflowDefinition", "workflowDefinitionId", e);
203
+ const i = "/v2/definitions/{workflowDefinitionId}".replace("{workflowDefinitionId}", encodeURIComponent(String(e))), r = new URL(i, W);
204
+ let a;
205
+ t && (a = t.baseOptions);
206
+ const l = { method: "GET", ...a, ...s }, c = {}, f = {};
207
+ await D(c, t), n !== void 0 && (f.version = n), c.Accept = "application/json", o != null && (c["X-Frankie-RequestID"] = String(o)), A(r, f);
208
+ let u = a && a.headers ? a.headers : {};
209
+ return l.headers = { ...c, ...u, ...s.headers }, {
210
+ url: P(r),
211
+ options: l
212
+ };
213
+ },
214
+ /**
215
+ * Returns a list of all workflow definitions
216
+ * @summary List all workflow definitions
217
+ * @param {string} [xFrankieRequestID] Request ID
218
+ * @param {boolean} [isTemplate] Include template workflow definitions in the response
219
+ * @param {string} [owner] Filter workflow definitions by owner
220
+ * @param {number} [page] Page number to retrieve (1-based)
221
+ * @param {number} [limit] Number of items per page (page size)
222
+ * @param {boolean} [isDraft] Include draft workflow definitions in the response
223
+ * @param {*} [options] Override http request option.
224
+ * @throws {RequiredError}
225
+ */
226
+ listWorkflowDefinitions: async (e, o, n, s, i, r, a = {}) => {
227
+ const l = "/v2/definitions", c = new URL(l, W);
228
+ let f;
229
+ t && (f = t.baseOptions);
230
+ const u = { method: "GET", ...f, ...a }, d = {}, p = {};
231
+ await D(d, t), o !== void 0 && (p.isTemplate = o), n !== void 0 && (p.owner = n), s !== void 0 && (p.page = s), i !== void 0 && (p.limit = i), r !== void 0 && (p.isDraft = r), d.Accept = "application/json", e != null && (d["X-Frankie-RequestID"] = String(e)), A(c, p);
232
+ let h = f && f.headers ? f.headers : {};
233
+ return u.headers = { ...d, ...h, ...a.headers }, {
234
+ url: P(c),
235
+ options: u
236
+ };
237
+ },
238
+ /**
239
+ * Updates an existing workflow definition
240
+ * @summary Update a workflow definition
241
+ * @param {string} workflowDefinitionId ID of the workflow definition
242
+ * @param {WorkflowDefinition} workflowDefinition
243
+ * @param {string} [xFrankieRequestID] Request ID
244
+ * @param {*} [options] Override http request option.
245
+ * @throws {RequiredError}
246
+ */
247
+ updateWorkflowDefinition: async (e, o, n, s = {}) => {
248
+ x("updateWorkflowDefinition", "workflowDefinitionId", e), x("updateWorkflowDefinition", "workflowDefinition", o);
249
+ const i = "/v2/definitions/{workflowDefinitionId}".replace("{workflowDefinitionId}", encodeURIComponent(String(e))), r = new URL(i, W);
250
+ let a;
251
+ t && (a = t.baseOptions);
252
+ const l = { method: "PUT", ...a, ...s }, c = {}, f = {};
253
+ await D(c, t), c["Content-Type"] = "application/json", c.Accept = "application/json", n != null && (c["X-Frankie-RequestID"] = String(n)), A(r, f);
254
+ let u = a && a.headers ? a.headers : {};
255
+ return l.headers = { ...c, ...u, ...s.headers }, l.data = V(o, l, t), {
256
+ url: P(r),
257
+ options: l
258
+ };
259
+ }
260
+ };
261
+ }, T = function(t) {
262
+ const e = L(t);
263
+ return {
264
+ /**
265
+ * Creates a new workflow definition with tasks and their dependencies
266
+ * @summary Create a new workflow definition
267
+ * @param {NewWorkflowDefinition} newWorkflowDefinition Workflow definition to create
268
+ * @param {*} [options] Override http request option.
269
+ * @throws {RequiredError}
270
+ */
271
+ async createWorkflowDefinition(o, n) {
272
+ const s = await e.createWorkflowDefinition(o, n), i = t?.serverIndex ?? 0, r = O["WorkflowDefinitionsApi.createWorkflowDefinition"]?.[i]?.url;
273
+ return (a, l) => S(s, w, E, t)(a, r || l);
274
+ },
275
+ /**
276
+ * Deletes a workflow definition by its ID
277
+ * @summary Delete a workflow definition
278
+ * @param {string} workflowDefinitionId ID of the workflow definition
279
+ * @param {string} [xFrankieRequestID] Request ID
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ */
283
+ async deleteWorkflowDefinition(o, n, s) {
284
+ const i = await e.deleteWorkflowDefinition(o, n, s), r = t?.serverIndex ?? 0, a = O["WorkflowDefinitionsApi.deleteWorkflowDefinition"]?.[r]?.url;
285
+ return (l, c) => S(i, w, E, t)(l, a || c);
286
+ },
287
+ /**
288
+ * Returns a workflow definition by its ID
289
+ * @summary Get a workflow definition by ID
290
+ * @param {string} workflowDefinitionId ID of the workflow definition
291
+ * @param {string} [xFrankieRequestID] Request ID
292
+ * @param {number} [version] Version of the workflow definition to retrieve. If not provided, the latest version will be returned.
293
+ * @param {*} [options] Override http request option.
294
+ * @throws {RequiredError}
295
+ */
296
+ async getWorkflowDefinition(o, n, s, i) {
297
+ const r = await e.getWorkflowDefinition(o, n, s, i), a = t?.serverIndex ?? 0, l = O["WorkflowDefinitionsApi.getWorkflowDefinition"]?.[a]?.url;
298
+ return (c, f) => S(r, w, E, t)(c, l || f);
299
+ },
300
+ /**
301
+ * Returns a list of all workflow definitions
302
+ * @summary List all workflow definitions
303
+ * @param {string} [xFrankieRequestID] Request ID
304
+ * @param {boolean} [isTemplate] Include template workflow definitions in the response
305
+ * @param {string} [owner] Filter workflow definitions by owner
306
+ * @param {number} [page] Page number to retrieve (1-based)
307
+ * @param {number} [limit] Number of items per page (page size)
308
+ * @param {boolean} [isDraft] Include draft workflow definitions in the response
309
+ * @param {*} [options] Override http request option.
310
+ * @throws {RequiredError}
311
+ */
312
+ async listWorkflowDefinitions(o, n, s, i, r, a, l) {
313
+ const c = await e.listWorkflowDefinitions(o, n, s, i, r, a, l), f = t?.serverIndex ?? 0, u = O["WorkflowDefinitionsApi.listWorkflowDefinitions"]?.[f]?.url;
314
+ return (d, p) => S(c, w, E, t)(d, u || p);
315
+ },
316
+ /**
317
+ * Updates an existing workflow definition
318
+ * @summary Update a workflow definition
319
+ * @param {string} workflowDefinitionId ID of the workflow definition
320
+ * @param {WorkflowDefinition} workflowDefinition
321
+ * @param {string} [xFrankieRequestID] Request ID
322
+ * @param {*} [options] Override http request option.
323
+ * @throws {RequiredError}
324
+ */
325
+ async updateWorkflowDefinition(o, n, s, i) {
326
+ const r = await e.updateWorkflowDefinition(o, n, s, i), a = t?.serverIndex ?? 0, l = O["WorkflowDefinitionsApi.updateWorkflowDefinition"]?.[a]?.url;
327
+ return (c, f) => S(r, w, E, t)(c, l || f);
328
+ }
329
+ };
330
+ }, J = function(t, e, o) {
331
+ const n = T(t);
332
+ return {
333
+ /**
334
+ * Creates a new workflow definition with tasks and their dependencies
335
+ * @summary Create a new workflow definition
336
+ * @param {NewWorkflowDefinition} newWorkflowDefinition Workflow definition to create
337
+ * @param {*} [options] Override http request option.
338
+ * @throws {RequiredError}
339
+ */
340
+ createWorkflowDefinition(s, i) {
341
+ return n.createWorkflowDefinition(s, i).then((r) => r(o, e));
342
+ },
343
+ /**
344
+ * Deletes a workflow definition by its ID
345
+ * @summary Delete a workflow definition
346
+ * @param {string} workflowDefinitionId ID of the workflow definition
347
+ * @param {string} [xFrankieRequestID] Request ID
348
+ * @param {*} [options] Override http request option.
349
+ * @throws {RequiredError}
350
+ */
351
+ deleteWorkflowDefinition(s, i, r) {
352
+ return n.deleteWorkflowDefinition(s, i, r).then((a) => a(o, e));
353
+ },
354
+ /**
355
+ * Returns a workflow definition by its ID
356
+ * @summary Get a workflow definition by ID
357
+ * @param {string} workflowDefinitionId ID of the workflow definition
358
+ * @param {string} [xFrankieRequestID] Request ID
359
+ * @param {number} [version] Version of the workflow definition to retrieve. If not provided, the latest version will be returned.
360
+ * @param {*} [options] Override http request option.
361
+ * @throws {RequiredError}
362
+ */
363
+ getWorkflowDefinition(s, i, r, a) {
364
+ return n.getWorkflowDefinition(s, i, r, a).then((l) => l(o, e));
365
+ },
366
+ /**
367
+ * Returns a list of all workflow definitions
368
+ * @summary List all workflow definitions
369
+ * @param {string} [xFrankieRequestID] Request ID
370
+ * @param {boolean} [isTemplate] Include template workflow definitions in the response
371
+ * @param {string} [owner] Filter workflow definitions by owner
372
+ * @param {number} [page] Page number to retrieve (1-based)
373
+ * @param {number} [limit] Number of items per page (page size)
374
+ * @param {boolean} [isDraft] Include draft workflow definitions in the response
375
+ * @param {*} [options] Override http request option.
376
+ * @throws {RequiredError}
377
+ */
378
+ listWorkflowDefinitions(s, i, r, a, l, c, f) {
379
+ return n.listWorkflowDefinitions(s, i, r, a, l, c, f).then((u) => u(o, e));
380
+ },
381
+ /**
382
+ * Updates an existing workflow definition
383
+ * @summary Update a workflow definition
384
+ * @param {string} workflowDefinitionId ID of the workflow definition
385
+ * @param {WorkflowDefinition} workflowDefinition
386
+ * @param {string} [xFrankieRequestID] Request ID
387
+ * @param {*} [options] Override http request option.
388
+ * @throws {RequiredError}
389
+ */
390
+ updateWorkflowDefinition(s, i, r, a) {
391
+ return n.updateWorkflowDefinition(s, i, r, a).then((l) => l(o, e));
392
+ }
393
+ };
394
+ };
395
+ class Y extends C {
396
+ /**
397
+ * Creates a new workflow definition with tasks and their dependencies
398
+ * @summary Create a new workflow definition
399
+ * @param {NewWorkflowDefinition} newWorkflowDefinition Workflow definition to create
400
+ * @param {*} [options] Override http request option.
401
+ * @throws {RequiredError}
402
+ */
403
+ createWorkflowDefinition(e, o) {
404
+ return T(this.configuration).createWorkflowDefinition(e, o).then((n) => n(this.axios, this.basePath));
405
+ }
406
+ /**
407
+ * Deletes a workflow definition by its ID
408
+ * @summary Delete a workflow definition
409
+ * @param {string} workflowDefinitionId ID of the workflow definition
410
+ * @param {string} [xFrankieRequestID] Request ID
411
+ * @param {*} [options] Override http request option.
412
+ * @throws {RequiredError}
413
+ */
414
+ deleteWorkflowDefinition(e, o, n) {
415
+ return T(this.configuration).deleteWorkflowDefinition(e, o, n).then((s) => s(this.axios, this.basePath));
416
+ }
417
+ /**
418
+ * Returns a workflow definition by its ID
419
+ * @summary Get a workflow definition by ID
420
+ * @param {string} workflowDefinitionId ID of the workflow definition
421
+ * @param {string} [xFrankieRequestID] Request ID
422
+ * @param {number} [version] Version of the workflow definition to retrieve. If not provided, the latest version will be returned.
423
+ * @param {*} [options] Override http request option.
424
+ * @throws {RequiredError}
425
+ */
426
+ getWorkflowDefinition(e, o, n, s) {
427
+ return T(this.configuration).getWorkflowDefinition(e, o, n, s).then((i) => i(this.axios, this.basePath));
428
+ }
429
+ /**
430
+ * Returns a list of all workflow definitions
431
+ * @summary List all workflow definitions
432
+ * @param {string} [xFrankieRequestID] Request ID
433
+ * @param {boolean} [isTemplate] Include template workflow definitions in the response
434
+ * @param {string} [owner] Filter workflow definitions by owner
435
+ * @param {number} [page] Page number to retrieve (1-based)
436
+ * @param {number} [limit] Number of items per page (page size)
437
+ * @param {boolean} [isDraft] Include draft workflow definitions in the response
438
+ * @param {*} [options] Override http request option.
439
+ * @throws {RequiredError}
440
+ */
441
+ listWorkflowDefinitions(e, o, n, s, i, r, a) {
442
+ return T(this.configuration).listWorkflowDefinitions(e, o, n, s, i, r, a).then((l) => l(this.axios, this.basePath));
443
+ }
444
+ /**
445
+ * Updates an existing workflow definition
446
+ * @summary Update a workflow definition
447
+ * @param {string} workflowDefinitionId ID of the workflow definition
448
+ * @param {WorkflowDefinition} workflowDefinition
449
+ * @param {string} [xFrankieRequestID] Request ID
450
+ * @param {*} [options] Override http request option.
451
+ * @throws {RequiredError}
452
+ */
453
+ updateWorkflowDefinition(e, o, n, s) {
454
+ return T(this.configuration).updateWorkflowDefinition(e, o, n, s).then((i) => i(this.axios, this.basePath));
455
+ }
456
+ }
457
+ const N = function(t) {
458
+ return {
459
+ /**
460
+ * Cancels a running or paused workflow execution
461
+ * @summary Cancel a workflow execution
462
+ * @param {string} executionId ID of the workflow execution
463
+ * @param {string} [xFrankieRequestID] Request ID
464
+ * @param {*} [options] Override http request option.
465
+ * @throws {RequiredError}
466
+ */
467
+ cancelWorkflowExecution: async (e, o, n = {}) => {
468
+ x("cancelWorkflowExecution", "executionId", e);
469
+ const s = "/v2/executions/{executionId}/cancel".replace("{executionId}", encodeURIComponent(String(e))), i = new URL(s, W);
470
+ let r;
471
+ t && (r = t.baseOptions);
472
+ const a = { method: "POST", ...r, ...n }, l = {}, c = {};
473
+ await D(l, t), l.Accept = "application/json", o != null && (l["X-Frankie-RequestID"] = String(o)), A(i, c);
474
+ let f = r && r.headers ? r.headers : {};
475
+ return a.headers = { ...l, ...f, ...n.headers }, {
476
+ url: P(i),
477
+ options: a
478
+ };
479
+ },
480
+ /**
481
+ * Starts execution of a workflow definition
482
+ * @summary Create a new workflow execution
483
+ * @param {WorkflowExecutionRequest} workflowExecutionRequest
484
+ * @param {boolean} [xAsyncExecution] Set to true to execute the workflow asynchronously
485
+ * @param {string} [xFrankieRequestID] Request ID
486
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
487
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
488
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
489
+ * @param {*} [options] Override http request option.
490
+ * @throws {RequiredError}
491
+ */
492
+ createWorkflowExecution: async (e, o, n, s, i, r, a = {}) => {
493
+ x("createWorkflowExecution", "workflowExecutionRequest", e);
494
+ const l = "/v2/executions", c = new URL(l, W);
495
+ let f;
496
+ t && (f = t.baseOptions);
497
+ const u = { method: "POST", ...f, ...a }, d = {}, p = {};
498
+ await D(d, t), d["Content-Type"] = "application/json", d.Accept = "application/json", o != null && (d["X-Async-Execution"] = typeof o == "string" ? o : JSON.stringify(o)), n != null && (d["X-Frankie-RequestID"] = String(n)), s != null && (d["X-Frankie-CustomerID"] = String(s)), i != null && (d["X-Frankie-CustomerChildID"] = String(i)), r != null && (d["X-Frankie-Channel"] = String(r)), A(c, p);
499
+ let h = f && f.headers ? f.headers : {};
500
+ return u.headers = { ...d, ...h, ...a.headers }, u.data = V(e, u, t), {
501
+ url: P(c),
502
+ options: u
503
+ };
504
+ },
505
+ /**
506
+ * Returns a workflow execution by its ID
507
+ * @summary Get a workflow execution by ID
508
+ * @param {string} executionId ID of the workflow execution
509
+ * @param {string} [xFrankieRequestID] Request ID
510
+ * @param {*} [options] Override http request option.
511
+ * @throws {RequiredError}
512
+ */
513
+ getWorkflowExecution: async (e, o, n = {}) => {
514
+ x("getWorkflowExecution", "executionId", e);
515
+ const s = "/v2/executions/{executionId}".replace("{executionId}", encodeURIComponent(String(e))), i = new URL(s, W);
516
+ let r;
517
+ t && (r = t.baseOptions);
518
+ const a = { method: "GET", ...r, ...n }, l = {}, c = {};
519
+ await D(l, t), l.Accept = "application/json", o != null && (l["X-Frankie-RequestID"] = String(o)), A(i, c);
520
+ let f = r && r.headers ? r.headers : {};
521
+ return a.headers = { ...l, ...f, ...n.headers }, {
522
+ url: P(i),
523
+ options: a
524
+ };
525
+ },
526
+ /**
527
+ * Returns a paginated list of workflow executions. Pagination is applied by default.
528
+ * @summary List workflow executions
529
+ * @param {string} [xFrankieRequestID] Request ID
530
+ * @param {string} [workflowDefinitionId] Filter by workflow definition ID
531
+ * @param {string} [owner] Filter by workflow definition owner
532
+ * @param {ListWorkflowExecutionsStatusEnum} [status] Filter by execution status
533
+ * @param {number} [page] Page number to retrieve (1-based)
534
+ * @param {number} [limit] Number of items per page (page size)
535
+ * @param {string} [startTimeBefore] Filter by execution start time before a specific date and time
536
+ * @param {string} [startTimeAfter] Filter by execution start time after a specific date and time
537
+ * @param {*} [options] Override http request option.
538
+ * @throws {RequiredError}
539
+ */
540
+ listWorkflowExecutions: async (e, o, n, s, i, r, a, l, c = {}) => {
541
+ const f = "/v2/executions", u = new URL(f, W);
542
+ let d;
543
+ t && (d = t.baseOptions);
544
+ const p = { method: "GET", ...d, ...c }, h = {}, k = {};
545
+ await D(h, t), o !== void 0 && (k.workflowDefinitionId = o), n !== void 0 && (k.owner = n), s !== void 0 && (k.status = s), i !== void 0 && (k.page = i), r !== void 0 && (k.limit = r), a !== void 0 && (k.startTimeBefore = a instanceof Date ? a.toISOString() : a), l !== void 0 && (k.startTimeAfter = l instanceof Date ? l.toISOString() : l), h.Accept = "application/json", e != null && (h["X-Frankie-RequestID"] = String(e)), A(u, k);
546
+ let R = d && d.headers ? d.headers : {};
547
+ return p.headers = { ...h, ...R, ...c.headers }, {
548
+ url: P(u),
549
+ options: p
550
+ };
551
+ },
552
+ /**
553
+ * Resumes a workflow execution that was paused
554
+ * @summary Resume a paused workflow execution
555
+ * @param {string} executionId ID of the workflow execution
556
+ * @param {ResumeWorkflowExecution} resumeWorkflowExecution Resume data for the workflow execution
557
+ * @param {string} [xFrankieRequestID] Request ID
558
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
559
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
560
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
561
+ * @param {*} [options] Override http request option.
562
+ * @throws {RequiredError}
563
+ */
564
+ resumeWorkflowExecution: async (e, o, n, s, i, r, a = {}) => {
565
+ x("resumeWorkflowExecution", "executionId", e), x("resumeWorkflowExecution", "resumeWorkflowExecution", o);
566
+ const l = "/v2/executions/{executionId}/resume".replace("{executionId}", encodeURIComponent(String(e))), c = new URL(l, W);
567
+ let f;
568
+ t && (f = t.baseOptions);
569
+ const u = { method: "POST", ...f, ...a }, d = {}, p = {};
570
+ await D(d, t), d["Content-Type"] = "application/json", d.Accept = "application/json", n != null && (d["X-Frankie-RequestID"] = String(n)), s != null && (d["X-Frankie-CustomerID"] = String(s)), i != null && (d["X-Frankie-CustomerChildID"] = String(i)), r != null && (d["X-Frankie-Channel"] = String(r)), A(c, p);
571
+ let h = f && f.headers ? f.headers : {};
572
+ return u.headers = { ...d, ...h, ...a.headers }, u.data = V(o, u, t), {
573
+ url: P(c),
574
+ options: u
575
+ };
576
+ }
577
+ };
578
+ }, m = function(t) {
579
+ const e = N(t);
580
+ return {
581
+ /**
582
+ * Cancels a running or paused workflow execution
583
+ * @summary Cancel a workflow execution
584
+ * @param {string} executionId ID of the workflow execution
585
+ * @param {string} [xFrankieRequestID] Request ID
586
+ * @param {*} [options] Override http request option.
587
+ * @throws {RequiredError}
588
+ */
589
+ async cancelWorkflowExecution(o, n, s) {
590
+ const i = await e.cancelWorkflowExecution(o, n, s), r = t?.serverIndex ?? 0, a = O["WorkflowExecutionsApi.cancelWorkflowExecution"]?.[r]?.url;
591
+ return (l, c) => S(i, w, E, t)(l, a || c);
592
+ },
593
+ /**
594
+ * Starts execution of a workflow definition
595
+ * @summary Create a new workflow execution
596
+ * @param {WorkflowExecutionRequest} workflowExecutionRequest
597
+ * @param {boolean} [xAsyncExecution] Set to true to execute the workflow asynchronously
598
+ * @param {string} [xFrankieRequestID] Request ID
599
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
600
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
601
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
602
+ * @param {*} [options] Override http request option.
603
+ * @throws {RequiredError}
604
+ */
605
+ async createWorkflowExecution(o, n, s, i, r, a, l) {
606
+ const c = await e.createWorkflowExecution(o, n, s, i, r, a, l), f = t?.serverIndex ?? 0, u = O["WorkflowExecutionsApi.createWorkflowExecution"]?.[f]?.url;
607
+ return (d, p) => S(c, w, E, t)(d, u || p);
608
+ },
609
+ /**
610
+ * Returns a workflow execution by its ID
611
+ * @summary Get a workflow execution by ID
612
+ * @param {string} executionId ID of the workflow execution
613
+ * @param {string} [xFrankieRequestID] Request ID
614
+ * @param {*} [options] Override http request option.
615
+ * @throws {RequiredError}
616
+ */
617
+ async getWorkflowExecution(o, n, s) {
618
+ const i = await e.getWorkflowExecution(o, n, s), r = t?.serverIndex ?? 0, a = O["WorkflowExecutionsApi.getWorkflowExecution"]?.[r]?.url;
619
+ return (l, c) => S(i, w, E, t)(l, a || c);
620
+ },
621
+ /**
622
+ * Returns a paginated list of workflow executions. Pagination is applied by default.
623
+ * @summary List workflow executions
624
+ * @param {string} [xFrankieRequestID] Request ID
625
+ * @param {string} [workflowDefinitionId] Filter by workflow definition ID
626
+ * @param {string} [owner] Filter by workflow definition owner
627
+ * @param {ListWorkflowExecutionsStatusEnum} [status] Filter by execution status
628
+ * @param {number} [page] Page number to retrieve (1-based)
629
+ * @param {number} [limit] Number of items per page (page size)
630
+ * @param {string} [startTimeBefore] Filter by execution start time before a specific date and time
631
+ * @param {string} [startTimeAfter] Filter by execution start time after a specific date and time
632
+ * @param {*} [options] Override http request option.
633
+ * @throws {RequiredError}
634
+ */
635
+ async listWorkflowExecutions(o, n, s, i, r, a, l, c, f) {
636
+ const u = await e.listWorkflowExecutions(o, n, s, i, r, a, l, c, f), d = t?.serverIndex ?? 0, p = O["WorkflowExecutionsApi.listWorkflowExecutions"]?.[d]?.url;
637
+ return (h, k) => S(u, w, E, t)(h, p || k);
638
+ },
639
+ /**
640
+ * Resumes a workflow execution that was paused
641
+ * @summary Resume a paused workflow execution
642
+ * @param {string} executionId ID of the workflow execution
643
+ * @param {ResumeWorkflowExecution} resumeWorkflowExecution Resume data for the workflow execution
644
+ * @param {string} [xFrankieRequestID] Request ID
645
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
646
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
647
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ */
651
+ async resumeWorkflowExecution(o, n, s, i, r, a, l) {
652
+ const c = await e.resumeWorkflowExecution(o, n, s, i, r, a, l), f = t?.serverIndex ?? 0, u = O["WorkflowExecutionsApi.resumeWorkflowExecution"]?.[f]?.url;
653
+ return (d, p) => S(c, w, E, t)(d, u || p);
654
+ }
655
+ };
656
+ }, Z = function(t, e, o) {
657
+ const n = m(t);
658
+ return {
659
+ /**
660
+ * Cancels a running or paused workflow execution
661
+ * @summary Cancel a workflow execution
662
+ * @param {string} executionId ID of the workflow execution
663
+ * @param {string} [xFrankieRequestID] Request ID
664
+ * @param {*} [options] Override http request option.
665
+ * @throws {RequiredError}
666
+ */
667
+ cancelWorkflowExecution(s, i, r) {
668
+ return n.cancelWorkflowExecution(s, i, r).then((a) => a(o, e));
669
+ },
670
+ /**
671
+ * Starts execution of a workflow definition
672
+ * @summary Create a new workflow execution
673
+ * @param {WorkflowExecutionRequest} workflowExecutionRequest
674
+ * @param {boolean} [xAsyncExecution] Set to true to execute the workflow asynchronously
675
+ * @param {string} [xFrankieRequestID] Request ID
676
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
677
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
678
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
679
+ * @param {*} [options] Override http request option.
680
+ * @throws {RequiredError}
681
+ */
682
+ createWorkflowExecution(s, i, r, a, l, c, f) {
683
+ return n.createWorkflowExecution(s, i, r, a, l, c, f).then((u) => u(o, e));
684
+ },
685
+ /**
686
+ * Returns a workflow execution by its ID
687
+ * @summary Get a workflow execution by ID
688
+ * @param {string} executionId ID of the workflow execution
689
+ * @param {string} [xFrankieRequestID] Request ID
690
+ * @param {*} [options] Override http request option.
691
+ * @throws {RequiredError}
692
+ */
693
+ getWorkflowExecution(s, i, r) {
694
+ return n.getWorkflowExecution(s, i, r).then((a) => a(o, e));
695
+ },
696
+ /**
697
+ * Returns a paginated list of workflow executions. Pagination is applied by default.
698
+ * @summary List workflow executions
699
+ * @param {string} [xFrankieRequestID] Request ID
700
+ * @param {string} [workflowDefinitionId] Filter by workflow definition ID
701
+ * @param {string} [owner] Filter by workflow definition owner
702
+ * @param {ListWorkflowExecutionsStatusEnum} [status] Filter by execution status
703
+ * @param {number} [page] Page number to retrieve (1-based)
704
+ * @param {number} [limit] Number of items per page (page size)
705
+ * @param {string} [startTimeBefore] Filter by execution start time before a specific date and time
706
+ * @param {string} [startTimeAfter] Filter by execution start time after a specific date and time
707
+ * @param {*} [options] Override http request option.
708
+ * @throws {RequiredError}
709
+ */
710
+ listWorkflowExecutions(s, i, r, a, l, c, f, u, d) {
711
+ return n.listWorkflowExecutions(s, i, r, a, l, c, f, u, d).then((p) => p(o, e));
712
+ },
713
+ /**
714
+ * Resumes a workflow execution that was paused
715
+ * @summary Resume a paused workflow execution
716
+ * @param {string} executionId ID of the workflow execution
717
+ * @param {ResumeWorkflowExecution} resumeWorkflowExecution Resume data for the workflow execution
718
+ * @param {string} [xFrankieRequestID] Request ID
719
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
720
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
721
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
722
+ * @param {*} [options] Override http request option.
723
+ * @throws {RequiredError}
724
+ */
725
+ resumeWorkflowExecution(s, i, r, a, l, c, f) {
726
+ return n.resumeWorkflowExecution(s, i, r, a, l, c, f).then((u) => u(o, e));
727
+ }
728
+ };
729
+ };
730
+ class ee extends C {
731
+ /**
732
+ * Cancels a running or paused workflow execution
733
+ * @summary Cancel a workflow execution
734
+ * @param {string} executionId ID of the workflow execution
735
+ * @param {string} [xFrankieRequestID] Request ID
736
+ * @param {*} [options] Override http request option.
737
+ * @throws {RequiredError}
738
+ */
739
+ cancelWorkflowExecution(e, o, n) {
740
+ return m(this.configuration).cancelWorkflowExecution(e, o, n).then((s) => s(this.axios, this.basePath));
741
+ }
742
+ /**
743
+ * Starts execution of a workflow definition
744
+ * @summary Create a new workflow execution
745
+ * @param {WorkflowExecutionRequest} workflowExecutionRequest
746
+ * @param {boolean} [xAsyncExecution] Set to true to execute the workflow asynchronously
747
+ * @param {string} [xFrankieRequestID] Request ID
748
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
749
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
750
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
751
+ * @param {*} [options] Override http request option.
752
+ * @throws {RequiredError}
753
+ */
754
+ createWorkflowExecution(e, o, n, s, i, r, a) {
755
+ return m(this.configuration).createWorkflowExecution(e, o, n, s, i, r, a).then((l) => l(this.axios, this.basePath));
756
+ }
757
+ /**
758
+ * Returns a workflow execution by its ID
759
+ * @summary Get a workflow execution by ID
760
+ * @param {string} executionId ID of the workflow execution
761
+ * @param {string} [xFrankieRequestID] Request ID
762
+ * @param {*} [options] Override http request option.
763
+ * @throws {RequiredError}
764
+ */
765
+ getWorkflowExecution(e, o, n) {
766
+ return m(this.configuration).getWorkflowExecution(e, o, n).then((s) => s(this.axios, this.basePath));
767
+ }
768
+ /**
769
+ * Returns a paginated list of workflow executions. Pagination is applied by default.
770
+ * @summary List workflow executions
771
+ * @param {string} [xFrankieRequestID] Request ID
772
+ * @param {string} [workflowDefinitionId] Filter by workflow definition ID
773
+ * @param {string} [owner] Filter by workflow definition owner
774
+ * @param {ListWorkflowExecutionsStatusEnum} [status] Filter by execution status
775
+ * @param {number} [page] Page number to retrieve (1-based)
776
+ * @param {number} [limit] Number of items per page (page size)
777
+ * @param {string} [startTimeBefore] Filter by execution start time before a specific date and time
778
+ * @param {string} [startTimeAfter] Filter by execution start time after a specific date and time
779
+ * @param {*} [options] Override http request option.
780
+ * @throws {RequiredError}
781
+ */
782
+ listWorkflowExecutions(e, o, n, s, i, r, a, l, c) {
783
+ return m(this.configuration).listWorkflowExecutions(e, o, n, s, i, r, a, l, c).then((f) => f(this.axios, this.basePath));
784
+ }
785
+ /**
786
+ * Resumes a workflow execution that was paused
787
+ * @summary Resume a paused workflow execution
788
+ * @param {string} executionId ID of the workflow execution
789
+ * @param {ResumeWorkflowExecution} resumeWorkflowExecution Resume data for the workflow execution
790
+ * @param {string} [xFrankieRequestID] Request ID
791
+ * @param {string} [xFrankieCustomerID] FrankieOne Customer Identifier
792
+ * @param {string} [xFrankieCustomerChildID] FrankieOne Customer Child Identifier
793
+ * @param {string} [xFrankieChannel] Channel that the request is coming from
794
+ * @param {*} [options] Override http request option.
795
+ * @throws {RequiredError}
796
+ */
797
+ resumeWorkflowExecution(e, o, n, s, i, r, a) {
798
+ return m(this.configuration).resumeWorkflowExecution(e, o, n, s, i, r, a).then((l) => l(this.axios, this.basePath));
799
+ }
800
+ }
801
+ const oe = {
802
+ Pending: "PENDING",
803
+ Running: "RUNNING",
804
+ Completed: "COMPLETED",
805
+ Failed: "FAILED",
806
+ Paused: "PAUSED",
807
+ Cancelled: "CANCELLED"
808
+ };
809
+ class te {
810
+ /**
811
+ * parameter for apiKey security
812
+ * @param name security name
813
+ */
814
+ apiKey;
815
+ /**
816
+ * parameter for basic security
817
+ */
818
+ username;
819
+ /**
820
+ * parameter for basic security
821
+ */
822
+ password;
823
+ /**
824
+ * parameter for oauth2 security
825
+ * @param name security name
826
+ * @param scopes oauth2 scope
827
+ */
828
+ accessToken;
829
+ /**
830
+ * parameter for aws4 signature security
831
+ * @param {Object} AWS4Signature - AWS4 Signature security
832
+ * @param {string} options.region - aws region
833
+ * @param {string} options.service - name of the service.
834
+ * @param {string} credentials.accessKeyId - aws access key id
835
+ * @param {string} credentials.secretAccessKey - aws access key
836
+ * @param {string} credentials.sessionToken - aws session token
837
+ * @memberof Configuration
838
+ */
839
+ awsv4;
840
+ /**
841
+ * override base path
842
+ */
843
+ basePath;
844
+ /**
845
+ * override server index
846
+ */
847
+ serverIndex;
848
+ /**
849
+ * base options for axios calls
850
+ */
851
+ baseOptions;
852
+ /**
853
+ * The FormData constructor that will be used to create multipart form data
854
+ * requests. You can inject this here so that execution environments that
855
+ * do not support the FormData class can still run the generated client.
856
+ *
857
+ * @type {new () => FormData}
858
+ */
859
+ formDataCtor;
860
+ constructor(e = {}) {
861
+ this.apiKey = e.apiKey, this.username = e.username, this.password = e.password, this.accessToken = e.accessToken, this.awsv4 = e.awsv4, this.basePath = e.basePath, this.serverIndex = e.serverIndex, this.baseOptions = {
862
+ ...e.baseOptions,
863
+ headers: {
864
+ ...e.baseOptions?.headers
865
+ }
866
+ }, this.formDataCtor = e.formDataCtor;
867
+ }
868
+ /**
869
+ * Check if the given MIME is a JSON MIME.
870
+ * JSON MIME examples:
871
+ * application/json
872
+ * application/json; charset=UTF8
873
+ * APPLICATION/JSON
874
+ * application/vnd.company+json
875
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
876
+ * @return True if the given MIME is JSON, false otherwise.
877
+ */
878
+ isJsonMime(e) {
879
+ const o = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i");
880
+ return e !== null && (o.test(e) || e.toLowerCase() === "application/json-patch+json");
881
+ }
882
+ }
883
+ export {
884
+ b as AgentTaskConfigAgentTypeEnum,
885
+ U as BaseTaskConfigType,
886
+ g as BranchTaskExpressionBaseType,
887
+ F as BranchTaskExpressionSimpleOperatorEnum,
888
+ te as Configuration,
889
+ B as FormFieldTextblockAlignmentEnum,
890
+ j as FormFieldType,
891
+ H as FormType,
892
+ G as HttpTaskConfigMethod,
893
+ oe as ListWorkflowExecutionsStatusEnum,
894
+ M as LogTaskConfigLevel,
895
+ q as NotificationTaskConfigBodyTypeEnum,
896
+ X as NotificationTaskConfigNotificationTypeEnum,
897
+ Q as RunWorkflowTaskConfigEntityTypeEnum,
898
+ $ as TaskExecutionDetailsStatus,
899
+ K as WorkflowDefinitionVariableTypeEnum,
900
+ Y as WorkflowDefinitionsApi,
901
+ L as WorkflowDefinitionsApiAxiosParamCreator,
902
+ J as WorkflowDefinitionsApiFactory,
903
+ T as WorkflowDefinitionsApiFp,
904
+ _ as WorkflowExecutionDetailsStatusEnum,
905
+ z as WorkflowExecutionSummaryStatusEnum,
906
+ ee as WorkflowExecutionsApi,
907
+ N as WorkflowExecutionsApiAxiosParamCreator,
908
+ Z as WorkflowExecutionsApiFactory,
909
+ m as WorkflowExecutionsApiFp
910
+ };
911
+ //# sourceMappingURL=workflow-api.js.map