@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.
Files changed (146) hide show
  1. package/README.md +4 -5
  2. package/dist/src/browser.d.ts +2 -0
  3. package/dist/src/browser.d.ts.map +1 -1
  4. package/dist/src/browser.js +6 -0
  5. package/dist/src/browser.js.map +1 -1
  6. package/dist/src/environment-capture.d.ts +21 -0
  7. package/dist/src/environment-capture.d.ts.map +1 -1
  8. package/dist/src/environment-capture.js +48 -0
  9. package/dist/src/environment-capture.js.map +1 -1
  10. package/dist/src/export.d.ts +10 -5
  11. package/dist/src/export.d.ts.map +1 -1
  12. package/dist/src/export.js +31 -47
  13. package/dist/src/export.js.map +1 -1
  14. package/dist/src/export.spec.js +27 -16
  15. package/dist/src/export.spec.js.map +1 -1
  16. package/dist/src/function.d.ts.map +1 -1
  17. package/dist/src/function.js.map +1 -1
  18. package/dist/src/functions-cache.d.ts +60 -0
  19. package/dist/src/functions-cache.d.ts.map +1 -0
  20. package/dist/src/functions-cache.js +165 -0
  21. package/dist/src/functions-cache.js.map +1 -0
  22. package/dist/src/functions-link.spec.js +191 -12
  23. package/dist/src/functions-link.spec.js.map +1 -1
  24. package/dist/src/functions-resolve.d.ts +52 -23
  25. package/dist/src/functions-resolve.d.ts.map +1 -1
  26. package/dist/src/functions-resolve.js +244 -96
  27. package/dist/src/functions-resolve.js.map +1 -1
  28. package/dist/src/index.d.ts +8 -61
  29. package/dist/src/index.d.ts.map +1 -1
  30. package/dist/src/index.js +3 -8
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/internal.d.ts +53 -0
  33. package/dist/src/internal.d.ts.map +1 -0
  34. package/dist/src/internal.js +29 -0
  35. package/dist/src/internal.js.map +1 -0
  36. package/dist/src/lazy-build.d.ts +25 -0
  37. package/dist/src/lazy-build.d.ts.map +1 -0
  38. package/dist/src/lazy-build.js +56 -0
  39. package/dist/src/lazy-build.js.map +1 -0
  40. package/dist/src/lazy-build.spec.d.ts +6 -0
  41. package/dist/src/lazy-build.spec.d.ts.map +1 -0
  42. package/dist/src/lazy-build.spec.js +153 -0
  43. package/dist/src/lazy-build.spec.js.map +1 -0
  44. package/dist/src/migration.d.ts +20 -163
  45. package/dist/src/migration.d.ts.map +1 -1
  46. package/dist/src/migration.js +37 -34
  47. package/dist/src/migration.js.map +1 -1
  48. package/dist/src/migration.spec.js +83 -78
  49. package/dist/src/migration.spec.js.map +1 -1
  50. package/dist/src/mutation-programs.spec.js +211 -118
  51. package/dist/src/mutation-programs.spec.js.map +1 -1
  52. package/dist/src/mutation.d.ts +37 -141
  53. package/dist/src/mutation.d.ts.map +1 -1
  54. package/dist/src/mutation.js +66 -28
  55. package/dist/src/mutation.js.map +1 -1
  56. package/dist/src/open-beast-link.spec.js +1 -1
  57. package/dist/src/open-beast-link.spec.js.map +1 -1
  58. package/dist/src/output.js.map +1 -1
  59. package/dist/src/package.d.ts +2 -38
  60. package/dist/src/package.d.ts.map +1 -1
  61. package/dist/src/package.js +42 -175
  62. package/dist/src/package.js.map +1 -1
  63. package/dist/src/record-area.d.ts +49 -37
  64. package/dist/src/record-area.d.ts.map +1 -1
  65. package/dist/src/record-area.js +211 -131
  66. package/dist/src/record-area.js.map +1 -1
  67. package/dist/src/record-area.spec.js +79 -62
  68. package/dist/src/record-area.spec.js.map +1 -1
  69. package/dist/src/record-arguments.d.ts +55 -0
  70. package/dist/src/record-arguments.d.ts.map +1 -0
  71. package/dist/src/record-arguments.js +72 -0
  72. package/dist/src/record-arguments.js.map +1 -0
  73. package/dist/src/record-builders.d.ts +547 -0
  74. package/dist/src/record-builders.d.ts.map +1 -0
  75. package/dist/src/record-builders.js +112 -0
  76. package/dist/src/record-builders.js.map +1 -0
  77. package/dist/src/record-declared.spec.d.ts +6 -0
  78. package/dist/src/record-declared.spec.d.ts.map +1 -0
  79. package/dist/src/record-declared.spec.js +251 -0
  80. package/dist/src/record-declared.spec.js.map +1 -0
  81. package/dist/src/record-guards.d.ts +114 -1
  82. package/dist/src/record-guards.d.ts.map +1 -1
  83. package/dist/src/record-guards.js +153 -2
  84. package/dist/src/record-guards.js.map +1 -1
  85. package/dist/src/record-index.d.ts +128 -350
  86. package/dist/src/record-index.d.ts.map +1 -1
  87. package/dist/src/record-index.js +44 -481
  88. package/dist/src/record-index.js.map +1 -1
  89. package/dist/src/record-index.spec.js +124 -90
  90. package/dist/src/record-index.spec.js.map +1 -1
  91. package/dist/src/record-interval.d.ts +57 -36
  92. package/dist/src/record-interval.d.ts.map +1 -1
  93. package/dist/src/record-interval.js +136 -94
  94. package/dist/src/record-interval.js.map +1 -1
  95. package/dist/src/record-interval.spec.js +48 -27
  96. package/dist/src/record-interval.spec.js.map +1 -1
  97. package/dist/src/record-keys.d.ts +146 -0
  98. package/dist/src/record-keys.d.ts.map +1 -0
  99. package/dist/src/record-keys.js +178 -0
  100. package/dist/src/record-keys.js.map +1 -0
  101. package/dist/src/record-nested-programs.d.ts +1457 -0
  102. package/dist/src/record-nested-programs.d.ts.map +1 -0
  103. package/dist/src/record-nested-programs.js +1974 -0
  104. package/dist/src/record-nested-programs.js.map +1 -0
  105. package/dist/src/record-nested.d.ts +284 -0
  106. package/dist/src/record-nested.d.ts.map +1 -0
  107. package/dist/src/record-nested.js +304 -0
  108. package/dist/src/record-nested.js.map +1 -0
  109. package/dist/src/record-nested.spec.d.ts +6 -0
  110. package/dist/src/record-nested.spec.d.ts.map +1 -0
  111. package/dist/src/record-nested.spec.js +1032 -0
  112. package/dist/src/record-nested.spec.js.map +1 -0
  113. package/dist/src/record-patches.d.ts +25 -0
  114. package/dist/src/record-patches.d.ts.map +1 -0
  115. package/dist/src/record-patches.js +27 -0
  116. package/dist/src/record-patches.js.map +1 -0
  117. package/dist/src/record-programs.d.ts +192 -26
  118. package/dist/src/record-programs.d.ts.map +1 -1
  119. package/dist/src/record-programs.js +858 -350
  120. package/dist/src/record-programs.js.map +1 -1
  121. package/dist/src/record-programs.spec.d.ts +6 -0
  122. package/dist/src/record-programs.spec.d.ts.map +1 -0
  123. package/dist/src/record-programs.spec.js +242 -0
  124. package/dist/src/record-programs.spec.js.map +1 -0
  125. package/dist/src/record-series.d.ts +101 -97
  126. package/dist/src/record-series.d.ts.map +1 -1
  127. package/dist/src/record-series.js +198 -149
  128. package/dist/src/record-series.js.map +1 -1
  129. package/dist/src/record-series.spec.js +241 -120
  130. package/dist/src/record-series.spec.js.map +1 -1
  131. package/dist/src/record-tiles.d.ts +328 -37
  132. package/dist/src/record-tiles.d.ts.map +1 -1
  133. package/dist/src/record-tiles.js +289 -100
  134. package/dist/src/record-tiles.js.map +1 -1
  135. package/dist/src/record.d.ts +66 -12
  136. package/dist/src/record.d.ts.map +1 -1
  137. package/dist/src/record.js +103 -34
  138. package/dist/src/record.js.map +1 -1
  139. package/dist/src/record.spec.js +48 -63
  140. package/dist/src/record.spec.js.map +1 -1
  141. package/dist/src/task.d.ts.map +1 -1
  142. package/dist/src/task.js +4 -1
  143. package/dist/src/task.js.map +1 -1
  144. package/dist/src/types.d.ts +103 -37
  145. package/dist/src/types.d.ts.map +1 -1
  146. package/package.json +7 -3
