seatable-html-page-sdk 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -20,10 +20,10 @@ Install with npm or yarn:
20
20
 
21
21
  ```bash
22
22
  # npm
23
- $ npm install seatable-html-page-sdk --save
23
+ npm install seatable-html-page-sdk --save
24
24
 
25
25
  # yarn
26
- $ yarn add seatable-html-page-sdk
26
+ yarn add seatable-html-page-sdk
27
27
  ```
28
28
 
29
29
  ### CDN
@@ -47,12 +47,12 @@ For local development:
47
47
 
48
48
  ```js
49
49
  const sdk = new HTMLPageSDK({
50
- server: "https://your-seatable-server.com",
50
+ server: "your-html-page-server",
51
51
  accountToken: "your-account-token",
52
52
  appUuid: "your-app-uuid",
53
53
  pageId: "your-app-page-id", // create an html page in universal app first
54
54
  });
55
- await sdk.init({});
55
+ await sdk.init();
56
56
  ```
57
57
 
58
58
  #### Production mode (iframe)
@@ -60,11 +60,8 @@ await sdk.init({});
60
60
  When running inside a SeaTable Universal App:
61
61
 
62
62
  ```js
63
- const sdk = new HTMLPageSDK({
64
- targetOrigin: "https://your-seatable-server.com", // Optional, defaults to '*'
65
- timeout: 10000, // Optional, request timeout in ms, defaults to 10000
66
- });
67
- await sdk.init({});
63
+ const sdk = new HTMLPageSDK();
64
+ await sdk.init();
68
65
  ```
69
66
 
70
67
  ### Basic usage
package/dist/index.js CHANGED
@@ -3929,7 +3929,11 @@
3929
3929
  table_name,
3930
3930
  rows_data
3931
3931
  };
3932
- return this.req.put(url, data);
3932
+ return this.req.put(url, data, {
3933
+ headers: {
3934
+ 'Content-Type': 'application/json'
3935
+ }
3936
+ });
3933
3937
  }
3934
3938
  deleteRows(page_id, table_name, rows_ids) {
3935
3939
  const url = `${this.server}api/v2.1/universal-apps/${this.appUuid}/html-page-rows/`;
@@ -3938,7 +3942,11 @@
3938
3942
  table_name,
3939
3943
  rows_ids
3940
3944
  };
3941
- return this.req.delete(url, data);
3945
+ return this.req.delete(url, data, {
3946
+ headers: {
3947
+ 'Content-Type': 'application/json'
3948
+ }
3949
+ });
3942
3950
  }
3943
3951
  }
3944
3952