@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.
- package/lib/IPropagation.d.ts +7 -2
- package/package.json +1 -1
- package/src/IPropagation.ts +7 -2
package/lib/IPropagation.d.ts
CHANGED
|
@@ -9,14 +9,19 @@ import { Primitive } from "./Primitive";
|
|
|
9
9
|
* ```typescript
|
|
10
10
|
* type Output = IPropagation<{
|
|
11
11
|
* 200: ISeller.IAuthorized;
|
|
12
|
-
*
|
|
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
|
-
*
|
|
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
package/src/IPropagation.ts
CHANGED
|
@@ -10,14 +10,19 @@ import { Primitive } from "./Primitive";
|
|
|
10
10
|
* ```typescript
|
|
11
11
|
* type Output = IPropagation<{
|
|
12
12
|
* 200: ISeller.IAuthorized;
|
|
13
|
-
*
|
|
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
|
-
*
|
|
24
|
+
* // unknown type when out of pre-defined status codes
|
|
25
|
+
* const result: unknown = output.data;
|
|
21
26
|
* }
|
|
22
27
|
* ```
|
|
23
28
|
*
|