@@ -2,502 +2,65 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
4
  */
5
- import { East, Expr, NullType, SetType, StructType, printType } from '@elaraai/east';
6
- import { RecordSummaryTotalsType } from '@elaraai/e3-types';
7
- import { intervalKey } from './record-interval.js';
8
- import { AREA_FIELD, areaCellExponent, areaKey } from './record-area.js';
9
- import { TILE_FIELD, seriesKeys, summaryContributions } from './record-series.js';
10
- import { checkTile } from './record-tiles.js';
11
- import { checkPure, sameEastType } from './record-guards.js';
12
- import { DEFAULT_RUNNER, runnerToVariant } from './runner.js';
13
- /** The index name reserved for the record's own collection wherever an index
14
- * is selected — a page, a key search, an arm of the mutation delta. */
15
- const RESERVED_INDEX_NAME = 'primary';
16
- /** Generate a pure key function from a field declaration. The normal index
17
- * build and mutation programs call it exactly as they call an authored key. */
18
- function fieldKey(name, keyType, valueType, on) {
19
- const rowType = valueType;
20
- if (rowType.type !== 'Struct')
21
- throw new Error(`e3.recordIndex '${name}' on requires a record with Struct rows`);
22
- if (on.length === 0)
23
- throw new Error(`e3.recordIndex '${name}' on requires at least one field`);
24
- if (new Set(on).size !== on.length)
25
- throw new Error(`e3.recordIndex '${name}' on must not repeat a field`);
26
- const fields = on.map((field) => {
27
- if (!Object.hasOwn(rowType.fields, field))
28
- throw new Error(`e3.recordIndex '${name}' on names unknown row field '${field}'`);
29
- const type = rowType.fields[field];
30
- const set = type.type === 'Set';
31
- return { field, type: set ? type.key : type, set };
32
- });
33
- const indexType = fields.length === 1 ? fields[0].type : StructType(Object.fromEntries(fields.map((f) => [f.field, f.type])));
34
- const multi = fields.some((f) => f.set);
35
- const output = multi ? SetType(indexType) : indexType;
36
- // Types are checked above; the row's dynamic field names are erased only
37
- // inside this generated East body, as in record-programs.ts.
38
- const fn = East.function([keyType, rowType], output, ($, _key, row) => {
39
- if (fields.length === 1)
40
- return row[fields[0].field];
41
- if (!multi)
42
- return Object.fromEntries(fields.map((f) => [f.field, row[f.field]]));
43
- const keys = $.let(new Set(), SetType(indexType));
44
- const append = ($, at, values) => {
45
- const field = fields[at];
46
- if (field === undefined) {
47
- $(keys.insert(values));
48
- return;
49
- }
50
- if (field.set) {
51
- $.for(row[field.field], ($, element) => append($, at + 1, { ...values, [field.field]: element }));
52
- }
53
- else
54
- append($, at + 1, { ...values, [field.field]: row[field.field] });
55
- };
56
- append($, 0, {});
57
- return keys;
58
- });
59
- return { fn, multi };
60
- }
61
- /** The signature of a function an index declares, as the guards see it. */
62
- function signatureOf(fn) {
63
- return Expr.type(fn);
64
- }
65
- /** Why an index function may be neither async nor reach a platform function:
66
- * either makes the index non-deterministic, and an index that does not equal
67
- * its rebuild is worse than no index, since the view it serves is quietly
68
- * wrong. */
69
- const INDEX_PURITY = {
70
- async: 'an async function implies platform IO, and an index is rebuilt from the record whenever it is dropped or its declaration changes.',
71
- platform: 'the index is maintained on every commit and rebuilt on demand, so a platform call makes the two disagree.',
72
- };
73
- /** Refuses an index function whose parameters are not the record's entry. */
74
- function checkEntryParams(name, role, keyType, valueType, inputs) {
75
- if (inputs.length !== 2 || !sameEastType(keyType, inputs[0]) || !sameEastType(valueType, inputs[1])) {
76
- const got = inputs.length === 0 ? 'no parameters' : inputs.map((t) => printType(t)).join(', ');
77
- throw new Error(`e3.recordIndex '${name}' ${role} must take the record's entry ` +
78
- `(${printType(keyType)}, ${printType(valueType)}), but got ${got}.`);
79
- }
80
- }
5
+ import { NullType } from '@elaraai/east';
6
+ import { indexFunctions, indexedEntry } from './record-guards.js';
7
+ import { checkLeading, fieldKeyOf } from './record-keys.js';
81
8
  /**
82
- * A record's entry types, once an index's name and its record pass: a name that
83
- * is an identifier, never `primary`, declared once on the record, over a Dict
84
- * record.
85
- *
86
- * Every guard here is a definition-time error rather than a deploy failure.
9
+ * A plain index's key function, from exactly one of `on` — row fields, whose
10
+ * key function is generated — `key` or `keys`.
11
+ *
12
+ * @param constructor - The declaration, for the refusals
13
+ * @param name - The index, for the refusals
14
+ * @param keyType - The record's key type
15
+ * @param valueType - The record's row type
16
+ * @param spec - The declaration
17
+ * @returns The key function, and whether it returns a Set of keys
18
+ * @throws {Error} When the declaration gives none of them or more than one, or `on` names no field of the row's
87
19
  */
