@blocklet/meta 1.8.33 → 1.8.34
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/parse-navigation.js +21 -1
- package/lib/schema.js +6 -1
- package/package.json +14 -13
package/lib/parse-navigation.js
CHANGED
|
@@ -150,7 +150,27 @@ const doParseNavigation = (navigation, blocklet, prefix = '/', _level = 1) => {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
item.link = parseLink(childNavigation[0].link || '/', normalizePathPrefix(`${prefix}${child.mountPoint}`));
|
|
153
|
-
|
|
153
|
+
|
|
154
|
+
// doParseNavigation because child nav depth may be > 1
|
|
155
|
+
const list = doParseNavigation(
|
|
156
|
+
childNavigation,
|
|
157
|
+
child,
|
|
158
|
+
normalizePathPrefix(`${prefix}${child.mountPoint}`),
|
|
159
|
+
_level + 1
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
if (list.length > 1) {
|
|
163
|
+
// more than 1 child nav
|
|
164
|
+
delete item.link;
|
|
165
|
+
result.push({
|
|
166
|
+
...item,
|
|
167
|
+
items: list,
|
|
168
|
+
});
|
|
169
|
+
} else {
|
|
170
|
+
// only 1 child nav
|
|
171
|
+
item.link = list[0].link;
|
|
172
|
+
result.push(item);
|
|
173
|
+
}
|
|
154
174
|
} else {
|
|
155
175
|
// child declares multiple menus
|
|
156
176
|
const groupSection = childNavigation[0].section || [];
|
package/lib/schema.js
CHANGED
|
@@ -21,12 +21,13 @@ const {
|
|
|
21
21
|
BLOCKLET_LATEST_REQUIREMENT_SERVER,
|
|
22
22
|
BLOCKLET_INTERFACE_TYPE_WEB,
|
|
23
23
|
BLOCKLET_INTERFACE_TYPE_WELLKNOWN,
|
|
24
|
+
BLOCKLET_APP_STORAGE_ENDPOINTS,
|
|
24
25
|
} = require('./constants');
|
|
25
26
|
|
|
26
27
|
const WELLKNOWN_PATH_PREFIX = '/.well-known';
|
|
27
28
|
const MAX_TITLE_LENGTH = 24;
|
|
28
29
|
const MAX_NAME_LENGTH = 32;
|
|
29
|
-
|
|
30
|
+
/** @type {import('joi') & {[key: string]: Function}} */
|
|
30
31
|
const Joi = JOI.extend(semver).extend(semverRange).extend(fileExtension).extend(didExtension);
|
|
31
32
|
|
|
32
33
|
const titleSchema = Joi.string()
|
|
@@ -462,6 +463,10 @@ const createBlockletSchema = (
|
|
|
462
463
|
|
|
463
464
|
// added in 1.2.2
|
|
464
465
|
component: Joi.boolean().default(true), // Can blocklet become a component and be composed by other blocklets
|
|
466
|
+
|
|
467
|
+
didStorage: Joi.string()
|
|
468
|
+
.valid(...Object.values(BLOCKLET_APP_STORAGE_ENDPOINTS))
|
|
469
|
+
.optional(),
|
|
465
470
|
}).default({
|
|
466
471
|
clusterMode: false,
|
|
467
472
|
component: true,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.34",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.8.
|
|
22
|
-
"@abtnode/util": "1.8.
|
|
23
|
-
"@arcblock/did": "1.18.
|
|
24
|
-
"@arcblock/did-ext": "1.18.
|
|
25
|
-
"@arcblock/did-util": "1.18.
|
|
26
|
-
"@arcblock/jwt": "1.18.
|
|
27
|
-
"@blocklet/constant": "1.8.
|
|
28
|
-
"@ocap/asset": "1.18.
|
|
29
|
-
"@ocap/mcrypto": "1.18.
|
|
30
|
-
"@ocap/util": "1.18.
|
|
31
|
-
"@ocap/wallet": "1.18.
|
|
21
|
+
"@abtnode/constant": "1.8.34",
|
|
22
|
+
"@abtnode/util": "1.8.34",
|
|
23
|
+
"@arcblock/did": "1.18.13",
|
|
24
|
+
"@arcblock/did-ext": "1.18.13",
|
|
25
|
+
"@arcblock/did-util": "1.18.13",
|
|
26
|
+
"@arcblock/jwt": "1.18.13",
|
|
27
|
+
"@blocklet/constant": "1.8.34",
|
|
28
|
+
"@ocap/asset": "1.18.13",
|
|
29
|
+
"@ocap/mcrypto": "1.18.13",
|
|
30
|
+
"@ocap/util": "1.18.13",
|
|
31
|
+
"@ocap/wallet": "1.18.13",
|
|
32
32
|
"ajv": "^8.11.0",
|
|
33
33
|
"axios": "^0.27.2",
|
|
34
34
|
"cjk-length": "^1.0.0",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"validate-npm-package-name": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
+
"@types/joi": "^17.2.3",
|
|
50
51
|
"body-parser": "^1.20.1",
|
|
51
52
|
"compression": "^1.7.4",
|
|
52
53
|
"detect-port": "^1.5.1",
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"express": "^4.18.2",
|
|
55
56
|
"jest": "^27.5.1"
|
|
56
57
|
},
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "c5fbb8e57493db62f212217cfde1980c82f00297"
|
|
58
59
|
}
|