@query-farm/vgi 0.48.0 → 0.48.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/dist/arguments/argument-spec.d.ts +17 -11
- package/dist/catalog/descriptors.d.ts +2 -2
- package/dist/catalog/publication.d.ts +7 -7
- package/dist/client/client.d.ts +9 -3
- package/dist/client/errors.d.ts +2 -2
- package/dist/client/types.d.ts +21 -0
- package/dist/client-entry.d.ts +1 -1
- package/dist/client-entry.js +31 -7
- package/dist/client-entry.js.map +20 -20
- package/dist/filter-pushdown/deserialize.d.ts +1 -1
- package/dist/filter-pushdown/types.d.ts +10 -10
- package/dist/functions/scalar.d.ts +1 -1
- package/dist/functions/table-buffering.d.ts +20 -20
- package/dist/functions/table-in-out.d.ts +4 -4
- package/dist/functions/table.d.ts +7 -7
- package/dist/functions/types.d.ts +47 -47
- package/dist/http/fetch.d.ts +10 -10
- package/dist/index.core.d.ts +1 -1
- package/dist/index.js +155 -94
- package/dist/index.js.map +53 -52
- package/dist/protocol/dispatch.d.ts +3 -3
- package/dist/protocol/handlers/function.d.ts +2 -2
- package/dist/protocol/serializers/cardinality.d.ts +4 -1
- package/dist/protocol/types.d.ts +5 -5
- package/dist/rpc-server.d.ts +6 -6
- package/dist/serve-entry.d.ts +16 -16
- package/dist/serve-entry.js +42 -21
- package/dist/serve-entry.js.map +38 -37
- package/dist/split-token.d.ts +6 -6
- package/dist/types.d.ts +9 -2
- package/dist/util/defined.d.ts +21 -0
- package/dist/worker-cf-entry.js +120 -85
- package/dist/worker-cf-entry.js.map +51 -50
- package/dist/worker.d.ts +2 -2
- package/package.json +6 -4
- package/src/arguments/argument-spec.ts +17 -11
- package/src/arrow/codec/registry.ts +2 -2
- package/src/arrow/impl-arrowjs/build.ts +1 -1
- package/src/arrow/impl-arrowjs/canonical.ts +23 -23
- package/src/arrow/impl-arrowjs/empty.ts +2 -2
- package/src/arrow/impl-arrowjs/ipc.ts +2 -2
- package/src/arrow/impl-arrowjs/iterate.ts +2 -2
- package/src/arrow/impl-arrowjs/project.ts +2 -2
- package/src/arrow/impl-flechette/build.ts +2 -1
- package/src/arrow/impl-flechette/canonical.ts +10 -9
- package/src/arrow/impl-flechette/compat.ts +3 -3
- package/src/arrow/impl-flechette/message-meta.ts +5 -4
- package/src/arrow/impl-flechette/statistics.ts +2 -2
- package/src/attach-ticket.ts +2 -2
- package/src/catalog/column-metadata.ts +1 -1
- package/src/catalog/composite.ts +2 -2
- package/src/catalog/constraints.ts +9 -9
- package/src/catalog/descriptors.ts +1 -1
- package/src/catalog/interface.ts +12 -12
- package/src/catalog/publication.ts +9 -8
- package/src/catalog/read-only.ts +9 -8
- package/src/catalog/sql-grammar.ts +6 -6
- package/src/client/client.ts +52 -15
- package/src/client/errors.ts +1 -1
- package/src/client/types.ts +23 -0
- package/src/client-entry.ts +2 -0
- package/src/codec/asd.ts +3 -3
- package/src/codec/conform.ts +3 -3
- package/src/filter-pushdown/collector.ts +1 -1
- package/src/filter-pushdown/deserialize.ts +13 -10
- package/src/filter-pushdown/evaluate.ts +3 -2
- package/src/filter-pushdown/history.ts +3 -2
- package/src/filter-pushdown/types.ts +10 -10
- package/src/functions/continuation.ts +1 -1
- package/src/functions/projection.ts +1 -1
- package/src/functions/registry.ts +14 -14
- package/src/functions/scalar.ts +3 -3
- package/src/functions/storage-cf-do.ts +2 -2
- package/src/functions/table-buffering.ts +25 -21
- package/src/functions/table-in-out.ts +8 -8
- package/src/functions/table.ts +27 -25
- package/src/functions/types.ts +47 -47
- package/src/generated/vgi-service.ts +5 -3
- package/src/http/fetch.ts +17 -12
- package/src/index.core.ts +2 -0
- package/src/protocol/carried-init-request.ts +1 -1
- package/src/protocol/dispatch.ts +3 -3
- package/src/protocol/handlers/aggregate.ts +8 -7
- package/src/protocol/handlers/catalog/shared.ts +1 -1
- package/src/protocol/handlers/function.ts +2 -2
- package/src/protocol/serializers/cardinality.ts +16 -3
- package/src/protocol/state-serializer.ts +1 -1
- package/src/protocol/types.ts +5 -5
- package/src/rpc-server.ts +13 -12
- package/src/serve-entry.ts +18 -18
- package/src/split-token.ts +10 -9
- package/src/types.ts +9 -2
- package/src/util/defined.ts +30 -0
- package/src/util/parent-rows.ts +2 -2
- package/src/worker.ts +15 -14
package/src/worker.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
serveStream as serveStreamRpc,
|
|
10
10
|
type VgiRpcServer,
|
|
11
11
|
} from "@query-farm/vgi-rpc";
|
|
12
|
+
import { omitUndefined } from "./util/defined.js";
|
|
12
13
|
import { buildRpcServer, type HostingOptions, type ServerTransport } from "./rpc-server.js";
|
|
13
14
|
import { FunctionRegistry } from "./functions/registry.js";
|
|
14
15
|
import type { VgiFunction } from "./functions/types.js";
|
|
@@ -73,31 +74,31 @@ function parseTcpSpec(spec: string, out: LauncherArgs): void {
|
|
|
73
74
|
function parseLauncherArgs(argv: readonly string[]): LauncherArgs {
|
|
74
75
|
const out: LauncherArgs = { irohTrustedProxyAddresses: [], irohAuthenticate: true };
|
|
75
76
|
for (let i = 0; i < argv.length; i++) {
|
|
76
|
-
const a = argv[i]
|
|
77
|
+
const a = argv[i]!;
|
|
77
78
|
if (a === "--unix" && i + 1 < argv.length) {
|
|
78
|
-
out.unixPath = argv[++i]
|
|
79
|
+
out.unixPath = argv[++i]!;
|
|
79
80
|
} else if (a.startsWith("--unix=")) {
|
|
80
81
|
out.unixPath = a.slice("--unix=".length);
|
|
81
82
|
} else if (a === "--tcp" && i + 1 < argv.length) {
|
|
82
|
-
parseTcpSpec(argv[++i]
|
|
83
|
+
parseTcpSpec(argv[++i]!, out);
|
|
83
84
|
} else if (a.startsWith("--tcp=")) {
|
|
84
85
|
parseTcpSpec(a.slice("--tcp=".length), out);
|
|
85
86
|
} else if (a === "--idle-timeout" && i + 1 < argv.length) {
|
|
86
|
-
out.idleTimeout = Number(argv[++i]);
|
|
87
|
+
out.idleTimeout = Number(argv[++i]!);
|
|
87
88
|
} else if (a.startsWith("--idle-timeout=")) {
|
|
88
89
|
out.idleTimeout = Number(a.slice("--idle-timeout=".length));
|
|
89
90
|
} else if (a === "--iroh-raw-upstream" && i + 1 < argv.length) {
|
|
90
|
-
parseTcpSpec(argv[++i]
|
|
91
|
+
parseTcpSpec(argv[++i]!, out);
|
|
91
92
|
out.irohRawUpstream = true;
|
|
92
93
|
} else if (a.startsWith("--iroh-raw-upstream=")) {
|
|
93
94
|
parseTcpSpec(a.slice("--iroh-raw-upstream=".length), out);
|
|
94
95
|
out.irohRawUpstream = true;
|
|
95
96
|
} else if (a === "--iroh-issuer" && i + 1 < argv.length) {
|
|
96
|
-
out.irohIssuer = argv[++i]
|
|
97
|
+
out.irohIssuer = argv[++i]!;
|
|
97
98
|
} else if (a.startsWith("--iroh-issuer=")) {
|
|
98
99
|
out.irohIssuer = a.slice("--iroh-issuer=".length);
|
|
99
100
|
} else if (a === "--iroh-trusted-proxy" && i + 1 < argv.length) {
|
|
100
|
-
out.irohTrustedProxyAddresses.push(...argv[++i]
|
|
101
|
+
out.irohTrustedProxyAddresses.push(...argv[++i]!.split(",").filter(Boolean));
|
|
101
102
|
} else if (a.startsWith("--iroh-trusted-proxy=")) {
|
|
102
103
|
out.irohTrustedProxyAddresses.push(...a.slice("--iroh-trusted-proxy=".length).split(",").filter(Boolean));
|
|
103
104
|
} else if (a === "--iroh-observe") {
|
|
@@ -127,8 +128,8 @@ export interface WorkerConfig extends HostingOptions {
|
|
|
127
128
|
export class Worker {
|
|
128
129
|
private _registry: FunctionRegistry;
|
|
129
130
|
private _hosting: HostingOptions;
|
|
130
|
-
private _catalogInterface
|
|
131
|
-
private _catalogName
|
|
131
|
+
private _catalogInterface: CatalogInterface | undefined;
|
|
132
|
+
private _catalogName: string | undefined;
|
|
132
133
|
|
|
133
134
|
constructor(config: WorkerConfig) {
|
|
134
135
|
// Reuse the caller's registry when given: a catalogInterface built
|
|
@@ -217,10 +218,10 @@ export class Worker {
|
|
|
217
218
|
debug(() =>
|
|
218
219
|
`[worker] AF_UNIX mode: ${launcher.unixPath} idle=${idleTimeout ?? 300}s${envOverride !== undefined && envOverride !== "" ? " (env override)" : ""}`,
|
|
219
220
|
);
|
|
220
|
-
serveUnix(this.buildServer(protocol, "unix"), {
|
|
221
|
+
serveUnix(this.buildServer(protocol, "unix"), omitUndefined({
|
|
221
222
|
unixPath: launcher.unixPath,
|
|
222
223
|
idleTimeout,
|
|
223
|
-
}).then((handle) => handle.done).then(() => {
|
|
224
|
+
})).then((handle) => handle.done).then(() => {
|
|
224
225
|
debug(() => `[worker] serveUnix done (idle shutdown)`);
|
|
225
226
|
}).catch((err: any) => {
|
|
226
227
|
process.stderr.write(`Worker error: ${err.message}\n${err.stack}\n`);
|
|
@@ -242,7 +243,7 @@ export class Worker {
|
|
|
242
243
|
debug(() =>
|
|
243
244
|
`[worker] TCP mode: ${launcher.tcpHost}:${launcher.tcpPort} idle=${idleTimeout ?? 300}s${envOverride !== undefined && envOverride !== "" ? " (env override)" : ""}`,
|
|
244
245
|
);
|
|
245
|
-
serveTcp(this.buildServer(protocol, launcher.irohRawUpstream ? "iroh" : "tcp"), {
|
|
246
|
+
serveTcp(this.buildServer(protocol, launcher.irohRawUpstream ? "iroh" : "tcp"), omitUndefined({
|
|
246
247
|
host: launcher.tcpHost,
|
|
247
248
|
port: launcher.tcpPort,
|
|
248
249
|
idleTimeout,
|
|
@@ -258,7 +259,7 @@ export class Worker {
|
|
|
258
259
|
: observePeerIdentity,
|
|
259
260
|
}
|
|
260
261
|
: {}),
|
|
261
|
-
}).then((handle) => handle.done).then(() => {
|
|
262
|
+
})).then((handle) => handle.done).then(() => {
|
|
262
263
|
debug(() => `[worker] serveTcp done (idle shutdown)`);
|
|
263
264
|
}).catch((err: any) => {
|
|
264
265
|
process.stderr.write(`Worker error: ${err.message}\n${err.stack}\n`);
|
|
@@ -317,6 +318,6 @@ export class Worker {
|
|
|
317
318
|
readable: ReadableStream<Uint8Array> | NodeJS.ReadableStream,
|
|
318
319
|
writable?: number | import("node:net").Socket | import("@query-farm/vgi-rpc").ByteSink,
|
|
319
320
|
): Promise<void> {
|
|
320
|
-
await serveStreamRpc(this.buildServer(this.buildProtocol(), "stream"), { readable, writable });
|
|
321
|
+
await serveStreamRpc(this.buildServer(this.buildProtocol(), "stream"), omitUndefined({ readable, writable }));
|
|
321
322
|
}
|
|
322
323
|
}
|