@honua/react 0.0.20-alpha.0 → 0.1.1-beta.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.
Files changed (363) hide show
  1. package/contract/discovery.d.ts +231 -0
  2. package/contract/discovery.d.ts.map +1 -0
  3. package/contract/discovery.js +554 -0
  4. package/contract/edit-sketch.d.ts +8 -0
  5. package/contract/edit-sketch.d.ts.map +1 -1
  6. package/contract/edit-sketch.js +15 -0
  7. package/contract/edit-snapping.d.ts +160 -0
  8. package/contract/edit-snapping.d.ts.map +1 -0
  9. package/contract/edit-snapping.js +675 -0
  10. package/contract/generated/projjson-v0.7-crs-validator.d.ts +35 -0
  11. package/contract/generated/projjson-v0.7-crs-validator.d.ts.map +1 -0
  12. package/contract/generated/projjson-v0.7-crs-validator.js +3941 -0
  13. package/contract/index.d.ts +12 -1
  14. package/contract/index.d.ts.map +1 -1
  15. package/contract/index.js +4 -0
  16. package/contract/pmtiles.d.ts +193 -0
  17. package/contract/pmtiles.d.ts.map +1 -0
  18. package/contract/pmtiles.js +195 -0
  19. package/contract/protocol-module.d.ts +70 -0
  20. package/contract/protocol-module.d.ts.map +1 -0
  21. package/contract/protocol-module.js +1 -0
  22. package/contract/schema-envelope.d.ts +26 -0
  23. package/contract/schema-envelope.d.ts.map +1 -0
  24. package/contract/schema-envelope.js +25 -0
  25. package/contract/schema.d.ts +582 -0
  26. package/contract/schema.d.ts.map +1 -0
  27. package/contract/schema.js +2483 -0
  28. package/contract/source-capability-support.d.ts +6 -0
  29. package/contract/source-capability-support.d.ts.map +1 -0
  30. package/contract/source-capability-support.js +154 -0
  31. package/contract/source.d.ts +57 -15
  32. package/contract/source.d.ts.map +1 -1
  33. package/contract/source.js +368 -65
  34. package/contract/types.d.ts +171 -6
  35. package/contract/types.d.ts.map +1 -1
  36. package/contract/types.js +14 -14
  37. package/core/auth/client-credentials-provider.d.ts +51 -0
  38. package/core/auth/client-credentials-provider.d.ts.map +1 -0
  39. package/core/auth/client-credentials-provider.js +115 -0
  40. package/core/auth/credential-store.d.ts +52 -0
  41. package/core/auth/credential-store.d.ts.map +1 -0
  42. package/core/auth/credential-store.js +82 -0
  43. package/core/auth/index.d.ts +23 -0
  44. package/core/auth/index.d.ts.map +1 -0
  45. package/core/auth/index.js +20 -0
  46. package/core/auth/oauth2-provider.d.ts +114 -0
  47. package/core/auth/oauth2-provider.d.ts.map +1 -0
  48. package/core/auth/oauth2-provider.js +408 -0
  49. package/core/auth/pkce.d.ts +25 -0
  50. package/core/auth/pkce.d.ts.map +1 -0
  51. package/core/auth/pkce.js +46 -0
  52. package/core/auth/static-providers.d.ts +20 -0
  53. package/core/auth/static-providers.d.ts.map +1 -0
  54. package/core/auth/static-providers.js +26 -0
  55. package/core/auth/token-endpoint.d.ts +40 -0
  56. package/core/auth/token-endpoint.d.ts.map +1 -0
  57. package/core/auth/token-endpoint.js +133 -0
  58. package/core/auth/types.d.ts +144 -0
  59. package/core/auth/types.d.ts.map +1 -0
  60. package/core/auth/types.js +8 -0
  61. package/core/bounded-json.d.ts +4 -0
  62. package/core/bounded-json.d.ts.map +1 -0
  63. package/core/bounded-json.js +38 -0
  64. package/core/cache-state.d.ts +9 -0
  65. package/core/cache-state.d.ts.map +1 -1
  66. package/core/cache-state.js +10 -0
  67. package/core/capabilities-xml.d.ts +33 -0
  68. package/core/capabilities-xml.d.ts.map +1 -0
  69. package/core/capabilities-xml.js +331 -0
  70. package/core/client.d.ts +35 -2
  71. package/core/client.d.ts.map +1 -1
  72. package/core/client.js +167 -29
  73. package/core/error-classifications.d.ts +153 -0
  74. package/core/error-classifications.d.ts.map +1 -0
  75. package/core/error-classifications.js +140 -0
  76. package/core/error-code-registry.d.ts +158 -0
  77. package/core/error-code-registry.d.ts.map +1 -0
  78. package/core/error-code-registry.js +143 -0
  79. package/core/error-envelope.d.ts +68 -0
  80. package/core/error-envelope.d.ts.map +1 -0
  81. package/core/error-envelope.js +357 -0
  82. package/core/errors.d.ts +73 -25
  83. package/core/errors.d.ts.map +1 -1
  84. package/core/errors.js +113 -46
  85. package/core/geoparquet-sql.d.ts +190 -0
  86. package/core/geoparquet-sql.d.ts.map +1 -0
  87. package/core/geoparquet-sql.js +368 -0
  88. package/core/odata-key-path.d.ts +12 -0
  89. package/core/odata-key-path.d.ts.map +1 -0
  90. package/core/odata-key-path.js +28 -0
  91. package/core/odata-write-codec.d.ts +66 -0
  92. package/core/odata-write-codec.d.ts.map +1 -0
  93. package/core/odata-write-codec.js +1083 -0
  94. package/core/odata.d.ts +59 -7
  95. package/core/odata.d.ts.map +1 -1
  96. package/core/odata.js +431 -99
  97. package/core/ogc-endpoint-layout.d.ts +70 -0
  98. package/core/ogc-endpoint-layout.d.ts.map +1 -0
  99. package/core/ogc-endpoint-layout.js +173 -0
  100. package/core/ogc-features.d.ts.map +1 -1
  101. package/core/ogc-features.js +35 -17
  102. package/core/ogc-maps.d.ts +7 -0
  103. package/core/ogc-maps.d.ts.map +1 -1
  104. package/core/ogc-maps.js +46 -7
  105. package/core/ogc-processes.d.ts +2 -1
  106. package/core/ogc-processes.d.ts.map +1 -1
  107. package/core/ogc-processes.js +33 -5
  108. package/core/ogc-records.d.ts +9 -0
  109. package/core/ogc-records.d.ts.map +1 -1
  110. package/core/ogc-records.js +78 -29
  111. package/core/ogc-tiles.d.ts +10 -1
  112. package/core/ogc-tiles.d.ts.map +1 -1
  113. package/core/ogc-tiles.js +56 -17
  114. package/core/path-utils.d.ts +9 -0
  115. package/core/path-utils.d.ts.map +1 -1
  116. package/core/path-utils.js +19 -0
  117. package/core/protocol-transport.d.ts +1 -0
  118. package/core/protocol-transport.d.ts.map +1 -1
  119. package/core/request-pipeline.d.ts.map +1 -1
  120. package/core/request-pipeline.js +1 -1
  121. package/core/spatial-filter.d.ts +8 -4
  122. package/core/spatial-filter.d.ts.map +1 -1
  123. package/core/spatial-filter.js +206 -16
  124. package/core/stac-static.d.ts +55 -0
  125. package/core/stac-static.d.ts.map +1 -0
  126. package/core/stac-static.js +386 -0
  127. package/core/stac.d.ts +12 -0
  128. package/core/stac.d.ts.map +1 -1
  129. package/core/stac.js +45 -15
  130. package/core/surfaces.d.ts +13 -0
  131. package/core/surfaces.d.ts.map +1 -1
  132. package/core/surfaces.js +127 -16
  133. package/core/types.d.ts +174 -7
  134. package/core/types.d.ts.map +1 -1
  135. package/core/wfs-capabilities.d.ts +12 -0
  136. package/core/wfs-capabilities.d.ts.map +1 -1
  137. package/core/wfs-capabilities.js +22 -3
  138. package/core/wfs.d.ts +13 -0
  139. package/core/wfs.d.ts.map +1 -1
  140. package/core/wfs.js +35 -5
  141. package/core/wms-capabilities.d.ts +56 -84
  142. package/core/wms-capabilities.d.ts.map +1 -1
  143. package/core/wms-capabilities.js +212 -509
  144. package/core/wmts-capabilities.d.ts +62 -62
  145. package/core/wmts-capabilities.d.ts.map +1 -1
  146. package/core/wmts-capabilities.js +224 -371
  147. package/esri-compat/editor.d.ts +8 -0
  148. package/esri-compat/editor.d.ts.map +1 -1
  149. package/esri-compat/editor.js +13 -0
  150. package/esri-compat/feature-layer.d.ts +2 -0
  151. package/esri-compat/feature-layer.d.ts.map +1 -1
  152. package/esri-compat/feature-layer.js +1 -0
  153. package/esri-compat/identity-manager.d.ts +43 -0
  154. package/esri-compat/identity-manager.d.ts.map +1 -1
  155. package/esri-compat/identity-manager.js +131 -1
  156. package/esri-compat/layer-list.d.ts +11 -0
  157. package/esri-compat/layer-list.d.ts.map +1 -1
  158. package/esri-compat/layer-list.js +49 -0
  159. package/esri-compat/legend.d.ts +10 -0
  160. package/esri-compat/legend.d.ts.map +1 -1
  161. package/esri-compat/legend.js +27 -0
  162. package/esri-compat/oauth-info.d.ts +15 -0
  163. package/esri-compat/oauth-info.d.ts.map +1 -1
  164. package/esri-compat/oauth-info.js +27 -0
  165. package/esri-compat/portal.d.ts +197 -0
  166. package/esri-compat/portal.d.ts.map +1 -0
  167. package/esri-compat/portal.js +251 -0
  168. package/esri-compat/renderer-objects.d.ts +40 -0
  169. package/esri-compat/renderer-objects.d.ts.map +1 -0
  170. package/esri-compat/renderer-objects.js +62 -0
  171. package/esri-compat/sketch.d.ts +43 -0
  172. package/esri-compat/sketch.d.ts.map +1 -1
  173. package/esri-compat/sketch.js +46 -0
  174. package/esri-compat/snapping.d.ts +43 -0
  175. package/esri-compat/snapping.d.ts.map +1 -0
  176. package/esri-compat/snapping.js +45 -0
  177. package/esri-compat/url.d.ts.map +1 -1
  178. package/esri-compat/url.js +1 -1
  179. package/esri-compat/widget-host.d.ts +84 -0
  180. package/esri-compat/widget-host.d.ts.map +1 -0
  181. package/esri-compat/widget-host.js +159 -0
  182. package/filter-registry/index.d.ts +145 -0
  183. package/filter-registry/index.d.ts.map +1 -0
  184. package/filter-registry/index.js +531 -0
  185. package/generated-app/errors.d.ts +18 -2
  186. package/generated-app/errors.d.ts.map +1 -1
  187. package/generated-app/errors.js +44 -11
  188. package/map/automatic-mount-integration.d.ts +134 -0
  189. package/map/automatic-mount-integration.d.ts.map +1 -0
  190. package/map/automatic-mount-integration.js +305 -0
  191. package/map/automatic-source-strategy.d.ts +125 -0
  192. package/map/automatic-source-strategy.d.ts.map +1 -0
  193. package/map/automatic-source-strategy.js +494 -0
  194. package/map/data-to-map-bridge.d.ts +293 -0
  195. package/map/data-to-map-bridge.d.ts.map +1 -0
  196. package/map/data-to-map-bridge.js +817 -0
  197. package/map/geojson-projection.d.ts +33 -0
  198. package/map/geojson-projection.d.ts.map +1 -0
  199. package/map/geojson-projection.js +118 -0
  200. package/map/index.d.ts +14 -0
  201. package/map/index.d.ts.map +1 -1
  202. package/map/index.js +8 -0
  203. package/map/raster-source-spec.d.ts +30 -0
  204. package/map/raster-source-spec.d.ts.map +1 -0
  205. package/map/raster-source-spec.js +190 -0
  206. package/map/raster-source-strategy.d.ts +65 -0
  207. package/map/raster-source-strategy.d.ts.map +1 -0
  208. package/map/raster-source-strategy.js +232 -0
  209. package/map/source-to-maplibre.d.ts +91 -0
  210. package/map/source-to-maplibre.d.ts.map +1 -0
  211. package/map/source-to-maplibre.js +454 -0
  212. package/map/temporal-playback.d.ts +139 -0
  213. package/map/temporal-playback.d.ts.map +1 -0
  214. package/map/temporal-playback.js +247 -0
  215. package/package.json +19 -1
  216. package/query-planner/canonical.d.ts +7 -0
  217. package/query-planner/canonical.d.ts.map +1 -0
  218. package/query-planner/canonical.js +145 -0
  219. package/query-planner/cql2-json.d.ts +17 -0
  220. package/query-planner/cql2-json.d.ts.map +1 -0
  221. package/query-planner/cql2-json.js +646 -0
  222. package/query-planner/diagnostics.d.ts +35 -0
  223. package/query-planner/diagnostics.d.ts.map +1 -0
  224. package/query-planner/diagnostics.js +373 -0
  225. package/query-planner/duckdb.d.ts +79 -0
  226. package/query-planner/duckdb.d.ts.map +1 -0
  227. package/query-planner/duckdb.js +758 -0
  228. package/query-planner/execution-context.d.ts +5 -0
  229. package/query-planner/execution-context.d.ts.map +1 -0
  230. package/query-planner/execution-context.js +50 -0
  231. package/query-planner/executor.d.ts +5 -0
  232. package/query-planner/executor.d.ts.map +1 -0
  233. package/query-planner/executor.js +223 -0
  234. package/query-planner/geoservices.d.ts +91 -0
  235. package/query-planner/geoservices.d.ts.map +1 -0
  236. package/query-planner/geoservices.js +667 -0
  237. package/query-planner/grpc.d.ts +100 -0
  238. package/query-planner/grpc.d.ts.map +1 -0
  239. package/query-planner/grpc.js +736 -0
  240. package/query-planner/index.d.ts +44 -0
  241. package/query-planner/index.d.ts.map +1 -0
  242. package/query-planner/index.js +30 -0
  243. package/query-planner/ir.d.ts +20 -0
  244. package/query-planner/ir.d.ts.map +1 -0
  245. package/query-planner/ir.js +417 -0
  246. package/query-planner/local-aggregate.d.ts +5 -0
  247. package/query-planner/local-aggregate.d.ts.map +1 -0
  248. package/query-planner/local-aggregate.js +126 -0
  249. package/query-planner/odata.d.ts +48 -0
  250. package/query-planner/odata.d.ts.map +1 -0
  251. package/query-planner/odata.js +662 -0
  252. package/query-planner/ogc-compiler.d.ts +55 -0
  253. package/query-planner/ogc-compiler.d.ts.map +1 -0
  254. package/query-planner/ogc-compiler.js +480 -0
  255. package/query-planner/ogc-features.d.ts +53 -0
  256. package/query-planner/ogc-features.d.ts.map +1 -0
  257. package/query-planner/ogc-features.js +617 -0
  258. package/query-planner/planner.d.ts +17 -0
  259. package/query-planner/planner.d.ts.map +1 -0
  260. package/query-planner/planner.js +818 -0
  261. package/query-planner/resource.d.ts +94 -0
  262. package/query-planner/resource.d.ts.map +1 -0
  263. package/query-planner/resource.js +526 -0
  264. package/query-planner/semantic-canonical.d.ts +15 -0
  265. package/query-planner/semantic-canonical.d.ts.map +1 -0
  266. package/query-planner/semantic-canonical.js +62 -0
  267. package/query-planner/semantic-compat.d.ts +10 -0
  268. package/query-planner/semantic-compat.d.ts.map +1 -0
  269. package/query-planner/semantic-compat.js +35 -0
  270. package/query-planner/semantic-compiler.d.ts +64 -0
  271. package/query-planner/semantic-compiler.d.ts.map +1 -0
  272. package/query-planner/semantic-compiler.js +81 -0
  273. package/query-planner/semantic-literals.d.ts +30 -0
  274. package/query-planner/semantic-literals.d.ts.map +1 -0
  275. package/query-planner/semantic-literals.js +133 -0
  276. package/query-planner/semantic-types.d.ts +265 -0
  277. package/query-planner/semantic-types.d.ts.map +1 -0
  278. package/query-planner/semantic-types.js +1 -0
  279. package/query-planner/semantic.d.ts +54 -0
  280. package/query-planner/semantic.d.ts.map +1 -0
  281. package/query-planner/semantic.js +1421 -0
  282. package/query-planner/types.d.ts +560 -0
  283. package/query-planner/types.d.ts.map +1 -0
  284. package/query-planner/types.js +49 -0
  285. package/query-planner/wfs-semantic.d.ts +58 -0
  286. package/query-planner/wfs-semantic.d.ts.map +1 -0
  287. package/query-planner/wfs-semantic.js +547 -0
  288. package/query-planner/wfs.d.ts +6 -0
  289. package/query-planner/wfs.d.ts.map +1 -0
  290. package/query-planner/wfs.js +71 -0
  291. package/react/external-map.d.ts +67 -0
  292. package/react/external-map.d.ts.map +1 -0
  293. package/react/external-map.js +63 -0
  294. package/react/honua-map.d.ts.map +1 -1
  295. package/react/honua-map.js +3 -2
  296. package/react/honua-source-layer.d.ts +110 -0
  297. package/react/honua-source-layer.d.ts.map +1 -0
  298. package/react/honua-source-layer.js +101 -0
  299. package/react/hooks.d.ts +28 -0
  300. package/react/hooks.d.ts.map +1 -1
  301. package/react/hooks.js +26 -4
  302. package/react/index.d.ts +8 -0
  303. package/react/index.d.ts.map +1 -1
  304. package/react/index.js +5 -0
  305. package/react/query-cache.d.ts +26 -4
  306. package/react/query-cache.d.ts.map +1 -1
  307. package/react/query-cache.js +51 -8
  308. package/react/selection.d.ts +177 -0
  309. package/react/selection.d.ts.map +1 -0
  310. package/react/selection.js +0 -0
  311. package/react/use-mounted-source.d.ts +69 -0
  312. package/react/use-mounted-source.d.ts.map +1 -0
  313. package/react/use-mounted-source.js +346 -0
  314. package/runtime/edit-snapping.d.ts +107 -0
  315. package/runtime/edit-snapping.d.ts.map +1 -0
  316. package/runtime/edit-snapping.js +190 -0
  317. package/runtime/errors.d.ts +3 -2
  318. package/runtime/errors.d.ts.map +1 -1
  319. package/runtime/errors.js +19 -2
  320. package/runtime/index.d.ts +8 -2
  321. package/runtime/index.d.ts.map +1 -1
  322. package/runtime/index.js +4 -4
  323. package/runtime/load-package.d.ts.map +1 -1
  324. package/runtime/load-package.js +8 -0
  325. package/runtime/map-package-validation.d.ts +0 -13
  326. package/runtime/map-package-validation.d.ts.map +1 -1
  327. package/runtime/map-package-validation.js +0 -12
  328. package/runtime/map-package.d.ts +1 -1
  329. package/runtime/map-package.d.ts.map +1 -1
  330. package/runtime/maplibre-renderer.d.ts +41 -0
  331. package/runtime/maplibre-renderer.d.ts.map +1 -0
  332. package/runtime/maplibre-renderer.js +322 -0
  333. package/runtime/pmtiles-protocol.d.ts +77 -0
  334. package/runtime/pmtiles-protocol.d.ts.map +1 -0
  335. package/runtime/pmtiles-protocol.js +120 -0
  336. package/runtime/query-tiles.d.ts +2 -1
  337. package/runtime/query-tiles.d.ts.map +1 -1
  338. package/runtime/query-tiles.js +6 -2
  339. package/runtime/source-bridge.d.ts +4 -4
  340. package/runtime/source-bridge.d.ts.map +1 -1
  341. package/runtime/source-bridge.js +36 -56
  342. package/runtime/style-interactions.d.ts +3 -2
  343. package/runtime/style-interactions.d.ts.map +1 -1
  344. package/runtime/style-interactions.js +11 -3
  345. package/runtime/terra-draw-sketch.d.ts +275 -0
  346. package/runtime/terra-draw-sketch.d.ts.map +1 -0
  347. package/runtime/terra-draw-sketch.js +404 -0
  348. package/source-capability-registry.d.ts +1 -0
  349. package/source-capability-registry.js +1 -0
  350. package/source-capability-types.d.ts +186 -0
  351. package/source-capability-types.js +7 -0
  352. package/style/index.d.ts +2 -0
  353. package/style/index.d.ts.map +1 -1
  354. package/style/index.js +2 -0
  355. package/style/renderers.d.ts +326 -0
  356. package/style/renderers.d.ts.map +1 -0
  357. package/style/renderers.js +517 -0
  358. package/webmap/convert-renderer.d.ts +24 -3
  359. package/webmap/convert-renderer.d.ts.map +1 -1
  360. package/webmap/convert-renderer.js +93 -112
  361. package/webmap/index.d.ts +1 -1
  362. package/webmap/index.d.ts.map +1 -1
  363. package/webmap/index.js +1 -1
