@blocklet/meta 1.6.20 → 1.6.23

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 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.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
@@ -25,6 +25,7 @@ const {
25
25
 
26
26
  const WELLKNOWN_PATH_PREFIX = '/.well-known';
27
27
  const MAX_TITLE_LENGTH = 48;
28
+ const MAX_NAME_LENGTH = 32;
28
29
 
29
30
  const Joi = JOI.extend(semver).extend(semverRange).extend(fileExtension).extend(didExtension);
30
31
 
@@ -140,7 +141,7 @@ const statsSchema = Joi.object({
140
141
  const childrenSchema = Joi.object({
141
142
  name: Joi.string().min(1).required(),
142
143
  resolved: Joi.alternatives().try(Joi.string().uri(), Joi.string()).required(),
143
- mountPoints: Joi.array()
144
+ mountPoints: Joi.array() // deprecated
144
145
  .items(
145
146
  Joi.object({
146
147
  root: Joi.object({
@@ -155,6 +156,14 @@ const childrenSchema = Joi.object({
155
156
  )
156
157
  .optional()
157
158
  .default([]),
159
+ mountPoint: Joi.string().trim().min(1), // added in 1.2.3
160
+ services: Joi.array().items(serviceSchema).unique('name'), // added in 1.2.3
161
+ }).custom((value) => {
162
+ if (!value.mountPoint && (!value.mountPoints || !value.mountPoints.length)) {
163
+ throw new Error('mountPoint is required');
164
+ }
165
+
166
+ return value;
158
167
  });
159
168
 
160
169
  const signatureSchema = Joi.object({
@@ -185,6 +194,7 @@ const createBlockletSchema = (
185
194
  validateName(value);
186
195
  return value;
187
196
  })
197
+ .max(MAX_NAME_LENGTH)
188
198
  .required(),
189
199
  description: Joi.string().trim().min(3).max(512).required(),
190
200
  group: Joi.string().valid(...BLOCKLET_GROUPS).required(), // prettier-ignore
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.20",
6
+ "version": "1.6.23",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,14 +18,14 @@
18
18
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@arcblock/did": "^1.14.13",
22
- "@arcblock/did-ext": "^1.14.13",
23
- "@arcblock/did-util": "^1.14.13",
24
- "@arcblock/nft": "^1.14.13",
25
- "@ocap/asset": "^1.14.13",
26
- "@ocap/mcrypto": "^1.14.13",
27
- "@ocap/util": "^1.14.13",
28
- "@ocap/wallet": "^1.14.13",
21
+ "@arcblock/did": "^1.14.19",
22
+ "@arcblock/did-ext": "^1.14.19",
23
+ "@arcblock/did-util": "^1.14.19",
24
+ "@arcblock/nft": "^1.14.19",
25
+ "@ocap/asset": "^1.14.19",
26
+ "@ocap/mcrypto": "^1.14.19",
27
+ "@ocap/util": "^1.14.19",
28
+ "@ocap/wallet": "^1.14.19",
29
29
  "ajv": "^7.0.3",
30
30
  "cjk-length": "^1.0.0",
31
31
  "debug": "^4.3.3",
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "jest": "^27.4.5"
45
45
  },
46
- "gitHead": "e695a9fa4e2cbf7fcef554be3309090c37919d94"
46
+ "gitHead": "6c478fb7e2a30b302981b5339f349c69134e022e"
47
47
  }