@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.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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 {
|
|
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
|
|
65
|
-
|
|
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
|
-
|
|
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`
|
|
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 {
|
|
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
|
|
65
|
-
|
|
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
|
-
|
|
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`
|
|
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
|
-
|
|
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`
|
|
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
|
-
&&
|
|
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
|
)
|