@elaraai/e3-cloud-files 1.0.94 → 1.1.0

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 (53) hide show
  1. package/README.md +221 -28
  2. package/dist/src/authoring.d.ts +90 -22
  3. package/dist/src/authoring.d.ts.map +1 -1
  4. package/dist/src/authoring.js +122 -46
  5. package/dist/src/authoring.js.map +1 -1
  6. package/dist/src/check/index.d.ts +3 -4
  7. package/dist/src/check/index.d.ts.map +1 -1
  8. package/dist/src/check/index.js +3 -4
  9. package/dist/src/check/index.js.map +1 -1
  10. package/dist/src/check.d.ts +44 -9
  11. package/dist/src/check.d.ts.map +1 -1
  12. package/dist/src/check.js +130 -53
  13. package/dist/src/check.js.map +1 -1
  14. package/dist/src/compat.d.ts +384 -0
  15. package/dist/src/compat.d.ts.map +1 -0
  16. package/dist/src/compat.js +258 -0
  17. package/dist/src/compat.js.map +1 -0
  18. package/dist/src/index.d.ts +14 -9
  19. package/dist/src/index.d.ts.map +1 -1
  20. package/dist/src/index.js +14 -9
  21. package/dist/src/index.js.map +1 -1
  22. package/dist/src/s3/index.d.ts.map +1 -1
  23. package/dist/src/s3/index.js +34 -12
  24. package/dist/src/s3/index.js.map +1 -1
  25. package/dist/src/storage/index.d.ts +84 -3
  26. package/dist/src/storage/index.d.ts.map +1 -1
  27. package/dist/src/storage/index.js +387 -13
  28. package/dist/src/storage/index.js.map +1 -1
  29. package/dist/src/sync/engine.d.ts +288 -49
  30. package/dist/src/sync/engine.d.ts.map +1 -1
  31. package/dist/src/sync/engine.js +605 -110
  32. package/dist/src/sync/engine.js.map +1 -1
  33. package/dist/src/sync/index.d.ts +3 -2
  34. package/dist/src/sync/index.d.ts.map +1 -1
  35. package/dist/src/sync/index.js +3 -2
  36. package/dist/src/sync/index.js.map +1 -1
  37. package/dist/src/sync/memory.d.ts +67 -12
  38. package/dist/src/sync/memory.d.ts.map +1 -1
  39. package/dist/src/sync/memory.js +248 -18
  40. package/dist/src/sync/memory.js.map +1 -1
  41. package/dist/src/sync/push.d.ts +56 -0
  42. package/dist/src/sync/push.d.ts.map +1 -0
  43. package/dist/src/sync/push.js +205 -0
  44. package/dist/src/sync/push.js.map +1 -0
  45. package/dist/test/decode.examples.d.ts +9 -4
  46. package/dist/test/decode.examples.d.ts.map +1 -1
  47. package/dist/test/decode.examples.js +15 -3
  48. package/dist/test/decode.examples.js.map +1 -1
  49. package/dist/test/typed.examples.d.ts +142 -0
  50. package/dist/test/typed.examples.d.ts.map +1 -0
  51. package/dist/test/typed.examples.js +125 -0
  52. package/dist/test/typed.examples.js.map +1 -0
  53. package/package.json +10 -6
@@ -3,28 +3,38 @@
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
5
  /**
6
- * Declaring which inputs come from files.
6
+ * Declaring which inputs come from files, and which records are seeded or
7
+ * fed from them.
7
8
  *
8
9
  * ```ts
9
10
  * export const upload = Files.source('upload');
10
- * export const rates = upload.file('rates', { key: 'rates.json' });
11
- * export const stock = upload.latest('stock', { prefix: 'stock/' });
12
- * export const orders = upload.folder('orders', { prefix: 'orders/', include: '*.json' });
11
+ * export const rates = upload.file('rates', { key: 'rates.json' }); // a Blob
12
+ * export const orders = upload.file('orders', { key: 'orders.beast2', type: ArrayType(Order) }); // an Array<Order>
13
+ * export const stock = upload.latest('stock', { prefix: 'stock/', type: ArrayType(Stock) });
14
+ * export const files = upload.folder('invoices', { prefix: 'invoices/', include: '*.pdf' });
15
+ * upload.mutation(priceBook.mutations.load_prices, { key: 'prices.beast2' }); // each new file calls it
13
16
  * export default Files.manifest([upload]);
14
17
  * ```
15
18
  *
16
- * Each declaration is an ordinary `e3.input` with no default, so the package
17
- * is plain e3 and tasks take these inputs as any other. A sync fills them;
18
- * until the first, they are unassigned. What each source's files fill is the
19
+ * Each input declaration is an ordinary `e3.input` with no default, so the
20
+ * package is plain e3 and tasks take these inputs as any other. A sync fills
21
+ * them; until the first, they are unassigned. A `file` or `latest` that
22
+ * names a `type` is an input of that type, filled with the beast2 value the
23
+ * file holds; one that names none is a `Blob`, filled with the file's
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
19
29
  * {@link Files.manifest}, which `e3-cloud files deploy` deploys beside the
20
30
  * package.
21
31
  *
22
32
  * @packageDocumentation
23
33
  */
