@sanity/workflow-engine 0.32.0 → 0.34.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.cjs CHANGED
@@ -11,9 +11,12 @@ function defineWorkflow(definition) {
11
11
  schema: invariants.AuthoringWorkflowSchema,
12
12
  input: definition,
13
13
  label: label
14
- }), {definition: stored, issues: desugarIssues} = invariants.desugarWorkflow(parsed), issues = [ ...desugarIssues, ...invariants.checkWorkflowInvariants(stored) ];
14
+ }), {definition: stored, runtime: runtime, issues: desugarIssues} = invariants.desugarWorkflow(parsed), issues = [ ...desugarIssues, ...invariants.checkWorkflowInvariants(stored) ];
15
15
  if (issues.length > 0) throw new Error(invariants.formatValidationError(label, issues));
16
- return stored;
16
+ return runtime === void 0 ? stored : {
17
+ ...stored,
18
+ runtime: runtime
19
+ };
17
20
  }
18
21
 
19
22
  function defineWorkflowConfig(config) {
@@ -90,7 +93,7 @@ function defineGuard(guard) {
90
93
 
91
94
  function defineEffect(effect) {
92
95
  return invariants.parseOrThrow({
93
- schema: invariants.EffectSchema,
96
+ schema: invariants.AuthoringEffectSchema,
94
97
  input: effect,
95
98
  label: invariants.labelFor("defineEffect", effect)
96
99
  });