@nestia/fetcher 2.0.0-dev.20230908-6 → 2.0.0-dev.20230909

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.
@@ -9,14 +9,19 @@ import { Primitive } from "./Primitive";
9
9
  * ```typescript
10
10
  * type Output = IPropagation<{
11
11
  * 200: ISeller.IAuthorized;
12
- * 403: TypeGuardError.IProps;
12
+ * 400: TypeGuardError.IProps;
13
13
  * >};
14
14
  *
15
15
  * const output: Output = await sdk.sellers.authenticate.join(input);
16
16
  * if (output.success) {
17
+ * // automatically casted to "ISeller.IAuthorized" type
17
18
  * const authorized: ISeller.IAuthorized = output.data;
19
+ * } else if (output.status === 400) {
20
+ * // automatically casted to "TypeGuardError.IProps" type
21
+ * const error: TypeGuardError.IProps = output.data;
18
22
  * } else {
19
- * const error: TypeGuardError.IProps = output.data;
23
+ * // unknown type when out of pre-defined status codes
24
+ * const result: unknown = output.data;
20
25
  * }
21
26
  * ```
22
27
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/fetcher",
3
- "version": "2.0.0-dev.20230908-6",
3
+ "version": "2.0.0-dev.20230909",
4
4
  "description": "Fetcher library of Nestia SDK",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -10,14 +10,19 @@ import { Primitive } from "./Primitive";
10
10
  * ```typescript
11
11
  * type Output = IPropagation<{
12
12
  * 200: ISeller.IAuthorized;
13
- * 403: TypeGuardError.IProps;
13
+ * 400: TypeGuardError.IProps;
14
14
  * >};
15
15
  *
16
16
  * const output: Output = await sdk.sellers.authenticate.join(input);
17
17
  * if (output.success) {
18
+ * // automatically casted to "ISeller.IAuthorized" type
18
19
  * const authorized: ISeller.IAuthorized = output.data;
20
+ * } else if (output.status === 400) {
21
+ * // automatically casted to "TypeGuardError.IProps" type
22
+ * const error: TypeGuardError.IProps = output.data;
19
23
  * } else {
20
- * const error: TypeGuardError.IProps = output.data;
24
+ * // unknown type when out of pre-defined status codes
25
+ * const result: unknown = output.data;
21
26
  * }
22
27
  * ```
23
28
  *