@abtnode/util 1.8.69-beta-b0bb2d67 → 1.8.69-beta-650a290b
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/did-document.js +15 -8
- package/lib/run-script.js +2 -1
- package/package.json +9 -9
package/lib/did-document.js
CHANGED
|
@@ -18,7 +18,7 @@ const getDID = (address) => {
|
|
|
18
18
|
return `did:abt:${address}`;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const update = async ({ services, didRegistryUrl, wallet }) => {
|
|
21
|
+
const update = async ({ services, didRegistryUrl, wallet, alsoKnownAs = [] }) => {
|
|
22
22
|
debug('update did document', { didRegistryUrl });
|
|
23
23
|
|
|
24
24
|
const did = getDID(wallet.address);
|
|
@@ -29,6 +29,7 @@ const update = async ({ services, didRegistryUrl, wallet }) => {
|
|
|
29
29
|
id: did,
|
|
30
30
|
controller: did,
|
|
31
31
|
service: services,
|
|
32
|
+
alsoKnownAs,
|
|
32
33
|
verificationMethod: [
|
|
33
34
|
{
|
|
34
35
|
id: `${did}#key-1`,
|
|
@@ -75,15 +76,15 @@ const getServerServices = ({ ips, wallet, domain }) => {
|
|
|
75
76
|
return services;
|
|
76
77
|
};
|
|
77
78
|
|
|
78
|
-
const getBlockletServices = ({
|
|
79
|
+
const getBlockletServices = ({ appPid, daemonDidDomain, domain }) => {
|
|
79
80
|
return [
|
|
80
81
|
{
|
|
81
|
-
id: getDID(
|
|
82
|
+
id: getDID(appPid),
|
|
82
83
|
type: 'DNSRecords',
|
|
83
84
|
records: [
|
|
84
85
|
{
|
|
85
86
|
type: 'CNAME',
|
|
86
|
-
rr: encodeBase32(
|
|
87
|
+
rr: encodeBase32(appPid),
|
|
87
88
|
value: daemonDidDomain,
|
|
88
89
|
domain,
|
|
89
90
|
},
|
|
@@ -103,10 +104,16 @@ const updateServerDocument = async ({ ips, wallet, didRegistryUrl, domain }) =>
|
|
|
103
104
|
return updateWithRetry({ services, didRegistryUrl, wallet });
|
|
104
105
|
};
|
|
105
106
|
|
|
106
|
-
const updateBlockletDocument = async ({
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
const updateBlockletDocument = async ({
|
|
108
|
+
wallet,
|
|
109
|
+
didRegistryUrl,
|
|
110
|
+
domain,
|
|
111
|
+
daemonDidDomain,
|
|
112
|
+
appPid,
|
|
113
|
+
alsoKnownAs = [],
|
|
114
|
+
}) => {
|
|
115
|
+
const services = getBlockletServices({ appPid, daemonDidDomain, domain });
|
|
116
|
+
return updateWithRetry({ services, didRegistryUrl, alsoKnownAs, wallet });
|
|
110
117
|
};
|
|
111
118
|
|
|
112
119
|
const disableDNS = async ({ wallet, didRegistryUrl }) => updateWithRetry({ services: [], didRegistryUrl, wallet });
|
package/lib/run-script.js
CHANGED
|
@@ -39,10 +39,11 @@ const wrapStream = (next, prefix, state) => {
|
|
|
39
39
|
*
|
|
40
40
|
* @param {string} script
|
|
41
41
|
* @param {string} label
|
|
42
|
+
* @param {object} options
|
|
42
43
|
* @param {object} options.env
|
|
43
44
|
* @param {string} options.cwd
|
|
44
45
|
* @param {number} options.timeout
|
|
45
|
-
* @param {
|
|
46
|
+
* @param {boolean} options.silent
|
|
46
47
|
* @return {Promise}
|
|
47
48
|
*/
|
|
48
49
|
const runScript = (script, label, options = {}) => {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.69-beta-
|
|
6
|
+
"version": "1.8.69-beta-650a290b",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.8.69-beta-
|
|
22
|
-
"@abtnode/logger": "1.8.69-beta-
|
|
23
|
-
"@arcblock/jwt": "^1.18.
|
|
24
|
-
"@blocklet/constant": "1.8.69-beta-
|
|
25
|
-
"@ocap/mcrypto": "1.18.
|
|
26
|
-
"@ocap/util": "1.18.
|
|
27
|
-
"@ocap/wallet": "1.18.
|
|
21
|
+
"@abtnode/constant": "1.8.69-beta-650a290b",
|
|
22
|
+
"@abtnode/logger": "1.8.69-beta-650a290b",
|
|
23
|
+
"@arcblock/jwt": "^1.18.59",
|
|
24
|
+
"@blocklet/constant": "1.8.69-beta-650a290b",
|
|
25
|
+
"@ocap/mcrypto": "1.18.59",
|
|
26
|
+
"@ocap/util": "1.18.59",
|
|
27
|
+
"@ocap/wallet": "1.18.59",
|
|
28
28
|
"archiver": "^5.3.1",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"axios-mock-adapter": "^1.21.2",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"jest": "^27.5.1",
|
|
71
71
|
"unzipper": "^0.10.11"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "a33c9ce6a52b8d522d13860e85809dcbba236712"
|
|
74
74
|
}
|