@koine/api 1.0.65 → 1.0.66

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/package.json +2 -2
  2. package/typings.d.ts +9 -8
package/package.json CHANGED
@@ -5,12 +5,12 @@
5
5
  "typings": "./index.d.ts",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {
8
- "@koine/utils": "1.0.65",
8
+ "@koine/utils": "1.0.66",
9
9
  "swr": "^2.0.0-beta.6",
10
10
  "next": "^12.2.3",
11
11
  "tslib": "^2.4.0"
12
12
  },
13
- "version": "1.0.65",
13
+ "version": "1.0.66",
14
14
  "module": "./index.js",
15
15
  "types": "./index.d.ts"
16
16
  }
package/typings.d.ts CHANGED
@@ -69,17 +69,18 @@ declare namespace Koine.Api {
69
69
  */
70
70
  processReq?: RequestProcessor;
71
71
  /**
72
- * Process ok response just after http response
72
+ * Process ok/failed response just after http response
73
73
  *
74
74
  * @default undefined
75
75
  */
76
- processRes?: ResponseProcessorOk;
76
+ processRes?: ResponseProcessorRes;
77
77
  /**
78
- * Process failed response just after http response
78
+ * Process maybe-thrown error originated either from `fetch` function
79
+ * invokation or from its `response.json()` parsing
79
80
  *
80
81
  * @default undefined
81
82
  */
82
- processErr?: ResponseProcessorFail;
83
+ processErr?: ResponseProcessorErr;
83
84
  };
84
85
 
85
86
  type ClientMethod<
@@ -379,19 +380,19 @@ declare namespace Koine.Api {
379
380
  ];
380
381
 
381
382
  /**
382
- * The ok response processor at the request level, this is meant to apply
383
+ * The ok/fail response processor at the request level, this is meant to apply
383
384
  * transformations to a single or all endpoint responses
384
385
  */
385
- type ResponseProcessorOk = <TResponseOk extends ResponseOk = ResponseOk>(
386
+ type ResponseProcessorRes = <TResponseOk extends ResponseOk = ResponseOk>(
386
387
  response: _Response,
387
388
  options: TOptions
388
389
  ) => Promise<Koine.Api.Result<TResponseOk>>;
389
390
 
390
391
  /**
391
- * The fail response processor at the request level, this is meant to apply
392
+ * The error response processor at the request level, this is meant to apply
392
393
  * transformations to a single or all endpoint responses
393
394
  */
394
- type ResponseProcessorFail = <
395
+ type ResponseProcessorErr = <
395
396
  TResponseFail extends ResponseFailed = ResponseFailed
396
397
  >(
397
398
  msg: string,