@sanity/workflow-engine-test 0.6.0 → 0.7.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 +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -10
- package/dist/index.d.ts +18 -10
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5148,17 +5148,17 @@ function createReadHelpers(scope) {
|
|
|
5148
5148
|
getInstance,
|
|
5149
5149
|
currentStage: async (instanceId) => (await getInstance(instanceId)).currentStage,
|
|
5150
5150
|
pendingEffects: async (instanceId) => (await getInstance(instanceId)).pendingEffects,
|
|
5151
|
-
|
|
5151
|
+
activityStatus: async (instanceId, activity) => {
|
|
5152
5152
|
const instance = await getInstance(instanceId);
|
|
5153
5153
|
return instance.stages.find(
|
|
5154
5154
|
(s) => s.name === instance.currentStage && s.exitedAt === void 0
|
|
5155
|
-
)?.
|
|
5155
|
+
)?.activities.find((t) => t.name === activity)?.status;
|
|
5156
5156
|
},
|
|
5157
5157
|
effectsContextMap: async (instanceId) => workflowEngine.effectsContextMap(await getInstance(instanceId)),
|
|
5158
|
-
children: async (parentInstanceId,
|
|
5158
|
+
children: async (parentInstanceId, activity) => workflowEngine.workflow.children({
|
|
5159
5159
|
...scope,
|
|
5160
5160
|
instanceId: parentInstanceId,
|
|
5161
|
-
...
|
|
5161
|
+
...activity !== void 0 ? { activity } : {}
|
|
5162
5162
|
}),
|
|
5163
5163
|
instancesForSubject: async (subjectRef, entryName = "subject") => (
|
|
5164
5164
|
// Subjects live on a workflow-scope `doc.ref` field entry. Match
|
|
@@ -5180,6 +5180,7 @@ function createReadHelpers(scope) {
|
|
|
5180
5180
|
{ wf: workflowName, stage, tag }
|
|
5181
5181
|
);
|
|
5182
5182
|
},
|
|
5183
|
+
instancesForDocument: async (document2) => workflowEngine.workflow.instancesForDocument({ ...scope, document: document2 }),
|
|
5183
5184
|
snapshot: () => client.snapshot()
|
|
5184
5185
|
};
|
|
5185
5186
|
}
|