@honua/react 0.1.1-beta.0 → 0.1.4-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/contract/discovery.d.ts +34 -0
- package/contract/discovery.d.ts.map +1 -1
- package/contract/index.d.ts +7 -5
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +3 -2
- package/contract/pmtiles.d.ts +10 -1
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +10 -2
- package/contract/protocol-module.d.ts +84 -9
- package/contract/protocol-module.d.ts.map +1 -1
- package/contract/query-filter-fes.d.ts +18 -0
- package/contract/query-filter-fes.d.ts.map +1 -0
- package/contract/query-filter-fes.js +122 -0
- package/contract/query-filter.d.ts +300 -0
- package/contract/query-filter.d.ts.map +1 -0
- package/contract/query-filter.js +883 -0
- package/contract/schema.d.ts +12 -0
- package/contract/schema.d.ts.map +1 -1
- package/contract/schema.js +34 -0
- package/contract/source-capability-support.d.ts.map +1 -1
- package/contract/source-capability-support.js +15 -3
- package/contract/source.d.ts +45 -25
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +719 -479
- package/contract/types.d.ts +87 -18
- package/contract/types.d.ts.map +1 -1
- package/contract/widget-source.d.ts.map +1 -1
- package/core/client.d.ts +45 -21
- package/core/client.d.ts.map +1 -1
- package/core/client.js +224 -46
- package/core/error-classifications.d.ts +6 -0
- package/core/error-classifications.d.ts.map +1 -1
- package/core/error-classifications.js +6 -0
- package/core/error-code-registry.d.ts +6 -0
- package/core/error-code-registry.d.ts.map +1 -1
- package/core/error-code-registry.js +6 -0
- package/core/error-envelope.js +2 -0
- package/core/errors.d.ts +1 -1
- package/core/errors.js +1 -1
- package/core/geoparquet-sql.d.ts +68 -4
- package/core/geoparquet-sql.d.ts.map +1 -1
- package/core/geoparquet-sql.js +325 -8
- package/core/odata-write-codec.d.ts.map +1 -1
- package/core/odata-write-codec.js +0 -1
- package/core/odata.d.ts +6 -0
- package/core/odata.d.ts.map +1 -1
- package/core/odata.js +6 -1
- package/core/ogc-processes.d.ts +182 -25
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +602 -30
- package/core/process-runner.d.ts +8 -1
- package/core/process-runner.d.ts.map +1 -1
- package/core/process-runner.js +1 -0
- package/core/protocol-transport.d.ts +2 -0
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/stac.d.ts +31 -0
- package/core/stac.d.ts.map +1 -1
- package/core/stac.js +136 -19
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +273 -68
- package/core/types.d.ts +123 -9
- package/core/types.d.ts.map +1 -1
- package/core/wfs-axis-order.d.ts +18 -0
- package/core/wfs-axis-order.d.ts.map +1 -0
- package/core/wfs-axis-order.js +108 -0
- package/core/wfs-capabilities.d.ts +65 -24
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +237 -27
- package/core/wfs-filter.d.ts +26 -3
- package/core/wfs-filter.d.ts.map +1 -1
- package/core/wfs-filter.js +48 -53
- package/core/wfs-protocol-error.d.ts +12 -0
- package/core/wfs-protocol-error.d.ts.map +1 -0
- package/core/wfs-protocol-error.js +13 -0
- package/core/wfs.d.ts +53 -1
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +251 -29
- package/core/wms-feature-info.d.ts +92 -0
- package/core/wms-feature-info.d.ts.map +1 -0
- package/core/wms-feature-info.js +285 -0
- package/core/wms.d.ts +9 -0
- package/core/wms.d.ts.map +1 -1
- package/core/wms.js +17 -5
- package/esri-compat/event-bus.d.ts +20 -0
- package/esri-compat/event-bus.d.ts.map +1 -1
- package/esri-compat/feature-filter.d.ts +46 -1
- package/esri-compat/feature-filter.d.ts.map +1 -1
- package/esri-compat/feature-filter.js +49 -0
- package/esri-compat/geojson-layer.d.ts +4 -2
- package/esri-compat/geojson-layer.d.ts.map +1 -1
- package/esri-compat/geojson-layer.js +4 -2
- package/esri-compat/identity-manager.js +2 -2
- package/esri-compat/imagery-layer.d.ts +2 -1
- package/esri-compat/imagery-layer.d.ts.map +1 -1
- package/esri-compat/imagery-layer.js +2 -1
- package/esri-compat/layer-list.d.ts +8 -1
- package/esri-compat/layer-list.d.ts.map +1 -1
- package/esri-compat/layer-list.js +11 -4
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +1 -1
- package/esri-compat/locator.d.ts +297 -0
- package/esri-compat/locator.d.ts.map +1 -0
- package/esri-compat/locator.js +579 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -1
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +1 -1
- package/esri-compat/scene-view.d.ts.map +1 -1
- package/esri-compat/time-slider.d.ts +29 -0
- package/esri-compat/time-slider.d.ts.map +1 -1
- package/esri-compat/time-slider.js +117 -0
- package/esri-compat/wfs-layer.d.ts +2 -1
- package/esri-compat/wfs-layer.d.ts.map +1 -1
- package/esri-compat/wfs-layer.js +2 -1
- package/esri-compat/widget-host.d.ts +42 -6
- package/esri-compat/widget-host.d.ts.map +1 -1
- package/esri-compat/widget-host.js +99 -10
- package/generated-app/projection.d.ts.map +1 -1
- package/generated-app/runtime.d.ts.map +1 -1
- package/map/data-to-map-bridge.d.ts +1 -1
- package/map/data-to-map-bridge.d.ts.map +1 -1
- package/map/data-to-map-bridge.js +1 -2
- package/map/honua-map.d.ts.map +1 -1
- package/map/honua-map.js +1 -1
- package/map/index.d.ts +2 -0
- package/map/index.d.ts.map +1 -1
- package/map/index.js +2 -0
- package/map/realtime-reconciliation-adapter.d.ts +98 -0
- package/map/realtime-reconciliation-adapter.d.ts.map +1 -0
- package/map/realtime-reconciliation-adapter.js +84 -0
- package/map/temporal-playback.d.ts +25 -0
- package/map/temporal-playback.d.ts.map +1 -1
- package/map/temporal-playback.js +29 -1
- package/package.json +4 -3
- package/query-planner/canonical-filter.d.ts +30 -0
- package/query-planner/canonical-filter.d.ts.map +1 -0
- package/query-planner/canonical-filter.js +30 -0
- package/query-planner/columnar-plan.d.ts +63 -0
- package/query-planner/columnar-plan.d.ts.map +1 -0
- package/query-planner/columnar-plan.js +94 -0
- package/query-planner/diagnostics.d.ts +3 -3
- package/query-planner/diagnostics.d.ts.map +1 -1
- package/query-planner/diagnostics.js +17 -4
- package/query-planner/duckdb.d.ts.map +1 -1
- package/query-planner/duckdb.js +16 -2
- package/query-planner/execution-context.d.ts.map +1 -1
- package/query-planner/execution-context.js +3 -1
- package/query-planner/executor.d.ts.map +1 -1
- package/query-planner/executor.js +7 -1
- package/query-planner/geoservices.d.ts.map +1 -1
- package/query-planner/geoservices.js +24 -5
- package/query-planner/grpc.d.ts.map +1 -1
- package/query-planner/grpc.js +29 -5
- package/query-planner/index.d.ts +20 -5
- package/query-planner/index.d.ts.map +1 -1
- package/query-planner/index.js +16 -3
- package/query-planner/ir.d.ts +6 -1
- package/query-planner/ir.d.ts.map +1 -1
- package/query-planner/ir.js +63 -1
- package/query-planner/odata-protocol-module.d.ts +54 -0
- package/query-planner/odata-protocol-module.d.ts.map +1 -0
- package/query-planner/odata-protocol-module.js +199 -0
- package/query-planner/odata-v1.d.ts +23 -0
- package/query-planner/odata-v1.d.ts.map +1 -0
- package/query-planner/odata-v1.js +202 -0
- package/query-planner/odata.d.ts +0 -3
- package/query-planner/odata.d.ts.map +1 -1
- package/query-planner/odata.js +0 -143
- package/query-planner/ogc-features.d.ts.map +1 -1
- package/query-planner/ogc-features.js +23 -1
- package/query-planner/planner.d.ts +2 -2
- package/query-planner/planner.d.ts.map +1 -1
- package/query-planner/planner.js +146 -27
- package/query-planner/representation.d.ts +59 -0
- package/query-planner/representation.d.ts.map +1 -0
- package/query-planner/representation.js +140 -0
- package/query-planner/types.d.ts +153 -3
- package/query-planner/types.d.ts.map +1 -1
- package/query-planner/wfs-protocol-module.d.ts +57 -0
- package/query-planner/wfs-protocol-module.d.ts.map +1 -0
- package/query-planner/wfs-protocol-module.js +731 -0
- package/query-planner/wfs-v1.d.ts +41 -0
- package/query-planner/wfs-v1.d.ts.map +1 -0
- package/query-planner/wfs-v1.js +366 -0
- package/query-planner/wfs.d.ts +1 -3
- package/query-planner/wfs.d.ts.map +1 -1
- package/query-planner/wfs.js +1 -70
- package/react/honua-map.d.ts +3 -1
- package/react/honua-map.d.ts.map +1 -1
- package/react/honua-map.js +11 -1
- package/react/hooks.d.ts +1 -1
- package/react/hooks.js +1 -1
- package/react/selection.d.ts.map +1 -1
- package/react/selection.js +0 -0
- package/react/use-mounted-source.d.ts +1 -1
- package/react/use-mounted-source.js +1 -1
- package/realtime/checkpoint-store.d.ts +206 -0
- package/realtime/checkpoint-store.d.ts.map +1 -0
- package/realtime/checkpoint-store.js +504 -0
- package/realtime/contract.d.ts +142 -0
- package/realtime/contract.d.ts.map +1 -0
- package/realtime/contract.js +154 -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 +131 -0
- package/realtime/honua-server.d.ts.map +1 -0
- package/realtime/honua-server.js +302 -0
- package/realtime/index.d.ts +39 -0
- package/realtime/index.d.ts.map +1 -0
- package/realtime/index.js +26 -0
- package/realtime/odata-delta.d.ts +114 -0
- package/realtime/odata-delta.d.ts.map +1 -0
- package/realtime/odata-delta.js +483 -0
- package/realtime/projections.d.ts +30 -0
- package/realtime/projections.d.ts.map +1 -0
- package/realtime/projections.js +51 -0
- package/realtime/reconciliation.d.ts +245 -0
- package/realtime/reconciliation.d.ts.map +1 -0
- package/realtime/reconciliation.js +377 -0
- package/realtime/reducer.d.ts +14 -0
- package/realtime/reducer.d.ts.map +1 -0
- package/realtime/reducer.js +351 -0
- package/realtime/resumable-transport.d.ts +111 -0
- package/realtime/resumable-transport.d.ts.map +1 -0
- package/realtime/resumable-transport.js +406 -0
- package/realtime/resumable.d.ts +104 -0
- package/realtime/resumable.d.ts.map +1 -0
- package/realtime/resumable.js +632 -0
- package/realtime/sse.d.ts +23 -0
- package/realtime/sse.d.ts.map +1 -0
- package/realtime/sse.js +147 -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/realtime/websocket.d.ts +60 -0
- package/realtime/websocket.d.ts.map +1 -0
- package/realtime/websocket.js +157 -0
- package/realtime/wire.d.ts +28 -0
- package/realtime/wire.d.ts.map +1 -0
- package/realtime/wire.js +73 -0
- package/runtime/index.d.ts +6 -2
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +3 -1
- package/runtime/load-package.d.ts +24 -0
- package/runtime/load-package.d.ts.map +1 -1
- package/runtime/load-package.js +45 -1
- package/runtime/maplibre-renderer.d.ts +11 -0
- package/runtime/maplibre-renderer.d.ts.map +1 -1
- package/runtime/maplibre-renderer.js +32 -7
- package/runtime/offline-region-protocol.d.ts +73 -0
- package/runtime/offline-region-protocol.d.ts.map +1 -0
- package/runtime/offline-region-protocol.js +63 -0
- package/runtime/offline-region-style.d.ts +78 -0
- package/runtime/offline-region-style.d.ts.map +1 -0
- package/runtime/offline-region-style.js +147 -0
- package/runtime/pmtiles-protocol.d.ts +7 -8
- package/runtime/pmtiles-protocol.d.ts.map +1 -1
- package/runtime/pmtiles-protocol.js +19 -66
- package/runtime/protocol-registry.d.ts +55 -0
- package/runtime/protocol-registry.d.ts.map +1 -0
- package/runtime/protocol-registry.js +103 -0
- package/runtime/runtime.d.ts +2 -0
- package/runtime/runtime.d.ts.map +1 -1
- package/runtime/runtime.js +6 -1
- package/studio/index.d.ts +24 -7
- package/studio/index.d.ts.map +1 -1
- package/studio/index.js +21 -7
- package/studio/lifecycle-client.d.ts +164 -0
- package/studio/lifecycle-client.d.ts.map +1 -0
- package/studio/lifecycle-client.js +299 -0
- package/studio/lifecycle-errors.d.ts +91 -0
- package/studio/lifecycle-errors.d.ts.map +1 -0
- package/studio/lifecycle-errors.js +77 -0
- package/studio/lifecycle-types.d.ts +321 -0
- package/studio/lifecycle-types.d.ts.map +1 -0
- package/studio/lifecycle-types.js +22 -0
- package/webmap/convert-label.js +0 -1
- package/webmap/convert-symbol.d.ts.map +1 -1
package/core/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HONUA_DEFAULT_METADATA_STALE_IF_ERROR_MS, createHonuaCacheState, honuaCacheValidatorFromHeaders, honuaMetadataRequestHeaders, isHonuaCacheEntryFresh, normalizeHonuaMetadataRequestOptions, withHonuaCacheState, withoutHonuaCacheState, } from "./cache-state.js";
|
|
2
2
|
import { HONUA_MINIMUM_SUPPORTED_SERVER_VERSION, MINIMUM_SUPPORTED_SERVER_RELEASE_CHANNEL, describeCompatibilityError, evaluateCompatibility, parseCompatibilityEnvelope, } from "./compatibility.js";
|
|
3
|
-
import { HonuaHttpError, HonuaNetworkError, HonuaTimeoutError } from "./errors.js";
|
|
3
|
+
import { HonuaAbortError, HonuaHttpError, HonuaNetworkError, HonuaTimeoutError } from "./errors.js";
|
|
4
4
|
import { applyEdits, exportMap, findMap, getFeatureServiceMetadata, getLayerMetadata, getMapLayerMetadata, getMapLegend, getMapServiceMetadata, identifyMap, listServices, queryFeaturesRest, queryMapLayer, queryMapRelatedRecords, queryRelatedRecords, } from "./geoservices.js";
|
|
5
5
|
import { HonuaOdataEntitySet } from "./odata.js";
|
|
6
6
|
import { honuaFacadeFeaturesLayout, resolveOgcEndpointLayout } from "./ogc-endpoint-layout.js";
|
|
@@ -557,8 +557,18 @@ export class HonuaClient {
|
|
|
557
557
|
wmts(serviceId) {
|
|
558
558
|
return new HonuaWmts({ client: this, serviceId });
|
|
559
559
|
}
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
/**
|
|
561
|
+
* Construct the OGC API Processes client wrapper.
|
|
562
|
+
*
|
|
563
|
+
* `basePath` pins every describe / execute / job route to a raw third-party
|
|
564
|
+
* service root (as discovered by `discoverOgcProcesses()`); omitting it uses
|
|
565
|
+
* the Honua facade prefix `/ogc/processes`. Pass the discovery result (or a
|
|
566
|
+
* `/conformance` response) as `conformance` — and optionally
|
|
567
|
+
* `capabilityPolicy: "strict"` — to gate execution and dismissal against what
|
|
568
|
+
* the server actually declares.
|
|
569
|
+
*/
|
|
570
|
+
ogcProcesses(options = {}) {
|
|
571
|
+
return new HonuaOgcProcesses({ ...options, client: this });
|
|
562
572
|
}
|
|
563
573
|
stac() {
|
|
564
574
|
return new HonuaStacSearch({ client: this });
|
|
@@ -575,8 +585,8 @@ export class HonuaClient {
|
|
|
575
585
|
processRunner(adapter) {
|
|
576
586
|
return createHonuaProcessRunner(adapter);
|
|
577
587
|
}
|
|
578
|
-
ogcProcessRunner() {
|
|
579
|
-
return createHonuaProcessRunner(createOgcProcessesAdapter(this.ogcProcesses()));
|
|
588
|
+
ogcProcessRunner(options = {}) {
|
|
589
|
+
return createHonuaProcessRunner(createOgcProcessesAdapter(this.ogcProcesses(options)));
|
|
580
590
|
}
|
|
581
591
|
geoprocessingRunner(serviceId, taskName) {
|
|
582
592
|
return createHonuaProcessRunner(createGeoServicesGpAdapter(this.geoprocessing(serviceId, taskName)));
|
|
@@ -801,6 +811,7 @@ export class HonuaClient {
|
|
|
801
811
|
path,
|
|
802
812
|
method,
|
|
803
813
|
init: {
|
|
814
|
+
...init,
|
|
804
815
|
method,
|
|
805
816
|
headers: await this.composeHeaders(init?.headers),
|
|
806
817
|
body: init?.body ?? null,
|
|
@@ -811,6 +822,9 @@ export class HonuaClient {
|
|
|
811
822
|
callerSignal,
|
|
812
823
|
...(options.okStatuses ? { okStatuses: options.okStatuses } : {}),
|
|
813
824
|
...(options.redirect ? { redirect: options.redirect } : {}),
|
|
825
|
+
...(options.beforeAttempt ? { beforeAttempt: options.beforeAttempt } : {}),
|
|
826
|
+
...(options.beforeReplay ? { beforeReplay: options.beforeReplay } : {}),
|
|
827
|
+
...(options.prepareResponse ? { deadlineThroughFinalize: true } : {}),
|
|
814
828
|
...(options.discardErrorBody
|
|
815
829
|
? {
|
|
816
830
|
errorBody: (response) => {
|
|
@@ -819,9 +833,11 @@ export class HonuaClient {
|
|
|
819
833
|
},
|
|
820
834
|
}
|
|
821
835
|
: {}),
|
|
822
|
-
finalize: async (response, _durationMs, _request, runAfter) => {
|
|
823
|
-
await
|
|
824
|
-
|
|
836
|
+
finalize: async (response, _durationMs, _request, runAfter, deadlineSignal) => {
|
|
837
|
+
const candidate = options.prepareResponse ? await options.prepareResponse(response, deadlineSignal) : response;
|
|
838
|
+
const prepared = candidate === response ? response : preserveResponseSemantics(candidate, response);
|
|
839
|
+
await runAfter(prepared);
|
|
840
|
+
return prepared;
|
|
825
841
|
},
|
|
826
842
|
});
|
|
827
843
|
}
|
|
@@ -1334,6 +1350,10 @@ export class HonuaClient {
|
|
|
1334
1350
|
* to reach `fetch` directly.
|
|
1335
1351
|
*/
|
|
1336
1352
|
async requestText(method, path, options) {
|
|
1353
|
+
if (options?.maxResponseBytes !== undefined &&
|
|
1354
|
+
(!Number.isSafeInteger(options.maxResponseBytes) || options.maxResponseBytes <= 0)) {
|
|
1355
|
+
throw new TypeError("maxResponseBytes must be a positive safe integer.");
|
|
1356
|
+
}
|
|
1337
1357
|
const acceptHeader = options?.accept ?? "*/*";
|
|
1338
1358
|
const headers = { Accept: acceptHeader };
|
|
1339
1359
|
if (options?.contentType)
|
|
@@ -1350,14 +1370,26 @@ export class HonuaClient {
|
|
|
1350
1370
|
};
|
|
1351
1371
|
return this.executeRequest(request, {
|
|
1352
1372
|
callerSignal: options?.signal,
|
|
1353
|
-
|
|
1354
|
-
|
|
1373
|
+
deadlineThroughFinalize: options?.maxResponseBytes !== undefined,
|
|
1374
|
+
errorBody: async (response, deadlineSignal) => {
|
|
1375
|
+
const clone = response.clone();
|
|
1376
|
+
const text = options?.maxResponseBytes === undefined
|
|
1377
|
+
? await clone.text()
|
|
1378
|
+
: new TextDecoder().decode(await readBoundedResponseBytes(clone, options.maxResponseBytes, deadlineSignal));
|
|
1355
1379
|
const contentType = response.headers.get("content-type") ?? acceptHeader;
|
|
1356
1380
|
return text ? { raw: text, contentType } : {};
|
|
1357
1381
|
},
|
|
1358
|
-
finalize: async (response, _durationMs, _request, runAfter) => {
|
|
1359
|
-
|
|
1360
|
-
|
|
1382
|
+
finalize: async (response, _durationMs, _request, runAfter, deadlineSignal) => {
|
|
1383
|
+
if (options?.maxResponseBytes === undefined) {
|
|
1384
|
+
await runAfter();
|
|
1385
|
+
const text = await response.text();
|
|
1386
|
+
const contentType = response.headers.get("content-type") ?? acceptHeader;
|
|
1387
|
+
return { text, contentType, status: response.status };
|
|
1388
|
+
}
|
|
1389
|
+
const bytes = await readBoundedResponseBytes(response, options.maxResponseBytes, deadlineSignal);
|
|
1390
|
+
const prepared = preserveResponseSemantics(bufferedResponse(response, bytes), response);
|
|
1391
|
+
await runAfter(prepared);
|
|
1392
|
+
const text = new TextDecoder().decode(bytes);
|
|
1361
1393
|
const contentType = response.headers.get("content-type") ?? acceptHeader;
|
|
1362
1394
|
return { text, contentType, status: response.status };
|
|
1363
1395
|
},
|
|
@@ -1424,14 +1456,17 @@ export class HonuaClient {
|
|
|
1424
1456
|
let refreshedAuth = false;
|
|
1425
1457
|
for (let attempt = 0;; attempt += 1) {
|
|
1426
1458
|
let response;
|
|
1459
|
+
await options.beforeAttempt?.(cloneRequestContext(request), attempt);
|
|
1427
1460
|
const timeout = createTimeoutSignal(options.callerSignal ?? request.init.signal, this.timeoutMs);
|
|
1428
1461
|
const startTime = performance.now();
|
|
1462
|
+
let fetchCompleted = false;
|
|
1429
1463
|
try {
|
|
1430
1464
|
response = await this.fetchWithSafeRedirects(request.url, {
|
|
1431
1465
|
...request.init,
|
|
1432
1466
|
method: request.method,
|
|
1433
1467
|
signal: timeout.signal,
|
|
1434
1468
|
}, options.redirect);
|
|
1469
|
+
fetchCompleted = true;
|
|
1435
1470
|
}
|
|
1436
1471
|
catch (error) {
|
|
1437
1472
|
const durationMs = performance.now() - startTime;
|
|
@@ -1439,6 +1474,7 @@ export class HonuaClient {
|
|
|
1439
1474
|
? new HonuaTimeoutError(this.timeoutMs ?? 0)
|
|
1440
1475
|
: normalizeNetworkError(error);
|
|
1441
1476
|
if (shouldRetryRequest(this.retryOptions, request.method, attempt, undefined, normalizedError)) {
|
|
1477
|
+
await options.beforeReplay?.(cloneRequestContext(request), undefined, "retry");
|
|
1442
1478
|
await this.sleepBeforeRetry(attempt, undefined, retrySignal);
|
|
1443
1479
|
continue;
|
|
1444
1480
|
}
|
|
@@ -1453,46 +1489,98 @@ export class HonuaClient {
|
|
|
1453
1489
|
throw normalizedError;
|
|
1454
1490
|
}
|
|
1455
1491
|
finally {
|
|
1456
|
-
|
|
1492
|
+
if (!fetchCompleted || !options.deadlineThroughFinalize)
|
|
1493
|
+
timeout.dispose();
|
|
1457
1494
|
}
|
|
1458
1495
|
const durationMs = performance.now() - startTime;
|
|
1459
1496
|
const currentRequest = request;
|
|
1460
|
-
|
|
1497
|
+
let terminalErrorNotification;
|
|
1498
|
+
const beginTerminalErrorNotification = (error, errorDurationMs) => {
|
|
1499
|
+
if (terminalErrorNotification) {
|
|
1500
|
+
return { claimed: false, completion: terminalErrorNotification.completion };
|
|
1501
|
+
}
|
|
1502
|
+
const completion = this.applyErrorInterceptorsConcurrently({
|
|
1503
|
+
request: cloneRequestContext(currentRequest),
|
|
1504
|
+
error,
|
|
1505
|
+
durationMs: errorDurationMs,
|
|
1506
|
+
});
|
|
1507
|
+
terminalErrorNotification = { completion };
|
|
1508
|
+
return { claimed: true, completion };
|
|
1509
|
+
};
|
|
1510
|
+
const awaitDeadlineOwned = async (operation) => {
|
|
1511
|
+
const owned = operation.catch(async (error) => {
|
|
1512
|
+
const notification = beginTerminalErrorNotification(error, performance.now() - startTime);
|
|
1513
|
+
if (notification.claimed) {
|
|
1514
|
+
await notification.completion;
|
|
1515
|
+
}
|
|
1516
|
+
throw error;
|
|
1517
|
+
});
|
|
1518
|
+
return await awaitAbortable(owned, timeout.signal);
|
|
1519
|
+
};
|
|
1520
|
+
const runAfter = async (preparedResponse = response) => {
|
|
1461
1521
|
try {
|
|
1462
|
-
await this.applyAfterInterceptors(cloneRequestContext(currentRequest),
|
|
1522
|
+
await this.applyAfterInterceptors(cloneRequestContext(currentRequest), preparedResponse, durationMs, options.deadlineThroughFinalize ? timeout.signal : undefined);
|
|
1463
1523
|
}
|
|
1464
1524
|
catch (error) {
|
|
1525
|
+
if (options.deadlineThroughFinalize)
|
|
1526
|
+
throw error;
|
|
1465
1527
|
await this.applyErrorInterceptors({ request: cloneRequestContext(currentRequest), error, durationMs });
|
|
1466
1528
|
throw error;
|
|
1467
1529
|
}
|
|
1468
1530
|
};
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
if (!response.ok && !options.okStatuses?.includes(response.status)) {
|
|
1475
|
-
const body = options.errorBody ? await options.errorBody(response) : await parseResponseBody(response.clone());
|
|
1476
|
-
const httpError = toHttpError(response.status, body);
|
|
1477
|
-
const authRefreshedRequest = refreshedAuth
|
|
1478
|
-
? undefined
|
|
1479
|
-
: await this.refreshReplaySafeRequestAuth(request, response.status);
|
|
1480
|
-
if (authRefreshedRequest) {
|
|
1481
|
-
request = authRefreshedRequest;
|
|
1482
|
-
refreshedAuth = true;
|
|
1483
|
-
continue;
|
|
1531
|
+
try {
|
|
1532
|
+
if (options.shortCircuit) {
|
|
1533
|
+
const shorted = await options.shortCircuit(response, durationMs, currentRequest, runAfter);
|
|
1534
|
+
if (shorted)
|
|
1535
|
+
return shorted.value;
|
|
1484
1536
|
}
|
|
1485
|
-
if (
|
|
1486
|
-
|
|
1487
|
-
|
|
1537
|
+
if (!response.ok && !options.okStatuses?.includes(response.status)) {
|
|
1538
|
+
const body = options.errorBody
|
|
1539
|
+
? await options.errorBody(response, options.deadlineThroughFinalize ? timeout.signal : undefined)
|
|
1540
|
+
: await parseResponseBody(response.clone());
|
|
1541
|
+
const httpError = toHttpError(response.status, body);
|
|
1542
|
+
if (!refreshedAuth &&
|
|
1543
|
+
(response.status === 401 || response.status === 403) &&
|
|
1544
|
+
this.authProvider &&
|
|
1545
|
+
DEFAULT_RETRY_METHODS.has(request.method)) {
|
|
1546
|
+
await options.beforeReplay?.(cloneRequestContext(request), response.status, "authentication");
|
|
1547
|
+
}
|
|
1548
|
+
const authRefreshedRequest = refreshedAuth
|
|
1549
|
+
? undefined
|
|
1550
|
+
: await this.refreshReplaySafeRequestAuth(request, response.status);
|
|
1551
|
+
if (authRefreshedRequest) {
|
|
1552
|
+
request = authRefreshedRequest;
|
|
1553
|
+
refreshedAuth = true;
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
if (shouldRetryRequest(this.retryOptions, request.method, attempt, response.status, httpError)) {
|
|
1557
|
+
await options.beforeReplay?.(cloneRequestContext(request), response.status, "retry");
|
|
1558
|
+
await this.sleepBeforeRetry(attempt, response, retrySignal);
|
|
1559
|
+
continue;
|
|
1560
|
+
}
|
|
1561
|
+
const fallback = options.onTerminalError?.(httpError);
|
|
1562
|
+
if (fallback !== undefined)
|
|
1563
|
+
return fallback;
|
|
1564
|
+
if (options.deadlineThroughFinalize) {
|
|
1565
|
+
return await awaitDeadlineOwned(Promise.reject(httpError));
|
|
1566
|
+
}
|
|
1567
|
+
await this.applyErrorInterceptors({ request: cloneRequestContext(request), error: httpError, durationMs });
|
|
1568
|
+
throw httpError;
|
|
1488
1569
|
}
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1570
|
+
const finalized = options.finalize(response, durationMs, currentRequest, runAfter, timeout.signal);
|
|
1571
|
+
return await (options.deadlineThroughFinalize ? awaitDeadlineOwned(finalized) : finalized);
|
|
1572
|
+
}
|
|
1573
|
+
catch (error) {
|
|
1574
|
+
if (!options.deadlineThroughFinalize || !timeout.signal?.aborted)
|
|
1575
|
+
throw error;
|
|
1576
|
+
const terminalError = timeout.didTimeout ? new HonuaTimeoutError(this.timeoutMs ?? 0) : new HonuaAbortError();
|
|
1577
|
+
beginTerminalErrorNotification(terminalError, performance.now() - startTime);
|
|
1578
|
+
throw terminalError;
|
|
1579
|
+
}
|
|
1580
|
+
finally {
|
|
1581
|
+
if (options.deadlineThroughFinalize)
|
|
1582
|
+
timeout.dispose();
|
|
1494
1583
|
}
|
|
1495
|
-
return options.finalize(response, durationMs, currentRequest, runAfter);
|
|
1496
1584
|
}
|
|
1497
1585
|
}
|
|
1498
1586
|
async applyBeforeInterceptors(request) {
|
|
@@ -1514,7 +1602,7 @@ export class HonuaClient {
|
|
|
1514
1602
|
}
|
|
1515
1603
|
return next;
|
|
1516
1604
|
}
|
|
1517
|
-
async applyAfterInterceptors(request, response, durationMs) {
|
|
1605
|
+
async applyAfterInterceptors(request, response, durationMs, deadlineSignal) {
|
|
1518
1606
|
for (const interceptor of this.interceptors) {
|
|
1519
1607
|
// Only clone the response for interceptors that actually inspect it. This
|
|
1520
1608
|
// keeps the no-after-interceptor hot path free of `Response.clone()` (so
|
|
@@ -1523,12 +1611,16 @@ export class HonuaClient {
|
|
|
1523
1611
|
if (!interceptor.after) {
|
|
1524
1612
|
continue;
|
|
1525
1613
|
}
|
|
1614
|
+
if (deadlineSignal?.aborted)
|
|
1615
|
+
throw new HonuaAbortError();
|
|
1526
1616
|
const context = {
|
|
1527
1617
|
request: cloneRequestContext(request),
|
|
1528
1618
|
response: response.clone(),
|
|
1529
1619
|
durationMs,
|
|
1530
1620
|
};
|
|
1531
1621
|
await interceptor.after(context);
|
|
1622
|
+
if (deadlineSignal?.aborted)
|
|
1623
|
+
throw new HonuaAbortError();
|
|
1532
1624
|
}
|
|
1533
1625
|
}
|
|
1534
1626
|
/** Whether any registered interceptor inspects responses (`after` hook). */
|
|
@@ -1545,6 +1637,21 @@ export class HonuaClient {
|
|
|
1545
1637
|
}
|
|
1546
1638
|
}
|
|
1547
1639
|
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Start every terminal error hook independently so one nonsettling hook
|
|
1642
|
+
* cannot prevent later hooks from observing the same failure. Each hook is
|
|
1643
|
+
* contained so a detached deadline notification can never reject unhandled.
|
|
1644
|
+
*/
|
|
1645
|
+
async applyErrorInterceptorsConcurrently(context) {
|
|
1646
|
+
await Promise.all(this.interceptors.map(async (interceptor) => {
|
|
1647
|
+
try {
|
|
1648
|
+
await interceptor.error?.(context);
|
|
1649
|
+
}
|
|
1650
|
+
catch {
|
|
1651
|
+
// Preserve the terminal request failure; interceptor failures should not mask it.
|
|
1652
|
+
}
|
|
1653
|
+
}));
|
|
1654
|
+
}
|
|
1548
1655
|
async refreshReplaySafeRequestAuth(request, statusCode) {
|
|
1549
1656
|
if ((statusCode !== 401 && statusCode !== 403) ||
|
|
1550
1657
|
!this.authProvider ||
|
|
@@ -1604,13 +1711,17 @@ async function parseResponseBody(response, maxResponseBytes) {
|
|
|
1604
1711
|
return { raw: text };
|
|
1605
1712
|
}
|
|
1606
1713
|
}
|
|
1607
|
-
async function readBoundedResponseBytes(response, maximum) {
|
|
1714
|
+
async function readBoundedResponseBytes(response, maximum, signal) {
|
|
1715
|
+
if (signal?.aborted) {
|
|
1716
|
+
void response.body?.cancel().catch(() => undefined);
|
|
1717
|
+
throw new HonuaAbortError();
|
|
1718
|
+
}
|
|
1608
1719
|
const advertised = response.headers.get("content-length");
|
|
1609
1720
|
if (advertised !== null) {
|
|
1610
1721
|
const length = Number(advertised);
|
|
1611
1722
|
if (Number.isFinite(length) && length > maximum) {
|
|
1612
|
-
|
|
1613
|
-
throw new HonuaNetworkError(`
|
|
1723
|
+
void response.body?.cancel().catch(() => undefined);
|
|
1724
|
+
throw new HonuaNetworkError(`Response body exceeds the configured ${maximum}-byte limit.`, undefined);
|
|
1614
1725
|
}
|
|
1615
1726
|
}
|
|
1616
1727
|
if (!response.body)
|
|
@@ -1618,20 +1729,32 @@ async function readBoundedResponseBytes(response, maximum) {
|
|
|
1618
1729
|
const reader = response.body.getReader();
|
|
1619
1730
|
const chunks = [];
|
|
1620
1731
|
let total = 0;
|
|
1732
|
+
const abort = () => void reader.cancel().catch(() => undefined);
|
|
1733
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
1621
1734
|
try {
|
|
1622
1735
|
for (;;) {
|
|
1736
|
+
if (signal?.aborted)
|
|
1737
|
+
throw new HonuaAbortError();
|
|
1623
1738
|
const { done, value } = await reader.read();
|
|
1739
|
+
if (signal?.aborted)
|
|
1740
|
+
throw new HonuaAbortError();
|
|
1624
1741
|
if (done)
|
|
1625
1742
|
break;
|
|
1626
1743
|
total += value.byteLength;
|
|
1627
1744
|
if (total > maximum) {
|
|
1628
|
-
|
|
1629
|
-
throw new HonuaNetworkError(`
|
|
1745
|
+
void reader.cancel().catch(() => undefined);
|
|
1746
|
+
throw new HonuaNetworkError(`Response body exceeds the configured ${maximum}-byte limit.`, undefined);
|
|
1630
1747
|
}
|
|
1631
1748
|
chunks.push(value);
|
|
1632
1749
|
}
|
|
1633
1750
|
}
|
|
1751
|
+
catch (error) {
|
|
1752
|
+
if (signal?.aborted)
|
|
1753
|
+
throw new HonuaAbortError();
|
|
1754
|
+
throw error;
|
|
1755
|
+
}
|
|
1634
1756
|
finally {
|
|
1757
|
+
signal?.removeEventListener("abort", abort);
|
|
1635
1758
|
reader.releaseLock();
|
|
1636
1759
|
}
|
|
1637
1760
|
const bytes = new Uint8Array(total);
|
|
@@ -1642,6 +1765,14 @@ async function readBoundedResponseBytes(response, maximum) {
|
|
|
1642
1765
|
}
|
|
1643
1766
|
return bytes;
|
|
1644
1767
|
}
|
|
1768
|
+
function bufferedResponse(source, bytes) {
|
|
1769
|
+
const body = source.status === 204 || source.status === 205 || source.status === 304 ? null : bytes.slice();
|
|
1770
|
+
return new Response(body, {
|
|
1771
|
+
status: source.status,
|
|
1772
|
+
statusText: source.statusText,
|
|
1773
|
+
headers: source.headers,
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1645
1776
|
function isObject(value) {
|
|
1646
1777
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1647
1778
|
}
|
|
@@ -1672,6 +1803,53 @@ function cloneRequestContext(request) {
|
|
|
1672
1803
|
},
|
|
1673
1804
|
};
|
|
1674
1805
|
}
|
|
1806
|
+
function awaitAbortable(value, signal) {
|
|
1807
|
+
const pending = Promise.resolve(value);
|
|
1808
|
+
if (!signal)
|
|
1809
|
+
return pending;
|
|
1810
|
+
if (signal.aborted) {
|
|
1811
|
+
void pending.catch(() => undefined);
|
|
1812
|
+
return Promise.reject(new HonuaAbortError());
|
|
1813
|
+
}
|
|
1814
|
+
return new Promise((resolve, reject) => {
|
|
1815
|
+
let settled = false;
|
|
1816
|
+
const finish = (callback) => {
|
|
1817
|
+
if (settled)
|
|
1818
|
+
return;
|
|
1819
|
+
settled = true;
|
|
1820
|
+
signal.removeEventListener("abort", abort);
|
|
1821
|
+
callback();
|
|
1822
|
+
};
|
|
1823
|
+
const abort = () => finish(() => reject(new HonuaAbortError()));
|
|
1824
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
1825
|
+
pending.then((result) => finish(() => resolve(result)), (error) => finish(() => reject(error)));
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* A response prepared under a tighter body boundary still represents the same
|
|
1830
|
+
* physical fetch. Preserve the fetch-owned semantic properties for public
|
|
1831
|
+
* interceptors and for every defensive clone they receive.
|
|
1832
|
+
*/
|
|
1833
|
+
function preserveResponseSemantics(response, source) {
|
|
1834
|
+
return decorateResponseSemantics(response, Object.freeze({
|
|
1835
|
+
url: source.url,
|
|
1836
|
+
type: source.type,
|
|
1837
|
+
redirected: source.redirected,
|
|
1838
|
+
}));
|
|
1839
|
+
}
|
|
1840
|
+
function decorateResponseSemantics(response, semantics) {
|
|
1841
|
+
const nativeClone = response.clone.bind(response);
|
|
1842
|
+
Object.defineProperties(response, {
|
|
1843
|
+
url: { configurable: true, value: semantics.url },
|
|
1844
|
+
type: { configurable: true, value: semantics.type },
|
|
1845
|
+
redirected: { configurable: true, value: semantics.redirected },
|
|
1846
|
+
clone: {
|
|
1847
|
+
configurable: true,
|
|
1848
|
+
value: () => decorateResponseSemantics(nativeClone(), semantics),
|
|
1849
|
+
},
|
|
1850
|
+
});
|
|
1851
|
+
return response;
|
|
1852
|
+
}
|
|
1675
1853
|
function cloneHeadersInit(headers) {
|
|
1676
1854
|
return mergeHeaders(headers);
|
|
1677
1855
|
}
|
|
@@ -48,6 +48,7 @@ export declare const HONUA_ERROR_RUNTIME_CLASSIFICATIONS: Readonly<{
|
|
|
48
48
|
readonly "query.planning.fallback-disabled": HonuaErrorRuntimeClassification;
|
|
49
49
|
readonly "query.planning.unsafe-materialization": HonuaErrorRuntimeClassification;
|
|
50
50
|
readonly "query.execution.invalid-plan": HonuaErrorRuntimeClassification;
|
|
51
|
+
readonly "query.execution.wfs-protocol": HonuaErrorRuntimeClassification;
|
|
51
52
|
readonly "query.execution.plan-context-mismatch": HonuaErrorRuntimeClassification;
|
|
52
53
|
readonly "query.execution.unsafe-materialization": HonuaErrorRuntimeClassification;
|
|
53
54
|
readonly "query.execution.invalid-resource-handle": HonuaErrorRuntimeClassification;
|
|
@@ -102,9 +103,12 @@ export declare const HONUA_ERROR_RUNTIME_CLASSIFICATIONS: Readonly<{
|
|
|
102
103
|
readonly "realtime.checkpoint.invalid": HonuaErrorRuntimeClassification;
|
|
103
104
|
readonly "realtime.sequence.gap": HonuaErrorRuntimeClassification;
|
|
104
105
|
readonly "realtime.protocol.terminal": HonuaErrorRuntimeClassification;
|
|
106
|
+
readonly "realtime.reconciliation.disposed": HonuaErrorRuntimeClassification;
|
|
107
|
+
readonly "realtime.reconciliation.invalid-option": HonuaErrorRuntimeClassification;
|
|
105
108
|
readonly "offline.region.validation": HonuaErrorRuntimeClassification;
|
|
106
109
|
readonly "offline.region.quota": HonuaErrorRuntimeClassification;
|
|
107
110
|
readonly "offline.region.integrity": HonuaErrorRuntimeClassification;
|
|
111
|
+
readonly "offline.region.miss": HonuaErrorRuntimeClassification;
|
|
108
112
|
readonly "offline.cancelled": HonuaErrorRuntimeClassification;
|
|
109
113
|
readonly "offline.transport.failure": HonuaErrorRuntimeClassification;
|
|
110
114
|
readonly "offline.transport.transient": HonuaErrorRuntimeClassification;
|
|
@@ -149,5 +153,7 @@ export declare const HONUA_ERROR_RUNTIME_CLASSIFICATIONS: Readonly<{
|
|
|
149
153
|
readonly "app.data-load-failed": HonuaErrorRuntimeClassification;
|
|
150
154
|
readonly "app.render-failed": HonuaErrorRuntimeClassification;
|
|
151
155
|
readonly "app.disposed": HonuaErrorRuntimeClassification;
|
|
156
|
+
readonly "app.export-unsafe": HonuaErrorRuntimeClassification;
|
|
157
|
+
readonly "app.export-failed": HonuaErrorRuntimeClassification;
|
|
152
158
|
}>;
|
|
153
159
|
//# sourceMappingURL=error-classifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-classifications.d.ts","sourceRoot":"","sources":["../../../src/core/error-classifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAkB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAErG;;;;;;;;GAQG;AACH,MAAM,MAAM,+BAA+B,GAAG,SAAS;IACrD,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,kBAAkB;IAC5B,SAAS,EAAE,OAAO;CACnB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,mCAAmC
|
|
1
|
+
{"version":3,"file":"error-classifications.d.ts","sourceRoot":"","sources":["../../../src/core/error-classifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAkB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAErG;;;;;;;;GAQG;AACH,MAAM,MAAM,+BAA+B,GAAG,SAAS;IACrD,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,kBAAkB;IAC5B,SAAS,EAAE,OAAO;CACnB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6I6B,CAAC"}
|
|
@@ -33,6 +33,7 @@ export const HONUA_ERROR_RUNTIME_CLASSIFICATIONS = Object.freeze({
|
|
|
33
33
|
"query.planning.fallback-disabled": runtimeClassification("query", "capability", false),
|
|
34
34
|
"query.planning.unsafe-materialization": runtimeClassification("query", "validation", false),
|
|
35
35
|
"query.execution.invalid-plan": runtimeClassification("query", "validation", false),
|
|
36
|
+
"query.execution.wfs-protocol": runtimeClassification("query", "protocol", false),
|
|
36
37
|
"query.execution.plan-context-mismatch": runtimeClassification("query", "validation", false),
|
|
37
38
|
"query.execution.unsafe-materialization": runtimeClassification("query", "validation", false),
|
|
38
39
|
"query.execution.invalid-resource-handle": runtimeClassification("query", "validation", false),
|
|
@@ -87,9 +88,12 @@ export const HONUA_ERROR_RUNTIME_CLASSIFICATIONS = Object.freeze({
|
|
|
87
88
|
"realtime.checkpoint.invalid": runtimeClassification("realtime", "validation", false),
|
|
88
89
|
"realtime.sequence.gap": runtimeClassification("realtime", "protocol", true),
|
|
89
90
|
"realtime.protocol.terminal": runtimeClassification("realtime", "protocol", false),
|
|
91
|
+
"realtime.reconciliation.disposed": runtimeClassification("realtime", "validation", false),
|
|
92
|
+
"realtime.reconciliation.invalid-option": runtimeClassification("realtime", "validation", false),
|
|
90
93
|
"offline.region.validation": runtimeClassification("offline", "validation", false),
|
|
91
94
|
"offline.region.quota": runtimeClassification("offline", "validation", false),
|
|
92
95
|
"offline.region.integrity": runtimeClassification("offline", "protocol", false),
|
|
96
|
+
"offline.region.miss": runtimeClassification("offline", "validation", false),
|
|
93
97
|
"offline.cancelled": runtimeClassification("offline", "cancellation", false),
|
|
94
98
|
"offline.transport.failure": runtimeClassification("offline", "network", false),
|
|
95
99
|
"offline.transport.transient": runtimeClassification("offline", "network", true),
|
|
@@ -134,6 +138,8 @@ export const HONUA_ERROR_RUNTIME_CLASSIFICATIONS = Object.freeze({
|
|
|
134
138
|
"app.data-load-failed": runtimeClassification("app", "internal", false),
|
|
135
139
|
"app.render-failed": runtimeClassification("app", "internal", false),
|
|
136
140
|
"app.disposed": runtimeClassification("app", "validation", false),
|
|
141
|
+
"app.export-unsafe": runtimeClassification("app", "validation", false),
|
|
142
|
+
"app.export-failed": runtimeClassification("app", "internal", false),
|
|
137
143
|
});
|
|
138
144
|
function runtimeClassification(domain, category, retryable) {
|
|
139
145
|
return Object.freeze([domain, category, retryable]);
|
|
@@ -52,6 +52,7 @@ export declare const HONUA_ERROR_CODE_REGISTRY: Readonly<{
|
|
|
52
52
|
readonly "query.planning.fallback-disabled": HonuaErrorCodeDescriptor;
|
|
53
53
|
readonly "query.planning.unsafe-materialization": HonuaErrorCodeDescriptor;
|
|
54
54
|
readonly "query.execution.invalid-plan": HonuaErrorCodeDescriptor;
|
|
55
|
+
readonly "query.execution.wfs-protocol": HonuaErrorCodeDescriptor;
|
|
55
56
|
readonly "query.execution.plan-context-mismatch": HonuaErrorCodeDescriptor;
|
|
56
57
|
readonly "query.execution.unsafe-materialization": HonuaErrorCodeDescriptor;
|
|
57
58
|
readonly "query.execution.invalid-resource-handle": HonuaErrorCodeDescriptor;
|
|
@@ -106,9 +107,12 @@ export declare const HONUA_ERROR_CODE_REGISTRY: Readonly<{
|
|
|
106
107
|
readonly "realtime.checkpoint.invalid": HonuaErrorCodeDescriptor;
|
|
107
108
|
readonly "realtime.sequence.gap": HonuaErrorCodeDescriptor;
|
|
108
109
|
readonly "realtime.protocol.terminal": HonuaErrorCodeDescriptor;
|
|
110
|
+
readonly "realtime.reconciliation.disposed": HonuaErrorCodeDescriptor;
|
|
111
|
+
readonly "realtime.reconciliation.invalid-option": HonuaErrorCodeDescriptor;
|
|
109
112
|
readonly "offline.region.validation": HonuaErrorCodeDescriptor;
|
|
110
113
|
readonly "offline.region.quota": HonuaErrorCodeDescriptor;
|
|
111
114
|
readonly "offline.region.integrity": HonuaErrorCodeDescriptor;
|
|
115
|
+
readonly "offline.region.miss": HonuaErrorCodeDescriptor;
|
|
112
116
|
readonly "offline.cancelled": HonuaErrorCodeDescriptor;
|
|
113
117
|
readonly "offline.transport.failure": HonuaErrorCodeDescriptor;
|
|
114
118
|
readonly "offline.transport.transient": HonuaErrorCodeDescriptor;
|
|
@@ -153,6 +157,8 @@ export declare const HONUA_ERROR_CODE_REGISTRY: Readonly<{
|
|
|
153
157
|
readonly "app.data-load-failed": HonuaErrorCodeDescriptor;
|
|
154
158
|
readonly "app.render-failed": HonuaErrorCodeDescriptor;
|
|
155
159
|
readonly "app.disposed": HonuaErrorCodeDescriptor;
|
|
160
|
+
readonly "app.export-unsafe": HonuaErrorCodeDescriptor;
|
|
161
|
+
readonly "app.export-failed": HonuaErrorCodeDescriptor;
|
|
156
162
|
}>;
|
|
157
163
|
export type HonuaErrorCode = keyof typeof HONUA_ERROR_CODE_REGISTRY;
|
|
158
164
|
//# sourceMappingURL=error-code-registry.d.ts.map
|
|
@@ -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,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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0kBwB,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,yBAAyB,CAAC"}
|
|
@@ -36,6 +36,7 @@ export const HONUA_ERROR_CODE_REGISTRY = Object.freeze({
|
|
|
36
36
|
"query.planning.fallback-disabled": classification("query", "capability", false, "Required local fallback is disabled"),
|
|
37
37
|
"query.planning.unsafe-materialization": classification("query", "validation", false, "Planned local materialization exceeds its safety bound"),
|
|
38
38
|
"query.execution.invalid-plan": classification("query", "validation", false, "Query plan is invalid"),
|
|
39
|
+
"query.execution.wfs-protocol": classification("query", "protocol", false, "WFS protocol evidence or response is invalid"),
|
|
39
40
|
"query.execution.plan-context-mismatch": classification("query", "validation", false, "Execution context does not match the accepted query plan"),
|
|
40
41
|
"query.execution.unsafe-materialization": classification("query", "validation", false, "Query execution exceeded its materialization bound"),
|
|
41
42
|
"query.execution.invalid-resource-handle": classification("query", "validation", false, "Query resource handle is invalid"),
|
|
@@ -90,9 +91,12 @@ export const HONUA_ERROR_CODE_REGISTRY = Object.freeze({
|
|
|
90
91
|
"realtime.checkpoint.invalid": classification("realtime", "validation", false, "Realtime checkpoint or resume context is invalid"),
|
|
91
92
|
"realtime.sequence.gap": classification("realtime", "protocol", true, "Realtime ordering requires a replacement snapshot"),
|
|
92
93
|
"realtime.protocol.terminal": classification("realtime", "protocol", false, "Realtime delivery reached a terminal failure"),
|
|
94
|
+
"realtime.reconciliation.disposed": classification("realtime", "validation", false, "Realtime reconciliation controller, cache, or adapter is disposed"),
|
|
95
|
+
"realtime.reconciliation.invalid-option": classification("realtime", "validation", false, "Realtime reconciliation option is invalid"),
|
|
93
96
|
"offline.region.validation": classification("offline", "validation", false, "Offline region input or lifecycle state is invalid"),
|
|
94
97
|
"offline.region.quota": classification("offline", "validation", false, "Offline region exceeds a logical storage quota"),
|
|
95
98
|
"offline.region.integrity": classification("offline", "protocol", false, "Offline resource integrity verification failed"),
|
|
99
|
+
"offline.region.miss": classification("offline", "validation", false, "Offline region does not cover the requested read"),
|
|
96
100
|
"offline.cancelled": classification("offline", "cancellation", false, "Offline operation was cancelled"),
|
|
97
101
|
"offline.transport.failure": classification("offline", "network", false, "Offline resource or replica transport failed without a transient classification"),
|
|
98
102
|
"offline.transport.transient": classification("offline", "network", true, "Offline resource or replica transport failed transiently"),
|
|
@@ -137,6 +141,8 @@ export const HONUA_ERROR_CODE_REGISTRY = Object.freeze({
|
|
|
137
141
|
"app.data-load-failed": classification("app", "internal", false, "Generated app feature data failed to load"),
|
|
138
142
|
"app.render-failed": classification("app", "internal", false, "Generated app render failed"),
|
|
139
143
|
"app.disposed": classification("app", "validation", false, "Generated app runtime is disposed"),
|
|
144
|
+
"app.export-unsafe": classification("app", "validation", false, "Component export refused because the artifact could not be proven credential-free"),
|
|
145
|
+
"app.export-failed": classification("app", "internal", false, "Component export adapter failed to produce an artifact"),
|
|
140
146
|
});
|
|
141
147
|
function classification(domain, category, retryable, summary) {
|
|
142
148
|
return Object.freeze({ domain, category, retryable, summary });
|
package/core/error-envelope.js
CHANGED
|
@@ -326,6 +326,7 @@ const SAFE_ERROR_NAMES = new Set([
|
|
|
326
326
|
"HonuaMapPackageError",
|
|
327
327
|
"HonuaNetworkError",
|
|
328
328
|
"HonuaOfflineRegionError",
|
|
329
|
+
"HonuaOfflineEditQueueError",
|
|
329
330
|
"HonuaPluginRegistryError",
|
|
330
331
|
"HonuaQueryPlanExecutionError",
|
|
331
332
|
"HonuaQueryPlanningError",
|
|
@@ -336,6 +337,7 @@ const SAFE_ERROR_NAMES = new Set([
|
|
|
336
337
|
"HonuaTemporalPlaybackError",
|
|
337
338
|
"HonuaTimeoutError",
|
|
338
339
|
"HonuaWfsExceptionError",
|
|
340
|
+
"HonuaWfsProtocolError",
|
|
339
341
|
"HonuaWmsCapabilitiesParseError",
|
|
340
342
|
"HonuaWmtsCapabilitiesParseError",
|
|
341
343
|
"NetworkError",
|
package/core/errors.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* } from "@honua/sdk-js";
|
|
16
16
|
*
|
|
17
17
|
* try {
|
|
18
|
-
* await dataset.source("parcels")!.queryAll({
|
|
18
|
+
* await dataset.source("parcels")!.queryAll({ pagination: { limit: 100 } });
|
|
19
19
|
* } catch (error) {
|
|
20
20
|
* if (!isHonuaError(error)) throw error;
|
|
21
21
|
* if (error instanceof HonuaCapabilityNotSupportedError) return fallback();
|
package/core/errors.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* } from "@honua/sdk-js";
|
|
16
16
|
*
|
|
17
17
|
* try {
|
|
18
|
-
* await dataset.source("parcels")!.queryAll({
|
|
18
|
+
* await dataset.source("parcels")!.queryAll({ pagination: { limit: 100 } });
|
|
19
19
|
* } catch (error) {
|
|
20
20
|
* if (!isHonuaError(error)) throw error;
|
|
21
21
|
* if (error instanceof HonuaCapabilityNotSupportedError) return fallback();
|