@query-farm/vgi 0.46.0 → 0.47.1
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 +11 -5
- package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
- package/dist/arrow/impl-arrowjs/iterate.d.ts +2 -0
- package/dist/arrow/impl-flechette/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +2 -0
- package/dist/arrow/index.d.ts +1 -1
- package/dist/catalog/column-expressions.d.ts +8 -0
- package/dist/catalog/column-metadata.d.ts +11 -0
- package/dist/catalog/composite.d.ts +2 -1
- package/dist/catalog/constraints.d.ts +74 -0
- package/dist/catalog/descriptors.d.ts +21 -29
- package/dist/catalog/interface.d.ts +15 -20
- package/dist/catalog/macro-overloads.d.ts +4 -0
- package/dist/catalog/read-only.d.ts +7 -1
- package/dist/catalog/unconstrained-columns.d.ts +2 -0
- package/dist/client/client.d.ts +18 -13
- package/dist/client-entry.js +753 -103
- package/dist/client-entry.js.map +16 -14
- package/dist/functions/projection.d.ts +18 -0
- package/dist/functions/table.d.ts +6 -1
- package/dist/functions/types.d.ts +1 -0
- package/dist/generated/vgi-client.d.ts +177 -36
- package/dist/generated/vgi-protocol-schemas.d.ts +51 -1
- package/dist/generated/vgi-protocol-types.d.ts +317 -3
- package/dist/generated/vgi-service.d.ts +266 -29
- package/dist/index.core.d.ts +3 -1
- package/dist/index.js +1630 -240
- package/dist/index.js.map +41 -34
- package/dist/protocol/dispatch.d.ts +9 -9
- package/dist/protocol/handlers/aggregate.d.ts +1 -1
- package/dist/protocol/handlers/catalog/index.d.ts +1 -1
- package/dist/protocol/handlers/catalog/metadata.d.ts +1 -0
- package/dist/protocol/handlers/function.d.ts +1 -1
- package/dist/protocol/handlers/table-buffering.d.ts +1 -1
- package/dist/protocol/handlers/unimplemented.d.ts +1 -1
- package/dist/protocol/serializers/bind.d.ts +5 -1
- package/dist/protocol/types.d.ts +5 -0
- package/dist/rpc-server.d.ts +6 -6
- package/dist/serve-entry.js +1613 -447
- package/dist/serve-entry.js.map +32 -26
- package/dist/util/arrow/index.d.ts +1 -1
- package/dist/worker-cf-entry.d.ts +2 -2
- package/dist/worker-cf-entry.js +1943 -572
- package/dist/worker-cf-entry.js.map +41 -34
- package/dist/worker.d.ts +1 -1
- package/package.json +5 -4
- package/src/arrow/impl-arrowjs/index.ts +1 -1
- package/src/arrow/impl-arrowjs/iterate.ts +9 -1
- package/src/arrow/impl-arrowjs/project.ts +1 -1
- package/src/arrow/impl-flechette/index.ts +1 -1
- package/src/arrow/impl-flechette/ipc.ts +12 -0
- package/src/arrow/impl-flechette/iterate.ts +5 -0
- package/src/arrow/impl-flechette/project.ts +6 -8
- package/src/arrow/index.ts +1 -1
- package/src/catalog/column-expressions.ts +224 -0
- package/src/catalog/column-metadata.ts +151 -0
- package/src/catalog/composite.ts +5 -1
- package/src/catalog/constraints.ts +207 -0
- package/src/catalog/contents-codec.ts +6 -1
- package/src/catalog/descriptors.ts +21 -29
- package/src/catalog/interface.ts +70 -55
- package/src/catalog/macro-overloads.ts +44 -0
- package/src/catalog/read-only.ts +92 -71
- package/src/catalog/unconstrained-columns.ts +23 -0
- package/src/client/client.ts +100 -58
- package/src/codec/asd.ts +3 -1
- package/src/functions/projection.ts +207 -0
- package/src/functions/table.ts +10 -0
- package/src/functions/types.ts +1 -0
- package/src/generated/vgi-client.ts +199 -37
- package/src/generated/vgi-protocol-schemas.ts +455 -41
- package/src/generated/vgi-protocol-types.ts +879 -5
- package/src/generated/vgi-service.ts +514 -42
- package/src/http/client-bundle.ts +1 -1
- package/src/http/fetch.ts +1 -1
- package/src/index.core.ts +5 -0
- package/src/protocol/dispatch.ts +9 -9
- package/src/protocol/handlers/aggregate.ts +1 -1
- package/src/protocol/handlers/catalog/admin.ts +27 -6
- package/src/protocol/handlers/catalog/index.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +6 -5
- package/src/protocol/handlers/catalog/metadata.ts +16 -0
- package/src/protocol/handlers/catalog/table.ts +72 -26
- package/src/protocol/handlers/catalog/view.ts +24 -3
- package/src/protocol/handlers/function.ts +67 -1
- package/src/protocol/handlers/table-buffering.ts +1 -1
- package/src/protocol/handlers/unimplemented.ts +6 -6
- package/src/protocol/serializers/bind.ts +17 -1
- package/src/protocol/types.ts +6 -0
- package/src/rpc-server.ts +9 -9
- package/src/util/arrow/index.ts +1 -1
- package/src/worker-cf-entry.ts +6 -0
- package/src/worker.ts +1 -1
|
@@ -21,7 +21,7 @@ export interface ProtocolConfig {
|
|
|
21
21
|
* The name carries the major version, so an incompatible major is a
|
|
22
22
|
* *different* protocol and therefore a 404 — an answer every proxy, WAF and
|
|
23
23
|
* load balancer understands without an Arrow parser, and one that lets
|
|
24
|
-
* `vgi.v2` and
|
|
24
|
+
* `vgi.v2` and `vgi.v3` be served side by side while clients migrate.
|
|
25
25
|
* That matters for this consumer specifically: the DuckDB extension ships to
|
|
26
26
|
* users and cannot be flag-dayed.
|
|
27
27
|
*
|
|
@@ -42,23 +42,23 @@ export interface ProtocolConfig {
|
|
|
42
42
|
*/
|
|
43
43
|
export { VGI_PROTOCOL_NAME };
|
|
44
44
|
/**
|
|
45
|
-
* The `vgi.
|
|
46
|
-
* worker: the reference's
|
|
47
|
-
* every `vgi.
|
|
45
|
+
* The `vgi.v3` protocol hash `vgi_rpc.Reflection.v1` must report for this
|
|
46
|
+
* worker: the combined reference's 85 methods. Every SDK hosts
|
|
47
|
+
* every `vgi.v3` method with the reference's schemas, so the hash is one value
|
|
48
48
|
* across the ports; a method this SDK does not implement is still registered
|
|
49
49
|
* with the generated UNIMPLEMENTED default (src/generated/vgi-service.ts). The
|
|
50
50
|
* hash covers method names, types and the params/result/header schemas only
|
|
51
51
|
* (WIRE_PROTOCOL.md §14).
|
|
52
52
|
*
|
|
53
|
-
* It changes only with vgi.
|
|
54
|
-
* by src/protocol/__tests__/vgi-
|
|
53
|
+
* It changes only with vgi.v3's protocol version (currently 3.0.0). Asserted
|
|
54
|
+
* by src/protocol/__tests__/vgi-v3-hash.test.ts; if that test fails, the
|
|
55
55
|
* surface drifted from the reference -- fix the schemas, do not bump this.
|
|
56
56
|
*/
|
|
57
|
-
export declare const
|
|
57
|
+
export declare const VGI_V3_PROTOCOL_HASH = "50e9404173bee3262e96b8939eb5c425463336abca2a17916812d68b6e0f6cad";
|
|
58
58
|
/**
|
|
59
|
-
* This worker's `vgi.
|
|
59
|
+
* This worker's `vgi.v3` implementation: the generated UNIMPLEMENTED default
|
|
60
60
|
* for every method, overridden by the handler groups for what this SDK serves.
|
|
61
61
|
*/
|
|
62
62
|
export declare function buildVgiService(config: ProtocolConfig): VgiService;
|
|
63
|
-
/** The `vgi.
|
|
63
|
+
/** The `vgi.v3` protocol, registered from the generated table with {@link buildVgiService}. */
|
|
64
64
|
export declare function buildVgiProtocol(config: ProtocolConfig): Protocol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { VgiService } from "../../generated/vgi-service.js";
|
|
2
2
|
import type { FunctionRegistry } from "../../functions/registry.js";
|
|
3
|
-
/** The aggregate lifecycle's `vgi.
|
|
3
|
+
/** The aggregate lifecycle's `vgi.v3` handlers. */
|
|
4
4
|
export declare function aggregateHandlers(registry: FunctionRegistry): Partial<VgiService>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CatalogInterface } from "../../../catalog/interface.js";
|
|
2
2
|
import type { VgiService } from "../../../generated/vgi-service.js";
|
|
3
|
-
/** The catalog_* `vgi.
|
|
3
|
+
/** The catalog_* `vgi.v3` handlers, over *catalog* (or `NoCatalogError` without one). */
|
|
4
4
|
export declare function catalogHandlers(catalog: CatalogInterface | undefined, signingKey?: Uint8Array): Partial<VgiService>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function catalogStringMap(raw: any): Record<string, string>;
|
|
@@ -23,5 +23,5 @@ export interface FunctionHandlerConfig {
|
|
|
23
23
|
version?(attach: Uint8Array, txn?: Uint8Array): number | Promise<number>;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
/** The per-function lifecycle's `vgi.
|
|
26
|
+
/** The per-function lifecycle's `vgi.v3` handlers. */
|
|
27
27
|
export declare function functionHandlers(config: FunctionHandlerConfig): Partial<VgiService>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { VgiService } from "../../generated/vgi-service.js";
|
|
2
2
|
import type { FunctionRegistry } from "../../functions/registry.js";
|
|
3
|
-
/** The table_buffering lifecycle's `vgi.
|
|
3
|
+
/** The table_buffering lifecycle's `vgi.v3` handlers. */
|
|
4
4
|
export declare function tableBufferingHandlers(registry: FunctionRegistry, signingKey?: Uint8Array): Partial<VgiService>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type VgiMethodSpec } from "../../generated/vgi-service.js";
|
|
2
2
|
export { unimplementedMessage } from "../../generated/vgi-service.js";
|
|
3
|
-
/** The vgi.
|
|
3
|
+
/** The vgi.v3 methods (of the reference's 72) this SDK leaves at the generated default. */
|
|
4
4
|
export declare const UNIMPLEMENTED_METHODS: readonly VgiMethodSpec[];
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type VgiSchema, type VgiBatch } from "../../arrow/index.js";
|
|
2
|
-
import type { BindRequest, BindResponse } from "../types.js";
|
|
2
|
+
import type { BindRequest, BindResponse, BindRepeatability } from "../types.js";
|
|
3
3
|
declare const BIND_REQUEST_SCHEMA: VgiSchema;
|
|
4
4
|
export declare function serializeBindRequest(req: BindRequest): VgiBatch;
|
|
5
5
|
export declare function deserializeBindRequest(params: Record<string, any>): BindRequest;
|
|
6
|
+
/** Validate required wire enum values, including rejecting NULL and absent values. */
|
|
7
|
+
export declare function parseBindRepeatability(value: unknown): BindRepeatability;
|
|
8
|
+
/** Only omitted provider declarations default; explicit NULL remains invalid. */
|
|
9
|
+
export declare function normalizeBindRepeatability(value: unknown): BindRepeatability;
|
|
6
10
|
export declare function serializeBindResponse(resp: BindResponse): Record<string, any>;
|
|
7
11
|
export declare function deserializeBindResponse(params: Record<string, any>): BindResponse;
|
|
8
12
|
export { BIND_REQUEST_SCHEMA };
|
package/dist/protocol/types.d.ts
CHANGED
|
@@ -88,7 +88,12 @@ export interface BindRequest {
|
|
|
88
88
|
*/
|
|
89
89
|
argument_names?: (string | null)[] | null;
|
|
90
90
|
}
|
|
91
|
+
/** Equivalent scans of one bound state within a query; independent binds may differ. */
|
|
92
|
+
export type BindRepeatability = "UNKNOWN" | "STABLE_WITHIN_QUERY";
|
|
91
93
|
export interface BindResponse {
|
|
94
|
+
/** Omitted provider values serialize as UNKNOWN. Wire values are required. */
|
|
95
|
+
repeatability?: BindRepeatability;
|
|
96
|
+
projection_expression_profiles?: string[];
|
|
92
97
|
output_schema: VgiSchema;
|
|
93
98
|
opaque_data: Uint8Array | null;
|
|
94
99
|
lookup_secret_types?: string[];
|
package/dist/rpc-server.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type ServerTransport = "pipe" | "unix" | "tcp" | "iroh" | "stream" | "htt
|
|
|
8
8
|
/** Environment variable naming the principals allowed to call `introspect_token`. */
|
|
9
9
|
export declare const INTROSPECT_PRINCIPALS_ENV = "VGI_INTROSPECT_PRINCIPALS";
|
|
10
10
|
/**
|
|
11
|
-
* What a worker hosts beyond `vgi.
|
|
11
|
+
* What a worker hosts beyond `vgi.v3`, and whether it opts into identity.
|
|
12
12
|
*
|
|
13
13
|
* Accepted by `new Worker({...})`, `serveVgiWorker`, `createVgiWorkerFetch`
|
|
14
14
|
* and `createVgiFetch` (Cloudflare Workers) alike, so one worker definition
|
|
@@ -16,20 +16,20 @@ export declare const INTROSPECT_PRINCIPALS_ENV = "VGI_INTROSPECT_PRINCIPALS";
|
|
|
16
16
|
*/
|
|
17
17
|
export interface HostingOptions {
|
|
18
18
|
/**
|
|
19
|
-
* Additional vgi-rpc protocols to host beside `vgi.
|
|
19
|
+
* Additional vgi-rpc protocols to host beside `vgi.v3`, on the **same**
|
|
20
20
|
* listener, whatever the transport.
|
|
21
21
|
*
|
|
22
22
|
* A vgi-rpc `Protocol` carries its handlers, so each entry is a whole
|
|
23
23
|
* `(protocol, implementation)` pair. Called **once**, when the server is
|
|
24
24
|
* built; it may consult configuration or the environment, but the answer is
|
|
25
25
|
* fixed for the life of the process, so reflection output and protocol
|
|
26
|
-
* hashes stay stable. Hosted after `vgi.
|
|
26
|
+
* hashes stay stable. Hosted after `vgi.v3`, in the order returned.
|
|
27
27
|
*
|
|
28
28
|
* The protocol is the unit of optionality: there is no way to host a subset
|
|
29
29
|
* of a protocol's methods. A capability that is optional is its own
|
|
30
30
|
* protocol, returned here or not.
|
|
31
31
|
*
|
|
32
|
-
* Each needs a distinct wire name, which may not be `vgi.
|
|
32
|
+
* Each needs a distinct wire name, which may not be `vgi.v3` and may not
|
|
33
33
|
* use the reserved `vgi_rpc.` prefix: reflection is hosted automatically and
|
|
34
34
|
* `vgi_rpc.Identity.v2` is enabled through {@link resolveToken} /
|
|
35
35
|
* {@link mintGrant}. Violations are a startup error naming this hook.
|
|
@@ -110,14 +110,14 @@ export interface BuildRpcServerOptions {
|
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
-
* Build the vgi-rpc server for a worker's `vgi.
|
|
113
|
+
* Build the vgi-rpc server for a worker's `vgi.v3` protocol on `transport`.
|
|
114
114
|
*
|
|
115
115
|
* Calls `hosting.hostedProtocols()` exactly once and hosts the result beside
|
|
116
116
|
* `primary`; see the module comment for the full hosted set.
|
|
117
117
|
*
|
|
118
118
|
* @throws TypeError `hostedProtocols()` returned something other than an
|
|
119
119
|
* iterable of vgi-rpc `Protocol`s.
|
|
120
|
-
* @throws Error A hosted protocol's name is invalid, reserved, `vgi.
|
|
120
|
+
* @throws Error A hosted protocol's name is invalid, reserved, `vgi.v3`'s, or
|
|
121
121
|
* repeated; the transport is unknown; or the worker supplies `resolveToken`
|
|
122
122
|
* on HTTP with no introspector allowlist.
|
|
123
123
|
*/
|