88
- function indexedEntry(constructor, name, rec) {
89
- if (!name) {
90
- throw new Error(`${constructor} requires a non-empty name`);
91
- }
92
- if (name === RESERVED_INDEX_NAME) {
93
- throw new Error(`${constructor} cannot be named '${RESERVED_INDEX_NAME}' — that name is the ` +
94
- `record's own collection wherever an index is selected.`);
20
+ function plainKey(constructor, name, keyType, valueType, spec) {
21
+ const { on, key, keys } = spec;
22
+ if (on !== undefined && key === undefined && keys === undefined) {
23
+ if (valueType.type !== 'Struct')
24
+ throw new Error(`${constructor} '${name}' on requires a record with Struct rows`);
25
+ if (on.length === 0)
26
+ throw new Error(`${constructor} '${name}' on requires at least one field`);
27
+ const leading = checkLeading(constructor, name, valueType, on);
28
+ return { keyFn: fieldKeyOf(keyType, valueType, leading), multi: leading.multi };
95
29
  }
96
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
97
- throw new Error(`${constructor} '${name}' must be an identifier — it names a query ` +
98
- `selector in URLs and on the command line.`);
99
- }
100
- // An assembled record — a package's `records.plans` — carries its indexes
101
- // already; a bare one is checked when `e3.package` folds indexes onto it.
102
- if (rec.indexes[name] !== undefined) {
103
- throw new Error(`${constructor} '${name}' is already declared on record '${rec.name}'`);
104
- }
105
- const recordType = rec.type;
106
- if (recordType.type !== 'Dict') {
107
- throw new Error(`${constructor} '${name}' indexes a Dict record — '${rec.name}' holds ` +
108
- `${printType(rec.type)}, which has no (key, value) entry to index. A Set or ` +
109
- `Array record is read in its own order only.`);
110
- }
111
- return { keyType: recordType.key, valueType: recordType.value };
112
- }
113
- /** Refuses an option a constructor does not take, naming those it does. */
114
- function onlyOptions(constructor, name, spec, options, instead) {
115
- const extra = Object.keys(spec).filter((option) => !options.includes(option));
116
- if (extra.length === 0)
117
- return;
118
- throw new Error(`${constructor} '${name}' takes ${options.join(', ')}, not ${extra.join(', ')}` + (instead === undefined ? '' : ` — ${instead}`));
30
+ if (key !== undefined && on === undefined && keys === undefined)
31
+ return { keyFn: key, multi: false };
32
+ if (keys !== undefined && on === undefined && key === undefined)
33
+ return { keyFn: keys, multi: true };
34
+ throw new Error(`${constructor} '${name}' takes exactly one of 'key' (one entry per row) ` +
35
+ `or 'keys' (one per element of a returned Set), or 'on' (row fields)`);
119
36
  }
120
37
  /**
121
- * An index's key and projection functions, checked as every constructor checks
122
- * them: pure, over the record's entry, a `keys` function returning a Set.
123
- *
124
- * @returns The runner, and the index key and projection types the functions declare
125
- */
126
- function indexFunctions(name, keyType, valueType, keyFn, multi, valueFn, config) {
127
- const runner = config?.runner ?? DEFAULT_RUNNER;
128
- // Validate eagerly so a bad runner fails at definition time, not export time.
129
- runnerToVariant(runner);
130
- checkPure(`e3.recordIndex '${name}' ${multi ? "'keys' function" : "'key' function"}`, keyFn, INDEX_PURITY);
131
- const keySig = signatureOf(keyFn);
132
- checkEntryParams(name, multi ? "'keys' function" : "'key' function", keyType, valueType, keySig.inputs);
133
- let indexKeyType = keySig.output;
134
- if (multi) {
135
- const returned = keySig.output;
136
- if (returned.type !== 'Set') {
137
- throw new Error(`e3.recordIndex '${name}' declared with 'keys' must return a Set of index ` +
138
- `keys — one entry per element — but returns ${printType(keySig.output)}. ` +
139
- `For one entry per row use 'key'.`);
140
- }
141
- indexKeyType = returned.key;
142
- }
143
- let projectionType = NullType;
144
- if (valueFn !== undefined) {
145
- checkPure(`e3.recordIndex '${name}' 'value' projection`, valueFn, INDEX_PURITY);
146
- const valueSig = signatureOf(valueFn);
147
- checkEntryParams(name, "'value' projection", keyType, valueType, valueSig.inputs);
148
- projectionType = valueSig.output;
149
- }
150
- return { runner, indexKeyType, projectionType };
151
- }
152
- /**
153
- * Defines a secondary index over a record.
154
- *
155
- * The index is a collection `Dict<{ik, k}, P>` — the index key first, the
156
- * primary key second — so every entry sharing an index key is one contiguous
157
- * run ordered by primary key inside it, and a RANGE of index keys is one
158
- * contiguous run too. Pages and key searches take the index by name; a view
159
- * that renders from the index alone declares its fields as `value` and never
160
- * reads the primary at all.
161
- *
162
- * An index that answers more than an order has a constructor of its own:
163
- * {@link intervalIndex | e3.recordIndex.interval}, the events overlapping a time
164
- * window, and {@link areaIndex | e3.recordIndex.area}, the boxes meeting a
165
- * window. This one refuses `interval`, naming its constructor.
166
- *
167
- * Every guard here is a definition-time error rather than a deploy failure.
168
- *
169
- * @typeParam Name - Index name (literal type)
170
- * @typeParam T - The owning record's state type (a Dict)
171
- * @typeParam S - The spec as written, from which the index key and covering
172
- * projection types are read
173
- * @param name - Index name: never `primary`, and one declaration per name on
174
- * the record, which `e3.package` enforces when it folds indexes onto it
175
- * @param rec - The record to index
176
- * @param spec - `on`, `key` or `keys`; optional covering `value`
177
- * @param config - Optional runner selection (known runtimes only)
178
- * @returns A RecordIndexDef to pass to `e3.package`
179
- *
180
- * @example
181
- * ```ts
182
- * const plans = e3.record('plans', DictType(PlanKeyType, PlanRowType), new Map());
183
- *
184
- * // One key per row, with a covering projection: a queue renders from the
185
- * // index alone.
186
- * const byStatus = e3.recordIndex('by_status', plans, {
187
- * key: East.function([PlanKeyType, PlanRowType], StatusKeyType,
188
- * ($, k, v) => ({ status: v.status, due: v.due })),
189
- * value: East.function([PlanKeyType, PlanRowType], QueueCardType,
190
- * ($, k, v) => ({ title: v.title, owner: v.owner })),
191
- * });
192
- *
193
- * // A row field supplies its own key type.
194
- * const byDue = e3.recordIndex('by_due', plans, { on: ['due'] });
195
- *
196
- * // Many keys per row: a Set return.
197
- * const byResource = e3.recordIndex('by_resource', plans, {
198
- * keys: East.function([PlanKeyType, PlanRowType], SetType(ResourceRefType),
199
- * ($, k, v) => v.resources),
200
- * });
201
- *
202
- * const pkg = e3.package('planning', '1.0.0', plans, byStatus, byDue, byResource);
203
- * ```
38
+ * Builds a plain index's definition: its key from `on`, `key` or `keys`, and
39
+ * its projection from `value`, each checked as every index's functions are.
40
+ *
41
+ * @param constructor - The declaration, as a refusal names it
42
+ * @param name - The index
43
+ * @param rec - Its record
44
+ * @param spec - Exactly one of `on`, `key` and `keys`, and an optional `value`
45
+ * @param config - Its runner selection
46
+ * @returns The definition
47
+ * @throws {Error} When the spec gives none of `on`, `key` and `keys` or more than one, or on any guard every index applies
204
48
  */
205
- function plainIndex(name, rec, spec, config) {
206
- const { keyType, valueType } = indexedEntry('e3.recordIndex', name, rec);
207
- onlyOptions('e3.recordIndex', name, spec, ['on', 'key', 'keys', 'value'], 'interval' in spec
208
- ? `an interval index has a constructor of its own: e3.recordIndex.interval('${name}', record, { on?, from, to })`
209
- : undefined);
210
- if ([spec.on, spec.key, spec.keys].filter((part) => part !== undefined).length !== 1) {
211
- throw new Error(`e3.recordIndex '${name}' takes exactly one of 'key' (one entry per row) ` +
212
- `or 'keys' (one per element of a returned Set), or 'on' (row fields)`);
213
- }
214
- const generated = spec.on === undefined ? undefined : fieldKey(name, keyType, valueType, spec.on);
215
- const multi = generated?.multi ?? (spec.keys !== undefined);
216
- const keyFn = generated?.fn ?? (spec.key ?? spec.keys);
217
- const { runner, indexKeyType, projectionType } = indexFunctions(name, keyType, valueType, keyFn, multi, spec.value, config);
49
+ export function plainDefinition(constructor, name, rec, spec, config) {
50
+ const { keyType, valueType } = indexedEntry(constructor, name, rec);
51
+ const { keyFn, multi } = plainKey(constructor, name, keyType, valueType, spec);
52
+ const { runner, indexKeyType, projectionType } = indexFunctions(constructor, name, keyType, valueType, keyFn, multi, spec.value, config);
218
53
  return {
219
54
  kind: 'recordIndex',
220
55
  name,
221
56
  record: rec,
222
- on: (spec.on === undefined ? undefined : Object.freeze([...spec.on])),
57
+ on: spec.on === undefined ? undefined : Object.freeze([...spec.on]),
223
58
  keyFn,
224
59
  ...(spec.value !== undefined && { valueFn: spec.value }),
225
60
  multi,
226
- // The signature read above IS the type the spec's functions declare; the
227
- // casts only restate it at the TypeScript level.
228
61
  keyType: indexKeyType,
229
- valueType: projectionType,
62
+ valueType: projectionType ?? NullType,
230
63
  runner,
231
64
  };
232
65
  }
233
- /**
234
- * Defines an interval index over a record: the events overlapping a half-open
235
- * time window `[from, to)`, carry-in events and those spanning the whole window
236
- * among them, each once, without day fan-out or a guessed lookback.
237
- *
238
- * It is an ordinary maintained index whose keys the SDK generates: each event
239
- * is filed under at most three entries a combination of its leading fields,
240
- * independent of its duration — a centred interval tree laid along the index's
241
- * key order. A record Slice reads a window through it as one start range and
242
- * at most 54 carry-in ranges a combination. A missing start is the backlog,
243
- * selectable as Unset; a missing or non-positive end is an instant.
244
- *
245
- * @typeParam Name - Index name (literal type)
246
- * @typeParam T - The owning record's state type (a Dict of Struct rows)
247
- * @typeParam S - The spec as written, from which the index key type is read
248
- * @param name - Index name: an identifier, never `primary`, declared once on the record
249
- * @param rec - The record to index
250
- * @param spec - `from` and `to`, the row's DateTime (or Option<DateTime>)
251
- * fields an event starts and ends at, and optional exact leading `on` fields
252
- * @param config - Optional runner selection (known runtimes only)
253
- * @returns A RecordIndexDef to pass to `e3.package`, its key `{ …on, __interval, [from] }`
254
- * @throws {Error} When `from` or `to` is not a DateTime field, when the start or
255
- * the reserved `__interval` is a leading field, or on any guard
256
- * `e3.recordIndex` applies to a name and a record
257
- *
258
- * @example
259
- * ```ts
260
- * const events = e3.record('events', DictType(StringType, EventRow), new Map());
261
- * // The events of a window, whatever their status:
262
- * const byTime = e3.recordIndex.interval('by_time', events, { from: 'start', to: 'end' });
263
- * // A choice of statuses and the window, in one read:
264
- * const byStatusTime = e3.recordIndex.interval('by_status_time', events, {
265
- * on: ['status'], from: 'start', to: 'end',
266
- * });
267
- * ```
268
- */
269
- function intervalIndex(name, rec, spec, config) {
270
- const { keyType, valueType } = indexedEntry('e3.recordIndex.interval', name, rec);
271
- onlyOptions('e3.recordIndex.interval', name, spec, ['on', 'from', 'to']);
272
- const prefix = spec.on === undefined ? undefined : fieldKey(name, keyType, valueType, spec.on);
273
- const generated = intervalKey(name, keyType, valueType, spec.on ?? [], { from: spec.from, to: spec.to }, prefix);
274
- const { runner, indexKeyType } = indexFunctions(name, keyType, valueType, generated.fn, generated.multi, undefined, config);
275
- return {
276
- kind: 'recordIndex',
277
- name,
278
- record: rec,
279
- on: Object.freeze([...(spec.on ?? []), spec.from]),
280
- interval: Object.freeze({ from: spec.from, to: spec.to }),
281
- keyFn: generated.fn,
282
- multi: generated.multi,
283
- keyType: indexKeyType,
284
- valueType: NullType,
285
- runner,
286
- };
287
- }
288
- /**
289
- * Defines an area index over a record: the rows whose box meets a window, each
290
- * once, the 2D twin of {@link intervalIndex | the interval index}.
291
- *
292
- * It is an ordinary maintained index whose keys the SDK generates: a loose
293
- * quadtree laid along a Z-order curve. The domain is the square
294
- * `[−cell·2²⁷, cell·2²⁷)` world units in 29 levels; each row is filed once,
295
- * under the deepest level whose cell is at least twice its box's larger side,
296
- * in the cell holding its box's centre, its key `{ …on, __area }`. A row whose
297
- * `x` or `y` is `none` is unplaced, `__area` −1; one outside the domain, not
298
- * finite, or larger than half the domain is filed under the root. A record Slice
299
- * reads a window through it as at most 266 disjoint searches a combination of
300
- * its leading fields, every row whose box meets the window among their rows.
301
- *
302
- * It carries its rows: each entry's projection is the whole row, so a window
303
- * reads the index alone and no record segment. It takes no `value`.
304
- *
305
- * @typeParam Name - Index name (literal type)
306
- * @typeParam T - The owning record's state type (a Dict of Struct rows)
307
- * @typeParam S - The spec as written, from which the index key type is read
308
- * @param name - Index name: an identifier, never `primary`, declared once on the record
309
- * @param rec - The record to index
310
- * @param spec - The box's fields — `x`, `y` (Float, or Option<Float> for a row
311
- * that may be unplaced), `width` and `height` (Float, or neither for a point)
312
- * — `at` (`"corner"`, the default, or `"centre"`), `cell` (the finest cell's
313
- * side in world units, rounded down to a power of two) and optional exact
314
- * leading `on` fields
315
- * @param config - Optional runner selection (known runtimes only)
316
- * @returns A RecordIndexDef to pass to `e3.package`, its key `{ …on, __area }`,
317
- * its projection the row
318
- * @throws {Error} When a field is not of its option's type, naming the option,
319
- * the field and its type; when `x` and `y` are not both Options or neither,
320
- * or `width` and `height` are not given together; when `cell` is not a
321
- * positive number; when the row has a field named `__area`; or on any guard
322
- * `e3.recordIndex` applies to a name and a record
323
- *
324
- * @example
325
- * ```ts
326
- * const racks = e3.record('racks', DictType(StringType, RackRow), new Map());
327
- * // The window, whatever the rail chooses:
328
- * const racksByArea = e3.recordIndex.area('racks_by_area', racks, {
329
- * x: 'x', y: 'y', width: 'w', height: 'h', at: 'centre', cell: 0.01,
330
- * });
331
- * // Beside it, a choice of halls and the window in one read:
332
- * const racksByHallArea = e3.recordIndex.area('racks_by_hall_area', racks, {
333
- * on: ['hall'], x: 'x', y: 'y', width: 'w', height: 'h', at: 'centre', cell: 0.01,
334
- * });
335
- * ```
336
- */
337
- function areaIndex(name, rec, spec, config) {
338
- const { keyType, valueType } = indexedEntry('e3.recordIndex.area', name, rec);
339
- onlyOptions('e3.recordIndex.area', name, spec, ['on', 'x', 'y', 'width', 'height', 'at', 'cell'], 'value' in spec ? 'an area index carries the whole row as its projection, so it takes no value' : undefined);
340
- const exponent = areaCellExponent(name, spec.cell);
341
- const box = {
342
- x: spec.x, y: spec.y,
343
- ...(spec.width !== undefined && { width: spec.width }),
344
- ...(spec.height !== undefined && { height: spec.height }),
345
- at: spec.at ?? 'corner',
346
- };
347
- const prefix = spec.on === undefined ? undefined : fieldKey(name, keyType, valueType, spec.on);
348
- const generated = areaKey(name, keyType, valueType, spec.on ?? [], box, exponent, prefix);
349
- // It carries its rows (D29): each entry's projection is the whole row, so a
350
- // window reads the index alone and no record segment.
351
- const valueFn = East.function([keyType, valueType], valueType, (_$, _key, row) => row);
352
- const { runner, indexKeyType, projectionType } = indexFunctions(name, keyType, valueType, generated.fn, generated.multi, valueFn, config);
353
- return {
354
- kind: 'recordIndex',
355
- name,
356
- record: rec,
357
- on: Object.freeze([...(spec.on ?? []), AREA_FIELD]),
358
- area: Object.freeze({ ...box, cell: 2 ** exponent }),
359
- keyFn: generated.fn,
360
- valueFn,
361
- multi: generated.multi,
362
- keyType: indexKeyType,
363
- valueType: projectionType,
364
- runner,
365
- };
366
- }
367
- /**
368
- * Defines a series index over a record (#1039): its events filed by the key
369
- * they are on — a Plan's resource — and by each time tile they touch, so the
370
- * events of a block of keys over a tile are one contiguous range, a cell.
371
- *
372
- * It is an ordinary maintained index whose keys the SDK generates: an entry per
373
- * tile an event `[from, to)` overlaps, `{ …on, __tile, <key> }`, the tile its
374
- * start in UTC. An instant — no end, or one at or before its start — is under
375
- * the one tile holding it; a row with no start is under none. An event touching
376
- * more than 4,096 tiles is refused where it is written, naming it and the tile.
377
- *
378
- * It carries its rows: each entry's projection is the whole row, so a cell
379
- * reads the index alone and no record segment. It takes no `value`.
380
- *
381
- * @typeParam Name - Index name (literal type)
382
- * @typeParam T - The owning record's state type (a Dict of Struct rows)
383
- * @typeParam S - The spec as written, from which the index key type is read
384
- * @param name - Index name: an identifier, never `primary`, declared once on the record
385
- * @param rec - The record to index
386
- * @param spec - `key`, the field naming what an event is on (any but a Set);
387
- * `from` and `to`, its DateTime (or Option<DateTime>) start and end fields;
388
- * `tile`, `day`, `week`, `month`, `quarter` or `year`; and optional exact
389
- * leading `on` fields
390
- * @param config - Optional runner selection (known runtimes only)
391
- * @returns A RecordIndexDef to pass to `e3.package`, its key `{ …on, __tile, <key> }`, its projection the row
392
- * @throws {Error} When a field is not of its option's type, naming the option,
393
- * the field and its type; when the tile is not one of the five; when the row
394
- * has a field named `__tile`; or on any guard `e3.recordIndex` applies to a
395
- * name and a record
396
- *
397
- * @example
398
- * ```ts
399
- * const jobs = e3.record('jobs', DictType(StringType, JobRow), new Map());
400
- * // The jobs on each press, a week at a time:
401
- * const jobsByPressWeek = e3.recordIndex.series('jobs_by_press_week', jobs, {
402
- * key: 'press', from: 'start', to: 'end', tile: 'week',
403
- * });
404
- * ```
405
- */
406
- function seriesIndex(name, rec, spec, config) {
407
- const { keyType, valueType } = indexedEntry('e3.recordIndex.series', name, rec);
408
- onlyOptions('e3.recordIndex.series', 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);
409
- const fields = { key: spec.key, from: spec.from, to: spec.to, tile: checkTile('e3.recordIndex.series', name, spec.tile) };
410
- const prefix = spec.on === undefined ? undefined : fieldKey(name, keyType, valueType, spec.on);
411
- const generated = seriesKeys(name, keyType, valueType, spec.on ?? [], fields, prefix);
412
- // It carries its rows: each entry's projection is the whole row, so a cell
413
- // reads the index alone and no record segment.
414
- const valueFn = East.function([keyType, valueType], valueType, (_$, _key, row) => row);
415
- const { runner, indexKeyType, projectionType } = indexFunctions(name, keyType, valueType, generated.fn, generated.multi, valueFn, config);
416
- return {
417
- kind: 'recordIndex',
418
- name,
419
- record: rec,
420
- on: Object.freeze([...(spec.on ?? []), TILE_FIELD, spec.key]),
421
- series: Object.freeze(fields),
422
- keyFn: generated.fn,
423
- valueFn,
424
- multi: generated.multi,
425
- keyType: indexKeyType,
426
- valueType: projectionType,
427
- runner,
428
- };
429
- }
430
- /**
431
- * Defines a summary index over a record (#1039): under each key and time tile
432
- * of a series index, how many rows touch the tile and the milliseconds of it
433
- * they cover — what a zoomed-out view draws where its events are too many to
434
- * read.
435
- *
436
- * Its entries are `{ ik: { …on, __tile, <key> }, k: Null }` → `{ count, ms }`,
437
- * one per key a row touches, standing for every row that does. A write changes
438
- * them by adding what its rows took away and gave, summed — its program reads
439
- * the record, never the summary — and the apply drops a total whose count
440
- * reaches zero, so a maintained summary equals the one a reindex sums, byte for
441
- * byte. The totals are Integers, so the sum is exact in any order.
442
- *
443
- * An event's share of a tile is the milliseconds of it the event overlaps, and
444
- * its shares add up to its length; an instant counts in the tile holding it and
445
- * covers none of it. A row with no start counts in no tile. An event touching
446
- * more than 4,096 tiles is refused where it is written, naming it and the tile.
447
- *
448
- * @typeParam Name - Index name (literal type)
449
- * @typeParam T - The owning record's state type (a Dict of Struct rows)
450
- * @typeParam S - The spec as written, from which the index key type is read
451
- * @param name - Index name: an identifier, never `primary`, declared once on the record
452
- * @param rec - The record to total
453
- * @param spec - `key`, `from`, `to` and `tile`, as a series index takes them,
454
- * and optional exact leading `on` fields
455
- * @param config - Optional runner selection (known runtimes only)
456
- * @returns A RecordIndexDef to pass to `e3.package`, its key `{ …on, __tile, <key> }`, its value the totals
457
- * @throws {Error} As {@link seriesIndex} does
458
- *
459
- * @example
460
- * ```ts
461
- * const jobs = e3.record('jobs', DictType(StringType, JobRow), new Map());
462
- * // How busy each press is, a month at a time:
463
- * const jobsByPressMonth = e3.recordIndex.summary('jobs_by_press_month', jobs, {
464
- * key: 'press', from: 'start', to: 'end', tile: 'month',
465
- * });
466
- * ```
467
- */
468
- function summaryIndex(name, rec, spec, config) {
469
- const { keyType, valueType } = indexedEntry('e3.recordIndex.summary', name, rec);
470
- onlyOptions('e3.recordIndex.summary', name, spec, ['on', 'key', 'from', 'to', 'tile'], 'value' in spec ? 'a summary index holds its totals, so it takes no value' : undefined);
471
- const fields = { key: spec.key, from: spec.from, to: spec.to, tile: checkTile('e3.recordIndex.summary', name, spec.tile) };
472
- const prefix = spec.on === undefined ? undefined : fieldKey(name, keyType, valueType, spec.on);
473
- const generated = summaryContributions(name, keyType, valueType, spec.on ?? [], fields, prefix);
474
- const runner = config?.runner ?? DEFAULT_RUNNER;
475
- // Validate eagerly so a bad runner fails at definition time, not export time.
476
- runnerToVariant(runner);
477
- checkPure(`e3.recordIndex.summary '${name}' contributions`, generated.fn, INDEX_PURITY);
478
- checkEntryParams(name, 'contributions', keyType, valueType, signatureOf(generated.fn).inputs);
479
- return {
480
- kind: 'recordIndex',
481
- name,
482
- record: rec,
483
- on: Object.freeze([...(spec.on ?? []), TILE_FIELD, spec.key]),
484
- summary: Object.freeze(fields),
485
- keyFn: generated.fn,
486
- // A row touches several keys, and a key stands for several rows.
487
- multi: true,
488
- keyType: generated.indexType,
489
- valueType: RecordSummaryTotalsType,
490
- runner,
491
- };
492
- }
493
- /**
494
- * Defines a secondary index over a record — `e3.recordIndex(name, record, {
495
- * on | key | keys, value? })`, an order to page in — and, as its own
496
- * constructors, the indexes that answer more than an order:
497
- * `e3.recordIndex.interval` (the events overlapping a time window),
498
- * `e3.recordIndex.area` (the boxes meeting a window), `e3.recordIndex.series`
499
- * (the events of a block of keys over a span of time tiles) and
500
- * `e3.recordIndex.summary` (their totals per key and tile).
501
- */
502
- export const recordIndex = Object.assign(plainIndex, { interval: intervalIndex, area: areaIndex, series: seriesIndex, summary: summaryIndex });
503
66
  //# sourceMappingURL=record-index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record-index.js","sourceRoot":"","sources":["../../src/record-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS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