@oktis-works/plugin-sdk 0.5.8 → 0.7.0
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/admin.d.ts +11 -60
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +21 -3
- package/dist/admin.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/permissions.d.ts +46 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +61 -0
- package/dist/permissions.js.map +1 -0
- package/dist/types.d.ts +260 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +4 -3
package/dist/admin.d.ts
CHANGED
|
@@ -1,78 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export interface AdminSubmenuPage {
|
|
9
|
-
parentSlug: string;
|
|
10
|
-
slug: string;
|
|
11
|
-
label: string;
|
|
12
|
-
capability?: string;
|
|
13
|
-
position?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface DashboardWidget {
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
render: 'component';
|
|
19
|
-
componentId: string;
|
|
20
|
-
columnsSpan?: 1 | 2 | 3 | 4;
|
|
21
|
-
}
|
|
22
|
-
export interface MetaBox {
|
|
23
|
-
id: string;
|
|
24
|
-
title: string;
|
|
25
|
-
/** Tipos de conteúdo onde a caixa aparece (ex.: ['post', 'page']). */
|
|
26
|
-
screens: string[];
|
|
27
|
-
context: 'normal' | 'side' | 'advanced';
|
|
28
|
-
priority: 'high' | 'default' | 'low';
|
|
29
|
-
componentId: string;
|
|
30
|
-
}
|
|
31
|
-
export interface AdminNotice {
|
|
32
|
-
id: string;
|
|
33
|
-
level: 'info' | 'success' | 'warning' | 'error';
|
|
34
|
-
message: string;
|
|
35
|
-
dismissible?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface ColumnDefinition {
|
|
38
|
-
key: string;
|
|
39
|
-
label: string;
|
|
40
|
-
position?: 'before_title' | 'after_title' | 'end';
|
|
41
|
-
}
|
|
1
|
+
import type { AdminExtensionsState, AdminMenuPage, AdminSubmenuPage, DashboardWidget, AdminMetaBox, AdminNotice, AdminColumnDefinition, AdminEditorRegistration } from '@oktis-works/types';
|
|
2
|
+
export type { AdminExtensionsState, AdminMenuPage, AdminSubmenuPage, DashboardWidget, DashboardWidgetDeclaration, AdminMetaBox, AdminMetaBoxDeclaration, AdminNotice, AdminColumnDefinition, AdminActionLink, AdminColumnDeclaration, AdminColumnRendererDeclaration, AdminEditorRegistration, PluginManifestAdmin, } from '@oktis-works/types';
|
|
3
|
+
/** Nome histórico do SDK — canônico em types como `AdminMetaBox`. */
|
|
4
|
+
export type MetaBox = AdminMetaBox;
|
|
5
|
+
/** Nome histórico do SDK — canônico em types como `AdminColumnDefinition`. */
|
|
6
|
+
export type ColumnDefinition = AdminColumnDefinition;
|
|
42
7
|
export interface PluginAdminApi {
|
|
43
8
|
addMenuPage(page: AdminMenuPage): void;
|
|
44
9
|
addSubmenuPage(page: AdminSubmenuPage): void;
|
|
45
10
|
addDashboardWidget(widget: DashboardWidget): void;
|
|
46
|
-
addMetaBox(box:
|
|
11
|
+
addMetaBox(box: AdminMetaBox): void;
|
|
47
12
|
addNotice(notice: Omit<AdminNotice, 'id'> & {
|
|
48
13
|
id?: string;
|
|
49
14
|
}): void;
|
|
50
15
|
removeNotice(noticeId: string): void;
|
|
51
|
-
manageColumns(contentType: string, column:
|
|
16
|
+
manageColumns(contentType: string, column: AdminColumnDefinition): void;
|
|
52
17
|
renderColumn(contentType: string, columnKey: string, componentId: string): void;
|
|
53
18
|
addActionLinks(links: Array<{
|
|
54
19
|
label: string;
|
|
55
20
|
url: string;
|
|
56
21
|
}>): void;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* Estado declarativo coletado pelos pontos de extensão e consumido
|
|
60
|
-
* pelo app admin via slots nomeados (FEAT-098 / DECI-027).
|
|
61
|
-
*/
|
|
62
|
-
export interface AdminExtensionsState {
|
|
63
|
-
menuPages: AdminMenuPage[];
|
|
64
|
-
submenuPages: AdminSubmenuPage[];
|
|
65
|
-
dashboardWidgets: DashboardWidget[];
|
|
66
|
-
metaBoxes: MetaBox[];
|
|
67
|
-
notices: AdminNotice[];
|
|
68
|
-
columns: Record<string, ColumnDefinition[]>;
|
|
69
|
-
columnRenderers: Record<string, Record<string, string>>;
|
|
70
|
-
actionLinks: Array<{
|
|
71
|
-
label: string;
|
|
72
|
-
url: string;
|
|
73
|
-
}>;
|
|
22
|
+
/** Registers a content editor for the editing screen (editor slot — see types docs). */
|
|
23
|
+
addEditor(editor: AdminEditorRegistration): void;
|
|
74
24
|
}
|
|
75
25
|
export declare function createPluginAdminApi(pluginId: string, state?: AdminExtensionsState): PluginAdminApi & {
|
|
76
26
|
state: AdminExtensionsState;
|
|
77
27
|
};
|
|
28
|
+
export declare function emptyState(): AdminExtensionsState;
|
|
78
29
|
//# sourceMappingURL=admin.d.ts.map
|
package/dist/admin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,eAAe,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ANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
// @oktis-works/plugin-sdk - Admin UI Extension Points (declarative slots)
|
|
2
|
+
//
|
|
3
|
+
// Os tipos canônicos vivem em `@oktis-works/types` (o barrel é a fonte única
|
|
4
|
+
// do wire format servido por GET /api/v1/plugins/extensions). Aqui
|
|
5
|
+
// re-exportamos os nomes históricos do SDK (API pública estável) e mantemos a
|
|
6
|
+
// fábrica de estado usada pelo runtime (`api.admin`).
|
|
2
7
|
export function createPluginAdminApi(pluginId, state = emptyState()) {
|
|
3
8
|
const api = {
|
|
4
9
|
state,
|
|
5
10
|
addMenuPage(page) {
|
|
6
11
|
if (!page.capability || page.capability.length === 0) {
|
|
7
|
-
throw new Error(`[${pluginId}] addMenuPage
|
|
12
|
+
throw new Error(`[${pluginId}] addMenuPage requires an explicit capability`);
|
|
8
13
|
}
|
|
9
14
|
state.menuPages.push(page);
|
|
10
15
|
},
|
|
11
16
|
addSubmenuPage(page) {
|
|
12
17
|
if (!page.capability || page.capability.length === 0) {
|
|
13
|
-
throw new Error(`[${pluginId}] addSubmenuPage
|
|
18
|
+
throw new Error(`[${pluginId}] addSubmenuPage requires an explicit capability`);
|
|
14
19
|
}
|
|
15
20
|
state.submenuPages.push(page);
|
|
16
21
|
},
|
|
@@ -37,10 +42,22 @@ export function createPluginAdminApi(pluginId, state = emptyState()) {
|
|
|
37
42
|
addActionLinks(links) {
|
|
38
43
|
state.actionLinks.push(...links);
|
|
39
44
|
},
|
|
45
|
+
addEditor(editor) {
|
|
46
|
+
if (!editor.id || !editor.componentId) {
|
|
47
|
+
throw new Error(`[${pluginId}] addEditor requires id and componentId`);
|
|
48
|
+
}
|
|
49
|
+
if (!Array.isArray(editor.screens) || editor.screens.length === 0) {
|
|
50
|
+
throw new Error(`[${pluginId}] addEditor requires a non-empty screens array`);
|
|
51
|
+
}
|
|
52
|
+
if (editor.mode !== 'replace-body' && editor.mode !== 'below') {
|
|
53
|
+
throw new Error(`[${pluginId}] addEditor mode must be "replace-body" or "below"`);
|
|
54
|
+
}
|
|
55
|
+
state.editors.push(editor);
|
|
56
|
+
},
|
|
40
57
|
};
|
|
41
58
|
return api;
|
|
42
59
|
}
|
|
43
|
-
function emptyState() {
|
|
60
|
+
export function emptyState() {
|
|
44
61
|
return {
|
|
45
62
|
menuPages: [],
|
|
46
63
|
submenuPages: [],
|
|
@@ -50,6 +67,7 @@ function emptyState() {
|
|
|
50
67
|
columns: {},
|
|
51
68
|
columnRenderers: {},
|
|
52
69
|
actionLinks: [],
|
|
70
|
+
editors: [],
|
|
53
71
|
};
|
|
54
72
|
}
|
|
55
73
|
//# sourceMappingURL=admin.js.map
|
package/dist/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,0EAA0E;
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,6EAA6E;AAC7E,mEAAmE;AACnE,8EAA8E;AAC9E,sDAAsD;AAiDtD,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAE,QAA8B,UAAU,EAAE;IAC/F,MAAM,GAAG,GAAqD;QAC5D,KAAK;QACL,WAAW,CAAC,IAAI;YACd,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrD,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,+CAA+C,CAAC,CAAC;YAC/E,CAAC;YACD,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrD,MAAM,IAAI,KAAK,CAAC,IAAI,QAA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KAAK;YAClB,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QACnC,CAAC;QACD,SAAS,CAAC,MAAM;YACd,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,yCAAyC,CAAC,CAAC;YACzE,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAClE,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,gDAAgD,CAAC,CAAC;YAChF,CAAC;YACD,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC9D,MAAM,IAAI,KAAK,CAAC,IAAI,QAAQ,oDAAoD,CAAC,CAAC;YACpF,CAAC;YACD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;KACF,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO;QACL,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,EAAE;QAChB,gBAAgB,EAAE,EAAE;QACpB,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,EAAE;QACnB,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { HookType, type PluginManifest, type PluginDependency, type PluginHook, type PluginHookHandler, type ContentField, type PluginContext, type PluginAPI, type RouteDefinition, type TenantInfo, type UserInfo, } from './types.js';
|
|
1
|
+
export { HookType, type PluginManifest, type PluginDependency, type PluginHook, type PluginHookHandler, type ContentField, type PluginContext, type PluginAPI, type RouteDefinition, type TenantInfo, type UserInfo, type PluginFieldTypeManifest, type PluginBlockManifest, type PluginPatternManifest, type PluginPostTypeDeclaration, type PluginTaxonomyDeclaration, type PluginJobDeclaration, type PluginHttpPolicy, type PluginCacheApi, type PluginJobsApi, type PluginRolesApi, type PluginAssetsApi, type PluginI18nApi, type PluginHealthApi, type PluginHealthCheck, type PluginHealthCheckResult, type PluginMailApi, type PluginMailTemplate, type PluginContentApi, type PluginContentQuery, type EnqueuedAsset, type EnqueuedStyle, type EnqueuedScript, type PluginJobHandler, type PluginHttpApi, type PluginHttpOptions, type PluginHttpResponse, } from './types.js';
|
|
2
2
|
export { createPluginHooksApi, ADMIN_HOOK_POINTS, } from './hooks.js';
|
|
3
3
|
export type { PluginHooksApi, HookRegistration, HookRegistryLike } from './hooks.js';
|
|
4
|
-
export {
|
|
5
|
-
export type {
|
|
4
|
+
export { PERMISSIONS, ALL_PERMISSIONS, validatePermissions, isKnownPermission, } from './permissions.js';
|
|
5
|
+
export type { Permission } from './permissions.js';
|
|
6
|
+
export { createPluginAdminApi, emptyState as createEmptyAdminExtensionsState, } from './admin.js';
|
|
7
|
+
export type { PluginAdminApi, AdminExtensionsState, AdminMenuPage, AdminSubmenuPage, DashboardWidget, DashboardWidgetDeclaration, MetaBox, AdminMetaBox, AdminMetaBoxDeclaration, AdminNotice, ColumnDefinition, AdminColumnDefinition, AdminActionLink, AdminColumnDeclaration, AdminColumnRendererDeclaration, AdminEditorRegistration, PluginManifestAdmin, } from './admin.js';
|
|
6
8
|
export { scopePluginCss, getPluginScopeAttribute, wrapWithPluginScope, } from './style-isolation.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK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E,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EACL,oBAAoB,EACpB,UAAU,IAAI,+BAA+B,GAC9C,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,OAAO,EACP,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { HookType, } from './types.js';
|
|
2
2
|
export { createPluginHooksApi, ADMIN_HOOK_POINTS, } from './hooks.js';
|
|
3
|
-
export {
|
|
3
|
+
export { PERMISSIONS, ALL_PERMISSIONS, validatePermissions, isKnownPermission, } from './permissions.js';
|
|
4
|
+
export { createPluginAdminApi, emptyState as createEmptyAdminExtensionsState, } from './admin.js';
|
|
4
5
|
// Style isolation helpers (re-export do plugin-runtime para uso sem dependência circular)
|
|
5
6
|
export { scopePluginCss, getPluginScopeAttribute, wrapWithPluginScope, } from './style-isolation.js';
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAqCT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,oBAAoB,EACpB,UAAU,IAAI,+BAA+B,GAC9C,MAAM,YAAY,CAAC;AAqBpB,0FAA0F;AAC1F,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type PluginPermission } from '@oktis-works/validation';
|
|
2
|
+
/**
|
|
3
|
+
* Constantes nomeadas de permissão. Valores tipados como `Permission`
|
|
4
|
+
* (união do catálogo de validation) — um typo não compila.
|
|
5
|
+
*
|
|
6
|
+
* Uso no manifesto: { "permissions": ["db:query", "cache:read"] }
|
|
7
|
+
* Uso no código: allowedPermissions.includes(PERMISSIONS.DB_QUERY)
|
|
8
|
+
*/
|
|
9
|
+
export declare const PERMISSIONS: {
|
|
10
|
+
readonly CONTENT_READ: "content:read";
|
|
11
|
+
readonly CONTENT_WRITE: "content:write";
|
|
12
|
+
readonly SETTINGS_READ: "settings:read";
|
|
13
|
+
readonly SETTINGS_WRITE: "settings:write";
|
|
14
|
+
readonly EVENTS_EMIT: "events:emit";
|
|
15
|
+
readonly STORAGE_READ: "storage:read";
|
|
16
|
+
readonly STORAGE_WRITE: "storage:write";
|
|
17
|
+
readonly HTTP_OUTBOUND: "http:outbound";
|
|
18
|
+
readonly DB_QUERY: "db:query";
|
|
19
|
+
readonly DB_WRITE: "db:write";
|
|
20
|
+
readonly ROUTES_REGISTER: "routes:register";
|
|
21
|
+
readonly ADMIN_UI: "admin:ui";
|
|
22
|
+
readonly FIELD_TYPES_REGISTER: "field-types:register";
|
|
23
|
+
readonly POST_TYPES_REGISTER: "post-types:register";
|
|
24
|
+
readonly TAXONOMIES_REGISTER: "taxonomies:register";
|
|
25
|
+
readonly CACHE_READ: "cache:read";
|
|
26
|
+
readonly CACHE_WRITE: "cache:write";
|
|
27
|
+
readonly JOBS_SCHEDULE: "jobs:schedule";
|
|
28
|
+
readonly BLOCKS_REGISTER: "blocks:register";
|
|
29
|
+
readonly PATTERNS_REGISTER: "patterns:register";
|
|
30
|
+
readonly ROLES_CREATE: "roles:create";
|
|
31
|
+
readonly ASSETS_ENQUEUE: "assets:enqueue";
|
|
32
|
+
readonly MAIL_SEND: "mail:send";
|
|
33
|
+
readonly HEALTH_REGISTER: "health:register";
|
|
34
|
+
};
|
|
35
|
+
/** Valor de permissão (string canônica do catálogo). */
|
|
36
|
+
export type Permission = PluginPermission;
|
|
37
|
+
/** Array com TODAS as permissões conhecidas (catálogo de validation). */
|
|
38
|
+
export declare const ALL_PERMISSIONS: readonly Permission[];
|
|
39
|
+
/**
|
|
40
|
+
* Valida uma lista de permissões declaradas em manifesto.
|
|
41
|
+
* Retorna as desconhecidas (vazia = tudo válido).
|
|
42
|
+
*/
|
|
43
|
+
export declare function validatePermissions(declared: string[]): string[];
|
|
44
|
+
/** Checa se uma permissão faz parte do catálogo. */
|
|
45
|
+
export declare function isKnownPermission(permission: string): permission is Permission;
|
|
46
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CA8B6B,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE1C,yEAAyE;AACzE,eAAO,MAAM,eAAe,EAAE,SAAS,UAAU,EAAuB,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEhE;AAED,oDAAoD;AACpD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,IAAI,UAAU,CAE9E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// @oktis-works/plugin-sdk - Constantes ergonômicas do catálogo de permissões
|
|
2
|
+
//
|
|
3
|
+
// A fonte ÚNICA é `@oktis-works/validation` (`PLUGIN_PERMISSIONS`): é ela que
|
|
4
|
+
// governa instalação (QUARANTINED fora do catálogo), sync, política do
|
|
5
|
+
// sandbox e policy do PluginAPI. Aqui só expomos constantes nomeadas para o
|
|
6
|
+
// código e `satisfies` garante que NENHUMA constante exista fora do catálogo
|
|
7
|
+
// (o drift que colocou `field-types:register` fora da política e trancou o
|
|
8
|
+
// mermaid-field em quarentena não se repete).
|
|
9
|
+
import { PLUGIN_PERMISSIONS, isKnownPluginPermission, unknownPluginPermissions, } from '@oktis-works/validation';
|
|
10
|
+
/**
|
|
11
|
+
* Constantes nomeadas de permissão. Valores tipados como `Permission`
|
|
12
|
+
* (união do catálogo de validation) — um typo não compila.
|
|
13
|
+
*
|
|
14
|
+
* Uso no manifesto: { "permissions": ["db:query", "cache:read"] }
|
|
15
|
+
* Uso no código: allowedPermissions.includes(PERMISSIONS.DB_QUERY)
|
|
16
|
+
*/
|
|
17
|
+
export const PERMISSIONS = {
|
|
18
|
+
// ── Core ──
|
|
19
|
+
CONTENT_READ: 'content:read',
|
|
20
|
+
CONTENT_WRITE: 'content:write',
|
|
21
|
+
SETTINGS_READ: 'settings:read',
|
|
22
|
+
SETTINGS_WRITE: 'settings:write',
|
|
23
|
+
EVENTS_EMIT: 'events:emit',
|
|
24
|
+
STORAGE_READ: 'storage:read',
|
|
25
|
+
STORAGE_WRITE: 'storage:write',
|
|
26
|
+
HTTP_OUTBOUND: 'http:outbound',
|
|
27
|
+
DB_QUERY: 'db:query',
|
|
28
|
+
DB_WRITE: 'db:write',
|
|
29
|
+
ROUTES_REGISTER: 'routes:register',
|
|
30
|
+
ADMIN_UI: 'admin:ui',
|
|
31
|
+
// ── Field types ──
|
|
32
|
+
FIELD_TYPES_REGISTER: 'field-types:register',
|
|
33
|
+
// ── Fase 1: CPTs / taxonomias / cache / jobs ──
|
|
34
|
+
POST_TYPES_REGISTER: 'post-types:register',
|
|
35
|
+
TAXONOMIES_REGISTER: 'taxonomies:register',
|
|
36
|
+
CACHE_READ: 'cache:read',
|
|
37
|
+
CACHE_WRITE: 'cache:write',
|
|
38
|
+
JOBS_SCHEDULE: 'jobs:schedule',
|
|
39
|
+
// ── Fase 2: editor de blocos ──
|
|
40
|
+
BLOCKS_REGISTER: 'blocks:register',
|
|
41
|
+
PATTERNS_REGISTER: 'patterns:register',
|
|
42
|
+
// ── Fase 3/4: roles, assets, mail, health ──
|
|
43
|
+
ROLES_CREATE: 'roles:create',
|
|
44
|
+
ASSETS_ENQUEUE: 'assets:enqueue',
|
|
45
|
+
MAIL_SEND: 'mail:send',
|
|
46
|
+
HEALTH_REGISTER: 'health:register',
|
|
47
|
+
};
|
|
48
|
+
/** Array com TODAS as permissões conhecidas (catálogo de validation). */
|
|
49
|
+
export const ALL_PERMISSIONS = PLUGIN_PERMISSIONS;
|
|
50
|
+
/**
|
|
51
|
+
* Valida uma lista de permissões declaradas em manifesto.
|
|
52
|
+
* Retorna as desconhecidas (vazia = tudo válido).
|
|
53
|
+
*/
|
|
54
|
+
export function validatePermissions(declared) {
|
|
55
|
+
return unknownPluginPermissions(declared);
|
|
56
|
+
}
|
|
57
|
+
/** Checa se uma permissão faz parte do catálogo. */
|
|
58
|
+
export function isKnownPermission(permission) {
|
|
59
|
+
return isKnownPluginPermission(permission);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,8EAA8E;AAC9E,uEAAuE;AACvE,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,8CAA8C;AAE9C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,GAEzB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,aAAa;IACb,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,iBAAiB;IAClC,QAAQ,EAAE,UAAU;IACpB,oBAAoB;IACpB,oBAAoB,EAAE,sBAAsB;IAC5C,iDAAiD;IACjD,mBAAmB,EAAE,qBAAqB;IAC1C,mBAAmB,EAAE,qBAAqB;IAC1C,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,iCAAiC;IACjC,eAAe,EAAE,iBAAiB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,8CAA8C;IAC9C,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAChC,SAAS,EAAE,WAAW;IACtB,eAAe,EAAE,iBAAiB;CACiB,CAAC;AAKtD,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAA0B,kBAAkB,CAAC;AAEzE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAkB;IACpD,OAAO,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { PluginManifest as CanonicalPluginManifest, PluginDependency as CanonicalPluginDependency } from '@oktis-works/types';
|
|
1
|
+
import type { PluginManifest as CanonicalPluginManifest, PluginDependency as CanonicalPluginDependency, PluginFieldTypeManifest, PluginBlockManifest, PluginPatternManifest, PluginPostTypeDeclaration, PluginTaxonomyDeclaration, PluginJobDeclaration, PluginHttpPolicy } from '@oktis-works/types';
|
|
2
|
+
import type { PluginAdminApi } from './admin.js';
|
|
3
|
+
export type { PluginFieldTypeManifest, PluginBlockManifest, PluginPatternManifest, PluginPostTypeDeclaration, PluginTaxonomyDeclaration, PluginJobDeclaration, PluginHttpPolicy, };
|
|
2
4
|
/**
|
|
3
5
|
* Plugin lifecycle hook types.
|
|
4
6
|
* These map to internal action names fired by the core:
|
|
@@ -56,6 +58,7 @@ export declare enum HookType {
|
|
|
56
58
|
export type PluginManifest = CanonicalPluginManifest & {
|
|
57
59
|
main: string;
|
|
58
60
|
hooks?: PluginHook[];
|
|
61
|
+
fieldTypes?: PluginFieldTypeManifest[];
|
|
59
62
|
};
|
|
60
63
|
export type PluginDependency = CanonicalPluginDependency;
|
|
61
64
|
export interface PluginHook {
|
|
@@ -80,6 +83,33 @@ export interface PluginAPI {
|
|
|
80
83
|
registerHook(type: HookType, handler: PluginHookHandler): void;
|
|
81
84
|
addRoute(route: RouteDefinition): void;
|
|
82
85
|
addContentField(field: ContentField): void;
|
|
86
|
+
addFieldType(definition: PluginFieldTypeManifest): void;
|
|
87
|
+
addPostType(declaration: PluginPostTypeDeclaration): void;
|
|
88
|
+
addTaxonomy(declaration: PluginTaxonomyDeclaration): void;
|
|
89
|
+
/** Registers an editor block (permission blocks:register) — data plane, no table. */
|
|
90
|
+
registerBlock(block: PluginBlockManifest): void;
|
|
91
|
+
/** Registers an editor pattern (permission patterns:register) — data plane, no table. */
|
|
92
|
+
registerPattern(pattern: PluginPatternManifest): void;
|
|
93
|
+
/** Cache/transient por plugin (namespaced, permissão cache:read/cache:write). */
|
|
94
|
+
cache: PluginCacheApi;
|
|
95
|
+
/** Jobs/cron por plugin (permissão jobs:schedule). */
|
|
96
|
+
jobs: PluginJobsApi;
|
|
97
|
+
/** HTTP externo protegido contra SSRF (permissão http:outbound). */
|
|
98
|
+
http: PluginHttpApi;
|
|
99
|
+
/** Slots declarativos do admin (menu/widgets/metaboxes/notices/colunas) — FEAT-098. */
|
|
100
|
+
admin: PluginAdminApi;
|
|
101
|
+
/** Gestão de roles do tenant (Item 6 — escopo tenant, anti-escalada, audit). */
|
|
102
|
+
roles: PluginRolesApi;
|
|
103
|
+
/** Asset enqueue para o site público (Item 8 — permissão assets:enqueue). */
|
|
104
|
+
assets: PluginAssetsApi;
|
|
105
|
+
/** Traduções server-side (Item 9 — fallback chain locale → base → en). */
|
|
106
|
+
i18n: PluginI18nApi;
|
|
107
|
+
/** Health checks agregados no /health (Item 14 — permissão health:register). */
|
|
108
|
+
health: PluginHealthApi;
|
|
109
|
+
/** Envio de e-mail via outbox (Item 12 — permissão mail:send). */
|
|
110
|
+
mail: PluginMailApi;
|
|
111
|
+
/** Query builder tipado de conteúdo (Item 22 — permissão db:query). */
|
|
112
|
+
content: PluginContentApi;
|
|
83
113
|
getSetting(key: string): Promise<unknown>;
|
|
84
114
|
setSetting(key: string, value: unknown): Promise<void>;
|
|
85
115
|
getTenant(): Promise<TenantInfo>;
|
|
@@ -87,6 +117,235 @@ export interface PluginAPI {
|
|
|
87
117
|
query<T>(sql: string, params?: unknown[]): Promise<T[]>;
|
|
88
118
|
emit(event: string, payload: unknown): Promise<void>;
|
|
89
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* API de cache/transient do plugin (Item 2 do plano de paridade).
|
|
122
|
+
* Chaves são namespaced por `plugin:{tenant}:{plugin}:{chave}` — um plugin não
|
|
123
|
+
* lê chaves de outro nem de outro tenant (RLS de cache).
|
|
124
|
+
*/
|
|
125
|
+
export interface PluginCacheApi {
|
|
126
|
+
/** Lê um valor; null se ausente/expirado. Permissão: cache:read. */
|
|
127
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
128
|
+
/**
|
|
129
|
+
* Grava um valor. Permissão: cache:write.
|
|
130
|
+
* `tags` permitem invalidação em lote via {@link invalidateTags}.
|
|
131
|
+
*/
|
|
132
|
+
set(key: string, value: unknown, options?: {
|
|
133
|
+
ttlSeconds?: number;
|
|
134
|
+
tags?: string[];
|
|
135
|
+
}): Promise<void>;
|
|
136
|
+
/** Remove uma chave. Permissão: cache:write. */
|
|
137
|
+
delete(key: string): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Lê; se ausente, executa `producer`, grava o resultado por `ttlSeconds` e
|
|
140
|
+
* retorna. Permissão: cache:write.
|
|
141
|
+
*/
|
|
142
|
+
wrap<T>(key: string, ttlSeconds: number, producer: () => Promise<T>): Promise<T>;
|
|
143
|
+
/** Invalida todas as chaves associadas às tags. Permissão: cache:write. */
|
|
144
|
+
invalidateTags(tags: string[]): Promise<void>;
|
|
145
|
+
}
|
|
146
|
+
/** Handler executado pelo worker quando um job do plugin roda. */
|
|
147
|
+
export type PluginJobHandler = (payload: unknown, context: {
|
|
148
|
+
tenantId: string | null;
|
|
149
|
+
plugin: string;
|
|
150
|
+
jobName: string;
|
|
151
|
+
}) => void | Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* API de jobs/cron do plugin (Item 3 do plano de paridade — parity com
|
|
154
|
+
* WP-Cron / Action Scheduler). Fila dedicada `plugins`, teto de 10 agendas
|
|
155
|
+
* por plugin, degradação silenciosa (retorna false) sem Redis.
|
|
156
|
+
*/
|
|
157
|
+
export interface PluginJobsApi {
|
|
158
|
+
/** Declara o handler executado pelo worker para este job. */
|
|
159
|
+
on(jobName: string, handler: PluginJobHandler): void;
|
|
160
|
+
/**
|
|
161
|
+
* Agenda execução recorrente — exatamente UM de `every` (ms) ou `cron`.
|
|
162
|
+
* Permissão: jobs:schedule. Retorna false quando a fila está indisponível.
|
|
163
|
+
*/
|
|
164
|
+
schedule(jobName: string, spec: {
|
|
165
|
+
every?: number;
|
|
166
|
+
cron?: string;
|
|
167
|
+
}): Promise<boolean>;
|
|
168
|
+
/** Cancela a agenda recorrente do job. Permissão: jobs:schedule. */
|
|
169
|
+
cancel(jobName: string): Promise<boolean>;
|
|
170
|
+
/** Enfileira uma execução única imediata. Permissão: jobs:schedule. */
|
|
171
|
+
enqueue(jobName: string, payload?: Record<string, unknown>): Promise<boolean>;
|
|
172
|
+
}
|
|
173
|
+
/** Resposta de api.http (Item 4 — HTTP externo protegido contra SSRF). */
|
|
174
|
+
export interface PluginHttpResponse {
|
|
175
|
+
status: number;
|
|
176
|
+
ok: boolean;
|
|
177
|
+
/** Headers em lowercase. */
|
|
178
|
+
headers: Record<string, string>;
|
|
179
|
+
/** Corpo completo (teto configurável, default 5 MB). */
|
|
180
|
+
body: string;
|
|
181
|
+
/** Parseia o corpo como JSON (lança em corpo inválido). */
|
|
182
|
+
json<T = unknown>(): T;
|
|
183
|
+
}
|
|
184
|
+
export interface PluginHttpOptions {
|
|
185
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD';
|
|
186
|
+
headers?: Record<string, string>;
|
|
187
|
+
/** Corpo textual (JSON.stringify antes de enviar). */
|
|
188
|
+
body?: string;
|
|
189
|
+
/** Timeout por tentativa (default 10s, máx 60s). */
|
|
190
|
+
timeoutMs?: number;
|
|
191
|
+
/** Teto do corpo em bytes (default 5 MB). */
|
|
192
|
+
maxBytes?: number;
|
|
193
|
+
/**
|
|
194
|
+
* Retentativas em erro de rede/5xx. Default: 2 para GET/HEAD, 0 para os
|
|
195
|
+
* demais métodos (não idempotentes não são repetidos por padrão).
|
|
196
|
+
*/
|
|
197
|
+
retries?: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* HTTP externo seguro (Item 4 do plano de paridade + Item 16 egress).
|
|
201
|
+
* Proteções: allowlist `httpPolicy.allowHosts` do manifesto, apenas http/https,
|
|
202
|
+
* pré-validação DNS com IP público (bloqueia RFC1918/loopback/link-local
|
|
203
|
+
* 169.254 = metadata cloud/CGNAT/multicast), DNS pinning via dispatcher,
|
|
204
|
+
* redirects manuais com re-validação (máx 3), timeout e teto de corpo.
|
|
205
|
+
* Permissão: http:outbound.
|
|
206
|
+
*/
|
|
207
|
+
export interface PluginHttpApi {
|
|
208
|
+
request(url: string, options?: PluginHttpOptions): Promise<PluginHttpResponse>;
|
|
209
|
+
get(url: string, options?: Omit<PluginHttpOptions, 'method' | 'body'>): Promise<PluginHttpResponse>;
|
|
210
|
+
post(url: string, body: string, options?: Omit<PluginHttpOptions, 'method' | 'body'>): Promise<PluginHttpResponse>;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Roles API for plugins (Item 6 — tenant-scoped, audited, anti-escalation).
|
|
214
|
+
* All operations require `roles:create`, a tenant context and block
|
|
215
|
+
* escalation: reserved/system role names, wildcard permissions and
|
|
216
|
+
* platform-only operations (create/update/delete plugin) are rejected.
|
|
217
|
+
*/
|
|
218
|
+
export interface PluginRolesApi {
|
|
219
|
+
/** Creates a tenant role. Permissions are `action:resource` strings. */
|
|
220
|
+
add(input: {
|
|
221
|
+
name: string;
|
|
222
|
+
slug?: string;
|
|
223
|
+
permissions?: string[];
|
|
224
|
+
}): Promise<{
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
slug: string;
|
|
228
|
+
permissions: string[];
|
|
229
|
+
}>;
|
|
230
|
+
/** Removes a non-system tenant role by slug. */
|
|
231
|
+
remove(slug: string): Promise<boolean>;
|
|
232
|
+
/** Grants one extra permission (`action:resource`) to a tenant role. */
|
|
233
|
+
addPermission(slug: string, permission: string): Promise<boolean>;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Stylesheet enqueued via api.assets.enqueueStyle (Item 8).
|
|
237
|
+
* `integrity`/`crossOrigin` enable SRI; `version` is appended as `?ver=`.
|
|
238
|
+
*/
|
|
239
|
+
export interface EnqueuedStyle {
|
|
240
|
+
kind: 'style';
|
|
241
|
+
src: string;
|
|
242
|
+
version?: string;
|
|
243
|
+
media?: string;
|
|
244
|
+
integrity?: string;
|
|
245
|
+
crossOrigin?: string;
|
|
246
|
+
pluginName: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Script enqueued via api.assets.enqueueScript (Item 8).
|
|
250
|
+
* `strategy` maps to defer/async; `placement` head (default) or footer.
|
|
251
|
+
*/
|
|
252
|
+
export interface EnqueuedScript {
|
|
253
|
+
kind: 'script';
|
|
254
|
+
src: string;
|
|
255
|
+
version?: string;
|
|
256
|
+
strategy?: 'blocking' | 'defer' | 'async';
|
|
257
|
+
placement?: 'head' | 'footer';
|
|
258
|
+
integrity?: string;
|
|
259
|
+
crossOrigin?: string;
|
|
260
|
+
pluginName: string;
|
|
261
|
+
}
|
|
262
|
+
export type EnqueuedAsset = EnqueuedStyle | EnqueuedScript;
|
|
263
|
+
/**
|
|
264
|
+
* Asset enqueue API for plugins (Item 8 — permission assets:enqueue).
|
|
265
|
+
* Assets are emitted on the public site: styles + head scripts in <head>,
|
|
266
|
+
* footer scripts before </body>. Duplicate URLs are emitted once (dedupe by
|
|
267
|
+
* URL hash across plugins).
|
|
268
|
+
*/
|
|
269
|
+
export interface PluginAssetsApi {
|
|
270
|
+
/** Enqueues a stylesheet for the public site <head>. */
|
|
271
|
+
enqueueStyle(style: Omit<EnqueuedStyle, 'kind' | 'pluginName'>): void;
|
|
272
|
+
/** Enqueues a script for the public site (head by default, or footer). */
|
|
273
|
+
enqueueScript(script: Omit<EnqueuedScript, 'kind' | 'pluginName'>): void;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Server-side i18n for plugins (Item 9). Bundles are flat { key: string };
|
|
277
|
+
* translate() resolves through the fallback chain (locale → base language →
|
|
278
|
+
* 'en' → key) with {param} interpolation. Manifest `locales[]` JSON files
|
|
279
|
+
* are loaded automatically at boot.
|
|
280
|
+
*/
|
|
281
|
+
export interface PluginI18nApi {
|
|
282
|
+
/** Merges a flat bundle into a locale (later loads override keys). */
|
|
283
|
+
load(locale: string, bundle: Record<string, string>): void;
|
|
284
|
+
/** Translates a key; unknown keys return the key itself. */
|
|
285
|
+
translate(key: string, params?: Record<string, unknown>, locale?: string): string;
|
|
286
|
+
/** Current default locale used when translate() gets no explicit locale. */
|
|
287
|
+
locale(): string;
|
|
288
|
+
/** Sets the plugin default locale (e.g. from the tenant language). */
|
|
289
|
+
setDefaultLocale(locale: string): void;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Health check API for plugins (Item 14 — permission health:register).
|
|
293
|
+
* Registered checks run aggregated in GET /api/v1/health with a 2s budget
|
|
294
|
+
* each; failure/timeout never breaks the endpoint (reported as 'error').
|
|
295
|
+
*/
|
|
296
|
+
export interface PluginHealthCheckResult {
|
|
297
|
+
ok: boolean;
|
|
298
|
+
details?: Record<string, unknown>;
|
|
299
|
+
}
|
|
300
|
+
export type PluginHealthCheck = () => PluginHealthCheckResult | Promise<PluginHealthCheckResult>;
|
|
301
|
+
export interface PluginHealthApi {
|
|
302
|
+
/** Registers a named health check for this plugin (duplicate names reject). */
|
|
303
|
+
register(name: string, check: PluginHealthCheck): void;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Mail template registered via api.mail.registerTemplate (Item 12).
|
|
307
|
+
* Strings support {param} interpolation from send()'s params.
|
|
308
|
+
*/
|
|
309
|
+
export interface PluginMailTemplate {
|
|
310
|
+
subject: string;
|
|
311
|
+
html?: string;
|
|
312
|
+
text?: string;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Mail API for plugins (Item 12 — permission mail:send). Messages land in a
|
|
316
|
+
* durable outbox (`mails`) and are delivered by the worker with a per-plugin
|
|
317
|
+
* rate limit; the queue being unavailable keeps the outbox row (never lost).
|
|
318
|
+
* Returns false when the send was refused (rate limit) or the queue is down.
|
|
319
|
+
*/
|
|
320
|
+
export interface PluginMailApi {
|
|
321
|
+
/** Registers a named template (duplicate names reject). */
|
|
322
|
+
registerTemplate(name: string, template: PluginMailTemplate): void;
|
|
323
|
+
/** Enqueues a message — by template or explicit subject/body. */
|
|
324
|
+
send(input: {
|
|
325
|
+
to: string;
|
|
326
|
+
template?: string;
|
|
327
|
+
params?: Record<string, unknown>;
|
|
328
|
+
subject?: string;
|
|
329
|
+
html?: string;
|
|
330
|
+
text?: string;
|
|
331
|
+
}): Promise<boolean>;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Typed content query builder (Item 22 — permission db:query). Declarative
|
|
335
|
+
* filters over allowlisted content columns, fully parameterized.
|
|
336
|
+
*/
|
|
337
|
+
export interface PluginContentQuery {
|
|
338
|
+
where(field: string, op: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like', value: unknown): PluginContentQuery;
|
|
339
|
+
whereIn(field: string, values: readonly unknown[]): PluginContentQuery;
|
|
340
|
+
orderBy(field: string, dir?: 'asc' | 'desc'): PluginContentQuery;
|
|
341
|
+
limit(n: number): PluginContentQuery;
|
|
342
|
+
offset(n: number): PluginContentQuery;
|
|
343
|
+
execute(): Promise<unknown[]>;
|
|
344
|
+
}
|
|
345
|
+
export interface PluginContentApi {
|
|
346
|
+
/** Starts a new declarative content query. */
|
|
347
|
+
query(): PluginContentQuery;
|
|
348
|
+
}
|
|
90
349
|
export interface RouteDefinition {
|
|
91
350
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
92
351
|
path: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,uBAAuB,EACzC,gBAAgB,IAAI,yBAAyB,EAC7C,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,oBAAo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,EAAE,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAAC;IAClH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,kBAAkB,CAAC;IACvE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,kBAAkB,CAAC;IACjE,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACrC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACtC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,KAAK,IAAI,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAyB3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAN,IAAY,QAeX;AAfD,WAAY,QAAQ;IAClB,yDAA6C,CAAA;IAC7C,uDAA2C,CAAA;IAC3C,yDAA6C,CAAA;IAC7C,uDAA2C,CAAA;IAC3C,yDAA6C,CAAA;IAC7C,uDAA2C,CAAA;IAC3C,mDAAuC,CAAA;IACvC,uDAA2C,CAAA;IAC3C,oCAAwB,CAAA;IACxB,sCAA0B,CAAA;IAC1B,0CAA8B,CAAA;IAC9B,wCAA4B,CAAA;IAC5B,+CAAmC,CAAA;IACnC,yCAA6B,CAAA;AAC/B,CAAC,EAfW,QAAQ,KAAR,QAAQ,QAenB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oktis-works/plugin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@oktis-works/types": "^0.
|
|
19
|
+
"@oktis-works/types": "^0.9.0",
|
|
20
|
+
"@oktis-works/validation": "^0.7.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"typescript": "5.7.3",
|
|
23
|
-
"@oktis-works/plugin-runtime": "^0.
|
|
24
|
+
"@oktis-works/plugin-runtime": "^0.7.0"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
27
|
"dist"
|