@query-farm/vgi 0.25.3 → 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 +6 -0
- package/dist/arrow/repr.test-d.d.ts +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 +135 -119
- package/dist/index.js.map +11 -8
- package/dist/serve-entry.js +140 -120
- package/dist/serve-entry.js.map +11 -8
- package/dist/worker-cf-entry.d.ts +2 -1
- package/dist/worker-cf-entry.js +141 -120
- package/dist/worker-cf-entry.js.map +12 -9
- package/package.json +6 -6
- 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 +122 -0
- package/src/index.core.ts +2 -1
- package/src/worker-cf-entry.ts +2 -1
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { list, asDate64Ms } from "./index.js";
|
|
1
|
+
import { dateMillisecond, list, bool, float64, asDate64Ms } from "./index.js";
|
|
2
2
|
import type { RichValue, RawValue, ValueFor, Date32Type, Date64Type, Int64Type, Int32Type, Utf8Type, BoolType, TimestampType, DecimalType, FloatType, StructType, ListType, TypedField, Date32, TimestampMicros, UnscaledDecimal } from "./index.js";
|
|
3
3
|
type Expect<T extends true> = T;
|
|
4
4
|
type Equal<A, B> = (<G>() => G extends A ? 1 : 2) extends (<G>() => G extends B ? 1 : 2) ? true : false;
|
|
@@ -43,9 +43,9 @@ export type _AllChecks = [
|
|
|
43
43
|
_r15
|
|
44
44
|
];
|
|
45
45
|
export declare const _unusedFactories: {
|
|
46
|
-
dateMillisecond:
|
|
47
|
-
bool:
|
|
48
|
-
float64:
|
|
46
|
+
dateMillisecond: typeof dateMillisecond;
|
|
47
|
+
bool: typeof bool;
|
|
48
|
+
float64: typeof float64;
|
|
49
49
|
list: typeof list;
|
|
50
50
|
asDate64Ms: typeof asDate64Ms;
|
|
51
51
|
};
|
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";
|