@blocklet/meta 1.8.65-beta-f7af64a4 → 1.8.65-beta-bfcc12ce
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/schema.d.ts +2 -1
- package/lib/schema.js +20 -4
- package/lib/types/schema.d.ts +2 -0
- package/package.json +16 -16
package/lib/schema.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const environmentSchema: JOI.ObjectSchema<any>;
|
|
|
9
9
|
declare const scriptsSchema: JOI.ObjectSchema<any>;
|
|
10
10
|
declare const serviceSchema: JOI.ObjectSchema<any>;
|
|
11
11
|
declare const endpointSchema: JOI.ObjectSchema<any>;
|
|
12
|
+
declare const cacheableSchema: JOI.StringSchema<string>;
|
|
12
13
|
declare const interfaceSchema: JOI.ObjectSchema<any>;
|
|
13
14
|
declare const engineSchema: JOI.ObjectSchema<any>;
|
|
14
15
|
declare const personSchema: JOI.ObjectSchema<any>;
|
|
@@ -27,7 +28,7 @@ declare const createBlockletSchema: (baseDir: string, { ensureMain, ensureFiles,
|
|
|
27
28
|
ensureDist?: boolean;
|
|
28
29
|
ensureComponentStore?: boolean;
|
|
29
30
|
}) => JOI.ObjectSchema;
|
|
30
|
-
export { blockletMetaSchema, blockletNameSchema, componentSchema, createBlockletSchema, descriptionSchema, distSchema, endpointSchema, engineSchema, environmentSchema, environmentNameSchema, interfaceSchema, logoSchema, mountPointSchema, navigationItemSchema, navigationSchema, personSchema, scriptsSchema, serviceSchema, signatureSchema, themeSchema, titleSchema, statsSchema, authConfigSchema, };
|
|
31
|
+
export { blockletMetaSchema, blockletNameSchema, componentSchema, createBlockletSchema, descriptionSchema, distSchema, endpointSchema, engineSchema, environmentSchema, environmentNameSchema, interfaceSchema, logoSchema, mountPointSchema, navigationItemSchema, navigationSchema, personSchema, scriptsSchema, serviceSchema, signatureSchema, themeSchema, titleSchema, statsSchema, cacheableSchema, authConfigSchema, };
|
|
31
32
|
declare const _default: {
|
|
32
33
|
blockletNameSchema: JOI.StringSchema<string>;
|
|
33
34
|
componentSchema: JOI.ObjectSchema<any>;
|
package/lib/schema.js
CHANGED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.authConfigSchema = exports.statsSchema = exports.titleSchema = exports.themeSchema = exports.signatureSchema = exports.serviceSchema = exports.scriptsSchema = exports.personSchema = exports.navigationSchema = exports.navigationItemSchema = exports.mountPointSchema = exports.logoSchema = exports.interfaceSchema = exports.environmentNameSchema = exports.environmentSchema = exports.engineSchema = exports.endpointSchema = exports.distSchema = exports.descriptionSchema = exports.createBlockletSchema = exports.componentSchema = exports.blockletNameSchema = exports.blockletMetaSchema = void 0;
|
|
17
|
+
exports.authConfigSchema = exports.cacheableSchema = exports.statsSchema = exports.titleSchema = exports.themeSchema = exports.signatureSchema = exports.serviceSchema = exports.scriptsSchema = exports.personSchema = exports.navigationSchema = exports.navigationItemSchema = exports.mountPointSchema = exports.logoSchema = exports.interfaceSchema = exports.environmentNameSchema = exports.environmentSchema = exports.engineSchema = exports.endpointSchema = exports.distSchema = exports.descriptionSchema = exports.createBlockletSchema = exports.componentSchema = exports.blockletNameSchema = exports.blockletMetaSchema = void 0;
|
|
18
18
|
const fs_1 = __importDefault(require("fs"));
|
|
19
19
|
const joi_1 = __importDefault(require("joi"));
|
|
20
20
|
// eslint-disable-next-line import/no-named-default
|
|
@@ -203,6 +203,21 @@ const endpointSchema = Joi.object({
|
|
|
203
203
|
unknownType: 'any',
|
|
204
204
|
});
|
|
205
205
|
exports.endpointSchema = endpointSchema;
|
|
206
|
+
const cacheableSchema = Joi.string()
|
|
207
|
+
.trim()
|
|
208
|
+
.custom((value, helpers) => {
|
|
209
|
+
const parts = value.split('/').filter(Boolean);
|
|
210
|
+
if (parts.length === 0) {
|
|
211
|
+
// @ts-ignore
|
|
212
|
+
return helpers.message('cacheable path must be a valid pathname that is not /');
|
|
213
|
+
}
|
|
214
|
+
return `/${parts.join('/')}`;
|
|
215
|
+
})
|
|
216
|
+
.meta({
|
|
217
|
+
className: 'TPathPrefix',
|
|
218
|
+
unknownType: 'any',
|
|
219
|
+
});
|
|
220
|
+
exports.cacheableSchema = cacheableSchema;
|
|
206
221
|
const interfaceSchema = Joi.object({
|
|
207
222
|
type: Joi.string()
|
|
208
223
|
.lowercase()
|
|
@@ -225,6 +240,7 @@ const interfaceSchema = Joi.object({
|
|
|
225
240
|
external: Joi.number().port().required(),
|
|
226
241
|
}))
|
|
227
242
|
.default(BLOCKLET_DEFAULT_PORT_NAME),
|
|
243
|
+
cacheable: Joi.array().items(cacheableSchema).unique(),
|
|
228
244
|
services: Joi.array().items(serviceSchema).unique('name'),
|
|
229
245
|
endpoints: Joi.array().items(endpointSchema).unique('type'),
|
|
230
246
|
}).meta({
|
|
@@ -474,15 +490,15 @@ const blockletMetaProps = {
|
|
|
474
490
|
// 3. 区间边界
|
|
475
491
|
.custom((value, helper) => {
|
|
476
492
|
if (value.length !== 2) {
|
|
477
|
-
// @ts-
|
|
493
|
+
// @ts-ignore
|
|
478
494
|
return helper.message('length of range should be 2');
|
|
479
495
|
}
|
|
480
496
|
if (value[0] < 0) {
|
|
481
|
-
// @ts-
|
|
497
|
+
// @ts-ignore
|
|
482
498
|
return helper.message('the first value should not less than 0 in range');
|
|
483
499
|
}
|
|
484
500
|
if (value[1] <= value[0]) {
|
|
485
|
-
// @ts-
|
|
501
|
+
// @ts-ignore
|
|
486
502
|
return helper.message('the second value should greater than the first value in range');
|
|
487
503
|
}
|
|
488
504
|
return value;
|
package/lib/types/schema.d.ts
CHANGED
|
@@ -180,6 +180,7 @@ export interface TEnvironment {
|
|
|
180
180
|
}
|
|
181
181
|
export type TEnvironmentName = string;
|
|
182
182
|
export interface TInterface {
|
|
183
|
+
cacheable?: TPathPrefix[];
|
|
183
184
|
endpoints?: TEndpoint[];
|
|
184
185
|
name: string;
|
|
185
186
|
path?: string;
|
|
@@ -235,6 +236,7 @@ export interface TNavigationItem {
|
|
|
235
236
|
};
|
|
236
237
|
visible?: boolean;
|
|
237
238
|
}
|
|
239
|
+
export type TPathPrefix = string;
|
|
238
240
|
export interface TPerson {
|
|
239
241
|
email?: string;
|
|
240
242
|
name: string;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.65-beta-
|
|
6
|
+
"version": "1.8.65-beta-bfcc12ce",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"typings": "./lib/index.d.ts",
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@abtnode/client": "1.8.65-beta-
|
|
28
|
-
"@abtnode/constant": "1.8.65-beta-
|
|
29
|
-
"@abtnode/util": "1.8.65-beta-
|
|
30
|
-
"@arcblock/did": "1.18.
|
|
31
|
-
"@arcblock/did-ext": "1.18.
|
|
32
|
-
"@arcblock/did-util": "1.18.
|
|
33
|
-
"@arcblock/jwt": "1.18.
|
|
34
|
-
"@blocklet/constant": "1.8.65-beta-
|
|
35
|
-
"@ocap/asset": "1.18.
|
|
36
|
-
"@ocap/mcrypto": "1.18.
|
|
37
|
-
"@ocap/types": "1.18.
|
|
38
|
-
"@ocap/util": "1.18.
|
|
39
|
-
"@ocap/wallet": "1.18.
|
|
27
|
+
"@abtnode/client": "1.8.65-beta-bfcc12ce",
|
|
28
|
+
"@abtnode/constant": "1.8.65-beta-bfcc12ce",
|
|
29
|
+
"@abtnode/util": "1.8.65-beta-bfcc12ce",
|
|
30
|
+
"@arcblock/did": "1.18.42",
|
|
31
|
+
"@arcblock/did-ext": "1.18.42",
|
|
32
|
+
"@arcblock/did-util": "1.18.42",
|
|
33
|
+
"@arcblock/jwt": "1.18.42",
|
|
34
|
+
"@blocklet/constant": "1.8.65-beta-bfcc12ce",
|
|
35
|
+
"@ocap/asset": "1.18.42",
|
|
36
|
+
"@ocap/mcrypto": "1.18.42",
|
|
37
|
+
"@ocap/types": "1.18.42",
|
|
38
|
+
"@ocap/util": "1.18.42",
|
|
39
|
+
"@ocap/wallet": "1.18.42",
|
|
40
40
|
"ajv": "^8.11.0",
|
|
41
41
|
"axios": "^0.27.2",
|
|
42
42
|
"cjk-length": "^1.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"validate-npm-package-name": "^3.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@abtnode/client": "^1.8.
|
|
62
|
+
"@abtnode/client": "^1.8.64",
|
|
63
63
|
"@arcblock/eslint-config-ts": "^0.2.3",
|
|
64
64
|
"@types/express": "^4.17.14",
|
|
65
65
|
"@types/jest": "^29.2.2",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"ts-node": "^10.9.1",
|
|
81
81
|
"typescript": "^4.8.4"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "f6a56512275a55feecf2f3953542ea98777a08f2"
|
|
84
84
|
}
|