@cervio/plugin-core 0.1.1 → 1.0.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.
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://cervio.app/schemas/plugin-manifest.json",
4
4
  "title": "Cervio Plugin Manifest",
5
- "description": "Author-facing plugin manifest. The `version` field is ignored — Cervio assigns release versions.",
5
+ "description": "Author-facing plugin manifest. The `version` field is ignored - Cervio assigns release versions.",
6
6
  "$ref": "#/definitions/CervioPluginManifest",
7
7
  "definitions": {
8
8
  "CervioPluginManifest": {
@@ -30,8 +30,11 @@
30
30
  "task",
31
31
  "form",
32
32
  "task_form",
33
- "route"
34
- ]
33
+ "route",
34
+ "policy",
35
+ "server"
36
+ ],
37
+ "description": "Use `policy` for Policy Plugins. `server` is a legacy alias for `policy`."
35
38
  },
36
39
  "kind": {
37
40
  "type": "string",
@@ -39,7 +42,46 @@
39
42
  },
40
43
  "version": {
41
44
  "type": "string",
42
- "description": "Ignored by Cervio — the host assigns release versions."
45
+ "description": "Ignored by Cervio - the host assigns release versions."
46
+ },
47
+ "hooks": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "object",
51
+ "properties": {
52
+ "event": {
53
+ "type": "string",
54
+ "enum": [
55
+ "before_create",
56
+ "before_update"
57
+ ]
58
+ },
59
+ "entities": {
60
+ "type": "array",
61
+ "items": {
62
+ "type": "string"
63
+ }
64
+ },
65
+ "blocking": {
66
+ "type": "boolean"
67
+ },
68
+ "identity": {
69
+ "type": "string",
70
+ "enum": [
71
+ "caller",
72
+ "plugin_principal"
73
+ ]
74
+ },
75
+ "entry": {
76
+ "type": "string"
77
+ }
78
+ },
79
+ "required": [
80
+ "event"
81
+ ],
82
+ "additionalProperties": false
83
+ },
84
+ "description": "Policy Plugin hook declarations (plugin_type=policy; legacy server)."
43
85
  },
44
86
  "required_connection_capabilities": {
45
87
  "type": "array",
@@ -169,6 +211,119 @@
169
211
  "cervioApis": {
170
212
  "type": "array",
171
213
  "items": {}
214
+ },
215
+ "boot_requests": {
216
+ "maxItems": 8,
217
+ "type": "array",
218
+ "items": {
219
+ "type": "object",
220
+ "properties": {
221
+ "path": {
222
+ "type": "string",
223
+ "description": "GET path + optional query under /api/v1/, covered by a GET `cervio_apis` prefix."
224
+ }
225
+ },
226
+ "required": [
227
+ "path"
228
+ ],
229
+ "additionalProperties": false
230
+ },
231
+ "description": "GET calls the plugin makes at start. The host starts them while the plugin loads and answers the plugin's own fetch of the same path + query from that response (once). `/api/v1/entities/<technical name>/...` also matches the entity id. Hint only: nothing changes for other requests."
232
+ },
233
+ "settings": {
234
+ "type": "array",
235
+ "items": {
236
+ "type": "object",
237
+ "properties": {
238
+ "key": {
239
+ "type": "string"
240
+ },
241
+ "type": {
242
+ "type": "string",
243
+ "enum": [
244
+ "string",
245
+ "boolean",
246
+ "select",
247
+ "multiselect"
248
+ ]
249
+ },
250
+ "label": {
251
+ "type": "string"
252
+ },
253
+ "hint": {
254
+ "type": "string"
255
+ },
256
+ "placeholder": {
257
+ "type": "string"
258
+ },
259
+ "default": {
260
+ "anyOf": [
261
+ {
262
+ "type": "string"
263
+ },
264
+ {
265
+ "type": "boolean"
266
+ },
267
+ {
268
+ "type": "array",
269
+ "items": {
270
+ "type": "string"
271
+ }
272
+ }
273
+ ]
274
+ },
275
+ "options": {
276
+ "type": "array",
277
+ "items": {
278
+ "type": "object",
279
+ "properties": {
280
+ "value": {
281
+ "type": "string"
282
+ },
283
+ "label": {
284
+ "type": "string"
285
+ }
286
+ },
287
+ "required": [
288
+ "value",
289
+ "label"
290
+ ],
291
+ "additionalProperties": false
292
+ },
293
+ "description": "Required for `select` / `multiselect`."
294
+ }
295
+ },
296
+ "required": [
297
+ "key",
298
+ "type",
299
+ "label"
300
+ ],
301
+ "additionalProperties": false
302
+ },
303
+ "description": "Admin-editable settings fields (drives Impostazioni dynamic form)."
304
+ },
305
+ "task_widget": {
306
+ "type": "object",
307
+ "properties": {
308
+ "preferred_size": {
309
+ "type": "string",
310
+ "enum": [
311
+ "compact",
312
+ "standard",
313
+ "tall",
314
+ "fill"
315
+ ],
316
+ "description": "Default box height preset in a task layout (standard = 34rem)."
317
+ },
318
+ "preferred_height_px": {
319
+ "type": "integer",
320
+ "minimum": 240,
321
+ "maximum": 1600,
322
+ "description": "Default box height in px; wins over preferred_size."
323
+ }
324
+ },
325
+ "additionalProperties": false,
326
+ "description": "task / task_form plugins: suggested size of the plugin box in a task layout. Default only: the layout widget size set by the tenant admin always wins. Invalid values are ignored, never fatal."
172
327
  }
173
328
  },
