@nestia/fetcher 2.5.4 → 2.5.5
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/package.json +1 -1
- package/src/internal/IFetchRoute.ts +62 -62
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Properties of remote API route.
|
|
3
|
-
*
|
|
4
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
5
|
-
*/
|
|
6
|
-
export interface IFetchRoute<
|
|
7
|
-
Method extends "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE",
|
|
8
|
-
> {
|
|
9
|
-
/**
|
|
10
|
-
* Method of the HTTP request.
|
|
11
|
-
*/
|
|
12
|
-
method: Method;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Path of the HTTP request.
|
|
16
|
-
*/
|
|
17
|
-
path: string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Request body data info.
|
|
21
|
-
*/
|
|
22
|
-
request: Method extends "DELETE" | "POST" | "PUT" | "PATCH"
|
|
23
|
-
? IFetchRoute.IBody | null
|
|
24
|
-
: null;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Response body data info.
|
|
28
|
-
*/
|
|
29
|
-
response: Method extends "HEAD" ? null : IFetchRoute.IBody;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* When special status code being used.
|
|
33
|
-
*/
|
|
34
|
-
status: number | null;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Parser of the query string.
|
|
38
|
-
*
|
|
39
|
-
* If content type of response body is `application/x-www-form-urlencoded`,
|
|
40
|
-
* then this `parseQuery` function would be called.
|
|
41
|
-
*
|
|
42
|
-
* If you've forgotten to configuring this `parseQuery` property about the
|
|
43
|
-
* `application/x-www-form-urlencoded` typed response body data, then
|
|
44
|
-
* only the `URLSearchParams` typed instance would be returned instead.
|
|
45
|
-
*/
|
|
46
|
-
parseQuery?(input: URLSearchParams): any;
|
|
47
|
-
}
|
|
48
|
-
export namespace IFetchRoute {
|
|
49
|
-
/**
|
|
50
|
-
* Metadata of body.
|
|
51
|
-
*
|
|
52
|
-
* Describes how content-type being used in body, and whether encrypted or not.
|
|
53
|
-
*/
|
|
54
|
-
export interface IBody {
|
|
55
|
-
type:
|
|
56
|
-
| "application/json"
|
|
57
|
-
| "application/x-www-form-urlencoded"
|
|
58
|
-
| "multipart/form-data"
|
|
59
|
-
| "text/plain";
|
|
60
|
-
encrypted?: boolean;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Properties of remote API route.
|
|
3
|
+
*
|
|
4
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
5
|
+
*/
|
|
6
|
+
export interface IFetchRoute<
|
|
7
|
+
Method extends "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE",
|
|
8
|
+
> {
|
|
9
|
+
/**
|
|
10
|
+
* Method of the HTTP request.
|
|
11
|
+
*/
|
|
12
|
+
method: Method;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Path of the HTTP request.
|
|
16
|
+
*/
|
|
17
|
+
path: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Request body data info.
|
|
21
|
+
*/
|
|
22
|
+
request: Method extends "DELETE" | "POST" | "PUT" | "PATCH"
|
|
23
|
+
? IFetchRoute.IBody | null
|
|
24
|
+
: null;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Response body data info.
|
|
28
|
+
*/
|
|
29
|
+
response: Method extends "HEAD" ? null : IFetchRoute.IBody;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* When special status code being used.
|
|
33
|
+
*/
|
|
34
|
+
status: number | null;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Parser of the query string.
|
|
38
|
+
*
|
|
39
|
+
* If content type of response body is `application/x-www-form-urlencoded`,
|
|
40
|
+
* then this `parseQuery` function would be called.
|
|
41
|
+
*
|
|
42
|
+
* If you've forgotten to configuring this `parseQuery` property about the
|
|
43
|
+
* `application/x-www-form-urlencoded` typed response body data, then
|
|
44
|
+
* only the `URLSearchParams` typed instance would be returned instead.
|
|
45
|
+
*/
|
|
46
|
+
parseQuery?(input: URLSearchParams): any;
|
|
47
|
+
}
|
|
48
|
+
export namespace IFetchRoute {
|
|
49
|
+
/**
|
|
50
|
+
* Metadata of body.
|
|
51
|
+
*
|
|
52
|
+
* Describes how content-type being used in body, and whether encrypted or not.
|
|
53
|
+
*/
|
|
54
|
+
export interface IBody {
|
|
55
|
+
type:
|
|
56
|
+
| "application/json"
|
|
57
|
+
| "application/x-www-form-urlencoded"
|
|
58
|
+
| "multipart/form-data"
|
|
59
|
+
| "text/plain";
|
|
60
|
+
encrypted?: boolean;
|
|
61
|
+
}
|
|
62
|
+
}
|