@elaraai/e3-types 1.0.79 → 1.0.80
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 +1 -1
- package/dist/src/api.d.ts +569 -36
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/api.js +257 -32
- package/dist/src/api.js.map +1 -1
- package/dist/src/collection-manifest.d.ts +37 -0
- package/dist/src/collection-manifest.d.ts.map +1 -0
- package/dist/src/collection-manifest.js +37 -0
- package/dist/src/collection-manifest.js.map +1 -0
- package/dist/src/dataflow.d.ts +264 -19
- package/dist/src/dataflow.d.ts.map +1 -1
- package/dist/src/dataflow.js +156 -15
- package/dist/src/dataflow.js.map +1 -1
- package/dist/src/dataflow.spec.js +184 -27
- package/dist/src/dataflow.spec.js.map +1 -1
- package/dist/src/dataset-blob.d.ts +75 -15
- package/dist/src/dataset-blob.d.ts.map +1 -1
- package/dist/src/dataset-blob.js +95 -28
- package/dist/src/dataset-blob.js.map +1 -1
- package/dist/src/dataset-blob.spec.d.ts +6 -0
- package/dist/src/dataset-blob.spec.d.ts.map +1 -0
- package/dist/src/dataset-blob.spec.js +92 -0
- package/dist/src/dataset-blob.spec.js.map +1 -0
- package/dist/src/dataset-ref.d.ts +5 -4
- package/dist/src/dataset-ref.d.ts.map +1 -1
- package/dist/src/dataset-ref.js +5 -4
- package/dist/src/dataset-ref.js.map +1 -1
- package/dist/src/environment.d.ts +3 -2
- package/dist/src/environment.d.ts.map +1 -1
- package/dist/src/environment.js +3 -2
- package/dist/src/environment.js.map +1 -1
- package/dist/src/execution.d.ts +112 -18
- package/dist/src/execution.d.ts.map +1 -1
- package/dist/src/execution.js +174 -45
- package/dist/src/execution.js.map +1 -1
- package/dist/src/execution.spec.d.ts +6 -0
- package/dist/src/execution.spec.d.ts.map +1 -0
- package/dist/src/execution.spec.js +108 -0
- package/dist/src/execution.spec.js.map +1 -0
- package/dist/src/function.d.ts +14 -12
- package/dist/src/function.d.ts.map +1 -1
- package/dist/src/function.js +17 -32
- package/dist/src/function.js.map +1 -1
- package/dist/src/index.d.ts +16 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +25 -20
- package/dist/src/index.js.map +1 -1
- package/dist/src/lock.d.ts +68 -22
- package/dist/src/lock.d.ts.map +1 -1
- package/dist/src/lock.js +33 -22
- package/dist/src/lock.js.map +1 -1
- package/dist/src/names.d.ts +21 -0
- package/dist/src/names.d.ts.map +1 -0
- package/dist/src/names.js +31 -0
- package/dist/src/names.js.map +1 -0
- package/dist/src/package.d.ts +11 -78
- package/dist/src/package.d.ts.map +1 -1
- package/dist/src/package.js +13 -66
- package/dist/src/package.js.map +1 -1
- package/dist/src/record.d.ts +582 -18
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/record.js +405 -7
- package/dist/src/record.js.map +1 -1
- package/dist/src/{stream.spec.d.ts → record.spec.d.ts} +1 -1
- package/dist/src/record.spec.d.ts.map +1 -0
- package/dist/src/record.spec.js +143 -0
- package/dist/src/record.spec.js.map +1 -0
- package/dist/src/release.d.ts +36 -0
- package/dist/src/release.d.ts.map +1 -0
- package/dist/src/release.js +71 -0
- package/dist/src/release.js.map +1 -0
- package/dist/src/release.spec.d.ts +6 -0
- package/dist/src/release.spec.d.ts.map +1 -0
- package/dist/src/release.spec.js +42 -0
- package/dist/src/release.spec.js.map +1 -0
- package/dist/src/repository.d.ts +64 -0
- package/dist/src/repository.d.ts.map +1 -0
- package/dist/src/repository.js +49 -0
- package/dist/src/repository.js.map +1 -0
- package/dist/src/runner.d.ts +16 -62
- package/dist/src/runner.d.ts.map +1 -1
- package/dist/src/runner.js +16 -79
- package/dist/src/runner.js.map +1 -1
- package/dist/src/runner.spec.js +11 -85
- package/dist/src/runner.spec.js.map +1 -1
- package/dist/src/structure.d.ts +0 -57
- package/dist/src/structure.d.ts.map +1 -1
- package/dist/src/structure.js +0 -3
- package/dist/src/structure.js.map +1 -1
- package/dist/src/task.d.ts +210 -318
- package/dist/src/task.d.ts.map +1 -1
- package/dist/src/task.js +117 -472
- package/dist/src/task.js.map +1 -1
- package/dist/src/task.spec.js +62 -154
- package/dist/src/task.spec.js.map +1 -1
- package/dist/src/transfer.d.ts +16 -22
- package/dist/src/transfer.d.ts.map +1 -1
- package/dist/src/transfer.js +16 -22
- package/dist/src/transfer.js.map +1 -1
- package/dist/src/transfer.spec.js +4 -34
- package/dist/src/transfer.spec.js.map +1 -1
- package/dist/src/unit-plan.d.ts +130 -0
- package/dist/src/unit-plan.d.ts.map +1 -0
- package/dist/src/unit-plan.js +107 -0
- package/dist/src/unit-plan.js.map +1 -0
- package/dist/src/unit-plan.spec.d.ts +6 -0
- package/dist/src/unit-plan.spec.d.ts.map +1 -0
- package/dist/src/unit-plan.spec.js +29 -0
- package/dist/src/unit-plan.spec.js.map +1 -0
- package/dist/src/workspace.d.ts +22 -11
- package/dist/src/workspace.d.ts.map +1 -1
- package/dist/src/workspace.js +10 -11
- package/dist/src/workspace.js.map +1 -1
- package/package.json +3 -3
- package/src/api.ts +276 -32
- package/src/collection-manifest.ts +53 -0
- package/src/dataflow.spec.ts +223 -31
- package/src/dataflow.ts +183 -26
- package/src/dataset-blob.spec.ts +117 -0
- package/src/dataset-blob.ts +157 -21
- package/src/dataset-ref.ts +5 -4
- package/src/environment.ts +3 -2
- package/src/execution.spec.ts +114 -0
- package/src/execution.ts +175 -51
- package/src/function.ts +19 -32
- package/src/index.ts +122 -39
- package/src/lock.ts +39 -22
- package/src/names.ts +39 -0
- package/src/package.ts +15 -71
- package/src/record.spec.ts +195 -0
- package/src/record.ts +489 -7
- package/src/release.spec.ts +47 -0
- package/src/release.ts +69 -0
- package/src/repository.ts +67 -0
- package/src/runner.spec.ts +11 -94
- package/src/runner.ts +16 -80
- package/src/structure.ts +0 -8
- package/src/task.spec.ts +67 -188
- package/src/task.ts +140 -522
- package/src/transfer.spec.ts +4 -51
- package/src/transfer.ts +16 -22
- package/src/unit-plan.spec.ts +31 -0
- package/src/unit-plan.ts +121 -0
- package/src/workspace.ts +13 -11
- package/dist/src/stream.d.ts +0 -97
- package/dist/src/stream.d.ts.map +0 -1
- package/dist/src/stream.js +0 -134
- package/dist/src/stream.js.map +0 -1
- package/dist/src/stream.spec.d.ts.map +0 -1
- package/dist/src/stream.spec.js +0 -60
- package/dist/src/stream.spec.js.map +0 -1
- package/src/stream.spec.ts +0 -88
- package/src/stream.ts +0 -170
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/** What no name may hold: a path separator, a character a Windows file name
|
|
6
|
+
* refuses, or a control character. */
|
|
7
|
+
const REFUSED = /[/\\:*?"<>|\u0000-\u001f]/;
|
|
8
|
+
/** What a workspace's name may not hold besides: the characters that join the
|
|
9
|
+
* parts of its locks' names. */
|
|
10
|
+
const REFUSED_IN_WORKSPACE = /[#~]/;
|
|
11
|
+
/**
|
|
12
|
+
* Why a name cannot be one path segment, or `null` when it can.
|
|
13
|
+
*
|
|
14
|
+
* @param kind - What the name names
|
|
15
|
+
* @param name - The name
|
|
16
|
+
* @returns The problem, in words that follow the name, or `null`
|
|
17
|
+
*/
|
|
18
|
+
export function nameProblem(kind, name) {
|
|
19
|
+
if (name === '')
|
|
20
|
+
return 'is empty';
|
|
21
|
+
if (name === '.' || name === '..')
|
|
22
|
+
return 'is a path of its own';
|
|
23
|
+
const refused = REFUSED.exec(name);
|
|
24
|
+
if (refused !== null)
|
|
25
|
+
return `holds ${JSON.stringify(refused[0])}, which a file name cannot`;
|
|
26
|
+
const joiner = kind === 'workspace' ? REFUSED_IN_WORKSPACE.exec(name) : null;
|
|
27
|
+
if (joiner !== null)
|
|
28
|
+
return `holds ${JSON.stringify(joiner[0])}, which joins the parts of a lock's name`;
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../src/names.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;uCACuC;AACvC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAE5C;iCACiC;AACjC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAe,EAAE,IAAY;IACvD,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,UAAU,CAAC;IACnC,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,sBAAsB,CAAC;IACjE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC;IAC7F,MAAM,MAAM,GAAG,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,0CAA0C,CAAC;IACzG,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/src/package.d.ts
CHANGED
|
@@ -88,73 +88,6 @@ export declare const PackageDataType: StructType<{
|
|
|
88
88
|
}>;
|
|
89
89
|
export type PackageDataType = typeof PackageDataType;
|
|
90
90
|
export type PackageData = ValueTypeOf<typeof PackageDataType>;
|
|
91
|
-
/** @deprecated Use PackageDataType instead */
|
|
92
|
-
export declare const PackageDatasetsType: StructType<{
|
|
93
|
-
/** Structure defining tree shape (what's a group vs dataset) */
|
|
94
|
-
readonly structure: import("@elaraai/east").RecursiveType<VariantType<{
|
|
95
|
-
readonly value: StructType<{
|
|
96
|
-
readonly type: import("@elaraai/east").RecursiveType<VariantType<{
|
|
97
|
-
readonly Never: NullType;
|
|
98
|
-
readonly Null: NullType;
|
|
99
|
-
readonly Boolean: NullType;
|
|
100
|
-
readonly Integer: NullType;
|
|
101
|
-
readonly Float: NullType;
|
|
102
|
-
readonly String: NullType;
|
|
103
|
-
readonly DateTime: NullType;
|
|
104
|
-
readonly Blob: NullType;
|
|
105
|
-
readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
|
|
106
|
-
readonly Array: import("@elaraai/east").RecursiveTypeMarker;
|
|
107
|
-
readonly Set: import("@elaraai/east").RecursiveTypeMarker;
|
|
108
|
-
readonly Dict: StructType<{
|
|
109
|
-
readonly key: import("@elaraai/east").RecursiveTypeMarker;
|
|
110
|
-
readonly value: import("@elaraai/east").RecursiveTypeMarker;
|
|
111
|
-
}>;
|
|
112
|
-
readonly Struct: import("@elaraai/east").ArrayType<StructType<{
|
|
113
|
-
readonly name: StringType;
|
|
114
|
-
readonly type: import("@elaraai/east").RecursiveTypeMarker;
|
|
115
|
-
}>>;
|
|
116
|
-
readonly Variant: import("@elaraai/east").ArrayType<StructType<{
|
|
117
|
-
readonly name: StringType;
|
|
118
|
-
readonly type: import("@elaraai/east").RecursiveTypeMarker;
|
|
119
|
-
}>>;
|
|
120
|
-
readonly Recursive: VariantType<{
|
|
121
|
-
readonly ref: IntegerType;
|
|
122
|
-
readonly wrapper: StructType<{
|
|
123
|
-
readonly id: IntegerType;
|
|
124
|
-
readonly inner: import("@elaraai/east").RecursiveTypeMarker;
|
|
125
|
-
}>;
|
|
126
|
-
}>;
|
|
127
|
-
readonly Function: StructType<{
|
|
128
|
-
readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
|
|
129
|
-
readonly output: import("@elaraai/east").RecursiveTypeMarker;
|
|
130
|
-
}>;
|
|
131
|
-
readonly AsyncFunction: StructType<{
|
|
132
|
-
readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
|
|
133
|
-
readonly output: import("@elaraai/east").RecursiveTypeMarker;
|
|
134
|
-
}>;
|
|
135
|
-
readonly Vector: import("@elaraai/east").RecursiveTypeMarker;
|
|
136
|
-
readonly Matrix: import("@elaraai/east").RecursiveTypeMarker;
|
|
137
|
-
}>>;
|
|
138
|
-
readonly writable: import("@elaraai/east").BooleanType;
|
|
139
|
-
}>;
|
|
140
|
-
readonly struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
|
|
141
|
-
}>>;
|
|
142
|
-
/** Per-dataset refs: refPath (e.g. "inputs/greeting") -> DatasetRef */
|
|
143
|
-
readonly refs: DictType<StringType, VariantType<{
|
|
144
|
-
readonly unassigned: NullType;
|
|
145
|
-
readonly null: StructType<{
|
|
146
|
-
readonly versions: DictType<StringType, StringType>;
|
|
147
|
-
}>;
|
|
148
|
-
readonly value: StructType<{
|
|
149
|
-
readonly hash: StringType;
|
|
150
|
-
readonly versions: DictType<StringType, StringType>;
|
|
151
|
-
}>;
|
|
152
|
-
}>>;
|
|
153
|
-
}>;
|
|
154
|
-
/** @deprecated Use PackageData instead */
|
|
155
|
-
export type PackageDatasetsType = PackageDataType;
|
|
156
|
-
/** @deprecated Use PackageData instead */
|
|
157
|
-
export type PackageDatasets = PackageData;
|
|
158
91
|
/**
|
|
159
92
|
* Package object stored in the object store.
|
|
160
93
|
*
|
|
@@ -270,12 +203,9 @@ export declare const PackageObjectType: StructType<{
|
|
|
270
203
|
}>;
|
|
271
204
|
/** Functions defined in this package: name -> FunctionObject hash. */
|
|
272
205
|
readonly functions: DictType<StringType, StringType>;
|
|
273
|
-
/** Records defined in this package: name -> RecordObject hash.
|
|
274
|
-
* BEAST2 encodes struct fields positionally in declaration order, so new
|
|
275
|
-
* fields MUST be appended LAST — never inserted between existing fields. */
|
|
206
|
+
/** Records defined in this package: name -> RecordObject hash. */
|
|
276
207
|
readonly records: DictType<StringType, StringType>;
|
|
277
|
-
/** Unresolved dataset sources: refPath (e.g. "inputs/table") -> descriptor.
|
|
278
|
-
* Appended LAST, per the positional rule above. */
|
|
208
|
+
/** Unresolved dataset sources: refPath (e.g. "inputs/table") -> descriptor. */
|
|
279
209
|
readonly sources: DictType<StringType, VariantType<{
|
|
280
210
|
/** A path on the machine that DEPLOYS the package, resolved at deploy. */
|
|
281
211
|
readonly file: StructType<{
|
|
@@ -286,13 +216,16 @@ export declare const PackageObjectType: StructType<{
|
|
|
286
216
|
export type PackageObjectType = typeof PackageObjectType;
|
|
287
217
|
export type PackageObject = ValueTypeOf<typeof PackageObjectType>;
|
|
288
218
|
/**
|
|
289
|
-
* Decode a `PackageObject` from BEAST2 bytes
|
|
290
|
-
*
|
|
219
|
+
* Decode a `PackageObject` from BEAST2 bytes.
|
|
220
|
+
*
|
|
221
|
+
* @remarks
|
|
222
|
+
* A package-borne wire, so it changes by hard cutover: a package exported by
|
|
223
|
+
* an older SDK is re-exported with the current one, and this says so.
|
|
291
224
|
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* the
|
|
295
|
-
*
|
|
225
|
+
* @param data - the stored bytes
|
|
226
|
+
* @returns the package object
|
|
227
|
+
* @throws {Error} When the bytes are not a current package object — a package
|
|
228
|
+
* exported by an older SDK, which is re-exported with the current one.
|
|
296
229
|
*/
|
|
297
230
|
export declare function decodePackageObject(data: Uint8Array): PackageObject;
|
|
298
231
|
export declare const PackageTransferInitRequestType: StructType<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAInI;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;IAC1B,gEAAgE;;;;;;;;;;;;;;;;;;;;;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/src/package.js
CHANGED
|
@@ -32,9 +32,6 @@ export const PackageDataType = StructType({
|
|
|
32
32
|
/** Per-dataset refs: refPath (e.g. "inputs/greeting") -> DatasetRef */
|
|
33
33
|
refs: DictType(StringType, DatasetRefType),
|
|
34
34
|
});
|
|
35
|
-
// Backwards compatibility alias
|
|
36
|
-
/** @deprecated Use PackageDataType instead */
|
|
37
|
-
export const PackageDatasetsType = PackageDataType;
|
|
38
35
|
/**
|
|
39
36
|
* Package object stored in the object store.
|
|
40
37
|
*
|
|
@@ -85,81 +82,31 @@ export const PackageObjectType = StructType({
|
|
|
85
82
|
data: PackageDataType,
|
|
86
83
|
/** Functions defined in this package: name -> FunctionObject hash. */
|
|
87
84
|
functions: DictType(StringType, StringType),
|
|
88
|
-
/** Records defined in this package: name -> RecordObject hash.
|
|
89
|
-
* BEAST2 encodes struct fields positionally in declaration order, so new
|
|
90
|
-
* fields MUST be appended LAST — never inserted between existing fields. */
|
|
85
|
+
/** Records defined in this package: name -> RecordObject hash. */
|
|
91
86
|
records: DictType(StringType, StringType),
|
|
92
|
-
/** Unresolved dataset sources: refPath (e.g. "inputs/table") -> descriptor.
|
|
93
|
-
* Appended LAST, per the positional rule above. */
|
|
87
|
+
/** Unresolved dataset sources: refPath (e.g. "inputs/table") -> descriptor. */
|
|
94
88
|
sources: DictType(StringType, DatasetSourceWireType),
|
|
95
89
|
});
|
|
96
|
-
/**
|
|
97
|
-
* The pre-`sources` package object wire shape (tasks, data, functions,
|
|
98
|
-
* records), kept only so {@link decodePackageObject} can read packages exported
|
|
99
|
-
* before path-initialised inputs existed.
|
|
100
|
-
*/
|
|
101
|
-
const RecordsEraPackageObjectType = StructType({
|
|
102
|
-
tasks: DictType(StringType, StringType),
|
|
103
|
-
data: PackageDataType,
|
|
104
|
-
functions: DictType(StringType, StringType),
|
|
105
|
-
records: DictType(StringType, StringType),
|
|
106
|
-
});
|
|
107
|
-
/**
|
|
108
|
-
* The pre-`records` package object wire shape (tasks, data, functions), kept
|
|
109
|
-
* only so {@link decodePackageObject} can read packages exported before records
|
|
110
|
-
* existed.
|
|
111
|
-
*/
|
|
112
|
-
const FunctionsEraPackageObjectType = StructType({
|
|
113
|
-
tasks: DictType(StringType, StringType),
|
|
114
|
-
data: PackageDataType,
|
|
115
|
-
functions: DictType(StringType, StringType),
|
|
116
|
-
});
|
|
117
|
-
/**
|
|
118
|
-
* The pre-`functions` package object wire shape (tasks, data), kept only so
|
|
119
|
-
* {@link decodePackageObject} can read packages exported before functions
|
|
120
|
-
* existed.
|
|
121
|
-
*/
|
|
122
|
-
const LegacyPackageObjectType = StructType({
|
|
123
|
-
tasks: DictType(StringType, StringType),
|
|
124
|
-
data: PackageDataType,
|
|
125
|
-
});
|
|
126
90
|
const decodeCurrent = decodeBeast2For(PackageObjectType);
|
|
127
|
-
const decodeRecordsEra = decodeBeast2For(RecordsEraPackageObjectType);
|
|
128
|
-
const decodeFunctionsEra = decodeBeast2For(FunctionsEraPackageObjectType);
|
|
129
|
-
const decodeLegacy = decodeBeast2For(LegacyPackageObjectType);
|
|
130
91
|
/**
|
|
131
|
-
* Decode a `PackageObject` from BEAST2 bytes
|
|
132
|
-
*
|
|
92
|
+
* Decode a `PackageObject` from BEAST2 bytes.
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* A package-borne wire, so it changes by hard cutover: a package exported by
|
|
96
|
+
* an older SDK is re-exported with the current one, and this says so.
|
|
133
97
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* the
|
|
137
|
-
*
|
|
98
|
+
* @param data - the stored bytes
|
|
99
|
+
* @returns the package object
|
|
100
|
+
* @throws {Error} When the bytes are not a current package object — a package
|
|
101
|
+
* exported by an older SDK, which is re-exported with the current one.
|
|
138
102
|
*/
|
|
139
103
|
export function decodePackageObject(data) {
|
|
140
104
|
try {
|
|
141
105
|
return decodeCurrent(data);
|
|
142
106
|
}
|
|
143
107
|
catch (err) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return { ...recEra, sources: new Map() };
|
|
147
|
-
}
|
|
148
|
-
catch {
|
|
149
|
-
try {
|
|
150
|
-
const fnEra = decodeFunctionsEra(data);
|
|
151
|
-
return { tasks: fnEra.tasks, data: fnEra.data, functions: fnEra.functions, records: new Map(), sources: new Map() };
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
try {
|
|
155
|
-
const legacy = decodeLegacy(data);
|
|
156
|
-
return { tasks: legacy.tasks, data: legacy.data, functions: new Map(), records: new Map(), sources: new Map() };
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
throw err; // no known shape — surface the current-format error
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
108
|
+
throw new Error(`the package object does not decode: the package was exported by an older e3 SDK — re-export it with the current one ` +
|
|
109
|
+
`(${err instanceof Error ? err.message : String(err)})`);
|
|
163
110
|
}
|
|
164
111
|
}
|
|
165
112
|
// =============================================================================
|
package/dist/src/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,gEAAgE;IAChE,SAAS,EAAE,aAAa;IACxB,uEAAuE;IACvE,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;CAC3C,CAAC,CAAC;AAKH
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings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