@blocklet/sdk 1.17.0-beta-20251105-030013-0c24dbf6 → 1.17.0-beta-20251105-095418-158ab2fa
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
CHANGED
|
@@ -83,13 +83,14 @@ const doCall = ({ url, componentName, callPath, headers = {}, ...options }, retr
|
|
|
83
83
|
headers,
|
|
84
84
|
});
|
|
85
85
|
const duration = Date.now() - startTime;
|
|
86
|
-
debug(`component.call succeed in ${duration}ms: ${url} `);
|
|
86
|
+
debug(`component.call to ${componentName} succeed in ${duration}ms: ${url} `);
|
|
87
87
|
return res;
|
|
88
88
|
}
|
|
89
89
|
catch (error) {
|
|
90
90
|
const duration = Date.now() - startTime;
|
|
91
91
|
config_1.default.logger.error(`component.call failed in ${duration}ms`, {
|
|
92
92
|
url,
|
|
93
|
+
componentName,
|
|
93
94
|
responseStatus: (0, get_1.default)(error, 'response.status'),
|
|
94
95
|
responseData: (0, get_1.default)(error, 'response.data'),
|
|
95
96
|
error: (0, get_1.default)(error, 'message'),
|
|
@@ -126,7 +127,7 @@ const call = async ({ name, method = 'POST', path: _path, ...options }, retryOpt
|
|
|
126
127
|
catch (error) {
|
|
127
128
|
const component = getComponent(name);
|
|
128
129
|
if (component.status !== constant_1.BlockletStatus.running) {
|
|
129
|
-
throw new Error(`component ${name} is not running`);
|
|
130
|
+
throw new Error(`component ${name} is not running, status: ${component.status}`);
|
|
130
131
|
}
|
|
131
132
|
throw error;
|
|
132
133
|
}
|
|
@@ -312,14 +312,24 @@ const cleanup = () => {
|
|
|
312
312
|
};
|
|
313
313
|
exports.cleanup = cleanup;
|
|
314
314
|
const on = async (event, cb) => {
|
|
315
|
-
|
|
315
|
+
try {
|
|
316
|
+
await (0, exports.ensureClient)();
|
|
317
|
+
}
|
|
318
|
+
catch (err) {
|
|
319
|
+
console.warn(`Error when subscribing to event: ${event}`, err);
|
|
320
|
+
}
|
|
316
321
|
return emitter.on(event, cb);
|
|
317
322
|
};
|
|
318
323
|
exports.on = on;
|
|
319
324
|
exports.off = emitter.off.bind(emitter);
|
|
320
325
|
exports._message = {
|
|
321
326
|
on: async (event, cb) => {
|
|
322
|
-
|
|
327
|
+
try {
|
|
328
|
+
await (0, exports.ensureClient)();
|
|
329
|
+
}
|
|
330
|
+
catch (err) {
|
|
331
|
+
console.warn(`Error when subscribing to message event: ${event}`, err);
|
|
332
|
+
}
|
|
323
333
|
return messageEmitter.on(event, cb);
|
|
324
334
|
},
|
|
325
335
|
off: messageEmitter.off.bind(messageEmitter),
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.0-beta-20251105-
|
|
6
|
+
"version": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
7
7
|
"description": "graphql client to read/write data on abt node",
|
|
8
8
|
"homepage": "https://www.arcblock.io/docs/blocklet-sdk-nodejs",
|
|
9
9
|
"main": "lib/index.js",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@abtnode/constant": "1.17.0-beta-20251105-
|
|
30
|
-
"@abtnode/db-cache": "1.17.0-beta-20251105-
|
|
31
|
-
"@abtnode/util": "1.17.0-beta-20251105-
|
|
29
|
+
"@abtnode/constant": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
30
|
+
"@abtnode/db-cache": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
31
|
+
"@abtnode/util": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
32
32
|
"@arcblock/did": "^1.27.2",
|
|
33
33
|
"@arcblock/did-connect-js": "^1.27.2",
|
|
34
34
|
"@arcblock/did-ext": "^1.27.2",
|
|
35
35
|
"@arcblock/jwt": "^1.27.2",
|
|
36
36
|
"@arcblock/ws": "^1.27.2",
|
|
37
|
-
"@blocklet/constant": "1.17.0-beta-20251105-
|
|
38
|
-
"@blocklet/env": "1.17.0-beta-20251105-
|
|
37
|
+
"@blocklet/constant": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
38
|
+
"@blocklet/env": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
39
39
|
"@blocklet/error": "^0.3.1",
|
|
40
|
-
"@blocklet/meta": "1.17.0-beta-20251105-
|
|
41
|
-
"@blocklet/server-js": "1.17.0-beta-20251105-
|
|
40
|
+
"@blocklet/meta": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
41
|
+
"@blocklet/server-js": "1.17.0-beta-20251105-095418-158ab2fa",
|
|
42
42
|
"@blocklet/theme": "^3.1.56",
|
|
43
43
|
"@did-connect/authenticator": "^2.2.8",
|
|
44
44
|
"@did-connect/handler": "^2.2.8",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"ts-node": "^10.9.1",
|
|
83
83
|
"typescript": "^5.6.3"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "bce9e12ce054d3caf16b5b0806f6ed6f141ab34c"
|
|
86
86
|
}
|