@blocklet/sdk 1.8.39 → 1.8.41

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/env.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ declare type BlockletPreferences = {
2
+ [key: string]: any;
3
+ };
1
4
  declare const env: Readonly<{
2
5
  appId: string;
3
6
  appName: string;
@@ -8,6 +11,6 @@ declare const env: Readonly<{
8
11
  cacheDir: string;
9
12
  mode: string;
10
13
  appStorageEndpoint: string;
11
- preferences: {};
14
+ preferences: BlockletPreferences;
12
15
  }>;
13
16
  export = env;
package/lib/env.js CHANGED
@@ -1,5 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  const constant_1 = require("@blocklet/constant");
6
+ const try_json_parse_1 = __importDefault(require("try-json-parse"));
7
+ const preferences = Object.keys(process.env)
8
+ .filter((x) => x.startsWith(constant_1.BLOCKLET_PREFERENCE_PREFIX))
9
+ .reduce((acc, x) => {
10
+ acc[x.replace(constant_1.BLOCKLET_PREFERENCE_PREFIX, '')] = (0, try_json_parse_1.default)(process.env[x]);
11
+ return acc;
12
+ }, {});
3
13
  const env = Object.freeze({
4
14
  appId: process.env.BLOCKLET_APP_ID,
5
15
  appName: process.env.BLOCKLET_APP_NAME,
@@ -10,11 +20,6 @@ const env = Object.freeze({
10
20
  cacheDir: process.env.BLOCKLET_CACHE_DIR,
11
21
  mode: process.env.BLOCKLET_MODE,
12
22
  appStorageEndpoint: process.env.BLOCKLET_APP_SPACE_ENDPOINT,
13
- preferences: Object.keys(process.env)
14
- .filter((x) => x.startsWith(constant_1.BLOCKLET_PREFERENCE_PREFIX))
15
- .reduce((acc, x) => {
16
- acc[x.replace(constant_1.BLOCKLET_PREFERENCE_PREFIX, '')] = process.env[x];
17
- return acc;
18
- }, {}),
23
+ preferences,
19
24
  });
20
25
  module.exports = env;
package/lib/index.d.ts CHANGED
@@ -44,6 +44,7 @@ declare global {
44
44
  version: string;
45
45
  theme: any;
46
46
  navigation: any[];
47
+ preferences: any;
47
48
  componentMountPoints: MountPoint[];
48
49
  };
49
50
  }
package/lib/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const version = "1.8.39";
1
+ declare const version = "1.8.41";
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.8.39';
4
+ const version = '1.8.41';
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.8.39",
6
+ "version": "1.8.41",
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,24 +26,25 @@
26
26
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@abtnode/client": "1.8.39",
30
- "@abtnode/constant": "1.8.39",
31
- "@arcblock/did-auth": "1.18.18",
32
- "@arcblock/jwt": "1.18.18",
33
- "@arcblock/ws": "1.18.18",
34
- "@blocklet/constant": "1.8.39",
35
- "@blocklet/meta": "1.8.39",
29
+ "@abtnode/client": "1.8.41",
30
+ "@abtnode/constant": "1.8.41",
31
+ "@arcblock/did-auth": "1.18.26",
32
+ "@arcblock/jwt": "1.18.26",
33
+ "@arcblock/ws": "1.18.26",
34
+ "@blocklet/constant": "1.8.41",
35
+ "@blocklet/meta": "1.8.41",
36
36
  "@did-connect/authenticator": "^2.1.26",
37
37
  "@did-connect/handler": "^2.1.26",
38
38
  "@nedb/core": "^2.0.5",
39
- "@ocap/mcrypto": "1.18.18",
40
- "@ocap/wallet": "1.18.18",
39
+ "@ocap/mcrypto": "1.18.26",
40
+ "@ocap/wallet": "1.18.26",
41
41
  "axios": "^0.27.2",
42
42
  "fs-extra": "^10.1.0",
43
43
  "joi": "17.6.3",
44
44
  "json-stable-stringify": "^1.0.1",
45
45
  "lodash": "^4.17.21",
46
46
  "lru-cache": "^6.0.0",
47
+ "try-json-parse": "^1.0.0",
47
48
  "url-join": "^4.0.1"
48
49
  },
49
50
  "resolutions": {
@@ -68,5 +69,5 @@
68
69
  "ts-node": "^10.9.1",
69
70
  "typescript": "^4.8.4"
70
71
  },
71
- "gitHead": "cf2223c4d9a999993b2be1c943dd75b4221593c3"
72
+ "gitHead": "bdc6b7c45ec5c59b83b2ef4ac088dc2eae9f4dea"
72
73
  }