@blocklet/meta 1.6.18 → 1.6.22
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/constants.js +1 -1
- package/lib/schema.js +17 -5
- package/lib/util.js +5 -0
- package/package.json +11 -11
package/lib/constants.js
CHANGED
|
@@ -173,7 +173,7 @@ module.exports = Object.freeze({
|
|
|
173
173
|
|
|
174
174
|
BLOCKLET_DEFAULT_VERSION: '1.0.0',
|
|
175
175
|
|
|
176
|
-
BLOCKLET_LATEST_SPEC_VERSION: '1.2.
|
|
176
|
+
BLOCKLET_LATEST_SPEC_VERSION: '1.2.3',
|
|
177
177
|
BLOCKLET_LATEST_REQUIREMENT_SERVER: '>=1.6.2',
|
|
178
178
|
BLOCKLET_LATEST_REQUIREMENT_ABTNODE: '>=1.5.15', // Deprecated
|
|
179
179
|
|
package/lib/schema.js
CHANGED
|
@@ -140,7 +140,7 @@ const statsSchema = Joi.object({
|
|
|
140
140
|
const childrenSchema = Joi.object({
|
|
141
141
|
name: Joi.string().min(1).required(),
|
|
142
142
|
resolved: Joi.alternatives().try(Joi.string().uri(), Joi.string()).required(),
|
|
143
|
-
mountPoints: Joi.array()
|
|
143
|
+
mountPoints: Joi.array() // deprecated
|
|
144
144
|
.items(
|
|
145
145
|
Joi.object({
|
|
146
146
|
root: Joi.object({
|
|
@@ -155,6 +155,14 @@ const childrenSchema = Joi.object({
|
|
|
155
155
|
)
|
|
156
156
|
.optional()
|
|
157
157
|
.default([]),
|
|
158
|
+
mountPoint: Joi.string().trim().min(1), // added in 1.2.3
|
|
159
|
+
services: Joi.array().items(serviceSchema).unique('name'), // added in 1.2.3
|
|
160
|
+
}).custom((value) => {
|
|
161
|
+
if (!value.mountPoint && (!value.mountPoints || !value.mountPoints.length)) {
|
|
162
|
+
throw new Error('mountPoint is required');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return value;
|
|
158
166
|
});
|
|
159
167
|
|
|
160
168
|
const signatureSchema = Joi.object({
|
|
@@ -259,9 +267,7 @@ const createBlockletSchema = (
|
|
|
259
267
|
}
|
|
260
268
|
return value;
|
|
261
269
|
}, 'invalid blocklet share'),
|
|
262
|
-
})
|
|
263
|
-
.default({ price: [], share: [] })
|
|
264
|
-
.optional(),
|
|
270
|
+
}).default({ price: [], share: [] }),
|
|
265
271
|
|
|
266
272
|
keywords: Joi.alternatives()
|
|
267
273
|
.try(Joi.string().trim().min(1), Joi.array().items(Joi.string().min(1)))
|
|
@@ -334,7 +340,13 @@ const createBlockletSchema = (
|
|
|
334
340
|
// capabilities
|
|
335
341
|
capabilities: Joi.object({
|
|
336
342
|
clusterMode: Joi.boolean().default(false), // Can blocklet be started in cluster mode
|
|
337
|
-
|
|
343
|
+
|
|
344
|
+
// added in 1.2.2
|
|
345
|
+
component: Joi.boolean().default(true), // Can blocklet become a component and be composed by other blocklets
|
|
346
|
+
}).default({
|
|
347
|
+
clusterMode: false,
|
|
348
|
+
component: true,
|
|
349
|
+
}),
|
|
338
350
|
|
|
339
351
|
// Other contents to be included in the bundle
|
|
340
352
|
files: Joi.array()
|
package/lib/util.js
CHANGED
|
@@ -101,6 +101,10 @@ const isFreeBlocklet = (meta) => {
|
|
|
101
101
|
return priceList.every((x) => x === 0);
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
+
const isComponentBlocklet = (meta) => {
|
|
105
|
+
return get(meta, 'capabilities.component') !== false;
|
|
106
|
+
};
|
|
107
|
+
|
|
104
108
|
const wipeSensitiveData = (blocklet) => {
|
|
105
109
|
if (!blocklet) {
|
|
106
110
|
return blocklet;
|
|
@@ -174,6 +178,7 @@ const getDisplayName = (blocklet, onlyUseMeta = false) => {
|
|
|
174
178
|
|
|
175
179
|
module.exports = {
|
|
176
180
|
isFreeBlocklet,
|
|
181
|
+
isComponentBlocklet,
|
|
177
182
|
forEachBlockletSync,
|
|
178
183
|
isDeletableBlocklet,
|
|
179
184
|
forEachBlocklet,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.6.
|
|
6
|
+
"version": "1.6.22",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/did": "^1.14.
|
|
22
|
-
"@arcblock/did-ext": "^1.14.
|
|
23
|
-
"@arcblock/did-util": "^1.14.
|
|
24
|
-
"@arcblock/nft": "^1.14.
|
|
25
|
-
"@ocap/asset": "^1.14.
|
|
26
|
-
"@ocap/mcrypto": "^1.14.
|
|
27
|
-
"@ocap/util": "^1.14.
|
|
28
|
-
"@ocap/wallet": "^1.14.
|
|
21
|
+
"@arcblock/did": "^1.14.16",
|
|
22
|
+
"@arcblock/did-ext": "^1.14.16",
|
|
23
|
+
"@arcblock/did-util": "^1.14.16",
|
|
24
|
+
"@arcblock/nft": "^1.14.16",
|
|
25
|
+
"@ocap/asset": "^1.14.16",
|
|
26
|
+
"@ocap/mcrypto": "^1.14.16",
|
|
27
|
+
"@ocap/util": "^1.14.16",
|
|
28
|
+
"@ocap/wallet": "^1.14.16",
|
|
29
29
|
"ajv": "^7.0.3",
|
|
30
30
|
"cjk-length": "^1.0.0",
|
|
31
31
|
"debug": "^4.3.3",
|
|
32
32
|
"fs-extra": "^10.0.0",
|
|
33
33
|
"hosted-git-info": "3.0.8",
|
|
34
34
|
"is-glob": "^4.0.3",
|
|
35
|
-
"joi": "^17.
|
|
35
|
+
"joi": "^17.6.0",
|
|
36
36
|
"joi-extension-semver": "^5.0.0",
|
|
37
37
|
"js-yaml": "^3.14.0",
|
|
38
38
|
"json-stable-stringify": "^1.0.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"jest": "^27.4.5"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "18ac52a439dbd04e4ace98d796b6de517503fb14"
|
|
47
47
|
}
|