@nestia/fetcher 1.0.0 → 1.0.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/lib/Fetcher.d.ts +4 -4
- package/package.json +1 -1
- package/src/Fetcher.ts +5 -5
package/lib/Fetcher.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { Primitive } from "./Primitive";
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class Fetcher {
|
|
18
18
|
/**
|
|
19
|
-
* Fetch function for the `GET`
|
|
19
|
+
* Fetch function for the `GET` methods.
|
|
20
20
|
*
|
|
21
21
|
* @param connection Connection information for the remote HTTP server
|
|
22
22
|
* @param encrypted Whether the request/response body be encrypted or not
|
|
@@ -24,9 +24,9 @@ export declare class Fetcher {
|
|
|
24
24
|
* @param path Path of the HTTP request
|
|
25
25
|
* @return Response body data from the remote HTTP server
|
|
26
26
|
*/
|
|
27
|
-
static fetch<Output>(connection: IConnection, encrypted: Fetcher.IEncrypted, method: "GET"
|
|
27
|
+
static fetch<Output>(connection: IConnection, encrypted: Fetcher.IEncrypted, method: "GET", path: string): Promise<Primitive<Output>>;
|
|
28
28
|
/**
|
|
29
|
-
* Fetch function for the `POST`, `PUT` and `
|
|
29
|
+
* Fetch function for the `POST`, `PUT`, `PATCH` and `DELETE` methods.
|
|
30
30
|
*
|
|
31
31
|
* @param connection Connection information for the remote HTTP server
|
|
32
32
|
* @param encrypted Whether the request/response body be encrypted or not
|
|
@@ -36,7 +36,7 @@ export declare class Fetcher {
|
|
|
36
36
|
* @param stringify JSON string conversion function, default is the `JSON.stringify`
|
|
37
37
|
* @return Response body data from the remote HTTP server
|
|
38
38
|
*/
|
|
39
|
-
static fetch<Input, Output>(connection: IConnection, encrypted: Fetcher.IEncrypted, method: "POST" | "PUT" | "PATCH", path: string, input
|
|
39
|
+
static fetch<Input, Output>(connection: IConnection, encrypted: Fetcher.IEncrypted, method: "POST" | "PUT" | "PATCH" | "DELETE", path: string, input?: Input, stringify?: (input: Input) => string): Promise<Primitive<Output>>;
|
|
40
40
|
}
|
|
41
41
|
export declare namespace Fetcher {
|
|
42
42
|
/**
|
package/package.json
CHANGED
package/src/Fetcher.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { Singleton } from "./internal/Singleton";
|
|
|
24
24
|
*/
|
|
25
25
|
export class Fetcher {
|
|
26
26
|
/**
|
|
27
|
-
* Fetch function for the `GET`
|
|
27
|
+
* Fetch function for the `GET` methods.
|
|
28
28
|
*
|
|
29
29
|
* @param connection Connection information for the remote HTTP server
|
|
30
30
|
* @param encrypted Whether the request/response body be encrypted or not
|
|
@@ -35,12 +35,12 @@ export class Fetcher {
|
|
|
35
35
|
public static fetch<Output>(
|
|
36
36
|
connection: IConnection,
|
|
37
37
|
encrypted: Fetcher.IEncrypted,
|
|
38
|
-
method: "GET"
|
|
38
|
+
method: "GET",
|
|
39
39
|
path: string,
|
|
40
40
|
): Promise<Primitive<Output>>;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Fetch function for the `POST`, `PUT` and `
|
|
43
|
+
* Fetch function for the `POST`, `PUT`, `PATCH` and `DELETE` methods.
|
|
44
44
|
*
|
|
45
45
|
* @param connection Connection information for the remote HTTP server
|
|
46
46
|
* @param encrypted Whether the request/response body be encrypted or not
|
|
@@ -53,9 +53,9 @@ export class Fetcher {
|
|
|
53
53
|
public static fetch<Input, Output>(
|
|
54
54
|
connection: IConnection,
|
|
55
55
|
encrypted: Fetcher.IEncrypted,
|
|
56
|
-
method: "POST" | "PUT" | "PATCH",
|
|
56
|
+
method: "POST" | "PUT" | "PATCH" | "DELETE",
|
|
57
57
|
path: string,
|
|
58
|
-
input
|
|
58
|
+
input?: Input,
|
|
59
59
|
stringify?: (input: Input) => string,
|
|
60
60
|
): Promise<Primitive<Output>>;
|
|
61
61
|
|