@query-farm/vgi 0.25.4 → 0.26.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 CHANGED
@@ -494,6 +494,12 @@ To mount the VGI routes inside a server you already own, use `createVgiWorkerFet
494
494
  which returns the `fetch` handler without binding a port. On Cloudflare Workers use
495
495
  `createVgiFetch` from `@query-farm/vgi/worker-cf`; both share one implementation.
496
496
 
497
+ `createVgiFetch` requires `landingInfo: { name, doc, version }` — the identity the
498
+ landing page and its JSON status document display. `serveVgiWorker` builds it from
499
+ its own required `name`/`doc`/`version`, so only the Cloudflare entry passes it
500
+ explicitly. Without it there is no landing page and no `/vgi-client.js`; see
501
+ [MIGRATION.md](MIGRATION.md).
502
+
497
503
  ## Runtimes & entry points
498
504
 
499
505
  The package ships a backend-agnostic Arrow facade and selects an implementation at
@@ -0,0 +1,2 @@
1
+ /** The vendored VGI browser client bundle, decoded to its raw bytes. */
2
+ export declare const CLIENT_BUNDLE_BYTES: Uint8Array;
@@ -1,5 +1,5 @@
1
1
  import { type ProtocolConfig } from "../protocol/dispatch.js";
2
- import type { LandingInfo } from "@query-farm/vgi-rpc";
2
+ import { type LandingInfo } from "./landing.js";
3
3
  export interface VgiFetchOptions {
4
4
  /** Wire-protocol config (registry + catalogInterface). */
5
5
  protocol: Omit<ProtocolConfig, "recoverExchangeState">;
@@ -20,11 +20,20 @@ export interface VgiFetchOptions {
20
20
  corsOrigins?: string;
21
21
  /** Public source-repository URL, surfaced on the landing page. */
22
22
  repositoryUrl?: string;
23
- /** Enables the standardized VGI landing surface: `GET /` serves the shared
24
- * landing.html plus a JSON status document carrying this identity, and
25
- * `GET /vgi-client.js` serves the browser client build the page reads the
26
- * catalog with. */
27
- landingInfo?: LandingInfo;
23
+ /** Worker identity for the standardized VGI landing surface: `GET /` serves
24
+ * the shared landing.html plus a JSON status document carrying this
25
+ * identity, and `GET /vgi-client.js` serves the browser client build the
26
+ * page reads the catalog with.
27
+ *
28
+ * Required, and deliberately so. It used to be optional, and omitting it
29
+ * silently downgraded `GET /` to vgi-rpc's generic "this is an RPC
30
+ * endpoint" placeholder while `GET /vgi-client.js` 404'd — a worker that
31
+ * looked deployed but had no catalog tree, no Cupola link, and no ATTACH
32
+ * snippet. Nothing failed loudly, so the only way to notice was to open the
33
+ * page. `serveVgiWorker` never had the problem because it builds this from
34
+ * its required name/doc/version; the CF entry had to remember, and
35
+ * vgi-open-meteo shipped for weeks without it. */
36
+ landingInfo: LandingInfo;
28
37
  }
29
38
  /**
30
39
  * Build a fetch handler suitable for `export default { fetch }` in a CF
@@ -0,0 +1,2 @@
1
+ /** The vendored shared landing page, decoded to its raw UTF-8 bytes. */
2
+ export declare const LANDING_HTML_BYTES: Uint8Array;
@@ -0,0 +1,36 @@
1
+ import type { ExtraRouteHandler } from "@query-farm/vgi-rpc";
2
+ /**
3
+ * Worker identity for the standardized VGI landing surface.
4
+ *
5
+ * The shared `landing.html` reads catalog metadata by speaking the VGI protocol
6
+ * through the client bundle the worker serves beside it, so nothing about the
7
+ * catalog belongs here. What the protocol has no method for — which worker this
8
+ * is, what it is called, what version it runs — rides on the JSON status
9
+ * document at `GET {prefix}/?format=json`.
10
+ */
11
+ export interface LandingInfo {
12
+ /** Worker name shown as the page heading, e.g. "ishares". */
13
+ name: string;
14
+ /** One-line description shown under the heading. */
15
+ doc?: string;
16
+ /** Worker version string shown in the footer. */
17
+ version?: string;
18
+ /** Override the Cupola base URL the "Explore" links point at. */
19
+ cupolaBase?: string;
20
+ }
21
+ /** Default Cupola deployment the page's "Explore" links point at. */
22
+ export declare const DEFAULT_CUPOLA_BASE = "https://cupola.query-farm.services";
23
+ /**
24
+ * Build the VGI landing surface as a route contributed to vgi-rpc's HTTP
25
+ * handler.
26
+ *
27
+ * Serves two paths, both relative to the handler's mount prefix:
28
+ *
29
+ * - `GET {prefix}/` — the shared `landing.html` for browsers, or a JSON status
30
+ * document for health checks, `?format=json`, and the page's own identity
31
+ * read. Content negotiation matches vgi-python's `LandingPageResource`.
32
+ * - `GET {prefix}/vgi-client.js` — the browser build the page imports.
33
+ *
34
+ * Anything else returns `null`, which lets normal routing continue.
35
+ */
36
+ export declare function createLandingRoutes(info: LandingInfo): ExtraRouteHandler;
@@ -24,7 +24,8 @@ export { metadatasToArrow, arrowToMetadatas } from "./metadata/serialize.js";
24
24
  export { PushdownFilters, FilteringOutputCollector, deserializeFilters, buildJoinKeysLookup, ComparisonOp, type Filter, type ConstantFilter, type IsNullFilter, type IsNotNullFilter, type InFilter, type AndFilter, type OrFilter, type StructFilter, formatPushedFilters, reprPushedFilters, } from "./filter-pushdown/index.js";
25
25
  export { arrowStateSerializer, EXCHANGE_STATE_SCHEMA, serializeUserState, deserializeUserState } from "./protocol/state-serializer.js";
26
26
  export { buildVgiProtocol, type ProtocolConfig } from "./protocol/dispatch.js";
27
- export type { LandingInfo } from "@query-farm/vgi-rpc";
27
+ export type { LandingInfo } from "./http/landing.js";
28
+ export { createLandingRoutes } from "./http/landing.js";
28
29
  export { BindResultSchema, ScanFunctionResultSchema } from "./generated/vgi-protocol-schemas.js";
29
30
  export { type AttachOptionSpec, serializeAttachOptionSpec, serializeAttachOptionSpecs, deserializeAttachOptionSpec, deserializeAttachOptionSpecs } from "./catalog/attach-option.js";
30
31
  export { type ColumnStatistics, serializeColumnStatistics } from "./util/statistics.js";