@blocklet/meta 1.16.4 → 1.16.5
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-utils.d.ts +5 -5
- package/lib/did-utils.js +16 -16
- package/lib/index.d.ts +7 -7
- package/lib/index.js +11 -11
- package/package.json +15 -15
package/lib/did-utils.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export interface ExtraConfigs {
|
|
|
3
3
|
sourceProvider: string;
|
|
4
4
|
connectedAccounts: any[];
|
|
5
5
|
}
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
6
|
+
export declare function getPermanentDid(user: UserInfo): string;
|
|
7
|
+
export declare function getConnectedAccounts(user: UserInfo): any[];
|
|
8
|
+
export declare function getConnectedDids(user: UserInfo): any[];
|
|
9
|
+
export declare function getWallet(user: UserInfo): any;
|
|
10
|
+
export declare function getWalletDid(user: UserInfo): any;
|
package/lib/did-utils.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
return user
|
|
3
|
+
exports.getWalletDid = exports.getWallet = exports.getConnectedDids = exports.getConnectedAccounts = exports.getPermanentDid = void 0;
|
|
4
|
+
function getPermanentDid(user) {
|
|
5
|
+
return user?.did;
|
|
6
6
|
}
|
|
7
|
-
exports.
|
|
8
|
-
function
|
|
9
|
-
const connectedAccounts = user
|
|
7
|
+
exports.getPermanentDid = getPermanentDid;
|
|
8
|
+
function getConnectedAccounts(user) {
|
|
9
|
+
const connectedAccounts = user?.extraConfigs?.connectedAccounts || [];
|
|
10
10
|
return connectedAccounts;
|
|
11
11
|
}
|
|
12
|
-
exports.
|
|
13
|
-
function
|
|
14
|
-
const connectedAccounts =
|
|
12
|
+
exports.getConnectedAccounts = getConnectedAccounts;
|
|
13
|
+
function getConnectedDids(user) {
|
|
14
|
+
const connectedAccounts = getConnectedAccounts(user);
|
|
15
15
|
const didList = connectedAccounts.map((item) => item.did);
|
|
16
16
|
return didList;
|
|
17
17
|
}
|
|
18
|
-
exports.
|
|
19
|
-
function
|
|
20
|
-
const connectedAccounts = user
|
|
18
|
+
exports.getConnectedDids = getConnectedDids;
|
|
19
|
+
function getWallet(user) {
|
|
20
|
+
const connectedAccounts = user?.extraConfigs?.connectedAccounts || [];
|
|
21
21
|
const walletAccount = connectedAccounts.find((item) => item.provider === 'wallet');
|
|
22
22
|
return walletAccount;
|
|
23
23
|
}
|
|
24
|
-
exports.
|
|
25
|
-
function
|
|
26
|
-
const walletAccount =
|
|
24
|
+
exports.getWallet = getWallet;
|
|
25
|
+
function getWalletDid(user) {
|
|
26
|
+
const walletAccount = getWallet(user);
|
|
27
27
|
return walletAccount?.did;
|
|
28
28
|
}
|
|
29
|
-
exports.
|
|
29
|
+
exports.getWalletDid = getWalletDid;
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { validateMeta, fixAndValidateService } from './validate';
|
|
|
9
9
|
import { formatPerson, parsePerson, fixPerson, fixInterfaces, fixService, fixName } from './fix';
|
|
10
10
|
import { list, select, update, read } from './file';
|
|
11
11
|
import verifyMultiSig from './verify-multi-sig';
|
|
12
|
-
import {
|
|
12
|
+
import { getConnectedAccounts, getConnectedDids, getPermanentDid, getWallet, getWalletDid } from './did-utils';
|
|
13
13
|
export { constants };
|
|
14
14
|
export { list };
|
|
15
15
|
export { select };
|
|
@@ -29,7 +29,7 @@ export { getBlockletWallet };
|
|
|
29
29
|
export { getBlockletInfo };
|
|
30
30
|
export { getBlockletEngine };
|
|
31
31
|
export { verifyMultiSig };
|
|
32
|
-
export {
|
|
32
|
+
export { getConnectedAccounts, getConnectedDids, getPermanentDid, getWallet, getWalletDid };
|
|
33
33
|
declare const _default: {
|
|
34
34
|
constants: any;
|
|
35
35
|
list: any[];
|
|
@@ -84,10 +84,10 @@ declare const _default: {
|
|
|
84
84
|
};
|
|
85
85
|
getBlockletEngine: (meta: import("./types").TBlockletMeta) => import("./types").TEngine;
|
|
86
86
|
verifyMultiSig: (blockletMeta: import("./types").TBlockletMeta) => boolean;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
getConnectedAccounts: typeof getConnectedAccounts;
|
|
88
|
+
getConnectedDids: typeof getConnectedDids;
|
|
89
|
+
getPermanentDid: typeof getPermanentDid;
|
|
90
|
+
getWallet: typeof getWallet;
|
|
91
|
+
getWalletDid: typeof getWalletDid;
|
|
92
92
|
};
|
|
93
93
|
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getWalletDid = exports.getWallet = exports.getPermanentDid = exports.getConnectedDids = exports.getConnectedAccounts = exports.verifyMultiSig = exports.getBlockletEngine = exports.getBlockletInfo = exports.getBlockletWallet = exports.toBlockletDid = exports.fixName = exports.fixService = exports.fixInterfaces = exports.fixPerson = exports.parsePerson = exports.formatPerson = exports.fixAndValidateService = exports.validateMeta = exports.parse = exports.read = exports.update = exports.select = exports.list = exports.constants = void 0;
|
|
7
7
|
const constants_1 = __importDefault(require("./constants"));
|
|
8
8
|
exports.constants = constants_1.default;
|
|
9
9
|
const parse_1 = __importDefault(require("./parse"));
|
|
@@ -34,11 +34,11 @@ Object.defineProperty(exports, "read", { enumerable: true, get: function () { re
|
|
|
34
34
|
const verify_multi_sig_1 = __importDefault(require("./verify-multi-sig"));
|
|
35
35
|
exports.verifyMultiSig = verify_multi_sig_1.default;
|
|
36
36
|
const did_utils_1 = require("./did-utils");
|
|
37
|
-
Object.defineProperty(exports, "
|
|
38
|
-
Object.defineProperty(exports, "
|
|
39
|
-
Object.defineProperty(exports, "
|
|
40
|
-
Object.defineProperty(exports, "
|
|
41
|
-
Object.defineProperty(exports, "
|
|
37
|
+
Object.defineProperty(exports, "getConnectedAccounts", { enumerable: true, get: function () { return did_utils_1.getConnectedAccounts; } });
|
|
38
|
+
Object.defineProperty(exports, "getConnectedDids", { enumerable: true, get: function () { return did_utils_1.getConnectedDids; } });
|
|
39
|
+
Object.defineProperty(exports, "getPermanentDid", { enumerable: true, get: function () { return did_utils_1.getPermanentDid; } });
|
|
40
|
+
Object.defineProperty(exports, "getWallet", { enumerable: true, get: function () { return did_utils_1.getWallet; } });
|
|
41
|
+
Object.defineProperty(exports, "getWalletDid", { enumerable: true, get: function () { return did_utils_1.getWalletDid; } });
|
|
42
42
|
exports.default = {
|
|
43
43
|
constants: constants_1.default,
|
|
44
44
|
list: file_1.list,
|
|
@@ -59,9 +59,9 @@ exports.default = {
|
|
|
59
59
|
getBlockletInfo: info_1.default,
|
|
60
60
|
getBlockletEngine: engine_1.default,
|
|
61
61
|
verifyMultiSig: verify_multi_sig_1.default,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
getConnectedAccounts: did_utils_1.getConnectedAccounts,
|
|
63
|
+
getConnectedDids: did_utils_1.getConnectedDids,
|
|
64
|
+
getPermanentDid: did_utils_1.getPermanentDid,
|
|
65
|
+
getWallet: did_utils_1.getWallet,
|
|
66
|
+
getWalletDid: did_utils_1.getWalletDid,
|
|
67
67
|
};
|
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.5",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"typings": "./lib/index.d.ts",
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@abtnode/client": "1.16.
|
|
28
|
-
"@abtnode/constant": "1.16.
|
|
29
|
-
"@abtnode/util": "1.16.
|
|
30
|
-
"@arcblock/did": "1.18.
|
|
31
|
-
"@arcblock/did-ext": "1.18.
|
|
32
|
-
"@arcblock/did-util": "1.18.
|
|
33
|
-
"@arcblock/jwt": "1.18.
|
|
34
|
-
"@blocklet/constant": "1.16.
|
|
35
|
-
"@ocap/asset": "1.18.
|
|
36
|
-
"@ocap/mcrypto": "1.18.
|
|
37
|
-
"@ocap/types": "1.18.
|
|
38
|
-
"@ocap/util": "1.18.
|
|
39
|
-
"@ocap/wallet": "1.18.
|
|
27
|
+
"@abtnode/client": "1.16.5",
|
|
28
|
+
"@abtnode/constant": "1.16.5",
|
|
29
|
+
"@abtnode/util": "1.16.5",
|
|
30
|
+
"@arcblock/did": "1.18.68",
|
|
31
|
+
"@arcblock/did-ext": "1.18.68",
|
|
32
|
+
"@arcblock/did-util": "1.18.68",
|
|
33
|
+
"@arcblock/jwt": "1.18.68",
|
|
34
|
+
"@blocklet/constant": "1.16.5",
|
|
35
|
+
"@ocap/asset": "1.18.68",
|
|
36
|
+
"@ocap/mcrypto": "1.18.68",
|
|
37
|
+
"@ocap/types": "1.18.68",
|
|
38
|
+
"@ocap/util": "1.18.68",
|
|
39
|
+
"@ocap/wallet": "1.18.68",
|
|
40
40
|
"ajv": "^8.11.0",
|
|
41
41
|
"axios": "^0.27.2",
|
|
42
42
|
"cjk-length": "^1.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"ts-node": "^10.9.1",
|
|
81
81
|
"typescript": "^4.8.4"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "229effc24ce7e12a0dbe551b2cc57825c3803745"
|
|
84
84
|
}
|