@bilig/workbook 0.42.0 → 0.51.2
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/README.md +25 -57
- package/dist/check.d.ts +0 -2
- package/dist/check.js +0 -61
- package/dist/check.js.map +1 -1
- package/dist/describe.d.ts +0 -16
- package/dist/describe.js +0 -22
- package/dist/describe.js.map +1 -1
- package/dist/guards.js +1 -55
- package/dist/guards.js.map +1 -1
- package/dist/input.d.ts +0 -1
- package/dist/input.js +0 -58
- package/dist/input.js.map +1 -1
- package/dist/model.js +1 -9
- package/dist/model.js.map +1 -1
- package/dist/ops.d.ts +11 -6
- package/dist/readback.d.ts +3 -15
- package/dist/readback.js +8 -125
- package/dist/readback.js.map +1 -1
- package/dist/requirements.d.ts +1 -13
- package/dist/requirements.js +13 -100
- package/dist/requirements.js.map +1 -1
- package/dist/result.d.ts +2 -19
- package/dist/result.js +0 -4
- package/dist/result.js.map +1 -1
- package/dist/run.d.ts +2 -4
- package/dist/run.js +6 -250
- package/dist/run.js.map +1 -1
- package/dist/verify.d.ts +0 -2
- package/dist/verify.js +0 -39
- package/dist/verify.js.map +1 -1
- package/package.json +3 -3
package/dist/requirements.js
CHANGED
|
@@ -38,102 +38,11 @@ function commandMessage(command) {
|
|
|
38
38
|
: `Apply workbook op ${command.op.kind} to ${command.target.label}`;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (expectation.kind === 'valueEquals') {
|
|
43
|
-
return {
|
|
44
|
-
kind: 'valueEquals',
|
|
45
|
-
value: expectation.value,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (expectation.kind === 'valuesEqual') {
|
|
49
|
-
return {
|
|
50
|
-
kind: 'valuesEqual',
|
|
51
|
-
values: expectation.values.map((row) => [...row]),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
if (expectation.kind === 'formulaEquals') {
|
|
55
|
-
return {
|
|
56
|
-
kind: 'formulaEquals',
|
|
57
|
-
formula: expectation.formula,
|
|
58
|
-
inputs: expectation.inputs.map(describeRef),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
kind: 'formulasEqual',
|
|
63
|
-
formulas: expectation.formulas.map((row) => [...row]),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function concreteSingleCell(target) {
|
|
67
|
-
if (target.kind !== 'range') {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const range = target.range;
|
|
71
|
-
return range.startAddress === range.endAddress ? { sheetName: range.sheetName, address: range.startAddress } : null;
|
|
72
|
-
}
|
|
73
|
-
function expectedConcreteOp(command) {
|
|
74
|
-
if (command.kind === 'op') {
|
|
75
|
-
return command.op;
|
|
76
|
-
}
|
|
77
|
-
const target = concreteSingleCell(command.target);
|
|
78
|
-
if (target === null) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
switch (command.kind) {
|
|
82
|
-
case 'writeFormula':
|
|
83
|
-
return {
|
|
84
|
-
kind: 'setCellFormula',
|
|
85
|
-
sheetName: target.sheetName,
|
|
86
|
-
address: target.address,
|
|
87
|
-
formula: command.formula,
|
|
88
|
-
};
|
|
89
|
-
case 'writeValue':
|
|
90
|
-
return {
|
|
91
|
-
kind: 'setCellValue',
|
|
92
|
-
sheetName: target.sheetName,
|
|
93
|
-
address: target.address,
|
|
94
|
-
value: command.value,
|
|
95
|
-
};
|
|
96
|
-
case 'clear':
|
|
97
|
-
return {
|
|
98
|
-
kind: 'clearCell',
|
|
99
|
-
sheetName: target.sheetName,
|
|
100
|
-
address: target.address,
|
|
101
|
-
};
|
|
102
|
-
case 'format':
|
|
103
|
-
if (command.numberFormat === undefined) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
kind: 'setCellFormat',
|
|
108
|
-
sheetName: target.sheetName,
|
|
109
|
-
address: target.address,
|
|
110
|
-
format: command.numberFormat,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function opIndexesFor(command, ops) {
|
|
115
|
-
const expected = expectedConcreteOp(command);
|
|
116
|
-
if (expected === null) {
|
|
117
|
-
return [];
|
|
118
|
-
}
|
|
119
|
-
const expectedKey = opKey(expected);
|
|
120
|
-
return ops.flatMap((op, index) => (opKey(op) === expectedKey ? [index] : []));
|
|
121
|
-
}
|
|
122
|
-
function commandMaterialization(command, opIndexes) {
|
|
123
|
-
if (command.kind === 'op') {
|
|
124
|
-
return 'providedOp';
|
|
125
|
-
}
|
|
126
|
-
return opIndexes.length === 0 ? 'adapterMaterialization' : 'concreteOp';
|
|
127
|
-
}
|
|
128
|
-
function commandRequirement(command, commandIndex, ops) {
|
|
129
|
-
const opIndexes = opIndexesFor(command, ops);
|
|
41
|
+
function commandRequirement(command, commandIndex) {
|
|
130
42
|
return {
|
|
131
43
|
kind: 'apply',
|
|
132
44
|
capability: commandCapability(command),
|
|
133
|
-
path: `commands[${String(commandIndex)}]`,
|
|
134
45
|
commandIndex,
|
|
135
|
-
materialization: commandMaterialization(command, opIndexes),
|
|
136
|
-
...(opIndexes.length > 0 ? { opIndexes } : {}),
|
|
137
46
|
...(command.kind === 'op' ? { opKind: command.op.kind } : {}),
|
|
138
47
|
...describedRef(command.target),
|
|
139
48
|
...describedRefs(commandRefs(command)),
|
|
@@ -147,12 +56,10 @@ function readRequirement(check, checkIndex) {
|
|
|
147
56
|
return {
|
|
148
57
|
kind: 'read',
|
|
149
58
|
capability: 'read',
|
|
150
|
-
path: `checks[${String(checkIndex)}]`,
|
|
151
59
|
checkIndex,
|
|
152
60
|
checkKind: check.kind,
|
|
153
61
|
...describedRef(check.target),
|
|
154
62
|
...describedRefs(check.expectation.kind === 'formulaEquals' ? check.expectation.inputs : undefined),
|
|
155
|
-
expectation: expectationDescription(check.expectation),
|
|
156
63
|
message: `Read ${check.target?.label ?? check.kind} for ${check.expectation.kind}`,
|
|
157
64
|
};
|
|
158
65
|
}
|
|
@@ -163,7 +70,6 @@ function verifyRequirement(check, checkIndex) {
|
|
|
163
70
|
return {
|
|
164
71
|
kind: 'verify',
|
|
165
72
|
capability: 'verifyCheck',
|
|
166
|
-
path: `checks[${String(checkIndex)}]`,
|
|
167
73
|
checkIndex,
|
|
168
74
|
checkKind: check.kind,
|
|
169
75
|
...describedRef(check.target),
|
|
@@ -185,19 +91,26 @@ function canonicalValue(value) {
|
|
|
185
91
|
function opKey(op) {
|
|
186
92
|
return JSON.stringify(canonicalValue(op));
|
|
187
93
|
}
|
|
94
|
+
function commandOpKeys(commands) {
|
|
95
|
+
const keys = new Set();
|
|
96
|
+
commands.forEach((command) => {
|
|
97
|
+
if (command.kind === 'op') {
|
|
98
|
+
keys.add(opKey(command.op));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return keys;
|
|
102
|
+
}
|
|
188
103
|
export function describeRuntimeRequirements(plan) {
|
|
189
|
-
const requirements = plan.commands.map(
|
|
190
|
-
const
|
|
104
|
+
const requirements = plan.commands.map(commandRequirement);
|
|
105
|
+
const explicitCommandOps = commandOpKeys(plan.commands);
|
|
191
106
|
plan.ops.forEach((op, opIndex) => {
|
|
192
|
-
if (
|
|
107
|
+
if (explicitCommandOps.has(opKey(op))) {
|
|
193
108
|
return;
|
|
194
109
|
}
|
|
195
110
|
requirements.push({
|
|
196
111
|
kind: 'apply',
|
|
197
112
|
capability: 'applyOp',
|
|
198
|
-
path: `ops[${String(opIndex)}]`,
|
|
199
113
|
opIndex,
|
|
200
|
-
materialization: 'providedOp',
|
|
201
114
|
opKind: op.kind,
|
|
202
115
|
message: `Apply workbook op ${op.kind}`,
|
|
203
116
|
});
|
package/dist/requirements.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirements.js","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"requirements.js","sourceRoot":"","sources":["../src/requirements.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AAI,CAAC,IAAI,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QACnD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,YAAY;KACb,CAAA;AACH,CAAC"}
|
package/dist/result.d.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import type { LiteralInput } from '@bilig/protocol';
|
|
2
2
|
import type { WorkbookRef } from './find.js';
|
|
3
|
-
import type { WorkbookActionInput } from './input.js';
|
|
4
3
|
import type { EngineOp } from './ops.js';
|
|
5
4
|
export type WorkbookCheckStatus = 'planned' | 'passed' | 'failed';
|
|
6
5
|
export type WorkbookCheckExpectation = {
|
|
7
6
|
readonly kind: 'valueEquals';
|
|
8
7
|
readonly value: LiteralInput;
|
|
9
|
-
} | {
|
|
10
|
-
readonly kind: 'valuesEqual';
|
|
11
|
-
readonly values: readonly (readonly LiteralInput[])[];
|
|
12
8
|
} | {
|
|
13
9
|
readonly kind: 'formulaEquals';
|
|
14
10
|
readonly formula: string;
|
|
15
11
|
readonly inputs: readonly WorkbookRef[];
|
|
16
|
-
} | {
|
|
17
|
-
readonly kind: 'formulasEqual';
|
|
18
|
-
readonly formulas: readonly (readonly (string | null)[])[];
|
|
19
12
|
};
|
|
20
13
|
export interface WorkbookCheckResult {
|
|
21
14
|
readonly status: WorkbookCheckStatus;
|
|
@@ -34,28 +27,18 @@ export interface WorkbookUndoRef {
|
|
|
34
27
|
readonly id: string;
|
|
35
28
|
readonly ops?: readonly EngineOp[];
|
|
36
29
|
}
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
readonly ops?: readonly EngineOp[];
|
|
40
|
-
}
|
|
41
|
-
export type WorkbookRunErrorCode = 'action_not_found' | 'invalid_action_input' | 'find_failed' | 'checks_failed' | 'action_failed' | 'duplicate_ref' | 'command_target_not_resolved' | 'formula_input_not_resolved' | 'invalid_formula' | 'change_target_not_resolved' | 'check_status_not_planned' | 'check_target_not_resolved' | 'check_ref_not_resolved' | 'check_expectation_input_not_resolved' | 'invalid_check_expectation_formula' | 'invalid_workbook_op' | 'op_target_mismatch' | 'missing_concrete_op' | 'missing_workbook_op' | 'apply_failed' | 'readback_failed' | 'readback_missing' | 'duplicate_readback' | 'value_mismatch' | 'values_mismatch' | 'formula_mismatch' | 'formulas_mismatch' | 'invalid_check_verification' | 'check_verification_failed' | 'check_failed' | 'check_not_verified' | 'invalid_runtime_result' | 'runtime_rejected';
|
|
42
|
-
export declare const workbookRunErrorCodes: readonly ("action_not_found" | "invalid_action_input" | "find_failed" | "checks_failed" | "action_failed" | "duplicate_ref" | "command_target_not_resolved" | "formula_input_not_resolved" | "invalid_formula" | "change_target_not_resolved" | "check_status_not_planned" | "check_target_not_resolved" | "check_ref_not_resolved" | "check_expectation_input_not_resolved" | "invalid_check_expectation_formula" | "invalid_workbook_op" | "op_target_mismatch" | "missing_concrete_op" | "missing_workbook_op" | "apply_failed" | "readback_failed" | "readback_missing" | "duplicate_readback" | "value_mismatch" | "values_mismatch" | "formula_mismatch" | "formulas_mismatch" | "invalid_check_verification" | "check_verification_failed" | "check_failed" | "check_not_verified" | "invalid_runtime_result" | "runtime_rejected")[];
|
|
30
|
+
export type WorkbookRunErrorCode = 'action_not_found' | 'invalid_action_input' | 'find_failed' | 'checks_failed' | 'action_failed' | 'duplicate_ref' | 'command_target_not_resolved' | 'formula_input_not_resolved' | 'invalid_formula' | 'change_target_not_resolved' | 'check_status_not_planned' | 'check_target_not_resolved' | 'check_ref_not_resolved' | 'check_expectation_input_not_resolved' | 'invalid_check_expectation_formula' | 'invalid_workbook_op' | 'op_target_mismatch' | 'missing_concrete_op' | 'missing_workbook_op' | 'apply_failed' | 'readback_failed' | 'readback_missing' | 'value_mismatch' | 'formula_mismatch' | 'invalid_check_verification' | 'check_verification_failed' | 'check_failed' | 'check_not_verified' | 'runtime_rejected';
|
|
31
|
+
export declare const workbookRunErrorCodes: readonly ("action_not_found" | "invalid_action_input" | "find_failed" | "checks_failed" | "action_failed" | "duplicate_ref" | "command_target_not_resolved" | "formula_input_not_resolved" | "invalid_formula" | "change_target_not_resolved" | "check_status_not_planned" | "check_target_not_resolved" | "check_ref_not_resolved" | "check_expectation_input_not_resolved" | "invalid_check_expectation_formula" | "invalid_workbook_op" | "op_target_mismatch" | "missing_concrete_op" | "missing_workbook_op" | "apply_failed" | "readback_failed" | "readback_missing" | "value_mismatch" | "formula_mismatch" | "invalid_check_verification" | "check_verification_failed" | "check_failed" | "check_not_verified" | "runtime_rejected")[];
|
|
43
32
|
export declare function isWorkbookRunErrorCode(value: unknown): value is WorkbookRunErrorCode;
|
|
44
33
|
export interface WorkbookRunError {
|
|
45
34
|
readonly code: WorkbookRunErrorCode;
|
|
46
35
|
readonly message: string;
|
|
47
|
-
readonly path?: string;
|
|
48
|
-
readonly target?: WorkbookRef;
|
|
49
|
-
readonly check?: WorkbookCheckResult;
|
|
50
|
-
readonly expected?: WorkbookActionInput;
|
|
51
|
-
readonly actual?: WorkbookActionInput;
|
|
52
36
|
}
|
|
53
37
|
export type WorkbookRunResult = {
|
|
54
38
|
readonly status: 'done';
|
|
55
39
|
readonly changed: readonly WorkbookChangeSummary[];
|
|
56
40
|
readonly checks: readonly WorkbookCheckResult[];
|
|
57
41
|
readonly undo?: WorkbookUndoRef;
|
|
58
|
-
readonly applied?: WorkbookAppliedSummary;
|
|
59
42
|
} | {
|
|
60
43
|
readonly status: 'failed';
|
|
61
44
|
readonly errors: readonly WorkbookRunError[];
|
package/dist/result.js
CHANGED
|
@@ -21,16 +21,12 @@ export const workbookRunErrorCodes = Object.freeze([
|
|
|
21
21
|
'apply_failed',
|
|
22
22
|
'readback_failed',
|
|
23
23
|
'readback_missing',
|
|
24
|
-
'duplicate_readback',
|
|
25
24
|
'value_mismatch',
|
|
26
|
-
'values_mismatch',
|
|
27
25
|
'formula_mismatch',
|
|
28
|
-
'formulas_mismatch',
|
|
29
26
|
'invalid_check_verification',
|
|
30
27
|
'check_verification_failed',
|
|
31
28
|
'check_failed',
|
|
32
29
|
'check_not_verified',
|
|
33
|
-
'invalid_runtime_result',
|
|
34
30
|
'runtime_rejected',
|
|
35
31
|
]);
|
|
36
32
|
export function isWorkbookRunErrorCode(value) {
|
package/dist/result.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAoEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,kBAAkB;IAClB,sBAAsB;IACtB,aAAa;IACb,eAAe;IACf,eAAe;IACf,eAAe;IACf,6BAA6B;IAC7B,4BAA4B;IAC5B,iBAAiB;IACjB,4BAA4B;IAC5B,0BAA0B;IAC1B,2BAA2B;IAC3B,wBAAwB;IACxB,sCAAsC;IACtC,mCAAmC;IACnC,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,4BAA4B;IAC5B,2BAA2B;IAC3B,cAAc;IACd,oBAAoB;IACpB,kBAAkB;CACuB,CAAC,CAAA;AAE5C,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAA;AAC1F,CAAC"}
|
package/dist/run.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WorkbookRef } from './find.js';
|
|
2
2
|
import type { WorkbookActionInput } from './input.js';
|
|
3
3
|
import { type WorkbookActionMap, type WorkbookActionPlan, type WorkbookModel } from './model.js';
|
|
4
4
|
import { type WorkbookRunReadback } from './readback.js';
|
|
5
|
-
import type {
|
|
6
|
-
import { type WorkbookCheckResult, type WorkbookRunError, type WorkbookRunResult, type WorkbookUndoRef } from './result.js';
|
|
5
|
+
import type { WorkbookCheckResult, WorkbookRunError, WorkbookRunResult, WorkbookUndoRef } from './result.js';
|
|
7
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
8
7
|
export interface WorkbookRunApplyResult {
|
|
9
8
|
readonly status: 'applied' | 'failed';
|
|
@@ -11,7 +10,6 @@ export interface WorkbookRunApplyResult {
|
|
|
11
10
|
readonly undo?: WorkbookUndoRef;
|
|
12
11
|
}
|
|
13
12
|
export interface WorkbookRunAdapter<Refs = unknown> {
|
|
14
|
-
readonly preview?: (plan: WorkbookActionPlan<Refs>) => MaybePromise<WorkbookRuntimePreview>;
|
|
15
13
|
readonly apply: (plan: WorkbookActionPlan<Refs>) => MaybePromise<WorkbookRunApplyResult>;
|
|
16
14
|
readonly read?: (targets: readonly WorkbookRef[], plan: WorkbookActionPlan<Refs>) => MaybePromise<readonly WorkbookRunReadback[]>;
|
|
17
15
|
readonly verifyChecks?: (checks: readonly WorkbookCheckResult[], plan: WorkbookActionPlan<Refs>) => MaybePromise<readonly WorkbookCheckResult[]>;
|
package/dist/run.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { isLiteralInput } from '@bilig/protocol';
|
|
2
|
-
import { isWorkbookRef } from './find.js';
|
|
3
|
-
import { isWorkbookOp } from './guards.js';
|
|
4
1
|
import { planWorkbookAction } from './model.js';
|
|
5
2
|
import { verifyWorkbookReadbacks } from './readback.js';
|
|
6
|
-
import { isWorkbookRunErrorCode, } from './result.js';
|
|
7
3
|
import { verifyPlan } from './verify.js';
|
|
8
4
|
function errorMessage(error) {
|
|
9
5
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -14,40 +10,6 @@ function runError(code, message) {
|
|
|
14
10
|
message,
|
|
15
11
|
};
|
|
16
12
|
}
|
|
17
|
-
function runtimeResultError(message, path = 'runtime') {
|
|
18
|
-
return {
|
|
19
|
-
code: 'invalid_runtime_result',
|
|
20
|
-
message,
|
|
21
|
-
path,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function planIssueError(issue) {
|
|
25
|
-
return {
|
|
26
|
-
code: issue.code,
|
|
27
|
-
message: issue.message,
|
|
28
|
-
path: issue.path,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function readbackIssueError(issue) {
|
|
32
|
-
return {
|
|
33
|
-
code: issue.code,
|
|
34
|
-
message: issue.message,
|
|
35
|
-
...(issue.path !== undefined ? { path: issue.path } : {}),
|
|
36
|
-
...(issue.target !== undefined ? { target: issue.target } : {}),
|
|
37
|
-
check: issue.check,
|
|
38
|
-
...(issue.expected !== undefined ? { expected: issue.expected } : {}),
|
|
39
|
-
...(issue.actual !== undefined ? { actual: issue.actual } : {}),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function appliedSummary(preview) {
|
|
43
|
-
if (preview === undefined) {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
opCount: preview.materializedOps.length,
|
|
48
|
-
ops: preview.materializedOps,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
13
|
function readbackTargets(checks) {
|
|
52
14
|
const targets = [];
|
|
53
15
|
const seen = new Set();
|
|
@@ -71,16 +33,14 @@ function failedFromPlanIssues(plan) {
|
|
|
71
33
|
}
|
|
72
34
|
return {
|
|
73
35
|
status: 'failed',
|
|
74
|
-
errors: verification.issues.map(
|
|
36
|
+
errors: verification.issues.map((issue) => runError(issue.code, issue.message)),
|
|
75
37
|
checks: plan.checks,
|
|
76
38
|
};
|
|
77
39
|
}
|
|
78
40
|
function failedApplyResult(plan, result) {
|
|
79
41
|
return {
|
|
80
42
|
status: 'failed',
|
|
81
|
-
errors: result.errors
|
|
82
|
-
? result.errors
|
|
83
|
-
: [runError('apply_failed', `Workbook action ${plan.modelName}.${plan.actionName} failed to apply`)],
|
|
43
|
+
errors: result.errors ?? [runError('apply_failed', `Workbook action ${plan.modelName}.${plan.actionName} failed to apply`)],
|
|
84
44
|
checks: plan.checks,
|
|
85
45
|
};
|
|
86
46
|
}
|
|
@@ -129,171 +89,6 @@ function isCheckStatus(value) {
|
|
|
129
89
|
function isRecord(value) {
|
|
130
90
|
return typeof value === 'object' && value !== null;
|
|
131
91
|
}
|
|
132
|
-
function isStringOrNull(value) {
|
|
133
|
-
return typeof value === 'string' || value === null;
|
|
134
|
-
}
|
|
135
|
-
function isRectangularMatrix(value) {
|
|
136
|
-
const width = value[0]?.length;
|
|
137
|
-
return value.every((row) => row.length === width);
|
|
138
|
-
}
|
|
139
|
-
function isLiteralMatrix(value) {
|
|
140
|
-
return (Array.isArray(value) &&
|
|
141
|
-
value.every((row) => Array.isArray(row) && row.every((entry) => isLiteralInput(entry))) &&
|
|
142
|
-
isRectangularMatrix(value));
|
|
143
|
-
}
|
|
144
|
-
function isFormulaMatrix(value) {
|
|
145
|
-
return Array.isArray(value) && value.every((row) => Array.isArray(row) && row.every(isStringOrNull)) && isRectangularMatrix(value);
|
|
146
|
-
}
|
|
147
|
-
function normalizedCellReadback(value) {
|
|
148
|
-
if (!isRecord(value) || typeof value['sheetName'] !== 'string' || typeof value['address'] !== 'string') {
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
const cell = {
|
|
152
|
-
sheetName: value['sheetName'],
|
|
153
|
-
address: value['address'],
|
|
154
|
-
};
|
|
155
|
-
if (value['value'] !== undefined) {
|
|
156
|
-
if (!isLiteralInput(value['value'])) {
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
cell.value = value['value'];
|
|
160
|
-
}
|
|
161
|
-
if (value['formula'] !== undefined) {
|
|
162
|
-
if (!isStringOrNull(value['formula'])) {
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
cell.formula = value['formula'];
|
|
166
|
-
}
|
|
167
|
-
return cell;
|
|
168
|
-
}
|
|
169
|
-
function isPreviewRequirement(value) {
|
|
170
|
-
return (isRecord(value) &&
|
|
171
|
-
(value['kind'] === 'apply' || value['kind'] === 'read' || value['kind'] === 'verify') &&
|
|
172
|
-
typeof value['capability'] === 'string' &&
|
|
173
|
-
typeof value['path'] === 'string' &&
|
|
174
|
-
typeof value['message'] === 'string');
|
|
175
|
-
}
|
|
176
|
-
function isRunError(value) {
|
|
177
|
-
return isRecord(value) && isWorkbookRunErrorCode(value['code']) && typeof value['message'] === 'string';
|
|
178
|
-
}
|
|
179
|
-
function validatePreviewResult(value, plan) {
|
|
180
|
-
if (!isRecord(value)) {
|
|
181
|
-
return runtimeResultError('Runtime preview must return an object', 'preview');
|
|
182
|
-
}
|
|
183
|
-
if (value['modelName'] !== plan.modelName) {
|
|
184
|
-
return runtimeResultError(`Runtime preview returned modelName ${String(value['modelName'])} for ${plan.modelName}`, 'preview.modelName');
|
|
185
|
-
}
|
|
186
|
-
if (value['actionName'] !== plan.actionName) {
|
|
187
|
-
return runtimeResultError(`Runtime preview returned actionName ${String(value['actionName'])} for ${plan.actionName}`, 'preview.actionName');
|
|
188
|
-
}
|
|
189
|
-
if (!Array.isArray(value['requirements'])) {
|
|
190
|
-
return runtimeResultError('Runtime preview requirements must be an array', 'preview.requirements');
|
|
191
|
-
}
|
|
192
|
-
const requirements = value['requirements'];
|
|
193
|
-
if (!requirements.every(isPreviewRequirement)) {
|
|
194
|
-
return runtimeResultError('Runtime preview requirements must be runtime requirement objects', 'preview.requirements');
|
|
195
|
-
}
|
|
196
|
-
const materializedOps = value['materializedOps'];
|
|
197
|
-
if (!Array.isArray(materializedOps) || !materializedOps.every(isWorkbookOp)) {
|
|
198
|
-
return runtimeResultError('Runtime preview materializedOps must be a WorkbookOp array', 'preview.materializedOps');
|
|
199
|
-
}
|
|
200
|
-
return {
|
|
201
|
-
modelName: plan.modelName,
|
|
202
|
-
actionName: plan.actionName,
|
|
203
|
-
requirements,
|
|
204
|
-
materializedOps,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
function validateApplyResult(value) {
|
|
208
|
-
if (!isRecord(value)) {
|
|
209
|
-
return runtimeResultError('Runtime apply must return an object', 'apply');
|
|
210
|
-
}
|
|
211
|
-
if (value['status'] !== 'applied' && value['status'] !== 'failed') {
|
|
212
|
-
return runtimeResultError('Runtime apply status must be applied or failed', 'apply.status');
|
|
213
|
-
}
|
|
214
|
-
const errors = value['errors'];
|
|
215
|
-
if (errors !== undefined && (!Array.isArray(errors) || !errors.every(isRunError))) {
|
|
216
|
-
return runtimeResultError('Runtime apply errors must be WorkbookRunError objects', 'apply.errors');
|
|
217
|
-
}
|
|
218
|
-
const undo = value['undo'];
|
|
219
|
-
let undoRef;
|
|
220
|
-
if (undo !== undefined) {
|
|
221
|
-
if (!isRecord(undo) || typeof undo['id'] !== 'string') {
|
|
222
|
-
return runtimeResultError('Runtime apply undo must include an id', 'apply.undo');
|
|
223
|
-
}
|
|
224
|
-
if (undo['ops'] !== undefined && (!Array.isArray(undo['ops']) || !undo['ops'].every(isWorkbookOp))) {
|
|
225
|
-
return runtimeResultError('Runtime apply undo ops must be a WorkbookOp array', 'apply.undo.ops');
|
|
226
|
-
}
|
|
227
|
-
undoRef = {
|
|
228
|
-
id: undo['id'],
|
|
229
|
-
...(undo['ops'] !== undefined ? { ops: undo['ops'] } : {}),
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
return {
|
|
233
|
-
status: value['status'],
|
|
234
|
-
...(errors !== undefined ? { errors } : {}),
|
|
235
|
-
...(undoRef !== undefined ? { undo: undoRef } : {}),
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
function validateReadbacks(value) {
|
|
239
|
-
if (!Array.isArray(value)) {
|
|
240
|
-
return runtimeResultError('Runtime read must return a readback array', 'read');
|
|
241
|
-
}
|
|
242
|
-
const readbacks = [];
|
|
243
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
244
|
-
const entry = value[index];
|
|
245
|
-
const path = `read[${index.toString()}]`;
|
|
246
|
-
if (!isRecord(entry)) {
|
|
247
|
-
return runtimeResultError('Runtime readback must be an object', path);
|
|
248
|
-
}
|
|
249
|
-
if (!isWorkbookRef(entry['target'])) {
|
|
250
|
-
return runtimeResultError('Runtime readback target must be a WorkbookRef', `${path}.target`);
|
|
251
|
-
}
|
|
252
|
-
const readback = {
|
|
253
|
-
target: entry['target'],
|
|
254
|
-
};
|
|
255
|
-
if (entry['value'] !== undefined && !isLiteralInput(entry['value'])) {
|
|
256
|
-
return runtimeResultError('Runtime readback value must be a literal input', `${path}.value`);
|
|
257
|
-
}
|
|
258
|
-
if (entry['value'] !== undefined) {
|
|
259
|
-
readback.value = entry['value'];
|
|
260
|
-
}
|
|
261
|
-
if (entry['formula'] !== undefined && !isStringOrNull(entry['formula'])) {
|
|
262
|
-
return runtimeResultError('Runtime readback formula must be a string or null', `${path}.formula`);
|
|
263
|
-
}
|
|
264
|
-
if (entry['formula'] !== undefined) {
|
|
265
|
-
readback.formula = entry['formula'];
|
|
266
|
-
}
|
|
267
|
-
if (entry['values'] !== undefined && !isLiteralMatrix(entry['values'])) {
|
|
268
|
-
return runtimeResultError('Runtime readback values must be an array of literal rows', `${path}.values`);
|
|
269
|
-
}
|
|
270
|
-
if (entry['values'] !== undefined) {
|
|
271
|
-
readback.values = entry['values'];
|
|
272
|
-
}
|
|
273
|
-
if (entry['formulas'] !== undefined && !isFormulaMatrix(entry['formulas'])) {
|
|
274
|
-
return runtimeResultError('Runtime readback formulas must be an array of string/null rows', `${path}.formulas`);
|
|
275
|
-
}
|
|
276
|
-
if (entry['formulas'] !== undefined) {
|
|
277
|
-
readback.formulas = entry['formulas'];
|
|
278
|
-
}
|
|
279
|
-
if (entry['cells'] !== undefined) {
|
|
280
|
-
if (!Array.isArray(entry['cells'])) {
|
|
281
|
-
return runtimeResultError('Runtime readback cells must be cell readback objects', `${path}.cells`);
|
|
282
|
-
}
|
|
283
|
-
const cells = [];
|
|
284
|
-
for (let cellIndex = 0; cellIndex < entry['cells'].length; cellIndex += 1) {
|
|
285
|
-
const cell = normalizedCellReadback(entry['cells'][cellIndex]);
|
|
286
|
-
if (cell === null) {
|
|
287
|
-
return runtimeResultError('Runtime readback cells must be cell readback objects', `${path}.cells`);
|
|
288
|
-
}
|
|
289
|
-
cells.push(cell);
|
|
290
|
-
}
|
|
291
|
-
readback.cells = cells;
|
|
292
|
-
}
|
|
293
|
-
readbacks.push(readback);
|
|
294
|
-
}
|
|
295
|
-
return readbacks;
|
|
296
|
-
}
|
|
297
92
|
function isWorkbookCheckResult(value) {
|
|
298
93
|
return isRecord(value) && isCheckStatus(value['status']) && typeof value['kind'] === 'string' && typeof value['message'] === 'string';
|
|
299
94
|
}
|
|
@@ -391,38 +186,9 @@ export async function runWorkbookPlan(plan, adapter) {
|
|
|
391
186
|
if (invalidPlan !== null) {
|
|
392
187
|
return invalidPlan;
|
|
393
188
|
}
|
|
394
|
-
let preview;
|
|
395
|
-
if (adapter.preview !== undefined) {
|
|
396
|
-
try {
|
|
397
|
-
const previewResult = validatePreviewResult(await adapter.preview(plan), plan);
|
|
398
|
-
if ('code' in previewResult) {
|
|
399
|
-
return {
|
|
400
|
-
status: 'failed',
|
|
401
|
-
errors: [previewResult],
|
|
402
|
-
checks: plan.checks,
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
preview = previewResult;
|
|
406
|
-
}
|
|
407
|
-
catch (error) {
|
|
408
|
-
return {
|
|
409
|
-
status: 'failed',
|
|
410
|
-
errors: [runError('runtime_rejected', errorMessage(error))],
|
|
411
|
-
checks: plan.checks,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
189
|
let applyResult;
|
|
416
190
|
try {
|
|
417
|
-
|
|
418
|
-
if ('code' in rawApplyResult) {
|
|
419
|
-
return {
|
|
420
|
-
status: 'failed',
|
|
421
|
-
errors: [rawApplyResult],
|
|
422
|
-
checks: plan.checks,
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
applyResult = rawApplyResult;
|
|
191
|
+
applyResult = await adapter.apply(plan);
|
|
426
192
|
}
|
|
427
193
|
catch (error) {
|
|
428
194
|
return {
|
|
@@ -441,21 +207,13 @@ export async function runWorkbookPlan(plan, adapter) {
|
|
|
441
207
|
const readbackVerification = verifyWorkbookReadbacks(checks, []);
|
|
442
208
|
return {
|
|
443
209
|
status: 'failed',
|
|
444
|
-
errors: readbackVerification.issues.map(
|
|
210
|
+
errors: readbackVerification.issues.map((issue) => runError(issue.code, issue.message)),
|
|
445
211
|
checks: readbackVerification.checks,
|
|
446
212
|
};
|
|
447
213
|
}
|
|
448
214
|
let readbacks;
|
|
449
215
|
try {
|
|
450
|
-
|
|
451
|
-
if ('code' in rawReadbacks) {
|
|
452
|
-
return {
|
|
453
|
-
status: 'failed',
|
|
454
|
-
errors: [rawReadbacks],
|
|
455
|
-
checks,
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
readbacks = rawReadbacks;
|
|
216
|
+
readbacks = await adapter.read(targets, plan);
|
|
459
217
|
}
|
|
460
218
|
catch (error) {
|
|
461
219
|
return {
|
|
@@ -469,7 +227,7 @@ export async function runWorkbookPlan(plan, adapter) {
|
|
|
469
227
|
if (readbackVerification.status === 'failed') {
|
|
470
228
|
return {
|
|
471
229
|
status: 'failed',
|
|
472
|
-
errors: readbackVerification.issues.map(
|
|
230
|
+
errors: readbackVerification.issues.map((issue) => runError(issue.code, issue.message)),
|
|
473
231
|
checks,
|
|
474
232
|
};
|
|
475
233
|
}
|
|
@@ -491,13 +249,11 @@ export async function runWorkbookPlan(plan, adapter) {
|
|
|
491
249
|
checks,
|
|
492
250
|
};
|
|
493
251
|
}
|
|
494
|
-
const applied = appliedSummary(preview);
|
|
495
252
|
return {
|
|
496
253
|
status: 'done',
|
|
497
254
|
changed: plan.changed,
|
|
498
255
|
checks,
|
|
499
256
|
...(applyResult.undo !== undefined ? { undo: applyResult.undo } : {}),
|
|
500
|
-
...(applied !== undefined ? { applied } : {}),
|
|
501
257
|
};
|
|
502
258
|
}
|
|
503
259
|
export async function runWorkbookAction(model, actionName, adapter, input) {
|