@webority/web-core 0.170.0 → 0.171.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.
Files changed (2) hide show
  1. package/README.md +10 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -198,6 +198,16 @@ says whether an answer arrived at all; `code` tells a timeout (`TIMEOUT_CODE`) f
198
198
  while online (`NETWORK_CODE`) and from a browser that reports no network (`OFFLINE_CODE`).
199
199
  `diagnostic` holds the server's own text (the body `detail`, else `title`, else a plain-text body, else
200
200
  the request's error message) for the logger, never for a screen.
201
+ `extensions` holds every other member of the refusal's body, as the server sent it (an empty object
202
+ when there were none or no answer arrived). A screen reads only a member the endpoint documents, and
203
+ narrows it with a type guard before use; never render a member or spread `extensions` into the page:
204
+
205
+ ```ts
206
+ const { code, extensions } = extractApiError(error);
207
+ if (code === "conflict" && typeof extensions.existingPublicId === "string") {
208
+ navigate(`/projects/${extensions.existingPublicId}`);
209
+ }
210
+ ```
201
211
 
202
212
  Errors raise a toast by default; a thunk or endpoint opts out with `meta: { silent: true }`, the
203
213
  same on web and mobile. An RTK Query call that handles some statuses itself passes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/web-core",
3
- "version": "0.170.0",
3
+ "version": "0.171.0",
4
4
  "description": "Platform layer for Webority React web portals: HTTP clients with single-flight token refresh, auth store, API error extraction, RTK Query base query, logger, formatters, storage, version check and route guards. No UI.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -110,7 +110,7 @@
110
110
  },
111
111
  "sideEffects": false,
112
112
  "dependencies": {
113
- "@webority/api-contract": "0.170.0"
113
+ "@webority/api-contract": "0.171.0"
114
114
  },
115
115
  "peerDependencies": {
116
116
  "@microsoft/applicationinsights-web": "^3.4.5",
@@ -137,7 +137,7 @@
137
137
  "@types/node": "25.6.0",
138
138
  "@types/react": "^19.3.0",
139
139
  "@vitest/coverage-v8": "5.1.0",
140
- "@webority/biome-config": "0.170.0",
140
+ "@webority/biome-config": "0.171.0",
141
141
  "axios": "^1.18.0",
142
142
  "jsdom": "30.1.1",
143
143
  "react": "^19.3.1",