@blocklet/sdk 1.16.48 → 1.16.49-beta-20250813-141500-f02b41b4
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/component/index.js +3 -1
- package/lib/config.d.ts +4 -12
- package/lib/config.js +8 -7
- package/lib/types/notification.d.ts +1 -0
- package/lib/util/send-notification.js +1 -1
- package/lib/validators/notification.js +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +11 -11
package/lib/component/index.js
CHANGED
|
@@ -44,10 +44,12 @@ const ufo_1 = require("ufo");
|
|
|
44
44
|
const p_retry_1 = __importDefault(require("p-retry"));
|
|
45
45
|
const wait_port_1 = __importDefault(require("wait-port"));
|
|
46
46
|
const constant_1 = require("@blocklet/constant");
|
|
47
|
+
const debug_1 = __importDefault(require("debug"));
|
|
47
48
|
const config_1 = __importStar(require("../config"));
|
|
48
49
|
const Util = __importStar(require("./util"));
|
|
49
50
|
const component_api_1 = __importDefault(require("../util/component-api"));
|
|
50
51
|
const parse_docker_endpoint_1 = require("../util/parse-docker-endpoint");
|
|
52
|
+
const debug = (0, debug_1.default)('@blocklet/sdk:component');
|
|
51
53
|
// eslint-disable-next-line require-await
|
|
52
54
|
const doCall = async ({ url, headers = {}, ...options }, retryOptions = {}) => (0, p_retry_1.default)(async () => {
|
|
53
55
|
const startTime = Date.now();
|
|
@@ -59,7 +61,7 @@ const doCall = async ({ url, headers = {}, ...options }, retryOptions = {}) => (
|
|
|
59
61
|
headers,
|
|
60
62
|
});
|
|
61
63
|
const duration = Date.now() - startTime;
|
|
62
|
-
|
|
64
|
+
debug(`component.call succeed in ${duration}ms: ${url} `);
|
|
63
65
|
return res;
|
|
64
66
|
}
|
|
65
67
|
catch (error) {
|
package/lib/config.d.ts
CHANGED
|
@@ -80,12 +80,8 @@ declare const _handleComponentConfigUpdate: (data: any) => void;
|
|
|
80
80
|
declare const getBlockletSettings: () => {
|
|
81
81
|
theme: {
|
|
82
82
|
prefer: "system";
|
|
83
|
-
light:
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
dark: {
|
|
87
|
-
palette: import("@mui/material").PaletteOptions;
|
|
88
|
-
};
|
|
83
|
+
light: import("@blocklet/theme").ThemeOptions;
|
|
84
|
+
dark: import("@blocklet/theme").ThemeOptions;
|
|
89
85
|
};
|
|
90
86
|
federated: any;
|
|
91
87
|
enableBlacklist: boolean;
|
|
@@ -150,12 +146,8 @@ declare const _default: {
|
|
|
150
146
|
getBlockletSettings: () => {
|
|
151
147
|
theme: {
|
|
152
148
|
prefer: "system";
|
|
153
|
-
light:
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
dark: {
|
|
157
|
-
palette: import("@mui/material").PaletteOptions;
|
|
158
|
-
};
|
|
149
|
+
light: import("@blocklet/theme").ThemeOptions;
|
|
150
|
+
dark: import("@blocklet/theme").ThemeOptions;
|
|
159
151
|
};
|
|
160
152
|
federated: any;
|
|
161
153
|
enableBlacklist: boolean;
|
package/lib/config.js
CHANGED
|
@@ -274,12 +274,8 @@ const _handleComponentConfigUpdate = (data) => {
|
|
|
274
274
|
exports._handleComponentConfigUpdate = _handleComponentConfigUpdate;
|
|
275
275
|
const DEFAULT_THEME_SETTINGS = {
|
|
276
276
|
prefer: 'system',
|
|
277
|
-
light:
|
|
278
|
-
|
|
279
|
-
},
|
|
280
|
-
dark: {
|
|
281
|
-
palette: theme_1.BLOCKLET_THEME_DARK.palette,
|
|
282
|
-
},
|
|
277
|
+
light: theme_1.BLOCKLET_THEME_LIGHT,
|
|
278
|
+
dark: theme_1.BLOCKLET_THEME_DARK,
|
|
283
279
|
};
|
|
284
280
|
let blockletJs = '';
|
|
285
281
|
const blockletSettings = {
|
|
@@ -315,7 +311,12 @@ const fetchBlockletJs = async (type = 'js') => {
|
|
|
315
311
|
throw new Error('Invalid blocklet.json response');
|
|
316
312
|
}
|
|
317
313
|
if (typeof data === 'object') {
|
|
318
|
-
blockletSettings.theme =
|
|
314
|
+
blockletSettings.theme = {
|
|
315
|
+
...DEFAULT_THEME_SETTINGS,
|
|
316
|
+
...(data.theme || {}),
|
|
317
|
+
light: (0, theme_1.merge)(DEFAULT_THEME_SETTINGS.light, data.theme?.light || {}),
|
|
318
|
+
dark: (0, theme_1.merge)(DEFAULT_THEME_SETTINGS.dark, data.theme?.dark || {}),
|
|
319
|
+
};
|
|
319
320
|
logger.info(`Fetch blocklet.json succeed: ${env.appPid}/${componentDid}`);
|
|
320
321
|
return data;
|
|
321
322
|
}
|
|
@@ -72,7 +72,7 @@ const sendToUser = async (receiver, notification, { appDid, appSk, type }, optio
|
|
|
72
72
|
if (pathname === 'send-to-mail') {
|
|
73
73
|
await (0, index_1.validateEmail)(receiver);
|
|
74
74
|
}
|
|
75
|
-
const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels', 'raw', 'ttl']);
|
|
75
|
+
const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels', 'raw', 'ttl', 'allowUnsubscribe']);
|
|
76
76
|
await (0, index_1.validateOption)(opt);
|
|
77
77
|
if (SERVER_MODE !== NODE_MODES.DEBUG) {
|
|
78
78
|
await (0, index_1.validateNotification)(notification);
|
|
@@ -285,6 +285,7 @@ const optionSchema = Joi.object({
|
|
|
285
285
|
.items(Joi.allow('app', 'email', 'push', 'webhook'))
|
|
286
286
|
.optional(),
|
|
287
287
|
ttl: Joi.number().integer().min(0).max(7200).optional(), // 0-7200 分钟
|
|
288
|
+
allowUnsubscribe: Joi.boolean().optional(),
|
|
288
289
|
})
|
|
289
290
|
.unknown()
|
|
290
291
|
.meta({ className: 'TSendOptions', unknownType: 'any' });
|
package/lib/version.d.ts
CHANGED
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.
|
|
6
|
+
"version": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
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,19 +27,19 @@
|
|
|
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.
|
|
31
|
-
"@abtnode/constant": "1.16.
|
|
32
|
-
"@abtnode/db-cache": "1.16.
|
|
33
|
-
"@abtnode/util": "1.16.
|
|
30
|
+
"@abtnode/client": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
31
|
+
"@abtnode/constant": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
32
|
+
"@abtnode/db-cache": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
33
|
+
"@abtnode/util": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
34
34
|
"@arcblock/did": "1.21.2",
|
|
35
35
|
"@arcblock/did-connect-js": "1.21.2",
|
|
36
36
|
"@arcblock/jwt": "1.21.2",
|
|
37
|
-
"@arcblock/ws": "1.21.
|
|
38
|
-
"@blocklet/constant": "1.16.
|
|
39
|
-
"@blocklet/env": "1.16.
|
|
37
|
+
"@arcblock/ws": "1.21.3",
|
|
38
|
+
"@blocklet/constant": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
39
|
+
"@blocklet/env": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
40
40
|
"@blocklet/error": "^0.2.5",
|
|
41
|
-
"@blocklet/meta": "1.16.
|
|
42
|
-
"@blocklet/theme": "^3.1.
|
|
41
|
+
"@blocklet/meta": "1.16.49-beta-20250813-141500-f02b41b4",
|
|
42
|
+
"@blocklet/theme": "^3.1.17",
|
|
43
43
|
"@did-connect/authenticator": "^2.2.8",
|
|
44
44
|
"@did-connect/handler": "^2.2.8",
|
|
45
45
|
"@nedb/core": "^2.1.5",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"ts-node": "^10.9.1",
|
|
86
86
|
"typescript": "^5.6.3"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "ff97c4a29a0eac939237a935e391d5d1b9c6eec2"
|
|
89
89
|
}
|