@abtnode/util 1.17.3-beta-20251123-232619-53258789 → 1.17.3-beta-20251126-121502-d0926972
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.js +25 -0
- package/package.json +13 -13
package/lib/blocklet.js
CHANGED
|
@@ -4,9 +4,33 @@ const isUrl = require('is-url');
|
|
|
4
4
|
const { joinURL } = require('ufo');
|
|
5
5
|
const { WELLKNOWN_SERVICE_PATH_PREFIX } = require('@abtnode/constant');
|
|
6
6
|
const { BLOCKLET_CONFIGURABLE_KEY } = require('@blocklet/constant');
|
|
7
|
+
const { getApplicationWallet } = require('@blocklet/meta/lib/wallet');
|
|
7
8
|
|
|
8
9
|
const getLogoHash = (logo) => encodeURIComponent((logo || '').split('/').slice(-1)[0].slice(0, 7));
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @param {{
|
|
15
|
+
* serverSecretKey: string;
|
|
16
|
+
* blockletAppDid: string;
|
|
17
|
+
* }} {
|
|
18
|
+
* serverSecretKey,
|
|
19
|
+
* blockletAppDid
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
function getAccessWallet({ serverSecretKey, blockletAppDid }) {
|
|
24
|
+
if (!serverSecretKey) {
|
|
25
|
+
throw new Error('serverSecretKey should not be empty');
|
|
26
|
+
}
|
|
27
|
+
if (!blockletAppDid) {
|
|
28
|
+
throw new Error('blockletAppDid should not be empty');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return getApplicationWallet(blockletAppDid, serverSecretKey, undefined, 2);
|
|
32
|
+
}
|
|
33
|
+
|
|
10
34
|
const getComponentApiKey = ({ serverSk, app, component } = {}) => {
|
|
11
35
|
if (!serverSk) {
|
|
12
36
|
throw new Error('serverSk should not be empty');
|
|
@@ -101,6 +125,7 @@ const getBlockletLogos = (blocklet) => {
|
|
|
101
125
|
};
|
|
102
126
|
|
|
103
127
|
module.exports = {
|
|
128
|
+
getAccessWallet,
|
|
104
129
|
getComponentApiKey,
|
|
105
130
|
getAppImageCacheDir: (cacheDir) => path.join(cacheDir, '.services', 'image-filter'),
|
|
106
131
|
getAppOgCacheDir: (cacheDir) => path.join(cacheDir, '.services', 'open-graph'),
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.3-beta-
|
|
6
|
+
"version": "1.17.3-beta-20251126-121502-d0926972",
|
|
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.3-beta-
|
|
22
|
-
"@abtnode/db-cache": "1.17.3-beta-
|
|
23
|
-
"@arcblock/did": "^1.27.
|
|
24
|
-
"@arcblock/event-hub": "^1.27.
|
|
21
|
+
"@abtnode/constant": "1.17.3-beta-20251126-121502-d0926972",
|
|
22
|
+
"@abtnode/db-cache": "1.17.3-beta-20251126-121502-d0926972",
|
|
23
|
+
"@arcblock/did": "^1.27.12",
|
|
24
|
+
"@arcblock/event-hub": "^1.27.12",
|
|
25
25
|
"@arcblock/pm2": "^6.0.12",
|
|
26
|
-
"@blocklet/constant": "1.17.3-beta-
|
|
26
|
+
"@blocklet/constant": "1.17.3-beta-20251126-121502-d0926972",
|
|
27
27
|
"@blocklet/error": "^0.3.3",
|
|
28
|
-
"@blocklet/meta": "1.17.3-beta-
|
|
29
|
-
"@blocklet/xss": "^0.3.
|
|
30
|
-
"@ocap/client": "^1.27.
|
|
31
|
-
"@ocap/mcrypto": "^1.27.
|
|
32
|
-
"@ocap/util": "^1.27.
|
|
33
|
-
"@ocap/wallet": "^1.27.
|
|
28
|
+
"@blocklet/meta": "1.17.3-beta-20251126-121502-d0926972",
|
|
29
|
+
"@blocklet/xss": "^0.3.10",
|
|
30
|
+
"@ocap/client": "^1.27.12",
|
|
31
|
+
"@ocap/mcrypto": "^1.27.12",
|
|
32
|
+
"@ocap/util": "^1.27.12",
|
|
33
|
+
"@ocap/wallet": "^1.27.12",
|
|
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": "7039cacaad2a14a9573371e24e57cbbd6b6525c8"
|
|
94
94
|
}
|