@sanity/workflow-engine 0.18.0 → 0.19.0
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/CHANGELOG.md +9 -0
- package/DATAMODEL.md +53 -0
- package/dist/_chunks-cjs/invariants.cjs +87 -17
- package/dist/_chunks-es/invariants.js +87 -17
- package/dist/define.d.cts +212 -4
- package/dist/define.d.ts +212 -4
- package/dist/index.cjs +2334 -1864
- package/dist/index.d.cts +455 -9
- package/dist/index.d.ts +455 -9
- package/dist/index.js +2313 -1855
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -140,6 +140,19 @@ export declare interface ActionEvaluation {
|
|
|
140
140
|
triggered?: true;
|
|
141
141
|
/** Present iff `allowed === false`. The first failing gate wins. */
|
|
142
142
|
disabledReason?: DisabledReason;
|
|
143
|
+
/**
|
|
144
|
+
* What firing this action would do to the flow RIGHT NOW — the fire
|
|
145
|
+
* replayed in memory on the engine's own machinery (ops, the triggered
|
|
146
|
+
* fixpoint, transition selection) against this projection's state, and
|
|
147
|
+
* conditional on the commit landing (rejectability is `allowed` /
|
|
148
|
+
* `disabledReason`'s story). Omitted when the consequence depends on
|
|
149
|
+
* inputs the projection doesn't hold — caller params, a spawn's
|
|
150
|
+
* dataset-driven fan-out, a terminal instance, a stage visit whose
|
|
151
|
+
* entries have diverged from the pinned definition — and on cascade-fired
|
|
152
|
+
* actions, which are never a caller's to fire. Advisory like every
|
|
153
|
+
* derived verdict: a placement/phrasing hint, never a gate.
|
|
154
|
+
*/
|
|
155
|
+
firing?: FiringConsequence;
|
|
143
156
|
/** Derived state of the action's `filter` gate — why it holds or fails,
|
|
144
157
|
* atom by atom. Present iff the action declares a filter. */
|
|
145
158
|
insight?: ConditionInsight;
|
|
@@ -1672,6 +1685,42 @@ declare type Clocked<T> = T & {
|
|
|
1672
1685
|
clock?: Clock;
|
|
1673
1686
|
};
|
|
1674
1687
|
|
|
1688
|
+
declare interface CommitEffectOpsArgs extends DedupableOperationArgs {
|
|
1689
|
+
/** The `_key` of the pending effect being reported on. */
|
|
1690
|
+
effectKey: string;
|
|
1691
|
+
/**
|
|
1692
|
+
* Required here, unlike the other dedupable verbs: the engine cannot
|
|
1693
|
+
* assume a supplied field op is idempotent, so every mid-dispatch report
|
|
1694
|
+
* must be retry-safe. (The runtime check remains for untyped callers.)
|
|
1695
|
+
*/
|
|
1696
|
+
idempotencyKey: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* The exact-claim identity handed to the reporting dispatch. The commit
|
|
1699
|
+
* re-reads the instance and rejects (writing nothing) unless the entry's
|
|
1700
|
+
* live claim carries this token unexpired — so an expired, released, or
|
|
1701
|
+
* superseded handler cannot update state. A successful commit renews the
|
|
1702
|
+
* claim's lease.
|
|
1703
|
+
*/
|
|
1704
|
+
claimToken: string;
|
|
1705
|
+
/**
|
|
1706
|
+
* Mid-dispatch field state, `field.*` ops only — validated and applied
|
|
1707
|
+
* exactly like completion ops (same applier, same target resolution
|
|
1708
|
+
* against the current open stage, workflow-/stage-scope only, never
|
|
1709
|
+
* `status.set`). Must be non-empty. Completion ops remain the final
|
|
1710
|
+
* atomic result committed when the handler returns; these are separately
|
|
1711
|
+
* committed and observable before it.
|
|
1712
|
+
*/
|
|
1713
|
+
ops: FieldOp[];
|
|
1714
|
+
/** Lease duration the successful commit renews the claim to — the
|
|
1715
|
+
* drain's `effectLeaseMs`. Default `DEFAULT_EFFECT_LEASE_MS` (5 min). */
|
|
1716
|
+
leaseMs?: number;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
export declare interface CommitOpsRequest {
|
|
1720
|
+
ops: FieldOp[];
|
|
1721
|
+
idempotencyKey: string;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1675
1724
|
export { ComparisonOp };
|
|
1676
1725
|
|
|
1677
1726
|
/**
|
|
@@ -1749,6 +1798,20 @@ export declare function computeDiffEntries<
|
|
|
1749
1798
|
target: DeployTarget;
|
|
1750
1799
|
}): Promise<DiffEntry[]>;
|
|
1751
1800
|
|
|
1801
|
+
/** {@link ConcurrentCompleteEffectError}'s mid-dispatch sibling: a
|
|
1802
|
+
* `commitEffectOps` commit lost every optimistic-locking attempt. Nothing
|
|
1803
|
+
* was written; the report may be retried under the same idempotency key. */
|
|
1804
|
+
export declare class ConcurrentCommitEffectOpsError extends WorkflowError<"concurrent-commit-effect-ops"> {
|
|
1805
|
+
readonly instanceId: string;
|
|
1806
|
+
readonly effectKey: string;
|
|
1807
|
+
readonly attempts: number;
|
|
1808
|
+
constructor(args: {
|
|
1809
|
+
instanceId: string;
|
|
1810
|
+
effectKey: string;
|
|
1811
|
+
attempts: number;
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1752
1815
|
/**
|
|
1753
1816
|
* Completion twin of {@link ConcurrentFireActionError}: a `completeEffect`
|
|
1754
1817
|
* commit lost the optimistic-locking race on every attempt. Same contract —
|
|
@@ -2221,6 +2284,24 @@ export declare const DATA_MODEL_CHANGES: readonly [
|
|
|
2221
2284
|
applicability: "detectable";
|
|
2222
2285
|
summary: "String, text, and number values may carry persisted inclusive bounds.";
|
|
2223
2286
|
}>,
|
|
2287
|
+
Readonly<{
|
|
2288
|
+
id: "progress-field-kind";
|
|
2289
|
+
introducedInModel: 3;
|
|
2290
|
+
minReaderModel: 0;
|
|
2291
|
+
documentTypes: readonly ["definition", "instance"];
|
|
2292
|
+
compatibility: "additive";
|
|
2293
|
+
applicability: "detectable";
|
|
2294
|
+
summary: "A progress field kind carries application-defined 0–100 completion.";
|
|
2295
|
+
}>,
|
|
2296
|
+
Readonly<{
|
|
2297
|
+
id: "effect-claim-tokens";
|
|
2298
|
+
introducedInModel: 3;
|
|
2299
|
+
minReaderModel: 0;
|
|
2300
|
+
documentTypes: readonly ["instance"];
|
|
2301
|
+
compatibility: "additive";
|
|
2302
|
+
applicability: "detectable";
|
|
2303
|
+
summary: "Pending-effect claims carry an exact-claim token gating mid-dispatch state reports.";
|
|
2304
|
+
}>,
|
|
2224
2305
|
];
|
|
2225
2306
|
|
|
2226
2307
|
/**
|
|
@@ -2245,7 +2326,7 @@ export declare const DATA_MODEL_MIN_READER = 2;
|
|
|
2245
2326
|
* job. Declare every bump in `DATAMODEL.md`; the model-surface snapshot test
|
|
2246
2327
|
* keeps undeclared drift red.
|
|
2247
2328
|
*/
|
|
2248
|
-
export declare const DATA_MODEL_VERSION =
|
|
2329
|
+
export declare const DATA_MODEL_VERSION = 3;
|
|
2249
2330
|
|
|
2250
2331
|
export declare interface DataModelChange {
|
|
2251
2332
|
readonly id: string;
|
|
@@ -2278,9 +2359,10 @@ export declare type DeclaredExecutionContext = Pick<
|
|
|
2278
2359
|
|
|
2279
2360
|
/**
|
|
2280
2361
|
* The {@link OperationArgs} of the verbs that own a discrete commit —
|
|
2281
|
-
* `fireAction`, `editField`, `completeEffect`, `
|
|
2282
|
-
* `tick` deliberately takes the plain base: it owns no
|
|
2283
|
-
* re-derives everything, so retrying it blind is
|
|
2362
|
+
* `fireAction`, `editField`, `completeEffect`, `commitEffectOps`, `setStage`,
|
|
2363
|
+
* `abortInstance`. `tick` deliberately takes the plain base: it owns no
|
|
2364
|
+
* commit of its own and re-derives everything, so retrying it blind is
|
|
2365
|
+
* already safe.
|
|
2284
2366
|
*/
|
|
2285
2367
|
export declare interface DedupableOperationArgs extends OperationArgs {
|
|
2286
2368
|
/**
|
|
@@ -3285,6 +3367,16 @@ export declare type EditMode = "set" | "append" | "unset";
|
|
|
3285
3367
|
|
|
3286
3368
|
export declare type Effect = v.InferOutput<typeof EffectSchema>;
|
|
3287
3369
|
|
|
3370
|
+
/** Total commits one dispatch may make — the runaway-handler bound: without
|
|
3371
|
+
* it, a looping reporter renews its own lease and appends history forever.
|
|
3372
|
+
* 2× the ceiling of 1%-granularity progress reporting. */
|
|
3373
|
+
export declare const EFFECT_COMMIT_DISPATCH_CAP = 200;
|
|
3374
|
+
|
|
3375
|
+
/** Pending mid-dispatch commits one dispatch may hold before `commitOps` /
|
|
3376
|
+
* `setProgress` throws synchronously. An awaiting handler never reaches it
|
|
3377
|
+
* (its queue depth stays ≤ 1). */
|
|
3378
|
+
export declare const EFFECT_COMMIT_QUEUE_DEPTH = 32;
|
|
3379
|
+
|
|
3288
3380
|
/**
|
|
3289
3381
|
* Every terminal state an effect run can record. `done` and `failed` are
|
|
3290
3382
|
* reported through completion ({@link EffectCompletionStatus}); `cancelled`
|
|
@@ -3294,6 +3386,22 @@ export declare type Effect = v.InferOutput<typeof EffectSchema>;
|
|
|
3294
3386
|
*/
|
|
3295
3387
|
declare const EFFECT_RUN_STATUSES: readonly ["done", "failed", "cancelled"];
|
|
3296
3388
|
|
|
3389
|
+
/**
|
|
3390
|
+
* A `ctx.commitOps` / `ctx.setProgress` call hit one of the dispatch's
|
|
3391
|
+
* bounds. Thrown synchronously at the call site — see the module doc for why
|
|
3392
|
+
* a rejection would be invisible to exactly the caller the bound exists for.
|
|
3393
|
+
*/
|
|
3394
|
+
export declare class EffectCommitQueueOverflowError extends WorkflowError<"effect-commit-queue-overflow"> {
|
|
3395
|
+
readonly effectKey: string;
|
|
3396
|
+
readonly bound: "queue-depth" | "dispatch-cap";
|
|
3397
|
+
readonly limit: number;
|
|
3398
|
+
constructor(args: {
|
|
3399
|
+
effectKey: string;
|
|
3400
|
+
bound: "queue-depth" | "dispatch-cap";
|
|
3401
|
+
limit: number;
|
|
3402
|
+
});
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3297
3405
|
/** The outcomes a completer may report through `completeEffect` — a run
|
|
3298
3406
|
* either succeeded or failed. `cancelled` is not reportable: only an abort
|
|
3299
3407
|
* stamps it, on entries that never dispatched. */
|
|
@@ -3378,6 +3486,34 @@ declare type EffectHandlerContext<Client extends WorkflowClient> = {
|
|
|
3378
3486
|
instanceId: string;
|
|
3379
3487
|
effectKey: string;
|
|
3380
3488
|
log: (message: string, extra?: Record<string, unknown>) => void;
|
|
3489
|
+
/**
|
|
3490
|
+
* Commit mid-dispatch field state as a real engine transaction —
|
|
3491
|
+
* validated like completion ops (`field.*` only, never `status.set`),
|
|
3492
|
+
* gated on THIS dispatch's exact claim (a stale/superseded claim
|
|
3493
|
+
* rejects before writing), history + idempotency recorded, guards
|
|
3494
|
+
* refreshed, cascade run, and the claim's lease renewed in the same
|
|
3495
|
+
* commit. Calls enqueue synchronously into a bounded per-dispatch FIFO
|
|
3496
|
+
* and execute strictly in call order, one at a time — forgetting to
|
|
3497
|
+
* `await` cannot create same-handler write races, and overflow (or the
|
|
3498
|
+
* per-dispatch commit cap) throws synchronously at the call site.
|
|
3499
|
+
* Await each call anyway: that is where errors surface promptly and
|
|
3500
|
+
* engine commit latency paces the reporter. `idempotencyKey` is
|
|
3501
|
+
* required — the engine does not assume a supplied op is idempotent.
|
|
3502
|
+
* An accepted-but-unawaited commit that fails still fails the effect
|
|
3503
|
+
* at settlement; the final completion always waits for this queue to
|
|
3504
|
+
* drain. Never coalesced.
|
|
3505
|
+
*/
|
|
3506
|
+
commitOps: (req: CommitOpsRequest) => Promise<void>;
|
|
3507
|
+
/**
|
|
3508
|
+
* Report absolute progress — sugar over {@link commitOps} that
|
|
3509
|
+
* `field.set`s a number (a `progress` field's 0–100 contract is
|
|
3510
|
+
* enforced by the engine at commit). A bare string targets a
|
|
3511
|
+
* workflow-scope field; pass `{scope: 'stage', field}` for stage
|
|
3512
|
+
* scope. Unlike `commitOps`, PENDING sets to the same field coalesce
|
|
3513
|
+
* (latest value wins, one commit), so a tight reporting loop is safe
|
|
3514
|
+
* by construction; idempotency keys are engine-derived.
|
|
3515
|
+
*/
|
|
3516
|
+
setProgress: (target: ProgressTarget, value: number) => Promise<void>;
|
|
3381
3517
|
};
|
|
3382
3518
|
|
|
3383
3519
|
export declare interface EffectHistoryEntry {
|
|
@@ -3579,6 +3715,10 @@ export declare interface Engine {
|
|
|
3579
3715
|
* reassign / reschedule / claim-by-hand / append-to-log, then cascade. */
|
|
3580
3716
|
editField: (args: EditFieldArgs) => Promise<OperationResult>;
|
|
3581
3717
|
completeEffect: (args: CompleteEffectArgs) => Promise<OperationResult>;
|
|
3718
|
+
/** Commit mid-dispatch field state from a running effect handler — the
|
|
3719
|
+
* verb behind `ctx.commitOps`. Gated on the dispatch's exact claim token;
|
|
3720
|
+
* a successful commit renews the claim's lease. */
|
|
3721
|
+
commitEffectOps: (args: CommitEffectOpsArgs) => Promise<OperationResult>;
|
|
3582
3722
|
tick: (args: OperationArgs) => Promise<OperationResult>;
|
|
3583
3723
|
/** Project the instance from an actor's perspective — per-action verdicts
|
|
3584
3724
|
* with structured disabled reasons. Pure read. */
|
|
@@ -4117,6 +4257,10 @@ export declare const FIELD_KIND_DISPLAY: {
|
|
|
4117
4257
|
title: string;
|
|
4118
4258
|
description: string;
|
|
4119
4259
|
};
|
|
4260
|
+
progress: {
|
|
4261
|
+
title: string;
|
|
4262
|
+
description: string;
|
|
4263
|
+
};
|
|
4120
4264
|
boolean: {
|
|
4121
4265
|
title: string;
|
|
4122
4266
|
description: string;
|
|
@@ -4174,6 +4318,7 @@ declare const FIELD_VALUE_KINDS: readonly [
|
|
|
4174
4318
|
"string",
|
|
4175
4319
|
"text",
|
|
4176
4320
|
"number",
|
|
4321
|
+
"progress",
|
|
4177
4322
|
"boolean",
|
|
4178
4323
|
"date",
|
|
4179
4324
|
"datetime",
|
|
@@ -4314,6 +4459,10 @@ export declare interface FieldValueMap {
|
|
|
4314
4459
|
/** Multiline string — same value as {@link FieldValueMap.string}, distinct kind for rendering. */
|
|
4315
4460
|
text: string | null;
|
|
4316
4461
|
number: number | null;
|
|
4462
|
+
/** Application-defined 0–100 completion — same stored value as
|
|
4463
|
+
* {@link FieldValueMap.number}, distinct kind so surfaces can elevate it;
|
|
4464
|
+
* always finite and within 0–100 inclusive (fractions allowed). */
|
|
4465
|
+
progress: number | null;
|
|
4317
4466
|
boolean: boolean | null;
|
|
4318
4467
|
/** Date-only (`YYYY-MM-DD`), no time component. */
|
|
4319
4468
|
date: string | null;
|
|
@@ -4411,6 +4560,20 @@ export declare interface FireActionArgs extends DedupableOperationArgs {
|
|
|
4411
4560
|
idempotent?: boolean;
|
|
4412
4561
|
}
|
|
4413
4562
|
|
|
4563
|
+
/**
|
|
4564
|
+
* The flow consequence of one caller fire, computed by replaying it in
|
|
4565
|
+
* memory through the same machinery a real commit runs — never by a
|
|
4566
|
+
* parallel model of it. State-dependent: it answers "now", not "always".
|
|
4567
|
+
*/
|
|
4568
|
+
export declare interface FiringConsequence {
|
|
4569
|
+
/** The replayed commit's cascade exits the current stage in its first
|
|
4570
|
+
* hop. `false` is a definite answer for the current state — including
|
|
4571
|
+
* a selection halted by an unevaluable trigger, which holds the stage. */
|
|
4572
|
+
exitsStage: boolean;
|
|
4573
|
+
/** The transition the selection picked, present iff `exitsStage`. */
|
|
4574
|
+
transition?: string;
|
|
4575
|
+
}
|
|
4576
|
+
|
|
4414
4577
|
export { formatRead };
|
|
4415
4578
|
|
|
4416
4579
|
/**
|
|
@@ -6335,6 +6498,16 @@ export declare interface PendingEffectClaim {
|
|
|
6335
6498
|
* live claim), and a field would drift from that trail across releases.
|
|
6336
6499
|
*/
|
|
6337
6500
|
leaseExpiresAt?: string;
|
|
6501
|
+
/**
|
|
6502
|
+
* The exact-claim identity a mid-dispatch state report must present.
|
|
6503
|
+
* `effectKey` cannot serve: a lease takeover keeps the same key, so a
|
|
6504
|
+
* superseded handler holding only the key could still write. The token is
|
|
6505
|
+
* minted fresh on every claim and takeover; `commitEffectOps` rejects a
|
|
6506
|
+
* report whose token no longer matches before writing anything. Absent
|
|
6507
|
+
* only on claims persisted before tokens existed — those never match, so
|
|
6508
|
+
* their dispatches simply cannot report mid-flight.
|
|
6509
|
+
*/
|
|
6510
|
+
claimToken?: string;
|
|
6338
6511
|
}
|
|
6339
6512
|
|
|
6340
6513
|
/**
|
|
@@ -6400,6 +6573,15 @@ export declare function processShellUserProperties<
|
|
|
6400
6573
|
runtimeVersion: string;
|
|
6401
6574
|
};
|
|
6402
6575
|
|
|
6576
|
+
/** `setProgress`'s field addressing: a bare name targets the workflow scope;
|
|
6577
|
+
* pass `{scope: 'stage', field}` for a stage-scope progress field. */
|
|
6578
|
+
export declare type ProgressTarget =
|
|
6579
|
+
| string
|
|
6580
|
+
| {
|
|
6581
|
+
scope: "workflow" | "stage";
|
|
6582
|
+
field: string;
|
|
6583
|
+
};
|
|
6584
|
+
|
|
6403
6585
|
/**
|
|
6404
6586
|
* Project a store-resolved doc onto its watch ref's identity, the way the
|
|
6405
6587
|
* lake's perspective reads do: the published-form id becomes `_id` (the form
|
|
@@ -6457,7 +6639,7 @@ export declare class ReaderModelAcknowledgementError extends WorkflowError<"read
|
|
|
6457
6639
|
readonly code = "WORKFLOW_READER_MODEL_ACKNOWLEDGEMENT_MISMATCH";
|
|
6458
6640
|
readonly expectedMinReaderModel: unknown;
|
|
6459
6641
|
readonly engineMinReaderModel = 2;
|
|
6460
|
-
readonly engineModelVersion =
|
|
6642
|
+
readonly engineModelVersion = 3;
|
|
6461
6643
|
readonly documentationUrl =
|
|
6462
6644
|
"https://github.com/sanity-io/workflows/blob/main/docs/reader-model-rollout.md";
|
|
6463
6645
|
constructor(expectedMinReaderModel: unknown, context?: string);
|
|
@@ -7079,6 +7261,32 @@ declare interface StageGuardArgs {
|
|
|
7079
7261
|
|
|
7080
7262
|
export declare type StageName = string;
|
|
7081
7263
|
|
|
7264
|
+
/** Why a mid-dispatch report's claim no longer authorises it — see
|
|
7265
|
+
* {@link StaleEffectClaimError}. */
|
|
7266
|
+
export declare type StaleClaimReason =
|
|
7267
|
+
| "unclaimed"
|
|
7268
|
+
| "claim-superseded"
|
|
7269
|
+
| "lease-expired";
|
|
7270
|
+
|
|
7271
|
+
/**
|
|
7272
|
+
* Thrown when a mid-dispatch state report (`commitEffectOps`) presents a
|
|
7273
|
+
* claim token that no longer authorises writing: the entry's claim was
|
|
7274
|
+
* released, taken over by another dispatch (`claim-superseded`), or its
|
|
7275
|
+
* lease lapsed. Nothing was written — the gate runs before any mutation.
|
|
7276
|
+
* The handler should stop reporting; its completion still follows the
|
|
7277
|
+
* normal first-writer-wins completion semantics.
|
|
7278
|
+
*/
|
|
7279
|
+
export declare class StaleEffectClaimError extends WorkflowError<"stale-effect-claim"> {
|
|
7280
|
+
readonly instanceId: string;
|
|
7281
|
+
readonly effectKey: string;
|
|
7282
|
+
readonly reason: StaleClaimReason;
|
|
7283
|
+
constructor(args: {
|
|
7284
|
+
instanceId: string;
|
|
7285
|
+
effectKey: string;
|
|
7286
|
+
reason: StaleClaimReason;
|
|
7287
|
+
});
|
|
7288
|
+
}
|
|
7289
|
+
|
|
7082
7290
|
/**
|
|
7083
7291
|
* The vars a definition's `start.allowed` reads — the start-time permission
|
|
7084
7292
|
* dialect: everything the filter context binds ({@link START_FILTER_VARS})
|
|
@@ -8527,6 +8735,23 @@ export declare const workflow: {
|
|
|
8527
8735
|
completeEffect: (
|
|
8528
8736
|
rawArgs: Clocked<Telemetered<CompleteEffectArgs & EngineScopeArgs>>,
|
|
8529
8737
|
) => Promise<OperationResult>;
|
|
8738
|
+
/**
|
|
8739
|
+
* Commit mid-dispatch field state from a running effect handler — the
|
|
8740
|
+
* engine verb behind `ctx.commitOps`. Gates on the dispatch's exact claim
|
|
8741
|
+
* (token match + unexpired lease; a stale report throws
|
|
8742
|
+
* `StaleEffectClaimError` and writes nothing), validates and applies the
|
|
8743
|
+
* `field.*` ops through the shared op applier, records history and the
|
|
8744
|
+
* mandatory idempotency key, renews the claim's lease in the same
|
|
8745
|
+
* compare-and-swap commit, refreshes the stage's guards, then cascades —
|
|
8746
|
+
* a report that satisfies a transition moves the instance, by design.
|
|
8747
|
+
*
|
|
8748
|
+
* Completion (`completeEffect`) remains the authoritative final result
|
|
8749
|
+
* and stays claim-blind; this verb only protects the mid-dispatch write
|
|
8750
|
+
* channel from superseded handlers.
|
|
8751
|
+
*/
|
|
8752
|
+
commitEffectOps: (
|
|
8753
|
+
rawArgs: Clocked<Telemetered<CommitEffectOpsArgs & EngineScopeArgs>>,
|
|
8754
|
+
) => Promise<OperationResult>;
|
|
8530
8755
|
/**
|
|
8531
8756
|
* Run the cascade until stable — triggered actions fire, transitions move.
|
|
8532
8757
|
*
|
|
@@ -8979,7 +9204,11 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
|
|
|
8979
9204
|
readonly name: v.SchemaWithPipe<
|
|
8980
9205
|
readonly [
|
|
8981
9206
|
v.StringSchema<undefined>,
|
|
8982
|
-
v.NonEmptyAction<string,
|
|
9207
|
+
v.NonEmptyAction<string, undefined>,
|
|
9208
|
+
v.CheckAction<
|
|
9209
|
+
string,
|
|
9210
|
+
`invalid ${string} \u2014 ASCII lowercase + digits + dashes, no leading dash, no dots`
|
|
9211
|
+
>,
|
|
8983
9212
|
]
|
|
8984
9213
|
>;
|
|
8985
9214
|
readonly expectedMinReaderModel: v.OptionalSchema<
|
|
@@ -8992,7 +9221,7 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
|
|
|
8992
9221
|
v.NonEmptyAction<string, undefined>,
|
|
8993
9222
|
v.CheckAction<
|
|
8994
9223
|
string,
|
|
8995
|
-
|
|
9224
|
+
`invalid ${string} \u2014 ASCII lowercase + digits + dashes, no leading dash, no dots`
|
|
8996
9225
|
>,
|
|
8997
9226
|
]
|
|
8998
9227
|
>;
|
|
@@ -9193,7 +9422,30 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
|
|
|
9193
9422
|
id: string;
|
|
9194
9423
|
};
|
|
9195
9424
|
}[],
|
|
9196
|
-
|
|
9425
|
+
(
|
|
9426
|
+
issue: v.CheckIssue<
|
|
9427
|
+
{
|
|
9428
|
+
name: string;
|
|
9429
|
+
resource:
|
|
9430
|
+
| {
|
|
9431
|
+
type: "dataset";
|
|
9432
|
+
id: string;
|
|
9433
|
+
}
|
|
9434
|
+
| {
|
|
9435
|
+
type: "canvas";
|
|
9436
|
+
id: string;
|
|
9437
|
+
}
|
|
9438
|
+
| {
|
|
9439
|
+
type: "media-library";
|
|
9440
|
+
id: string;
|
|
9441
|
+
}
|
|
9442
|
+
| {
|
|
9443
|
+
type: "dashboard";
|
|
9444
|
+
id: string;
|
|
9445
|
+
};
|
|
9446
|
+
}[]
|
|
9447
|
+
>,
|
|
9448
|
+
) => string
|
|
9197
9449
|
>,
|
|
9198
9450
|
]
|
|
9199
9451
|
>,
|
|
@@ -9363,7 +9615,187 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
|
|
|
9363
9615
|
roleAliases?: RoleAliases | undefined;
|
|
9364
9616
|
}[];
|
|
9365
9617
|
}[],
|
|
9366
|
-
|
|
9618
|
+
(
|
|
9619
|
+
issue: v.CheckIssue<
|
|
9620
|
+
{
|
|
9621
|
+
name: string;
|
|
9622
|
+
expectedMinReaderModel?: 2 | undefined;
|
|
9623
|
+
tag: string;
|
|
9624
|
+
workflowResource:
|
|
9625
|
+
| {
|
|
9626
|
+
type: "dataset";
|
|
9627
|
+
id: string;
|
|
9628
|
+
}
|
|
9629
|
+
| {
|
|
9630
|
+
type: "canvas";
|
|
9631
|
+
id: string;
|
|
9632
|
+
}
|
|
9633
|
+
| {
|
|
9634
|
+
type: "media-library";
|
|
9635
|
+
id: string;
|
|
9636
|
+
}
|
|
9637
|
+
| {
|
|
9638
|
+
type: "dashboard";
|
|
9639
|
+
id: string;
|
|
9640
|
+
};
|
|
9641
|
+
resourceAliases?:
|
|
9642
|
+
| {
|
|
9643
|
+
name: string;
|
|
9644
|
+
resource:
|
|
9645
|
+
| {
|
|
9646
|
+
type: "dataset";
|
|
9647
|
+
id: string;
|
|
9648
|
+
}
|
|
9649
|
+
| {
|
|
9650
|
+
type: "canvas";
|
|
9651
|
+
id: string;
|
|
9652
|
+
}
|
|
9653
|
+
| {
|
|
9654
|
+
type: "media-library";
|
|
9655
|
+
id: string;
|
|
9656
|
+
}
|
|
9657
|
+
| {
|
|
9658
|
+
type: "dashboard";
|
|
9659
|
+
id: string;
|
|
9660
|
+
};
|
|
9661
|
+
}[]
|
|
9662
|
+
| undefined;
|
|
9663
|
+
definitions: {
|
|
9664
|
+
name: string;
|
|
9665
|
+
title: string;
|
|
9666
|
+
description?: string | undefined;
|
|
9667
|
+
groups?: Group[] | undefined;
|
|
9668
|
+
lifecycle?: WorkflowLifecycle | undefined;
|
|
9669
|
+
start?: StartBlock | undefined;
|
|
9670
|
+
initialStage: string;
|
|
9671
|
+
fields?: FieldEntry[] | undefined;
|
|
9672
|
+
stages: Stage[];
|
|
9673
|
+
predicates?: Record<string, string> | undefined;
|
|
9674
|
+
roleAliases?: RoleAliases | undefined;
|
|
9675
|
+
}[];
|
|
9676
|
+
}[]
|
|
9677
|
+
>,
|
|
9678
|
+
) => string
|
|
9679
|
+
>,
|
|
9680
|
+
v.CheckAction<
|
|
9681
|
+
{
|
|
9682
|
+
name: string;
|
|
9683
|
+
expectedMinReaderModel?: 2 | undefined;
|
|
9684
|
+
tag: string;
|
|
9685
|
+
workflowResource:
|
|
9686
|
+
| {
|
|
9687
|
+
type: "dataset";
|
|
9688
|
+
id: string;
|
|
9689
|
+
}
|
|
9690
|
+
| {
|
|
9691
|
+
type: "canvas";
|
|
9692
|
+
id: string;
|
|
9693
|
+
}
|
|
9694
|
+
| {
|
|
9695
|
+
type: "media-library";
|
|
9696
|
+
id: string;
|
|
9697
|
+
}
|
|
9698
|
+
| {
|
|
9699
|
+
type: "dashboard";
|
|
9700
|
+
id: string;
|
|
9701
|
+
};
|
|
9702
|
+
resourceAliases?:
|
|
9703
|
+
| {
|
|
9704
|
+
name: string;
|
|
9705
|
+
resource:
|
|
9706
|
+
| {
|
|
9707
|
+
type: "dataset";
|
|
9708
|
+
id: string;
|
|
9709
|
+
}
|
|
9710
|
+
| {
|
|
9711
|
+
type: "canvas";
|
|
9712
|
+
id: string;
|
|
9713
|
+
}
|
|
9714
|
+
| {
|
|
9715
|
+
type: "media-library";
|
|
9716
|
+
id: string;
|
|
9717
|
+
}
|
|
9718
|
+
| {
|
|
9719
|
+
type: "dashboard";
|
|
9720
|
+
id: string;
|
|
9721
|
+
};
|
|
9722
|
+
}[]
|
|
9723
|
+
| undefined;
|
|
9724
|
+
definitions: {
|
|
9725
|
+
name: string;
|
|
9726
|
+
title: string;
|
|
9727
|
+
description?: string | undefined;
|
|
9728
|
+
groups?: Group[] | undefined;
|
|
9729
|
+
lifecycle?: WorkflowLifecycle | undefined;
|
|
9730
|
+
start?: StartBlock | undefined;
|
|
9731
|
+
initialStage: string;
|
|
9732
|
+
fields?: FieldEntry[] | undefined;
|
|
9733
|
+
stages: Stage[];
|
|
9734
|
+
predicates?: Record<string, string> | undefined;
|
|
9735
|
+
roleAliases?: RoleAliases | undefined;
|
|
9736
|
+
}[];
|
|
9737
|
+
}[],
|
|
9738
|
+
(
|
|
9739
|
+
issue: v.CheckIssue<
|
|
9740
|
+
{
|
|
9741
|
+
name: string;
|
|
9742
|
+
expectedMinReaderModel?: 2 | undefined;
|
|
9743
|
+
tag: string;
|
|
9744
|
+
workflowResource:
|
|
9745
|
+
| {
|
|
9746
|
+
type: "dataset";
|
|
9747
|
+
id: string;
|
|
9748
|
+
}
|
|
9749
|
+
| {
|
|
9750
|
+
type: "canvas";
|
|
9751
|
+
id: string;
|
|
9752
|
+
}
|
|
9753
|
+
| {
|
|
9754
|
+
type: "media-library";
|
|
9755
|
+
id: string;
|
|
9756
|
+
}
|
|
9757
|
+
| {
|
|
9758
|
+
type: "dashboard";
|
|
9759
|
+
id: string;
|
|
9760
|
+
};
|
|
9761
|
+
resourceAliases?:
|
|
9762
|
+
| {
|
|
9763
|
+
name: string;
|
|
9764
|
+
resource:
|
|
9765
|
+
| {
|
|
9766
|
+
type: "dataset";
|
|
9767
|
+
id: string;
|
|
9768
|
+
}
|
|
9769
|
+
| {
|
|
9770
|
+
type: "canvas";
|
|
9771
|
+
id: string;
|
|
9772
|
+
}
|
|
9773
|
+
| {
|
|
9774
|
+
type: "media-library";
|
|
9775
|
+
id: string;
|
|
9776
|
+
}
|
|
9777
|
+
| {
|
|
9778
|
+
type: "dashboard";
|
|
9779
|
+
id: string;
|
|
9780
|
+
};
|
|
9781
|
+
}[]
|
|
9782
|
+
| undefined;
|
|
9783
|
+
definitions: {
|
|
9784
|
+
name: string;
|
|
9785
|
+
title: string;
|
|
9786
|
+
description?: string | undefined;
|
|
9787
|
+
groups?: Group[] | undefined;
|
|
9788
|
+
lifecycle?: WorkflowLifecycle | undefined;
|
|
9789
|
+
start?: StartBlock | undefined;
|
|
9790
|
+
initialStage: string;
|
|
9791
|
+
fields?: FieldEntry[] | undefined;
|
|
9792
|
+
stages: Stage[];
|
|
9793
|
+
predicates?: Record<string, string> | undefined;
|
|
9794
|
+
roleAliases?: RoleAliases | undefined;
|
|
9795
|
+
}[];
|
|
9796
|
+
}[]
|
|
9797
|
+
>,
|
|
9798
|
+
) => string
|
|
9367
9799
|
>,
|
|
9368
9800
|
]
|
|
9369
9801
|
>;
|
|
@@ -9506,6 +9938,17 @@ export declare interface WorkflowEffectsDrainedData extends InstanceScopedEventD
|
|
|
9506
9938
|
drainedEffects: EffectName[];
|
|
9507
9939
|
}
|
|
9508
9940
|
|
|
9941
|
+
export declare const WorkflowEffectStateReported: WorkflowTelemetryEvent<WorkflowEffectStateReportedData>;
|
|
9942
|
+
|
|
9943
|
+
export declare interface WorkflowEffectStateReportedData extends InstanceScopedEventData {
|
|
9944
|
+
/** The reporting effect's author-chosen name — one of the payload policy's
|
|
9945
|
+
* two deliberate customer-string exceptions (module doc). */
|
|
9946
|
+
effect: EffectName;
|
|
9947
|
+
/** Auto-transitions fired during the post-report cascade — a report that
|
|
9948
|
+
* satisfies a transition moves the instance. */
|
|
9949
|
+
cascaded: number;
|
|
9950
|
+
}
|
|
9951
|
+
|
|
9509
9952
|
/**
|
|
9510
9953
|
* Base class of the engine's structured errors. `kind` is the stable
|
|
9511
9954
|
* discriminant — render on it; `name` mirrors the concrete class for logs.
|
|
@@ -9538,6 +9981,9 @@ export declare type WorkflowErrorKind =
|
|
|
9538
9981
|
| "concurrent-fire-action"
|
|
9539
9982
|
| "concurrent-edit-field"
|
|
9540
9983
|
| "concurrent-complete-effect"
|
|
9984
|
+
| "concurrent-commit-effect-ops"
|
|
9985
|
+
| "stale-effect-claim"
|
|
9986
|
+
| "effect-commit-queue-overflow"
|
|
9541
9987
|
| "cascade-limit"
|
|
9542
9988
|
| "field-value-shape"
|
|
9543
9989
|
| "ref-resource-undeclared"
|