@honua/react 0.1.9-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 +2 -0
- package/control-plane/admin-client.d.ts.map +1 -1
- package/control-plane/admin-client.js +32 -1
- package/control-plane/client.d.ts +1 -1
- package/control-plane/client.d.ts.map +1 -1
- package/control-plane/client.js +124 -8
- package/control-plane/commands/catalog.d.ts +7 -7
- package/control-plane/commands/catalog.d.ts.map +1 -1
- package/control-plane/commands/catalog.js +27 -15
- package/control-plane/commands/runtime.d.ts +6 -6
- package/control-plane/commands/runtime.d.ts.map +1 -1
- package/control-plane/commands/runtime.js +26 -14
- package/control-plane/commands/types.d.ts +4 -2
- package/control-plane/commands/types.d.ts.map +1 -1
- package/control-plane/generated/admin-api.d.ts +6 -4
- package/control-plane/generated/admin-api.d.ts.map +1 -1
- package/control-plane/generated/admin-api.js +2 -2
- package/control-plane/generated/admin-operations.d.ts +7 -7
- package/control-plane/generated/admin-operations.d.ts.map +1 -1
- package/control-plane/generated/admin-operations.js +9 -9
- package/control-plane/index.d.ts +1 -1
- package/control-plane/index.d.ts.map +1 -1
- package/control-plane/index.js +1 -1
- package/core/client.d.ts.map +1 -1
- package/core/client.js +28 -30
- 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.map +1 -1
- package/core/grpc-adapter.js +11 -3
- package/core/pbf-decoder.d.ts.map +1 -1
- package/core/pbf-decoder.js +16 -4
- 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/types.d.ts +14 -3
- package/core/types.d.ts.map +1 -1
- 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/map/webmap-maplibre.d.ts +2 -1
- package/map/webmap-maplibre.d.ts.map +1 -1
- package/map/webmap-maplibre.js +3 -0
- package/package.json +3 -3
- package/query-planner/geoservices.d.ts.map +1 -1
- package/query-planner/geoservices.js +2 -0
- package/query-planner/types.d.ts +2 -0
- 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/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/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 +8 -6
- package/studio/index.d.ts.map +1 -1
- package/studio/index.js +6 -5
- package/studio/lifecycle-client.d.ts +3 -3
- package/studio/lifecycle-client.d.ts.map +1 -1
- package/studio/lifecycle-client.js +41 -22
- package/studio/lifecycle-types.d.ts +56 -77
- package/studio/lifecycle-types.d.ts.map +1 -1
- package/studio/lifecycle-types.js +5 -12
- 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/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/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,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EAEpB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAIpB,wBAAsB,YAAY,CAChC,SAAS,EAAE,sBAAsB,EACjC,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,qBAAqB,CAAC,CAIhC;AAED,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,sBAAsB,EACjC,SAAS,EAAE,MAAM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,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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-adapter.d.ts","sourceRoot":"","sources":["../../../src/core/grpc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,WAAW,EAWhB,KAAK,qBAAqB,EAM3B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"grpc-adapter.d.ts","sourceRoot":"","sources":["../../../src/core/grpc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,WAAW,EAWhB,KAAK,qBAAqB,EAM3B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EAEZ,sBAAsB,EACtB,kBAAkB,EAElB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AA6GpB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,6EA6IhE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,qBAAqB,GAC9B,kBAAkB,GAAG,kBAAkB,GAAG,sBAAsB,GAAG,mBAAmB,CAkDxF;AA0UD;;;;GAIG;AACH,wBAAuB,gBAAgB,CACrC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,GACjC,cAAc,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,CAiBjD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAiBtD"}
|
package/core/grpc-adapter.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { create } from "@bufbuild/protobuf";
|
|
2
2
|
import { CoordinateSchema, CoordinateSequenceSchema, DistanceUnit, FieldType, GeometrySchema, GeometryType, MultiPointGeometrySchema, PointGeometrySchema, PolygonGeometrySchema, PolylineGeometrySchema, QueryFeaturesRequestSchema, SpatialFilterSchema, SpatialReferenceSchema, SpatialRelationship, StatisticDefinitionSchema, StatisticType, } from "../gen/geospatial/v1/index.js";
|
|
3
3
|
import { HonuaGrpcError } from "./errors.js";
|
|
4
|
+
import { geometryInputSpatialReference } from "./geometry-input-sr.js";
|
|
4
5
|
/**
|
|
5
6
|
* Maps proto FieldType enum values to Esri-style field type strings
|
|
6
7
|
* used in the JSON response shape.
|
|
@@ -170,8 +171,11 @@ export function toProtoQueryRequest(request) {
|
|
|
170
171
|
else {
|
|
171
172
|
filter.spatialRelationship = SpatialRelationship.INTERSECTS;
|
|
172
173
|
}
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
const inputSpatialReference = spatialReference ??
|
|
175
|
+
toProtoSpatialReference(request.extraParams?.inSR) ??
|
|
176
|
+
toProtoSpatialReference(geometryInputSpatialReference(request.geometry));
|
|
177
|
+
if (inputSpatialReference) {
|
|
178
|
+
filter.spatialReference = inputSpatialReference;
|
|
175
179
|
}
|
|
176
180
|
const distance = request.distance ?? parseExtraNumber(request.extraParams ?? {}, "distance");
|
|
177
181
|
if (distance !== undefined) {
|
|
@@ -577,7 +581,11 @@ export async function* streamProtoPages(stream) {
|
|
|
577
581
|
*/
|
|
578
582
|
export function wrapConnectError(error) {
|
|
579
583
|
if (error instanceof Error && "code" in error && typeof error.code === "number") {
|
|
580
|
-
|
|
584
|
+
const candidate = error;
|
|
585
|
+
return new HonuaGrpcError(candidate.code, error.message, "rawMessage" in error ? candidate.rawMessage : undefined, {
|
|
586
|
+
initialMetadata: candidate.headers ?? candidate.initialMetadata,
|
|
587
|
+
trailingMetadata: candidate.trailers ?? candidate.trailer ?? candidate.metadata,
|
|
588
|
+
});
|
|
581
589
|
}
|
|
582
590
|
if (error instanceof Error) {
|
|
583
591
|
return error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbf-decoder.d.ts","sourceRoot":"","sources":["../../../src/core/pbf-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBACpB,OAAO,EAAE,MAAM;CAInC;
|
|
1
|
+
{"version":3,"file":"pbf-decoder.d.ts","sourceRoot":"","sources":["../../../src/core/pbf-decoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBACpB,OAAO,EAAE,MAAM;CAInC;AAyoBD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiChG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAGzD"}
|
package/core/pbf-decoder.js
CHANGED
|
@@ -359,6 +359,14 @@ function decodeValue(reader) {
|
|
|
359
359
|
else
|
|
360
360
|
reader.skip(wire);
|
|
361
361
|
break;
|
|
362
|
+
case 8: // sint64_value (zigzag, used by ArcGIS for timestamp epochs)
|
|
363
|
+
if (wire === WIRE_VARINT) {
|
|
364
|
+
const encoded = reader.readVarint64Bigint();
|
|
365
|
+
value = safeNumberOrString((encoded >> 1n) ^ -(encoded & 1n));
|
|
366
|
+
}
|
|
367
|
+
else
|
|
368
|
+
reader.skip(wire);
|
|
369
|
+
break;
|
|
362
370
|
case 9: // bool_value
|
|
363
371
|
if (wire === WIRE_VARINT)
|
|
364
372
|
value = reader.readBool();
|
|
@@ -484,10 +492,12 @@ function decodeFeature(reader, fields, transform, geometryType) {
|
|
|
484
492
|
reader.skip(wire);
|
|
485
493
|
}
|
|
486
494
|
}
|
|
487
|
-
//
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
495
|
+
// FeatureCollection attributes follow field order. The optional Value.index
|
|
496
|
+
// is also supported when a producer explicitly supplies a field mapping.
|
|
497
|
+
for (const [position, entry] of valueEntries.entries()) {
|
|
498
|
+
const fieldIndex = entry.fieldIndex >= 0 ? entry.fieldIndex : position;
|
|
499
|
+
if (fieldIndex < fields.length) {
|
|
500
|
+
attributes[fields[fieldIndex].name] = entry.value;
|
|
491
501
|
}
|
|
492
502
|
}
|
|
493
503
|
const result = { attributes };
|
|
@@ -644,6 +654,8 @@ function mapPbfFieldTypeToGeoServices(fieldType) {
|
|
|
644
654
|
return "esriFieldTypeXML";
|
|
645
655
|
case 13:
|
|
646
656
|
return "esriFieldTypeBigInteger";
|
|
657
|
+
case 14:
|
|
658
|
+
return "esriFieldTypeDateOnly";
|
|
647
659
|
default:
|
|
648
660
|
return "esriFieldTypeString";
|
|
649
661
|
}
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { HonuaMetadataRequestOptions } from "./cache-state.js";
|
|
16
16
|
import type { QueryMethod } from "./types.js";
|
|
17
|
+
/** Internal opt-in for a read query transported in an immutable POST body. */
|
|
18
|
+
export interface HonuaJsonRequestPolicy {
|
|
19
|
+
/** Retain read-query replay semantics and reject redirects that discard the body. */
|
|
20
|
+
readonly readOnlyQuery?: true;
|
|
21
|
+
}
|
|
17
22
|
/**
|
|
18
23
|
* The minimal request primitives a protocol wire module needs. Every method
|
|
19
24
|
* routes through the same auth / retry / timeout / interceptor pipeline as the
|
|
@@ -31,7 +36,7 @@ export interface HonuaProtocolTransport {
|
|
|
31
36
|
* surfaces GeoServices `{error}` envelopes returned on HTTP 200 as
|
|
32
37
|
* `HonuaHttpError`. Caller-supplied query params belong on `path`.
|
|
33
38
|
*/
|
|
34
|
-
requestJson<T = unknown>(method: QueryMethod, path: string, init?: RequestInit, signal?: AbortSignal): Promise<T>;
|
|
39
|
+
requestJson<T = unknown>(method: QueryMethod, path: string, init?: RequestInit, signal?: AbortSignal, policy?: HonuaJsonRequestPolicy): Promise<T>;
|
|
35
40
|
/**
|
|
36
41
|
* Fetch a text response (XML / JSON / plain) with explicit Accept negotiation.
|
|
37
42
|
* Used by the WMS / WMTS capabilities pipelines and the WFS adapter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-transport.d.ts","sourceRoot":"","sources":["../../../src/core/protocol-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,WAAW,CAAC,CAAC,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"protocol-transport.d.ts","sourceRoot":"","sources":["../../../src/core/protocol-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,qFAAqF;IACrF,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,WAAW,CAAC,CAAC,GAAG,OAAO,EACrB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI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aAAa,GAAG,OAAO,CAAA;KAAE,GAC/E,OAAO,CAAC,QAAQ,CAAC,CAAC;IAErB;;;OAGG;IACH,6BAA6B,CAAC,CAAC,GAAG,OAAO,EACvC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,CAAC,CAAC,CAAC;CACf"}
|
|
@@ -29,9 +29,10 @@ export declare function parseRetryAfterMs(response: Response): number | undefine
|
|
|
29
29
|
/**
|
|
30
30
|
* Decide whether a failed attempt should be retried. Idempotent/replay-safe
|
|
31
31
|
* methods (GET/PUT/DELETE) are retried on the configured retry statuses or on
|
|
32
|
-
* transient network/timeout errors; aborts are never retried.
|
|
32
|
+
* transient network/timeout errors; aborts are never retried. A protocol may
|
|
33
|
+
* explicitly identify an immutable read-query POST as replay-safe too.
|
|
33
34
|
*/
|
|
34
|
-
export declare function shouldRetryRequest(retryOptions: NormalizedRetryOptions | undefined, method: QueryMethod, attempt: number, statusCode: number | undefined, error: unknown): boolean;
|
|
35
|
+
export declare function shouldRetryRequest(retryOptions: NormalizedRetryOptions | undefined, method: QueryMethod, attempt: number, statusCode: number | undefined, error: unknown, readOnlyQuery?: boolean): boolean;
|
|
35
36
|
/**
|
|
36
37
|
* Resolve the backoff delay before the next attempt. A server `Retry-After`
|
|
37
38
|
* header (capped by `maxDelayMs`) wins; otherwise an exponential backoff with
|
|
@@ -84,5 +85,7 @@ export declare function createTimeoutSignal(existingSignal: AbortSignal | null |
|
|
|
84
85
|
* server's structured error message (`error.message`, `message`, or `detail`)
|
|
85
86
|
* and falling back to a generic message while preserving the raw body.
|
|
86
87
|
*/
|
|
87
|
-
export declare function toHttpError(statusCode: number, body: unknown): HonuaHttpError;
|
|
88
|
+
export declare function toHttpError(statusCode: number, body: unknown, responseHeaders?: Headers): HonuaHttpError;
|
|
89
|
+
/** Preserve an HTTP-200 GeoServices error envelope without conflating its code with HTTP status. */
|
|
90
|
+
export declare function toGeoServicesError(transportStatus: number, body: unknown, responseHeaders: Headers): HonuaHttpError | undefined;
|
|
88
91
|
//# sourceMappingURL=request-pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-pipeline.d.ts","sourceRoot":"","sources":["../../../src/core/request-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAwC,MAAM,aAAa,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;;;GAOG;AAEH,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAAiC,CAAC;AACzF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,WAAW,CAA6C,CAAC;AAEzG,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKpF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,sBAAsB,GAAG,SAAS,CAsChH;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,MAAM,GAAG,SAAS,CAgBzF;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAExE;AAED
|
|
1
|
+
{"version":3,"file":"request-pipeline.d.ts","sourceRoot":"","sources":["../../../src/core/request-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAwC,MAAM,aAAa,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAA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