@query-farm/vgi 0.41.0 → 0.42.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/dist/index.js +34 -1
- package/dist/index.js.map +5 -4
- package/dist/protocol/dispatch.d.ts +13 -0
- package/dist/protocol/handlers/unimplemented.d.ts +17 -0
- package/dist/serve-entry.js +34 -1
- package/dist/serve-entry.js.map +5 -4
- package/dist/worker-cf-entry.js +34 -1
- package/dist/worker-cf-entry.js.map +5 -4
- package/package.json +1 -1
- package/src/protocol/dispatch.ts +16 -0
- package/src/protocol/handlers/unimplemented.ts +74 -0
|
@@ -39,4 +39,17 @@ export interface ProtocolConfig {
|
|
|
39
39
|
* protocol is registered under rather than a second copy of the literal.
|
|
40
40
|
*/
|
|
41
41
|
export declare const VGI_PROTOCOL_NAME = "vgi.v2";
|
|
42
|
+
/**
|
|
43
|
+
* The `vgi.v2` protocol hash `vgi_rpc.Reflection.v1` must report for this
|
|
44
|
+
* worker: the reference's (vgi-python 0.43.0, 72 methods). Every SDK hosts
|
|
45
|
+
* every `vgi.v2` method with the reference's schemas, so the hash is one value
|
|
46
|
+
* across the ports; a method this SDK does not implement is still registered
|
|
47
|
+
* (handlers/unimplemented.ts). The hash covers method names, types and the
|
|
48
|
+
* params/result/header schemas only (WIRE_PROTOCOL.md §14).
|
|
49
|
+
*
|
|
50
|
+
* It changes only with vgi.v2's protocol version (currently 2.1.0). Asserted
|
|
51
|
+
* by src/protocol/__tests__/vgi-v2-hash.test.ts; if that test fails, the
|
|
52
|
+
* surface drifted from the reference -- fix the schemas, do not bump this.
|
|
53
|
+
*/
|
|
54
|
+
export declare const VGI_V2_PROTOCOL_HASH = "774cb80090d71ea76d09aa311b9cda4ca4c33c3bf72c43242eb6dc87b6f79ce5";
|
|
42
55
|
export declare function buildVgiProtocol(config: ProtocolConfig): Protocol;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Protocol } from "@query-farm/vgi-rpc";
|
|
2
|
+
import type { VgiSchema } from "../../arrow/index.js";
|
|
3
|
+
/** One unimplemented method: its wire name and the reference's schemas. */
|
|
4
|
+
interface UnimplementedMethod {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly params: VgiSchema;
|
|
7
|
+
readonly result: VgiSchema;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The vgi.v2 methods (of the reference's 72) this SDK does not implement.
|
|
11
|
+
* Exported so a test can assert each one refuses with UNIMPLEMENTED.
|
|
12
|
+
*/
|
|
13
|
+
export declare const UNIMPLEMENTED_METHODS: readonly UnimplementedMethod[];
|
|
14
|
+
/** The message every unimplemented method answers with. */
|
|
15
|
+
export declare function unimplementedMessage(method: string): string;
|
|
16
|
+
export declare function registerUnimplementedMethods(protocol: Protocol): void;
|
|
17
|
+
export {};
|
package/dist/serve-entry.js
CHANGED
|
@@ -7371,6 +7371,38 @@ function registerCatalogMethods(protocol, catalog, _catalogName, signingKey) {
|
|
|
7371
7371
|
registerCatalogIndexMethods(protocol, getCatalog, signingKey);
|
|
7372
7372
|
}
|
|
7373
7373
|
|
|
7374
|
+
// src/protocol/handlers/unimplemented.ts
|
|
7375
|
+
import { MethodNotImplementedError } from "@query-farm/vgi-rpc";
|
|
7376
|
+
var UNIMPLEMENTED_METHODS = [
|
|
7377
|
+
{ name: "aggregate_streaming_open", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7378
|
+
{ name: "aggregate_streaming_chunk", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7379
|
+
{ name: "aggregate_streaming_close", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7380
|
+
{ name: "aggregate_window_init", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7381
|
+
{ name: "aggregate_window", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7382
|
+
{ name: "aggregate_window_batch", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7383
|
+
{ name: "aggregate_window_destructor", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
7384
|
+
{ name: "catalog_index_create", params: CatalogIndexCreateParamsSchema, result: emptyResultSchema },
|
|
7385
|
+
{ name: "catalog_index_drop", params: CatalogIndexDropParamsSchema, result: emptyResultSchema },
|
|
7386
|
+
{ name: "catalog_table_column_comment_set", params: CatalogTableColumnCommentSetParamsSchema, result: emptyResultSchema },
|
|
7387
|
+
{ name: "catalog_table_insert_function_get", params: CatalogTableInsertFunctionGetParamsSchema, result: RESULT_BINARY_SCHEMA },
|
|
7388
|
+
{ name: "catalog_table_update_function_get", params: CatalogTableUpdateFunctionGetParamsSchema, result: RESULT_BINARY_SCHEMA },
|
|
7389
|
+
{ name: "catalog_table_delete_function_get", params: CatalogTableDeleteFunctionGetParamsSchema, result: RESULT_BINARY_SCHEMA }
|
|
7390
|
+
];
|
|
7391
|
+
function unimplementedMessage(method) {
|
|
7392
|
+
return `${method} is not implemented by this worker`;
|
|
7393
|
+
}
|
|
7394
|
+
function registerUnimplementedMethods(protocol) {
|
|
7395
|
+
for (const m of UNIMPLEMENTED_METHODS) {
|
|
7396
|
+
protocol.unary(m.name, {
|
|
7397
|
+
params: m.params,
|
|
7398
|
+
result: m.result,
|
|
7399
|
+
handler: async () => {
|
|
7400
|
+
throw new MethodNotImplementedError(unimplementedMessage(m.name));
|
|
7401
|
+
}
|
|
7402
|
+
});
|
|
7403
|
+
}
|
|
7404
|
+
}
|
|
7405
|
+
|
|
7374
7406
|
// src/protocol/dispatch.ts
|
|
7375
7407
|
var VGI_PROTOCOL_NAME = "vgi.v2";
|
|
7376
7408
|
function buildVgiProtocol(config) {
|
|
@@ -7383,6 +7415,7 @@ function buildVgiProtocol(config) {
|
|
|
7383
7415
|
registerAggregateMethods(protocol, config.registry);
|
|
7384
7416
|
registerTableBufferingMethods(protocol, config.registry, config.signingKey);
|
|
7385
7417
|
registerCatalogMethods(protocol, config.catalogInterface, config.catalogName, config.signingKey);
|
|
7418
|
+
registerUnimplementedMethods(protocol);
|
|
7386
7419
|
return protocol;
|
|
7387
7420
|
}
|
|
7388
7421
|
|
|
@@ -7826,4 +7859,4 @@ export {
|
|
|
7826
7859
|
serveVgiWorker
|
|
7827
7860
|
};
|
|
7828
7861
|
|
|
7829
|
-
//# debugId=
|
|
7862
|
+
//# debugId=6B882607A7F5F68164756E2164756E21
|