@eidos.space/eidos-file 2.2.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/FIELD-CONVERSION.md +40 -19
  2. package/dist/adapter-contract-SrPzXysz.d.mts +281 -0
  3. package/dist/adapter-contract-SrPzXysz.d.mts.map +1 -0
  4. package/dist/better-sqlite3.d.mts +2 -2
  5. package/dist/better-sqlite3.mjs +1 -1
  6. package/dist/browser.d.mts +4 -4
  7. package/dist/browser.mjs +2 -2
  8. package/dist/{csv-BVaUkU1o.mjs → csv-NK8Rti5O.mjs} +38 -7
  9. package/dist/csv-NK8Rti5O.mjs.map +1 -0
  10. package/dist/csv.d.mts +1 -1
  11. package/dist/csv.d.mts.map +1 -1
  12. package/dist/csv.mjs +1 -1
  13. package/dist/index.d.mts +57 -9
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +66 -499
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/node-sqlite.d.mts +3 -3
  18. package/dist/node-sqlite.d.mts.map +1 -1
  19. package/dist/node-sqlite.mjs +10 -4
  20. package/dist/node-sqlite.mjs.map +1 -1
  21. package/dist/runtime-CUCgAnbo.d.mts +1682 -0
  22. package/dist/runtime-CUCgAnbo.d.mts.map +1 -0
  23. package/dist/{runtime-D9Vp-lxn.mjs → runtime-CrsC-uwG.mjs} +1390 -293
  24. package/dist/runtime-CrsC-uwG.mjs.map +1 -0
  25. package/dist/{sqlite-wasm-DzuW0TZZ.mjs → sqlite-wasm-BQqcna0d.mjs} +9 -2
  26. package/dist/sqlite-wasm-BQqcna0d.mjs.map +1 -0
  27. package/dist/{system-metadata-merge-DeHwokcY.d.mts → system-metadata-merge-BY7ebqnp.d.mts} +2 -2
  28. package/dist/{system-metadata-merge-DeHwokcY.d.mts.map → system-metadata-merge-BY7ebqnp.d.mts.map} +1 -1
  29. package/dist/{system-metadata-merge-DJ9yCprr.mjs → system-metadata-merge-CVa87L1C.mjs} +2 -2
  30. package/dist/{system-metadata-merge-DJ9yCprr.mjs.map → system-metadata-merge-CVa87L1C.mjs.map} +1 -1
  31. package/dist/{temporal-CnuhXeP8.d.mts → temporal-BMFnxGcx.d.mts} +6 -3
  32. package/dist/temporal-BMFnxGcx.d.mts.map +1 -0
  33. package/package.json +3 -3
  34. package/dist/adapter-contract-CNigdeQ7.d.mts +0 -1137
  35. package/dist/adapter-contract-CNigdeQ7.d.mts.map +0 -1
  36. package/dist/csv-BVaUkU1o.mjs.map +0 -1
  37. package/dist/runtime-BSYpcOBe.d.mts +0 -801
  38. package/dist/runtime-BSYpcOBe.d.mts.map +0 -1
  39. package/dist/runtime-D9Vp-lxn.mjs.map +0 -1
  40. package/dist/sqlite-wasm-DzuW0TZZ.mjs.map +0 -1
  41. package/dist/temporal-CnuhXeP8.d.mts.map +0 -1
