@honua/app-platform 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 (381) 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 +11 -2
  14. package/contract/index.d.ts.map +1 -1
  15. package/contract/index.js +4 -1
  16. package/contract/pmtiles.d.ts +31 -0
  17. package/contract/pmtiles.d.ts.map +1 -1
  18. package/contract/pmtiles.js +60 -20
  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 +35 -17
  32. package/contract/source.d.ts.map +1 -1
  33. package/contract/source.js +267 -71
  34. package/contract/types.d.ts +140 -4
  35. package/contract/types.d.ts.map +1 -1
  36. package/contract/types.js +6 -14
  37. package/core/bounded-json.d.ts +4 -0
  38. package/core/bounded-json.d.ts.map +1 -0
  39. package/core/bounded-json.js +38 -0
  40. package/core/cache-state.d.ts +9 -0
  41. package/core/cache-state.d.ts.map +1 -1
  42. package/core/cache-state.js +10 -0
  43. package/core/capabilities-xml.d.ts +33 -0
  44. package/core/capabilities-xml.d.ts.map +1 -0
  45. package/core/capabilities-xml.js +331 -0
  46. package/core/client.d.ts +4 -1
  47. package/core/client.d.ts.map +1 -1
  48. package/core/client.js +115 -29
  49. package/core/error-classifications.d.ts +153 -0
  50. package/core/error-classifications.d.ts.map +1 -0
  51. package/core/error-classifications.js +140 -0
  52. package/core/error-code-registry.d.ts +158 -0
  53. package/core/error-code-registry.d.ts.map +1 -0
  54. package/core/error-code-registry.js +143 -0
  55. package/core/error-envelope.d.ts +68 -0
  56. package/core/error-envelope.d.ts.map +1 -0
  57. package/core/error-envelope.js +357 -0
  58. package/core/errors.d.ts +45 -29
  59. package/core/errors.d.ts.map +1 -1
  60. package/core/errors.js +97 -50
  61. package/core/geoparquet-sql.d.ts +30 -2
  62. package/core/geoparquet-sql.d.ts.map +1 -1
  63. package/core/geoparquet-sql.js +38 -3
  64. package/core/odata-key-path.d.ts +12 -0
  65. package/core/odata-key-path.d.ts.map +1 -0
  66. package/core/odata-key-path.js +28 -0
  67. package/core/odata-write-codec.d.ts +66 -0
  68. package/core/odata-write-codec.d.ts.map +1 -0
  69. package/core/odata-write-codec.js +1083 -0
  70. package/core/odata.d.ts +59 -7
  71. package/core/odata.d.ts.map +1 -1
  72. package/core/odata.js +431 -99
  73. package/core/ogc-features.d.ts.map +1 -1
  74. package/core/ogc-features.js +3 -0
  75. package/core/ogc-maps.d.ts +7 -0
  76. package/core/ogc-maps.d.ts.map +1 -1
  77. package/core/ogc-maps.js +46 -7
  78. package/core/ogc-processes.d.ts +2 -1
  79. package/core/ogc-processes.d.ts.map +1 -1
  80. package/core/ogc-processes.js +33 -5
  81. package/core/ogc-records.d.ts +9 -0
  82. package/core/ogc-records.d.ts.map +1 -1
  83. package/core/ogc-records.js +78 -29
  84. package/core/ogc-tiles.d.ts +10 -1
  85. package/core/ogc-tiles.d.ts.map +1 -1
  86. package/core/ogc-tiles.js +56 -17
  87. package/core/path-utils.d.ts +9 -0
  88. package/core/path-utils.d.ts.map +1 -1
  89. package/core/path-utils.js +19 -0
  90. package/core/protocol-transport.d.ts +1 -0
  91. package/core/protocol-transport.d.ts.map +1 -1
  92. package/core/request-pipeline.d.ts.map +1 -1
  93. package/core/request-pipeline.js +1 -1
  94. package/core/spatial-filter.d.ts +8 -4
  95. package/core/spatial-filter.d.ts.map +1 -1
  96. package/core/spatial-filter.js +206 -16
  97. package/core/stac-static.d.ts +6 -2
  98. package/core/stac-static.d.ts.map +1 -1
  99. package/core/stac-static.js +260 -69
  100. package/core/surfaces.d.ts.map +1 -1
  101. package/core/surfaces.js +69 -5
  102. package/core/types.d.ts +125 -7
  103. package/core/types.d.ts.map +1 -1
  104. package/core/wfs-capabilities.d.ts +2 -0
  105. package/core/wfs-capabilities.d.ts.map +1 -1
  106. package/core/wfs-capabilities.js +8 -1
  107. package/core/wfs.d.ts.map +1 -1
  108. package/core/wfs.js +10 -0
  109. package/core/wms-capabilities.d.ts +56 -84
  110. package/core/wms-capabilities.d.ts.map +1 -1
  111. package/core/wms-capabilities.js +212 -509
  112. package/core/wmts-capabilities.d.ts +62 -62
  113. package/core/wmts-capabilities.d.ts.map +1 -1
  114. package/core/wmts-capabilities.js +224 -371
  115. package/esri-compat/editor.d.ts +8 -0
  116. package/esri-compat/editor.d.ts.map +1 -1
  117. package/esri-compat/editor.js +13 -0
  118. package/esri-compat/feature-layer.d.ts +2 -0
  119. package/esri-compat/feature-layer.d.ts.map +1 -1
  120. package/esri-compat/feature-layer.js +1 -0
  121. package/esri-compat/layer-list.d.ts +11 -0
  122. package/esri-compat/layer-list.d.ts.map +1 -1
  123. package/esri-compat/layer-list.js +49 -0
  124. package/esri-compat/legend.d.ts +10 -0
  125. package/esri-compat/legend.d.ts.map +1 -1
  126. package/esri-compat/legend.js +27 -0
  127. package/esri-compat/portal.d.ts +197 -0
  128. package/esri-compat/portal.d.ts.map +1 -0
  129. package/esri-compat/portal.js +251 -0
  130. package/esri-compat/renderer-objects.d.ts +40 -0
  131. package/esri-compat/renderer-objects.d.ts.map +1 -0
  132. package/esri-compat/renderer-objects.js +62 -0
  133. package/esri-compat/sketch.d.ts +43 -0
  134. package/esri-compat/sketch.d.ts.map +1 -1
  135. package/esri-compat/sketch.js +46 -0
  136. package/esri-compat/snapping.d.ts +43 -0
  137. package/esri-compat/snapping.d.ts.map +1 -0
  138. package/esri-compat/snapping.js +45 -0
  139. package/esri-compat/url.d.ts.map +1 -1
  140. package/esri-compat/url.js +1 -1
  141. package/esri-compat/widget-host.d.ts +84 -0
  142. package/esri-compat/widget-host.d.ts.map +1 -0
  143. package/esri-compat/widget-host.js +159 -0
  144. package/generated-app/errors.d.ts +18 -2
  145. package/generated-app/errors.d.ts.map +1 -1
  146. package/generated-app/errors.js +44 -11
  147. package/geocoding/index.d.ts +7 -0
  148. package/geocoding/index.d.ts.map +1 -1
  149. package/geocoding/index.js +5 -0
  150. package/geocoding/provider-http.d.ts +37 -0
  151. package/geocoding/provider-http.d.ts.map +1 -0
  152. package/geocoding/provider-http.js +91 -0
  153. package/geocoding/provider.d.ts +145 -0
  154. package/geocoding/provider.d.ts.map +1 -0
  155. package/geocoding/provider.js +41 -0
  156. package/geocoding/providers/honua.d.ts +28 -0
  157. package/geocoding/providers/honua.d.ts.map +1 -0
  158. package/geocoding/providers/honua.js +68 -0
  159. package/geocoding/providers/nominatim.d.ts +47 -0
  160. package/geocoding/providers/nominatim.d.ts.map +1 -0
  161. package/geocoding/providers/nominatim.js +105 -0
  162. package/geocoding/providers/pelias.d.ts +40 -0
  163. package/geocoding/providers/pelias.d.ts.map +1 -0
  164. package/geocoding/providers/pelias.js +115 -0
  165. package/geocoding/providers/photon.d.ts +39 -0
  166. package/geocoding/providers/photon.d.ts.map +1 -0
  167. package/geocoding/providers/photon.js +107 -0
  168. package/geometry/convert.d.ts +13 -0
  169. package/geometry/convert.d.ts.map +1 -0
  170. package/geometry/convert.js +12 -0
  171. package/geometry/index.d.ts +17 -0
  172. package/geometry/index.d.ts.map +1 -0
  173. package/geometry/index.js +15 -0
  174. package/geometry/internal.d.ts +25 -0
  175. package/geometry/internal.d.ts.map +1 -0
  176. package/geometry/internal.js +40 -0
  177. package/geometry/ops.d.ts +71 -0
  178. package/geometry/ops.d.ts.map +1 -0
  179. package/geometry/ops.js +147 -0
  180. package/geometry/project.d.ts +40 -0
  181. package/geometry/project.d.ts.map +1 -0
  182. package/geometry/project.js +88 -0
  183. package/geometry/types.d.ts +36 -0
  184. package/geometry/types.d.ts.map +1 -0
  185. package/geometry/types.js +12 -0
  186. package/map/automatic-mount-integration.d.ts +134 -0
  187. package/map/automatic-mount-integration.d.ts.map +1 -0
  188. package/map/automatic-mount-integration.js +305 -0
  189. package/map/automatic-source-strategy.d.ts +125 -0
  190. package/map/automatic-source-strategy.d.ts.map +1 -0
  191. package/map/automatic-source-strategy.js +494 -0
  192. package/map/data-to-map-bridge.d.ts +293 -0
  193. package/map/data-to-map-bridge.d.ts.map +1 -0
  194. package/map/data-to-map-bridge.js +817 -0
  195. package/map/geojson-projection.d.ts +33 -0
  196. package/map/geojson-projection.d.ts.map +1 -0
  197. package/map/geojson-projection.js +118 -0
  198. package/map/index.d.ts +14 -0
  199. package/map/index.d.ts.map +1 -1
  200. package/map/index.js +8 -0
  201. package/map/raster-source-spec.d.ts +30 -0
  202. package/map/raster-source-spec.d.ts.map +1 -0
  203. package/map/raster-source-spec.js +190 -0
  204. package/map/raster-source-strategy.d.ts +65 -0
  205. package/map/raster-source-strategy.d.ts.map +1 -0
  206. package/map/raster-source-strategy.js +232 -0
  207. package/map/source-to-maplibre.d.ts +91 -0
  208. package/map/source-to-maplibre.d.ts.map +1 -0
  209. package/map/source-to-maplibre.js +454 -0
  210. package/map/temporal-playback.d.ts +139 -0
  211. package/map/temporal-playback.d.ts.map +1 -0
  212. package/map/temporal-playback.js +247 -0
  213. package/package.json +33 -2
  214. package/query-planner/canonical.d.ts +7 -0
  215. package/query-planner/canonical.d.ts.map +1 -0
  216. package/query-planner/canonical.js +145 -0
  217. package/query-planner/cql2-json.d.ts +17 -0
  218. package/query-planner/cql2-json.d.ts.map +1 -0
  219. package/query-planner/cql2-json.js +646 -0
  220. package/query-planner/diagnostics.d.ts +35 -0
  221. package/query-planner/diagnostics.d.ts.map +1 -0
  222. package/query-planner/diagnostics.js +373 -0
  223. package/query-planner/duckdb.d.ts +79 -0
  224. package/query-planner/duckdb.d.ts.map +1 -0
  225. package/query-planner/duckdb.js +758 -0
  226. package/query-planner/execution-context.d.ts +5 -0
  227. package/query-planner/execution-context.d.ts.map +1 -0
  228. package/query-planner/execution-context.js +50 -0
  229. package/query-planner/executor.d.ts +5 -0
  230. package/query-planner/executor.d.ts.map +1 -0
  231. package/query-planner/executor.js +223 -0
  232. package/query-planner/geoservices.d.ts +91 -0
  233. package/query-planner/geoservices.d.ts.map +1 -0
  234. package/query-planner/geoservices.js +667 -0
  235. package/query-planner/grpc.d.ts +100 -0
  236. package/query-planner/grpc.d.ts.map +1 -0
  237. package/query-planner/grpc.js +736 -0
  238. package/query-planner/index.d.ts +44 -0
  239. package/query-planner/index.d.ts.map +1 -0
  240. package/query-planner/index.js +30 -0
  241. package/query-planner/ir.d.ts +20 -0
  242. package/query-planner/ir.d.ts.map +1 -0
  243. package/query-planner/ir.js +417 -0
  244. package/query-planner/local-aggregate.d.ts +5 -0
  245. package/query-planner/local-aggregate.d.ts.map +1 -0
  246. package/query-planner/local-aggregate.js +126 -0
  247. package/query-planner/odata.d.ts +48 -0
  248. package/query-planner/odata.d.ts.map +1 -0
  249. package/query-planner/odata.js +662 -0
  250. package/query-planner/ogc-compiler.d.ts +55 -0
  251. package/query-planner/ogc-compiler.d.ts.map +1 -0
  252. package/query-planner/ogc-compiler.js +480 -0
  253. package/query-planner/ogc-features.d.ts +53 -0
  254. package/query-planner/ogc-features.d.ts.map +1 -0
  255. package/query-planner/ogc-features.js +617 -0
  256. package/query-planner/planner.d.ts +17 -0
  257. package/query-planner/planner.d.ts.map +1 -0
  258. package/query-planner/planner.js +818 -0
  259. package/query-planner/resource.d.ts +94 -0
  260. package/query-planner/resource.d.ts.map +1 -0
  261. package/query-planner/resource.js +526 -0
  262. package/query-planner/semantic-canonical.d.ts +15 -0
  263. package/query-planner/semantic-canonical.d.ts.map +1 -0
  264. package/query-planner/semantic-canonical.js +62 -0
  265. package/query-planner/semantic-compat.d.ts +10 -0
  266. package/query-planner/semantic-compat.d.ts.map +1 -0
  267. package/query-planner/semantic-compat.js +35 -0
  268. package/query-planner/semantic-compiler.d.ts +64 -0
  269. package/query-planner/semantic-compiler.d.ts.map +1 -0
  270. package/query-planner/semantic-compiler.js +81 -0
  271. package/query-planner/semantic-literals.d.ts +30 -0
  272. package/query-planner/semantic-literals.d.ts.map +1 -0
  273. package/query-planner/semantic-literals.js +133 -0
  274. package/query-planner/semantic-types.d.ts +265 -0
  275. package/query-planner/semantic-types.d.ts.map +1 -0
  276. package/query-planner/semantic-types.js +1 -0
  277. package/query-planner/semantic.d.ts +54 -0
  278. package/query-planner/semantic.d.ts.map +1 -0
  279. package/query-planner/semantic.js +1421 -0
  280. package/query-planner/types.d.ts +560 -0
  281. package/query-planner/types.d.ts.map +1 -0
  282. package/query-planner/types.js +49 -0
  283. package/query-planner/wfs-semantic.d.ts +58 -0
  284. package/query-planner/wfs-semantic.d.ts.map +1 -0
  285. package/query-planner/wfs-semantic.js +547 -0
  286. package/query-planner/wfs.d.ts +6 -0
  287. package/query-planner/wfs.d.ts.map +1 -0
  288. package/query-planner/wfs.js +71 -0
  289. package/realtime/contract.d.ts +142 -0
  290. package/realtime/contract.d.ts.map +1 -0
  291. package/realtime/contract.js +154 -0
  292. package/realtime/honua-server.d.ts.map +1 -1
  293. package/realtime/honua-server.js +13 -8
  294. package/realtime/index.d.ts +19 -4
  295. package/realtime/index.d.ts.map +1 -1
  296. package/realtime/index.js +14 -4
  297. package/realtime/odata-delta.d.ts +114 -0
  298. package/realtime/odata-delta.d.ts.map +1 -0
  299. package/realtime/odata-delta.js +483 -0
  300. package/realtime/resumable-transport.d.ts +111 -0
  301. package/realtime/resumable-transport.d.ts.map +1 -0
  302. package/realtime/resumable-transport.js +406 -0
  303. package/realtime/resumable.d.ts +104 -0
  304. package/realtime/resumable.d.ts.map +1 -0
  305. package/realtime/resumable.js +632 -0
  306. package/realtime/sse.d.ts.map +1 -1
  307. package/realtime/sse.js +27 -23
  308. package/realtime/websocket.d.ts +60 -0
  309. package/realtime/websocket.d.ts.map +1 -0
  310. package/realtime/websocket.js +157 -0
  311. package/realtime/wire.d.ts +27 -0
  312. package/realtime/wire.d.ts.map +1 -0
  313. package/realtime/wire.js +57 -0
  314. package/replica-sync/errors.d.ts +2 -1
  315. package/replica-sync/errors.d.ts.map +1 -1
  316. package/replica-sync/errors.js +33 -2
  317. package/runtime/edit-snapping.d.ts +107 -0
  318. package/runtime/edit-snapping.d.ts.map +1 -0
  319. package/runtime/edit-snapping.js +190 -0
  320. package/runtime/errors.d.ts +3 -2
  321. package/runtime/errors.d.ts.map +1 -1
  322. package/runtime/errors.js +19 -2
  323. package/runtime/index.d.ts +6 -0
  324. package/runtime/index.d.ts.map +1 -1
  325. package/runtime/index.js +3 -0
  326. package/runtime/maplibre-renderer.d.ts +41 -0
  327. package/runtime/maplibre-renderer.d.ts.map +1 -0
  328. package/runtime/maplibre-renderer.js +322 -0
  329. package/runtime/query-tiles.d.ts +2 -1
  330. package/runtime/query-tiles.d.ts.map +1 -1
  331. package/runtime/query-tiles.js +6 -2
  332. package/runtime/source-bridge.d.ts +4 -4
  333. package/runtime/source-bridge.d.ts.map +1 -1
  334. package/runtime/source-bridge.js +9 -56
  335. package/runtime/style-interactions.d.ts +3 -2
  336. package/runtime/style-interactions.d.ts.map +1 -1
  337. package/runtime/style-interactions.js +11 -3
  338. package/runtime/terra-draw-sketch.d.ts +275 -0
  339. package/runtime/terra-draw-sketch.d.ts.map +1 -0
  340. package/runtime/terra-draw-sketch.js +404 -0
  341. package/scene-workspace/index.d.ts +4 -0
  342. package/scene-workspace/index.d.ts.map +1 -1
  343. package/scene-workspace/index.js +2 -0
  344. package/scene-workspace/source-to-cesium.d.ts +116 -0
  345. package/scene-workspace/source-to-cesium.d.ts.map +1 -0
  346. package/scene-workspace/source-to-cesium.js +791 -0
  347. package/scene-workspace/state-sync.d.ts +147 -0
  348. package/scene-workspace/state-sync.d.ts.map +1 -0
  349. package/scene-workspace/state-sync.js +1123 -0
  350. package/source-capability-registry.d.ts +1 -0
  351. package/source-capability-registry.js +1 -0
  352. package/source-capability-types.d.ts +186 -0
  353. package/source-capability-types.js +7 -0
  354. package/style/index.d.ts +2 -0
  355. package/style/index.d.ts.map +1 -1
  356. package/style/index.js +2 -0
  357. package/style/renderers.d.ts +326 -0
  358. package/style/renderers.d.ts.map +1 -0
  359. package/style/renderers.js +517 -0
  360. package/web-components/controller.d.ts +2 -0
  361. package/web-components/controller.d.ts.map +1 -1
  362. package/web-components/controller.js +49 -8
  363. package/web-components/elements.d.ts +95 -1
  364. package/web-components/elements.d.ts.map +1 -1
  365. package/web-components/elements.js +458 -19
  366. package/web-components/index.d.ts +8 -1
  367. package/web-components/index.d.ts.map +1 -1
  368. package/web-components/index.js +7 -0
  369. package/web-components/maplibre-renderer.d.ts.map +1 -1
  370. package/web-components/maplibre-renderer.js +87 -0
  371. package/web-components/measurement.d.ts +69 -0
  372. package/web-components/measurement.d.ts.map +1 -0
  373. package/web-components/measurement.js +523 -0
  374. package/web-components/types.d.ts +109 -0
  375. package/web-components/types.d.ts.map +1 -1
  376. package/webmap/convert-renderer.d.ts +24 -3
  377. package/webmap/convert-renderer.d.ts.map +1 -1
  378. package/webmap/convert-renderer.js +93 -112
  379. package/webmap/index.d.ts +1 -1
  380. package/webmap/index.d.ts.map +1 -1
  381. package/webmap/index.js +1 -1
