@elaraai/e3-cloud-files 1.0.97 → 1.1.1

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 (46) hide show
  1. package/README.md +208 -64
  2. package/dist/src/authoring.d.ts +42 -11
  3. package/dist/src/authoring.d.ts.map +1 -1
  4. package/dist/src/authoring.js +41 -9
  5. package/dist/src/authoring.js.map +1 -1
  6. package/dist/src/compat.d.ts +629 -13
  7. package/dist/src/compat.d.ts.map +1 -1
  8. package/dist/src/compat.js +115 -16
  9. package/dist/src/compat.js.map +1 -1
  10. package/dist/src/index.d.ts +5 -3
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/index.js +4 -2
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/s3/index.d.ts +3 -1
  15. package/dist/src/s3/index.d.ts.map +1 -1
  16. package/dist/src/s3/index.js +31 -1
  17. package/dist/src/s3/index.js.map +1 -1
  18. package/dist/src/storage/index.d.ts +13 -1
  19. package/dist/src/storage/index.d.ts.map +1 -1
  20. package/dist/src/storage/index.js +140 -5
  21. package/dist/src/storage/index.js.map +1 -1
  22. package/dist/src/sync/engine.d.ts +33 -3
  23. package/dist/src/sync/engine.d.ts.map +1 -1
  24. package/dist/src/sync/engine.js +68 -7
  25. package/dist/src/sync/engine.js.map +1 -1
  26. package/dist/src/sync/index.d.ts +1 -1
  27. package/dist/src/sync/index.d.ts.map +1 -1
  28. package/dist/src/sync/index.js +1 -1
  29. package/dist/src/sync/index.js.map +1 -1
  30. package/dist/src/sync/memory.d.ts +11 -3
  31. package/dist/src/sync/memory.d.ts.map +1 -1
  32. package/dist/src/sync/memory.js +20 -4
  33. package/dist/src/sync/memory.js.map +1 -1
  34. package/dist/src/sync/push.d.ts +9 -1
  35. package/dist/src/sync/push.d.ts.map +1 -1
  36. package/dist/src/sync/push.js +48 -15
  37. package/dist/src/sync/push.js.map +1 -1
  38. package/dist/test/decode.examples.d.ts +9 -4
  39. package/dist/test/decode.examples.d.ts.map +1 -1
  40. package/dist/test/decode.examples.js +15 -3
  41. package/dist/test/decode.examples.js.map +1 -1
  42. package/dist/test/typed.examples.d.ts +97 -4
  43. package/dist/test/typed.examples.d.ts.map +1 -1
  44. package/dist/test/typed.examples.js +80 -13
  45. package/dist/test/typed.examples.js.map +1 -1
  46. package/package.json +6 -6
package/README.md CHANGED
@@ -13,27 +13,33 @@ changed, the same way on a local repository and on a deployed workspace.
13
13
  East's JSON, as CSV, or as text. Or, named with a **type**, a beast2 file
14
14
  arrives as the value it holds, an input of that type with no task in
15
15
  between, a collection of any size.
16
- - **Records are seeded and fed from files.** A record's mutation may be fed
17
- by files: each new file is the mutation's one argument, applied once.
18
- (A record seeded from a file, `upload.record`, lands with the next e3
19
- release: see below.)
20
- - **Push from disk.** `e3-cloud files push` puts files from your machine
21
- into a source and takes them in, with your e3 login alone where the source
22
- is the deployment's own bucket.
16
+ - **Records are seeded and fed from files.** A record may be seeded from a
17
+ file (`upload.record`): pending until its file arrives, which is its
18
+ first state, and in its history the seed names the file. A record's
19
+ mutation may be fed by files: each new file is the mutation's one
20
+ argument, applied once.
21
+ - **Push from disk, or from a workspace.** `e3-cloud files push` puts files
22
+ from your machine into a source and takes them in, with your e3 login
23
+ alone where the source is the deployment's own bucket. A value an e3
24
+ workspace computes (`dataset:dev.customer_book`) pushes as the file of its
25
+ value would, with no file kept by hand, and the history names the dataset.
23
26
  - **Nothing polls.** A sync runs when someone asks for it, and reads only the
24
27
  files that changed since the last one.
25
28
 
26
- Its version is the @elaraai lockstep it is built against: install the one of
27
- the same version as your east and e3.
29
+ Its version is e3 cloud's own, shared by every `@elaraai/e3-cloud-*` package.
30
+ Each release is built with one release of east and e3, which its peers name
31
+ exactly.
28
32
 
29
33
  ## Install
30
34
 
31
35
  ```bash
32
- npm install @elaraai/e3-cloud-files@<your e3's version>
36
+ npm install @elaraai/e3-cloud-files@<release>
33
37
  ```
