@blocklet/sdk 1.16.46-beta-20250703-024219-4029ee97 → 1.16.46-beta-20250704-234926-09d872ad
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 +7 -6
- package/lib/config.js +10 -4
- package/package.json +19 -19
package/lib/config.d.ts
CHANGED
|
@@ -74,22 +74,23 @@ declare const _handleComponentUpdated: (data: {
|
|
|
74
74
|
declare const _handleComponentInstalled: (data: {
|
|
75
75
|
components: TComponents;
|
|
76
76
|
}) => void;
|
|
77
|
-
declare const
|
|
77
|
+
declare const _handleAppConfigUpdate: (data: any) => void;
|
|
78
|
+
declare const _handleAppSettingUpdate: (data: any) => void;
|
|
78
79
|
declare const _handleComponentConfigUpdate: (data: any) => void;
|
|
79
80
|
declare const getBlockletSettings: () => {
|
|
80
81
|
theme: {
|
|
81
82
|
prefer: "system";
|
|
82
83
|
light: {
|
|
83
|
-
palette:
|
|
84
|
+
palette: any;
|
|
84
85
|
};
|
|
85
86
|
dark: {
|
|
86
|
-
palette:
|
|
87
|
+
palette: any;
|
|
87
88
|
};
|
|
88
89
|
};
|
|
89
90
|
};
|
|
90
91
|
declare const getBlockletJs: (pageGroup?: string, pathPrefix?: string, source?: string) => string;
|
|
91
92
|
export { logger, setLogger, env, componentStore as components, MountPoint, // @deprecated, for backward compatibility
|
|
92
|
-
TComponent, events, Events, getBlockletJs, _handleComponentUpdateOld,
|
|
93
|
+
TComponent, events, Events, getBlockletJs, _handleComponentUpdateOld, _handleAppConfigUpdate, _handleAppSettingUpdate, _handleComponentInstalled, _handleComponentUpdated, _handleComponentStarted, _handleComponentStopped, _handleComponentRemoved, _handleComponentConfigUpdate, getBlockletSettings, };
|
|
93
94
|
declare const _default: {
|
|
94
95
|
logger: {
|
|
95
96
|
info: {
|
|
@@ -148,10 +149,10 @@ declare const _default: {
|
|
|
148
149
|
theme: {
|
|
149
150
|
prefer: "system";
|
|
150
151
|
light: {
|
|
151
|
-
palette:
|
|
152
|
+
palette: any;
|
|
152
153
|
};
|
|
153
154
|
dark: {
|
|
154
|
-
palette:
|
|
155
|
+
palette: any;
|
|
155
156
|
};
|
|
156
157
|
};
|
|
157
158
|
};
|
package/lib/config.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getBlockletSettings = exports._handleComponentConfigUpdate = exports._handleComponentRemoved = exports._handleComponentStopped = exports._handleComponentStarted = exports._handleComponentUpdated = exports._handleComponentInstalled = exports.
|
|
6
|
+
exports.getBlockletSettings = exports._handleComponentConfigUpdate = exports._handleComponentRemoved = exports._handleComponentStopped = exports._handleComponentStarted = exports._handleComponentUpdated = exports._handleComponentInstalled = exports._handleAppSettingUpdate = exports._handleAppConfigUpdate = exports._handleComponentUpdateOld = exports.getBlockletJs = exports.Events = exports.events = exports.components = exports.env = exports.setLogger = exports.logger = void 0;
|
|
7
7
|
/* eslint-disable prettier/prettier */
|
|
8
8
|
/* eslint-disable no-console */
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -210,7 +210,7 @@ const _handleComponentInstalled = (data) => {
|
|
|
210
210
|
events.emit(Events.componentAdded, list);
|
|
211
211
|
};
|
|
212
212
|
exports._handleComponentInstalled = _handleComponentInstalled;
|
|
213
|
-
const
|
|
213
|
+
const _handleAppConfigUpdate = (data) => {
|
|
214
214
|
// ensure version in ServerVersion
|
|
215
215
|
const serverVersion = data.configs.find((x) => x.key === 'ABT_NODE_VERSION')?.value;
|
|
216
216
|
if (serverVersion) {
|
|
@@ -235,7 +235,12 @@ const _handleConfigUpdate = (data) => {
|
|
|
235
235
|
debug('handle app config update', data, updates);
|
|
236
236
|
events.emit(Events.envUpdate, updates);
|
|
237
237
|
};
|
|
238
|
-
exports.
|
|
238
|
+
exports._handleAppConfigUpdate = _handleAppConfigUpdate;
|
|
239
|
+
const _handleAppSettingUpdate = (data) => {
|
|
240
|
+
debug('handle app settings update', data);
|
|
241
|
+
events.emit(Events.envUpdate, data);
|
|
242
|
+
};
|
|
243
|
+
exports._handleAppSettingUpdate = _handleAppSettingUpdate;
|
|
239
244
|
const _handleComponentConfigUpdate = (data) => {
|
|
240
245
|
try {
|
|
241
246
|
const decrypted = (0, security_1.decrypt)(data.configs || '[]', process.env.BLOCKLET_COMPONENT_API_KEY, process.env.BLOCKLET_COMPONENT_DID);
|
|
@@ -356,7 +361,8 @@ const runInServer = (fn, type) =>
|
|
|
356
361
|
};
|
|
357
362
|
const inRuntimeEnv = !!process.env.BLOCKLET_APP_SK;
|
|
358
363
|
if (inRuntimeEnv && !process.env.BLOCKLET_HOOK_NAME && process.env.BLOCKLET_MODE !== 'test') {
|
|
359
|
-
notification_1.default.on(constant_1.BlockletInternalEvents.appConfigChanged,
|
|
364
|
+
notification_1.default.on(constant_1.BlockletInternalEvents.appConfigChanged, _handleAppConfigUpdate);
|
|
365
|
+
notification_1.default.on(constant_1.BlockletInternalEvents.appSettingChanged, _handleAppSettingUpdate);
|
|
360
366
|
notification_1.default.on(constant_1.BlockletInternalEvents.componentConfigChanged, _handleComponentConfigUpdate);
|
|
361
367
|
// Reactive fetch
|
|
362
368
|
notification_1.default.on(constant_1.BlockletInternalEvents.appConfigChanged, refreshBlockletContext);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.46-beta-
|
|
6
|
+
"version": "1.16.46-beta-20250704-234926-09d872ad",
|
|
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",
|
|
@@ -27,28 +27,28 @@
|
|
|
27
27
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/client": "1.16.46-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.46-beta-
|
|
32
|
-
"@abtnode/db-cache": "1.16.46-beta-
|
|
33
|
-
"@abtnode/util": "1.16.46-beta-
|
|
34
|
-
"@arcblock/did": "1.20.
|
|
35
|
-
"@arcblock/did-auth": "1.20.
|
|
36
|
-
"@arcblock/jwt": "1.20.
|
|
37
|
-
"@arcblock/ws": "1.20.
|
|
38
|
-
"@blocklet/constant": "1.16.46-beta-
|
|
39
|
-
"@blocklet/env": "1.16.46-beta-
|
|
30
|
+
"@abtnode/client": "1.16.46-beta-20250704-234926-09d872ad",
|
|
31
|
+
"@abtnode/constant": "1.16.46-beta-20250704-234926-09d872ad",
|
|
32
|
+
"@abtnode/db-cache": "1.16.46-beta-20250704-234926-09d872ad",
|
|
33
|
+
"@abtnode/util": "1.16.46-beta-20250704-234926-09d872ad",
|
|
34
|
+
"@arcblock/did": "1.20.15",
|
|
35
|
+
"@arcblock/did-auth": "1.20.15",
|
|
36
|
+
"@arcblock/jwt": "1.20.15",
|
|
37
|
+
"@arcblock/ws": "1.20.15",
|
|
38
|
+
"@blocklet/constant": "1.16.46-beta-20250704-234926-09d872ad",
|
|
39
|
+
"@blocklet/env": "1.16.46-beta-20250704-234926-09d872ad",
|
|
40
40
|
"@blocklet/error": "^0.2.5",
|
|
41
|
-
"@blocklet/meta": "1.16.46-beta-
|
|
42
|
-
"@blocklet/theme": "^
|
|
41
|
+
"@blocklet/meta": "1.16.46-beta-20250704-234926-09d872ad",
|
|
42
|
+
"@blocklet/theme": "^3.0.14",
|
|
43
43
|
"@did-connect/authenticator": "^2.2.8",
|
|
44
44
|
"@did-connect/handler": "^2.2.8",
|
|
45
45
|
"@nedb/core": "^2.1.5",
|
|
46
|
-
"@ocap/mcrypto": "1.20.
|
|
47
|
-
"@ocap/util": "1.20.
|
|
48
|
-
"@ocap/wallet": "1.20.
|
|
46
|
+
"@ocap/mcrypto": "1.20.15",
|
|
47
|
+
"@ocap/util": "1.20.15",
|
|
48
|
+
"@ocap/wallet": "1.20.15",
|
|
49
49
|
"axios": "^1.7.9",
|
|
50
50
|
"cheerio": "1.0.0-rc.12",
|
|
51
|
-
"debug": "^4.
|
|
51
|
+
"debug": "^4.4.1",
|
|
52
52
|
"fs-extra": "^11.2.0",
|
|
53
53
|
"joi": "17.12.2",
|
|
54
54
|
"json-stable-stringify": "^1.0.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/express": "^5.0.0",
|
|
71
71
|
"@types/jest": "^29.5.13",
|
|
72
72
|
"@types/json-stable-stringify": "^1.0.36",
|
|
73
|
-
"@types/lodash": "^4.17.
|
|
73
|
+
"@types/lodash": "^4.17.20",
|
|
74
74
|
"@types/node": "^22.7.5",
|
|
75
75
|
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
|
76
76
|
"@typescript-eslint/parser": "^5.42.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"ts-node": "^10.9.1",
|
|
86
86
|
"typescript": "^5.6.3"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "1767a642c60fcfada6be69de0e68c5d269489e5d"
|
|
89
89
|
}
|