@@ -0,0 +1,84 @@
1
+ /**
2
+ * `HonuaWidgetHost` — mounts the app-platform survival-tier web components
3
+ * (`@honua/sdk-js/web-components`, moving to `@honua/app-platform`) into the
4
+ * `container` an esri-compat widget shim was constructed with, so shim UI
5
+ * renders through the shared component set instead of shim-only markup
6
+ * (issue #493, REQ-004).
7
+ *
8
+ * The host **never imports the web-component kit** — not even dynamically:
9
+ * the `/esri-compat` entrypoint is bundle-budgeted, and any intra-package
10
+ * import (static or `import()`) would pull the whole kit plus its geometry
11
+ * closure into every compat bundle. Instead the application injects the kit
12
+ * once via {@link registerHonuaWidgetKit}:
13
+ *
14
+ * ```ts doc-test=skip reason="wiring snippet requires an application host"
15
+ * import { registerHonuaWidgetKit } from "@honua/sdk-esri-compat";
16
+ *
17
+ * // Eager (module object) or lazy (loader) — both work:
18
+ * registerHonuaWidgetKit(() => import("@honua/sdk-js/web-components"));
19
+ * ```
20
+ *
21
+ * The host is deliberately defensive:
22
+ *
23
+ * - It resolves the ArcGIS-style `container` option (an `HTMLElement` or an
24
+ * element id) only when a DOM is present; headless (Node) shim usage keeps
25
+ * working with no DOM side effects.
26
+ * - Without a registered kit — the default, and the only possibility in the
27
+ * standalone `@honua/sdk-esri-compat` split package unless the app installs
28
+ * the kit — mounting quietly no-ops and the shims stay state-model-only,
29
+ * exactly their pre-delegation behavior.
30
+ * - The delegation tag must be owned by the kit's own element class; a
31
+ * foreign registrant (e.g. the controls kit's `honua-legend`, which has a
32
+ * different `entries` API) also falls back to the headless behavior.
33
+ *
34
+ * @module
35
+ */
36
+ /** Element surface the host hands back to shim update callbacks. */
37
+ export interface HonuaWidgetHostElement extends HTMLElement {
38
+ [key: string]: unknown;
39
+ }
40
+ /**
41
+ * Structural slice of the `@honua/sdk-js/web-components` module the host
42
+ * needs: the element classes (to verify tag ownership) and the registration
43
+ * helper. Passing the whole module object satisfies this interface.
44
+ */
45
+ export interface HonuaWidgetKitLike {
46
+ HonuaLegendElement?: CustomElementConstructor;
47
+ HonuaLayerListElement?: CustomElementConstructor;
48
+ HonuaSearchElement?: CustomElementConstructor;
49
+ HonuaMeasurementElement?: CustomElementConstructor;
50
+ defineHonuaWebComponents?: (registry?: CustomElementRegistry) => void;
51
+ }
52
+ /** A kit module object, or a (possibly async) loader for one. */
53
+ export type HonuaWidgetKitSource = HonuaWidgetKitLike | (() => HonuaWidgetKitLike | Promise<HonuaWidgetKitLike>);
54
+ /**
55
+ * Injects the web-component kit that {@link HonuaWidgetHost} delegates to.
56
+ * Call once from application code with the `@honua/sdk-js/web-components`
57
+ * (or `@honua/app-platform/web-components`) module — eagerly or as a lazy
58
+ * loader. Pass `undefined` to unregister (shims return to headless mode).
59
+ */
60
+ export declare function registerHonuaWidgetKit(source: HonuaWidgetKitSource | undefined): void;
61
+ export declare class HonuaWidgetHost {
62
+ #private;
63
+ constructor(tagName: string, container: unknown);
64
+ /** Whether a usable container was resolved (requires a DOM). */
65
+ get available(): boolean;
66
+ /** The mounted element, when {@link mount} has completed. */
67
+ get element(): HonuaWidgetHostElement | undefined;
68
+ /**
69
+ * Ensures the injected web-component kit is registered and the element is
70
+ * mounted into the container. Returns the element, or `undefined` when no
71
+ * DOM / container / kit is available (headless shims, or an application
72
+ * that never called {@link registerHonuaWidgetKit}).
73
+ */
74
+ mount(): Promise<HonuaWidgetHostElement | undefined>;
75
+ /**
76
+ * Mounts (when needed) and applies `assign` to the element. Fire-and-forget
77
+ * friendly: shims call `void host.update(...)` from synchronous refresh
78
+ * paths.
79
+ */
80
+ update(assign: (element: HonuaWidgetHostElement) => void): Promise<void>;
81
+ /** Removes the mounted element from the container. */
82
+ destroy(): void;
83
+ }
84
+ //# sourceMappingURL=widget-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-host.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/widget-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AASH,oEAAoE;AACpE,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C,qBAAqB,CAAC,EAAE,wBAAwB,CAAC;IACjD,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,wBAAwB,CAAC;IACnD,wBAAwB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvE;AAED,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAIjH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,GAAG,IAAI,CAErF;AAED,qBAAa,eAAe;;gBAOP,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;IAKtD,gEAAgE;IAChE,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,6DAA6D;IAC7D,IAAW,OAAO,IAAI,sBAAsB,GAAG,SAAS,CAEvD;IAED;;;;;OAKG;IACU,KAAK,IAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAYjE;;;;OAIG;IACU,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrF,sDAAsD;IAC/C,OAAO,IAAI,IAAI;CAmCvB"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * `HonuaWidgetHost` — mounts the app-platform survival-tier web components
3
+ * (`@honua/sdk-js/web-components`, moving to `@honua/app-platform`) into the
4
+ * `container` an esri-compat widget shim was constructed with, so shim UI
5
+ * renders through the shared component set instead of shim-only markup
6
+ * (issue #493, REQ-004).
7
+ *
8
+ * The host **never imports the web-component kit** — not even dynamically:
9
+ * the `/esri-compat` entrypoint is bundle-budgeted, and any intra-package
10
+ * import (static or `import()`) would pull the whole kit plus its geometry
11
+ * closure into every compat bundle. Instead the application injects the kit
12
+ * once via {@link registerHonuaWidgetKit}:
13
+ *
14
+ * ```ts doc-test=skip reason="wiring snippet requires an application host"
15
+ * import { registerHonuaWidgetKit } from "@honua/sdk-esri-compat";
16
+ *
17
+ * // Eager (module object) or lazy (loader) — both work:
18
+ * registerHonuaWidgetKit(() => import("@honua/sdk-js/web-components"));
19
+ * ```
20
+ *
21
+ * The host is deliberately defensive:
22
+ *
23
+ * - It resolves the ArcGIS-style `container` option (an `HTMLElement` or an
24
+ * element id) only when a DOM is present; headless (Node) shim usage keeps
25
+ * working with no DOM side effects.
26
+ * - Without a registered kit — the default, and the only possibility in the
27
+ * standalone `@honua/sdk-esri-compat` split package unless the app installs
28
+ * the kit — mounting quietly no-ops and the shims stay state-model-only,
29
+ * exactly their pre-delegation behavior.
30
+ * - The delegation tag must be owned by the kit's own element class; a
31
+ * foreign registrant (e.g. the controls kit's `honua-legend`, which has a
32
+ * different `entries` API) also falls back to the headless behavior.
33
+ *
34
+ * @module
35
+ */
36
+ const globalDom = globalThis;
37
+ let widgetKitSource;
38
+ /**
39
+ * Injects the web-component kit that {@link HonuaWidgetHost} delegates to.
40
+ * Call once from application code with the `@honua/sdk-js/web-components`
41
+ * (or `@honua/app-platform/web-components`) module — eagerly or as a lazy
42
+ * loader. Pass `undefined` to unregister (shims return to headless mode).
43
+ */
44
+ export function registerHonuaWidgetKit(source) {
45
+ widgetKitSource = source;
46
+ }
47
+ export class HonuaWidgetHost {
48
+ #tagName;
49
+ #container;
50
+ #element;
51
+ #kitLoad;
52
+ #kitLoadSource;
53
+ constructor(tagName, container) {
54
+ this.#tagName = tagName;
55
+ this.#container = resolveContainer(container);
56
+ }
57
+ /** Whether a usable container was resolved (requires a DOM). */
58
+ get available() {
59
+ return this.#container !== undefined;
60
+ }
61
+ /** The mounted element, when {@link mount} has completed. */
62
+ get element() {
63
+ return this.#element;
64
+ }
65
+ /**
66
+ * Ensures the injected web-component kit is registered and the element is
67
+ * mounted into the container. Returns the element, or `undefined` when no
68
+ * DOM / container / kit is available (headless shims, or an application
69
+ * that never called {@link registerHonuaWidgetKit}).
70
+ */
71
+ async mount() {
72
+ const container = this.#container;
73
+ if (!container || !globalDom.document)
74
+ return undefined;
75
+ if (!(await this.#loadKit()))
76
+ return undefined;
77
+ if (!this.#element || !this.#element.isConnected) {
78
+ const element = globalDom.document.createElement(this.#tagName);
79
+ container.replaceChildren(element);
80
+ this.#element = element;
81
+ }
82
+ return this.#element;
83
+ }
84
+ /**
85
+ * Mounts (when needed) and applies `assign` to the element. Fire-and-forget
86
+ * friendly: shims call `void host.update(...)` from synchronous refresh
87
+ * paths.
88
+ */
89
+ async update(assign) {
90
+ const element = await this.mount();
91
+ if (element)
92
+ assign(element);
93
+ }
94
+ /** Removes the mounted element from the container. */
95
+ destroy() {
96
+ this.#element?.remove();
97
+ this.#element = undefined;
98
+ }
99
+ #loadKit() {
100
+ const source = widgetKitSource;
101
+ // No kit injected (yet): stay headless without caching, so a later
102
+ // registerHonuaWidgetKit call is picked up by the next refresh.
103
+ if (!source)
104
+ return Promise.resolve(false);
105
+ if (!this.#kitLoad || this.#kitLoadSource !== source) {
106
+ this.#kitLoadSource = source;
107
+ this.#kitLoad = (async () => {
108
+ let kit;
109
+ try {
110
+ kit = typeof source === "function" ? await source() : source;
111
+ // Importing the kit module registers the elements as a side effect;
112
+ // calling the helper again is an if-missing no-op, but covers kits
113
+ // handed over as plain objects in scoped-registry setups.
114
+ kit.defineHonuaWebComponents?.();
115
+ }
116
+ catch {
117
+ return false;
118
+ }
119
+ // The tag must be owned by the kit's own class. Another registrant
120
+ // can win the tag (e.g. the controls kit registers its own
121
+ // `honua-legend` with a different `entries` API when imported first);
122
+ // mounting that element and assigning the web-components properties
123
+ // would render nothing, so fall back to the headless shim behavior.
124
+ const expected = expectedKitConstructor(kit, this.#tagName);
125
+ const registered = globalDom.customElements?.get(this.#tagName);
126
+ return expected !== undefined && registered === expected;
127
+ })();
128
+ }
129
+ return this.#kitLoad;
130
+ }
131
+ }
132
+ /** Resolves the web-components kit class that must own `tagName` for delegation. */
133
+ function expectedKitConstructor(kit, tagName) {
134
+ switch (tagName) {
135
+ case "honua-legend":
136
+ return kit.HonuaLegendElement;
137
+ case "honua-layer-list":
138
+ return kit.HonuaLayerListElement;
139
+ case "honua-search":
140
+ return kit.HonuaSearchElement;
141
+ case "honua-measurement":
142
+ return kit.HonuaMeasurementElement;
143
+ default:
144
+ return undefined;
145
+ }
146
+ }
147
+ function resolveContainer(container) {
148
+ if (!globalDom.document)
149
+ return undefined;
150
+ if (typeof container === "string") {
151
+ return globalDom.document.getElementById(container) ?? undefined;
152
+ }
153
+ if (typeof container === "object" &&
154
+ container !== null &&
155
+ typeof container.appendChild === "function") {
156
+ return container;
157
+ }
158
+ return undefined;
159
+ }
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * @module
8
8
  */
9
+ import { HonuaSdkError } from "../core/error-envelope.js";
9
10
  export type HonuaGeneratedAppErrorCode = "unsupported-profile" | "unsupported-widget" | "missing-manifest" | "missing-manifest-artifact" | "missing-map-package" | "map-package-mismatch" | "missing-widget" | "missing-binding" | "map-load-failed" | "data-load-failed" | "render-failed" | "disposed";
10
11
  export type HonuaGeneratedAppErrorStage = "manifest" | "projection" | "load" | "interaction" | "render" | "dispose";
11
12
  export interface HonuaGeneratedAppErrorDetail {
@@ -25,7 +26,23 @@ export interface HonuaGeneratedAppDiagnostic {
25
26
  readonly message: string;
26
27
  readonly detail?: HonuaGeneratedAppErrorDetail;
27
28
  }
28
- export declare class HonuaGeneratedAppError extends Error {
29
+ /**
30
+ * Tagged generated-app preview/runtime failure. Participates in the shared
31
+ * SDK error envelope (`isHonuaError`, `serializeHonuaError`) while
32
+ * preserving the legacy `.code`/`.stage`/`.detail`/`.cause` fields consumed
33
+ * by {@link toGeneratedAppDiagnostic}. `detail` is an open, caller-supplied
34
+ * bag (`expected`/`received`/etc.) and is deliberately kept local-only — it
35
+ * is never placed in the envelope's serialized `context`.
36
+ *
37
+ * The base `HonuaSdkError.toJSON()` (the redacted envelope projection) is
38
+ * inherited unchanged, so `JSON.stringify(error)` now returns the safe,
39
+ * sanitized `SerializedHonuaError` shape rather than the raw diagnostic
40
+ * (which could otherwise echo an unsanitized `detail`). Callers that need
41
+ * the legacy `{name, code, stage, message, detail}` diagnostic shape use
42
+ * {@link toGeneratedAppDiagnostic}, which reads the documented fields
43
+ * directly rather than relying on `toJSON()`.
44
+ */
45
+ export declare class HonuaGeneratedAppError extends HonuaSdkError {
29
46
  readonly code: HonuaGeneratedAppErrorCode;
30
47
  readonly stage: HonuaGeneratedAppErrorStage;
31
48
  readonly detail: HonuaGeneratedAppErrorDetail | undefined;
@@ -35,7 +52,6 @@ export declare class HonuaGeneratedAppError extends Error {
35
52
  readonly detail?: HonuaGeneratedAppErrorDetail;
36
53
  readonly cause?: unknown;
37
54
  });
38
- toJSON(): HonuaGeneratedAppDiagnostic;
39
55
  }
40
56
  export declare function toGeneratedAppDiagnostic(error: unknown): HonuaGeneratedAppDiagnostic;
41
57
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/generated-app/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,0BAA0B,GAClC,qBAAqB,GACrB,oBAAoB,GACpB,kBAAkB,GAClB,2BAA2B,GAC3B,qBAAqB,GACrB,sBAAsB,GACtB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,UAAU,CAAC;AAEf,MAAM,MAAM,2BAA2B,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CA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AAM,EAAE,4BAA4B,GAAG,SAAS,CAAC;IACjE,SAAyB,KAAK,EAAE,OAAO,CAAC;gBAGtC,IAAI,EAAE,0BAA0B,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QACP,QAAQ,CAAC,KAAK,EAAE,2BAA2B,CAAC;QAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,4BAA4B,CAAC;QAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;KAC1B;CASJ;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,CAgBpF"}
@@ -6,32 +6,65 @@
6
6
  *
7
7
  * @module
8
8
  */
9
- export class HonuaGeneratedAppError extends Error {
9
+ import { HonuaSdkError } from "../core/error-envelope.js";
10
+ /**
11
+ * Legacy detailed reason codes mapped to registered `app.*` `sdkCode`
12
+ * values, one-to-one.
13
+ */
14
+ const GENERATED_APP_ERROR_SDK_CODES = {
15
+ "unsupported-profile": "app.unsupported-profile",
16
+ "unsupported-widget": "app.unsupported-widget",
17
+ "missing-manifest": "app.missing-manifest",
18
+ "missing-manifest-artifact": "app.missing-manifest-artifact",
19
+ "missing-map-package": "app.missing-map-package",
20
+ "map-package-mismatch": "app.map-package-mismatch",
21
+ "missing-widget": "app.missing-widget",
22
+ "missing-binding": "app.missing-binding",
23
+ "map-load-failed": "app.map-load-failed",
24
+ "data-load-failed": "app.data-load-failed",
25
+ "render-failed": "app.render-failed",
26
+ disposed: "app.disposed",
27
+ };
28
+ /**
29
+ * Tagged generated-app preview/runtime failure. Participates in the shared
30
+ * SDK error envelope (`isHonuaError`, `serializeHonuaError`) while
31
+ * preserving the legacy `.code`/`.stage`/`.detail`/`.cause` fields consumed
32
+ * by {@link toGeneratedAppDiagnostic}. `detail` is an open, caller-supplied
33
+ * bag (`expected`/`received`/etc.) and is deliberately kept local-only — it
34
+ * is never placed in the envelope's serialized `context`.
35
+ *
36
+ * The base `HonuaSdkError.toJSON()` (the redacted envelope projection) is
37
+ * inherited unchanged, so `JSON.stringify(error)` now returns the safe,
38
+ * sanitized `SerializedHonuaError` shape rather than the raw diagnostic
39
+ * (which could otherwise echo an unsanitized `detail`). Callers that need
40
+ * the legacy `{name, code, stage, message, detail}` diagnostic shape use
41
+ * {@link toGeneratedAppDiagnostic}, which reads the documented fields
42
+ * directly rather than relying on `toJSON()`.
43
+ */
44
+ export class HonuaGeneratedAppError extends HonuaSdkError {
10
45
  code;
11
46
  stage;
12
47
  detail;
13
48
  cause;
14
49
  constructor(code, message, options) {
15
- super(message);
50
+ super(GENERATED_APP_ERROR_SDK_CODES[code], message, options.cause === undefined ? {} : { cause: options.cause });
16
51
  this.name = "HonuaGeneratedAppError";
17
52
  this.code = code;
18
53
  this.stage = options.stage;
19
54
  this.detail = options.detail;
20
55
  this.cause = options.cause;
21
56
  }
22
- toJSON() {
57
+ }
58
+ export function toGeneratedAppDiagnostic(error) {
59
+ if (error instanceof HonuaGeneratedAppError) {
23
60
  return {
24
61
  name: "HonuaGeneratedAppError",
25
- code: this.code,
26
- stage: this.stage,
27
- message: this.message,
28
- ...(this.detail ? { detail: this.detail } : {}),
62
+ code: error.code,
63
+ stage: error.stage,
64
+ message: error.message,
65
+ ...(error.detail ? { detail: error.detail } : {}),
29
66
  };
30
67
  }
31
- }
32
- export function toGeneratedAppDiagnostic(error) {
33
- if (error instanceof HonuaGeneratedAppError)
34
- return error.toJSON();
35
68
  return {
36
69
  name: "HonuaGeneratedAppError",
37
70
  code: "render-failed",
@@ -31,6 +31,13 @@
31
31
  *
32
32
  * @packageDocumentation
33
33
  */
34
+ export type { ProviderTransportOptions } from "./provider-http.js";
35
+ export type { CapabilityPolicy, GeocodingCapability, GeocodingProvenance, GeocodingProvider, ProviderGeocodeMatch, ProviderGeocodeOptions, ProviderReverseMatch, ProviderSuggestion, ProviderSuggestOptions, } from "./provider.js";
36
+ export { assertGeocodingCapability, supportsGeocodingCapability } from "./provider.js";
37
+ export { type HonuaGeocodingProviderOptions, honuaGeocodingProvider } from "./providers/honua.js";
38
+ export { type NominatimProviderOptions, nominatimGeocodingProvider } from "./providers/nominatim.js";
39
+ export { type PeliasProviderOptions, peliasGeocodingProvider } from "./providers/pelias.js";
40
+ export { type PhotonProviderOptions, photonGeocodingProvider } from "./providers/photon.js";
34
41
  export interface GeocodingClientOptions {
35
42
  baseUrl: string;
36
43
  locatorName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/geocoding/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AASH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAA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,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB;AA0ED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;gBAE5B,OAAO,EAAE,sBAAsB;IAwBlD;;;OAGG;IACU,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA+BvG;;;;OAIG;IACU,cAAc,CACzB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8CvC;;OAEG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA8B1F,OAAO,CAAC,eAAe;IAIvB;;;;;;;OAOG;YACW,sBAAsB;YA0CtB,OAAO;CAiDtB"}
@@ -33,6 +33,11 @@
33
33
  */
34
34
  import { HonuaAbortError, HonuaHttpError, HonuaNetworkError, HonuaTimeoutError } from "../core/errors.js";
35
35
  import { encodeServiceIdPath, trimTrailingSlashes } from "../core/path-utils.js";
36
+ export { assertGeocodingCapability, supportsGeocodingCapability } from "./provider.js";
37
+ export { honuaGeocodingProvider } from "./providers/honua.js";
38
+ export { nominatimGeocodingProvider } from "./providers/nominatim.js";
39
+ export { peliasGeocodingProvider } from "./providers/pelias.js";
40
+ export { photonGeocodingProvider } from "./providers/photon.js";
36
41
  // ---------------------------------------------------------------------------
37
42
  // Helpers
38
43
  // ---------------------------------------------------------------------------
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Minimal shared HTTP helper for the third-party geocoding / routing provider
3
+ * adapters. Mirrors the request semantics of the SDK's core clients — timeout
4
+ * composition and the typed error envelope (`HonuaTimeoutError`,
5
+ * `HonuaAbortError`, `HonuaNetworkError`, `HonuaHttpError`) — without pulling
6
+ * the full request pipeline into these small subpath bundles.
7
+ *
8
+ * Unlike `HonuaGeocodingClient`, provider adapters never attach Honua
9
+ * credentials, so the default fetch redirect behavior is safe here.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ /** Transport options shared by every provider adapter. @experimental */
14
+ export interface ProviderTransportOptions {
15
+ /** Custom fetch implementation (testing, interception, auth bridges). */
16
+ fetchFn?: typeof fetch;
17
+ /** Per-request timeout in milliseconds. */
18
+ timeoutMs?: number;
19
+ }
20
+ /** @internal */
21
+ export interface ProviderRequestInit extends ProviderTransportOptions {
22
+ /** Extra request headers (e.g. a Nominatim-policy `User-Agent`). */
23
+ headers?: Record<string, string>;
24
+ /** Label used in error messages, e.g. `"nominatim geocode"`. */
25
+ label: string;
26
+ }
27
+ /**
28
+ * GET a JSON document with the SDK's typed error mapping.
29
+ *
30
+ * @internal
31
+ */
32
+ export declare function providerGetJson<T>(url: string, init: ProviderRequestInit): Promise<T>;
33
+ /** Strip trailing slashes so adapters can join paths deterministically. @internal */
34
+ export declare function trimProviderBaseUrl(baseUrl: string): string;
35
+ /** Stringify provider attributes to the contract `Record<string, string | null>` shape. @internal */
36
+ export declare function stringifyProviderAttributes(attrs: Record<string, unknown>): Record<string, string | null>;
37
+ //# sourceMappingURL=provider-http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-http.d.ts","sourceRoot":"","sources":["../../../src/geocoding/provider-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,wEAAwE;AACxE,MAAM,WAAW,wBAAwB;IACvC,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACnE,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmD3F;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED,qGAAqG;AACrG,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CASzG"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Minimal shared HTTP helper for the third-party geocoding / routing provider
3
+ * adapters. Mirrors the request semantics of the SDK's core clients — timeout
4
+ * composition and the typed error envelope (`HonuaTimeoutError`,
5
+ * `HonuaAbortError`, `HonuaNetworkError`, `HonuaHttpError`) — without pulling
6
+ * the full request pipeline into these small subpath bundles.
7
+ *
8
+ * Unlike `HonuaGeocodingClient`, provider adapters never attach Honua
9
+ * credentials, so the default fetch redirect behavior is safe here.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ import { HonuaAbortError, HonuaHttpError, HonuaNetworkError, HonuaTimeoutError } from "../core/errors.js";
14
+ /**
15
+ * GET a JSON document with the SDK's typed error mapping.
16
+ *
17
+ * @internal
18
+ */
19
+ export async function providerGetJson(url, init) {
20
+ // Bind to `globalThis` at call time: invoking an unbound `window.fetch`
21
+ // throws "TypeError: Illegal invocation" in browsers.
22
+ const fetchFn = (init.fetchFn ?? fetch).bind(globalThis);
23
+ const controller = new AbortController();
24
+ let timeoutId;
25
+ if (init.timeoutMs !== undefined) {
26
+ timeoutId = setTimeout(() => controller.abort(), init.timeoutMs);
27
+ }
28
+ let response;
29
+ try {
30
+ response = await fetchFn(url, {
31
+ method: "GET",
32
+ headers: { Accept: "application/json", ...init.headers },
33
+ signal: controller.signal,
34
+ });
35
+ }
36
+ catch (err) {
37
+ if (err instanceof DOMException && err.name === "AbortError") {
38
+ if (init.timeoutMs !== undefined) {
39
+ throw new HonuaTimeoutError(init.timeoutMs);
40
+ }
41
+ throw new HonuaAbortError();
42
+ }
43
+ throw new HonuaNetworkError(err instanceof Error
44
+ ? `${init.label} request failed: ${err.message}`
45
+ : `${init.label} request failed due to a network error`, err);
46
+ }
47
+ finally {
48
+ if (timeoutId !== undefined) {
49
+ clearTimeout(timeoutId);
50
+ }
51
+ }
52
+ if (!response.ok) {
53
+ let body;
54
+ try {
55
+ body = await response.json();
56
+ }
57
+ catch {
58
+ body = await response.text().catch(() => null);
59
+ }
60
+ throw new HonuaHttpError(response.status, `${init.label} request failed with status ${response.status}`, body);
61
+ }
62
+ try {
63
+ return (await response.json());
64
+ }
65
+ catch (err) {
66
+ throw new HonuaNetworkError(`${init.label} response was not valid JSON`, err);
67
+ }
68
+ }
69
+ /** Strip trailing slashes so adapters can join paths deterministically. @internal */
70
+ export function trimProviderBaseUrl(baseUrl) {
71
+ let end = baseUrl.length;
72
+ while (end > 0 && baseUrl[end - 1] === "/") {
73
+ end -= 1;
74
+ }
75
+ const trimmed = baseUrl.slice(0, end);
76
+ if (!trimmed) {
77
+ throw new Error("Provider baseUrl must be a non-empty URL (no default third-party endpoint is baked in).");
78
+ }
79
+ return trimmed;
80
+ }
81
+ /** Stringify provider attributes to the contract `Record<string, string | null>` shape. @internal */
82
+ export function stringifyProviderAttributes(attrs) {
83
+ const result = {};
84
+ for (const [key, value] of Object.entries(attrs)) {
85
+ if (value === undefined) {
86
+ continue;
87
+ }
88
+ result[key] = value === null ? null : String(value);
89
+ }
90
+ return result;
91
+ }