174
329
  "additionalProperties": true
package/package.json CHANGED
@@ -1,46 +1,61 @@
1
1
  {
2
2
  "name": "@cervio/plugin-core",
3
- "version": "0.1.1",
3
+ "version": "1.0.0",
4
4
  "description": "Shared Cervio plugin manifest validation, ZIP safety, content hash, and packing.",
5
+ "keywords": [
6
+ "cervio",
7
+ "plugin"
8
+ ],
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/cervio-app/cervio-devkit/tree/main/packages/plugin-core#readme",
11
+ "bugs": "https://github.com/cervio-app/cervio-devkit/issues",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/cervio-app/cervio-devkit.git",
15
+ "directory": "packages/plugin-core"
16
+ },
5
17
  "type": "module",
18
+ "sideEffects": false,
6
19
  "main": "./dist/index.js",
7
20
  "types": "./dist/index.d.ts",
8
21
  "exports": {
9
22
  ".": {
10
23
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
24
+ "import": "./dist/index.js"
25
+ },
26
+ "./browser": {
27
+ "types": "./dist/browser.d.ts",
28
+ "import": "./dist/browser.js"
13
29
  },
14
30
  "./manifest.schema.json": "./manifest.schema.json"
15
31
  },
16
32
  "files": [
17
33
  "dist",
18
34
  "manifest.schema.json",
19
- "README.md"
35
+ "README.md",
36
+ "LICENSE"
20
37
  ],
21
- "scripts": {
22
- "build": "tsup --config tsup.config.ts && node scripts/emit-manifest-schema.mjs",
23
- "typecheck": "tsc -p tsconfig.json --noEmit",
24
- "test": "vitest run",
25
- "emit-schema": "node scripts/emit-manifest-schema.mjs"
38
+ "engines": {
39
+ "node": ">=26"
26
40
  },
27
41
  "dependencies": {
28
- "jszip": "^3.10.1",
29
- "zod": "^3.25.76",
30
- "zod-to-json-schema": "^3.24.6"
42
+ "fflate": "^0.8.3",
43
+ "zod": "^4.6.7"
31
44
  },
32
45
  "devDependencies": {
33
- "@types/node": "^22.15.0",
34
- "tsup": "^8.5.0",
46
+ "@types/node": "^26.0.0",
47
+ "jszip": "^3.10.1",
48
+ "tsup": "^9.0.0",
35
49
  "typescript": "^5.8.3",
36
- "vitest": "^3.2.4"
50
+ "vitest": "^5.0.5"
37
51
  },
38
52
  "publishConfig": {
39
53
  "access": "public"
40
54
  },
41
- "license": "UNLICENSED",
42
- "keywords": [
43
- "cervio",
44
- "plugin"
45
- ]
46
- }
55
+ "scripts": {
56
+ "build": "tsup --config tsup.config.ts && node scripts/emit-manifest-schema.mjs",
57
+ "typecheck": "tsc -p tsconfig.json --noEmit",
58
+ "test": "vitest run",
59
+ "emit-schema": "node scripts/emit-manifest-schema.mjs"
60
+ }
61
+ }