feat: add notification scheduling permission

This commit is contained in:
mirivlad 2026-07-14 02:46:03 +08:00
parent 1378fda7f2
commit 43ac963923
6 changed files with 10 additions and 5 deletions

2
dist/types.d.ts vendored
View File

@ -50,7 +50,7 @@ export interface CapabilityEntry {
pluginId: string; pluginId: string;
status: 'stable' | 'draft' | 'deprecated'; status: 'stable' | 'draft' | 'deprecated';
} }
export type Permission = 'vault.read' | 'vault.write' | 'vault.watch' | 'files.read' | 'files.write' | 'files.delete' | 'files.openExternal' | 'workbench.open' | 'storage.namespace' | 'storage.migrations' | 'events.publish' | 'events.subscribe' | 'ui.register' | 'commands.register' | 'network.local' | 'network.remote' | 'process.spawn' | 'secrets.read' | 'secrets.write' | 'sync.participate' | 'browser.receiver.manage'; export type Permission = 'vault.read' | 'vault.write' | 'vault.watch' | 'files.read' | 'files.write' | 'files.delete' | 'files.openExternal' | 'workbench.open' | 'storage.namespace' | 'storage.migrations' | 'events.publish' | 'events.subscribe' | 'ui.register' | 'commands.register' | 'network.local' | 'network.remote' | 'process.spawn' | 'secrets.read' | 'secrets.write' | 'sync.participate' | 'browser.receiver.manage' | 'notifications.schedule';
export interface PermissionEntry { export interface PermissionEntry {
name: Permission; name: Permission;
description: string; description: string;

2
dist/types.d.ts.map vendored

File diff suppressed because one or more lines are too long

View File

@ -126,7 +126,8 @@
"secrets.read", "secrets.read",
"secrets.write", "secrets.write",
"sync.participate", "sync.participate",
"browser.receiver.manage" "browser.receiver.manage",
"notifications.schedule"
] ]
}, },
"minItems": 1 "minItems": 1

View File

@ -47,6 +47,7 @@
{ "name": "secrets.read", "description": "Read secrets from the secret store", "dangerous": true }, { "name": "secrets.read", "description": "Read secrets from the secret store", "dangerous": true },
{ "name": "secrets.write", "description": "Write secrets to the secret store", "dangerous": true }, { "name": "secrets.write", "description": "Write secrets to the secret store", "dangerous": true },
{ "name": "sync.participate", "description": "Participate in vault sync", "dangerous": true }, { "name": "sync.participate", "description": "Participate in vault sync", "dangerous": true },
{ "name": "browser.receiver.manage", "description": "View and rotate the local browser receiver pairing token", "dangerous": true } { "name": "browser.receiver.manage", "description": "View and rotate the local browser receiver pairing token", "dangerous": true },
{ "name": "notifications.schedule", "description": "Replace the plugin's scheduled native notifications", "dangerous": false }
] ]
} }

View File

@ -135,7 +135,9 @@ describe('VerstakPluginAPI contract', () => {
const permissionEnum = ((manifestSchema as any).properties.permissions.items.enum || []) as string[]; const permissionEnum = ((manifestSchema as any).properties.permissions.items.enum || []) as string[];
expect(permissions).toContainEqual(expect.objectContaining({ name: 'browser.receiver.manage', dangerous: true })); expect(permissions).toContainEqual(expect.objectContaining({ name: 'browser.receiver.manage', dangerous: true }));
expect(permissions).toContainEqual(expect.objectContaining({ name: 'notifications.schedule', dangerous: false }));
expect(permissionEnum).toContain('browser.receiver.manage'); expect(permissionEnum).toContain('browser.receiver.manage');
expect(permissionEnum).toContain('notifications.schedule');
}); });
test('file.changed schema documents watcher refresh payload', () => { test('file.changed schema documents watcher refresh payload', () => {

View File

@ -89,7 +89,8 @@ export type Permission =
| 'secrets.read' | 'secrets.read'
| 'secrets.write' | 'secrets.write'
| 'sync.participate' | 'sync.participate'
| 'browser.receiver.manage'; | 'browser.receiver.manage'
| 'notifications.schedule';
export interface PermissionEntry { export interface PermissionEntry {
name: Permission; name: Permission;