@elaraai/e3 1.0.98 → 1.0.100
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 +4 -5
- package/dist/src/browser.d.ts +2 -0
- package/dist/src/browser.d.ts.map +1 -1
- package/dist/src/browser.js +6 -0
- package/dist/src/browser.js.map +1 -1
- package/dist/src/environment-capture.d.ts +21 -0
- package/dist/src/environment-capture.d.ts.map +1 -1
- package/dist/src/environment-capture.js +48 -0
- package/dist/src/environment-capture.js.map +1 -1
- package/dist/src/export.d.ts +10 -5
- package/dist/src/export.d.ts.map +1 -1
- package/dist/src/export.js +31 -47
- package/dist/src/export.js.map +1 -1
- package/dist/src/export.spec.js +27 -16
- package/dist/src/export.spec.js.map +1 -1
- package/dist/src/function.d.ts.map +1 -1
- package/dist/src/function.js.map +1 -1
- package/dist/src/functions-cache.d.ts +60 -0
- package/dist/src/functions-cache.d.ts.map +1 -0
- package/dist/src/functions-cache.js +165 -0
- package/dist/src/functions-cache.js.map +1 -0
- package/dist/src/functions-link.spec.js +191 -12
- package/dist/src/functions-link.spec.js.map +1 -1
- package/dist/src/functions-resolve.d.ts +52 -23
- package/dist/src/functions-resolve.d.ts.map +1 -1
- package/dist/src/functions-resolve.js +244 -96
- package/dist/src/functions-resolve.js.map +1 -1
- package/dist/src/index.d.ts +8 -61
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +53 -0
- package/dist/src/internal.d.ts.map +1 -0
- package/dist/src/internal.js +29 -0
- package/dist/src/internal.js.map +1 -0
- package/dist/src/lazy-build.d.ts +25 -0
- package/dist/src/lazy-build.d.ts.map +1 -0
- package/dist/src/lazy-build.js +56 -0
- package/dist/src/lazy-build.js.map +1 -0
- package/dist/src/lazy-build.spec.d.ts +6 -0
- package/dist/src/lazy-build.spec.d.ts.map +1 -0
- package/dist/src/lazy-build.spec.js +153 -0
- package/dist/src/lazy-build.spec.js.map +1 -0
- package/dist/src/migration.d.ts +20 -163
- package/dist/src/migration.d.ts.map +1 -1
- package/dist/src/migration.js +37 -34
- package/dist/src/migration.js.map +1 -1
- package/dist/src/migration.spec.js +83 -78
- package/dist/src/migration.spec.js.map +1 -1
- package/dist/src/mutation-programs.spec.js +211 -118
- package/dist/src/mutation-programs.spec.js.map +1 -1
- package/dist/src/mutation.d.ts +37 -141
- package/dist/src/mutation.d.ts.map +1 -1
- package/dist/src/mutation.js +66 -28
- package/dist/src/mutation.js.map +1 -1
- package/dist/src/open-beast-link.spec.js +1 -1
- package/dist/src/open-beast-link.spec.js.map +1 -1
- package/dist/src/output.js.map +1 -1
- package/dist/src/package.d.ts +2 -38
- package/dist/src/package.d.ts.map +1 -1
- package/dist/src/package.js +42 -175
- package/dist/src/package.js.map +1 -1
- package/dist/src/record-area.d.ts +49 -37
- package/dist/src/record-area.d.ts.map +1 -1
- package/dist/src/record-area.js +211 -131
- package/dist/src/record-area.js.map +1 -1
- package/dist/src/record-area.spec.js +79 -62
- package/dist/src/record-area.spec.js.map +1 -1
- package/dist/src/record-arguments.d.ts +55 -0
- package/dist/src/record-arguments.d.ts.map +1 -0
- package/dist/src/record-arguments.js +72 -0
- package/dist/src/record-arguments.js.map +1 -0
- package/dist/src/record-builders.d.ts +547 -0
- package/dist/src/record-builders.d.ts.map +1 -0
- package/dist/src/record-builders.js +112 -0
- package/dist/src/record-builders.js.map +1 -0
- package/dist/src/record-declared.spec.d.ts +6 -0
- package/dist/src/record-declared.spec.d.ts.map +1 -0
- package/dist/src/record-declared.spec.js +251 -0
- package/dist/src/record-declared.spec.js.map +1 -0
- package/dist/src/record-guards.d.ts +114 -1
- package/dist/src/record-guards.d.ts.map +1 -1
- package/dist/src/record-guards.js +153 -2
- package/dist/src/record-guards.js.map +1 -1
- package/dist/src/record-index.d.ts +128 -350
- package/dist/src/record-index.d.ts.map +1 -1
- package/dist/src/record-index.js +44 -481
- package/dist/src/record-index.js.map +1 -1
- package/dist/src/record-index.spec.js +124 -90
- package/dist/src/record-index.spec.js.map +1 -1
- package/dist/src/record-interval.d.ts +57 -36
- package/dist/src/record-interval.d.ts.map +1 -1
- package/dist/src/record-interval.js +136 -94
- package/dist/src/record-interval.js.map +1 -1
- package/dist/src/record-interval.spec.js +48 -27
- package/dist/src/record-interval.spec.js.map +1 -1
- package/dist/src/record-keys.d.ts +146 -0
- package/dist/src/record-keys.d.ts.map +1 -0
- package/dist/src/record-keys.js +178 -0
- package/dist/src/record-keys.js.map +1 -0
- package/dist/src/record-nested-programs.d.ts +1457 -0
- package/dist/src/record-nested-programs.d.ts.map +1 -0
- package/dist/src/record-nested-programs.js +1974 -0
- package/dist/src/record-nested-programs.js.map +1 -0
- package/dist/src/record-nested.d.ts +284 -0
- package/dist/src/record-nested.d.ts.map +1 -0
- package/dist/src/record-nested.js +304 -0
- package/dist/src/record-nested.js.map +1 -0
- package/dist/src/record-nested.spec.d.ts +6 -0
- package/dist/src/record-nested.spec.d.ts.map +1 -0
- package/dist/src/record-nested.spec.js +1032 -0
- package/dist/src/record-nested.spec.js.map +1 -0
- package/dist/src/record-patches.d.ts +25 -0
- package/dist/src/record-patches.d.ts.map +1 -0
- package/dist/src/record-patches.js +27 -0
- package/dist/src/record-patches.js.map +1 -0
- package/dist/src/record-programs.d.ts +192 -26
- package/dist/src/record-programs.d.ts.map +1 -1
- package/dist/src/record-programs.js +858 -350
- package/dist/src/record-programs.js.map +1 -1
- package/dist/src/record-programs.spec.d.ts +6 -0
- package/dist/src/record-programs.spec.d.ts.map +1 -0
- package/dist/src/record-programs.spec.js +242 -0
- package/dist/src/record-programs.spec.js.map +1 -0
- package/dist/src/record-series.d.ts +101 -97
- package/dist/src/record-series.d.ts.map +1 -1
- package/dist/src/record-series.js +198 -149
- package/dist/src/record-series.js.map +1 -1
- package/dist/src/record-series.spec.js +241 -120
- package/dist/src/record-series.spec.js.map +1 -1
- package/dist/src/record-tiles.d.ts +328 -37
- package/dist/src/record-tiles.d.ts.map +1 -1
- package/dist/src/record-tiles.js +289 -100
- package/dist/src/record-tiles.js.map +1 -1
- package/dist/src/record.d.ts +66 -12
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/record.js +103 -34
- package/dist/src/record.js.map +1 -1
- package/dist/src/record.spec.js +48 -63
- package/dist/src/record.spec.js.map +1 -1
- package/dist/src/task.d.ts.map +1 -1
- package/dist/src/task.js +4 -1
- package/dist/src/task.js.map +1 -1
- package/dist/src/types.d.ts +103 -37
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +7 -3
|
@@ -4,197 +4,246 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* The keys of a series index and the contributions of a summary index (#1039):
|
|
7
|
-
* a record's events filed by a key — the resource an event is on — and by
|
|
8
|
-
*
|
|
7
|
+
* a record's events filed by a key — the resource an event is on — and by time
|
|
8
|
+
* (`record-tiles.ts`).
|
|
9
9
|
*
|
|
10
|
-
* Both
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* contiguous range of either index: a cell.
|
|
10
|
+
* Both lead with the exact leading fields under `on` (#1432), then the key's
|
|
11
|
+
* value, so a key's entries over any span of time are one contiguous range of
|
|
12
|
+
* either index (#1433):
|
|
14
13
|
*
|
|
15
|
-
* - **A series index**
|
|
16
|
-
*
|
|
14
|
+
* - **A series index** files each event once, `{ on: { …on }, key, level,
|
|
15
|
+
* tile }`: at the finest level, from its tile up, whose shortest tile holds
|
|
16
|
+
* the event's length, under the tile of that level holding its start — or,
|
|
17
|
+
* past a year, under each year it touches (`eventFilings`). A reader reads a
|
|
18
|
+
* key one range a level, whatever the span. It is an ordinary maintained
|
|
19
|
+
* index whose keys the SDK generates, each entry carrying the row: mutation,
|
|
17
20
|
* rebuild, storage and transport are the ones every index has.
|
|
18
|
-
* - **A summary index** keeps, for each key, how many rows touch
|
|
19
|
-
* the milliseconds of it they cover
|
|
20
|
-
* contributions, `(K, V) → Dict<IK, Totals>`: the
|
|
21
|
-
* of each tile it touches, under each
|
|
21
|
+
* - **A summary index** keeps, for each key and tile, how many rows touch the
|
|
22
|
+
* tile and the milliseconds of it they cover, `{ on: { …on }, key, tile }`.
|
|
23
|
+
* Its keys come from a row's contributions, `(K, V) → Dict<IK, Totals>`: the
|
|
24
|
+
* count 1 and the row's share of each tile it touches, under each
|
|
25
|
+
* (`tileShares`).
|
|
22
26
|
*
|
|
23
27
|
* A row with no start is in neither: it has no time to file it by.
|
|
24
28
|
*
|
|
25
29
|
* @packageDocumentation
|
|
26
30
|
*/
|
|
27
|
-
import { DateTimeType, DictType, East,
|
|
28
|
-
import { RecordSummaryTotalsType } from '@elaraai/e3-types';
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
import { ArrayType, DateTimeType, DictType, East, NullType, SetType, StringType, StructType, variant, withLocationCapture, } from '@elaraai/east';
|
|
32
|
+
import { RecordLevelType, RecordSummaryTotalsType } from '@elaraai/e3-types';
|
|
33
|
+
import { INDEX_PURITY, checkEntryParams, checkPure, indexRunner, indexedEntry, onlyOptions, signatureOf, } from './record-guards.js';
|
|
34
|
+
import { checkLeading, checkTimeField, fieldReader, leadingValues } from './record-keys.js';
|
|
35
|
+
import { TILE_FNS, TileFilingType, TileShareType, checkTile } from './record-tiles.js';
|
|
36
|
+
import { lazyBuilds } from './lazy-build.js';
|
|
32
37
|
/**
|
|
33
38
|
* Checks a series or summary declaration's fields against the record's row:
|
|
34
39
|
* the key is a field that is no Set, the start and the end are DateTime or
|
|
35
|
-
* Option<DateTime> fields, the tile is one an index files by, the
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
+
* Option<DateTime> fields, the tile is one an index files by, and the leading
|
|
41
|
+
* fields take neither the key — the index orders by it already — nor the start
|
|
42
|
+
* nor the end: a leading field is matched exactly, before the key, and led by
|
|
43
|
+
* the start or the end the tiles are cut by, a key's events over a span would
|
|
44
|
+
* be a range for each instant, never one range a level.
|
|
40
45
|
*
|
|
41
46
|
* @param constructor - The constructor, as a refusal names it
|
|
42
47
|
* @param name - The index
|
|
43
48
|
* @param valueType - The record's row type
|
|
44
|
-
* @param
|
|
45
|
-
* @
|
|
46
|
-
* @returns The types the key is built from
|
|
49
|
+
* @param spec - The declaration
|
|
50
|
+
* @returns The fields
|
|
47
51
|
* @throws {Error} Naming the option, the field and why
|
|
48
52
|
*/
|
|
49
|
-
|
|
53
|
+
function checkTimeTile(constructor, name, valueType, spec) {
|
|
50
54
|
if (valueType.type !== 'Struct')
|
|
51
55
|
throw new Error(`${constructor} '${name}' indexes a record with Struct rows`);
|
|
52
56
|
const rowType = valueType;
|
|
53
|
-
checkTile(constructor, name, spec.tile);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
const keyField = rowType.fields[spec.key];
|
|
58
|
-
if (keyField === undefined)
|
|
57
|
+
const tile = checkTile(constructor, name, spec.tile);
|
|
58
|
+
const keyType = rowType.fields[spec.key];
|
|
59
|
+
if (keyType === undefined)
|
|
59
60
|
throw new Error(`${constructor} '${name}' key names unknown row field '${spec.key}'`);
|
|
60
|
-
if (
|
|
61
|
+
if (keyType.type === 'Set') {
|
|
61
62
|
throw new Error(`${constructor} '${name}' key names '${spec.key}', a Set: the key is the one field naming what an event is on`);
|
|
62
63
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
throw new Error(`${constructor} '${name}' ${option} names '${field}', of type ${printType(type)}: ${option} is a DateTime or an Option<DateTime> field`);
|
|
69
|
-
}
|
|
70
|
-
return type;
|
|
71
|
-
};
|
|
72
|
-
const startType = timed('from', spec.from);
|
|
73
|
-
const endType = timed('to', spec.to);
|
|
74
|
-
for (const field of [spec.key, TILE_FIELD]) {
|
|
75
|
-
if (on.includes(field))
|
|
76
|
-
throw new Error(`${constructor} '${name}': '${field}' follows the leading fields, and cannot be one`);
|
|
77
|
-
}
|
|
64
|
+
const start = checkTimeField(constructor, name, rowType, 'from', spec.from);
|
|
65
|
+
const end = checkTimeField(constructor, name, rowType, 'to', spec.to);
|
|
66
|
+
const on = spec.on ?? [];
|
|
67
|
+
if (on.includes(spec.key))
|
|
68
|
+
throw new Error(`${constructor} '${name}': '${spec.key}' follows the leading fields, and cannot be one`);
|
|
78
69
|
for (const [field, what] of [[spec.from, 'start'], [spec.to, 'end']]) {
|
|
79
70
|
if (on.includes(field)) {
|
|
80
71
|
throw new Error(`${constructor} '${name}': '${field}' is the event's ${what}, which its tiles are cut by, and cannot be a leading field`);
|
|
81
72
|
}
|
|
82
73
|
}
|
|
83
|
-
|
|
84
|
-
const type = rowType.fields[field];
|
|
85
|
-
return [field, type.type === 'Set' ? type.key : type];
|
|
86
|
-
}));
|
|
87
|
-
const indexType = StructType({ ...fields, [TILE_FIELD]: DateTimeType, [spec.key]: keyField });
|
|
88
|
-
return { rowType, startType, endType, indexType };
|
|
74
|
+
return { rowType, leading: checkLeading(constructor, name, rowType, on), key: { field: spec.key, type: keyType }, start, end, tile };
|
|
89
75
|
}
|
|
90
76
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
77
|
+
* A series index's definition (`index.series`): its key function,
|
|
78
|
+
* `(K, V) → Set<IK>`, an entry per place a row's event is filed
|
|
79
|
+
* (`eventFilings`: once, or once a year past a year), `{ on: { …on }, key,
|
|
80
|
+
* level, tile }` — one per combination of its leading values, a Set among them
|
|
81
|
+
* fanning out, as the interval index's do; and its projection, the whole row,
|
|
82
|
+
* so a cell reads the index alone and no record segment. It stays an ordinary
|
|
83
|
+
* maintained index: mutation, rebuild, storage and transport are shared.
|
|
84
|
+
*
|
|
85
|
+
* @param constructor - The declaration, as a refusal names it
|
|
86
|
+
* @param name - The index
|
|
87
|
+
* @param rec - Its record
|
|
88
|
+
* @param spec - The key, the start and the end, the tile, and the optional leading `on`
|
|
89
|
+
* @param config - Its runner selection
|
|
90
|
+
* @returns The definition
|
|
91
|
+
* @throws {Error} When a field is not of its option's type, naming the option, the field and its type; when the tile is
|
|
92
|
+
* not one of the five; when the key, the start or the end is a leading field; or on any guard every index applies
|
|
94
93
|
*/
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
const make = $.const(prefix.fn);
|
|
120
|
-
const values = $.let(make(key, row), prefixType.output);
|
|
121
|
-
const leadingOf = (value) => Object.fromEntries(on.map((field) => [field, on.length === 1 ? value : value[field]]));
|
|
122
|
-
if (prefix.multi)
|
|
123
|
-
$.for(values, ($, value) => file($, leadingOf(value)));
|
|
124
|
-
else
|
|
125
|
-
file($, leadingOf(values));
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
return into;
|
|
94
|
+
export function seriesDefinition(constructor, name, rec, spec, config) {
|
|
95
|
+
const { keyType, valueType } = indexedEntry(constructor, name, rec);
|
|
96
|
+
onlyOptions(constructor, name, spec, ['on', 'key', 'from', 'to', 'tile'], 'value' in spec ? 'a series index carries the whole row as its projection, so it takes no value' : undefined);
|
|
97
|
+
const fields = checkTimeTile(constructor, name, valueType, spec);
|
|
98
|
+
const { rowType, leading } = fields;
|
|
99
|
+
const indexType = StructType({ on: leading.onType, key: fields.key.type, level: RecordLevelType, tile: DateTimeType });
|
|
100
|
+
const level = variant(fields.tile, null);
|
|
101
|
+
const readKey = fieldReader(keyType, rowType, fields.key);
|
|
102
|
+
const readStart = fieldReader(keyType, rowType, { option: fields.start });
|
|
103
|
+
const readEnd = fieldReader(keyType, rowType, { option: fields.end });
|
|
104
|
+
const leads = leadingValues(keyType, rowType, leading);
|
|
105
|
+
// An event's entries under one combination of its leading values: one a place it is filed.
|
|
106
|
+
const filedUnder = East.function([leading.onType, fields.key.type, ArrayType(TileFilingType)], SetType(indexType), (_$, on, key, filings) => filings.toSet((_$, filing) => ({ on, key, level: filing.level, tile: filing.tile })));
|
|
107
|
+
const keyFn = East.function([keyType, rowType], SetType(indexType), ($, key, row) => {
|
|
108
|
+
const keyOf = $.const(readKey);
|
|
109
|
+
const startOf = $.const(readStart);
|
|
110
|
+
const endOf = $.const(readEnd);
|
|
111
|
+
const file = $.const(TILE_FNS.placedFilings);
|
|
112
|
+
const combinations = $.const(leads);
|
|
113
|
+
const under = $.const(filedUnder);
|
|
114
|
+
const eventKey = $.let(keyOf(key, row));
|
|
115
|
+
const filings = $.let(file(level, startOf(key, row), endOf(key, row), East.print(key)));
|
|
116
|
+
return combinations(key, row).flattenToSet((_$, on) => under(on, eventKey, filings));
|
|
129
117
|
});
|
|
118
|
+
// It carries its rows: each entry's projection is the whole row, so a cell reads the index alone and no record segment.
|
|
119
|
+
const valueFn = East.function([keyType, rowType], rowType, (_$, _key, row) => row);
|
|
120
|
+
const runner = indexRunner(config);
|
|
121
|
+
checkPure(`${constructor} '${name}' 'keys' function`, keyFn, INDEX_PURITY);
|
|
122
|
+
checkEntryParams(constructor, name, "'keys' function", keyType, valueType, signatureOf(keyFn).inputs);
|
|
123
|
+
return {
|
|
124
|
+
kind: 'recordIndex',
|
|
125
|
+
name,
|
|
126
|
+
record: rec,
|
|
127
|
+
on: Object.freeze([...(spec.on ?? [])]),
|
|
128
|
+
series: Object.freeze({ key: spec.key, from: spec.from, to: spec.to, tile: fields.tile }),
|
|
129
|
+
keyFn,
|
|
130
|
+
valueFn,
|
|
131
|
+
multi: true,
|
|
132
|
+
keyType: indexType,
|
|
133
|
+
valueType: rowType,
|
|
134
|
+
runner,
|
|
135
|
+
};
|
|
130
136
|
}
|
|
137
|
+
/** The largest Integer: a summary's total past it is no Integer. */
|
|
138
|
+
const INTEGER_MAX = (1n << 63n) - 1n;
|
|
139
|
+
/** What a refusal says of totals summed past the largest Integer, after naming them. */
|
|
140
|
+
const PAST_INTEGER_MAX = 'sum past the largest Integer: declare a finer tile, whose totals are smaller';
|
|
131
141
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
142
|
+
* A summary's merge, `({ik, k}, Totals, Totals) → Totals`: a build's pieces
|
|
143
|
+
* hold the same keys, and a key's totals across them are their sum, refused
|
|
144
|
+
* past the largest Integer naming the index and the key. Built with no source
|
|
145
|
+
* locations, so its program is the same wherever the package is built.
|
|
135
146
|
*
|
|
136
|
-
* @param name - The index
|
|
137
|
-
* @param
|
|
138
|
-
* @
|
|
139
|
-
* @param on - The exact leading fields
|
|
140
|
-
* @param spec - The key, the start and the end, and the tile
|
|
141
|
-
* @param prefix - The leading fields' generated key function
|
|
142
|
-
* @returns The key function and the index key's type
|
|
143
|
-
* @throws {Error} As {@link checkTimeTile} does
|
|
147
|
+
* @param name - The index
|
|
148
|
+
* @param indexType - Its key type
|
|
149
|
+
* @returns The merge
|
|
144
150
|
*/
|
|
145
|
-
export function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
export function summaryMerge(name, indexType) {
|
|
152
|
+
return withLocationCapture(false, () => East.function([StructType({ ik: indexType, k: NullType }), RecordSummaryTotalsType, RecordSummaryTotalsType], RecordSummaryTotalsType, ($, entry, a, b) => {
|
|
153
|
+
const add = $.const(SERIES_FNS.addTotals);
|
|
154
|
+
return add(East.str `${name}: the totals under ${East.print(entry)}`, a, b);
|
|
155
|
+
}));
|
|
150
156
|
}
|
|
151
157
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
158
|
+
* A summary index's definition (`index.summary`): its key function, a
|
|
159
|
+
* row's contributions, `(K, V) → Dict<IK, Totals>` — under each tile its event
|
|
160
|
+
* touches, `{ on: { …on }, key, tile }`, once per combination of its leading
|
|
161
|
+
* values, the count 1 and the milliseconds of the tile it covers — and its
|
|
162
|
+
* merge, `({ik, k}, Totals, Totals) → Totals`: a build's pieces hold the same
|
|
163
|
+
* keys, and a key's totals across them are their sum.
|
|
155
164
|
*
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
158
|
-
* @param
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
161
|
-
* @
|
|
162
|
-
* @
|
|
163
|
-
* @throws {Error} As {@link checkTimeTile} does
|
|
165
|
+
* @param constructor - The declaration, as a refusal names it
|
|
166
|
+
* @param name - The index
|
|
167
|
+
* @param rec - Its record
|
|
168
|
+
* @param spec - The key, the start and the end, the tile, and the optional leading `on`
|
|
169
|
+
* @param config - Its runner selection
|
|
170
|
+
* @returns The definition
|
|
171
|
+
* @throws {Error} As {@link seriesDefinition} does
|
|
164
172
|
*/
|
|
165
|
-
export function
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
173
|
+
export function summaryDefinition(constructor, name, rec, spec, config) {
|
|
174
|
+
const { keyType, valueType } = indexedEntry(constructor, name, rec);
|
|
175
|
+
onlyOptions(constructor, name, spec, ['on', 'key', 'from', 'to', 'tile'], 'value' in spec ? 'a summary index holds its totals, so it takes no value' : undefined);
|
|
176
|
+
const fields = checkTimeTile(constructor, name, valueType, spec);
|
|
177
|
+
const { rowType, leading } = fields;
|
|
178
|
+
const indexType = StructType({ on: leading.onType, key: fields.key.type, tile: DateTimeType });
|
|
179
|
+
const totalsType = DictType(indexType, RecordSummaryTotalsType);
|
|
180
|
+
const level = variant(fields.tile, null);
|
|
181
|
+
const readKey = fieldReader(keyType, rowType, fields.key);
|
|
182
|
+
const readStart = fieldReader(keyType, rowType, { option: fields.start });
|
|
183
|
+
const readEnd = fieldReader(keyType, rowType, { option: fields.end });
|
|
184
|
+
const leads = leadingValues(keyType, rowType, leading);
|
|
185
|
+
// An event's contributions under one combination of its leading values: the count 1 and its share, under each tile.
|
|
186
|
+
const sharesUnder = East.function([leading.onType, fields.key.type, ArrayType(TileShareType)], totalsType, (_$, on, key, shares) => shares.toDict((_$, share) => ({ on, key, tile: share.tile }), (_$, share) => ({ count: 1n, ms: share.ms })));
|
|
187
|
+
const keyFn = East.function([keyType, rowType], totalsType, ($, key, row) => {
|
|
188
|
+
const keyOf = $.const(readKey);
|
|
189
|
+
const startOf = $.const(readStart);
|
|
190
|
+
const endOf = $.const(readEnd);
|
|
191
|
+
const share = $.const(TILE_FNS.placedShares);
|
|
192
|
+
const combinations = $.const(leads);
|
|
193
|
+
const under = $.const(sharesUnder);
|
|
194
|
+
const eventKey = $.let(keyOf(key, row));
|
|
195
|
+
const shares = $.let(share(level, startOf(key, row), endOf(key, row), East.print(key)));
|
|
196
|
+
return combinations(key, row).flattenToDict((_$, on) => under(on, eventKey, shares));
|
|
197
|
+
});
|
|
198
|
+
const mergeFn = summaryMerge(name, indexType);
|
|
199
|
+
const runner = indexRunner(config);
|
|
200
|
+
checkPure(`${constructor} '${name}' contributions`, keyFn, INDEX_PURITY);
|
|
201
|
+
checkEntryParams(constructor, name, 'contributions', keyType, valueType, signatureOf(keyFn).inputs);
|
|
202
|
+
return {
|
|
203
|
+
kind: 'recordIndex',
|
|
204
|
+
name,
|
|
205
|
+
record: rec,
|
|
206
|
+
on: Object.freeze([...(spec.on ?? [])]),
|
|
207
|
+
summary: Object.freeze({ key: spec.key, from: spec.from, to: spec.to, tile: fields.tile }),
|
|
208
|
+
keyFn,
|
|
209
|
+
mergeFn,
|
|
210
|
+
// A row touches several keys, and a key stands for several rows.
|
|
211
|
+
multi: true,
|
|
212
|
+
keyType: indexType,
|
|
213
|
+
valueType: RecordSummaryTotalsType,
|
|
214
|
+
runner,
|
|
215
|
+
};
|
|
170
216
|
}
|
|
171
|
-
|
|
172
|
-
const INTEGER_MAX = (1n << 63n) - 1n;
|
|
217
|
+
// ── The functions, each built the first time it is read ──────────────────────
|
|
173
218
|
/**
|
|
174
|
-
* A summary's
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* @remarks
|
|
179
|
-
* East's Integer addition wraps, so a sum past the largest Integer is refused
|
|
180
|
-
* rather than stored below none — as a write that would carry a total past it
|
|
181
|
-
* is: a finer tile's totals are smaller.
|
|
182
|
-
*
|
|
183
|
-
* @param name - The summary, as the refusal names it
|
|
184
|
-
* @param indexType - The summary's index key
|
|
185
|
-
* @returns `({ik, k}, Totals, Totals) → Totals`
|
|
186
|
-
* @throws East runtime error when a key's totals sum past the largest Integer,
|
|
187
|
-
* naming the summary, the key and a finer tile
|
|
219
|
+
* A summary index's East functions, each built the first time it is read,
|
|
220
|
+
* with no location captured ({@link lazyBuilds}, #1466): importing the SDK
|
|
221
|
+
* builds none of them.
|
|
188
222
|
*/
|
|
189
|
-
export
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
223
|
+
export const SERIES_FNS = lazyBuilds({
|
|
224
|
+
/**
|
|
225
|
+
* Two of a summary's totals summed. Integer addition is associative and
|
|
226
|
+
* commutative, so a build's pieces fold to the same totals in any order.
|
|
227
|
+
*
|
|
228
|
+
* `(what, a, b) → a + b`, `what` naming the totals in the refusal.
|
|
229
|
+
*
|
|
230
|
+
* @remarks
|
|
231
|
+
* East's Integer addition wraps, so a sum past the largest Integer is refused
|
|
232
|
+
* rather than stored below none — as a write that would carry a total past it
|
|
233
|
+
* is: a finer tile's totals are smaller.
|
|
234
|
+
*
|
|
235
|
+
* Throws an East runtime error when the totals sum past the largest Integer,
|
|
236
|
+
* naming `what` and a finer tile.
|
|
237
|
+
*/
|
|
238
|
+
get addTotals() {
|
|
239
|
+
return East.function([StringType, RecordSummaryTotalsType, RecordSummaryTotalsType], RecordSummaryTotalsType, ($, what, a, b) => {
|
|
240
|
+
const max = $.const(INTEGER_MAX);
|
|
241
|
+
// Totals are never below none, so a sum passes the largest Integer exactly when one part passes what the other leaves of it.
|
|
242
|
+
$.if(a.count.greater(max.subtract(b.count)).or(() => a.ms.greater(max.subtract(b.ms))), ($) => {
|
|
243
|
+
$.error(East.str `${what} ${PAST_INTEGER_MAX}`);
|
|
244
|
+
});
|
|
245
|
+
return { count: a.count.add(b.count), ms: a.ms.add(b.ms) };
|
|
196
246
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
247
|
+
},
|
|
248
|
+
});
|
|
200
249
|
//# sourceMappingURL=record-series.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-series.js","sourceRoot":"","sources":["../../src/record-series.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"record-series.js","sourceRoot":"","sources":["../../src/record-series.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,mBAAmB,GAEjH,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EACL,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,GAC/F,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAgD,MAAM,kBAAkB,CAAC;AAC1I,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAmB,MAAM,mBAAmB,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA2B7C;;;;;;;;;;;;;;;GAeG;AACH,SAAS,aAAa,CAAC,WAA6B,EAAE,IAAY,EAAE,SAAmB,EAAE,IAAkB;IACzG,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;QAAE,MAAM,IAAI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