34
38
 
35
- Its peers are the same lockstep's `@elaraai/east` and `@elaraai/e3`. The
36
- `e3-cloud` CLI (`@elaraai/e3-cloud-cli`) deploys and syncs.
39
+ Install the release built with the e3 your deployment runs, beside its peers
40
+ at the versions it names (`npm view @elaraai/e3-cloud-files@<release>
41
+ peerDependencies`): `@elaraai/east` and `@elaraai/e3`. The `e3-cloud` CLI
42
+ (`@elaraai/e3-cloud-cli`) of the same release deploys and syncs.
37
43
 
38
44
  ## Declaring the files
39
45
 
@@ -68,6 +74,7 @@ export default Files.manifest([upload]);
68
74
  | `latest(input, { prefix, include?, type })` | The greatest key, a beast2 file of `type` | `type` | as a typed `file` |
69
75
  | `folder(input, { prefix, include? })` | Every key under the prefix that matches, by its path under the prefix | `Dict<String, Blob>` | 64 MiB less 64 KiB each |
70
76
  | `listing(input, { prefix, include? })` | The same keys' size, time and ETag, without their bytes | `Dict<String, Struct{size, modified, etag}>` | none |
77
+ | `record(name, type, { key } \| { prefix, include? }, parts?)` | One key, or the greatest under a prefix: a beast2 file of `type`, the record's first state and, while unmutated, its state again | the record's (`e3.record(name, type, parts)`: its indexes, mutations and migrations, no initial value) | as a typed `file` |
71
78
  | `mutation(def, { key } \| { prefix, include? })` | One key, or every file under a prefix its glob matches, each new one in key order: a beast2 file of the mutation's one argument's type | (the mutation's, as declared) | 1 GiB |
72
79
 
73
80
  - **Each shape returns an ordinary `e3.input`.** It has no default, so it
@@ -88,27 +95,17 @@ export default Files.manifest([upload]);
88
95
  in `Files.manifest` two sources of one name or two shapes filling one
89
96
  target.
90
97
 
91
- ## Typed files and fed records
98
+ ## A typed file
92
99
 
93
- A beast2 file already is an East value: the East SDK (`encodeBeast2For`,
94
- `Beast2ElementWriter`), east-py, `e3 convert` and `e3 dataset get -f beast2`
95
- all write it. A `file` or `latest` that names a `type` is an input of that
96
- type, and the sync takes the file in as the value it holds, with no task in
97
- between:
100
+ A `file` or `latest` that names a `type` is an input of that type, and the
101
+ sync takes the file in as the value it holds, with no task in between:
98
102
 
99
103
  ```ts
100
104
  // src/package.ts
101
105
  export const Price = StructType({ sku: StringType, price: FloatType });
102
106
  export const prices = upload.file('prices', { key: 'prices.beast2', type: ArrayType(Price) }); // an input of Array<Price>
103
107
  export const stock = upload.latest('stock', { prefix: 'stock/', type: ArrayType(Stock) }); // the greatest key, typed
104
-
105
- export const priceBook = e3.record('price_book', DictType(StringType, FloatType), new Map());
106
- export const loadPrices = e3.mutation.reduce('load_prices', priceBook, East.function([PriceBook, ArrayType(Price)], PriceBook, …));
107
- export const summary = e3.task('price_summary', [prices, priceBook], …); // used as any dataset
108
-
109
- // src/files.ts
110
- upload.mutation(loadPrices, { prefix: 'deltas/', include: '*.beast2' }); // each new delta file calls load_prices with its value
111
- export default Files.manifest([upload]);
108
+ export const summary = e3.task('price_summary', [prices], …); // used as any dataset
112
109
  ```
113
110
 
114
111
  - **The header first.** The sync reads a typed file's beast2 header before
@@ -123,21 +120,174 @@ export default Files.manifest([upload]);
123
120
  the fix (write it again with a current writer).
124
121
  - **The same bytes again change nothing.** A file re-uploaded unchanged (a
125
122
  new ETag, the same SHA-256) gives the same value: nothing downstream runs.
126
- - **A fed mutation** (`upload.mutation(def, …)`) is the package's own, a
127
- `reduce` or an `edit` taking exactly one argument (a `patch` cannot be
128
- fed). Every new file the mapping selects is applied, in key order, once by
129
- its bytes' hash: a sync run again applies nothing twice, and the same bytes
130
- under another name are applied no more; a file the mutation refuses
131
- (`invalid`, `failed`, `timed_out`) is reported and tried again only once it
132
- changes, and the files after it wait; a feed of a record with no state yet,
133
- or one busy, waits for the next sync. Its commit reads in the record's
134
- history as any mutation's, its argument the delivery.
135
- - **A seeded record** (`upload.record(name, type, { key })`, a record pending
136
- until its file arrives, which is its first state) needs the e3 release
137
- that lets a record be declared with no initial value
138
- (elaraai/east-workspace#1363): the declarations, the checks (`record`
139
- targets, `$init` and `$seed` commits, `--reset`) and the sync's seeds are
140
- in place, and the declaration itself lands with that release.
123
+ The report counts it `changed`, not `updated`.
124
+
125
+ ## A record seeded from a file
126
+
127
+ `upload.record(name, type, { key }, parts)` (or `{ prefix, include }`, the
128
+ greatest key) declares `e3.record(name, type, parts)` with no initial value,
129
+ and returns the record, used in tasks as any record. A record is declared
130
+ whole, so its indexes, mutations and migrations are its `parts`, as
131
+ `e3.record` takes them; an initial value is refused, since its file is its
132
+ first state:
133
+
134
+ ```ts
135
+ // src/package.ts
136
+ export const Customer = StructType({ name: StringType, tier: IntegerType });
137
+ export const CustomerBook = DictType(StringType, Customer);
138
+ export const customers = upload.record('customers', CustomerBook, { key: 'customers.beast2' }, {
139
+ mutations: (mutation) => ({
140
+ set_tier: mutation.reduce(East.function([CustomerBook, StringType, IntegerType], CustomerBook, …)),
141
+ }),
142
+ });
143
+ export const customerCount = e3.task('customer_count', [customers], …);
144
+ ```
145
+
146
+ - **Pending until its file.** The record has no state until its file
147
+ arrives, which is its first state (`$init`): nothing runs on an empty
148
+ state first, and the tasks over it wait as they wait on an unset input,
149
+ the run completing without them. The workspace page shows it **Pending**,
150
+ its own page says what seeds it, and `files status` prints `pending`.
151
+ - **Seeded again while unmutated.** A changed file while nothing has mutated
152
+ the record since its seed is its state again (`$seed`). Once mutated the
153
+ record is kept (the report says how many mutations since the seed), until
154
+ `files sync --reset <record>` (or `files push --reset <record>`) takes the
155
+ file as its state over whatever was done.
156
+ - **In its history** the seed reads as any commit, through the `files`
157
+ channel: "Initialised from customers.beast2 (12,004 rows)", "Seeded again
158
+ from customers.beast2 (12,100 rows)", on the record's page and in
159
+ `e3-cloud records history`; a file pushed from a dataset names it too,
160
+ with its value's hash ("…, from dev.customer_book at 3f9a2b1c4d5e"). A
161
+ rollback to an earlier seed brings its state back, as to any commit.
162
+ - **A deploy that cannot keep the record** (its type changed) under
163
+ `--schema reset` unassigns it: pending again, seeded by the next version's
164
+ file once the new declarations are deployed.
165
+ - The file is taken in as a typed input is (by pieces, resumable), then
166
+ committed as a system commit with the file's key, ETag and SHA-256 as its
167
+ arguments (and, for a file pushed from a dataset, the dataset's path and
168
+ its value's hash after them), under one hold of the repository's running
169
+ work. The report numbers each seed among the record's: `$init #1`, then
170
+ `$seed #2`, and so on.
171
+
172
+ ## A record fed through a mutation
173
+
174
+ `upload.mutation(def, { key })` or `{ prefix, include }` feeds a record's
175
+ mutation: `def` is one the record declares, `record.mutations.<name>`, a
176
+ `reduce` or an `edit` taking exactly one argument (a `patch` cannot be fed),
177
+ and each file is that argument:
178
+
179
+ ```ts
180
+ // src/package.ts
181
+ export const PriceBook = DictType(StringType, FloatType);
182
+ export const priceBook = e3.record('price_book', PriceBook, {
183
+ initial: new Map(),
184
+ mutations: (mutation) => ({
185
+ load_prices: mutation.reduce(East.function([PriceBook, ArrayType(Price)], PriceBook, …)),
186
+ }),
187
+ });
188
+
189
+ // src/files.ts
190
+ upload.mutation(priceBook.mutations.load_prices, { prefix: 'deltas/', include: '*.beast2' }); // each new delta file calls load_prices with its value
191
+ export default Files.manifest([upload]);
192
+ ```
193
+
194
+ - **Once per file.** Every new file the mapping selects is applied, in key
195
+ order, once by its bytes' hash: a sync run again applies nothing twice,
196
+ and the same bytes under another name are applied no more.
197
+ - **The record's rules decide.** A file the mutation refuses (`invalid`,
198
+ `failed`, `timed_out`) is reported with what it said and tried again only
199
+ once the file changes, and the files after it wait; a feed of a record
200
+ with no state yet, or one busy, waits for the next sync. Its commit reads
201
+ in the record's history as any mutation's, through the `files` channel,
202
+ naming the file it was fed.
203
+
204
+ ## Pushing files from disk
205
+
206
+ `e3-cloud files push` puts files from your machine into a source and takes
207
+ them in: put, then one sync of what was put, idempotent and safe to repeat.
208
+
209
+ ```
210
+ $ e3-cloud files push https://e3.example.com/repos/acme dev ./data/prices.beast2 ./data/deltas/2026-10-19.beast2
211
+ upload s3://acme-files/acme/dev/
212
+ prices.beast2 → prices Array<Struct{sku, price}> 38 MiB put taken in 412,310 rows
213
+ 2026-10-19.beast2 → mutation:price_book.load_prices load_prices 1 MiB put committed 9f2c1a0b7e3d
214
+ Next: e3 dataflow run https://e3.example.com/repos/acme dev
215
+ ```
216
+
217
+ - **Each file is matched to the mapping that takes it**: a `file` by its
218
+ name, a `latest` under its prefix (a greater key there would shadow it:
219
+ refused `not_latest`), a directory to the `folder`; or `--as <target>`
220
+ names one for every file (`orders`, `record:customers`,
221
+ `mutation:price_book.load_prices`). A file no mapping takes, or several
222
+ would, is refused naming them.
223
+ - **Checked before it is put**: against the mapping's type (the file's
224
+ header is read) and its limit.
225
+ - **The deployment's own bucket needs no credentials of yours**: the
226
+ platform signs the upload, bound to the file's SHA-256, one PUT up to
227
+ 5 GiB or a multipart upload in 64 MiB parts. A bucket the deployment lists
228
+ as a source is written with your own credentials (`--profile`); a local
229
+ repository's sources, with the binding's profile.
230
+ - **Unchanged once it is there**: a file the source holds already, by its
231
+ hash and ETag, is `unchanged`, and running the command again puts only
232
+ what is not there. `--dry-run` plans and puts nothing.
233
+ - The output is a row per file: the file, its target and kind, its size,
234
+ `put`, `unchanged` or `refused`, and what the sync did (`taken in` with
235
+ the rows, `$init #1` or `$seed #n` with the rows, the mutation with its
236
+ commit, `kept`, or the refusal). The command exits 1 when any file was
237
+ refused or failed.
238
+
239
+ ### A workspace's dataset
240
+
241
+ A value an e3 workspace computes (a task's output, an input or a record)
242
+ pushes as the file of its value would, with no file kept by hand: name it
243
+ `dataset:<workspace>.<name>` among the paths, in the repository `--from`
244
+ names. That is a local repository's path or a repository's URL, and
245
+ defaults as e3's own `[repo]` does (`$E3_REPO`, then `.`). Files,
246
+ directories and datasets mix in one push.
247
+
248
+ ```
249
+ $ e3-cloud files push https://e3.example.com/repos/acme dev dataset:dev.customers --from ./archive
250
+ upload s3://acme-files/acme/dev/
251
+ dataset:dev.customers (task output) → record:customers seed 3 MiB put $init #1 12,004 rows
252
+ ```
253
+
254
+ - **Matched by its name**: a dataset goes to the `file` or `latest`
255
+ mapping that fills the input or the record of its name
256
+ (`dataset:dev.customers` → `record:customers`), else `--as` names its
257
+ target, any `file` or `latest` mapping's (a mutation's too). It is put at
258
+ a `file` mapping's key, or under a `latest` mapping's prefix as
259
+ `<name>.beast2` (refused `not_latest` as a file is). A `folder` or a
260
+ `listing` takes no dataset: a dataset is one value.
261
+ - **Its bytes are its value's**, as `e3 dataset get -f beast2` writes it,
262
+ its header its declared type: read from the repository a segment at a
263
+ time, never held whole, and checked against the mapping's type before
264
+ anything is put (`type_mismatch`, naming both). They are read once to
265
+ measure them and again as they upload, and a dataset a run writes again in
266
+ between fails in its row, never put as something else: push it again.
267
+ - **The same stored value is `unchanged`**: nothing put, nothing downstream
268
+ runs. A dataset changed since (a run, a value set) is put and taken in by
269
+ the target's rules: a record seeded again while nothing has mutated it,
270
+ kept once something has, seeded over it on `--reset`.
271
+ - **Refused in its row**, the rest going on: a dataset that is unassigned (a
272
+ task output not produced since its workspace's last deploy, an input never
273
+ set, a record with no state yet), or one the workspace doesn't hold.
274
+ - **Named where it lands**: the object is put with metadata naming the
275
+ dataset and its value's hash (`e3-dataset`, `e3-dataset-hash`), and a
276
+ seed's or a feed's commit records them, so its history reads "Initialised
277
+ from customers.beast2 (12,004 rows), from dev.customers at 3f9a2b1c4d5e".
278
+ - A local repository works at either end: the push reads a local
279
+ repository's datasets through e3 on your machine, and a deployed one's
280
+ through its API with your e3 login.
281
+
282
+ ## Making a beast2 file
283
+
284
+ A beast2 file already is an East value. The East SDK writes one from a value
285
+ (`encodeBeast2For(T)(value)`), or a collection of any size by elements
286
+ (`Beast2ElementWriter`, which the platform's own tests use for files of a
287
+ gibibyte); east-py writes one from Python; `e3 convert` converts a file of
288
+ another format; `e3 dataset get -f beast2` writes any dataset of a workspace
289
+ as one, though a push takes the dataset itself (A workspace's dataset,
290
+ above). A typed mapping takes it as it stands, its header saying its type.
141
291
 