24
34
  import e3 from '@elaraai/e3';
25
- import { none, some, variant } from '@elaraai/east';
35
+ import { none, some, toEastTypeValue, variant } from '@elaraai/east';
26
36
  import { nameProblem } from '@elaraai/e3-types';
27
- import { FilesFileType, FilesFolderType, FilesListingType, filesProblemText, } from '@elaraai/e3-cloud-types';
37
+ import { FilesFileType, FilesFolderType, FilesListingType, filesProblemText, sameFilesTarget, } from '@elaraai/e3-cloud-types';
28
38
  import { includeProblem, keyProblem, prefixProblem } from './paths.js';
29
39
  /** Thrown when declarations are not well-formed, naming every problem. */
30
40
  export class FilesDeclarationError extends Error {
@@ -46,16 +56,21 @@ function nameProblems(kind, name) {
46
56
  const reason = nameProblem('workspace', name);
47
57
  return reason === null ? [] : [variant('invalid_name', { kind, name, reason })];
48
58
  }
59
+ /** A key's problems. */
60
+ function keyProblems(target, key) {
61
+ const reason = keyProblem(key);
62
+ return reason === null ? [] : [variant('invalid_key', { target, key, reason })];
63
+ }
49
64
  /** A selection's problems. */
50
- function selectionProblems(input, selection) {
65
+ function selectionProblems(target, selection) {
51
66
  const problems = [];
52
67
  const prefix = prefixProblem(selection.prefix);
53
68
  if (prefix !== null)
54
- problems.push(variant('invalid_key', { input, key: selection.prefix, reason: prefix }));
69
+ problems.push(variant('invalid_key', { target, key: selection.prefix, reason: prefix }));
55
70
  if (selection.include !== undefined) {
56
71
  const include = includeProblem(selection.include);
57
72
  if (include !== null)
58
- problems.push(variant('invalid_include', { input, include: selection.include, reason: include }));
73
+ problems.push(variant('invalid_include', { target, include: selection.include, reason: include }));
59
74
  }
60
75
  return problems;
61
76
  }
@@ -63,9 +78,23 @@ function selectionProblems(input, selection) {
63
78
  function selected(selection) {
64
79
  return { prefix: selection.prefix, include: selection.include === undefined ? none : some(selection.include) };
65
80
  }
81
+ /** Whether a spec names one file, rather than a selection. */
82
+ function isKeySpec(spec) {
83
+ return 'key' in spec;
84
+ }
85
+ /**
86
+ * The shape of a spec that selects one file, typed: `file` or `latest`, with
87
+ * the type, and its problems.
88
+ */
89
+ function oneFileShape(target, spec, type) {
90
+ const typeValue = some(toEastTypeValue(type));
91
+ if (isKeySpec(spec))
92
+ return { shape: variant('file', { key: spec.key, type: typeValue }), problems: keyProblems(target, spec.key) };
93
+ return { shape: variant('latest', { ...selected(spec), type: typeValue }), problems: selectionProblems(target, spec) };
94
+ }
66
95
  /**
67
96
  * A source of files: a name each workspace binds to a bucket and a prefix,
68
- * and the inputs its files fill.
97
+ * and the inputs, records and mutations its files fill.
69
98
  */
70
99
  export class FilesSource {
71
100
  /** The source's name */
@@ -76,38 +105,31 @@ export class FilesSource {
76
105
  refuse(nameProblems('source', name));
77
106
  this.name = name;
78
107
  }
79
- /** The inputs this source fills, in the order they were declared. */
108
+ /** The targets this source fills, in the order they were declared. */
80
109
  get mappings() {
81
110
  return this.#mappings;
82
111
  }
83
- /** Records a mapping and makes its input. */
84
- #declare(input, type, shape, problems) {
85
- refuse([...nameProblems('input', input), ...problems]);
86
- this.#mappings.push({ input, source: this.name, shape });
112
+ /** Records a mapping, refusing its problems first. */
113
+ #declare(target, shape, problems) {
114
+ refuse(problems);
115
+ this.#mappings.push({ target, source: this.name, shape });
116
+ }
117
+ /** Records an input's mapping and makes its input. */
118
+ #input(input, type, shape, problems) {
119
+ this.#declare(variant('input', input), shape, [...nameProblems('input', input), ...problems]);
87
120
  return e3.input(input, type);
88
121
  }
89
- /**
90
- * One file, as a `Blob`: the input `.inputs.<input>`.
91
- *
92
- * @param input - The input's name
93
- * @param spec - `key`: the file, relative to where the workspace binds the source
94
- * @returns The input, for tasks to take
95
- */
96
122
  file(input, spec) {
97
- const reason = keyProblem(spec.key);
98
- const problems = reason === null ? [] : [variant('invalid_key', { input, key: spec.key, reason })];
99
- return this.#declare(input, FilesFileType, variant('file', { key: spec.key }), problems);
123
+ const target = variant('input', input);
124
+ const type = 'type' in spec ? spec.type : FilesFileType;
125
+ const shape = variant('file', { key: spec.key, type: 'type' in spec ? some(toEastTypeValue(spec.type)) : none });
126
+ return this.#input(input, type, shape, keyProblems(target, spec.key));
100
127
  }
101
- /**
102
- * The newest file under a prefix, as a `Blob`: the greatest key that matches
103
- * `include`, so files named by their time pick the latest.
104
- *
105
- * @param input - The input's name
106
- * @param spec - The prefix, and a glob over the paths under it
107
- * @returns The input, for tasks to take
108
- */
109
128
  latest(input, spec) {
110
- return this.#declare(input, FilesFileType, variant('latest', selected(spec)), selectionProblems(input, spec));
129
+ const target = variant('input', input);
130
+ const type = 'type' in spec ? spec.type : FilesFileType;
131
+ const shape = variant('latest', { ...selected(spec), type: 'type' in spec ? some(toEastTypeValue(spec.type)) : none });
132
+ return this.#input(input, type, shape, selectionProblems(target, spec));
111
133
  }
112
134
  /**
113
135
  * Every file under a prefix that matches `include`, as a
@@ -118,7 +140,7 @@ export class FilesSource {
118
140
  * @returns The input, for tasks to take
119
141
  */
120
142
  folder(input, spec) {
121
- return this.#declare(input, FilesFolderType, variant('folder', selected(spec)), selectionProblems(input, spec));
143
+ return this.#input(input, FilesFolderType, variant('folder', selected(spec)), selectionProblems(variant('input', input), spec));
122
144
  }
123
145
  /**
124
146
  * The files under a prefix that match `include`, without their bytes: each
@@ -130,7 +152,61 @@ export class FilesSource {
130
152
  * @returns The input, for tasks to take
131
153
  */
132
154
  listing(input, spec) {
133
- return this.#declare(input, FilesListingType, variant('listing', selected(spec)), selectionProblems(input, spec));
155
+ return this.#input(input, FilesListingType, variant('listing', selected(spec)), selectionProblems(variant('input', input), spec));
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
+ }
186
+ /**
187
+ * A record's mutation, fed: a sync calls it once with each new file's
188
+ * value, which must be of the mutation's one argument's type. The
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.
192
+ *
193
+ * @param def - The mutation, as its record holds it: `record.mutations.<name>`, a `mutation.reduce(...)` or `mutation.edit(...)` of its declaration
194
+ * @param spec - One file (`key`), or the newest under a prefix (`prefix`, `include`)
195
+ * @returns The mutation, as given
196
+ * @throws {FilesDeclarationError} When the mutation takes other than one argument, or is a `patch`
197
+ */
198
+ mutation(def, spec) {
199
+ const record = def.record.name;
200
+ const target = variant('mutation', { record, mutation: def.name });
201
+ const problems = [...nameProblems('record', record), ...nameProblems('mutation', def.name)];
202
+ if (def.form === 'patch')
203
+ problems.push(variant('mutation_patch', { record, mutation: def.name }));
204
+ else if (def.argTypes.length !== 1)
205
+ problems.push(variant('mutation_arity', { record, mutation: def.name, arity: BigInt(def.argTypes.length) }));
206
+ refuse(problems);
207
+ const { shape, problems: specProblems } = oneFileShape(target, spec, def.argTypes[0]);
208
+ this.#declare(target, shape, specProblems);
209
+ return def;
134
210
  }
135
211
  }
136
212
  /** Declaring files. */
@@ -139,7 +215,7 @@ export const Files = {
139
215
  * A source of files, which each workspace binds to a bucket and a prefix.
140
216
  *
141
217
  * @param name - Its name, unique among a solution's sources
142
- * @returns The source, whose methods declare the inputs it fills
218
+ * @returns The source, whose methods declare what its files fill
143
219
  * @throws {FilesDeclarationError} When the name is one e3 refuses
144
220
  */
145
221
  source(name) {
@@ -147,17 +223,17 @@ export const Files = {
147
223
  },
148
224
  /**
149
225
  * The declarations `e3-cloud files deploy` deploys: the sources, and the
150
- * inputs their files fill.
226
+ * inputs, records and mutations their files fill.
151
227
  *
152
228
  * @param sources - Every source
153
229
  * @returns The manifest, an East value of `FilesManifestType`
154
230
  * @throws {FilesDeclarationError} When two sources share a name, or two
155
- * mappings fill one input
231
+ * mappings fill one target
156
232
  */
157
233
  manifest(sources) {
158
234
  const problems = [];
159
235
  const names = new Set();
160
- const inputs = new Set();
236
+ const targets = [];
161
237
  const mappings = [];
162
238
  for (const source of sources) {
163
239
  if (names.has(source.name)) {
@@ -165,9 +241,9 @@ export const Files = {
165
241
  }
166
242
  names.add(source.name);
167
243
  for (const mapping of source.mappings) {
168
- if (inputs.has(mapping.input))
169
- problems.push(variant('duplicate_input', { input: mapping.input }));
170
- inputs.add(mapping.input);
244
+ if (targets.some((t) => sameFilesTarget(t, mapping.target)))
245
+ problems.push(variant('duplicate_target', { target: mapping.target }));
246
+ targets.push(mapping.target);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I,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;YAC7G,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACvB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACtC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;oBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;gBACpI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAC7B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjB,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC"}
@@ -4,12 +4,11 @@
4
4
  */
5
5
  /**
6
6
  * `@elaraai/e3-cloud-files/check`: the checks a deploy of declarations and a
7
- * bind run, and the keys, prefixes, globs and URLs they hold to, without the
8
- * authoring (which needs `@elaraai/e3`): what the CLI and the platform
9
- * import.
7
+ * bind run, and the reading of a package's inputs, records and mutations
8
+ * they are checked against.
10
9
  *
11
10
  * @packageDocumentation
12
11
  */
13
- export { checkFiles, checkBindings, readPackageInputs, shapeType, type PackageInput, type ObjectReader, type BindingPolicy, } from '../check.js';
12
+ export { checkFiles, checkBindings, readPackageInputs, readPackageSurface, shapeType, type PackageInput, type PackageRecord, type PackageMutation, type PackageSurface, type ObjectReader, type BindingPolicy, } from '../check.js';
14
13
  export { globMatcher, parseBucketUrl, keyProblem, prefixProblem, includeProblem, type BucketLocation } from '../paths.js';
15
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/check/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACL,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/check/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -4,12 +4,11 @@
4
4
  */
5
5
  /**
6
6
  * `@elaraai/e3-cloud-files/check`: the checks a deploy of declarations and a
7
- * bind run, and the keys, prefixes, globs and URLs they hold to, without the
8
- * authoring (which needs `@elaraai/e3`): what the CLI and the platform
9
- * import.
7
+ * bind run, and the reading of a package's inputs, records and mutations
8
+ * they are checked against.
10
9
  *
11
10
  * @packageDocumentation
12
11
  */
13
- export { checkFiles, checkBindings, readPackageInputs, shapeType, } from '../check.js';
12
+ export { checkFiles, checkBindings, readPackageInputs, readPackageSurface, shapeType, } from '../check.js';
14
13
  export { globMatcher, parseBucketUrl, keyProblem, prefixProblem, includeProblem } from '../paths.js';
15
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/check/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACL,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,SAAS,GAIV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/check/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,GAOV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC"}
@@ -6,15 +6,19 @@
6
6
  * Whether declarations fit a package, and bindings fit declarations.
7
7
  *
8
8
  * {@link checkFiles} is the one check every deploy of declarations runs, on a
9
- * local repository and in the cloud: each mapping's input exists, is an
10
- * input, and is of its shape's type, compared exactly. {@link checkBindings}
11
- * is what a bind runs. {@link readPackageInputs} reads a package's inputs
12
- * from its objects, through a reader: the store's on a server, a local
13
- * repository's on a machine.
9
+ * local repository and in the cloud: each mapping's target exists in the
10
+ * package and is of its shape's type, compared exactly. An input must be
11
+ * writable; a record's state type must be the type its file holds; a fed
12
+ * mutation must exist on its record, take exactly one argument, of the type
13
+ * its file holds, and be no `patch`. {@link checkBindings} is what a bind
14
+ * runs. {@link readPackageSurface} reads a package's inputs, records and
15
+ * mutations from its objects, through a reader: the store's on a server, a
16
+ * local repository's on a machine.
14
17
  *
15
18
  * @packageDocumentation
16
19
  */
17
20
  import { type EastTypeValue } from '@elaraai/east';
21
+ import { type MutationForm } from '@elaraai/e3-types';
18
22
  import { type FilesBinding, type FilesManifest, type FilesProblem, type FilesShape } from '@elaraai/e3-cloud-types';
19
23
  /** An input of a package. */
20
24
  export interface PackageInput {
@@ -23,9 +27,28 @@ export interface PackageInput {
23
27
  /** Whether anything may write it: inputs are writable; task outputs and records are not */
24
28
  readonly writable: boolean;
25
29
  }
30
+ /** A mutation of a package's record. */
31
+ export interface PackageMutation {
32
+ /** Its form: `reduce`, `edit` or `patch` */
33
+ readonly form: MutationForm;
34
+ /** The types of its arguments after the state */
35
+ readonly argTypes: readonly EastTypeValue[];
36
+ }
37
+ /** A record of a package. */
38
+ export interface PackageRecord {
39
+ /** Its state's type, as the package declares it */
40
+ readonly type: EastTypeValue;
41
+ /** Its mutations, by name */
42
+ readonly mutations: ReadonlyMap<string, PackageMutation>;
43
+ }
44
+ /** What of a package Files' declarations may fill: its inputs, and its records with their mutations. */
45
+ export interface PackageSurface {
46
+ readonly inputs: ReadonlyMap<string, PackageInput>;
47
+ readonly records: ReadonlyMap<string, PackageRecord>;
48
+ }
26
49
  /** Reads an object of a package's repository by hash. */
27
50
  export type ObjectReader = (hash: string) => Promise<Uint8Array>;
28
- /** The type a shape's input holds. */
51
+ /** The type a shape fills its target with: the type it names, else its `Blob` form. */
29
52
  export declare function shapeType(shape: FilesShape): EastTypeValue;
30
53
  /**
31
54
  * Reads a package's inputs, `.inputs.<name>`, from its objects.
@@ -35,15 +58,27 @@ export declare function shapeType(shape: FilesShape): EastTypeValue;
35
58
  * @returns Each input, by name
36
59
  */
37
60
  export declare function readPackageInputs(read: ObjectReader, packageHash: string): Promise<Map<string, PackageInput>>;
61
+ /**
62
+ * Reads what of a package Files' declarations may fill: its inputs, and its
63
+ * records with their mutations (each record's object, and each mutation's,
64
+ * read by hash: small objects, a few per record).
65
+ *
66
+ * @param read - Reads an object by hash
67
+ * @param packageHash - The package object's hash
68
+ * @returns The package's inputs and records
69
+ */
70
+ export declare function readPackageSurface(read: ObjectReader, packageHash: string): Promise<PackageSurface>;
38
71
  /**
39
72
  * The problems of declarations against a package, none when they fit. Each
40
- * mapping's input must be an input of the package, of its shape's type.
73
+ * mapping's target must be of the package, of its shape's type: an input
74
+ * anything may write; a record whose state is the file's type; a mutation
75
+ * of its record taking one argument of the file's type, no `patch`.
41
76
  *
42
77
  * @param manifest - The declarations
43
- * @param inputs - The package's inputs ({@link readPackageInputs})
78
+ * @param pkg - The package's inputs and records ({@link readPackageSurface})
44
79
  * @returns Every problem
45
80
  */
46
- export declare function checkFiles(manifest: FilesManifest, inputs: ReadonlyMap<string, PackageInput>): FilesProblem[];
81
+ export declare function checkFiles(manifest: FilesManifest, pkg: PackageSurface): FilesProblem[];
47
82
  /** Where a binding may point: for a deployed workspace, the sources the deployment grants. */
48
83
  export interface BindingPolicy {
49
84
  /** Whether the bindings are a local repository's, where `profile` and `latest` apply */
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAErG,OAAO,EAEL,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAC1E,MAAM,yBAAyB,CAAC;AAGjC,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;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