sea-chart 0.0.3 → 0.0.4

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/dist/api/index.js +18 -1
  2. package/package.json +1 -1
package/dist/api/index.js CHANGED
@@ -80,7 +80,24 @@ class SeaChartAPI {
80
80
  this.instance = new SeaChartAPI(config);
81
81
  return this.instance;
82
82
  }
83
- async init() {
83
+ async init(config) {
84
+ if (config && typeof config === 'object') {
85
+ const {
86
+ appName,
87
+ accessToken,
88
+ dtableUuid,
89
+ dtableServer,
90
+ dtableSocket,
91
+ dtableDb
92
+ } = config;
93
+ this.appName = appName;
94
+ this.accessToken = accessToken;
95
+ this.dtableUuid = dtableUuid;
96
+ this.dtableServer = dtableServer.replace(/\/+$/, '') + '/';
97
+ this.dtableSocket = dtableSocket.replace(/\/+$/, '') + '/';
98
+ this.dtableDB = dtableDb.replace(/\/+$/, '') + '/';
99
+ return;
100
+ }
84
101
  const accessTokenRes = await this.getDTableAccessToken();
85
102
  const {
86
103
  app_name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",