@sanity/workflow-engine 0.31.0 → 0.32.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 +130 -0
- package/DATAMODEL.md +79 -1
- package/dist/_chunks-cjs/invariants.cjs +194 -147
- package/dist/_chunks-es/invariants.js +148 -149
- package/dist/define.d.cts +263 -966
- package/dist/define.d.ts +263 -966
- package/dist/index.cjs +1795 -785
- package/dist/index.d.cts +711 -1583
- package/dist/index.d.ts +711 -1583
- package/dist/index.js +1691 -709
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -99,6 +99,8 @@ export declare function aclPathForResource(
|
|
|
99
99
|
* only when cascade-fired (the pin on which identities may execute the
|
|
100
100
|
* trigger); a fireAction-fired action's `roles` folds into `filter` at
|
|
101
101
|
* desugar instead.
|
|
102
|
+
*
|
|
103
|
+
* @interface
|
|
102
104
|
*/
|
|
103
105
|
export declare type Action = ActionFields<Op, string[]> & {
|
|
104
106
|
roles?: string[] | undefined;
|
|
@@ -185,10 +187,15 @@ export declare interface ActionEvaluation {
|
|
|
185
187
|
/** Derived state of a cascade-fired action's `when` trigger — what would
|
|
186
188
|
* fire it. Present iff the action declares `when`. */
|
|
187
189
|
whenInsight?: ConditionInsight;
|
|
190
|
+
/** A canonical `$assigned` filter leg withheld this absent action. The
|
|
191
|
+
* action still follows filter-existence semantics; this metadata lets the
|
|
192
|
+
* owning activity explain who currently holds the work. */
|
|
193
|
+
holderGate?: {
|
|
194
|
+
holders: Assignee[];
|
|
195
|
+
};
|
|
188
196
|
}
|
|
189
197
|
|
|
190
|
-
/**
|
|
191
|
-
* group-membership grammars. */
|
|
198
|
+
/** @inline */
|
|
192
199
|
declare type ActionFields<TOp, TGroup> = {
|
|
193
200
|
name: string;
|
|
194
201
|
semantics?: ActionSemantic[] | undefined;
|
|
@@ -210,6 +217,8 @@ export declare type ActionName = string;
|
|
|
210
217
|
* or queuing effects: a missing required param throws
|
|
211
218
|
* `ActionParamsInvalidError` and the action does not commit. Resolved values
|
|
212
219
|
* feed `ValueExpr.param` lookups.
|
|
220
|
+
*
|
|
221
|
+
* @interface
|
|
213
222
|
*/
|
|
214
223
|
export declare type ActionParam = v.InferOutput<typeof ActionParamSchema>;
|
|
215
224
|
|
|
@@ -390,6 +399,11 @@ export declare function actionVerdict(
|
|
|
390
399
|
action: ActionEvaluation,
|
|
391
400
|
): AvailableAction;
|
|
392
401
|
|
|
402
|
+
/** The members that own work after direct-user membership shadows every role route. */
|
|
403
|
+
export declare function activeAssignmentMembers(
|
|
404
|
+
members: readonly Assignee[],
|
|
405
|
+
): readonly Assignee[];
|
|
406
|
+
|
|
393
407
|
/**
|
|
394
408
|
* A unit of work carrying no payload of its own — every op, effect, and
|
|
395
409
|
* spawn lives on an action; an activity contributes scoped `fields`
|
|
@@ -403,6 +417,8 @@ export declare function actionVerdict(
|
|
|
403
417
|
* `requirements` are readiness gates orthogonal to `filter` — an unmet one
|
|
404
418
|
* keeps the activity visible but disables its actions with a
|
|
405
419
|
* `requirements-unmet` verdict; distinct from ACL and guards.
|
|
420
|
+
*
|
|
421
|
+
* @interface
|
|
406
422
|
*/
|
|
407
423
|
export declare type Activity = ActivityFields<
|
|
408
424
|
FieldEntry,
|
|
@@ -454,19 +470,6 @@ export declare const ACTIVITY_KINDS: readonly [
|
|
|
454
470
|
"receive",
|
|
455
471
|
];
|
|
456
472
|
|
|
457
|
-
/**
|
|
458
|
-
* An activity is `active` from stage entry (or `skipped` when its `filter`
|
|
459
|
-
* excluded it) until a terminal status resolves it — there is no pre-active
|
|
460
|
-
* state. The authored action `status:` sugar (and the `status.set` op it
|
|
461
|
-
* desugars to) is constrained to {@link TerminalActivityStatus}.
|
|
462
|
-
*/
|
|
463
|
-
declare const ACTIVITY_STATUSES: readonly [
|
|
464
|
-
"active",
|
|
465
|
-
"done",
|
|
466
|
-
"skipped",
|
|
467
|
-
"failed",
|
|
468
|
-
];
|
|
469
|
-
|
|
470
473
|
/** The activity slice of a stage rollup — total by construction, like
|
|
471
474
|
* {@link stageAutonomyOf}. */
|
|
472
475
|
export declare function activityAutonomyOf(
|
|
@@ -564,7 +567,7 @@ export declare interface ActivityEvaluation {
|
|
|
564
567
|
actions: ActionEvaluation[];
|
|
565
568
|
}
|
|
566
569
|
|
|
567
|
-
/**
|
|
570
|
+
/** @inline */
|
|
568
571
|
declare type ActivityFields<TField, TAction, TTarget, TGroup> = {
|
|
569
572
|
name: string;
|
|
570
573
|
semantics?: Semantic[] | undefined;
|
|
@@ -583,7 +586,13 @@ export declare type ActivityKind = (typeof ACTIVITY_KINDS)[number];
|
|
|
583
586
|
|
|
584
587
|
export declare type ActivityName = string;
|
|
585
588
|
|
|
586
|
-
|
|
589
|
+
/**
|
|
590
|
+
* An activity is `active` from stage entry (or `skipped` when its `filter`
|
|
591
|
+
* excluded it) until a terminal status resolves it — there is no pre-active
|
|
592
|
+
* state. The authored action `status:` sugar (and the `status.set` op it
|
|
593
|
+
* desugars to) is constrained to {@link TerminalActivityStatus}.
|
|
594
|
+
*/
|
|
595
|
+
export declare type ActivityStatus = "active" | "done" | "skipped" | "failed";
|
|
587
596
|
|
|
588
597
|
/**
|
|
589
598
|
* Who is acting — advisory provenance, not an authenticated principal. The
|
|
@@ -633,7 +642,7 @@ export declare interface Actor {
|
|
|
633
642
|
*/
|
|
634
643
|
export declare const ACTOR_KINDS: readonly ["person", "agent", "system"];
|
|
635
644
|
|
|
636
|
-
/** Runtime
|
|
645
|
+
/** Runtime role check; like alias expansion, it expands only the required side. */
|
|
637
646
|
export declare function actorFulfillsRole({
|
|
638
647
|
actorRoles,
|
|
639
648
|
required,
|
|
@@ -646,6 +655,13 @@ export declare function actorFulfillsRole({
|
|
|
646
655
|
|
|
647
656
|
export declare type ActorKind = (typeof ACTOR_KINDS)[number];
|
|
648
657
|
|
|
658
|
+
/** Assignment ownership for runtime actors, with authorization aliases applied to role members. */
|
|
659
|
+
export declare function actorMatchesAssignment(args: {
|
|
660
|
+
actor: Actor | undefined;
|
|
661
|
+
members: readonly Assignee[];
|
|
662
|
+
roleAliases?: RoleAliases | undefined;
|
|
663
|
+
}): boolean;
|
|
664
|
+
|
|
649
665
|
export declare type ActorResolution<User> =
|
|
650
666
|
| {
|
|
651
667
|
readonly status: "resolved";
|
|
@@ -720,9 +736,8 @@ export declare function assertReaderModelAcknowledgement(
|
|
|
720
736
|
): asserts expectedMinReaderModel is number;
|
|
721
737
|
|
|
722
738
|
/**
|
|
723
|
-
* One member of an
|
|
724
|
-
*
|
|
725
|
-
* rendered `$assigned` gate match against. A `role` member names a capability
|
|
739
|
+
* One member of an assignment entry's value, matched by the inbox reverse-query
|
|
740
|
+
* and rendered `$assigned` gate. A `role` member names a capability
|
|
726
741
|
* (fulfilled by whoever deploys that role), not a concrete principal — which
|
|
727
742
|
* is what distinguishes it from {@link Actor}. `id` here is a SYSTEM
|
|
728
743
|
* identifier (a principal), not authored identity.
|
|
@@ -737,6 +752,56 @@ export declare type Assignee =
|
|
|
737
752
|
role: string;
|
|
738
753
|
};
|
|
739
754
|
|
|
755
|
+
export declare interface AssignmentIdentity {
|
|
756
|
+
readonly userId: string;
|
|
757
|
+
readonly roles: readonly string[];
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/** @inline */
|
|
761
|
+
declare type AssignmentInstance = Pick<
|
|
762
|
+
WorkflowInstance,
|
|
763
|
+
"currentStage" | "stages"
|
|
764
|
+
>;
|
|
765
|
+
|
|
766
|
+
export declare type AssignmentMatch = "user" | "role" | undefined;
|
|
767
|
+
|
|
768
|
+
/** Whether an identity owns the assignment directly or through a literal project role. */
|
|
769
|
+
export declare function assignmentMatch(
|
|
770
|
+
members: readonly Assignee[],
|
|
771
|
+
identity: AssignmentIdentity,
|
|
772
|
+
): AssignmentMatch;
|
|
773
|
+
|
|
774
|
+
/** Every member stored in assignment entries, preserving field and member order. */
|
|
775
|
+
export declare function assignmentMembers(
|
|
776
|
+
entries: readonly ResolvedFieldEntry[],
|
|
777
|
+
): readonly Assignee[];
|
|
778
|
+
|
|
779
|
+
export declare function assignmentPrefilter(
|
|
780
|
+
assignment: NonNullable<InstancesQueryFilter["assignment"]>,
|
|
781
|
+
params: Record<string, string | string[]>,
|
|
782
|
+
): string;
|
|
783
|
+
|
|
784
|
+
export declare type AssignmentState = "unrouted" | "routed" | "held";
|
|
785
|
+
|
|
786
|
+
/** Classify one assignment slot by whether it has no route, role routes, or a user holder. */
|
|
787
|
+
export declare function assignmentState(
|
|
788
|
+
members: readonly Assignee[],
|
|
789
|
+
): AssignmentState;
|
|
790
|
+
|
|
791
|
+
export declare interface AssignmentStateCounts {
|
|
792
|
+
readonly unrouted: number;
|
|
793
|
+
readonly routed: number;
|
|
794
|
+
readonly held: number;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/** Viewer-scoped assignment counts at assignment-slot grain. Unrouted work is
|
|
798
|
+
* visible to every viewer; routed and held count only work offered to or
|
|
799
|
+
* held by the supplied identity. */
|
|
800
|
+
export declare function assignmentStateCounts(
|
|
801
|
+
assignments: readonly (readonly Assignee[])[],
|
|
802
|
+
identity: AssignmentIdentity,
|
|
803
|
+
): AssignmentStateCounts;
|
|
804
|
+
|
|
740
805
|
export { AtomInsight };
|
|
741
806
|
|
|
742
807
|
export { atomReadsDataset };
|
|
@@ -766,8 +831,7 @@ export declare const AUTHORING_DISPLAY: {
|
|
|
766
831
|
};
|
|
767
832
|
|
|
768
833
|
/**
|
|
769
|
-
* The stored action fields plus
|
|
770
|
-
* {@link ClaimAction} pair-half. `roles`: on a fireAction-fired action (no
|
|
834
|
+
* The stored action fields plus authoring sugar. `roles`: on a fireAction-fired action (no
|
|
771
835
|
* `when`) it desugars into a `count($actor.roles[@ in [...]]) > 0` condition
|
|
772
836
|
* ANDed with `filter`; on a CASCADE-FIRED action it stores VERBATIM instead —
|
|
773
837
|
* the pin on which identities may execute the trigger, since folding it into
|
|
@@ -777,8 +841,9 @@ export declare const AUTHORING_DISPLAY: {
|
|
|
777
841
|
* deliberately never implied, so a forgotten `status` is a visible stall
|
|
778
842
|
* rather than a silently completed action.
|
|
779
843
|
*/
|
|
780
|
-
export declare type AuthoringAction = AuthoringRawAction
|
|
844
|
+
export declare type AuthoringAction = AuthoringRawAction;
|
|
781
845
|
|
|
846
|
+
/** @interface */
|
|
782
847
|
export declare type AuthoringActivity = ActivityFields<
|
|
783
848
|
AuthoringFieldEntry,
|
|
784
849
|
AuthoringAction,
|
|
@@ -792,41 +857,30 @@ export declare type AuthoringActivity = ActivityFields<
|
|
|
792
857
|
* predicate `action.roles` produces. `true` opens the field to anyone in its
|
|
793
858
|
* window; a bare string is a raw predicate.
|
|
794
859
|
*/
|
|
795
|
-
export declare type AuthoringEditable =
|
|
796
|
-
typeof AuthoringEditableSchema
|
|
797
|
-
>;
|
|
798
|
-
|
|
799
|
-
declare const AuthoringEditableSchema: v.UnionSchema<
|
|
800
|
-
[
|
|
801
|
-
v.LiteralSchema<true, undefined>,
|
|
802
|
-
v.ArraySchema<
|
|
803
|
-
v.SchemaWithPipe<
|
|
804
|
-
readonly [
|
|
805
|
-
v.StringSchema<undefined>,
|
|
806
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
807
|
-
]
|
|
808
|
-
>,
|
|
809
|
-
undefined
|
|
810
|
-
>,
|
|
811
|
-
v.SchemaWithPipe<
|
|
812
|
-
readonly [
|
|
813
|
-
v.StringSchema<undefined>,
|
|
814
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
815
|
-
]
|
|
816
|
-
>,
|
|
817
|
-
],
|
|
818
|
-
undefined
|
|
819
|
-
>;
|
|
860
|
+
export declare type AuthoringEditable = true | string[] | string;
|
|
820
861
|
|
|
862
|
+
/**
|
|
863
|
+
* A raw field entry or one of the authoring-only field sugars. `todoList`
|
|
864
|
+
* expands to an array of objects with `label`, `status`, optional `assignee`,
|
|
865
|
+
* and optional `dueDate`; that due date remains an ordinary date field.
|
|
866
|
+
* `notes` expands to an array of audit-shaped objects with `body`, `actor`,
|
|
867
|
+
* and `at` fields. Sugar type names are compiled away and never become stored
|
|
868
|
+
* field kinds.
|
|
869
|
+
*/
|
|
821
870
|
export declare type AuthoringFieldEntry =
|
|
822
871
|
| AuthoringRawFieldEntry
|
|
823
|
-
| ClaimField
|
|
824
872
|
| TodoListField
|
|
825
873
|
| NotesField;
|
|
826
874
|
|
|
827
|
-
/**
|
|
828
|
-
*
|
|
829
|
-
|
|
875
|
+
/**
|
|
876
|
+
* A field reference with `scope` optional; desugar resolves it lexically
|
|
877
|
+
* (activity → stage → workflow) into {@link StoredFieldRef}.
|
|
878
|
+
*
|
|
879
|
+
* @interface
|
|
880
|
+
*/
|
|
881
|
+
export declare type AuthoringFieldRef = v.InferOutput<
|
|
882
|
+
typeof AuthoringFieldRefSchema
|
|
883
|
+
>;
|
|
830
884
|
|
|
831
885
|
declare const AuthoringFieldRefSchema: v.StrictObjectSchema<
|
|
832
886
|
{
|
|
@@ -844,8 +898,12 @@ declare const AuthoringFieldRefSchema: v.StrictObjectSchema<
|
|
|
844
898
|
undefined
|
|
845
899
|
>;
|
|
846
900
|
|
|
847
|
-
/**
|
|
848
|
-
*
|
|
901
|
+
/**
|
|
902
|
+
* {@link Guard}'s contract as authored: `match.idRefs` and `metadata` carry
|
|
903
|
+
* typed {@link GuardRead} values that deploy resolves to bare ones.
|
|
904
|
+
*
|
|
905
|
+
* @interface
|
|
906
|
+
*/
|
|
849
907
|
export declare type AuthoringGuard = v.InferOutput<typeof AuthoringGuardSchema>;
|
|
850
908
|
|
|
851
909
|
declare const AuthoringGuardSchema: v.StrictObjectSchema<
|
|
@@ -873,105 +931,7 @@ declare const AuthoringGuardSchema: v.StrictObjectSchema<
|
|
|
873
931
|
undefined
|
|
874
932
|
>;
|
|
875
933
|
idRefs: v.OptionalSchema<
|
|
876
|
-
v.ArraySchema<
|
|
877
|
-
v.VariantSchema<
|
|
878
|
-
"type",
|
|
879
|
-
[
|
|
880
|
-
v.StrictObjectSchema<
|
|
881
|
-
{
|
|
882
|
-
readonly type: v.LiteralSchema<"self", undefined>;
|
|
883
|
-
},
|
|
884
|
-
undefined
|
|
885
|
-
>,
|
|
886
|
-
v.StrictObjectSchema<
|
|
887
|
-
{
|
|
888
|
-
readonly type: v.LiteralSchema<"now", undefined>;
|
|
889
|
-
},
|
|
890
|
-
undefined
|
|
891
|
-
>,
|
|
892
|
-
v.StrictObjectSchema<
|
|
893
|
-
{
|
|
894
|
-
readonly type: v.LiteralSchema<"fieldRead", undefined>;
|
|
895
|
-
readonly field: v.SchemaWithPipe<
|
|
896
|
-
readonly [
|
|
897
|
-
v.StringSchema<undefined>,
|
|
898
|
-
v.RegexAction<string, string>,
|
|
899
|
-
]
|
|
900
|
-
>;
|
|
901
|
-
readonly path: v.OptionalSchema<
|
|
902
|
-
v.SchemaWithPipe<
|
|
903
|
-
readonly [
|
|
904
|
-
v.SchemaWithPipe<
|
|
905
|
-
readonly [
|
|
906
|
-
v.StringSchema<undefined>,
|
|
907
|
-
v.MinLengthAction<
|
|
908
|
-
string,
|
|
909
|
-
1,
|
|
910
|
-
"must be a non-empty string"
|
|
911
|
-
>,
|
|
912
|
-
]
|
|
913
|
-
>,
|
|
914
|
-
v.CheckAction<
|
|
915
|
-
string,
|
|
916
|
-
"a guard read path cannot contain a line break"
|
|
917
|
-
>,
|
|
918
|
-
]
|
|
919
|
-
>,
|
|
920
|
-
undefined
|
|
921
|
-
>;
|
|
922
|
-
},
|
|
923
|
-
undefined
|
|
924
|
-
>,
|
|
925
|
-
v.StrictObjectSchema<
|
|
926
|
-
{
|
|
927
|
-
readonly type: v.LiteralSchema<"effectsRead", undefined>;
|
|
928
|
-
readonly effect: v.SchemaWithPipe<
|
|
929
|
-
readonly [
|
|
930
|
-
v.SchemaWithPipe<
|
|
931
|
-
readonly [
|
|
932
|
-
v.StringSchema<undefined>,
|
|
933
|
-
v.MinLengthAction<
|
|
934
|
-
string,
|
|
935
|
-
1,
|
|
936
|
-
"must be a non-empty string"
|
|
937
|
-
>,
|
|
938
|
-
]
|
|
939
|
-
>,
|
|
940
|
-
v.CheckAction<
|
|
941
|
-
string,
|
|
942
|
-
"an effect name cannot contain `'`"
|
|
943
|
-
>,
|
|
944
|
-
]
|
|
945
|
-
>;
|
|
946
|
-
readonly path: v.OptionalSchema<
|
|
947
|
-
v.SchemaWithPipe<
|
|
948
|
-
readonly [
|
|
949
|
-
v.SchemaWithPipe<
|
|
950
|
-
readonly [
|
|
951
|
-
v.StringSchema<undefined>,
|
|
952
|
-
v.MinLengthAction<
|
|
953
|
-
string,
|
|
954
|
-
1,
|
|
955
|
-
"must be a non-empty string"
|
|
956
|
-
>,
|
|
957
|
-
]
|
|
958
|
-
>,
|
|
959
|
-
v.CheckAction<
|
|
960
|
-
string,
|
|
961
|
-
"a guard read path cannot contain a line break"
|
|
962
|
-
>,
|
|
963
|
-
]
|
|
964
|
-
>,
|
|
965
|
-
undefined
|
|
966
|
-
>;
|
|
967
|
-
},
|
|
968
|
-
undefined
|
|
969
|
-
>,
|
|
970
|
-
],
|
|
971
|
-
undefined
|
|
972
|
-
>,
|
|
973
|
-
undefined
|
|
974
|
-
>,
|
|
934
|
+
v.ArraySchema<v.GenericSchema<GuardRead>, undefined>,
|
|
975
935
|
undefined
|
|
976
936
|
>;
|
|
977
937
|
idPatterns: v.OptionalSchema<
|
|
@@ -998,492 +958,79 @@ declare const AuthoringGuardSchema: v.StrictObjectSchema<
|
|
|
998
958
|
v.MinLengthAction<
|
|
999
959
|
("create" | "update" | "delete" | "publish" | "unpublish")[],
|
|
1000
960
|
1,
|
|
1001
|
-
"a guard must match at least one action"
|
|
1002
|
-
>,
|
|
1003
|
-
]
|
|
1004
|
-
>;
|
|
1005
|
-
},
|
|
1006
|
-
undefined
|
|
1007
|
-
>;
|
|
1008
|
-
predicate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1009
|
-
metadata: v.OptionalSchema<
|
|
1010
|
-
v.RecordSchema<
|
|
1011
|
-
v.SchemaWithPipe<
|
|
1012
|
-
readonly [
|
|
1013
|
-
v.StringSchema<undefined>,
|
|
1014
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1015
|
-
]
|
|
1016
|
-
>,
|
|
1017
|
-
v.VariantSchema<
|
|
1018
|
-
"type",
|
|
1019
|
-
[
|
|
1020
|
-
v.StrictObjectSchema<
|
|
1021
|
-
{
|
|
1022
|
-
readonly type: v.LiteralSchema<"self", undefined>;
|
|
1023
|
-
},
|
|
1024
|
-
undefined
|
|
1025
|
-
>,
|
|
1026
|
-
v.StrictObjectSchema<
|
|
1027
|
-
{
|
|
1028
|
-
readonly type: v.LiteralSchema<"now", undefined>;
|
|
1029
|
-
},
|
|
1030
|
-
undefined
|
|
1031
|
-
>,
|
|
1032
|
-
v.StrictObjectSchema<
|
|
1033
|
-
{
|
|
1034
|
-
readonly type: v.LiteralSchema<"fieldRead", undefined>;
|
|
1035
|
-
readonly field: v.SchemaWithPipe<
|
|
1036
|
-
readonly [
|
|
1037
|
-
v.StringSchema<undefined>,
|
|
1038
|
-
v.RegexAction<string, string>,
|
|
1039
|
-
]
|
|
1040
|
-
>;
|
|
1041
|
-
readonly path: v.OptionalSchema<
|
|
1042
|
-
v.SchemaWithPipe<
|
|
1043
|
-
readonly [
|
|
1044
|
-
v.SchemaWithPipe<
|
|
1045
|
-
readonly [
|
|
1046
|
-
v.StringSchema<undefined>,
|
|
1047
|
-
v.MinLengthAction<
|
|
1048
|
-
string,
|
|
1049
|
-
1,
|
|
1050
|
-
"must be a non-empty string"
|
|
1051
|
-
>,
|
|
1052
|
-
]
|
|
1053
|
-
>,
|
|
1054
|
-
v.CheckAction<
|
|
1055
|
-
string,
|
|
1056
|
-
"a guard read path cannot contain a line break"
|
|
1057
|
-
>,
|
|
1058
|
-
]
|
|
1059
|
-
>,
|
|
1060
|
-
undefined
|
|
1061
|
-
>;
|
|
1062
|
-
},
|
|
1063
|
-
undefined
|
|
1064
|
-
>,
|
|
1065
|
-
v.StrictObjectSchema<
|
|
1066
|
-
{
|
|
1067
|
-
readonly type: v.LiteralSchema<"effectsRead", undefined>;
|
|
1068
|
-
readonly effect: v.SchemaWithPipe<
|
|
1069
|
-
readonly [
|
|
1070
|
-
v.SchemaWithPipe<
|
|
1071
|
-
readonly [
|
|
1072
|
-
v.StringSchema<undefined>,
|
|
1073
|
-
v.MinLengthAction<
|
|
1074
|
-
string,
|
|
1075
|
-
1,
|
|
1076
|
-
"must be a non-empty string"
|
|
1077
|
-
>,
|
|
1078
|
-
]
|
|
1079
|
-
>,
|
|
1080
|
-
v.CheckAction<string, "an effect name cannot contain `'`">,
|
|
1081
|
-
]
|
|
1082
|
-
>;
|
|
1083
|
-
readonly path: v.OptionalSchema<
|
|
1084
|
-
v.SchemaWithPipe<
|
|
1085
|
-
readonly [
|
|
1086
|
-
v.SchemaWithPipe<
|
|
1087
|
-
readonly [
|
|
1088
|
-
v.StringSchema<undefined>,
|
|
1089
|
-
v.MinLengthAction<
|
|
1090
|
-
string,
|
|
1091
|
-
1,
|
|
1092
|
-
"must be a non-empty string"
|
|
1093
|
-
>,
|
|
1094
|
-
]
|
|
1095
|
-
>,
|
|
1096
|
-
v.CheckAction<
|
|
1097
|
-
string,
|
|
1098
|
-
"a guard read path cannot contain a line break"
|
|
1099
|
-
>,
|
|
1100
|
-
]
|
|
1101
|
-
>,
|
|
1102
|
-
undefined
|
|
1103
|
-
>;
|
|
1104
|
-
},
|
|
1105
|
-
undefined
|
|
1106
|
-
>,
|
|
1107
|
-
],
|
|
1108
|
-
undefined
|
|
1109
|
-
>,
|
|
1110
|
-
undefined
|
|
1111
|
-
>,
|
|
1112
|
-
undefined
|
|
1113
|
-
>;
|
|
1114
|
-
},
|
|
1115
|
-
undefined
|
|
1116
|
-
>;
|
|
1117
|
-
|
|
1118
|
-
/** Like {@link ManualTarget}, but the `field` variant also accepts a bare
|
|
1119
|
-
* field name; desugar normalises it into {@link AuthoringFieldRef}. */
|
|
1120
|
-
export declare type AuthoringManualTarget = v.InferOutput<
|
|
1121
|
-
typeof AuthoringManualTargetSchema
|
|
1122
|
-
>;
|
|
1123
|
-
|
|
1124
|
-
declare const AuthoringManualTargetSchema: v.VariantSchema<
|
|
1125
|
-
"type",
|
|
1126
|
-
[
|
|
1127
|
-
v.StrictObjectSchema<
|
|
1128
|
-
{
|
|
1129
|
-
readonly type: v.LiteralSchema<"url", undefined>;
|
|
1130
|
-
readonly url: v.SchemaWithPipe<
|
|
1131
|
-
readonly [
|
|
1132
|
-
v.StringSchema<undefined>,
|
|
1133
|
-
v.UrlAction<string, "must be a valid URL">,
|
|
1134
|
-
v.CheckAction<string, "must be an http(s) URL">,
|
|
1135
|
-
]
|
|
1136
|
-
>;
|
|
1137
|
-
},
|
|
1138
|
-
undefined
|
|
1139
|
-
>,
|
|
1140
|
-
v.StrictObjectSchema<
|
|
1141
|
-
{
|
|
1142
|
-
readonly type: v.LiteralSchema<"field", undefined>;
|
|
1143
|
-
readonly field: v.UnionSchema<
|
|
1144
|
-
[
|
|
1145
|
-
v.SchemaWithPipe<
|
|
1146
|
-
readonly [
|
|
1147
|
-
v.StringSchema<undefined>,
|
|
1148
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1149
|
-
]
|
|
1150
|
-
>,
|
|
1151
|
-
v.StrictObjectSchema<
|
|
1152
|
-
{
|
|
1153
|
-
readonly scope: v.OptionalSchema<
|
|
1154
|
-
v.PicklistSchema<
|
|
1155
|
-
readonly ["workflow", "stage", "activity"],
|
|
1156
|
-
string
|
|
1157
|
-
>,
|
|
1158
|
-
undefined
|
|
1159
|
-
>;
|
|
1160
|
-
readonly field: v.SchemaWithPipe<
|
|
1161
|
-
readonly [
|
|
1162
|
-
v.StringSchema<undefined>,
|
|
1163
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1164
|
-
]
|
|
1165
|
-
>;
|
|
1166
|
-
},
|
|
1167
|
-
undefined
|
|
1168
|
-
>,
|
|
1169
|
-
],
|
|
1170
|
-
undefined
|
|
1171
|
-
>;
|
|
1172
|
-
},
|
|
1173
|
-
undefined
|
|
1174
|
-
>,
|
|
1175
|
-
],
|
|
1176
|
-
undefined
|
|
1177
|
-
>;
|
|
1178
|
-
|
|
1179
|
-
/** Like {@link Op}, plus: `status.set`'s `activity` is optional (desugar fills
|
|
1180
|
-
* the firing activity), and the `audit` sugar — a stamped append merging
|
|
1181
|
-
* `actor`/`at` {@link ValueExpr} fields into its own value. */
|
|
1182
|
-
export declare type AuthoringOp = v.InferOutput<typeof AuthoringOpSchema>;
|
|
1183
|
-
|
|
1184
|
-
declare const AuthoringOpSchema: v.VariantSchema<
|
|
1185
|
-
"type",
|
|
1186
|
-
[
|
|
1187
|
-
v.StrictObjectSchema<
|
|
1188
|
-
{
|
|
1189
|
-
readonly type: v.LiteralSchema<"field.set", undefined>;
|
|
1190
|
-
readonly target: v.StrictObjectSchema<
|
|
1191
|
-
{
|
|
1192
|
-
readonly scope: v.OptionalSchema<
|
|
1193
|
-
v.PicklistSchema<
|
|
1194
|
-
readonly ["workflow", "stage", "activity"],
|
|
1195
|
-
string
|
|
1196
|
-
>,
|
|
1197
|
-
undefined
|
|
1198
|
-
>;
|
|
1199
|
-
readonly field: v.SchemaWithPipe<
|
|
1200
|
-
readonly [
|
|
1201
|
-
v.StringSchema<undefined>,
|
|
1202
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1203
|
-
]
|
|
1204
|
-
>;
|
|
1205
|
-
},
|
|
1206
|
-
undefined
|
|
1207
|
-
>;
|
|
1208
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
1209
|
-
},
|
|
1210
|
-
undefined
|
|
1211
|
-
>,
|
|
1212
|
-
v.StrictObjectSchema<
|
|
1213
|
-
{
|
|
1214
|
-
readonly type: v.LiteralSchema<"field.setIfMissing", undefined>;
|
|
1215
|
-
readonly target: v.StrictObjectSchema<
|
|
1216
|
-
{
|
|
1217
|
-
readonly scope: v.OptionalSchema<
|
|
1218
|
-
v.PicklistSchema<
|
|
1219
|
-
readonly ["workflow", "stage", "activity"],
|
|
1220
|
-
string
|
|
1221
|
-
>,
|
|
1222
|
-
undefined
|
|
1223
|
-
>;
|
|
1224
|
-
readonly field: v.SchemaWithPipe<
|
|
1225
|
-
readonly [
|
|
1226
|
-
v.StringSchema<undefined>,
|
|
1227
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1228
|
-
]
|
|
1229
|
-
>;
|
|
1230
|
-
},
|
|
1231
|
-
undefined
|
|
1232
|
-
>;
|
|
1233
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
1234
|
-
},
|
|
1235
|
-
undefined
|
|
1236
|
-
>,
|
|
1237
|
-
v.StrictObjectSchema<
|
|
1238
|
-
{
|
|
1239
|
-
readonly type: v.LiteralSchema<"field.unset", undefined>;
|
|
1240
|
-
readonly target: v.StrictObjectSchema<
|
|
1241
|
-
{
|
|
1242
|
-
readonly scope: v.OptionalSchema<
|
|
1243
|
-
v.PicklistSchema<
|
|
1244
|
-
readonly ["workflow", "stage", "activity"],
|
|
1245
|
-
string
|
|
1246
|
-
>,
|
|
1247
|
-
undefined
|
|
1248
|
-
>;
|
|
1249
|
-
readonly field: v.SchemaWithPipe<
|
|
1250
|
-
readonly [
|
|
1251
|
-
v.StringSchema<undefined>,
|
|
1252
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1253
|
-
]
|
|
1254
|
-
>;
|
|
1255
|
-
},
|
|
1256
|
-
undefined
|
|
1257
|
-
>;
|
|
1258
|
-
},
|
|
1259
|
-
undefined
|
|
1260
|
-
>,
|
|
1261
|
-
v.StrictObjectSchema<
|
|
1262
|
-
{
|
|
1263
|
-
readonly type: v.LiteralSchema<"field.append", undefined>;
|
|
1264
|
-
readonly target: v.StrictObjectSchema<
|
|
1265
|
-
{
|
|
1266
|
-
readonly scope: v.OptionalSchema<
|
|
1267
|
-
v.PicklistSchema<
|
|
1268
|
-
readonly ["workflow", "stage", "activity"],
|
|
1269
|
-
string
|
|
1270
|
-
>,
|
|
1271
|
-
undefined
|
|
1272
|
-
>;
|
|
1273
|
-
readonly field: v.SchemaWithPipe<
|
|
1274
|
-
readonly [
|
|
1275
|
-
v.StringSchema<undefined>,
|
|
1276
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1277
|
-
]
|
|
1278
|
-
>;
|
|
1279
|
-
},
|
|
1280
|
-
undefined
|
|
1281
|
-
>;
|
|
1282
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
1283
|
-
},
|
|
1284
|
-
undefined
|
|
1285
|
-
>,
|
|
1286
|
-
v.StrictObjectSchema<
|
|
1287
|
-
{
|
|
1288
|
-
readonly type: v.LiteralSchema<"field.inc", undefined>;
|
|
1289
|
-
readonly target: v.StrictObjectSchema<
|
|
1290
|
-
{
|
|
1291
|
-
readonly scope: v.OptionalSchema<
|
|
1292
|
-
v.PicklistSchema<
|
|
1293
|
-
readonly ["workflow", "stage", "activity"],
|
|
1294
|
-
string
|
|
1295
|
-
>,
|
|
1296
|
-
undefined
|
|
1297
|
-
>;
|
|
1298
|
-
readonly field: v.SchemaWithPipe<
|
|
1299
|
-
readonly [
|
|
1300
|
-
v.StringSchema<undefined>,
|
|
1301
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1302
|
-
]
|
|
1303
|
-
>;
|
|
1304
|
-
},
|
|
1305
|
-
undefined
|
|
1306
|
-
>;
|
|
1307
|
-
readonly value: v.OptionalSchema<
|
|
1308
|
-
v.GenericSchema<ValueExprInternal>,
|
|
1309
|
-
undefined
|
|
1310
|
-
>;
|
|
1311
|
-
},
|
|
1312
|
-
undefined
|
|
1313
|
-
>,
|
|
1314
|
-
v.StrictObjectSchema<
|
|
1315
|
-
{
|
|
1316
|
-
readonly type: v.LiteralSchema<"field.dec", undefined>;
|
|
1317
|
-
readonly target: v.StrictObjectSchema<
|
|
1318
|
-
{
|
|
1319
|
-
readonly scope: v.OptionalSchema<
|
|
1320
|
-
v.PicklistSchema<
|
|
1321
|
-
readonly ["workflow", "stage", "activity"],
|
|
1322
|
-
string
|
|
1323
|
-
>,
|
|
1324
|
-
undefined
|
|
1325
|
-
>;
|
|
1326
|
-
readonly field: v.SchemaWithPipe<
|
|
1327
|
-
readonly [
|
|
1328
|
-
v.StringSchema<undefined>,
|
|
1329
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1330
|
-
]
|
|
1331
|
-
>;
|
|
1332
|
-
},
|
|
1333
|
-
undefined
|
|
1334
|
-
>;
|
|
1335
|
-
readonly value: v.OptionalSchema<
|
|
1336
|
-
v.GenericSchema<ValueExprInternal>,
|
|
1337
|
-
undefined
|
|
1338
|
-
>;
|
|
1339
|
-
},
|
|
1340
|
-
undefined
|
|
1341
|
-
>,
|
|
1342
|
-
v.StrictObjectSchema<
|
|
1343
|
-
{
|
|
1344
|
-
readonly type: v.LiteralSchema<"field.updateWhere", undefined>;
|
|
1345
|
-
readonly target: v.StrictObjectSchema<
|
|
1346
|
-
{
|
|
1347
|
-
readonly scope: v.OptionalSchema<
|
|
1348
|
-
v.PicklistSchema<
|
|
1349
|
-
readonly ["workflow", "stage", "activity"],
|
|
1350
|
-
string
|
|
1351
|
-
>,
|
|
1352
|
-
undefined
|
|
1353
|
-
>;
|
|
1354
|
-
readonly field: v.SchemaWithPipe<
|
|
1355
|
-
readonly [
|
|
1356
|
-
v.StringSchema<undefined>,
|
|
1357
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1358
|
-
]
|
|
1359
|
-
>;
|
|
1360
|
-
},
|
|
1361
|
-
undefined
|
|
1362
|
-
>;
|
|
1363
|
-
readonly where: v.SchemaWithPipe<
|
|
1364
|
-
readonly [
|
|
1365
|
-
v.StringSchema<undefined>,
|
|
1366
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1367
|
-
]
|
|
1368
|
-
>;
|
|
1369
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
1370
|
-
},
|
|
1371
|
-
undefined
|
|
1372
|
-
>,
|
|
1373
|
-
v.StrictObjectSchema<
|
|
1374
|
-
{
|
|
1375
|
-
readonly type: v.LiteralSchema<"field.removeWhere", undefined>;
|
|
1376
|
-
readonly target: v.StrictObjectSchema<
|
|
1377
|
-
{
|
|
1378
|
-
readonly scope: v.OptionalSchema<
|
|
1379
|
-
v.PicklistSchema<
|
|
1380
|
-
readonly ["workflow", "stage", "activity"],
|
|
1381
|
-
string
|
|
1382
|
-
>,
|
|
1383
|
-
undefined
|
|
1384
|
-
>;
|
|
1385
|
-
readonly field: v.SchemaWithPipe<
|
|
1386
|
-
readonly [
|
|
1387
|
-
v.StringSchema<undefined>,
|
|
1388
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1389
|
-
]
|
|
1390
|
-
>;
|
|
1391
|
-
},
|
|
1392
|
-
undefined
|
|
1393
|
-
>;
|
|
1394
|
-
readonly where: v.SchemaWithPipe<
|
|
1395
|
-
readonly [
|
|
1396
|
-
v.StringSchema<undefined>,
|
|
1397
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1398
|
-
]
|
|
1399
|
-
>;
|
|
1400
|
-
},
|
|
1401
|
-
undefined
|
|
1402
|
-
>,
|
|
1403
|
-
v.StrictObjectSchema<
|
|
1404
|
-
{
|
|
1405
|
-
readonly type: v.LiteralSchema<"status.set", undefined>;
|
|
1406
|
-
readonly activity: v.OptionalSchema<
|
|
1407
|
-
v.SchemaWithPipe<
|
|
1408
|
-
readonly [
|
|
1409
|
-
v.StringSchema<undefined>,
|
|
1410
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1411
|
-
]
|
|
1412
|
-
>,
|
|
1413
|
-
undefined
|
|
1414
|
-
>;
|
|
1415
|
-
readonly status: v.PicklistSchema<
|
|
1416
|
-
readonly ["active", "done", "skipped", "failed"],
|
|
1417
|
-
string
|
|
1418
|
-
>;
|
|
1419
|
-
},
|
|
1420
|
-
undefined
|
|
1421
|
-
>,
|
|
1422
|
-
v.StrictObjectSchema<
|
|
1423
|
-
{
|
|
1424
|
-
readonly type: v.LiteralSchema<"audit", undefined>;
|
|
1425
|
-
readonly target: v.StrictObjectSchema<
|
|
1426
|
-
{
|
|
1427
|
-
readonly scope: v.OptionalSchema<
|
|
1428
|
-
v.PicklistSchema<
|
|
1429
|
-
readonly ["workflow", "stage", "activity"],
|
|
1430
|
-
string
|
|
1431
|
-
>,
|
|
1432
|
-
undefined
|
|
1433
|
-
>;
|
|
1434
|
-
readonly field: v.SchemaWithPipe<
|
|
1435
|
-
readonly [
|
|
1436
|
-
v.StringSchema<undefined>,
|
|
1437
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1438
|
-
]
|
|
1439
|
-
>;
|
|
1440
|
-
},
|
|
1441
|
-
undefined
|
|
1442
|
-
>;
|
|
1443
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
1444
|
-
readonly stampFields: v.OptionalSchema<
|
|
1445
|
-
v.StrictObjectSchema<
|
|
1446
|
-
{
|
|
1447
|
-
readonly actor: v.OptionalSchema<
|
|
1448
|
-
v.SchemaWithPipe<
|
|
1449
|
-
readonly [
|
|
1450
|
-
v.StringSchema<undefined>,
|
|
1451
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1452
|
-
]
|
|
1453
|
-
>,
|
|
1454
|
-
undefined
|
|
1455
|
-
>;
|
|
1456
|
-
readonly at: v.OptionalSchema<
|
|
1457
|
-
v.SchemaWithPipe<
|
|
1458
|
-
readonly [
|
|
1459
|
-
v.StringSchema<undefined>,
|
|
1460
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
1461
|
-
]
|
|
1462
|
-
>,
|
|
1463
|
-
undefined
|
|
1464
|
-
>;
|
|
1465
|
-
},
|
|
1466
|
-
undefined
|
|
1467
|
-
>,
|
|
1468
|
-
undefined
|
|
961
|
+
"a guard must match at least one action"
|
|
962
|
+
>,
|
|
963
|
+
]
|
|
1469
964
|
>;
|
|
1470
965
|
},
|
|
1471
966
|
undefined
|
|
1472
|
-
|
|
1473
|
-
|
|
967
|
+
>;
|
|
968
|
+
predicate: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
969
|
+
metadata: v.OptionalSchema<
|
|
970
|
+
v.RecordSchema<
|
|
971
|
+
v.SchemaWithPipe<
|
|
972
|
+
readonly [
|
|
973
|
+
v.StringSchema<undefined>,
|
|
974
|
+
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
975
|
+
]
|
|
976
|
+
>,
|
|
977
|
+
v.GenericSchema<GuardRead>,
|
|
978
|
+
undefined
|
|
979
|
+
>,
|
|
980
|
+
undefined
|
|
981
|
+
>;
|
|
982
|
+
},
|
|
1474
983
|
undefined
|
|
1475
984
|
>;
|
|
1476
985
|
|
|
986
|
+
/** Like {@link ManualTarget}, but the `field` variant also accepts a bare
|
|
987
|
+
* field name; desugar normalises it into {@link AuthoringFieldRef}. */
|
|
988
|
+
export declare type AuthoringManualTarget =
|
|
989
|
+
| {
|
|
990
|
+
type: "url";
|
|
991
|
+
url: string;
|
|
992
|
+
}
|
|
993
|
+
| {
|
|
994
|
+
type: "field";
|
|
995
|
+
field: string | AuthoringFieldRef;
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
/** Like {@link Op}, plus: `status.set`'s `activity` is optional (desugar fills
|
|
999
|
+
* the firing activity), and the `audit` sugar — a stamped append merging
|
|
1000
|
+
* `actor`/`at` {@link ValueExpr} fields into its own value.
|
|
1001
|
+
*/
|
|
1002
|
+
export declare type AuthoringOp =
|
|
1003
|
+
| FieldMutationOp<AuthoringFieldRef>
|
|
1004
|
+
| {
|
|
1005
|
+
type: "status.set";
|
|
1006
|
+
activity?: string | undefined;
|
|
1007
|
+
status: ActivityStatus;
|
|
1008
|
+
}
|
|
1009
|
+
| {
|
|
1010
|
+
type: "audit";
|
|
1011
|
+
target: AuthoringFieldRef;
|
|
1012
|
+
value: ValueExpr;
|
|
1013
|
+
stampFields?:
|
|
1014
|
+
| {
|
|
1015
|
+
actor?: string | undefined;
|
|
1016
|
+
at?: string | undefined;
|
|
1017
|
+
}
|
|
1018
|
+
| undefined;
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
/** @inline */
|
|
1477
1022
|
declare type AuthoringRawAction = ActionFields<AuthoringOp, GroupMembership> & {
|
|
1478
1023
|
roles?: string[] | undefined;
|
|
1479
1024
|
status?: TerminalActivityStatus | undefined;
|
|
1480
1025
|
};
|
|
1481
1026
|
|
|
1027
|
+
/** @inline */
|
|
1482
1028
|
declare type AuthoringRawFieldEntry = FieldEntryFields<
|
|
1483
1029
|
AuthoringEditable,
|
|
1484
1030
|
GroupMembership
|
|
1485
1031
|
>;
|
|
1486
1032
|
|
|
1033
|
+
/** @interface */
|
|
1487
1034
|
export declare type AuthoringStage = StageFields<
|
|
1488
1035
|
AuthoringFieldEntry,
|
|
1489
1036
|
AuthoringActivity,
|
|
@@ -1505,7 +1052,11 @@ export declare type AuthoringTransition = TransitionFields & {
|
|
|
1505
1052
|
when?: string | undefined;
|
|
1506
1053
|
};
|
|
1507
1054
|
|
|
1508
|
-
/**
|
|
1055
|
+
/**
|
|
1056
|
+
* The authoring surface: stored primitives plus the define-time sugar.
|
|
1057
|
+
*
|
|
1058
|
+
* @interface
|
|
1059
|
+
*/
|
|
1509
1060
|
export declare type AuthoringWorkflow = WorkflowFields<
|
|
1510
1061
|
AuthoringFieldEntry,
|
|
1511
1062
|
AuthoringStage,
|
|
@@ -1679,31 +1230,6 @@ export declare interface ChoiceOptions {
|
|
|
1679
1230
|
|
|
1680
1231
|
export declare type ChoiceValue = string | number;
|
|
1681
1232
|
|
|
1682
|
-
/** The action half of the mirrored claim pair: `field` names the actor-valued entry this action claims, resolved lexically, and the expansion
|
|
1683
|
-
* adds a no-steal `!defined($fields.<field>)` filter ANDed with `roles`/`filter` plus a `field.set` ← actor op. `ops`/`status` are reserved (strictObject rejects them). */
|
|
1684
|
-
declare type ClaimAction = {
|
|
1685
|
-
type: "claim";
|
|
1686
|
-
name: string;
|
|
1687
|
-
title?: string | undefined;
|
|
1688
|
-
description?: string | undefined;
|
|
1689
|
-
group?: GroupMembership | undefined;
|
|
1690
|
-
field: string | AuthoringFieldRef;
|
|
1691
|
-
roles?: string[] | undefined;
|
|
1692
|
-
filter?: string | undefined;
|
|
1693
|
-
params?: ActionParam[] | undefined;
|
|
1694
|
-
effects?: Effect[] | undefined;
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
/** The field half of the mirrored claim pair, expanding strictly within this entry: an `actor`
|
|
1698
|
-
* working-memory field with no `initialValue` — the paired {@link ClaimAction}'s op fills it. */
|
|
1699
|
-
declare type ClaimField = {
|
|
1700
|
-
type: "claim";
|
|
1701
|
-
name: string;
|
|
1702
|
-
title?: string | undefined;
|
|
1703
|
-
description?: string | undefined;
|
|
1704
|
-
group?: GroupMembership | undefined;
|
|
1705
|
-
};
|
|
1706
|
-
|
|
1707
1233
|
export declare interface ClassifiedPrincipal {
|
|
1708
1234
|
namespace: PrincipalNamespace;
|
|
1709
1235
|
/**
|
|
@@ -1744,9 +1270,14 @@ export declare function clientConfigFromResource(res: WorkflowResource):
|
|
|
1744
1270
|
resource: WorkflowResource;
|
|
1745
1271
|
};
|
|
1746
1272
|
|
|
1747
|
-
/** The
|
|
1273
|
+
/** The total GDR router — every parsed GDR
|
|
1748
1274
|
* resolves to a client, or the router throws. */
|
|
1749
|
-
declare type ClientForGdr = (parsed: ParsedGdr) => WorkflowClient;
|
|
1275
|
+
export declare type ClientForGdr = (parsed: ParsedGdr) => WorkflowClient;
|
|
1276
|
+
|
|
1277
|
+
/** Stored-resource dereferencing for write pre-flights and host previews. */
|
|
1278
|
+
export declare function clientGuardDereference(
|
|
1279
|
+
client: Pick<WorkflowClient, "getDocument">,
|
|
1280
|
+
): GuardDereference;
|
|
1750
1281
|
|
|
1751
1282
|
/** Native project-user response returned by Sanity's project API. */
|
|
1752
1283
|
export declare interface ClientProjectUser {
|
|
@@ -1792,7 +1323,7 @@ export declare function clientProjectUserDirectory(
|
|
|
1792
1323
|
* `createEngine({ clock })`, and tests use `@sanity/workflow-engine-test`'s
|
|
1793
1324
|
* `setNow` / `advance` (the bench wraps the same seam). It is deliberately
|
|
1794
1325
|
* NOT a field on the public per-verb `*Args` — the raw `workflow.*` verbs
|
|
1795
|
-
* accept it only through the
|
|
1326
|
+
* accept it only through the {@link Clocked} composition seam, so prod code
|
|
1796
1327
|
* can't trivially override engine time by accident.
|
|
1797
1328
|
*
|
|
1798
1329
|
* `drainEffects` and `sweepStaleClaims` read the same engine clock for
|
|
@@ -1802,19 +1333,18 @@ export declare function clientProjectUserDirectory(
|
|
|
1802
1333
|
export declare type Clock = () => string;
|
|
1803
1334
|
|
|
1804
1335
|
/**
|
|
1805
|
-
*
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
1808
|
-
* `createEngine({ clock })`, and the test bench
|
|
1809
|
-
* `advance`.
|
|
1810
|
-
*
|
|
1811
|
-
* `*Args` interface as if it were an everyday option.
|
|
1336
|
+
* Optional clock-injection field on the raw `workflow.*` verbs. It is
|
|
1337
|
+
* exported because those verbs expose this composition helper in their
|
|
1338
|
+
* public signatures, but production normally injects a clock once via
|
|
1339
|
+
* `createEngine({ clock })`, and the test bench controls it through
|
|
1340
|
+
* `setNow` / `advance`. The documented `*Args` interfaces omit `clock`
|
|
1341
|
+
* because it is infrastructure context, not an everyday per-call option.
|
|
1812
1342
|
*/
|
|
1813
|
-
declare type Clocked<T> = T & {
|
|
1343
|
+
export declare type Clocked<T> = T & {
|
|
1814
1344
|
clock?: Clock;
|
|
1815
1345
|
};
|
|
1816
1346
|
|
|
1817
|
-
declare interface CommitEffectOpsArgs extends DedupableOperationArgs {
|
|
1347
|
+
export declare interface CommitEffectOpsArgs extends DedupableOperationArgs {
|
|
1818
1348
|
/** The `_key` of the pending effect being reported on. */
|
|
1819
1349
|
effectKey: string;
|
|
1820
1350
|
/**
|
|
@@ -1841,7 +1371,7 @@ declare interface CommitEffectOpsArgs extends DedupableOperationArgs {
|
|
|
1841
1371
|
*/
|
|
1842
1372
|
ops: FieldOp[];
|
|
1843
1373
|
/** Lease duration the successful commit renews the claim to — the
|
|
1844
|
-
* drain's `
|
|
1374
|
+
* drain's `effects.leaseMs`. Default `DEFAULT_EFFECT_LEASE_MS` (5 min). */
|
|
1845
1375
|
leaseMs?: number;
|
|
1846
1376
|
}
|
|
1847
1377
|
|
|
@@ -1862,10 +1392,19 @@ export declare interface CompiledQuery {
|
|
|
1862
1392
|
params: Record<string, string | string[]>;
|
|
1863
1393
|
}
|
|
1864
1394
|
|
|
1865
|
-
/**
|
|
1866
|
-
|
|
1395
|
+
/**
|
|
1396
|
+
* Translate one authored guard into the temporary documents that preview its
|
|
1397
|
+
* eventual Content Lake enforcement.
|
|
1398
|
+
* Content edits target draft ids, instance updates keep the instance id, and
|
|
1399
|
+
* publish or unpublish targets published ids using the Lake operations those
|
|
1400
|
+
* lifecycle writes perform. A mixed guard emits one document per id space so
|
|
1401
|
+
* its action and id facets never form an unintended cross-product.
|
|
1402
|
+
*/
|
|
1403
|
+
export declare function compileGuards(
|
|
1404
|
+
args: CompileGuardsArgs,
|
|
1405
|
+
): [MutationGuardDoc, ...MutationGuardDoc[]];
|
|
1867
1406
|
|
|
1868
|
-
declare interface
|
|
1407
|
+
export declare interface CompileGuardsArgs extends MutationGuardBody {
|
|
1869
1408
|
id: string;
|
|
1870
1409
|
}
|
|
1871
1410
|
|
|
@@ -1924,6 +1463,17 @@ export declare function computeDiffEntries<
|
|
|
1924
1463
|
target: DeployTarget;
|
|
1925
1464
|
}): Promise<DiffEntry[]>;
|
|
1926
1465
|
|
|
1466
|
+
/**
|
|
1467
|
+
* Thrown when one automatic cascade hop loses every optimistic-locking
|
|
1468
|
+
* attempt. An earlier verb commit may already have landed; invoke `tick`
|
|
1469
|
+
* after re-reading the instance to resume convergence when contention subsides.
|
|
1470
|
+
*/
|
|
1471
|
+
export declare class ConcurrentCascadeError extends WorkflowError<"concurrent-cascade"> {
|
|
1472
|
+
readonly instanceId: string;
|
|
1473
|
+
readonly attempts: number;
|
|
1474
|
+
constructor(args: { instanceId: string; attempts: number });
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1927
1477
|
/** {@link ConcurrentCompleteEffectError}'s mid-dispatch sibling: a
|
|
1928
1478
|
* `commitEffectOps` commit lost every optimistic-locking attempt. Nothing
|
|
1929
1479
|
* was written; the report may be retried under the same idempotency key. */
|
|
@@ -1984,7 +1534,7 @@ export declare class ConcurrentEditFieldError extends WorkflowError<"concurrent-
|
|
|
1984
1534
|
|
|
1985
1535
|
/**
|
|
1986
1536
|
* Thrown when a `fireAction` commit loses the optimistic-locking race on
|
|
1987
|
-
*
|
|
1537
|
+
* every commit attempt — each reload +
|
|
1988
1538
|
* `ifRevisionId` retry was beaten by another writer committing first.
|
|
1989
1539
|
* Surfacing it (rather than silently overwriting) lets the caller decide
|
|
1990
1540
|
* whether to retry later or report a write storm; nothing was committed
|
|
@@ -2011,7 +1561,7 @@ export declare class ConcurrentFireActionError extends WorkflowError<"concurrent
|
|
|
2011
1561
|
* never a `_type` scan over the lake (rejected at deploy).
|
|
2012
1562
|
*
|
|
2013
1563
|
* There is no `{ref, args}` wrapper: parameterized reuse is a define-time
|
|
2014
|
-
* TypeScript function producing a condition string (see the {@link groq} tag).
|
|
1564
|
+
* TypeScript function producing a condition string (see the {@link define.groq | groq} tag).
|
|
2015
1565
|
*/
|
|
2016
1566
|
export declare type Condition = string;
|
|
2017
1567
|
|
|
@@ -2063,7 +1613,7 @@ export { ConditionRead };
|
|
|
2063
1613
|
* then per stage — transitions, activities (filter, requirements, action
|
|
2064
1614
|
* filters and `when` triggers), editable gates, tighten-overrides.
|
|
2065
1615
|
* Editable gates resolve through the same helper the runtime projection uses
|
|
2066
|
-
* (
|
|
1616
|
+
* (entry `editable` ANDed with the stage
|
|
2067
1617
|
* tighten-override), so every live editable-field address exists here with
|
|
2068
1618
|
* the same EFFECTIVE predicate the edit insight explains — including
|
|
2069
1619
|
* override-only gates on `editable: true` entries, and workflow-scope fields
|
|
@@ -2098,7 +1648,7 @@ export declare type ConditionVarBinding = "always" | "caller" | "spawn";
|
|
|
2098
1648
|
/**
|
|
2099
1649
|
* The one-doc read a reactive adapter subscribes with to observe a content doc
|
|
2100
1650
|
* under a perspective stack. It uses the same perspective semantics as
|
|
2101
|
-
*
|
|
1651
|
+
* `hydrateSnapshot`: draft/version content is projected onto the published
|
|
2102
1652
|
* id, and a doc that exists only as a draft or release version remains visible.
|
|
2103
1653
|
*/
|
|
2104
1654
|
export declare function contentDocQuery(documentId: string): CompiledQuery;
|
|
@@ -2139,7 +1689,7 @@ export declare function contentDraftFallback(args: {
|
|
|
2139
1689
|
* Note: this resolves a **single** release — the documented `instance.perspective`
|
|
2140
1690
|
* shapes (`[release]` / `[release, "drafts"]`). The stores' per-doc reads take
|
|
2141
1691
|
* one release, so a multi-release stack can't be observed through them; the
|
|
2142
|
-
* engine's own fetch path (
|
|
1692
|
+
* engine's own fetch path (`hydrateSnapshot`) — and the SDK adapter's
|
|
2143
1693
|
* query-store route for stacks without a `'drafts'` entry — honour the full
|
|
2144
1694
|
* stack via `client.fetch({perspective})`.
|
|
2145
1695
|
*/
|
|
@@ -2250,15 +1800,12 @@ export declare class ContractViolationError extends WorkflowError<"contract-viol
|
|
|
2250
1800
|
* {@link Engine.subscriptionDocumentsForInstance} (need the pinned
|
|
2251
1801
|
* binding), {@link Engine.drainEffects} and
|
|
2252
1802
|
* {@link Engine.verifyDeployedDefinitions} (need the construction-time
|
|
2253
|
-
* `
|
|
1803
|
+
* `effects` / `loggerFactory`).
|
|
2254
1804
|
* - Namespace-only: `workflow.permissions` — pure grant helpers that need
|
|
2255
1805
|
* no engine scope.
|
|
2256
1806
|
*
|
|
2257
|
-
*
|
|
2258
|
-
*
|
|
2259
|
-
* {@link Engine.verifyDeployedDefinitions} (the startup audit of
|
|
2260
|
-
* deployed effect names). They don't change `fireAction` / `tick` /
|
|
2261
|
-
* `completeEffect` — the runtime still decides when to drain and
|
|
1807
|
+
* The {@link EngineEffectsArgs} group changes nothing about `fireAction` /
|
|
1808
|
+
* `tick` / `completeEffect` — the runtime still decides when to drain, and
|
|
2262
1809
|
* reports outcomes via `completeEffect`.
|
|
2263
1810
|
*/
|
|
2264
1811
|
export declare function createEngine<Client extends WorkflowClient>(
|
|
@@ -2267,8 +1814,8 @@ export declare function createEngine<Client extends WorkflowClient>(
|
|
|
2267
1814
|
|
|
2268
1815
|
/**
|
|
2269
1816
|
* The {@link EngineScopeArgs} scope pinned at construction, plus the
|
|
2270
|
-
* engine-only extras (`
|
|
2271
|
-
*
|
|
1817
|
+
* engine-only extras (`effects` and `loggerFactory` feed `drainEffects` +
|
|
1818
|
+
* `verifyDeployedDefinitions`). The `tag` partition is
|
|
2272
1819
|
* required and never defaulted — the engine enforces nothing, so the
|
|
2273
1820
|
* partition is the only thing keeping reads and writes off the wrong
|
|
2274
1821
|
* environment.
|
|
@@ -2277,18 +1824,8 @@ export declare interface CreateEngineArgs<
|
|
|
2277
1824
|
Client extends WorkflowClient = WorkflowClient,
|
|
2278
1825
|
> extends EngineScopeArgs {
|
|
2279
1826
|
client: Client;
|
|
2280
|
-
|
|
2281
|
-
missingHandler?: MissingHandlerPolicy;
|
|
1827
|
+
effects?: EngineEffectsArgs<Client>;
|
|
2282
1828
|
loggerFactory?: LoggerFactory;
|
|
2283
|
-
/**
|
|
2284
|
-
* Lease duration `drainEffects` stamps on each pending-effect claim.
|
|
2285
|
-
* Past the lease the claimer is presumed dead: the entry becomes
|
|
2286
|
-
* recoverable by another drain's takeover or by
|
|
2287
|
-
* the standalone `sweepStaleClaims` export. Default 5 minutes — size it well above
|
|
2288
|
-
* the slowest handler's honest runtime, since a live-but-slow dispatch
|
|
2289
|
-
* that outlives its lease can be redispatched (see {@link EffectHandler}).
|
|
2290
|
-
*/
|
|
2291
|
-
effectLeaseMs?: number;
|
|
2292
1829
|
/**
|
|
2293
1830
|
* Deterministic-time seam, pinned once for this engine and threaded
|
|
2294
1831
|
* into every verb it drives — `$now`, the `now` op-source, and the
|
|
@@ -2459,10 +1996,28 @@ export declare const DATA_MODEL_CHANGES: readonly [
|
|
|
2459
1996
|
applicability: "detectable";
|
|
2460
1997
|
summary: "Assignee fields may restrict newly assigned users and collective roles by role.";
|
|
2461
1998
|
}>,
|
|
1999
|
+
Readonly<{
|
|
2000
|
+
id: "split-guard-id-spaces";
|
|
2001
|
+
introducedInModel: 9;
|
|
2002
|
+
minReaderModel: 9;
|
|
2003
|
+
documentTypes: readonly ["definition", "instance"];
|
|
2004
|
+
compatibility: "reader-floor";
|
|
2005
|
+
applicability: "detectable";
|
|
2006
|
+
summary: "Guards spanning edit and lifecycle id spaces emit independently retractable documents.";
|
|
2007
|
+
}>,
|
|
2008
|
+
Readonly<{
|
|
2009
|
+
id: "singular-assignee-lists";
|
|
2010
|
+
introducedInModel: 9;
|
|
2011
|
+
minReaderModel: 9;
|
|
2012
|
+
documentTypes: readonly ["definition", "instance"];
|
|
2013
|
+
compatibility: "reader-floor";
|
|
2014
|
+
applicability: "detectable";
|
|
2015
|
+
summary: "Singular assignee fields use member lists with at most one user and any number of roles.";
|
|
2016
|
+
}>,
|
|
2462
2017
|
];
|
|
2463
2018
|
|
|
2464
2019
|
/** The maximum reader floor this writer can emit for a detectable feature. */
|
|
2465
|
-
export declare const DATA_MODEL_MAX_READER =
|
|
2020
|
+
export declare const DATA_MODEL_MAX_READER = 9;
|
|
2466
2021
|
|
|
2467
2022
|
/**
|
|
2468
2023
|
* The unconditional model-4 reader floor for every engine-owned document.
|
|
@@ -2484,7 +2039,7 @@ export declare const DATA_MODEL_MIN_READER = 4;
|
|
|
2484
2039
|
* `minReaderModel` floor. Declare every bump in `DATAMODEL.md`; the model-surface snapshot test
|
|
2485
2040
|
* fails on undeclared drift.
|
|
2486
2041
|
*/
|
|
2487
|
-
export declare const DATA_MODEL_VERSION =
|
|
2042
|
+
export declare const DATA_MODEL_VERSION = 9;
|
|
2488
2043
|
|
|
2489
2044
|
export declare interface DataModelChange {
|
|
2490
2045
|
readonly id: string;
|
|
@@ -2561,7 +2116,7 @@ export declare interface DedupableOperationArgs extends OperationArgs {
|
|
|
2561
2116
|
export declare const DEFAULT_CONTENT_PERSPECTIVE = "drafts";
|
|
2562
2117
|
|
|
2563
2118
|
/** How long a fresh claim's lease runs unless the engine configured
|
|
2564
|
-
* `
|
|
2119
|
+
* `effects.leaseMs`. */
|
|
2565
2120
|
export declare const DEFAULT_EFFECT_LEASE_MS: number;
|
|
2566
2121
|
|
|
2567
2122
|
/** How long a recorded idempotency key dedupes retries, unless the caller
|
|
@@ -2609,7 +2164,7 @@ export declare interface DefinitionGroupSite {
|
|
|
2609
2164
|
members: GroupMember[];
|
|
2610
2165
|
}
|
|
2611
2166
|
|
|
2612
|
-
declare interface DefinitionGuardsQueryArgs {
|
|
2167
|
+
export declare interface DefinitionGuardsQueryArgs {
|
|
2613
2168
|
client: WorkflowClient;
|
|
2614
2169
|
clientForGdr: ClientForGdr;
|
|
2615
2170
|
workflowResource: WorkflowResource;
|
|
@@ -2661,6 +2216,11 @@ export declare class DefinitionNotFoundError extends WorkflowError<"definition-n
|
|
|
2661
2216
|
constructor(args: { definition: string; version?: number });
|
|
2662
2217
|
}
|
|
2663
2218
|
|
|
2219
|
+
/** Every literal project role a stored definition references, deduplicated in encounter order. */
|
|
2220
|
+
export declare function definitionRoleNames(
|
|
2221
|
+
definition: WorkflowDefinition,
|
|
2222
|
+
): readonly string[];
|
|
2223
|
+
|
|
2664
2224
|
export declare interface DefinitionsForDocumentArgs {
|
|
2665
2225
|
/**
|
|
2666
2226
|
* The LOADED candidate document — unlike {@link InstancesForDocumentArgs},
|
|
@@ -2785,6 +2345,7 @@ export declare function denyingGuards(args: {
|
|
|
2785
2345
|
type?: string;
|
|
2786
2346
|
};
|
|
2787
2347
|
context: MutationContext;
|
|
2348
|
+
dereference?: GuardDereference;
|
|
2788
2349
|
}): Promise<MutationGuardDoc[]>;
|
|
2789
2350
|
|
|
2790
2351
|
export declare interface DeployDefinitionResult {
|
|
@@ -2842,14 +2403,13 @@ export declare interface DeployDefinitionsResult {
|
|
|
2842
2403
|
/** A definition as fetched back from the lake. The document carries `_id` plus
|
|
2843
2404
|
* the deploy-stamped envelope the authored {@link WorkflowDefinition} never
|
|
2844
2405
|
* had: the assigned `version` and the content fingerprint it was minted from
|
|
2845
|
-
* ({@link hashDefinitionContent}).
|
|
2846
|
-
* `contentHash` at runtime — see {@link LatestDeployed}. */
|
|
2406
|
+
* ({@link hashDefinitionContent}). */
|
|
2847
2407
|
export declare type DeployedDefinition = WorkflowDefinition & {
|
|
2848
2408
|
_id: string;
|
|
2849
2409
|
tag?: string;
|
|
2850
2410
|
version: number;
|
|
2851
|
-
/** Optional: a document deployed before content-addressing has none
|
|
2852
|
-
*
|
|
2411
|
+
/** Optional: a document deployed before content-addressing has none. Every
|
|
2412
|
+
* version this engine deploys carries one. */
|
|
2853
2413
|
contentHash?: string;
|
|
2854
2414
|
/** Engine data-model stamp (see {@link DATA_MODEL_VERSION}) — absent on
|
|
2855
2415
|
* documents deployed before the stamp existed (model 0). */
|
|
@@ -3089,16 +2649,17 @@ export declare interface DiagnoseResult {
|
|
|
3089
2649
|
}
|
|
3090
2650
|
|
|
3091
2651
|
/**
|
|
3092
|
-
* How an
|
|
3093
|
-
*
|
|
3094
|
-
* action
|
|
3095
|
-
*
|
|
3096
|
-
* `
|
|
2652
|
+
* How an instance reads right now. `waiting` and `blocked` are both healthy,
|
|
2653
|
+
* not stuck. A `waiting` result says whether the activity awaits an
|
|
2654
|
+
* action available to this caller (`caller`), a manual action that this caller
|
|
2655
|
+
* cannot currently take (`manual-action`), or a cascade-fired action
|
|
2656
|
+
* (`automation`). How long a workflow is "allowed" to wait is workflow- and
|
|
2657
|
+
* team-specific, not this classifier's call. `blocked` means an active
|
|
2658
|
+
* activity's declared requirements aren't all met
|
|
3097
2659
|
* yet, and flips to `waiting` once they hold (typically a sibling activity
|
|
3098
|
-
* completing, or content landing).
|
|
3099
|
-
* `liveChildren`
|
|
3100
|
-
*
|
|
3101
|
-
* should surface it loudly.
|
|
2660
|
+
* completing, or content landing). Completed and aborted results include
|
|
2661
|
+
* `liveChildren` while detached spawned work remains active; consumers should
|
|
2662
|
+
* surface it prominently.
|
|
3102
2663
|
*/
|
|
3103
2664
|
export declare type Diagnosis =
|
|
3104
2665
|
| {
|
|
@@ -3109,6 +2670,7 @@ export declare type Diagnosis =
|
|
|
3109
2670
|
activity: string;
|
|
3110
2671
|
assignees: Assignee[];
|
|
3111
2672
|
actions: string[];
|
|
2673
|
+
waitingFor: "automation" | "caller" | "manual-action";
|
|
3112
2674
|
}
|
|
3113
2675
|
| {
|
|
3114
2676
|
state: "blocked";
|
|
@@ -3148,7 +2710,7 @@ export declare interface DiffEntry {
|
|
|
3148
2710
|
|
|
3149
2711
|
/**
|
|
3150
2712
|
* Classifies `def` against the latest deployed version of its name via
|
|
3151
|
-
*
|
|
2713
|
+
* the deploy planner — a content change is always a new version,
|
|
3152
2714
|
* never an in-place update. `def` passes the same boundary parse deploy uses
|
|
3153
2715
|
* ({@link parseDefinitionInput}), so diff and deploy accept and reject the
|
|
3154
2716
|
* same input shape.
|
|
@@ -3279,26 +2841,25 @@ export declare interface DisplayMetadata {
|
|
|
3279
2841
|
export declare function displayTitle(typeKey: string | undefined): string;
|
|
3280
2842
|
|
|
3281
2843
|
/** Document-value permissions. Grants ({@link Grant} in ./authorization.ts) compose most-permissive-wins. */
|
|
3282
|
-
declare const DOCUMENT_VALUE_PERMISSIONS: readonly [
|
|
2844
|
+
export declare const DOCUMENT_VALUE_PERMISSIONS: readonly [
|
|
2845
|
+
"create",
|
|
2846
|
+
"manage",
|
|
2847
|
+
"read",
|
|
2848
|
+
"update",
|
|
2849
|
+
];
|
|
3283
2850
|
|
|
3284
2851
|
/**
|
|
3285
|
-
* The guards that
|
|
3286
|
-
*
|
|
3287
|
-
*
|
|
3288
|
-
* disables, it never enforces.
|
|
2852
|
+
* The guards that deny a concrete Lake mutation image. Advisory, like every
|
|
2853
|
+
* engine-side guard verdict: the check explains and disables, it never
|
|
2854
|
+
* enforces.
|
|
3289
2855
|
*/
|
|
3290
2856
|
export declare function documentActionDenials(
|
|
3291
2857
|
args: DocumentActionDenialsArgs,
|
|
3292
2858
|
): Promise<MutationGuardDoc[]>;
|
|
3293
2859
|
|
|
3294
2860
|
export declare interface DocumentActionDenialsArgs {
|
|
3295
|
-
/** The
|
|
3296
|
-
|
|
3297
|
-
* delta predicates see "no change"). */
|
|
3298
|
-
doc: {
|
|
3299
|
-
_id: string;
|
|
3300
|
-
_type: string;
|
|
3301
|
-
} & Record<string, unknown>;
|
|
2861
|
+
/** The concrete Lake mutation the action will perform. */
|
|
2862
|
+
mutation: MutationContext;
|
|
3302
2863
|
/** The datasource the document lives in. A guard applies solely within the
|
|
3303
2864
|
* datasource it is registered in, so a same-id match from a foreign
|
|
3304
2865
|
* datasource can never gate this action and must not flip verdicts. */
|
|
@@ -3306,15 +2867,15 @@ export declare interface DocumentActionDenialsArgs {
|
|
|
3306
2867
|
type: string;
|
|
3307
2868
|
id: string;
|
|
3308
2869
|
};
|
|
3309
|
-
action: MutationGuardAction;
|
|
3310
2870
|
guards: readonly MutationGuardDoc[];
|
|
3311
2871
|
/** The caller's principal id in the guarded resource's own namespace,
|
|
3312
2872
|
* resolved as `identity()` in predicates. */
|
|
3313
2873
|
identity?: string;
|
|
2874
|
+
/** Resource-local stored-document lookup for predicates using `->`. */
|
|
2875
|
+
dereference?: GuardDereference;
|
|
3314
2876
|
}
|
|
3315
2877
|
|
|
3316
|
-
/**
|
|
3317
|
-
* boundary strips rather than rejects. */
|
|
2878
|
+
/** @inline */
|
|
3318
2879
|
declare type DocumentEnvelopeKey =
|
|
3319
2880
|
| `_${string}`
|
|
3320
2881
|
| "tag"
|
|
@@ -3442,7 +3003,7 @@ export declare function driverKind(actor: Actor): DriverKind;
|
|
|
3442
3003
|
* to decide who-may-edit. ADVISORY like every engine gate — it disables the
|
|
3443
3004
|
* inline field and explains; a {@link Guard} declares the intended write-lock.
|
|
3444
3005
|
*/
|
|
3445
|
-
export declare type Editable =
|
|
3006
|
+
export declare type Editable = true | string;
|
|
3446
3007
|
|
|
3447
3008
|
/**
|
|
3448
3009
|
* One declared-editable field in the current scope, projected for an actor: its
|
|
@@ -3586,6 +3147,8 @@ export declare type EditMode = "set" | "append" | "unset";
|
|
|
3586
3147
|
* completion and nothing is stored. Omitting `outputs` is an EMPTY allowlist,
|
|
3587
3148
|
* so ANY returned output is rejected and fails the completion — the bound is
|
|
3588
3149
|
* universal, not opt-in.
|
|
3150
|
+
*
|
|
3151
|
+
* @interface
|
|
3589
3152
|
*/
|
|
3590
3153
|
export declare type Effect = v.InferOutput<typeof EffectSchema>;
|
|
3591
3154
|
|
|
@@ -3599,15 +3162,6 @@ export declare const EFFECT_COMMIT_DISPATCH_CAP = 200;
|
|
|
3599
3162
|
* (its queue depth stays ≤ 1). */
|
|
3600
3163
|
export declare const EFFECT_COMMIT_QUEUE_DEPTH = 32;
|
|
3601
3164
|
|
|
3602
|
-
/**
|
|
3603
|
-
* Every terminal state an effect run can record. `done` and `failed` are
|
|
3604
|
-
* reported through completion ({@link EffectCompletionStatus}); `cancelled`
|
|
3605
|
-
* is engine-stamped only — an abort cancelling the entry before dispatch.
|
|
3606
|
-
* A cancellation is not a failure: anything counting failures (dashboards,
|
|
3607
|
-
* retry tooling) must not count aborted-away effects among them.
|
|
3608
|
-
*/
|
|
3609
|
-
declare const EFFECT_RUN_STATUSES: readonly ["done", "failed", "cancelled"];
|
|
3610
|
-
|
|
3611
3165
|
/**
|
|
3612
3166
|
* A `ctx.commitOps` / `ctx.setProgress` call hit one of the dispatch's
|
|
3613
3167
|
* bounds. Thrown synchronously at the call site, not as a promise rejection:
|
|
@@ -3666,7 +3220,7 @@ export declare type EffectHandler<
|
|
|
3666
3220
|
} | void>;
|
|
3667
3221
|
}["bivarianceHack"];
|
|
3668
3222
|
|
|
3669
|
-
declare type EffectHandlerContext<Client extends WorkflowClient> = {
|
|
3223
|
+
export declare type EffectHandlerContext<Client extends WorkflowClient> = {
|
|
3670
3224
|
/** A concrete sibling of the `createEngine` client, bound to the workflow resource with the
|
|
3671
3225
|
* same credentials; untagged handler requests carry the `workflow.effect` tag by default. */
|
|
3672
3226
|
client: Client;
|
|
@@ -3784,7 +3338,14 @@ export declare function effectOutputsMap(
|
|
|
3784
3338
|
instance: Pick<WorkflowInstance, "effectHistory">,
|
|
3785
3339
|
): Record<string, unknown>;
|
|
3786
3340
|
|
|
3787
|
-
|
|
3341
|
+
/**
|
|
3342
|
+
* Every terminal state an effect run can record. `done` and `failed` are
|
|
3343
|
+
* reported through completion ({@link EffectCompletionStatus}); `cancelled`
|
|
3344
|
+
* is engine-stamped only — an abort cancelling the entry before dispatch.
|
|
3345
|
+
* A cancellation is not a failure: anything counting failures (dashboards,
|
|
3346
|
+
* retry tooling) must not count aborted-away effects among them.
|
|
3347
|
+
*/
|
|
3348
|
+
export declare type EffectRunStatus = "done" | "failed" | "cancelled";
|
|
3788
3349
|
|
|
3789
3350
|
declare const EffectSchema: v.StrictObjectSchema<
|
|
3790
3351
|
{
|
|
@@ -3840,8 +3401,7 @@ export declare interface Engine {
|
|
|
3840
3401
|
readonly client: WorkflowClient;
|
|
3841
3402
|
readonly tag: string;
|
|
3842
3403
|
readonly workflowResource: WorkflowResource;
|
|
3843
|
-
readonly
|
|
3844
|
-
readonly missingHandler: MissingHandlerPolicy;
|
|
3404
|
+
readonly effects: ResolvedEngineEffects;
|
|
3845
3405
|
readonly logger: LoggerFactory;
|
|
3846
3406
|
/** The resolved telemetry logger ({@link noopTelemetry} unless injected) —
|
|
3847
3407
|
* exposed so adapters built on the engine log through the same seam. */
|
|
@@ -3979,13 +3539,13 @@ export declare interface Engine {
|
|
|
3979
3539
|
drainEffects: (args: DrainEffectsArgs) => Promise<DrainEffectsResult>;
|
|
3980
3540
|
/**
|
|
3981
3541
|
* Inspect every deployed definition in the engine's tag and apply
|
|
3982
|
-
* the configured missingHandler policy at `phase: "deploy"` for any
|
|
3542
|
+
* the configured `effects.missingHandler` policy at `phase: "deploy"` for any
|
|
3983
3543
|
* effect name without a registered handler. Catches "definition
|
|
3984
3544
|
* shipped, handler removed" misconfigurations at startup instead of
|
|
3985
3545
|
* three days later when the effect fires.
|
|
3986
3546
|
*
|
|
3987
3547
|
* Returns the list of (definitionId, name, locations) tuples it saw.
|
|
3988
|
-
* Throws if missingHandler resolved as "fail" for any of them.
|
|
3548
|
+
* Throws if `effects.missingHandler` resolved as "fail" for any of them.
|
|
3989
3549
|
*/
|
|
3990
3550
|
verifyDeployedDefinitions: () => Promise<VerifyDeployedDefinitionsResult>;
|
|
3991
3551
|
}
|
|
@@ -4004,6 +3564,31 @@ export declare interface Engine {
|
|
|
4004
3564
|
*/
|
|
4005
3565
|
export declare const ENGINE_API_VERSION = "2026-04-29";
|
|
4006
3566
|
|
|
3567
|
+
/**
|
|
3568
|
+
* Everything this engine needs to run pending effects, in one group.
|
|
3569
|
+
* {@link Engine.drainEffects} dispatches through `handlers` under a
|
|
3570
|
+
* `leaseMs` claim, and both the drain and
|
|
3571
|
+
* {@link Engine.verifyDeployedDefinitions} apply `missingHandler` to an effect
|
|
3572
|
+
* name no handler covers.
|
|
3573
|
+
*/
|
|
3574
|
+
export declare interface EngineEffectsArgs<
|
|
3575
|
+
Client extends WorkflowClient = WorkflowClient,
|
|
3576
|
+
> {
|
|
3577
|
+
/** Effect handlers keyed by the effect name the definition queues. */
|
|
3578
|
+
handlers?: Record<string, EffectHandler<Client>>;
|
|
3579
|
+
/**
|
|
3580
|
+
* Lease duration `drainEffects` stamps on each pending-effect claim.
|
|
3581
|
+
* Past the lease the claimer is presumed dead: the entry becomes
|
|
3582
|
+
* recoverable by another drain's takeover or by
|
|
3583
|
+
* the standalone `sweepStaleClaims` export. Default 5 minutes — size it well above
|
|
3584
|
+
* the slowest handler's honest runtime, since a live-but-slow dispatch
|
|
3585
|
+
* that outlives its lease can be redispatched (see {@link EffectHandler}).
|
|
3586
|
+
*/
|
|
3587
|
+
leaseMs?: number;
|
|
3588
|
+
/** What to do with an effect name `handlers` doesn't cover. Default `fail`. */
|
|
3589
|
+
missingHandler?: MissingHandlerPolicy;
|
|
3590
|
+
}
|
|
3591
|
+
|
|
4007
3592
|
export declare interface EngineLogger {
|
|
4008
3593
|
info: (message: string, extra?: Record<string, unknown>) => void;
|
|
4009
3594
|
warn: (message: string, extra?: Record<string, unknown>) => void;
|
|
@@ -4066,7 +3651,7 @@ export declare interface EngineScopeArgs {
|
|
|
4066
3651
|
/**
|
|
4067
3652
|
* Pull the {@link GlobalDocumentReference} values out of `doc.ref` /
|
|
4068
3653
|
* `subject` / `doc.refs` (content) field entries. Content only — release
|
|
4069
|
-
* field entries come from
|
|
3654
|
+
* field entries come from the shared release-ref projection, so guard discovery (which
|
|
4070
3655
|
* reads this via `collectEntryDocUris`) stays scoped to content docs.
|
|
4071
3656
|
*/
|
|
4072
3657
|
export declare function entryDocRefs(
|
|
@@ -4098,12 +3683,14 @@ export declare interface EvaluateArgs {
|
|
|
4098
3683
|
}
|
|
4099
3684
|
|
|
4100
3685
|
/**
|
|
4101
|
-
* The pure projection at the heart of
|
|
3686
|
+
* The pure projection at the heart of runtime evaluation: given an
|
|
4102
3687
|
* instance, its definition, the resolved actor/grants, and a snapshot,
|
|
4103
|
-
* compute "what can this actor do right now, and why not the rest."
|
|
4104
|
-
*
|
|
4105
|
-
*
|
|
4106
|
-
*
|
|
3688
|
+
* compute "what can this actor do right now, and why not the rest." The
|
|
3689
|
+
* supplied snapshot is never refetched; guards using `->` may call the
|
|
3690
|
+
* supplied {@link EvaluateFromSnapshotArgs.guardDereference} resolver.
|
|
3691
|
+
* Feed it a fresh snapshot (e.g. rebuilt from a live store on change) for
|
|
3692
|
+
* reactive re-evaluation. Best-effort by design: verdicts are advisory,
|
|
3693
|
+
* not enforcement.
|
|
4107
3694
|
*/
|
|
4108
3695
|
export declare function evaluateFromSnapshot(
|
|
4109
3696
|
args: EvaluateFromSnapshotArgs,
|
|
@@ -4134,7 +3721,7 @@ export declare interface EvaluateFromSnapshotArgs {
|
|
|
4134
3721
|
attributes?: UserAttributes;
|
|
4135
3722
|
/**
|
|
4136
3723
|
* The in-memory snapshot to evaluate against. The caller assembles it
|
|
4137
|
-
* from whatever source — a fetch
|
|
3724
|
+
* from whatever source — a fetch-backed evaluation or a
|
|
4138
3725
|
* live store. The `_id` of every doc must be in GDR-URI form, as
|
|
4139
3726
|
* {@link buildSnapshot} produces.
|
|
4140
3727
|
*/
|
|
@@ -4151,9 +3738,14 @@ export declare interface EvaluateFromSnapshotArgs {
|
|
|
4151
3738
|
* doc, so a guard that matches the instance and denies that write disables
|
|
4152
3739
|
* every action with `mutation-guard-denied`. Omit to skip the gate in this
|
|
4153
3740
|
* projection — the engine's verb paths load live guards and re-check at
|
|
4154
|
-
* commit time (
|
|
3741
|
+
* commit time (the runtime evaluation path fetches them itself).
|
|
4155
3742
|
*/
|
|
4156
3743
|
guards?: readonly MutationGuardDoc[];
|
|
3744
|
+
/**
|
|
3745
|
+
* Stored-resource lookup for guard predicates using `->`. Omit when no
|
|
3746
|
+
* guard can dereference; missing lookups resolve `null` and deny fail-closed.
|
|
3747
|
+
*/
|
|
3748
|
+
guardDereference?: GuardDereference;
|
|
4157
3749
|
/**
|
|
4158
3750
|
* Per-FOREIGN-subject-resource access — the actor's ACL grants PLUS the
|
|
4159
3751
|
* actor's principal id in that resource's own namespace — keyed by
|
|
@@ -4161,20 +3753,22 @@ export declare interface EvaluateFromSnapshotArgs {
|
|
|
4161
3753
|
* effects-bearing actions ({@link SubjectPermissionDenial}). A resource
|
|
4162
3754
|
* appears only when both halves resolved; omit it (or the whole map) to
|
|
4163
3755
|
* skip that resource's forecast (degrade open — the subject's lake still
|
|
4164
|
-
* enforces).
|
|
4165
|
-
* resource's own client
|
|
3756
|
+
* enforces). The runtime evaluation path resolves this through each
|
|
3757
|
+
* resource's own client.
|
|
4166
3758
|
*/
|
|
4167
3759
|
resourceGrants?: ReadonlyMap<string, SubjectResourceAccess>;
|
|
4168
3760
|
}
|
|
4169
3761
|
|
|
4170
3762
|
/**
|
|
4171
3763
|
* Evaluate a guard predicate against a mutation. Returns `true` only when the
|
|
4172
|
-
* predicate is strictly `true` (ALLOW). Empty
|
|
4173
|
-
*
|
|
3764
|
+
* predicate is strictly `true` (ALLOW). Empty predicates, parse failures, and
|
|
3765
|
+
* non-`true` results deny. A supplied dereference resolver's failure propagates
|
|
3766
|
+
* so infrastructure errors cannot masquerade as guard verdicts.
|
|
4174
3767
|
*/
|
|
4175
3768
|
export declare function evaluateMutationGuard(args: {
|
|
4176
3769
|
guard: MutationGuardDoc;
|
|
4177
3770
|
context: MutationContext;
|
|
3771
|
+
dereference?: GuardDereference;
|
|
4178
3772
|
}): Promise<boolean>;
|
|
4179
3773
|
|
|
4180
3774
|
/** Args for `evaluateStart` — the pre-flight read of `startInstance`'s gates
|
|
@@ -4297,14 +3891,14 @@ export declare type ExecutorClassification =
|
|
|
4297
3891
|
* alias isn't bound: the check that stops a portable definition from deploying
|
|
4298
3892
|
* against the wrong (or no) resource.
|
|
4299
3893
|
*
|
|
4300
|
-
* Runs
|
|
3894
|
+
* Runs during deploy planning, BEFORE the content
|
|
4301
3895
|
* fingerprint, so a deployed definition never carries a logical alias. The
|
|
4302
3896
|
* stored references are physical, and a rebind (same source, a different alias
|
|
4303
3897
|
* map) surfaces as changed content — a new version, never a silent shift in what
|
|
4304
3898
|
* the workflow reads. A no-op when the definition references no aliases.
|
|
4305
3899
|
*
|
|
4306
|
-
* Rewrites string VALUES only
|
|
4307
|
-
*
|
|
3900
|
+
* Rewrites string VALUES only through a shared deep walk, skipping known prose
|
|
3901
|
+
* fields. A reference that stands alone
|
|
4308
3902
|
* (the whole value is `@<alias>:<id>`, e.g. a literal `doc.ref`) must expand to a
|
|
4309
3903
|
* well-formed GDR — a malformed one (`@content:a:b`, an empty id) is rejected
|
|
4310
3904
|
* here rather than failing when an instance later reads it.
|
|
@@ -4449,13 +4043,6 @@ export declare const FIELD_KIND_DISPLAY: {
|
|
|
4449
4043
|
};
|
|
4450
4044
|
};
|
|
4451
4045
|
|
|
4452
|
-
/**
|
|
4453
|
-
* The three field scopes a field entry can live in. Also the
|
|
4454
|
-
* group-declaration levels: a `groups` array lives at exactly these three
|
|
4455
|
-
* nodes, so `DefinitionGroupSite.level` reuses this vocabulary.
|
|
4456
|
-
*/
|
|
4457
|
-
declare const FIELD_SCOPES: readonly ["workflow", "stage", "activity"];
|
|
4458
|
-
|
|
4459
4046
|
/**
|
|
4460
4047
|
* The kinds a VALUE can take — scalars aligned to Sanity's names, the
|
|
4461
4048
|
* reference kinds, the actor/assignee identities, and the two compositional
|
|
@@ -4490,8 +4077,7 @@ declare const FIELD_VALUE_KINDS: readonly [
|
|
|
4490
4077
|
"array",
|
|
4491
4078
|
];
|
|
4492
4079
|
|
|
4493
|
-
/**
|
|
4494
|
-
* `group` grammars (stored membership is the canonical list form). */
|
|
4080
|
+
/** @inline */
|
|
4495
4081
|
declare type FieldBase<TEditable, TGroup> = {
|
|
4496
4082
|
name: string;
|
|
4497
4083
|
title?: string | undefined;
|
|
@@ -4509,11 +4095,14 @@ export declare interface FieldDescription {
|
|
|
4509
4095
|
proposals: InsightPhrase[];
|
|
4510
4096
|
}
|
|
4511
4097
|
|
|
4512
|
-
/**
|
|
4098
|
+
/**
|
|
4099
|
+
* One declared field entry as authored and stored: name, value kind, and its scope's sourcing and editability.
|
|
4100
|
+
*
|
|
4101
|
+
* @interface
|
|
4102
|
+
*/
|
|
4513
4103
|
export declare type FieldEntry = FieldEntryFields<Editable, string[]>;
|
|
4514
4104
|
|
|
4515
|
-
/**
|
|
4516
|
-
* editability and group-membership grammars. */
|
|
4105
|
+
/** @inline */
|
|
4517
4106
|
declare type FieldEntryFields<TEditable, TGroup> = FieldBase<
|
|
4518
4107
|
TEditable,
|
|
4519
4108
|
TGroup
|
|
@@ -4550,11 +4139,58 @@ export declare interface FieldInsight {
|
|
|
4550
4139
|
|
|
4551
4140
|
export declare type FieldKind = keyof FieldValueMap;
|
|
4552
4141
|
|
|
4142
|
+
/** A field mutation targeting the supplied field-reference shape. */
|
|
4143
|
+
export declare type FieldMutationOp<
|
|
4144
|
+
TTarget extends {
|
|
4145
|
+
field: string;
|
|
4146
|
+
},
|
|
4147
|
+
> =
|
|
4148
|
+
| {
|
|
4149
|
+
type: "field.set";
|
|
4150
|
+
target: TTarget;
|
|
4151
|
+
value: ValueExpr;
|
|
4152
|
+
}
|
|
4153
|
+
| {
|
|
4154
|
+
type: "field.setIfMissing";
|
|
4155
|
+
target: TTarget;
|
|
4156
|
+
value: ValueExpr;
|
|
4157
|
+
}
|
|
4158
|
+
| {
|
|
4159
|
+
type: "field.unset";
|
|
4160
|
+
target: TTarget;
|
|
4161
|
+
}
|
|
4162
|
+
| {
|
|
4163
|
+
type: "field.append";
|
|
4164
|
+
target: TTarget;
|
|
4165
|
+
value: ValueExpr;
|
|
4166
|
+
}
|
|
4167
|
+
| {
|
|
4168
|
+
type: "field.inc";
|
|
4169
|
+
target: TTarget;
|
|
4170
|
+
value?: ValueExpr | undefined;
|
|
4171
|
+
}
|
|
4172
|
+
| {
|
|
4173
|
+
type: "field.dec";
|
|
4174
|
+
target: TTarget;
|
|
4175
|
+
value?: ValueExpr | undefined;
|
|
4176
|
+
}
|
|
4177
|
+
| {
|
|
4178
|
+
type: "field.updateWhere";
|
|
4179
|
+
target: TTarget;
|
|
4180
|
+
where: Condition;
|
|
4181
|
+
value: ValueExpr;
|
|
4182
|
+
}
|
|
4183
|
+
| {
|
|
4184
|
+
type: "field.removeWhere";
|
|
4185
|
+
target: TTarget;
|
|
4186
|
+
where: Condition;
|
|
4187
|
+
};
|
|
4188
|
+
|
|
4553
4189
|
/**
|
|
4554
4190
|
* A stored field mutation. `field.inc` and `field.dec` use the same names as
|
|
4555
4191
|
* `@sanity/client` patches and default an omitted `value` to a delta of `1`.
|
|
4556
4192
|
*/
|
|
4557
|
-
export declare type FieldOp =
|
|
4193
|
+
export declare type FieldOp = FieldMutationOp<StoredFieldRef>;
|
|
4558
4194
|
|
|
4559
4195
|
/**
|
|
4560
4196
|
* A concrete value a blocking atom pins for this field, with the verified
|
|
@@ -4568,6 +4204,7 @@ export declare interface FieldProposal {
|
|
|
4568
4204
|
consequences: SiteConsequence[];
|
|
4569
4205
|
}
|
|
4570
4206
|
|
|
4207
|
+
/** @inline */
|
|
4571
4208
|
declare type FieldReadExpr = {
|
|
4572
4209
|
type: "fieldRead";
|
|
4573
4210
|
scope?: "workflow" | "stage" | undefined;
|
|
@@ -4575,7 +4212,12 @@ declare type FieldReadExpr = {
|
|
|
4575
4212
|
path?: string | undefined;
|
|
4576
4213
|
};
|
|
4577
4214
|
|
|
4578
|
-
|
|
4215
|
+
/**
|
|
4216
|
+
* The three field scopes a field entry can live in. Also the
|
|
4217
|
+
* group-declaration levels: a `groups` array lives at exactly these three
|
|
4218
|
+
* nodes, so `DefinitionGroupSite.level` reuses this vocabulary.
|
|
4219
|
+
*/
|
|
4220
|
+
export declare type FieldScope = "workflow" | "stage" | "activity";
|
|
4579
4221
|
|
|
4580
4222
|
/**
|
|
4581
4223
|
* A sub-field shape used inside an `object`'s `fields` or an `array`'s `of` —
|
|
@@ -4607,6 +4249,7 @@ export declare interface FieldShape {
|
|
|
4607
4249
|
*/
|
|
4608
4250
|
export declare type FieldSource = FieldSourceInternal;
|
|
4609
4251
|
|
|
4252
|
+
/** @inline */
|
|
4610
4253
|
declare type FieldSourceInternal =
|
|
4611
4254
|
| {
|
|
4612
4255
|
type: "input";
|
|
@@ -4655,8 +4298,8 @@ export declare interface FieldValueMap {
|
|
|
4655
4298
|
dueDatetime: string | null;
|
|
4656
4299
|
url: string | null;
|
|
4657
4300
|
actor: Actor | null;
|
|
4658
|
-
/**
|
|
4659
|
-
assignee: Assignee
|
|
4301
|
+
/** Assignment members with at most one user; role members do not consume that cardinality. */
|
|
4302
|
+
assignee: Assignee[];
|
|
4660
4303
|
assignees: Assignee[];
|
|
4661
4304
|
/** An object with named sub-fields; the value is keyed by sub-field name. */
|
|
4662
4305
|
object: Record<string, unknown> | null;
|
|
@@ -5018,33 +4661,15 @@ export declare function groupSitesOf(
|
|
|
5018
4661
|
): DefinitionGroupSite[];
|
|
5019
4662
|
|
|
5020
4663
|
/**
|
|
5021
|
-
* A
|
|
5022
|
-
*
|
|
5023
|
-
*
|
|
5024
|
-
*
|
|
5025
|
-
*
|
|
5026
|
-
* `_id` derives from `(instanceId, name)` at stage entry) and the deploy-time
|
|
5027
|
-
* read VALUES on `match.idRefs` / `metadata` (a typed {@link GuardRead} when
|
|
5028
|
-
* authoring, resolved to bare values at deploy). `match` selects mutations by
|
|
5029
|
-
* `types` (empty matches any), `idRefs` (field reads resolved to bare ids),
|
|
5030
|
-
* `idPatterns` (bare glob ids), and `actions` (at least one). `predicate` is
|
|
5031
|
-
* lake GROQ in a distinct delta-mode eval context (`before()`/`after()`,
|
|
5032
|
-
* `mutation`, `guard`, `identity()`, bare ids/fields only): strictly `true`
|
|
5033
|
-
* ALLOWS the mutation; anything else — false, null, an evaluation error, or
|
|
5034
|
-
* an omitted/empty predicate — DENIES. `metadata` is the only bridge from
|
|
5035
|
-
* that eval context (which cannot see `$fields`) to workflow fields, read as
|
|
5036
|
-
* `guard.metadata.*` and re-synced by the post-field-op guard refresh. The
|
|
5037
|
-
* lake does not enforce the guard document type yet: a deployed guard denies
|
|
5038
|
-
* optimistically engine-side, and the lake ACL is the only hard gate until
|
|
5039
|
-
* guard enforcement ships.
|
|
4664
|
+
* A stored workflow guard. Its string reads and authored lifecycle actions
|
|
4665
|
+
* remain unresolved until stage entry produces the Lake-shaped documents
|
|
4666
|
+
* deployed for that stage.
|
|
4667
|
+
*
|
|
4668
|
+
* @interface
|
|
5040
4669
|
*/
|
|
5041
4670
|
export declare type Guard = v.InferOutput<typeof GuardSchema>;
|
|
5042
4671
|
|
|
5043
4672
|
/**
|
|
5044
|
-
* The lake document type for a mutation guard. Single source of truth — both
|
|
5045
|
-
* the runtime value (id construction, `compileGuard`, queries) and the
|
|
5046
|
-
* {@link MutationGuardDoc} `_type` literal derive from here.
|
|
5047
|
-
*
|
|
5048
4673
|
* The enforcement story hangs off this type: the lake does not evaluate
|
|
5049
4674
|
* this doc type — it is the engine's placeholder for the lake's
|
|
5050
4675
|
* forthcoming guard primitive (the lake reserves `system.*`). Until that
|
|
@@ -5061,21 +4686,21 @@ export declare const GUARD_OWNER = "robot:workflow-engine";
|
|
|
5061
4686
|
* The identifiers a lake mutation guard's `predicate` reads — the wire
|
|
5062
4687
|
* dialect, not the condition scope (so no {@link ConditionVarBinding}: these
|
|
5063
4688
|
* bind only when a guard evaluates a mutation). `before()`/`after()`/
|
|
5064
|
-
* `identity()` are groq-js delta-mode natives on top of these.
|
|
5065
|
-
*
|
|
4689
|
+
* `identity()` are groq-js delta-mode natives on top of these. The guard
|
|
4690
|
+
* evaluator must bind every entry here at the predicate root.
|
|
5066
4691
|
*/
|
|
5067
4692
|
export declare const GUARD_PREDICATE_VARS: readonly {
|
|
5068
4693
|
name: string;
|
|
5069
4694
|
description: string;
|
|
5070
4695
|
}[];
|
|
5071
4696
|
|
|
5072
|
-
export declare type GuardAction =
|
|
4697
|
+
export declare type GuardAction = MutationGuardAction;
|
|
5073
4698
|
|
|
5074
|
-
declare
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
>;
|
|
4699
|
+
export declare type GuardDereference = (ref: {
|
|
4700
|
+
_ref: string;
|
|
4701
|
+
}) => PromiseLike<Record<string, unknown> | null>;
|
|
5078
4702
|
|
|
4703
|
+
/** The stored document, pattern, type, and authored-action facets a guard matches. */
|
|
5079
4704
|
export declare type GuardMatch = Guard["match"];
|
|
5080
4705
|
|
|
5081
4706
|
/**
|
|
@@ -5106,86 +4731,23 @@ export declare function guardMatches({
|
|
|
5106
4731
|
* matched by anchored regexes, so a line break in a path would print an
|
|
5107
4732
|
* unparseable read.
|
|
5108
4733
|
*/
|
|
5109
|
-
export declare type GuardRead =
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
undefined
|
|
5125
|
-
|
|
5126
|
-
v.StrictObjectSchema<
|
|
5127
|
-
{
|
|
5128
|
-
readonly type: v.LiteralSchema<"fieldRead", undefined>;
|
|
5129
|
-
readonly field: v.SchemaWithPipe<
|
|
5130
|
-
readonly [v.StringSchema<undefined>, v.RegexAction<string, string>]
|
|
5131
|
-
>;
|
|
5132
|
-
readonly path: v.OptionalSchema<
|
|
5133
|
-
v.SchemaWithPipe<
|
|
5134
|
-
readonly [
|
|
5135
|
-
v.SchemaWithPipe<
|
|
5136
|
-
readonly [
|
|
5137
|
-
v.StringSchema<undefined>,
|
|
5138
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
5139
|
-
]
|
|
5140
|
-
>,
|
|
5141
|
-
v.CheckAction<
|
|
5142
|
-
string,
|
|
5143
|
-
"a guard read path cannot contain a line break"
|
|
5144
|
-
>,
|
|
5145
|
-
]
|
|
5146
|
-
>,
|
|
5147
|
-
undefined
|
|
5148
|
-
>;
|
|
5149
|
-
},
|
|
5150
|
-
undefined
|
|
5151
|
-
>,
|
|
5152
|
-
v.StrictObjectSchema<
|
|
5153
|
-
{
|
|
5154
|
-
readonly type: v.LiteralSchema<"effectsRead", undefined>;
|
|
5155
|
-
readonly effect: v.SchemaWithPipe<
|
|
5156
|
-
readonly [
|
|
5157
|
-
v.SchemaWithPipe<
|
|
5158
|
-
readonly [
|
|
5159
|
-
v.StringSchema<undefined>,
|
|
5160
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
5161
|
-
]
|
|
5162
|
-
>,
|
|
5163
|
-
v.CheckAction<string, "an effect name cannot contain `'`">,
|
|
5164
|
-
]
|
|
5165
|
-
>;
|
|
5166
|
-
readonly path: v.OptionalSchema<
|
|
5167
|
-
v.SchemaWithPipe<
|
|
5168
|
-
readonly [
|
|
5169
|
-
v.SchemaWithPipe<
|
|
5170
|
-
readonly [
|
|
5171
|
-
v.StringSchema<undefined>,
|
|
5172
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
5173
|
-
]
|
|
5174
|
-
>,
|
|
5175
|
-
v.CheckAction<
|
|
5176
|
-
string,
|
|
5177
|
-
"a guard read path cannot contain a line break"
|
|
5178
|
-
>,
|
|
5179
|
-
]
|
|
5180
|
-
>,
|
|
5181
|
-
undefined
|
|
5182
|
-
>;
|
|
5183
|
-
},
|
|
5184
|
-
undefined
|
|
5185
|
-
>,
|
|
5186
|
-
],
|
|
5187
|
-
undefined
|
|
5188
|
-
>;
|
|
4734
|
+
export declare type GuardRead =
|
|
4735
|
+
| {
|
|
4736
|
+
type: "self";
|
|
4737
|
+
}
|
|
4738
|
+
| {
|
|
4739
|
+
type: "now";
|
|
4740
|
+
}
|
|
4741
|
+
| {
|
|
4742
|
+
type: "fieldRead";
|
|
4743
|
+
field: string;
|
|
4744
|
+
path?: string | undefined;
|
|
4745
|
+
}
|
|
4746
|
+
| {
|
|
4747
|
+
type: "effectsRead";
|
|
4748
|
+
effect: string;
|
|
4749
|
+
path?: string | undefined;
|
|
4750
|
+
};
|
|
5189
4751
|
|
|
5190
4752
|
declare const GuardSchema: v.StrictObjectSchema<
|
|
5191
4753
|
{
|
|
@@ -5235,21 +4797,12 @@ declare const GuardSchema: v.StrictObjectSchema<
|
|
|
5235
4797
|
>,
|
|
5236
4798
|
undefined
|
|
5237
4799
|
>;
|
|
5238
|
-
actions: v.
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
>,
|
|
5245
|
-
undefined
|
|
5246
|
-
>,
|
|
5247
|
-
v.MinLengthAction<
|
|
5248
|
-
("create" | "update" | "delete" | "publish" | "unpublish")[],
|
|
5249
|
-
1,
|
|
5250
|
-
"a guard must match at least one action"
|
|
5251
|
-
>,
|
|
5252
|
-
]
|
|
4800
|
+
actions: v.ArraySchema<
|
|
4801
|
+
v.PicklistSchema<
|
|
4802
|
+
readonly ["create", "update", "delete", "publish", "unpublish"],
|
|
4803
|
+
string
|
|
4804
|
+
>,
|
|
4805
|
+
undefined
|
|
5253
4806
|
>;
|
|
5254
4807
|
},
|
|
5255
4808
|
undefined
|
|
@@ -5282,7 +4835,7 @@ declare const GuardSchema: v.StrictObjectSchema<
|
|
|
5282
4835
|
* its guards statically name — no live instance required. Guard docs are
|
|
5283
4836
|
* stamped with the version-less definition, so this spans the datasources
|
|
5284
4837
|
* declared across ALL deployed versions
|
|
5285
|
-
* (
|
|
4838
|
+
* (`definitions`), not just the latest.
|
|
5286
4839
|
*
|
|
5287
4840
|
* A datasource is statically reachable when a guard idRef resolves to a
|
|
5288
4841
|
* hardcoded GDR literal — directly, or via a `fieldRead` of a field entry whose
|
|
@@ -5328,7 +4881,7 @@ export { guillemets };
|
|
|
5328
4881
|
* Advisory, like every engine check (the lake is the only enforcement point):
|
|
5329
4882
|
* FNV-1a is a fast, deterministic, dependency-free, isomorphic digest — enough
|
|
5330
4883
|
* to detect honest change and drift, not a tamper-proof seal. Kept synchronous
|
|
5331
|
-
* so the pure planning path
|
|
4884
|
+
* so the pure planning path needs no `await`.
|
|
5332
4885
|
*/
|
|
5333
4886
|
export declare function hashDefinitionContent(def: WorkflowDefinition): string;
|
|
5334
4887
|
|
|
@@ -5424,6 +4977,7 @@ export declare type HistoryEntry = HistoryEvent & {
|
|
|
5424
4977
|
executionContext?: ExecutionContext;
|
|
5425
4978
|
};
|
|
5426
4979
|
|
|
4980
|
+
/** @inline */
|
|
5427
4981
|
declare type HistoryEvent =
|
|
5428
4982
|
| {
|
|
5429
4983
|
_key: string;
|
|
@@ -5593,6 +5147,14 @@ export declare interface HydratedSnapshot {
|
|
|
5593
5147
|
knownIds: Set<string>;
|
|
5594
5148
|
}
|
|
5595
5149
|
|
|
5150
|
+
/** Assignment ownership for list/read surfaces. Role aliases deliberately do
|
|
5151
|
+
* not apply: aliases widen authorization, not whose inbox a literal pool
|
|
5152
|
+
* member routes work into. */
|
|
5153
|
+
export declare function identityMatchesAssignment(
|
|
5154
|
+
members: readonly Assignee[],
|
|
5155
|
+
identity: AssignmentIdentity,
|
|
5156
|
+
): boolean;
|
|
5157
|
+
|
|
5596
5158
|
/**
|
|
5597
5159
|
* The in-flight arm — the one spelling of "not completed/aborted" every
|
|
5598
5160
|
* list surface's `includeCompleted` filter negates (the engine stamps
|
|
@@ -5712,6 +5274,12 @@ export declare type InsightSite =
|
|
|
5712
5274
|
activity?: string;
|
|
5713
5275
|
};
|
|
5714
5276
|
|
|
5277
|
+
/** Viewer-scoped assignment counts across active activities in the open stage. */
|
|
5278
|
+
export declare function instanceAssignmentStateCounts(
|
|
5279
|
+
instance: AssignmentInstance,
|
|
5280
|
+
identity: AssignmentIdentity,
|
|
5281
|
+
): AssignmentStateCounts;
|
|
5282
|
+
|
|
5715
5283
|
/**
|
|
5716
5284
|
* The tag's instance partition as a listen filter — the one shared change
|
|
5717
5285
|
* feed a preview store keeps itself fresh from (an event names the touched
|
|
@@ -5725,9 +5293,9 @@ export declare function instanceChangesQuery(args: {
|
|
|
5725
5293
|
|
|
5726
5294
|
/**
|
|
5727
5295
|
* Mint the Sanity document `_id` for a workflow instance — a fresh
|
|
5728
|
-
*
|
|
5296
|
+
* random suffix, so every instance (root or spawned child) gets a
|
|
5729
5297
|
* unique doc id under its tag. Lives in the shell, not `core/`, because it
|
|
5730
|
-
* draws randomness; the deterministic
|
|
5298
|
+
* draws randomness; the deterministic `definitionDocId` is the pure-core
|
|
5731
5299
|
* counterpart. Bare form — Sanity rejects `:` in document IDs, so this is
|
|
5732
5300
|
* never a GDR URI.
|
|
5733
5301
|
*/
|
|
@@ -5745,7 +5313,7 @@ export declare function instanceDocId(tag: string): string;
|
|
|
5745
5313
|
*/
|
|
5746
5314
|
export declare function instanceGuardQuery(instanceId: string): CompiledQuery;
|
|
5747
5315
|
|
|
5748
|
-
declare interface InstanceGuardsQueryArgs {
|
|
5316
|
+
export declare interface InstanceGuardsQueryArgs {
|
|
5749
5317
|
client: WorkflowClient;
|
|
5750
5318
|
clientForGdr: ClientForGdr;
|
|
5751
5319
|
instance: WorkflowInstance;
|
|
@@ -5822,8 +5390,9 @@ export declare interface InstanceSession {
|
|
|
5822
5390
|
/** Best-effort projection against the held content + held guards. The first
|
|
5823
5391
|
* call resolves the caller's identity/grants from the client's token over
|
|
5824
5392
|
* the network (cached per client) — plus each foreign subject resource's
|
|
5825
|
-
* grants through its own client, for the subject-write forecast
|
|
5826
|
-
*
|
|
5393
|
+
* grants through its own client, for the subject-write forecast. The held
|
|
5394
|
+
* snapshot is not refetched; a guard predicate using `->` reads its target
|
|
5395
|
+
* through the bound engine client. */
|
|
5827
5396
|
evaluate(): Promise<WorkflowEvaluation>;
|
|
5828
5397
|
/** Advance the instance against the held content: cascade auto-transitions,
|
|
5829
5398
|
* deploy guards, queue effects, commit with `ifRevisionId`. */
|
|
@@ -5930,6 +5499,14 @@ export declare interface InstancesQueryFilter {
|
|
|
5930
5499
|
definition?: string;
|
|
5931
5500
|
/** Current stage name. */
|
|
5932
5501
|
stage?: string;
|
|
5502
|
+
/** Current viewer assignment filter. `unrouted` needs no identity match;
|
|
5503
|
+
* `routed` matches literal role members only while no user holds the
|
|
5504
|
+
* activity; `held` matches the direct user and shadows every role. */
|
|
5505
|
+
assignment?: {
|
|
5506
|
+
userId: string;
|
|
5507
|
+
roles?: readonly string[] | undefined;
|
|
5508
|
+
states?: readonly AssignmentState[] | undefined;
|
|
5509
|
+
};
|
|
5933
5510
|
/** Include completed/aborted instances (default: in-flight only). */
|
|
5934
5511
|
includeCompleted?: boolean;
|
|
5935
5512
|
/**
|
|
@@ -5957,9 +5534,9 @@ export declare interface InstancesQueryFilter {
|
|
|
5957
5534
|
/**
|
|
5958
5535
|
* Whether {@link document} is in {@link instance}'s reactive watch-set — the
|
|
5959
5536
|
* reverse of {@link subscriptionDocumentsForInstance}. Both derive from
|
|
5960
|
-
*
|
|
5537
|
+
* the shared watch-ref collector, the single source of truth, so "which docs does
|
|
5961
5538
|
* this instance watch" and "which instances watch this doc" stay in lockstep
|
|
5962
|
-
* — the same way
|
|
5539
|
+
* — the same way `hydrateSnapshot`'s load-set does. Matching is on the
|
|
5963
5540
|
* resource-qualified GDR URI, so a cross-dataset subject (`dataset:A:ds:doc`)
|
|
5964
5541
|
* never matches a same-id doc in another resource (`dataset:B:ds:doc`).
|
|
5965
5542
|
*
|
|
@@ -6190,6 +5767,9 @@ export declare function lakeGuardId(args: {
|
|
|
6190
5767
|
guardName: string;
|
|
6191
5768
|
}): string;
|
|
6192
5769
|
|
|
5770
|
+
/** The write operations Content Lake exposes to mutation guards. */
|
|
5771
|
+
export declare type LakeMutationGuardAction = "create" | "update" | "delete";
|
|
5772
|
+
|
|
6193
5773
|
/**
|
|
6194
5774
|
* The one rule every lake-facing identity check (guard previews/pre-flights, `$can` grant filters)
|
|
6195
5775
|
* must resolve through to agree with the lake's own `identity()`; binding `actor.id` directly at a
|
|
@@ -6248,6 +5828,7 @@ export declare function lintEffectOutputs(
|
|
|
6248
5828
|
definition: WorkflowDefinition,
|
|
6249
5829
|
): string[];
|
|
6250
5830
|
|
|
5831
|
+
/** @inline */
|
|
6251
5832
|
declare type LiteralExpr = {
|
|
6252
5833
|
type: "literal";
|
|
6253
5834
|
value: unknown;
|
|
@@ -6275,9 +5856,15 @@ export declare interface LogicalRef {
|
|
|
6275
5856
|
* reference whose resolved document the consumer opens; deploy checks the
|
|
6276
5857
|
* `field` variant points at a doc-valued entry.
|
|
6277
5858
|
*/
|
|
6278
|
-
export declare type ManualTarget =
|
|
6279
|
-
|
|
6280
|
-
|
|
5859
|
+
export declare type ManualTarget =
|
|
5860
|
+
| {
|
|
5861
|
+
type: "url";
|
|
5862
|
+
url: string;
|
|
5863
|
+
}
|
|
5864
|
+
| {
|
|
5865
|
+
type: "field";
|
|
5866
|
+
field: StoredFieldRef;
|
|
5867
|
+
};
|
|
6281
5868
|
|
|
6282
5869
|
/** Returns true iff `document` survives `filter`'s GROQ predicate under the supplied identity. */
|
|
6283
5870
|
declare function matchesFilter(args: {
|
|
@@ -6314,7 +5901,7 @@ export declare interface MissingHandlerDrainInfo {
|
|
|
6314
5901
|
}
|
|
6315
5902
|
|
|
6316
5903
|
/**
|
|
6317
|
-
* The `missingHandler: 'fail'` policy tripped: an effect names a handler the
|
|
5904
|
+
* The `effects.missingHandler: 'fail'` policy tripped: an effect names a handler the
|
|
6318
5905
|
* runtime never registered. `info` carries the phase-specific location
|
|
6319
5906
|
* (deploy verification vs a drain attempt) so the runtime that opted into
|
|
6320
5907
|
* failing can report exactly which handler is missing where.
|
|
@@ -6339,9 +5926,9 @@ export declare type MissingHandlerPolicy =
|
|
|
6339
5926
|
* required when it is `required` AND `input`-sourced (the only combination
|
|
6340
5927
|
* deploy admits), and as provided when a supplied value matches its name AND
|
|
6341
5928
|
* kind with a real (non-null) value. Keys on the same name+type as the input
|
|
6342
|
-
* read
|
|
5929
|
+
* read during input resolution, but is stricter: a present-but-null/
|
|
6343
5930
|
* undefined value counts as absent here (a required field needs a real
|
|
6344
|
-
* value), whereas
|
|
5931
|
+
* value), whereas input resolution passes a null fill straight
|
|
6345
5932
|
* through. Exported so pre-flight validators (e.g. mapping validation) share
|
|
6346
5933
|
* the engine's own rule instead of mirroring it.
|
|
6347
5934
|
*/
|
|
@@ -6373,15 +5960,6 @@ export declare class ModelVersionAheadError extends WorkflowError<"model-version
|
|
|
6373
5960
|
/** A document with no stamp, or a non-number stamp (foreign data this engine never wrote), reads as model 0. */
|
|
6374
5961
|
export declare function modelVersionOf(doc: object): number;
|
|
6375
5962
|
|
|
6376
|
-
/** The lake operations a guard can gate — see the guard types in ./authorization.ts. */
|
|
6377
|
-
declare const MUTATION_GUARD_ACTIONS: readonly [
|
|
6378
|
-
"create",
|
|
6379
|
-
"update",
|
|
6380
|
-
"delete",
|
|
6381
|
-
"publish",
|
|
6382
|
-
"unpublish",
|
|
6383
|
-
];
|
|
6384
|
-
|
|
6385
5963
|
/**
|
|
6386
5964
|
* Inputs to predicate evaluation: the delta-mode natives `before()`/`after()`,
|
|
6387
5965
|
* the `mutation`, the `guard`, and `identity()`. `before` is null on create,
|
|
@@ -6400,7 +5978,7 @@ export declare interface MutationContext {
|
|
|
6400
5978
|
_type: string;
|
|
6401
5979
|
} & Record<string, unknown>)
|
|
6402
5980
|
| null;
|
|
6403
|
-
action:
|
|
5981
|
+
action: LakeMutationGuardAction;
|
|
6404
5982
|
/**
|
|
6405
5983
|
* The caller's principal id in the guarded resource's own namespace
|
|
6406
5984
|
* (what that lake's `identity()` returns), resolved as `identity()` in
|
|
@@ -6410,8 +5988,11 @@ export declare interface MutationContext {
|
|
|
6410
5988
|
identity?: string;
|
|
6411
5989
|
}
|
|
6412
5990
|
|
|
5991
|
+
/** Lake operations plus the authored lifecycle actions the compiler translates. */
|
|
6413
5992
|
export declare type MutationGuardAction =
|
|
6414
|
-
|
|
5993
|
+
| LakeMutationGuardAction
|
|
5994
|
+
| "publish"
|
|
5995
|
+
| "unpublish";
|
|
6415
5996
|
|
|
6416
5997
|
/**
|
|
6417
5998
|
* The persisted body of a mutation guard — every field except the lake system
|
|
@@ -6444,7 +6025,11 @@ export declare interface MutationGuardBody {
|
|
|
6444
6025
|
description?: string;
|
|
6445
6026
|
/** Bare document ids (resource-local; both published and `drafts.` forms). */
|
|
6446
6027
|
match: MutationGuardMatch;
|
|
6447
|
-
/**
|
|
6028
|
+
/**
|
|
6029
|
+
* Lake delta-mode GROQ. The root exposes `document.before`,
|
|
6030
|
+
* `document.after`, `mutation`, and `guard`; `identity()` and resource-local
|
|
6031
|
+
* reference dereferencing are available. Empty string is unconditional deny.
|
|
6032
|
+
*/
|
|
6448
6033
|
predicate: string;
|
|
6449
6034
|
/** Caller-owned projected state the predicate reads as `guard.metadata.*`. */
|
|
6450
6035
|
metadata: Record<string, unknown>;
|
|
@@ -6483,7 +6068,7 @@ export declare class MutationGuardDeniedError extends WorkflowError<"mutation-gu
|
|
|
6483
6068
|
*/
|
|
6484
6069
|
static fromGuards(args: {
|
|
6485
6070
|
documentId: string;
|
|
6486
|
-
action:
|
|
6071
|
+
action: LakeMutationGuardAction;
|
|
6487
6072
|
guards: readonly MutationGuardDoc[];
|
|
6488
6073
|
}): MutationGuardDeniedError;
|
|
6489
6074
|
}
|
|
@@ -6541,15 +6126,20 @@ export declare interface NoteItem {
|
|
|
6541
6126
|
at?: string | null;
|
|
6542
6127
|
}
|
|
6543
6128
|
|
|
6544
|
-
/**
|
|
6545
|
-
* names match the `audit` op's stamp fields, so it pairs with it. Never a stored kind. */
|
|
6129
|
+
/** @inline */
|
|
6546
6130
|
declare type NotesField = FieldBase<AuthoringEditable, GroupMembership> & {
|
|
6547
6131
|
type: "notes";
|
|
6548
6132
|
};
|
|
6549
6133
|
|
|
6550
6134
|
/** A `field.updateWhere` / `field.removeWhere` op's `where` selects rows to
|
|
6551
6135
|
* mutate with rendered-scope GROQ (`$row`, `$params` bound) — row selection, not a gate; an unevaluable row never matches. */
|
|
6552
|
-
export declare type Op =
|
|
6136
|
+
export declare type Op =
|
|
6137
|
+
| FieldOp
|
|
6138
|
+
| {
|
|
6139
|
+
type: "status.set";
|
|
6140
|
+
activity: string;
|
|
6141
|
+
status: ActivityStatus;
|
|
6142
|
+
};
|
|
6553
6143
|
|
|
6554
6144
|
/**
|
|
6555
6145
|
* Op `type` discriminators — the stored mutation primitives.
|
|
@@ -6602,6 +6192,11 @@ export declare interface OpAppliedSummary {
|
|
|
6602
6192
|
resolved?: Record<string, unknown>;
|
|
6603
6193
|
}
|
|
6604
6194
|
|
|
6195
|
+
/** Assignment members for each active activity in the instance's open stage. */
|
|
6196
|
+
export declare function openActivityAssignments(
|
|
6197
|
+
instance: AssignmentInstance,
|
|
6198
|
+
): readonly (readonly Assignee[])[];
|
|
6199
|
+
|
|
6605
6200
|
export declare interface OperationArgs {
|
|
6606
6201
|
instanceId: string;
|
|
6607
6202
|
/**
|
|
@@ -6612,9 +6207,10 @@ export declare interface OperationArgs {
|
|
|
6612
6207
|
|
|
6613
6208
|
/**
|
|
6614
6209
|
* What a state-changing verb reports back. Every mutating verb —
|
|
6615
|
-
* `startInstance`, `fireAction`, `editField`, `completeEffect`,
|
|
6616
|
-
* `setStage`, `abortInstance` —
|
|
6617
|
-
* the `Engine`, and the reactive
|
|
6210
|
+
* `startInstance`, `fireAction`, `editField`, `completeEffect`,
|
|
6211
|
+
* `commitEffectOps`, `tick`, `setStage`, `abortInstance`, `resetActivity` —
|
|
6212
|
+
* returns this one shape, on the namespace, the `Engine`, and the reactive
|
|
6213
|
+
* session alike.
|
|
6618
6214
|
*/
|
|
6619
6215
|
export declare interface OperationResult {
|
|
6620
6216
|
/** The instance after the operation + all cascading auto-transitions. */
|
|
@@ -6634,6 +6230,14 @@ export declare interface OperationResult {
|
|
|
6634
6230
|
* during the action commit. Surfaced for caller-side assertions and
|
|
6635
6231
|
* audit. */
|
|
6636
6232
|
ranOps?: OpAppliedSummary[];
|
|
6233
|
+
/**
|
|
6234
|
+
* The nearest future instant (ISO 8601) at which the clock alone changes what
|
|
6235
|
+
* the instance evaluates to; schedule the next `tick` for it. Derived per
|
|
6236
|
+
* call, never persisted. Absent on a terminal instance, when no site yields a
|
|
6237
|
+
* boundary from the instance's values, and for a gate reading `$now` beside a
|
|
6238
|
+
* caller variable, which {@link WorkflowEvaluation.nextEvaluationAt} carries.
|
|
6239
|
+
*/
|
|
6240
|
+
nextEvaluationAt?: string;
|
|
6637
6241
|
}
|
|
6638
6242
|
|
|
6639
6243
|
export { OUTCOME_MARKS };
|
|
@@ -6725,7 +6329,7 @@ export declare function parseResourceGdr(uri: string): WorkflowResource;
|
|
|
6725
6329
|
/**
|
|
6726
6330
|
* A stage's multi-guard deploy failed *after* at least one guard already landed.
|
|
6727
6331
|
* Those partial locks can't be cleanly undone (guard docs have no transactional
|
|
6728
|
-
* deploy). Inside the engine
|
|
6332
|
+
* deploy). Inside the engine `deployOrRollback` rolls the state move back
|
|
6729
6333
|
* and escalates this to a loud {@link WorkflowStateDivergedError}; a caller that
|
|
6730
6334
|
* invokes {@link deployStageGuards} directly (without that rollback wrapper) can
|
|
6731
6335
|
* also see it, so it's exported to be catchable by type.
|
|
@@ -6733,7 +6337,14 @@ export declare function parseResourceGdr(uri: string): WorkflowResource;
|
|
|
6733
6337
|
export declare class PartialGuardDeployError extends WorkflowError<"partial-guard-deploy"> {
|
|
6734
6338
|
readonly stageName: string;
|
|
6735
6339
|
readonly deployed: number;
|
|
6736
|
-
|
|
6340
|
+
/** The cleanup failure, when newly created guards could not be retracted. */
|
|
6341
|
+
readonly rollbackError?: unknown;
|
|
6342
|
+
constructor(args: {
|
|
6343
|
+
stageName: string;
|
|
6344
|
+
deployed: number;
|
|
6345
|
+
cause: unknown;
|
|
6346
|
+
rollbackError?: unknown;
|
|
6347
|
+
});
|
|
6737
6348
|
}
|
|
6738
6349
|
|
|
6739
6350
|
export declare interface PendingEffect {
|
|
@@ -6913,8 +6524,8 @@ export declare function projectStartSliceRow(
|
|
|
6913
6524
|
* representation's stored id rides along as `_originalId` — session-side
|
|
6914
6525
|
* conditions (including the `_originalId in path("versions.**")` shape) then
|
|
6915
6526
|
* read the same projected identity as the engine's perspective-aware hydration.
|
|
6916
|
-
* Strict by construction: only
|
|
6917
|
-
*
|
|
6527
|
+
* Strict by construction: only a canonical watch-reference representation is
|
|
6528
|
+
* accepted — an id that merely *ends* in
|
|
6918
6529
|
* the watched id (another doc's dotted id under a version prefix), a release
|
|
6919
6530
|
* the perspective doesn't read, or a draft the perspective makes invisible is
|
|
6920
6531
|
* a store routing bug, and projecting it would make content the engine's read
|
|
@@ -6964,8 +6575,8 @@ export declare class ReaderModelAcknowledgementError extends WorkflowError<"read
|
|
|
6964
6575
|
readonly expectedMinReaderModel: unknown;
|
|
6965
6576
|
readonly requiredMinReaderModel: number;
|
|
6966
6577
|
readonly engineMinReaderModel = 4;
|
|
6967
|
-
readonly engineMaxReaderModel =
|
|
6968
|
-
readonly engineModelVersion =
|
|
6578
|
+
readonly engineMaxReaderModel = 9;
|
|
6579
|
+
readonly engineModelVersion = 9;
|
|
6969
6580
|
readonly documentationUrl = "https://www.sanity.io/docs/workflows/prerelease";
|
|
6970
6581
|
constructor(
|
|
6971
6582
|
expectedMinReaderModel: unknown,
|
|
@@ -6997,7 +6608,7 @@ export declare function readInstancePreviewDoc(
|
|
|
6997
6608
|
* perspective; everything else is content and resolves to its
|
|
6998
6609
|
* version/draft/published form. This is the single encoding of the rule
|
|
6999
6610
|
* the {@link WatchSet} `perspective` contract describes to consumers, and
|
|
7000
|
-
* the rule
|
|
6611
|
+
* the rule `hydrateSnapshot` applies on the fetch side.
|
|
7001
6612
|
*/
|
|
7002
6613
|
export declare function readsRaw(ref: { type: string }): boolean;
|
|
7003
6614
|
|
|
@@ -7122,7 +6733,7 @@ export declare function releaseRef({
|
|
|
7122
6733
|
* half. Empty unless the instance is `stuck`: a `waiting` instance advances on
|
|
7123
6734
|
* its own next action (see `availableActions`), and terminal or `progressing`
|
|
7124
6735
|
* ones need nothing. Each verb is flagged
|
|
7125
|
-
* {@link SuggestedRemediation.available} from
|
|
6736
|
+
* {@link SuggestedRemediation.available} from the runnable-verb vocabulary.
|
|
7126
6737
|
*/
|
|
7127
6738
|
export declare function remediationsFor(
|
|
7128
6739
|
diagnosis: Diagnosis,
|
|
@@ -7180,6 +6791,7 @@ export declare function requiredReaderModel(
|
|
|
7180
6791
|
document: unknown,
|
|
7181
6792
|
): number;
|
|
7182
6793
|
|
|
6794
|
+
/** @inline */
|
|
7183
6795
|
declare type RequirementBase = {
|
|
7184
6796
|
name: string;
|
|
7185
6797
|
title?: string | undefined;
|
|
@@ -7201,8 +6813,6 @@ export declare interface RequirementDescriptor {
|
|
|
7201
6813
|
*/
|
|
7202
6814
|
export declare const RESERVED_CONDITION_VARS: readonly string[];
|
|
7203
6815
|
|
|
7204
|
-
declare const RESET_ACTIVITY_TARGETS: readonly ["active", "skipped"];
|
|
7205
|
-
|
|
7206
6816
|
export declare interface ResetActivityArgs extends DedupableOperationArgs {
|
|
7207
6817
|
/** Name of the activity to reset, within the instance's current stage. */
|
|
7208
6818
|
activity: string;
|
|
@@ -7236,8 +6846,7 @@ export declare type ResetActivityResult =
|
|
|
7236
6846
|
* fire). `done` is deliberately absent: a reset is recovery, not a silent
|
|
7237
6847
|
* declaration that the work succeeded.
|
|
7238
6848
|
*/
|
|
7239
|
-
export declare type ResetActivityTarget =
|
|
7240
|
-
(typeof RESET_ACTIVITY_TARGETS)[number];
|
|
6849
|
+
export declare type ResetActivityTarget = "active" | "skipped";
|
|
7241
6850
|
|
|
7242
6851
|
/**
|
|
7243
6852
|
* Resolve the engine's `WorkflowAccess` for a client — actor and grants
|
|
@@ -7279,6 +6888,12 @@ export declare interface ResolveClientActorArgs {
|
|
|
7279
6888
|
readonly projectId: string;
|
|
7280
6889
|
}
|
|
7281
6890
|
|
|
6891
|
+
/** {@link EngineEffectsArgs} after the engine applied its defaults. */
|
|
6892
|
+
export declare interface ResolvedEngineEffects {
|
|
6893
|
+
readonly handlers: Readonly<Record<string, EffectHandler>>;
|
|
6894
|
+
readonly missingHandler: MissingHandlerPolicy;
|
|
6895
|
+
}
|
|
6896
|
+
|
|
7282
6897
|
/**
|
|
7283
6898
|
* A resolved field entry as the engine persists it on an instance.
|
|
7284
6899
|
* Discriminated by `_type` (bare — unique within this union); the `value`
|
|
@@ -7398,7 +7013,7 @@ export declare function resourceFromParsed(parsed: ParsedGdr): WorkflowResource;
|
|
|
7398
7013
|
export declare function resourceGdr(res: WorkflowResource): string;
|
|
7399
7014
|
|
|
7400
7015
|
/** Args for the single-resource ref constructors ({@link refCanvas}, {@link refMediaLibrary}, {@link refDashboard}). */
|
|
7401
|
-
declare interface ResourceRefArgs<TType extends string> {
|
|
7016
|
+
export declare interface ResourceRefArgs<TType extends string> {
|
|
7402
7017
|
resourceId: string;
|
|
7403
7018
|
documentId: string;
|
|
7404
7019
|
type: TType;
|
|
@@ -7436,35 +7051,7 @@ export declare function retractStageGuards(args: StageGuardArgs): Promise<void>;
|
|
|
7436
7051
|
* literal ownership values and are not widened by this map. The authored `"*"`
|
|
7437
7052
|
* key lists universal fulfillers and is normalized before persistence.
|
|
7438
7053
|
*/
|
|
7439
|
-
export declare type RoleAliases =
|
|
7440
|
-
|
|
7441
|
-
declare const RoleAliasesSchema: v.RecordSchema<
|
|
7442
|
-
v.SchemaWithPipe<
|
|
7443
|
-
readonly [
|
|
7444
|
-
v.StringSchema<undefined>,
|
|
7445
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
7446
|
-
]
|
|
7447
|
-
>,
|
|
7448
|
-
v.SchemaWithPipe<
|
|
7449
|
-
readonly [
|
|
7450
|
-
v.ArraySchema<
|
|
7451
|
-
v.SchemaWithPipe<
|
|
7452
|
-
readonly [
|
|
7453
|
-
v.StringSchema<undefined>,
|
|
7454
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
7455
|
-
]
|
|
7456
|
-
>,
|
|
7457
|
-
undefined
|
|
7458
|
-
>,
|
|
7459
|
-
v.MinLengthAction<
|
|
7460
|
-
string[],
|
|
7461
|
-
1,
|
|
7462
|
-
"a role alias must list at least one fulfilling role"
|
|
7463
|
-
>,
|
|
7464
|
-
]
|
|
7465
|
-
>,
|
|
7466
|
-
undefined
|
|
7467
|
-
>;
|
|
7054
|
+
export declare type RoleAliases = Record<string, string[]>;
|
|
7468
7055
|
|
|
7469
7056
|
/** Whether two workflow resources address the same place. */
|
|
7470
7057
|
export declare function sameResource(
|
|
@@ -7584,6 +7171,12 @@ export declare interface SiteConsequence {
|
|
|
7584
7171
|
after: ConditionOutcome;
|
|
7585
7172
|
}
|
|
7586
7173
|
|
|
7174
|
+
/** Pure resource-local dereferencing for held snapshot evaluation. */
|
|
7175
|
+
export declare function snapshotGuardDereference(args: {
|
|
7176
|
+
snapshot: HydratedSnapshot;
|
|
7177
|
+
resource: WorkflowResource;
|
|
7178
|
+
}): GuardDereference;
|
|
7179
|
+
|
|
7587
7180
|
/** One statically invalid parent-to-child spawn contract found at deploy. */
|
|
7588
7181
|
export declare type SpawnContractIssue =
|
|
7589
7182
|
| {
|
|
@@ -7616,6 +7209,8 @@ export declare class SpawnContractsInvalidError extends WorkflowError<"spawn-con
|
|
|
7616
7209
|
* own `editable` is the ceiling, ANDed with the stage value at runtime, so an
|
|
7617
7210
|
* override can only NARROW — never open a field the baseline left closed. An
|
|
7618
7211
|
* unlisted field inherits its baseline.
|
|
7212
|
+
*
|
|
7213
|
+
* @interface
|
|
7619
7214
|
*/
|
|
7620
7215
|
export declare type Stage = StageFields<
|
|
7621
7216
|
FieldEntry,
|
|
@@ -7662,7 +7257,7 @@ export declare interface StageEvaluation {
|
|
|
7662
7257
|
autonomy: StageAutonomy;
|
|
7663
7258
|
}
|
|
7664
7259
|
|
|
7665
|
-
/**
|
|
7260
|
+
/** @inline */
|
|
7666
7261
|
declare type StageFields<TField, TActivity, TTransition, TGuard, TEditable> = {
|
|
7667
7262
|
name: string;
|
|
7668
7263
|
semantics?: Semantic[] | undefined;
|
|
@@ -7676,7 +7271,7 @@ declare type StageFields<TField, TActivity, TTransition, TGuard, TEditable> = {
|
|
|
7676
7271
|
editable?: Record<string, TEditable> | undefined;
|
|
7677
7272
|
};
|
|
7678
7273
|
|
|
7679
|
-
declare interface StageGuardArgs {
|
|
7274
|
+
export declare interface StageGuardArgs {
|
|
7680
7275
|
client: WorkflowClient;
|
|
7681
7276
|
clientForGdr: ClientForGdr;
|
|
7682
7277
|
instance: WorkflowInstance;
|
|
@@ -7737,8 +7332,6 @@ export declare const START_FILTER_VARS: readonly {
|
|
|
7737
7332
|
description: string;
|
|
7738
7333
|
}[];
|
|
7739
7334
|
|
|
7740
|
-
declare const START_KINDS: readonly ["interactive", "autonomous"];
|
|
7741
|
-
|
|
7742
7335
|
/**
|
|
7743
7336
|
* The vars a definition's start GROQ requirements read — the start-time readiness
|
|
7744
7337
|
* dialect: everything the filter context binds ({@link START_FILTER_VARS})
|
|
@@ -7828,6 +7421,7 @@ export declare interface StartEvaluation {
|
|
|
7828
7421
|
invalidInitialFields: InitialFieldIssue[];
|
|
7829
7422
|
}
|
|
7830
7423
|
|
|
7424
|
+
/** @inline */
|
|
7831
7425
|
declare type StartFields = {
|
|
7832
7426
|
filter?: string | undefined;
|
|
7833
7427
|
requirements?: StartRequirement[] | undefined;
|
|
@@ -7836,7 +7430,7 @@ declare type StartFields = {
|
|
|
7836
7430
|
/**
|
|
7837
7431
|
* Project caller-supplied `initialFields` into the `$fields` map the
|
|
7838
7432
|
* start-requirement context binds: one key per declared `input`-sourced entry,
|
|
7839
|
-
* resolved through
|
|
7433
|
+
* resolved through the supplied-field lookup — the predicate can only ever see
|
|
7840
7434
|
* a value the input resolution would persist, and an undeclared supplied name
|
|
7841
7435
|
* never leaks in. Unsupplied (or null-supplied) entries stay unbound, so a
|
|
7842
7436
|
* read of one is GROQ null. Document references bind as their GDR envelopes
|
|
@@ -7926,7 +7520,7 @@ export declare interface StartInstanceArgs {
|
|
|
7926
7520
|
* path for every kind, and an interactive start of an autonomous workflow is
|
|
7927
7521
|
* legal.
|
|
7928
7522
|
*/
|
|
7929
|
-
export declare type StartKind =
|
|
7523
|
+
export declare type StartKind = "interactive" | "autonomous";
|
|
7930
7524
|
|
|
7931
7525
|
/**
|
|
7932
7526
|
* The declared {@link StartKind} of a definition, defaulting the absent
|
|
@@ -7953,325 +7547,108 @@ export declare function startKindOf(definition: {
|
|
|
7953
7547
|
*/
|
|
7954
7548
|
export declare class StartNotAllowedError extends WorkflowError<"start-not-allowed"> {
|
|
7955
7549
|
readonly definition: string;
|
|
7956
|
-
readonly unmetRequirements: RequirementDescriptor[];
|
|
7957
|
-
constructor(args: {
|
|
7958
|
-
definition: string;
|
|
7959
|
-
unmetRequirements: RequirementDescriptor[];
|
|
7960
|
-
});
|
|
7961
|
-
}
|
|
7962
|
-
|
|
7963
|
-
/**
|
|
7964
|
-
* Thrown when a start fails AFTER its create committed but BEFORE priming:
|
|
7965
|
-
* the instance document exists, unprimed (see {@link isUnprimed}) — a
|
|
7966
|
-
* genuinely failed start, but a RESUMABLE one. The error names the id so
|
|
7967
|
-
* every surface's failure message can point at the retry rail: retrying
|
|
7968
|
-
* `startInstance` with this `instanceId` finishes the start instead of
|
|
7969
|
-
* creating a duplicate; aborting the instance discards it.
|
|
7970
|
-
*/
|
|
7971
|
-
export declare class StartNotPrimedError extends WorkflowError<"start-not-primed"> {
|
|
7972
|
-
readonly instanceId: string;
|
|
7973
|
-
constructor(args: { instanceId: string; cause: unknown });
|
|
7974
|
-
}
|
|
7975
|
-
|
|
7976
|
-
/**
|
|
7977
|
-
* Thrown when a start's first cascade fails AFTER the instance was created
|
|
7978
|
-
* and primed: the run exists — stage entered, activities active, guards
|
|
7979
|
-
* deployed — it just hasn't auto-advanced to a stable stage yet. Callers
|
|
7980
|
-
* must not present this as a failed start: the workflow IS running, and a
|
|
7981
|
-
* `tick` (or retrying `startInstance` with the same `instanceId`) resumes
|
|
7982
|
-
* the settling.
|
|
7983
|
-
*/
|
|
7984
|
-
export declare class StartNotSettledError extends WorkflowError<"start-not-settled"> {
|
|
7985
|
-
readonly instanceId: string;
|
|
7986
|
-
/** The primed instance re-read after the cascade failure — absent when
|
|
7987
|
-
* that best-effort read also failed. */
|
|
7988
|
-
readonly instance?: WorkflowInstance;
|
|
7989
|
-
constructor(args: {
|
|
7990
|
-
instanceId: string;
|
|
7991
|
-
instance?: WorkflowInstance;
|
|
7992
|
-
cause: unknown;
|
|
7993
|
-
});
|
|
7994
|
-
}
|
|
7995
|
-
|
|
7996
|
-
/** Advisory only, per {@link isStartableDefinition} — a start surface has no parent context to give a spawn-only child, so it rejects fast with this message instead. */
|
|
7997
|
-
export declare function startRefusal(definition: {
|
|
7998
|
-
lifecycle?: WorkflowLifecycle | undefined;
|
|
7999
|
-
}): string | undefined;
|
|
8000
|
-
|
|
8001
|
-
/** Every named readiness requirement accepted by workflow `start.requirements`. */
|
|
8002
|
-
export declare type StartRequirement =
|
|
8003
|
-
| GroqRequirement
|
|
8004
|
-
| SingleSubjectRequirement;
|
|
8005
|
-
|
|
8006
|
-
export declare interface StartRequirementEvaluation extends RequirementDescriptor {
|
|
8007
|
-
/** Whether this requirement is satisfied, unsatisfied, or not yet decidable. */
|
|
8008
|
-
outcome: ConditionOutcome;
|
|
8009
|
-
/** GROQ explanation; absent for non-GROQ requirement kinds. */
|
|
8010
|
-
insight?: ConditionInsight | undefined;
|
|
8011
|
-
}
|
|
8012
|
-
|
|
8013
|
-
/**
|
|
8014
|
-
* The caller-side half of the start contexts — everything the evaluating
|
|
8015
|
-
* surface knows that the definition doesn't. Every member is optional
|
|
8016
|
-
* because the surfaces genuinely differ (a pure consumer may hold no clock):
|
|
8017
|
-
* An absent binding evaluates each read of it to GROQ null, and where that
|
|
8018
|
-
* null lands decides the verdict — a predicate that can't decide without
|
|
8019
|
-
* the binding fails closed, while a count-of-matches clause over values
|
|
8020
|
-
* every row stores passes vacuously (in GROQ null equals only null, so the
|
|
8021
|
-
* unbound read matches no stored value). The vars themselves are
|
|
8022
|
-
* inventoried in `START_FILTER_VARS` / `START_REQUIREMENT_VARS`; the caller's
|
|
8023
|
-
* `$fields` map is NOT scope — `start.filter` never binds it, and
|
|
8024
|
-
* `explainStartRequirement` takes it as its own argument.
|
|
8025
|
-
*/
|
|
8026
|
-
export declare interface StartScope {
|
|
8027
|
-
/** The engine's tag partition — binds `$tag`. */
|
|
8028
|
-
tag?: string | undefined;
|
|
8029
|
-
/** ISO clock reading — binds `$now`. */
|
|
8030
|
-
now?: string | undefined;
|
|
8031
|
-
/** Resource-qualified identity of the prospective subject. Unlike a loaded
|
|
8032
|
-
* document's bare `_id`, this stays collision-free across resources. */
|
|
8033
|
-
subject?: GdrUri | undefined;
|
|
8034
|
-
/**
|
|
8035
|
-
* The engine-owned start slice, for predicates that read `*[...]` or for a
|
|
8036
|
-
* `singleSubject` requirement — invoked lazily only when evaluation needs it.
|
|
8037
|
-
* Each row exposes exactly `{definition, subject, completedAt}`; completed
|
|
8038
|
-
* rows are included, so authors qualify in-flight
|
|
8039
|
-
* themselves (`!defined(completedAt)`). Absent ⇒ a dataset-reading filter
|
|
8040
|
-
* fails closed (this surface cannot see the dataset, so it cannot decide),
|
|
8041
|
-
* while a dataset-reading requirement THROWS — see
|
|
8042
|
-
* {@link explainStartRequirement}.
|
|
8043
|
-
*/
|
|
8044
|
-
fetchDataset?: (() => Promise<unknown[]>) | undefined;
|
|
8045
|
-
}
|
|
8046
|
-
|
|
8047
|
-
export declare interface StartSliceRow {
|
|
8048
|
-
definition: string;
|
|
8049
|
-
subject: GdrUri | null;
|
|
8050
|
-
completedAt: string | null;
|
|
8051
|
-
}
|
|
8052
|
-
|
|
8053
|
-
declare const StoredEditableSchema: v.UnionSchema<
|
|
8054
|
-
[
|
|
8055
|
-
v.LiteralSchema<true, undefined>,
|
|
8056
|
-
v.SchemaWithPipe<
|
|
8057
|
-
readonly [
|
|
8058
|
-
v.StringSchema<undefined>,
|
|
8059
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8060
|
-
]
|
|
8061
|
-
>,
|
|
8062
|
-
],
|
|
8063
|
-
undefined
|
|
8064
|
-
>;
|
|
8065
|
-
|
|
8066
|
-
/**
|
|
8067
|
-
* The `field.*` subset — every mutation op EXCEPT `status.set`. Shared by the
|
|
8068
|
-
* boundaries that write fields but must not set an activity status: a transition
|
|
8069
|
-
* (its stage's activities are tearing down, so `status.set` has no coherent
|
|
8070
|
-
* target) and an effect's completion (an effect is OUTSIDE the activity's own
|
|
8071
|
-
* awaiting — it reports its result through fields, never by flipping a status;
|
|
8072
|
-
* the activity/stage gate then reads those fields). The full {@link StoredOpSchema}
|
|
8073
|
-
* (these plus `status.set`) is what actions and activity boundaries carry.
|
|
8074
|
-
*/
|
|
8075
|
-
declare const StoredFieldOpSchema: v.VariantSchema<
|
|
8076
|
-
"type",
|
|
8077
|
-
[
|
|
8078
|
-
v.StrictObjectSchema<
|
|
8079
|
-
{
|
|
8080
|
-
readonly type: v.LiteralSchema<"field.set", undefined>;
|
|
8081
|
-
readonly target: v.StrictObjectSchema<
|
|
8082
|
-
{
|
|
8083
|
-
readonly scope: v.PicklistSchema<
|
|
8084
|
-
readonly ["workflow", "stage", "activity"],
|
|
8085
|
-
string
|
|
8086
|
-
>;
|
|
8087
|
-
readonly field: v.SchemaWithPipe<
|
|
8088
|
-
readonly [
|
|
8089
|
-
v.StringSchema<undefined>,
|
|
8090
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8091
|
-
]
|
|
8092
|
-
>;
|
|
8093
|
-
},
|
|
8094
|
-
undefined
|
|
8095
|
-
>;
|
|
8096
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8097
|
-
},
|
|
8098
|
-
undefined
|
|
8099
|
-
>,
|
|
8100
|
-
v.StrictObjectSchema<
|
|
8101
|
-
{
|
|
8102
|
-
readonly type: v.LiteralSchema<"field.setIfMissing", undefined>;
|
|
8103
|
-
readonly target: v.StrictObjectSchema<
|
|
8104
|
-
{
|
|
8105
|
-
readonly scope: v.PicklistSchema<
|
|
8106
|
-
readonly ["workflow", "stage", "activity"],
|
|
8107
|
-
string
|
|
8108
|
-
>;
|
|
8109
|
-
readonly field: v.SchemaWithPipe<
|
|
8110
|
-
readonly [
|
|
8111
|
-
v.StringSchema<undefined>,
|
|
8112
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8113
|
-
]
|
|
8114
|
-
>;
|
|
8115
|
-
},
|
|
8116
|
-
undefined
|
|
8117
|
-
>;
|
|
8118
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8119
|
-
},
|
|
8120
|
-
undefined
|
|
8121
|
-
>,
|
|
8122
|
-
v.StrictObjectSchema<
|
|
8123
|
-
{
|
|
8124
|
-
readonly type: v.LiteralSchema<"field.unset", undefined>;
|
|
8125
|
-
readonly target: v.StrictObjectSchema<
|
|
8126
|
-
{
|
|
8127
|
-
readonly scope: v.PicklistSchema<
|
|
8128
|
-
readonly ["workflow", "stage", "activity"],
|
|
8129
|
-
string
|
|
8130
|
-
>;
|
|
8131
|
-
readonly field: v.SchemaWithPipe<
|
|
8132
|
-
readonly [
|
|
8133
|
-
v.StringSchema<undefined>,
|
|
8134
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8135
|
-
]
|
|
8136
|
-
>;
|
|
8137
|
-
},
|
|
8138
|
-
undefined
|
|
8139
|
-
>;
|
|
8140
|
-
},
|
|
8141
|
-
undefined
|
|
8142
|
-
>,
|
|
8143
|
-
v.StrictObjectSchema<
|
|
8144
|
-
{
|
|
8145
|
-
readonly type: v.LiteralSchema<"field.append", undefined>;
|
|
8146
|
-
readonly target: v.StrictObjectSchema<
|
|
8147
|
-
{
|
|
8148
|
-
readonly scope: v.PicklistSchema<
|
|
8149
|
-
readonly ["workflow", "stage", "activity"],
|
|
8150
|
-
string
|
|
8151
|
-
>;
|
|
8152
|
-
readonly field: v.SchemaWithPipe<
|
|
8153
|
-
readonly [
|
|
8154
|
-
v.StringSchema<undefined>,
|
|
8155
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8156
|
-
]
|
|
8157
|
-
>;
|
|
8158
|
-
},
|
|
8159
|
-
undefined
|
|
8160
|
-
>;
|
|
8161
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8162
|
-
},
|
|
8163
|
-
undefined
|
|
8164
|
-
>,
|
|
8165
|
-
v.StrictObjectSchema<
|
|
8166
|
-
{
|
|
8167
|
-
readonly type: v.LiteralSchema<"field.inc", undefined>;
|
|
8168
|
-
readonly target: v.StrictObjectSchema<
|
|
8169
|
-
{
|
|
8170
|
-
readonly scope: v.PicklistSchema<
|
|
8171
|
-
readonly ["workflow", "stage", "activity"],
|
|
8172
|
-
string
|
|
8173
|
-
>;
|
|
8174
|
-
readonly field: v.SchemaWithPipe<
|
|
8175
|
-
readonly [
|
|
8176
|
-
v.StringSchema<undefined>,
|
|
8177
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8178
|
-
]
|
|
8179
|
-
>;
|
|
8180
|
-
},
|
|
8181
|
-
undefined
|
|
8182
|
-
>;
|
|
8183
|
-
readonly value: v.OptionalSchema<
|
|
8184
|
-
v.GenericSchema<ValueExprInternal>,
|
|
8185
|
-
undefined
|
|
8186
|
-
>;
|
|
8187
|
-
},
|
|
8188
|
-
undefined
|
|
8189
|
-
>,
|
|
8190
|
-
v.StrictObjectSchema<
|
|
8191
|
-
{
|
|
8192
|
-
readonly type: v.LiteralSchema<"field.dec", undefined>;
|
|
8193
|
-
readonly target: v.StrictObjectSchema<
|
|
8194
|
-
{
|
|
8195
|
-
readonly scope: v.PicklistSchema<
|
|
8196
|
-
readonly ["workflow", "stage", "activity"],
|
|
8197
|
-
string
|
|
8198
|
-
>;
|
|
8199
|
-
readonly field: v.SchemaWithPipe<
|
|
8200
|
-
readonly [
|
|
8201
|
-
v.StringSchema<undefined>,
|
|
8202
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8203
|
-
]
|
|
8204
|
-
>;
|
|
8205
|
-
},
|
|
8206
|
-
undefined
|
|
8207
|
-
>;
|
|
8208
|
-
readonly value: v.OptionalSchema<
|
|
8209
|
-
v.GenericSchema<ValueExprInternal>,
|
|
8210
|
-
undefined
|
|
8211
|
-
>;
|
|
8212
|
-
},
|
|
8213
|
-
undefined
|
|
8214
|
-
>,
|
|
8215
|
-
v.StrictObjectSchema<
|
|
8216
|
-
{
|
|
8217
|
-
readonly type: v.LiteralSchema<"field.updateWhere", undefined>;
|
|
8218
|
-
readonly target: v.StrictObjectSchema<
|
|
8219
|
-
{
|
|
8220
|
-
readonly scope: v.PicklistSchema<
|
|
8221
|
-
readonly ["workflow", "stage", "activity"],
|
|
8222
|
-
string
|
|
8223
|
-
>;
|
|
8224
|
-
readonly field: v.SchemaWithPipe<
|
|
8225
|
-
readonly [
|
|
8226
|
-
v.StringSchema<undefined>,
|
|
8227
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8228
|
-
]
|
|
8229
|
-
>;
|
|
8230
|
-
},
|
|
8231
|
-
undefined
|
|
8232
|
-
>;
|
|
8233
|
-
readonly where: v.SchemaWithPipe<
|
|
8234
|
-
readonly [
|
|
8235
|
-
v.StringSchema<undefined>,
|
|
8236
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8237
|
-
]
|
|
8238
|
-
>;
|
|
8239
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8240
|
-
},
|
|
8241
|
-
undefined
|
|
8242
|
-
>,
|
|
8243
|
-
v.StrictObjectSchema<
|
|
8244
|
-
{
|
|
8245
|
-
readonly type: v.LiteralSchema<"field.removeWhere", undefined>;
|
|
8246
|
-
readonly target: v.StrictObjectSchema<
|
|
8247
|
-
{
|
|
8248
|
-
readonly scope: v.PicklistSchema<
|
|
8249
|
-
readonly ["workflow", "stage", "activity"],
|
|
8250
|
-
string
|
|
8251
|
-
>;
|
|
8252
|
-
readonly field: v.SchemaWithPipe<
|
|
8253
|
-
readonly [
|
|
8254
|
-
v.StringSchema<undefined>,
|
|
8255
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8256
|
-
]
|
|
8257
|
-
>;
|
|
8258
|
-
},
|
|
8259
|
-
undefined
|
|
8260
|
-
>;
|
|
8261
|
-
readonly where: v.SchemaWithPipe<
|
|
8262
|
-
readonly [
|
|
8263
|
-
v.StringSchema<undefined>,
|
|
8264
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8265
|
-
]
|
|
8266
|
-
>;
|
|
8267
|
-
},
|
|
8268
|
-
undefined
|
|
8269
|
-
>,
|
|
8270
|
-
],
|
|
8271
|
-
undefined
|
|
8272
|
-
>;
|
|
7550
|
+
readonly unmetRequirements: RequirementDescriptor[];
|
|
7551
|
+
constructor(args: {
|
|
7552
|
+
definition: string;
|
|
7553
|
+
unmetRequirements: RequirementDescriptor[];
|
|
7554
|
+
});
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
/**
|
|
7558
|
+
* Thrown when a start fails AFTER its create committed but BEFORE priming:
|
|
7559
|
+
* the instance document exists, unprimed (see {@link isUnprimed}) — a
|
|
7560
|
+
* genuinely failed start, but a RESUMABLE one. The error names the id so
|
|
7561
|
+
* every surface's failure message can point at the retry rail: retrying
|
|
7562
|
+
* `startInstance` with this `instanceId` finishes the start instead of
|
|
7563
|
+
* creating a duplicate; aborting the instance discards it.
|
|
7564
|
+
*/
|
|
7565
|
+
export declare class StartNotPrimedError extends WorkflowError<"start-not-primed"> {
|
|
7566
|
+
readonly instanceId: string;
|
|
7567
|
+
constructor(args: { instanceId: string; cause: unknown });
|
|
7568
|
+
}
|
|
7569
|
+
|
|
7570
|
+
/**
|
|
7571
|
+
* Thrown when a start's first cascade fails AFTER the instance was created
|
|
7572
|
+
* and primed: the run exists — stage entered, activities active, guards
|
|
7573
|
+
* deployed — it just hasn't auto-advanced to a stable stage yet. Callers
|
|
7574
|
+
* must not present this as a failed start: the workflow IS running, and a
|
|
7575
|
+
* `tick` (or retrying `startInstance` with the same `instanceId`) resumes
|
|
7576
|
+
* the settling.
|
|
7577
|
+
*/
|
|
7578
|
+
export declare class StartNotSettledError extends WorkflowError<"start-not-settled"> {
|
|
7579
|
+
readonly instanceId: string;
|
|
7580
|
+
/** The primed instance re-read after the cascade failure — absent when
|
|
7581
|
+
* that best-effort read also failed. */
|
|
7582
|
+
readonly instance?: WorkflowInstance;
|
|
7583
|
+
constructor(args: {
|
|
7584
|
+
instanceId: string;
|
|
7585
|
+
instance?: WorkflowInstance;
|
|
7586
|
+
cause: unknown;
|
|
7587
|
+
});
|
|
7588
|
+
}
|
|
7589
|
+
|
|
7590
|
+
/** Advisory only, per {@link isStartableDefinition} — a start surface has no parent context to give a spawn-only child, so it rejects fast with this message instead. */
|
|
7591
|
+
export declare function startRefusal(definition: {
|
|
7592
|
+
lifecycle?: WorkflowLifecycle | undefined;
|
|
7593
|
+
}): string | undefined;
|
|
7594
|
+
|
|
7595
|
+
/** Every named readiness requirement accepted by workflow `start.requirements`. */
|
|
7596
|
+
export declare type StartRequirement =
|
|
7597
|
+
| GroqRequirement
|
|
7598
|
+
| SingleSubjectRequirement;
|
|
7599
|
+
|
|
7600
|
+
export declare interface StartRequirementEvaluation extends RequirementDescriptor {
|
|
7601
|
+
/** Whether this requirement is satisfied, unsatisfied, or not yet decidable. */
|
|
7602
|
+
outcome: ConditionOutcome;
|
|
7603
|
+
/** GROQ explanation; absent for non-GROQ requirement kinds. */
|
|
7604
|
+
insight?: ConditionInsight | undefined;
|
|
7605
|
+
}
|
|
7606
|
+
|
|
7607
|
+
/**
|
|
7608
|
+
* The caller-side half of the start contexts — everything the evaluating
|
|
7609
|
+
* surface knows that the definition doesn't. Every member is optional
|
|
7610
|
+
* because the surfaces genuinely differ (a pure consumer may hold no clock):
|
|
7611
|
+
* An absent binding evaluates each read of it to GROQ null, and where that
|
|
7612
|
+
* null lands decides the verdict — a predicate that can't decide without
|
|
7613
|
+
* the binding fails closed, while a count-of-matches clause over values
|
|
7614
|
+
* every row stores passes vacuously (in GROQ null equals only null, so the
|
|
7615
|
+
* unbound read matches no stored value). The vars themselves are
|
|
7616
|
+
* inventoried in `START_FILTER_VARS` / `START_REQUIREMENT_VARS`; the caller's
|
|
7617
|
+
* `$fields` map is NOT scope — `start.filter` never binds it, and
|
|
7618
|
+
* `explainStartRequirement` takes it as its own argument.
|
|
7619
|
+
*/
|
|
7620
|
+
export declare interface StartScope {
|
|
7621
|
+
/** The engine's tag partition — binds `$tag`. */
|
|
7622
|
+
tag?: string | undefined;
|
|
7623
|
+
/** ISO clock reading — binds `$now`. */
|
|
7624
|
+
now?: string | undefined;
|
|
7625
|
+
/** Resource-qualified identity of the prospective subject. Unlike a loaded
|
|
7626
|
+
* document's bare `_id`, this stays collision-free across resources. */
|
|
7627
|
+
subject?: GdrUri | undefined;
|
|
7628
|
+
/**
|
|
7629
|
+
* The engine-owned start slice, for predicates that read `*[...]` or for a
|
|
7630
|
+
* `singleSubject` requirement — invoked lazily only when evaluation needs it.
|
|
7631
|
+
* Each row exposes exactly `{definition, subject, completedAt}`; completed
|
|
7632
|
+
* rows are included, so authors qualify in-flight
|
|
7633
|
+
* themselves (`!defined(completedAt)`). Absent ⇒ a dataset-reading filter
|
|
7634
|
+
* fails closed (this surface cannot see the dataset, so it cannot decide),
|
|
7635
|
+
* while a dataset-reading requirement THROWS — see
|
|
7636
|
+
* {@link explainStartRequirement}.
|
|
7637
|
+
*/
|
|
7638
|
+
fetchDataset?: (() => Promise<unknown[]>) | undefined;
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7641
|
+
export declare interface StartSliceRow {
|
|
7642
|
+
definition: string;
|
|
7643
|
+
subject: GdrUri | null;
|
|
7644
|
+
completedAt: string | null;
|
|
7645
|
+
}
|
|
8273
7646
|
|
|
8274
|
-
/**
|
|
7647
|
+
/**
|
|
7648
|
+
* A field reference with `scope` already resolved — the form every op target carries.
|
|
7649
|
+
*
|
|
7650
|
+
* @interface
|
|
7651
|
+
*/
|
|
8275
7652
|
export declare type StoredFieldRef = v.InferOutput<typeof StoredFieldRefSchema>;
|
|
8276
7653
|
|
|
8277
7654
|
declare const StoredFieldRefSchema: v.StrictObjectSchema<
|
|
@@ -8290,262 +7667,6 @@ declare const StoredFieldRefSchema: v.StrictObjectSchema<
|
|
|
8290
7667
|
undefined
|
|
8291
7668
|
>;
|
|
8292
7669
|
|
|
8293
|
-
declare const StoredManualTargetSchema: v.VariantSchema<
|
|
8294
|
-
"type",
|
|
8295
|
-
[
|
|
8296
|
-
v.StrictObjectSchema<
|
|
8297
|
-
{
|
|
8298
|
-
readonly type: v.LiteralSchema<"url", undefined>;
|
|
8299
|
-
readonly url: v.SchemaWithPipe<
|
|
8300
|
-
readonly [
|
|
8301
|
-
v.StringSchema<undefined>,
|
|
8302
|
-
v.UrlAction<string, "must be a valid URL">,
|
|
8303
|
-
v.CheckAction<string, "must be an http(s) URL">,
|
|
8304
|
-
]
|
|
8305
|
-
>;
|
|
8306
|
-
},
|
|
8307
|
-
undefined
|
|
8308
|
-
>,
|
|
8309
|
-
v.StrictObjectSchema<
|
|
8310
|
-
{
|
|
8311
|
-
readonly type: v.LiteralSchema<"field", undefined>;
|
|
8312
|
-
readonly field: v.StrictObjectSchema<
|
|
8313
|
-
{
|
|
8314
|
-
readonly scope: v.PicklistSchema<
|
|
8315
|
-
readonly ["workflow", "stage", "activity"],
|
|
8316
|
-
string
|
|
8317
|
-
>;
|
|
8318
|
-
readonly field: v.SchemaWithPipe<
|
|
8319
|
-
readonly [
|
|
8320
|
-
v.StringSchema<undefined>,
|
|
8321
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8322
|
-
]
|
|
8323
|
-
>;
|
|
8324
|
-
},
|
|
8325
|
-
undefined
|
|
8326
|
-
>;
|
|
8327
|
-
},
|
|
8328
|
-
undefined
|
|
8329
|
-
>,
|
|
8330
|
-
],
|
|
8331
|
-
undefined
|
|
8332
|
-
>;
|
|
8333
|
-
|
|
8334
|
-
declare const StoredOpSchema: v.VariantSchema<
|
|
8335
|
-
"type",
|
|
8336
|
-
[
|
|
8337
|
-
v.StrictObjectSchema<
|
|
8338
|
-
{
|
|
8339
|
-
readonly type: v.LiteralSchema<"field.set", undefined>;
|
|
8340
|
-
readonly target: v.StrictObjectSchema<
|
|
8341
|
-
{
|
|
8342
|
-
readonly scope: v.PicklistSchema<
|
|
8343
|
-
readonly ["workflow", "stage", "activity"],
|
|
8344
|
-
string
|
|
8345
|
-
>;
|
|
8346
|
-
readonly field: v.SchemaWithPipe<
|
|
8347
|
-
readonly [
|
|
8348
|
-
v.StringSchema<undefined>,
|
|
8349
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8350
|
-
]
|
|
8351
|
-
>;
|
|
8352
|
-
},
|
|
8353
|
-
undefined
|
|
8354
|
-
>;
|
|
8355
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8356
|
-
},
|
|
8357
|
-
undefined
|
|
8358
|
-
>,
|
|
8359
|
-
v.StrictObjectSchema<
|
|
8360
|
-
{
|
|
8361
|
-
readonly type: v.LiteralSchema<"field.setIfMissing", undefined>;
|
|
8362
|
-
readonly target: v.StrictObjectSchema<
|
|
8363
|
-
{
|
|
8364
|
-
readonly scope: v.PicklistSchema<
|
|
8365
|
-
readonly ["workflow", "stage", "activity"],
|
|
8366
|
-
string
|
|
8367
|
-
>;
|
|
8368
|
-
readonly field: v.SchemaWithPipe<
|
|
8369
|
-
readonly [
|
|
8370
|
-
v.StringSchema<undefined>,
|
|
8371
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8372
|
-
]
|
|
8373
|
-
>;
|
|
8374
|
-
},
|
|
8375
|
-
undefined
|
|
8376
|
-
>;
|
|
8377
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8378
|
-
},
|
|
8379
|
-
undefined
|
|
8380
|
-
>,
|
|
8381
|
-
v.StrictObjectSchema<
|
|
8382
|
-
{
|
|
8383
|
-
readonly type: v.LiteralSchema<"field.unset", undefined>;
|
|
8384
|
-
readonly target: v.StrictObjectSchema<
|
|
8385
|
-
{
|
|
8386
|
-
readonly scope: v.PicklistSchema<
|
|
8387
|
-
readonly ["workflow", "stage", "activity"],
|
|
8388
|
-
string
|
|
8389
|
-
>;
|
|
8390
|
-
readonly field: v.SchemaWithPipe<
|
|
8391
|
-
readonly [
|
|
8392
|
-
v.StringSchema<undefined>,
|
|
8393
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8394
|
-
]
|
|
8395
|
-
>;
|
|
8396
|
-
},
|
|
8397
|
-
undefined
|
|
8398
|
-
>;
|
|
8399
|
-
},
|
|
8400
|
-
undefined
|
|
8401
|
-
>,
|
|
8402
|
-
v.StrictObjectSchema<
|
|
8403
|
-
{
|
|
8404
|
-
readonly type: v.LiteralSchema<"field.append", undefined>;
|
|
8405
|
-
readonly target: v.StrictObjectSchema<
|
|
8406
|
-
{
|
|
8407
|
-
readonly scope: v.PicklistSchema<
|
|
8408
|
-
readonly ["workflow", "stage", "activity"],
|
|
8409
|
-
string
|
|
8410
|
-
>;
|
|
8411
|
-
readonly field: v.SchemaWithPipe<
|
|
8412
|
-
readonly [
|
|
8413
|
-
v.StringSchema<undefined>,
|
|
8414
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8415
|
-
]
|
|
8416
|
-
>;
|
|
8417
|
-
},
|
|
8418
|
-
undefined
|
|
8419
|
-
>;
|
|
8420
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8421
|
-
},
|
|
8422
|
-
undefined
|
|
8423
|
-
>,
|
|
8424
|
-
v.StrictObjectSchema<
|
|
8425
|
-
{
|
|
8426
|
-
readonly type: v.LiteralSchema<"field.inc", undefined>;
|
|
8427
|
-
readonly target: v.StrictObjectSchema<
|
|
8428
|
-
{
|
|
8429
|
-
readonly scope: v.PicklistSchema<
|
|
8430
|
-
readonly ["workflow", "stage", "activity"],
|
|
8431
|
-
string
|
|
8432
|
-
>;
|
|
8433
|
-
readonly field: v.SchemaWithPipe<
|
|
8434
|
-
readonly [
|
|
8435
|
-
v.StringSchema<undefined>,
|
|
8436
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8437
|
-
]
|
|
8438
|
-
>;
|
|
8439
|
-
},
|
|
8440
|
-
undefined
|
|
8441
|
-
>;
|
|
8442
|
-
readonly value: v.OptionalSchema<
|
|
8443
|
-
v.GenericSchema<ValueExprInternal>,
|
|
8444
|
-
undefined
|
|
8445
|
-
>;
|
|
8446
|
-
},
|
|
8447
|
-
undefined
|
|
8448
|
-
>,
|
|
8449
|
-
v.StrictObjectSchema<
|
|
8450
|
-
{
|
|
8451
|
-
readonly type: v.LiteralSchema<"field.dec", undefined>;
|
|
8452
|
-
readonly target: v.StrictObjectSchema<
|
|
8453
|
-
{
|
|
8454
|
-
readonly scope: v.PicklistSchema<
|
|
8455
|
-
readonly ["workflow", "stage", "activity"],
|
|
8456
|
-
string
|
|
8457
|
-
>;
|
|
8458
|
-
readonly field: v.SchemaWithPipe<
|
|
8459
|
-
readonly [
|
|
8460
|
-
v.StringSchema<undefined>,
|
|
8461
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8462
|
-
]
|
|
8463
|
-
>;
|
|
8464
|
-
},
|
|
8465
|
-
undefined
|
|
8466
|
-
>;
|
|
8467
|
-
readonly value: v.OptionalSchema<
|
|
8468
|
-
v.GenericSchema<ValueExprInternal>,
|
|
8469
|
-
undefined
|
|
8470
|
-
>;
|
|
8471
|
-
},
|
|
8472
|
-
undefined
|
|
8473
|
-
>,
|
|
8474
|
-
v.StrictObjectSchema<
|
|
8475
|
-
{
|
|
8476
|
-
readonly type: v.LiteralSchema<"field.updateWhere", undefined>;
|
|
8477
|
-
readonly target: v.StrictObjectSchema<
|
|
8478
|
-
{
|
|
8479
|
-
readonly scope: v.PicklistSchema<
|
|
8480
|
-
readonly ["workflow", "stage", "activity"],
|
|
8481
|
-
string
|
|
8482
|
-
>;
|
|
8483
|
-
readonly field: v.SchemaWithPipe<
|
|
8484
|
-
readonly [
|
|
8485
|
-
v.StringSchema<undefined>,
|
|
8486
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8487
|
-
]
|
|
8488
|
-
>;
|
|
8489
|
-
},
|
|
8490
|
-
undefined
|
|
8491
|
-
>;
|
|
8492
|
-
readonly where: v.SchemaWithPipe<
|
|
8493
|
-
readonly [
|
|
8494
|
-
v.StringSchema<undefined>,
|
|
8495
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8496
|
-
]
|
|
8497
|
-
>;
|
|
8498
|
-
readonly value: v.GenericSchema<ValueExprInternal>;
|
|
8499
|
-
},
|
|
8500
|
-
undefined
|
|
8501
|
-
>,
|
|
8502
|
-
v.StrictObjectSchema<
|
|
8503
|
-
{
|
|
8504
|
-
readonly type: v.LiteralSchema<"field.removeWhere", undefined>;
|
|
8505
|
-
readonly target: v.StrictObjectSchema<
|
|
8506
|
-
{
|
|
8507
|
-
readonly scope: v.PicklistSchema<
|
|
8508
|
-
readonly ["workflow", "stage", "activity"],
|
|
8509
|
-
string
|
|
8510
|
-
>;
|
|
8511
|
-
readonly field: v.SchemaWithPipe<
|
|
8512
|
-
readonly [
|
|
8513
|
-
v.StringSchema<undefined>,
|
|
8514
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8515
|
-
]
|
|
8516
|
-
>;
|
|
8517
|
-
},
|
|
8518
|
-
undefined
|
|
8519
|
-
>;
|
|
8520
|
-
readonly where: v.SchemaWithPipe<
|
|
8521
|
-
readonly [
|
|
8522
|
-
v.StringSchema<undefined>,
|
|
8523
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8524
|
-
]
|
|
8525
|
-
>;
|
|
8526
|
-
},
|
|
8527
|
-
undefined
|
|
8528
|
-
>,
|
|
8529
|
-
v.StrictObjectSchema<
|
|
8530
|
-
{
|
|
8531
|
-
readonly type: v.LiteralSchema<"status.set", undefined>;
|
|
8532
|
-
readonly activity: v.SchemaWithPipe<
|
|
8533
|
-
readonly [
|
|
8534
|
-
v.StringSchema<undefined>,
|
|
8535
|
-
v.MinLengthAction<string, 1, "must be a non-empty string">,
|
|
8536
|
-
]
|
|
8537
|
-
>;
|
|
8538
|
-
readonly status: v.PicklistSchema<
|
|
8539
|
-
readonly ["active", "done", "skipped", "failed"],
|
|
8540
|
-
string
|
|
8541
|
-
>;
|
|
8542
|
-
},
|
|
8543
|
-
undefined
|
|
8544
|
-
>,
|
|
8545
|
-
],
|
|
8546
|
-
undefined
|
|
8547
|
-
>;
|
|
8548
|
-
|
|
8549
7670
|
export declare function stripSystemFields(
|
|
8550
7671
|
doc: Record<string, unknown>,
|
|
8551
7672
|
): Record<string, unknown>;
|
|
@@ -8609,7 +7730,7 @@ export declare interface SubjectPermissionDenial {
|
|
|
8609
7730
|
permission: DocumentValuePermission;
|
|
8610
7731
|
}
|
|
8611
7732
|
|
|
8612
|
-
declare interface SubjectResourceAccess {
|
|
7733
|
+
export declare interface SubjectResourceAccess {
|
|
8613
7734
|
grants: Grant[];
|
|
8614
7735
|
/** The actor's principal id in this resource's own namespace: per-project user id for a dataset resource, account-global id for an org-level one. */
|
|
8615
7736
|
actorId: string;
|
|
@@ -8730,6 +7851,8 @@ export declare interface SubworkflowEntry {
|
|
|
8730
7851
|
* (default) lets them run to completion, `'abort'` kills them recursively —
|
|
8731
7852
|
* always an authored choice, never automatic. Whether the PARENT may move at
|
|
8732
7853
|
* all is a separate gate over `$subworkflows`.
|
|
7854
|
+
*
|
|
7855
|
+
* @interface
|
|
8733
7856
|
*/
|
|
8734
7857
|
export declare type Subworkflows = v.InferOutput<typeof SubworkflowsSchema>;
|
|
8735
7858
|
|
|
@@ -8861,13 +7984,15 @@ export declare const SYSTEM_IDENTITY = "<system>";
|
|
|
8861
7984
|
export declare function tagScopeFilter(): string;
|
|
8862
7985
|
|
|
8863
7986
|
/**
|
|
8864
|
-
*
|
|
8865
|
-
* telemetry twin of the `Clocked` seam in `clock.ts
|
|
8866
|
-
*
|
|
8867
|
-
*
|
|
8868
|
-
*
|
|
7987
|
+
* Optional telemetry-injection field on the raw `workflow.*` verbs — the
|
|
7988
|
+
* telemetry twin of the `Clocked` seam in `clock.ts`. It is exported
|
|
7989
|
+
* because those verbs expose this composition helper in their public
|
|
7990
|
+
* signatures, but production normally injects a logger once via
|
|
7991
|
+
* `createEngine({ telemetry })`, not as an everyday per-call option. A
|
|
7992
|
+
* raw-namespace caller that omits it emits nothing (the verbs default to
|
|
7993
|
+
* {@link noopTelemetry}).
|
|
8869
7994
|
*/
|
|
8870
|
-
declare type Telemetered<T> = T & {
|
|
7995
|
+
export declare type Telemetered<T> = T & {
|
|
8871
7996
|
telemetry?: WorkflowTelemetryLogger;
|
|
8872
7997
|
};
|
|
8873
7998
|
|
|
@@ -8913,14 +8038,7 @@ export declare interface TelemetryIntakeClient {
|
|
|
8913
8038
|
* `$allActivitiesDone` — a `failed` activity blocks it permanently, surfacing
|
|
8914
8039
|
* via `$anyActivityFailed`.
|
|
8915
8040
|
*/
|
|
8916
|
-
declare
|
|
8917
|
-
"done",
|
|
8918
|
-
"skipped",
|
|
8919
|
-
"failed",
|
|
8920
|
-
];
|
|
8921
|
-
|
|
8922
|
-
export declare type TerminalActivityStatus =
|
|
8923
|
-
(typeof TERMINAL_ACTIVITY_STATUSES)[number];
|
|
8041
|
+
export declare type TerminalActivityStatus = "done" | "skipped" | "failed";
|
|
8924
8042
|
|
|
8925
8043
|
/** See {@link terminalState}. */
|
|
8926
8044
|
export declare type TerminalState = "aborted" | "completed" | "in-flight";
|
|
@@ -8943,8 +8061,7 @@ export declare function terminalState(
|
|
|
8943
8061
|
*/
|
|
8944
8062
|
export declare function toBareId(id: string): string;
|
|
8945
8063
|
|
|
8946
|
-
/**
|
|
8947
|
-
* Its `dueDate` is a `date` column named `dueDate`, not the elevated `dueDate` kind, which reserves one deadline slot per level. Never a stored kind. */
|
|
8064
|
+
/** @inline */
|
|
8948
8065
|
declare type TodoListField = FieldBase<AuthoringEditable, GroupMembership> & {
|
|
8949
8066
|
type: "todoList";
|
|
8950
8067
|
};
|
|
@@ -8962,7 +8079,8 @@ export declare interface TodoListItem {
|
|
|
8962
8079
|
_key: string;
|
|
8963
8080
|
label: string;
|
|
8964
8081
|
status?: string | null;
|
|
8965
|
-
|
|
8082
|
+
/** Singular assignment slot: any number of routing roles and at most one user. */
|
|
8083
|
+
assignee?: Assignee[];
|
|
8966
8084
|
dueDate?: string | null;
|
|
8967
8085
|
}
|
|
8968
8086
|
|
|
@@ -9003,8 +8121,7 @@ export declare interface TransitionEvaluation {
|
|
|
9003
8121
|
insight: ConditionInsight;
|
|
9004
8122
|
}
|
|
9005
8123
|
|
|
9006
|
-
/**
|
|
9007
|
-
* authoring omits it (desugar fills the default), so each variant declares it. */
|
|
8124
|
+
/** @inline */
|
|
9008
8125
|
declare type TransitionFields = {
|
|
9009
8126
|
name: string;
|
|
9010
8127
|
title?: string | undefined;
|
|
@@ -9094,7 +8211,7 @@ export declare function validateDefinition(
|
|
|
9094
8211
|
|
|
9095
8212
|
export declare function validateTag(tag: string): void;
|
|
9096
8213
|
|
|
9097
|
-
declare interface ValidationIssue {
|
|
8214
|
+
export declare interface ValidationIssue {
|
|
9098
8215
|
path: ReadonlyArray<PropertyKey>;
|
|
9099
8216
|
message: string;
|
|
9100
8217
|
}
|
|
@@ -9107,6 +8224,7 @@ declare interface ValidationIssue {
|
|
|
9107
8224
|
*/
|
|
9108
8225
|
export declare type ValueExpr = ValueExprInternal;
|
|
9109
8226
|
|
|
8227
|
+
/** @inline */
|
|
9110
8228
|
declare type ValueExprInternal =
|
|
9111
8229
|
| LiteralExpr
|
|
9112
8230
|
| FieldReadExpr
|
|
@@ -9225,9 +8343,8 @@ export declare const workflow: {
|
|
|
9225
8343
|
/**
|
|
9226
8344
|
* Remove a deployed definition (all versions, or one via `version`). Refuses
|
|
9227
8345
|
* while non-terminal instances exist unless `cascade` aborts them first —
|
|
9228
|
-
* instances are never deleted, only aborted in place
|
|
9229
|
-
*
|
|
9230
|
-
* check, guard-doc housekeeping).
|
|
8346
|
+
* instances are never deleted, only aborted in place. The operation also
|
|
8347
|
+
* checks spawn referrers and cleans up guard documents.
|
|
9231
8348
|
*/
|
|
9232
8349
|
deleteDefinition: (
|
|
9233
8350
|
rawArgs: Clocked<Telemetered<DeleteDefinitionArgs & EngineScopeArgs>>,
|
|
@@ -9344,8 +8461,8 @@ export declare const workflow: {
|
|
|
9344
8461
|
) => Promise<OperationResult>;
|
|
9345
8462
|
/**
|
|
9346
8463
|
* Admin override — hard-stop an in-flight instance where it stands. No stage
|
|
9347
|
-
* move, no transition effects, pending effects cancelled
|
|
9348
|
-
*
|
|
8464
|
+
* move, no transition effects, pending effects cancelled. The abort
|
|
8465
|
+
* propagates through affected ancestor instances.
|
|
9349
8466
|
* Propagated, not cascaded — the instance is terminal, so `cascaded` is
|
|
9350
8467
|
* always `0` and ancestor movement is reported on the ancestors, not here.
|
|
9351
8468
|
* `changed: false` means the instance was already terminal.
|
|
@@ -9534,8 +8651,6 @@ export declare const WORKFLOW_DEFINITION_TYPE = "sanity.workflow.definition";
|
|
|
9534
8651
|
*/
|
|
9535
8652
|
export declare const WORKFLOW_INSTANCE_TYPE = "sanity.workflow.instance";
|
|
9536
8653
|
|
|
9537
|
-
declare const WORKFLOW_LIFECYCLES: readonly ["standalone", "child"];
|
|
9538
|
-
|
|
9539
8654
|
/**
|
|
9540
8655
|
* The engine's view of "who am I, what can I do?". `actor` is who
|
|
9541
8656
|
* the engine stamps onto history / `completedBy` / `ValueExpr.actor` —
|
|
@@ -9775,6 +8890,8 @@ export declare interface WorkflowCommitOptions {
|
|
|
9775
8890
|
* logger unconditionally (CI and `DO_NOT_TRACK` included), and consent,
|
|
9776
8891
|
* environment suppression, and transport become this implementation's
|
|
9777
8892
|
* business.
|
|
8893
|
+
*
|
|
8894
|
+
* @interface
|
|
9778
8895
|
*/
|
|
9779
8896
|
export declare type WorkflowConfig = v.InferOutput<typeof WorkflowConfigSchema>;
|
|
9780
8897
|
|
|
@@ -10427,6 +9544,8 @@ declare const WorkflowConfigSchema: v.ObjectSchema<
|
|
|
10427
9544
|
* conditions — each `name: groq` entry is pre-evaluated and bound as the
|
|
10428
9545
|
* boolean `$name` var; redefining a built-in var is a deploy error, never a
|
|
10429
9546
|
* silent shadow.
|
|
9547
|
+
*
|
|
9548
|
+
* @interface
|
|
10430
9549
|
*/
|
|
10431
9550
|
export declare type WorkflowDefinition = v.InferOutput<
|
|
10432
9551
|
typeof WorkflowDefinitionSchema
|
|
@@ -10482,7 +9601,7 @@ export declare interface WorkflowDefinitionDeployedData {
|
|
|
10482
9601
|
* fetch results are typed (`Record<string, unknown>`), which pass through to
|
|
10483
9602
|
* the runtime boundary parse. Everything precisely typed gets the exact
|
|
10484
9603
|
* {@link WorkflowDefinition} contract: beyond the document envelope
|
|
10485
|
-
* (
|
|
9604
|
+
* (the closed system-key union, so a typed {@link DeployedDefinition} passes
|
|
10486
9605
|
* castless), unknown keys are `never` — a typo'd literal is a compile error,
|
|
10487
9606
|
* never a silent collapse to the record arm.
|
|
10488
9607
|
*/
|
|
@@ -10602,6 +9721,7 @@ export declare type WorkflowErrorKind =
|
|
|
10602
9721
|
| "partial-guard-deploy"
|
|
10603
9722
|
| "start-not-primed"
|
|
10604
9723
|
| "start-not-settled"
|
|
9724
|
+
| "concurrent-cascade"
|
|
10605
9725
|
| "concurrent-fire-action"
|
|
10606
9726
|
| "concurrent-edit-field"
|
|
10607
9727
|
| "concurrent-complete-effect"
|
|
@@ -10629,7 +9749,7 @@ export declare interface WorkflowEvaluation {
|
|
|
10629
9749
|
semantics?: Semantic[] | undefined;
|
|
10630
9750
|
actor: Actor;
|
|
10631
9751
|
currentStage: StageEvaluation;
|
|
10632
|
-
/** Active activities whose
|
|
9752
|
+
/** Active activities whose singular or plural assignment entry matches the actor. */
|
|
10633
9753
|
pendingOnYou: ActivityEvaluation[];
|
|
10634
9754
|
/** True if at least one action on any active activity is allowed. */
|
|
10635
9755
|
canInteract: boolean;
|
|
@@ -10655,6 +9775,14 @@ export declare interface WorkflowEvaluation {
|
|
|
10655
9775
|
* evaluation time, so their legs report `conditional`.
|
|
10656
9776
|
*/
|
|
10657
9777
|
autonomy: WorkflowAutonomy;
|
|
9778
|
+
/**
|
|
9779
|
+
* The nearest future instant (ISO 8601) at which the clock alone changes this
|
|
9780
|
+
* projection; re-evaluate then. Includes a gate reading `$now` beside
|
|
9781
|
+
* `$actor`, `$assigned`, `$can`, or `$attributes`, evaluated in this actor's
|
|
9782
|
+
* scopes. Derived per call, never persisted. Absent on a terminal instance
|
|
9783
|
+
* and when no site yields a boundary from those scopes.
|
|
9784
|
+
*/
|
|
9785
|
+
nextEvaluationAt?: string;
|
|
10658
9786
|
}
|
|
10659
9787
|
|
|
10660
9788
|
export declare interface WorkflowFetchOptions {
|
|
@@ -10682,7 +9810,7 @@ export declare interface WorkflowFieldEditedData extends InstanceScopedEventData
|
|
|
10682
9810
|
mode: EditMode;
|
|
10683
9811
|
}
|
|
10684
9812
|
|
|
10685
|
-
/**
|
|
9813
|
+
/** @inline */
|
|
10686
9814
|
declare type WorkflowFields<TField, TStage, TStart> = {
|
|
10687
9815
|
name: string;
|
|
10688
9816
|
semantics?: Semantic[] | undefined;
|
|
@@ -10905,7 +10033,7 @@ export declare interface WorkflowInstanceTickedData extends InstanceScopedEventD
|
|
|
10905
10033
|
/** How instances of a definition come to exist: started standalone (the
|
|
10906
10034
|
* default) or spawned by a parent. `'child'` is spawn-only — see
|
|
10907
10035
|
* {@link isStartableDefinition}. */
|
|
10908
|
-
export declare type WorkflowLifecycle =
|
|
10036
|
+
export declare type WorkflowLifecycle = "standalone" | "child";
|
|
10909
10037
|
|
|
10910
10038
|
/**
|
|
10911
10039
|
* The subset of `@sanity/client` the engine actually needs. The
|