@query-farm/vgi 0.27.0 → 0.29.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/README.md +26 -7
- package/dist/arguments/argument-spec.d.ts +53 -0
- package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
- package/dist/arrow/impl-arrowjs/iterate.d.ts +10 -1
- package/dist/arrow/impl-arrowjs/schema.d.ts +2 -0
- package/dist/arrow/impl-flechette/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +10 -1
- package/dist/arrow/impl-flechette/schema.d.ts +2 -0
- package/dist/arrow/index.d.ts +1 -1
- package/dist/arrow/schema-types.d.ts +3 -1
- package/dist/arrow/types.d.ts +39 -3
- package/dist/catalog/interface.d.ts +43 -0
- package/dist/client/client.d.ts +1 -1
- package/dist/client-entry.js +360 -178
- package/dist/client-entry.js.map +14 -14
- package/dist/functions/table.d.ts +63 -0
- package/dist/functions/types.d.ts +38 -0
- package/dist/generated/vgi-client.d.ts +59 -0
- package/dist/generated/vgi-protocol-schemas.d.ts +19 -0
- package/dist/http/fetch.d.ts +10 -0
- package/dist/index.core.d.ts +2 -2
- package/dist/index.js +1203 -834
- package/dist/index.js.map +40 -37
- package/dist/protocol/handlers/catalog/shared.d.ts +0 -8
- package/dist/protocol/handlers/function.d.ts +11 -0
- package/dist/protocol/serializers/bind.d.ts +1 -2
- package/dist/protocol/serializers/cardinality.d.ts +1 -2
- package/dist/protocol/serializers/splits.d.ts +126 -0
- package/dist/protocol/types.d.ts +27 -0
- package/dist/request-auth.d.ts +28 -0
- package/dist/serve-entry.d.ts +4 -0
- package/dist/serve-entry.js +745 -359
- package/dist/serve-entry.js.map +32 -29
- package/dist/split-token.d.ts +88 -0
- package/dist/worker-cf-entry.js +1029 -619
- package/dist/worker-cf-entry.js.map +37 -34
- package/package.json +3 -3
- package/src/arguments/argument-spec.ts +81 -0
- package/src/arguments/arguments.ts +0 -1
- package/src/arrow/impl-arrowjs/index.ts +1 -1
- package/src/arrow/impl-arrowjs/iterate.ts +21 -0
- package/src/arrow/impl-arrowjs/schema.ts +4 -0
- package/src/arrow/impl-flechette/index.ts +1 -1
- package/src/arrow/impl-flechette/iterate.ts +24 -1
- package/src/arrow/impl-flechette/schema.ts +4 -0
- package/src/arrow/index.ts +1 -1
- package/src/arrow/schema-types.ts +4 -0
- package/src/arrow/types.ts +39 -3
- package/src/catalog/interface.ts +124 -29
- package/src/catalog/read-only.ts +18 -18
- package/src/client/client.ts +6 -2
- package/src/functions/aggregate.ts +3 -0
- package/src/functions/copy-from.ts +2 -1
- package/src/functions/copy-to.ts +2 -1
- package/src/functions/scalar.ts +11 -0
- package/src/functions/table-buffering.ts +3 -0
- package/src/functions/table-in-out.ts +8 -4
- package/src/functions/table.ts +129 -2
- package/src/functions/types.ts +40 -0
- package/src/generated/vgi-client.ts +63 -1
- package/src/generated/vgi-protocol-schemas.ts +240 -14
- package/src/http/fetch.ts +117 -2
- package/src/index.core.ts +2 -2
- package/src/protocol/handlers/aggregate.ts +10 -5
- package/src/protocol/handlers/catalog/admin.ts +41 -48
- package/src/protocol/handlers/catalog/index_methods.ts +4 -11
- package/src/protocol/handlers/catalog/macro.ts +8 -16
- package/src/protocol/handlers/catalog/shared.ts +10 -57
- package/src/protocol/handlers/catalog/table.ts +33 -96
- package/src/protocol/handlers/catalog/view.ts +13 -17
- package/src/protocol/handlers/function.ts +311 -18
- package/src/protocol/handlers/table-buffering.ts +7 -4
- package/src/protocol/serializers/bind.ts +56 -63
- package/src/protocol/serializers/cardinality.ts +7 -7
- package/src/protocol/serializers/init.ts +52 -10
- package/src/protocol/serializers/splits.ts +219 -0
- package/src/protocol/state-serializer.ts +55 -1
- package/src/protocol/types.ts +27 -0
- package/src/request-auth.ts +73 -0
- package/src/serve-entry.ts +5 -0
- package/src/split-token.ts +297 -0
- package/src/worker-cf-entry.ts +2 -1
- package/src/worker.ts +30 -10
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type VgiSchema, type VgiDataType } from "../arrow/index.js";
|
|
2
2
|
import type { OutputCollector } from "@query-farm/vgi-rpc";
|
|
3
|
+
import type { PlanResult, TableFunctionPlanRequest } from "../protocol/serializers/splits.js";
|
|
3
4
|
import type { BindRequest, InitRequest, GlobalInitResponse, TableCardinality } from "../protocol/types.js";
|
|
4
5
|
import type { VgiFunction, FunctionExample } from "./types.js";
|
|
5
6
|
import { type ArgumentConstraints } from "../arguments/argument-spec.js";
|
|
@@ -22,6 +23,15 @@ export interface TableProcessParams<TArgs = Record<string, any>> {
|
|
|
22
23
|
settings: Record<string, any>;
|
|
23
24
|
secrets: Record<string, Record<string, any>>;
|
|
24
25
|
pushdownFilters?: PushdownFilters;
|
|
26
|
+
/**
|
|
27
|
+
* The verified payloads of the splits this init claimed, in the order given,
|
|
28
|
+
* or undefined when this is not a split scan.
|
|
29
|
+
*
|
|
30
|
+
* Undefined is meaningfully different from an empty array: undefined means
|
|
31
|
+
* the client did not plan (a split-only function should fail loudly rather
|
|
32
|
+
* than answer the same query differently), empty means a claim of no work.
|
|
33
|
+
*/
|
|
34
|
+
splitPayloads?: Uint8Array[];
|
|
25
35
|
storage?: BoundStorage;
|
|
26
36
|
/**
|
|
27
37
|
* AT (TIMESTAMP|VERSION) clause for this scan, or `undefined` when the scan
|
|
@@ -91,6 +101,40 @@ export interface TableFunctionConfig<TArgs = Record<string, any>, TState = null>
|
|
|
91
101
|
process: (params: TableProcessParams<TArgs>, state: TState, out: OutputCollector) => void | Promise<void>;
|
|
92
102
|
/** Cardinality hints */
|
|
93
103
|
cardinality?: (params: TableBindParams<TArgs>) => TableCardinality | Promise<TableCardinality>;
|
|
104
|
+
/**
|
|
105
|
+
* Divide this scan into named, independently redeemable splits.
|
|
106
|
+
*
|
|
107
|
+
* Declaring it (together with `meta.supportsSplits`) is what opts a function
|
|
108
|
+
* into the split path; omitting it means the whole scan is one unit of work.
|
|
109
|
+
*
|
|
110
|
+
* A split *names* work rather than describing it. "These three files at
|
|
111
|
+
* version 47" survives a retry; "rows 0-999 of whatever this returns now"
|
|
112
|
+
* does not — and a distributed engine WILL retry, so the difference is
|
|
113
|
+
* correctness, not tidiness. The same split may also be redeemed more than
|
|
114
|
+
* once (recursive CTEs, re-collected DataFrames, task retry) and may be
|
|
115
|
+
* abandoned mid-stream (LIMIT, TopK, an empty join build side); neither is an
|
|
116
|
+
* error.
|
|
117
|
+
*
|
|
118
|
+
* Set only `payload` on each split. The framework stamps the consistency
|
|
119
|
+
* anchor, the bind fingerprint and (where a key exists) the seal.
|
|
120
|
+
*
|
|
121
|
+
* Size splits into comparable units of work and honour `targetSplitBytes`: a
|
|
122
|
+
* claiming client treats them as interchangeable because it cannot see
|
|
123
|
+
* per-split cost, so wildly uneven splits leave its makespan bounded by the
|
|
124
|
+
* largest one.
|
|
125
|
+
*/
|
|
126
|
+
plan?: (params: TableBindParams<TArgs>, request: TableFunctionPlanRequest) => PlanResult | Promise<PlanResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Called on a split init with the VERIFIED payloads for the splits this
|
|
129
|
+
* connection claimed — the envelope is already opened and stripped, so
|
|
130
|
+
* unverified bytes never reach here.
|
|
131
|
+
*
|
|
132
|
+
* Any state carried from planning to reading must live in cross-process
|
|
133
|
+
* storage keyed by `execution_id`: the process that plans is, in the general
|
|
134
|
+
* case, not the process that reads — and under a distributed engine it is not
|
|
135
|
+
* even the same host.
|
|
136
|
+
*/
|
|
137
|
+
onSplit?: (payloads: Uint8Array[], params: TableBindParams<TArgs>) => void | Promise<void>;
|
|
94
138
|
/**
|
|
95
139
|
* Per-column statistics for the function's output. Returned to DuckDB via
|
|
96
140
|
* the `table_function_statistics` RPC; the optimizer uses min/max to
|
|
@@ -134,5 +178,24 @@ export interface TableFunctionConfig<TArgs = Record<string, any>, TState = null>
|
|
|
134
178
|
supportsBatchIndex?: boolean;
|
|
135
179
|
/** Hive-style partition-columns mode; FunctionInfo.partition_kind. */
|
|
136
180
|
partitionKind?: "NOT_PARTITIONED" | "SINGLE_VALUE_PARTITIONS" | "OVERLAPPING_PARTITIONS" | "DISJOINT_PARTITIONS";
|
|
181
|
+
/**
|
|
182
|
+
* This function divides its scan into named, independently redeemable splits;
|
|
183
|
+
* FunctionInfo.supports_splits. Declare it together with `plan` and `onSplit`.
|
|
184
|
+
*
|
|
185
|
+
* It is what a distributed engine reads to decide it can retry a task against
|
|
186
|
+
* this function, and what makes the client call `plan()` at all — without it a
|
|
187
|
+
* split-capable function is scanned as one undivided unit, silently.
|
|
188
|
+
*/
|
|
189
|
+
supportsSplits?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* How long a minted split token stays redeemable, or undefined for UNBOUNDED
|
|
192
|
+
* (NOT "expires immediately"); FunctionInfo.split_token_ttl_seconds.
|
|
193
|
+
*
|
|
194
|
+
* A client refuses a plan whose TTL is below its own scheduling horizon,
|
|
195
|
+
* because an expired token is a failed query rather than a degradation:
|
|
196
|
+
* nothing re-plans when one expires, since a distributed engine retries the
|
|
197
|
+
* serialized task it was handed and has no path back to the planner.
|
|
198
|
+
*/
|
|
199
|
+
splitTokenTtlSeconds?: number;
|
|
137
200
|
}
|
|
138
201
|
export declare function defineTableFunction<TArgs = Record<string, any>, TState = null>(config: TableFunctionConfig<TArgs, TState>): VgiFunction;
|
|
@@ -82,6 +82,38 @@ export interface FunctionMeta {
|
|
|
82
82
|
* `supports_batch_index`.
|
|
83
83
|
*/
|
|
84
84
|
supportsBatchIndex?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* table (generator): the scan divides into named, independently redeemable
|
|
87
|
+
* splits (see the `plan` / `onSplit` hooks). Surfaces as FunctionInfo
|
|
88
|
+
* `supports_splits`.
|
|
89
|
+
*
|
|
90
|
+
* The declaration is what a distributed engine reads to decide whether it can
|
|
91
|
+
* retry a task: a split NAMES its work, so re-running one reads exactly the
|
|
92
|
+
* same rows. Without it, the division lives behind an opaque worker-side queue
|
|
93
|
+
* and a retry reads neither what it read before nor what it missed.
|
|
94
|
+
*/
|
|
95
|
+
supportsSplits?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* table (generator): the worker applies every pushed filter EXACTLY, so the
|
|
98
|
+
* engine may drop its own copy rather than re-filtering. Wrong answers if
|
|
99
|
+
* declared falsely — leave unset unless certain.
|
|
100
|
+
*/
|
|
101
|
+
filtersExactlyApplied?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* table (generator): addressable positions in the data, for incremental and
|
|
104
|
+
* streaming reads. The engine owns the checkpoint; this declares only that
|
|
105
|
+
* positions are meaningful to externalize.
|
|
106
|
+
*/
|
|
107
|
+
supportsPositions?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* table (generator): how long a split token stays redeemable.
|
|
110
|
+
*
|
|
111
|
+
* UNSET MEANS UNBOUNDED, not "expires immediately" — a client must not assume
|
|
112
|
+
* a TTL exists, or long-running streams are foreclosed. A client rejects a
|
|
113
|
+
* plan whose TTL is below its own planning-to-task-start horizon, which on a
|
|
114
|
+
* busy cluster is hours rather than seconds.
|
|
115
|
+
*/
|
|
116
|
+
splitTokenTtlSeconds?: number;
|
|
85
117
|
/**
|
|
86
118
|
* table (generator): Hive-style partition-columns mode. Functions declare
|
|
87
119
|
* a PartitionKind and annotate bind-schema fields; emitted batches carry
|
|
@@ -146,6 +178,12 @@ export interface VgiFunction {
|
|
|
146
178
|
globalInit(request: InitRequest): GlobalInitResponse | Promise<GlobalInitResponse>;
|
|
147
179
|
createStreamHandlers(request: InitRequest, response: GlobalInitResponse, accumulatedState?: any): StreamHandlers;
|
|
148
180
|
cardinality?(request: TableFunctionCardinalityRequest): TableCardinality | Promise<TableCardinality>;
|
|
181
|
+
/**
|
|
182
|
+
* Divide a scan into named, independently redeemable splits. Absent means the
|
|
183
|
+
* function is not split-capable: the whole scan is one unit of work, and the
|
|
184
|
+
* framework answers with a single empty-payload split.
|
|
185
|
+
*/
|
|
186
|
+
plan?(request: import("../protocol/serializers/splits.js").TableFunctionPlanRequest): import("../protocol/serializers/splits.js").PlanResult | Promise<import("../protocol/serializers/splits.js").PlanResult>;
|
|
149
187
|
/**
|
|
150
188
|
* Per-column statistics for this table function's output given the user's
|
|
151
189
|
* bind-time arguments. Returns null/[] when stats are unknown. Wired to the
|
|
@@ -99,6 +99,10 @@ export interface FunctionInfo {
|
|
|
99
99
|
order_preservation?: OrderPreservation | null;
|
|
100
100
|
max_workers?: number | null;
|
|
101
101
|
supports_batch_index: boolean;
|
|
102
|
+
supports_splits: boolean;
|
|
103
|
+
filters_exactly_applied: boolean;
|
|
104
|
+
supports_positions: boolean;
|
|
105
|
+
split_token_ttl_seconds?: number | null;
|
|
102
106
|
partition_kind: PartitionKind;
|
|
103
107
|
order_dependent: OrderDependence;
|
|
104
108
|
distinct_dependent: DistinctDependence;
|
|
@@ -307,6 +311,7 @@ export interface CatalogAttachRequest {
|
|
|
307
311
|
options?: /** @record-batch */ Uint8Array | null;
|
|
308
312
|
data_version_spec?: string | null;
|
|
309
313
|
implementation_version?: string | null;
|
|
314
|
+
client_capabilities?: Uint8Array | null;
|
|
310
315
|
}
|
|
311
316
|
export interface CatalogAttachResult {
|
|
312
317
|
attach_opaque_data: Uint8Array;
|
|
@@ -406,6 +411,8 @@ export interface InitRequest {
|
|
|
406
411
|
projection_ids?: number[] | null;
|
|
407
412
|
pushdown_filters?: /** @record-batch */ Uint8Array | null;
|
|
408
413
|
join_keys?: /** @record-batch */ Uint8Array[] | null;
|
|
414
|
+
split_tokens?: Uint8Array[] | null;
|
|
415
|
+
row_limit?: number | null;
|
|
409
416
|
phase?: TableInOutFunctionInitPhase | null;
|
|
410
417
|
finalize_state_id?: Uint8Array | null;
|
|
411
418
|
execution_id?: Uint8Array | null;
|
|
@@ -467,6 +474,58 @@ export interface TableFunctionDynamicToStringResponse {
|
|
|
467
474
|
keys: string[];
|
|
468
475
|
values: string[];
|
|
469
476
|
}
|
|
477
|
+
export interface TableFunctionPlanRequest {
|
|
478
|
+
bind_call: BindRequest;
|
|
479
|
+
bind_opaque_data?: Uint8Array | null;
|
|
480
|
+
projection_ids?: number[] | null;
|
|
481
|
+
pushdown_filters?: /** @record-batch */ Uint8Array | null;
|
|
482
|
+
join_keys?: /** @record-batch */ Uint8Array[] | null;
|
|
483
|
+
row_limit?: number | null;
|
|
484
|
+
target_split_bytes?: number | null;
|
|
485
|
+
min_splits?: number | null;
|
|
486
|
+
max_splits_per_response?: number | null;
|
|
487
|
+
cursor?: Uint8Array | null;
|
|
488
|
+
refined_filters?: /** @record-batch */ Uint8Array | null;
|
|
489
|
+
filters_complete: boolean;
|
|
490
|
+
start_position?: Uint8Array | null;
|
|
491
|
+
end_position?: Uint8Array | null;
|
|
492
|
+
order_by_column_name?: string | null;
|
|
493
|
+
order_by_direction?: OrderByDirection | null;
|
|
494
|
+
order_by_null_order?: OrderByNullOrder | null;
|
|
495
|
+
order_by_limit?: number | null;
|
|
496
|
+
tablesample_percentage?: number | null;
|
|
497
|
+
tablesample_seed?: number | null;
|
|
498
|
+
}
|
|
499
|
+
export interface ScanSplit {
|
|
500
|
+
payload: Uint8Array;
|
|
501
|
+
token: Uint8Array;
|
|
502
|
+
estimated_rows?: number | null;
|
|
503
|
+
rows_exact: boolean;
|
|
504
|
+
estimated_bytes?: number | null;
|
|
505
|
+
partition_bounds?: /** @record-batch */ Uint8Array | null;
|
|
506
|
+
column_statistics?: Uint8Array | null;
|
|
507
|
+
location_ids?: number[] | null;
|
|
508
|
+
start_position?: Uint8Array | null;
|
|
509
|
+
end_position?: Uint8Array | null;
|
|
510
|
+
}
|
|
511
|
+
export interface PlanResponse {
|
|
512
|
+
splits: ScanSplit[] | Uint8Array[];
|
|
513
|
+
next_cursors?: Uint8Array[] | null;
|
|
514
|
+
execution_id?: Uint8Array | null;
|
|
515
|
+
init_opaque_data?: Uint8Array | null;
|
|
516
|
+
max_workers?: number | null;
|
|
517
|
+
estimated_total_splits?: number | null;
|
|
518
|
+
estimated_total_rows?: number | null;
|
|
519
|
+
estimated_total_bytes?: number | null;
|
|
520
|
+
catalog_version?: number | null;
|
|
521
|
+
scope: string;
|
|
522
|
+
locations?: string[] | null;
|
|
523
|
+
partitioning?: Uint8Array[] | null;
|
|
524
|
+
sort_order?: Uint8Array[] | null;
|
|
525
|
+
cache_max_age_seconds?: number | null;
|
|
526
|
+
start_position?: Uint8Array | null;
|
|
527
|
+
end_position?: Uint8Array | null;
|
|
528
|
+
}
|
|
470
529
|
export interface TableFunctionStatisticsRequest {
|
|
471
530
|
bind_call: BindRequest;
|
|
472
531
|
bind_opaque_data?: Uint8Array | null;
|
|
@@ -9,7 +9,24 @@ export declare const CopyFromFormatInfoSchema: import("../index.core.js").VgiSch
|
|
|
9
9
|
export declare const ScanFunctionResultSchema: import("../index.core.js").VgiSchema;
|
|
10
10
|
export declare const ScanBranchesResultSchema: import("../index.core.js").VgiSchema;
|
|
11
11
|
export declare const ScanBranchSchema: import("../index.core.js").VgiSchema;
|
|
12
|
+
export declare const ScanSplitSchema: import("../index.core.js").VgiSchema;
|
|
12
13
|
export declare const AttachCatalogInfoSchema: import("../index.core.js").VgiSchema;
|
|
14
|
+
export declare const AggregateBindRequestSchema: import("../index.core.js").VgiSchema;
|
|
15
|
+
export declare const AggregateCombineRequestSchema: import("../index.core.js").VgiSchema;
|
|
16
|
+
export declare const AggregateDestructorRequestSchema: import("../index.core.js").VgiSchema;
|
|
17
|
+
export declare const AggregateFinalizeRequestSchema: import("../index.core.js").VgiSchema;
|
|
18
|
+
export declare const AggregateUpdateRequestSchema: import("../index.core.js").VgiSchema;
|
|
19
|
+
export declare const BindRequestSchema: import("../index.core.js").VgiSchema;
|
|
20
|
+
export declare const CatalogAttachRequestSchema: import("../index.core.js").VgiSchema;
|
|
21
|
+
export declare const CopyFromContextSchema: import("../index.core.js").VgiSchema;
|
|
22
|
+
export declare const CopyToContextSchema: import("../index.core.js").VgiSchema;
|
|
23
|
+
export declare const GlobalInitResponseSchema: import("../index.core.js").VgiSchema;
|
|
24
|
+
export declare const InitRequestSchema: import("../index.core.js").VgiSchema;
|
|
25
|
+
export declare const TableBufferingCombineRequestSchema: import("../index.core.js").VgiSchema;
|
|
26
|
+
export declare const TableBufferingDestructorRequestSchema: import("../index.core.js").VgiSchema;
|
|
27
|
+
export declare const TableBufferingProcessRequestSchema: import("../index.core.js").VgiSchema;
|
|
28
|
+
export declare const TableFunctionCardinalityRequestSchema: import("../index.core.js").VgiSchema;
|
|
29
|
+
export declare const TableFunctionPlanRequestSchema: import("../index.core.js").VgiSchema;
|
|
13
30
|
export declare const AggregateBindResultSchema: import("../index.core.js").VgiSchema;
|
|
14
31
|
export declare const AggregateCombineResultSchema: import("../index.core.js").VgiSchema;
|
|
15
32
|
export declare const AggregateDestructorResultSchema: import("../index.core.js").VgiSchema;
|
|
@@ -44,6 +61,7 @@ export declare const TableBufferingDestructorResultSchema: import("../index.core
|
|
|
44
61
|
export declare const TableBufferingProcessResultSchema: import("../index.core.js").VgiSchema;
|
|
45
62
|
export declare const TableFunctionCardinalityResultSchema: import("../index.core.js").VgiSchema;
|
|
46
63
|
export declare const TableFunctionDynamicToStringResultSchema: import("../index.core.js").VgiSchema;
|
|
64
|
+
export declare const TableFunctionPlanResultSchema: import("../index.core.js").VgiSchema;
|
|
47
65
|
export declare const AggregateBindParamsSchema: import("../index.core.js").VgiSchema;
|
|
48
66
|
export declare const AggregateCombineParamsSchema: import("../index.core.js").VgiSchema;
|
|
49
67
|
export declare const AggregateDestructorParamsSchema: import("../index.core.js").VgiSchema;
|
|
@@ -113,4 +131,5 @@ export declare const TableBufferingDestructorParamsSchema: import("../index.core
|
|
|
113
131
|
export declare const TableBufferingProcessParamsSchema: import("../index.core.js").VgiSchema;
|
|
114
132
|
export declare const TableFunctionCardinalityParamsSchema: import("../index.core.js").VgiSchema;
|
|
115
133
|
export declare const TableFunctionDynamicToStringParamsSchema: import("../index.core.js").VgiSchema;
|
|
134
|
+
export declare const TableFunctionPlanParamsSchema: import("../index.core.js").VgiSchema;
|
|
116
135
|
export declare const TableFunctionStatisticsParamsSchema: import("../index.core.js").VgiSchema;
|
package/dist/http/fetch.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AuthenticateFn } from "@query-farm/vgi-rpc";
|
|
1
2
|
import { type ProtocolConfig } from "../protocol/dispatch.js";
|
|
2
3
|
import { type LandingInfo } from "./landing.js";
|
|
3
4
|
export interface VgiFetchOptions {
|
|
@@ -42,6 +43,15 @@ export interface VgiFetchOptions {
|
|
|
42
43
|
* its required name/doc/version; the CF entry had to remember, and
|
|
43
44
|
* vgi-open-meteo shipped for weeks without it. */
|
|
44
45
|
landingInfo: LandingInfo;
|
|
46
|
+
/** Authenticates each incoming request, returning the caller's
|
|
47
|
+
* {@link AuthContext}. Forwarded verbatim to `createHttpHandler`; omit it
|
|
48
|
+
* and every caller is anonymous, which is what this package did before the
|
|
49
|
+
* option existed.
|
|
50
|
+
*
|
|
51
|
+
* Supplying it is what makes a worker able to serve more than one principal,
|
|
52
|
+
* and the identity it returns is the one the worker seals `attach_opaque_data`
|
|
53
|
+
* and split tokens under. */
|
|
54
|
+
authenticate?: AuthenticateFn;
|
|
45
55
|
}
|
|
46
56
|
/**
|
|
47
57
|
* Build a fetch handler suitable for `export default { fetch }` in a CF
|
package/dist/index.core.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { defineTableBufferingFunction, type TableBufferingConfig, type TableBuff
|
|
|
7
7
|
export { defineCopyFromFunction, type CopyFromFunctionConfig, type CopyFromOption, type CopyFromReadParams, } from "./functions/copy-from.js";
|
|
8
8
|
export { defineCopyToFunction, type CopyToFunctionConfig, type CopyToOption, type CopyToWriteParams, type CopyToCloseParams, } from "./functions/copy-to.js";
|
|
9
9
|
export type { VgiFunction, FunctionMeta, StreamHandlers, FunctionExample, HandlerState } from "./functions/types.js";
|
|
10
|
-
export { CatalogInterface, type CatalogAttachResult, type SchemaInfo, encodeSchemaInfo, decodeSchemaInfo, type TableInfo, encodeTableInfo, decodeTableInfo, type ViewInfo, encodeViewInfo, decodeViewInfo, type CatalogInfo, encodeCatalogInfo, decodeCatalogInfo, type FunctionInfo, encodeFunctionInfo, decodeFunctionInfo, type FunctionInfoOptions, type MacroInfo, encodeMacroInfo, decodeMacroInfo, type MacroType, type CopyFromFormatInfo, encodeCopyFromFormatInfo, type AttachOpaqueData, type TransactionOpaqueData, buildScanBranchesResult, type ScanBranchInput } from "./catalog/interface.js";
|
|
10
|
+
export { CatalogInterface, type CatalogAttachResult, type SchemaInfo, encodeSchemaInfo, decodeSchemaInfo, type TableInfo, encodeTableInfo, decodeTableInfo, type ViewInfo, encodeViewInfo, decodeViewInfo, type CatalogInfo, encodeCatalogInfo, decodeCatalogInfo, type FunctionInfo, encodeFunctionInfo, decodeFunctionInfo, type FunctionInfoOptions, type MacroInfo, encodeMacroInfo, decodeMacroInfo, type MacroType, type CopyFromFormatInfo, encodeCopyFromFormatInfo, type AttachOpaqueData, type TransactionOpaqueData, buildScanBranchesResult, encodeFormatOptions, type ScanBranchInput } from "./catalog/interface.js";
|
|
11
11
|
export type { CatalogDescriptor, SchemaDescriptor, TableDescriptor, ViewDescriptor, MacroDescriptor, SettingDescriptor, SecretTypeDescriptor, ForeignKeyDef, DefaultValue } from "./catalog/descriptors.js";
|
|
12
12
|
export { ReadOnlyCatalogInterface } from "./catalog/read-only.js";
|
|
13
13
|
export { CompositeCatalogInterface } from "./catalog/composite.js";
|
|
@@ -33,7 +33,7 @@ export { toUint8Array } from "./util/bytes.js";
|
|
|
33
33
|
export { iterRows, batchFromRows, batchFromColumns, emptyBatch, filterBatch, projectSchema, projectBatch, batchToScalarDict, batchToSecretDict, safeNumber, } from "./util/arrow/index.js";
|
|
34
34
|
export { type SecretFields, type SecretsDict, secretType, secretsOfType, secretForScope, secretForScopeOfType, } from "./secrets/helpers.js";
|
|
35
35
|
export { serializeSchema, deserializeSchema, serializeBatch, deserializeBatch, } from "./util/arrow/index.js";
|
|
36
|
-
export { schema, field, nullType, int8, int16, int64, uint8, uint16, uint32, uint64, float16, float64, utf8, binary, fixedSizeBinary, decimal, decimal128, decimal256, date, dateDay, dateMillisecond, time, timeSecond, timeMillisecond, timeMicrosecond, timeNanosecond, timestamp, duration, interval, timestampSeconds, timestampMillis, timestampMicros, timestampNanos, durationSeconds, durationMillis, durationMicros, durationNanos, list, fixedSizeList, struct, map, dictionary, union, sparseUnion, denseUnion, TimeUnit, DateUnit, IntervalUnit, UnionMode, codecFor, asDate32, asDate64Ms, asTime32S, asTime32Ms, asTime64Us, asTime64Ns, asTimestampSeconds, asTimestampMillis, asTimestampMicros, asTimestampNanos, asDurationSeconds, asDurationMillis, asDurationMicros, asDurationNanos, asUnscaledDecimal, asInt64, asUint64, fromBranded, fromBrandedNumber, fromBrandedBigInt, TypeId, isNull, isInt, isFloat, isBinary, isUtf8, isBool, isDecimal, isDate, isTime, isTimestamp, isInterval, isList, isStruct, isUnion, isFixedSizeBinary, isFixedSizeList, isMap, isDuration, isDictionary, isBatch, typeSignature, readCanonicalValue, columnFromArray, decodeDictValue, backend, adoptArrowJsShape, } from "./arrow/index.js";
|
|
36
|
+
export { schema, field, nullType, int8, int16, int64, uint8, uint16, uint32, uint64, float16, float64, utf8, largeUtf8, binary, largeBinary, fixedSizeBinary, decimal, decimal128, decimal256, date, dateDay, dateMillisecond, time, timeSecond, timeMillisecond, timeMicrosecond, timeNanosecond, timestamp, duration, interval, timestampSeconds, timestampMillis, timestampMicros, timestampNanos, durationSeconds, durationMillis, durationMicros, durationNanos, list, fixedSizeList, struct, map, dictionary, union, sparseUnion, denseUnion, TimeUnit, DateUnit, IntervalUnit, UnionMode, codecFor, asDate32, asDate64Ms, asTime32S, asTime32Ms, asTime64Us, asTime64Ns, asTimestampSeconds, asTimestampMillis, asTimestampMicros, asTimestampNanos, asDurationSeconds, asDurationMillis, asDurationMicros, asDurationNanos, asUnscaledDecimal, asInt64, asUint64, fromBranded, fromBrandedNumber, fromBrandedBigInt, TypeId, isNull, isInt, isFloat, isBinary, isUtf8, isBool, isDecimal, isDate, isTime, isTimestamp, isInterval, isList, isStruct, isUnion, isFixedSizeBinary, isFixedSizeList, isMap, isDuration, isDictionary, isBatch, typeSignature, readCanonicalValue, columnFromArray, decodeDictValue, backend, adoptArrowJsShape, } from "./arrow/index.js";
|
|
37
37
|
export type { VgiTypeId, VgiDataType, VgiField, VgiSchema, VgiColumn, VgiColumnData, VgiBatch, VgiBackendInfo, TaggedUnion, NullDescriptor, BoolType, IntType, Int8Type, Int16Type, Int32Type, Int64Type, Uint8Type, Uint16Type, Uint32Type, Uint64Type, FloatType, Utf8Type, LargeUtf8Type, BinaryType, LargeBinaryType, FixedSizeBinaryType, DecimalType, Date32Type, Date64Type, Time32Type, Time64Type, TimestampType, DurationType, IntervalType, ListType, FixedSizeListType, StructType, MapType, DictionaryType, UnionType, TypedField, TUnit, RichValue, RawValue, ValueFor, Repr, Codec, Branded, Date32, Date64Ms, Time32S, Time32Ms, Time64Us, Time64Ns, TimestampSeconds, TimestampMillis, TimestampMicros, TimestampNanos, DurationSeconds, DurationMillis, DurationMicros, DurationNanos, UnscaledDecimal, Int64Raw, Uint64Raw, } from "./arrow/index.js";
|
|
38
38
|
export type { ScalarComputeRow, ScalarOutputValue, ScalarComputeResult } from "./functions/scalar.js";
|
|
39
39
|
export { type FunctionStorage, FunctionStorageSqlite, BoundStorage, UnknownInvocationError, resolveStorageFromEnv, setStorage, storage as functionStorage, } from "./functions/storage.js";
|