@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.
- package/FIELD-CONVERSION.md +40 -19
- package/dist/adapter-contract-SrPzXysz.d.mts +281 -0
- package/dist/adapter-contract-SrPzXysz.d.mts.map +1 -0
- package/dist/better-sqlite3.d.mts +2 -2
- package/dist/better-sqlite3.mjs +1 -1
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +2 -2
- package/dist/{csv-BVaUkU1o.mjs → csv-NK8Rti5O.mjs} +38 -7
- package/dist/csv-NK8Rti5O.mjs.map +1 -0
- package/dist/csv.d.mts +1 -1
- package/dist/csv.d.mts.map +1 -1
- package/dist/csv.mjs +1 -1
- package/dist/index.d.mts +57 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +66 -499
- package/dist/index.mjs.map +1 -1
- package/dist/node-sqlite.d.mts +3 -3
- package/dist/node-sqlite.d.mts.map +1 -1
- package/dist/node-sqlite.mjs +10 -4
- package/dist/node-sqlite.mjs.map +1 -1
- package/dist/runtime-CUCgAnbo.d.mts +1682 -0
- package/dist/runtime-CUCgAnbo.d.mts.map +1 -0
- package/dist/{runtime-D9Vp-lxn.mjs → runtime-CrsC-uwG.mjs} +1390 -293
- package/dist/runtime-CrsC-uwG.mjs.map +1 -0
- package/dist/{sqlite-wasm-DzuW0TZZ.mjs → sqlite-wasm-BQqcna0d.mjs} +9 -2
- package/dist/sqlite-wasm-BQqcna0d.mjs.map +1 -0
- package/dist/{system-metadata-merge-DeHwokcY.d.mts → system-metadata-merge-BY7ebqnp.d.mts} +2 -2
- package/dist/{system-metadata-merge-DeHwokcY.d.mts.map → system-metadata-merge-BY7ebqnp.d.mts.map} +1 -1
- package/dist/{system-metadata-merge-DJ9yCprr.mjs → system-metadata-merge-CVa87L1C.mjs} +2 -2
- package/dist/{system-metadata-merge-DJ9yCprr.mjs.map → system-metadata-merge-CVa87L1C.mjs.map} +1 -1
- package/dist/{temporal-CnuhXeP8.d.mts → temporal-BMFnxGcx.d.mts} +6 -3
- package/dist/temporal-BMFnxGcx.d.mts.map +1 -0
- package/package.json +3 -3
- package/dist/adapter-contract-CNigdeQ7.d.mts +0 -1137
- package/dist/adapter-contract-CNigdeQ7.d.mts.map +0 -1
- package/dist/csv-BVaUkU1o.mjs.map +0 -1
- package/dist/runtime-BSYpcOBe.d.mts +0 -801
- package/dist/runtime-BSYpcOBe.d.mts.map +0 -1
- package/dist/runtime-D9Vp-lxn.mjs.map +0 -1
- package/dist/sqlite-wasm-DzuW0TZZ.mjs.map +0 -1
- package/dist/temporal-CnuhXeP8.d.mts.map +0 -1
|
@@ -1,1137 +0,0 @@
|
|
|
1
|
-
import { At as ByteSource, Bt as RequestContext, Ft as JsonObject, It as JsonValue, Nt as ClockPort, Pt as EntropyPort, Rt as OwnedBytes, jt as CancellationPort } from "./runtime-BSYpcOBe.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/runtime-contract.d.ts
|
|
4
|
-
interface FileEntry extends JsonObject {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
mediaType: string;
|
|
8
|
-
size: string;
|
|
9
|
-
uri: string;
|
|
10
|
-
}
|
|
11
|
-
type Revision = string;
|
|
12
|
-
type ScalarType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url" | "json" | "select" | "multi-select" | "file" | "relation";
|
|
13
|
-
type AtomicType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url" | "select" | "row-id" | "file-entry";
|
|
14
|
-
type TypeRef = ScalarType | "row-id" | "file-entry" | {
|
|
15
|
-
kind: "list";
|
|
16
|
-
element: AtomicType;
|
|
17
|
-
};
|
|
18
|
-
type LogicalValue = null | boolean | number | string | FileEntry | LogicalValue[];
|
|
19
|
-
interface RuntimeEnvironment {
|
|
20
|
-
clock: ClockPort;
|
|
21
|
-
entropy: EntropyPort;
|
|
22
|
-
transportCommitBarrier?: TransportCommitBarrier;
|
|
23
|
-
}
|
|
24
|
-
interface RuntimeFactoryContext {
|
|
25
|
-
cancellation: CancellationPort;
|
|
26
|
-
deadlineMilliseconds?: number;
|
|
27
|
-
}
|
|
28
|
-
interface RuntimeCreateInput {
|
|
29
|
-
title: string;
|
|
30
|
-
fileId?: string;
|
|
31
|
-
createdAt?: string;
|
|
32
|
-
}
|
|
33
|
-
interface RuntimeBinding {
|
|
34
|
-
service: RuntimeService;
|
|
35
|
-
hostBridge: RuntimeHostBridge;
|
|
36
|
-
}
|
|
37
|
-
interface RuntimeHostBridge {
|
|
38
|
-
allocateFileEntry(request: {
|
|
39
|
-
name: string;
|
|
40
|
-
mediaType: string;
|
|
41
|
-
size: string;
|
|
42
|
-
uri: string;
|
|
43
|
-
extensions?: Record<string, JsonValue>;
|
|
44
|
-
}, context: RequestContext): Promise<FileEntry>;
|
|
45
|
-
createPublicationSnapshot(request: {
|
|
46
|
-
maxBytes: string;
|
|
47
|
-
}, context: RequestContext): Promise<RuntimePublicationSnapshot>;
|
|
48
|
-
}
|
|
49
|
-
interface RuntimePublicationSnapshot {
|
|
50
|
-
fileId: string;
|
|
51
|
-
revision: string;
|
|
52
|
-
bytes: ByteSource;
|
|
53
|
-
release(): Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
interface RuntimeCapabilities {
|
|
56
|
-
readRows: boolean;
|
|
57
|
-
schemaPaging: boolean;
|
|
58
|
-
cursorPaging: boolean;
|
|
59
|
-
aggregate: boolean;
|
|
60
|
-
groupRows: boolean;
|
|
61
|
-
formulaPreview: boolean;
|
|
62
|
-
mutateRows: boolean;
|
|
63
|
-
mutationUndo: boolean;
|
|
64
|
-
mutateView: boolean;
|
|
65
|
-
schemaPreflight: boolean;
|
|
66
|
-
mutateSchema: boolean;
|
|
67
|
-
validate: boolean;
|
|
68
|
-
events: boolean;
|
|
69
|
-
csvExport: boolean;
|
|
70
|
-
csvImport: boolean;
|
|
71
|
-
}
|
|
72
|
-
interface RuntimeLimits {
|
|
73
|
-
requestBytesMax: number;
|
|
74
|
-
responseBytesMax: number;
|
|
75
|
-
schemaPageSizeMax: number;
|
|
76
|
-
pageSizeMax: number;
|
|
77
|
-
projectionFieldsMax: number;
|
|
78
|
-
rowsByIdMax: number;
|
|
79
|
-
mutationRowsMax: number;
|
|
80
|
-
mutationCellsMax: number;
|
|
81
|
-
mutationBytesMax: number;
|
|
82
|
-
aggregateItemsMax: number;
|
|
83
|
-
groupPageSizeMax: number;
|
|
84
|
-
formulaPreviewRowsMax: number;
|
|
85
|
-
filterDepthMax: number;
|
|
86
|
-
filterNodesMax: number;
|
|
87
|
-
sortFieldsMax: number;
|
|
88
|
-
groupFieldsMax: number;
|
|
89
|
-
searchBytesMax: number;
|
|
90
|
-
listElementsMax: number;
|
|
91
|
-
logicalValueBytesMax: number;
|
|
92
|
-
formulaBytesMax: number;
|
|
93
|
-
formulaNodesMax: number;
|
|
94
|
-
formulaDepthMax: number;
|
|
95
|
-
diagnosticsMax: number;
|
|
96
|
-
foregroundTimeMsMax: number;
|
|
97
|
-
csvBytesMax: number;
|
|
98
|
-
schemaPlanEntriesMax: number;
|
|
99
|
-
schemaPlanBytesMax: number;
|
|
100
|
-
undoEntriesMax: number;
|
|
101
|
-
undoBytesMax: number;
|
|
102
|
-
}
|
|
103
|
-
type RuntimeErrorCode = "invalid-request" | "unsupported" | "not-found" | "already-exists" | "invalid-value" | "invalid-query" | "invalid-formula" | "cycle" | "constraint" | "stale-revision" | "conflict" | "forbidden" | "lossy-confirmation-required" | "invalid-plan" | "plan-expired" | "resource-limit" | "cancelled" | "deadline-exceeded" | "busy" | "corrupt-file" | "adapter-error" | "unknown-commit" | "closed" | "fatal";
|
|
104
|
-
interface RuntimeError {
|
|
105
|
-
code: RuntimeErrorCode;
|
|
106
|
-
message: string;
|
|
107
|
-
retryable: boolean;
|
|
108
|
-
path?: string;
|
|
109
|
-
fileId?: string;
|
|
110
|
-
tableId?: string;
|
|
111
|
-
fieldId?: string;
|
|
112
|
-
rowId?: string;
|
|
113
|
-
currentRevision?: string;
|
|
114
|
-
details?: JsonObject;
|
|
115
|
-
}
|
|
116
|
-
interface RuntimeSnapshot {
|
|
117
|
-
fileId: string;
|
|
118
|
-
format: {
|
|
119
|
-
major: 1;
|
|
120
|
-
minor: 0;
|
|
121
|
-
};
|
|
122
|
-
revision: string;
|
|
123
|
-
title: string;
|
|
124
|
-
defaultTableId: string | null;
|
|
125
|
-
schemaCounts: {
|
|
126
|
-
tables: string;
|
|
127
|
-
fields: string;
|
|
128
|
-
views: string;
|
|
129
|
-
features: string;
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
interface TableDescriptor {
|
|
133
|
-
object: "table";
|
|
134
|
-
id: string;
|
|
135
|
-
name: string;
|
|
136
|
-
labelFieldId: string;
|
|
137
|
-
position: string;
|
|
138
|
-
settings: JsonObject;
|
|
139
|
-
}
|
|
140
|
-
interface FieldDescriptor {
|
|
141
|
-
object: "field";
|
|
142
|
-
id: string;
|
|
143
|
-
tableId: string;
|
|
144
|
-
name: string;
|
|
145
|
-
kind: ScalarType | "formula" | "lookup";
|
|
146
|
-
valueType: TypeRef;
|
|
147
|
-
systemRole: "row-id" | "created-time" | "updated-time" | null;
|
|
148
|
-
nullable: boolean;
|
|
149
|
-
position: string;
|
|
150
|
-
settings: JsonObject;
|
|
151
|
-
writable: boolean;
|
|
152
|
-
definition?: RelationDefinition | FormulaDefinition | LookupDefinition;
|
|
153
|
-
}
|
|
154
|
-
interface ViewDescriptor {
|
|
155
|
-
object: "view";
|
|
156
|
-
id: string;
|
|
157
|
-
tableId: string;
|
|
158
|
-
name: string;
|
|
159
|
-
type: string;
|
|
160
|
-
/** Absent means supported for compatibility with older Runtime transports. */
|
|
161
|
-
queryStatus?: "supported" | "unsupported";
|
|
162
|
-
query: SavedViewQuery;
|
|
163
|
-
layout: JsonObject;
|
|
164
|
-
position: string;
|
|
165
|
-
}
|
|
166
|
-
interface FeatureDescriptor {
|
|
167
|
-
object: "feature";
|
|
168
|
-
name: string;
|
|
169
|
-
version: string;
|
|
170
|
-
required: boolean;
|
|
171
|
-
config: JsonObject;
|
|
172
|
-
}
|
|
173
|
-
type SchemaDescriptor = TableDescriptor | FieldDescriptor | ViewDescriptor | FeatureDescriptor;
|
|
174
|
-
interface GetSchemaPageRequest {
|
|
175
|
-
revision: string;
|
|
176
|
-
limit: number;
|
|
177
|
-
cursor?: string;
|
|
178
|
-
}
|
|
179
|
-
interface SchemaPage {
|
|
180
|
-
fileId: string;
|
|
181
|
-
revision: string;
|
|
182
|
-
objects: SchemaDescriptor[];
|
|
183
|
-
nextCursor: string | null;
|
|
184
|
-
}
|
|
185
|
-
interface ProjectionSpec {
|
|
186
|
-
fields: string[];
|
|
187
|
-
resolveRelations: string[];
|
|
188
|
-
}
|
|
189
|
-
interface ColumnDescriptor {
|
|
190
|
-
fieldId: string;
|
|
191
|
-
name: string;
|
|
192
|
-
valueType: TypeRef;
|
|
193
|
-
source: "stored" | "formula" | "lookup" | "inverse-relation";
|
|
194
|
-
writable: boolean;
|
|
195
|
-
}
|
|
196
|
-
interface ProjectedRow {
|
|
197
|
-
id: string;
|
|
198
|
-
values: LogicalValue[];
|
|
199
|
-
resolvedRelations?: Array<{
|
|
200
|
-
column: number;
|
|
201
|
-
items: ResolvedRelationItem[];
|
|
202
|
-
}>;
|
|
203
|
-
}
|
|
204
|
-
type ResolvedRelationItem = {
|
|
205
|
-
id: string;
|
|
206
|
-
state: "unresolved";
|
|
207
|
-
} | {
|
|
208
|
-
id: string;
|
|
209
|
-
state: "resolved";
|
|
210
|
-
labelFieldId: string;
|
|
211
|
-
labelType: TypeRef;
|
|
212
|
-
label: LogicalValue;
|
|
213
|
-
};
|
|
214
|
-
interface RowPage {
|
|
215
|
-
fileId: string;
|
|
216
|
-
tableId: string;
|
|
217
|
-
revision: string;
|
|
218
|
-
projectionHash: string;
|
|
219
|
-
columns: ColumnDescriptor[];
|
|
220
|
-
rows: ProjectedRow[];
|
|
221
|
-
nextCursor: string | null;
|
|
222
|
-
previousCursor: string | null;
|
|
223
|
-
}
|
|
224
|
-
interface RowBatch {
|
|
225
|
-
fileId: string;
|
|
226
|
-
tableId: string;
|
|
227
|
-
revision: string;
|
|
228
|
-
projectionHash: string;
|
|
229
|
-
columns: ColumnDescriptor[];
|
|
230
|
-
rows: ProjectedRow[];
|
|
231
|
-
missingRowIds: string[];
|
|
232
|
-
}
|
|
233
|
-
interface RowQuery {
|
|
234
|
-
filter?: FilterNode;
|
|
235
|
-
search?: {
|
|
236
|
-
text: string;
|
|
237
|
-
fields: string[];
|
|
238
|
-
};
|
|
239
|
-
sort?: Array<{
|
|
240
|
-
fieldId: string;
|
|
241
|
-
direction: "asc" | "desc";
|
|
242
|
-
nulls?: "first" | "last";
|
|
243
|
-
}>;
|
|
244
|
-
}
|
|
245
|
-
type FilterOperand = Exclude<LogicalValue, null>;
|
|
246
|
-
type FilterNode = {
|
|
247
|
-
op: "and" | "or";
|
|
248
|
-
args: FilterNode[];
|
|
249
|
-
} | {
|
|
250
|
-
op: "not";
|
|
251
|
-
arg: FilterNode;
|
|
252
|
-
} | {
|
|
253
|
-
op: "is-null" | "is-not-null";
|
|
254
|
-
fieldId: string;
|
|
255
|
-
} | {
|
|
256
|
-
op: "eq" | "ne" | "lt" | "lte" | "gt" | "gte";
|
|
257
|
-
fieldId: string;
|
|
258
|
-
value: FilterOperand;
|
|
259
|
-
} | {
|
|
260
|
-
op: "between";
|
|
261
|
-
fieldId: string;
|
|
262
|
-
lower: FilterOperand;
|
|
263
|
-
upper: FilterOperand;
|
|
264
|
-
} | {
|
|
265
|
-
op: "in";
|
|
266
|
-
fieldId: string;
|
|
267
|
-
values: FilterOperand[];
|
|
268
|
-
} | {
|
|
269
|
-
op: "contains" | "starts-with" | "ends-with";
|
|
270
|
-
fieldId: string;
|
|
271
|
-
value: string;
|
|
272
|
-
} | {
|
|
273
|
-
op: "has-any" | "has-all";
|
|
274
|
-
fieldId: string;
|
|
275
|
-
values: FilterOperand[];
|
|
276
|
-
} | {
|
|
277
|
-
op: "relation-has";
|
|
278
|
-
fieldId: string;
|
|
279
|
-
rowId: string;
|
|
280
|
-
} | {
|
|
281
|
-
op: "relative-date";
|
|
282
|
-
fieldId: string;
|
|
283
|
-
direction: "past" | "next" | "this";
|
|
284
|
-
unit: "day" | "week" | "month" | "year";
|
|
285
|
-
};
|
|
286
|
-
interface QueryRowsRequest {
|
|
287
|
-
tableId: string;
|
|
288
|
-
query: RowQuery;
|
|
289
|
-
projection: ProjectionSpec;
|
|
290
|
-
limit: number;
|
|
291
|
-
offset?: number;
|
|
292
|
-
cursor?: string;
|
|
293
|
-
direction?: "forward" | "backward";
|
|
294
|
-
}
|
|
295
|
-
interface AggregateRequest {
|
|
296
|
-
tableId: string;
|
|
297
|
-
query?: RowQuery;
|
|
298
|
-
items: AggregateItem[];
|
|
299
|
-
}
|
|
300
|
-
type AggregateItem = {
|
|
301
|
-
key: string;
|
|
302
|
-
op: "count-all";
|
|
303
|
-
} | {
|
|
304
|
-
key: string;
|
|
305
|
-
op: "distinct-values";
|
|
306
|
-
fieldId: string;
|
|
307
|
-
limit: number;
|
|
308
|
-
} | {
|
|
309
|
-
key: string;
|
|
310
|
-
op: "count" | "distinct-count" | "sum" | "average" | "min" | "max";
|
|
311
|
-
fieldId: string;
|
|
312
|
-
} | {
|
|
313
|
-
key: string;
|
|
314
|
-
op: "statistics";
|
|
315
|
-
fieldId: string;
|
|
316
|
-
};
|
|
317
|
-
type AggregateResult = {
|
|
318
|
-
key: string;
|
|
319
|
-
value: LogicalValue;
|
|
320
|
-
} | {
|
|
321
|
-
key: string;
|
|
322
|
-
values: LogicalValue[];
|
|
323
|
-
truncated: boolean;
|
|
324
|
-
} | {
|
|
325
|
-
key: string;
|
|
326
|
-
statistics: ColumnStatistics;
|
|
327
|
-
};
|
|
328
|
-
interface AggregateResponse {
|
|
329
|
-
fileId: string;
|
|
330
|
-
tableId: string;
|
|
331
|
-
revision: string;
|
|
332
|
-
results: AggregateResult[];
|
|
333
|
-
}
|
|
334
|
-
interface ColumnStatistics {
|
|
335
|
-
rows: string;
|
|
336
|
-
nulls: string;
|
|
337
|
-
distinct: string;
|
|
338
|
-
min?: LogicalValue;
|
|
339
|
-
max?: LogicalValue;
|
|
340
|
-
sum?: LogicalValue;
|
|
341
|
-
average?: number | null;
|
|
342
|
-
}
|
|
343
|
-
interface GroupRequest {
|
|
344
|
-
tableId: string;
|
|
345
|
-
query: RowQuery;
|
|
346
|
-
groupBy: string[];
|
|
347
|
-
aggregates: AggregateItem[];
|
|
348
|
-
projection: ProjectionSpec;
|
|
349
|
-
groupLimit: number;
|
|
350
|
-
rowsPerGroup: number;
|
|
351
|
-
cursor?: string;
|
|
352
|
-
direction?: "forward" | "backward";
|
|
353
|
-
}
|
|
354
|
-
interface GroupPage {
|
|
355
|
-
fileId: string;
|
|
356
|
-
tableId: string;
|
|
357
|
-
revision: string;
|
|
358
|
-
projectionHash: string;
|
|
359
|
-
columns: ColumnDescriptor[];
|
|
360
|
-
groups: Array<{
|
|
361
|
-
key: LogicalValue[];
|
|
362
|
-
count: string;
|
|
363
|
-
aggregates: AggregateResult[];
|
|
364
|
-
rows: ProjectedRow[];
|
|
365
|
-
nextRowCursor: string | null;
|
|
366
|
-
}>;
|
|
367
|
-
nextCursor: string | null;
|
|
368
|
-
previousCursor: string | null;
|
|
369
|
-
}
|
|
370
|
-
interface GroupRowsRequest {
|
|
371
|
-
cursor: string;
|
|
372
|
-
limit: number;
|
|
373
|
-
direction?: "forward" | "backward";
|
|
374
|
-
}
|
|
375
|
-
interface GroupRowPage {
|
|
376
|
-
fileId: string;
|
|
377
|
-
tableId: string;
|
|
378
|
-
revision: string;
|
|
379
|
-
projectionHash: string;
|
|
380
|
-
columns: ColumnDescriptor[];
|
|
381
|
-
groupKey: LogicalValue[];
|
|
382
|
-
rows: ProjectedRow[];
|
|
383
|
-
nextCursor: string | null;
|
|
384
|
-
previousCursor: string | null;
|
|
385
|
-
}
|
|
386
|
-
interface ForwardRelationDefinition {
|
|
387
|
-
direction: "forward";
|
|
388
|
-
targetTableId: string;
|
|
389
|
-
cardinality: "one" | "many";
|
|
390
|
-
onDelete: "restrict" | "detach" | "preserve";
|
|
391
|
-
}
|
|
392
|
-
interface InverseRelationDefinition {
|
|
393
|
-
direction: "inverse";
|
|
394
|
-
targetTableId: string;
|
|
395
|
-
cardinality: "many";
|
|
396
|
-
inverseOfFieldId: string;
|
|
397
|
-
}
|
|
398
|
-
type RelationDefinition = ForwardRelationDefinition | InverseRelationDefinition;
|
|
399
|
-
type FormulaResultType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url";
|
|
400
|
-
interface FormulaDefinition {
|
|
401
|
-
sourceText: string;
|
|
402
|
-
resultType: FormulaResultType;
|
|
403
|
-
}
|
|
404
|
-
interface FormulaPreviewRequest {
|
|
405
|
-
tableId: string;
|
|
406
|
-
fieldId?: string;
|
|
407
|
-
candidateName?: string;
|
|
408
|
-
sourceText: string;
|
|
409
|
-
declaredResultType: FormulaResultType;
|
|
410
|
-
rowIds?: string[];
|
|
411
|
-
}
|
|
412
|
-
interface FormulaPreviewResult {
|
|
413
|
-
fileId: string;
|
|
414
|
-
revision: string;
|
|
415
|
-
valid: boolean;
|
|
416
|
-
inferredType?: FormulaResultType;
|
|
417
|
-
dependencies?: string[];
|
|
418
|
-
rows?: Array<{
|
|
419
|
-
rowId: string;
|
|
420
|
-
value?: LogicalValue;
|
|
421
|
-
error?: RuntimeError;
|
|
422
|
-
}>;
|
|
423
|
-
diagnostics: RuntimeDiagnostic[];
|
|
424
|
-
diagnosticsTruncated: boolean;
|
|
425
|
-
}
|
|
426
|
-
interface LookupDefinition {
|
|
427
|
-
relationFieldId: string;
|
|
428
|
-
targetFieldId: string;
|
|
429
|
-
aggregate: "values" | "first" | "count" | "sum" | "average" | "min" | "max";
|
|
430
|
-
distinctValues: boolean;
|
|
431
|
-
}
|
|
432
|
-
interface RowMutation {
|
|
433
|
-
tableId: string;
|
|
434
|
-
expectedRevision: string;
|
|
435
|
-
returning?: ProjectionSpec;
|
|
436
|
-
changes: RowChange[];
|
|
437
|
-
}
|
|
438
|
-
type RowChange = {
|
|
439
|
-
kind: "create";
|
|
440
|
-
clientKey: string;
|
|
441
|
-
values: Record<string, LogicalValue>;
|
|
442
|
-
} | {
|
|
443
|
-
kind: "update";
|
|
444
|
-
rowId: string;
|
|
445
|
-
values: Record<string, LogicalValue>;
|
|
446
|
-
} | {
|
|
447
|
-
kind: "delete";
|
|
448
|
-
rowId: string;
|
|
449
|
-
};
|
|
450
|
-
interface MutationResult {
|
|
451
|
-
fileId: string;
|
|
452
|
-
revision: string;
|
|
453
|
-
changed: boolean;
|
|
454
|
-
created: Array<{
|
|
455
|
-
clientKey: string;
|
|
456
|
-
rowId: string;
|
|
457
|
-
}>;
|
|
458
|
-
affectedRows: Array<{
|
|
459
|
-
tableId: string;
|
|
460
|
-
rowId: string;
|
|
461
|
-
}>;
|
|
462
|
-
returnedRows?: RowBatch;
|
|
463
|
-
undoToken?: string;
|
|
464
|
-
evictedUndoTokens?: string[];
|
|
465
|
-
}
|
|
466
|
-
type CreatedSchemaObject = {
|
|
467
|
-
id: string;
|
|
468
|
-
object: "table";
|
|
469
|
-
clientKey: string;
|
|
470
|
-
} | {
|
|
471
|
-
id: string;
|
|
472
|
-
object: "field";
|
|
473
|
-
clientKey: string;
|
|
474
|
-
} | {
|
|
475
|
-
id: string;
|
|
476
|
-
object: "field";
|
|
477
|
-
systemRole: "row-id" | "created-time" | "updated-time";
|
|
478
|
-
};
|
|
479
|
-
type CommitReconciliation = {
|
|
480
|
-
operation: "mutateRows" | "revertMutation";
|
|
481
|
-
result: {
|
|
482
|
-
fileId: string;
|
|
483
|
-
revision: string;
|
|
484
|
-
changed: true;
|
|
485
|
-
created: Array<{
|
|
486
|
-
clientKey: string;
|
|
487
|
-
rowId: string;
|
|
488
|
-
}>;
|
|
489
|
-
affectedRows: Array<{
|
|
490
|
-
tableId: string;
|
|
491
|
-
rowId: string;
|
|
492
|
-
}>;
|
|
493
|
-
};
|
|
494
|
-
} | {
|
|
495
|
-
operation: "mutateView";
|
|
496
|
-
result: {
|
|
497
|
-
fileId: string;
|
|
498
|
-
revision: string;
|
|
499
|
-
changed: true;
|
|
500
|
-
createdViews: Array<{
|
|
501
|
-
clientKey: string;
|
|
502
|
-
viewId: string;
|
|
503
|
-
}>;
|
|
504
|
-
affectedViewIds: string[];
|
|
505
|
-
};
|
|
506
|
-
} | {
|
|
507
|
-
operation: "mutateSchema";
|
|
508
|
-
result: {
|
|
509
|
-
fileId: string;
|
|
510
|
-
revision: string;
|
|
511
|
-
changed: true;
|
|
512
|
-
createdObjects: CreatedSchemaObject[];
|
|
513
|
-
affectedTableIds: string[];
|
|
514
|
-
affectedFieldIds: string[];
|
|
515
|
-
};
|
|
516
|
-
} | {
|
|
517
|
-
operation: "importCsv";
|
|
518
|
-
result: {
|
|
519
|
-
fileId: string;
|
|
520
|
-
tableId: string;
|
|
521
|
-
revision: string;
|
|
522
|
-
changed: true;
|
|
523
|
-
createdRows: Array<{
|
|
524
|
-
recordIndex: number;
|
|
525
|
-
rowId: string;
|
|
526
|
-
}>;
|
|
527
|
-
};
|
|
528
|
-
};
|
|
529
|
-
interface TransportCommitBarrier {
|
|
530
|
-
prepare(preparation: {
|
|
531
|
-
fileID: string;
|
|
532
|
-
baseRevision: string;
|
|
533
|
-
commitRevision: string;
|
|
534
|
-
reconciliation: CommitReconciliation;
|
|
535
|
-
}, context: RequestContext): Promise<void>;
|
|
536
|
-
}
|
|
537
|
-
type ViewChange = {
|
|
538
|
-
kind: "create-view";
|
|
539
|
-
clientKey: string;
|
|
540
|
-
tableId: string;
|
|
541
|
-
name: string;
|
|
542
|
-
type: string;
|
|
543
|
-
query: SavedViewQuery;
|
|
544
|
-
layout: JsonObject;
|
|
545
|
-
position: string;
|
|
546
|
-
} | {
|
|
547
|
-
kind: "update-view";
|
|
548
|
-
viewId: string;
|
|
549
|
-
patch: {
|
|
550
|
-
name?: string;
|
|
551
|
-
type?: string;
|
|
552
|
-
query?: SavedViewQuery;
|
|
553
|
-
layout?: JsonObject;
|
|
554
|
-
position?: string;
|
|
555
|
-
};
|
|
556
|
-
} | {
|
|
557
|
-
kind: "delete-view";
|
|
558
|
-
viewId: string;
|
|
559
|
-
};
|
|
560
|
-
interface ViewMutationRequest {
|
|
561
|
-
expectedRevision: string;
|
|
562
|
-
changes: ViewChange[];
|
|
563
|
-
}
|
|
564
|
-
interface ViewMutationResult {
|
|
565
|
-
fileId: string;
|
|
566
|
-
revision: string;
|
|
567
|
-
changed: boolean;
|
|
568
|
-
createdViews: Array<{
|
|
569
|
-
clientKey: string;
|
|
570
|
-
viewId: string;
|
|
571
|
-
}>;
|
|
572
|
-
affectedViewIds: string[];
|
|
573
|
-
}
|
|
574
|
-
type SchemaChange = SchemaLeafChange | {
|
|
575
|
-
kind: "batch";
|
|
576
|
-
changes: SchemaLeafChange[];
|
|
577
|
-
};
|
|
578
|
-
type SchemaLeafChange = {
|
|
579
|
-
kind: "create-table";
|
|
580
|
-
clientKey: string;
|
|
581
|
-
name: string;
|
|
582
|
-
position: string;
|
|
583
|
-
settings?: JsonObject;
|
|
584
|
-
fields: NewField[];
|
|
585
|
-
labelFieldClientKey?: string;
|
|
586
|
-
} | {
|
|
587
|
-
kind: "set-file-title";
|
|
588
|
-
title: string;
|
|
589
|
-
} | {
|
|
590
|
-
kind: "set-default-table";
|
|
591
|
-
tableId: string | null;
|
|
592
|
-
} | {
|
|
593
|
-
kind: "delete-table";
|
|
594
|
-
tableId: string;
|
|
595
|
-
} | {
|
|
596
|
-
kind: "rename-table";
|
|
597
|
-
tableId: string;
|
|
598
|
-
name: string;
|
|
599
|
-
} | {
|
|
600
|
-
kind: "set-table-settings";
|
|
601
|
-
tableId: string;
|
|
602
|
-
settings: JsonObject;
|
|
603
|
-
} | {
|
|
604
|
-
kind: "set-table-position";
|
|
605
|
-
tableId: string;
|
|
606
|
-
position: string;
|
|
607
|
-
} | {
|
|
608
|
-
kind: "create-field";
|
|
609
|
-
tableId: string;
|
|
610
|
-
field: NewField;
|
|
611
|
-
} | {
|
|
612
|
-
kind: "delete-field";
|
|
613
|
-
fieldId: string;
|
|
614
|
-
replacementLabelFieldId?: string;
|
|
615
|
-
} | {
|
|
616
|
-
kind: "rename-field";
|
|
617
|
-
fieldId: string;
|
|
618
|
-
name: string;
|
|
619
|
-
} | {
|
|
620
|
-
kind: "set-field-nullable";
|
|
621
|
-
fieldId: string;
|
|
622
|
-
nullable: boolean;
|
|
623
|
-
} | {
|
|
624
|
-
kind: "set-field-settings";
|
|
625
|
-
fieldId: string;
|
|
626
|
-
settings: JsonObject;
|
|
627
|
-
} | {
|
|
628
|
-
kind: "set-field-position";
|
|
629
|
-
fieldId: string;
|
|
630
|
-
position: string;
|
|
631
|
-
} | {
|
|
632
|
-
kind: "set-record-label";
|
|
633
|
-
tableId: string;
|
|
634
|
-
fieldId: string;
|
|
635
|
-
} | {
|
|
636
|
-
kind: "set-formula";
|
|
637
|
-
fieldId: string;
|
|
638
|
-
definition: FormulaDefinition;
|
|
639
|
-
} | {
|
|
640
|
-
kind: "set-lookup";
|
|
641
|
-
fieldId: string;
|
|
642
|
-
definition: LookupDefinition;
|
|
643
|
-
} | {
|
|
644
|
-
kind: "set-relation";
|
|
645
|
-
fieldId: string;
|
|
646
|
-
definition: RelationDefinition;
|
|
647
|
-
} | ConvertFieldChange | {
|
|
648
|
-
kind: "rename-option";
|
|
649
|
-
fieldId: string;
|
|
650
|
-
from: string;
|
|
651
|
-
to: string;
|
|
652
|
-
collision: "reject" | "merge";
|
|
653
|
-
};
|
|
654
|
-
type StoredFieldType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url" | "select" | "multi-select" | "file" | "relation";
|
|
655
|
-
interface NewField {
|
|
656
|
-
clientKey: string;
|
|
657
|
-
name: string;
|
|
658
|
-
kind: StoredFieldType | "formula" | "lookup";
|
|
659
|
-
position: string;
|
|
660
|
-
nullable?: boolean;
|
|
661
|
-
settings?: JsonObject;
|
|
662
|
-
definition?: RelationDefinition | FormulaDefinition | LookupDefinition;
|
|
663
|
-
}
|
|
664
|
-
type ConversionPolicy = "round-binary64" | "truncate-toward-zero" | "round-ties-even" | "zero-false-nonzero-true" | "utc-date" | "first" | "null-to-empty-list";
|
|
665
|
-
type ScalarStoredFieldType = "text" | "number" | "integer" | "checkbox" | "date" | "datetime" | "url" | "select";
|
|
666
|
-
type ConvertFieldChange = {
|
|
667
|
-
kind: "convert-field";
|
|
668
|
-
fieldId: string;
|
|
669
|
-
to: ScalarStoredFieldType;
|
|
670
|
-
toNullable: boolean;
|
|
671
|
-
policies?: ConversionPolicy[];
|
|
672
|
-
} | {
|
|
673
|
-
kind: "convert-field";
|
|
674
|
-
fieldId: string;
|
|
675
|
-
to: "multi-select" | "file";
|
|
676
|
-
policies?: ConversionPolicy[];
|
|
677
|
-
} | {
|
|
678
|
-
kind: "convert-field";
|
|
679
|
-
fieldId: string;
|
|
680
|
-
to: "relation";
|
|
681
|
-
definition: ForwardRelationDefinition;
|
|
682
|
-
policies?: ConversionPolicy[];
|
|
683
|
-
};
|
|
684
|
-
interface SchemaPreflightRequest {
|
|
685
|
-
change: SchemaChange;
|
|
686
|
-
expectedRevision: string;
|
|
687
|
-
}
|
|
688
|
-
interface SchemaPreflightResult {
|
|
689
|
-
fileId: string;
|
|
690
|
-
planToken: string;
|
|
691
|
-
baseRevision: string;
|
|
692
|
-
actionsHash: string;
|
|
693
|
-
classification: "metadata-only" | "lossless-rewrite" | "explicit-lossy" | "forbidden";
|
|
694
|
-
affectedRows: string;
|
|
695
|
-
dependencyCount: string;
|
|
696
|
-
dependencies: SchemaDependency[];
|
|
697
|
-
dependencyCursor?: string;
|
|
698
|
-
warnings: RuntimeDiagnostic[];
|
|
699
|
-
warningsTruncated: boolean;
|
|
700
|
-
valueChanges: SchemaValueChange[];
|
|
701
|
-
valueChangesTruncated: boolean;
|
|
702
|
-
expiresInMilliseconds: number;
|
|
703
|
-
expiresAt: string;
|
|
704
|
-
}
|
|
705
|
-
interface SchemaValueChange {
|
|
706
|
-
code: SchemaValueChangeCode;
|
|
707
|
-
rows: string;
|
|
708
|
-
tableId: string;
|
|
709
|
-
fieldId: string;
|
|
710
|
-
}
|
|
711
|
-
type SchemaValueChangeCode = "value-reencoded" | "binary64-rounded" | "fraction-truncated" | "integer-rounded" | "numeric-to-checkbox" | "datetime-to-date" | "null-to-empty-list" | "list-empty-to-null" | "list-tail-dropped" | "relation-detached" | "option-value-renamed" | "option-duplicate-collapsed";
|
|
712
|
-
interface SchemaDependency {
|
|
713
|
-
object: "table" | "field" | "view";
|
|
714
|
-
id: string;
|
|
715
|
-
}
|
|
716
|
-
interface SchemaDependencyPage {
|
|
717
|
-
fileId: string;
|
|
718
|
-
revision: string;
|
|
719
|
-
dependencyCount: string;
|
|
720
|
-
dependencies: SchemaDependency[];
|
|
721
|
-
nextCursor: string | null;
|
|
722
|
-
}
|
|
723
|
-
interface SchemaMutationRequest {
|
|
724
|
-
planToken: string;
|
|
725
|
-
expectedRevision: string;
|
|
726
|
-
actionsHash: string;
|
|
727
|
-
confirmLossy?: true;
|
|
728
|
-
}
|
|
729
|
-
interface SchemaMutationResult {
|
|
730
|
-
fileId: string;
|
|
731
|
-
revision: string;
|
|
732
|
-
changed: boolean;
|
|
733
|
-
createdObjects: CreatedSchemaObject[];
|
|
734
|
-
affectedTableIds: string[];
|
|
735
|
-
affectedFieldIds: string[];
|
|
736
|
-
}
|
|
737
|
-
interface SavedViewQuery {
|
|
738
|
-
filter?: FilterNode;
|
|
739
|
-
sort?: Array<{
|
|
740
|
-
fieldId: string;
|
|
741
|
-
direction: "asc" | "desc";
|
|
742
|
-
nulls?: "first" | "last";
|
|
743
|
-
}>;
|
|
744
|
-
}
|
|
745
|
-
interface CsvExportRequest {
|
|
746
|
-
tableId: string;
|
|
747
|
-
query: RowQuery;
|
|
748
|
-
fields: string[];
|
|
749
|
-
includeHeader: boolean;
|
|
750
|
-
}
|
|
751
|
-
interface CsvExportResult {
|
|
752
|
-
fileId: string;
|
|
753
|
-
tableId: string;
|
|
754
|
-
revision: string;
|
|
755
|
-
csv: OwnedBytes;
|
|
756
|
-
}
|
|
757
|
-
interface CsvImportRequest {
|
|
758
|
-
tableId: string;
|
|
759
|
-
expectedRevision: string;
|
|
760
|
-
hasHeader: boolean;
|
|
761
|
-
columns: Array<{
|
|
762
|
-
csvIndex: number;
|
|
763
|
-
fieldId: string;
|
|
764
|
-
}>;
|
|
765
|
-
csv: OwnedBytes;
|
|
766
|
-
}
|
|
767
|
-
interface CsvImportResult {
|
|
768
|
-
fileId: string;
|
|
769
|
-
tableId: string;
|
|
770
|
-
revision: string;
|
|
771
|
-
changed: boolean;
|
|
772
|
-
createdRows: Array<{
|
|
773
|
-
recordIndex: number;
|
|
774
|
-
rowId: string;
|
|
775
|
-
}>;
|
|
776
|
-
undoToken?: string;
|
|
777
|
-
evictedUndoTokens?: string[];
|
|
778
|
-
}
|
|
779
|
-
interface RuntimeEvent {
|
|
780
|
-
kind: "revision-changed" | "schema-changed" | "fatal";
|
|
781
|
-
fileId: string;
|
|
782
|
-
revision: string;
|
|
783
|
-
tableIds?: string[];
|
|
784
|
-
fieldIds?: string[];
|
|
785
|
-
}
|
|
786
|
-
interface ValidationRequest {
|
|
787
|
-
level: "identity" | "structural" | "content" | "semantic" | "full";
|
|
788
|
-
diagnosticsLimit: number;
|
|
789
|
-
}
|
|
790
|
-
interface RuntimeDiagnostic {
|
|
791
|
-
code: RuntimeDiagnosticCode;
|
|
792
|
-
severity: "fatal" | "error" | "warning" | "info";
|
|
793
|
-
message?: string;
|
|
794
|
-
fileId?: string;
|
|
795
|
-
tableId?: string;
|
|
796
|
-
fieldId?: string;
|
|
797
|
-
rowId?: string;
|
|
798
|
-
viewId?: string;
|
|
799
|
-
path?: string;
|
|
800
|
-
sourceByteOffset?: number;
|
|
801
|
-
relatedFieldIds?: string[];
|
|
802
|
-
}
|
|
803
|
-
type RuntimeDiagnosticCode = "file-not-sqlite" | "file-identity-invalid" | "file-format-unsupported" | "file-feature-unsupported" | "file-core-object-invalid" | "file-metadata-invalid" | "file-foreign-key-invalid" | "file-physical-schema-invalid" | "file-definition-invalid" | "file-trigger-invalid" | "file-index-invalid" | "file-extension-invalid" | "file-cell-invalid" | "file-json-invalid" | "file-reference-invalid" | "file-unresolved-relation" | "file-integrity-invalid" | "semantic-field-invalid" | "formula-parse-invalid" | "formula-name-invalid" | "formula-type-invalid" | "semantic-cycle" | "lookup-invalid" | "relation-invalid" | "record-label-invalid" | "view-query-invalid" | "option-catalog-invalid" | "validation-prerequisite-failed" | "fraction-loss" | "precision-loss" | "truthiness-loss" | "time-loss" | "null-distinction-loss" | "list-tail-loss" | "option-merge-loss" | "object-delete-loss" | "dependent-source-rewritten" | "dependency-blocked" | "conversion-domain-invalid" | "non-nullability-blocked" | "relation-definition-invalid" | "cardinality-blocked" | "record-label-blocked" | `x.${string}.${string}`;
|
|
804
|
-
interface ValidationReport {
|
|
805
|
-
fileId?: string;
|
|
806
|
-
revision?: string;
|
|
807
|
-
level: ValidationRequest["level"];
|
|
808
|
-
valid: boolean;
|
|
809
|
-
diagnostics: RuntimeDiagnostic[];
|
|
810
|
-
truncated: boolean;
|
|
811
|
-
}
|
|
812
|
-
interface RuntimeClient {
|
|
813
|
-
negotiate(request: {
|
|
814
|
-
protocol: "eidos-runtime";
|
|
815
|
-
versions: ["1.0"];
|
|
816
|
-
}, context: RequestContext): Promise<{
|
|
817
|
-
version: "1.0";
|
|
818
|
-
capabilities: RuntimeCapabilities;
|
|
819
|
-
limits: RuntimeLimits;
|
|
820
|
-
}>;
|
|
821
|
-
getSnapshot(request: {
|
|
822
|
-
minimumRevision?: string;
|
|
823
|
-
}, context: RequestContext): Promise<RuntimeSnapshot>;
|
|
824
|
-
getSchemaPage(request: GetSchemaPageRequest, context: RequestContext): Promise<SchemaPage>;
|
|
825
|
-
queryRows(request: QueryRowsRequest, context: RequestContext): Promise<RowPage>;
|
|
826
|
-
getRowsById(request: {
|
|
827
|
-
tableId: string;
|
|
828
|
-
rowIds: string[];
|
|
829
|
-
projection: ProjectionSpec;
|
|
830
|
-
}, context: RequestContext): Promise<RowBatch>;
|
|
831
|
-
aggregate(request: AggregateRequest, context: RequestContext): Promise<AggregateResponse>;
|
|
832
|
-
groupRows(request: GroupRequest, context: RequestContext): Promise<GroupPage>;
|
|
833
|
-
queryGroupRows(request: GroupRowsRequest, context: RequestContext): Promise<GroupRowPage>;
|
|
834
|
-
previewFormula(request: FormulaPreviewRequest, context: RequestContext): Promise<FormulaPreviewResult>;
|
|
835
|
-
mutateRows(request: RowMutation, context: RequestContext): Promise<MutationResult>;
|
|
836
|
-
revertMutation?(request: {
|
|
837
|
-
undoToken: string;
|
|
838
|
-
expectedRevision: string;
|
|
839
|
-
}, context: RequestContext): Promise<MutationResult>;
|
|
840
|
-
mutateView(request: ViewMutationRequest, context: RequestContext): Promise<ViewMutationResult>;
|
|
841
|
-
preflightSchema(request: SchemaPreflightRequest, context: RequestContext): Promise<SchemaPreflightResult>;
|
|
842
|
-
getSchemaPlanDependencies(request: {
|
|
843
|
-
planToken: string;
|
|
844
|
-
cursor?: string;
|
|
845
|
-
limit: number;
|
|
846
|
-
}, context: RequestContext): Promise<SchemaDependencyPage>;
|
|
847
|
-
mutateSchema(request: SchemaMutationRequest, context: RequestContext): Promise<SchemaMutationResult>;
|
|
848
|
-
validate(request: ValidationRequest, context: RequestContext): Promise<ValidationReport>;
|
|
849
|
-
exportCsv?(request: CsvExportRequest, context: RequestContext): Promise<CsvExportResult>;
|
|
850
|
-
importCsv?(request: CsvImportRequest, context: RequestContext): Promise<CsvImportResult>;
|
|
851
|
-
cancel(request: {
|
|
852
|
-
requestId: string;
|
|
853
|
-
}): Promise<void>;
|
|
854
|
-
subscribe?(listener: (event: RuntimeEvent) => void): () => void;
|
|
855
|
-
close(context: RequestContext): Promise<void>;
|
|
856
|
-
}
|
|
857
|
-
type RuntimeService = RuntimeClient;
|
|
858
|
-
//#endregion
|
|
859
|
-
//#region src/adapter-contract.d.ts
|
|
860
|
-
type SqlValue = {
|
|
861
|
-
tag: "null";
|
|
862
|
-
} | {
|
|
863
|
-
tag: "integer";
|
|
864
|
-
value: string;
|
|
865
|
-
} | {
|
|
866
|
-
tag: "real";
|
|
867
|
-
value: number;
|
|
868
|
-
} | {
|
|
869
|
-
tag: "text";
|
|
870
|
-
value: string;
|
|
871
|
-
} | {
|
|
872
|
-
tag: "blob";
|
|
873
|
-
value: OwnedBytes;
|
|
874
|
-
};
|
|
875
|
-
interface Column {
|
|
876
|
-
name: string;
|
|
877
|
-
}
|
|
878
|
-
interface QueryResult {
|
|
879
|
-
columns: Column[];
|
|
880
|
-
rows: SqlValue[][];
|
|
881
|
-
}
|
|
882
|
-
interface RunResult {
|
|
883
|
-
changes: string;
|
|
884
|
-
lastInsertRowid: string;
|
|
885
|
-
}
|
|
886
|
-
interface ConnectionCapabilities {
|
|
887
|
-
adapterVersion: "1.0";
|
|
888
|
-
sqliteVersion: string;
|
|
889
|
-
json1: boolean;
|
|
890
|
-
returning: boolean;
|
|
891
|
-
strict: boolean;
|
|
892
|
-
int64: boolean;
|
|
893
|
-
scalarFunctions: boolean;
|
|
894
|
-
directOnlyFunctions: boolean;
|
|
895
|
-
interrupt: boolean;
|
|
896
|
-
snapshot: true;
|
|
897
|
-
defensiveMode: boolean;
|
|
898
|
-
busyTimeoutMs: number;
|
|
899
|
-
maxVariables: number;
|
|
900
|
-
maxSqlBytes: number;
|
|
901
|
-
maxValueBytes: number;
|
|
902
|
-
maxResultRows: number;
|
|
903
|
-
maxResultBytes: number;
|
|
904
|
-
}
|
|
905
|
-
interface ScalarDefinition {
|
|
906
|
-
name: string;
|
|
907
|
-
arity: number;
|
|
908
|
-
deterministic: true;
|
|
909
|
-
directOnly: true;
|
|
910
|
-
}
|
|
911
|
-
interface SnapshotContext {
|
|
912
|
-
cancellation: CancellationPort;
|
|
913
|
-
deadlineMilliseconds?: number;
|
|
914
|
-
maxBytes: string;
|
|
915
|
-
}
|
|
916
|
-
interface ConnectionSnapshot {
|
|
917
|
-
bytes: ByteSource;
|
|
918
|
-
release(): Promise<void>;
|
|
919
|
-
}
|
|
920
|
-
interface ConnectionPort {
|
|
921
|
-
capabilities(): ConnectionCapabilities;
|
|
922
|
-
execSchema(sql: string): void;
|
|
923
|
-
query(sql: string, bindings?: readonly SqlValue[]): QueryResult;
|
|
924
|
-
get(sql: string, bindings?: readonly SqlValue[]): {
|
|
925
|
-
columns: Column[];
|
|
926
|
-
row: SqlValue[] | null;
|
|
927
|
-
};
|
|
928
|
-
run(sql: string, bindings?: readonly SqlValue[]): RunResult;
|
|
929
|
-
runMany(sql: string, bindingSets: readonly (readonly SqlValue[])[]): RunResult[];
|
|
930
|
-
registerScalar(definition: ScalarDefinition, operation: (...values: SqlValue[]) => SqlValue): void;
|
|
931
|
-
transaction<T>(mode: "read" | "write", operation: () => T): T;
|
|
932
|
-
transaction<T>(mode: "read" | "write", operation: () => Promise<T>): Promise<T>;
|
|
933
|
-
dataVersion(): string;
|
|
934
|
-
interrupt(): void;
|
|
935
|
-
snapshot(context: SnapshotContext): Promise<ConnectionSnapshot>;
|
|
936
|
-
close(): void;
|
|
937
|
-
}
|
|
938
|
-
type AdapterErrorCode = "adapter-closed" | "invalid-argument" | "invalid-sql-value" | "unsupported-capability" | "sql-error" | "sql-function-error" | "constraint" | "busy" | "locked" | "cancelled" | "deadline-exceeded" | "resource-limit" | "out-of-memory" | "io-error" | "corrupt" | "not-a-database" | "read-only" | "permission-denied" | "source-changed" | "writer-unavailable" | "publication-failed" | "recovery-required" | "asset-unavailable" | "protocol-error" | "backpressure" | "commit-outcome-unknown" | "transport-closed" | "transport-fatal";
|
|
939
|
-
interface AdapterError {
|
|
940
|
-
code: AdapterErrorCode;
|
|
941
|
-
message: string;
|
|
942
|
-
retryable: boolean;
|
|
943
|
-
fatal: boolean;
|
|
944
|
-
sqlitePrimaryCode?: number;
|
|
945
|
-
sqliteExtendedCode?: number;
|
|
946
|
-
details?: JsonObject;
|
|
947
|
-
}
|
|
948
|
-
interface HostServices {
|
|
949
|
-
negotiate(request: {
|
|
950
|
-
protocol: "eidos-host";
|
|
951
|
-
versions: ["1.0"];
|
|
952
|
-
}, context: RequestContext): Promise<{
|
|
953
|
-
version: "1.0";
|
|
954
|
-
serviceCapabilities: HostServiceCapabilities;
|
|
955
|
-
limits: HostLimits;
|
|
956
|
-
}>;
|
|
957
|
-
openSource(request: {
|
|
958
|
-
sourceToken: string;
|
|
959
|
-
access: "read" | "readwrite";
|
|
960
|
-
}, context: RequestContext): Promise<{
|
|
961
|
-
sessionId: string;
|
|
962
|
-
runtime: RuntimeClient;
|
|
963
|
-
state: HostSessionState;
|
|
964
|
-
}>;
|
|
965
|
-
createSource(request: {
|
|
966
|
-
destinationToken: string;
|
|
967
|
-
title: string;
|
|
968
|
-
}, context: RequestContext): Promise<{
|
|
969
|
-
sessionId: string;
|
|
970
|
-
runtime: RuntimeClient;
|
|
971
|
-
state: HostSessionState;
|
|
972
|
-
}>;
|
|
973
|
-
requestWritePermission(request: {
|
|
974
|
-
sessionId: string;
|
|
975
|
-
}, context: RequestContext): Promise<HostSessionState>;
|
|
976
|
-
save(request: {
|
|
977
|
-
sessionId: string;
|
|
978
|
-
}, context: RequestContext): Promise<HostSaveResult>;
|
|
979
|
-
saveCopy(request: {
|
|
980
|
-
sessionId: string;
|
|
981
|
-
destinationToken: string;
|
|
982
|
-
adopt: "keep-current" | "adopt-copy";
|
|
983
|
-
}, context: RequestContext): Promise<HostSaveCopyResult>;
|
|
984
|
-
reconcileCommit(request: {
|
|
985
|
-
sessionId: string;
|
|
986
|
-
}, context: RequestContext): Promise<HostCommitReconciliationResult>;
|
|
987
|
-
resolveConflict(request: {
|
|
988
|
-
sessionId: string;
|
|
989
|
-
strategy: "reload" | "save-copy" | "merge";
|
|
990
|
-
conflictToken: string;
|
|
991
|
-
destinationToken?: string;
|
|
992
|
-
adopt?: "keep-current" | "adopt-copy";
|
|
993
|
-
}, context: RequestContext): Promise<HostConflictResult>;
|
|
994
|
-
listRecovery(request: {
|
|
995
|
-
sessionId: string;
|
|
996
|
-
}, context: RequestContext): Promise<HostRecoveryReport>;
|
|
997
|
-
restoreRecovery(request: {
|
|
998
|
-
sessionId: string;
|
|
999
|
-
recoveryToken: string;
|
|
1000
|
-
}, context: RequestContext): Promise<HostRecoveryResult>;
|
|
1001
|
-
discardRecovery(request: {
|
|
1002
|
-
sessionId: string;
|
|
1003
|
-
recoveryToken: string;
|
|
1004
|
-
}, context: RequestContext): Promise<HostRecoveryResult>;
|
|
1005
|
-
acquireAsset(request: {
|
|
1006
|
-
sessionId: string;
|
|
1007
|
-
sourceToken: string;
|
|
1008
|
-
}, context: RequestContext): Promise<{
|
|
1009
|
-
entry: FileEntry;
|
|
1010
|
-
}>;
|
|
1011
|
-
acquireRemoteAsset?(request: {
|
|
1012
|
-
sessionId: string;
|
|
1013
|
-
uri: string;
|
|
1014
|
-
name?: string;
|
|
1015
|
-
}, context: RequestContext): Promise<{
|
|
1016
|
-
entry: FileEntry;
|
|
1017
|
-
}>;
|
|
1018
|
-
resolveAsset(request: {
|
|
1019
|
-
sessionId: string;
|
|
1020
|
-
entryId: string;
|
|
1021
|
-
purpose: "thumbnail" | "preview" | "download";
|
|
1022
|
-
}, context: RequestContext): Promise<AssetLease>;
|
|
1023
|
-
resolveUrlImage?(request: {
|
|
1024
|
-
sessionId: string;
|
|
1025
|
-
uri: string;
|
|
1026
|
-
purpose: "thumbnail" | "preview";
|
|
1027
|
-
}, context: RequestContext): Promise<UrlImageLease>;
|
|
1028
|
-
releaseAsset(request: {
|
|
1029
|
-
sessionId: string;
|
|
1030
|
-
leaseId: string;
|
|
1031
|
-
}, context: RequestContext): Promise<void>;
|
|
1032
|
-
close(request: {
|
|
1033
|
-
sessionId: string;
|
|
1034
|
-
}, context: RequestContext): Promise<void>;
|
|
1035
|
-
subscribe(sessionId: string, listener: (state: HostSessionState) => void): () => void;
|
|
1036
|
-
}
|
|
1037
|
-
interface HostServiceCapabilities {
|
|
1038
|
-
canOpenSource: true;
|
|
1039
|
-
canCreateSource: boolean;
|
|
1040
|
-
canRequestPermission: boolean;
|
|
1041
|
-
canSaveCopy: boolean;
|
|
1042
|
-
canReconcileCommit: boolean;
|
|
1043
|
-
canResolveConflict: boolean;
|
|
1044
|
-
canRecover: boolean;
|
|
1045
|
-
canUseAssets: boolean;
|
|
1046
|
-
}
|
|
1047
|
-
interface HostCapabilities {
|
|
1048
|
-
canWriteCurrent: boolean;
|
|
1049
|
-
canSaveCopy: boolean;
|
|
1050
|
-
canRequestPermission: boolean;
|
|
1051
|
-
hasRecovery: boolean;
|
|
1052
|
-
assetReadSchemes: string[];
|
|
1053
|
-
assetWriteSchemes: string[];
|
|
1054
|
-
casGuarantee: "strong" | "cooperative" | "none";
|
|
1055
|
-
atomicReplace: boolean;
|
|
1056
|
-
durability: "durable" | "best-effort";
|
|
1057
|
-
}
|
|
1058
|
-
interface HostLimits {
|
|
1059
|
-
sourceBytesMax: string;
|
|
1060
|
-
candidateBytesMax: string;
|
|
1061
|
-
recoveryBytesMax: string;
|
|
1062
|
-
recoveryEntriesMax: number;
|
|
1063
|
-
recoveryRetentionSecondsMax: number;
|
|
1064
|
-
assetBytesMax: string;
|
|
1065
|
-
assetPreviewBytesMax: string;
|
|
1066
|
-
concurrentAssetLeasesMax: number;
|
|
1067
|
-
concurrentSessionsMax: number;
|
|
1068
|
-
}
|
|
1069
|
-
type HostPhase = "opening" | "ready-readonly" | "ready-clean" | "ready-dirty" | "publishing" | "commit-unknown" | "conflict" | "recovery-required" | "fatal" | "closed";
|
|
1070
|
-
interface HostError {
|
|
1071
|
-
code: "invalid-request" | "unsupported" | "invalid-source" | "conflict" | "permission-denied" | "source-changed" | "writer-unavailable" | "publication-failed" | "recovery-required" | "asset-unavailable" | "cancelled" | "deadline-exceeded" | "resource-limit" | "io-error" | "unknown-commit" | "closed" | "fatal";
|
|
1072
|
-
message: string;
|
|
1073
|
-
retryable: boolean;
|
|
1074
|
-
details?: JsonObject;
|
|
1075
|
-
}
|
|
1076
|
-
interface HostSessionState {
|
|
1077
|
-
sessionId: string;
|
|
1078
|
-
phase: HostPhase;
|
|
1079
|
-
capabilities: HostCapabilities;
|
|
1080
|
-
limits: HostLimits;
|
|
1081
|
-
fileId?: string;
|
|
1082
|
-
revision?: string;
|
|
1083
|
-
conflictToken?: string;
|
|
1084
|
-
error?: HostError;
|
|
1085
|
-
}
|
|
1086
|
-
interface HostSaveResult {
|
|
1087
|
-
state: HostSessionState;
|
|
1088
|
-
}
|
|
1089
|
-
interface HostSaveCopyResult {
|
|
1090
|
-
state: HostSessionState;
|
|
1091
|
-
adopted: boolean;
|
|
1092
|
-
runtime?: RuntimeClient;
|
|
1093
|
-
}
|
|
1094
|
-
interface HostCommitReconciliationResult {
|
|
1095
|
-
state: HostSessionState;
|
|
1096
|
-
outcome: "committed" | "rolled-back" | "conflict";
|
|
1097
|
-
runtime?: RuntimeClient;
|
|
1098
|
-
reconciliation?: CommitReconciliation;
|
|
1099
|
-
}
|
|
1100
|
-
interface HostConflictResult {
|
|
1101
|
-
state: HostSessionState;
|
|
1102
|
-
runtime?: RuntimeClient;
|
|
1103
|
-
}
|
|
1104
|
-
interface HostRecoveryResult {
|
|
1105
|
-
state: HostSessionState;
|
|
1106
|
-
runtime?: RuntimeClient;
|
|
1107
|
-
}
|
|
1108
|
-
interface HostRecoveryReport {
|
|
1109
|
-
items: Array<{
|
|
1110
|
-
recoveryToken: string;
|
|
1111
|
-
fileId: string;
|
|
1112
|
-
revision: string;
|
|
1113
|
-
createdAt: string;
|
|
1114
|
-
size: string;
|
|
1115
|
-
}>;
|
|
1116
|
-
}
|
|
1117
|
-
interface AssetLease {
|
|
1118
|
-
leaseId: string;
|
|
1119
|
-
entryId: string;
|
|
1120
|
-
purpose: "thumbnail" | "preview" | "download";
|
|
1121
|
-
mediaType: string;
|
|
1122
|
-
name: string;
|
|
1123
|
-
size: string;
|
|
1124
|
-
expiresAt: string;
|
|
1125
|
-
resourceToken: string;
|
|
1126
|
-
}
|
|
1127
|
-
interface UrlImageLease {
|
|
1128
|
-
leaseId: string;
|
|
1129
|
-
purpose: "thumbnail" | "preview";
|
|
1130
|
-
mediaType: string;
|
|
1131
|
-
size: string;
|
|
1132
|
-
expiresAt: string;
|
|
1133
|
-
resourceToken: string;
|
|
1134
|
-
}
|
|
1135
|
-
//#endregion
|
|
1136
|
-
export { GroupPage as $, TypeRef as $t, AggregateResult as A, RuntimeHostBridge as At, CsvImportRequest as B, SchemaDependencyPage as Bt, ScalarDefinition as C, RuntimeDiagnostic as Ct, AggregateItem as D, RuntimeErrorCode as Dt, UrlImageLease as E, RuntimeError as Et, ConversionPolicy as F, SavedViewQuery as Ft, FilterNode as G, SchemaPage as Gt, FeatureDescriptor as H, SchemaLeafChange as Ht, ConvertFieldChange as I, ScalarStoredFieldType as It, FormulaPreviewRequest as J, SchemaValueChange as Jt, FilterOperand as K, SchemaPreflightRequest as Kt, CreatedSchemaObject as L, ScalarType as Lt, ColumnDescriptor as M, RuntimePublicationSnapshot as Mt, ColumnStatistics as N, RuntimeService as Nt, AggregateRequest as O, RuntimeEvent as Ot, CommitReconciliation as P, RuntimeSnapshot as Pt, GetSchemaPageRequest as Q, TransportCommitBarrier as Qt, CsvExportRequest as R, SchemaChange as Rt, RunResult as S, RuntimeCreateInput as St, SqlValue as T, RuntimeEnvironment as Tt, FieldDescriptor as U, SchemaMutationRequest as Ut, CsvImportResult as V, SchemaDescriptor as Vt, FileEntry as W, SchemaMutationResult as Wt, FormulaResultType as X, StoredFieldType as Xt, FormulaPreviewResult as Y, SchemaValueChangeCode as Yt, ForwardRelationDefinition as Z, TableDescriptor as Zt, HostSaveResult as _, RowPage as _t, ConnectionCapabilities as a, ViewMutationResult as an, LookupDefinition as at, HostSessionState as b, RuntimeCapabilities as bt, HostCapabilities as c, ProjectedRow as ct, HostError as d, RelationDefinition as dt, ValidationReport as en, GroupRequest as et, HostLimits as f, ResolvedRelationItem as ft, HostSaveCopyResult as g, RowMutation as gt, HostRecoveryResult as h, RowChange as ht, Column as i, ViewMutationRequest as in, LogicalValue as it, AtomicType as j, RuntimeLimits as jt, AggregateResponse as k, RuntimeFactoryContext as kt, HostCommitReconciliationResult as l, ProjectionSpec as lt, HostRecoveryReport as m, RowBatch as mt, AdapterErrorCode as n, ViewChange as nn, GroupRowsRequest as nt, ConnectionPort as o, MutationResult as ot, HostPhase as p, Revision as pt, FormulaDefinition as q, SchemaPreflightResult as qt, AssetLease as r, ViewDescriptor as rn, InverseRelationDefinition as rt, ConnectionSnapshot as s, NewField as st, AdapterError as t, ValidationRequest as tn, GroupRowPage as tt, HostConflictResult as u, QueryRowsRequest as ut, HostServiceCapabilities as v, RowQuery as vt, SnapshotContext as w, RuntimeDiagnosticCode as wt, QueryResult as x, RuntimeClient as xt, HostServices as y, RuntimeBinding as yt, CsvExportResult as z, SchemaDependency as zt };
|
|
1137
|
-
//# sourceMappingURL=adapter-contract-CNigdeQ7.d.mts.map
|