@eidos.space/eidos-file 0.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPER_PLATFORM.md +55 -53
- package/FIELD-CONVERSION.md +75 -0
- package/README.md +89 -106
- package/dist/adapter-contract-BRKKEulb.d.mts +1110 -0
- package/dist/adapter-contract-BRKKEulb.d.mts.map +1 -0
- package/dist/better-sqlite3.d.mts +64 -3
- package/dist/better-sqlite3.d.mts.map +1 -1
- package/dist/better-sqlite3.mjs +395 -14
- package/dist/better-sqlite3.mjs.map +1 -1
- package/dist/browser.d.mts +4 -3
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.mjs +30 -11
- package/dist/browser.mjs.map +1 -1
- package/dist/csv-BQPkzC5Y.mjs +386 -0
- package/dist/csv-BQPkzC5Y.mjs.map +1 -0
- package/dist/csv.d.mts +4 -2
- package/dist/csv.d.mts.map +1 -1
- package/dist/csv.mjs +1 -248
- package/dist/index.d.mts +327 -18
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3555 -4
- package/dist/index.mjs.map +1 -0
- package/dist/node-sqlite.d.mts +98 -0
- package/dist/node-sqlite.d.mts.map +1 -0
- package/dist/node-sqlite.mjs +684 -0
- package/dist/node-sqlite.mjs.map +1 -0
- package/dist/runtime-9_adwQ0y.mjs +5637 -0
- package/dist/runtime-9_adwQ0y.mjs.map +1 -0
- package/dist/runtime-C9IcEeTi.d.mts +728 -0
- package/dist/runtime-C9IcEeTi.d.mts.map +1 -0
- package/dist/select-options-CfNwfc_a.mjs +561 -0
- package/dist/select-options-CfNwfc_a.mjs.map +1 -0
- package/dist/sqlite-wasm-BM6hsxH8.mjs +2007 -0
- package/dist/sqlite-wasm-BM6hsxH8.mjs.map +1 -0
- package/dist/temporal-fyRCzJjy.d.mts +517 -0
- package/dist/temporal-fyRCzJjy.d.mts.map +1 -0
- package/package.json +11 -4
- package/dist/csv.mjs.map +0 -1
- package/dist/host-CqP1MeMK.d.mts +0 -213
- package/dist/host-CqP1MeMK.d.mts.map +0 -1
- package/dist/host-D5kZAhga.mjs +0 -478
- package/dist/host-D5kZAhga.mjs.map +0 -1
- package/dist/relation-values-B0JhHBjZ.mjs +0 -232
- package/dist/relation-values-B0JhHBjZ.mjs.map +0 -1
- package/dist/runtime-C3bstvB8.d.mts +0 -465
- package/dist/runtime-C3bstvB8.d.mts.map +0 -1
- package/dist/runtime-CWC5y95G.mjs +0 -2907
- package/dist/runtime-CWC5y95G.mjs.map +0 -1
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
//#region src/connection.d.ts
|
|
2
|
+
type EidosFileSqlPrimitive = string | number | bigint | null | Uint8Array;
|
|
3
|
+
type EidosFileSqlParams = readonly EidosFileSqlPrimitive[];
|
|
4
|
+
interface EidosFileRunResult {
|
|
5
|
+
changes: number;
|
|
6
|
+
lastInsertRowid: number | bigint;
|
|
7
|
+
}
|
|
8
|
+
interface EidosFileConnectionCapabilities {
|
|
9
|
+
/** The adapter can bind and return 64-bit integers without truncation. */
|
|
10
|
+
int64: boolean;
|
|
11
|
+
/** JSON1 is available to canonical Relation, Lookup, and list operations. */
|
|
12
|
+
json1: boolean;
|
|
13
|
+
/** SQLite RETURNING clauses are available. */
|
|
14
|
+
returning: boolean;
|
|
15
|
+
/** The adapter can call sqlite3_interrupt on its active connection. */
|
|
16
|
+
interrupt: boolean;
|
|
17
|
+
/** Deterministic scalar functions can be registered for shared semantics. */
|
|
18
|
+
scalarFunctions: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface EidosFileConnection {
|
|
21
|
+
readonly capabilities: EidosFileConnectionCapabilities;
|
|
22
|
+
exec(sql: string): void;
|
|
23
|
+
query<T extends object>(sql: string, params?: EidosFileSqlParams): T[];
|
|
24
|
+
get<T extends object>(sql: string, params?: EidosFileSqlParams): T | undefined;
|
|
25
|
+
run(sql: string, params?: EidosFileSqlParams): EidosFileRunResult;
|
|
26
|
+
runMany?(sql: string, parameterSets: readonly EidosFileSqlParams[]): void;
|
|
27
|
+
registerFunction(name: string, operation: (...values: EidosFileSqlPrimitive[]) => EidosFileSqlPrimitive, arity?: number): void;
|
|
28
|
+
transaction<T>(operation: () => T): T;
|
|
29
|
+
/** Current SQLite connection-visible change counter for cache invalidation. */
|
|
30
|
+
dataVersion(): number;
|
|
31
|
+
/** Interrupts a currently executing query when the adapter supports it. */
|
|
32
|
+
interrupt(): void;
|
|
33
|
+
close?(): void;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/protocol-types.d.ts
|
|
37
|
+
/** JSON values accepted by the Eidos 1.0 public protocols. */
|
|
38
|
+
interface JsonObject {
|
|
39
|
+
[key: string]: JsonValue;
|
|
40
|
+
}
|
|
41
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | JsonObject;
|
|
42
|
+
/**
|
|
43
|
+
* An immutable, independently owned octet sequence at a public boundary.
|
|
44
|
+
* Implementations copy on ingress/egress; callers must treat this value as
|
|
45
|
+
* immutable even though JavaScript's Uint8Array type itself is mutable.
|
|
46
|
+
*/
|
|
47
|
+
type OwnedBytes = Uint8Array;
|
|
48
|
+
interface CancellationSignal {
|
|
49
|
+
readonly aborted: boolean;
|
|
50
|
+
onAbort(callback: () => void): () => void;
|
|
51
|
+
}
|
|
52
|
+
interface CancellationPort {
|
|
53
|
+
cancelled(): boolean;
|
|
54
|
+
onCancel(callback: () => void): () => void;
|
|
55
|
+
}
|
|
56
|
+
interface RequestContext {
|
|
57
|
+
requestId: string;
|
|
58
|
+
deadlineMilliseconds?: number;
|
|
59
|
+
signal?: CancellationSignal;
|
|
60
|
+
}
|
|
61
|
+
interface PublicationContext {
|
|
62
|
+
cancellation: CancellationPort;
|
|
63
|
+
deadlineMilliseconds?: number;
|
|
64
|
+
}
|
|
65
|
+
interface ByteSource {
|
|
66
|
+
size: string;
|
|
67
|
+
read(offset: string, length: number, context: PublicationContext): Promise<OwnedBytes>;
|
|
68
|
+
}
|
|
69
|
+
interface ClockPort {
|
|
70
|
+
nowInstant(): string;
|
|
71
|
+
nowMilliseconds(): number;
|
|
72
|
+
}
|
|
73
|
+
interface EntropyPort {
|
|
74
|
+
randomBytes(length: number): OwnedBytes;
|
|
75
|
+
}
|
|
76
|
+
declare function cancellationPortFromSignal(signal?: CancellationSignal): CancellationPort;
|
|
77
|
+
declare class MemoryByteSource implements ByteSource {
|
|
78
|
+
readonly size: string;
|
|
79
|
+
private released;
|
|
80
|
+
private readonly bytes;
|
|
81
|
+
constructor(bytes: Uint8Array | ArrayBuffer);
|
|
82
|
+
read(offset: string, length: number, context: PublicationContext): Promise<OwnedBytes>;
|
|
83
|
+
release(): void;
|
|
84
|
+
}
|
|
85
|
+
declare function parseNonNegativeInt64(value: string, label: string): bigint;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/types.d.ts
|
|
88
|
+
interface EidosFileMetadata {
|
|
89
|
+
format: "eidos-file";
|
|
90
|
+
/** Stable UUIDv7 file identity. */
|
|
91
|
+
fileId: string;
|
|
92
|
+
formatVersion: "1.0";
|
|
93
|
+
schemaVersion: number;
|
|
94
|
+
revision: number | bigint;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
title?: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
defaultTableId?: string;
|
|
100
|
+
}
|
|
101
|
+
interface EidosFileTableInfo {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
/** Exact SQLite table identifier (without quote characters). */
|
|
105
|
+
physicalName?: string;
|
|
106
|
+
/** @deprecated Use physicalName. */
|
|
107
|
+
rawTableName: string;
|
|
108
|
+
position: number | null;
|
|
109
|
+
icon: string | null;
|
|
110
|
+
description: string | null;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
updatedAt: string;
|
|
113
|
+
}
|
|
114
|
+
type EidosFileFieldType = "integer" | "relation" | "text" | "number" | "checkbox" | "date" | "datetime" | "file" | "multi-select" | "rating" | "select" | "url" | "formula" | "lookup" | "created-time" | "last-edited-time" | "row-id";
|
|
115
|
+
type EidosFileSourceFieldType = Exclude<EidosFileFieldType, "row-id" | "formula" | "relation" | "lookup" | "created-time" | "last-edited-time">;
|
|
116
|
+
type EidosFileStorageCodec = "scalar" | "json_array" | "relation" | "materialized_text";
|
|
117
|
+
type EidosFileValueKind = "source" | "relation" | "derived" | "materialized" | "system";
|
|
118
|
+
interface EidosFileFieldInfo {
|
|
119
|
+
/** Stable UUIDv7 Field identity. */
|
|
120
|
+
id: string;
|
|
121
|
+
tableId: string;
|
|
122
|
+
name: string;
|
|
123
|
+
type: EidosFileFieldType;
|
|
124
|
+
tableName: string;
|
|
125
|
+
tableColumnName: string;
|
|
126
|
+
/** Exact SQLite column name, or null for a virtual Field. */
|
|
127
|
+
physicalName?: string | null;
|
|
128
|
+
/** Canonical system role, independent of the persisted Field type. */
|
|
129
|
+
systemRole?: "row-id" | "created-time" | "updated-time" | null;
|
|
130
|
+
nullable?: boolean;
|
|
131
|
+
isRecordLabel?: boolean;
|
|
132
|
+
position?: number;
|
|
133
|
+
settings?: Record<string, unknown>;
|
|
134
|
+
property: Record<string, unknown> | null;
|
|
135
|
+
storageCodec: EidosFileStorageCodec;
|
|
136
|
+
valueKind: EidosFileValueKind;
|
|
137
|
+
isHidden: boolean;
|
|
138
|
+
isDerived: boolean;
|
|
139
|
+
sourceTableColumnName: string | null;
|
|
140
|
+
dependsOn: unknown;
|
|
141
|
+
}
|
|
142
|
+
interface EidosFileViewInfo {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
type: string;
|
|
146
|
+
tableId: string;
|
|
147
|
+
query: string;
|
|
148
|
+
properties: Record<string, unknown> | null;
|
|
149
|
+
filter: EidosFileFilterGroup | null;
|
|
150
|
+
sorts: EidosFileSort[];
|
|
151
|
+
orderMap: Record<string, number> | null;
|
|
152
|
+
hiddenFields: string[];
|
|
153
|
+
position: number | null;
|
|
154
|
+
createdAt: string;
|
|
155
|
+
updatedAt: string;
|
|
156
|
+
}
|
|
157
|
+
interface UpdateEidosFileViewInput {
|
|
158
|
+
name?: string;
|
|
159
|
+
type?: string;
|
|
160
|
+
position?: number | null;
|
|
161
|
+
properties?: Record<string, unknown> | null;
|
|
162
|
+
filter?: EidosFileFilterGroup | null;
|
|
163
|
+
sorts?: EidosFileSort[];
|
|
164
|
+
orderMap?: Record<string, number> | null;
|
|
165
|
+
hiddenFields?: string[];
|
|
166
|
+
}
|
|
167
|
+
interface CreateEidosFileOptions {
|
|
168
|
+
fileId?: string;
|
|
169
|
+
title?: string;
|
|
170
|
+
description?: string;
|
|
171
|
+
createdAt?: string;
|
|
172
|
+
defaultTable?: CreateEidosFileTableInput;
|
|
173
|
+
}
|
|
174
|
+
interface CreateEidosFileTableInput {
|
|
175
|
+
id?: string;
|
|
176
|
+
name: string;
|
|
177
|
+
icon?: string;
|
|
178
|
+
description?: string;
|
|
179
|
+
fields?: CreateEidosFileFieldInput[];
|
|
180
|
+
createDefaultView?: boolean;
|
|
181
|
+
}
|
|
182
|
+
type EidosFileCsvFieldType = "text" | "number" | "checkbox" | "date" | "datetime" | "url";
|
|
183
|
+
interface EidosFileCsvImportColumn {
|
|
184
|
+
sourceIndex: number;
|
|
185
|
+
sourceName: string;
|
|
186
|
+
name: string;
|
|
187
|
+
columnName: string;
|
|
188
|
+
type: "record-label" | EidosFileCsvFieldType;
|
|
189
|
+
}
|
|
190
|
+
interface EidosFileCsvImportIssue {
|
|
191
|
+
code: "malformed-row" | "inconsistent-column-count";
|
|
192
|
+
count: number;
|
|
193
|
+
message: string;
|
|
194
|
+
}
|
|
195
|
+
interface EidosFileCsvImportPlan {
|
|
196
|
+
fileName: string;
|
|
197
|
+
tableName: string;
|
|
198
|
+
rowCount: number;
|
|
199
|
+
skippedRowCount: number;
|
|
200
|
+
columns: EidosFileCsvImportColumn[];
|
|
201
|
+
sampleRows: string[][];
|
|
202
|
+
issues: EidosFileCsvImportIssue[];
|
|
203
|
+
}
|
|
204
|
+
interface EidosFileCsvColumnOverride {
|
|
205
|
+
sourceIndex: number;
|
|
206
|
+
name?: string;
|
|
207
|
+
type?: EidosFileCsvFieldType;
|
|
208
|
+
}
|
|
209
|
+
interface EidosFileCsvImportOptions {
|
|
210
|
+
tableName?: string;
|
|
211
|
+
columns?: EidosFileCsvColumnOverride[];
|
|
212
|
+
}
|
|
213
|
+
interface EidosFileCsvImportResult {
|
|
214
|
+
table: EidosFileTableInfo;
|
|
215
|
+
importedRowCount: number;
|
|
216
|
+
skippedRowCount: number;
|
|
217
|
+
}
|
|
218
|
+
interface EidosFileCsvExportColumn {
|
|
219
|
+
columnName: string;
|
|
220
|
+
name: string;
|
|
221
|
+
}
|
|
222
|
+
interface EidosFileCsvExportOptions {
|
|
223
|
+
query?: EidosFileRowQuery;
|
|
224
|
+
columns: EidosFileCsvExportColumn[];
|
|
225
|
+
}
|
|
226
|
+
interface EidosFileCsvExportResult {
|
|
227
|
+
exportedRowCount: number;
|
|
228
|
+
}
|
|
229
|
+
interface UpdateEidosFileTableInput {
|
|
230
|
+
name?: string;
|
|
231
|
+
icon?: string | null;
|
|
232
|
+
description?: string | null;
|
|
233
|
+
}
|
|
234
|
+
interface CreateEidosFileSourceFieldInput {
|
|
235
|
+
id?: string;
|
|
236
|
+
name: string;
|
|
237
|
+
/** @deprecated The Runtime derives the SQLite physical name from name. */
|
|
238
|
+
columnName?: string;
|
|
239
|
+
type: EidosFileSourceFieldType;
|
|
240
|
+
property?: Record<string, unknown>;
|
|
241
|
+
storageCodec?: EidosFileStorageCodec;
|
|
242
|
+
/** SQL NULL policy for scalar and JSON storage. */
|
|
243
|
+
nullable?: boolean;
|
|
244
|
+
isRecordLabel?: boolean;
|
|
245
|
+
}
|
|
246
|
+
interface EidosFileRelationProperty extends Record<string, unknown> {
|
|
247
|
+
targetTableId: string;
|
|
248
|
+
targetField?: string;
|
|
249
|
+
multiple?: boolean;
|
|
250
|
+
direction?: "forward" | "inverse";
|
|
251
|
+
sourceFieldId?: string;
|
|
252
|
+
cardinality?: "one" | "many";
|
|
253
|
+
onDelete?: "restrict" | "detach" | "preserve";
|
|
254
|
+
}
|
|
255
|
+
interface CreateEidosFileRelationFieldInput {
|
|
256
|
+
id?: string;
|
|
257
|
+
name: string;
|
|
258
|
+
/** @deprecated The Runtime derives the SQLite physical name from name. */
|
|
259
|
+
columnName?: string;
|
|
260
|
+
type: "relation";
|
|
261
|
+
property: EidosFileRelationProperty;
|
|
262
|
+
storageCodec?: "relation";
|
|
263
|
+
}
|
|
264
|
+
type EidosFileFormulaDisplayType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url" | "json";
|
|
265
|
+
type EidosFileFormulaResultType = Exclude<EidosFileFormulaDisplayType, "json">;
|
|
266
|
+
interface EidosFileFormulaProperty extends Record<string, unknown> {
|
|
267
|
+
formula: string;
|
|
268
|
+
displayType: EidosFileFormulaDisplayType;
|
|
269
|
+
expression?: string;
|
|
270
|
+
}
|
|
271
|
+
interface CreateEidosFileFormulaFieldInput {
|
|
272
|
+
id?: string;
|
|
273
|
+
name: string;
|
|
274
|
+
/** @deprecated Formula Fields are virtual and have no physical column. */
|
|
275
|
+
columnName?: string;
|
|
276
|
+
type: "formula";
|
|
277
|
+
property: EidosFileFormulaProperty;
|
|
278
|
+
storageCodec?: "scalar";
|
|
279
|
+
isRecordLabel?: boolean;
|
|
280
|
+
}
|
|
281
|
+
interface EidosFileFormulaPreviewInput {
|
|
282
|
+
name: string;
|
|
283
|
+
columnName: string;
|
|
284
|
+
formula: string;
|
|
285
|
+
displayType: EidosFileFormulaResultType;
|
|
286
|
+
}
|
|
287
|
+
interface EidosFileFormulaPreviewDependency {
|
|
288
|
+
name: string;
|
|
289
|
+
columnName: string;
|
|
290
|
+
}
|
|
291
|
+
interface EidosFileFormulaPreviewSample {
|
|
292
|
+
rowId: string;
|
|
293
|
+
title: string | null;
|
|
294
|
+
value: EidosFileRowValue;
|
|
295
|
+
}
|
|
296
|
+
interface EidosFileFormulaPreview {
|
|
297
|
+
expression: string;
|
|
298
|
+
dependencies: EidosFileFormulaPreviewDependency[];
|
|
299
|
+
samples: EidosFileFormulaPreviewSample[];
|
|
300
|
+
}
|
|
301
|
+
type EidosFileLookupAggregate = "first" | "values" | "count" | "sum" | "average" | "min" | "max";
|
|
302
|
+
interface EidosFileLookupProperty extends Record<string, unknown> {
|
|
303
|
+
relationField: string;
|
|
304
|
+
targetField: string;
|
|
305
|
+
aggregate: EidosFileLookupAggregate;
|
|
306
|
+
displayType: EidosFileFormulaDisplayType;
|
|
307
|
+
}
|
|
308
|
+
interface EidosFileSelectOption {
|
|
309
|
+
/** Canonical option identity and raw cell value. */
|
|
310
|
+
name: string;
|
|
311
|
+
color: string;
|
|
312
|
+
}
|
|
313
|
+
interface EidosFileOptionValueChange {
|
|
314
|
+
from: string;
|
|
315
|
+
to: string;
|
|
316
|
+
}
|
|
317
|
+
interface CreateEidosFileLookupFieldInput {
|
|
318
|
+
id?: string;
|
|
319
|
+
name: string;
|
|
320
|
+
/** @deprecated Lookup Fields are virtual and have no physical column. */
|
|
321
|
+
columnName?: string;
|
|
322
|
+
type: "lookup";
|
|
323
|
+
property: EidosFileLookupProperty;
|
|
324
|
+
storageCodec?: "scalar" | "json_array";
|
|
325
|
+
isRecordLabel?: boolean;
|
|
326
|
+
}
|
|
327
|
+
type CreateEidosFileFieldInput = CreateEidosFileSourceFieldInput | CreateEidosFileRelationFieldInput | CreateEidosFileFormulaFieldInput | CreateEidosFileLookupFieldInput;
|
|
328
|
+
interface EidosFileFieldPlacement {
|
|
329
|
+
viewId: string;
|
|
330
|
+
index: number;
|
|
331
|
+
}
|
|
332
|
+
interface EidosFileRelationValue {
|
|
333
|
+
id: string;
|
|
334
|
+
title: string;
|
|
335
|
+
}
|
|
336
|
+
interface ImportEidosFileFieldInput {
|
|
337
|
+
name: string;
|
|
338
|
+
columnName: string;
|
|
339
|
+
type: EidosFileFieldType;
|
|
340
|
+
property?: Record<string, unknown> | null;
|
|
341
|
+
storageCodec?: EidosFileStorageCodec;
|
|
342
|
+
valueKind?: EidosFileValueKind;
|
|
343
|
+
isHidden?: boolean;
|
|
344
|
+
isDerived?: boolean;
|
|
345
|
+
sourceTableColumnName?: string | null;
|
|
346
|
+
dependsOn?: unknown;
|
|
347
|
+
}
|
|
348
|
+
interface CreateEidosFileViewInput {
|
|
349
|
+
id?: string;
|
|
350
|
+
name: string;
|
|
351
|
+
type: string;
|
|
352
|
+
query?: string;
|
|
353
|
+
properties?: Record<string, unknown> | null;
|
|
354
|
+
filter?: EidosFileFilterGroup | null;
|
|
355
|
+
sorts?: EidosFileSort[];
|
|
356
|
+
orderMap?: Record<string, number> | null;
|
|
357
|
+
hiddenFields?: string[];
|
|
358
|
+
position?: number | null;
|
|
359
|
+
}
|
|
360
|
+
interface UpdateEidosFileFieldInput {
|
|
361
|
+
name?: string;
|
|
362
|
+
type?: EidosFileFieldType;
|
|
363
|
+
property?: Record<string, unknown> | null;
|
|
364
|
+
optionValueChanges?: EidosFileOptionValueChange[];
|
|
365
|
+
isRecordLabel?: boolean;
|
|
366
|
+
/** Explicit user approval for a preflighted conversion that may change values. */
|
|
367
|
+
confirmLossy?: boolean;
|
|
368
|
+
}
|
|
369
|
+
type EidosFileLogicalValue = EidosFileSqlPrimitive | boolean | EidosFileLogicalValue[] | {
|
|
370
|
+
readonly [key: string]: EidosFileLogicalValue;
|
|
371
|
+
};
|
|
372
|
+
interface EidosFileFileValue {
|
|
373
|
+
id: string;
|
|
374
|
+
uri: string;
|
|
375
|
+
name: string;
|
|
376
|
+
mediaType: string;
|
|
377
|
+
/** Canonical non-negative signed-int64 decimal string. */
|
|
378
|
+
size: string;
|
|
379
|
+
/** Extension members are preserved through parse and serialization. */
|
|
380
|
+
[key: string]: JsonValue;
|
|
381
|
+
}
|
|
382
|
+
type EidosFileRowValue = EidosFileSqlPrimitive | boolean;
|
|
383
|
+
type EidosFileRow = Record<string, EidosFileRowValue>;
|
|
384
|
+
/** Language-neutral Runtime row shape from Eidos File 1.0 §16. */
|
|
385
|
+
interface EidosFileLogicalRow {
|
|
386
|
+
id: string;
|
|
387
|
+
fields: Record<string, EidosFileLogicalValue>;
|
|
388
|
+
/** Generated Relation targets, requested separately from canonical values. */
|
|
389
|
+
resolved?: Record<string, EidosFileResolvedRelationValue[]>;
|
|
390
|
+
}
|
|
391
|
+
interface EidosFileResolvedRelationValue {
|
|
392
|
+
id: string;
|
|
393
|
+
label: EidosFileLogicalValue;
|
|
394
|
+
}
|
|
395
|
+
interface EidosFileLogicalRowDraft {
|
|
396
|
+
id?: string;
|
|
397
|
+
fields: Record<string, EidosFileLogicalValue>;
|
|
398
|
+
}
|
|
399
|
+
interface EidosFileLogicalRowUpdate {
|
|
400
|
+
id: string;
|
|
401
|
+
fields: Record<string, EidosFileLogicalValue>;
|
|
402
|
+
}
|
|
403
|
+
interface EidosFileRowsMutation {
|
|
404
|
+
tableId: string;
|
|
405
|
+
insert?: EidosFileLogicalRowDraft[];
|
|
406
|
+
update?: EidosFileLogicalRowUpdate[];
|
|
407
|
+
delete?: string[];
|
|
408
|
+
expectedRevision?: number | bigint;
|
|
409
|
+
}
|
|
410
|
+
type EidosFileSchemaMutation = {
|
|
411
|
+
type: "create-table";
|
|
412
|
+
table: CreateEidosFileTableInput;
|
|
413
|
+
} | {
|
|
414
|
+
type: "update-table";
|
|
415
|
+
tableId: string;
|
|
416
|
+
changes: UpdateEidosFileTableInput;
|
|
417
|
+
} | {
|
|
418
|
+
type: "delete-table";
|
|
419
|
+
tableId: string;
|
|
420
|
+
} | {
|
|
421
|
+
type: "add-field";
|
|
422
|
+
tableId: string;
|
|
423
|
+
field: CreateEidosFileFieldInput;
|
|
424
|
+
} | {
|
|
425
|
+
type: "update-field";
|
|
426
|
+
tableId: string;
|
|
427
|
+
fieldId: string;
|
|
428
|
+
changes: UpdateEidosFileFieldInput;
|
|
429
|
+
} | {
|
|
430
|
+
type: "delete-field";
|
|
431
|
+
tableId: string;
|
|
432
|
+
fieldId: string;
|
|
433
|
+
} | {
|
|
434
|
+
type: "create-view";
|
|
435
|
+
tableId: string;
|
|
436
|
+
view: CreateEidosFileViewInput;
|
|
437
|
+
} | {
|
|
438
|
+
type: "update-view";
|
|
439
|
+
viewId: string;
|
|
440
|
+
changes: UpdateEidosFileViewInput;
|
|
441
|
+
} | {
|
|
442
|
+
type: "delete-view";
|
|
443
|
+
viewId: string;
|
|
444
|
+
};
|
|
445
|
+
type EidosFileSortDirection = "asc" | "desc";
|
|
446
|
+
interface EidosFileSort {
|
|
447
|
+
field: string;
|
|
448
|
+
direction: EidosFileSortDirection;
|
|
449
|
+
nulls?: "first" | "last";
|
|
450
|
+
}
|
|
451
|
+
type EidosFileFilterOperator = "equals" | "not-equals" | "contains" | "not-contains" | "starts-with" | "ends-with" | "greater-than" | "greater-than-or-equal" | "less-than" | "less-than-or-equal" | "is-empty" | "is-not-empty" | "is-any-of" | "is-all-of" | "is-none-of";
|
|
452
|
+
type EidosFileFilterValue = string | number | boolean | null;
|
|
453
|
+
interface EidosFileFilterRule {
|
|
454
|
+
type: "rule";
|
|
455
|
+
field: string;
|
|
456
|
+
operator: EidosFileFilterOperator;
|
|
457
|
+
value?: EidosFileFilterValue | EidosFileFilterValue[];
|
|
458
|
+
}
|
|
459
|
+
interface EidosFileFilterGroup {
|
|
460
|
+
type: "group";
|
|
461
|
+
conjunction: "and" | "or";
|
|
462
|
+
/** Internal compatibility representation of Runtime's Boolean NOT. */
|
|
463
|
+
negated?: boolean;
|
|
464
|
+
children: Array<EidosFileFilterRule | EidosFileFilterGroup>;
|
|
465
|
+
}
|
|
466
|
+
interface EidosFileRowQuery {
|
|
467
|
+
search?: string;
|
|
468
|
+
/** Exact Runtime search Field restriction, expressed as canonical Field IDs. */
|
|
469
|
+
searchFields?: string[];
|
|
470
|
+
filter?: EidosFileFilterGroup | null;
|
|
471
|
+
sorts?: EidosFileSort[];
|
|
472
|
+
}
|
|
473
|
+
interface EidosFileRowPageProjection {
|
|
474
|
+
/** Ordered field candidates available to each projected row. */
|
|
475
|
+
columns: string[];
|
|
476
|
+
/** Fields returned for every row without consuming the per-row field limit. */
|
|
477
|
+
preservedColumns?: string[];
|
|
478
|
+
/** Maximum candidate fields returned for each row. */
|
|
479
|
+
fieldLimit?: number;
|
|
480
|
+
/** Skip null, undefined, and empty-string candidates before applying the limit. */
|
|
481
|
+
omitEmptyFields?: boolean;
|
|
482
|
+
/** @internal Include the Table's current Record Label Field in compatibility projections. */
|
|
483
|
+
includeRecordLabel?: boolean;
|
|
484
|
+
/** @internal Include resolved Relation label arrays for compatibility editors. */
|
|
485
|
+
includeRelationDisplays?: boolean;
|
|
486
|
+
}
|
|
487
|
+
interface EidosFileRowPageOptions {
|
|
488
|
+
offset: number;
|
|
489
|
+
limit: number;
|
|
490
|
+
query?: EidosFileRowQuery;
|
|
491
|
+
/**
|
|
492
|
+
* Optional per-row response projection. Record identity is always
|
|
493
|
+
* included. Query-only fields may be read internally for filtering, sorting,
|
|
494
|
+
* and cursor generation but are not exposed in the returned rows.
|
|
495
|
+
*/
|
|
496
|
+
projection?: EidosFileRowPageProjection;
|
|
497
|
+
/**
|
|
498
|
+
* Previously observed row count for the same query. When present, paging can
|
|
499
|
+
* reuse it instead of repeating an expensive COUNT query.
|
|
500
|
+
*/
|
|
501
|
+
totalHint?: number;
|
|
502
|
+
/**
|
|
503
|
+
* Opaque cursor returned by the previous contiguous page. The runtime uses
|
|
504
|
+
* it as a paging fast path for natural and indexed explicit sort orders.
|
|
505
|
+
*/
|
|
506
|
+
cursor?: string;
|
|
507
|
+
}
|
|
508
|
+
interface EidosFileValidationIssue {
|
|
509
|
+
code: string;
|
|
510
|
+
message: string;
|
|
511
|
+
table?: string;
|
|
512
|
+
severity?: "fatal" | "error" | "warning" | "info";
|
|
513
|
+
}
|
|
514
|
+
interface EidosFileValidationResult {
|
|
515
|
+
valid: boolean;
|
|
516
|
+
metadata: EidosFileMetadata | null;
|
|
517
|
+
tables: EidosFileTableInfo[];
|
|
518
|
+
errors: EidosFileValidationIssue[];
|
|
519
|
+
warnings: EidosFileValidationIssue[];
|
|
520
|
+
}
|
|
521
|
+
interface EidosFileTableSnapshot {
|
|
522
|
+
table: EidosFileTableInfo;
|
|
523
|
+
fields: EidosFileFieldInfo[];
|
|
524
|
+
views: EidosFileViewInfo[];
|
|
525
|
+
rowCount: number;
|
|
526
|
+
}
|
|
527
|
+
interface EidosFileRowPage {
|
|
528
|
+
tableId: string;
|
|
529
|
+
offset: number;
|
|
530
|
+
limit: number;
|
|
531
|
+
total: number;
|
|
532
|
+
rows: EidosFileRow[];
|
|
533
|
+
/** Opaque cursor for the next contiguous page, when cursor paging is safe. */
|
|
534
|
+
nextCursor?: string;
|
|
535
|
+
}
|
|
536
|
+
interface EidosFileRowGroupCount {
|
|
537
|
+
value: EidosFileSqlPrimitive;
|
|
538
|
+
total: number;
|
|
539
|
+
}
|
|
540
|
+
type EidosFileColumnStatType = "count-all" | "count-non-null" | "count-distinct" | "count-empty" | "percent-checked" | "percent-unchecked" | "sum" | "average" | "min" | "max" | "relation-value-count" | "relation-row-count" | "relation-distinct-target-count";
|
|
541
|
+
interface EidosFileColumnStatConfig {
|
|
542
|
+
fieldId: string;
|
|
543
|
+
type: EidosFileColumnStatType;
|
|
544
|
+
}
|
|
545
|
+
interface EidosFileColumnStatResult extends EidosFileColumnStatConfig {
|
|
546
|
+
value: string | number | null;
|
|
547
|
+
}
|
|
548
|
+
interface EidosFileRowMutationResult {
|
|
549
|
+
tableId: string;
|
|
550
|
+
row: EidosFileRow;
|
|
551
|
+
rowCount: number;
|
|
552
|
+
/** Eidos File metadata revision after the committed mutation. */
|
|
553
|
+
revision?: number | bigint;
|
|
554
|
+
}
|
|
555
|
+
interface EidosFileRowUpdate {
|
|
556
|
+
rowId: string;
|
|
557
|
+
changes: EidosFileRow;
|
|
558
|
+
}
|
|
559
|
+
interface EidosFileRowsMutationResult {
|
|
560
|
+
tableId: string;
|
|
561
|
+
rows: EidosFileRow[];
|
|
562
|
+
rowCount: number;
|
|
563
|
+
/** Eidos File metadata revision after the committed mutation. */
|
|
564
|
+
revision?: number | bigint;
|
|
565
|
+
}
|
|
566
|
+
interface EidosFileRowRange {
|
|
567
|
+
startIndex: number;
|
|
568
|
+
endIndex: number;
|
|
569
|
+
}
|
|
570
|
+
interface EidosFileRowsDeleteResult {
|
|
571
|
+
tableId: string;
|
|
572
|
+
deletedCount: number;
|
|
573
|
+
rowCount: number;
|
|
574
|
+
/** Eidos File metadata revision after the committed mutation. */
|
|
575
|
+
revision?: number | bigint;
|
|
576
|
+
}
|
|
577
|
+
interface EidosFileSnapshot {
|
|
578
|
+
path: string;
|
|
579
|
+
metadata: EidosFileMetadata;
|
|
580
|
+
tables: EidosFileTableSnapshot[];
|
|
581
|
+
}
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/runtime.d.ts
|
|
584
|
+
declare class EidosFileRuntime {
|
|
585
|
+
readonly connection: EidosFileConnection;
|
|
586
|
+
private readonly ownsConnection;
|
|
587
|
+
private mutationDepth;
|
|
588
|
+
private mutationInstant;
|
|
589
|
+
private schemaCache;
|
|
590
|
+
private readonly nowInstant;
|
|
591
|
+
private readonly allocateId;
|
|
592
|
+
constructor(connection: EidosFileConnection, ownsConnection?: boolean, environment?: {
|
|
593
|
+
nowInstant?: () => string;
|
|
594
|
+
allocateId?: () => string;
|
|
595
|
+
});
|
|
596
|
+
close(): void;
|
|
597
|
+
inspect(): EidosFileValidationResult;
|
|
598
|
+
validate(options?: {
|
|
599
|
+
level?: "identity" | "structural" | "content" | "semantic" | "full";
|
|
600
|
+
}): EidosFileValidationResult;
|
|
601
|
+
info(): EidosFileMetadata;
|
|
602
|
+
metadata(): EidosFileMetadata;
|
|
603
|
+
private tableRow;
|
|
604
|
+
private fieldRows;
|
|
605
|
+
private allSchema;
|
|
606
|
+
listTables(): EidosFileTableInfo[];
|
|
607
|
+
getTable(tableId: string): EidosFileTableInfo;
|
|
608
|
+
listFields(tableId: string): EidosFileFieldInfo[];
|
|
609
|
+
private fieldByKey;
|
|
610
|
+
/** @internal Exact Runtime service transaction composition hook. */
|
|
611
|
+
applyCanonicalMutation<T>(operation: (instant: string) => T, expectedRevision?: number | bigint): T;
|
|
612
|
+
private mutate;
|
|
613
|
+
private operationInstant;
|
|
614
|
+
private prepareFields;
|
|
615
|
+
createTable(input: CreateEidosFileTableInput): EidosFileTableInfo;
|
|
616
|
+
private insertFieldMetadata;
|
|
617
|
+
private insertFieldSubtypeMetadata;
|
|
618
|
+
private installRowIdTrigger;
|
|
619
|
+
private installRelationTriggers;
|
|
620
|
+
private dropRelationTriggers;
|
|
621
|
+
updateTable(tableId: string, changes: UpdateEidosFileTableInput): EidosFileTableInfo;
|
|
622
|
+
deleteTable(tableId: string): boolean;
|
|
623
|
+
addField(tableId: string, input: CreateEidosFileFieldInput, placement?: EidosFileFieldPlacement): EidosFileFieldInfo;
|
|
624
|
+
importField(tableId: string, input: ImportEidosFileFieldInput): EidosFileFieldInfo;
|
|
625
|
+
updateField(tableId: string, fieldKey: string, changes: UpdateEidosFileFieldInput): EidosFileFieldInfo;
|
|
626
|
+
setFieldNullable(fieldId: string, nullable: boolean): EidosFileFieldInfo;
|
|
627
|
+
/** @internal Applies a preflighted Runtime 1.0 stored-type conversion. */
|
|
628
|
+
convertStoredFieldMetadataOnly(fieldId: string, targetType: "text" | "select" | "url", nullable: boolean): EidosFileFieldInfo;
|
|
629
|
+
/** @internal Applies a preflighted Runtime 1.0 stored-type conversion. */
|
|
630
|
+
convertStoredField(fieldId: string, targetType: EidosFileFieldType, nullable: boolean, rows: readonly {
|
|
631
|
+
id: string;
|
|
632
|
+
value: EidosFileSqlPrimitive;
|
|
633
|
+
changed: boolean;
|
|
634
|
+
}[], relation?: {
|
|
635
|
+
targetTableId: string;
|
|
636
|
+
cardinality: "one" | "many";
|
|
637
|
+
onDelete: "restrict" | "detach" | "preserve";
|
|
638
|
+
}): EidosFileFieldInfo;
|
|
639
|
+
private rebuildUserTable;
|
|
640
|
+
private transientTableName;
|
|
641
|
+
private removeFieldFromViewLayouts;
|
|
642
|
+
deleteField(tableId: string, fieldKey: string, replacementRecordLabelFieldId?: string): boolean;
|
|
643
|
+
private viewRow;
|
|
644
|
+
private mapView;
|
|
645
|
+
listViews(tableId: string): EidosFileViewInfo[];
|
|
646
|
+
createView(tableId: string, input: CreateEidosFileViewInput): EidosFileViewInfo;
|
|
647
|
+
updateView(viewId: string, changes: UpdateEidosFileViewInput): EidosFileViewInfo;
|
|
648
|
+
duplicateView(viewId: string, name?: string): EidosFileViewInfo;
|
|
649
|
+
deleteView(viewId: string): boolean;
|
|
650
|
+
reorderViews(tableId: string, viewIds: string[]): EidosFileViewInfo[];
|
|
651
|
+
private fieldExpression;
|
|
652
|
+
private lookupExpression;
|
|
653
|
+
private relationDisplayExpression;
|
|
654
|
+
private requiredQueryFieldKeys;
|
|
655
|
+
private logicalSource;
|
|
656
|
+
private compatibilityQuery;
|
|
657
|
+
listRows(tableId: string, options?: {
|
|
658
|
+
offset?: number;
|
|
659
|
+
limit?: number;
|
|
660
|
+
query?: EidosFileRowQuery;
|
|
661
|
+
}): EidosFileRow[];
|
|
662
|
+
listRows(tableId: string, limit?: number, offset?: number, query?: EidosFileRowQuery): EidosFileRow[];
|
|
663
|
+
getRowPage(tableId: string, offset: number, limit: number, query?: EidosFileRowQuery, totalHint?: number, cursor?: string, projection?: EidosFileRowPageProjection): EidosFileRowPage;
|
|
664
|
+
getRow(tableId: string, rowId: string): EidosFileRow | null;
|
|
665
|
+
queryRows(tableId: string, options?: {
|
|
666
|
+
fields?: string[];
|
|
667
|
+
query?: EidosFileRowQuery;
|
|
668
|
+
limit?: number;
|
|
669
|
+
offset?: number;
|
|
670
|
+
cursor?: string;
|
|
671
|
+
resolveRelations?: boolean;
|
|
672
|
+
}): {
|
|
673
|
+
rows: EidosFileLogicalRow[];
|
|
674
|
+
nextCursor?: string;
|
|
675
|
+
};
|
|
676
|
+
/**
|
|
677
|
+
* @internal Exact Runtime aggregate/group scan. One set-based SQL statement
|
|
678
|
+
* returns typed logical inputs in effective query order; the public Runtime
|
|
679
|
+
* remains responsible for aggregate arithmetic and response bounds.
|
|
680
|
+
*/
|
|
681
|
+
runtimeScanLogicalRows(tableId: string, fieldIds: string[], query: EidosFileRowQuery): EidosFileLogicalRow[];
|
|
682
|
+
/** @internal Builds the keyset boundary used by the exact Runtime service. */
|
|
683
|
+
createRowCursor(tableId: string, query: EidosFileRowQuery, row: EidosFileLogicalRow): string;
|
|
684
|
+
countRows(tableId: string, query?: EidosFileRowQuery): number;
|
|
685
|
+
countRowsByField(tableId: string, fieldKey: string, query?: EidosFileRowQuery): EidosFileRowGroupCount[];
|
|
686
|
+
calculateColumnStats(tableId: string, configs: EidosFileColumnStatConfig[], query?: EidosFileRowQuery): EidosFileColumnStatResult[];
|
|
687
|
+
aggregate(tableId: string, configs: EidosFileColumnStatConfig[], query?: EidosFileRowQuery): EidosFileColumnStatResult[];
|
|
688
|
+
private normalizeStoredValue;
|
|
689
|
+
private rowChanges;
|
|
690
|
+
private insertRowInTransaction;
|
|
691
|
+
private insertImportedRowsInTransaction;
|
|
692
|
+
insertRow(tableId: string, row: EidosFileRow): EidosFileRow;
|
|
693
|
+
insertImportedRow(tableId: string, row: EidosFileRow): EidosFileRow;
|
|
694
|
+
insertImportedRows(tableId: string, rows: EidosFileRow[]): EidosFileRow[];
|
|
695
|
+
/** @internal Appends rows inside a caller-owned import transaction. */
|
|
696
|
+
appendImportedRows(tableId: string, rows: EidosFileRow[]): void;
|
|
697
|
+
/** @internal Used by the transactional CSV interchange layer. */
|
|
698
|
+
importTable(table: CreateEidosFileTableInput, rows: EidosFileRow[]): EidosFileTableInfo;
|
|
699
|
+
updateRow(tableId: string, rowId: string, changes: EidosFileRow): EidosFileRow;
|
|
700
|
+
updateRows(tableId: string, updates: EidosFileRowUpdate[]): EidosFileRow[];
|
|
701
|
+
deleteRow(tableId: string, rowId: string): boolean;
|
|
702
|
+
deleteRows(tableId: string, rowIds: string[]): string[];
|
|
703
|
+
deleteRowRanges(tableId: string, ranges: EidosFileRowRange[], query?: EidosFileRowQuery): number;
|
|
704
|
+
previewFormula(tableId: string, input: EidosFileFormulaPreviewInput): EidosFileFormulaPreview;
|
|
705
|
+
optimizeViewQueries(): void;
|
|
706
|
+
schema(tableId?: string): {
|
|
707
|
+
table: EidosFileTableInfo;
|
|
708
|
+
fields: EidosFileFieldInfo[];
|
|
709
|
+
views: EidosFileViewInfo[];
|
|
710
|
+
}[];
|
|
711
|
+
mutateSchema(operations: EidosFileSchemaMutation[], expectedRevision?: number | bigint): {
|
|
712
|
+
revision: number | bigint;
|
|
713
|
+
results: unknown[];
|
|
714
|
+
};
|
|
715
|
+
private logicalMutationFields;
|
|
716
|
+
mutateRows(input: EidosFileRowsMutation): {
|
|
717
|
+
revision: number | bigint;
|
|
718
|
+
rows: EidosFileLogicalRow[];
|
|
719
|
+
deleted: string[]; /** @internal Exact Runtime affected-row composition, including detach. */
|
|
720
|
+
affected?: Array<{
|
|
721
|
+
tableId: string;
|
|
722
|
+
rowId: string;
|
|
723
|
+
}>;
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
//#endregion
|
|
727
|
+
export { EidosFileRowPageOptions as $, EidosFileFilterValue as A, JsonObject as At, EidosFileLogicalRowUpdate as B, EidosFileRunResult as Bt, EidosFileFieldInfo as C, UpdateEidosFileTableInput as Ct, EidosFileFilterGroup as D, CancellationSignal as Dt, EidosFileFileValue as E, CancellationPort as Et, EidosFileFormulaPreviewSample as F, RequestContext as Ft, EidosFileOptionValueChange as G, EidosFileLookupAggregate as H, EidosFileSqlPrimitive as Ht, EidosFileFormulaProperty as I, cancellationPortFromSignal as It, EidosFileResolvedRelationValue as J, EidosFileRelationProperty as K, EidosFileFormulaResultType as L, parseNonNegativeInt64 as Lt, EidosFileFormulaPreview as M, MemoryByteSource as Mt, EidosFileFormulaPreviewDependency as N, OwnedBytes as Nt, EidosFileFilterOperator as O, ClockPort as Ot, EidosFileFormulaPreviewInput as P, PublicationContext as Pt, EidosFileRowPage as Q, EidosFileLogicalRow as R, EidosFileConnection as Rt, EidosFileCsvImportResult as S, UpdateEidosFileFieldInput as St, EidosFileFieldType as T, ByteSource as Tt, EidosFileLookupProperty as U, EidosFileLogicalValue as V, EidosFileSqlParams as Vt, EidosFileMetadata as W, EidosFileRowGroupCount as X, EidosFileRow as Y, EidosFileRowMutationResult as Z, EidosFileCsvFieldType as _, EidosFileValidationIssue as _t, CreateEidosFileOptions as a, EidosFileRowsDeleteResult as at, EidosFileCsvImportOptions as b, EidosFileViewInfo as bt, CreateEidosFileTableInput as c, EidosFileSchemaMutation as ct, EidosFileColumnStatResult as d, EidosFileSort as dt, EidosFileRowPageProjection as et, EidosFileColumnStatType as f, EidosFileSortDirection as ft, EidosFileCsvExportResult as g, EidosFileTableSnapshot as gt, EidosFileCsvExportOptions as h, EidosFileTableInfo as ht, CreateEidosFileLookupFieldInput as i, EidosFileRowValue as it, EidosFileFormulaDisplayType as j, JsonValue as jt, EidosFileFilterRule as k, EntropyPort as kt, CreateEidosFileViewInput as l, EidosFileSelectOption as lt, EidosFileCsvExportColumn as m, EidosFileStorageCodec as mt, CreateEidosFileFieldInput as n, EidosFileRowRange as nt, CreateEidosFileRelationFieldInput as o, EidosFileRowsMutation as ot, EidosFileCsvColumnOverride as p, EidosFileSourceFieldType as pt, EidosFileRelationValue as q, CreateEidosFileFormulaFieldInput as r, EidosFileRowUpdate as rt, CreateEidosFileSourceFieldInput as s, EidosFileRowsMutationResult as st, EidosFileRuntime as t, EidosFileRowQuery as tt, EidosFileColumnStatConfig as u, EidosFileSnapshot as ut, EidosFileCsvImportColumn as v, EidosFileValidationResult as vt, EidosFileFieldPlacement as w, UpdateEidosFileViewInput as wt, EidosFileCsvImportPlan as x, ImportEidosFileFieldInput as xt, EidosFileCsvImportIssue as y, EidosFileValueKind as yt, EidosFileLogicalRowDraft as z, EidosFileConnectionCapabilities as zt };
|
|
728
|
+
//# sourceMappingURL=runtime-C9IcEeTi.d.mts.map
|