@sheet2db/sdk 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +21 -17
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- `Sheet2DB` is a TypeScript class that provides an easy interface to interact with Google Sheets via the `sheet2db` API. This class abstracts the complexity of API calls and provides a simple way to read, write, update, and delete data in Google Sheets. It supports both browser and Node.js environments.
5
+ `Sheet2DB` is a TypeScript class that provides an easy interface to interact with Google Sheets via the [`sheet2db`](https://sheet2db.com) API. This class abstracts the complexity of API calls and provides a simple way to read, write, update, and delete data in Google Sheets. It supports both browser and Node.js environments.
6
6
 
7
7
  ## Installation
8
8
 
@@ -10,6 +10,19 @@
10
10
  npm install sheet2db
11
11
  ```
12
12
 
13
+ ## Configuration Options
14
+
15
+ ### Sheet2DBOptions
16
+
17
+ - **mode**: `'apikey' | 'connectionId'` - Authentication mode.
18
+ - **apiKey**: `string` (required for `'apikey'` mode) - API key for accessing the spreadsheet.
19
+ - **spreadsheetId**: `string` (required for `'apikey'` mode) - The ID of the Google spreadsheet.
20
+ - **version**: `"v1"` - API version, always "v1".
21
+ - **connectionId**: `string` (required for `'connectionId'` mode) - Connection ID for accessing the spreadsheet.
22
+ - **basicAuth**: `{ username: string; password: string; }` (optional for `'connectionId'` mode) - Basic authentication credentials.
23
+ - **jwtAuth**: `{ bearerToken: string; }` (optional for `'connectionId'` mode) - JWT authentication token.
24
+ - **fetchFn**: `typeof fetch` (optional) - Custom fetch function.
25
+
13
26
  ## Usage
14
27
 
15
28
  ### Import and Initialize
@@ -24,6 +37,12 @@ const options: Sheet2DBOptions = {
24
37
  version: 'v1'
25
38
  };
26
39
 
40
+ const options: Sheet2DBOptions = {
41
+ mode: 'connectionId',
42
+ connectionId: 'your-connection-id',
43
+ version: 'v1'
44
+ };
45
+
27
46
  const sheet2db = new Sheet2DB(options);
28
47
  ```
29
48
 
@@ -280,18 +299,7 @@ sheet2db.DeleteSheet({ sheet: 'Sheet1' })
280
299
  .catch(error => console.error(error));
281
300
  ```
282
301
 
283
- ## Configuration Options
284
302
 
285
- ### Sheet2DBOptions
286
-
287
- - **mode**: `'apikey' | 'connectionId'` - Authentication mode.
288
- - **apiKey**: `string` (required for `'apikey'` mode) - API key for accessing the spreadsheet.
289
- - **spreadsheetId**: `string` (required for `'apikey'` mode) - The ID of the Google spreadsheet.
290
- - **version**: `"v1"` - API version, always "v1".
291
- - **connectionId**: `string` (required for `'connectionId'` mode) - Connection ID for accessing the spreadsheet.
292
- - **basicAuth**: `{ username: string; password: string; }` (optional for `'connectionId'` mode) - Basic authentication credentials.
293
- - **jwtAuth**: `{ bearerToken: string; }` (optional for `'connectionId'` mode) - JWT authentication token.
294
- - **fetchFn**: `typeof fetch` (optional) - Custom fetch function.
295
303
 
296
304
  ## Environment Detection
297
305
 
@@ -318,8 +326,4 @@ Each method returns a promise that resolves to the API response or rejects with
318
326
  sheet2db.ReadContent()
319
327
  .then(data => console.log(data))
320
328
  .catch(error => console.error(error));
321
- ```
322
-
323
- ## License
324
-
325
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
329
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheet2db/sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  }
15
15
  },
16
16
  "author": "",
17
- "license": "ISC",
17
+ "license": "MIT",
18
18
  "devDependencies": {
19
19
  "@jest/globals": "^29.7.0",
20
20
  "jest": "^29.7.0",