@pikku/fetch 0.11.0 → 0.11.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/CHANGELOG.md CHANGED
@@ -1,10 +1,15 @@
1
1
  ## 0.11.0
2
2
 
3
+ ## 0.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ce902b1: fix: method in core pikku fetch should be any to avoid typescript issues
8
+
3
9
  ### Minor Changes
4
10
 
5
11
  - Workflow support
6
12
 
7
-
8
13
  # @pikku/fetch
9
14
 
10
15
  ## 0.10.0
@@ -21,7 +21,7 @@ export type CorePikkuFetchOptions = {
21
21
  } & Pick<RequestInit, 'cache' | 'credentials' | 'mode'>;
22
22
  /**
23
23
  * The `CorePikkuFetch` class provides a utility for making HTTP requests, including handling authorization,
24
- * transforming dates in responses, and managing server URLs. This class is designed to simplify API interactions
24
+ * transforming dates in responses, and managing server URLs. This class is designed to simplify API wires
25
25
  * with configurable options and support for JWT and API key-based authentication.
26
26
  */
27
27
  export declare class CorePikkuFetch {
@@ -81,7 +81,8 @@ export declare class CorePikkuFetch {
81
81
  * @param {RequestInit} [options] - Additional options for the request.
82
82
  * @returns {Promise<Response>} - A promise that resolves to the fetch response.
83
83
  */
84
- fetch(uri: string, method: HTTPMethod, data: any, options?: RequestInit): Promise<Response>;
84
+ fetch(uri: string, method: any, // HTTPMethod, TODO: the generated file is a subset of HTTPMethod
85
+ data: any, options?: RequestInit): Promise<Response>;
85
86
  /**
86
87
  * Verifies that the server URL is set before making a request.
87
88
  *
@@ -14,7 +14,7 @@ const transform_date_js_1 = require("./transform-date.js");
14
14
  const pikku_fetch_js_1 = require("./pikku-fetch.js");
15
15
  /**
16
16
  * The `CorePikkuFetch` class provides a utility for making HTTP requests, including handling authorization,
17
- * transforming dates in responses, and managing server URLs. This class is designed to simplify API interactions
17
+ * transforming dates in responses, and managing server URLs. This class is designed to simplify API wires
18
18
  * with configurable options and support for JWT and API key-based authentication.
19
19
  */
20
20
  class CorePikkuFetch {
@@ -138,7 +138,8 @@ class CorePikkuFetch {
138
138
  * @param {RequestInit} [options] - Additional options for the request.
139
139
  * @returns {Promise<Response>} - A promise that resolves to the fetch response.
140
140
  */
141
- fetch(uri, method, data, options) {
141
+ fetch(uri, method, // HTTPMethod, TODO: the generated file is a subset of HTTPMethod
142
+ data, options) {
142
143
  return __awaiter(this, void 0, void 0, function* () {
143
144
  this.verifyServerUrlSet();
144
145
  if (uri.startsWith('/')) {
@@ -21,7 +21,7 @@ export type CorePikkuFetchOptions = {
21
21
  } & Pick<RequestInit, 'cache' | 'credentials' | 'mode'>;
22
22
  /**
23
23
  * The `CorePikkuFetch` class provides a utility for making HTTP requests, including handling authorization,
24
- * transforming dates in responses, and managing server URLs. This class is designed to simplify API interactions
24
+ * transforming dates in responses, and managing server URLs. This class is designed to simplify API wires
25
25
  * with configurable options and support for JWT and API key-based authentication.
26
26
  */
27
27
  export declare class CorePikkuFetch {
@@ -81,7 +81,8 @@ export declare class CorePikkuFetch {
81
81
  * @param {RequestInit} [options] - Additional options for the request.
82
82
  * @returns {Promise<Response>} - A promise that resolves to the fetch response.
83
83
  */
84
- fetch(uri: string, method: HTTPMethod, data: any, options?: RequestInit): Promise<Response>;
84
+ fetch(uri: string, method: any, // HTTPMethod, TODO: the generated file is a subset of HTTPMethod
85
+ data: any, options?: RequestInit): Promise<Response>;
85
86
  /**
86
87
  * Verifies that the server URL is set before making a request.
87
88
  *
@@ -2,7 +2,7 @@ import { transformDates } from './transform-date.js';
2
2
  import { corePikkuFetch } from './pikku-fetch.js';
3
3
  /**
4
4
  * The `CorePikkuFetch` class provides a utility for making HTTP requests, including handling authorization,
5
- * transforming dates in responses, and managing server URLs. This class is designed to simplify API interactions
5
+ * transforming dates in responses, and managing server URLs. This class is designed to simplify API wires
6
6
  * with configurable options and support for JWT and API key-based authentication.
7
7
  */
8
8
  export class CorePikkuFetch {
@@ -117,7 +117,8 @@ export class CorePikkuFetch {
117
117
  * @param {RequestInit} [options] - Additional options for the request.
118
118
  * @returns {Promise<Response>} - A promise that resolves to the fetch response.
119
119
  */
120
- async fetch(uri, method, data, options) {
120
+ async fetch(uri, method, // HTTPMethod, TODO: the generated file is a subset of HTTPMethod
121
+ data, options) {
121
122
  this.verifyServerUrlSet();
122
123
  if (uri.startsWith('/')) {
123
124
  uri = `${this.options.serverUrl}${uri}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/fetch",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,7 +27,7 @@ export type CorePikkuFetchOptions = {
27
27
 
28
28
  /**
29
29
  * The `CorePikkuFetch` class provides a utility for making HTTP requests, including handling authorization,
30
- * transforming dates in responses, and managing server URLs. This class is designed to simplify API interactions
30
+ * transforming dates in responses, and managing server URLs. This class is designed to simplify API wires
31
31
  * with configurable options and support for JWT and API key-based authentication.
32
32
  */
33
33
  export class CorePikkuFetch {
@@ -154,7 +154,7 @@ export class CorePikkuFetch {
154
154
  */
155
155
  public async fetch(
156
156
  uri: string,
157
- method: HTTPMethod,
157
+ method: any, // HTTPMethod, TODO: the generated file is a subset of HTTPMethod
158
158
  data: any,
159
159
  options?: RequestInit
160
160
  ) {