kizlo 0.26.0 → 0.26.1

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/dist/client.js CHANGED
@@ -2,7 +2,7 @@ import { RPC_PROTOCOL_HEADER } from "./shared/constants.js";
2
2
  import { isContractProcedure as isContractProcedure$1, restoreContract } from "./shared/contract.js";
3
3
  import { createResultClient } from "./shared/result.js";
4
4
  import { getObjectProperty } from "./shared/utils.js";
5
- import { DynamicLink, createORPCClient } from "@orpc/client";
5
+ import { DynamicLink, createORPCClient, createORPCErrorFromJson, isORPCErrorJson } from "@orpc/client";
6
6
  import { RPCLink } from "@orpc/client/fetch";
7
7
  import { inferRPCMethodFromContractRouter } from "@orpc/contract";
8
8
  import { OpenAPILink } from "@orpc/openapi-client/fetch";
@@ -17,7 +17,15 @@ var KizloClient = class {
17
17
  const orpcContract = restoreContract(config.contract);
18
18
  const openapiLink = new OpenAPILink(orpcContract, {
19
19
  url,
20
- fetch: config.fetch
20
+ fetch: config.fetch,
21
+ customErrorResponseBodyDecoder(body, response) {
22
+ if (body === null || typeof body !== "object" || Array.isArray(body)) return void 0;
23
+ const error = {
24
+ defined: false,
25
+ ...body
26
+ };
27
+ return isORPCErrorJson(error) && error.status === response.status ? createORPCErrorFromJson(error) : void 0;
28
+ }
21
29
  });
22
30
  const remoteLink = new RPCLink({
23
31
  url,
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.26.0";
2
+ var version = "0.26.1";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kizlo",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "type": "module",
5
5
  "description": "A headless WordPress framework for TypeScript.",
6
6
  "keywords": [