@blocklet/meta 1.7.4 → 1.7.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.js CHANGED
@@ -3,7 +3,7 @@ const { toHex } = require('@ocap/util');
3
3
  const { fromPublicKey } = require('@arcblock/did');
4
4
 
5
5
  const toBlockletDid = (name) => {
6
- const pk = toHex(name);
6
+ const pk = toHex(Buffer.from(typeof name === 'string' ? name.trim() : name));
7
7
  return fromPublicKey(pk, { role: types.RoleType.ROLE_ANY });
8
8
  };
9
9
 
package/lib/schema.js CHANGED
@@ -37,6 +37,12 @@ const environmentSchema = Joi.object({
37
37
  secure: Joi.boolean().default(false),
38
38
  validation: Joi.string().optional(),
39
39
  shared: Joi.boolean().default((parent) => !parent.secure),
40
+ }).custom((x, helper) => {
41
+ if (x.secure && x.default) {
42
+ return helper.message(`Cannot declare default value for secure env ${x.name}`);
43
+ }
44
+
45
+ return x;
40
46
  });
41
47
 
42
48
  const scriptsSchema = Joi.object({
package/lib/util.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-await-in-loop */
2
2
  const get = require('lodash/get');
3
3
 
4
- const { NODE_SERVICES } = require('@abtnode/constant');
4
+ const { NODE_SERVICES, SLOT_FOR_IP_DNS_SITE } = require('@abtnode/constant');
5
5
 
6
6
  const { BlockletGroup, fromBlockletStatus, fromBlockletSource, BLOCKLET_INTERFACE_TYPE_WEB } = require('./constants');
7
7
 
@@ -213,6 +213,8 @@ const isInvitedUserOnlyInMeta = (blocklet) => {
213
213
  return service && service.config && ['yes', 'not-first'].includes(service.config.invitedUserOnly);
214
214
  };
215
215
 
216
+ const replaceSlotToIp = (url, ip) => (url || '').replace(SLOT_FOR_IP_DNS_SITE, (ip || '').replace(/\./g, '-'));
217
+
216
218
  module.exports = {
217
219
  isFreeBlocklet,
218
220
  isComponentBlocklet,
@@ -227,4 +229,5 @@ module.exports = {
227
229
  findWebInterface,
228
230
  findServiceFromMeta,
229
231
  isInvitedUserOnlyInMeta,
232
+ replaceSlotToIp,
230
233
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.7.4",
6
+ "version": "1.7.5",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,19 +18,19 @@
18
18
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.7.4",
22
- "@arcblock/did": "^1.15.3",
23
- "@arcblock/did-ext": "^1.15.3",
24
- "@arcblock/did-util": "^1.15.3",
25
- "@arcblock/nft": "^1.15.3",
26
- "@ocap/asset": "^1.15.3",
27
- "@ocap/mcrypto": "^1.15.3",
28
- "@ocap/util": "^1.15.3",
29
- "@ocap/wallet": "^1.15.3",
21
+ "@abtnode/constant": "1.7.5",
22
+ "@arcblock/did": "^1.15.7",
23
+ "@arcblock/did-ext": "^1.15.7",
24
+ "@arcblock/did-util": "^1.15.7",
25
+ "@arcblock/nft": "^1.15.7",
26
+ "@ocap/asset": "^1.15.7",
27
+ "@ocap/mcrypto": "^1.15.7",
28
+ "@ocap/util": "^1.15.7",
29
+ "@ocap/wallet": "^1.15.7",
30
30
  "ajv": "^7.0.3",
31
31
  "cjk-length": "^1.0.0",
32
32
  "debug": "^4.3.3",
33
- "fs-extra": "^10.0.0",
33
+ "fs-extra": "^10.0.1",
34
34
  "hosted-git-info": "3.0.8",
35
35
  "is-glob": "^4.0.3",
36
36
  "joi": "^17.6.0",
@@ -44,5 +44,5 @@
44
44
  "devDependencies": {
45
45
  "jest": "^27.4.5"
46
46
  },
47
- "gitHead": "02b25a877e5b56b389ab318a851bea01212e10df"
47
+ "gitHead": "b17d83773e5a4c06bae390fc70398d49d6dd86b3"
48
48
  }