@sfutureapps/db-sdk 0.3.6 → 0.3.8

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/dist/index.d.mts CHANGED
@@ -30,7 +30,6 @@ declare class HttpClient {
30
30
  private baseUrl;
31
31
  private apiKey?;
32
32
  private accessToken?;
33
- private fetcher;
34
33
  private extraHeaders;
35
34
  constructor(baseUrl: string, opts?: ClientOptions);
36
35
  post<T>(path: string, body: any): Promise<DbResponse<T>>;
package/dist/index.d.ts CHANGED
@@ -30,7 +30,6 @@ declare class HttpClient {
30
30
  private baseUrl;
31
31
  private apiKey?;
32
32
  private accessToken?;
33
- private fetcher;
34
33
  private extraHeaders;
35
34
  constructor(baseUrl: string, opts?: ClientOptions);
36
35
  post<T>(path: string, body: any): Promise<DbResponse<T>>;
package/dist/index.js CHANGED
@@ -30,7 +30,6 @@ var HttpClient = class {
30
30
  this.baseUrl = baseUrl.replace(/\/+$/, "");
31
31
  this.apiKey = opts.apiKey;
32
32
  this.accessToken = opts.accessToken;
33
- this.fetcher = opts.fetch ?? fetch;
34
33
  this.extraHeaders = opts.headers ?? {};
35
34
  }
36
35
  async post(path, body) {
@@ -41,7 +40,7 @@ var HttpClient = class {
41
40
  if (this.apiKey) headers["x-api-key"] = this.apiKey;
42
41
  const token = this.accessToken?.();
43
42
  if (token) headers["Authorization"] = `Bearer ${token}`;
44
- const res = await this.fetcher(`${this.baseUrl}${path}`, {
43
+ const res = await fetch(`${this.baseUrl}${path}`, {
45
44
  method: "POST",
46
45
  headers,
47
46
  body: JSON.stringify(body)
package/dist/index.mjs CHANGED
@@ -4,7 +4,6 @@ var HttpClient = class {
4
4
  this.baseUrl = baseUrl.replace(/\/+$/, "");
5
5
  this.apiKey = opts.apiKey;
6
6
  this.accessToken = opts.accessToken;
7
- this.fetcher = opts.fetch ?? fetch;
8
7
  this.extraHeaders = opts.headers ?? {};
9
8
  }
10
9
  async post(path, body) {
@@ -15,7 +14,7 @@ var HttpClient = class {
15
14
  if (this.apiKey) headers["x-api-key"] = this.apiKey;
16
15
  const token = this.accessToken?.();
17
16
  if (token) headers["Authorization"] = `Bearer ${token}`;
18
- const res = await this.fetcher(`${this.baseUrl}${path}`, {
17
+ const res = await fetch(`${this.baseUrl}${path}`, {
19
18
  method: "POST",
20
19
  headers,
21
20
  body: JSON.stringify(body)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfutureapps/db-sdk",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "SfutureApps JS SDK for ThinkPHP DB Gateway (MySQL)",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",