@query-farm/vgi 0.25.4 → 0.26.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 +6 -0
- package/dist/client-entry.js +2 -1
- package/dist/client-entry.js.map +4 -4
- package/dist/http/client-bundle.d.ts +2 -0
- package/dist/http/fetch.d.ts +15 -6
- package/dist/http/landing-html.d.ts +2 -0
- package/dist/http/landing.d.ts +36 -0
- package/dist/index.core.d.ts +2 -1
- package/dist/index.js +107 -1
- package/dist/index.js.map +9 -6
- package/dist/serve-entry.js +111 -2
- package/dist/serve-entry.js.map +8 -5
- package/dist/types.d.ts +1 -0
- package/dist/worker-cf-entry.d.ts +4 -3
- package/dist/worker-cf-entry.js +115 -6
- package/dist/worker-cf-entry.js.map +11 -8
- package/package.json +3 -3
- package/src/http/client-bundle.ts +24 -0
- package/src/http/fetch.ts +32 -7
- package/src/http/landing-html.ts +23 -0
- package/src/http/landing.ts +195 -0
- package/src/index.core.ts +2 -1
- package/src/protocol/serializers/bind.ts +2 -0
- package/src/types.ts +4 -0
- package/src/worker-cf-entry.ts +9 -1
package/dist/http/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ProtocolConfig } from "../protocol/dispatch.js";
|
|
2
|
-
import type
|
|
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
|
-
/**
|
|
24
|
-
* landing.html plus a JSON status document carrying this
|
|
25
|
-
* `GET /vgi-client.js` serves the browser client build the
|
|
26
|
-
* catalog with.
|
|
27
|
-
|
|
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,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;
|
package/dist/index.core.d.ts
CHANGED
|
@@ -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 "
|
|
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";
|