doover-js 0.13.1 → 0.13.2

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/README.md CHANGED
@@ -437,8 +437,10 @@ and limiting probes to one per second. It does not retry or queue the failed
437
437
  request, including commands. HTTP error responses and response parsing failures
438
438
  do not trigger these checks.
439
439
 
440
- The probe sends a credential-free `HEAD` request to `dataRestUrl` with
441
- `cache: "no-store"`. Any HTTP response, including 401, 404, or 500, proves network
440
+ The probe sends a credential-free `HEAD` request to `dataRestUrl` with a trailing slash and
441
+ `cache: "no-store"`. For example, a base URL ending in `/api` is probed at `/api/`,
442
+ inside the API routing prefix rather than a possible static CDN fallback. An
443
+ explicit `probeUrl` is used unchanged. Any HTTP response, including 401, 404, or 500, proves network
442
444
  reachability; this is not an application health check. DNS, CORS, transport errors,
443
445
  and timeouts report unreachable. A deployment must allow CORS on its probe URL.
444
446
  Set `reachability: { probeUrl: "https://data.example.com/health" }` to use a different
@@ -51,7 +51,10 @@ class DooverClient {
51
51
  },
52
52
  };
53
53
  const stamper = new provenance_js_1.ProvenanceStamper(this.identity);
54
- const reachability = config.reachability === false ? undefined : new service_reachability_js_1.ServiceReachabilityMonitor(config.reachability?.probeUrl ?? config.dataRestUrl, this.networkStatus, config.fetchImpl ?? ((...args) => fetch(...args)));
54
+ const reachability = config.reachability === false ? undefined : new service_reachability_js_1.ServiceReachabilityMonitor(
55
+ // Probe inside the API prefix: the bare prefix may route to a static CDN
56
+ // fallback without CORS, even though every real API request succeeds.
57
+ config.reachability?.probeUrl ?? `${config.dataRestUrl.replace(/\/+$/, "")}/`, this.networkStatus, config.fetchImpl ?? ((...args) => fetch(...args)));
55
58
  this.reachability = reachability;
56
59
  this.rest = new rest_client_js_1.RestClient(config, this.auth, () => reachability?.requestFailed());
57
60
  this.gatewayImpl = new gateway_client_js_1.GatewayClient(config, this.auth);
@@ -6,7 +6,7 @@ export interface ServiceReachabilitySource {
6
6
  subscribe(listener: () => void): () => void;
7
7
  }
8
8
  export interface ReachabilityOptions {
9
- /** A CORS-enabled, read-only URL on the data service. Defaults to dataRestUrl.
9
+ /** A CORS-enabled, read-only URL on the data service. Defaults to dataRestUrl with a trailing slash.
10
10
  * Any HTTP response proves reachability, including authentication/server errors.
11
11
  * HEAD requests omit credentials and bypass the browser cache. */
12
12
  probeUrl?: string;
@@ -48,7 +48,10 @@ export class DooverClient {
48
48
  },
49
49
  };
50
50
  const stamper = new ProvenanceStamper(this.identity);
51
- const reachability = config.reachability === false ? undefined : new ServiceReachabilityMonitor(config.reachability?.probeUrl ?? config.dataRestUrl, this.networkStatus, config.fetchImpl ?? ((...args) => fetch(...args)));
51
+ const reachability = config.reachability === false ? undefined : new ServiceReachabilityMonitor(
52
+ // Probe inside the API prefix: the bare prefix may route to a static CDN
53
+ // fallback without CORS, even though every real API request succeeds.
54
+ config.reachability?.probeUrl ?? `${config.dataRestUrl.replace(/\/+$/, "")}/`, this.networkStatus, config.fetchImpl ?? ((...args) => fetch(...args)));
52
55
  this.reachability = reachability;
53
56
  this.rest = new RestClient(config, this.auth, () => reachability?.requestFailed());
54
57
  this.gatewayImpl = new GatewayClient(config, this.auth);
@@ -6,7 +6,7 @@ export interface ServiceReachabilitySource {
6
6
  subscribe(listener: () => void): () => void;
7
7
  }
8
8
  export interface ReachabilityOptions {
9
- /** A CORS-enabled, read-only URL on the data service. Defaults to dataRestUrl.
9
+ /** A CORS-enabled, read-only URL on the data service. Defaults to dataRestUrl with a trailing slash.
10
10
  * Any HTTP response proves reachability, including authentication/server errors.
11
11
  * HEAD requests omit credentials and bypass the browser cache. */
12
12
  probeUrl?: string;
@@ -1 +1 @@
1
- {"name":"doover-js","version":"0.13.1","type":"module","sideEffects":false}
1
+ {"name":"doover-js","version":"0.13.2","type":"module","sideEffects":false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doover-js",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "TypeScript client for Doover.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",