@@ -1,801 +0,0 @@
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
- /** Whether this Runtime can execute the complete saved query. */
148
- queryStatus?: "supported" | "unsupported";
149
- query: string;
150
- properties: Record<string, unknown> | null;
151
- filter: EidosFileFilterGroup | null;
152
- sorts: EidosFileSort[];
153
- orderMap: Record<string, number> | null;
154
- hiddenFields: string[];
155
- position: number | null;
156
- createdAt: string;
157
- updatedAt: string;
158
- }
159
- interface UpdateEidosFileViewInput {
160
- name?: string;
161
- type?: string;
162
- position?: number | null;
163
- properties?: Record<string, unknown> | null;
164
- filter?: EidosFileFilterGroup | null;
165
- sorts?: EidosFileSort[];
166
- orderMap?: Record<string, number> | null;
167
- hiddenFields?: string[];
168
- }
169
- interface CreateEidosFileOptions {
170
- fileId?: string;
171
- title?: string;
172
- description?: string;
173
- createdAt?: string;
174
- defaultTable?: CreateEidosFileTableInput;
175
- }
176
- interface CreateEidosFileTableInput {
177
- id?: string;
178
- name: string;
179
- icon?: string;
180
- description?: string;
181
- fields?: CreateEidosFileFieldInput[];
182
- createDefaultView?: boolean;
183
- }
184
- type EidosFileCsvFieldType = "text" | "number" | "checkbox" | "date" | "datetime" | "url";
185
- interface EidosFileCsvImportColumn {
186
- sourceIndex: number;
187
- sourceName: string;
188
- name: string;
189
- columnName: string;
190
- type: "record-label" | EidosFileCsvFieldType;
191
- settings?: Record<string, unknown>;
192
- }
193
- interface EidosFileCsvImportIssue {
194
- code: "malformed-row" | "inconsistent-column-count";
195
- count: number;
196
- message: string;
197
- }
198
- interface EidosFileCsvImportPlan {
199
- fileName: string;
200
- tableName: string;
201
- rowCount: number;
202
- skippedRowCount: number;
203
- columns: EidosFileCsvImportColumn[];
204
- sampleRows: string[][];
205
- issues: EidosFileCsvImportIssue[];
206
- }
207
- interface EidosFileCsvColumnOverride {
208
- sourceIndex: number;
209
- name?: string;
210
- type?: EidosFileCsvFieldType;
211
- }
212
- interface EidosFileCsvImportOptions {
213
- tableName?: string;
214
- columns?: EidosFileCsvColumnOverride[];
215
- }
216
- interface EidosFileCsvImportResult {
217
- table: EidosFileTableInfo;
218
- importedRowCount: number;
219
- skippedRowCount: number;
220
- }
221
- interface EidosFileCsvExportColumn {
222
- columnName: string;
223
- name: string;
224
- }
225
- interface EidosFileCsvExportOptions {
226
- query?: EidosFileRowQuery;
227
- columns: EidosFileCsvExportColumn[];
228
- }
229
- interface EidosFileCsvExportResult {
230
- exportedRowCount: number;
231
- }
232
- interface UpdateEidosFileTableInput {
233
- name?: string;
234
- icon?: string | null;
235
- description?: string | null;
236
- }
237
- interface CreateEidosFileSourceFieldInput {
238
- id?: string;
239
- name: string;
240
- /** @deprecated The Runtime derives the SQLite physical name from name. */
241
- columnName?: string;
242
- type: EidosFileSourceFieldType;
243
- property?: Record<string, unknown>;
244
- storageCodec?: EidosFileStorageCodec;
245
- /** SQL NULL policy for scalar and JSON storage. */
246
- nullable?: boolean;
247
- isRecordLabel?: boolean;
248
- }
249
- interface EidosFileRelationProperty extends Record<string, unknown> {
250
- targetTableId: string;
251
- targetField?: string;
252
- multiple?: boolean;
253
- direction?: "forward" | "inverse";
254
- sourceFieldId?: string;
255
- cardinality?: "one" | "many";
256
- onDelete?: "restrict" | "detach" | "preserve";
257
- }
258
- interface CreateEidosFileRelationFieldInput {
259
- id?: string;
260
- name: string;
261
- /** @deprecated The Runtime derives the SQLite physical name from name. */
262
- columnName?: string;
263
- type: "relation";
264
- property: EidosFileRelationProperty;
265
- storageCodec?: "relation";
266
- }
267
- type EidosFileFormulaDisplayType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url" | "json";
268
- type EidosFileFormulaResultType = Exclude<EidosFileFormulaDisplayType, "json">;
269
- interface EidosFileFormulaProperty extends Record<string, unknown> {
270
- formula: string;
271
- displayType: EidosFileFormulaDisplayType;
272
- expression?: string;
273
- }
274
- interface CreateEidosFileFormulaFieldInput {
275
- id?: string;
276
- name: string;
277
- /** @deprecated Formula Fields are virtual and have no physical column. */
278
- columnName?: string;
279
- type: "formula";
280
- property: EidosFileFormulaProperty;
281
- storageCodec?: "scalar";
282
- isRecordLabel?: boolean;
283
- }
284
- interface EidosFileFormulaPreviewInput {
285
- name: string;
286
- columnName: string;
287
- formula: string;
288
- displayType: EidosFileFormulaResultType;
289
- /** Restrict preview samples to these records, preserving UI context. */
290
- rowIds?: string[];
291
- }
292
- interface EidosFileFormulaPreviewDependency {
293
- name: string;
294
- columnName: string;
295
- }
296
- interface EidosFileFormulaPreviewSample {
297
- rowId: string;
298
- title: string | null;
299
- value: EidosFileRowValue;
300
- }
301
- interface EidosFileFormulaPreview {
302
- expression: string;
303
- dependencies: EidosFileFormulaPreviewDependency[];
304
- samples: EidosFileFormulaPreviewSample[];
305
- }
306
- type EidosFileLookupAggregate = "first" | "values" | "count" | "sum" | "average" | "min" | "max";
307
- interface EidosFileLookupProperty extends Record<string, unknown> {
308
- relationField: string;
309
- targetField: string;
310
- aggregate: EidosFileLookupAggregate;
311
- displayType: EidosFileFormulaDisplayType;
312
- }
313
- interface EidosFileSelectOption {
314
- /** Canonical option identity and raw cell value. */
315
- name: string;
316
- color: string;
317
- }
318
- interface EidosFileOptionValueChange {
319
- from: string;
320
- to: string;
321
- }
322
- interface CreateEidosFileLookupFieldInput {
323
- id?: string;
324
- name: string;
325
- /** @deprecated Lookup Fields are virtual and have no physical column. */
326
- columnName?: string;
327
- type: "lookup";
328
- property: EidosFileLookupProperty;
329
- storageCodec?: "scalar" | "json_array";
330
- isRecordLabel?: boolean;
331
- }
332
- type CreateEidosFileFieldInput = CreateEidosFileSourceFieldInput | CreateEidosFileRelationFieldInput | CreateEidosFileFormulaFieldInput | CreateEidosFileLookupFieldInput;
333
- interface EidosFileFieldPlacement {
334
- viewId: string;
335
- index: number;
336
- }
337
- interface EidosFileRelationValue {
338
- id: string;
339
- title: string;
340
- }
341
- interface ImportEidosFileFieldInput {
342
- name: string;
343
- columnName: string;
344
- type: EidosFileFieldType;
345
- property?: Record<string, unknown> | null;
346
- storageCodec?: EidosFileStorageCodec;
347
- valueKind?: EidosFileValueKind;
348
- isHidden?: boolean;
349
- isDerived?: boolean;
350
- sourceTableColumnName?: string | null;
351
- dependsOn?: unknown;
352
- }
353
- interface CreateEidosFileViewInput {
354
- id?: string;
355
- name: string;
356
- type: string;
357
- query?: string;
358
- properties?: Record<string, unknown> | null;
359
- filter?: EidosFileFilterGroup | null;
360
- sorts?: EidosFileSort[];
361
- orderMap?: Record<string, number> | null;
362
- hiddenFields?: string[];
363
- position?: number | null;
364
- }
365
- interface UpdateEidosFileFieldInput {
366
- name?: string;
367
- type?: EidosFileFieldType;
368
- property?: Record<string, unknown> | null;
369
- optionValueChanges?: EidosFileOptionValueChange[];
370
- isRecordLabel?: boolean;
371
- /** Explicit user approval for a preflighted conversion that may change values. */
372
- confirmLossy?: boolean;
373
- }
374
- type EidosFileLogicalValue = EidosFileSqlPrimitive | boolean | EidosFileLogicalValue[] | {
375
- readonly [key: string]: EidosFileLogicalValue;
376
- };
377
- interface EidosFileFileValue {
378
- id: string;
379
- uri: string;
380
- name: string;
381
- mediaType: string;
382
- /** Canonical non-negative signed-int64 decimal string. */
383
- size: string;
384
- /** Extension members are preserved through parse and serialization. */
385
- [key: string]: JsonValue;
386
- }
387
- type EidosFileRowValue = EidosFileSqlPrimitive | boolean;
388
- type EidosFileRow = Record<string, EidosFileRowValue>;
389
- /** Language-neutral Runtime row shape from Eidos File 1.0 §16. */
390
- interface EidosFileLogicalRow {
391
- id: string;
392
- fields: Record<string, EidosFileLogicalValue>;
393
- /** Generated Relation targets, requested separately from canonical values. */
394
- resolved?: Record<string, EidosFileResolvedRelationValue[]>;
395
- }
396
- interface EidosFileResolvedRelationValue {
397
- id: string;
398
- label: EidosFileLogicalValue;
399
- }
400
- interface EidosFileLogicalRowDraft {
401
- id?: string;
402
- fields: Record<string, EidosFileLogicalValue>;
403
- }
404
- interface EidosFileLogicalRowUpdate {
405
- id: string;
406
- fields: Record<string, EidosFileLogicalValue>;
407
- }
408
- interface EidosFileRowsMutation {
409
- tableId: string;
410
- insert?: EidosFileLogicalRowDraft[];
411
- update?: EidosFileLogicalRowUpdate[];
412
- delete?: string[];
413
- expectedRevision?: number | bigint;
414
- }
415
- type EidosFileSchemaMutation = {
416
- type: "create-table";
417
- table: CreateEidosFileTableInput;
418
- } | {
419
- type: "update-table";
420
- tableId: string;
421
- changes: UpdateEidosFileTableInput;
422
- } | {
423
- type: "delete-table";
424
- tableId: string;
425
- } | {
426
- type: "add-field";
427
- tableId: string;
428
- field: CreateEidosFileFieldInput;
429
- } | {
430
- type: "update-field";
431
- tableId: string;
432
- fieldId: string;
433
- changes: UpdateEidosFileFieldInput;
434
- } | {
435
- type: "delete-field";
436
- tableId: string;
437
- fieldId: string;
438
- } | {
439
- type: "create-view";
440
- tableId: string;
441
- view: CreateEidosFileViewInput;
442
- } | {
443
- type: "update-view";
444
- viewId: string;
445
- changes: UpdateEidosFileViewInput;
446
- } | {
447
- type: "delete-view";
448
- viewId: string;
449
- };
450
- type EidosFileSortDirection = "asc" | "desc";
451
- interface EidosFileSort {
452
- field: string;
453
- direction: EidosFileSortDirection;
454
- nulls?: "first" | "last";
455
- }
456
- 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" | "is-between" | "is-relative-to-today";
457
- type EidosFileFilterValue = string | number | boolean | null;
458
- type EidosFileRelativeDateDirection = "past" | "next" | "this";
459
- type EidosFileRelativeDateUnit = "day" | "week" | "month" | "year";
460
- interface EidosFileRelativeDateValue {
461
- direction: EidosFileRelativeDateDirection;
462
- unit: EidosFileRelativeDateUnit;
463
- }
464
- type EidosFileFilterRuleValue = EidosFileFilterValue | EidosFileFilterValue[] | EidosFileRelativeDateValue;
465
- interface EidosFileFilterRule {
466
- type: "rule";
467
- field: string;
468
- operator: EidosFileFilterOperator;
469
- value?: EidosFileFilterRuleValue;
470
- }
471
- interface EidosFileFilterGroup {
472
- type: "group";
473
- conjunction: "and" | "or";
474
- /** Internal compatibility representation of Runtime's Boolean NOT. */
475
- negated?: boolean;
476
- children: Array<EidosFileFilterRule | EidosFileFilterGroup>;
477
- }
478
- interface EidosFileRowQuery {
479
- search?: string;
480
- /** Exact Runtime search Field restriction, expressed as canonical Field IDs. */
481
- searchFields?: string[];
482
- filter?: EidosFileFilterGroup | null;
483
- sorts?: EidosFileSort[];
484
- }
485
- interface EidosFileRowPageProjection {
486
- /** Ordered field candidates available to each projected row. */
487
- columns: string[];
488
- /** Fields returned for every row without consuming the per-row field limit. */
489
- preservedColumns?: string[];
490
- /** Maximum candidate fields returned for each row. */
491
- fieldLimit?: number;
492
- /** Skip null, undefined, and empty-string candidates before applying the limit. */
493
- omitEmptyFields?: boolean;
494
- /** @internal Include the Table's current Record Label Field in compatibility projections. */
495
- includeRecordLabel?: boolean;
496
- /** @internal Include resolved Relation label arrays for compatibility editors. */
497
- includeRelationDisplays?: boolean;
498
- }
499
- interface EidosFileRowPageOptions {
500
- offset: number;
501
- limit: number;
502
- query?: EidosFileRowQuery;
503
- /**
504
- * Optional per-row response projection. Record identity is always
505
- * included. Query-only fields may be read internally for filtering, sorting,
506
- * and cursor generation but are not exposed in the returned rows.
507
- */
508
- projection?: EidosFileRowPageProjection;
509
- /**
510
- * Previously observed row count for the same query. When present, paging can
511
- * reuse it instead of repeating an expensive COUNT query.
512
- */
513
- totalHint?: number;
514
- /**
515
- * Opaque cursor returned by the previous contiguous page. The runtime uses
516
- * it as a paging fast path for natural and indexed explicit sort orders.
517
- */
518
- cursor?: string;
519
- }
520
- interface EidosFileValidationIssue {
521
- code: string;
522
- message: string;
523
- table?: string;
524
- severity?: "fatal" | "error" | "warning" | "info";
525
- }
526
- interface EidosFileValidationResult {
527
- valid: boolean;
528
- metadata: EidosFileMetadata | null;
529
- tables: EidosFileTableInfo[];
530
- errors: EidosFileValidationIssue[];
531
- warnings: EidosFileValidationIssue[];
532
- }
533
- interface EidosFileTableSnapshot {
534
- table: EidosFileTableInfo;
535
- fields: EidosFileFieldInfo[];
536
- views: EidosFileViewInfo[];
537
- rowCount: number;
538
- }
539
- interface EidosFileRowPage {
540
- tableId: string;
541
- offset: number;
542
- limit: number;
543
- total: number;
544
- rows: EidosFileRow[];
545
- /** Opaque cursor for the next contiguous page, when cursor paging is safe. */
546
- nextCursor?: string;
547
- }
548
- interface EidosFileRowGroupCount {
549
- value: EidosFileSqlPrimitive;
550
- total: number;
551
- }
552
- 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";
553
- interface EidosFileColumnStatConfig {
554
- fieldId: string;
555
- type: EidosFileColumnStatType;
556
- }
557
- interface EidosFileColumnStatResult extends EidosFileColumnStatConfig {
558
- value: string | number | null;
559
- }
560
- interface EidosFileRowMutationResult {
561
- tableId: string;
562
- row: EidosFileRow;
563
- rowCount: number;
564
- /** Eidos File metadata revision after the committed mutation. */
565
- revision?: number | bigint;
566
- }
567
- interface EidosFileRowUpdate {
568
- rowId: string;
569
- changes: EidosFileRow;
570
- }
571
- interface EidosFileRowsMutationResult {
572
- tableId: string;
573
- rows: EidosFileRow[];
574
- rowCount: number;
575
- /** Eidos File metadata revision after the committed mutation. */
576
- revision?: number | bigint;
577
- }
578
- interface EidosFileRowRange {
579
- startIndex: number;
580
- endIndex: number;
581
- }
582
- interface EidosFileRowsDeleteResult {
583
- tableId: string;
584
- deletedCount: number;
585
- rowCount: number;
586
- /** Opaque, session-local token used to undo this deletion. */
587
- undoToken?: string;
588
- /** Eidos File metadata revision after the committed mutation. */
589
- revision?: number | bigint;
590
- }
591
- interface EidosFileRowsUndoResult {
592
- tableId: string;
593
- rowCount: number;
594
- /** Opaque token that reverses this operation, enabling redo. */
595
- undoToken?: string;
596
- /** Eidos File metadata revision after the committed mutation. */
597
- revision?: number | bigint;
598
- }
599
- interface EidosFileSnapshot {
600
- path: string;
601
- metadata: EidosFileMetadata;
602
- tables: EidosFileTableSnapshot[];
603
- }
604
- //#endregion
605
- //#region src/runtime.d.ts
606
- declare class EidosFileRuntime {
607
- readonly connection: EidosFileConnection;
608
- private readonly ownsConnection;
609
- private mutationDepth;
610
- private mutationInstant;
611
- private readonly rowMutationUndoEntries;
612
- private rowMutationUndoBytes;
613
- private nestedMutationInvalidatesRowUndo;
614
- private schemaCache;
615
- private readonly nowInstant;
616
- private readonly allocateId;
617
- constructor(connection: EidosFileConnection, ownsConnection?: boolean, environment?: {
618
- nowInstant?: () => string;
619
- allocateId?: () => string;
620
- });
621
- close(): void;
622
- inspect(): EidosFileValidationResult;
623
- validate(options?: {
624
- level?: "identity" | "structural" | "content" | "semantic" | "full";
625
- }): EidosFileValidationResult;
626
- info(): EidosFileMetadata;
627
- metadata(): EidosFileMetadata;
628
- private tableRow;
629
- private fieldRows;
630
- private allSchema;
631
- listTables(): EidosFileTableInfo[];
632
- getTable(tableId: string): EidosFileTableInfo;
633
- listFields(tableId: string): EidosFileFieldInfo[];
634
- private fieldByKey;
635
- /** @internal Exact Runtime service transaction composition hook. */
636
- applyCanonicalMutation<T>(operation: (instant: string) => T, expectedRevision?: number | bigint): T;
637
- private mutate;
638
- private mutateSchemaState;
639
- private operationInstant;
640
- private prepareFields;
641
- createTable(input: CreateEidosFileTableInput): EidosFileTableInfo;
642
- private insertFieldMetadata;
643
- private insertFieldSubtypeMetadata;
644
- private installRowIdTrigger;
645
- private installRelationTriggers;
646
- private dropRelationTriggers;
647
- updateTable(tableId: string, changes: UpdateEidosFileTableInput): EidosFileTableInfo;
648
- deleteTable(tableId: string): boolean;
649
- addField(tableId: string, input: CreateEidosFileFieldInput, placement?: EidosFileFieldPlacement): EidosFileFieldInfo;
650
- importField(tableId: string, input: ImportEidosFileFieldInput): EidosFileFieldInfo;
651
- updateField(tableId: string, fieldKey: string, changes: UpdateEidosFileFieldInput): EidosFileFieldInfo;
652
- setFieldNullable(fieldId: string, nullable: boolean): EidosFileFieldInfo;
653
- /** @internal Applies a preflighted Runtime 1.0 stored-type conversion. */
654
- convertStoredFieldMetadataOnly(fieldId: string, targetType: "text" | "select" | "url", nullable: boolean): EidosFileFieldInfo;
655
- /** @internal Applies a preflighted Runtime 1.0 stored-type conversion. */
656
- convertStoredField(fieldId: string, targetType: EidosFileFieldType, nullable: boolean, rows: readonly {
657
- id: string;
658
- value: EidosFileSqlPrimitive;
659
- changed: boolean;
660
- }[], relation?: {
661
- targetTableId: string;
662
- cardinality: "one" | "many";
663
- onDelete: "restrict" | "detach" | "preserve";
664
- }): EidosFileFieldInfo;
665
- private rebuildUserTable;
666
- private transientTableName;
667
- private removeFieldFromViewLayouts;
668
- deleteField(tableId: string, fieldKey: string, replacementRecordLabelFieldId?: string): boolean;
669
- private viewRow;
670
- private mapView;
671
- listViews(tableId: string): EidosFileViewInfo[];
672
- createView(tableId: string, input: CreateEidosFileViewInput): EidosFileViewInfo;
673
- updateView(viewId: string, changes: UpdateEidosFileViewInput): EidosFileViewInfo;
674
- duplicateView(viewId: string, name?: string): EidosFileViewInfo;
675
- deleteView(viewId: string): boolean;
676
- reorderViews(tableId: string, viewIds: string[]): EidosFileViewInfo[];
677
- private fieldExpression;
678
- private lookupExpression;
679
- private relationDisplayExpression;
680
- private requiredQueryFieldKeys;
681
- private logicalSource;
682
- private compatibilityQuery;
683
- listRows(tableId: string, options?: {
684
- offset?: number;
685
- limit?: number;
686
- query?: EidosFileRowQuery;
687
- }): EidosFileRow[];
688
- listRows(tableId: string, limit?: number, offset?: number, query?: EidosFileRowQuery): EidosFileRow[];
689
- getRowPage(tableId: string, offset: number, limit: number, query?: EidosFileRowQuery, totalHint?: number, cursor?: string, projection?: EidosFileRowPageProjection): EidosFileRowPage;
690
- /** Returns the zero-based position of a Row ID in a filtered/sorted query. */
691
- getRowIndex(tableId: string, rowId: string, query?: EidosFileRowQuery): number | null;
692
- getRow(tableId: string, rowId: string): EidosFileRow | null;
693
- queryRows(tableId: string, options?: {
694
- fields?: string[];
695
- query?: EidosFileRowQuery;
696
- limit?: number;
697
- offset?: number;
698
- cursor?: string;
699
- resolveRelations?: boolean;
700
- }): {
701
- rows: EidosFileLogicalRow[];
702
- nextCursor?: string;
703
- };
704
- /** @internal Exact primary-key lookup without page totals or cursor work. */
705
- getLogicalRowsByIds(tableId: string, rowIds: string[], options?: {
706
- fields?: string[];
707
- resolveRelations?: boolean;
708
- }): EidosFileLogicalRow[];
709
- private logicalRows;
710
- /**
711
- * @internal Exact Runtime aggregate/group scan. One set-based SQL statement
712
- * returns typed logical inputs in effective query order; the public Runtime
713
- * remains responsible for aggregate arithmetic and response bounds.
714
- */
715
- runtimeScanLogicalRows(tableId: string, fieldIds: string[], query: EidosFileRowQuery): EidosFileLogicalRow[];
716
- /** @internal Builds the keyset boundary used by the exact Runtime service. */
717
- createRowCursor(tableId: string, query: EidosFileRowQuery, row: EidosFileLogicalRow): string;
718
- countRows(tableId: string, query?: EidosFileRowQuery, referenceInstant?: string): number;
719
- countRowsByField(tableId: string, fieldKey: string, query?: EidosFileRowQuery): EidosFileRowGroupCount[];
720
- calculateColumnStats(tableId: string, configs: EidosFileColumnStatConfig[], query?: EidosFileRowQuery): EidosFileColumnStatResult[];
721
- aggregate(tableId: string, configs: EidosFileColumnStatConfig[], query?: EidosFileRowQuery): EidosFileColumnStatResult[];
722
- private normalizeStoredValue;
723
- private rowChanges;
724
- private insertRowInTransaction;
725
- private insertImportedRowsInTransaction;
726
- insertRow(tableId: string, row: EidosFileRow): EidosFileRow;
727
- insertImportedRow(tableId: string, row: EidosFileRow): EidosFileRow;
728
- insertImportedRows(tableId: string, rows: EidosFileRow[]): EidosFileRow[];
729
- /** @internal Appends rows inside a caller-owned import transaction. */
730
- appendImportedRows(tableId: string, rows: EidosFileRow[]): void;
731
- /** @internal Used by the transactional CSV interchange layer. */
732
- importTable(table: CreateEidosFileTableInput, rows: EidosFileRow[]): EidosFileTableInfo;
733
- updateRow(tableId: string, rowId: string, changes: EidosFileRow): EidosFileRow;
734
- updateRows(tableId: string, updates: EidosFileRowUpdate[]): EidosFileRow[];
735
- private rowMutationUndoEntryBytes;
736
- private prepareRowMutationUndo;
737
- private deleteRowMutationUndoEntry;
738
- private clearRowMutationUndoEntries;
739
- private commitRowMutationUndo;
740
- private captureRowDeletionUndoState;
741
- private sameUndoPhysicalRow;
742
- private assertRepeatRowDeletionApplicable;
743
- private restoreRowDeletionUndoState;
744
- deleteRowsReversible(tableId: string, rowIds: string[], expectedRevision?: number | bigint, consumedUndoToken?: string): {
745
- revision: number | bigint;
746
- deleted: string[];
747
- affected: Array<{
748
- tableId: string;
749
- rowId: string;
750
- }>;
751
- rowCount: number;
752
- undoToken?: string;
753
- };
754
- revertRowMutation(undoToken: string): {
755
- revision: number | bigint;
756
- affected: Array<{
757
- tableId: string;
758
- rowId: string;
759
- }>;
760
- rowCount: number;
761
- undoToken?: string;
762
- };
763
- deleteRow(tableId: string, rowId: string): boolean;
764
- deleteRows(tableId: string, rowIds: string[]): string[];
765
- private rowIdsForRanges;
766
- deleteRowRanges(tableId: string, ranges: EidosFileRowRange[], query?: EidosFileRowQuery): number;
767
- deleteRowRangesReversible(tableId: string, ranges: EidosFileRowRange[], query?: EidosFileRowQuery): {
768
- revision: number | bigint;
769
- deleted: string[];
770
- affected: Array<{
771
- tableId: string;
772
- rowId: string;
773
- }>;
774
- rowCount: number;
775
- undoToken?: string;
776
- };
777
- previewFormula(tableId: string, input: EidosFileFormulaPreviewInput): EidosFileFormulaPreview;
778
- optimizeViewQueries(): void;
779
- schema(tableId?: string): {
780
- table: EidosFileTableInfo;
781
- fields: EidosFileFieldInfo[];
782
- views: EidosFileViewInfo[];
783
- }[];
784
- mutateSchema(operations: EidosFileSchemaMutation[], expectedRevision?: number | bigint): {
785
- revision: number | bigint;
786
- results: unknown[];
787
- };
788
- private logicalMutationFields;
789
- mutateRows(input: EidosFileRowsMutation): {
790
- revision: number | bigint;
791
- rows: EidosFileLogicalRow[];
792
- deleted: string[]; /** @internal Exact Runtime affected-row composition, including detach. */
793
- affected?: Array<{
794
- tableId: string;
795
- rowId: string;
796
- }>;
797
- };
798
- }
799
- //#endregion
800
- export { EidosFileRow as $, EidosFileFilterRuleValue as A, ByteSource as At, EidosFileLogicalRowDraft as B, RequestContext as Bt, EidosFileFieldInfo as C, EidosFileValidationResult as Ct, EidosFileFilterGroup as D, UpdateEidosFileFieldInput as Dt, EidosFileFileValue as E, ImportEidosFileFieldInput as Et, EidosFileFormulaPreviewInput as F, JsonObject as Ft, EidosFileMetadata as G, EidosFileRunResult as Gt, EidosFileLogicalValue as H, parseNonNegativeInt64 as Ht, EidosFileFormulaPreviewSample as I, JsonValue as It, EidosFileRelationValue as J, EidosFileOptionValueChange as K, EidosFileSqlParams as Kt, EidosFileFormulaProperty as L, MemoryByteSource as Lt, EidosFileFormulaDisplayType as M, CancellationSignal as Mt, EidosFileFormulaPreview as N, ClockPort as Nt, EidosFileFilterOperator as O, UpdateEidosFileTableInput as Ot, EidosFileFormulaPreviewDependency as P, EntropyPort as Pt, EidosFileResolvedRelationValue as Q, EidosFileFormulaResultType as R, OwnedBytes as Rt, EidosFileCsvImportResult as S, EidosFileValidationIssue as St, EidosFileFieldType as T, EidosFileViewInfo as Tt, EidosFileLookupAggregate as U, EidosFileConnection as Ut, EidosFileLogicalRowUpdate as V, cancellationPortFromSignal as Vt, EidosFileLookupProperty as W, EidosFileConnectionCapabilities as Wt, EidosFileRelativeDateUnit as X, EidosFileRelativeDateDirection as Y, EidosFileRelativeDateValue as Z, EidosFileCsvFieldType as _, EidosFileSortDirection as _t, CreateEidosFileOptions as a, EidosFileRowQuery as at, EidosFileCsvImportOptions as b, EidosFileTableInfo as bt, CreateEidosFileTableInput as c, EidosFileRowValue as ct, EidosFileColumnStatResult as d, EidosFileRowsMutationResult as dt, EidosFileRowGroupCount as et, EidosFileColumnStatType as f, EidosFileRowsUndoResult as ft, EidosFileCsvExportResult as g, EidosFileSort as gt, EidosFileCsvExportOptions as h, EidosFileSnapshot as ht, CreateEidosFileLookupFieldInput as i, EidosFileRowPageProjection as it, EidosFileFilterValue as j, CancellationPort as jt, EidosFileFilterRule as k, UpdateEidosFileViewInput as kt, CreateEidosFileViewInput as l, EidosFileRowsDeleteResult as lt, EidosFileCsvExportColumn as m, EidosFileSelectOption as mt, CreateEidosFileFieldInput as n, EidosFileRowPage as nt, CreateEidosFileRelationFieldInput as o, EidosFileRowRange as ot, EidosFileCsvColumnOverride as p, EidosFileSchemaMutation as pt, EidosFileRelationProperty as q, EidosFileSqlPrimitive as qt, CreateEidosFileFormulaFieldInput as r, EidosFileRowPageOptions as rt, CreateEidosFileSourceFieldInput as s, EidosFileRowUpdate as st, EidosFileRuntime as t, EidosFileRowMutationResult as tt, EidosFileColumnStatConfig as u, EidosFileRowsMutation as ut, EidosFileCsvImportColumn as v, EidosFileSourceFieldType as vt, EidosFileFieldPlacement as w, EidosFileValueKind as wt, EidosFileCsvImportPlan as x, EidosFileTableSnapshot as xt, EidosFileCsvImportIssue as y, EidosFileStorageCodec as yt, EidosFileLogicalRow as z, PublicationContext as zt };
801
- //# sourceMappingURL=runtime-BSYpcOBe.d.mts.map