@sheet2db/sdk 2.0.5 → 2.0.6

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
@@ -120,7 +120,7 @@ declare class Sheet2DBClient {
120
120
  useBasicAuthentication(username: string, password: string): void;
121
121
  useJWTAuthentication(token: string): void;
122
122
  useBearerTokenAuthentication(token: string): void;
123
- Read<T = any>(options: ReadOptions, sheet?: string): Promise<T>;
123
+ Read<T = any>(options: Partial<ReadOptions>, sheet?: string): Promise<T>;
124
124
  Update(options: UpdateOptions, sheet?: string): Promise<{
125
125
  updated: number;
126
126
  }>;
package/dist/index.d.ts CHANGED
@@ -120,7 +120,7 @@ declare class Sheet2DBClient {
120
120
  useBasicAuthentication(username: string, password: string): void;
121
121
  useJWTAuthentication(token: string): void;
122
122
  useBearerTokenAuthentication(token: string): void;
123
- Read<T = any>(options: ReadOptions, sheet?: string): Promise<T>;
123
+ Read<T = any>(options: Partial<ReadOptions>, sheet?: string): Promise<T>;
124
124
  Update(options: UpdateOptions, sheet?: string): Promise<{
125
125
  updated: number;
126
126
  }>;
package/dist/index.js CHANGED
@@ -59,8 +59,9 @@ var Sheet2DBClient = class {
59
59
  constructor(apiId, version = "v1") {
60
60
  this.authentication = null;
61
61
  if (!(apiId == null ? void 0 : apiId.trim())) throw new Error("apiId is required to create a Sheet2DBClient.");
62
+ const baseURL = typeof process != "undefined" && process.env.SHEET2DB_BASE_URL || "https://api.sheet2db.io/" + version + "/data/" + apiId;
62
63
  this.axios = import_axios.default.create({
63
- baseURL: process.env.SHEET2DB_BASE_URL || "https://api.sheet2db.io/" + version + "/data/" + apiId,
64
+ baseURL,
64
65
  paramsSerializer: {
65
66
  serialize: (params) => new URLSearchParams(params).toString()
66
67
  }
@@ -73,7 +74,7 @@ var Sheet2DBClient = class {
73
74
  });
74
75
  }
75
76
  endpoint(sheet) {
76
- return sheet ? `/${sheet}` : "/";
77
+ return sheet ? `/${sheet}` : "";
77
78
  }
78
79
  useBasicAuthentication(username, password) {
79
80
  const token = isNode ? Buffer.from(`${username}:${password}`).toString("base64") : btoa(`${username}:${password}`);
package/dist/index.mjs CHANGED
@@ -26,8 +26,9 @@ var Sheet2DBClient = class {
26
26
  constructor(apiId, version = "v1") {
27
27
  this.authentication = null;
28
28
  if (!(apiId == null ? void 0 : apiId.trim())) throw new Error("apiId is required to create a Sheet2DBClient.");
29
+ const baseURL = typeof process != "undefined" && process.env.SHEET2DB_BASE_URL || "https://api.sheet2db.io/" + version + "/data/" + apiId;
29
30
  this.axios = axios.create({
30
- baseURL: process.env.SHEET2DB_BASE_URL || "https://api.sheet2db.io/" + version + "/data/" + apiId,
31
+ baseURL,
31
32
  paramsSerializer: {
32
33
  serialize: (params) => new URLSearchParams(params).toString()
33
34
  }
@@ -40,7 +41,7 @@ var Sheet2DBClient = class {
40
41
  });
41
42
  }
42
43
  endpoint(sheet) {
43
- return sheet ? `/${sheet}` : "/";
44
+ return sheet ? `/${sheet}` : "";
44
45
  }
45
46
  useBasicAuthentication(username, password) {
46
47
  const token = isNode ? Buffer.from(`${username}:${password}`).toString("base64") : btoa(`${username}:${password}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheet2db/sdk",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {