@frontera-sdk/workflow 1.52.13 → 1.52.15

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/definition.ts +42 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontera-sdk/workflow",
3
- "version": "1.52.13",
3
+ "version": "1.52.15",
4
4
  "description": "Typed headless client for starting, inspecting, waiting on and cancelling Frontera workflow runs from a script or backend.",
5
5
  "keywords": [
6
6
  "frontera",
@@ -38,8 +38,8 @@
38
38
  "typecheck": "bunx tsc --noEmit"
39
39
  },
40
40
  "dependencies": {
41
- "@frontera-sdk/core": "1.52.13",
42
- "@frontera-sdk/functions": "1.52.13"
41
+ "@frontera-sdk/core": "1.52.15",
42
+ "@frontera-sdk/functions": "1.52.15"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/bun": "^1.3.14",
package/src/definition.ts CHANGED
@@ -263,6 +263,19 @@ export interface DecideParams {
263
263
  }
264
264
  export interface ActionParams {
265
265
  input: DataInput
266
+ /**
267
+ * Keep the step open until the request settles (succeeded, rejected,
268
+ * expired, cancelled, failed, or closed with an unknown outcome) instead of
269
+ * returning as soon as it is submitted. Absent or `false`: the step returns
270
+ * `{ requestId, lifecycle }` at submit, as it always has.
271
+ */
272
+ waitForOutcome?: boolean
273
+ /**
274
+ * How long a `waitForOutcome` step waits, like `30m` or `4h`. Defaults to
275
+ * `1h`, at most `24h`. Reaching it is not a failure: the step returns
276
+ * `timedOut: true` with the lifecycle it last read.
277
+ */
278
+ outcomeTimeout?: string
266
279
  }
267
280
  export interface AgentParams {
268
281
  message: DataInput
@@ -300,11 +313,38 @@ export interface ForEachParams {
300
313
  export interface ParallelParams {
301
314
  branches: Array<{ id: string; nodes: WorkflowNode[] }>
302
315
  }
303
- export interface WaitParams {
304
- /** Exactly one of `for` or `until`. */
316
+ /** Wait for a length of time, or until a moment. Exactly one of `for` or `until`. */
317
+ export interface WaitTimeParams {
318
+ mode?: 'time'
305
319
  for?: string
306
320
  until?: string
307
321
  }
322
+ /**
323
+ * Wait until one Blueprint record meets a condition, re-reading it until the
324
+ * condition holds or `timeout` passes. Reaching the timeout is not a failure:
325
+ * the step returns `{ matched: false, timedOut: true, record }`.
326
+ */
327
+ export interface WaitRecordParams {
328
+ mode: 'record'
329
+ /** The object type to read, by id. */
330
+ objectTypeId: string
331
+ /** The record's primary key. */
332
+ pk: DataInput
333
+ /** JSONata predicate evaluated with the record as `$`, e.g. `jobState in ['accepted', 'declined']`. */
334
+ where: string
335
+ /** How long to wait, like `30m` or `4h`. Defaults to `1h`, at most `7d`. */
336
+ timeout?: string
337
+ /** How often to read the record. Defaults to `30s`; widened when the timeout would need too many reads. */
338
+ pollEvery?: string
339
+ /**
340
+ * Never set on a record wait. Declared so code that reads `params.for` or
341
+ * `params.until` off a `WaitParams` keeps compiling; `mode` still tells the
342
+ * two apart.
343
+ */
344
+ for?: never
345
+ until?: never
346
+ }
347
+ export type WaitParams = WaitTimeParams | WaitRecordParams
308
348
  export interface RespondParams {
309
349
  status: number
310
350
  headers?: Record<string, DataInput>