@honua/sdk-esri-compat 0.1.12 → 0.1.14
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 +2 -0
- package/columnar/apache-arrow.d.ts +17 -0
- package/columnar/apache-arrow.d.ts.map +1 -0
- package/columnar/apache-arrow.js +1036 -0
- package/columnar/batch-cache-conformance.d.ts +66 -0
- package/columnar/batch-cache-conformance.d.ts.map +1 -0
- package/columnar/batch-cache-conformance.js +317 -0
- package/columnar/batch-cache-indexeddb.d.ts +31 -0
- package/columnar/batch-cache-indexeddb.d.ts.map +1 -0
- package/columnar/batch-cache-indexeddb.js +148 -0
- package/columnar/batch-cache.d.ts +298 -0
- package/columnar/batch-cache.d.ts.map +1 -0
- package/columnar/batch-cache.js +757 -0
- package/columnar/geoarrow-aggregate.d.ts +178 -0
- package/columnar/geoarrow-aggregate.d.ts.map +1 -0
- package/columnar/geoarrow-aggregate.js +976 -0
- package/columnar/geoarrow-patch.d.ts +382 -0
- package/columnar/geoarrow-patch.d.ts.map +1 -0
- package/columnar/geoarrow-patch.js +1656 -0
- package/columnar/geoarrow-reproject.d.ts +22 -0
- package/columnar/geoarrow-reproject.d.ts.map +1 -0
- package/columnar/geoarrow-reproject.js +119 -0
- package/columnar/geoarrow-serialization.d.ts +68 -0
- package/columnar/geoarrow-serialization.d.ts.map +1 -0
- package/columnar/geoarrow-serialization.js +331 -0
- package/columnar/geoarrow-types.d.ts +271 -0
- package/columnar/geoarrow-types.d.ts.map +1 -0
- package/columnar/geoarrow-types.js +15 -0
- package/columnar/geoarrow.d.ts +52 -0
- package/columnar/geoarrow.d.ts.map +1 -0
- package/columnar/geoarrow.js +1469 -0
- package/columnar/index.d.ts +43 -0
- package/columnar/index.d.ts.map +1 -0
- package/columnar/index.js +29 -0
- package/columnar/operators.d.ts +70 -0
- package/columnar/operators.d.ts.map +1 -0
- package/columnar/operators.js +307 -0
- package/columnar/result.d.ts +369 -0
- package/columnar/result.d.ts.map +1 -0
- package/columnar/result.js +815 -0
- package/columnar/telemetry.d.ts +152 -0
- package/columnar/telemetry.d.ts.map +1 -0
- package/columnar/telemetry.js +265 -0
- package/columnar/transfer.d.ts +28 -0
- package/columnar/transfer.d.ts.map +1 -0
- package/columnar/transfer.js +669 -0
- package/columnar/types.d.ts +175 -0
- package/columnar/types.d.ts.map +1 -0
- package/columnar/types.js +22 -0
- package/columnar/worker.d.ts +157 -0
- package/columnar/worker.d.ts.map +1 -0
- package/columnar/worker.js +1059 -0
- package/connect-url-safety.d.ts +53 -0
- package/connect-url-safety.js +189 -0
- package/contract/pmtiles.d.ts +6 -5
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +30 -5
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +11 -8
- package/core/client.d.ts.map +1 -1
- package/core/client.js +87 -19
- package/core/deprecation-notice.d.ts +28 -0
- package/core/deprecation-notice.d.ts.map +1 -0
- package/core/deprecation-notice.js +22 -0
- package/core/esri-geojson.d.ts.map +1 -1
- package/core/esri-geojson.js +14 -8
- package/core/optional-grpc-peer.d.ts +15 -0
- package/core/optional-grpc-peer.d.ts.map +1 -0
- package/core/optional-grpc-peer.js +60 -0
- package/esri-compat/basemap-gallery.d.ts +2 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -1
- package/esri-compat/basemap-gallery.js +12 -0
- package/esri-compat/basemap.d.ts +4 -0
- package/esri-compat/basemap.d.ts.map +1 -1
- package/esri-compat/basemap.js +70 -0
- package/esri-compat/bookmarks.d.ts +2 -0
- package/esri-compat/bookmarks.d.ts.map +1 -1
- package/esri-compat/bookmarks.js +12 -0
- package/esri-compat/controls.d.ts +18 -0
- package/esri-compat/controls.d.ts.map +1 -1
- package/esri-compat/controls.js +120 -57
- package/esri-compat/directions.d.ts +4 -0
- package/esri-compat/directions.d.ts.map +1 -1
- package/esri-compat/directions.js +30 -20
- package/esri-compat/editor.d.ts +4 -0
- package/esri-compat/editor.d.ts.map +1 -1
- package/esri-compat/editor.js +16 -0
- package/esri-compat/esri-config.d.ts +2 -1
- package/esri-compat/esri-config.d.ts.map +1 -1
- package/esri-compat/feature-effect.d.ts +23 -0
- package/esri-compat/feature-effect.d.ts.map +1 -0
- package/esri-compat/feature-effect.js +12 -0
- package/esri-compat/feature-form.d.ts +6 -0
- package/esri-compat/feature-form.d.ts.map +1 -1
- package/esri-compat/feature-form.js +63 -0
- package/esri-compat/feature-layer.d.ts +21 -2
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +172 -1
- package/esri-compat/feature-table.d.ts +5 -0
- package/esri-compat/feature-table.d.ts.map +1 -1
- package/esri-compat/feature-table.js +23 -0
- package/esri-compat/identity-manager.d.ts +1 -1
- package/esri-compat/identity-manager.js +1 -1
- package/esri-compat/legend.d.ts +2 -0
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +98 -0
- package/esri-compat/locator.d.ts +1 -1
- package/esri-compat/locator.js +1 -1
- package/esri-compat/map-view-mount.d.ts +1 -0
- package/esri-compat/map-view-mount.d.ts.map +1 -1
- package/esri-compat/map-view-mount.js +46 -25
- package/esri-compat/map-view.d.ts +13 -0
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +94 -8
- package/esri-compat/map.d.ts +5 -1
- package/esri-compat/map.d.ts.map +1 -1
- package/esri-compat/map.js +10 -0
- package/esri-compat/measurement.d.ts +2 -0
- package/esri-compat/measurement.d.ts.map +1 -1
- package/esri-compat/measurement.js +14 -0
- package/esri-compat/point.d.ts +7 -0
- package/esri-compat/point.d.ts.map +1 -1
- package/esri-compat/point.js +33 -3
- package/esri-compat/popup.d.ts +2 -0
- package/esri-compat/popup.d.ts.map +1 -1
- package/esri-compat/popup.js +12 -0
- package/esri-compat/portal.d.ts +1 -1
- package/esri-compat/portal.js +1 -1
- package/esri-compat/print.d.ts +3 -0
- package/esri-compat/print.d.ts.map +1 -1
- package/esri-compat/print.js +15 -0
- package/esri-compat/search.d.ts +4 -0
- package/esri-compat/search.d.ts.map +1 -1
- package/esri-compat/search.js +25 -28
- package/esri-compat/sketch.d.ts +2 -0
- package/esri-compat/sketch.d.ts.map +1 -1
- package/esri-compat/sketch.js +12 -0
- package/esri-compat/widget-host.d.ts +46 -17
- package/esri-compat/widget-host.d.ts.map +1 -1
- package/esri-compat/widget-host.js +84 -20
- package/esri-compat/widget-shell-hosts.d.ts +61 -0
- package/esri-compat/widget-shell-hosts.d.ts.map +1 -0
- package/esri-compat/widget-shell-hosts.js +76 -0
- package/index.d.ts +3 -1
- package/index.js +1 -0
- package/offline/digest.d.ts +15 -0
- package/offline/digest.js +58 -0
- package/offline/quota.d.ts +161 -0
- package/offline/quota.js +370 -0
- package/offline/types.d.ts +349 -0
- package/offline/types.js +75 -0
- package/package.json +21 -2
- package/query-planner/canonical-filter.d.ts +30 -0
- package/query-planner/canonical-filter.d.ts.map +1 -0
- package/query-planner/canonical-filter.js +30 -0
- package/query-planner/canonical.d.ts +7 -0
- package/query-planner/canonical.d.ts.map +1 -0
- package/query-planner/canonical.js +145 -0
- package/query-planner/columnar-plan.d.ts +63 -0
- package/query-planner/columnar-plan.d.ts.map +1 -0
- package/query-planner/columnar-plan.js +94 -0
- package/query-planner/cql2-json.d.ts +17 -0
- package/query-planner/cql2-json.d.ts.map +1 -0
- package/query-planner/cql2-json.js +646 -0
- package/query-planner/diagnostics.d.ts +35 -0
- package/query-planner/diagnostics.d.ts.map +1 -0
- package/query-planner/diagnostics.js +386 -0
- package/query-planner/duckdb.d.ts +79 -0
- package/query-planner/duckdb.d.ts.map +1 -0
- package/query-planner/duckdb.js +772 -0
- package/query-planner/execution-context.d.ts +5 -0
- package/query-planner/execution-context.d.ts.map +1 -0
- package/query-planner/execution-context.js +52 -0
- package/query-planner/executor.d.ts +5 -0
- package/query-planner/executor.d.ts.map +1 -0
- package/query-planner/executor.js +229 -0
- package/query-planner/geoservices.d.ts +91 -0
- package/query-planner/geoservices.d.ts.map +1 -0
- package/query-planner/geoservices.js +688 -0
- package/query-planner/grpc.d.ts +100 -0
- package/query-planner/grpc.d.ts.map +1 -0
- package/query-planner/grpc.js +760 -0
- package/query-planner/index.d.ts +59 -0
- package/query-planner/index.d.ts.map +1 -0
- package/query-planner/index.js +43 -0
- package/query-planner/ir.d.ts +25 -0
- package/query-planner/ir.d.ts.map +1 -0
- package/query-planner/ir.js +479 -0
- package/query-planner/local-aggregate.d.ts +5 -0
- package/query-planner/local-aggregate.d.ts.map +1 -0
- package/query-planner/local-aggregate.js +126 -0
- package/query-planner/odata-protocol-module.d.ts +54 -0
- package/query-planner/odata-protocol-module.d.ts.map +1 -0
- package/query-planner/odata-protocol-module.js +199 -0
- package/query-planner/odata-v1.d.ts +23 -0
- package/query-planner/odata-v1.d.ts.map +1 -0
- package/query-planner/odata-v1.js +202 -0
- package/query-planner/odata.d.ts +45 -0
- package/query-planner/odata.d.ts.map +1 -0
- package/query-planner/odata.js +519 -0
- package/query-planner/ogc-compiler.d.ts +55 -0
- package/query-planner/ogc-compiler.d.ts.map +1 -0
- package/query-planner/ogc-compiler.js +480 -0
- package/query-planner/ogc-features.d.ts +53 -0
- package/query-planner/ogc-features.d.ts.map +1 -0
- package/query-planner/ogc-features.js +639 -0
- package/query-planner/planner.d.ts +17 -0
- package/query-planner/planner.d.ts.map +1 -0
- package/query-planner/planner.js +937 -0
- package/query-planner/representation.d.ts +59 -0
- package/query-planner/representation.d.ts.map +1 -0
- package/query-planner/representation.js +140 -0
- package/query-planner/resource.d.ts +94 -0
- package/query-planner/resource.d.ts.map +1 -0
- package/query-planner/resource.js +526 -0
- package/query-planner/semantic-canonical.d.ts +15 -0
- package/query-planner/semantic-canonical.d.ts.map +1 -0
- package/query-planner/semantic-canonical.js +62 -0
- package/query-planner/semantic-compat.d.ts +10 -0
- package/query-planner/semantic-compat.d.ts.map +1 -0
- package/query-planner/semantic-compat.js +35 -0
- package/query-planner/semantic-compiler.d.ts +64 -0
- package/query-planner/semantic-compiler.d.ts.map +1 -0
- package/query-planner/semantic-compiler.js +81 -0
- package/query-planner/semantic-literals.d.ts +30 -0
- package/query-planner/semantic-literals.d.ts.map +1 -0
- package/query-planner/semantic-literals.js +133 -0
- package/query-planner/semantic-types.d.ts +265 -0
- package/query-planner/semantic-types.d.ts.map +1 -0
- package/query-planner/semantic-types.js +1 -0
- package/query-planner/semantic.d.ts +54 -0
- package/query-planner/semantic.d.ts.map +1 -0
- package/query-planner/semantic.js +1421 -0
- package/query-planner/types.d.ts +712 -0
- package/query-planner/types.d.ts.map +1 -0
- package/query-planner/types.js +49 -0
- package/query-planner/wfs-protocol-module.d.ts +57 -0
- package/query-planner/wfs-protocol-module.d.ts.map +1 -0
- package/query-planner/wfs-protocol-module.js +731 -0
- package/query-planner/wfs-semantic.d.ts +58 -0
- package/query-planner/wfs-semantic.d.ts.map +1 -0
- package/query-planner/wfs-semantic.js +547 -0
- package/query-planner/wfs-v1.d.ts +41 -0
- package/query-planner/wfs-v1.d.ts.map +1 -0
- package/query-planner/wfs-v1.js +366 -0
- package/query-planner/wfs.d.ts +4 -0
- package/query-planner/wfs.d.ts.map +1 -0
- package/query-planner/wfs.js +2 -0
- package/widget-capabilities.d.ts +67 -0
- package/widget-capabilities.js +152 -0
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
import type { ProtocolModuleQueryOperation } from "../contract/protocol-module.js";
|
|
2
|
+
import type { QueryFilterExpression, QueryTemporalFilter } from "../contract/query-filter.js";
|
|
3
|
+
import type { AggregationSpec, Capability, CapabilityPolicy, Protocol, Query, Result, Source, SourceDescriptor } from "../contract/types.js";
|
|
4
|
+
import { type HonuaErrorOptions, HonuaSdkError } from "../core/error-envelope.js";
|
|
5
|
+
import type { GeometryEncoding } from "../core/geoparquet-sql.js";
|
|
6
|
+
import type { EsriGeometryType, EsriSpatialRel } from "../core/types.js";
|
|
7
|
+
import type { GeoParquetResourceHandleV1, GeoParquetResourceResolver } from "./resource.js";
|
|
8
|
+
export declare const QUERY_IR_VERSION: "1.0";
|
|
9
|
+
export declare const QUERY_PLAN_VERSION: "1.0";
|
|
10
|
+
export declare const QUERY_IR_V2_VERSION: "2.0";
|
|
11
|
+
export declare const QUERY_PLAN_V2_VERSION: "2.0";
|
|
12
|
+
export declare const QUERY_PLAN_DIAGNOSTICS_VERSION: "1.0";
|
|
13
|
+
export declare const QUERY_PLANNER_VERSION: "honua-query-planner@1";
|
|
14
|
+
export declare const QUERY_IR_KIND: "honua.query-ir";
|
|
15
|
+
export declare const QUERY_PLAN_KIND: "honua.query-plan";
|
|
16
|
+
/** Hard safety ceiling for this first in-process fallback implementation. */
|
|
17
|
+
export declare const MAX_LOCAL_MATERIALIZATION_ROWS = 100000;
|
|
18
|
+
export type JsonPrimitive = null | boolean | number | string;
|
|
19
|
+
export type JsonValue = JsonPrimitive | readonly JsonValue[] | {
|
|
20
|
+
readonly [key: string]: JsonValue;
|
|
21
|
+
};
|
|
22
|
+
export interface CanonicalSpatialFilter {
|
|
23
|
+
readonly geometry: {
|
|
24
|
+
readonly [key: string]: JsonValue;
|
|
25
|
+
};
|
|
26
|
+
readonly geometryType: EsriGeometryType;
|
|
27
|
+
readonly spatialRel?: EsriSpatialRel;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Serializable form of the current canonical {@link Query}. `AbortSignal` is
|
|
31
|
+
* deliberately excluded: cancellation belongs to execution, never identity.
|
|
32
|
+
*/
|
|
33
|
+
export interface CanonicalQuery {
|
|
34
|
+
/** The current contract carries a source-native string escape hatch. */
|
|
35
|
+
readonly where?: {
|
|
36
|
+
readonly kind: "source-native";
|
|
37
|
+
readonly expression: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Typed semantic filter carried verbatim into the IR so it participates in
|
|
41
|
+
* `hashQueryIr` / `hashQueryPlan` exactly as every other query member does.
|
|
42
|
+
* A compiler that cannot express it refuses; it is never dropped in planning.
|
|
43
|
+
*/
|
|
44
|
+
readonly filter?: QueryFilterExpression;
|
|
45
|
+
/** Canonical temporal constraint (instant or interval, optionally field bound). */
|
|
46
|
+
readonly temporalFilter?: QueryTemporalFilter;
|
|
47
|
+
readonly spatialFilter?: CanonicalSpatialFilter;
|
|
48
|
+
readonly outFields?: readonly string[];
|
|
49
|
+
readonly orderBy?: readonly {
|
|
50
|
+
readonly field: string;
|
|
51
|
+
readonly direction: "asc" | "desc";
|
|
52
|
+
}[];
|
|
53
|
+
readonly pagination?: {
|
|
54
|
+
readonly offset?: number;
|
|
55
|
+
readonly limit?: number;
|
|
56
|
+
};
|
|
57
|
+
readonly aggregation?: AggregationSpec;
|
|
58
|
+
readonly returnGeometry?: boolean;
|
|
59
|
+
readonly outSr?: string | number;
|
|
60
|
+
}
|
|
61
|
+
export interface QueryIrSourceIdentity {
|
|
62
|
+
readonly id: string;
|
|
63
|
+
readonly protocol: Protocol;
|
|
64
|
+
/** Credential-free endpoint identity: origin/path plus protocol locator ids. */
|
|
65
|
+
readonly endpoint: string;
|
|
66
|
+
/**
|
|
67
|
+
* Secret-free digest binding the runtime endpoint authority (including any
|
|
68
|
+
* credential-bearing query/user-info) and structural authorization scopes.
|
|
69
|
+
* Present on WFS identities; raw authority material is never serialized.
|
|
70
|
+
*/
|
|
71
|
+
readonly authorityFingerprint?: `sha256:${string}`;
|
|
72
|
+
readonly serviceId?: string;
|
|
73
|
+
readonly layerId?: number;
|
|
74
|
+
readonly collectionId?: string | number;
|
|
75
|
+
readonly typeName?: string;
|
|
76
|
+
readonly entitySet?: string;
|
|
77
|
+
/** Descriptor-derived geometry property used by the metadata-free OData compiler. */
|
|
78
|
+
readonly geometryProperty?: string;
|
|
79
|
+
readonly srsName?: string;
|
|
80
|
+
/** Bounded, credential-screened schema version identity. */
|
|
81
|
+
readonly schemaVersion?: string;
|
|
82
|
+
/** Bounded, credential-screened source version identity. */
|
|
83
|
+
readonly sourceVersion?: string;
|
|
84
|
+
/** DuckDB/GeoParquet addressing derived from the descriptor for the SQL compiler. */
|
|
85
|
+
readonly geoparquet?: QueryIrGeoparquetIdentity;
|
|
86
|
+
readonly authorizationScope: readonly string[];
|
|
87
|
+
readonly capabilities: readonly Capability[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Physical geometry encoding of a GeoParquet column, per the DuckDB SQL
|
|
91
|
+
* compiler. Re-exports {@link GeometryEncoding} (`core/geoparquet-sql.ts`) so
|
|
92
|
+
* the planner's compiled-query artifacts and the live `Source` never drift on
|
|
93
|
+
* which encodings exist — including the GeoParquet 1.1 `geoarrow-*` native
|
|
94
|
+
* single-geometry encodings, which have no DuckDB spatial-predicate
|
|
95
|
+
* expression (`geometryExpr` throws for them; see that module).
|
|
96
|
+
*/
|
|
97
|
+
export type DuckDbGeometryEncoding = GeometryEncoding;
|
|
98
|
+
/**
|
|
99
|
+
* Deterministic GeoParquet addressing carried on the IR so the DuckDB SQL
|
|
100
|
+
* compiler can build `read_parquet(...)` SQL with spatial pushdown without a
|
|
101
|
+
* profiling round-trip. Derived from `locator.url`, `locator.geoparquet`, and
|
|
102
|
+
* the descriptor schema.
|
|
103
|
+
*/
|
|
104
|
+
export interface QueryIrGeoparquetIdentity {
|
|
105
|
+
/** Parquet file URL(s) / hive glob(s) read as one relation. */
|
|
106
|
+
readonly sources: readonly string[];
|
|
107
|
+
/** Geometry column name, when the source is spatial. */
|
|
108
|
+
readonly geometryColumn?: string;
|
|
109
|
+
/** Physical encoding of the geometry column (defaults to `wkb`). */
|
|
110
|
+
readonly geometryEncoding?: DuckDbGeometryEncoding;
|
|
111
|
+
/** Optional GeoParquet 1.1 bbox-covering struct column for row-group pruning. */
|
|
112
|
+
readonly bboxColumn?: string;
|
|
113
|
+
/** Coordinate dimensions for a `geoarrow-*` `geometryEncoding` (GeoParquet 1.1 native). */
|
|
114
|
+
readonly nativeDimensions?: "xy" | "xyz";
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* One projected DuckDB output field of an effective GeoParquet schema: the
|
|
118
|
+
* exact name/type/nullable evidence {@link module:geoparquet/lossless-decoder}
|
|
119
|
+
* needs to compile a lossless row decoder without a runtime `DESCRIBE`.
|
|
120
|
+
*/
|
|
121
|
+
export interface GeoParquetEffectiveSchemaFieldV1 {
|
|
122
|
+
readonly name: string;
|
|
123
|
+
/** Effective DuckDB DESCRIBE type text (e.g. `BIGINT`, `DECIMAL(20,5)`). */
|
|
124
|
+
readonly type: string;
|
|
125
|
+
readonly nullable?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/** Credential-free GeoParquet identity used by v2 plans. */
|
|
128
|
+
export interface QueryIrGeoparquetResourceIdentity {
|
|
129
|
+
readonly resource: GeoParquetResourceHandleV1;
|
|
130
|
+
/** Geometry metadata is safe planner input and never requires locator resolution. */
|
|
131
|
+
readonly geometryColumn?: string;
|
|
132
|
+
readonly geometryEncoding?: DuckDbGeometryEncoding;
|
|
133
|
+
readonly bboxColumn?: string;
|
|
134
|
+
/** Coordinate dimensions for a `geoarrow-*` `geometryEncoding` (GeoParquet 1.1 native). */
|
|
135
|
+
readonly nativeDimensions?: "xy" | "xyz";
|
|
136
|
+
/**
|
|
137
|
+
* Validated, versioned effective DuckDB output schema bound to this plan so
|
|
138
|
+
* opaque `resultEncoding: "lossless-json"` execution can decode exactly,
|
|
139
|
+
* without profiling the resolved locator (#627). Absent for legacy/default
|
|
140
|
+
* result encoding.
|
|
141
|
+
*/
|
|
142
|
+
readonly effectiveSchema?: readonly GeoParquetEffectiveSchemaFieldV1[];
|
|
143
|
+
}
|
|
144
|
+
/** GeoParquet-only v2 source identity. Raw locators are deliberately absent. */
|
|
145
|
+
export interface QueryIrSourceIdentityV2 {
|
|
146
|
+
/** Stable logical id copied from the validated opaque handle. */
|
|
147
|
+
readonly id: string;
|
|
148
|
+
readonly protocol: "geoparquet";
|
|
149
|
+
readonly endpoint: "[opaque-resource]";
|
|
150
|
+
/** Safe descriptor metadata needed to reconstruct bounded-local plans exactly. */
|
|
151
|
+
readonly primaryKey?: string;
|
|
152
|
+
readonly schemaVersion?: string;
|
|
153
|
+
readonly sourceVersion?: string;
|
|
154
|
+
readonly geoparquet: QueryIrGeoparquetResourceIdentity;
|
|
155
|
+
readonly authorizationScope: readonly string[];
|
|
156
|
+
readonly capabilities: readonly Capability[];
|
|
157
|
+
}
|
|
158
|
+
export interface QueryIrV1 {
|
|
159
|
+
readonly kind: typeof QUERY_IR_KIND;
|
|
160
|
+
readonly version: typeof QUERY_IR_VERSION;
|
|
161
|
+
readonly source: QueryIrSourceIdentity;
|
|
162
|
+
readonly query: CanonicalQuery;
|
|
163
|
+
}
|
|
164
|
+
export interface QueryIrV2 {
|
|
165
|
+
readonly kind: typeof QUERY_IR_KIND;
|
|
166
|
+
readonly version: typeof QUERY_IR_V2_VERSION;
|
|
167
|
+
readonly source: QueryIrSourceIdentityV2;
|
|
168
|
+
readonly query: CanonicalQuery;
|
|
169
|
+
}
|
|
170
|
+
export type QueryFallbackPolicy = {
|
|
171
|
+
readonly mode: "disabled";
|
|
172
|
+
} | {
|
|
173
|
+
readonly mode: "bounded-local";
|
|
174
|
+
/** Maximum feature objects that may enter local execution. */
|
|
175
|
+
readonly maxRows: number;
|
|
176
|
+
/** Optional additional ceiling measured from the materialized JSON payload. */
|
|
177
|
+
readonly maxBytes?: number;
|
|
178
|
+
};
|
|
179
|
+
export interface QueryPlanningEstimates {
|
|
180
|
+
readonly rows?: number;
|
|
181
|
+
readonly bytes?: number;
|
|
182
|
+
readonly requests?: number;
|
|
183
|
+
}
|
|
184
|
+
export type QueryPlanBoundConfidence = "exact" | "bounded" | "estimated" | "unknown";
|
|
185
|
+
export type QueryPlanBoundSource = "compiler" | "query-limit" | "fallback-policy" | "caller-estimate" | "plan-summary" | "unavailable";
|
|
186
|
+
/** One deterministic quantity bound. Missing numbers are deliberately unknown, never zero. */
|
|
187
|
+
export interface QueryPlanQuantityBound {
|
|
188
|
+
readonly unit: "request" | "row" | "byte";
|
|
189
|
+
readonly confidence: QueryPlanBoundConfidence;
|
|
190
|
+
readonly source: QueryPlanBoundSource;
|
|
191
|
+
readonly lower?: number;
|
|
192
|
+
readonly upper?: number;
|
|
193
|
+
readonly estimate?: number;
|
|
194
|
+
}
|
|
195
|
+
/** Versioned cost and safety bounds used at both plan and step scope. */
|
|
196
|
+
export interface QueryPlanBoundsV1 {
|
|
197
|
+
readonly version: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
198
|
+
readonly requests: QueryPlanQuantityBound;
|
|
199
|
+
readonly rows: QueryPlanQuantityBound;
|
|
200
|
+
readonly bytes: QueryPlanQuantityBound;
|
|
201
|
+
readonly transferBytes: QueryPlanQuantityBound;
|
|
202
|
+
/** UTF-8 bytes of the deterministic serialized materialization checked by the executor. */
|
|
203
|
+
readonly serializedMaterializationBytes: QueryPlanQuantityBound;
|
|
204
|
+
/** Actual JavaScript heap use. Unknown unless a runtime supplies direct evidence. */
|
|
205
|
+
readonly memoryBytes: QueryPlanQuantityBound;
|
|
206
|
+
}
|
|
207
|
+
export type QueryPlanCachePolicy = "bypass" | "prefer-cache" | "require-fresh";
|
|
208
|
+
export type QueryPlanCacheFreshness = "fresh" | "stale" | "unknown";
|
|
209
|
+
export type QueryPlanCacheAction = "bypass" | "reuse" | "revalidate" | "refresh";
|
|
210
|
+
export type QueryPlanValidatorKind = "etag" | "last-modified" | "revision" | "fingerprint";
|
|
211
|
+
export interface QueryPlanValidatorInput {
|
|
212
|
+
readonly kind: QueryPlanValidatorKind;
|
|
213
|
+
/** Raw validators are accepted at planning only and persisted as a digest. */
|
|
214
|
+
readonly value?: string;
|
|
215
|
+
/** Safe reconstruction path for already-digested persisted provenance. */
|
|
216
|
+
readonly fingerprint?: `sha256:${string}`;
|
|
217
|
+
}
|
|
218
|
+
export interface QueryPlanCacheOptions {
|
|
219
|
+
readonly policy?: QueryPlanCachePolicy;
|
|
220
|
+
readonly freshness?: QueryPlanCacheFreshness;
|
|
221
|
+
readonly validator?: QueryPlanValidatorInput;
|
|
222
|
+
}
|
|
223
|
+
export interface QueryPlanCacheDecisionV1 {
|
|
224
|
+
readonly version: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
225
|
+
readonly policy: QueryPlanCachePolicy;
|
|
226
|
+
readonly action: QueryPlanCacheAction;
|
|
227
|
+
readonly freshness: QueryPlanCacheFreshness;
|
|
228
|
+
readonly validator?: {
|
|
229
|
+
readonly kind: QueryPlanValidatorKind;
|
|
230
|
+
readonly fingerprint: `sha256:${string}`;
|
|
231
|
+
};
|
|
232
|
+
readonly reason: "policy-bypass" | "fresh-entry" | "validator-available" | "stale-entry" | "cache-miss";
|
|
233
|
+
}
|
|
234
|
+
export type QueryPlanFidelity = "exact" | "equivalent" | "approximate";
|
|
235
|
+
export interface QueryPlanFidelityLoss {
|
|
236
|
+
readonly code: "spatial-envelope-reduction";
|
|
237
|
+
readonly path: string;
|
|
238
|
+
readonly description: string;
|
|
239
|
+
readonly remediation: string;
|
|
240
|
+
}
|
|
241
|
+
export type QueryPlanDiscoveryState = "metadata" | "declared" | "inferred" | "unavailable";
|
|
242
|
+
export interface QueryPlanDiscoveryContext {
|
|
243
|
+
readonly state: QueryPlanDiscoveryState;
|
|
244
|
+
/** Raw discovery source is planning-only and persisted as a digest. */
|
|
245
|
+
readonly source?: string;
|
|
246
|
+
readonly sourceFingerprint?: `sha256:${string}`;
|
|
247
|
+
readonly validator?: QueryPlanValidatorInput;
|
|
248
|
+
}
|
|
249
|
+
export interface QueryPlanProvenanceV1 {
|
|
250
|
+
readonly version: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
251
|
+
readonly source: {
|
|
252
|
+
readonly id: string;
|
|
253
|
+
readonly protocol: Protocol;
|
|
254
|
+
readonly endpointFingerprint: `sha256:${string}`;
|
|
255
|
+
readonly descriptorFingerprint: `sha256:${string}`;
|
|
256
|
+
readonly versionFingerprint?: `sha256:${string}`;
|
|
257
|
+
};
|
|
258
|
+
readonly schema: {
|
|
259
|
+
readonly state: "known";
|
|
260
|
+
readonly fingerprint: `sha256:${string}`;
|
|
261
|
+
readonly basis: "schema-v2" | "version";
|
|
262
|
+
} | {
|
|
263
|
+
readonly state: "unavailable";
|
|
264
|
+
readonly reason: "not-provided";
|
|
265
|
+
};
|
|
266
|
+
readonly discovery: {
|
|
267
|
+
readonly state: QueryPlanDiscoveryState;
|
|
268
|
+
readonly sourceFingerprint?: `sha256:${string}`;
|
|
269
|
+
readonly validator?: {
|
|
270
|
+
readonly kind: QueryPlanValidatorKind;
|
|
271
|
+
readonly fingerprint: `sha256:${string}`;
|
|
272
|
+
};
|
|
273
|
+
readonly fingerprint: `sha256:${string}`;
|
|
274
|
+
};
|
|
275
|
+
readonly authorizationScope: {
|
|
276
|
+
readonly fingerprint: `sha256:${string}`;
|
|
277
|
+
readonly count: number;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
export interface QueryPlanStepProvenanceV1 {
|
|
281
|
+
readonly version: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
282
|
+
readonly sourceFingerprint: `sha256:${string}`;
|
|
283
|
+
readonly schemaFingerprint?: `sha256:${string}`;
|
|
284
|
+
readonly discoveryFingerprint: `sha256:${string}`;
|
|
285
|
+
readonly authorizationScopeFingerprint: `sha256:${string}`;
|
|
286
|
+
}
|
|
287
|
+
export type QueryPlanExecutionMode = "snapshot" | "delta";
|
|
288
|
+
/**
|
|
289
|
+
* Result-representation axis of a plan: the shape execution hands back.
|
|
290
|
+
*
|
|
291
|
+
* This is orthogonal to {@link QueryPlanExecutionMode}, which is a realtime
|
|
292
|
+
* axis. `object` returns the protocol-neutral `Result` feature objects every
|
|
293
|
+
* adapter already produces. `columnar` returns a `ColumnarBatchV1` whose
|
|
294
|
+
* identity is derived from this plan (see `columnarBatchIdentityFromPlan`),
|
|
295
|
+
* so nothing per-row is materialized on the way out.
|
|
296
|
+
*
|
|
297
|
+
* The union is deliberately open to extension (`tile`, `stream`) but only
|
|
298
|
+
* names representations the SDK can actually produce today; a representation
|
|
299
|
+
* with no executable producer would be a promise the planner cannot keep.
|
|
300
|
+
*/
|
|
301
|
+
export type QueryPlanRepresentation = "object" | "columnar";
|
|
302
|
+
/** Caller intent for {@link QueryPlanRepresentation}; `auto` lets the planner select. */
|
|
303
|
+
export type QueryPlanRepresentationRequest = QueryPlanRepresentation | "auto";
|
|
304
|
+
/**
|
|
305
|
+
* Why the planner selected the representation it did. Every value is a
|
|
306
|
+
* deterministic function of declared source metadata plus
|
|
307
|
+
* {@link QueryPlanningEstimates} — never of result data.
|
|
308
|
+
*/
|
|
309
|
+
export type QueryPlanRepresentationReason =
|
|
310
|
+
/** The caller pinned the representation explicitly and the source can serve it. */
|
|
311
|
+
"explicit-pin"
|
|
312
|
+
/** Columnar is available and the caller's estimate reaches the columnar threshold. */
|
|
313
|
+
| "workload-above-threshold"
|
|
314
|
+
/** Columnar is available but the estimated workload does not justify it. */
|
|
315
|
+
| "workload-below-threshold"
|
|
316
|
+
/** Columnar is available but the caller supplied no estimate to justify it. */
|
|
317
|
+
| "estimate-unavailable"
|
|
318
|
+
/** No columnar producer exists for this protocol. */
|
|
319
|
+
| "protocol-not-columnar"
|
|
320
|
+
/** The declared geometry encoding has no columnar producer. */
|
|
321
|
+
| "encoding-not-columnar"
|
|
322
|
+
/** Aggregate results are grouped rows, not a feature batch. */
|
|
323
|
+
| "aggregation-not-columnar"
|
|
324
|
+
/** A columnar batch is a geometry batch; the query suppressed geometry. */
|
|
325
|
+
| "geometry-not-requested";
|
|
326
|
+
/**
|
|
327
|
+
* The metadata-only decision inputs recorded beside a representation choice so
|
|
328
|
+
* the selection is reproducible by inspection. Missing estimates are absent,
|
|
329
|
+
* never zero.
|
|
330
|
+
*/
|
|
331
|
+
export interface QueryPlanRepresentationInputsV1 {
|
|
332
|
+
/** Declared physical geometry encoding, when the source identity carries one. */
|
|
333
|
+
readonly geometryEncoding?: DuckDbGeometryEncoding;
|
|
334
|
+
/** Estimated rows at or above which `auto` selects columnar. */
|
|
335
|
+
readonly rowThreshold: number;
|
|
336
|
+
/** Estimated bytes at or above which `auto` selects columnar. */
|
|
337
|
+
readonly byteThreshold: number;
|
|
338
|
+
readonly estimatedRows?: number;
|
|
339
|
+
readonly estimatedBytes?: number;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Deterministic, explainable result-representation decision carried by every
|
|
343
|
+
* plan. `available` lists exactly what this source and query can serve, so a
|
|
344
|
+
* consumer can tell "columnar was not offered" from "columnar was declined".
|
|
345
|
+
*/
|
|
346
|
+
export interface QueryPlanRepresentationDecisionV1 {
|
|
347
|
+
readonly version: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
348
|
+
readonly requested: QueryPlanRepresentationRequest;
|
|
349
|
+
readonly selected: QueryPlanRepresentation;
|
|
350
|
+
/** Representations this source and query can serve, in stable order. */
|
|
351
|
+
readonly available: readonly QueryPlanRepresentation[];
|
|
352
|
+
readonly reason: QueryPlanRepresentationReason;
|
|
353
|
+
readonly inputs: QueryPlanRepresentationInputsV1;
|
|
354
|
+
}
|
|
355
|
+
export interface QueryPlanValidityV1 {
|
|
356
|
+
readonly version: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
357
|
+
readonly plannerVersion: typeof QUERY_PLANNER_VERSION;
|
|
358
|
+
readonly contractVersion: string;
|
|
359
|
+
readonly executionMode: QueryPlanExecutionMode;
|
|
360
|
+
/** Selected result representation; a batch produced under a different one is a different plan. */
|
|
361
|
+
readonly representation: QueryPlanRepresentation;
|
|
362
|
+
readonly sourceFingerprint: `sha256:${string}`;
|
|
363
|
+
readonly schemaFingerprint: `sha256:${string}`;
|
|
364
|
+
readonly discoveryFingerprint: `sha256:${string}`;
|
|
365
|
+
readonly authorizationScopeFingerprint: `sha256:${string}`;
|
|
366
|
+
readonly queryFingerprint: `sha256:${string}`;
|
|
367
|
+
readonly crsFingerprint: `sha256:${string}`;
|
|
368
|
+
readonly policyFingerprint: `sha256:${string}`;
|
|
369
|
+
readonly fingerprint: `sha256:${string}`;
|
|
370
|
+
}
|
|
371
|
+
export type QueryPlanWarningCode = "bounded-local-fallback" | "geometry-transfer-required" | "approximate-spatial-filter" | "columnar-representation-declined";
|
|
372
|
+
export interface QueryPlanWarning {
|
|
373
|
+
readonly code: QueryPlanWarningCode;
|
|
374
|
+
readonly severity: "warning";
|
|
375
|
+
readonly path: string;
|
|
376
|
+
readonly message: string;
|
|
377
|
+
readonly remediation: string;
|
|
378
|
+
}
|
|
379
|
+
export interface ExplainQueryOptions<T = Record<string, unknown>> {
|
|
380
|
+
readonly descriptor: SourceDescriptor;
|
|
381
|
+
readonly query?: Readonly<Query<T>>;
|
|
382
|
+
readonly capabilityPolicy?: CapabilityPolicy;
|
|
383
|
+
readonly fallback?: QueryFallbackPolicy;
|
|
384
|
+
readonly schemaVersion?: string;
|
|
385
|
+
readonly sourceVersion?: string;
|
|
386
|
+
/** Stable scope identifiers only. Never pass credentials or tokens. */
|
|
387
|
+
readonly authorizationScope?: readonly string[];
|
|
388
|
+
/**
|
|
389
|
+
* Trusted persisted authority identity used only while rebuilding a
|
|
390
|
+
* previously validated plan. Normal callers omit this and derive it from
|
|
391
|
+
* the descriptor plus `authorizationScope`.
|
|
392
|
+
* @internal
|
|
393
|
+
*/
|
|
394
|
+
readonly sourceAuthorityFingerprint?: `sha256:${string}` | null;
|
|
395
|
+
/** Caller-supplied metadata estimates; explaining never reads result data. */
|
|
396
|
+
readonly estimates?: QueryPlanningEstimates;
|
|
397
|
+
/** Stable cache state only. Observation clocks never enter a plan fingerprint. */
|
|
398
|
+
readonly cache?: QueryPlanCacheOptions;
|
|
399
|
+
/** Credential-safe discovery identity. Raw sources/validators are digested. */
|
|
400
|
+
readonly discovery?: QueryPlanDiscoveryContext;
|
|
401
|
+
/** Realtime delta plans carry mode only; live cursor bytes remain transport state. */
|
|
402
|
+
readonly executionMode?: QueryPlanExecutionMode;
|
|
403
|
+
/**
|
|
404
|
+
* Result-representation intent. Defaults to `auto`, which selects from
|
|
405
|
+
* declared source capabilities plus {@link ExplainQueryOptions.estimates}.
|
|
406
|
+
* Pinning a representation the source cannot serve throws
|
|
407
|
+
* `HonuaCapabilityNotSupportedError` rather than degrading silently.
|
|
408
|
+
*/
|
|
409
|
+
readonly representation?: QueryPlanRepresentationRequest;
|
|
410
|
+
}
|
|
411
|
+
/** Opt-in GeoParquet v2 planning options. */
|
|
412
|
+
export interface ExplainGeoParquetQueryOptions<T = Record<string, unknown>> extends ExplainQueryOptions<T> {
|
|
413
|
+
/** Opaque stable identity; the locator remains private to the injected resolver. */
|
|
414
|
+
readonly geoparquetResource: GeoParquetResourceHandleV1;
|
|
415
|
+
/**
|
|
416
|
+
* Trustworthy effective DuckDB output schema for this resource, established
|
|
417
|
+
* out-of-band by the trusted plan author (#627). Required to bind a plan
|
|
418
|
+
* that a `resultEncoding: "lossless-json"` source can execute opaquely.
|
|
419
|
+
*/
|
|
420
|
+
readonly effectiveSchema?: readonly GeoParquetEffectiveSchemaFieldV1[];
|
|
421
|
+
}
|
|
422
|
+
export interface GeoServicesCompiledQueryV1 {
|
|
423
|
+
/** Explicit input CRS for every query geometry; untagged inputs default to WGS84. */
|
|
424
|
+
readonly inSr?: string | number;
|
|
425
|
+
readonly compiler: "geoservices-rest-query-v1";
|
|
426
|
+
readonly serviceId: string;
|
|
427
|
+
readonly layerId: number;
|
|
428
|
+
readonly where?: string;
|
|
429
|
+
readonly outFields?: readonly string[];
|
|
430
|
+
readonly returnGeometry?: boolean;
|
|
431
|
+
readonly outSr?: string | number;
|
|
432
|
+
readonly orderByFields?: string;
|
|
433
|
+
readonly geometry?: {
|
|
434
|
+
readonly [key: string]: JsonValue;
|
|
435
|
+
};
|
|
436
|
+
readonly geometryType?: EsriGeometryType;
|
|
437
|
+
readonly spatialRel?: EsriSpatialRel;
|
|
438
|
+
/** GeoServices `time=` value compiled from a source-dimension temporal filter. */
|
|
439
|
+
readonly time?: string;
|
|
440
|
+
readonly resultOffset?: number;
|
|
441
|
+
readonly resultRecordCount?: number;
|
|
442
|
+
readonly outStatistics?: readonly {
|
|
443
|
+
readonly statisticType: string;
|
|
444
|
+
readonly onStatisticField: string;
|
|
445
|
+
readonly outStatisticFieldName: string;
|
|
446
|
+
}[];
|
|
447
|
+
readonly groupByFieldsForStatistics?: string;
|
|
448
|
+
}
|
|
449
|
+
/** Inspectable OGC API Features `/items` request produced without I/O. */
|
|
450
|
+
export interface OgcApiFeaturesCompiledQueryV1 {
|
|
451
|
+
readonly compiler: "ogc-api-features-query-v1";
|
|
452
|
+
readonly collectionId: string | number;
|
|
453
|
+
readonly filter?: string;
|
|
454
|
+
readonly filterLang?: "cql2-text";
|
|
455
|
+
/** OGC `datetime=` value compiled from a source-dimension temporal filter. */
|
|
456
|
+
readonly datetime?: string;
|
|
457
|
+
readonly properties?: readonly string[];
|
|
458
|
+
readonly sortby?: string;
|
|
459
|
+
readonly bbox?: string;
|
|
460
|
+
readonly crs?: string;
|
|
461
|
+
readonly offset?: number;
|
|
462
|
+
readonly limit?: number;
|
|
463
|
+
}
|
|
464
|
+
/** Inspectable WFS 2.0 GetFeature request produced without I/O. */
|
|
465
|
+
export interface WfsCompiledQueryV1 {
|
|
466
|
+
readonly compiler: "wfs-2.0-get-feature-v1";
|
|
467
|
+
readonly typeName: string;
|
|
468
|
+
readonly filter?: string;
|
|
469
|
+
readonly propertyName?: readonly string[];
|
|
470
|
+
readonly sortBy?: string;
|
|
471
|
+
readonly startIndex?: number;
|
|
472
|
+
readonly count?: number;
|
|
473
|
+
readonly srsName?: string;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Operation- and source-identity-bound WFS 2.0 artifact used by query plans and the
|
|
477
|
+
* executable protocol-module seam. Output-format negotiation and transport
|
|
478
|
+
* authority remain on the discovered runtime handle.
|
|
479
|
+
*/
|
|
480
|
+
export interface WfsProtocolCompiledQueryV1 {
|
|
481
|
+
readonly compiler: "wfs-2.0-protocol-query-v1";
|
|
482
|
+
readonly operation: ProtocolModuleQueryOperation;
|
|
483
|
+
readonly sourceId: string;
|
|
484
|
+
/** Credential-free endpoint identity; never the request authority itself. */
|
|
485
|
+
readonly endpoint: string;
|
|
486
|
+
/** Secret-free binding to the runtime handle's endpoint authority and scope. */
|
|
487
|
+
readonly authorityFingerprint: `sha256:${string}`;
|
|
488
|
+
readonly typeName: string;
|
|
489
|
+
readonly method: "GET" | "POST";
|
|
490
|
+
readonly filter?: string;
|
|
491
|
+
readonly bbox?: string;
|
|
492
|
+
readonly propertyName?: readonly string[];
|
|
493
|
+
readonly sortBy?: string;
|
|
494
|
+
readonly startIndex?: number;
|
|
495
|
+
readonly count?: number;
|
|
496
|
+
/** CRS of the caller-supplied filter geometry, independent of response CRS. */
|
|
497
|
+
readonly filterSrsName?: string;
|
|
498
|
+
/** Requested response geometry CRS. */
|
|
499
|
+
readonly srsName?: string;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Legacy, operation-neutral OData v4 entity-set request produced by
|
|
503
|
+
* `compileOdataQuery()`. Executable protocol modules use the distinct
|
|
504
|
+
* operation-bound {@link OdataProtocolCompiledQueryV1} artifact.
|
|
505
|
+
*/
|
|
506
|
+
export interface OdataCompiledQueryV1 {
|
|
507
|
+
readonly compiler: "odata-v4-query-v1";
|
|
508
|
+
readonly entitySet: string;
|
|
509
|
+
readonly filter?: string;
|
|
510
|
+
readonly select?: readonly string[];
|
|
511
|
+
readonly expand?: readonly string[];
|
|
512
|
+
readonly orderBy?: readonly string[];
|
|
513
|
+
readonly skip?: number;
|
|
514
|
+
readonly top?: number;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Operation-bound OData v4 protocol artifact used by query plans and the
|
|
518
|
+
* executable protocol-module seam.
|
|
519
|
+
*/
|
|
520
|
+
export interface OdataProtocolCompiledQueryV1 {
|
|
521
|
+
readonly compiler: "odata-v4-protocol-query-v1";
|
|
522
|
+
readonly operation: ProtocolModuleQueryOperation;
|
|
523
|
+
readonly entitySet: string;
|
|
524
|
+
readonly filter?: string;
|
|
525
|
+
readonly select?: readonly string[];
|
|
526
|
+
readonly expand?: readonly string[];
|
|
527
|
+
readonly orderBy?: readonly string[];
|
|
528
|
+
readonly skip?: number;
|
|
529
|
+
readonly top?: number;
|
|
530
|
+
}
|
|
531
|
+
/** Inspectable DuckDB `SELECT` over `read_parquet(...)` produced without I/O. */
|
|
532
|
+
export interface DuckDbCompiledQueryV1 {
|
|
533
|
+
readonly compiler: "duckdb-sql-v1";
|
|
534
|
+
/** Deterministic, injection-safe DuckDB SQL text. */
|
|
535
|
+
readonly sql: string;
|
|
536
|
+
/** Parquet file URL(s) / glob(s) the SQL reads. */
|
|
537
|
+
readonly sources: readonly string[];
|
|
538
|
+
readonly geometryColumn?: string;
|
|
539
|
+
readonly geometryEncoding?: DuckDbGeometryEncoding;
|
|
540
|
+
/** True when a non-envelope spatial filter was reduced to its bounding box. */
|
|
541
|
+
readonly bboxApproximated?: boolean;
|
|
542
|
+
}
|
|
543
|
+
/** Credential-free DuckDB template compiled for execution-time resource binding. */
|
|
544
|
+
export interface DuckDbCompiledQueryV2 {
|
|
545
|
+
readonly compiler: "duckdb-sql-v2";
|
|
546
|
+
/** Inspectable SQL over a fixed non-runnable placeholder, never a raw locator. */
|
|
547
|
+
readonly sqlTemplate: string;
|
|
548
|
+
readonly resource: GeoParquetResourceHandleV1;
|
|
549
|
+
readonly geometryColumn?: string;
|
|
550
|
+
readonly geometryEncoding?: DuckDbGeometryEncoding;
|
|
551
|
+
readonly bboxApproximated?: boolean;
|
|
552
|
+
}
|
|
553
|
+
/** Proto spatial-relationship enum value name emitted by the gRPC compiler. */
|
|
554
|
+
export type GrpcSpatialRelationship = "SPATIAL_RELATIONSHIP_INTERSECTS" | "SPATIAL_RELATIONSHIP_WITHIN" | "SPATIAL_RELATIONSHIP_CONTAINS" | "SPATIAL_RELATIONSHIP_ENVELOPE_INTERSECTS" | "SPATIAL_RELATIONSHIP_CROSSES" | "SPATIAL_RELATIONSHIP_TOUCHES" | "SPATIAL_RELATIONSHIP_OVERLAPS" | "SPATIAL_RELATIONSHIP_DISJOINT";
|
|
555
|
+
/** Proto statistic-type enum value name emitted by the gRPC compiler. */
|
|
556
|
+
export type GrpcStatisticType = "STATISTIC_TYPE_COUNT" | "STATISTIC_TYPE_SUM" | "STATISTIC_TYPE_MIN" | "STATISTIC_TYPE_MAX" | "STATISTIC_TYPE_AVG" | "STATISTIC_TYPE_STDDEV" | "STATISTIC_TYPE_VAR";
|
|
557
|
+
/**
|
|
558
|
+
* Inspectable `geospatial.v1.FeatureService/QueryFeatures` unary request produced
|
|
559
|
+
* without pulling in the protobuf runtime. Field names and enum value names
|
|
560
|
+
* mirror the generated `QueryFeaturesRequest` message so the plan is a faithful,
|
|
561
|
+
* deterministic description of the wire request.
|
|
562
|
+
*/
|
|
563
|
+
export interface GrpcCompiledQueryV1 {
|
|
564
|
+
readonly compiler: "honua-grpc-query-features-v1";
|
|
565
|
+
readonly service: "geospatial.v1.FeatureService";
|
|
566
|
+
readonly method: "QueryFeatures";
|
|
567
|
+
readonly serviceId: string;
|
|
568
|
+
readonly layerId: number;
|
|
569
|
+
readonly where?: string;
|
|
570
|
+
readonly outFields?: readonly string[];
|
|
571
|
+
readonly returnGeometry?: boolean;
|
|
572
|
+
readonly outSr?: string | number;
|
|
573
|
+
readonly orderBy?: string;
|
|
574
|
+
readonly resultOffsetLong?: string;
|
|
575
|
+
readonly resultRecordCountLong?: string;
|
|
576
|
+
readonly spatialFilter?: {
|
|
577
|
+
readonly geometry: {
|
|
578
|
+
readonly [key: string]: JsonValue;
|
|
579
|
+
};
|
|
580
|
+
readonly geometryType: EsriGeometryType;
|
|
581
|
+
readonly spatialRelationship: GrpcSpatialRelationship;
|
|
582
|
+
};
|
|
583
|
+
readonly outStatistics?: readonly {
|
|
584
|
+
readonly statisticType: GrpcStatisticType;
|
|
585
|
+
readonly onStatisticField: string;
|
|
586
|
+
readonly outStatisticFieldName: string;
|
|
587
|
+
}[];
|
|
588
|
+
readonly groupBy?: readonly string[];
|
|
589
|
+
}
|
|
590
|
+
export type RemoteCompiledQueryV1 = GeoServicesCompiledQueryV1 | OgcApiFeaturesCompiledQueryV1 | WfsCompiledQueryV1 | WfsProtocolCompiledQueryV1 | OdataCompiledQueryV1 | OdataProtocolCompiledQueryV1 | DuckDbCompiledQueryV1 | GrpcCompiledQueryV1;
|
|
591
|
+
export interface RemoteQueryPlanStep {
|
|
592
|
+
readonly id: string;
|
|
593
|
+
readonly engine: "remote";
|
|
594
|
+
readonly operation: "query" | "queryAll" | "queryAggregate";
|
|
595
|
+
readonly pushdown: "full" | "partial";
|
|
596
|
+
readonly fidelity: QueryPlanFidelity;
|
|
597
|
+
readonly losses: readonly QueryPlanFidelityLoss[];
|
|
598
|
+
readonly bounds: QueryPlanBoundsV1;
|
|
599
|
+
readonly provenance: QueryPlanStepProvenanceV1;
|
|
600
|
+
readonly reason: string;
|
|
601
|
+
readonly requests: number;
|
|
602
|
+
readonly query: CanonicalQuery;
|
|
603
|
+
readonly compiled: RemoteCompiledQueryV1;
|
|
604
|
+
}
|
|
605
|
+
export interface GeoParquetRemoteQueryPlanStepV2 {
|
|
606
|
+
readonly id: string;
|
|
607
|
+
readonly engine: "remote";
|
|
608
|
+
readonly operation: "query" | "queryAll" | "queryAggregate";
|
|
609
|
+
readonly pushdown: "full" | "partial";
|
|
610
|
+
readonly fidelity: QueryPlanFidelity;
|
|
611
|
+
readonly losses: readonly QueryPlanFidelityLoss[];
|
|
612
|
+
readonly bounds: QueryPlanBoundsV1;
|
|
613
|
+
readonly provenance: QueryPlanStepProvenanceV1;
|
|
614
|
+
readonly reason: string;
|
|
615
|
+
readonly requests: number;
|
|
616
|
+
readonly query: CanonicalQuery;
|
|
617
|
+
readonly compiled: DuckDbCompiledQueryV2;
|
|
618
|
+
}
|
|
619
|
+
export interface LocalAggregatePlanStep {
|
|
620
|
+
readonly id: string;
|
|
621
|
+
readonly engine: "client";
|
|
622
|
+
readonly operation: "aggregate";
|
|
623
|
+
readonly pushdown: "none";
|
|
624
|
+
readonly fidelity: "equivalent";
|
|
625
|
+
readonly losses: readonly QueryPlanFidelityLoss[];
|
|
626
|
+
readonly bounds: QueryPlanBoundsV1;
|
|
627
|
+
readonly provenance: QueryPlanStepProvenanceV1;
|
|
628
|
+
readonly reason: string;
|
|
629
|
+
readonly inputStepId: string;
|
|
630
|
+
readonly aggregation: AggregationSpec;
|
|
631
|
+
readonly maxRows: number;
|
|
632
|
+
readonly maxBytes?: number;
|
|
633
|
+
}
|
|
634
|
+
export type QueryPlanStep = RemoteQueryPlanStep | LocalAggregatePlanStep;
|
|
635
|
+
export type QueryPlanStepV2 = GeoParquetRemoteQueryPlanStepV2 | LocalAggregatePlanStep;
|
|
636
|
+
export interface QueryExecutionPlanV1 {
|
|
637
|
+
readonly kind: typeof QUERY_PLAN_KIND;
|
|
638
|
+
readonly version: typeof QUERY_PLAN_VERSION;
|
|
639
|
+
readonly id: string;
|
|
640
|
+
readonly fingerprint: `sha256:${string}`;
|
|
641
|
+
readonly ir: QueryIrV1;
|
|
642
|
+
readonly capabilityPolicy: CapabilityPolicy;
|
|
643
|
+
readonly fallback: QueryFallbackPolicy;
|
|
644
|
+
readonly pushdown: "full" | "partial";
|
|
645
|
+
readonly diagnosticsVersion: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
646
|
+
readonly fidelity: QueryPlanFidelity;
|
|
647
|
+
readonly losses: readonly QueryPlanFidelityLoss[];
|
|
648
|
+
readonly bounds: QueryPlanBoundsV1;
|
|
649
|
+
readonly cache: QueryPlanCacheDecisionV1;
|
|
650
|
+
readonly provenance: QueryPlanProvenanceV1;
|
|
651
|
+
readonly validity: QueryPlanValidityV1;
|
|
652
|
+
readonly representation: QueryPlanRepresentationDecisionV1;
|
|
653
|
+
readonly estimates: QueryPlanningEstimates;
|
|
654
|
+
readonly steps: readonly QueryPlanStep[];
|
|
655
|
+
readonly warnings: readonly QueryPlanWarning[];
|
|
656
|
+
}
|
|
657
|
+
export interface QueryExecutionPlanV2 {
|
|
658
|
+
readonly kind: typeof QUERY_PLAN_KIND;
|
|
659
|
+
readonly version: typeof QUERY_PLAN_V2_VERSION;
|
|
660
|
+
readonly id: string;
|
|
661
|
+
readonly fingerprint: `sha256:${string}`;
|
|
662
|
+
readonly ir: QueryIrV2;
|
|
663
|
+
readonly capabilityPolicy: CapabilityPolicy;
|
|
664
|
+
readonly fallback: QueryFallbackPolicy;
|
|
665
|
+
readonly pushdown: "full" | "partial";
|
|
666
|
+
readonly diagnosticsVersion: typeof QUERY_PLAN_DIAGNOSTICS_VERSION;
|
|
667
|
+
readonly fidelity: QueryPlanFidelity;
|
|
668
|
+
readonly losses: readonly QueryPlanFidelityLoss[];
|
|
669
|
+
readonly bounds: QueryPlanBoundsV1;
|
|
670
|
+
readonly cache: QueryPlanCacheDecisionV1;
|
|
671
|
+
readonly provenance: QueryPlanProvenanceV1;
|
|
672
|
+
readonly validity: QueryPlanValidityV1;
|
|
673
|
+
readonly representation: QueryPlanRepresentationDecisionV1;
|
|
674
|
+
readonly estimates: QueryPlanningEstimates;
|
|
675
|
+
readonly steps: readonly QueryPlanStepV2[];
|
|
676
|
+
readonly warnings: readonly QueryPlanWarning[];
|
|
677
|
+
}
|
|
678
|
+
export type QueryExecutionPlan = QueryExecutionPlanV1 | QueryExecutionPlanV2;
|
|
679
|
+
export type QueryPlanningErrorCode = "invalid-query" | "unsupported-compiler" | "unsupported-query" | "capability-not-supported" | "fallback-disabled" | "unsafe-materialization";
|
|
680
|
+
export declare class HonuaQueryPlanningError extends HonuaSdkError {
|
|
681
|
+
readonly code: QueryPlanningErrorCode;
|
|
682
|
+
constructor(code: QueryPlanningErrorCode, message: string, options?: HonuaErrorOptions);
|
|
683
|
+
}
|
|
684
|
+
export type QueryPlanExecutionErrorCode = "invalid-plan" | "plan-context-mismatch" | "stale-plan" | "foreign-plan" | "unsafe-materialization" | "invalid-resource-handle" | "resource-unavailable" | "resource-expired" | "resource-resolution-failed" | "resource-execution-failed";
|
|
685
|
+
export declare class HonuaQueryPlanExecutionError extends HonuaSdkError {
|
|
686
|
+
readonly code: QueryPlanExecutionErrorCode;
|
|
687
|
+
readonly reason?: QueryPlanExecutionFailureReason | undefined;
|
|
688
|
+
constructor(code: QueryPlanExecutionErrorCode, message: string, options?: HonuaErrorOptions, reason?: QueryPlanExecutionFailureReason | undefined);
|
|
689
|
+
}
|
|
690
|
+
export interface ExecuteQueryPlanOptions {
|
|
691
|
+
readonly signal?: AbortSignal;
|
|
692
|
+
readonly schemaVersion?: string;
|
|
693
|
+
readonly sourceVersion?: string;
|
|
694
|
+
readonly authorizationScope?: readonly string[];
|
|
695
|
+
readonly discovery?: QueryPlanDiscoveryContext;
|
|
696
|
+
readonly executionMode?: QueryPlanExecutionMode;
|
|
697
|
+
/** Exact non-secret partition id required by a GeoParquet v2 resource handle. */
|
|
698
|
+
readonly authorizationContextId?: string;
|
|
699
|
+
/** Lifecycle-scoped resolver used only at the trusted v2 execution boundary. */
|
|
700
|
+
readonly geoParquetResourceResolver?: GeoParquetResourceResolver;
|
|
701
|
+
/** Must match the effective schema the plan was explained with (#627). */
|
|
702
|
+
readonly effectiveSchema?: readonly GeoParquetEffectiveSchemaFieldV1[];
|
|
703
|
+
}
|
|
704
|
+
export type QueryPlanExecutionFailureReason = "source-identity-changed" | "authorization-scope-changed" | "source-version-changed" | "schema-changed" | "capabilities-changed" | "discovery-changed" | "execution-mode-changed";
|
|
705
|
+
export interface QueryPlanExecution<T = Record<string, unknown>> {
|
|
706
|
+
readonly planId: string;
|
|
707
|
+
readonly fingerprint: `sha256:${string}`;
|
|
708
|
+
readonly result: Result<T>;
|
|
709
|
+
}
|
|
710
|
+
/** Executor signature exported for dependency injection and test doubles. */
|
|
711
|
+
export type QueryPlanExecutor = <T>(plan: QueryExecutionPlan, source: Source<T>, options?: ExecuteQueryPlanOptions) => Promise<QueryPlanExecution<T>>;
|
|
712
|
+
//# sourceMappingURL=types.d.ts.map
|