@@ -0,0 +1,44 @@
1
+ /**
2
+ * `@honua/sdk-js/query-planner` — deterministic query IR, explain plans, and
3
+ * bounded execution for the protocol-neutral contract.
4
+ *
5
+ * Planning is synchronous and side-effect free: it uses a caller-supplied
6
+ * descriptor/capability snapshot and never fetches metadata or result rows.
7
+ * Execution is separate and validates the accepted fingerprint and source
8
+ * context before invoking a `Source`.
9
+ *
10
+ * @experimental
11
+ * @packageDocumentation
12
+ */
13
+ export { canonicalStringify, sha256, toJsonValue } from "./canonical.js";
14
+ export { compileDuckDbQuery, compileDuckDbQueryV2, compileSemanticDuckDbQuery } from "./duckdb.js";
15
+ export { executeQueryPlan } from "./executor.js";
16
+ export { compileGeoServicesQuery, compileSemanticGeoServicesQuery } from "./geoservices.js";
17
+ export { compileGrpcQuery, compileSemanticGrpcQuery } from "./grpc.js";
18
+ export { compileOgcApiFeaturesQuery, compileSemanticOgcApiFeaturesQuery } from "./ogc-features.js";
19
+ export { compileOdataQuery, compileSemanticOdataQuery } from "./odata.js";
20
+ export { compileSemanticWfsQuery, compileWfsQuery } from "./wfs.js";
21
+ export { canonicalizeQuery, createGeoParquetQueryIr, createQueryIr, hashQueryIr, queryFromCanonical, } from "./ir.js";
22
+ export { explainQuery, hashQueryPlan, migrateGeoParquetQueryPlanV1, parseQueryPlan, queryPlanCacheKey, serializeQueryPlan, } from "./planner.js";
23
+ export { QUERY_RESOURCE_HANDLE_KIND, QUERY_RESOURCE_HANDLE_VERSION, createGeoParquetResourceHandle, createGeoParquetResourceRegistry, hashGeoParquetResourceHandle, parseGeoParquetResourceHandle, resolveGeoParquetResource, } from "./resource.js";
24
+ export { SEMANTIC_QUERY_CANONICAL_KIND, SEMANTIC_QUERY_CANONICAL_VERSION, SEMANTIC_QUERY_HASH_DOMAIN, canonicalSemanticQueryBytes, hashSemanticQuery, serializeCanonicalSemanticQuery, } from "./semantic-canonical.js";
25
+ export { legacyWhereToNativeFilter } from "./semantic-compat.js";
26
+ export type { SemanticCompilationResult, SemanticCompilerDiagnostic, SemanticCompilerFidelity, SemanticCompilerLoss, SemanticCompilerUnsupportedCode, SemanticSqlParameter, } from "./semantic-compiler.js";
27
+ export type { SemanticCompilerFieldMapping } from "./semantic-literals.js";
28
+ export { semanticFilterFromCql2Json, semanticFilterToCql2Json } from "./cql2-json.js";
29
+ export { MAX_SEMANTIC_QUERY_BYTES, MAX_SEMANTIC_QUERY_COLLECTION_ITEMS, MAX_SEMANTIC_QUERY_DEPTH, MAX_SEMANTIC_QUERY_NODES, MAX_SEMANTIC_QUERY_TEXT_BYTES, createSemanticQueryBuilder, defineSemanticQuery, defineSpatialNode, parseSemanticQuery, temporalLiteral, } from "./semantic.js";
30
+ export type { SemanticQueryBuilder } from "./semantic.js";
31
+ export type { AggregateMetric, BuiltInNativeDialect, CanonicalSemanticQueryOptions, Cql2JsonExpression, Cql2JsonInterchangeOptions, ComparisonNode, CountMetric, DistanceOperand, DistanceSpatialPredicate, DistanceUnit, EqualityOperator, ExtremumMetric, FieldName, FirstPageRequest, GeometryFieldName, GeometryProjectionFor, GroupableFieldName, ListNode, LegacyWhereDialectFor, LegacyWhereProtocol, LiteralNode, NativeDialectFor, NativeFilter, NativePayloadFor, NullNode, NumericFieldName, NumericMetric, OffsetPageRequest, OrderableFieldName, OrderedComparisonOperator, OutputCrsFor, ParseSemanticQueryOptions, PatternNode, PropertyNode, QueryFilter, QueryLiteral, RangeNode, ScalarFieldName, SemanticAggregateQuery, SemanticFeatureQuery, SemanticFilter, SemanticPageRequest, SemanticQuery, SemanticSort, SourceSpatiality, SpatialNode, SpatialPredicate, SpatialityForSchema, StringFieldName, TemporalFieldName, TemporalLiteralNode, TemporalNode, TemporalPredicate, TemporalValue, TopologicalSpatialPredicate, } from "./semantic-types.js";
32
+ export type { SemanticOdataCompileOptions, SemanticOdataCompiledQueryV1, SemanticOdataOutputGeometry, SemanticOdataSourceIdentity, SemanticOdataSpatialFunction, } from "./odata.js";
33
+ export type { SemanticDuckDbCompileOptions, SemanticDuckDbCompiledQueryV1, SemanticDuckDbGeometrySource, SemanticDuckDbOutputGeometry, SemanticDuckDbSpatialCompilation, } from "./duckdb.js";
34
+ export type { SemanticGeoServicesCompileOptions, SemanticGeoServicesCompiledQueryV1, SemanticGeoServicesGeometry, SemanticGeoServicesProtocol, SemanticGeoServicesSourceIdentity, SemanticGeoServicesSpatialReference, SemanticGeoServicesSpatialRelationship, } from "./geoservices.js";
35
+ export type { SemanticGrpcCompileOptions, SemanticGrpcCompiledQueryV1, SemanticGrpcCoordinate, SemanticGrpcCoordinateSequence, SemanticGrpcGeometry, SemanticGrpcSourceIdentity, SemanticGrpcSpatialReference, SemanticGrpcSpatialRelationship, } from "./grpc.js";
36
+ export type { Cql2FilterLanguage, OgcApiFeaturesFilterConformanceEvidence, SemanticOgcApiFeaturesCompileOptions, SemanticOgcApiFeaturesCompiledQueryV1, SemanticOgcApiFeaturesSourceIdentity, } from "./ogc-features.js";
37
+ export type { SemanticWfsCompileOptions, SemanticWfsCompiledQueryV1, SemanticWfsSourceIdentity, Wfs20FilterCapabilitiesEvidence, } from "./wfs.js";
38
+ export { COLUMNAR_WORKER_CANCEL_KIND, COLUMNAR_WORKER_ERROR_KIND, COLUMNAR_WORKER_PROGRESS_KIND, COLUMNAR_WORKER_PROTOCOL_VERSION, COLUMNAR_WORKER_REQUEST_KIND, COLUMNAR_WORKER_RESULT_KIND, ColumnarBatchLease, GEOARROW_SPEC_VERSION, HONUA_GEOARROW_LAYOUT_VERSION, HonuaGeoArrowError, HonuaColumnarWorkerError, createColumnarBatch, createColumnarWorkerSession, createGeoArrowBatch, decodeGeoArrowBatch, fromApacheArrowRecordBatch, inspectGeoArrowBatch, inspectColumnarBatch, leaseColumnarBatch, loadApacheArrow, startColumnarWorkerHost, toApacheArrowRecordBatch, } from "../columnar/index.js";
39
+ export { COLUMNAR_BATCH_KIND, COLUMNAR_BATCH_VERSION, COLUMNAR_TRANSFER_KIND, DEFAULT_COLUMNAR_BATCH_MAX_BACKING_BYTES, DEFAULT_COLUMNAR_BATCH_MAX_BUFFER_VIEWS, DEFAULT_COLUMNAR_BATCH_MAX_METADATA_ENTRIES, DEFAULT_COLUMNAR_BATCH_MAX_ROWS, DEFAULT_COLUMNAR_BATCH_MAX_SCHEMA_NODES, DEFAULT_COLUMNAR_BATCH_MAX_STRING_BYTES, HonuaColumnarTransferError, } from "../columnar/index.js";
40
+ export type { ApacheArrowAdapterMetrics, ApacheArrowAdapterOptions, ApacheArrowDataLike, ApacheArrowFieldLike, ApacheArrowModuleImporter, ApacheArrowModuleLike, ApacheArrowRecordBatchLike, ApacheArrowRecordBatchResult, ApacheArrowTypeLike, ApacheArrowVectorLike, ColumnarBatchLeaseState, ColumnarBatchIdentityV1, ColumnarBatchLimits, ColumnarBatchMetrics, ColumnarBatchV1, ColumnarBufferRole, ColumnarBufferV1, ColumnarFieldV1, ColumnarFreshnessV1, ColumnarOrderingKeyV1, ColumnarOrderingV1, ColumnarSchemaV1, ColumnarTransferErrorCode, ColumnarTransferMessageV1, ColumnarTransferOptions, ColumnarTransferReceipt, ColumnarTransferTarget, ColumnarTypeV1, CreateColumnarBatchInput, ColumnarWorkerCancelV1, ColumnarWorkerErrorCode, ColumnarWorkerErrorV1, ColumnarWorkerExecutionProgress, ColumnarWorkerExecutionResult, ColumnarWorkerFactory, ColumnarWorkerFaultEvent, ColumnarWorkerHost, ColumnarWorkerMessageEvent, ColumnarWorkerOperation, ColumnarWorkerOperationContext, ColumnarWorkerProgressV1, ColumnarWorkerRequestV1, ColumnarWorkerResultV1, ColumnarWorkerSession, ColumnarWorkerSessionState, ColumnarWorkerTransport, CreateColumnarWorkerSessionOptions, ExecuteColumnarWorkerOperationOptions, CreateGeoArrowBatchInput, CreatedGeoArrowBatch, DecodedGeoArrowBatch, DecodedGeoArrowRow, GeoArrowBatchInspection, GeoArrowConversionLimits, GeoArrowConversionMetrics, GeoArrowCoordinateLayout, GeoArrowCrs, GeoArrowDictionaryBuffers, GeoArrowDictionaryColumnInput, GeoArrowDimensions, GeoArrowEdges, GeoArrowFeatureIdColumnInput, GeoArrowGeometryBuffers, GeoArrowGeometryColumnInput, GeoArrowGeometryKind, GeoArrowLineString, GeoArrowLineStringColumnInput, GeoArrowPoint, GeoArrowPointColumnInput, GeoArrowPolygon, GeoArrowPolygonColumnInput, GeoArrowPosition, GeoArrowTemporalBuffers, GeoArrowTemporalColumnInput, GeoArrowTimestampUnit, FromApacheArrowRecordBatchOptions, GeoArrowBatchFromApacheResult, HonuaGeoArrowErrorCode, LoadApacheArrowOptions, StartColumnarWorkerHostOptions, } from "../columnar/index.js";
41
+ export { HonuaQueryPlanExecutionError, HonuaQueryPlanningError, MAX_LOCAL_MATERIALIZATION_ROWS, QUERY_IR_KIND, QUERY_IR_VERSION, QUERY_PLAN_KIND, QUERY_PLAN_DIAGNOSTICS_VERSION, QUERY_PLANNER_VERSION, QUERY_PLAN_VERSION, QUERY_IR_V2_VERSION, QUERY_PLAN_V2_VERSION, } from "./types.js";
42
+ export type { CanonicalQuery, CanonicalSpatialFilter, DuckDbCompiledQueryV1, DuckDbCompiledQueryV2, DuckDbGeometryEncoding, ExecuteQueryPlanOptions, ExplainGeoParquetQueryOptions, ExplainQueryOptions, GeoParquetEffectiveSchemaFieldV1, GeoParquetRemoteQueryPlanStepV2, GeoServicesCompiledQueryV1, GrpcCompiledQueryV1, GrpcSpatialRelationship, GrpcStatisticType, JsonPrimitive, JsonValue, LocalAggregatePlanStep, OgcApiFeaturesCompiledQueryV1, OdataCompiledQueryV1, QueryExecutionPlan, QueryExecutionPlanV1, QueryExecutionPlanV2, QueryFallbackPolicy, QueryIrGeoparquetIdentity, QueryIrGeoparquetResourceIdentity, QueryIrSourceIdentity, QueryIrSourceIdentityV2, QueryIrV1, QueryIrV2, QueryPlanExecution, QueryPlanExecutionErrorCode, QueryPlanExecutor, QueryPlanningErrorCode, QueryPlanningEstimates, QueryPlanBoundConfidence, QueryPlanBoundSource, QueryPlanBoundsV1, QueryPlanCacheAction, QueryPlanCacheDecisionV1, QueryPlanCacheFreshness, QueryPlanCacheOptions, QueryPlanCachePolicy, QueryPlanDiscoveryContext, QueryPlanDiscoveryState, QueryPlanExecutionFailureReason, QueryPlanExecutionMode, QueryPlanFidelity, QueryPlanFidelityLoss, QueryPlanProvenanceV1, QueryPlanQuantityBound, QueryPlanStepProvenanceV1, QueryPlanValidatorInput, QueryPlanValidatorKind, QueryPlanValidityV1, QueryPlanWarning, QueryPlanWarningCode, RemoteCompiledQueryV1, QueryPlanStep, QueryPlanStepV2, RemoteQueryPlanStep, WfsCompiledQueryV1, } from "./types.js";
43
+ export type { CreateGeoParquetResourceHandleInput, GeoParquetResolverResourceReferenceV1, GeoParquetResourceHandleV1, GeoParquetResourceRegistry, GeoParquetResourceRegistryOptions, GeoParquetResourceResolutionContext, GeoParquetResourceResolver, RegisterGeoParquetResourceInput, ResolvedGeoParquetResource, } from "./resource.js";
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/query-planner/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,EACb,WAAW,EACX,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,4BAA4B,EAC5B,cAAc,EACd,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,EAChC,4BAA4B,EAC5B,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sB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/B,0BAA0B,GAC3B,MAAM,eAAe,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * `@honua/sdk-js/query-planner` — deterministic query IR, explain plans, and
3
+ * bounded execution for the protocol-neutral contract.
4
+ *
5
+ * Planning is synchronous and side-effect free: it uses a caller-supplied
6
+ * descriptor/capability snapshot and never fetches metadata or result rows.
7
+ * Execution is separate and validates the accepted fingerprint and source
8
+ * context before invoking a `Source`.
9
+ *
10
+ * @experimental
11
+ * @packageDocumentation
12
+ */
13
+ export { canonicalStringify, sha256, toJsonValue } from "./canonical.js";
14
+ export { compileDuckDbQuery, compileDuckDbQueryV2, compileSemanticDuckDbQuery } from "./duckdb.js";
15
+ export { executeQueryPlan } from "./executor.js";
16
+ export { compileGeoServicesQuery, compileSemanticGeoServicesQuery } from "./geoservices.js";
17
+ export { compileGrpcQuery, compileSemanticGrpcQuery } from "./grpc.js";
18
+ export { compileOgcApiFeaturesQuery, compileSemanticOgcApiFeaturesQuery } from "./ogc-features.js";
19
+ export { compileOdataQuery, compileSemanticOdataQuery } from "./odata.js";
20
+ export { compileSemanticWfsQuery, compileWfsQuery } from "./wfs.js";
21
+ export { canonicalizeQuery, createGeoParquetQueryIr, createQueryIr, hashQueryIr, queryFromCanonical, } from "./ir.js";
22
+ export { explainQuery, hashQueryPlan, migrateGeoParquetQueryPlanV1, parseQueryPlan, queryPlanCacheKey, serializeQueryPlan, } from "./planner.js";
23
+ export { QUERY_RESOURCE_HANDLE_KIND, QUERY_RESOURCE_HANDLE_VERSION, createGeoParquetResourceHandle, createGeoParquetResourceRegistry, hashGeoParquetResourceHandle, parseGeoParquetResourceHandle, resolveGeoParquetResource, } from "./resource.js";
24
+ export { SEMANTIC_QUERY_CANONICAL_KIND, SEMANTIC_QUERY_CANONICAL_VERSION, SEMANTIC_QUERY_HASH_DOMAIN, canonicalSemanticQueryBytes, hashSemanticQuery, serializeCanonicalSemanticQuery, } from "./semantic-canonical.js";
25
+ export { legacyWhereToNativeFilter } from "./semantic-compat.js";
26
+ export { semanticFilterFromCql2Json, semanticFilterToCql2Json } from "./cql2-json.js";
27
+ export { MAX_SEMANTIC_QUERY_BYTES, MAX_SEMANTIC_QUERY_COLLECTION_ITEMS, MAX_SEMANTIC_QUERY_DEPTH, MAX_SEMANTIC_QUERY_NODES, MAX_SEMANTIC_QUERY_TEXT_BYTES, createSemanticQueryBuilder, defineSemanticQuery, defineSpatialNode, parseSemanticQuery, temporalLiteral, } from "./semantic.js";
28
+ export { COLUMNAR_WORKER_CANCEL_KIND, COLUMNAR_WORKER_ERROR_KIND, COLUMNAR_WORKER_PROGRESS_KIND, COLUMNAR_WORKER_PROTOCOL_VERSION, COLUMNAR_WORKER_REQUEST_KIND, COLUMNAR_WORKER_RESULT_KIND, ColumnarBatchLease, GEOARROW_SPEC_VERSION, HONUA_GEOARROW_LAYOUT_VERSION, HonuaGeoArrowError, HonuaColumnarWorkerError, createColumnarBatch, createColumnarWorkerSession, createGeoArrowBatch, decodeGeoArrowBatch, fromApacheArrowRecordBatch, inspectGeoArrowBatch, inspectColumnarBatch, leaseColumnarBatch, loadApacheArrow, startColumnarWorkerHost, toApacheArrowRecordBatch, } from "../columnar/index.js";
29
+ export { COLUMNAR_BATCH_KIND, COLUMNAR_BATCH_VERSION, COLUMNAR_TRANSFER_KIND, DEFAULT_COLUMNAR_BATCH_MAX_BACKING_BYTES, DEFAULT_COLUMNAR_BATCH_MAX_BUFFER_VIEWS, DEFAULT_COLUMNAR_BATCH_MAX_METADATA_ENTRIES, DEFAULT_COLUMNAR_BATCH_MAX_ROWS, DEFAULT_COLUMNAR_BATCH_MAX_SCHEMA_NODES, DEFAULT_COLUMNAR_BATCH_MAX_STRING_BYTES, HonuaColumnarTransferError, } from "../columnar/index.js";
30
+ export { HonuaQueryPlanExecutionError, HonuaQueryPlanningError, MAX_LOCAL_MATERIALIZATION_ROWS, QUERY_IR_KIND, QUERY_IR_VERSION, QUERY_PLAN_KIND, QUERY_PLAN_DIAGNOSTICS_VERSION, QUERY_PLANNER_VERSION, QUERY_PLAN_VERSION, QUERY_IR_V2_VERSION, QUERY_PLAN_V2_VERSION, } from "./types.js";
@@ -0,0 +1,20 @@
1
+ import type { Query, SourceDescriptor } from "../contract/types.js";
2
+ import { type CanonicalQuery, type ExplainGeoParquetQueryOptions, type ExplainQueryOptions, type GeoParquetEffectiveSchemaFieldV1, type QueryIrSourceIdentity, type QueryIrSourceIdentityV2, type QueryIrV1, type QueryIrV2 } from "./types.js";
3
+ /** Context accepted by {@link queryIrSourceIdentityV2}: shared by explain and execute call sites. */
4
+ export interface GeoParquetV2IdentityContext {
5
+ readonly authorizationScope?: readonly string[];
6
+ readonly schemaVersion?: string;
7
+ readonly sourceVersion?: string;
8
+ readonly effectiveSchema?: readonly GeoParquetEffectiveSchemaFieldV1[];
9
+ }
10
+ export declare function createQueryIr<T>(options: ExplainQueryOptions<T>): QueryIrV1;
11
+ /** Build a GeoParquet v2 IR whose only resource addressing is an opaque handle. */
12
+ export declare function createGeoParquetQueryIr<T>(options: ExplainGeoParquetQueryOptions<T>): QueryIrV2;
13
+ export declare function hashQueryIr(ir: QueryIrV1 | QueryIrV2): `sha256:${string}`;
14
+ export declare function canonicalizeQuery<T>(query?: Readonly<Query<T>>): CanonicalQuery;
15
+ export declare function queryFromCanonical<T>(query: CanonicalQuery, signal?: AbortSignal): Query<T>;
16
+ export declare function queryIrSourceIdentity(descriptor: SourceDescriptor, context?: Pick<ExplainQueryOptions, "authorizationScope" | "schemaVersion" | "sourceVersion">): QueryIrSourceIdentity;
17
+ /** Rebuild the exact credential-free source identity used by a GeoParquet v2 plan. */
18
+ export declare function queryIrSourceIdentityV2(descriptor: SourceDescriptor, resourceValue: unknown, context?: GeoParquetV2IdentityContext): QueryIrSourceIdentityV2;
19
+ export declare function deepFreeze<T>(value: T): T;
20
+ //# sourceMappingURL=ir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../../../src/query-planner/ir.ts"],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AChG,qBAAqB,CA2BvB;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,gBAAgB,EAC5B,aAAa,EAAE,OAAO,EACtB,OAAO,GAAE,2BAAgC,GACxC,uBAAuB,CAwDzB;AA0PD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAMzC"}
@@ -0,0 +1,417 @@
1
+ import { canonicalStringify, sha256, toJsonValue } from "./canonical.js";
2
+ import { parseGeoParquetResourceHandle } from "./resource.js";
3
+ import { HonuaQueryPlanningError, QUERY_IR_KIND, QUERY_IR_V2_VERSION, QUERY_IR_VERSION, } from "./types.js";
4
+ const MAX_EFFECTIVE_SCHEMA_FIELDS = 512;
5
+ export function createQueryIr(options) {
6
+ try {
7
+ const ir = {
8
+ kind: QUERY_IR_KIND,
9
+ version: QUERY_IR_VERSION,
10
+ source: queryIrSourceIdentity(options.descriptor, options),
11
+ query: canonicalizeQuery(options.query),
12
+ };
13
+ return deepFreeze(ir);
14
+ }
15
+ catch (error) {
16
+ if (error instanceof HonuaQueryPlanningError)
17
+ throw error;
18
+ throw new HonuaQueryPlanningError("invalid-query", `Query cannot be represented by ${QUERY_IR_KIND}@${QUERY_IR_VERSION}: ${errorMessage(error)}`);
19
+ }
20
+ }
21
+ /** Build a GeoParquet v2 IR whose only resource addressing is an opaque handle. */
22
+ export function createGeoParquetQueryIr(options) {
23
+ try {
24
+ const ir = {
25
+ kind: QUERY_IR_KIND,
26
+ version: QUERY_IR_V2_VERSION,
27
+ source: queryIrSourceIdentityV2(options.descriptor, options.geoparquetResource, options),
28
+ query: canonicalizeQuery(options.query),
29
+ };
30
+ return deepFreeze(ir);
31
+ }
32
+ catch (error) {
33
+ if (error instanceof HonuaQueryPlanningError)
34
+ throw error;
35
+ throw new HonuaQueryPlanningError("invalid-query", `GeoParquet query cannot be represented safely by ${QUERY_IR_KIND}@${QUERY_IR_V2_VERSION}`);
36
+ }
37
+ }
38
+ export function hashQueryIr(ir) {
39
+ return sha256(canonicalStringify(toJsonValue(ir)));
40
+ }
41
+ export function canonicalizeQuery(query) {
42
+ if (!query)
43
+ return deepFreeze({});
44
+ if (query.where !== undefined)
45
+ assertSafeNativeExpression(query.where);
46
+ const canonical = {
47
+ ...(query.where !== undefined ? { where: { kind: "source-native", expression: query.where } } : {}),
48
+ ...(query.spatialFilter
49
+ ? {
50
+ spatialFilter: {
51
+ geometry: asJsonObject(query.spatialFilter.geometry, "$.query.spatialFilter.geometry"),
52
+ geometryType: query.spatialFilter.geometryType,
53
+ ...(query.spatialFilter.spatialRel ? { spatialRel: query.spatialFilter.spatialRel } : {}),
54
+ },
55
+ }
56
+ : {}),
57
+ ...(query.outFields ? { outFields: [...query.outFields] } : {}),
58
+ ...(query.orderBy
59
+ ? {
60
+ orderBy: query.orderBy.map((sort) => ({ field: sort.field, direction: sort.direction ?? "asc" })),
61
+ }
62
+ : {}),
63
+ ...(query.pagination
64
+ ? {
65
+ pagination: {
66
+ ...(query.pagination.offset !== undefined
67
+ ? { offset: checkedInteger(query.pagination.offset, "offset", 0) }
68
+ : {}),
69
+ ...(query.pagination.limit !== undefined
70
+ ? { limit: checkedInteger(query.pagination.limit, "limit", 0) }
71
+ : {}),
72
+ },
73
+ }
74
+ : {}),
75
+ ...(query.aggregation ? { aggregation: canonicalizeAggregation(query.aggregation) } : {}),
76
+ ...(query.returnGeometry !== undefined ? { returnGeometry: query.returnGeometry } : {}),
77
+ ...(query.outSr !== undefined ? { outSr: query.outSr } : {}),
78
+ };
79
+ return deepFreeze(canonical);
80
+ }
81
+ export function queryFromCanonical(query, signal) {
82
+ return {
83
+ ...(query.where ? { where: query.where.expression } : {}),
84
+ ...(query.spatialFilter
85
+ ? {
86
+ spatialFilter: {
87
+ geometry: query.spatialFilter.geometry,
88
+ geometryType: query.spatialFilter.geometryType,
89
+ ...(query.spatialFilter.spatialRel ? { spatialRel: query.spatialFilter.spatialRel } : {}),
90
+ },
91
+ }
92
+ : {}),
93
+ ...(query.outFields ? { outFields: query.outFields } : {}),
94
+ ...(query.orderBy ? { orderBy: query.orderBy } : {}),
95
+ ...(query.pagination ? { pagination: query.pagination } : {}),
96
+ ...(query.aggregation ? { aggregation: query.aggregation } : {}),
97
+ ...(query.returnGeometry !== undefined ? { returnGeometry: query.returnGeometry } : {}),
98
+ ...(query.outSr !== undefined ? { outSr: query.outSr } : {}),
99
+ ...(signal ? { signal } : {}),
100
+ };
101
+ }
102
+ export function queryIrSourceIdentity(descriptor, context = {}) {
103
+ const authorizationScope = [...new Set(context.authorizationScope ?? [])].sort();
104
+ if (authorizationScope.some((scope) => !isStableAuthorizationScope(scope))) {
105
+ throw new HonuaQueryPlanningError("invalid-query", "authorization scope identity is invalid");
106
+ }
107
+ const geometryProperty = descriptor.schema?.fields?.find((field) => field.type === "esriFieldTypeGeometry")?.name;
108
+ const geoparquet = descriptor.protocol === "geoparquet" ? geoparquetIdentity(descriptor, geometryProperty) : undefined;
109
+ const schemaVersion = optionalPlanMetadata(context.schemaVersion, "schema version");
110
+ const sourceVersion = optionalPlanMetadata(context.sourceVersion, "source version");
111
+ return deepFreeze({
112
+ id: descriptor.id,
113
+ protocol: descriptor.protocol,
114
+ endpoint: credentialFreeEndpoint(descriptor.locator.url),
115
+ ...(descriptor.locator.serviceId !== undefined ? { serviceId: descriptor.locator.serviceId } : {}),
116
+ ...(descriptor.locator.layerId !== undefined ? { layerId: descriptor.locator.layerId } : {}),
117
+ ...(descriptor.locator.collectionId !== undefined ? { collectionId: descriptor.locator.collectionId } : {}),
118
+ ...(descriptor.locator.typeName !== undefined ? { typeName: descriptor.locator.typeName } : {}),
119
+ ...(descriptor.locator.entitySet !== undefined ? { entitySet: descriptor.locator.entitySet } : {}),
120
+ ...(geometryProperty ? { geometryProperty } : {}),
121
+ ...(descriptor.locator.srsName !== undefined ? { srsName: String(descriptor.locator.srsName) } : {}),
122
+ ...(schemaVersion ? { schemaVersion } : {}),
123
+ ...(sourceVersion ? { sourceVersion } : {}),
124
+ ...(geoparquet ? { geoparquet } : {}),
125
+ authorizationScope,
126
+ capabilities: [...descriptor.capabilities].sort(),
127
+ });
128
+ }
129
+ /** Rebuild the exact credential-free source identity used by a GeoParquet v2 plan. */
130
+ export function queryIrSourceIdentityV2(descriptor, resourceValue, context = {}) {
131
+ if (descriptor.protocol !== "geoparquet") {
132
+ throw new HonuaQueryPlanningError("invalid-query", "Opaque GeoParquet resources require protocol geoparquet");
133
+ }
134
+ const resource = parseGeoParquetResourceHandle(resourceValue);
135
+ const authorizationScope = [...new Set(context.authorizationScope ?? [])].sort();
136
+ if (authorizationScope.some((scope) => !isStableAuthorizationScope(scope))) {
137
+ throw new HonuaQueryPlanningError("invalid-query", "GeoParquet authorization scope identity is invalid");
138
+ }
139
+ const geometryProperty = descriptor.schema?.fields?.find((field) => field.type === "esriFieldTypeGeometry")?.name;
140
+ const primaryKey = optionalPlanMetadata(descriptor.schema?.primaryKey, "primary key");
141
+ const schemaVersion = optionalPlanMetadata(context.schemaVersion, "schema version");
142
+ const sourceVersion = optionalPlanMetadata(context.sourceVersion, "source version");
143
+ const geometryColumn = optionalPlanMetadata(descriptor.locator.geoparquet?.geometryColumn ?? geometryProperty, "geometry column");
144
+ const bboxColumn = optionalPlanMetadata(descriptor.locator.geoparquet?.bboxColumn, "bbox column");
145
+ const geometryEncoding = descriptor.locator.geoparquet?.geometryEncoding;
146
+ if (geometryEncoding !== undefined &&
147
+ geometryEncoding !== "wkb" &&
148
+ geometryEncoding !== "native" &&
149
+ geometryEncoding !== "geojson" &&
150
+ geometryEncoding !== "geoarrow-point" &&
151
+ geometryEncoding !== "geoarrow-linestring" &&
152
+ geometryEncoding !== "geoarrow-polygon" &&
153
+ geometryEncoding !== "geoarrow-multipoint" &&
154
+ geometryEncoding !== "geoarrow-multilinestring" &&
155
+ geometryEncoding !== "geoarrow-multipolygon") {
156
+ throw new HonuaQueryPlanningError("invalid-query", "GeoParquet geometry encoding identity is invalid");
157
+ }
158
+ const nativeDimensions = descriptor.locator.geoparquet?.nativeDimensions;
159
+ if (nativeDimensions !== undefined && nativeDimensions !== "xy" && nativeDimensions !== "xyz") {
160
+ throw new HonuaQueryPlanningError("invalid-query", "GeoParquet native geometry dimensions identity is invalid");
161
+ }
162
+ const effectiveSchema = geoparquetEffectiveSchema(context.effectiveSchema);
163
+ return deepFreeze({
164
+ id: resource.resource.id,
165
+ protocol: "geoparquet",
166
+ endpoint: "[opaque-resource]",
167
+ ...(primaryKey ? { primaryKey } : {}),
168
+ ...(schemaVersion ? { schemaVersion } : {}),
169
+ ...(sourceVersion ? { sourceVersion } : {}),
170
+ geoparquet: {
171
+ resource,
172
+ ...(geometryColumn ? { geometryColumn } : {}),
173
+ ...(geometryEncoding ? { geometryEncoding } : {}),
174
+ ...(bboxColumn ? { bboxColumn } : {}),
175
+ ...(nativeDimensions ? { nativeDimensions } : {}),
176
+ ...(effectiveSchema ? { effectiveSchema } : {}),
177
+ },
178
+ authorizationScope,
179
+ capabilities: [...descriptor.capabilities].sort(),
180
+ });
181
+ }
182
+ /**
183
+ * Validate and freeze caller-supplied effective GeoParquet schema evidence
184
+ * (#627). Reuses the same bounded string checks as other plan metadata so
185
+ * field name/type text can never smuggle credential material or control
186
+ * characters into a persisted plan.
187
+ */
188
+ function geoparquetEffectiveSchema(value) {
189
+ if (value === undefined)
190
+ return undefined;
191
+ if (!Array.isArray(value) || value.length === 0 || value.length > MAX_EFFECTIVE_SCHEMA_FIELDS) {
192
+ throw new HonuaQueryPlanningError("invalid-query", "GeoParquet effective schema identity is invalid");
193
+ }
194
+ const names = new Set();
195
+ const fields = value.map((field, index) => {
196
+ if (field === null || typeof field !== "object" || Array.isArray(field)) {
197
+ throw new HonuaQueryPlanningError("invalid-query", `GeoParquet effective schema field ${index} is invalid`);
198
+ }
199
+ const keys = Object.keys(field);
200
+ if (keys.some((key) => key !== "name" && key !== "type" && key !== "nullable")) {
201
+ throw new HonuaQueryPlanningError("invalid-query", `GeoParquet effective schema field ${index} is invalid`);
202
+ }
203
+ const name = requiredPlanMetadata(field.name, `effective schema field ${index} name`);
204
+ const type = requiredPlanMetadata(field.type, `effective schema field ${index} type`);
205
+ if (names.has(name)) {
206
+ throw new HonuaQueryPlanningError("invalid-query", `GeoParquet effective schema field ${index} duplicates name "${name}"`);
207
+ }
208
+ names.add(name);
209
+ const nullable = field.nullable;
210
+ if (nullable !== undefined && typeof nullable !== "boolean") {
211
+ throw new HonuaQueryPlanningError("invalid-query", `GeoParquet effective schema field ${index} nullable is invalid`);
212
+ }
213
+ return deepFreeze({ name, type, ...(nullable !== undefined ? { nullable } : {}) });
214
+ });
215
+ return deepFreeze(fields);
216
+ }
217
+ function requiredPlanMetadata(value, label) {
218
+ const parsed = optionalPlanMetadata(value, label);
219
+ if (parsed === undefined) {
220
+ throw new HonuaQueryPlanningError("invalid-query", `Query plan ${label} identity is invalid`);
221
+ }
222
+ return parsed;
223
+ }
224
+ function optionalPlanMetadata(value, label) {
225
+ if (value === undefined)
226
+ return undefined;
227
+ if (typeof value !== "string" ||
228
+ value.length === 0 ||
229
+ new TextEncoder().encode(value).byteLength > 1_024 ||
230
+ containsControlCharacter(value) ||
231
+ containsCredentialMaterial(value)) {
232
+ throw new HonuaQueryPlanningError("invalid-query", `Query plan ${label} identity is invalid`);
233
+ }
234
+ return value;
235
+ }
236
+ const CREDENTIAL_MATERIAL = /(?:\bBearer\s+[A-Za-z0-9._~+/=-]{8,}|\bBasic\s+[A-Za-z0-9+/=]{8,}|\bAKIA[0-9A-Z]{16}\b|[?&;](?:access[-_]?token|id[-_]?token|refresh[-_]?token|x-amz-signature|x-goog-credential|signature|sig|token|api[-_]?key|password|secret)=[^\s&#;]*|\b(?:authorization|password|secret|token|api[-_]?key|account[-_]?key|shared[-_]?access[-_]?signature)\s*(?:=|:)\s*[^\s,;]+|[a-z][a-z0-9+.-]*:\/\/[^/\s"'<>]*@|\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b)/i;
237
+ function containsCredentialMaterial(value) {
238
+ return CREDENTIAL_MATERIAL.test(value);
239
+ }
240
+ function containsControlCharacter(value) {
241
+ for (let index = 0; index < value.length; index += 1) {
242
+ const code = value.charCodeAt(index);
243
+ if (code <= 0x1f || code === 0x7f)
244
+ return true;
245
+ }
246
+ return false;
247
+ }
248
+ function isStableAuthorizationScope(value) {
249
+ return (typeof value === "string" &&
250
+ value.length > 0 &&
251
+ value.length <= 256 &&
252
+ /^[A-Za-z0-9][A-Za-z0-9._:/~-]*$/.test(value) &&
253
+ !value.endsWith("/") &&
254
+ !value.includes("//") &&
255
+ !value.split("/").some((segment) => segment === "." || segment === "..") &&
256
+ !/^eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}$/.test(value));
257
+ }
258
+ function assertSafeNativeExpression(value) {
259
+ if (typeof value !== "string" || value.length === 0 || value.length > 65_536 || containsControlCharacter(value)) {
260
+ throw new HonuaQueryPlanningError("invalid-query", "query.where is invalid");
261
+ }
262
+ const sensitive = /(?:\bBearer\s+[A-Za-z0-9._~+/=-]{8,}|\bBasic\s+[A-Za-z0-9+/=]{8,}|\bAKIA[0-9A-Z]{16}\b|\b(?:authorization|password|secret|token|api[-_]?key)\s*(?:=|eq)\s*['"][^'"]{4,}['"]|\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b)/i;
263
+ if (sensitive.test(value)) {
264
+ throw new HonuaQueryPlanningError("invalid-query", "query.where contains sensitive native expression material");
265
+ }
266
+ }
267
+ /**
268
+ * Derive deterministic DuckDB/GeoParquet addressing from the descriptor so the
269
+ * SQL compiler never needs a profiling round-trip. Mirrors the live GeoParquet
270
+ * `Source` addressing (`locator.url` + `locator.geoparquet.urls`).
271
+ */
272
+ function geoparquetIdentity(descriptor, geometryProperty) {
273
+ const { url, geoparquet } = descriptor.locator;
274
+ const sources = [];
275
+ if (typeof url === "string" && url.length > 0)
276
+ sources.push(url);
277
+ if (geoparquet?.urls)
278
+ sources.push(...geoparquet.urls);
279
+ const geometryColumn = geoparquet?.geometryColumn ?? geometryProperty;
280
+ return {
281
+ sources,
282
+ ...(geometryColumn ? { geometryColumn } : {}),
283
+ ...(geoparquet?.geometryEncoding ? { geometryEncoding: geoparquet.geometryEncoding } : {}),
284
+ ...(geoparquet?.bboxColumn ? { bboxColumn: geoparquet.bboxColumn } : {}),
285
+ ...(geoparquet?.nativeDimensions ? { nativeDimensions: geoparquet.nativeDimensions } : {}),
286
+ };
287
+ }
288
+ function canonicalizeAggregation(aggregation) {
289
+ if (aggregation.metrics.length === 0) {
290
+ throw new HonuaQueryPlanningError("invalid-query", "aggregation.metrics must contain at least one metric");
291
+ }
292
+ return {
293
+ ...(aggregation.groupBy ? { groupBy: [...aggregation.groupBy] } : {}),
294
+ metrics: aggregation.metrics.map((metric) => ({
295
+ fn: metric.fn,
296
+ field: metric.field,
297
+ ...(metric.alias !== undefined ? { alias: metric.alias } : {}),
298
+ })),
299
+ ...(aggregation.histogram
300
+ ? { histogram: toJsonValue(aggregation.histogram) }
301
+ : {}),
302
+ ...(aggregation.timeSeries
303
+ ? { timeSeries: toJsonValue(aggregation.timeSeries) }
304
+ : {}),
305
+ };
306
+ }
307
+ function checkedInteger(value, name, minimum) {
308
+ if (!Number.isSafeInteger(value) || value < minimum) {
309
+ throw new HonuaQueryPlanningError("invalid-query", `pagination.${name} must be a safe integer >= ${minimum}`);
310
+ }
311
+ return value;
312
+ }
313
+ function asJsonObject(value, path) {
314
+ const json = toJsonValue(value, path);
315
+ if (json === null || Array.isArray(json) || typeof json !== "object") {
316
+ throw new TypeError(`${path} must be an object`);
317
+ }
318
+ return json;
319
+ }
320
+ function credentialFreeEndpoint(rawUrl) {
321
+ const invalidEndpoint = "[invalid-endpoint]";
322
+ try {
323
+ const parsed = new URL(rawUrl);
324
+ if (!parsed.username && !parsed.password && hasOpaqueSchemeUserInfo(rawUrl))
325
+ return invalidEndpoint;
326
+ parsed.username = "";
327
+ parsed.password = "";
328
+ parsed.search = "";
329
+ parsed.hash = "";
330
+ return parsed.toString().replace(/\/$/, "");
331
+ }
332
+ catch {
333
+ const path = rawUrl.split(/[?#]/, 1)[0] ?? rawUrl;
334
+ const malformedAuthority = hasSchemeAuthorityPrefix(rawUrl) || startsWithDoubleSlash(rawUrl);
335
+ const bareUserInfo = hasBareUserInfo(rawUrl);
336
+ let unsafeCharacters = false;
337
+ for (const character of rawUrl) {
338
+ const codePoint = character.codePointAt(0);
339
+ if (codePoint <= 0x20 || codePoint === 0x7f || character.trim() === "") {
340
+ unsafeCharacters = true;
341
+ break;
342
+ }
343
+ }
344
+ return malformedAuthority || bareUserInfo || unsafeCharacters ? invalidEndpoint : path;
345
+ }
346
+ }
347
+ function hasSchemeAuthorityPrefix(value) {
348
+ const colon = value.indexOf(":");
349
+ if (colon < 1 || !asciiAlpha(value.charCodeAt(0)))
350
+ return false;
351
+ for (let index = 1; index < colon; index += 1) {
352
+ const code = value.charCodeAt(index);
353
+ if (!(asciiAlpha(code) || (code >= 48 && code <= 57) || code === 43 || code === 45 || code === 46)) {
354
+ return false;
355
+ }
356
+ }
357
+ return isSlash(value.charCodeAt(colon + 1)) && isSlash(value.charCodeAt(colon + 2));
358
+ }
359
+ function startsWithDoubleSlash(value) {
360
+ return isSlash(value.charCodeAt(0)) && isSlash(value.charCodeAt(1));
361
+ }
362
+ function hasOpaqueSchemeUserInfo(value) {
363
+ const colon = value.indexOf(":");
364
+ if (colon < 1 || !asciiAlpha(value.charCodeAt(0)))
365
+ return false;
366
+ for (let index = 1; index < colon; index += 1) {
367
+ const code = value.charCodeAt(index);
368
+ if (!(asciiAlpha(code) || (code >= 48 && code <= 57) || code === 43 || code === 45 || code === 46)) {
369
+ return false;
370
+ }
371
+ }
372
+ for (let index = colon + 1; index < value.length; index += 1) {
373
+ const code = value.charCodeAt(index);
374
+ if (code === 64)
375
+ return true;
376
+ if (endpointDelimiter(code, false))
377
+ return false;
378
+ }
379
+ return false;
380
+ }
381
+ function hasBareUserInfo(value) {
382
+ let colon = -1;
383
+ for (let index = 0; index < value.length; index += 1) {
384
+ const code = value.charCodeAt(index);
385
+ if (endpointDelimiter(code, true))
386
+ return false;
387
+ if (code === 58 && colon === -1) {
388
+ if (index === 0)
389
+ return false;
390
+ colon = index;
391
+ }
392
+ else if (code === 64) {
393
+ return colon !== -1;
394
+ }
395
+ }
396
+ return false;
397
+ }
398
+ function endpointDelimiter(code, backslash) {
399
+ return code <= 32 || code === 47 || code === 63 || code === 35 || (backslash && code === 92);
400
+ }
401
+ function asciiAlpha(code) {
402
+ return (code >= 65 && code <= 90) || (code >= 97 && code <= 122);
403
+ }
404
+ function isSlash(code) {
405
+ return code === 47 || code === 92;
406
+ }
407
+ export function deepFreeze(value) {
408
+ if (value !== null && typeof value === "object" && !Object.isFrozen(value)) {
409
+ Object.freeze(value);
410
+ for (const child of Object.values(value))
411
+ deepFreeze(child);
412
+ }
413
+ return value;
414
+ }
415
+ function errorMessage(error) {
416
+ return error instanceof Error ? error.message : String(error);
417
+ }
@@ -0,0 +1,5 @@
1
+ import type { AggregationSpec } from "../contract/types.js";
2
+ import type { HonuaTypedFeature } from "../core/types.js";
3
+ import type { CanonicalQuery } from "./types.js";
4
+ export declare function aggregateLocally<T>(features: readonly HonuaTypedFeature<T>[], aggregation: AggregationSpec, output: Pick<CanonicalQuery, "orderBy" | "pagination">, signal?: AbortSignal): readonly Record<string, unknown>[];
5
+ //# sourceMappingURL=local-aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-aggregate.d.ts","sourceRoot":"","sources":["../../../src/query-planner/local-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,QAAQ,EAAE,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,EACzC,WAAW,EAAE,eAAe,EAC5B,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,YAAY,CAAC,EACtD,MAAM,CAAC,EAAE,WAAW,GACnB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAcpC"}