142
292
  ## Decoding in a task
143
293
 
@@ -213,28 +363,12 @@ e3 dataflow run ./repo dev
213
363
  what a sync would take and takes nothing. A sync doesn't run the dataflow:
214
364
  `e3 dataflow run` does, and the sync prints the command when anything
215
365
  changed.
216
- - **`files push`** puts files from disk into a source and takes them in:
217
- each file is matched to the mapping that takes it (a `file` by its name, a
218
- `latest` under its prefix, a directory to the `folder`; or `--as <target>`
219
- names one for every file), checked against the mapping's type and limit,
220
- put where the source is bound (with your e3 login alone where that is the
221
- deployment's own bucket: the platform signs the upload, bound to the
222
- file's SHA-256; with your own credentials, `--profile`, elsewhere), then
223
- one sync of what was put. A file the source holds already is `unchanged`;
224
- `--dry-run` plans and puts nothing. Running it again puts only what is
225
- not there.
366
+ - **`files push`** puts files from disk, and workspaces' datasets, into a
367
+ source and takes them in (Pushing files from disk, above).
226
368
  - **`files status`** shows each mapping with its shape, its type, the file
227
369
  it holds and the commit it made (or `pending` for a record not yet
228
370
  seeded), where each source is bound, and the last sync.
229
371
 
230
- ```
231
- $ e3-cloud files push https://e3.example.com/repos/acme dev ./data/prices.beast2 ./data/deltas/2026-10-19.beast2
232
- upload s3://acme-files/acme/dev/
233
- prices.beast2 → prices Array<Struct{sku, price}> 38 MiB put taken in 412,310 rows
234
- 2026-10-19.beast2 → mutation:price_book.load_prices load_prices 1 MiB put committed 9f2c1a0b7e3d
235
- Next: e3 dataflow run https://e3.example.com/repos/acme dev
236
- ```
237
-
238
372
  A sync is safe to repeat and to stop. Each input is remembered only once it
239
373
  is written, so a sync that stops part way takes the rest next time.
240
374
 
@@ -368,10 +502,20 @@ In `@elaraai/e3-cloud-types`, re-exported here:
368
502
  typed value taken (`FilesTakenType`: its rows), the commit a seed or feed
369
503
  made, and why a seed was kept or a feed waits.
370
504
  - `FilesStatusType` (each mapping with what it holds and whether its record
371
- is pending), `FilesProblemType`, the push's `FilesPushRequestType` and
372
- `FilesPushPlanType`.
373
- - Values stored by the first version (mappings by input) are read through
374
- `@elaraai/e3-cloud-files/compat`, which lifts them.
505
+ is pending), `FilesProblemType`, the push's `FilesPushRequestType` (each
506
+ file's `FilesPushFileType`, with the dataset it is the value of, if one)
507
+ and `FilesPushPlanType`.
508
+ - `FilesSeedCommitType`: a seed's commit, `$init` or `$seed`, and its number
509
+ among the record's seeds, in a mapping's report.
510
+ - `FilesDatasetOriginType`: where a pushed file came from, a dataset's path
511
+ and its value's hash, as the object's metadata carries it
512
+ (`filesDatasetMetadata`, read back by `filesDatasetOriginOf`).
513
+ - Values stored by earlier versions (the first: mappings by input, a refusal
514
+ as one text; the second: a record's seeds not counted) are read by their
515
+ header's type and lifted (`@elaraai/e3-cloud-files/compat`):
516
+ declarations, ledgers and reports a workspace stored before this version
517
+ read as they were, and are written again in the current form on their next
518
+ write. A local repository's state file says its version (`version: 3`).
375
519
  - The inputs' types: `FilesFileType` (`Blob`), `FilesFolderType`
376
520
  (`Dict<String, Blob>`), `FilesListingType`.
377
521
 
@@ -384,7 +528,7 @@ In `@elaraai/e3-cloud-types`, re-exported here:
384
528
  | `@elaraai/e3-cloud-files/sync` | The sync (`syncFiles`) over what reads, writes and remembers, the push's plan (`planPush`), and the ports in memory for tests |
385
529
  | `@elaraai/e3-cloud-files/storage` | The sync's writer over an e3 store, and the cloud's over a staging (needs `@elaraai/e3-core`) |
386
530
  | `@elaraai/e3-cloud-files/s3` | The sync's reader of a bucket (needs `@aws-sdk/client-s3`) |
387
- | `@elaraai/e3-cloud-files/compat` | The first version's stored types, and their lift into the current ones |
531
+ | `@elaraai/e3-cloud-files/compat` | The earlier versions' stored types, and their lift into the current ones |
388
532
  | `@elaraai/e3-cloud-files/examples/*` | The worked examples (`orders`, `typed`) and the decoding examples (`decode`) |
389
533
 
390
534
  ## License
@@ -12,7 +12,7 @@
12
12
  * export const orders = upload.file('orders', { key: 'orders.beast2', type: ArrayType(Order) }); // an Array<Order>
13
13
  * export const stock = upload.latest('stock', { prefix: 'stock/', type: ArrayType(Stock) });
14
14
  * export const files = upload.folder('invoices', { prefix: 'invoices/', include: '*.pdf' });
15
- * upload.mutation(loadPrices, { key: 'prices.beast2' }); // each new file calls loadPrices
15
+ * upload.mutation(priceBook.mutations.load_prices, { key: 'prices.beast2' }); // each new file calls it
16
16
  * export default Files.manifest([upload]);
17
17
  * ```
18
18
  *
@@ -21,20 +21,33 @@
21
21
  * them; until the first, they are unassigned. A `file` or `latest` that
22
22
  * names a `type` is an input of that type, filled with the beast2 value the
23
23
  * file holds; one that names none is a `Blob`, filled with the file's
24
- * bytes. A mutation declared here is the package's own (`e3.mutation.reduce`
25
- * or `edit`, taking one argument): a sync calls it once with each new file's
26
- * value. What each source's files fill is the {@link Files.manifest}, which
27
- * `e3-cloud files deploy` deploys beside the package.
24
+ * bytes. A record seeded here is an `e3.record` with no initial value,
25
+ * declared whole with its indexes, mutations and migrations. A mutation fed
26
+ * here is one a record of the package declares, a `reduce` or an `edit`
27
+ * taking one argument (`record.mutations.<name>`): a sync calls it once with
28
+ * each new file's value. What each source's files fill is the
29
+ * {@link Files.manifest}, which `e3-cloud files deploy` deploys beside the
30
+ * package.
28
31
  *
29
32
  * @packageDocumentation
30
33
  */
31
- import e3, { type MutationDef } from '@elaraai/e3';
34
+ import e3, { type IndexDraft, type MutationDef, type MutationDraft, type RecordConfig } from '@elaraai/e3';
32
35
  import { type EastType } from '@elaraai/east';
33
36
  import { FilesFileType, FilesFolderType, FilesListingType, type FilesManifest, type FilesMapping, type FilesProblem } from '@elaraai/e3-cloud-types';
34
37
  /** The input a declaration makes: an `e3.input` of its type, with no default. */
35
38
  export type FilesInput<Name extends string, T extends EastType> = ReturnType<typeof e3.input<Name, T>>;
36
- /** The mutation a feed declaration hands back: the package's own definition, as it was given. */
39
+ /** The mutation a feed declaration hands back: its record's definition, as it was given. */
37
40
  export type FilesMutation<M extends MutationDef> = M;
41
+ /**
42
+ * What a record seeded from a file is declared with beside its file: its
43
+ * indexes, mutations and migrations, as `e3.record` takes them, and never an
44
+ * initial value, since its file is its first state.
45
+ *
46
+ * @typeParam T - The record's state type
47
+ * @typeParam I - Its indexes, as `indexes` returns them
48
+ * @typeParam M - Its mutations, as `mutations` returns them
49
+ */
50
+ export type FilesRecordParts<T extends EastType, I extends object, M extends object> = Omit<RecordConfig<T, I, M>, 'initial'>;
38
51
  /** One file, by its key relative to where the workspace binds the source. */
39
52
  export interface FilesKeySpec {
40
53
  readonly key: string;
@@ -113,14 +126,32 @@ export declare class FilesSource {
113
126
  * @returns The input, for tasks to take
114
127
  */
115
128
  listing<Name extends string>(input: Name, spec: FilesSelection): FilesInput<Name, typeof FilesListingType>;
129
+ /**
130
+ * A record seeded from a file: declared with no initial value, so it is
131
+ * pending until its file arrives, which is its first state (`$init`;
132
+ * nothing runs on an empty state first, and its dependents wait as they
133
+ * wait on an unset input); seeded again (`$seed`) while nothing has
134
+ * mutated it since, or when a sync is asked to reset it; kept otherwise.
135
+ * It is declared whole, as any record is: its indexes, mutations and
136
+ * migrations are given here, as `e3.record` takes them.
137
+ *
138
+ * @param name - The record's name
139
+ * @param type - Its state's type, which the file must hold
140
+ * @param spec - One file (`key`), or the newest under a prefix (`prefix`, `include`)
141
+ * @param parts - Its indexes, mutations and migrations, as `e3.record` takes them; none when omitted
142
+ * @returns The record, for tasks to take and its mutations to be fed: `e3.record(name, type, parts)`
143
+ * @throws {FilesDeclarationError} When the name is one e3 refuses, or the spec is
144
+ * @throws {Error} When `parts` holds an initial value, or holds what `e3.record` refuses, naming it
145
+ */
146
+ record<Name extends string, T extends EastType, I extends Readonly<Record<string, IndexDraft>> = Record<never, never>, M extends Readonly<Record<string, MutationDraft>> = Record<never, never>>(name: Name, type: T, spec: FilesKeySpec | FilesSelection, parts?: FilesRecordParts<T, I, M>): ReturnType<typeof e3.record<Name, T, I, M>>;
116
147
  /**
117
148
  * A record's mutation, fed: a sync calls it once with each new file's
118
149
  * value, which must be of the mutation's one argument's type. The
119
- * mutation is the package's own, a `reduce` or an `edit` taking exactly
120
- * one argument; a `patch` mutation takes a patch, not a value, so it
121
- * cannot be fed.
150
+ * mutation is one a record of the package declares, a `reduce` or an
151
+ * `edit` taking exactly one argument; a `patch` mutation takes a patch,
152
+ * not a value, so it cannot be fed.
122
153
  *
123
- * @param def - The mutation: `e3.mutation.reduce(...)` or `e3.mutation.edit(...)`
154
+ * @param def - The mutation, as its record holds it: `record.mutations.<name>`, a `mutation.reduce(...)` or `mutation.edit(...)` of its declaration
124
155
  * @param spec - One file (`key`), or the newest under a prefix (`prefix`, `include`)
125
156
  * @returns The mutation, as given
126
157
  * @throws {FilesDeclarationError} When the mutation takes other than one argument, or is a `patch`
@@ -1 +1 @@
1
- {"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../../src/authoring.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,EAAE,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAwC,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAEhD,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EACzD,MAAM,yBAAyB,CAAC;AAGjC,iFAAiF;AACjF,MAAM,MAAM,UAAU,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,QAAQ,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvG,iGAAiG;AACjG,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,CAAC;AAErD,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,uGAAuG;AACvG,MAAM,WAAW,cAAc;IAC7B,6GAA6G;IAC7G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0KAA0K;IAC1K,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,QAAQ,CAAE,SAAQ,YAAY;IACzE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CAClB;AAED,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB,C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AE,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAY3I;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,GAAG,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC;CAW/F;AAED,uBAAuB;AACvB,eAAO,MAAM,KAAK;IAChB;;;;;;OAMG;iBACU,MAAM,GAAG,WAAW;IAIjC;;;;;;;;OAQG;sBACe,SAAS,WAAW,EAAE,GAAG,aAAa;CAmBzD,CAAC"}
@@ -12,7 +12,7 @@
12
12
  * export const orders = upload.file('orders', { key: 'orders.beast2', type: ArrayType(Order) }); // an Array<Order>
13
13
  * export const stock = upload.latest('stock', { prefix: 'stock/', type: ArrayType(Stock) });
14
14
  * export const files = upload.folder('invoices', { prefix: 'invoices/', include: '*.pdf' });
15
- * upload.mutation(loadPrices, { key: 'prices.beast2' }); // each new file calls loadPrices
15
+ * upload.mutation(priceBook.mutations.load_prices, { key: 'prices.beast2' }); // each new file calls it
16
16
  * export default Files.manifest([upload]);
17
17
  * ```
18
18
  *
@@ -21,10 +21,13 @@
21
21
  * them; until the first, they are unassigned. A `file` or `latest` that
22
22
  * names a `type` is an input of that type, filled with the beast2 value the
23
23
  * file holds; one that names none is a `Blob`, filled with the file's
24
- * bytes. A mutation declared here is the package's own (`e3.mutation.reduce`
25
- * or `edit`, taking one argument): a sync calls it once with each new file's
26
- * value. What each source's files fill is the {@link Files.manifest}, which
27
- * `e3-cloud files deploy` deploys beside the package.
24
+ * bytes. A record seeded here is an `e3.record` with no initial value,
25
+ * declared whole with its indexes, mutations and migrations. A mutation fed
26
+ * here is one a record of the package declares, a `reduce` or an `edit`
27
+ * taking one argument (`record.mutations.<name>`): a sync calls it once with
28
+ * each new file's value. What each source's files fill is the
29
+ * {@link Files.manifest}, which `e3-cloud files deploy` deploys beside the
30
+ * package.
28
31
  *
