@shiqianjiang/ceru-plugin-issuer 0.3.0 → 0.3.2
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/dist/index.js +17 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ export const MANIFEST_SCHEMA = object({
|
|
|
146
146
|
maxItems: 64,
|
|
147
147
|
items: object({
|
|
148
148
|
id,
|
|
149
|
-
kind: { enum: ['schema', 'web'] },
|
|
149
|
+
kind: { enum: ['schema', 'web', 'native'] },
|
|
150
150
|
entry: id,
|
|
151
151
|
title: { type: 'string', minLength: 1, maxLength: 100 },
|
|
152
152
|
presentation: object({
|
|
@@ -203,6 +203,11 @@ export const MANIFEST_SCHEMA = object({
|
|
|
203
203
|
}),
|
|
204
204
|
}, ['id', 'slot', 'title', 'commandId']),
|
|
205
205
|
},
|
|
206
|
+
accountItems: {
|
|
207
|
+
type: 'array',
|
|
208
|
+
maxItems: 16,
|
|
209
|
+
items: object({ id, title: string, view: id, action: id }, ['id', 'title', 'view', 'action']),
|
|
210
|
+
},
|
|
206
211
|
homeSections: {
|
|
207
212
|
type: 'array',
|
|
208
213
|
maxItems: 32,
|
|
@@ -391,9 +396,18 @@ export function validateManifest(value) {
|
|
|
391
396
|
const views = new Set(manifest.modules.surfaces?.map((p) => p.id));
|
|
392
397
|
const actions = new Set(manifest.contributes?.commands?.map((command) => command.action));
|
|
393
398
|
for (const surface of manifest.modules.surfaces ?? []) {
|
|
399
|
+
if (surface.kind === 'native') {
|
|
400
|
+
ensure(manifest.modules.logic, 'Native surfaces require a logic module');
|
|
401
|
+
ensure(actions.has(surface.entry), 'Missing native render action: ' + surface.entry);
|
|
402
|
+
}
|
|
394
403
|
for (const action of Object.values(surface.lifecycle ?? {}))
|
|
395
404
|
ensure(actions.has(action), 'Unknown surface lifecycle action: ' + action);
|
|
396
405
|
}
|
|
406
|
+
for (const account of manifest.contributes?.accountItems ?? []) {
|
|
407
|
+
ensure(manifest.modules.logic, 'Account items require a logic module');
|
|
408
|
+
ensure(views.has(account.view), 'Unknown account view: ' + account.view);
|
|
409
|
+
ensure(actions.has(account.action), 'Unknown account summary action: ' + account.action);
|
|
410
|
+
}
|
|
397
411
|
const share = manifest.modules.share;
|
|
398
412
|
if (share?.guestAdapterId)
|
|
399
413
|
ensure(manifest.contributes?.guestAdapters?.some((adapter) => adapter.id === share.guestAdapterId), 'Unknown share guest adapter: ' + share.guestAdapterId);
|
|
@@ -848,6 +862,8 @@ function inspectBody(body, manifest) {
|
|
|
848
862
|
for (const surface of manifest.modules.surfaces ?? []) {
|
|
849
863
|
if (surface.kind === 'web')
|
|
850
864
|
add(surface.entry);
|
|
865
|
+
else if (surface.kind === 'native')
|
|
866
|
+
ensure(manifest.contributes?.commands?.some(command => command.action === surface.entry), 'Missing native render action: ' + surface.entry);
|
|
851
867
|
else
|
|
852
868
|
ensure(resources[surface.entry]?.type === 'json', 'Missing schema resource: ' + surface.entry);
|
|
853
869
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shiqianjiang/ceru-plugin-issuer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Static verification, Ed25519 signing and cached personalized issuance of Ceru single-JS plugins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"node": ">=22.12.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@shiqianjiang/ceru-plugin-sdk": "0.3.
|
|
26
|
+
"@shiqianjiang/ceru-plugin-sdk": "0.3.2",
|
|
27
27
|
"acorn": "^8.18.0",
|
|
28
28
|
"ajv": "^8.20.0"
|
|
29
29
|
},
|