@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.
- package/README.md +221 -28
- package/dist/src/authoring.d.ts +90 -22
- package/dist/src/authoring.d.ts.map +1 -1
- package/dist/src/authoring.js +122 -46
- package/dist/src/authoring.js.map +1 -1
- package/dist/src/check/index.d.ts +3 -4
- package/dist/src/check/index.d.ts.map +1 -1
- package/dist/src/check/index.js +3 -4
- package/dist/src/check/index.js.map +1 -1
- package/dist/src/check.d.ts +44 -9
- package/dist/src/check.d.ts.map +1 -1
- package/dist/src/check.js +130 -53
- package/dist/src/check.js.map +1 -1
- package/dist/src/compat.d.ts +384 -0
- package/dist/src/compat.d.ts.map +1 -0
- package/dist/src/compat.js +258 -0
- package/dist/src/compat.js.map +1 -0
- package/dist/src/index.d.ts +14 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +14 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/s3/index.d.ts.map +1 -1
- package/dist/src/s3/index.js +34 -12
- package/dist/src/s3/index.js.map +1 -1
- package/dist/src/storage/index.d.ts +84 -3
- package/dist/src/storage/index.d.ts.map +1 -1
- package/dist/src/storage/index.js +387 -13
- package/dist/src/storage/index.js.map +1 -1
- package/dist/src/sync/engine.d.ts +288 -49
- package/dist/src/sync/engine.d.ts.map +1 -1
- package/dist/src/sync/engine.js +605 -110
- package/dist/src/sync/engine.js.map +1 -1
- package/dist/src/sync/index.d.ts +3 -2
- package/dist/src/sync/index.d.ts.map +1 -1
- package/dist/src/sync/index.js +3 -2
- package/dist/src/sync/index.js.map +1 -1
- package/dist/src/sync/memory.d.ts +67 -12
- package/dist/src/sync/memory.d.ts.map +1 -1
- package/dist/src/sync/memory.js +248 -18
- package/dist/src/sync/memory.js.map +1 -1
- package/dist/src/sync/push.d.ts +56 -0
- package/dist/src/sync/push.d.ts.map +1 -0
- package/dist/src/sync/push.js +205 -0
- package/dist/src/sync/push.js.map +1 -0
- package/dist/test/decode.examples.d.ts +9 -4
- package/dist/test/decode.examples.d.ts.map +1 -1
- package/dist/test/decode.examples.js +15 -3
- package/dist/test/decode.examples.js.map +1 -1
- package/dist/test/typed.examples.d.ts +142 -0
- package/dist/test/typed.examples.d.ts.map +1 -0
- package/dist/test/typed.examples.js +125 -0
- package/dist/test/typed.examples.js.map +1 -0
- package/package.json +10 -6
package/dist/src/check.js
CHANGED
|
@@ -6,31 +6,48 @@
|
|
|
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
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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 { EastTypeType, equalFor, toEastTypeValue, variant } from '@elaraai/east';
|
|
18
|
-
import { decodePackageObject } from '@elaraai/e3-types';
|
|
19
|
-
import { FilesFileType, FilesFolderType, FilesListingType, } from '@elaraai/e3-cloud-types';
|
|
21
|
+
import { decodeMutationObject, decodePackageObject, decodeRecordObject } from '@elaraai/e3-types';
|
|
22
|
+
import { FilesFileType, FilesFolderType, FilesListingType, sameFilesTarget, } from '@elaraai/e3-cloud-types';
|
|
20
23
|
import { includeProblem, keyProblem, parseBucketUrl, prefixProblem } from './paths.js';
|
|
21
24
|
const typesEqual = equalFor(EastTypeType);
|
|
22
|
-
/** The type a shape
|
|
25
|
+
/** The type a shape fills its target with: the type it names, else its `Blob` form. */
|
|
23
26
|
export function shapeType(shape) {
|
|
24
27
|
switch (shape.type) {
|
|
25
28
|
case 'file':
|
|
26
29
|
case 'latest':
|
|
27
|
-
return toEastTypeValue(FilesFileType);
|
|
30
|
+
return shape.value.type.type === 'some' ? shape.value.type.value : toEastTypeValue(FilesFileType);
|
|
28
31
|
case 'folder':
|
|
29
32
|
return toEastTypeValue(FilesFolderType);
|
|
30
33
|
case 'listing':
|
|
31
34
|
return toEastTypeValue(FilesListingType);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
37
|
+
/** The datasets of a package's structure under one top-level tree, by name. */
|
|
38
|
+
function datasetsUnder(root, tree) {
|
|
39
|
+
const datasets = new Map();
|
|
40
|
+
if (root.type !== 'struct')
|
|
41
|
+
return datasets;
|
|
42
|
+
const branch = root.value.get(tree);
|
|
43
|
+
if (branch === undefined || branch.type !== 'struct')
|
|
44
|
+
return datasets;
|
|
45
|
+
for (const [name, child] of branch.value) {
|
|
46
|
+
if (child.type === 'value')
|
|
47
|
+
datasets.set(name, { type: child.value.type, writable: child.value.writable });
|
|
48
|
+
}
|
|
49
|
+
return datasets;
|
|
50
|
+
}
|
|
34
51
|
/**
|
|
35
52
|
* Reads a package's inputs, `.inputs.<name>`, from its objects.
|
|
36
53
|
*
|
|
@@ -40,64 +57,124 @@ export function shapeType(shape) {
|
|
|
40
57
|
*/
|
|
41
58
|
export async function readPackageInputs(read, packageHash) {
|
|
42
59
|
const pkg = decodePackageObject(await read(packageHash));
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
return datasetsUnder(pkg.data.structure, 'inputs');
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Reads what of a package Files' declarations may fill: its inputs, and its
|
|
64
|
+
* records with their mutations (each record's object, and each mutation's,
|
|
65
|
+
* read by hash: small objects, a few per record).
|
|
66
|
+
*
|
|
67
|
+
* @param read - Reads an object by hash
|
|
68
|
+
* @param packageHash - The package object's hash
|
|
69
|
+
* @returns The package's inputs and records
|
|
70
|
+
*/
|
|
71
|
+
export async function readPackageSurface(read, packageHash) {
|
|
72
|
+
const pkg = decodePackageObject(await read(packageHash));
|
|
73
|
+
const inputs = datasetsUnder(pkg.data.structure, 'inputs');
|
|
74
|
+
const states = datasetsUnder(pkg.data.structure, 'records');
|
|
75
|
+
// Each record's object, then its mutations', read beside each other
|
|
76
|
+
const records = new Map();
|
|
77
|
+
await Promise.all([...pkg.records].map(async ([name, hash]) => {
|
|
78
|
+
const state = states.get(name);
|
|
79
|
+
if (state === undefined)
|
|
80
|
+
return;
|
|
81
|
+
const record = decodeRecordObject(await read(hash));
|
|
82
|
+
const mutations = new Map();
|
|
83
|
+
await Promise.all([...record.mutations].map(async ([mutationName, mutationHash]) => {
|
|
84
|
+
const mutation = decodeMutationObject(await read(mutationHash));
|
|
85
|
+
mutations.set(mutationName, { form: mutation.form.type, argTypes: [...mutation.argTypes] });
|
|
86
|
+
}));
|
|
87
|
+
records.set(name, { type: state.type, mutations });
|
|
88
|
+
}));
|
|
89
|
+
return { inputs, records };
|
|
90
|
+
}
|
|
91
|
+
/** A mapping's selection problems: what the declarations alone get wrong, as a declaration would have refused it. */
|
|
92
|
+
function shapeProblems(target, shape) {
|
|
93
|
+
const problems = [];
|
|
94
|
+
if (shape.type === 'file') {
|
|
95
|
+
const reason = keyProblem(shape.value.key);
|
|
96
|
+
if (reason !== null)
|
|
97
|
+
problems.push(variant('invalid_key', { target, key: shape.value.key, reason }));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const reason = prefixProblem(shape.value.prefix);
|
|
101
|
+
if (reason !== null)
|
|
102
|
+
problems.push(variant('invalid_key', { target, key: shape.value.prefix, reason }));
|
|
103
|
+
if (shape.value.include.type === 'some') {
|
|
104
|
+
const include = includeProblem(shape.value.include.value);
|
|
105
|
+
if (include !== null)
|
|
106
|
+
problems.push(variant('invalid_include', { target, include: shape.value.include.value, reason: include }));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (target.type !== 'input') {
|
|
110
|
+
if (shape.type === 'folder' || shape.type === 'listing')
|
|
111
|
+
problems.push(variant('target_shape', { target }));
|
|
112
|
+
else if (shape.value.type.type === 'none')
|
|
113
|
+
problems.push(variant('target_untyped', { target }));
|
|
53
114
|
}
|
|
54
|
-
return
|
|
115
|
+
return problems;
|
|
55
116
|
}
|
|
56
117
|
/**
|
|
57
118
|
* The problems of declarations against a package, none when they fit. Each
|
|
58
|
-
* mapping's
|
|
119
|
+
* mapping's target must be of the package, of its shape's type: an input
|
|
120
|
+
* anything may write; a record whose state is the file's type; a mutation
|
|
121
|
+
* of its record taking one argument of the file's type, no `patch`.
|
|
59
122
|
*
|
|
60
123
|
* @param manifest - The declarations
|
|
61
|
-
* @param
|
|
124
|
+
* @param pkg - The package's inputs and records ({@link readPackageSurface})
|
|
62
125
|
* @returns Every problem
|
|
63
126
|
*/
|
|
64
|
-
export function checkFiles(manifest,
|
|
127
|
+
export function checkFiles(manifest, pkg) {
|
|
65
128
|
const problems = [];
|
|
66
|
-
const seen =
|
|
129
|
+
const seen = [];
|
|
67
130
|
const sources = new Set(manifest.sources);
|
|
68
131
|
for (const mapping of manifest.mappings) {
|
|
69
|
-
const {
|
|
70
|
-
if (seen.
|
|
71
|
-
problems.push(variant('
|
|
72
|
-
seen.
|
|
132
|
+
const { target, shape } = mapping;
|
|
133
|
+
if (seen.some((t) => sameFilesTarget(t, target)))
|
|
134
|
+
problems.push(variant('duplicate_target', { target }));
|
|
135
|
+
seen.push(target);
|
|
73
136
|
if (!sources.has(mapping.source))
|
|
74
137
|
problems.push(variant('source_unknown', { source: mapping.source }));
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const reason = prefixProblem(shape.value.prefix);
|
|
83
|
-
if (reason !== null)
|
|
84
|
-
problems.push(variant('invalid_key', { input, key: shape.value.prefix, reason }));
|
|
85
|
-
if (shape.value.include.type === 'some') {
|
|
86
|
-
const include = includeProblem(shape.value.include.value);
|
|
87
|
-
if (include !== null)
|
|
88
|
-
problems.push(variant('invalid_include', { input, include: shape.value.include.value, reason: include }));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
138
|
+
const shapeless = shapeProblems(target, shape);
|
|
139
|
+
problems.push(...shapeless);
|
|
140
|
+
// A record or mutation mapped to a folder, or with no type, fills nothing of the type: its shape is the problem
|
|
141
|
+
if (shapeless.some((p) => p.type === 'target_shape' || p.type === 'target_untyped'))
|
|
142
|
+
continue;
|
|
91
143
|
const expected = shapeType(shape);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
144
|
+
switch (target.type) {
|
|
145
|
+
case 'input': {
|
|
146
|
+
const input = target.value;
|
|
147
|
+
const declared = pkg.inputs.get(input);
|
|
148
|
+
if (declared === undefined)
|
|
149
|
+
problems.push(variant('input_missing', { input, expected }));
|
|
150
|
+
else if (!declared.writable)
|
|
151
|
+
problems.push(variant('input_not_writable', { input }));
|
|
152
|
+
else if (!typesEqual(declared.type, expected))
|
|
153
|
+
problems.push(variant('input_type', { input, expected, actual: declared.type }));
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case 'record': {
|
|
157
|
+
const record = target.value;
|
|
158
|
+
const declared = pkg.records.get(record);
|
|
159
|
+
if (declared === undefined)
|
|
160
|
+
problems.push(variant('record_missing', { record, expected }));
|
|
161
|
+
else if (!typesEqual(declared.type, expected))
|
|
162
|
+
problems.push(variant('record_type', { record, expected, actual: declared.type }));
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
case 'mutation': {
|
|
166
|
+
const { record, mutation } = target.value;
|
|
167
|
+
const declared = pkg.records.get(record)?.mutations.get(mutation);
|
|
168
|
+
if (declared === undefined)
|
|
169
|
+
problems.push(variant('mutation_missing', { record, mutation }));
|
|
170
|
+
else if (declared.form === 'patch')
|
|
171
|
+
problems.push(variant('mutation_patch', { record, mutation }));
|
|
172
|
+
else if (declared.argTypes.length !== 1)
|
|
173
|
+
problems.push(variant('mutation_arity', { record, mutation, arity: BigInt(declared.argTypes.length) }));
|
|
174
|
+
else if (!typesEqual(declared.argTypes[0], expected))
|
|
175
|
+
problems.push(variant('mutation_type', { record, mutation, expected, actual: declared.argTypes[0] }));
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
101
178
|
}
|
|
102
179
|
}
|
|
103
180
|
return problems;
|
package/dist/src/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAsB,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAAqC,MAAM,mBAAmB,CAAC;AACrI,OAAO,EACL,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,GAElE,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmCvF,MAAM,UAAU,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAE1C,uFAAuF;AACvF,MAAM,UAAU,SAAS,CAAC,KAAiB;IACzC,QAAQ,KAAK,CAAC,IAAI,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AO,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YACzG,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;gBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YACvG,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CACpD,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3G,IAAI,CAAC,OAAO;gBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC;YAChE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC,CAAC;QACvG,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `@elaraai/e3-cloud-files/compat`: Files' stored values as the first
|
|
7
|
+
* version wrote them, and their lift into the current types.
|
|
8
|
+
*
|
|
9
|
+
* The first version mapped a source's files to inputs alone: a mapping was
|
|
10
|
+
* `{input, source, shape}`, a `file` or `latest` shape named no type, a
|
|
11
|
+
* refusal's reason was a string, a sync was asked for `inputs`, and a ledger
|
|
12
|
+
* entry held an ETag and a size. The current types map to a target (an
|
|
13
|
+
* input, a record or a mutation), may name a type, tell refusals apart, ask
|
|
14
|
+
* for `targets` and `reset`, and remember a file's hash and the commit a
|
|
15
|
+
* seed or feed made.
|
|
16
|
+
*
|
|
17
|
+
* A store reads a stored value through {@link readFilesManifest},
|
|
18
|
+
* {@link readFilesSyncReport}, {@link readFilesLedger},
|
|
19
|
+
* {@link readFilesSyncJob} or {@link readFilesHistoryManifest}: each reads
|
|
20
|
+
* the root type the bytes' beast2 header declares, decodes a current value as
|
|
21
|
+
* it is, and decodes a first-version value with its own type and lifts it
|
|
22
|
+
* (`input` → `target: input(name)`, each `file`/`latest` shape `type: none`,
|
|
23
|
+
* a refusal's string `other(reason)`, the new fields none). A value is
|
|
24
|
+
* written at the current version on its next write. The lifts are pure, so
|
|
25
|
+
* the CLI lifts a local repository's state file through them too.
|
|
26
|
+
*
|
|
27
|
+
* The first version's types are kept here, and nowhere else, under their
|
|
28
|
+
* `V1` names.
|
|
29
|
+
*
|
|
30
|
+
* @packageDocumentation
|
|
31
|
+
*/
|
|
32
|
+
import { ArrayType, BooleanType, DateTimeType, DictType, IntegerType, OptionType, StringType, StructType, VariantType, type EastType, type ValueTypeOf } from '@elaraai/east';
|
|
33
|
+
import { type FilesLedgerValue, type FilesManifest, type FilesMapping, type FilesMappingReport, type FilesShape, type FilesSyncJob, type FilesSyncReport } from '@elaraai/e3-cloud-types';
|
|
34
|
+
/** A `file` or `latest` shape of the first version: no type. */
|
|
35
|
+
export declare const FilesShapeTypeV1: VariantType<{
|
|
36
|
+
readonly file: StructType<{
|
|
37
|
+
readonly key: StringType;
|
|
38
|
+
}>;
|
|
39
|
+
readonly latest: StructType<{
|
|
40
|
+
readonly prefix: StringType;
|
|
41
|
+
readonly include: OptionType<StringType>;
|
|
42
|
+
}>;
|
|
43
|
+
readonly folder: StructType<{
|
|
44
|
+
readonly prefix: StringType;
|
|
45
|
+
readonly include: OptionType<StringType>;
|
|
46
|
+
}>;
|
|
47
|
+
readonly listing: StructType<{
|
|
48
|
+
readonly prefix: StringType;
|
|
49
|
+
readonly include: OptionType<StringType>;
|
|
50
|
+
}>;
|
|
51
|
+
}>;
|
|
52
|
+
export type FilesShapeV1 = ValueTypeOf<typeof FilesShapeTypeV1>;
|
|
53
|
+
/** A mapping of the first version: an input, by name. */
|
|
54
|
+
export declare const FilesMappingTypeV1: StructType<{
|
|
55
|
+
readonly input: StringType;
|
|
56
|
+
readonly source: StringType;
|
|
57
|
+
readonly shape: VariantType<{
|
|
58
|
+
readonly file: StructType<{
|
|
59
|
+
readonly key: StringType;
|
|
60
|
+
}>;
|
|
61
|
+
readonly latest: StructType<{
|
|
62
|
+
readonly prefix: StringType;
|
|
63
|
+
readonly include: OptionType<StringType>;
|
|
64
|
+
}>;
|
|
65
|
+
readonly folder: StructType<{
|
|
66
|
+
readonly prefix: StringType;
|
|
67
|
+
readonly include: OptionType<StringType>;
|
|
68
|
+
}>;
|
|
69
|
+
readonly listing: StructType<{
|
|
70
|
+
readonly prefix: StringType;
|
|
71
|
+
readonly include: OptionType<StringType>;
|
|
72
|
+
}>;
|
|
73
|
+
}>;
|
|
74
|
+
}>;
|
|
75
|
+
export type FilesMappingV1 = ValueTypeOf<typeof FilesMappingTypeV1>;
|
|
76
|
+
/** The declarations of the first version. */
|
|
77
|
+
export declare const FilesManifestTypeV1: StructType<{
|
|
78
|
+
readonly sources: ArrayType<StringType>;
|
|
79
|
+
readonly mappings: ArrayType<StructType<{
|
|
80
|
+
readonly input: StringType;
|
|
81
|
+
readonly source: StringType;
|
|
82
|
+
readonly shape: VariantType<{
|
|
83
|
+
readonly file: StructType<{
|
|
84
|
+
readonly key: StringType;
|
|
85
|
+
}>;
|
|
86
|
+
readonly latest: StructType<{
|
|
87
|
+
readonly prefix: StringType;
|
|
88
|
+
readonly include: OptionType<StringType>;
|
|
89
|
+
}>;
|
|
90
|
+
readonly folder: StructType<{
|
|
91
|
+
readonly prefix: StringType;
|
|
92
|
+
readonly include: OptionType<StringType>;
|
|
93
|
+
}>;
|
|
94
|
+
readonly listing: StructType<{
|
|
95
|
+
readonly prefix: StringType;
|
|
96
|
+
readonly include: OptionType<StringType>;
|
|
97
|
+
}>;
|
|
98
|
+
}>;
|
|
99
|
+
}>>;
|
|
100
|
+
}>;
|
|
101
|
+
export type FilesManifestV1 = ValueTypeOf<typeof FilesManifestTypeV1>;
|
|
102
|
+
/** A refusal of the first version: its reason a string. */
|
|
103
|
+
export declare const FilesRefusalTypeV1: StructType<{
|
|
104
|
+
readonly key: StringType;
|
|
105
|
+
readonly reason: StringType;
|
|
106
|
+
}>;
|
|
107
|
+
/** A mapping's report of the first version. */
|
|
108
|
+
export declare const FilesMappingReportTypeV1: StructType<{
|
|
109
|
+
readonly input: StringType;
|
|
110
|
+
readonly added: IntegerType;
|
|
111
|
+
readonly changed: IntegerType;
|
|
112
|
+
readonly removed: IntegerType;
|
|
113
|
+
readonly unchanged: IntegerType;
|
|
114
|
+
readonly refused: ArrayType<StructType<{
|
|
115
|
+
readonly key: StringType;
|
|
116
|
+
readonly reason: StringType;
|
|
117
|
+
}>>;
|
|
118
|
+
readonly bytes: IntegerType;
|
|
119
|
+
readonly updated: BooleanType;
|
|
120
|
+
}>;
|
|
121
|
+
export type FilesMappingReportV1 = ValueTypeOf<typeof FilesMappingReportTypeV1>;
|
|
122
|
+
/** A sync's report of the first version. */
|
|
123
|
+
export declare const FilesSyncReportTypeV1: StructType<{
|
|
124
|
+
readonly started: DateTimeType;
|
|
125
|
+
readonly finished: DateTimeType;
|
|
126
|
+
readonly dryRun: BooleanType;
|
|
127
|
+
readonly mappings: ArrayType<StructType<{
|
|
128
|
+
readonly input: StringType;
|
|
129
|
+
readonly added: IntegerType;
|
|
130
|
+
readonly changed: IntegerType;
|
|
131
|
+
readonly removed: IntegerType;
|
|
132
|
+
readonly unchanged: IntegerType;
|
|
133
|
+
readonly refused: ArrayType<StructType<{
|
|
134
|
+
readonly key: StringType;
|
|
135
|
+
readonly reason: StringType;
|
|
136
|
+
}>>;
|
|
137
|
+
readonly bytes: IntegerType;
|
|
138
|
+
readonly updated: BooleanType;
|
|
139
|
+
}>>;
|
|
140
|
+
}>;
|
|
141
|
+
export type FilesSyncReportV1 = ValueTypeOf<typeof FilesSyncReportTypeV1>;
|
|
142
|
+
/** A ledger of the first version: each file's ETag and size. */
|
|
143
|
+
export declare const FilesLedgerTypeV1: StructType<{
|
|
144
|
+
readonly entries: DictType<StringType, StructType<{
|
|
145
|
+
readonly etag: StringType;
|
|
146
|
+
readonly size: IntegerType;
|
|
147
|
+
}>>;
|
|
148
|
+
readonly value: OptionType<StringType>;
|
|
149
|
+
readonly under: OptionType<StringType>;
|
|
150
|
+
}>;
|
|
151
|
+
export type FilesLedgerValueV1 = ValueTypeOf<typeof FilesLedgerTypeV1>;
|
|
152
|
+
/** A sync of the first version: asked for inputs. */
|
|
153
|
+
export declare const FilesSyncJobTypeV1: StructType<{
|
|
154
|
+
readonly id: StringType;
|
|
155
|
+
readonly workspace: StringType;
|
|
156
|
+
readonly by: StringType;
|
|
157
|
+
readonly dryRun: BooleanType;
|
|
158
|
+
readonly inputs: OptionType<ArrayType<StringType>>;
|
|
159
|
+
readonly state: VariantType<{
|
|
160
|
+
readonly running: import("@elaraai/east").NullType;
|
|
161
|
+
readonly succeeded: import("@elaraai/east").NullType;
|
|
162
|
+
readonly failed: StringType;
|
|
163
|
+
}>;
|
|
164
|
+
readonly startedAt: DateTimeType;
|
|
165
|
+
readonly finishedAt: OptionType<DateTimeType>;
|
|
166
|
+
readonly report: OptionType<StructType<{
|
|
167
|
+
readonly started: DateTimeType;
|
|
168
|
+
readonly finished: DateTimeType;
|
|
169
|
+
readonly dryRun: BooleanType;
|
|
170
|
+
readonly mappings: ArrayType<StructType<{
|
|
171
|
+
readonly input: StringType;
|
|
172
|
+
readonly added: IntegerType;
|
|
173
|
+
readonly changed: IntegerType;
|
|
174
|
+
readonly removed: IntegerType;
|
|
175
|
+
readonly unchanged: IntegerType;
|
|
176
|
+
readonly refused: ArrayType<StructType<{
|
|
177
|
+
readonly key: StringType;
|
|
178
|
+
readonly reason: StringType;
|
|
179
|
+
}>>;
|
|
180
|
+
readonly bytes: IntegerType;
|
|
181
|
+
readonly updated: BooleanType;
|
|
182
|
+
}>>;
|
|
183
|
+
}>>;
|
|
184
|
+
}>;
|
|
185
|
+
export type FilesSyncJobV1 = ValueTypeOf<typeof FilesSyncJobTypeV1>;
|
|
186
|
+
/**
|
|
187
|
+
* A first-version shape as the current one: a `file` or `latest` names no type.
|
|
188
|
+
*
|
|
189
|
+
* @param shape - The shape
|
|
190
|
+
* @returns The current shape
|
|
191
|
+
*/
|
|
192
|
+
export declare function liftFilesShapeV1(shape: FilesShapeV1): FilesShape;
|
|
193
|
+
/**
|
|
194
|
+
* A first-version mapping as the current one: its input, as a target.
|
|
195
|
+
*
|
|
196
|
+
* @param mapping - The mapping
|
|
197
|
+
* @returns The current mapping
|
|
198
|
+
*/
|
|
199
|
+
export declare function liftFilesMappingV1(mapping: FilesMappingV1): FilesMapping;
|
|
200
|
+
/**
|
|
201
|
+
* First-version declarations as the current ones.
|
|
202
|
+
*
|
|
203
|
+
* @param manifest - The declarations
|
|
204
|
+
* @returns The current declarations
|
|
205
|
+
*/
|
|
206
|
+
export declare function liftFilesManifestV1(manifest: FilesManifestV1): FilesManifest;
|
|
207
|
+
/**
|
|
208
|
+
* A first-version mapping's report as the current one: its reasons kept as
|
|
209
|
+
* `other`, and nothing taken, committed, kept or waiting.
|
|
210
|
+
*
|
|
211
|
+
* @param report - The report
|
|
212
|
+
* @returns The current report
|
|
213
|
+
*/
|
|
214
|
+
export declare function liftFilesMappingReportV1(report: FilesMappingReportV1): FilesMappingReport;
|
|
215
|
+
/**
|
|
216
|
+
* A first-version sync's report as the current one.
|
|
217
|
+
*
|
|
218
|
+
* @param report - The report
|
|
219
|
+
* @returns The current report
|
|
220
|
+
*/
|
|
221
|
+
export declare function liftFilesSyncReportV1(report: FilesSyncReportV1): FilesSyncReport;
|
|
222
|
+
/**
|
|
223
|
+
* A first-version ledger as the current one: no hashes, no commit.
|
|
224
|
+
*
|
|
225
|
+
* @param ledger - The ledger
|
|
226
|
+
* @returns The current ledger
|
|
227
|
+
*/
|
|
228
|
+
export declare function liftFilesLedgerV1(ledger: FilesLedgerValueV1): FilesLedgerValue;
|
|
229
|
+
/**
|
|
230
|
+
* A first-version sync as the current one: its inputs, as targets.
|
|
231
|
+
*
|
|
232
|
+
* @param job - The sync
|
|
233
|
+
* @returns The current sync
|
|
234
|
+
*/
|
|
235
|
+
export declare function liftFilesSyncJobV1(job: FilesSyncJobV1): FilesSyncJob;
|
|
236
|
+
/** Reads stored declarations, at any version, as the current ones. */
|
|
237
|
+
export declare const readFilesManifest: (bytes: Uint8Array) => FilesManifest;
|
|
238
|
+
/** Reads a stored sync's report, at any version, as the current one. */
|
|
239
|
+
export declare const readFilesSyncReport: (bytes: Uint8Array) => FilesSyncReport;
|
|
240
|
+
/** Reads a stored ledger, at any version, as the current one. */
|
|
241
|
+
export declare const readFilesLedger: (bytes: Uint8Array) => FilesLedgerValue;
|
|
242
|
+
/** Reads a stored sync, at any version, as the current one. */
|
|
243
|
+
export declare const readFilesSyncJob: (bytes: Uint8Array) => FilesSyncJob;
|
|
244
|
+
/** The declarations a workspace's history entry left: none, or the declarations. */
|
|
245
|
+
declare const HistoryManifestType: OptionType<StructType<{
|
|
246
|
+
readonly sources: ArrayType<StringType>;
|
|
247
|
+
readonly mappings: ArrayType<StructType<{
|
|
248
|
+
readonly target: VariantType<{
|
|
249
|
+
readonly input: StringType;
|
|
250
|
+
readonly record: StringType;
|
|
251
|
+
readonly mutation: StructType<{
|
|
252
|
+
readonly record: StringType;
|
|
253
|
+
readonly mutation: StringType;
|
|
254
|
+
}>;
|
|
255
|
+
}>;
|
|
256
|
+
readonly source: StringType;
|
|
257
|
+
readonly shape: VariantType<{
|
|
258
|
+
readonly file: StructType<{
|
|
259
|
+
readonly key: StringType;
|
|
260
|
+
readonly type: OptionType<import("@elaraai/east").RecursiveType<VariantType<{
|
|
261
|
+
readonly Never: import("@elaraai/east").NullType;
|
|
262
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
263
|
+
readonly Boolean: import("@elaraai/east").NullType;
|
|
264
|
+
readonly Integer: import("@elaraai/east").NullType;
|
|
265
|
+
readonly Float: import("@elaraai/east").NullType;
|
|
266
|
+
readonly String: import("@elaraai/east").NullType;
|
|
267
|
+
readonly DateTime: import("@elaraai/east").NullType;
|
|
268
|
+
readonly Blob: import("@elaraai/east").NullType;
|
|
269
|
+
readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
|
|
270
|
+
readonly Array: import("@elaraai/east").RecursiveTypeMarker;
|
|
271
|
+
readonly Set: import("@elaraai/east").RecursiveTypeMarker;
|
|
272
|
+
readonly Dict: StructType<{
|
|
273
|
+
readonly key: import("@elaraai/east").RecursiveTypeMarker;
|
|
274
|
+
readonly value: import("@elaraai/east").RecursiveTypeMarker;
|
|
275
|
+
}>;
|
|
276
|
+
readonly Struct: ArrayType<StructType<{
|
|
277
|
+
readonly name: StringType;
|
|
278
|
+
readonly type: import("@elaraai/east").RecursiveTypeMarker;
|
|
279
|
+
}>>;
|
|
280
|
+
readonly Variant: ArrayType<StructType<{
|
|
281
|
+
readonly name: StringType;
|
|
282
|
+
readonly type: import("@elaraai/east").RecursiveTypeMarker;
|
|
283
|
+
}>>;
|
|
284
|
+
readonly Recursive: VariantType<{
|
|
285
|
+
readonly ref: IntegerType;
|
|
286
|
+
readonly wrapper: StructType<{
|
|
287
|
+
readonly id: IntegerType;
|
|
288
|
+
readonly inner: import("@elaraai/east").RecursiveTypeMarker;
|
|
289
|
+
}>;
|
|
290
|
+
}>;
|
|
291
|
+
readonly Function: StructType<{
|
|
292
|
+
readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
|
|
293
|
+
readonly output: import("@elaraai/east").RecursiveTypeMarker;
|
|
294
|
+
}>;
|
|
295
|
+
readonly AsyncFunction: StructType<{
|
|
296
|
+
readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
|
|
297
|
+
readonly output: import("@elaraai/east").RecursiveTypeMarker;
|
|
298
|
+
}>;
|
|
299
|
+
readonly Vector: import("@elaraai/east").RecursiveTypeMarker;
|
|
300
|
+
readonly Matrix: import("@elaraai/east").RecursiveTypeMarker;
|
|
301
|
+
}>>>;
|
|
302
|
+
}>;
|
|
303
|
+
readonly latest: StructType<{
|
|
304
|
+
readonly prefix: StringType;
|
|
305
|
+
readonly include: OptionType<StringType>;
|
|
306
|
+
readonly type: OptionType<import("@elaraai/east").RecursiveType<VariantType<{
|
|
307
|
+
readonly Never: import("@elaraai/east").NullType;
|
|
308
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
309
|
+
readonly Boolean: import("@elaraai/east").NullType;
|
|
310
|
+
readonly Integer: import("@elaraai/east").NullType;
|
|
311
|
+
readonly Float: import("@elaraai/east").NullType;
|
|
312
|
+
readonly String: import("@elaraai/east").NullType;
|
|
313
|
+
readonly DateTime: import("@elaraai/east").NullType;
|
|
314
|
+
readonly Blob: import("@elaraai/east").NullType;
|
|
315
|
+
readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
|
|
316
|
+
readonly Array: import("@elaraai/east").RecursiveTypeMarker;
|
|
317
|
+
readonly Set: import("@elaraai/east").RecursiveTypeMarker;
|
|
318
|
+
readonly Dict: StructType<{
|
|
319
|
+
readonly key: import("@elaraai/east").RecursiveTypeMarker;
|
|
320
|
+
readonly value: import("@elaraai/east").RecursiveTypeMarker;
|
|
321
|
+
}>;
|
|
322
|
+
readonly Struct: ArrayType<StructType<{
|
|
323
|
+
readonly name: StringType;
|
|
324
|
+
readonly type: import("@elaraai/east").RecursiveTypeMarker;
|
|
325
|
+
}>>;
|
|
326
|
+
readonly Variant: ArrayType<StructType<{
|
|
327
|
+
readonly name: StringType;
|
|
328
|
+
readonly type: import("@elaraai/east").RecursiveTypeMarker;
|
|
329
|
+
}>>;
|
|
330
|
+
readonly Recursive: VariantType<{
|
|
331
|
+
readonly ref: IntegerType;
|
|
332
|
+
readonly wrapper: StructType<{
|
|
333
|
+
readonly id: IntegerType;
|
|
334
|
+
readonly inner: import("@elaraai/east").RecursiveTypeMarker;
|
|
335
|
+
}>;
|
|
336
|
+
}>;
|
|
337
|
+
readonly Function: StructType<{
|
|
338
|
+
readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
|
|
339
|
+
readonly output: import("@elaraai/east").RecursiveTypeMarker;
|
|
340
|
+
}>;
|
|
341
|
+
readonly AsyncFunction: StructType<{
|
|
342
|
+
readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
|
|
343
|
+
readonly output: import("@elaraai/east").RecursiveTypeMarker;
|
|
344
|
+
}>;
|
|
345
|
+
readonly Vector: import("@elaraai/east").RecursiveTypeMarker;
|
|
346
|
+
readonly Matrix: import("@elaraai/east").RecursiveTypeMarker;
|
|
347
|
+
}>>>;
|
|
348
|
+
}>;
|
|
349
|
+
readonly folder: StructType<{
|
|
350
|
+
readonly prefix: StringType;
|
|
351
|
+
readonly include: OptionType<StringType>;
|
|
352
|
+
}>;
|
|
353
|
+
readonly listing: StructType<{
|
|
354
|
+
readonly prefix: StringType;
|
|
355
|
+
readonly include: OptionType<StringType>;
|
|
356
|
+
}>;
|
|
357
|
+
}>;
|
|
358
|
+
}>>;
|
|
359
|
+
}>>;
|
|
360
|
+
type HistoryManifest = ValueTypeOf<typeof HistoryManifestType>;
|
|
361
|
+
/** Reads the declarations a history entry left (`Option<FilesManifest>`), at any version, as the current ones. */
|
|
362
|
+
export declare const readFilesHistoryManifest: (bytes: Uint8Array) => HistoryManifest;
|
|
363
|
+
/**
|
|
364
|
+
* The stored versions of a kept value, for a cutover's check: the current
|
|
365
|
+
* type, and each older one with its lift, so a value an older platform wrote
|
|
366
|
+
* is brought forward rather than refused.
|
|
367
|
+
*/
|
|
368
|
+
export interface FilesStoredVersions {
|
|
369
|
+
readonly current: EastType;
|
|
370
|
+
readonly older: readonly {
|
|
371
|
+
readonly type: EastType;
|
|
372
|
+
readonly lift: (value: never) => unknown;
|
|
373
|
+
}[];
|
|
374
|
+
}
|
|
375
|
+
/** The stored versions of a workspace's declarations (`FILES/` `manifest`). */
|
|
376
|
+
export declare const FILES_MANIFEST_VERSIONS: FilesStoredVersions;
|
|
377
|
+
/** The stored versions of a sync's report (`FILES/` `lastSync`, `FILESJOB/` `report`). */
|
|
378
|
+
export declare const FILES_REPORT_VERSIONS: FilesStoredVersions;
|
|
379
|
+
/** The stored versions of a sync as filed (`FILESJOB/` `value`). */
|
|
380
|
+
export declare const FILES_JOB_VERSIONS: FilesStoredVersions;
|
|
381
|
+
/** The stored versions of the declarations a history entry left (`RELEASE/` `files`). */
|
|
382
|
+
export declare const FILES_HISTORY_VERSIONS: FilesStoredVersions;
|
|
383
|
+
export {};
|
|
384
|
+
//# sourceMappingURL=compat.d.ts.map
|