@honua/app-platform 0.1.7-beta.0 → 0.1.10-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.
- package/control-plane/admin-client.d.ts +89 -0
- package/control-plane/admin-client.d.ts.map +1 -0
- package/control-plane/admin-client.js +200 -0
- package/control-plane/client.d.ts +1 -1
- package/control-plane/client.d.ts.map +1 -1
- package/control-plane/client.js +145 -11
- package/control-plane/commands/catalog.d.ts +133 -0
- package/control-plane/commands/catalog.d.ts.map +1 -0
- package/control-plane/commands/catalog.js +365 -0
- package/control-plane/commands/errors.d.ts +96 -0
- package/control-plane/commands/errors.d.ts.map +1 -0
- package/control-plane/commands/errors.js +130 -0
- package/control-plane/commands/identity.d.ts +71 -0
- package/control-plane/commands/identity.d.ts.map +1 -0
- package/control-plane/commands/identity.js +0 -0
- package/control-plane/commands/index.d.ts +39 -0
- package/control-plane/commands/index.d.ts.map +1 -0
- package/control-plane/commands/index.js +34 -0
- package/control-plane/commands/runtime.d.ts +146 -0
- package/control-plane/commands/runtime.d.ts.map +1 -0
- package/control-plane/commands/runtime.js +330 -0
- package/control-plane/commands/types.d.ts +228 -0
- package/control-plane/commands/types.d.ts.map +1 -0
- package/control-plane/commands/types.js +30 -0
- package/control-plane/commands/validate.d.ts +27 -0
- package/control-plane/commands/validate.d.ts.map +1 -0
- package/control-plane/commands/validate.js +132 -0
- package/control-plane/generated/admin-api.d.ts +30265 -0
- package/control-plane/generated/admin-api.d.ts.map +1 -0
- package/control-plane/generated/admin-api.js +5 -0
- package/control-plane/generated/admin-operations.d.ts +4053 -0
- package/control-plane/generated/admin-operations.d.ts.map +1 -0
- package/control-plane/generated/admin-operations.js +820 -0
- package/control-plane/index.d.ts +11 -0
- package/control-plane/index.d.ts.map +1 -1
- package/control-plane/index.js +8 -0
- package/control-plane/types.d.ts +14 -0
- package/control-plane/types.d.ts.map +1 -1
- package/controls/catalog.d.ts.map +1 -1
- package/controls/catalog.js +12 -1
- package/controls/qualification.d.ts.map +1 -1
- package/controls/qualification.js +71 -8
- package/core/client.d.ts.map +1 -1
- package/core/client.js +29 -31
- package/core/credential-redaction.d.ts +163 -0
- package/core/credential-redaction.d.ts.map +1 -0
- package/core/credential-redaction.js +389 -0
- package/core/error-classifications.d.ts +15 -0
- package/core/error-classifications.d.ts.map +1 -1
- package/core/error-classifications.js +15 -0
- package/core/error-code-registry.d.ts +15 -0
- package/core/error-code-registry.d.ts.map +1 -1
- package/core/error-code-registry.js +15 -0
- package/core/error-envelope.d.ts +31 -0
- package/core/error-envelope.d.ts.map +1 -1
- package/core/error-envelope.js +11 -0
- package/core/errors.d.ts +15 -3
- package/core/errors.d.ts.map +1 -1
- package/core/errors.js +254 -2
- package/core/geometry-input-sr.d.ts +3 -0
- package/core/geometry-input-sr.d.ts.map +1 -0
- package/core/geometry-input-sr.js +28 -0
- package/core/geoservices.d.ts.map +1 -1
- package/core/geoservices.js +33 -6
- package/core/grpc-adapter.d.ts +2 -2
- package/core/grpc-adapter.d.ts.map +1 -1
- package/core/grpc-adapter.js +41 -9
- package/core/job-run-errors.d.ts +10 -0
- package/core/job-run-errors.d.ts.map +1 -0
- package/core/job-run-errors.js +14 -0
- package/core/job-run-lifecycle.d.ts +34 -0
- package/core/job-run-lifecycle.d.ts.map +1 -0
- package/core/job-run-lifecycle.js +193 -0
- package/core/ogc-processes.d.ts +38 -31
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +123 -173
- package/core/pbf-decoder.d.ts.map +1 -1
- package/core/pbf-decoder.js +16 -4
- package/core/process-runner.js +15 -100
- package/core/protocol-transport.d.ts +6 -1
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/request-pipeline.d.ts +6 -3
- package/core/request-pipeline.d.ts.map +1 -1
- package/core/request-pipeline.js +28 -11
- package/core/spatial-filter.d.ts +4 -4
- package/core/spatial-filter.d.ts.map +1 -1
- package/core/spatial-filter.js +7 -7
- package/core/surfaces.d.ts +2 -8
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +21 -112
- package/core/types.d.ts +21 -9
- package/core/types.d.ts.map +1 -1
- package/custom-elements.json +341 -0
- package/esri-compat/class-breaks-renderer.d.ts +2 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -1
- package/esri-compat/class-breaks-renderer.js +7 -0
- package/esri-compat/controls.d.ts +10 -1
- package/esri-compat/controls.d.ts.map +1 -1
- package/esri-compat/controls.js +86 -2
- package/esri-compat/directions.d.ts +35 -0
- package/esri-compat/directions.d.ts.map +1 -1
- package/esri-compat/directions.js +153 -2
- package/esri-compat/expand.d.ts +1 -0
- package/esri-compat/expand.d.ts.map +1 -1
- package/esri-compat/expand.js +61 -0
- package/esri-compat/feature-layer.d.ts +29 -4
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +335 -13
- package/esri-compat/geometry-engine.d.ts +4 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -1
- package/esri-compat/geometry-engine.js +8 -1
- package/esri-compat/graphic.d.ts +7 -4
- package/esri-compat/graphic.d.ts.map +1 -1
- package/esri-compat/legend.d.ts +2 -1
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +15 -0
- package/esri-compat/map-view-mount.d.ts +48 -0
- package/esri-compat/map-view-mount.d.ts.map +1 -0
- package/esri-compat/map-view-mount.js +344 -0
- package/esri-compat/map-view.d.ts +38 -6
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +467 -33
- package/esri-compat/portal.d.ts +2 -0
- package/esri-compat/portal.d.ts.map +1 -1
- package/esri-compat/portal.js +7 -2
- package/esri-compat/renderer-objects.d.ts +7 -2
- package/esri-compat/renderer-objects.d.ts.map +1 -1
- package/esri-compat/renderer-objects.js +16 -5
- package/esri-compat/route-layer.d.ts +8 -0
- package/esri-compat/route-layer.d.ts.map +1 -1
- package/esri-compat/route-layer.js +24 -4
- package/esri-compat/route-task.d.ts +5 -1
- package/esri-compat/route-task.d.ts.map +1 -1
- package/esri-compat/route-task.js +119 -7
- package/esri-compat/scene-view.d.ts.map +1 -1
- package/esri-compat/scene-view.js +1 -0
- package/esri-compat/search.d.ts +2 -1
- package/esri-compat/search.d.ts.map +1 -1
- package/esri-compat/search.js +52 -2
- package/esri-compat/unique-value-renderer.d.ts +2 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -1
- package/esri-compat/unique-value-renderer.js +7 -0
- package/esri-compat/web-map.d.ts +10 -0
- package/esri-compat/web-map.d.ts.map +1 -1
- package/esri-compat/web-map.js +102 -0
- package/gen/geospatial/v1/common_pb.d.ts +514 -0
- package/gen/geospatial/v1/common_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/common_pb.js +335 -0
- package/gen/geospatial/v1/execution_types_pb.d.ts +1186 -0
- package/gen/geospatial/v1/execution_types_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/execution_types_pb.js +396 -0
- package/gen/geospatial/v1/feature_service_pb.d.ts +403 -0
- package/gen/geospatial/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/feature_service_pb.js +47 -0
- package/gen/geospatial/v1/index.d.ts +5 -0
- package/gen/geospatial/v1/index.d.ts.map +1 -0
- package/gen/geospatial/v1/index.js +9 -0
- package/gen/geospatial/v1/spatial_types_pb.d.ts +285 -0
- package/gen/geospatial/v1/spatial_types_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/spatial_types_pb.js +58 -0
- package/gen/geospatial/v1/workspace_artifact_types_pb.d.ts +379 -0
- package/gen/geospatial/v1/workspace_artifact_types_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/workspace_artifact_types_pb.js +151 -0
- package/generated-app/projection.d.ts.map +1 -1
- package/generated-app/projection.js +10 -1
- package/geocoding/index.d.ts +1 -0
- package/geocoding/index.d.ts.map +1 -1
- package/geocoding/index.js +18 -8
- package/geocoding/provider-http.d.ts.map +1 -1
- package/geocoding/provider-http.js +3 -1
- package/map/webmap-maplibre.d.ts +2 -1
- package/map/webmap-maplibre.d.ts.map +1 -1
- package/map/webmap-maplibre.js +3 -0
- package/operate/client.d.ts +11 -1
- package/operate/client.d.ts.map +1 -1
- package/operate/client.js +39 -2
- package/operate/index.d.ts +1 -1
- package/operate/index.d.ts.map +1 -1
- package/operate/types.d.ts +40 -6
- package/operate/types.d.ts.map +1 -1
- package/package.json +6 -4
- package/query-planner/geoservices.d.ts.map +1 -1
- package/query-planner/geoservices.js +2 -0
- package/query-planner/grpc.d.ts +4 -4
- package/query-planner/grpc.d.ts.map +1 -1
- package/query-planner/grpc.js +11 -11
- package/query-planner/types.d.ts +6 -4
- package/query-planner/types.d.ts.map +1 -1
- package/realtime/honua-server.d.ts +4 -0
- package/realtime/honua-server.d.ts.map +1 -1
- package/realtime/honua-server.js +10 -0
- package/realtime/resumable.js +9 -0
- package/realtime/types.d.ts +8 -0
- package/realtime/types.d.ts.map +1 -1
- package/runtime/errors.d.ts +1 -1
- package/runtime/errors.d.ts.map +1 -1
- package/runtime/errors.js +2 -0
- package/runtime/generated/map-package-schema-meta.d.ts +11 -0
- package/runtime/generated/map-package-schema-meta.d.ts.map +1 -0
- package/runtime/generated/map-package-schema-meta.js +12 -0
- package/runtime/generated/map-package-schema-validator.d.ts +16 -0
- package/runtime/generated/map-package-schema-validator.d.ts.map +1 -0
- package/runtime/generated/map-package-schema-validator.js +1422 -0
- package/runtime/index.d.ts +5 -1
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +6 -0
- package/runtime/map-package-export.d.ts +151 -0
- package/runtime/map-package-export.d.ts.map +1 -0
- package/runtime/map-package-export.js +636 -0
- package/runtime/map-package-validation.d.ts +21 -1
- package/runtime/map-package-validation.d.ts.map +1 -1
- package/runtime/map-package-validation.js +132 -95
- package/runtime/map-package.d.ts +80 -0
- package/runtime/map-package.d.ts.map +1 -1
- package/scene-workspace/cesium-adapter.d.ts +8 -8
- package/scene-workspace/cesium-adapter.d.ts.map +1 -1
- package/scene-workspace/cesium-adapter.js +31 -18
- package/scene-workspace/index.d.ts +2 -2
- package/scene-workspace/index.d.ts.map +1 -1
- package/scene-workspace/index.js +1 -1
- package/scene-workspace/maplibre-state-sync.d.ts.map +1 -1
- package/scene-workspace/maplibre-state-sync.js +35 -3
- package/scene-workspace/primitives.d.ts +37 -5
- package/scene-workspace/primitives.d.ts.map +1 -1
- package/scene-workspace/primitives.js +55 -18
- package/scene-workspace/source-to-cesium.js +1 -1
- package/scene-workspace/state-sync-port-kit.d.ts +1 -1
- package/scene-workspace/state-sync-port-kit.d.ts.map +1 -1
- package/studio/capability-manifest.d.ts +10 -0
- package/studio/capability-manifest.d.ts.map +1 -1
- package/studio/capability-manifest.js +38 -0
- package/studio/chart-spec.d.ts +6 -6
- package/studio/chart-spec.d.ts.map +1 -1
- package/studio/chart-spec.js +6 -6
- package/studio/command-adapter.d.ts +35 -0
- package/studio/command-adapter.d.ts.map +1 -0
- package/studio/command-adapter.js +36 -0
- package/studio/generated/studio-api.d.ts +1062 -0
- package/studio/generated/studio-api.d.ts.map +1 -0
- package/studio/generated/studio-api.js +4 -0
- package/studio/index.d.ts +25 -13
- package/studio/index.d.ts.map +1 -1
- package/studio/index.js +21 -10
- package/studio/lifecycle-client.d.ts +262 -22
- package/studio/lifecycle-client.d.ts.map +1 -1
- package/studio/lifecycle-client.js +543 -24
- package/studio/lifecycle-errors.d.ts +8 -2
- package/studio/lifecycle-errors.d.ts.map +1 -1
- package/studio/lifecycle-errors.js +6 -1
- package/studio/lifecycle-types.d.ts +237 -38
- package/studio/lifecycle-types.d.ts.map +1 -1
- package/studio/lifecycle-types.js +5 -12
- package/studio/publication-status.d.ts +55 -0
- package/studio/publication-status.d.ts.map +1 -0
- package/studio/publication-status.js +103 -0
- package/studio/types.d.ts +37 -7
- package/studio/types.d.ts.map +1 -1
- package/studio/types.js +5 -3
- package/studio/validate.d.ts.map +1 -1
- package/studio/validate.js +104 -7
- package/style/renderers.d.ts +6 -1
- package/style/renderers.d.ts.map +1 -1
- package/style/renderers.js +11 -6
- package/style/visual-variables.d.ts +43 -0
- package/style/visual-variables.d.ts.map +1 -0
- package/style/visual-variables.js +183 -0
- package/web-components/application-context.d.ts +186 -0
- package/web-components/application-context.d.ts.map +1 -0
- package/web-components/application-context.js +429 -0
- package/web-components/elements.d.ts +10 -1
- package/web-components/elements.d.ts.map +1 -1
- package/web-components/elements.js +187 -7
- package/web-components/export-redaction.d.ts +11 -102
- package/web-components/export-redaction.d.ts.map +1 -1
- package/web-components/export-redaction.js +7 -260
- package/web-components/feature-editor-offline.d.ts +32 -0
- package/web-components/feature-editor-offline.d.ts.map +1 -0
- package/web-components/feature-editor-offline.js +115 -0
- package/web-components/feature-editor-workflow.d.ts +85 -22
- package/web-components/feature-editor-workflow.d.ts.map +1 -1
- package/web-components/feature-editor-workflow.js +240 -0
- package/web-components/feature-editor.d.ts +20 -6
- package/web-components/feature-editor.d.ts.map +1 -1
- package/web-components/feature-editor.js +159 -7
- package/web-components/feature-inspection.d.ts +287 -0
- package/web-components/feature-inspection.d.ts.map +1 -0
- package/web-components/feature-inspection.js +1464 -0
- package/web-components/feature-mutation.d.ts +77 -0
- package/web-components/feature-mutation.d.ts.map +1 -0
- package/web-components/feature-mutation.js +137 -0
- package/web-components/feature-table-engine.d.ts +94 -4
- package/web-components/feature-table-engine.d.ts.map +1 -1
- package/web-components/feature-table-engine.js +365 -18
- package/web-components/feature-table-view.d.ts +35 -1
- package/web-components/feature-table-view.d.ts.map +1 -1
- package/web-components/feature-table-view.js +128 -12
- package/web-components/index.d.ts +16 -7
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +9 -2
- package/web-components/map-pointer-claim.d.ts +24 -0
- package/web-components/map-pointer-claim.d.ts.map +1 -0
- package/web-components/map-pointer-claim.js +40 -0
- package/web-components/maplibre-renderer.d.ts.map +1 -1
- package/web-components/maplibre-renderer.js +5 -1
- package/web-components/measurement-units.d.ts +88 -0
- package/web-components/measurement-units.d.ts.map +1 -0
- package/web-components/measurement-units.js +278 -0
- package/web-components/measurement.d.ts +75 -4
- package/web-components/measurement.d.ts.map +1 -1
- package/web-components/measurement.js +227 -28
- package/web-components/types.d.ts +58 -3
- package/web-components/types.d.ts.map +1 -1
- package/webmap/convert-layer.d.ts +2 -1
- package/webmap/convert-layer.d.ts.map +1 -1
- package/webmap/convert-layer.js +20 -3
- package/webmap/convert-renderer.d.ts +10 -3
- package/webmap/convert-renderer.d.ts.map +1 -1
- package/webmap/convert-renderer.js +190 -36
- package/webmap/index.d.ts +1 -0
- package/webmap/index.d.ts.map +1 -1
- package/webmap/parse.d.ts +2 -1
- package/webmap/parse.d.ts.map +1 -1
- package/webmap/parse.js +1 -1
- package/gen/honua/v1/feature_service_pb.d.ts +0 -918
- package/gen/honua/v1/feature_service_pb.d.ts.map +0 -1
- package/gen/honua/v1/feature_service_pb.js +0 -375
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-code-registry.d.ts","sourceRoot":"","sources":["../../../src/core/error-code-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,WAAW,GACX,OAAO,GACP,KAAK,GACL,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,KAAK,CAAC;AAEV,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"error-code-registry.d.ts","sourceRoot":"","sources":["../../../src/core/error-code-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,WAAW,GACX,OAAO,GACP,KAAK,GACL,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,KAAK,CAAC;AAEV,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqrBwB,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,yBAAyB,CAAC"}
|
|
@@ -35,6 +35,19 @@ export const HONUA_ERROR_CODE_REGISTRY = Object.freeze({
|
|
|
35
35
|
"core.coverage.unsupported-format": classification("core", "capability", false, "Coverage format is unsupported"),
|
|
36
36
|
"core.coverage.service-error": classification("core", "protocol", false, "Coverage service rejected the request"),
|
|
37
37
|
"core.coverage.wcs-exception": classification("core", "protocol", false, "WCS exception report"),
|
|
38
|
+
"core.zarr.invalid-request": classification("core", "validation", false, "Zarr request is invalid"),
|
|
39
|
+
"core.zarr.invalid-response": classification("core", "protocol", false, "Zarr response is invalid"),
|
|
40
|
+
"core.zarr.response-too-large": classification("core", "validation", false, "Zarr response exceeds its byte limit"),
|
|
41
|
+
"core.zarr.metadata-pending": classification("core", "capability", false, "Zarr metadata scan is pending"),
|
|
42
|
+
"core.zarr.missing-spatial-extent": classification("core", "capability", false, "Zarr storage spatial extent is missing or unusable"),
|
|
43
|
+
"core.zarr.no-tileable-variable": classification("core", "capability", false, "Zarr metadata contains no tileable variable"),
|
|
44
|
+
"core.zarr.missing-spatial-reference": classification("core", "capability", false, "Zarr registration is missing a positive storage SRID for tile handoff"),
|
|
45
|
+
"core.zarr.spatial-reference-mismatch": classification("core", "capability", false, "Zarr storage and tile matrix spatial references do not match"),
|
|
46
|
+
"core.zarr.unsupported-version": classification("core", "capability", false, "Zarr version is unsupported"),
|
|
47
|
+
"core.zarr.unsupported-codec": classification("core", "capability", false, "Zarr codec is unsupported"),
|
|
48
|
+
"core.zarr.unsupported-dtype": classification("core", "capability", false, "Zarr dtype is unsupported"),
|
|
49
|
+
"core.zarr.ambiguous-dimensions": classification("core", "validation", false, "Zarr dimensions are ambiguous"),
|
|
50
|
+
"core.zarr.service-error": classification("core", "protocol", false, "Zarr service rejected the request"),
|
|
38
51
|
"discovery.ambiguous-protocol": classification("discovery", "validation", false, "Multiple protocols match the endpoint"),
|
|
39
52
|
"discovery.ambiguous-source": classification("discovery", "validation", false, "Multiple sources match the selection"),
|
|
40
53
|
"discovery.invalid-cloud-native-input": classification("discovery", "validation", false, "Cloud-native discovery input is invalid or ambiguous"),
|
|
@@ -94,6 +107,8 @@ export const HONUA_ERROR_CODE_REGISTRY = Object.freeze({
|
|
|
94
107
|
"runtime.map-package.fetch": classification("runtime", "network", true, "Map package fetch failed"),
|
|
95
108
|
"runtime.map-package.load": classification("runtime", "internal", false, "Map package load failed"),
|
|
96
109
|
"runtime.map-package.validate": classification("runtime", "validation", false, "Map package validation failed"),
|
|
110
|
+
"runtime.map-package.export": classification("runtime", "validation", false, "Map package export refused"),
|
|
111
|
+
"runtime.map-package.import": classification("runtime", "validation", false, "Map package import refused"),
|
|
97
112
|
"runtime.map-package.update": classification("runtime", "internal", false, "Map package update failed"),
|
|
98
113
|
"runtime.map-package.style-compose": classification("runtime", "validation", false, "Map package style composition failed"),
|
|
99
114
|
"runtime.map-package.source-bind": classification("runtime", "internal", false, "Map package source binding failed"),
|
package/core/error-envelope.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface HonuaErrorMetadata {
|
|
|
17
17
|
readonly operationId?: string;
|
|
18
18
|
readonly requestId?: string;
|
|
19
19
|
readonly context?: Readonly<Record<string, unknown>>;
|
|
20
|
+
readonly terminalReceipt?: HonuaTerminalFailureReceipt;
|
|
20
21
|
}
|
|
21
22
|
export interface HonuaErrorOptions extends ErrorOptions, HonuaErrorMetadata {
|
|
22
23
|
}
|
|
@@ -29,9 +30,38 @@ export interface SerializedHonuaError {
|
|
|
29
30
|
readonly retryable: boolean;
|
|
30
31
|
readonly operationId?: string;
|
|
31
32
|
readonly requestId?: string;
|
|
33
|
+
readonly receipt?: HonuaTerminalFailureReceipt;
|
|
32
34
|
readonly context: HonuaErrorEnvelopeContext;
|
|
33
35
|
readonly cause?: SerializedHonuaErrorCause;
|
|
34
36
|
}
|
|
37
|
+
/** Stable failure classes shared by HTTP, GeoServices, and gRPC terminal receipts. */
|
|
38
|
+
export type HonuaFailureKind = "authentication" | "authorization" | "not-found" | "validation" | "conflict" | "throttled" | "unavailable" | "unknown";
|
|
39
|
+
/** One field- or item-addressable server rejection. */
|
|
40
|
+
export interface HonuaFieldFailure {
|
|
41
|
+
readonly code?: string;
|
|
42
|
+
readonly severity?: string;
|
|
43
|
+
readonly path?: string;
|
|
44
|
+
readonly fieldId?: string;
|
|
45
|
+
readonly itemIndex?: number;
|
|
46
|
+
readonly message?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Protocol-native metadata retained at a terminal transport boundary. */
|
|
49
|
+
export interface HonuaProtocolMetadata {
|
|
50
|
+
readonly initial: Readonly<Record<string, readonly string[]>>;
|
|
51
|
+
readonly trailing: Readonly<Record<string, readonly string[]>>;
|
|
52
|
+
}
|
|
53
|
+
/** Machine-actionable receipt exposed by every remote terminal SDK error. */
|
|
54
|
+
export interface HonuaTerminalFailureReceipt {
|
|
55
|
+
readonly transportStatus?: number;
|
|
56
|
+
readonly protocolCode?: number | string;
|
|
57
|
+
readonly kind: HonuaFailureKind;
|
|
58
|
+
readonly code?: string;
|
|
59
|
+
readonly retryable: boolean;
|
|
60
|
+
readonly retryAfterMs?: number;
|
|
61
|
+
readonly correlationId?: string;
|
|
62
|
+
readonly fieldErrors: readonly HonuaFieldFailure[];
|
|
63
|
+
readonly protocolMetadata: HonuaProtocolMetadata;
|
|
64
|
+
}
|
|
35
65
|
export interface SerializedHonuaErrorCause {
|
|
36
66
|
readonly name: string;
|
|
37
67
|
readonly domain?: HonuaErrorDomain;
|
|
@@ -49,6 +79,7 @@ export declare abstract class HonuaSdkError extends Error {
|
|
|
49
79
|
readonly retryable: boolean;
|
|
50
80
|
readonly operationId: string | undefined;
|
|
51
81
|
readonly requestId: string | undefined;
|
|
82
|
+
readonly terminalReceipt: HonuaTerminalFailureReceipt | undefined;
|
|
52
83
|
readonly context: HonuaErrorEnvelopeContext;
|
|
53
84
|
protected constructor(code: HonuaErrorCode, message: string, options?: HonuaErrorOptions);
|
|
54
85
|
/** Safe JSON projection. Raw messages, stacks, details, bodies, and causes are intentionally omitted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-envelope.d.ts","sourceRoot":"","sources":["../../../src/core/error-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAErG,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,gBAAgB,EAAG,oBAA6B,CAAC;AAE9D,MAAM,MAAM,8BAA8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;
|
|
21
22
|
context;
|
|
22
23
|
constructor(code, message, options = {}) {
|
|
23
24
|
const [domain, category, retryable] = errorCodeClassification(code);
|
|
@@ -29,6 +30,7 @@ export class HonuaSdkError extends Error {
|
|
|
29
30
|
this.retryable = retryable;
|
|
30
31
|
this.operationId = sanitizeIdentifier(options.operationId);
|
|
31
32
|
this.requestId = sanitizeIdentifier(options.requestId);
|
|
33
|
+
this.terminalReceipt = options.terminalReceipt;
|
|
32
34
|
this.context = sanitizeHonuaErrorContext(options.context);
|
|
33
35
|
}
|
|
34
36
|
/** Safe JSON projection. Raw messages, stacks, details, bodies, and causes are intentionally omitted. */
|
|
@@ -69,6 +71,7 @@ export function serializeHonuaError(error) {
|
|
|
69
71
|
const cause = serializeCause(ownDataProperty(error, "cause"));
|
|
70
72
|
const operationId = sanitizeIdentifier(asOptionalString(ownDataProperty(error, "operationId")));
|
|
71
73
|
const requestId = sanitizeIdentifier(asOptionalString(ownDataProperty(error, "requestId")));
|
|
74
|
+
const receipt = ownDataProperty(error, "terminalReceipt");
|
|
72
75
|
const context = ownDataProperty(error, "context");
|
|
73
76
|
return {
|
|
74
77
|
kind: HONUA_ERROR_KIND,
|
|
@@ -79,10 +82,18 @@ export function serializeHonuaError(error) {
|
|
|
79
82
|
retryable,
|
|
80
83
|
...(operationId ? { operationId } : {}),
|
|
81
84
|
...(requestId ? { requestId } : {}),
|
|
85
|
+
...(isTerminalFailureReceipt(receipt) ? { receipt } : {}),
|
|
82
86
|
context: isRecord(context) && !Array.isArray(context) ? sanitizeHonuaErrorContext(context) : emptyContext(),
|
|
83
87
|
...(cause ? { cause } : {}),
|
|
84
88
|
};
|
|
85
89
|
}
|
|
90
|
+
function isTerminalFailureReceipt(value) {
|
|
91
|
+
return (isRecord(value) &&
|
|
92
|
+
typeof ownDataProperty(value, "kind") === "string" &&
|
|
93
|
+
typeof ownDataProperty(value, "retryable") === "boolean" &&
|
|
94
|
+
Array.isArray(ownDataProperty(value, "fieldErrors")) &&
|
|
95
|
+
isRecord(ownDataProperty(value, "protocolMetadata")));
|
|
96
|
+
}
|
|
86
97
|
/** Redact structured context before it is stored on an SDK error. */
|
|
87
98
|
export function sanitizeHonuaErrorContext(context) {
|
|
88
99
|
if (!context)
|
package/core/errors.d.ts
CHANGED
|
@@ -30,7 +30,17 @@
|
|
|
30
30
|
*
|
|
31
31
|
* @packageDocumentation
|
|
32
32
|
*/
|
|
33
|
-
import { type HonuaErrorMetadata, type HonuaErrorOptions, HonuaSdkError } from "./error-envelope.js";
|
|
33
|
+
import { type HonuaErrorMetadata, type HonuaErrorOptions, type HonuaFailureKind, type HonuaFieldFailure, type HonuaProtocolMetadata, HonuaSdkError, type HonuaTerminalFailureReceipt } from "./error-envelope.js";
|
|
34
|
+
export type { HonuaFailureKind, HonuaFieldFailure, HonuaProtocolMetadata, HonuaTerminalFailureReceipt };
|
|
35
|
+
export interface HonuaHttpErrorOptions extends HonuaErrorOptions {
|
|
36
|
+
readonly responseHeaders?: Pick<Headers, "entries" | "get"> | Readonly<Record<string, string | readonly string[]>>;
|
|
37
|
+
readonly protocolCode?: number | string;
|
|
38
|
+
readonly transportStatus?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface HonuaGrpcErrorOptions extends HonuaErrorOptions {
|
|
41
|
+
readonly initialMetadata?: unknown;
|
|
42
|
+
readonly trailingMetadata?: unknown;
|
|
43
|
+
}
|
|
34
44
|
export type HonuaDiscoveryErrorCode = "ambiguous-protocol" | "ambiguous-source" | "invalid-cloud-native-input" | "invalid-cloud-native-manifest" | "invalid-endpoint" | "invalid-cache-identity" | "invalid-discovery-cache" | "invalid-capability" | "cloud-native-operation-unavailable" | "unsupported-protocol" | "protocol-mismatch";
|
|
35
45
|
/** Discovery input, metadata, or cache identity is invalid or inconsistent. */
|
|
36
46
|
export declare class HonuaDiscoveryError extends HonuaSdkError {
|
|
@@ -60,7 +70,8 @@ export declare class HonuaGeometryError extends HonuaSdkError {
|
|
|
60
70
|
export declare class HonuaHttpError extends HonuaSdkError {
|
|
61
71
|
readonly statusCode: number;
|
|
62
72
|
readonly body: unknown;
|
|
63
|
-
|
|
73
|
+
readonly receipt: HonuaTerminalFailureReceipt;
|
|
74
|
+
constructor(statusCode: number, message: string, body: unknown, options?: HonuaHttpErrorOptions);
|
|
64
75
|
}
|
|
65
76
|
/** Thrown when a request exceeds the configured timeout. */
|
|
66
77
|
export declare class HonuaTimeoutError extends HonuaSdkError {
|
|
@@ -80,7 +91,8 @@ export declare class HonuaAbortError extends HonuaSdkError {
|
|
|
80
91
|
export declare class HonuaGrpcError extends HonuaSdkError {
|
|
81
92
|
readonly code: number;
|
|
82
93
|
readonly details: unknown;
|
|
83
|
-
|
|
94
|
+
readonly receipt: HonuaTerminalFailureReceipt;
|
|
95
|
+
constructor(code: number, message: string, details?: unknown, options?: HonuaGrpcErrorOptions);
|
|
84
96
|
}
|
|
85
97
|
/**
|
|
86
98
|
* Thrown when a `Source` is asked to perform an operation that the underlying
|
package/core/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,aAAa,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,aAAa,EACb,KAAK,2BAA2B,EAGjC,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,CAAC;AAExG,MAAM,WAAW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AAE,MAAM,CAAC;IACjC,SAAgB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE1B,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;CAa5G;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE7F;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,aAAa;aAI7B,IAAI,EAAE,kBAAkB;IAH1C,SAAyB,KAAK,EAAE,OAAO,CAAC;gBAGtB,IAAI,EAAE,kBAAkB,EACxC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB;CAMlC;AAED;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,aAAa;aAE3C,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB;CAQlC;AAED;;;;;;;GAOG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,SAAgB,aAAa,EAAE,MAAM,CAAC;IACtC,SAAgB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEzB,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;CAY7G;AAED,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
|
package/core/errors.js
CHANGED
|
@@ -73,14 +73,19 @@ export class HonuaGeometryError extends HonuaSdkError {
|
|
|
73
73
|
export class HonuaHttpError extends HonuaSdkError {
|
|
74
74
|
statusCode;
|
|
75
75
|
body;
|
|
76
|
+
receipt;
|
|
76
77
|
constructor(statusCode, message, body, options = {}) {
|
|
77
|
-
|
|
78
|
+
const receipt = httpFailureReceipt(statusCode, body, options);
|
|
79
|
+
super(receipt.retryable ? "core.http.transient" : "core.http.rejected", `HTTP ${statusCode}: ${message}`, {
|
|
78
80
|
...options,
|
|
81
|
+
requestId: options.requestId ?? receipt.correlationId,
|
|
82
|
+
terminalReceipt: receipt,
|
|
79
83
|
context: mergeHonuaErrorContext(options.context, { statusCode }),
|
|
80
84
|
});
|
|
81
85
|
this.name = "HonuaHttpError";
|
|
82
86
|
this.statusCode = statusCode;
|
|
83
87
|
this.body = body;
|
|
88
|
+
this.receipt = receipt;
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
91
|
/** Thrown when a request exceeds the configured timeout. */
|
|
@@ -115,14 +120,19 @@ export class HonuaAbortError extends HonuaSdkError {
|
|
|
115
120
|
export class HonuaGrpcError extends HonuaSdkError {
|
|
116
121
|
code;
|
|
117
122
|
details;
|
|
123
|
+
receipt;
|
|
118
124
|
constructor(code, message, details, options = {}) {
|
|
119
|
-
|
|
125
|
+
const receipt = grpcFailureReceipt(code, details, options);
|
|
126
|
+
super(receipt.retryable ? "core.grpc.transient" : "core.grpc.rejected", message, {
|
|
120
127
|
...options,
|
|
128
|
+
requestId: options.requestId ?? receipt.correlationId,
|
|
129
|
+
terminalReceipt: receipt,
|
|
121
130
|
context: mergeHonuaErrorContext(options.context, { grpcCode: code }),
|
|
122
131
|
});
|
|
123
132
|
this.code = code;
|
|
124
133
|
this.name = "HonuaGrpcError";
|
|
125
134
|
this.details = details;
|
|
135
|
+
this.receipt = receipt;
|
|
126
136
|
}
|
|
127
137
|
}
|
|
128
138
|
/**
|
|
@@ -221,3 +231,245 @@ const AUTH_ERROR_CODES = {
|
|
|
221
231
|
refresh_failed: "core.auth.refresh-failed",
|
|
222
232
|
invalid_grant: "core.auth.invalid-grant",
|
|
223
233
|
};
|
|
234
|
+
function httpFailureReceipt(statusCode, body, options) {
|
|
235
|
+
const root = isObject(body) ? body : undefined;
|
|
236
|
+
const protocolError = root && isObject(root.error) ? root.error : undefined;
|
|
237
|
+
const source = protocolError ?? root;
|
|
238
|
+
const protocolCode = options.protocolCode ?? scalarCode(protocolError?.code);
|
|
239
|
+
const classificationCode = typeof protocolCode === "number" ? protocolCode : statusCode;
|
|
240
|
+
const metadata = metadataRecord(options.responseHeaders);
|
|
241
|
+
const bodyKind = stringValue(source?.kind);
|
|
242
|
+
const kind = isFailureKind(bodyKind) ? bodyKind : failureKindForHttp(classificationCode, statusCode);
|
|
243
|
+
const code = stringValue(source?.machineCode) ?? stringValue(source?.code) ?? stringValue(root?.code) ?? defaultCode(kind);
|
|
244
|
+
const explicitRetryable = booleanValue(source?.retryable) ?? booleanValue(root?.retryable);
|
|
245
|
+
const retryAfterSeconds = numberValue(source?.retryAfterSeconds) ?? numberValue(root?.retryAfterSeconds);
|
|
246
|
+
const headerDelay = parseRetryAfter(metadataGetter(options.responseHeaders));
|
|
247
|
+
const correlationId = stringValue(source?.correlationId) ??
|
|
248
|
+
stringValue(root?.correlationId) ??
|
|
249
|
+
firstMetadata(metadata, "x-correlation-id", "honua-request-id", "x-request-id", "honua-correlation-id");
|
|
250
|
+
const fieldErrors = parseFieldFailures(source?.errors ?? root?.errors);
|
|
251
|
+
return freezeReceipt({
|
|
252
|
+
transportStatus: options.transportStatus ?? statusCode,
|
|
253
|
+
...(protocolCode !== undefined ? { protocolCode } : {}),
|
|
254
|
+
kind,
|
|
255
|
+
...(code ? { code } : {}),
|
|
256
|
+
retryable: explicitRetryable ??
|
|
257
|
+
(HTTP_RETRYABLE_STATUSES.has(classificationCode) ||
|
|
258
|
+
HTTP_RETRYABLE_STATUSES.has(options.transportStatus ?? statusCode)),
|
|
259
|
+
...(retryAfterSeconds !== undefined
|
|
260
|
+
? { retryAfterMs: Math.max(0, retryAfterSeconds * 1_000) }
|
|
261
|
+
: headerDelay !== undefined
|
|
262
|
+
? { retryAfterMs: headerDelay }
|
|
263
|
+
: {}),
|
|
264
|
+
...(correlationId ? { correlationId } : {}),
|
|
265
|
+
fieldErrors,
|
|
266
|
+
protocolMetadata: { initial: metadata, trailing: emptyMetadata() },
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function grpcFailureReceipt(code, details, options) {
|
|
270
|
+
const initial = metadataRecord(options.initialMetadata);
|
|
271
|
+
const trailing = metadataRecord(options.trailingMetadata);
|
|
272
|
+
const declaredMachineCode = firstMetadata(trailing, "honua-error-code") ?? firstMetadata(initial, "honua-error-code");
|
|
273
|
+
const declaredKind = firstMetadata(trailing, "honua-error-kind") ?? firstMetadata(initial, "honua-error-kind");
|
|
274
|
+
const kind = isFailureKind(declaredKind) ? declaredKind : failureKindForGrpc(code);
|
|
275
|
+
const machineCode = declaredMachineCode ?? defaultCode(kind);
|
|
276
|
+
const declaredRetryable = firstMetadata(trailing, "honua-retryable", "honua-error-retryable") ??
|
|
277
|
+
firstMetadata(initial, "honua-retryable", "honua-error-retryable");
|
|
278
|
+
const retryAfterMs = parseRetryAfter(metadataGetterFromRecords(trailing, initial));
|
|
279
|
+
const correlationId = firstMetadata(trailing, "x-correlation-id", "honua-request-id", "x-request-id", "honua-correlation-id") ??
|
|
280
|
+
firstMetadata(initial, "x-correlation-id", "honua-request-id", "x-request-id", "honua-correlation-id");
|
|
281
|
+
const encodedErrors = firstMetadata(trailing, "honua-error-details") ?? firstMetadata(initial, "honua-error-details");
|
|
282
|
+
return freezeReceipt({
|
|
283
|
+
protocolCode: code,
|
|
284
|
+
kind,
|
|
285
|
+
code: machineCode,
|
|
286
|
+
retryable: parseBoolean(declaredRetryable) ?? GRPC_RETRYABLE_CODES.has(code),
|
|
287
|
+
...(retryAfterMs !== undefined ? { retryAfterMs } : {}),
|
|
288
|
+
...(correlationId ? { correlationId } : {}),
|
|
289
|
+
fieldErrors: parseEncodedFieldFailures(encodedErrors, details),
|
|
290
|
+
protocolMetadata: { initial, trailing },
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function failureKindForHttp(code, transportStatus) {
|
|
294
|
+
if (code === 401 || code === 498 || code === 499)
|
|
295
|
+
return "authentication";
|
|
296
|
+
if (code === 403)
|
|
297
|
+
return "authorization";
|
|
298
|
+
if (code === 404)
|
|
299
|
+
return "not-found";
|
|
300
|
+
if (code === 400 || code === 422)
|
|
301
|
+
return "validation";
|
|
302
|
+
if (code === 409 || code === 412 || code === 428)
|
|
303
|
+
return "conflict";
|
|
304
|
+
if (code === 429)
|
|
305
|
+
return "throttled";
|
|
306
|
+
if (HTTP_RETRYABLE_STATUSES.has(code) || transportStatus >= 500)
|
|
307
|
+
return "unavailable";
|
|
308
|
+
return "unknown";
|
|
309
|
+
}
|
|
310
|
+
function failureKindForGrpc(code) {
|
|
311
|
+
if (code === 16)
|
|
312
|
+
return "authentication";
|
|
313
|
+
if (code === 7)
|
|
314
|
+
return "authorization";
|
|
315
|
+
if (code === 5)
|
|
316
|
+
return "not-found";
|
|
317
|
+
if (code === 3)
|
|
318
|
+
return "validation";
|
|
319
|
+
if (code === 10 || code === 6)
|
|
320
|
+
return "conflict";
|
|
321
|
+
if (code === 8)
|
|
322
|
+
return "throttled";
|
|
323
|
+
if (GRPC_RETRYABLE_CODES.has(code))
|
|
324
|
+
return "unavailable";
|
|
325
|
+
return "unknown";
|
|
326
|
+
}
|
|
327
|
+
function defaultCode(kind) {
|
|
328
|
+
return {
|
|
329
|
+
authentication: "authentication_required",
|
|
330
|
+
authorization: "permission_denied",
|
|
331
|
+
"not-found": "resource_not_found",
|
|
332
|
+
validation: "validation_failed",
|
|
333
|
+
conflict: "resource_conflict",
|
|
334
|
+
throttled: "rate_limit_exceeded",
|
|
335
|
+
unavailable: "service_unavailable",
|
|
336
|
+
unknown: "unknown_failure",
|
|
337
|
+
}[kind];
|
|
338
|
+
}
|
|
339
|
+
function metadataRecord(value) {
|
|
340
|
+
const result = Object.create(null);
|
|
341
|
+
const add = (key, item) => {
|
|
342
|
+
const normalized = key.toLowerCase();
|
|
343
|
+
if (SENSITIVE_METADATA_KEYS.has(normalized))
|
|
344
|
+
return;
|
|
345
|
+
const values = Array.isArray(item)
|
|
346
|
+
? item.filter((entry) => typeof entry === "string")
|
|
347
|
+
: [String(item)];
|
|
348
|
+
if (values.length > 0)
|
|
349
|
+
result[normalized] = Object.freeze(values.slice(0, 20));
|
|
350
|
+
};
|
|
351
|
+
if (value && typeof value.entries === "function") {
|
|
352
|
+
for (const [key, item] of value.entries())
|
|
353
|
+
add(key, item);
|
|
354
|
+
}
|
|
355
|
+
else if (isObject(value)) {
|
|
356
|
+
for (const [key, item] of Object.entries(value))
|
|
357
|
+
add(key, item);
|
|
358
|
+
}
|
|
359
|
+
return Object.freeze(result);
|
|
360
|
+
}
|
|
361
|
+
function metadataGetter(value) {
|
|
362
|
+
if (value && typeof value.get === "function")
|
|
363
|
+
return value;
|
|
364
|
+
return metadataGetterFromRecords(metadataRecord(value));
|
|
365
|
+
}
|
|
366
|
+
function metadataGetterFromRecords(...records) {
|
|
367
|
+
return {
|
|
368
|
+
get(name) {
|
|
369
|
+
for (const record of records) {
|
|
370
|
+
const value = firstMetadata(record, name);
|
|
371
|
+
if (value)
|
|
372
|
+
return value;
|
|
373
|
+
}
|
|
374
|
+
return null;
|
|
375
|
+
},
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
function firstMetadata(record, ...keys) {
|
|
379
|
+
for (const key of keys) {
|
|
380
|
+
const value = record[key.toLowerCase()]?.[0];
|
|
381
|
+
if (value)
|
|
382
|
+
return value;
|
|
383
|
+
}
|
|
384
|
+
return undefined;
|
|
385
|
+
}
|
|
386
|
+
function parseRetryAfter(headers) {
|
|
387
|
+
const value = headers.get("retry-after");
|
|
388
|
+
if (!value)
|
|
389
|
+
return undefined;
|
|
390
|
+
const seconds = Number(value);
|
|
391
|
+
if (Number.isFinite(seconds) && seconds >= 0)
|
|
392
|
+
return seconds * 1_000;
|
|
393
|
+
const target = Date.parse(value);
|
|
394
|
+
return Number.isFinite(target) ? Math.max(0, target - Date.now()) : undefined;
|
|
395
|
+
}
|
|
396
|
+
function parseEncodedFieldFailures(encoded, details) {
|
|
397
|
+
if (encoded) {
|
|
398
|
+
try {
|
|
399
|
+
return parseFieldFailures(JSON.parse(encoded));
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
return [];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return parseFieldFailures(details);
|
|
406
|
+
}
|
|
407
|
+
function parseFieldFailures(value) {
|
|
408
|
+
if (!Array.isArray(value))
|
|
409
|
+
return Object.freeze([]);
|
|
410
|
+
return Object.freeze(value.filter(isObject).map((item) => {
|
|
411
|
+
const code = stringValue(item.code);
|
|
412
|
+
const severity = stringValue(item.severity);
|
|
413
|
+
const path = stringValue(item.path);
|
|
414
|
+
const fieldId = stringValue(item.fieldId);
|
|
415
|
+
const itemIndex = numberValue(item.itemIndex);
|
|
416
|
+
const message = stringValue(item.message);
|
|
417
|
+
return Object.freeze({
|
|
418
|
+
...(code ? { code } : {}),
|
|
419
|
+
...(severity ? { severity } : {}),
|
|
420
|
+
...(path ? { path } : {}),
|
|
421
|
+
...(fieldId ? { fieldId } : {}),
|
|
422
|
+
...(itemIndex !== undefined ? { itemIndex } : {}),
|
|
423
|
+
...(message ? { message } : {}),
|
|
424
|
+
});
|
|
425
|
+
}));
|
|
426
|
+
}
|
|
427
|
+
function freezeReceipt(receipt) {
|
|
428
|
+
return Object.freeze({
|
|
429
|
+
...receipt,
|
|
430
|
+
fieldErrors: Object.freeze([...receipt.fieldErrors]),
|
|
431
|
+
protocolMetadata: Object.freeze({
|
|
432
|
+
initial: receipt.protocolMetadata.initial,
|
|
433
|
+
trailing: receipt.protocolMetadata.trailing,
|
|
434
|
+
}),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function emptyMetadata() {
|
|
438
|
+
return Object.freeze(Object.create(null));
|
|
439
|
+
}
|
|
440
|
+
function scalarCode(value) {
|
|
441
|
+
return typeof value === "number" || typeof value === "string" ? value : undefined;
|
|
442
|
+
}
|
|
443
|
+
function stringValue(value) {
|
|
444
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
445
|
+
}
|
|
446
|
+
function booleanValue(value) {
|
|
447
|
+
return typeof value === "boolean" ? value : undefined;
|
|
448
|
+
}
|
|
449
|
+
function parseBoolean(value) {
|
|
450
|
+
if (value === "true")
|
|
451
|
+
return true;
|
|
452
|
+
if (value === "false")
|
|
453
|
+
return false;
|
|
454
|
+
return undefined;
|
|
455
|
+
}
|
|
456
|
+
function numberValue(value) {
|
|
457
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
458
|
+
}
|
|
459
|
+
function isFailureKind(value) {
|
|
460
|
+
return value !== undefined && FAILURE_KINDS.has(value);
|
|
461
|
+
}
|
|
462
|
+
function isObject(value) {
|
|
463
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
464
|
+
}
|
|
465
|
+
const FAILURE_KINDS = new Set([
|
|
466
|
+
"authentication",
|
|
467
|
+
"authorization",
|
|
468
|
+
"not-found",
|
|
469
|
+
"validation",
|
|
470
|
+
"conflict",
|
|
471
|
+
"throttled",
|
|
472
|
+
"unavailable",
|
|
473
|
+
"unknown",
|
|
474
|
+
]);
|
|
475
|
+
const SENSITIVE_METADATA_KEYS = new Set(["authorization", "cookie", "set-cookie", "x-api-key"]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry-input-sr.d.ts","sourceRoot":"","sources":["../../../src/core/geometry-input-sr.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAqBhF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HonuaGeometryError } from "./errors.js";
|
|
2
|
+
/** GeoServices query geometry defaults to WGS84, never the target layer CRS. */
|
|
3
|
+
export function geometryInputSpatialReference(geometry) {
|
|
4
|
+
if (typeof geometry === "string") {
|
|
5
|
+
try {
|
|
6
|
+
geometry = JSON.parse(geometry);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
// GeoServices also accepts comma-separated coordinate strings.
|
|
10
|
+
return 4326;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (typeof geometry !== "object" || geometry === null || !("spatialReference" in geometry))
|
|
14
|
+
return 4326;
|
|
15
|
+
const sr = geometry.spatialReference;
|
|
16
|
+
if (typeof sr === "object" && sr !== null) {
|
|
17
|
+
if ("wkt" in sr && typeof sr.wkt === "string" && sr.wkt.trim())
|
|
18
|
+
return JSON.stringify(sr);
|
|
19
|
+
if ("latestWkid" in sr && typeof sr.latestWkid === "number" && Number.isInteger(sr.latestWkid) && sr.latestWkid > 0)
|
|
20
|
+
return sr.latestWkid;
|
|
21
|
+
if ("wkid" in sr && typeof sr.wkid === "number" && Number.isInteger(sr.wkid) && sr.wkid > 0)
|
|
22
|
+
return sr.wkid;
|
|
23
|
+
}
|
|
24
|
+
throw new HonuaGeometryError("malformed-geometry", "Query geometry has an invalid spatialReference", {
|
|
25
|
+
operation: "query-input-spatial-reference",
|
|
26
|
+
reason: "invalid-spatial-reference",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geoservices.d.ts","sourceRoot":"","sources":["../../../src/core/geoservices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"geoservices.d.ts","sourceRoot":"","sources":["../../../src/core/geoservices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,i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,CAAC,kBAAkB,CAAC,CA4B7B;AAED,wBAAsB,UAAU,CAC9B,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CA0BlC;AAED,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CAyCtC;AAED,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,2BAA2B,CAAC,CAwCtC;AAED,wBAAsB,SAAS,CAC7B,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CA6CjC;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAiB9B;AAED,wBAAsB,WAAW,CAC/B,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,qBAAqB,CAAC,CA8ChC;AAED,wBAAsB,OAAO,CAAC,SAAS,EAAE,sBAAsB,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA2DpH"}
|
package/core/geoservices.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
+
import { geometryInputSpatialReference } from "./geometry-input-sr.js";
|
|
11
12
|
import { encodeServiceIdPath } from "./path-utils.js";
|
|
12
13
|
// ── Metadata ────────────────────────────────────────────────────
|
|
13
14
|
export async function listServices(transport, format, options = {}) {
|
|
@@ -36,6 +37,17 @@ export async function getMapLayerMetadata(transport, serviceId, layerId, options
|
|
|
36
37
|
return transport.requestCachedMetadataJson(`geoservices-map:${serviceId}:${layerId}`, path, options);
|
|
37
38
|
}
|
|
38
39
|
// ── FeatureServer / MapServer operations ────────────────────────
|
|
40
|
+
// A conservative request-target budget avoids common browser/proxy URL limits.
|
|
41
|
+
// Measure encoded parameters plus the configured base path: Unicode, polygon
|
|
42
|
+
// coordinates, and a deployment prefix (e.g. `/honua`) can all expand the
|
|
43
|
+
// actual request target that `resolveRequestUrl` sends. Explicit caller
|
|
44
|
+
// choices remain authoritative.
|
|
45
|
+
function queryMethod(method, path, params, baseUrl) {
|
|
46
|
+
if (method !== undefined)
|
|
47
|
+
return method;
|
|
48
|
+
const url = new URL(`${baseUrl}${path}?${params.toString()}`, globalThis.location?.href ?? "https://honua.invalid");
|
|
49
|
+
return url.pathname.length + url.search.length > 2_000 ? "POST" : "GET";
|
|
50
|
+
}
|
|
39
51
|
/**
|
|
40
52
|
* REST portion of `client.queryFeatures` (the gRPC-web fast path is
|
|
41
53
|
* orchestrated by the client). Maps directly to the FeatureServer `query`
|
|
@@ -43,16 +55,18 @@ export async function getMapLayerMetadata(transport, serviceId, layerId, options
|
|
|
43
55
|
* `preferBinary` is set.
|
|
44
56
|
*/
|
|
45
57
|
export async function queryFeaturesRest(transport, request, preferBinary) {
|
|
46
|
-
const method = request.method ?? "GET";
|
|
47
|
-
const usePbf = preferBinary && method === "GET";
|
|
48
58
|
const params = new URLSearchParams();
|
|
49
|
-
params.set("f",
|
|
59
|
+
params.set("f", preferBinary && (request.method === undefined || request.method === "GET") ? "pbf" : "json");
|
|
50
60
|
params.set("where", request.where ?? "1=1");
|
|
51
61
|
params.set("outFields", normalizeOutFields(request.outFields));
|
|
52
62
|
params.set("returnGeometry", String(request.returnGeometry ?? true));
|
|
53
63
|
serializeQueryParams(params, request);
|
|
54
64
|
appendQueryExtraParams(params, request);
|
|
55
65
|
const path = `/rest/services/${encodeServiceIdPath(request.serviceId)}/FeatureServer/${request.layerId}/query`;
|
|
66
|
+
const method = queryMethod(request.method, path, params, transport.baseUrl);
|
|
67
|
+
const usePbf = preferBinary && method === "GET";
|
|
68
|
+
if (request.method === undefined && method === "POST" && params.get("f") === "pbf")
|
|
69
|
+
params.set("f", "json");
|
|
56
70
|
if (usePbf) {
|
|
57
71
|
return transport.requestBinaryWithJsonFallback("GET", `${path}?${params.toString()}`, params, request.signal);
|
|
58
72
|
}
|
|
@@ -64,10 +78,9 @@ export async function queryFeaturesRest(transport, request, preferBinary) {
|
|
|
64
78
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
65
79
|
},
|
|
66
80
|
body: params.toString(),
|
|
67
|
-
}, request.signal);
|
|
81
|
+
}, request.signal, request.method === undefined ? { readOnlyQuery: true } : undefined);
|
|
68
82
|
}
|
|
69
83
|
export async function queryMapLayer(transport, request) {
|
|
70
|
-
const method = request.method ?? "GET";
|
|
71
84
|
const params = new URLSearchParams();
|
|
72
85
|
params.set("f", "json");
|
|
73
86
|
params.set("where", request.where ?? "1=1");
|
|
@@ -76,6 +89,7 @@ export async function queryMapLayer(transport, request) {
|
|
|
76
89
|
serializeQueryParams(params, request);
|
|
77
90
|
appendQueryExtraParams(params, request);
|
|
78
91
|
const path = `/rest/services/${encodeServiceIdPath(request.serviceId)}/MapServer/${request.layerId}/query`;
|
|
92
|
+
const method = queryMethod(request.method, path, params, transport.baseUrl);
|
|
79
93
|
if (method === "GET") {
|
|
80
94
|
return transport.requestJson("GET", `${path}?${params.toString()}`, undefined, request.signal);
|
|
81
95
|
}
|
|
@@ -84,7 +98,7 @@ export async function queryMapLayer(transport, request) {
|
|
|
84
98
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
85
99
|
},
|
|
86
100
|
body: params.toString(),
|
|
87
|
-
}, request.signal);
|
|
101
|
+
}, request.signal, request.method === undefined ? { readOnlyQuery: true } : undefined);
|
|
88
102
|
}
|
|
89
103
|
export async function applyEdits(transport, request) {
|
|
90
104
|
const path = `/rest/services/${encodeServiceIdPath(request.serviceId)}/FeatureServer/${request.layerId}/applyEdits`;
|
|
@@ -392,6 +406,7 @@ function serializeQueryParams(params, request) {
|
|
|
392
406
|
params.set("objectIds", Array.isArray(request.objectIds) ? request.objectIds.join(",") : String(request.objectIds));
|
|
393
407
|
}
|
|
394
408
|
if (request.geometry !== undefined) {
|
|
409
|
+
params.set("inSR", String(request.extraParams?.inSR ?? geometryInputSpatialReference(request.geometry)));
|
|
395
410
|
params.set("geometry", typeof request.geometry === "object" && request.geometry !== null
|
|
396
411
|
? JSON.stringify(request.geometry)
|
|
397
412
|
: String(request.geometry));
|
|
@@ -402,6 +417,18 @@ function serializeQueryParams(params, request) {
|
|
|
402
417
|
if (request.spatialRel !== undefined) {
|
|
403
418
|
params.set("spatialRel", request.spatialRel);
|
|
404
419
|
}
|
|
420
|
+
if (request.distance !== undefined) {
|
|
421
|
+
params.set("distance", String(request.distance));
|
|
422
|
+
}
|
|
423
|
+
if (request.units !== undefined) {
|
|
424
|
+
params.set("units", request.units);
|
|
425
|
+
}
|
|
426
|
+
if (request.nearestCount !== undefined) {
|
|
427
|
+
params.set("nearestCount", String(request.nearestCount));
|
|
428
|
+
}
|
|
429
|
+
if (request.returnDistance !== undefined) {
|
|
430
|
+
params.set("returnDistance", String(request.returnDistance));
|
|
431
|
+
}
|
|
405
432
|
if (request.returnDistinctValues !== undefined) {
|
|
406
433
|
params.set("returnDistinctValues", String(request.returnDistinctValues));
|
|
407
434
|
}
|