@elaraai/e3-cloud-files 0.0.0-stage → 1.0.92
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/LICENSE.md +54 -0
- package/README.md +286 -2
- package/dist/src/authoring.d.ts +114 -0
- package/dist/src/authoring.d.ts.map +1 -0
- package/dist/src/authoring.js +178 -0
- package/dist/src/authoring.js.map +1 -0
- package/dist/src/check/index.d.ts +15 -0
- package/dist/src/check/index.d.ts.map +1 -0
- package/dist/src/check/index.js +15 -0
- package/dist/src/check/index.js.map +1 -0
- package/dist/src/check.d.ts +66 -0
- package/dist/src/check.d.ts.map +1 -0
- package/dist/src/check.js +140 -0
- package/dist/src/check.js.map +1 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +27 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/paths.d.ts +70 -0
- package/dist/src/paths.d.ts.map +1 -0
- package/dist/src/paths.js +205 -0
- package/dist/src/paths.js.map +1 -0
- package/dist/src/s3/index.d.ts +44 -0
- package/dist/src/s3/index.d.ts.map +1 -0
- package/dist/src/s3/index.js +138 -0
- package/dist/src/s3/index.js.map +1 -0
- package/dist/src/storage/index.d.ts +16 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +120 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/sync/engine.d.ts +191 -0
- package/dist/src/sync/engine.d.ts.map +1 -0
- package/dist/src/sync/engine.js +481 -0
- package/dist/src/sync/engine.js.map +1 -0
- package/dist/src/sync/index.d.ts +15 -0
- package/dist/src/sync/index.d.ts.map +1 -0
- package/dist/src/sync/index.js +15 -0
- package/dist/src/sync/index.js.map +1 -0
- package/dist/src/sync/memory.d.ts +75 -0
- package/dist/src/sync/memory.d.ts.map +1 -0
- package/dist/src/sync/memory.js +155 -0
- package/dist/src/sync/memory.js.map +1 -0
- package/dist/test/decode.examples.d.ts +33 -0
- package/dist/test/decode.examples.d.ts.map +1 -0
- package/dist/test/decode.examples.js +103 -0
- package/dist/test/decode.examples.js.map +1 -0
- package/dist/test/orders.examples.d.ts +88 -0
- package/dist/test/orders.examples.d.ts.map +1 -0
- package/dist/test/orders.examples.js +71 -0
- package/dist/test/orders.examples.js.map +1 -0
- package/package.json +76 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { FilesUnreadableError, NO_LEDGER } from './engine.js';
|
|
6
|
+
/** Items as an async iterable, as a store's paged listing gives them. */
|
|
7
|
+
function iterate(items) {
|
|
8
|
+
return {
|
|
9
|
+
[Symbol.asyncIterator]() {
|
|
10
|
+
let at = 0;
|
|
11
|
+
return {
|
|
12
|
+
next: () => Promise.resolve(at < items.length ? { value: items[at++], done: false } : { value: undefined, done: true }),
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** A bucket in memory: files by key, each with its time and an ETag that changes with its bytes. */
|
|
18
|
+
export class MemoryBucket {
|
|
19
|
+
#files = new Map();
|
|
20
|
+
/** Why each file a reader may not read is refused, by key */
|
|
21
|
+
#refused = new Map();
|
|
22
|
+
#version = 0;
|
|
23
|
+
/** How many times a file's bytes were read, for tests that hold a sync to reading only what changed */
|
|
24
|
+
reads = 0;
|
|
25
|
+
/** How many listings were asked for, for tests that hold a sync to listing a prefix once */
|
|
26
|
+
listings = 0;
|
|
27
|
+
/**
|
|
28
|
+
* Writes a file, as an upload would.
|
|
29
|
+
*
|
|
30
|
+
* @param key - Its key, from the bucket's root
|
|
31
|
+
* @param bytes - Its bytes, or text as UTF-8
|
|
32
|
+
* @param modified - When it was written
|
|
33
|
+
*/
|
|
34
|
+
put(key, bytes, modified = new Date()) {
|
|
35
|
+
const data = typeof bytes === 'string' ? new TextEncoder().encode(bytes) : bytes;
|
|
36
|
+
this.#version += 1;
|
|
37
|
+
this.#files.set(key, { bytes: data, modified, etag: `"${this.#version}-${data.length}"` });
|
|
38
|
+
}
|
|
39
|
+
/** Deletes a file. */
|
|
40
|
+
delete(key) {
|
|
41
|
+
this.#files.delete(key);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Makes a file unreadable, as an archived file, or one encrypted with a key
|
|
45
|
+
* the reader may not use, is: listed, but refused when read.
|
|
46
|
+
*
|
|
47
|
+
* @param key - Its key, from the bucket's root
|
|
48
|
+
* @param reason - Why, as the reader says it; `null` makes it readable again
|
|
49
|
+
*/
|
|
50
|
+
refuse(key, reason) {
|
|
51
|
+
if (reason === null)
|
|
52
|
+
this.#refused.delete(key);
|
|
53
|
+
else
|
|
54
|
+
this.#refused.set(key, reason);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A reader of the files under a prefix, as a binding to `s3://bucket/<prefix>` reads them.
|
|
58
|
+
* A file put after the reader is made is listed by it, as a bucket would list it.
|
|
59
|
+
*
|
|
60
|
+
* @param prefix - The binding's prefix: `''`, or ending with `/`
|
|
61
|
+
* @returns The reader, whose keys are relative to the prefix
|
|
62
|
+
*/
|
|
63
|
+
reader(prefix = '') {
|
|
64
|
+
const files = this.#files;
|
|
65
|
+
const refused = this.#refused;
|
|
66
|
+
const counted = () => { this.reads += 1; };
|
|
67
|
+
const listedOnce = () => { this.listings += 1; };
|
|
68
|
+
const listed = (key, file) => ({ key: key.slice(prefix.length), size: file.bytes.length, modified: file.modified, etag: file.etag });
|
|
69
|
+
return {
|
|
70
|
+
list(under, options = {}) {
|
|
71
|
+
listedOnce();
|
|
72
|
+
const keys = [...files.keys()]
|
|
73
|
+
.filter((key) => key.startsWith(prefix + under) && (options.topFolderOnly !== true || !key.slice((prefix + under).length).includes('/')))
|
|
74
|
+
.sort();
|
|
75
|
+
return iterate(keys.map((key) => listed(key, files.get(key))));
|
|
76
|
+
},
|
|
77
|
+
stat(key) {
|
|
78
|
+
const file = files.get(prefix + key);
|
|
79
|
+
return Promise.resolve(file === undefined ? null : listed(prefix + key, file));
|
|
80
|
+
},
|
|
81
|
+
read(object) {
|
|
82
|
+
const file = files.get(prefix + object.key);
|
|
83
|
+
if (file === undefined)
|
|
84
|
+
return Promise.reject(new FilesUnreadableError(object.key, 'went while the sync read it'));
|
|
85
|
+
if (file.etag !== object.etag)
|
|
86
|
+
return Promise.reject(new FilesUnreadableError(object.key, 'changed since it was listed: the next sync takes it'));
|
|
87
|
+
const reason = refused.get(prefix + object.key);
|
|
88
|
+
if (reason !== undefined)
|
|
89
|
+
return Promise.reject(new FilesUnreadableError(object.key, reason));
|
|
90
|
+
counted();
|
|
91
|
+
return Promise.resolve(file.bytes);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** A workspace's inputs in memory: what a sync wrote to each, and a hash of each value. */
|
|
97
|
+
export class MemoryWorkspace {
|
|
98
|
+
/** Each `file` or `latest` input's bytes */
|
|
99
|
+
files = new Map();
|
|
100
|
+
/** Each `folder` input's entries */
|
|
101
|
+
folders = new Map();
|
|
102
|
+
/** Each `listing` input's rows */
|
|
103
|
+
listings = new Map();
|
|
104
|
+
/** How many times each input was written */
|
|
105
|
+
writes = new Map();
|
|
106
|
+
#values = new Map();
|
|
107
|
+
#version = 0;
|
|
108
|
+
/** Records a write, and answers the value's hash: a new one each time. */
|
|
109
|
+
#wrote(input) {
|
|
110
|
+
this.writes.set(input, (this.writes.get(input) ?? 0) + 1);
|
|
111
|
+
this.#version += 1;
|
|
112
|
+
const value = `value-${this.#version}`;
|
|
113
|
+
this.#values.set(input, value);
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
/** Empties an input, as a deploy that resets the workspace's inputs does. */
|
|
117
|
+
reset(input) {
|
|
118
|
+
this.files.delete(input);
|
|
119
|
+
this.folders.delete(input);
|
|
120
|
+
this.listings.delete(input);
|
|
121
|
+
this.#values.delete(input);
|
|
122
|
+
}
|
|
123
|
+
current(input) {
|
|
124
|
+
return Promise.resolve(this.#values.get(input) ?? null);
|
|
125
|
+
}
|
|
126
|
+
setFile(input, bytes) {
|
|
127
|
+
this.files.set(input, bytes);
|
|
128
|
+
return Promise.resolve(this.#wrote(input));
|
|
129
|
+
}
|
|
130
|
+
updateFolder(input, changes) {
|
|
131
|
+
const folder = changes.fresh ? new Map() : new Map(this.folders.get(input) ?? []);
|
|
132
|
+
for (const path of changes.remove)
|
|
133
|
+
folder.delete(path);
|
|
134
|
+
for (const [path, bytes] of changes.set)
|
|
135
|
+
folder.set(path, bytes);
|
|
136
|
+
this.folders.set(input, new Map([...folder].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))));
|
|
137
|
+
return Promise.resolve(this.#wrote(input));
|
|
138
|
+
}
|
|
139
|
+
setListing(input, rows) {
|
|
140
|
+
this.listings.set(input, new Map(rows));
|
|
141
|
+
return Promise.resolve(this.#wrote(input));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/** A ledger in memory. */
|
|
145
|
+
export class MemoryLedger {
|
|
146
|
+
#states = new Map();
|
|
147
|
+
read(input) {
|
|
148
|
+
return Promise.resolve(this.#states.get(input) ?? NO_LEDGER);
|
|
149
|
+
}
|
|
150
|
+
write(input, state) {
|
|
151
|
+
this.#states.set(input, { entries: new Map(state.entries), value: state.value, under: state.under });
|
|
152
|
+
return Promise.resolve();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../src/sync/memory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAgH,MAAM,aAAa,CAAC;AAE5K,yEAAyE;AACzE,SAAS,OAAO,CAAI,KAAmB;IACrC,OAAO;QACL,CAAC,MAAM,CAAC,aAAa,CAAC;Y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,CAAC;QACxC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,0BAA0B;AAC1B,MAAM,OAAO,YAAY;IACd,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAElD,IAAI,CAAC,KAAa;QAChB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,KAAa,EAAE,KAAkB;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QACrG,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Decoding what Files fills, one example each. Each `fn` is the East
|
|
7
|
+
* function a task runs over an input a source's files fill: a `file` or
|
|
8
|
+
* `latest` input is the file's bytes, a `Blob`; a `folder` input every file's
|
|
9
|
+
* bytes by its path under the prefix, a `Dict<String, Blob>`; a `listing`
|
|
10
|
+
* input each file's size, time and ETag by its path. Nothing decodes a file
|
|
11
|
+
* for you: the task does, here as East's JSON, as CSV, or as lines of text.
|
|
12
|
+
* The declarations themselves (`Files.source`, `file`, `latest`, `folder`,
|
|
13
|
+
* `listing`, `Files.manifest`) are the index's hand-written entries, and the
|
|
14
|
+
* skill's.
|
|
15
|
+
*/
|
|
16
|
+
import { BlobType, DateTimeType, IntegerType, StringType, StructType } from '@elaraai/east';
|
|
17
|
+
export declare const fileAsJson: import("@elaraai/east").ExampleDef<[BlobType], any>;
|
|
18
|
+
export declare const fileAsCsv: import("@elaraai/east").ExampleDef<[BlobType], any>;
|
|
19
|
+
export declare const fileAsLines: import("@elaraai/east").ExampleDef<[BlobType], any>;
|
|
20
|
+
export declare const folderAsOneArray: import("@elaraai/east").ExampleDef<[import("@elaraai/east").DictType<StringType, BlobType>], any>;
|
|
21
|
+
export declare const folderRowsWithTheirFile: import("@elaraai/east").ExampleDef<[import("@elaraai/east").DictType<StringType, BlobType>], any>;
|
|
22
|
+
export declare const folderUnderASubfolder: import("@elaraai/east").ExampleDef<[import("@elaraai/east").DictType<StringType, BlobType>, StringType], any>;
|
|
23
|
+
export declare const listingChangedSince: import("@elaraai/east").ExampleDef<[import("@elaraai/east").DictType<StringType, StructType<{
|
|
24
|
+
readonly size: IntegerType;
|
|
25
|
+
readonly modified: DateTimeType;
|
|
26
|
+
readonly etag: StringType;
|
|
27
|
+
}>>, DateTimeType], any>;
|
|
28
|
+
export declare const listingTotals: import("@elaraai/east").ExampleDef<[import("@elaraai/east").DictType<StringType, StructType<{
|
|
29
|
+
readonly size: IntegerType;
|
|
30
|
+
readonly modified: DateTimeType;
|
|
31
|
+
readonly etag: StringType;
|
|
32
|
+
}>>], any>;
|
|
33
|
+
//# sourceMappingURL=decode.examples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.examples.d.ts","sourceRoot":"","sources":["../../test/decode.examples.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAAmB,QAAQ,EAAE,YAAY,EAAa,WAAW,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAcjI,eAAO,MAAM,UAAU,qDAMrB,CAAC;AAEH,eAAO,MAAM,SAAS,qDAMpB,CAAC;AAEH,eAAO,MAAM,WAAW,qDAOtB,CAAC;AAMH,eAAO,MAAM,gBAAgB,mGAU3B,CAAC;AAEH,eAAO,MAAM,uBAAuB,mGAWlC,CAAC;AAEH,eAAO,MAAM,qBAAqB,+GAOhC,CAAC;AAMH,eAAO,MAAM,mBAAmB;;;;wBAa9B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;UAUxB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Decoding what Files fills, one example each. Each `fn` is the East
|
|
7
|
+
* function a task runs over an input a source's files fill: a `file` or
|
|
8
|
+
* `latest` input is the file's bytes, a `Blob`; a `folder` input every file's
|
|
9
|
+
* bytes by its path under the prefix, a `Dict<String, Blob>`; a `listing`
|
|
10
|
+
* input each file's size, time and ETag by its path. Nothing decodes a file
|
|
11
|
+
* for you: the task does, here as East's JSON, as CSV, or as lines of text.
|
|
12
|
+
* The declarations themselves (`Files.source`, `file`, `latest`, `folder`,
|
|
13
|
+
* `listing`, `Files.manifest`) are the index's hand-written entries, and the
|
|
14
|
+
* skill's.
|
|
15
|
+
*/
|
|
16
|
+
import { East, ArrayType, BlobType, DateTimeType, FloatType, IntegerType, StringType, StructType, example } from '@elaraai/east';
|
|
17
|
+
import { FilesFolderType, FilesListingType } from '@elaraai/e3-cloud-files';
|
|
18
|
+
const Rate = StructType({ currency: StringType, rate: FloatType });
|
|
19
|
+
const Order = StructType({ id: StringType, sku: StringType, amount: FloatType });
|
|
20
|
+
const Reading = StructType({ tank: StringType, litres: FloatType });
|
|
21
|
+
/** Text as a file's bytes. */
|
|
22
|
+
const utf8 = (text) => new TextEncoder().encode(text);
|
|
23
|
+
// ---
|
|
24
|
+
// A file's bytes: file and latest
|
|
25
|
+
// ---
|
|
26
|
+
export const fileAsJson = example({
|
|
27
|
+
keywords: ['Files', 'file', 'latest', 'Blob', 'decodeUtf8', 'parseJson', 'JSON', 'decode', 'task'],
|
|
28
|
+
description: 'A file input\'s bytes decoded as East\'s JSON, in the task that reads it: what upload.file(\'rates\', { key: \'rates.json\' }) or upload.latest(…) fills, a Blob',
|
|
29
|
+
fn: East.function([BlobType], ArrayType(Rate), (_$, file) => file.decodeUtf8().parseJson(ArrayType(Rate))),
|
|
30
|
+
inputs: [utf8('[{"currency":"AUD","rate":1.0},{"currency":"USD","rate":0.66}]')],
|
|
31
|
+
returns: [{ currency: 'AUD', rate: 1.0 }, { currency: 'USD', rate: 0.66 }],
|
|
32
|
+
});
|
|
33
|
+
export const fileAsCsv = example({
|
|
34
|
+
keywords: ['Files', 'file', 'latest', 'Blob', 'decodeCsv', 'CSV', 'header', 'delimiter', 'columns'],
|
|
35
|
+
description: 'A file input\'s bytes decoded as CSV with a header row, each row a struct whose fields name the columns',
|
|
36
|
+
fn: East.function([BlobType], ArrayType(Reading), (_$, file) => file.decodeCsv(Reading, { delimiter: ',' })),
|
|
37
|
+
inputs: [utf8('tank,litres\nT1,1200.5\nT2,880\n')],
|
|
38
|
+
returns: [{ tank: 'T1', litres: 1200.5 }, { tank: 'T2', litres: 880 }],
|
|
39
|
+
});
|
|
40
|
+
export const fileAsLines = example({
|
|
41
|
+
keywords: ['Files', 'file', 'Blob', 'decodeUtf8', 'split', 'lines', 'text', 'trim'],
|
|
42
|
+
description: 'A text file input\'s lines, trimmed, blank ones left out',
|
|
43
|
+
fn: East.function([BlobType], ArrayType(StringType), (_$, file) => file.decodeUtf8().split('\n').map((_$, line) => line.trim()).filter((_$, line) => line.notEquals(''))),
|
|
44
|
+
inputs: [utf8('first\n\n second \nthird\n')],
|
|
45
|
+
returns: ['first', 'second', 'third'],
|
|
46
|
+
});
|
|
47
|
+
// ---
|
|
48
|
+
// A folder's files
|
|
49
|
+
// ---
|
|
50
|
+
export const folderAsOneArray = example({
|
|
51
|
+
keywords: ['Files', 'folder', 'Dict', 'Blob', 'flattenToArray', 'parseJson', 'every file', 'concatenate'],
|
|
52
|
+
description: 'Every file of a folder input decoded and joined into one array, in the order of their paths: what upload.folder(\'orders\', { prefix: \'orders/\', include: \'*.json\' }) fills, a Dict<String, Blob> keyed by each file\'s path under the prefix',
|
|
53
|
+
fn: East.function([FilesFolderType], ArrayType(Order), (_$, files) => files.flattenToArray((_$, file) => file.decodeUtf8().parseJson(ArrayType(Order)))),
|
|
54
|
+
inputs: [new Map([
|
|
55
|
+
['2026-10-01.json', utf8('[{"id":"O-1","sku":"A1","amount":250.0}]')],
|
|
56
|
+
['2026-10-02.json', utf8('[{"id":"O-2","sku":"B2","amount":80.0},{"id":"O-3","sku":"A1","amount":120.0}]')],
|
|
57
|
+
])],
|
|
58
|
+
returns: [{ id: 'O-1', sku: 'A1', amount: 250 }, { id: 'O-2', sku: 'B2', amount: 80 }, { id: 'O-3', sku: 'A1', amount: 120 }],
|
|
59
|
+
});
|
|
60
|
+
export const folderRowsWithTheirFile = example({
|
|
61
|
+
keywords: ['Files', 'folder', 'path', 'key', 'flattenToArray', 'decodeCsv', 'which file', 'provenance'],
|
|
62
|
+
description: 'Every CSV file of a folder input decoded, each row carrying the path of the file it came from',
|
|
63
|
+
fn: East.function([FilesFolderType], ArrayType(StructType({ file: StringType, tank: StringType, litres: FloatType })), (_$, files) => files.flattenToArray((_$, file, path) => file.decodeCsv(Reading, { delimiter: ',' }).map((_$, row) => ({ file: path, tank: row.tank, litres: row.litres })))),
|
|
64
|
+
inputs: [new Map([
|
|
65
|
+
['site-a.csv', utf8('tank,litres\nT1,1200.5\n')],
|
|
66
|
+
['site-b.csv', utf8('tank,litres\nT9,40\n')],
|
|
67
|
+
])],
|
|
68
|
+
returns: [{ file: 'site-a.csv', tank: 'T1', litres: 1200.5 }, { file: 'site-b.csv', tank: 'T9', litres: 40 }],
|
|
69
|
+
});
|
|
70
|
+
export const folderUnderASubfolder = example({
|
|
71
|
+
keywords: ['Files', 'folder', 'filter', 'startsWith', 'path', 'subfolder', 'include', '**'],
|
|
72
|
+
description: 'Only the files of a folder input under one of its subfolders. A folder declared with include \'**/*.csv\', or none, holds its subfolders\' files too, each path naming its subfolder (2026/10/a.csv); \'*.csv\' matches only the top level',
|
|
73
|
+
fn: East.function([FilesFolderType, StringType], FilesFolderType, (_$, files, under) => files.filter((_$, _file, path) => path.startsWith(under))),
|
|
74
|
+
inputs: [new Map([['2025/12/a.csv', utf8('a')], ['2026/01/b.csv', utf8('b')], ['2026/02/c.csv', utf8('c')]]), '2026/'],
|
|
75
|
+
returns: new Map([['2026/01/b.csv', utf8('b')], ['2026/02/c.csv', utf8('c')]]),
|
|
76
|
+
});
|
|
77
|
+
// ---
|
|
78
|
+
// A listing: the files, without their bytes
|
|
79
|
+
// ---
|
|
80
|
+
export const listingChangedSince = example({
|
|
81
|
+
keywords: ['Files', 'listing', 'modified', 'since', 'DateTime', 'filter', 'keys', 'newest'],
|
|
82
|
+
description: 'The paths of a listing input\'s files changed since a time, without reading their bytes: what upload.listing(\'order_files\', { prefix: \'orders/\' }) fills, each file\'s size, modified time and ETag by its path',
|
|
83
|
+
fn: East.function([FilesListingType, DateTimeType], ArrayType(StringType), (_$, rows, since) => rows.filter((_$, row) => row.modified.greaterThan(since)).keys().toArray()),
|
|
84
|
+
inputs: [
|
|
85
|
+
new Map([
|
|
86
|
+
['2026-10-01.json', { size: 120n, modified: new Date(Date.UTC(2026, 9, 1)), etag: 'a1' }],
|
|
87
|
+
['2026-10-02.json', { size: 310n, modified: new Date(Date.UTC(2026, 9, 2)), etag: 'b2' }],
|
|
88
|
+
]),
|
|
89
|
+
new Date(Date.UTC(2026, 9, 1, 12)),
|
|
90
|
+
],
|
|
91
|
+
returns: ['2026-10-02.json'],
|
|
92
|
+
});
|
|
93
|
+
export const listingTotals = example({
|
|
94
|
+
keywords: ['Files', 'listing', 'size', 'sum', 'count', 'bytes', 'how many'],
|
|
95
|
+
description: 'How many files a listing input holds, and their bytes in all',
|
|
96
|
+
fn: East.function([FilesListingType], StructType({ files: IntegerType, bytes: IntegerType }), (_$, rows) => ({ files: rows.size(), bytes: rows.sum((_$, row) => row.size) })),
|
|
97
|
+
inputs: [new Map([
|
|
98
|
+
['a.json', { size: 120n, modified: new Date(Date.UTC(2026, 9, 1)), etag: 'a1' }],
|
|
99
|
+
['b.json', { size: 310n, modified: new Date(Date.UTC(2026, 9, 2)), etag: 'b2' }],
|
|
100
|
+
])],
|
|
101
|
+
returns: { files: 2n, bytes: 430n },
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=decode.examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.examples.js","sourceRoot":"","sources":["../../test/decode.examples.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjI,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE5E,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AACnE,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AACjF,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpE,8BAA8B;AAC9B,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAE9D,MAAM;AACN,kCAAkC;AAClC,MAAM;AAEN,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;IAChC,QAAQ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E for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The worked example of the author's guide (README): an orders business whose
|
|
7
|
+
* partners drop files in a bucket. Every shape appears: one file (`rates`),
|
|
8
|
+
* the newest of a folder of snapshots (`stock`), every file of a folder
|
|
9
|
+
* (`orders`), and a folder's listing (`order_files`), each decoded in East by
|
|
10
|
+
* a task, as a file's bytes arrive as they are.
|
|
11
|
+
*
|
|
12
|
+
* `sampleFiles` is what a partner drops, in East's JSON; the examples deploy
|
|
13
|
+
* uploads them to the bucket the example binds, then syncs and runs.
|
|
14
|
+
*/
|
|
15
|
+
import { ArrayType, BlobType, FloatType, IntegerType, StringType, StructType } from '@elaraai/east';
|
|
16
|
+
import { type FilesManifest } from '../src/index.js';
|
|
17
|
+
/** Where the partners' files are: each workspace binds it to a bucket and prefix. */
|
|
18
|
+
export declare const upload: import("../src/authoring.js").FilesSource;
|
|
19
|
+
/** One file: today's exchange rates. */
|
|
20
|
+
export declare const rates: import("@elaraai/e3").DatasetDef<BlobType, [import("@elaraai/east").variant<"field", "inputs">, import("@elaraai/east").variant<"field", "rates">]>;
|
|
21
|
+
/** The newest stock snapshot: the snapshots are named by their date, so the greatest key is the latest. */
|
|
22
|
+
export declare const stock: import("@elaraai/e3").DatasetDef<BlobType, [import("@elaraai/east").variant<"field", "inputs">, import("@elaraai/east").variant<"field", "stock">]>;
|
|
23
|
+
/** Every order file, keyed by its name. */
|
|
24
|
+
export declare const orders: import("@elaraai/e3").DatasetDef<import("@elaraai/east").DictType<StringType, BlobType>, [import("@elaraai/east").variant<"field", "inputs">, import("@elaraai/east").variant<"field", "orders">]>;
|
|
25
|
+
/** The order files' sizes, times and ETags, without their bytes. */
|
|
26
|
+
export declare const orderFiles: import("@elaraai/e3").DatasetDef<import("@elaraai/east").DictType<StringType, StructType<{
|
|
27
|
+
readonly size: IntegerType;
|
|
28
|
+
readonly modified: import("@elaraai/east").DateTimeType;
|
|
29
|
+
readonly etag: StringType;
|
|
30
|
+
}>>, [import("@elaraai/east").variant<"field", "inputs">, import("@elaraai/east").variant<"field", "order_files">]>;
|
|
31
|
+
/** What `e3-cloud files deploy` deploys. */
|
|
32
|
+
declare const manifest: FilesManifest;
|
|
33
|
+
export default manifest;
|
|
34
|
+
export declare const Rate: StructType<{
|
|
35
|
+
readonly currency: StringType;
|
|
36
|
+
readonly rate: FloatType;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const StockLine: StructType<{
|
|
39
|
+
readonly sku: StringType;
|
|
40
|
+
readonly units: FloatType;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const Order: StructType<{
|
|
43
|
+
readonly id: StringType;
|
|
44
|
+
readonly sku: StringType;
|
|
45
|
+
readonly currency: StringType;
|
|
46
|
+
readonly amount: FloatType;
|
|
47
|
+
}>;
|
|
48
|
+
/** A file's bytes as East's JSON. */
|
|
49
|
+
export declare const decodeRates: import("@elaraai/east").CallableFunctionExpr<[BlobType], ArrayType<StructType<{
|
|
50
|
+
readonly currency: StringType;
|
|
51
|
+
readonly rate: FloatType;
|
|
52
|
+
}>>>;
|
|
53
|
+
export declare const decodeStock: import("@elaraai/east").CallableFunctionExpr<[BlobType], ArrayType<StructType<{
|
|
54
|
+
readonly sku: StringType;
|
|
55
|
+
readonly units: FloatType;
|
|
56
|
+
}>>>;
|
|
57
|
+
/** Every order file's orders, one after another. */
|
|
58
|
+
export declare const decodeOrders: import("@elaraai/east").CallableFunctionExpr<[import("@elaraai/east").DictType<StringType, BlobType>], ArrayType<StructType<{
|
|
59
|
+
readonly id: StringType;
|
|
60
|
+
readonly sku: StringType;
|
|
61
|
+
readonly currency: StringType;
|
|
62
|
+
readonly amount: FloatType;
|
|
63
|
+
}>>>;
|
|
64
|
+
/** How many order files there are, from the listing alone. */
|
|
65
|
+
export declare const countFiles: import("@elaraai/east").CallableFunctionExpr<[import("@elaraai/east").DictType<StringType, StructType<{
|
|
66
|
+
readonly size: IntegerType;
|
|
67
|
+
readonly modified: import("@elaraai/east").DateTimeType;
|
|
68
|
+
readonly etag: StringType;
|
|
69
|
+
}>>], IntegerType>;
|
|
70
|
+
export declare const rateTable: import("@elaraai/e3").TaskDef<ArrayType<StructType<{
|
|
71
|
+
readonly currency: StringType;
|
|
72
|
+
readonly rate: FloatType;
|
|
73
|
+
}>>, [import("@elaraai/east").variant<"field", "tasks">, import("@elaraai/east").variant<"field", "rate_table">, import("@elaraai/east").variant<"field", "output">]>;
|
|
74
|
+
export declare const stockLevels: import("@elaraai/e3").TaskDef<ArrayType<StructType<{
|
|
75
|
+
readonly sku: StringType;
|
|
76
|
+
readonly units: FloatType;
|
|
77
|
+
}>>, [import("@elaraai/east").variant<"field", "tasks">, import("@elaraai/east").variant<"field", "stock_levels">, import("@elaraai/east").variant<"field", "output">]>;
|
|
78
|
+
export declare const allOrders: import("@elaraai/e3").TaskDef<ArrayType<StructType<{
|
|
79
|
+
readonly id: StringType;
|
|
80
|
+
readonly sku: StringType;
|
|
81
|
+
readonly currency: StringType;
|
|
82
|
+
readonly amount: FloatType;
|
|
83
|
+
}>>, [import("@elaraai/east").variant<"field", "tasks">, import("@elaraai/east").variant<"field", "all_orders">, import("@elaraai/east").variant<"field", "output">]>;
|
|
84
|
+
export declare const orderFileCount: import("@elaraai/e3").TaskDef<IntegerType, [import("@elaraai/east").variant<"field", "tasks">, import("@elaraai/east").variant<"field", "order_file_count">, import("@elaraai/east").variant<"field", "output">]>;
|
|
85
|
+
export declare const ordersPackage: import("@elaraai/e3").PackageDef<Record<string, unknown>>;
|
|
86
|
+
/** Sample files, by key under the binding, written with East's JSON encoder. */
|
|
87
|
+
export declare const sampleFiles: ReadonlyMap<string, Uint8Array>;
|
|
88
|
+
//# sourceMappingURL=orders.examples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.examples.d.ts","sourceRoot":"","sources":["../../test/orders.examples.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAQ,SAAS,EAAE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ensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The worked example of the author's guide (README): an orders business whose
|
|
7
|
+
* partners drop files in a bucket. Every shape appears: one file (`rates`),
|
|
8
|
+
* the newest of a folder of snapshots (`stock`), every file of a folder
|
|
9
|
+
* (`orders`), and a folder's listing (`order_files`), each decoded in East by
|
|
10
|
+
* a task, as a file's bytes arrive as they are.
|
|
11
|
+
*
|
|
12
|
+
* `sampleFiles` is what a partner drops, in East's JSON; the examples deploy
|
|
13
|
+
* uploads them to the bucket the example binds, then syncs and runs.
|
|
14
|
+
*/
|
|
15
|
+
import { East, ArrayType, BlobType, FloatType, IntegerType, StringType, StructType, encodeJSONFor } from '@elaraai/east';
|
|
16
|
+
import e3 from '@elaraai/e3';
|
|
17
|
+
import { Files, FilesFolderType, FilesListingType } from '../src/index.js';
|
|
18
|
+
const RUNNER = { runtime: 'east-c', platforms: ['east-c-std'] };
|
|
19
|
+
// ─── src/files.ts: the files, and the inputs they fill ──────────────────────
|
|
20
|
+
/** Where the partners' files are: each workspace binds it to a bucket and prefix. */
|
|
21
|
+
export const upload = Files.source('upload');
|
|
22
|
+
/** One file: today's exchange rates. */
|
|
23
|
+
export const rates = upload.file('rates', { key: 'rates.json' });
|
|
24
|
+
/** The newest stock snapshot: the snapshots are named by their date, so the greatest key is the latest. */
|
|
25
|
+
export const stock = upload.latest('stock', { prefix: 'stock/', include: '*.json' });
|
|
26
|
+
/** Every order file, keyed by its name. */
|
|
27
|
+
export const orders = upload.folder('orders', { prefix: 'orders/', include: '*.json' });
|
|
28
|
+
/** The order files' sizes, times and ETags, without their bytes. */
|
|
29
|
+
export const orderFiles = upload.listing('order_files', { prefix: 'orders/', include: '*.json' });
|
|
30
|
+
/** What `e3-cloud files deploy` deploys. */
|
|
31
|
+
const manifest = Files.manifest([upload]);
|
|
32
|
+
export default manifest;
|
|
33
|
+
// ─── src/package.ts: the files, decoded ─────────────────────────────────────
|
|
34
|
+
export const Rate = StructType({ currency: StringType, rate: FloatType });
|
|
35
|
+
export const StockLine = StructType({ sku: StringType, units: FloatType });
|
|
36
|
+
export const Order = StructType({ id: StringType, sku: StringType, currency: StringType, amount: FloatType });
|
|
37
|
+
/** A file's bytes as East's JSON. */
|
|
38
|
+
export const decodeRates = East.function([BlobType], ArrayType(Rate), (_$, file) => file.decodeUtf8().parseJson(ArrayType(Rate)));
|
|
39
|
+
export const decodeStock = East.function([BlobType], ArrayType(StockLine), (_$, file) => file.decodeUtf8().parseJson(ArrayType(StockLine)));
|
|
40
|
+
/** Every order file's orders, one after another. */
|
|
41
|
+
export const decodeOrders = East.function([FilesFolderType], ArrayType(Order), ($, files) => {
|
|
42
|
+
const all = $.let([], ArrayType(Order));
|
|
43
|
+
$.for(files, ($, file) => {
|
|
44
|
+
$(all.append(file.decodeUtf8().parseJson(ArrayType(Order))));
|
|
45
|
+
});
|
|
46
|
+
$.return(all);
|
|
47
|
+
});
|
|
48
|
+
/** How many order files there are, from the listing alone. */
|
|
49
|
+
export const countFiles = East.function([FilesListingType], IntegerType, (_$, rows) => rows.size());
|
|
50
|
+
export const rateTable = e3.task('rate_table', [rates], decodeRates, { runner: RUNNER });
|
|
51
|
+
export const stockLevels = e3.task('stock_levels', [stock], decodeStock, { runner: RUNNER });
|
|
52
|
+
export const allOrders = e3.task('all_orders', [orders], decodeOrders, { runner: RUNNER });
|
|
53
|
+
export const orderFileCount = e3.task('order_file_count', [orderFiles], countFiles, { runner: RUNNER });
|
|
54
|
+
export const ordersPackage = e3.package('orders', '1.0.0', rateTable, stockLevels, allOrders, orderFileCount);
|
|
55
|
+
// ─── What a partner drops ───────────────────────────────────────────────────
|
|
56
|
+
const rateFile = encodeJSONFor(ArrayType(Rate));
|
|
57
|
+
const stockFile = encodeJSONFor(ArrayType(StockLine));
|
|
58
|
+
const orderFile = encodeJSONFor(ArrayType(Order));
|
|
59
|
+
/** Sample files, by key under the binding, written with East's JSON encoder. */
|
|
60
|
+
export const sampleFiles = new Map([
|
|
61
|
+
['rates.json', rateFile([{ currency: 'AUD', rate: 1.0 }, { currency: 'USD', rate: 0.66 }])],
|
|
62
|
+
['stock/2026-10-01.json', stockFile([{ sku: 'A1', units: 120 }, { sku: 'B2', units: 40 }])],
|
|
63
|
+
['stock/2026-10-02.json', stockFile([{ sku: 'A1', units: 95 }, { sku: 'B2', units: 52 }])],
|
|
64
|
+
['orders/2026-10-01.json', orderFile([{ id: 'O-1', sku: 'A1', currency: 'AUD', amount: 250 }])],
|
|
65
|
+
['orders/2026-10-02.json', orderFile([
|
|
66
|
+
{ id: 'O-2', sku: 'B2', currency: 'USD', amount: 80 },
|
|
67
|
+
{ id: 'O-3', sku: 'A1', currency: 'AUD', amount: 120 },
|
|
68
|
+
])],
|
|
69
|
+
['orders/README.txt', new TextEncoder().encode('Not an order file: the glob leaves it out.')],
|
|
70
|
+
]);
|
|
71
|
+
//# sourceMappingURL=orders.examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.examples.js","sourceRoot":"","sources":["../../test/orders.examples.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzH,OAAO,EAAmB,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAsB,MAAM,iBAAiB,CAAC;AAE/F,MAAM,MAAM,GAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAExE,+EAA+E;AAE/E,qFAAqF;AACrF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAE7C,wCAAwC;AACxC,MAAM,CAAC,MAAM,KAAK,GAAG,MA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,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3F,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC/F,CAAC,wBAAwB,EAAE,SAAS,CAAC;YACnC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;YACrD,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE;SACvD,CAAC,CAAC;IACH,CAAC,mBAAmB,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,4CAA4C,CAAC,CAAC;CAC9F,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,79 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elaraai/e3-cloud-files",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.92",
|
|
4
|
+
"description": "Files for e3 cloud: a solution's inputs that come from files in a bucket, declared in its code and synced on demand, locally and in the cloud",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/src/index.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/src/index.d.ts",
|
|
11
|
+
"default": "./dist/src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./check": {
|
|
14
|
+
"types": "./dist/src/check/index.d.ts",
|
|
15
|
+
"default": "./dist/src/check/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./sync": {
|
|
18
|
+
"types": "./dist/src/sync/index.d.ts",
|
|
19
|
+
"default": "./dist/src/sync/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./storage": {
|
|
22
|
+
"types": "./dist/src/storage/index.d.ts",
|
|
23
|
+
"default": "./dist/src/storage/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./s3": {
|
|
26
|
+
"types": "./dist/src/s3/index.d.ts",
|
|
27
|
+
"default": "./dist/src/s3/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./examples/*": {
|
|
30
|
+
"types": "./dist/test/*.examples.d.ts",
|
|
31
|
+
"default": "./dist/test/*.examples.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist/src/**/*",
|
|
36
|
+
"dist/test/**/*.examples.*",
|
|
37
|
+
"!dist/**/*.spec.*",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE.md"
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"east",
|
|
43
|
+
"elara",
|
|
44
|
+
"e3",
|
|
45
|
+
"e3-cloud",
|
|
46
|
+
"files",
|
|
47
|
+
"s3"
|
|
48
|
+
],
|
|
49
|
+
"author": "Elara AI Pty Ltd",
|
|
50
|
+
"license": "BUSL-1.1",
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.0.0"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@elaraai/e3-types": "1.0.92",
|
|
57
|
+
"@elaraai/e3-cloud-types": "1.0.92"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"@aws-sdk/client-s3": "^3.966.0",
|
|
61
|
+
"@elaraai/e3": "1.0.92",
|
|
62
|
+
"@elaraai/e3-core": "1.0.92",
|
|
63
|
+
"@elaraai/east": "1.0.92"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"@aws-sdk/client-s3": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"@elaraai/e3": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"@elaraai/e3-core": {
|
|
73
|
+
"optional": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
}
|
|
6
79
|
}
|