@eidos.space/eidos-file 1.0.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.
Files changed (42) hide show
  1. package/DEVELOPER_PLATFORM.md +17 -11
  2. package/FIELD-CONVERSION.md +75 -0
  3. package/README.md +18 -2
  4. package/dist/{adapter-contract-B3p-48Yb.d.mts → adapter-contract-BRKKEulb.d.mts} +26 -65
  5. package/dist/adapter-contract-BRKKEulb.d.mts.map +1 -0
  6. package/dist/better-sqlite3.d.mts +2 -2
  7. package/dist/better-sqlite3.d.mts.map +1 -1
  8. package/dist/better-sqlite3.mjs +13 -5
  9. package/dist/better-sqlite3.mjs.map +1 -1
  10. package/dist/browser.d.mts +4 -4
  11. package/dist/browser.mjs +3 -3
  12. package/dist/browser.mjs.map +1 -1
  13. package/dist/{csv-WEud-i_H.mjs → csv-BQPkzC5Y.mjs} +18 -8
  14. package/dist/csv-BQPkzC5Y.mjs.map +1 -0
  15. package/dist/csv.d.mts +4 -2
  16. package/dist/csv.d.mts.map +1 -1
  17. package/dist/csv.mjs +1 -1
  18. package/dist/index.d.mts +29 -14
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +493 -175
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/node-sqlite.d.mts +98 -0
  23. package/dist/node-sqlite.d.mts.map +1 -0
  24. package/dist/node-sqlite.mjs +684 -0
  25. package/dist/node-sqlite.mjs.map +1 -0
  26. package/dist/{runtime-CMdfE7Gx.mjs → runtime-9_adwQ0y.mjs} +287 -126
  27. package/dist/runtime-9_adwQ0y.mjs.map +1 -0
  28. package/dist/{runtime-DCo5E0Kr.d.mts → runtime-C9IcEeTi.d.mts} +67 -7
  29. package/dist/runtime-C9IcEeTi.d.mts.map +1 -0
  30. package/dist/{select-options-DihMTuoa.mjs → select-options-CfNwfc_a.mjs} +123 -80
  31. package/dist/select-options-CfNwfc_a.mjs.map +1 -0
  32. package/dist/{sqlite-wasm-B86yaLG6.mjs → sqlite-wasm-BM6hsxH8.mjs} +14 -7
  33. package/dist/sqlite-wasm-BM6hsxH8.mjs.map +1 -0
  34. package/dist/{temporal-CVzLU63l.d.mts → temporal-fyRCzJjy.d.mts} +3 -3
  35. package/dist/{temporal-CVzLU63l.d.mts.map → temporal-fyRCzJjy.d.mts.map} +1 -1
  36. package/package.json +10 -2
  37. package/dist/adapter-contract-B3p-48Yb.d.mts.map +0 -1
  38. package/dist/csv-WEud-i_H.mjs.map +0 -1
  39. package/dist/runtime-CMdfE7Gx.mjs.map +0 -1
  40. package/dist/runtime-DCo5E0Kr.d.mts.map +0 -1
  41. package/dist/select-options-DihMTuoa.mjs.map +0 -1
  42. package/dist/sqlite-wasm-B86yaLG6.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,8 +1,29 @@
1
- import { A as parseEidosFileJson, C as createEidosFileUuid, D as rawTableNameForId, E as quoteIdentifier, O as canonicalizeEidosFileJson, S as createEidosFileIdentifier, T as isEidosFileUuid, _ as EidosUuidV7Generator, b as assertEidosFileTableId, c as normalizeEidosFileDate, d as decodeEidosFileAttachmentPaths, f as decodeEidosFileValues, g as normalizeEidosFileAttachmentPath, h as isSafeEidosFileUri, j as EidosFileError, k as isCanonicalEidosFileJson, l as normalizeEidosFileInstant, m as encodeEidosFileValues, n as parseEidosFileSelectOptions, o as isCanonicalEidosFileDate, p as encodeEidosFileAttachmentPaths, r as currentEidosFileInstant, s as isCanonicalEidosFileInstant, t as assertEidosFileSelectOptions, u as assertEidosFileValues, v as assertEidosFileColumnName, w as eidosFilePhysicalName, x as assertEidosFileUuid, y as assertEidosFileDisplayName } from "./select-options-DihMTuoa.mjs";
2
- import { a as eidosFileTypeHandler, c as AdapterTransportRuntimeClient, d as transportFitsHostLimit, f as validateAdapterCarrier, i as EidosFileSession, l as AdapterTransportServer, n as EidosFileHandlerRegistry, o as EidosFileRuntimeDataSource, p as validateAdapterEnvelope, r as EidosFileHostError, s as eidosFileSnapshot, t as SQLiteWasmConnectionPort, u as EIDOS_ADAPTER_TRANSPORT_LIMITS } from "./sqlite-wasm-B86yaLG6.mjs";
3
- import { $ as EIDOS_FILE_SYSTEM_COLUMNS, A as eidosFileLookupTargetDisplayType, B as EIDOS_FILE_APPLICATION_ID, C as normalizeEidosFileSorts, D as eidosFileLookupDisplayType, E as eidosFileLookupAggregateSupportsTarget, F as compileEidosFileFormula, G as EIDOS_FILE_FORMAT_VERSION, H as EIDOS_FILE_FEATURES_TABLE, I as compileEidosFileFormulaFields, J as EIDOS_FILE_META_TABLE, K as EIDOS_FILE_FORMULA_FIELDS_TABLE, L as compileEidosFileFormulaSource, M as eidosFileLookupValueType, N as EIDOS_FILE_FORMULA_FIELD_FUNCTION_NAMES, O as eidosFileLookupElementType, P as EIDOS_FILE_FORMULA_FUNCTION_NAMES, Q as EIDOS_FILE_SCHEMA_VERSION, R as eidosFileFormulaReferences, S as normalizeEidosFileRowQuery, T as eidosFileFieldStoresJsonArray, U as EIDOS_FILE_FIELDS_TABLE, V as EIDOS_FILE_EXTENSION, W as EIDOS_FILE_FORMAT, X as EIDOS_FILE_RELATION_FIELDS_TABLE, Y as EIDOS_FILE_MIME_TYPE, Z as EIDOS_FILE_REQUIRED_TABLES, _ as compileEidosFileRowQuery, a as EIDOS_FILE_SCHEMA_SQL, at as eidosFileColumnStatTypesForField, b as eidosFileSortExpression, c as initializeEidosFileSchema, d as decodeEidosFileRelationIds, et as EIDOS_FILE_TABLES_TABLE, f as encodeEidosFileRelationIds, ft as nativeToSqlValue, g as assertEidosFileRowQuery, h as parseNonNegativeInt64, i as EIDOS_FILE_FORMAT_VERSION_TEXT, it as eidosFileColumnStatLabel, j as eidosFileLookupTargetValueType, k as eidosFileLookupStorageCodec, l as setEidosFileMetadata, lt as assertInt64Decimal, m as cancellationPortFromSignal, n as validateEidosFile, nt as SQLITE_HEADER, o as configureEidosFileConnection, ot as ConnectionPortEidosFileConnection, p as MemoryByteSource, pt as sqlValueToNative, q as EIDOS_FILE_LOOKUP_FIELDS_TABLE, r as smallestDependencyCycle, rt as hasEidosFileSqliteHeader, s as incrementEidosFileRevision, st as EidosAdapterError, t as EidosFileRuntime, tt as EIDOS_FILE_VIEWS_TABLE, u as decodeEidosFileRelationDisplay, ut as assertUnicodeString, v as eidosFileRowQueryAffectedByFieldChanges, w as removeEidosFileFilterField, x as normalizeEidosFileFilter, y as eidosFileRowQueryPredicateColumns, z as rewriteEidosFileFormulaFieldReferences } from "./runtime-CMdfE7Gx.mjs";
4
- import { _ as planEidosFileFieldConversion, a as eidosFileCsvExportHeader, b as encodeEidosFileJsonArray, c as importEidosFileCsv, d as prepareEidosFileCsvImport, f as MUTABLE_BASE_FIELD_TYPES, g as isMutableEidosFileFieldType, h as encodeEidosFileMultiSelectValues, i as createEidosFileCsvRowEncoder, l as parseEidosFileCsvRows, m as eidosFileFieldDisplayValues, n as EIDOS_FILE_CSV_PREVIEW_ROW_COUNT, o as eidosFileCsvRowToEidosFileRow, p as decodeEidosFileMultiSelectValues, r as createEidosFileCsvImportPlan, s as encodeEidosFileCsvRecord, t as EIDOS_FILE_CSV_INFERENCE_ROW_COUNT, u as planEidosFileCsvImport, v as decodeEidosFileJsonArray, y as decodeEidosFileStringArray } from "./csv-WEud-i_H.mjs";
1
+ import { A as isCanonicalEidosFileJson, C as assertEidosFileUuid, D as isEidosFileUuid, E as isEidosFileReservedTableName, M as EidosFileError, O as quoteIdentifier, S as assertEidosFileTableName, T as createEidosFileUuid, _ as normalizeEidosFileAttachmentPath, b as assertEidosFileDisplayName, c as normalizeEidosFileDate, d as decodeEidosFileAttachmentPaths, f as decodeEidosFileValues, g as isSafeEidosFileUri, h as encodeEidosFileValues, j as parseEidosFileJson, k as canonicalizeEidosFileJson, l as normalizeEidosFileInstant, m as encodeEidosFileAttachmentPaths, n as parseEidosFileSelectOptions, o as isCanonicalEidosFileDate, p as eidosFileUriClass, r as currentEidosFileInstant, s as isCanonicalEidosFileInstant, t as assertEidosFileSelectOptions, u as assertEidosFileValues, v as EidosUuidV7Generator, w as createEidosFileIdentifier, x as assertEidosFileTableId, y as assertEidosFileColumnName } from "./select-options-CfNwfc_a.mjs";
2
+ import { a as eidosFileTypeHandler, c as AdapterTransportRuntimeClient, d as transportFitsHostLimit, f as validateAdapterCarrier, i as EidosFileSession, l as AdapterTransportServer, n as EidosFileHandlerRegistry, o as EidosFileRuntimeDataSource, p as validateAdapterEnvelope, r as EidosFileHostError, s as eidosFileSnapshot, t as SQLiteWasmConnectionPort, u as EIDOS_ADAPTER_TRANSPORT_LIMITS } from "./sqlite-wasm-BM6hsxH8.mjs";
3
+ import { $ as EIDOS_FILE_SCHEMA_VERSION, A as eidosFileLookupStorageCodec, B as rewriteEidosFileFormulaFieldReferences, C as normalizeEidosFileRowQuery, D as eidosFileLookupAggregateSupportsTarget, E as eidosFileFieldStoresJsonArray, F as EIDOS_FILE_FORMULA_FUNCTION_NAMES, G as EIDOS_FILE_FORMAT, H as EIDOS_FILE_EXTENSION, I as compileEidosFileFormula, J as EIDOS_FILE_LOOKUP_FIELDS_TABLE, K as EIDOS_FILE_FORMAT_VERSION, L as compileEidosFileFormulaFields, M as eidosFileLookupTargetValueType, N as eidosFileLookupValueType, O as eidosFileLookupDisplayType, P as EIDOS_FILE_FORMULA_FIELD_FUNCTION_NAMES, Q as EIDOS_FILE_REQUIRED_TABLES, R as compileEidosFileFormulaSource, S as normalizeEidosFileFilter, T as removeEidosFileFilterField, U as EIDOS_FILE_FEATURES_TABLE, V as EIDOS_FILE_APPLICATION_ID, W as EIDOS_FILE_FIELDS_TABLE, X as EIDOS_FILE_MIME_TYPE, Y as EIDOS_FILE_META_TABLE, Z as EIDOS_FILE_RELATION_FIELDS_TABLE, _ as assertEidosFileRowQuery, a as EIDOS_FILE_FORMAT_VERSION_TEXT, at as eidosFileColumnStatLabel, b as eidosFileRowQueryPredicateColumns, c as incrementEidosFileRevision, ct as EidosAdapterError, d as decodeEidosFileRelationDisplay, dt as assertUnicodeString, et as EIDOS_FILE_SYSTEM_COLUMNS, f as decodeEidosFileRelationIds, g as parseNonNegativeInt64, h as cancellationPortFromSignal, i as scanStableRowPages, it as hasEidosFileSqliteHeader, j as eidosFileLookupTargetDisplayType, k as eidosFileLookupElementType, l as initializeEidosFileSchema, m as MemoryByteSource, mt as sqlValueToNative, n as validateEidosFile, nt as EIDOS_FILE_VIEWS_TABLE, o as EIDOS_FILE_SCHEMA_SQL, ot as eidosFileColumnStatTypesForField, p as encodeEidosFileRelationIds, pt as nativeToSqlValue, q as EIDOS_FILE_FORMULA_FIELDS_TABLE, r as smallestDependencyCycle, rt as SQLITE_HEADER, s as configureEidosFileConnection, st as ConnectionPortEidosFileConnection, t as EidosFileRuntime, tt as EIDOS_FILE_TABLES_TABLE, u as setEidosFileMetadata, ut as assertInt64Decimal, v as compileEidosFileRowQuery, w as normalizeEidosFileSorts, x as eidosFileSortExpression, y as eidosFileRowQueryAffectedByFieldChanges, z as eidosFileFormulaReferences } from "./runtime-9_adwQ0y.mjs";
4
+ import { _ as isMutableEidosFileFieldType, a as eidosFileCsvExportHeader, b as decodeEidosFileStringArray, c as importEidosFileCsv, d as prepareEidosFileCsvImport, f as MUTABLE_BASE_FIELD_TYPES, g as encodeEidosFileMultiSelectValues, h as eidosFileFieldDisplayValues, i as createEidosFileCsvRowEncoder, l as parseEidosFileCsvRows, m as eidosFileFieldConversionMayRequireLossyConfirmation, n as EIDOS_FILE_CSV_PREVIEW_ROW_COUNT, o as eidosFileCsvRowToEidosFileRow, p as decodeEidosFileMultiSelectValues, r as createEidosFileCsvImportPlan, s as encodeEidosFileCsvRecord, t as EIDOS_FILE_CSV_INFERENCE_ROW_COUNT, u as planEidosFileCsvImport, v as planEidosFileFieldConversion, x as encodeEidosFileJsonArray, y as decodeEidosFileJsonArray } from "./csv-BQPkzC5Y.mjs";
5
5
  //#region src/canonical-conversion.ts
