@blocklet/meta
Advanced tools
Comparing version 1.1.1 to 1.1.2
const BLOCKLET_INTERFACE_TYPE_WEB = 'web'; | ||
const BLOCKLET_INTERFACE_TYPE_SERVICE = 'service'; | ||
const BlockletStatus = Object.freeze({ | ||
added: 0, | ||
downloading: 1, | ||
downloaded: 2, // Deprecated | ||
installing: 3, | ||
installed: 4, | ||
starting: 5, | ||
running: 6, | ||
stopping: 7, | ||
stopped: 8, | ||
error: 9, | ||
upgrading: 10, | ||
restarting: 11, // Deprecated | ||
corrupted: 12, | ||
waiting: 13, | ||
}); | ||
const BlockletSource = Object.freeze({ | ||
registry: 0, | ||
local: 1, | ||
upload: 2, | ||
url: 3, | ||
}); | ||
const fromEntry = (entries) => (v) => { | ||
const match = Object.entries(entries).find((x) => x[1] === Number(v)); | ||
return match ? match[0] : 'unknown'; | ||
}; | ||
const toEntry = (entries) => (v) => Object.keys(entries).find((x) => entries[x] === Number(v)); | ||
const fromBlockletStatus = fromEntry(BlockletStatus); | ||
const toBlockletStatus = toEntry(BlockletStatus); | ||
const fromBlockletSource = fromEntry(BlockletSource); | ||
const toBlockletSource = toEntry(BlockletSource); | ||
module.exports = Object.freeze({ | ||
BlockletStatus: Object.freeze({ | ||
added: 0, | ||
downloading: 1, | ||
downloaded: 2, | ||
installing: 3, | ||
installed: 4, | ||
starting: 5, | ||
running: 6, | ||
stopping: 7, | ||
stopped: 8, | ||
error: 9, | ||
upgrading: 10, | ||
restarting: 11, | ||
corrupted: 12, | ||
}), | ||
BlockletStatus, | ||
BlockletSource, | ||
fromBlockletStatus, | ||
toBlockletStatus, | ||
fromBlockletSource, | ||
toBlockletSource, | ||
BlockletSource: Object.freeze({ | ||
registry: 0, | ||
local: 1, | ||
upload: 2, | ||
url: 3, | ||
}), | ||
BlockletGroup: Object.freeze({ | ||
@@ -29,0 +50,0 @@ static: true, |
@@ -162,3 +162,3 @@ /* eslint-disable newline-per-chained-call */ | ||
// hookFiles has been renamed to files | ||
// Other contents to be included in the bundle | ||
files: Joi.array() | ||
@@ -177,3 +177,2 @@ .items( | ||
// TODO: following fields only exist for backward compatibility | ||
hooks: scriptsSchema, | ||
publicUrl: Joi.string().optional().allow(''), | ||
@@ -183,17 +182,2 @@ adminUrl: Joi.string().optional().allow(''), | ||
docUrl: Joi.string().optional().allow(''), | ||
hookFiles: Joi.array() | ||
.items(ensureFiles ? Joi.file().exists({ baseDir }) : Joi.string().trim()) | ||
.optional(), | ||
capabilities: Joi.object({ dynamicPathPrefix: Joi.boolean().default(true) }) | ||
.optional() | ||
.default({ dynamicPathPrefix: true }), | ||
exposeServices: Joi.array() | ||
.items( | ||
Joi.object({ | ||
protocol: Joi.string().valid('udp', 'tcp').required(), | ||
port: Joi.number().port().required(), | ||
upstreamPort: Joi.number().port().required(), | ||
}) | ||
) | ||
.optional(), | ||
@@ -200,0 +184,0 @@ // NOTE: following fields are appended by registry or bundling process |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Library to parse/validate/fix blocklet meta", | ||
@@ -24,7 +24,7 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@arcblock/did": "^1.4.4", | ||
"@arcblock/forge-util": "^1.4.4", | ||
"@arcblock/forge-wallet": "^1.4.4", | ||
"@arcblock/mcrypto": "^1.4.4", | ||
"@wangshijun/hdkey": "^2.0.3", | ||
"@arcblock/did": "^1.4.5", | ||
"@arcblock/forge-util": "^1.4.5", | ||
"@arcblock/forge-wallet": "^1.4.5", | ||
"@arcblock/mcrypto": "^1.4.5", | ||
"@wangshijun/hdkey": "^2.0.4", | ||
"axios": "^0.21.0", | ||
@@ -43,3 +43,3 @@ "debug": "^4.2.0", | ||
}, | ||
"gitHead": "74ba80cf8a4bef09086022934deac0c887462004" | ||
"gitHead": "35ad9101617e44c0589872a915e52acec592b937" | ||
} |
29648
Updated@arcblock/did@^1.4.5
Updated@arcblock/forge-util@^1.4.5
Updated@arcblock/mcrypto@^1.4.5
Updated@wangshijun/hdkey@^2.0.4