29
32
  * @packageDocumentation
30
33
  */
@@ -151,14 +154,43 @@ export class FilesSource {
151
154
  listing(input, spec) {
152
155
  return this.#input(input, FilesListingType, variant('listing', selected(spec)), selectionProblems(variant('input', input), spec));
153
156
  }
157
+ /**
158
+ * A record seeded from a file: declared with no initial value, so it is
159
+ * pending until its file arrives, which is its first state (`$init`;
160
+ * nothing runs on an empty state first, and its dependents wait as they
161
+ * wait on an unset input); seeded again (`$seed`) while nothing has
162
+ * mutated it since, or when a sync is asked to reset it; kept otherwise.
163
+ * It is declared whole, as any record is: its indexes, mutations and
164
+ * migrations are given here, as `e3.record` takes them.
165
+ *
166
+ * @param name - The record's name
167
+ * @param type - Its state's type, which the file must hold
168
+ * @param spec - One file (`key`), or the newest under a prefix (`prefix`, `include`)
169
+ * @param parts - Its indexes, mutations and migrations, as `e3.record` takes them; none when omitted
170
+ * @returns The record, for tasks to take and its mutations to be fed: `e3.record(name, type, parts)`
171
+ * @throws {FilesDeclarationError} When the name is one e3 refuses, or the spec is
172
+ * @throws {Error} When `parts` holds an initial value, or holds what `e3.record` refuses, naming it
173
+ */
174
+ record(name, type, spec, parts) {
175
+ const target = variant('record', name);
176
+ refuse(nameProblems('record', name));
177
+ // Built before its mapping is recorded, so a part e3 refuses leaves the source as it was
178
+ const record = e3.record(name, type, parts);
179
+ // `default` is where a record keeps its initial value, there whether a value or a function that makes one (never called here)
180
+ if ('default' in record)
181
+ throw new Error(`record ${name}: a record seeded from a file declares no initial value, since its file is its first state`);
182
+ const { shape, problems } = oneFileShape(target, spec, type);
183
+ this.#declare(target, shape, problems);
184
+ return record;
185
+ }
154
186
  /**
155
187
  * A record's mutation, fed: a sync calls it once with each new file's
156
188
  * value, which must be of the mutation's one argument's type. The
157
- * mutation is the package's own, a `reduce` or an `edit` taking exactly
158
- * one argument; a `patch` mutation takes a patch, not a value, so it
159
- * cannot be fed.
189
+ * mutation is one a record of the package declares, a `reduce` or an
190
+ * `edit` taking exactly one argument; a `patch` mutation takes a patch,
191
+ * not a value, so it cannot be fed.
160
192
  *
161
- * @param def - The mutation: `e3.mutation.reduce(...)` or `e3.mutation.edit(...)`
193
+ * @param def - The mutation, as its record holds it: `record.mutations.<name>`, a `mutation.reduce(...)` or `mutation.edit(...)` of its declaration
162
194
  * @param spec - One file (`key`), or the newest under a prefix (`prefix`, `include`)
163
195
  * @returns The mutation, as given
164
196
  * @throws {FilesDeclarationError} When the mutation takes other than one argument, or is a `patch`
@@ -1 +1 @@
1
- {"version":3,"file":"authoring.js","sourceRoot":"","sources":["../../src/authoring.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAwB,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAiB,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAChD,gBAAgB,EAAE,eAAe,GAElC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA+BvE,0EAA0E;AAC1E,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,oBAAoB;IACX,QAAQ,CAA0B;IAE3C,YAAY,QAAiC;QAC3C,KAAK,CAAC,gDAAgD,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtH,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;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