@webpieces/http-client-browser 0.4.744 → 0.4.746
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
|
@@ -23,3 +23,8 @@ store.set(CompanyHeaders.TENANT_ID, tenantId);
|
|
|
23
23
|
|
|
24
24
|
A browser cannot hold service credentials, so a contract with an `@AuthOidc` endpoint fails fast at
|
|
25
25
|
`createRpcClient`. The server twin is [@webpieces/http-client-node](../http-client-node).
|
|
26
|
+
|
|
27
|
+
Calls have a **30-second default timeout**, including reading the response body. Configure
|
|
28
|
+
`CallRegistry` from `@webpieces/core-util` for ALL, API or API-method overrides and explicit retry
|
|
29
|
+
strategies. Any strategy replaces the entire timeout ladder; there is no default retry because
|
|
30
|
+
POSTs may not be idempotent. See [client timeouts and testing](../../../docs/client-timeouts.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/http-client-browser",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.746",
|
|
4
4
|
"description": "Browser HTTP client for webpieces: DI-free (React or Angular), app-managed context store, no AsyncLocalStorage",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@webpieces/core-util": "0.4.
|
|
26
|
-
"@webpieces/http-client-core": "0.4.
|
|
25
|
+
"@webpieces/core-util": "0.4.746",
|
|
26
|
+
"@webpieces/http-client-core": "0.4.746"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -7,7 +7,7 @@ import { RequestOutcome } from '@webpieces/http-client-core';
|
|
|
7
7
|
* each call.
|
|
8
8
|
*
|
|
9
9
|
* Replaces the older header-only ResponseHeadersListener. `onRequestEnd`'s `outcome.headers` carries
|
|
10
|
-
* the same Response Headers (
|
|
10
|
+
* the same Response Headers (after settlement, on both ok and error), and it adds the
|
|
11
11
|
* two signals the header-only seam could not give: a START marker, and success-or-error.
|
|
12
12
|
*
|
|
13
13
|
* The driver is a browser app that must drive ONE progress bar across N requests per user action,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestLifecycleListener.js","sourceRoot":"","sources":["../../../../../packages/http/http-client-browser/src/RequestLifecycleListener.ts"],"names":[],"mappings":"","sourcesContent":["import { RouteMetadata } from '@webpieces/core-util';\nimport { RequestOutcome } from '@webpieces/http-client-core';\n\n/**\n * The inbound seam an app implements to observe the FULL lifecycle of every RPC call — symmetric\n * with the outbound header propagation done by {@link MutableContextStore} / {@link ContextMgr}.\n * Registered once on {@link ClientHttpBrowserFactory}; invoked by {@link BrowserProxyClient} around\n * each call.\n *\n * Replaces the older header-only ResponseHeadersListener. `onRequestEnd`'s `outcome.headers` carries\n * the same Response Headers (
|
|
1
|
+
{"version":3,"file":"RequestLifecycleListener.js","sourceRoot":"","sources":["../../../../../packages/http/http-client-browser/src/RequestLifecycleListener.ts"],"names":[],"mappings":"","sourcesContent":["import { RouteMetadata } from '@webpieces/core-util';\nimport { RequestOutcome } from '@webpieces/http-client-core';\n\n/**\n * The inbound seam an app implements to observe the FULL lifecycle of every RPC call — symmetric\n * with the outbound header propagation done by {@link MutableContextStore} / {@link ContextMgr}.\n * Registered once on {@link ClientHttpBrowserFactory}; invoked by {@link BrowserProxyClient} around\n * each call.\n *\n * Replaces the older header-only ResponseHeadersListener. `onRequestEnd`'s `outcome.headers` carries\n * the same Response Headers (after settlement, on both ok and error), and it adds the\n * two signals the header-only seam could not give: a START marker, and success-or-error.\n *\n * The driver is a browser app that must drive ONE progress bar across N requests per user action,\n * AND detect that a newer server is deployed than this bundle (the server stamps\n * `x-<org>-server-version` on every response) — reloading only at a safe moment, so a half-filled\n * form is never blown away. It needs, per RPC: bar on, bar off, the outcome, and the headers.\n *\n * `onRequestStart` and `onRequestEnd` are PAIRED: every start is followed by exactly one end, on\n * every path (2xx, HTTP error, network reject), so a counter driven off them cannot leak.\n *\n * ```typescript\n * class RpcLifecycleListener implements RequestLifecycleListener {\n * onRequestStart(_route: RouteMetadata): void {\n * progressBar.noteRequestStart();\n * }\n * onRequestEnd(_route: RouteMetadata, outcome: RequestOutcome): void {\n * serverVersionBridge.set(outcome.headers?.get('x-myorg-server-version'));\n * progressBar.noteRequestEnd(!outcome.ok);\n * }\n * }\n * const factory = new ClientHttpBrowserFactory(store, new RpcLifecycleListener());\n * ```\n *\n * This is BUSINESS LOGIC (methods), so it is an interface, not a data class — unlike the\n * {@link RequestOutcome} it is handed.\n */\nexport interface RequestLifecycleListener {\n /** Before fetch, once per RPC. */\n onRequestStart(route: RouteMetadata): void;\n\n /** Once, after the call settles, on every path (success, HTTP error, network reject). */\n onRequestEnd(route: RouteMetadata, outcome: RequestOutcome): void;\n}\n"]}
|