@elaraai/e3 1.0.79 → 1.0.80
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 +11 -2
- package/dist/src/browser.d.ts +5 -4
- package/dist/src/browser.d.ts.map +1 -1
- package/dist/src/browser.js +3 -2
- package/dist/src/browser.js.map +1 -1
- package/dist/src/dataset-file.d.ts +17 -19
- package/dist/src/dataset-file.d.ts.map +1 -1
- package/dist/src/dataset-file.js +26 -45
- package/dist/src/dataset-file.js.map +1 -1
- package/dist/src/export.d.ts +2 -3
- package/dist/src/export.d.ts.map +1 -1
- package/dist/src/export.js +150 -80
- package/dist/src/export.js.map +1 -1
- package/dist/src/export.spec.js +177 -57
- package/dist/src/export.spec.js.map +1 -1
- package/dist/src/function.spec.js +29 -58
- package/dist/src/function.spec.js.map +1 -1
- package/dist/src/functions-link.spec.js +19 -17
- package/dist/src/functions-link.spec.js.map +1 -1
- package/dist/src/index.d.ts +56 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/input.d.ts +8 -5
- package/dist/src/input.d.ts.map +1 -1
- package/dist/src/input.js +8 -5
- package/dist/src/input.js.map +1 -1
- package/dist/src/migration.d.ts +172 -0
- package/dist/src/migration.d.ts.map +1 -0
- package/dist/src/migration.js +108 -0
- package/dist/src/migration.js.map +1 -0
- package/dist/src/migration.spec.d.ts +6 -0
- package/dist/src/migration.spec.d.ts.map +1 -0
- package/dist/src/migration.spec.js +197 -0
- package/dist/src/migration.spec.js.map +1 -0
- package/dist/src/mutation-programs.spec.d.ts +6 -0
- package/dist/src/mutation-programs.spec.d.ts.map +1 -0
- package/dist/src/mutation-programs.spec.js +310 -0
- package/dist/src/mutation-programs.spec.js.map +1 -0
- package/dist/src/mutation.d.ts +117 -9
- package/dist/src/mutation.d.ts.map +1 -1
- package/dist/src/mutation.js +104 -46
- package/dist/src/mutation.js.map +1 -1
- package/dist/src/open-beast-link.spec.js +10 -8
- package/dist/src/open-beast-link.spec.js.map +1 -1
- package/dist/src/output.d.ts +117 -0
- package/dist/src/output.d.ts.map +1 -0
- package/dist/src/output.js +119 -0
- package/dist/src/output.js.map +1 -0
- package/dist/src/package.d.ts +7 -5
- package/dist/src/package.d.ts.map +1 -1
- package/dist/src/package.js +98 -8
- package/dist/src/package.js.map +1 -1
- package/dist/src/package.spec.d.ts +6 -0
- package/dist/src/package.spec.d.ts.map +1 -0
- package/dist/src/package.spec.js +16 -0
- package/dist/src/package.spec.js.map +1 -0
- package/dist/src/record-guards.d.ts +41 -0
- package/dist/src/record-guards.d.ts.map +1 -0
- package/dist/src/record-guards.js +44 -0
- package/dist/src/record-guards.js.map +1 -0
- package/dist/src/record-index.d.ts +129 -0
- package/dist/src/record-index.d.ts.map +1 -0
- package/dist/src/record-index.js +144 -0
- package/dist/src/record-index.js.map +1 -0
- package/dist/src/record-index.spec.d.ts +6 -0
- package/dist/src/record-index.spec.d.ts.map +1 -0
- package/dist/src/record-index.spec.js +160 -0
- package/dist/src/record-index.spec.js.map +1 -0
- package/dist/src/record-programs.d.ts +128 -0
- package/dist/src/record-programs.d.ts.map +1 -0
- package/dist/src/record-programs.js +480 -0
- package/dist/src/record-programs.js.map +1 -0
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/record.js +2 -0
- package/dist/src/record.js.map +1 -1
- package/dist/src/record.spec.js +71 -13
- package/dist/src/record.spec.js.map +1 -1
- package/dist/src/runner.d.ts +6 -9
- package/dist/src/runner.d.ts.map +1 -1
- package/dist/src/runner.js +9 -25
- package/dist/src/runner.js.map +1 -1
- package/dist/src/runner.spec.js +16 -34
- package/dist/src/runner.spec.js.map +1 -1
- package/dist/src/sha256.d.ts +4 -3
- package/dist/src/sha256.d.ts.map +1 -1
- package/dist/src/sha256.js +20 -17
- package/dist/src/sha256.js.map +1 -1
- package/dist/src/sha256.spec.js +10 -0
- package/dist/src/sha256.spec.js.map +1 -1
- package/dist/src/task.d.ts +116 -251
- package/dist/src/task.d.ts.map +1 -1
- package/dist/src/task.js +169 -435
- package/dist/src/task.js.map +1 -1
- package/dist/src/task.spec.js +174 -489
- package/dist/src/task.spec.js.map +1 -1
- package/dist/src/types.d.ts +215 -23
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The East programs a record's declarations generate.
|
|
7
|
+
*
|
|
8
|
+
* An author declares what an index keys on, how a mutation writes and how a
|
|
9
|
+
* migration changes a row; what actually runs is a program built from those
|
|
10
|
+
* declarations — an ordinary East function assembled at export time from the
|
|
11
|
+
* author's own expressions, as a stream task's output kind builds its merge
|
|
12
|
+
* function. It is linked and
|
|
13
|
+
* encoded like any other body, runs on the runner the author chose, and is
|
|
14
|
+
* what keeps e3 out of the business of evaluating user East: the engine runs a
|
|
15
|
+
* program and applies what it emits.
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
import { DictType, East, FunctionType, NullType, OptionType, PatchType, SetType, StructType, VariantType, none, some, variant, } from '@elaraai/east';
|
|
20
|
+
import { DELTA_CONFLICT, editTypeOf, indexCollectionType, mutationDeltaType, patchOpsType, } from '@elaraai/e3-types';
|
|
21
|
+
/**
|
|
22
|
+
* The entry key an index collection sorts under: `{ik, k}`.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* `ik` first, so every entry with one index key is a contiguous run — ordered
|
|
26
|
+
* by primary key inside it — and a range of index keys is one contiguous run
|
|
27
|
+
* too. Struct keys compare field by field in declaration order, which is what
|
|
28
|
+
* makes that true rather than merely intended.
|
|
29
|
+
*
|
|
30
|
+
* @param keyType - the record's primary key type
|
|
31
|
+
* @param indexKeyType - the index key
|
|
32
|
+
* @returns the entry key type
|
|
33
|
+
*/
|
|
34
|
+
export function indexEntryKeyType(keyType, indexKeyType) {
|
|
35
|
+
return StructType({ ik: indexKeyType, k: keyType });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The build program of an index: `(piece, emit) => Null`.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Called with a piece of the primary — a whole small record, or one piece of a
|
|
42
|
+
* large one — it emits each row's index entries as it reads the row. Index
|
|
43
|
+
* order is not primary order, and need not be: the runner writes a `dict`
|
|
44
|
+
* output through its RunSorter, which sorts what it is given, so the program
|
|
45
|
+
* holds no more than the row in hand.
|
|
46
|
+
*
|
|
47
|
+
* The author's key and value functions are bound as function values and
|
|
48
|
+
* CALLED, never spliced into the loop: a spliced expression tree would be
|
|
49
|
+
* re-evaluated per reference and could capture the wrong bindings.
|
|
50
|
+
*
|
|
51
|
+
* @param recordType - the record's state type, `Dict<K, V>`
|
|
52
|
+
* @param def - the index declaration
|
|
53
|
+
* @returns the program's IR bundle
|
|
54
|
+
*/
|
|
55
|
+
export function indexBuildProgram(recordType, def) {
|
|
56
|
+
const dict = recordType;
|
|
57
|
+
const entryKey = indexEntryKeyType(dict.key, def.keyType);
|
|
58
|
+
const emitType = FunctionType([entryKey, def.valueType], NullType);
|
|
59
|
+
return East.function([recordType, emitType], NullType, ($, piece, emit) => {
|
|
60
|
+
const indexKey = $.const(def.keyFn);
|
|
61
|
+
const project = def.valueFn === undefined ? undefined : $.const(def.valueFn);
|
|
62
|
+
$.for(piece, ($, row, key) => {
|
|
63
|
+
const value = project === undefined ? null : $.const(project(key, row));
|
|
64
|
+
if (def.multi) {
|
|
65
|
+
$.for(indexKey(key, row), ($, ik) => {
|
|
66
|
+
$(emit({ ik, k: key }, value));
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
$(emit({ ik: indexKey(key, row), k: key }, value));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return null;
|
|
74
|
+
}).toIR();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The program a `rows` or `rekey` migration runs over each piece of a record's
|
|
78
|
+
* state: `(piece, emit) => Null`.
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* It calls the author's function on each row, or element, as it reads it, and
|
|
82
|
+
* emits what the function returns: a `rows` step under the row's own key, or
|
|
83
|
+
* in order over an Array; a `rekey` step under the key the function returns,
|
|
84
|
+
* or, over a Set, as the element it returns. The runner writes a `dict` or
|
|
85
|
+
* `set` output through its RunSorter, which sorts what it is given, and an
|
|
86
|
+
* `array` output in the order emitted, so the program holds no more than the
|
|
87
|
+
* row in hand.
|
|
88
|
+
*
|
|
89
|
+
* The author's function is bound as a function value and CALLED, never
|
|
90
|
+
* spliced: a spliced expression tree would be re-evaluated per reference and
|
|
91
|
+
* could capture the wrong bindings.
|
|
92
|
+
*
|
|
93
|
+
* @param def - the migration, a `rows` or `rekey` step
|
|
94
|
+
* @returns the program's IR bundle
|
|
95
|
+
* @throws {Error} When the step is a `value` step, whose own function runs.
|
|
96
|
+
*/
|
|
97
|
+
export function migrationProgram(def) {
|
|
98
|
+
if (def.form === 'value') {
|
|
99
|
+
throw new Error(`e3.migration.value '${def.name}' runs its own function, and has no program`);
|
|
100
|
+
}
|
|
101
|
+
const to = def.to;
|
|
102
|
+
const emitType = to.type === 'Dict'
|
|
103
|
+
? FunctionType([to.key, to.value], NullType)
|
|
104
|
+
: FunctionType([(to.type === 'Array' ? to.value : to.key)], NullType);
|
|
105
|
+
return East.function([def.from, emitType], NullType, ($, piece, emit) => {
|
|
106
|
+
const step = $.const(def.fn);
|
|
107
|
+
if (to.type !== 'Dict') {
|
|
108
|
+
$.for(piece, ($, element) => {
|
|
109
|
+
$(emit(step(element)));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else if (def.form === 'rows') {
|
|
113
|
+
$.for(piece, ($, row, key) => {
|
|
114
|
+
$(emit(key, step(key, row)));
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
$.for(piece, ($, row, key) => {
|
|
119
|
+
const entry = $.let(step(key, row));
|
|
120
|
+
$(emit(entry.key, entry.value));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}).toIR();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The delta's targets for a record: its own collection, then each index.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* The names become the delta's variant cases, which is why `primary` is a
|
|
131
|
+
* reserved index name. Returned in the order the cases compare in — variant
|
|
132
|
+
* values order by case NAME — which is the order the delta holds their ops in.
|
|
133
|
+
*
|
|
134
|
+
* @param recordType - the record's state type, a Dict or a Set
|
|
135
|
+
* @param indexes - the record's index declarations
|
|
136
|
+
* @returns the targets, in canonical case order
|
|
137
|
+
*/
|
|
138
|
+
export function deltaTargets(recordType, indexes) {
|
|
139
|
+
const collection = recordType;
|
|
140
|
+
const targets = [
|
|
141
|
+
{ name: 'primary', keyType: collection.key, collectionType: recordType },
|
|
142
|
+
];
|
|
143
|
+
for (const index of indexes) {
|
|
144
|
+
targets.push({
|
|
145
|
+
name: index.name,
|
|
146
|
+
keyType: indexEntryKeyType(collection.key, index.keyType),
|
|
147
|
+
collectionType: indexCollectionType(collection.key, index.keyType, index.valueType),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return targets.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
151
|
+
}
|
|
152
|
+
/** The foldable op an `edit` body records per key, before the state resolves it
|
|
153
|
+
* into an insert / delete / update. `set` is deliberately not one of those:
|
|
154
|
+
* which it becomes depends on whether the record already holds the key, and
|
|
155
|
+
* the body is not the place that knows. */
|
|
156
|
+
function editOpsType(valueType) {
|
|
157
|
+
return VariantType({ set: valueType, delete: NullType, update: PatchType(valueType) });
|
|
158
|
+
}
|
|
159
|
+
/** Whether a record's own collection has a delta at all: one addressed by key,
|
|
160
|
+
* which is what lets a commit rebuild only the segments it touched. An Array
|
|
161
|
+
* record's patch is positional, and a scalar's is a replace. */
|
|
162
|
+
export function hasKeyedDelta(recordType) {
|
|
163
|
+
const t = recordType.type;
|
|
164
|
+
return t === 'Dict' || t === 'Set';
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Folds a `PatchType(State)` into the program's per-key op dict.
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* A patch has three arms and the delta has one shape, so all three land here.
|
|
171
|
+
* `replace` is the interesting one: `diff` produces it whenever every key
|
|
172
|
+
* changed, and a client may send it outright — so it is turned into per-key
|
|
173
|
+
* ops against the state rather than carried through, which is what keeps the
|
|
174
|
+
* apply's cost proportional to what actually differs. A client's `replace`
|
|
175
|
+
* whose `before` the record no longer holds is a stale write, emitted as the
|
|
176
|
+
* delta's conflict.
|
|
177
|
+
*/
|
|
178
|
+
function collectOps($, state, patchExpr, ops, keyed, verifyBefore, emit) {
|
|
179
|
+
const patch = $.let(patchExpr);
|
|
180
|
+
$.match(patch, {
|
|
181
|
+
patch: ($, entries) => {
|
|
182
|
+
$.for(entries, ($, op, key) => {
|
|
183
|
+
$(ops.insertOrUpdate(key, op));
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
replace: ($, whole) => {
|
|
187
|
+
if (verifyBefore) {
|
|
188
|
+
$.if(East.notEqual(whole.before, state), ($) => {
|
|
189
|
+
$(emit(variant(DELTA_CONFLICT, 'the patch replaces a state the record no longer holds'), variant(DELTA_CONFLICT, null)));
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (keyed === 'Set') {
|
|
193
|
+
$.for(state, ($, key) => {
|
|
194
|
+
$.if(whole.after.has(key).not(), ($) => {
|
|
195
|
+
$(ops.insertOrUpdate(key, variant('delete', null)));
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
$.for(whole.after, ($, key) => {
|
|
199
|
+
$.if(state.has(key).not(), ($) => {
|
|
200
|
+
$(ops.insertOrUpdate(key, variant('insert', null)));
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
$.for(state, ($, value, key) => {
|
|
206
|
+
$.if(whole.after.has(key).not(), ($) => {
|
|
207
|
+
$(ops.insertOrUpdate(key, variant('delete', value)));
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
$.for(whole.after, ($, value, key) => {
|
|
211
|
+
$.match(state.tryGet(key), {
|
|
212
|
+
none: ($) => {
|
|
213
|
+
$(ops.insertOrUpdate(key, variant('insert', value)));
|
|
214
|
+
},
|
|
215
|
+
some: ($, held) => {
|
|
216
|
+
$.if(East.notEqual(held, value), ($) => {
|
|
217
|
+
$(ops.insertOrUpdate(key, variant('update', East.diff(held, value))));
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The program every write form runs: `(State, …Args | Patch, Emit) => Null`.
|
|
227
|
+
*
|
|
228
|
+
* @remarks
|
|
229
|
+
* One program, three forms, one output — the mutation delta, emitted entry by
|
|
230
|
+
* entry as it is computed, in any order: the runner writes a `dict` output
|
|
231
|
+
* through its RunSorter, which sorts it. e3 stores the delta as segments and
|
|
232
|
+
* applies it one target segment at a time; it never evaluates the author's
|
|
233
|
+
* East itself, which is what keeps one rule for where user code runs and gives
|
|
234
|
+
* the three runtimes something to agree on byte for byte.
|
|
235
|
+
*
|
|
236
|
+
* The three forms differ only in how the per-key ops are reached — a diff of
|
|
237
|
+
* the reducer's result, the folded writes of an `edit` body, or the client's
|
|
238
|
+
* own patch — after which the tail is shared: for each touched key, emit its
|
|
239
|
+
* op, then resolve the old and new row and ask each index what its entry was
|
|
240
|
+
* and what it becomes.
|
|
241
|
+
*
|
|
242
|
+
* A write the state moved under — a patch whose `before` the record no longer
|
|
243
|
+
* holds, an update of a row that no longer matches, a delete or update of a
|
|
244
|
+
* key the record does not hold — is emitted as a {@link DELTA_CONFLICT} entry
|
|
245
|
+
* naming it, which sorts first, rather than failing the program: a caller
|
|
246
|
+
* resubmits a conflict and gives up on a failure.
|
|
247
|
+
*
|
|
248
|
+
* The author's functions are bound as function values and CALLED, never
|
|
249
|
+
* spliced: a spliced tree would be re-evaluated per reference and could
|
|
250
|
+
* capture the wrong bindings.
|
|
251
|
+
*
|
|
252
|
+
* @param rec - the record, carrying its indexes
|
|
253
|
+
* @param mut - the mutation declaration
|
|
254
|
+
* @returns the program's IR bundle
|
|
255
|
+
* @throws {Error} When the record's collection has no keyed delta, or an
|
|
256
|
+
* `edit` / `patch` mutation has no body where one is required.
|
|
257
|
+
*/
|
|
258
|
+
export function buildMutationProgram(rec, mut) {
|
|
259
|
+
const collection = rec.type;
|
|
260
|
+
if (!hasKeyedDelta(rec.type)) {
|
|
261
|
+
throw new Error(`e3.mutation.${mut.form} '${mut.name}' writes a delta, ` +
|
|
262
|
+
`which addresses a Dict or a Set by key; record '${rec.name}' holds ${collection.type}.`);
|
|
263
|
+
}
|
|
264
|
+
const keyed = collection.type;
|
|
265
|
+
const indexes = Object.values(rec.indexes)
|
|
266
|
+
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
267
|
+
const delta = mutationDeltaType(deltaTargets(rec.type, indexes));
|
|
268
|
+
const emitType = FunctionType([delta.key, delta.value], NullType);
|
|
269
|
+
const primaryOps = patchOpsType(rec.type);
|
|
270
|
+
const opsType = DictType(collection.key, primaryOps);
|
|
271
|
+
const argTypes = mut.form === 'patch' ? [PatchType(rec.type)] : [...mut.argTypes];
|
|
272
|
+
if (mut.form !== 'patch' && mut.fn === undefined) {
|
|
273
|
+
throw new Error(`e3 mutation '${mut.name}' has no body to build its program from`);
|
|
274
|
+
}
|
|
275
|
+
return East.function([rec.type, ...argTypes, emitType], NullType, ($, ...params) => {
|
|
276
|
+
const state = params[0];
|
|
277
|
+
const emit = params[params.length - 1];
|
|
278
|
+
const args = params.slice(1, params.length - 1);
|
|
279
|
+
const ops = $.let(new Map(), opsType);
|
|
280
|
+
if (mut.form === 'patch') {
|
|
281
|
+
collectOps($, state, args[0], ops, keyed, true, emit);
|
|
282
|
+
}
|
|
283
|
+
else if (mut.form === 'reduce') {
|
|
284
|
+
const reduce = $.const(mut.fn);
|
|
285
|
+
const next = $.let(reduce(state, ...args));
|
|
286
|
+
collectOps($, state, East.diff(state, next), ops, keyed, false, emit);
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
foldEdits($, state, mut, args, ops, rec.type, emit);
|
|
290
|
+
}
|
|
291
|
+
const keyFns = indexes.map((index) => $.const(index.keyFn));
|
|
292
|
+
const valueFns = indexes.map((index) => (index.valueFn === undefined ? undefined : $.const(index.valueFn)));
|
|
293
|
+
$.for(ops, ($, op, key) => {
|
|
294
|
+
$(emit(variant('primary', key), variant('primary', op)));
|
|
295
|
+
if (indexes.length === 0)
|
|
296
|
+
return;
|
|
297
|
+
const held = $.let(state.tryGet(key));
|
|
298
|
+
const next = $.let(none, OptionType(collection.value));
|
|
299
|
+
$.match(op, {
|
|
300
|
+
insert: ($, value) => {
|
|
301
|
+
$.assign(next, some(value));
|
|
302
|
+
},
|
|
303
|
+
update: ($, patch) => {
|
|
304
|
+
$.matchTag(held, 'some', ($, value) => {
|
|
305
|
+
// Applying a patch verifies the row it was made against, and a
|
|
306
|
+
// row that no longer matches is a stale write — the conflict the
|
|
307
|
+
// engine reports when it applies an unindexed record's patch.
|
|
308
|
+
// Named in words every runtime shares: each one's own apply
|
|
309
|
+
// message is different.
|
|
310
|
+
$.try(($) => {
|
|
311
|
+
$.assign(next, some(East.applyPatch(value, patch)));
|
|
312
|
+
}).catch(($) => {
|
|
313
|
+
$(emit(variant(DELTA_CONFLICT, East.str `update of ${East.print(key)}, whose row no longer matches the patch`), variant(DELTA_CONFLICT, null)));
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
indexes.forEach((index, i) => {
|
|
319
|
+
maintainIndex($, index, key, held, next, keyFns[i], valueFns[i], emit);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
return null;
|
|
323
|
+
}).toIR();
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Runs an `edit` body against a capability that folds its writes, then resolves
|
|
327
|
+
* the fold into the per-key ops the tail shares.
|
|
328
|
+
*
|
|
329
|
+
* @remarks
|
|
330
|
+
* `set` is the reason the fold has its own op type: whether it becomes an
|
|
331
|
+
* insert or an update is a fact about the record, not about the body, and the
|
|
332
|
+
* body is not asked to know. Resolving it here is also where a `delete` or an
|
|
333
|
+
* `update` of a key the record does not hold is found — emitted as the
|
|
334
|
+
* delta's conflict naming the key, as an apply would name it, rather than
|
|
335
|
+
* reaching the apply as an op that cannot be represented.
|
|
336
|
+
*/
|
|
337
|
+
function foldEdits($, state, mut, args, ops, recordType, emit) {
|
|
338
|
+
const { key: keyType, value: valueType } = recordType;
|
|
339
|
+
const edits = $.let(new Map(), DictType(keyType, editOpsType(valueType)));
|
|
340
|
+
const capability = $.const({
|
|
341
|
+
set: East.function([keyType, valueType], NullType, ($, key, value) => {
|
|
342
|
+
$(edits.insertOrUpdate(key, variant('set', value)));
|
|
343
|
+
}),
|
|
344
|
+
delete: East.function([keyType], NullType, ($, key) => {
|
|
345
|
+
$.if(state.has(key), ($) => {
|
|
346
|
+
$(edits.insertOrUpdate(key, variant('delete', null)));
|
|
347
|
+
}).else(($) => {
|
|
348
|
+
// The record does not hold the key, so a pending `set` of it is this
|
|
349
|
+
// body creating it: deleting it again leaves the record as it was, and
|
|
350
|
+
// there is nothing to write. Anything else is a delete of a key the
|
|
351
|
+
// record does not hold, which resolving refuses.
|
|
352
|
+
$.match(edits.tryGet(key), {
|
|
353
|
+
some: ($, prior) => {
|
|
354
|
+
$.match(prior, {
|
|
355
|
+
set: ($) => {
|
|
356
|
+
$(edits.delete(key));
|
|
357
|
+
},
|
|
358
|
+
delete: ($) => {
|
|
359
|
+
$(edits.insertOrUpdate(key, variant('delete', null)));
|
|
360
|
+
},
|
|
361
|
+
update: ($) => {
|
|
362
|
+
$(edits.insertOrUpdate(key, variant('delete', null)));
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
},
|
|
366
|
+
none: ($) => {
|
|
367
|
+
$(edits.insertOrUpdate(key, variant('delete', null)));
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
}),
|
|
372
|
+
update: East.function([keyType, PatchType(valueType)], NullType, ($, key, patch) => {
|
|
373
|
+
$.match(edits.tryGet(key), {
|
|
374
|
+
none: ($) => {
|
|
375
|
+
$(edits.insertOrUpdate(key, variant('update', patch)));
|
|
376
|
+
},
|
|
377
|
+
some: ($, prior) => {
|
|
378
|
+
$.match(prior, {
|
|
379
|
+
set: ($, value) => {
|
|
380
|
+
$(edits.insertOrUpdate(key, variant('set', East.applyPatch(value, patch))));
|
|
381
|
+
},
|
|
382
|
+
update: ($, first) => {
|
|
383
|
+
$(edits.insertOrUpdate(key, variant('update', East.composePatch(first, patch, valueType))));
|
|
384
|
+
},
|
|
385
|
+
delete: ($) => {
|
|
386
|
+
$.error(East.str `update of ${East.print(key)}, which this mutation already deleted`);
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
},
|
|
390
|
+
});
|
|
391
|
+
}),
|
|
392
|
+
}, editTypeOf(recordType));
|
|
393
|
+
const body = $.const(mut.fn);
|
|
394
|
+
$(body(state, ...args, capability));
|
|
395
|
+
$.for(edits, ($, edit, key) => {
|
|
396
|
+
const held = $.let(state.tryGet(key));
|
|
397
|
+
$.match(edit, {
|
|
398
|
+
set: ($, value) => {
|
|
399
|
+
$.match(held, {
|
|
400
|
+
some: ($, prior) => {
|
|
401
|
+
// A `set` of what the record already holds changed nothing, and a
|
|
402
|
+
// delta says what changed: an op here would re-cut the segment to
|
|
403
|
+
// the bytes it already has and count itself in the history.
|
|
404
|
+
$.if(East.notEqual(prior, value), ($) => {
|
|
405
|
+
$(ops.insertOrUpdate(key, variant('update', East.diff(prior, value))));
|
|
406
|
+
});
|
|
407
|
+
},
|
|
408
|
+
none: ($) => {
|
|
409
|
+
$(ops.insertOrUpdate(key, variant('insert', value)));
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
},
|
|
413
|
+
delete: ($) => {
|
|
414
|
+
$.match(held, {
|
|
415
|
+
some: ($, prior) => {
|
|
416
|
+
$(ops.insertOrUpdate(key, variant('delete', prior)));
|
|
417
|
+
},
|
|
418
|
+
none: ($) => {
|
|
419
|
+
$(emit(variant(DELTA_CONFLICT, East.str `delete of ${East.print(key)}, which the record does not hold`), variant(DELTA_CONFLICT, null)));
|
|
420
|
+
},
|
|
421
|
+
});
|
|
422
|
+
},
|
|
423
|
+
update: ($, patch) => {
|
|
424
|
+
$.match(held, {
|
|
425
|
+
some: ($) => {
|
|
426
|
+
$(ops.insertOrUpdate(key, variant('update', patch)));
|
|
427
|
+
},
|
|
428
|
+
none: ($) => {
|
|
429
|
+
$(emit(variant(DELTA_CONFLICT, East.str `update of ${East.print(key)}, which the record does not hold`), variant(DELTA_CONFLICT, null)));
|
|
430
|
+
},
|
|
431
|
+
});
|
|
432
|
+
},
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Emits one index's entry changes for one touched row.
|
|
438
|
+
*
|
|
439
|
+
* @remarks
|
|
440
|
+
* An index entry is `{ik, k}`, so a row moving from one index key to another is
|
|
441
|
+
* a delete at the old entry and an insert at the new one — not an update. Only
|
|
442
|
+
* an entry that keeps its index key and whose covering projection changed is an
|
|
443
|
+
* update, and an index carrying no projection has none of those at all. The
|
|
444
|
+
* three sets are disjoint and `k` is this row's, so no entry is emitted twice.
|
|
445
|
+
*/
|
|
446
|
+
function maintainIndex($, index, key, held, next, indexKey, project, emit) {
|
|
447
|
+
const heldKeys = $.let(new Set(), SetType(index.keyType));
|
|
448
|
+
const nextKeys = $.let(new Set(), SetType(index.keyType));
|
|
449
|
+
const heldValue = $.let(none, OptionType(index.valueType));
|
|
450
|
+
const nextValue = $.let(none, OptionType(index.valueType));
|
|
451
|
+
const gather = (keys, value) => ($, row) => {
|
|
452
|
+
if (index.multi) {
|
|
453
|
+
$.for(indexKey(key, row), ($, ik) => {
|
|
454
|
+
$(keys.insert(ik));
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
$(keys.insert(indexKey(key, row)));
|
|
459
|
+
}
|
|
460
|
+
$.assign(value, some(project === undefined ? null : project(key, row)));
|
|
461
|
+
};
|
|
462
|
+
$.matchTag(held, 'some', gather(heldKeys, heldValue));
|
|
463
|
+
$.matchTag(next, 'some', gather(nextKeys, nextValue));
|
|
464
|
+
$.for(heldKeys.difference(nextKeys), ($, ik) => {
|
|
465
|
+
$(emit(variant(index.name, { ik, k: key }), variant(index.name, variant('delete', heldValue.unwrap()))));
|
|
466
|
+
});
|
|
467
|
+
$.for(nextKeys.difference(heldKeys), ($, ik) => {
|
|
468
|
+
$(emit(variant(index.name, { ik, k: key }), variant(index.name, variant('insert', nextValue.unwrap()))));
|
|
469
|
+
});
|
|
470
|
+
if (project === undefined)
|
|
471
|
+
return;
|
|
472
|
+
$.for(heldKeys.intersection(nextKeys), ($, ik) => {
|
|
473
|
+
const before = $.let(heldValue.unwrap());
|
|
474
|
+
const after = $.let(nextValue.unwrap());
|
|
475
|
+
$.if(East.notEqual(before, after), ($) => {
|
|
476
|
+
$(emit(variant(index.name, { ik, k: key }), variant(index.name, variant('update', East.diff(before, after)))));
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
//# sourceMappingURL=record-programs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-programs.js","sourceRoot":"","sources":["../../src/record-programs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;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QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/src/record.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/record.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,QAAQ,EAC5D,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,CAAC,EACP,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,GAC3B,SAAS,CAAC,CAAC,EAAE,CAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/record.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,QAAQ,EAC5D,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,CAAC,EACP,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,GAC3B,SAAS,CAAC,CAAC,EAAE,CAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAE,CAAC,CAcvE"}
|
package/dist/src/record.js
CHANGED
package/dist/src/record.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/record.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACnC,IAAI,EAAE,IAAI,GAAG,EAAE;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,MAAM,CACpB,IAAU,EACV,IAAO,EACP,YAA4B;IAE5B,OAAO;QACL,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,QAAQ;QACpB,IAAI;QACJ,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI;QACJ,OAAO,EAAE,YAAY;QACrB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"record.js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