6
+ /**
7
+ * Product defaults for conversions requested by the Eidos File editor.
8
+ *
9
+ * These policies are intentionally explicit: the Runtime still reports an
10
+ * `explicit-lossy` preflight and requires confirmation whenever the values in
11
+ * the current Field would actually lose information.
12
+ */
13
+ function recommendedEidosFileConversionPolicies(from, to) {
14
+ const policies = [];
15
+ if (from === "integer" && to === "number") policies.push("round-binary64");
16
+ if (from === "number" && to === "integer") policies.push("round-ties-even");
17
+ if ((from === "integer" || from === "number") && to === "checkbox") policies.push("zero-false-nonzero-true");
18
+ if (from === "datetime" && to === "date") policies.push("utc-date");
19
+ if (from === "multi-select" && to === "select") policies.push("first");
20
+ if (!LIST_TYPES.has(from) && LIST_TYPES.has(to)) policies.push("null-to-empty-list");
21
+ return policies;
22
+ }
23
+ /** Returns the nullable shape used by editor-initiated conversions. */
24
+ function eidosFileConversionTargetNullable(from, to, sourceNullable) {
25
+ return sourceNullable || from === "multi-select" && to === "select";
26
+ }
6
27
  const INT64_MIN = -9223372036854775808n;
7
28
  const INT64_MAX = 9223372036854775807n;
8
29
  const INT64 = /^(?:0|-[1-9][0-9]*|[1-9][0-9]*)$/u;
@@ -18,10 +39,17 @@ const TEXT_TYPES = new Set([
18
39
  "url",
19
40
  "select"
20
41
  ]);
