@abtnode/util 1.17.8-beta-20260111-112953-aed5ff39 → 1.17.8-beta-20260115-003043-5e15c08a
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/blocklet-cache.js +2 -3
- package/lib/detect-workspace.js +5 -0
- package/lib/did-document.js +1 -1
- package/package.json +12 -12
package/lib/blocklet-cache.js
CHANGED
|
@@ -2,7 +2,6 @@ const { DBCache, getAbtNodeRedisAndSQLiteUrl } = require('@abtnode/db-cache');
|
|
|
2
2
|
const { BLOCKLET_CACHE_TTL } = require('@abtnode/constant');
|
|
3
3
|
|
|
4
4
|
const BLOCKLET_INFO_SHORT_CACHE_TTL = 1000 * 60 * 30; // 30 minutes
|
|
5
|
-
const logger = console;
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Blocklet Info 缓存, 用于 blocklet.js 请求,快速返回数据
|
|
@@ -37,7 +36,7 @@ const getBlockletInfoCachePrefixKey = (did) => {
|
|
|
37
36
|
*
|
|
38
37
|
* @param {string} did: blockletDid
|
|
39
38
|
*/
|
|
40
|
-
const clearBlockletInfoCache = async (did) => {
|
|
39
|
+
const clearBlockletInfoCache = async (did, logger = console) => {
|
|
41
40
|
try {
|
|
42
41
|
// 由于 cacheKey 包含动态参数(pathPrefix 等),无法枚举所有可能的 key
|
|
43
42
|
// 所以使用前缀匹配删除所有与该 DID 相关的缓存
|
|
@@ -64,7 +63,7 @@ const blockletCache = new DBCache(() => ({
|
|
|
64
63
|
* 删除 Blocklet state 缓存
|
|
65
64
|
* @param {string} did: blockletDid
|
|
66
65
|
*/
|
|
67
|
-
const deleteBlockletCache = async (did) => {
|
|
66
|
+
const deleteBlockletCache = async (did, logger = console) => {
|
|
68
67
|
try {
|
|
69
68
|
await blockletCache.del(did);
|
|
70
69
|
logger.info('Deleted blocklet cache', { did });
|
package/lib/detect-workspace.js
CHANGED
|
@@ -2,6 +2,11 @@ const path = require('path');
|
|
|
2
2
|
const defaultFindUp = require('find-up');
|
|
3
3
|
|
|
4
4
|
const detectWorkspace = (cwd, findUp = defaultFindUp) => {
|
|
5
|
+
const bunLockPath = findUp.sync('bun.lock', { cwd });
|
|
6
|
+
if (bunLockPath) {
|
|
7
|
+
return { type: 'bun', dir: path.dirname(bunLockPath) };
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
const yarnLockPath = findUp.sync('yarn.lock', { cwd });
|
|
6
11
|
if (yarnLockPath) {
|
|
7
12
|
return { type: 'yarn', dir: path.dirname(yarnLockPath) };
|
package/lib/did-document.js
CHANGED
|
@@ -308,7 +308,7 @@ const updateBlockletDocument = ({
|
|
|
308
308
|
launcher,
|
|
309
309
|
domains,
|
|
310
310
|
}) => {
|
|
311
|
-
const
|
|
311
|
+
const appPid = blocklet.appPid || blocklet.meta?.did;
|
|
312
312
|
if (['0', 'false', 0, false].includes(process.env.ABT_NODE_DID_DOCUMENT_UPDATE)) {
|
|
313
313
|
throw new Error('Did Document update is disabled');
|
|
314
314
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.8-beta-
|
|
6
|
+
"version": "1.17.8-beta-20260115-003043-5e15c08a",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
"author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.17.8-beta-
|
|
22
|
-
"@abtnode/db-cache": "1.17.8-beta-
|
|
23
|
-
"@arcblock/did": "^1.28.
|
|
24
|
-
"@arcblock/event-hub": "^1.28.
|
|
21
|
+
"@abtnode/constant": "1.17.8-beta-20260115-003043-5e15c08a",
|
|
22
|
+
"@abtnode/db-cache": "1.17.8-beta-20260115-003043-5e15c08a",
|
|
23
|
+
"@arcblock/did": "^1.28.5",
|
|
24
|
+
"@arcblock/event-hub": "^1.28.5",
|
|
25
25
|
"@arcblock/pm2": "^6.0.12",
|
|
26
|
-
"@blocklet/constant": "1.17.8-beta-
|
|
26
|
+
"@blocklet/constant": "1.17.8-beta-20260115-003043-5e15c08a",
|
|
27
27
|
"@blocklet/error": "^0.3.5",
|
|
28
|
-
"@blocklet/meta": "1.17.8-beta-
|
|
28
|
+
"@blocklet/meta": "1.17.8-beta-20260115-003043-5e15c08a",
|
|
29
29
|
"@blocklet/xss": "^0.3.16",
|
|
30
|
-
"@ocap/client": "^1.28.
|
|
31
|
-
"@ocap/mcrypto": "^1.28.
|
|
32
|
-
"@ocap/util": "^1.28.
|
|
33
|
-
"@ocap/wallet": "^1.28.
|
|
30
|
+
"@ocap/client": "^1.28.5",
|
|
31
|
+
"@ocap/mcrypto": "^1.28.5",
|
|
32
|
+
"@ocap/util": "^1.28.5",
|
|
33
|
+
"@ocap/wallet": "^1.28.5",
|
|
34
34
|
"archiver": "^7.0.1",
|
|
35
35
|
"axios": "^1.7.9",
|
|
36
36
|
"axios-mock-adapter": "^2.1.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"express": "^4.18.2",
|
|
91
91
|
"fs-extra": "^11.2.0"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "b22c37d35c84211b50f9ca05176f2c6de59fb24d"
|
|
94
94
|
}
|