tines 0.0.237 → 0.0.238
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.js +33 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4558,6 +4558,15 @@ function deriveTransferConflictDeltas(before, after) {
|
|
|
4558
4558
|
);
|
|
4559
4559
|
}
|
|
4560
4560
|
|
|
4561
|
+
// ../shared/src/workflow-navigation.ts
|
|
4562
|
+
function workflowStateAnchorId(stateId) {
|
|
4563
|
+
return `state-${stateId}`;
|
|
4564
|
+
}
|
|
4565
|
+
function workflowStateHref(workflowId, stateId) {
|
|
4566
|
+
const anchor = workflowStateAnchorId(stateId);
|
|
4567
|
+
return `/workflows/${workflowId}?state=${stateId}#${anchor}`;
|
|
4568
|
+
}
|
|
4569
|
+
|
|
4561
4570
|
// ../shared/src/library/types.ts
|
|
4562
4571
|
var LIBRARY_V3_MAX_DEPTH = 64;
|
|
4563
4572
|
var LIBRARY_V3_MAX_RECORDS = 1e3;
|
|
@@ -12651,8 +12660,13 @@ function tokenPayload(token) {
|
|
|
12651
12660
|
}
|
|
12652
12661
|
function expectedWorkflowPackageOperations(plan) {
|
|
12653
12662
|
const operations = [];
|
|
12663
|
+
const allocatedId = (localId) => {
|
|
12664
|
+
const id2 = plan.allocation.records[localId]?.id;
|
|
12665
|
+
if (!id2) throw new Error(`saved workflow package plan has no allocation for ${localId}`);
|
|
12666
|
+
return id2;
|
|
12667
|
+
};
|
|
12654
12668
|
for (const workflow2 of plan.resolved.workflows) {
|
|
12655
|
-
const workflowId =
|
|
12669
|
+
const workflowId = allocatedId(workflow2.id);
|
|
12656
12670
|
const href = `/workflows/${workflowId}`;
|
|
12657
12671
|
operations.push({
|
|
12658
12672
|
action: "create",
|
|
@@ -12663,15 +12677,17 @@ function expectedWorkflowPackageOperations(plan) {
|
|
|
12663
12677
|
href,
|
|
12664
12678
|
relationship: workflow2.id === plan.document.main_workflow_id ? "main" : "dependency"
|
|
12665
12679
|
});
|
|
12666
|
-
for (const state of workflow2.states)
|
|
12680
|
+
for (const state of workflow2.states) {
|
|
12681
|
+
const stateId = allocatedId(state.id);
|
|
12667
12682
|
operations.push({
|
|
12668
12683
|
action: "create",
|
|
12669
12684
|
kind: "state",
|
|
12670
12685
|
local_id: state.id,
|
|
12671
|
-
id:
|
|
12686
|
+
id: stateId,
|
|
12672
12687
|
name: state.name,
|
|
12673
|
-
href:
|
|
12688
|
+
href: workflowStateHref(workflowId, stateId)
|
|
12674
12689
|
});
|
|
12690
|
+
}
|
|
12675
12691
|
for (const transition of workflow2.transitions)
|
|
12676
12692
|
operations.push({
|
|
12677
12693
|
action: "create",
|
|
@@ -12760,7 +12776,19 @@ function assertPlanBinding(plan) {
|
|
|
12760
12776
|
}
|
|
12761
12777
|
if (signedDigest !== digest2 || plan.plan_digest !== digest2)
|
|
12762
12778
|
throw new Error("saved workflow package plan digest does not bind its review");
|
|
12763
|
-
|
|
12779
|
+
const comparisonOperations = plan.operations.map((operation) => {
|
|
12780
|
+
if (operation.kind !== "state") return operation;
|
|
12781
|
+
const workflow2 = plan.resolved.workflows.find(
|
|
12782
|
+
(candidate) => candidate.states.some((state) => state.id === operation.local_id)
|
|
12783
|
+
);
|
|
12784
|
+
if (!workflow2) return operation;
|
|
12785
|
+
const workflowId = plan.allocation.records[workflow2.id]?.id;
|
|
12786
|
+
const stateId = plan.allocation.records[operation.local_id]?.id;
|
|
12787
|
+
if (!workflowId || !stateId) return operation;
|
|
12788
|
+
const legacyHref = `/workflows/${workflowId}#state-${stateId}`;
|
|
12789
|
+
return operation.href === legacyHref ? { ...operation, href: workflowStateHref(workflowId, stateId) } : operation;
|
|
12790
|
+
});
|
|
12791
|
+
if (canonicalizeLibraryValue(comparisonOperations) !== canonicalizeLibraryValue(expectedWorkflowPackageOperations(plan)))
|
|
12764
12792
|
throw new Error("saved workflow package plan has modified operations");
|
|
12765
12793
|
}
|
|
12766
12794
|
var lines = (heading, values) => values.length ? [heading, ...values.map((value) => ` ${value}`)] : [heading, " none"];
|