@sanity/workflow-engine-test 0.5.0 → 0.6.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/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import type { CompleteEffectArgs } from "@sanity/workflow-engine";
3
3
  import { DeployDefinitionsArgs } from "@sanity/workflow-engine";
4
4
  import { DeployDefinitionsResult } from "@sanity/workflow-engine";
5
5
  import { DispatchResult } from "@sanity/workflow-engine";
6
- import type { EditStateArgs } from "@sanity/workflow-engine";
6
+ import type { EditFieldArgs } from "@sanity/workflow-engine";
7
7
  import type { EvaluateArgs } from "@sanity/workflow-engine";
8
8
  import type { FireActionArgs } from "@sanity/workflow-engine";
9
9
  import type { Grant } from "@sanity/workflow-engine";
@@ -61,8 +61,8 @@ declare type BenchCompleteEffectArgs = Omit<
61
61
  actor?: Actor;
62
62
  };
63
63
 
64
- declare type BenchEditStateArgs = Omit<
65
- EditStateArgs,
64
+ declare type BenchEditFieldArgs = Omit<
65
+ EditFieldArgs,
66
66
  "client" | "tag" | "workflowResource" | "access"
67
67
  > & {
68
68
  access?: WorkflowAccess;
@@ -285,7 +285,7 @@ declare type EngineWrappers = {
285
285
  ) => Promise<DeployDefinitionsResult>;
286
286
  startInstance: (args: BenchStartInstanceArgs) => Promise<WorkflowInstance>;
287
287
  fireAction: (args: BenchFireActionArgs) => Promise<DispatchResult>;
288
- editState: (args: BenchEditStateArgs) => Promise<DispatchResult>;
288
+ editField: (args: BenchEditFieldArgs) => Promise<DispatchResult>;
289
289
  completeEffect: (args: BenchCompleteEffectArgs) => Promise<DispatchResult>;
290
290
  tick: (args: BenchTickArgs) => Promise<DispatchResult>;
291
291
  evaluate: (args: BenchEvaluateArgs) => Promise<WorkflowEvaluation>;
@@ -569,7 +569,7 @@ declare type ReadHelpers = {
569
569
  task?: string,
570
570
  ) => Promise<WorkflowInstance[]>;
571
571
  /**
572
- * All workflow instances whose `doc.ref` state entry named
572
+ * All workflow instances whose `doc.ref` field entry named
573
573
  * `entryName` (default `"subject"`) matches the given doc id. Useful
574
574
  * for "what workflow is running on this document?" questions. Pass
575
575
  * `entryName` for workflows whose subject entry uses a different name.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { CompleteEffectArgs } from "@sanity/workflow-engine";
3
3
  import { DeployDefinitionsArgs } from "@sanity/workflow-engine";
4
4
  import { DeployDefinitionsResult } from "@sanity/workflow-engine";
5
5
  import { DispatchResult } from "@sanity/workflow-engine";
6
- import type { EditStateArgs } from "@sanity/workflow-engine";
6
+ import type { EditFieldArgs } from "@sanity/workflow-engine";
7
7
  import type { EvaluateArgs } from "@sanity/workflow-engine";
8
8
  import type { FireActionArgs } from "@sanity/workflow-engine";
9
9
  import type { Grant } from "@sanity/workflow-engine";
@@ -61,8 +61,8 @@ declare type BenchCompleteEffectArgs = Omit<
61
61
  actor?: Actor;
62
62
  };
63
63
 
64
- declare type BenchEditStateArgs = Omit<
65
- EditStateArgs,
64
+ declare type BenchEditFieldArgs = Omit<
65
+ EditFieldArgs,
66
66
  "client" | "tag" | "workflowResource" | "access"
67
67
  > & {
68
68
  access?: WorkflowAccess;
@@ -285,7 +285,7 @@ declare type EngineWrappers = {
285
285
  ) => Promise<DeployDefinitionsResult>;
286
286
  startInstance: (args: BenchStartInstanceArgs) => Promise<WorkflowInstance>;
287
287
  fireAction: (args: BenchFireActionArgs) => Promise<DispatchResult>;
288
- editState: (args: BenchEditStateArgs) => Promise<DispatchResult>;
288
+ editField: (args: BenchEditFieldArgs) => Promise<DispatchResult>;
289
289
  completeEffect: (args: BenchCompleteEffectArgs) => Promise<DispatchResult>;
290
290
  tick: (args: BenchTickArgs) => Promise<DispatchResult>;
291
291
  evaluate: (args: BenchEvaluateArgs) => Promise<WorkflowEvaluation>;
@@ -569,7 +569,7 @@ declare type ReadHelpers = {
569
569
  task?: string,
570
570
  ) => Promise<WorkflowInstance[]>;
571
571
  /**
572
- * All workflow instances whose `doc.ref` state entry named
572
+ * All workflow instances whose `doc.ref` field entry named
573
573
  * `entryName` (default `"subject"`) matches the given doc id. Useful
574
574
  * for "what workflow is running on this document?" questions. Pass
575
575
  * `entryName` for workflows whose subject entry uses a different name.
package/dist/index.js CHANGED
@@ -5093,7 +5093,7 @@ function createEngineWrappers(scope, access, clock) {
5093
5093
  deployDefinitions: (args) => workflow.deployDefinitions({ ...scope, ...args }),
5094
5094
  startInstance: (args) => workflow.startInstance(withAccess(args)),
5095
5095
  fireAction: (args) => workflow.fireAction(withAccess(args)),
5096
- editState: (args) => workflow.editState(withAccess(args)),
5096
+ editField: (args) => workflow.editField(withAccess(args)),
5097
5097
  completeEffect: (args) => workflow.completeEffect(withAccess(args)),
5098
5098
  tick: (args) => workflow.tick(withAccess(args)),
5099
5099
  evaluate: (args) => workflow.evaluate(withAccess(args)),
@@ -5157,13 +5157,13 @@ function createReadHelpers(scope) {
5157
5157
  ...task !== void 0 ? { task } : {}
5158
5158
  }),
5159
5159
  instancesForSubject: async (subjectRef, entryName = "subject") => (
5160
- // Subjects live on a workflow-scope `doc.ref` state entry. Match
5160
+ // Subjects live on a workflow-scope `doc.ref` field entry. Match
5161
5161
  // instances whose entry's value.id equals the supplied ref. The
5162
5162
  // entry name is conventionally "subject" but workflows may name
5163
5163
  // it otherwise.
5164
5164
  client.fetch(
5165
5165
  `*[_type == "${WORKFLOW_INSTANCE_TYPE}"
5166
- && state[_type == "doc.ref" && name == $entry][0].value.id == $ref
5166
+ && fields[_type == "doc.ref" && name == $entry][0].value.id == $ref
5167
5167
  && ${tagScopeFilter()}] | order(startedAt asc)`,
5168
5168
  { ref: subjectRef, entry: entryName, tag }
5169
5169
  )