@blocklet/meta 1.16.28-next-5a717317 → 1.16.28
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/nft-templates.js +3 -6
- package/lib/parse-navigation-from-blocklet.js +4 -14
- package/lib/payment/v1.js +2 -5
- package/lib/payment/v2.js +3 -3
- package/lib/util-meta.js +2 -2
- package/lib/util.js +2 -2
- package/package.json +6 -6
package/lib/nft-templates.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getBlockletPurchaseTemplate = void 0;
|
|
7
|
-
const
|
|
4
|
+
const ufo_1 = require("ufo");
|
|
8
5
|
const getBlockletPurchaseTemplate = (serviceUrl = 'https://registry.arcblock.io') => ({
|
|
9
6
|
type: 'vc',
|
|
10
7
|
value: {
|
|
@@ -30,11 +27,11 @@ const getBlockletPurchaseTemplate = (serviceUrl = 'https://registry.arcblock.io'
|
|
|
30
27
|
},
|
|
31
28
|
display: {
|
|
32
29
|
type: 'url',
|
|
33
|
-
content: (0,
|
|
30
|
+
content: (0, ufo_1.joinURL)(serviceUrl, '/api/nft/display'), // accept asset-did in query param
|
|
34
31
|
},
|
|
35
32
|
},
|
|
36
33
|
credentialStatus: {
|
|
37
|
-
id: (0,
|
|
34
|
+
id: (0, ufo_1.joinURL)(serviceUrl, '/api/nft/status'),
|
|
38
35
|
type: 'NFTStatusList2021',
|
|
39
36
|
scope: 'public',
|
|
40
37
|
},
|
|
@@ -10,7 +10,7 @@ const pick_1 = __importDefault(require("lodash/pick"));
|
|
|
10
10
|
const isNil_1 = __importDefault(require("lodash/isNil"));
|
|
11
11
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
12
12
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
13
|
-
const
|
|
13
|
+
const ufo_1 = require("ufo");
|
|
14
14
|
const path_1 = __importDefault(require("path"));
|
|
15
15
|
const is_absolute_url_1 = __importDefault(require("is-absolute-url"));
|
|
16
16
|
const lodash_1 = require("lodash");
|
|
@@ -214,7 +214,7 @@ function parseBlockletNavigationList(blocklet = {}) {
|
|
|
214
214
|
const childBase = child.mountPoint;
|
|
215
215
|
const mergeName = [parentName, currentName, childName].filter(Boolean).join('.');
|
|
216
216
|
const childNavigation = child.meta.navigation || [];
|
|
217
|
-
const mergeBase = (0,
|
|
217
|
+
const mergeBase = (0, ufo_1.joinURL)(parentBase, currentBase, childBase);
|
|
218
218
|
if (child.meta?.capabilities?.navigation !== false) {
|
|
219
219
|
components.push({
|
|
220
220
|
did: child.meta.did,
|
|
@@ -498,14 +498,8 @@ function parseNavigation(blocklet = {}, options = {}) {
|
|
|
498
498
|
// 将 footer-social, footer-bottom, sessionManager, userCenter 的二级菜单提升为一级菜单
|
|
499
499
|
const levelUpNavigation = splitNavigation.reduce((all, cur) => {
|
|
500
500
|
const shouldLevelUp = ['bottom', 'social', 'sessionManager', 'userCenter'].includes(cur.section);
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
// 同时兼容非容器模式(root-blocklet 不会出现在 components 中)
|
|
504
|
-
const rootBlocklet = components.find((item) => item.link === '/');
|
|
505
|
-
if (rootBlocklet && cur.id === rootBlocklet.did) {
|
|
506
|
-
isRoot = true;
|
|
507
|
-
}
|
|
508
|
-
if (shouldLevelUp || isRoot) {
|
|
501
|
+
// 调整设计,不再将 root-blocklet 提升为一级菜单, 但是保留 footer-social, footer-bottom, sessionManager, userCenter 提升为一级菜单
|
|
502
|
+
if (shouldLevelUp) {
|
|
509
503
|
if (cur.items && cur.items.length > 0) {
|
|
510
504
|
all.push(...cur.items.map((x) => {
|
|
511
505
|
const { section } = cur;
|
|
@@ -515,10 +509,6 @@ function parseNavigation(blocklet = {}, options = {}) {
|
|
|
515
509
|
}));
|
|
516
510
|
return all;
|
|
517
511
|
}
|
|
518
|
-
// root blocklet 不应该出现在菜单中
|
|
519
|
-
if (isRoot) {
|
|
520
|
-
return all;
|
|
521
|
-
}
|
|
522
512
|
}
|
|
523
513
|
all.push(cur);
|
|
524
514
|
return all;
|
package/lib/payment/v1.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createNftFactoryItx = exports.createShareContract = void 0;
|
|
7
|
-
const
|
|
4
|
+
const ufo_1 = require("ufo");
|
|
8
5
|
const util_1 = require("@ocap/util");
|
|
9
6
|
const asset_1 = require("@ocap/asset");
|
|
10
7
|
const did_util_1 = require("@arcblock/did-util");
|
|
@@ -60,7 +57,7 @@ const createNftFactoryItx = ({ meta, tokens, shares, issuers, serviceUrl, }) =>
|
|
|
60
57
|
type: 'json',
|
|
61
58
|
value: {
|
|
62
59
|
did: meta.did,
|
|
63
|
-
url: (0,
|
|
60
|
+
url: (0, ufo_1.joinURL)(serviceUrl, `/blocklet/${meta.did}`),
|
|
64
61
|
name: meta.name,
|
|
65
62
|
},
|
|
66
63
|
},
|
package/lib/payment/v2.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.version = exports.checkFreeBlocklet = exports.verifyNftFactory = exports
|
|
|
30
30
|
/* eslint-disable no-await-in-loop */
|
|
31
31
|
const crypto_1 = __importDefault(require("crypto"));
|
|
32
32
|
const debug_1 = __importDefault(require("debug"));
|
|
33
|
-
const
|
|
33
|
+
const ufo_1 = require("ufo");
|
|
34
34
|
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
35
35
|
const get_1 = __importDefault(require("lodash/get"));
|
|
36
36
|
const pick_1 = __importDefault(require("lodash/pick"));
|
|
@@ -60,7 +60,7 @@ const safeMul = (a, b) => Number((0, util_1.fromUnitToToken)((0, util_1.fromToke
|
|
|
60
60
|
.div(defaultDecimalsBN)));
|
|
61
61
|
const md5 = (str) => crypto_1.default.createHash('md5').update(str).digest('hex');
|
|
62
62
|
const getStoreInfo = async (url) => {
|
|
63
|
-
const storeMetaUrl = (0,
|
|
63
|
+
const storeMetaUrl = (0, ufo_1.joinURL)(new URL(url).origin, BLOCKLET_STORE_META_PATH);
|
|
64
64
|
const { data: info } = await axios_1.default.get(storeMetaUrl, { timeout: 8000 });
|
|
65
65
|
return info;
|
|
66
66
|
};
|
|
@@ -328,7 +328,7 @@ const innerCreateNftFactoryItx = ({ meta, issuers, serviceUrl, storeSignatures,
|
|
|
328
328
|
type: 'json',
|
|
329
329
|
value: {
|
|
330
330
|
did: meta.did,
|
|
331
|
-
url: (0,
|
|
331
|
+
url: (0, ufo_1.joinURL)(serviceUrl, `/blocklet/${meta.did}`),
|
|
332
332
|
name: meta.name,
|
|
333
333
|
version: meta.version,
|
|
334
334
|
payment: {
|
package/lib/util-meta.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getSourceUrlsFromConfig = exports.getBlockletMetaFromUrls = exports.getB
|
|
|
7
7
|
const url_1 = require("url");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const promise_any_1 = __importDefault(require("promise.any"));
|
|
10
|
-
const
|
|
10
|
+
const ufo_1 = require("ufo");
|
|
11
11
|
const constant_1 = __importDefault(require("@abtnode/constant"));
|
|
12
12
|
const axios_1 = __importDefault(require("./axios"));
|
|
13
13
|
const did_1 = __importDefault(require("./did"));
|
|
@@ -136,7 +136,7 @@ const getSourceUrlsFromConfig = (config) => {
|
|
|
136
136
|
// FIXME: @linchen the format or version is semverRange, blocklet store should support it
|
|
137
137
|
return [store]
|
|
138
138
|
.flat()
|
|
139
|
-
.map((x) => (0,
|
|
139
|
+
.map((x) => (0, ufo_1.joinURL)(x, BLOCKLET_STORE_API_BLOCKLET_PREFIX, (0, did_1.default)(name), !version || version === 'latest' ? '' : version, 'blocklet.json'));
|
|
140
140
|
}
|
|
141
141
|
if (config.resolved) {
|
|
142
142
|
return [config.resolved];
|
package/lib/util.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.hasResourceType = exports.hasStartEngine = void 0;
|
|
|
8
8
|
/* eslint-disable no-await-in-loop */
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
11
|
-
const
|
|
11
|
+
const ufo_1 = require("ufo");
|
|
12
12
|
const p_limit_1 = __importDefault(require("p-limit"));
|
|
13
13
|
const constant_1 = __importDefault(require("@abtnode/constant"));
|
|
14
14
|
const constant_2 = require("@blocklet/constant");
|
|
@@ -591,7 +591,7 @@ const getConnectAppUrl = ({ request, baseUrl }) => {
|
|
|
591
591
|
// Child blocklets should set appInfo.link to exactly the same path as the root blocklet
|
|
592
592
|
let appUrl = baseUrl;
|
|
593
593
|
if (blockletDid !== blockletRealDid && pathPrefix !== groupPathPrefix) {
|
|
594
|
-
appUrl = (0,
|
|
594
|
+
appUrl = (0, ufo_1.joinURL)(appUrl, '/').replace(pathPrefix, groupPathPrefix);
|
|
595
595
|
}
|
|
596
596
|
return appUrl;
|
|
597
597
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.28
|
|
6
|
+
"version": "1.16.28",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"typings": "./lib/index.d.ts",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@abtnode/constant": "1.16.28
|
|
28
|
+
"@abtnode/constant": "1.16.28",
|
|
29
29
|
"@arcblock/did": "1.18.123",
|
|
30
30
|
"@arcblock/did-ext": "1.18.123",
|
|
31
31
|
"@arcblock/did-util": "1.18.123",
|
|
32
32
|
"@arcblock/jwt": "1.18.123",
|
|
33
|
-
"@blocklet/constant": "1.16.28
|
|
33
|
+
"@blocklet/constant": "1.16.28",
|
|
34
34
|
"@ocap/asset": "1.18.123",
|
|
35
35
|
"@ocap/mcrypto": "1.18.123",
|
|
36
36
|
"@ocap/types": "1.18.123",
|
|
37
37
|
"@ocap/util": "1.18.123",
|
|
38
38
|
"@ocap/wallet": "1.18.123",
|
|
39
39
|
"ajv": "^8.11.0",
|
|
40
|
-
"axios": "^
|
|
40
|
+
"axios": "^1.7.2",
|
|
41
41
|
"cjk-length": "^1.0.0",
|
|
42
42
|
"debug": "^4.3.4",
|
|
43
43
|
"fs-extra": "^11.2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"p-limit": "^3.1.0",
|
|
55
55
|
"promise.any": "^2.0.4",
|
|
56
56
|
"slugify": "^1.6.5",
|
|
57
|
-
"
|
|
57
|
+
"ufo": "^1.5.3",
|
|
58
58
|
"utility-types": "^3.10.0",
|
|
59
59
|
"validate-npm-package-name": "^3.0.0"
|
|
60
60
|
},
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"ts-node": "^10.9.1",
|
|
80
80
|
"typescript": "^5.0.4"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "54db076a7e520bbc260f8cbf0af31dd50b86aef1"
|
|
83
83
|
}
|