@nestia/fetcher 0.2.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 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` or `DELETE` methods.
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" | "DELETE", path: string): Promise<Primitive<Output>>;
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 `PATCH` methods.
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: Input, stringify?: (input: Input) => string): Promise<Primitive<Output>>;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/fetcher",
3
- "version": "0.2.0",
3
+ "version": "1.0.1",
4
4
  "description": "Fetcher library of Nestia SDK",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "import2": "^1.0.3",
39
- "node-fetch": "^3.3.0"
39
+ "node-fetch": "^2.6.7"
40
40
  },
41
41
  "files": [
42
42
  "README.md",
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` or `DELETE` methods.
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" | "DELETE",
38
+ method: "GET",
39
39
  path: string,
40
40
  ): Promise<Primitive<Output>>;
41
41
 
42
42
  /**
43
- * Fetch function for the `POST`, `PUT` and `PATCH` methods.
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: Input,
58
+ input?: Input,
59
59
  stringify?: (input: Input) => string,
60
60
  ): Promise<Primitive<Output>>;
61
61