@sanity/workflow-engine 0.32.0 → 0.33.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/dist/define.js CHANGED
@@ -1,4 +1,4 @@
1
- import { parseOrThrow, desugarWorkflow, checkWorkflowInvariants, formatValidationError, AuthoringWorkflowSchema, labelFor, WorkflowConfigSchema, AuthoringStageSchema, AuthoringActivitySchema, AuthoringActionSchema, AuthoringTransitionSchema, AuthoringFieldEntrySchema, AuthoringOpSchema, GroupSchema, AuthoringGuardSchema, EffectSchema } from "./_chunks-es/invariants.js";
1
+ import { parseOrThrow, desugarWorkflow, checkWorkflowInvariants, formatValidationError, AuthoringWorkflowSchema, labelFor, WorkflowConfigSchema, AuthoringStageSchema, AuthoringActivitySchema, AuthoringActionSchema, AuthoringTransitionSchema, AuthoringFieldEntrySchema, AuthoringOpSchema, GroupSchema, AuthoringGuardSchema, AuthoringEffectSchema } from "./_chunks-es/invariants.js";
2
2
 
3
3
  import { CONDITION_VARS, FILTER_SCOPE_VARS, GUARD_PREDICATE_VARS, RESERVED_CONDITION_VARS, groq } from "./_chunks-es/invariants.js";
4
4
 
@@ -7,9 +7,12 @@ function defineWorkflow(definition) {
7
7
  schema: AuthoringWorkflowSchema,
8
8
  input: definition,
9
9
  label: label
10
- }), {definition: stored, issues: desugarIssues} = desugarWorkflow(parsed), issues = [ ...desugarIssues, ...checkWorkflowInvariants(stored) ];
10
+ }), {definition: stored, runtime: runtime, issues: desugarIssues} = desugarWorkflow(parsed), issues = [ ...desugarIssues, ...checkWorkflowInvariants(stored) ];
11
11
  if (issues.length > 0) throw new Error(formatValidationError(label, issues));
12
- return stored;
12
+ return runtime === void 0 ? stored : {
13
+ ...stored,
14
+ runtime: runtime
15
+ };
13
16
  }
14
17
 
15
18
  function defineWorkflowConfig(config) {
@@ -86,7 +89,7 @@ function defineGuard(guard) {
86
89
 
87
90
  function defineEffect(effect) {
88
91
  return parseOrThrow({
89
- schema: EffectSchema,
92
+ schema: AuthoringEffectSchema,
90
93
  input: effect,
91
94
  label: labelFor("defineEffect", effect)
92
95
  });