@elaraai/e3-cloud-files 1.0.94 → 1.0.97
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 +129 -23
- package/dist/src/authoring.d.ts +61 -24
- package/dist/src/authoring.d.ts.map +1 -1
- package/dist/src/authoring.js +92 -48
- 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 +12 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -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 +72 -3
- package/dist/src/storage/index.d.ts.map +1 -1
- package/dist/src/storage/index.js +258 -13
- package/dist/src/storage/index.js.map +1 -1
- package/dist/src/sync/engine.d.ts +282 -49
- package/dist/src/sync/engine.d.ts.map +1 -1
- package/dist/src/sync/engine.js +599 -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/typed.examples.d.ts +49 -0
- package/dist/test/typed.examples.d.ts.map +1 -0
- package/dist/test/typed.examples.js +58 -0
- package/dist/test/typed.examples.js.map +1 -0
- package/package.json +10 -6
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../../src/compat.ts"],"names":[],"mappings":"AAAA;;;GAGG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAgC,CAAC;AAE1D,KAAK,eAAe,GAAG,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE/D,kHAAkH;AAClH,eAAO,MAAM,wBAAwB,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,eAK5D,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;KAAE,EAAE,CAAC;CAClG;AAED,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,EAAE,mBAAoJ,CAAC;AAC3L,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,EAAE,mBAA0J,CAAC;AAC/L,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,EAAE,mBAAiJ,CAAC;AACnL,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,EAAE,mBAGpC,CAAC"}
|
|
@@ -0,0 +1,258 @@
|
|
|
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, decodeBeast2For, isTypeValueEqual, none, readBeast2Type, some, toEastTypeValue, variant, } from '@elaraai/east';
|
|
33
|
+
import { FilesLedgerType, FilesManifestType, FilesSyncJobType, FilesSyncReportType, FilesSyncStateType, } from '@elaraai/e3-cloud-types';
|
|
34
|
+
/** A `file` or `latest` shape of the first version: no type. */
|
|
35
|
+
export const FilesShapeTypeV1 = VariantType({
|
|
36
|
+
file: StructType({ key: StringType }),
|
|
37
|
+
latest: StructType({ prefix: StringType, include: OptionType(StringType) }),
|
|
38
|
+
folder: StructType({ prefix: StringType, include: OptionType(StringType) }),
|
|
39
|
+
listing: StructType({ prefix: StringType, include: OptionType(StringType) }),
|
|
40
|
+
});
|
|
41
|
+
/** A mapping of the first version: an input, by name. */
|
|
42
|
+
export const FilesMappingTypeV1 = StructType({
|
|
43
|
+
input: StringType,
|
|
44
|
+
source: StringType,
|
|
45
|
+
shape: FilesShapeTypeV1,
|
|
46
|
+
});
|
|
47
|
+
/** The declarations of the first version. */
|
|
48
|
+
export const FilesManifestTypeV1 = StructType({
|
|
49
|
+
sources: ArrayType(StringType),
|
|
50
|
+
mappings: ArrayType(FilesMappingTypeV1),
|
|
51
|
+
});
|
|
52
|
+
/** A refusal of the first version: its reason a string. */
|
|
53
|
+
export const FilesRefusalTypeV1 = StructType({ key: StringType, reason: StringType });
|
|
54
|
+
/** A mapping's report of the first version. */
|
|
55
|
+
export const FilesMappingReportTypeV1 = StructType({
|
|
56
|
+
input: StringType,
|
|
57
|
+
added: IntegerType,
|
|
58
|
+
changed: IntegerType,
|
|
59
|
+
removed: IntegerType,
|
|
60
|
+
unchanged: IntegerType,
|
|
61
|
+
refused: ArrayType(FilesRefusalTypeV1),
|
|
62
|
+
bytes: IntegerType,
|
|
63
|
+
updated: BooleanType,
|
|
64
|
+
});
|
|
65
|
+
/** A sync's report of the first version. */
|
|
66
|
+
export const FilesSyncReportTypeV1 = StructType({
|
|
67
|
+
started: DateTimeType,
|
|
68
|
+
finished: DateTimeType,
|
|
69
|
+
dryRun: BooleanType,
|
|
70
|
+
mappings: ArrayType(FilesMappingReportTypeV1),
|
|
71
|
+
});
|
|
72
|
+
/** A ledger of the first version: each file's ETag and size. */
|
|
73
|
+
export const FilesLedgerTypeV1 = StructType({
|
|
74
|
+
entries: DictType(StringType, StructType({ etag: StringType, size: IntegerType })),
|
|
75
|
+
value: OptionType(StringType),
|
|
76
|
+
under: OptionType(StringType),
|
|
77
|
+
});
|
|
78
|
+
/** A sync of the first version: asked for inputs. */
|
|
79
|
+
export const FilesSyncJobTypeV1 = StructType({
|
|
80
|
+
id: StringType,
|
|
81
|
+
workspace: StringType,
|
|
82
|
+
by: StringType,
|
|
83
|
+
dryRun: BooleanType,
|
|
84
|
+
inputs: OptionType(ArrayType(StringType)),
|
|
85
|
+
state: FilesSyncStateType,
|
|
86
|
+
startedAt: DateTimeType,
|
|
87
|
+
finishedAt: OptionType(DateTimeType),
|
|
88
|
+
report: OptionType(FilesSyncReportTypeV1),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* A first-version shape as the current one: a `file` or `latest` names no type.
|
|
92
|
+
*
|
|
93
|
+
* @param shape - The shape
|
|
94
|
+
* @returns The current shape
|
|
95
|
+
*/
|
|
96
|
+
export function liftFilesShapeV1(shape) {
|
|
97
|
+
switch (shape.type) {
|
|
98
|
+
case 'file': return variant('file', { key: shape.value.key, type: none });
|
|
99
|
+
case 'latest': return variant('latest', { prefix: shape.value.prefix, include: shape.value.include, type: none });
|
|
100
|
+
case 'folder': return variant('folder', shape.value);
|
|
101
|
+
case 'listing': return variant('listing', shape.value);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A first-version mapping as the current one: its input, as a target.
|
|
106
|
+
*
|
|
107
|
+
* @param mapping - The mapping
|
|
108
|
+
* @returns The current mapping
|
|
109
|
+
*/
|
|
110
|
+
export function liftFilesMappingV1(mapping) {
|
|
111
|
+
return { target: variant('input', mapping.input), source: mapping.source, shape: liftFilesShapeV1(mapping.shape) };
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* First-version declarations as the current ones.
|
|
115
|
+
*
|
|
116
|
+
* @param manifest - The declarations
|
|
117
|
+
* @returns The current declarations
|
|
118
|
+
*/
|
|
119
|
+
export function liftFilesManifestV1(manifest) {
|
|
120
|
+
return { sources: [...manifest.sources], mappings: manifest.mappings.map(liftFilesMappingV1) };
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A first-version mapping's report as the current one: its reasons kept as
|
|
124
|
+
* `other`, and nothing taken, committed, kept or waiting.
|
|
125
|
+
*
|
|
126
|
+
* @param report - The report
|
|
127
|
+
* @returns The current report
|
|
128
|
+
*/
|
|
129
|
+
export function liftFilesMappingReportV1(report) {
|
|
130
|
+
const refused = report.refused.map((r) => ({ key: r.key, reason: variant('other', r.reason) }));
|
|
131
|
+
return {
|
|
132
|
+
target: variant('input', report.input),
|
|
133
|
+
added: report.added,
|
|
134
|
+
changed: report.changed,
|
|
135
|
+
removed: report.removed,
|
|
136
|
+
unchanged: report.unchanged,
|
|
137
|
+
refused,
|
|
138
|
+
bytes: report.bytes,
|
|
139
|
+
updated: report.updated,
|
|
140
|
+
taken: none,
|
|
141
|
+
commit: none,
|
|
142
|
+
kept: none,
|
|
143
|
+
waiting: none,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A first-version sync's report as the current one.
|
|
148
|
+
*
|
|
149
|
+
* @param report - The report
|
|
150
|
+
* @returns The current report
|
|
151
|
+
*/
|
|
152
|
+
export function liftFilesSyncReportV1(report) {
|
|
153
|
+
return { started: report.started, finished: report.finished, dryRun: report.dryRun, mappings: report.mappings.map(liftFilesMappingReportV1) };
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A first-version ledger as the current one: no hashes, no commit.
|
|
157
|
+
*
|
|
158
|
+
* @param ledger - The ledger
|
|
159
|
+
* @returns The current ledger
|
|
160
|
+
*/
|
|
161
|
+
export function liftFilesLedgerV1(ledger) {
|
|
162
|
+
return {
|
|
163
|
+
entries: new Map([...ledger.entries].map(([key, e]) => [key, { etag: e.etag, size: e.size, sha256: none, modified: none }])),
|
|
164
|
+
value: ledger.value,
|
|
165
|
+
under: ledger.under,
|
|
166
|
+
commit: none,
|
|
167
|
+
tried: none,
|
|
168
|
+
taking: none,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* A first-version sync as the current one: its inputs, as targets.
|
|
173
|
+
*
|
|
174
|
+
* @param job - The sync
|
|
175
|
+
* @returns The current sync
|
|
176
|
+
*/
|
|
177
|
+
export function liftFilesSyncJobV1(job) {
|
|
178
|
+
return {
|
|
179
|
+
id: job.id,
|
|
180
|
+
workspace: job.workspace,
|
|
181
|
+
by: job.by,
|
|
182
|
+
dryRun: job.dryRun,
|
|
183
|
+
targets: job.inputs.type === 'some' ? some(job.inputs.value.map((input) => variant('input', input))) : none,
|
|
184
|
+
reset: [],
|
|
185
|
+
state: job.state,
|
|
186
|
+
startedAt: job.startedAt,
|
|
187
|
+
finishedAt: job.finishedAt,
|
|
188
|
+
report: job.report.type === 'some' ? some(liftFilesSyncReportV1(job.report.value)) : none,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* A reader of a stored value at any version: the bytes' header type decides
|
|
193
|
+
* which type decodes them, and an older value is lifted.
|
|
194
|
+
*
|
|
195
|
+
* @param what - What the value is, for the error
|
|
196
|
+
* @param current - The current type
|
|
197
|
+
* @param older - Each older version, its type and lift
|
|
198
|
+
* @returns The reader
|
|
199
|
+
*/
|
|
200
|
+
function versioned(what, current, older) {
|
|
201
|
+
const decodeCurrent = decodeBeast2For(current);
|
|
202
|
+
const currentType = toEastTypeValue(current);
|
|
203
|
+
const olders = older.map((o) => ({ ...o, typeValue: toEastTypeValue(o.type), decode: decodeBeast2For(o.type) }));
|
|
204
|
+
return (bytes) => {
|
|
205
|
+
let header;
|
|
206
|
+
try {
|
|
207
|
+
header = readBeast2Type(bytes);
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
throw new Error(`The stored ${what} is not a beast2 value: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
211
|
+
}
|
|
212
|
+
if (isTypeValueEqual(header, currentType))
|
|
213
|
+
return decodeCurrent(bytes);
|
|
214
|
+
for (const o of olders) {
|
|
215
|
+
if (isTypeValueEqual(header, o.typeValue))
|
|
216
|
+
return o.lift(o.decode(bytes));
|
|
217
|
+
}
|
|
218
|
+
throw new Error(`The stored ${what} is of a type this version does not read`);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/** Reads stored declarations, at any version, as the current ones. */
|
|
222
|
+
export const readFilesManifest = versioned('Files declarations', FilesManifestType, [
|
|
223
|
+
{ type: FilesManifestTypeV1, lift: liftFilesManifestV1 },
|
|
224
|
+
]);
|
|
225
|
+
/** Reads a stored sync's report, at any version, as the current one. */
|
|
226
|
+
export const readFilesSyncReport = versioned('Files sync report', FilesSyncReportType, [
|
|
227
|
+
{ type: FilesSyncReportTypeV1, lift: liftFilesSyncReportV1 },
|
|
228
|
+
]);
|
|
229
|
+
/** Reads a stored ledger, at any version, as the current one. */
|
|
230
|
+
export const readFilesLedger = versioned('Files ledger', FilesLedgerType, [
|
|
231
|
+
{ type: FilesLedgerTypeV1, lift: liftFilesLedgerV1 },
|
|
232
|
+
]);
|
|
233
|
+
/** Reads a stored sync, at any version, as the current one. */
|
|
234
|
+
export const readFilesSyncJob = versioned('Files sync', FilesSyncJobType, [
|
|
235
|
+
{ type: FilesSyncJobTypeV1, lift: liftFilesSyncJobV1 },
|
|
236
|
+
]);
|
|
237
|
+
/** The declarations a workspace's history entry left: none, or the declarations. */
|
|
238
|
+
const HistoryManifestType = OptionType(FilesManifestType);
|
|
239
|
+
const HistoryManifestTypeV1 = OptionType(FilesManifestTypeV1);
|
|
240
|
+
/** Reads the declarations a history entry left (`Option<FilesManifest>`), at any version, as the current ones. */
|
|
241
|
+
export const readFilesHistoryManifest = versioned('Files declarations of a history entry', HistoryManifestType, [
|
|
242
|
+
{
|
|
243
|
+
type: HistoryManifestTypeV1,
|
|
244
|
+
lift: ((value) => (value.type === 'some' ? some(liftFilesManifestV1(value.value)) : none)),
|
|
245
|
+
},
|
|
246
|
+
]);
|
|
247
|
+
/** The stored versions of a workspace's declarations (`FILES/` `manifest`). */
|
|
248
|
+
export const FILES_MANIFEST_VERSIONS = { current: FilesManifestType, older: [{ type: FilesManifestTypeV1, lift: liftFilesManifestV1 }] };
|
|
249
|
+
/** The stored versions of a sync's report (`FILES/` `lastSync`, `FILESJOB/` `report`). */
|
|
250
|
+
export const FILES_REPORT_VERSIONS = { current: FilesSyncReportType, older: [{ type: FilesSyncReportTypeV1, lift: liftFilesSyncReportV1 }] };
|
|
251
|
+
/** The stored versions of a sync as filed (`FILESJOB/` `value`). */
|
|
252
|
+
export const FILES_JOB_VERSIONS = { current: FilesSyncJobType, older: [{ type: FilesSyncJobTypeV1, lift: liftFilesSyncJobV1 }] };
|
|
253
|
+
/** The stored versions of the declarations a history entry left (`RELEASE/` `files`). */
|
|
254
|
+
export const FILES_HISTORY_VERSIONS = {
|
|
255
|
+
current: HistoryManifestType,
|
|
256
|
+
older: [{ type: HistoryManifestTypeV1, lift: ((value) => (value.type === 'some' ? some(liftFilesManifestV1(value.value)) : none)) }],
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../src/compat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAC5G,eAAe,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,GAExF,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,GAG9F,MAAM,yBAAyB,CAAC;AAEjC,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,IAAI,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;IAC3E,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;I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