@honua/app-platform 0.0.20-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +11 -0
- package/app/index.d.ts +164 -0
- package/app/index.d.ts.map +1 -0
- package/app/index.js +424 -0
- package/app-controller/controller.d.ts +425 -0
- package/app-controller/controller.d.ts.map +1 -0
- package/app-controller/controller.js +1173 -0
- package/app-controller/index.d.ts +14 -0
- package/app-controller/index.d.ts.map +1 -0
- package/app-controller/index.js +12 -0
- package/app-workspace/index.d.ts +421 -0
- package/app-workspace/index.d.ts.map +1 -0
- package/app-workspace/index.js +722 -0
- package/collaboration/client.d.ts +40 -0
- package/collaboration/client.d.ts.map +1 -0
- package/collaboration/client.js +299 -0
- package/collaboration/errors.d.ts +15 -0
- package/collaboration/errors.d.ts.map +1 -0
- package/collaboration/errors.js +17 -0
- package/collaboration/fixture.d.ts +41 -0
- package/collaboration/fixture.d.ts.map +1 -0
- package/collaboration/fixture.js +362 -0
- package/collaboration/index.d.ts +18 -0
- package/collaboration/index.d.ts.map +1 -0
- package/collaboration/index.js +14 -0
- package/collaboration/types.d.ts +240 -0
- package/collaboration/types.d.ts.map +1 -0
- package/collaboration/types.js +1 -0
- package/contract/analytics-sources.d.ts +149 -0
- package/contract/analytics-sources.d.ts.map +1 -0
- package/contract/analytics-sources.js +235 -0
- package/contract/edit-session.d.ts +203 -0
- package/contract/edit-session.d.ts.map +1 -0
- package/contract/edit-session.js +760 -0
- package/contract/edit-sketch.d.ts +91 -0
- package/contract/edit-sketch.d.ts.map +1 -0
- package/contract/edit-sketch.js +281 -0
- package/contract/index.d.ts +63 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +52 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/pmtiles.d.ts +162 -0
- package/contract/pmtiles.d.ts.map +1 -0
- package/contract/pmtiles.js +155 -0
- package/contract/source.d.ts +447 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3909 -0
- package/contract/spatial-aggregation.d.ts +336 -0
- package/contract/spatial-aggregation.d.ts.map +1 -0
- package/contract/spatial-aggregation.js +298 -0
- package/contract/temporal.d.ts +455 -0
- package/contract/temporal.d.ts.map +1 -0
- package/contract/temporal.js +146 -0
- package/contract/tiles.d.ts +370 -0
- package/contract/tiles.d.ts.map +1 -0
- package/contract/tiles.js +519 -0
- package/contract/types.d.ts +694 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +183 -0
- package/contract/widget-source.d.ts +205 -0
- package/contract/widget-source.d.ts.map +1 -0
- package/contract/widget-source.js +1473 -0
- package/control-plane/client.d.ts +95 -0
- package/control-plane/client.d.ts.map +1 -0
- package/control-plane/client.js +374 -0
- package/control-plane/index.d.ts +18 -0
- package/control-plane/index.d.ts.map +1 -0
- package/control-plane/index.js +14 -0
- package/control-plane/types.d.ts +233 -0
- package/control-plane/types.d.ts.map +1 -0
- package/control-plane/types.js +7 -0
- package/controls/basemap-style-binding.d.ts +54 -0
- package/controls/basemap-style-binding.d.ts.map +1 -0
- package/controls/basemap-style-binding.js +199 -0
- package/controls/basemap-switcher.d.ts +95 -0
- package/controls/basemap-switcher.d.ts.map +1 -0
- package/controls/basemap-switcher.js +379 -0
- package/controls/element-utils.d.ts +48 -0
- package/controls/element-utils.d.ts.map +1 -0
- package/controls/element-utils.js +78 -0
- package/controls/index.d.ts +33 -0
- package/controls/index.d.ts.map +1 -0
- package/controls/index.js +30 -0
- package/controls/layer-list.d.ts +98 -0
- package/controls/layer-list.d.ts.map +1 -0
- package/controls/layer-list.js +375 -0
- package/controls/legend-derive.d.ts +53 -0
- package/controls/legend-derive.d.ts.map +1 -0
- package/controls/legend-derive.js +196 -0
- package/controls/legend.d.ts +104 -0
- package/controls/legend.d.ts.map +1 -0
- package/controls/legend.js +381 -0
- package/controls/swipe-control.d.ts +80 -0
- package/controls/swipe-control.d.ts.map +1 -0
- package/controls/swipe-control.js +368 -0
- package/controls/types.d.ts +227 -0
- package/controls/types.d.ts.map +1 -0
- package/controls/types.js +11 -0
- package/core/auth/client-credentials-provider.d.ts +51 -0
- package/core/auth/client-credentials-provider.d.ts.map +1 -0
- package/core/auth/client-credentials-provider.js +115 -0
- package/core/auth/credential-store.d.ts +52 -0
- package/core/auth/credential-store.d.ts.map +1 -0
- package/core/auth/credential-store.js +82 -0
- package/core/auth/index.d.ts +23 -0
- package/core/auth/index.d.ts.map +1 -0
- package/core/auth/index.js +20 -0
- package/core/auth/oauth2-provider.d.ts +114 -0
- package/core/auth/oauth2-provider.d.ts.map +1 -0
- package/core/auth/oauth2-provider.js +408 -0
- package/core/auth/pkce.d.ts +25 -0
- package/core/auth/pkce.d.ts.map +1 -0
- package/core/auth/pkce.js +46 -0
- package/core/auth/static-providers.d.ts +20 -0
- package/core/auth/static-providers.d.ts.map +1 -0
- package/core/auth/static-providers.js +26 -0
- package/core/auth/token-endpoint.d.ts +40 -0
- package/core/auth/token-endpoint.d.ts.map +1 -0
- package/core/auth/token-endpoint.js +133 -0
- package/core/auth/types.d.ts +144 -0
- package/core/auth/types.d.ts.map +1 -0
- package/core/auth/types.js +8 -0
- package/core/batch.d.ts +37 -0
- package/core/batch.d.ts.map +1 -0
- package/core/batch.js +79 -0
- package/core/cache-state.d.ts +79 -0
- package/core/cache-state.d.ts.map +1 -0
- package/core/cache-state.js +87 -0
- package/core/client.d.ts +607 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1716 -0
- package/core/compatibility.d.ts +18 -0
- package/core/compatibility.d.ts.map +1 -0
- package/core/compatibility.js +245 -0
- package/core/errors.d.ts +139 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +176 -0
- package/core/esri-geojson.d.ts +66 -0
- package/core/esri-geojson.d.ts.map +1 -0
- package/core/esri-geojson.js +363 -0
- package/core/geoparquet-sql.d.ts +162 -0
- package/core/geoparquet-sql.d.ts.map +1 -0
- package/core/geoparquet-sql.js +333 -0
- package/core/geoservices.d.ts +34 -0
- package/core/geoservices.d.ts.map +1 -0
- package/core/geoservices.js +434 -0
- package/core/grpc-adapter.d.ts +23 -0
- package/core/grpc-adapter.d.ts.map +1 -0
- package/core/grpc-adapter.js +688 -0
- package/core/odata.d.ts +347 -0
- package/core/odata.d.ts.map +1 -0
- package/core/odata.js +913 -0
- package/core/ogc-conformance.d.ts +35 -0
- package/core/ogc-conformance.d.ts.map +1 -0
- package/core/ogc-conformance.js +134 -0
- package/core/ogc-endpoint-layout.d.ts +70 -0
- package/core/ogc-endpoint-layout.d.ts.map +1 -0
- package/core/ogc-endpoint-layout.js +173 -0
- package/core/ogc-features.d.ts +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +129 -0
- package/core/ogc-maps.d.ts +49 -0
- package/core/ogc-maps.d.ts.map +1 -0
- package/core/ogc-maps.js +126 -0
- package/core/ogc-processes.d.ts +118 -0
- package/core/ogc-processes.d.ts.map +1 -0
- package/core/ogc-processes.js +423 -0
- package/core/ogc-records.d.ts +75 -0
- package/core/ogc-records.d.ts.map +1 -0
- package/core/ogc-records.js +251 -0
- package/core/ogc-tiles.d.ts +125 -0
- package/core/ogc-tiles.d.ts.map +1 -0
- package/core/ogc-tiles.js +183 -0
- package/core/path-utils.d.ts +69 -0
- package/core/path-utils.d.ts.map +1 -0
- package/core/path-utils.js +123 -0
- package/core/pbf-decoder.d.ts +39 -0
- package/core/pbf-decoder.d.ts.map +1 -0
- package/core/pbf-decoder.js +702 -0
- package/core/process-runner.d.ts +104 -0
- package/core/process-runner.d.ts.map +1 -0
- package/core/process-runner.js +315 -0
- package/core/protocol-transport.d.ts +76 -0
- package/core/protocol-transport.d.ts.map +1 -0
- package/core/protocol-transport.js +15 -0
- package/core/query-builder.d.ts +261 -0
- package/core/query-builder.d.ts.map +1 -0
- package/core/query-builder.js +538 -0
- package/core/request-pipeline.d.ts +88 -0
- package/core/request-pipeline.d.ts.map +1 -0
- package/core/request-pipeline.js +273 -0
- package/core/spatial-filter.d.ts +93 -0
- package/core/spatial-filter.d.ts.map +1 -0
- package/core/spatial-filter.js +153 -0
- package/core/stac-static.d.ts +51 -0
- package/core/stac-static.d.ts.map +1 -0
- package/core/stac-static.js +195 -0
- package/core/stac.d.ts +67 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +259 -0
- package/core/surfaces.d.ts +540 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1964 -0
- package/core/terrain-elevation.d.ts +114 -0
- package/core/terrain-elevation.d.ts.map +1 -0
- package/core/terrain-elevation.js +150 -0
- package/core/types.d.ts +1404 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +153 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +490 -0
- package/core/wfs-filter.d.ts +118 -0
- package/core/wfs-filter.d.ts.map +1 -0
- package/core/wfs-filter.js +634 -0
- package/core/wfs.d.ts +232 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +426 -0
- package/core/wire-shared.d.ts +32 -0
- package/core/wire-shared.d.ts.map +1 -0
- package/core/wire-shared.js +76 -0
- package/core/wms-axis.d.ts +36 -0
- package/core/wms-axis.d.ts.map +1 -0
- package/core/wms-axis.js +73 -0
- package/core/wms-capabilities.d.ts +110 -0
- package/core/wms-capabilities.d.ts.map +1 -0
- package/core/wms-capabilities.js +559 -0
- package/core/wms-types.d.ts +128 -0
- package/core/wms-types.d.ts.map +1 -0
- package/core/wms-types.js +32 -0
- package/core/wms.d.ts +144 -0
- package/core/wms.d.ts.map +1 -0
- package/core/wms.js +338 -0
- package/core/wmts-capabilities.d.ts +82 -0
- package/core/wmts-capabilities.d.ts.map +1 -0
- package/core/wmts-capabilities.js +402 -0
- package/core/wmts.d.ts +103 -0
- package/core/wmts.d.ts.map +1 -0
- package/core/wmts.js +332 -0
- package/core/xml-text.d.ts +20 -0
- package/core/xml-text.d.ts.map +1 -0
- package/core/xml-text.js +85 -0
- package/esri-compat/basemap-gallery.d.ts +38 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -0
- package/esri-compat/basemap-gallery.js +159 -0
- package/esri-compat/basemap-layer-list.d.ts +35 -0
- package/esri-compat/basemap-layer-list.d.ts.map +1 -0
- package/esri-compat/basemap-layer-list.js +139 -0
- package/esri-compat/basemap.d.ts +32 -0
- package/esri-compat/basemap.d.ts.map +1 -0
- package/esri-compat/basemap.js +84 -0
- package/esri-compat/bookmarks.d.ts +36 -0
- package/esri-compat/bookmarks.d.ts.map +1 -0
- package/esri-compat/bookmarks.js +108 -0
- package/esri-compat/class-breaks-renderer.d.ts +50 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -0
- package/esri-compat/class-breaks-renderer.js +164 -0
- package/esri-compat/color.d.ts +22 -0
- package/esri-compat/color.d.ts.map +1 -0
- package/esri-compat/color.js +106 -0
- package/esri-compat/controls.d.ts +174 -0
- package/esri-compat/controls.d.ts.map +1 -0
- package/esri-compat/controls.js +479 -0
- package/esri-compat/coordinate-conversion.d.ts +41 -0
- package/esri-compat/coordinate-conversion.d.ts.map +1 -0
- package/esri-compat/coordinate-conversion.js +125 -0
- package/esri-compat/directions.d.ts +45 -0
- package/esri-compat/directions.d.ts.map +1 -0
- package/esri-compat/directions.js +123 -0
- package/esri-compat/editor.d.ts +47 -0
- package/esri-compat/editor.d.ts.map +1 -0
- package/esri-compat/editor.js +170 -0
- package/esri-compat/esri-config.d.ts +16 -0
- package/esri-compat/esri-config.d.ts.map +1 -0
- package/esri-compat/esri-config.js +23 -0
- package/esri-compat/esri-request.d.ts +17 -0
- package/esri-compat/esri-request.d.ts.map +1 -0
- package/esri-compat/esri-request.js +127 -0
- package/esri-compat/event-bus.d.ts +106 -0
- package/esri-compat/event-bus.d.ts.map +1 -0
- package/esri-compat/event-bus.js +90 -0
- package/esri-compat/expand.d.ts +36 -0
- package/esri-compat/expand.d.ts.map +1 -0
- package/esri-compat/expand.js +97 -0
- package/esri-compat/extent.d.ts +43 -0
- package/esri-compat/extent.d.ts.map +1 -0
- package/esri-compat/extent.js +140 -0
- package/esri-compat/feature-filter.d.ts +55 -0
- package/esri-compat/feature-filter.d.ts.map +1 -0
- package/esri-compat/feature-filter.js +109 -0
- package/esri-compat/feature-form.d.ts +64 -0
- package/esri-compat/feature-form.d.ts.map +1 -0
- package/esri-compat/feature-form.js +137 -0
- package/esri-compat/feature-layer.d.ts +173 -0
- package/esri-compat/feature-layer.d.ts.map +1 -0
- package/esri-compat/feature-layer.js +661 -0
- package/esri-compat/feature-set.d.ts +32 -0
- package/esri-compat/feature-set.d.ts.map +1 -0
- package/esri-compat/feature-set.js +80 -0
- package/esri-compat/feature-table.d.ts +141 -0
- package/esri-compat/feature-table.d.ts.map +1 -0
- package/esri-compat/feature-table.js +500 -0
- package/esri-compat/feature-templates.d.ts +41 -0
- package/esri-compat/feature-templates.d.ts.map +1 -0
- package/esri-compat/feature-templates.js +97 -0
- package/esri-compat/feature.d.ts +33 -0
- package/esri-compat/feature.d.ts.map +1 -0
- package/esri-compat/feature.js +83 -0
- package/esri-compat/geojson-layer.d.ts +86 -0
- package/esri-compat/geojson-layer.d.ts.map +1 -0
- package/esri-compat/geojson-layer.js +191 -0
- package/esri-compat/geometry-engine.d.ts +107 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -0
- package/esri-compat/geometry-engine.js +266 -0
- package/esri-compat/graphic.d.ts +46 -0
- package/esri-compat/graphic.d.ts.map +1 -0
- package/esri-compat/graphic.js +103 -0
- package/esri-compat/graphics-layer.d.ts +49 -0
- package/esri-compat/graphics-layer.d.ts.map +1 -0
- package/esri-compat/graphics-layer.js +185 -0
- package/esri-compat/group-layer.d.ts +48 -0
- package/esri-compat/group-layer.d.ts.map +1 -0
- package/esri-compat/group-layer.js +212 -0
- package/esri-compat/identify.d.ts +71 -0
- package/esri-compat/identify.d.ts.map +1 -0
- package/esri-compat/identify.js +299 -0
- package/esri-compat/identity-manager.d.ts +74 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +245 -0
- package/esri-compat/imagery-layer.d.ts +78 -0
- package/esri-compat/imagery-layer.d.ts.map +1 -0
- package/esri-compat/imagery-layer.js +167 -0
- package/esri-compat/label-class.d.ts +31 -0
- package/esri-compat/label-class.d.ts.map +1 -0
- package/esri-compat/label-class.js +102 -0
- package/esri-compat/layer-list.d.ts +77 -0
- package/esri-compat/layer-list.d.ts.map +1 -0
- package/esri-compat/layer-list.js +342 -0
- package/esri-compat/legend.d.ts +53 -0
- package/esri-compat/legend.d.ts.map +1 -0
- package/esri-compat/legend.js +254 -0
- package/esri-compat/map-image-layer.d.ts +162 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -0
- package/esri-compat/map-image-layer.js +709 -0
- package/esri-compat/map-view.d.ts +323 -0
- package/esri-compat/map-view.d.ts.map +1 -0
- package/esri-compat/map-view.js +1175 -0
- package/esri-compat/map.d.ts +47 -0
- package/esri-compat/map.d.ts.map +1 -0
- package/esri-compat/map.js +209 -0
- package/esri-compat/measurement-2d.d.ts +61 -0
- package/esri-compat/measurement-2d.d.ts.map +1 -0
- package/esri-compat/measurement-2d.js +184 -0
- package/esri-compat/measurement.d.ts +45 -0
- package/esri-compat/measurement.d.ts.map +1 -0
- package/esri-compat/measurement.js +193 -0
- package/esri-compat/oauth-info.d.ts +50 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +142 -0
- package/esri-compat/picture-marker-symbol.d.ts +35 -0
- package/esri-compat/picture-marker-symbol.d.ts.map +1 -0
- package/esri-compat/picture-marker-symbol.js +126 -0
- package/esri-compat/point.d.ts +31 -0
- package/esri-compat/point.d.ts.map +1 -0
- package/esri-compat/point.js +102 -0
- package/esri-compat/polygon.d.ts +31 -0
- package/esri-compat/polygon.d.ts.map +1 -0
- package/esri-compat/polygon.js +107 -0
- package/esri-compat/polyline.d.ts +31 -0
- package/esri-compat/polyline.d.ts.map +1 -0
- package/esri-compat/polyline.js +107 -0
- package/esri-compat/popup-template.d.ts +55 -0
- package/esri-compat/popup-template.d.ts.map +1 -0
- package/esri-compat/popup-template.js +128 -0
- package/esri-compat/popup.d.ts +54 -0
- package/esri-compat/popup.d.ts.map +1 -0
- package/esri-compat/popup.js +312 -0
- package/esri-compat/print.d.ts +47 -0
- package/esri-compat/print.d.ts.map +1 -0
- package/esri-compat/print.js +105 -0
- package/esri-compat/query.d.ts +58 -0
- package/esri-compat/query.d.ts.map +1 -0
- package/esri-compat/query.js +128 -0
- package/esri-compat/reactive-utils.d.ts +24 -0
- package/esri-compat/reactive-utils.d.ts.map +1 -0
- package/esri-compat/reactive-utils.js +193 -0
- package/esri-compat/request.d.ts +41 -0
- package/esri-compat/request.d.ts.map +1 -0
- package/esri-compat/request.js +253 -0
- package/esri-compat/route-layer.d.ts +59 -0
- package/esri-compat/route-layer.d.ts.map +1 -0
- package/esri-compat/route-layer.js +223 -0
- package/esri-compat/route-task.d.ts +88 -0
- package/esri-compat/route-task.d.ts.map +1 -0
- package/esri-compat/route-task.js +225 -0
- package/esri-compat/scene-view.d.ts +41 -0
- package/esri-compat/scene-view.d.ts.map +1 -0
- package/esri-compat/scene-view.js +68 -0
- package/esri-compat/search.d.ts +112 -0
- package/esri-compat/search.d.ts.map +1 -0
- package/esri-compat/search.js +820 -0
- package/esri-compat/simple-fill-symbol.d.ts +27 -0
- package/esri-compat/simple-fill-symbol.d.ts.map +1 -0
- package/esri-compat/simple-fill-symbol.js +85 -0
- package/esri-compat/simple-line-symbol.d.ts +27 -0
- package/esri-compat/simple-line-symbol.d.ts.map +1 -0
- package/esri-compat/simple-line-symbol.js +85 -0
- package/esri-compat/simple-marker-symbol.d.ts +29 -0
- package/esri-compat/simple-marker-symbol.d.ts.map +1 -0
- package/esri-compat/simple-marker-symbol.js +92 -0
- package/esri-compat/simple-renderer.d.ts +29 -0
- package/esri-compat/simple-renderer.d.ts.map +1 -0
- package/esri-compat/simple-renderer.js +92 -0
- package/esri-compat/sketch.d.ts +64 -0
- package/esri-compat/sketch.d.ts.map +1 -0
- package/esri-compat/sketch.js +227 -0
- package/esri-compat/spatial-reference.d.ts +31 -0
- package/esri-compat/spatial-reference.d.ts.map +1 -0
- package/esri-compat/spatial-reference.js +102 -0
- package/esri-compat/swipe.d.ts +34 -0
- package/esri-compat/swipe.d.ts.map +1 -0
- package/esri-compat/swipe.js +93 -0
- package/esri-compat/table-list.d.ts +36 -0
- package/esri-compat/table-list.d.ts.map +1 -0
- package/esri-compat/table-list.js +126 -0
- package/esri-compat/text-symbol.d.ts +37 -0
- package/esri-compat/text-symbol.d.ts.map +1 -0
- package/esri-compat/text-symbol.js +123 -0
- package/esri-compat/tile-layer.d.ts +52 -0
- package/esri-compat/tile-layer.d.ts.map +1 -0
- package/esri-compat/tile-layer.js +168 -0
- package/esri-compat/time-slider.d.ts +70 -0
- package/esri-compat/time-slider.d.ts.map +1 -0
- package/esri-compat/time-slider.js +208 -0
- package/esri-compat/track.d.ts +51 -0
- package/esri-compat/track.d.ts.map +1 -0
- package/esri-compat/track.js +174 -0
- package/esri-compat/unique-value-renderer.d.ts +41 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -0
- package/esri-compat/unique-value-renderer.js +127 -0
- package/esri-compat/url.d.ts +13 -0
- package/esri-compat/url.d.ts.map +1 -0
- package/esri-compat/url.js +68 -0
- package/esri-compat/vector-tile-layer.d.ts +47 -0
- package/esri-compat/vector-tile-layer.d.ts.map +1 -0
- package/esri-compat/vector-tile-layer.js +130 -0
- package/esri-compat/web-map.d.ts +14 -0
- package/esri-compat/web-map.d.ts.map +1 -0
- package/esri-compat/web-map.js +24 -0
- package/esri-compat/wfs-layer.d.ts +64 -0
- package/esri-compat/wfs-layer.d.ts.map +1 -0
- package/esri-compat/wfs-layer.js +145 -0
- package/esri-compat/wms-layer.d.ts +76 -0
- package/esri-compat/wms-layer.d.ts.map +1 -0
- package/esri-compat/wms-layer.js +157 -0
- package/exploration/context.d.ts +25 -0
- package/exploration/context.d.ts.map +1 -0
- package/exploration/context.js +396 -0
- package/exploration/index.d.ts +27 -0
- package/exploration/index.d.ts.map +1 -0
- package/exploration/index.js +24 -0
- package/exploration/presets.d.ts +27 -0
- package/exploration/presets.d.ts.map +1 -0
- package/exploration/presets.js +114 -0
- package/exploration/reducer.d.ts +23 -0
- package/exploration/reducer.d.ts.map +1 -0
- package/exploration/reducer.js +332 -0
- package/exploration/selection.d.ts +25 -0
- package/exploration/selection.d.ts.map +1 -0
- package/exploration/selection.js +34 -0
- package/exploration/selectors.d.ts +56 -0
- package/exploration/selectors.d.ts.map +1 -0
- package/exploration/selectors.js +110 -0
- package/exploration/types.d.ts +294 -0
- package/exploration/types.d.ts.map +1 -0
- package/exploration/types.js +33 -0
- package/expr/expression.d.ts +457 -0
- package/expr/expression.d.ts.map +1 -0
- package/expr/expression.js +663 -0
- package/expr/index.d.ts +32 -0
- package/expr/index.d.ts.map +1 -0
- package/expr/index.js +30 -0
- package/filter-registry/index.d.ts +145 -0
- package/filter-registry/index.d.ts.map +1 -0
- package/filter-registry/index.js +531 -0
- package/gen/honua/v1/feature_service_pb.d.ts +918 -0
- package/gen/honua/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/honua/v1/feature_service_pb.js +375 -0
- package/generated-app/errors.d.ts +41 -0
- package/generated-app/errors.d.ts.map +1 -0
- package/generated-app/errors.js +41 -0
- package/generated-app/index.d.ts +17 -0
- package/generated-app/index.d.ts.map +1 -0
- package/generated-app/index.js +12 -0
- package/generated-app/manifest.d.ts +183 -0
- package/generated-app/manifest.d.ts.map +1 -0
- package/generated-app/manifest.js +14 -0
- package/generated-app/projection.d.ts +44 -0
- package/generated-app/projection.d.ts.map +1 -0
- package/generated-app/projection.js +234 -0
- package/generated-app/runtime.d.ts +215 -0
- package/generated-app/runtime.d.ts.map +1 -0
- package/generated-app/runtime.js +1196 -0
- package/geocoding/index.d.ts +106 -0
- package/geocoding/index.d.ts.map +1 -0
- package/geocoding/index.js +278 -0
- package/interactions/detail-model.d.ts +54 -0
- package/interactions/detail-model.d.ts.map +1 -0
- package/interactions/detail-model.js +105 -0
- package/interactions/exploration-bindings.d.ts +120 -0
- package/interactions/exploration-bindings.d.ts.map +1 -0
- package/interactions/exploration-bindings.js +218 -0
- package/interactions/feature-state.d.ts +144 -0
- package/interactions/feature-state.d.ts.map +1 -0
- package/interactions/feature-state.js +169 -0
- package/interactions/hit-test.d.ts +112 -0
- package/interactions/hit-test.d.ts.map +1 -0
- package/interactions/hit-test.js +291 -0
- package/interactions/index.d.ts +31 -0
- package/interactions/index.d.ts.map +1 -0
- package/interactions/index.js +24 -0
- package/interactions/share-state.d.ts +36 -0
- package/interactions/share-state.d.ts.map +1 -0
- package/interactions/share-state.js +123 -0
- package/map/feature-service-adapter.d.ts +138 -0
- package/map/feature-service-adapter.d.ts.map +1 -0
- package/map/feature-service-adapter.js +279 -0
- package/map/honua-map.d.ts +203 -0
- package/map/honua-map.d.ts.map +1 -0
- package/map/honua-map.js +347 -0
- package/map/index.d.ts +27 -0
- package/map/index.d.ts.map +1 -0
- package/map/index.js +22 -0
- package/map/maplibre-target.d.ts +103 -0
- package/map/maplibre-target.d.ts.map +1 -0
- package/map/maplibre-target.js +164 -0
- package/map/webmap-maplibre.d.ts +60 -0
- package/map/webmap-maplibre.d.ts.map +1 -0
- package/map/webmap-maplibre.js +212 -0
- package/operate/client.d.ts +94 -0
- package/operate/client.d.ts.map +1 -0
- package/operate/client.js +361 -0
- package/operate/index.d.ts +22 -0
- package/operate/index.d.ts.map +1 -0
- package/operate/index.js +19 -0
- package/operate/types.d.ts +397 -0
- package/operate/types.d.ts.map +1 -0
- package/operate/types.js +17 -0
- package/operator/client.d.ts +60 -0
- package/operator/client.d.ts.map +1 -0
- package/operator/client.js +20 -0
- package/operator/controllers/approval.d.ts +52 -0
- package/operator/controllers/approval.d.ts.map +1 -0
- package/operator/controllers/approval.js +123 -0
- package/operator/controllers/base.d.ts +27 -0
- package/operator/controllers/base.d.ts.map +1 -0
- package/operator/controllers/base.js +53 -0
- package/operator/controllers/builder-workspace.d.ts +55 -0
- package/operator/controllers/builder-workspace.d.ts.map +1 -0
- package/operator/controllers/builder-workspace.js +108 -0
- package/operator/controllers/chat.d.ts +61 -0
- package/operator/controllers/chat.d.ts.map +1 -0
- package/operator/controllers/chat.js +154 -0
- package/operator/controllers/clarification.d.ts +52 -0
- package/operator/controllers/clarification.d.ts.map +1 -0
- package/operator/controllers/clarification.js +121 -0
- package/operator/controllers/execution.d.ts +60 -0
- package/operator/controllers/execution.d.ts.map +1 -0
- package/operator/controllers/execution.js +286 -0
- package/operator/controllers/index.d.ts +23 -0
- package/operator/controllers/index.d.ts.map +1 -0
- package/operator/controllers/index.js +15 -0
- package/operator/controllers/map-workspace.d.ts +85 -0
- package/operator/controllers/map-workspace.d.ts.map +1 -0
- package/operator/controllers/map-workspace.js +296 -0
- package/operator/controllers/plan-review.d.ts +66 -0
- package/operator/controllers/plan-review.d.ts.map +1 -0
- package/operator/controllers/plan-review.js +124 -0
- package/operator/errors.d.ts +62 -0
- package/operator/errors.d.ts.map +1 -0
- package/operator/errors.js +75 -0
- package/operator/i18n/index.d.ts +10 -0
- package/operator/i18n/index.d.ts.map +1 -0
- package/operator/i18n/index.js +8 -0
- package/operator/i18n/messages.d.ts +19 -0
- package/operator/i18n/messages.d.ts.map +1 -0
- package/operator/i18n/messages.js +54 -0
- package/operator/index.d.ts +19 -0
- package/operator/index.d.ts.map +1 -0
- package/operator/index.js +15 -0
- package/operator/telemetry.d.ts +26 -0
- package/operator/telemetry.d.ts.map +1 -0
- package/operator/telemetry.js +9 -0
- package/operator/theming/index.d.ts +12 -0
- package/operator/theming/index.d.ts.map +1 -0
- package/operator/theming/index.js +9 -0
- package/operator/theming/provider.d.ts +27 -0
- package/operator/theming/provider.d.ts.map +1 -0
- package/operator/theming/provider.js +26 -0
- package/operator/theming/tokens.d.ts +28 -0
- package/operator/theming/tokens.d.ts.map +1 -0
- package/operator/theming/tokens.js +65 -0
- package/operator/workspace/events.d.ts +70 -0
- package/operator/workspace/events.d.ts.map +1 -0
- package/operator/workspace/events.js +9 -0
- package/operator/workspace/index.d.ts +12 -0
- package/operator/workspace/index.d.ts.map +1 -0
- package/operator/workspace/index.js +8 -0
- package/operator/workspace/types.d.ts +178 -0
- package/operator/workspace/types.d.ts.map +1 -0
- package/operator/workspace/types.js +47 -0
- package/operator/workspace/workspace.d.ts +58 -0
- package/operator/workspace/workspace.d.ts.map +1 -0
- package/operator/workspace/workspace.js +339 -0
- package/package.json +105 -0
- package/realtime/exploration.d.ts +16 -0
- package/realtime/exploration.d.ts.map +1 -0
- package/realtime/exploration.js +32 -0
- package/realtime/honua-server.d.ts +123 -0
- package/realtime/honua-server.d.ts.map +1 -0
- package/realtime/honua-server.js +188 -0
- package/realtime/index.d.ts +20 -0
- package/realtime/index.d.ts.map +1 -0
- package/realtime/index.js +14 -0
- package/realtime/projections.d.ts +30 -0
- package/realtime/projections.d.ts.map +1 -0
- package/realtime/projections.js +51 -0
- package/realtime/reducer.d.ts +14 -0
- package/realtime/reducer.d.ts.map +1 -0
- package/realtime/reducer.js +351 -0
- package/realtime/sse.d.ts +23 -0
- package/realtime/sse.d.ts.map +1 -0
- package/realtime/sse.js +143 -0
- package/realtime/store.d.ts +18 -0
- package/realtime/store.d.ts.map +1 -0
- package/realtime/store.js +63 -0
- package/realtime/types.d.ts +190 -0
- package/realtime/types.d.ts.map +1 -0
- package/realtime/types.js +10 -0
- package/replica-sync/client.d.ts +32 -0
- package/replica-sync/client.d.ts.map +1 -0
- package/replica-sync/client.js +52 -0
- package/replica-sync/errors.d.ts +22 -0
- package/replica-sync/errors.d.ts.map +1 -0
- package/replica-sync/errors.js +29 -0
- package/replica-sync/fixture.d.ts +40 -0
- package/replica-sync/fixture.d.ts.map +1 -0
- package/replica-sync/fixture.js +364 -0
- package/replica-sync/index.d.ts +22 -0
- package/replica-sync/index.d.ts.map +1 -0
- package/replica-sync/index.js +17 -0
- package/replica-sync/types.d.ts +270 -0
- package/replica-sync/types.d.ts.map +1 -0
- package/replica-sync/types.js +13 -0
- package/runtime/diff.d.ts +31 -0
- package/runtime/diff.d.ts.map +1 -0
- package/runtime/diff.js +143 -0
- package/runtime/errors.d.ts +40 -0
- package/runtime/errors.d.ts.map +1 -0
- package/runtime/errors.js +35 -0
- package/runtime/index.d.ts +59 -0
- package/runtime/index.d.ts.map +1 -0
- package/runtime/index.js +40 -0
- package/runtime/legend.d.ts +23 -0
- package/runtime/legend.d.ts.map +1 -0
- package/runtime/legend.js +38 -0
- package/runtime/load-package.d.ts +125 -0
- package/runtime/load-package.d.ts.map +1 -0
- package/runtime/load-package.js +272 -0
- package/runtime/map-package-fetch.d.ts +107 -0
- package/runtime/map-package-fetch.d.ts.map +1 -0
- package/runtime/map-package-fetch.js +336 -0
- package/runtime/map-package-realtime.d.ts +169 -0
- package/runtime/map-package-realtime.d.ts.map +1 -0
- package/runtime/map-package-realtime.js +350 -0
- package/runtime/map-package-validation.d.ts +30 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +257 -0
- package/runtime/map-package-watch.d.ts +78 -0
- package/runtime/map-package-watch.d.ts.map +1 -0
- package/runtime/map-package-watch.js +695 -0
- package/runtime/map-package.d.ts +167 -0
- package/runtime/map-package.d.ts.map +1 -0
- package/runtime/map-package.js +15 -0
- package/runtime/ogc-styles.d.ts +110 -0
- package/runtime/ogc-styles.d.ts.map +1 -0
- package/runtime/ogc-styles.js +195 -0
- package/runtime/pmtiles-protocol.d.ts +77 -0
- package/runtime/pmtiles-protocol.d.ts.map +1 -0
- package/runtime/pmtiles-protocol.js +120 -0
- package/runtime/popups.d.ts +62 -0
- package/runtime/popups.d.ts.map +1 -0
- package/runtime/popups.js +95 -0
- package/runtime/query-tiles.d.ts +217 -0
- package/runtime/query-tiles.d.ts.map +1 -0
- package/runtime/query-tiles.js +801 -0
- package/runtime/runtime.d.ts +243 -0
- package/runtime/runtime.d.ts.map +1 -0
- package/runtime/runtime.js +1147 -0
- package/runtime/source-bridge.d.ts +99 -0
- package/runtime/source-bridge.d.ts.map +1 -0
- package/runtime/source-bridge.js +428 -0
- package/runtime/style-compose.d.ts +46 -0
- package/runtime/style-compose.d.ts.map +1 -0
- package/runtime/style-compose.js +144 -0
- package/runtime/style-interactions.d.ts +141 -0
- package/runtime/style-interactions.d.ts.map +1 -0
- package/runtime/style-interactions.js +574 -0
- package/runtime/style-spec-validation.d.ts +23 -0
- package/runtime/style-spec-validation.d.ts.map +1 -0
- package/runtime/style-spec-validation.js +357 -0
- package/scene-workspace/analysis-widgets.d.ts +334 -0
- package/scene-workspace/analysis-widgets.d.ts.map +1 -0
- package/scene-workspace/analysis-widgets.js +424 -0
- package/scene-workspace/cesium-adapter.d.ts +438 -0
- package/scene-workspace/cesium-adapter.d.ts.map +1 -0
- package/scene-workspace/cesium-adapter.js +493 -0
- package/scene-workspace/index.d.ts +21 -0
- package/scene-workspace/index.d.ts.map +1 -0
- package/scene-workspace/index.js +14 -0
- package/scene-workspace/primitives.d.ts +162 -0
- package/scene-workspace/primitives.d.ts.map +1 -0
- package/scene-workspace/primitives.js +255 -0
- package/scene-workspace/scene-discovery.d.ts +196 -0
- package/scene-workspace/scene-discovery.d.ts.map +1 -0
- package/scene-workspace/scene-discovery.js +228 -0
- package/scene-workspace/scene-view.d.ts +209 -0
- package/scene-workspace/scene-view.d.ts.map +1 -0
- package/scene-workspace/scene-view.js +267 -0
- package/scene-workspace/types.d.ts +229 -0
- package/scene-workspace/types.d.ts.map +1 -0
- package/scene-workspace/types.js +23 -0
- package/scene-workspace/workspace.d.ts +13 -0
- package/scene-workspace/workspace.d.ts.map +1 -0
- package/scene-workspace/workspace.js +391 -0
- package/share/denial.d.ts +78 -0
- package/share/denial.d.ts.map +1 -0
- package/share/denial.js +61 -0
- package/share/embed-token.d.ts +71 -0
- package/share/embed-token.d.ts.map +1 -0
- package/share/embed-token.js +99 -0
- package/share/index.d.ts +35 -0
- package/share/index.d.ts.map +1 -0
- package/share/index.js +30 -0
- package/share/open-data.d.ts +114 -0
- package/share/open-data.d.ts.map +1 -0
- package/share/open-data.js +81 -0
- package/share/types.d.ts +163 -0
- package/share/types.d.ts.map +1 -0
- package/share/types.js +17 -0
- package/studio/capability-manifest.d.ts +285 -0
- package/studio/capability-manifest.d.ts.map +1 -0
- package/studio/capability-manifest.js +59 -0
- package/studio/chart-spec.d.ts +85 -0
- package/studio/chart-spec.d.ts.map +1 -0
- package/studio/chart-spec.js +106 -0
- package/studio/index.d.ts +34 -0
- package/studio/index.d.ts.map +1 -0
- package/studio/index.js +27 -0
- package/studio/provenance.d.ts +131 -0
- package/studio/provenance.d.ts.map +1 -0
- package/studio/provenance.js +39 -0
- package/studio/publish.d.ts +64 -0
- package/studio/publish.d.ts.map +1 -0
- package/studio/publish.js +13 -0
- package/studio/types.d.ts +278 -0
- package/studio/types.d.ts.map +1 -0
- package/studio/types.js +71 -0
- package/studio/validate.d.ts +45 -0
- package/studio/validate.d.ts.map +1 -0
- package/studio/validate.js +255 -0
- package/studio/validation.d.ts +112 -0
- package/studio/validation.d.ts.map +1 -0
- package/studio/validation.js +42 -0
- package/style/factory.d.ts +30 -0
- package/style/factory.d.ts.map +1 -0
- package/style/factory.js +61 -0
- package/style/index.d.ts +25 -0
- package/style/index.d.ts.map +1 -0
- package/style/index.js +24 -0
- package/style/specification.d.ts +203 -0
- package/style/specification.d.ts.map +1 -0
- package/style/specification.js +178 -0
- package/style/wms-wmts-resolvers.d.ts +38 -0
- package/style/wms-wmts-resolvers.d.ts.map +1 -0
- package/style/wms-wmts-resolvers.js +92 -0
- package/web-components/controller.d.ts +39 -0
- package/web-components/controller.d.ts.map +1 -0
- package/web-components/controller.js +640 -0
- package/web-components/elements.d.ts +210 -0
- package/web-components/elements.d.ts.map +1 -0
- package/web-components/elements.js +1651 -0
- package/web-components/index.d.ts +24 -0
- package/web-components/index.d.ts.map +1 -0
- package/web-components/index.js +22 -0
- package/web-components/maplibre-renderer.d.ts +22 -0
- package/web-components/maplibre-renderer.d.ts.map +1 -0
- package/web-components/maplibre-renderer.js +474 -0
- package/web-components/types.d.ts +397 -0
- package/web-components/types.d.ts.map +1 -0
- package/web-components/types.js +1 -0
- package/webmap/contract.d.ts +28 -0
- package/webmap/contract.d.ts.map +1 -0
- package/webmap/contract.js +130 -0
- package/webmap/convert-basemap.d.ts +17 -0
- package/webmap/convert-basemap.d.ts.map +1 -0
- package/webmap/convert-basemap.js +78 -0
- package/webmap/convert-extent.d.ts +17 -0
- package/webmap/convert-extent.d.ts.map +1 -0
- package/webmap/convert-extent.js +114 -0
- package/webmap/convert-label.d.ts +13 -0
- package/webmap/convert-label.d.ts.map +1 -0
- package/webmap/convert-label.js +125 -0
- package/webmap/convert-layer.d.ts +22 -0
- package/webmap/convert-layer.d.ts.map +1 -0
- package/webmap/convert-layer.js +181 -0
- package/webmap/convert-popup.d.ts +34 -0
- package/webmap/convert-popup.d.ts.map +1 -0
- package/webmap/convert-popup.js +68 -0
- package/webmap/convert-renderer.d.ts +17 -0
- package/webmap/convert-renderer.d.ts.map +1 -0
- package/webmap/convert-renderer.js +161 -0
- package/webmap/convert-symbol.d.ts +17 -0
- package/webmap/convert-symbol.d.ts.map +1 -0
- package/webmap/convert-symbol.js +122 -0
- package/webmap/index.d.ts +44 -0
- package/webmap/index.d.ts.map +1 -0
- package/webmap/index.js +33 -0
- package/webmap/parse.d.ts +25 -0
- package/webmap/parse.d.ts.map +1 -0
- package/webmap/parse.js +83 -0
- package/webmap/types.d.ts +264 -0
- package/webmap/types.d.ts.map +1 -0
- package/webmap/types.js +13 -0
- package/webmap/warnings.d.ts +30 -0
- package/webmap/warnings.d.ts.map +1 -0
- package/webmap/warnings.js +37 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static STAC catalog reader.
|
|
3
|
+
*
|
|
4
|
+
* A large share of public STAC catalogs are not API servers — they are
|
|
5
|
+
* static `catalog.json` / `collection.json` / item trees served from object
|
|
6
|
+
* storage, with no `/search` endpoint. This reader walks such a tree the
|
|
7
|
+
* spec-driven way: it follows `rel="child"` links to descend catalogs /
|
|
8
|
+
* collections and `rel="item"` links to reach STAC Items, resolving every
|
|
9
|
+
* href against the document it was found in (STAC best-practice relative
|
|
10
|
+
* links). Filtering (`collections` / `bbox` / `datetime` / `limit`) is
|
|
11
|
+
* applied client-side and the result is projected onto the same
|
|
12
|
+
* {@link HonuaStacItemCollectionResponse} envelope the STAC API search path
|
|
13
|
+
* returns, so the canonical `Source` surface is identical across both
|
|
14
|
+
* layouts.
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import { HonuaCapabilityNotSupportedError } from "./errors.js";
|
|
19
|
+
/** Guardrails so a malformed / cyclic catalog cannot fan out unbounded. */
|
|
20
|
+
const MAX_DOCUMENTS = 500;
|
|
21
|
+
const DEFAULT_ITEM_CAP = 1000;
|
|
22
|
+
/**
|
|
23
|
+
* Reader bound to the URL of a static STAC catalog / collection root. The
|
|
24
|
+
* URL is the client baseUrl (the transport resolves same-origin absolute
|
|
25
|
+
* child/item hrefs directly), so `rootUrl` is normally `""` (the baseUrl
|
|
26
|
+
* itself) but may be an absolute `catalog.json` URL.
|
|
27
|
+
*/
|
|
28
|
+
export class HonuaStacStaticCatalog {
|
|
29
|
+
client;
|
|
30
|
+
rootUrl;
|
|
31
|
+
constructor(client, rootUrl = "") {
|
|
32
|
+
this.client = client;
|
|
33
|
+
this.rootUrl = rootUrl;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Traverse the catalog tree, collect matching items, and return them in
|
|
37
|
+
* the STAC search envelope shape.
|
|
38
|
+
*/
|
|
39
|
+
async search(params = {}) {
|
|
40
|
+
const items = await this.collectItems(params);
|
|
41
|
+
const filtered = items.filter((item) => matchesFilters(item, params));
|
|
42
|
+
const cap = typeof params.limit === "number" && params.limit >= 0 ? params.limit : filtered.length;
|
|
43
|
+
const sliced = filtered.slice(0, cap);
|
|
44
|
+
return {
|
|
45
|
+
type: "FeatureCollection",
|
|
46
|
+
features: sliced,
|
|
47
|
+
numberReturned: sliced.length,
|
|
48
|
+
numberMatched: filtered.length,
|
|
49
|
+
links: [],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async fetchDoc(url, signal) {
|
|
53
|
+
// An empty seed root means "the client baseUrl is the catalog document".
|
|
54
|
+
const path = url === "" ? this.client.serverBaseUrl : url;
|
|
55
|
+
return this.client.pipelineRequestJson("GET", path, undefined, signal);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Breadth-first walk collecting item documents. Descends `rel="child"`
|
|
59
|
+
* links; a `collections` filter prunes Collection subtrees whose `id`
|
|
60
|
+
* is not requested. Bounded by {@link MAX_DOCUMENTS} and the item cap.
|
|
61
|
+
*/
|
|
62
|
+
async collectItems(params) {
|
|
63
|
+
const itemCap = typeof params.limit === "number" && params.limit >= 0 ? Math.max(params.limit, 1) : DEFAULT_ITEM_CAP;
|
|
64
|
+
const wantedCollections = params.collections ? new Set(params.collections) : undefined;
|
|
65
|
+
const visited = new Set();
|
|
66
|
+
const queue = [this.rootUrl];
|
|
67
|
+
const itemUrls = [];
|
|
68
|
+
let docCount = 0;
|
|
69
|
+
while (queue.length > 0 && docCount < MAX_DOCUMENTS) {
|
|
70
|
+
const url = queue.shift();
|
|
71
|
+
if (url === undefined || visited.has(url))
|
|
72
|
+
continue;
|
|
73
|
+
visited.add(url);
|
|
74
|
+
docCount += 1;
|
|
75
|
+
let doc;
|
|
76
|
+
try {
|
|
77
|
+
doc = await this.fetchDoc(url, params.signal);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
if (url === this.rootUrl) {
|
|
81
|
+
throw new HonuaCapabilityNotSupportedError("query", "stac", `static catalog root ${url || "(baseUrl)"} could not be read: ${err instanceof Error ? err.message : String(err)}`);
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
// A Collection subtree not in the requested set is pruned entirely.
|
|
86
|
+
if (wantedCollections &&
|
|
87
|
+
doc.type === "Collection" &&
|
|
88
|
+
typeof doc.id === "string" &&
|
|
89
|
+
!wantedCollections.has(doc.id)) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const base = absoluteBaseFor(url, this.client.serverBaseUrl);
|
|
93
|
+
for (const link of doc.links ?? []) {
|
|
94
|
+
if (typeof link.href !== "string")
|
|
95
|
+
continue;
|
|
96
|
+
const rel = (link.rel ?? "").toLowerCase();
|
|
97
|
+
const resolved = resolveHref(link.href, base);
|
|
98
|
+
if (rel === "child") {
|
|
99
|
+
if (!visited.has(resolved))
|
|
100
|
+
queue.push(resolved);
|
|
101
|
+
}
|
|
102
|
+
else if (rel === "item" || rel === "items") {
|
|
103
|
+
itemUrls.push(resolved);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const items = [];
|
|
108
|
+
for (const itemUrl of itemUrls) {
|
|
109
|
+
if (items.length >= itemCap)
|
|
110
|
+
break;
|
|
111
|
+
try {
|
|
112
|
+
const item = (await this.fetchDoc(itemUrl, params.signal));
|
|
113
|
+
if (item && item.type === "Feature")
|
|
114
|
+
items.push(item);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// Skip an unreadable item; the traversal is best-effort per item.
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return items;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The base URL a document's relative links resolve against. When the reader
|
|
125
|
+
* was seeded with a bare `""` root (the client baseUrl IS the catalog), use
|
|
126
|
+
* the client's server base URL so `./child.json` resolves correctly.
|
|
127
|
+
*/
|
|
128
|
+
function absoluteBaseFor(docUrl, serverBaseUrl) {
|
|
129
|
+
if (docUrl === "")
|
|
130
|
+
return serverBaseUrl;
|
|
131
|
+
if (/^https?:\/\//i.test(docUrl))
|
|
132
|
+
return docUrl;
|
|
133
|
+
const root = serverBaseUrl.endsWith("/") ? serverBaseUrl : `${serverBaseUrl}/`;
|
|
134
|
+
try {
|
|
135
|
+
return new URL(docUrl, root).toString();
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return serverBaseUrl;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function resolveHref(href, base) {
|
|
142
|
+
if (/^https?:\/\//i.test(href))
|
|
143
|
+
return href;
|
|
144
|
+
try {
|
|
145
|
+
return new URL(href, base).toString();
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return href;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function matchesFilters(item, params) {
|
|
152
|
+
const doc = item;
|
|
153
|
+
if (params.collections && params.collections.length > 0) {
|
|
154
|
+
if (typeof doc.collection !== "string" || !params.collections.includes(doc.collection))
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
if (params.bbox && Array.isArray(doc.bbox) && doc.bbox.length >= 4) {
|
|
158
|
+
if (!bboxIntersects(params.bbox, doc.bbox))
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
if (params.datetime) {
|
|
162
|
+
if (!datetimeMatches(params.datetime, doc))
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
function bboxIntersects(a, b) {
|
|
168
|
+
// 2D envelope intersection; ignores any z components.
|
|
169
|
+
const [axmin, aymin, axmax, aymax] = a;
|
|
170
|
+
const bxmin = b[0];
|
|
171
|
+
const bymin = b[1];
|
|
172
|
+
// A 4- or 6-tuple bbox: max x/y are the second half.
|
|
173
|
+
const bxmax = b.length >= 6 ? b[3] : b[2];
|
|
174
|
+
const bymax = b.length >= 6 ? b[4] : b[3];
|
|
175
|
+
return axmin <= bxmax && axmax >= bxmin && aymin <= bymax && aymax >= bymin;
|
|
176
|
+
}
|
|
177
|
+
function datetimeMatches(query, doc) {
|
|
178
|
+
const dt = doc.properties?.datetime;
|
|
179
|
+
// Closed / open interval query per STAC (`start/end`, `../end`, `start/..`).
|
|
180
|
+
if (query.includes("/")) {
|
|
181
|
+
const [rawStart, rawEnd] = query.split("/");
|
|
182
|
+
const start = rawStart && rawStart !== ".." ? Date.parse(rawStart) : Number.NEGATIVE_INFINITY;
|
|
183
|
+
const end = rawEnd && rawEnd !== ".." ? Date.parse(rawEnd) : Number.POSITIVE_INFINITY;
|
|
184
|
+
const startProp = doc.properties?.start_datetime ?? dt;
|
|
185
|
+
const endProp = doc.properties?.end_datetime ?? dt;
|
|
186
|
+
if (!startProp && !endProp)
|
|
187
|
+
return false;
|
|
188
|
+
const itemStart = startProp ? Date.parse(startProp) : Number.NEGATIVE_INFINITY;
|
|
189
|
+
const itemEnd = endProp ? Date.parse(endProp) : Number.POSITIVE_INFINITY;
|
|
190
|
+
return itemStart <= end && itemEnd >= start;
|
|
191
|
+
}
|
|
192
|
+
if (!dt)
|
|
193
|
+
return false;
|
|
194
|
+
return Date.parse(dt) === Date.parse(query);
|
|
195
|
+
}
|
package/core/stac.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STAC API search surface. STAC builds on OGC API Features, so this
|
|
3
|
+
* class wraps the STAC catalog landing, collections listing, items, and
|
|
4
|
+
* cross-collection search endpoints. The wire calls live on
|
|
5
|
+
* `HonuaClient`; this class is the request-shaping layer on top.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { HonuaClient } from "./client.js";
|
|
10
|
+
import type { HonuaProtocolTransport } from "./protocol-transport.js";
|
|
11
|
+
import type { HonuaOgcCollectionMetadata, HonuaOgcCollectionsResponse, HonuaStacItemCollectionResponse, HonuaStacItemResponse, HonuaStacLandingResponse, OgcCollectionRequest, OgcMetadataRequest, StacSearchRequest } from "./types.js";
|
|
12
|
+
export interface HonuaStacSearchOptions {
|
|
13
|
+
client: HonuaClient;
|
|
14
|
+
/**
|
|
15
|
+
* Path prefix the STAC endpoints are mounted under. Defaults to `/stac`
|
|
16
|
+
* (Honua facade). Pass `""` for a raw STAC API root (e.g. Earth Search
|
|
17
|
+
* served at `.../v1`), so the search / collection paths resolve directly
|
|
18
|
+
* under the client baseUrl.
|
|
19
|
+
*/
|
|
20
|
+
basePath?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface HonuaStacSearchAllRequest extends StacSearchRequest {
|
|
23
|
+
/** Maximum number of items to materialize across pages. */
|
|
24
|
+
pageSize?: number;
|
|
25
|
+
/** Hard cap on the number of pages to fetch (defaults to 100). */
|
|
26
|
+
maxPages?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* STAC API entry point. Discovery (`landing`, `collections`,
|
|
30
|
+
* `collection`) plus search (`search`, `searchAll`, `searchStream`) and
|
|
31
|
+
* item fetch.
|
|
32
|
+
*/
|
|
33
|
+
export declare class HonuaStacSearch {
|
|
34
|
+
readonly client: HonuaClient;
|
|
35
|
+
private readonly basePath;
|
|
36
|
+
constructor(options: HonuaStacSearchOptions);
|
|
37
|
+
/** Inject the configured STAC base path unless the caller already set one. */
|
|
38
|
+
private withBase;
|
|
39
|
+
landing(request?: OgcMetadataRequest): Promise<HonuaStacLandingResponse>;
|
|
40
|
+
collections(request?: OgcMetadataRequest): Promise<HonuaOgcCollectionsResponse>;
|
|
41
|
+
collection(request: OgcCollectionRequest): Promise<HonuaOgcCollectionMetadata>;
|
|
42
|
+
item(request: {
|
|
43
|
+
collectionId: string | number;
|
|
44
|
+
itemId: string | number;
|
|
45
|
+
signal?: AbortSignal;
|
|
46
|
+
responseFormat?: string;
|
|
47
|
+
extraParams?: Record<string, string | number | boolean>;
|
|
48
|
+
stacBasePath?: string;
|
|
49
|
+
}): Promise<HonuaStacItemResponse>;
|
|
50
|
+
search(request?: StacSearchRequest): Promise<HonuaStacItemCollectionResponse>;
|
|
51
|
+
searchAll(request?: HonuaStacSearchAllRequest): Promise<HonuaStacItemResponse[]>;
|
|
52
|
+
searchStream(request?: HonuaStacSearchAllRequest): AsyncGenerator<HonuaStacItemResponse[], void, undefined>;
|
|
53
|
+
}
|
|
54
|
+
export declare function createHonuaStacSearch(client: HonuaClient): HonuaStacSearch;
|
|
55
|
+
export declare function getStacLanding(transport: HonuaProtocolTransport, request?: OgcMetadataRequest): Promise<HonuaStacLandingResponse>;
|
|
56
|
+
export declare function listStacCollections(transport: HonuaProtocolTransport, request?: OgcMetadataRequest): Promise<HonuaOgcCollectionsResponse>;
|
|
57
|
+
export declare function getStacCollection(transport: HonuaProtocolTransport, request: OgcCollectionRequest): Promise<HonuaOgcCollectionMetadata>;
|
|
58
|
+
export declare function getStacItem(transport: HonuaProtocolTransport, request: {
|
|
59
|
+
collectionId: string | number;
|
|
60
|
+
itemId: string | number;
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
responseFormat?: string;
|
|
63
|
+
extraParams?: Record<string, string | number | boolean>;
|
|
64
|
+
stacBasePath?: string;
|
|
65
|
+
}): Promise<HonuaStacItemResponse>;
|
|
66
|
+
export declare function searchStac(transport: HonuaProtocolTransport, request?: StacSearchRequest): Promise<HonuaStacItemCollectionResponse>;
|
|
67
|
+
//# sourceMappingURL=stac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stac.d.ts","sourceRoot":"","sources":["../../../src/core/stac.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,EAC/B,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,WAAW,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAKD;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,SAAgB,MAAM,EAAE,WAAW,CAAC;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;gBAE3B,OAAO,EAAE,sBAAsB;IAKlD,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAKH,OAAO,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI5E,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAInF,UAAU,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAI9E,IAAI,CAAC,OAAO,EAAE;QACzB,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;QAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;QACxD,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIrB,MAAM,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAIjF,SAAS,CAAC,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA2BnF,YAAY,CACxB,OAAO,GAAE,yBAA8B,GACtC,cAAc,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;CAsB5D;AAkCD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,eAAe,CAE1E;AAoBD,wBAAsB,cAAc,CAClC,SAAS,EAAE,sBAAsB,EACjC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,wBAAwB,CAAC,CAQnC;AAED,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,sBAAsB,EACjC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,2BAA2B,CAAC,CAQtC;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,0BAA0B,CAAC,CAQrC;AAED,wBAAsB,WAAW,CAC/B,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE;IACP,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC,qBAAqB,CAAC,CAOhC;AAED,wBAAsB,UAAU,CAC9B,SAAS,EAAE,sBAAsB,EACjC,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,+BAA+B,CAAC,CAoB1C"}
|
package/core/stac.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STAC API search surface. STAC builds on OGC API Features, so this
|
|
3
|
+
* class wraps the STAC catalog landing, collections listing, items, and
|
|
4
|
+
* cross-collection search endpoints. The wire calls live on
|
|
5
|
+
* `HonuaClient`; this class is the request-shaping layer on top.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { createOgcMetadataParams, mergeHeaders } from "./wire-shared.js";
|
|
10
|
+
const DEFAULT_STAC_PAGE_SIZE = 100;
|
|
11
|
+
const DEFAULT_STAC_MAX_PAGES = 100;
|
|
12
|
+
/**
|
|
13
|
+
* STAC API entry point. Discovery (`landing`, `collections`,
|
|
14
|
+
* `collection`) plus search (`search`, `searchAll`, `searchStream`) and
|
|
15
|
+
* item fetch.
|
|
16
|
+
*/
|
|
17
|
+
export class HonuaStacSearch {
|
|
18
|
+
client;
|
|
19
|
+
basePath;
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.client = options.client;
|
|
22
|
+
this.basePath = options.basePath;
|
|
23
|
+
}
|
|
24
|
+
/** Inject the configured STAC base path unless the caller already set one. */
|
|
25
|
+
withBase(request) {
|
|
26
|
+
if (this.basePath === undefined || request.stacBasePath !== undefined)
|
|
27
|
+
return request;
|
|
28
|
+
return { ...request, stacBasePath: this.basePath };
|
|
29
|
+
}
|
|
30
|
+
async landing(request = {}) {
|
|
31
|
+
return this.client.getStacLanding(this.withBase(request));
|
|
32
|
+
}
|
|
33
|
+
async collections(request = {}) {
|
|
34
|
+
return this.client.listStacCollections(this.withBase(request));
|
|
35
|
+
}
|
|
36
|
+
async collection(request) {
|
|
37
|
+
return this.client.getStacCollection(this.withBase(request));
|
|
38
|
+
}
|
|
39
|
+
async item(request) {
|
|
40
|
+
return this.client.getStacItem(this.withBase(request));
|
|
41
|
+
}
|
|
42
|
+
async search(request = {}) {
|
|
43
|
+
return this.client.searchStac(this.withBase(request));
|
|
44
|
+
}
|
|
45
|
+
async searchAll(request = {}) {
|
|
46
|
+
const pageSize = request.pageSize ?? request.limit ?? DEFAULT_STAC_PAGE_SIZE;
|
|
47
|
+
const maxPages = request.maxPages ?? DEFAULT_STAC_MAX_PAGES;
|
|
48
|
+
const items = [];
|
|
49
|
+
let cursor = { offset: request.offset, next: request.next };
|
|
50
|
+
for (let page = 0; page < maxPages; page += 1) {
|
|
51
|
+
const response = await this.client.searchStac(this.withBase({
|
|
52
|
+
...request,
|
|
53
|
+
limit: pageSize,
|
|
54
|
+
offset: cursor.offset,
|
|
55
|
+
next: cursor.next,
|
|
56
|
+
}));
|
|
57
|
+
const pageItems = response.features ?? [];
|
|
58
|
+
if (pageItems.length === 0)
|
|
59
|
+
break;
|
|
60
|
+
items.push(...pageItems);
|
|
61
|
+
cursor = nextStacCursor(response.links);
|
|
62
|
+
// Continuation is driven solely by the next-link cursor (and the
|
|
63
|
+
// maxPages cap). STAC permits a server to return fewer than `limit`
|
|
64
|
+
// items on a non-final page while still advertising a `rel=next` link,
|
|
65
|
+
// so a short page must not stop paging.
|
|
66
|
+
if (cursor.offset === undefined && cursor.next === undefined)
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return items;
|
|
70
|
+
}
|
|
71
|
+
async *searchStream(request = {}) {
|
|
72
|
+
const pageSize = request.pageSize ?? request.limit ?? DEFAULT_STAC_PAGE_SIZE;
|
|
73
|
+
const maxPages = request.maxPages ?? DEFAULT_STAC_MAX_PAGES;
|
|
74
|
+
let cursor = { offset: request.offset, next: request.next };
|
|
75
|
+
for (let page = 0; page < maxPages; page += 1) {
|
|
76
|
+
const response = await this.client.searchStac(this.withBase({
|
|
77
|
+
...request,
|
|
78
|
+
limit: pageSize,
|
|
79
|
+
offset: cursor.offset,
|
|
80
|
+
next: cursor.next,
|
|
81
|
+
}));
|
|
82
|
+
const pageItems = response.features ?? [];
|
|
83
|
+
if (pageItems.length === 0)
|
|
84
|
+
break;
|
|
85
|
+
yield pageItems;
|
|
86
|
+
cursor = nextStacCursor(response.links);
|
|
87
|
+
// See searchAll: a short page is not a termination signal; rely on the
|
|
88
|
+
// next-link cursor and the maxPages cap.
|
|
89
|
+
if (cursor.offset === undefined && cursor.next === undefined)
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Resolve the next-page cursor for STAC paging. honua-server emits a
|
|
96
|
+
* `rel=next` link with `?offset=N` on the href; some non-Honua STAC
|
|
97
|
+
* servers emit `?next=…` opaque tokens instead. Prefer `offset` when the
|
|
98
|
+
* link carries it, otherwise fall back to `next`. When the server omits
|
|
99
|
+
* a usable `rel=next` link, return an empty cursor so the caller stops.
|
|
100
|
+
*/
|
|
101
|
+
function nextStacCursor(links) {
|
|
102
|
+
if (!links)
|
|
103
|
+
return {};
|
|
104
|
+
for (const link of links) {
|
|
105
|
+
if (link.rel !== "next" || typeof link.href !== "string")
|
|
106
|
+
continue;
|
|
107
|
+
try {
|
|
108
|
+
const url = new URL(link.href, "https://placeholder.test");
|
|
109
|
+
const offsetParam = url.searchParams.get("offset");
|
|
110
|
+
if (offsetParam !== null) {
|
|
111
|
+
const offset = Number(offsetParam);
|
|
112
|
+
if (Number.isFinite(offset))
|
|
113
|
+
return { offset };
|
|
114
|
+
}
|
|
115
|
+
const nextParam = url.searchParams.get("next");
|
|
116
|
+
if (nextParam !== null)
|
|
117
|
+
return { next: nextParam };
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// ignore unparsable hrefs; keep scanning for a usable link
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
export function createHonuaStacSearch(client) {
|
|
126
|
+
return new HonuaStacSearch({ client });
|
|
127
|
+
}
|
|
128
|
+
// ── STAC API wire methods ───────────────────────────────────────
|
|
129
|
+
/**
|
|
130
|
+
* Path prefix the STAC endpoints are mounted under. Defaults to `/stac`
|
|
131
|
+
* (the Honua Server facade). Backend-agnostic callers pointing at a raw
|
|
132
|
+
* STAC API root pass `""` so the paths resolve directly under the client
|
|
133
|
+
* baseUrl (e.g. Earth Search served at `.../v1`).
|
|
134
|
+
*/
|
|
135
|
+
function stacBase(request) {
|
|
136
|
+
const base = request.stacBasePath;
|
|
137
|
+
if (base === undefined)
|
|
138
|
+
return "/stac";
|
|
139
|
+
// Trim trailing slashes; an explicit "" means "the client baseUrl is the
|
|
140
|
+
// STAC API root".
|
|
141
|
+
let end = base.length;
|
|
142
|
+
while (end > 0 && base.charCodeAt(end - 1) === 0x2f)
|
|
143
|
+
end--;
|
|
144
|
+
return base.slice(0, end);
|
|
145
|
+
}
|
|
146
|
+
export async function getStacLanding(transport, request = {}) {
|
|
147
|
+
const params = createOgcMetadataParams(request);
|
|
148
|
+
const base = stacBase(request);
|
|
149
|
+
return transport.requestCachedMetadataJson(`stac:landing:${base}:${params.toString()}`, `${base}?${params.toString()}`, request);
|
|
150
|
+
}
|
|
151
|
+
export async function listStacCollections(transport, request = {}) {
|
|
152
|
+
const params = createOgcMetadataParams(request);
|
|
153
|
+
const base = stacBase(request);
|
|
154
|
+
return transport.requestCachedMetadataJson(`stac:collections:${base}:${params.toString()}`, `${base}/collections?${params.toString()}`, request);
|
|
155
|
+
}
|
|
156
|
+
export async function getStacCollection(transport, request) {
|
|
157
|
+
const params = createOgcMetadataParams(request);
|
|
158
|
+
const base = stacBase(request);
|
|
159
|
+
return transport.requestCachedMetadataJson(`stac:collection:${base}:${request.collectionId}:${params.toString()}`, `${base}/collections/${encodeURIComponent(String(request.collectionId))}?${params.toString()}`, request);
|
|
160
|
+
}
|
|
161
|
+
export async function getStacItem(transport, request) {
|
|
162
|
+
const params = createOgcMetadataParams(request);
|
|
163
|
+
const base = stacBase(request);
|
|
164
|
+
const path = `${base}/collections/${encodeURIComponent(String(request.collectionId))}` +
|
|
165
|
+
`/items/${encodeURIComponent(String(request.itemId))}`;
|
|
166
|
+
return transport.requestJson("GET", `${path}?${params.toString()}`, undefined, request.signal);
|
|
167
|
+
}
|
|
168
|
+
export async function searchStac(transport, request = {}) {
|
|
169
|
+
const base = stacBase(request);
|
|
170
|
+
if (request.usePost) {
|
|
171
|
+
return transport.requestJson("POST", `${base}/search`, {
|
|
172
|
+
headers: mergeHeaders({ "Content-Type": "application/json", Accept: "application/json" }),
|
|
173
|
+
body: JSON.stringify(stacSearchBody(request)),
|
|
174
|
+
}, request.signal);
|
|
175
|
+
}
|
|
176
|
+
const params = serializeStacSearchParams(request);
|
|
177
|
+
return transport.requestJson("GET", `${base}/search?${params.toString()}`, undefined, request.signal);
|
|
178
|
+
}
|
|
179
|
+
function serializeStacSearchParams(request) {
|
|
180
|
+
const params = new URLSearchParams();
|
|
181
|
+
if (request.bbox !== undefined)
|
|
182
|
+
params.set("bbox", request.bbox.join(","));
|
|
183
|
+
if (request.datetime !== undefined)
|
|
184
|
+
params.set("datetime", request.datetime);
|
|
185
|
+
if (request.ids !== undefined && request.ids.length > 0)
|
|
186
|
+
params.set("ids", request.ids.join(","));
|
|
187
|
+
if (request.collections !== undefined && request.collections.length > 0) {
|
|
188
|
+
params.set("collections", request.collections.join(","));
|
|
189
|
+
}
|
|
190
|
+
// honua-server accepts `intersects` on GET as a JSON-encoded geometry
|
|
191
|
+
// and `fields` as a CSV with `-` prefix marking excludes (matches
|
|
192
|
+
// STAC Item Search GET conventions and the server's parser).
|
|
193
|
+
if (request.intersects !== undefined)
|
|
194
|
+
params.set("intersects", JSON.stringify(request.intersects));
|
|
195
|
+
const fields = stacFieldsCsv(request.fields);
|
|
196
|
+
if (fields !== undefined)
|
|
197
|
+
params.set("fields", fields);
|
|
198
|
+
if (request.filter !== undefined)
|
|
199
|
+
params.set("filter", request.filter);
|
|
200
|
+
if (request.filterLang !== undefined)
|
|
201
|
+
params.set("filter-lang", request.filterLang);
|
|
202
|
+
if (request.limit !== undefined)
|
|
203
|
+
params.set("limit", String(request.limit));
|
|
204
|
+
// honua-server uses numeric `offset` paging on GET. `next` is kept as
|
|
205
|
+
// optional support for STAC servers that advertise an opaque token.
|
|
206
|
+
if (request.offset !== undefined)
|
|
207
|
+
params.set("offset", String(request.offset));
|
|
208
|
+
if (request.next !== undefined)
|
|
209
|
+
params.set("next", request.next);
|
|
210
|
+
if (request.sortby !== undefined)
|
|
211
|
+
params.set("sortby", request.sortby);
|
|
212
|
+
return params;
|
|
213
|
+
}
|
|
214
|
+
function stacSearchBody(request) {
|
|
215
|
+
const out = {};
|
|
216
|
+
if (request.bbox !== undefined)
|
|
217
|
+
out.bbox = request.bbox;
|
|
218
|
+
if (request.datetime !== undefined)
|
|
219
|
+
out.datetime = request.datetime;
|
|
220
|
+
if (request.intersects !== undefined)
|
|
221
|
+
out.intersects = request.intersects;
|
|
222
|
+
if (request.ids !== undefined)
|
|
223
|
+
out.ids = request.ids;
|
|
224
|
+
if (request.collections !== undefined)
|
|
225
|
+
out.collections = request.collections;
|
|
226
|
+
if (request.filter !== undefined)
|
|
227
|
+
out.filter = request.filter;
|
|
228
|
+
if (request.filterLang !== undefined)
|
|
229
|
+
out["filter-lang"] = request.filterLang;
|
|
230
|
+
if (request.limit !== undefined)
|
|
231
|
+
out.limit = request.limit;
|
|
232
|
+
if (request.offset !== undefined)
|
|
233
|
+
out.offset = request.offset;
|
|
234
|
+
if (request.next !== undefined)
|
|
235
|
+
out.next = request.next;
|
|
236
|
+
if (request.sortby !== undefined)
|
|
237
|
+
out.sortby = request.sortby;
|
|
238
|
+
if (request.fields !== undefined)
|
|
239
|
+
out.fields = request.fields;
|
|
240
|
+
return out;
|
|
241
|
+
}
|
|
242
|
+
function stacFieldsCsv(fields) {
|
|
243
|
+
if (!fields)
|
|
244
|
+
return undefined;
|
|
245
|
+
const parts = [];
|
|
246
|
+
if (fields.include) {
|
|
247
|
+
for (const f of fields.include) {
|
|
248
|
+
if (typeof f === "string" && f.length > 0)
|
|
249
|
+
parts.push(f);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (fields.exclude) {
|
|
253
|
+
for (const f of fields.exclude) {
|
|
254
|
+
if (typeof f === "string" && f.length > 0)
|
|
255
|
+
parts.push(`-${f}`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return parts.length > 0 ? parts.join(",") : undefined;
|
|
259
|
+
}
|