@blocklet/sdk 1.16.17 → 1.16.18-beta-adeeb0b3

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/lib/config.d.ts CHANGED
@@ -124,7 +124,7 @@ declare const _default: {
124
124
  componentRemoved: string;
125
125
  envUpdate: string;
126
126
  };
127
- fetchBlockletJs: () => Promise<any>;
127
+ fetchBlockletJs: () => Promise<string>;
128
128
  getBlockletJs: (pageGroup?: string, pathPrefix?: string, source?: string) => string;
129
129
  };
130
130
  export default _default;
package/lib/config.js CHANGED
@@ -241,13 +241,16 @@ const fetchBlockletJs = async () => {
241
241
  'User-Agent': `BlockletSDK/${version_1.version}`,
242
242
  },
243
243
  });
244
- blockletJs = res.data;
245
- logger.info(`Fetch blocklet.js succeed: ${env.appPid}/${componentDid}`);
246
- return res.data;
244
+ if (typeof res.data === 'string' && res.data.startsWith('window.blocklet')) {
245
+ blockletJs = res.data;
246
+ logger.info(`Fetch blocklet.js succeed: ${env.appPid}/${componentDid}`);
247
+ return res.data;
248
+ }
249
+ throw new Error('Invalid blocklet.js');
247
250
  }
248
251
  catch (err) {
249
252
  logger.error(`Fetch blocklet.js failed: ${env.appPid}/${componentDid}`, err.message);
250
- return null;
253
+ return '';
251
254
  }
252
255
  };
253
256
  // Page group is dynamic, so we need to create it on the fly
package/lib/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const version = "1.16.17";
1
+ declare const version = "1.16.18";
2
2
  export { version };
3
3
  declare const _default: {
4
4
  version: string;
package/lib/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- const version = '1.16.17';
4
+ const version = '1.16.18';
5
5
  exports.version = version;
6
6
  exports.default = { version };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.17",
6
+ "version": "1.16.18-beta-adeeb0b3",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
@@ -26,15 +26,15 @@
26
26
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@abtnode/client": "1.16.17",
30
- "@abtnode/constant": "1.16.17",
29
+ "@abtnode/client": "1.16.18-beta-adeeb0b3",
30
+ "@abtnode/constant": "1.16.18-beta-adeeb0b3",
31
31
  "@arcblock/did": "1.18.93",
32
32
  "@arcblock/did-auth": "1.18.93",
33
33
  "@arcblock/jwt": "1.18.93",
34
34
  "@arcblock/ws": "1.18.93",
35
- "@blocklet/constant": "1.16.17",
36
- "@blocklet/env": "1.16.17",
37
- "@blocklet/meta": "1.16.17",
35
+ "@blocklet/constant": "1.16.18-beta-adeeb0b3",
36
+ "@blocklet/env": "1.16.18-beta-adeeb0b3",
37
+ "@blocklet/meta": "1.16.18-beta-adeeb0b3",
38
38
  "@did-connect/authenticator": "^2.2.0",
39
39
  "@did-connect/handler": "^2.2.0",
40
40
  "@nedb/core": "^2.1.5",
@@ -74,5 +74,5 @@
74
74
  "ts-node": "^10.9.1",
75
75
  "typescript": "^5.0.4"
76
76
  },
77
- "gitHead": "628ba2f5dac74749900bc1e9fd81bab8d320412a"
77
+ "gitHead": "1bef55d8f6ec840d5336e5a8c113771535a1416f"
78
78
  }