42
+ const SHARED_TEXT_COLUMN_TYPES = new Set([
43
+ "text",
44
+ "select",
45
+ "url"
46
+ ]);
47
+ /** True when a conversion can retain the exact nullable SQLite column DDL. */
48
+ function eidosFileConversionCanReusePhysicalColumn(from, to, sourceNullable, targetNullable) {
49
+ return sourceNullable === targetNullable && SHARED_TEXT_COLUMN_TYPES.has(from) && SHARED_TEXT_COLUMN_TYPES.has(to);
50
+ }
21
51
  function planCanonicalFieldConversion(input) {
22
52
  const policies = new Set(input.policies ?? []);
23
- const sourceHasSqlNull = input.rows.some((row) => row.value === null);
24
- const sourceHasJsonNull = input.rows.some((row) => input.from === "json" && row.value === "null");
25
53
  const sourceHasEmptyList = input.rows.some((row) => {
26
54
  if (row.value === null || typeof row.value !== "string") return false;
27
55
  return row.value === "[]";
@@ -32,11 +60,8 @@ function planCanonicalFieldConversion(input) {
32
60
  let error;
33
61
  for (const row of input.rows) try {
34
62
  let converted;
35
- if (row.value === null) converted = convertNull(input, policies, sourceHasJsonNull, sourceHasEmptyList);
36
- else converted = convertNonNull(input, row.value, policies, {
37
- sourceHasSqlNull,
38
- sourceHasJsonNull
39
- });
63
+ if (row.value === null) converted = convertNull(input, policies, sourceHasEmptyList);
64
+ else converted = convertNonNull(input, row.value, policies);
40
65
  if (converted.value === null && !input.toNullable && !LIST_TYPES.has(input.to)) throw new Error("Destination non-nullability rejects SQL NULL");
41
66
  validateDestination(input, converted.value);
42
67
  const changed = storageClass(input.from) !== storageClass(input.to) || !sameStorageValue(row.value, converted.value);
@@ -73,7 +98,7 @@ function planCanonicalFieldConversion(input) {
73
98
  }))
74
99
  };
75
100
  }
76
- function convertNull(input, policies, sourceHasJsonNull, sourceHasEmptyList) {
101
+ function convertNull(input, policies, sourceHasEmptyList) {
77
102
  if (LIST_TYPES.has(input.to)) {
78
103
  if (!policies.has("null-to-empty-list")) throw new Error("SQL NULL requires null-to-empty-list for a list destination");
79
104
  return {
@@ -85,10 +110,10 @@ function convertNull(input, policies, sourceHasJsonNull, sourceHasEmptyList) {
85
110
  if (!input.toNullable) throw new Error("Destination non-nullability rejects SQL NULL");
86
111
  return {
87
112
  value: null,
88
- class: sourceHasJsonNull && policies.has("json-null-to-sql-null") ? 2 : 0
113
+ class: 0
89
114
  };
90
115
  }
91
- function convertNonNull(input, value, policies, domain) {
116
+ function convertNonNull(input, value, policies) {
92
117
  const { from, to } = input;
93
118
  if (from === to) return {
94
119
  value,
@@ -130,7 +155,7 @@ function convertNonNull(input, value, policies, domain) {
130
155
  value: asCheckbox(value) ? "true" : "false",
131
156
  class: 1
132
157
  };
133
- if (from === "json" || LIST_TYPES.has(from)) return {
158
+ if (LIST_TYPES.has(from)) return {
134
159
  value: asText(value),
135
160
  class: 0
136
161
  };
@@ -169,7 +194,6 @@ function convertNonNull(input, value, policies, domain) {
169
194
  code: "list-tail-dropped"
170
195
  };
171
196
  }
172
- if (from === "json") return unwrapJsonScalar(value, "select", policies, domain);
173
197
  }
174
198
  if (to === "number") {
175
199
  if (from === "integer") {
@@ -199,7 +223,6 @@ function convertNonNull(input, value, policies, domain) {
199
223
  class: 1
200
224
  };
201
225
  }
202
- if (from === "json") return unwrapJsonScalar(value, "number", policies, domain);
203
226
  }
204
227
  if (to === "integer") {
205
228
  if (from === "checkbox") return {
@@ -211,7 +234,6 @@ function convertNonNull(input, value, policies, domain) {
211
234
  class: 1
212
235
  };
213
236
  if (from === "number") return numberToInteger(asNumber(value), policies);
214
- if (from === "json") return unwrapJsonScalar(value, "integer", policies, domain);
215
237
  }
216
238
  if (to === "checkbox") {
217
239
  if (from === "text" || from === "select") {
@@ -252,86 +274,23 @@ function convertNonNull(input, value, policies, domain) {
252
274
  code: "numeric-to-checkbox"
253
275
  };
254
276
  }
255
- if (from === "json") return unwrapJsonScalar(value, "checkbox", policies, domain);
256
- }
257
- if (to === "date" || to === "datetime" || to === "url") {
258
- if (from === "json") return unwrapJsonScalar(value, to, policies, domain);
259
- }
260
- if (to === "json") {
261
- if (from === "json" || LIST_TYPES.has(from)) return {
262
- value: asText(value),
263
- class: 0
264
- };
265
- if (TEXT_TYPES.has(from)) return {
266
- value: canonicalizeEidosFileJson(asText(value)),
267
- class: 1
268
- };
269
- if (from === "number") return {
270
- value: canonicalizeEidosFileJson(asNumber(value)),
271
- class: 1
272
- };
273
- if (from === "integer") {
274
- const integer = asInteger(value);
275
- const number = Number(integer);
276
- if (Number.isInteger(number) && BigInt(number) === integer) return {
277
- value: canonicalizeEidosFileJson(number),
278
- class: 1
279
- };
280
- if (!policies.has("round-binary64") || !Number.isFinite(number)) throw new Error("Integer JSON conversion requires round-binary64");
281
- return {
282
- value: canonicalizeEidosFileJson(number),
283
- class: 2,
284
- code: "binary64-rounded"
285
- };
286
- }
287
- if (from === "checkbox") return {
288
- value: asCheckbox(value) ? "true" : "false",
289
- class: 1
290
- };
291
277
  }
292
278
  if (LIST_TYPES.has(to)) {
293
279
  if (from === "select" && to === "multi-select") return {
294
280
  value: canonicalizeEidosFileJson([asText(value)]),
295
281
  class: 1
296
282
  };
297
- if (from === "text" || from === "json" || from === "multi-select" && to === "relation" || from === "relation" && to === "multi-select" || from === to) return {
283
+ if (from === "text" && to === "multi-select") return {
284
+ value: canonicalizeEidosFileJson([asText(value)]),
285
+ class: 1
286
+ };
287
+ if (from === "multi-select" && to === "relation" || from === "relation" && to === "multi-select" || from === to) return {
298
288
  value: asText(value),
299
289
  class: 0
300
290
  };
301
291
  }
302
292
  throw new Error(`Conversion from ${from} to ${to} is forbidden`);
303
293
  }
304
- function unwrapJsonScalar(value, to, policies, domain) {
305
- const parsed = parseEidosFileJson(asText(value));
306
- if (parsed === null) {
307
- if (!policies.has("json-null-to-sql-null")) throw new Error("JSON literal null requires json-null-to-sql-null");
308
- return {
309
- value: null,
310
- class: domain.sourceHasSqlNull && domain.sourceHasJsonNull ? 2 : 1,
311
- code: "json-null-to-sql-null"
312
- };
313
- }
314
- if (to === "number" && typeof parsed === "number") return {
315
- value: parsed,
316
- class: 1
317
- };
318
- if (to === "integer" && typeof parsed === "number") return numberToInteger(parsed, policies);
319
- if (to === "checkbox" && typeof parsed === "boolean") return {
320
- value: parsed ? 1n : 0n,
321
- class: 1
322
- };
323
- if ([
324
- "text",
325
- "date",
326
- "datetime",
327
- "url",
328
- "select"
329
- ].includes(to) && typeof parsed === "string") return {
330
- value: parsed,
331
- class: 1
332
- };
333
- throw new Error(`JSON root is incompatible with ${to}`);
334
- }
335
294
  function numberToInteger(number, policies) {
336
295
  let result = number;
337
296
  let code;
@@ -376,14 +335,11 @@ function validateDestination(input, value) {
376
335
  case "url":
377
336
  if (!isUriReference(asText(value))) throw new Error("Invalid URI-reference");
378
337
  return;
379
- case "json":
380
- if (!isCanonicalEidosFileJson(asText(value))) throw new Error("Invalid canonical JSON");
381
- return;
382
338
  case "multi-select":
383
339
  parseStringList(value);
384
340
  return;
385
341
  case "file":
386
- assertEidosFileValues(parseEidosFileJson(asText(value)));
342
+ decodeEidosFileValues(asText(value));
387
343
  return;
388
344
  case "relation": {
389
345
  const ids = parseStringList(value);
@@ -477,8 +433,7 @@ const EIDOS_RUNTIME_LIMITS = Object.freeze({
477
433
  groupFieldsMax: 8,
478
434
  searchBytesMax: 4096,
479
435
  listElementsMax: 1e4,
480
- logicalValueBytesMax: 1048576,
481
- jsonCellBytesMax: 1048576,
436
+ logicalValueBytesMax: 2 * 1048576,
482
437
  formulaBytesMax: 4096,
483
438
  formulaNodesMax: 1e4,
484
439
  formulaDepthMax: 256,
@@ -513,7 +468,8 @@ function runtimeCapabilities(writable) {
513
468
  mutateRows: writable,
514
469
  mutateView: writable,
515
470
  schemaPreflight: writable,
516
- mutateSchema: writable
471
+ mutateSchema: writable,
472
+ csvImport: writable
517
473
  };
518
474
  }
519
475
  var Runtime = class {
@@ -580,6 +536,7 @@ var EidosRuntimeService = class {
580
536
  this.writable = writable;
581
537
  this.generator = generator;
582
538
  this.capabilitiesValue = runtimeCapabilities(writable);
539
+ if (writable) this.importCsv = (request, context) => this.importCsvRequest(request, context);
583
540
  this.epoch = generator.next();
584
541
  this.cursorSecret = environment.entropy.randomBytes(16).slice();
585
542
  if (this.cursorSecret.byteLength !== 16) throw runtimeError("adapter-error", "EntropyPort returned an invalid cursor authentication key");
@@ -679,6 +636,11 @@ var EidosRuntimeService = class {
679
636
  return this.invoke(context, async () => this.read(async () => {
680
637
  assertLimit(request.limit, EIDOS_RUNTIME_LIMITS.pageSizeMax, "limit");
681
638
  assertProjection(request.projection);
639
+ if (request.offset !== void 0) {
640
+ if (!Number.isSafeInteger(request.offset) || request.offset < 0) throw runtimeError("invalid-request", "offset must be a non-negative JSON safe integer");
641
+ if (request.cursor !== void 0) throw runtimeError("invalid-request", "offset and cursor cannot be used together");
642
+ if (request.direction === "backward") throw runtimeError("invalid-request", "offset only supports forward row queries");
643
+ }
682
644
  const query = this.compatibilityQuery(request.tableId, request.query);
683
645
  const direction = request.direction ?? "forward";
684
646
  const metadata = this.core.info();
@@ -702,6 +664,7 @@ var EidosRuntimeService = class {
702
664
  fields,
703
665
  query: traversal,
704
666
  limit: request.limit + 1,
667
+ ...request.offset !== void 0 ? { offset: request.offset } : {},
705
668
  cursor: coreCursor,
706
669
  resolveRelations: request.projection.resolveRelations.length > 0
707
670
  });
@@ -722,7 +685,7 @@ var EidosRuntimeService = class {
722
685
  backward: this.core.createRowCursor(request.tableId, this.compatibilityQuery(request.tableId, backwardQuery), row)
723
686
  });
724
687
  };
725
- const hasEarlier = direction === "backward" ? hasMoreInTraversal : request.cursor !== void 0;
688
+ const hasEarlier = direction === "backward" ? hasMoreInTraversal : request.cursor !== void 0 || (request.offset ?? 0) > 0;
726
689
  const hasLater = direction === "forward" ? hasMoreInTraversal : request.cursor !== void 0;
727
690
  return {
728
691
  fileId: metadata.fileId,
@@ -949,24 +912,126 @@ var EidosRuntimeService = class {
949
912
  normalized[fieldId] = null;
950
913
  continue;
951
914
  }
915
+ if (type === "file") assertEidosFileValues(value);
916
+ else if (type === "file-entry") assertEidosFileValues([value]);
952
917
  if (!logicalValueMatchesType(value, type)) throw runtimeError("invalid-value", "Mutation value type is invalid", { fieldId });
953
918
  if (Array.isArray(value) && value.length > EIDOS_RUNTIME_LIMITS.listElementsMax) throw runtimeError("resource-limit", "List exceeds listElementsMax", { fieldId });
954
919
  if (type === "date" && !isCanonicalEidosFileDate(value)) throw runtimeError("invalid-value", "Date is not canonical", { fieldId });
955
920
  if (type === "datetime" && !isCanonicalEidosFileInstant(value)) throw runtimeError("invalid-value", "Datetime is not canonical", { fieldId });
956
- if (type === "json") {
957
- const text = value;
958
- if (new TextEncoder().encode(text).byteLength > EIDOS_RUNTIME_LIMITS.jsonCellBytesMax) throw runtimeError("resource-limit", "JSON cell exceeds jsonCellBytesMax", { fieldId });
959
- try {
960
- if (canonicalizeEidosFileJson(JSON.parse(text)) !== text) throw new Error("non-canonical");
961
- } catch {
962
- throw runtimeError("invalid-value", "JSON Field value must be canonical JCS text", { fieldId });
963
- }
964
- }
965
921
  if (type === "integer") normalized[fieldId] = parseSignedInt64(value, "Integer value");
966
922
  else normalized[fieldId] = value;
967
923
  }
968
924
  return normalized;
969
925
  }
926
+ importCsvRequest(request, context) {
927
+ const requestSummary = {
928
+ tableId: request.tableId,
929
+ expectedRevision: request.expectedRevision,
930
+ hasHeader: request.hasHeader,
931
+ columns: request.columns,
932
+ csvBytes: request.csv instanceof Uint8Array ? request.csv.byteLength : -1
933
+ };
934
+ return this.invoke(context, async () => {
935
+ this.assertWritable("importCsv");
936
+ if (!(request.csv instanceof Uint8Array)) throw runtimeError("invalid-request", "CSV bytes are required");
937
+ if (typeof request.hasHeader !== "boolean") throw runtimeError("invalid-request", "hasHeader must be boolean");
938
+ if (request.csv.byteLength > EIDOS_RUNTIME_LIMITS.csvBytesMax) throw runtimeError("resource-limit", "CSV exceeds csvBytesMax");
939
+ if (!Array.isArray(request.columns) || request.columns.length < 1) throw runtimeError("invalid-request", "CSV columns are required");
940
+ if (request.columns.length > EIDOS_RUNTIME_LIMITS.projectionFieldsMax) throw runtimeError("resource-limit", "CSV column mapping is too large");
941
+ const before = this.core.info();
942
+ assertCurrentRevision(request.expectedRevision, String(before.revision));
943
+ const table = this.core.getTable(request.tableId);
944
+ const fields = new Map(this.core.listFields(request.tableId).map((field) => [field.id, field]));
945
+ const csvIndexes = /* @__PURE__ */ new Set();
946
+ const fieldIds = /* @__PURE__ */ new Set();
947
+ const columns = request.columns.map(({ csvIndex, fieldId }) => {
948
+ if (!Number.isSafeInteger(csvIndex) || csvIndex < 0) throw runtimeError("invalid-request", "CSV column indexes must be non-negative integers");
949
+ if (csvIndexes.has(csvIndex) || fieldIds.has(fieldId)) throw runtimeError("invalid-request", "CSV column mappings must be unique");
950
+ csvIndexes.add(csvIndex);
951
+ fieldIds.add(fieldId);
952
+ const field = fields.get(fieldId);
953
+ if (!field) throw runtimeError("not-found", "CSV destination Field not found", { fieldId });
954
+ if (!fieldWritable(field)) throw runtimeError("forbidden", "CSV destination Field is read-only", { fieldId });
955
+ const type = csvImportFieldType(field);
956
+ if (!type) throw runtimeError("unsupported", `CSV import does not support ${field.type} Fields`, { fieldId });
957
+ return {
958
+ sourceIndex: csvIndex,
959
+ sourceName: field.name,
960
+ name: field.name,
961
+ columnName: field.id,
962
+ type
963
+ };
964
+ });
965
+ let content;
966
+ try {
967
+ content = new TextDecoder("utf-8", { fatal: true }).decode(request.csv);
968
+ } catch {
969
+ throw runtimeError("invalid-value", "CSV must be valid UTF-8");
970
+ }
971
+ const plan = {
972
+ fileName: "runtime-import.csv",
973
+ tableName: table.name,
974
+ rowCount: 0,
975
+ skippedRowCount: 0,
976
+ columns,
977
+ sampleRows: [],
978
+ issues: []
979
+ };
980
+ const rows = parseEidosFileCsvRows({
981
+ name: plan.fileName,
982
+ content
983
+ }, plan, { hasHeader: request.hasHeader });
984
+ if (rows.length === 0) return {
985
+ fileId: before.fileId,
986
+ tableId: request.tableId,
987
+ revision: String(before.revision),
988
+ changed: false,
989
+ createdRows: []
990
+ };
991
+ const beforeRevision = String(before.revision);
992
+ const importedRows = rows.map((row) => {
993
+ const rowId = this.generator.next();
994
+ return {
995
+ rowId,
996
+ row: {
997
+ ...row,
998
+ _id: rowId
999
+ }
1000
+ };
1001
+ });
1002
+ const createdRows = importedRows.map(({ rowId }, index) => ({
1003
+ recordIndex: index + (request.hasHeader ? 1 : 0),
1004
+ rowId
1005
+ }));
1006
+ assertJcsBytes({
1007
+ fileId: before.fileId,
1008
+ tableId: request.tableId,
1009
+ revision: "-9223372036854775808",
1010
+ changed: true,
1011
+ createdRows
1012
+ }, EIDOS_RUNTIME_LIMITS.responseBytesMax, "CSV import result");
1013
+ return this.withCommitBarrier("importCsv", beforeRevision, context, () => {
1014
+ this.core.applyCanonicalMutation(() => this.core.appendImportedRows(request.tableId, importedRows.map((entry) => entry.row)), parseRevision(request.expectedRevision));
1015
+ const after = this.core.info();
1016
+ return {
1017
+ fileId: after.fileId,
1018
+ tableId: request.tableId,
1019
+ revision: String(after.revision),
1020
+ changed: String(after.revision) !== beforeRevision,
1021
+ createdRows
1022
+ };
1023
+ }, (result) => ({
1024
+ operation: "importCsv",
1025
+ result: {
1026
+ fileId: result.fileId,
1027
+ tableId: result.tableId,
1028
+ revision: result.revision,
1029
+ changed: true,
1030
+ createdRows: result.createdRows
1031
+ }
1032
+ }));
1033
+ }, false, requestSummary);
1034
+ }
970
1035
  async mutateView(request, context) {
971
1036
  return this.invoke(context, () => {
972
1037
  this.assertWritable("mutateView");
@@ -1273,7 +1338,7 @@ var EidosRuntimeService = class {
1273
1338
  name: view.name,
1274
1339
  type: view.type,
1275
1340
  query: {
1276
- ...view.filter ? { filter: compatibilityFilterToRuntime(view.filter) } : {},
1341
+ ...view.filter ? { filter: compatibilityFilterToRuntime(view.filter, this.core.listFields(view.tableId)) } : {},
1277
1342
  ...view.sorts.length > 0 ? { sort: view.sorts.map((sort) => ({
1278
1343
  fieldId: sort.field,
1279
1344
  direction: sort.direction,
@@ -1341,14 +1406,68 @@ var EidosRuntimeService = class {
1341
1406
  aggregateNow(request) {
1342
1407
  if (request.items.length < 1 || request.items.length > EIDOS_RUNTIME_LIMITS.aggregateItemsMax) throw runtimeError("invalid-request", "Aggregate items exceed aggregateItemsMax");
1343
1408
  const keys = /* @__PURE__ */ new Set();
1409
+ for (const item of request.items) {
1410
+ if (!item.key || keys.has(item.key)) throw runtimeError("invalid-request", "Aggregate keys must be non-empty and unique");
1411
+ keys.add(item.key);
1412
+ }
1413
+ const query = this.compatibilityQuery(request.tableId, request.query ?? {});
1414
+ if (request.items.every((item) => item.op === "count-all")) {
1415
+ const metadata = this.core.info();
1416
+ const count = String(this.core.countRows(request.tableId, query));
1417
+ return {
1418
+ fileId: metadata.fileId,
1419
+ tableId: request.tableId,
1420
+ revision: String(metadata.revision),
1421
+ results: request.items.map((item) => ({
1422
+ key: item.key,
1423
+ value: count
1424
+ }))
1425
+ };
1426
+ }
1344
1427
  const fields = this.core.listFields(request.tableId);
1345
1428
  const fieldsById = new Map(fields.map((field) => [field.id, field]));
1429
+ if (!(request.query !== void 0 && Object.keys(request.query).length > 0) && request.items.every((item) => item.op === "count-all" || item.op === "distinct-count" && fieldsById.get(item.fieldId)?.physicalName || item.op === "distinct-values" && fieldsById.get(item.fieldId)?.physicalName && [
1430
+ "text",
1431
+ "select",
1432
+ "url"
1433
+ ].includes(fieldsById.get(item.fieldId).type))) {
1434
+ const metadata = this.core.info();
1435
+ const table = this.core.getTable(request.tableId);
1436
+ const tableSql = quoteSqlIdentifier(table.physicalName ?? table.rawTableName);
1437
+ return {
1438
+ fileId: metadata.fileId,
1439
+ tableId: request.tableId,
1440
+ revision: String(metadata.revision),
1441
+ results: request.items.map((item) => {
1442
+ if (item.op === "count-all") return {
1443
+ key: item.key,
1444
+ value: String(this.core.countRows(request.tableId))
1445
+ };
1446
+ const field = fieldsById.get(item.fieldId);
1447
+ if (item.op === "distinct-values") {
1448
+ const rows = this.core.connection.query(`SELECT DISTINCT ${quoteSqlIdentifier(field.physicalName)} AS value
1449
+ FROM ${tableSql}
1450
+ WHERE ${quoteSqlIdentifier(field.physicalName)} IS NOT NULL
1451
+ ORDER BY ${quoteSqlIdentifier(field.physicalName)} COLLATE BINARY
1452
+ LIMIT ?`, [item.limit + 1]);
1453
+ return {
1454
+ key: item.key,
1455
+ values: rows.slice(0, item.limit).map((row) => String(row.value)),
1456
+ truncated: rows.length > item.limit
1457
+ };
1458
+ }
1459
+ const count = this.core.connection.get(`SELECT count(DISTINCT ${quoteSqlIdentifier(field.physicalName)}) AS count FROM ${tableSql}`)?.count;
1460
+ return {
1461
+ key: item.key,
1462
+ value: String(count ?? 0)
1463
+ };
1464
+ })
1465
+ };
1466
+ }
1346
1467
  const fieldIds = Array.from(new Set([...request.items.flatMap((item) => item.op === "count-all" ? [] : [item.fieldId]), ...runtimeQueryFieldIds(request.query)]));
1347
1468
  for (const fieldId of fieldIds) if (!fieldsById.has(fieldId)) throw runtimeError("not-found", "Aggregate Field not found", { fieldId });
1348
- const rows = this.core.runtimeScanLogicalRows(request.tableId, fieldIds, this.compatibilityQuery(request.tableId, request.query ?? {})).sort((left, right) => binaryCompare(left.id, right.id));
1469
+ const rows = this.core.runtimeScanLogicalRows(request.tableId, fieldIds, query).sort((left, right) => binaryCompare(left.id, right.id));
1349
1470
  const results = request.items.map((item) => {
1350
- if (!item.key || keys.has(item.key)) throw runtimeError("invalid-request", "Aggregate keys must be non-empty and unique");
1351
- keys.add(item.key);
1352
1471
  if (item.op === "count-all") return {
1353
1472
  key: item.key,
1354
1473
  value: String(rows.length)
@@ -1753,6 +1872,20 @@ var EidosRuntimeService = class {
1753
1872
  object: "field",
1754
1873
  id: leaf.fieldId
1755
1874
  });
1875
+ for (const view of this.core.listViews(field.tableId)) {
1876
+ const queryReferencesField = view.sorts.some((sort) => sort.field === leaf.fieldId) || compatibilityFilterReferencesField(view.filter, leaf.fieldId);
1877
+ const layoutReferencesField = knownViewLayoutReferencesField(view.properties, leaf.fieldId);
1878
+ if (!queryReferencesField && !layoutReferencesField) continue;
1879
+ dependencies.set("view:" + view.id, {
1880
+ object: "view",
1881
+ id: view.id
1882
+ });
1883
+ if (queryReferencesField) forbid("dependency-blocked", "Saved View query still references the Field", {
1884
+ tableId: field.tableId,
1885
+ fieldId: leaf.fieldId,
1886
+ viewId: view.id
1887
+ });
1888
+ }
1756
1889
  break;
1757
1890
  }
1758
1891
  case "rename-field":
@@ -1842,14 +1975,33 @@ var EidosRuntimeService = class {
1842
1975
  valueChanges: [],
1843
1976
  error: "Virtual and inverse Fields cannot be converted"
1844
1977
  };
1978
+ const targetNullable = "toNullable" in change ? change.toNullable : false;
1979
+ if (eidosFileConversionCanReusePhysicalColumn(field.type, change.to, field.nullable ?? false, targetNullable) && change.to !== "url") return {
1980
+ classification: "metadata-only",
1981
+ rows: [],
1982
+ affectedRows: "0",
1983
+ valueChanges: []
1984
+ };
1845
1985
  const table = this.core.getTable(field.tableId);
1846
- const rows = this.core.connection.query(`SELECT "_id" AS id, ${quoteSqlIdentifier(field.physicalName)} AS value
1847
- FROM ${quoteSqlIdentifier(table.physicalName ?? table.rawTableName)}
1848
- ORDER BY "_id" COLLATE BINARY`);
1986
+ const rows = [];
1987
+ scanStableRowPages(this.core.connection, {
1988
+ columnsSql: `"_id" AS id, ${quoteSqlIdentifier(field.physicalName)} AS value`,
1989
+ tableSql: quoteSqlIdentifier(table.physicalName ?? table.rawTableName),
1990
+ rowIdSql: `"_id"`,
1991
+ rowIdKey: "id"
1992
+ }, (page) => rows.push(...page));
1849
1993
  let relationIds;
1850
1994
  if (change.to === "relation") {
1851
1995
  const target = this.core.getTable(change.definition.targetTableId);
1852
- relationIds = new Set(this.core.connection.query(`SELECT "_id" AS id FROM ${quoteSqlIdentifier(target.physicalName ?? target.rawTableName)}`).map((row) => row.id));
1996
+ relationIds = /* @__PURE__ */ new Set();
1997
+ scanStableRowPages(this.core.connection, {
1998
+ columnsSql: `"_id" AS id`,
1999
+ tableSql: quoteSqlIdentifier(target.physicalName ?? target.rawTableName),
2000
+ rowIdSql: `"_id"`,
2001
+ rowIdKey: "id"
2002
+ }, (page) => {
2003
+ for (const row of page) relationIds.add(row.id);
2004
+ });
1853
2005
  }
1854
2006
  return planCanonicalFieldConversion({
1855
2007
  from: field.type,
@@ -2051,7 +2203,9 @@ var EidosRuntimeService = class {
2051
2203
  const field = this.field(leaf.fieldId);
2052
2204
  const conversion = this.conversionPlan(leaf);
2053
2205
  if (conversion.classification === "forbidden") throw runtimeError("forbidden", conversion.error ?? "Conversion predicates no longer hold");
2054
- this.core.convertStoredField(leaf.fieldId, leaf.to, "toNullable" in leaf ? leaf.toNullable : false, conversion.rows, leaf.to === "relation" ? {
2206
+ const targetNullable = "toNullable" in leaf ? leaf.toNullable : false;
2207
+ if (conversion.classification === "metadata-only" && (leaf.to === "text" || leaf.to === "select" || leaf.to === "url") && eidosFileConversionCanReusePhysicalColumn(field.type, leaf.to, field.nullable ?? false, targetNullable)) this.core.convertStoredFieldMetadataOnly(leaf.fieldId, leaf.to, targetNullable);
2208
+ else this.core.convertStoredField(leaf.fieldId, leaf.to, targetNullable, conversion.rows, leaf.to === "relation" ? {
2055
2209
  targetTableId: leaf.definition.targetTableId,
2056
2210
  cardinality: leaf.definition.cardinality,
2057
2211
  onDelete: leaf.definition.onDelete
@@ -2108,7 +2262,7 @@ var EidosRuntimeService = class {
2108
2262
  try {
2109
2263
  return assertEidosFileValues([candidate])[0];
2110
2264
  } catch (error) {
2111
- throw runtimeError("invalid-value", error instanceof Error ? error.message : "Invalid File entry");
2265
+ throw runtimeError(error instanceof EidosFileError && error.code === "resource-limit" ? "resource-limit" : "invalid-value", error instanceof Error ? error.message : "Invalid File entry");
2112
2266
  }
2113
2267
  }
2114
2268
  read(operation) {
@@ -2249,6 +2403,17 @@ function fieldValueType(field) {
2249
2403
  }
2250
2404
  return field.type;
2251
2405
  }
2406
+ function csvImportFieldType(field) {
2407
+ if (field.isRecordLabel) return "record-label";
2408
+ return [
2409
+ "text",
2410
+ "number",
2411
+ "checkbox",
2412
+ "date",
2413
+ "datetime",
2414
+ "url"
2415
+ ].includes(field.type) ? field.type : null;
2416
+ }
2252
2417
  function fieldWritable(field) {
2253
2418
  const relation = field.type === "relation" ? relationDefinition(field) : void 0;
2254
2419
  return !field.systemRole && field.type !== "formula" && field.type !== "lookup" && !(field.type === "relation" && relation?.direction === "inverse");
@@ -2301,6 +2466,20 @@ function runtimeQueryFieldIds(query) {
2301
2466
  if (query.filter) visit(query.filter);
2302
2467
  return [...ids];
2303
2468
  }
2469
+ function compatibilityFilterReferencesField(filter, fieldId) {
2470
+ if (!filter) return false;
2471
+ return filter.children.some((child) => child.type === "group" ? compatibilityFilterReferencesField(child, fieldId) : child.field === fieldId);
2472
+ }
2473
+ function knownViewLayoutReferencesField(layout, fieldId) {
2474
+ if (!layout) return false;
2475
+ if ([
2476
+ "cardFields",
2477
+ "fieldOrder",
2478
+ "hiddenFields"
2479
+ ].some((key) => Array.isArray(layout[key]) && layout[key].includes(fieldId))) return true;
2480
+ if (layout.coverField === fieldId || layout.groupField === fieldId || layout.fieldWidths !== null && typeof layout.fieldWidths === "object" && !Array.isArray(layout.fieldWidths) && Object.prototype.hasOwnProperty.call(layout.fieldWidths, fieldId)) return true;
2481
+ return false;
2482
+ }
2304
2483
  function reverseRuntimeQuery(query, fields) {
2305
2484
  const sorts = (query.sort ?? []).map((sort) => ({
2306
2485
  ...sort,
@@ -2330,6 +2509,12 @@ function runtimeQueryToCompatibility(query) {
2330
2509
  }))
2331
2510
  };
2332
2511
  }
2512
+ function runtimeListElementType(type) {
2513
+ if (typeof type === "object") return type.element;
2514
+ if (type === "multi-select") return "select";
2515
+ if (type === "relation") return "row-id";
2516
+ if (type === "file") return "file-entry";
2517
+ }
2333
2518
  function assertRuntimeRowQuery(fields, query) {
2334
2519
  if (!query || typeof query !== "object" || Array.isArray(query)) throw runtimeError("invalid-query", "RowQuery must be an object");
2335
2520
  const byId = new Map(fields.map((field) => [field.id, field]));
@@ -2393,7 +2578,8 @@ function assertRuntimeRowQuery(fields, query) {
2393
2578
  return;
2394
2579
  }
2395
2580
  if (node.op === "has-any" || node.op === "has-all") {
2396
- if (typeof type === "string" || !Array.isArray(node.values) || !node.values.every((value) => value !== null && logicalValueMatchesType(value, type.element))) throw runtimeError("invalid-query", "List Filter operand is invalid");
2581
+ const elementType = runtimeListElementType(type);
2582
+ if (!elementType || !Array.isArray(node.values) || !node.values.every((value) => value !== null && filterValueMatchesType(value, elementType))) throw runtimeError("invalid-query", "List Filter operand is invalid");
2397
2583
  return;
2398
2584
  }
2399
2585
  if (node.op === "relation-has") {
@@ -2406,14 +2592,14 @@ function assertRuntimeRowQuery(fields, query) {
2406
2592
  return;
2407
2593
  }
2408
2594
  if (node.op === "in") {
2409
- if (!Array.isArray(node.values) || !node.values.every((value) => value !== null && logicalValueMatchesType(value, type))) throw runtimeError("invalid-query", "in operands are invalid");
2595
+ if (!Array.isArray(node.values) || !node.values.every((value) => value !== null && filterValueMatchesType(value, type))) throw runtimeError("invalid-query", "in operands are invalid");
2410
2596
  return;
2411
2597
  }
2412
2598
  if (node.op === "between") {
2413
- if (typeof type !== "string" || !isSortableType(type) || node.lower === null || node.upper === null || !logicalValueMatchesType(node.lower, type) || !logicalValueMatchesType(node.upper, type)) throw runtimeError("invalid-query", "between operands are invalid");
2599
+ if (typeof type !== "string" || !isSortableType(type) || node.lower === null || node.upper === null || !filterValueMatchesType(node.lower, type) || !filterValueMatchesType(node.upper, type)) throw runtimeError("invalid-query", "between operands are invalid");
2414
2600
  return;
2415
2601
  }
2416
- if (!("value" in node) || node.value === null || !logicalValueMatchesType(node.value, type) || [
2602
+ if (!("value" in node) || node.value === null || !filterValueMatchesType(node.value, type) || [
2417
2603
  "lt",
2418
2604
  "lte",
2419
2605
  "gt",
@@ -2422,6 +2608,10 @@ function assertRuntimeRowQuery(fields, query) {
2422
2608
  };
2423
2609
  if (query.filter) visit(query.filter, 1);
2424
2610
  }
2611
+ function filterValueMatchesType(value, type) {
2612
+ if (type === "row-id") return typeof value === "string";
2613
+ return logicalValueMatchesType(value, type);
2614
+ }
2425
2615
  function isSortableType(type) {
2426
2616
  return [
2427
2617
  "text",
@@ -2456,8 +2646,18 @@ function logicalValueMatchesType(value, type) {
2456
2646
  case "datetime": return typeof value === "string";
2457
2647
  case "multi-select": return Array.isArray(value) && value.every((entry) => typeof entry === "string");
2458
2648
  case "relation": return Array.isArray(value) && value.every((entry) => typeof entry === "string");
2459
- case "file": return Array.isArray(value) && value.every((entry) => isFileEntry(entry));
2460
- case "file-entry": return isFileEntry(value);
2649
+ case "file": try {
2650
+ assertEidosFileValues(value);
2651
+ return true;
2652
+ } catch {
2653
+ return false;
2654
+ }
2655
+ case "file-entry": try {
2656
+ assertEidosFileValues([value]);
2657
+ return true;
2658
+ } catch {
2659
+ return false;
2660
+ }
2461
2661
  case "json":
2462
2662
  if (typeof value !== "string") return false;
2463
2663
  try {
@@ -2467,20 +2667,24 @@ function logicalValueMatchesType(value, type) {
2467
2667
  }
2468
2668
  }
2469
2669
  }
2470
- function isFileEntry(value) {
2471
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
2472
- const entry = value;
2473
- return typeof entry.id === "string" && typeof entry.name === "string" && typeof entry.mediaType === "string" && typeof entry.size === "string" && typeof entry.uri === "string";
2474
- }
2475
2670
  function runtimeFilterToCompatibility(node) {
2671
+ const filter = runtimeFilterNodeToCompatibility(node);
2672
+ return filter.type === "group" ? filter : {
2673
+ type: "group",
2674
+ conjunction: "and",
2675
+ children: [filter]
2676
+ };
2677
+ }
2678
+ function runtimeFilterNodeToCompatibility(node) {
2476
2679
  const group = (conjunction, children) => ({
2477
2680
  type: "group",
2478
2681
  conjunction,
2479
2682
  children
2480
2683
  });
2481
- if (node.op === "and" || node.op === "or") return group(node.op, node.args.map(runtimeFilterToCompatibility));
2684
+ if (node.op === "and" || node.op === "or") return group(node.op, node.args.map(runtimeFilterNodeToCompatibility));
2482
2685
  if (node.op === "not") {
2483
- const nested = runtimeFilterToCompatibility(node.arg);
2686
+ const filter = runtimeFilterNodeToCompatibility(node.arg);
2687
+ const nested = filter.type === "group" ? filter : group("and", [filter]);
2484
2688
  return {
2485
2689
  ...nested,
2486
2690
  negated: nested.negated !== true
@@ -2497,23 +2701,32 @@ function runtimeFilterToCompatibility(node) {
2497
2701
  operator: "less-than-or-equal",
2498
2702
  value: node.upper
2499
2703
  }]);
2500
- if (node.op === "has-all") return group("and", [{
2704
+ if (node.op === "has-all") return {
2501
2705
  type: "rule",
2502
2706
  field: node.fieldId,
2503
2707
  operator: "is-all-of",
2504
2708
  value: node.values
2505
- }]);
2709
+ };
2710
+ if (node.op === "in") return group("or", node.values.map((value) => ({
2711
+ type: "rule",
2712
+ field: node.fieldId,
2713
+ operator: "equals",
2714
+ value
2715
+ })));
2716
+ if (node.op === "is-null" || node.op === "is-not-null") return {
2717
+ type: "rule",
2718
+ field: node.fieldId,
2719
+ operator: node.op === "is-null" ? "equals" : "not-equals",
2720
+ value: null
2721
+ };
2506
2722
  const leaf = node;
2507
2723
  const operator = {
2508
- "is-null": "is-empty",
2509
- "is-not-null": "is-not-empty",
2510
2724
  eq: "equals",
2511
2725
  ne: "not-equals",
2512
2726
  lt: "less-than",
2513
2727
  lte: "less-than-or-equal",
2514
2728
  gt: "greater-than",
2515
2729
  gte: "greater-than-or-equal",
2516
- in: "is-any-of",
2517
2730
  contains: "contains",
2518
2731
  "starts-with": "starts-with",
2519
2732
  "ends-with": "ends-with",
@@ -2522,52 +2735,136 @@ function runtimeFilterToCompatibility(node) {
2522
2735
  }[leaf.op];
2523
2736
  if (!operator) throw runtimeError("invalid-query", "Filter operation is unsupported");
2524
2737
  const value = leaf.op === "in" || leaf.op === "has-any" ? leaf.values : leaf.op === "relation-has" ? [leaf.rowId] : "value" in leaf ? leaf.value : void 0;
2525
- return group("and", [{
2738
+ return {
2526
2739
  type: "rule",
2527
2740
  field: leaf.fieldId,
2528
2741
  operator,
2529
2742
  ...value === void 0 ? {} : { value }
2530
- }]);
2743
+ };
2531
2744
  }
2532
- function compatibilityFilterToRuntime(group) {
2533
- return {
2745
+ function compatibilityFilterToRuntime(group, fields = []) {
2746
+ const node = {
2534
2747
  op: group.conjunction,
2535
2748
  args: group.children.map((child) => {
2536
- if (child.type === "group") return compatibilityFilterToRuntime(child);
2537
- const operator = compatibilityOperator(child.operator);
2538
- if (operator === "is-null" || operator === "is-not-null") return {
2539
- op: operator,
2540
- fieldId: child.field
2541
- };
2542
- if (operator === "in") return {
2543
- op: "in",
2544
- fieldId: child.field,
2545
- values: Array.isArray(child.value) ? child.value : [child.value ?? null]
2546
- };
2547
- return {
2548
- op: operator ?? "eq",
2549
- fieldId: child.field,
2550
- value: Array.isArray(child.value) ? child.value[0] : child.value ?? null
2551
- };
2749
+ if (child.type === "group") return compatibilityFilterToRuntime(child, fields);
2750
+ return compatibilityFilterRuleToRuntime(child, fields);
2552
2751
  })
2553
2752
  };
2554
- }
2555
- function compatibilityOperator(operator) {
2556
- switch (operator) {
2557
- case "is-empty": return "is-null";
2558
- case "is-not-empty": return "is-not-null";
2559
- case "equals": return "eq";
2560
- case "not-equals": return "ne";
2561
- case "less-than": return "lt";
2562
- case "less-than-or-equal": return "lte";
2563
- case "greater-than": return "gt";
2564
- case "greater-than-or-equal": return "gte";
2565
- case "contains": return "contains";
2566
- case "starts-with": return "starts-with";
2567
- case "ends-with": return "ends-with";
2568
- case "is-any-of": return "in";
2569
- case "not-contains":
2570
- case "is-none-of": return;
2753
+ return group.negated ? {
2754
+ op: "not",
2755
+ arg: node
2756
+ } : node;
2757
+ }
2758
+ function compatibilityFilterRuleToRuntime(rule, fields) {
2759
+ const field = fields.find((candidate) => candidate.id === rule.field);
2760
+ const type = field ? fieldValueType(field) : void 0;
2761
+ const list = type !== void 0 && runtimeListElementType(type) !== void 0;
2762
+ const values = Array.isArray(rule.value) ? rule.value : [rule.value ?? null];
2763
+ const scalarValue = values[0] ?? null;
2764
+ const equalityValue = list && Array.isArray(rule.value) ? rule.value : scalarValue;
2765
+ const requireValue = () => {
2766
+ if (scalarValue === null) throw runtimeError("corrupt-file", "Stored View filter operand is missing");
2767
+ return scalarValue;
2768
+ };
2769
+ const requireValues = () => {
2770
+ if (values.some((value) => value === null)) throw runtimeError("corrupt-file", "Stored View filter operand is null");
2771
+ return values;
2772
+ };
2773
+ const membership = () => list ? {
2774
+ op: "has-any",
2775
+ fieldId: rule.field,
2776
+ values: requireValues()
2777
+ } : {
2778
+ op: "in",
2779
+ fieldId: rule.field,
2780
+ values: requireValues()
2781
+ };
2782
+ switch (rule.operator) {
2783
+ case "is-empty": return list ? {
2784
+ op: "eq",
2785
+ fieldId: rule.field,
2786
+ value: []
2787
+ } : {
2788
+ op: "is-null",
2789
+ fieldId: rule.field
2790
+ };
2791
+ case "is-not-empty": return list ? {
2792
+ op: "ne",
2793
+ fieldId: rule.field,
2794
+ value: []
2795
+ } : {
2796
+ op: "is-not-null",
2797
+ fieldId: rule.field
2798
+ };
2799
+ case "equals": return equalityValue === null ? {
2800
+ op: "is-null",
2801
+ fieldId: rule.field
2802
+ } : {
2803
+ op: "eq",
2804
+ fieldId: rule.field,
2805
+ value: equalityValue
2806
+ };
2807
+ case "not-equals": return equalityValue === null ? {
2808
+ op: "is-not-null",
2809
+ fieldId: rule.field
2810
+ } : {
2811
+ op: "ne",
2812
+ fieldId: rule.field,
2813
+ value: equalityValue
2814
+ };
2815
+ case "less-than": return {
2816
+ op: "lt",
2817
+ fieldId: rule.field,
2818
+ value: requireValue()
2819
+ };
2820
+ case "less-than-or-equal": return {
2821
+ op: "lte",
2822
+ fieldId: rule.field,
2823
+ value: requireValue()
2824
+ };
2825
+ case "greater-than": return {
2826
+ op: "gt",
2827
+ fieldId: rule.field,
2828
+ value: requireValue()
2829
+ };
2830
+ case "greater-than-or-equal": return {
2831
+ op: "gte",
2832
+ fieldId: rule.field,
2833
+ value: requireValue()
2834
+ };
2835
+ case "contains": return list ? membership() : {
2836
+ op: "contains",
2837
+ fieldId: rule.field,
2838
+ value: String(requireValue())
2839
+ };
2840
+ case "not-contains": return {
2841
+ op: "not",
2842
+ arg: list ? membership() : {
2843
+ op: "contains",
2844
+ fieldId: rule.field,
2845
+ value: String(requireValue())
2846
+ }
2847
+ };
2848
+ case "starts-with": return {
2849
+ op: "starts-with",
2850
+ fieldId: rule.field,
2851
+ value: String(requireValue())
2852
+ };
2853
+ case "ends-with": return {
2854
+ op: "ends-with",
2855
+ fieldId: rule.field,
2856
+ value: String(requireValue())
2857
+ };
2858
+ case "is-any-of": return membership();
2859
+ case "is-all-of": return {
2860
+ op: "has-all",
2861
+ fieldId: rule.field,
2862
+ values: requireValues()
2863
+ };
2864
+ case "is-none-of": return {
2865
+ op: "not",
2866
+ arg: membership()
2867
+ };
2571
2868
  }
2572
2869
  }
2573
2870
  function compatibilityLogicalValue(value, type) {
@@ -2577,12 +2874,24 @@ function compatibilityLogicalValue(value, type) {
2577
2874
  if (!Array.isArray(parsed)) return null;
2578
2875
  return parsed.map((entry) => compatibilityLogicalValue(entry, type.element));
2579
2876
  }
2580
- if (typeof value === "string" && typeof type === "string" && [
2581
- "file",
2582
- "multi-select",
2583
- "relation"
2584
- ].includes(type)) return JSON.parse(value);
2585
- if (typeof value === "string" && type === "file-entry") return JSON.parse(value);
2877
+ if (typeof value === "string" && typeof type === "string" && ["multi-select", "relation"].includes(type)) return JSON.parse(value);
2878
+ if (type === "file") try {
2879
+ return typeof value === "string" ? decodeEidosFileValues(value) : assertEidosFileValues(value);
2880
+ } catch {
2881
+ throw runtimeError("corrupt-file", "Stored File value is invalid");
2882
+ }
2883
+ if (typeof value === "string" && type === "file-entry") try {
2884
+ const parsed = JSON.parse(value);
2885
+ if (canonicalizeEidosFileJson(parsed) !== value) throw new Error();
2886
+ return assertEidosFileValues([parsed])[0];
2887
+ } catch {
2888
+ throw runtimeError("corrupt-file", "Stored File entry is invalid");
2889
+ }
2890
+ if (type === "file-entry") try {
2891
+ return assertEidosFileValues([value])[0];
2892
+ } catch {
2893
+ throw runtimeError("corrupt-file", "Stored File entry is invalid");
2894
+ }
2586
2895
  if (type === "checkbox" && typeof value === "number") return value === 1;
2587
2896
  if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) || typeof value === "object" && value !== null) return value;
2588
2897
  return null;
@@ -2992,6 +3301,7 @@ function assertAggregateItems(items, fieldsById) {
2992
3301
  if (!item.key || keys.has(item.key)) throw runtimeError("invalid-request", "Aggregate keys must be non-empty and unique");
2993
3302
  keys.add(item.key);
2994
3303
  if (item.op !== "count-all" && !fieldsById.has(item.fieldId)) throw runtimeError("not-found", "Aggregate Field not found", { fieldId: item.fieldId });
3304
+ if (item.op === "distinct-values" && (!Number.isInteger(item.limit) || item.limit < 1 || item.limit > EIDOS_RUNTIME_LIMITS.pageSizeMax)) throw runtimeError("invalid-request", "Distinct value limit exceeds pageSizeMax", { fieldId: item.fieldId });
2995
3305
  }
2996
3306
  }
2997
3307
  function aggregateResultsForRows(items, fieldsById, rows) {
@@ -3075,6 +3385,14 @@ function aggregateItemResult(item, valueType, values) {
3075
3385
  key: item.key,
3076
3386
  value: String(distinct.size)
3077
3387
  };
3388
+ if (item.op === "distinct-values") {
3389
+ const ordered = Array.from(distinct.values()).sort((left, right) => compareAggregateValues(left, right, valueType));
3390
+ return {
3391
+ key: item.key,
3392
+ values: ordered.slice(0, item.limit).map((value) => publicAggregateValue(value, valueType)),
3393
+ truncated: ordered.length > item.limit
3394
+ };
3395
+ }
3078
3396
  const sortable = typeof valueType === "string" && isSortableType(valueType);
3079
3397
  const numeric = valueType === "integer" || valueType === "number";
3080
3398
  if ((item.op === "sum" || item.op === "average") && !numeric) throw runtimeError("invalid-request", `${item.op} requires an Integer or Number Field`, { fieldId: item.fieldId });
@@ -3232,6 +3550,6 @@ function jcsByteLength(value) {
3232
3550
  return new TextEncoder().encode(canonicalizeEidosFileJson(value)).byteLength;
3233
3551
  }
3234
3552
  //#endregion
3235
- export { AdapterTransportRuntimeClient, AdapterTransportServer, ConnectionPortEidosFileConnection, EIDOS_ADAPTER_TRANSPORT_LIMITS, EIDOS_FILE_APPLICATION_ID, EIDOS_FILE_CSV_INFERENCE_ROW_COUNT, EIDOS_FILE_CSV_PREVIEW_ROW_COUNT, EIDOS_FILE_EXTENSION, EIDOS_FILE_FEATURES_TABLE, EIDOS_FILE_FIELDS_TABLE, EIDOS_FILE_FORMAT, EIDOS_FILE_FORMAT_VERSION, EIDOS_FILE_FORMAT_VERSION_TEXT, EIDOS_FILE_FORMULA_FIELDS_TABLE, EIDOS_FILE_FORMULA_FIELD_FUNCTION_NAMES, EIDOS_FILE_FORMULA_FUNCTION_NAMES, EIDOS_FILE_LOOKUP_FIELDS_TABLE, EIDOS_FILE_META_TABLE, EIDOS_FILE_MIME_TYPE, EIDOS_FILE_RELATION_FIELDS_TABLE, EIDOS_FILE_REQUIRED_TABLES, EIDOS_FILE_SCHEMA_SQL, EIDOS_FILE_SCHEMA_VERSION, EIDOS_FILE_SYSTEM_COLUMNS, EIDOS_FILE_TABLES_TABLE, EIDOS_FILE_VIEWS_TABLE, EIDOS_RUNTIME_LIMITS, EidosAdapterError, EidosFileError, EidosFileHandlerRegistry, EidosFileHostError, EidosFileRuntime, EidosFileRuntimeDataSource, EidosFileSession, EidosRuntimeService, EidosUuidV7Generator, MUTABLE_BASE_FIELD_TYPES, MemoryByteSource, Runtime, SQLITE_HEADER, SQLiteWasmConnectionPort, assertEidosFileColumnName, assertEidosFileDisplayName, assertEidosFileRowQuery, assertEidosFileSelectOptions, assertEidosFileTableId, assertEidosFileUuid, assertEidosFileValues, assertInt64Decimal, assertUnicodeString, cancellationPortFromSignal, canonicalizeEidosFileJson, compileEidosFileFormula, compileEidosFileFormulaFields, compileEidosFileFormulaSource, compileEidosFileRowQuery, configureEidosFileConnection, createEidosFileCsvImportPlan, createEidosFileCsvRowEncoder, createEidosFileIdentifier, createEidosFileUuid, currentEidosFileInstant, decodeEidosFileAttachmentPaths, decodeEidosFileJsonArray, decodeEidosFileMultiSelectValues, decodeEidosFileRelationDisplay, decodeEidosFileRelationIds, decodeEidosFileStringArray, decodeEidosFileValues, eidosFileColumnStatLabel, eidosFileColumnStatTypesForField, eidosFileCsvExportHeader, eidosFileCsvRowToEidosFileRow, eidosFileFieldDisplayValues, eidosFileFieldStoresJsonArray, eidosFileFormulaReferences, eidosFileLookupAggregateSupportsTarget, eidosFileLookupDisplayType, eidosFileLookupElementType, eidosFileLookupStorageCodec, eidosFileLookupTargetDisplayType, eidosFileLookupTargetValueType, eidosFileLookupValueType, eidosFilePhysicalName, eidosFileRowQueryAffectedByFieldChanges, eidosFileRowQueryPredicateColumns, eidosFileSnapshot, eidosFileSortExpression, eidosFileTypeHandler, encodeEidosFileAttachmentPaths, encodeEidosFileCsvRecord, encodeEidosFileJsonArray, encodeEidosFileMultiSelectValues, encodeEidosFileRelationIds, encodeEidosFileValues, hasEidosFileSqliteHeader, importEidosFileCsv, incrementEidosFileRevision, initializeEidosFileSchema, isCanonicalEidosFileDate, isCanonicalEidosFileInstant, isCanonicalEidosFileJson, isEidosFileUuid, isMutableEidosFileFieldType, isSafeEidosFileUri, nativeToSqlValue, normalizeEidosFileAttachmentPath, normalizeEidosFileDate, normalizeEidosFileFilter, normalizeEidosFileInstant, normalizeEidosFileRowQuery, normalizeEidosFileSorts, parseEidosFileCsvRows, parseEidosFileJson, parseEidosFileSelectOptions, parseNonNegativeInt64, planCanonicalFieldConversion, planEidosFileCsvImport, planEidosFileFieldConversion, prepareEidosFileCsvImport, quoteIdentifier, rawTableNameForId, removeEidosFileFilterField, rewriteEidosFileFormulaFieldReferences, setEidosFileMetadata, sqlValueToNative, transportFitsHostLimit, validateAdapterCarrier, validateAdapterEnvelope, validateEidosFile };
3553
+ export { AdapterTransportRuntimeClient, AdapterTransportServer, ConnectionPortEidosFileConnection, EIDOS_ADAPTER_TRANSPORT_LIMITS, EIDOS_FILE_APPLICATION_ID, EIDOS_FILE_CSV_INFERENCE_ROW_COUNT, EIDOS_FILE_CSV_PREVIEW_ROW_COUNT, EIDOS_FILE_EXTENSION, EIDOS_FILE_FEATURES_TABLE, EIDOS_FILE_FIELDS_TABLE, EIDOS_FILE_FORMAT, EIDOS_FILE_FORMAT_VERSION, EIDOS_FILE_FORMAT_VERSION_TEXT, EIDOS_FILE_FORMULA_FIELDS_TABLE, EIDOS_FILE_FORMULA_FIELD_FUNCTION_NAMES, EIDOS_FILE_FORMULA_FUNCTION_NAMES, EIDOS_FILE_LOOKUP_FIELDS_TABLE, EIDOS_FILE_META_TABLE, EIDOS_FILE_MIME_TYPE, EIDOS_FILE_RELATION_FIELDS_TABLE, EIDOS_FILE_REQUIRED_TABLES, EIDOS_FILE_SCHEMA_SQL, EIDOS_FILE_SCHEMA_VERSION, EIDOS_FILE_SYSTEM_COLUMNS, EIDOS_FILE_TABLES_TABLE, EIDOS_FILE_VIEWS_TABLE, EIDOS_RUNTIME_LIMITS, EidosAdapterError, EidosFileError, EidosFileHandlerRegistry, EidosFileHostError, EidosFileRuntime, EidosFileRuntimeDataSource, EidosFileSession, EidosRuntimeService, EidosUuidV7Generator, MUTABLE_BASE_FIELD_TYPES, MemoryByteSource, Runtime, SQLITE_HEADER, SQLiteWasmConnectionPort, assertEidosFileColumnName, assertEidosFileDisplayName, assertEidosFileRowQuery, assertEidosFileSelectOptions, assertEidosFileTableId, assertEidosFileTableName, assertEidosFileUuid, assertEidosFileValues, assertInt64Decimal, assertUnicodeString, cancellationPortFromSignal, canonicalizeEidosFileJson, compileEidosFileFormula, compileEidosFileFormulaFields, compileEidosFileFormulaSource, compileEidosFileRowQuery, configureEidosFileConnection, createEidosFileCsvImportPlan, createEidosFileCsvRowEncoder, createEidosFileIdentifier, createEidosFileUuid, currentEidosFileInstant, decodeEidosFileAttachmentPaths, decodeEidosFileJsonArray, decodeEidosFileMultiSelectValues, decodeEidosFileRelationDisplay, decodeEidosFileRelationIds, decodeEidosFileStringArray, decodeEidosFileValues, eidosFileColumnStatLabel, eidosFileColumnStatTypesForField, eidosFileConversionCanReusePhysicalColumn, eidosFileConversionTargetNullable, eidosFileCsvExportHeader, eidosFileCsvRowToEidosFileRow, eidosFileFieldConversionMayRequireLossyConfirmation, eidosFileFieldDisplayValues, eidosFileFieldStoresJsonArray, eidosFileFormulaReferences, eidosFileLookupAggregateSupportsTarget, eidosFileLookupDisplayType, eidosFileLookupElementType, eidosFileLookupStorageCodec, eidosFileLookupTargetDisplayType, eidosFileLookupTargetValueType, eidosFileLookupValueType, eidosFileRowQueryAffectedByFieldChanges, eidosFileRowQueryPredicateColumns, eidosFileSnapshot, eidosFileSortExpression, eidosFileTypeHandler, eidosFileUriClass, encodeEidosFileAttachmentPaths, encodeEidosFileCsvRecord, encodeEidosFileJsonArray, encodeEidosFileMultiSelectValues, encodeEidosFileRelationIds, encodeEidosFileValues, hasEidosFileSqliteHeader, importEidosFileCsv, incrementEidosFileRevision, initializeEidosFileSchema, isCanonicalEidosFileDate, isCanonicalEidosFileInstant, isCanonicalEidosFileJson, isEidosFileReservedTableName, isEidosFileUuid, isMutableEidosFileFieldType, isSafeEidosFileUri, nativeToSqlValue, normalizeEidosFileAttachmentPath, normalizeEidosFileDate, normalizeEidosFileFilter, normalizeEidosFileInstant, normalizeEidosFileRowQuery, normalizeEidosFileSorts, parseEidosFileCsvRows, parseEidosFileJson, parseEidosFileSelectOptions, parseNonNegativeInt64, planCanonicalFieldConversion, planEidosFileCsvImport, planEidosFileFieldConversion, prepareEidosFileCsvImport, quoteIdentifier, recommendedEidosFileConversionPolicies, removeEidosFileFilterField, rewriteEidosFileFormulaFieldReferences, setEidosFileMetadata, sqlValueToNative, transportFitsHostLimit, validateAdapterCarrier, validateAdapterEnvelope, validateEidosFile };
3236
3554
 
3237
3555
  //# sourceMappingURL=index.mjs.map