@surnie/plugin-kit 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +29 -2
- package/dist/cli.js +2521 -0
- package/package.json +28 -4
- package/schema/manifest.schema.json +1035 -0
|
@@ -0,0 +1,1035 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Manifiesto de un plugin de Surnie (contrato 0)",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"$schema": {
|
|
7
|
+
"description": "Esquema JSON del manifiesto, para el editor. El motor lo ignora.",
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
"contract": {
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"description": "Versión del contrato con el motor que usa el plugin. 0 = inestable.",
|
|
13
|
+
"const": 0
|
|
14
|
+
},
|
|
15
|
+
"namespace": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^[a-z][a-z0-9]{2,15}$",
|
|
18
|
+
"description": "Prefijo de todo lo del plugin (seo → seo_title). De 3 a 16 minúsculas o dígitos, sin '_'. Único en la plataforma.",
|
|
19
|
+
"not": {
|
|
20
|
+
"enum": [
|
|
21
|
+
"account",
|
|
22
|
+
"admin",
|
|
23
|
+
"api",
|
|
24
|
+
"app",
|
|
25
|
+
"backups",
|
|
26
|
+
"core",
|
|
27
|
+
"engine",
|
|
28
|
+
"login",
|
|
29
|
+
"media",
|
|
30
|
+
"model",
|
|
31
|
+
"plugin",
|
|
32
|
+
"plugins",
|
|
33
|
+
"roles",
|
|
34
|
+
"sessions",
|
|
35
|
+
"setup",
|
|
36
|
+
"surnie",
|
|
37
|
+
"system",
|
|
38
|
+
"themes",
|
|
39
|
+
"user",
|
|
40
|
+
"users",
|
|
41
|
+
"view",
|
|
42
|
+
"webhook",
|
|
43
|
+
"webhooks"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"name": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"minLength": 1,
|
|
50
|
+
"maxLength": 60,
|
|
51
|
+
"description": "Nombre visible del plugin."
|
|
52
|
+
},
|
|
53
|
+
"description": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"maxLength": 200,
|
|
57
|
+
"description": "Qué hace el plugin, en una frase."
|
|
58
|
+
},
|
|
59
|
+
"version": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
|
|
62
|
+
"description": "Versión del plugin: X.Y.Z."
|
|
63
|
+
},
|
|
64
|
+
"permissions": {
|
|
65
|
+
"default": {
|
|
66
|
+
"required": [],
|
|
67
|
+
"optional": []
|
|
68
|
+
},
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"required": {
|
|
72
|
+
"default": [],
|
|
73
|
+
"description": "Sin ellos el plugin no se instala.",
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"oneOf": [
|
|
77
|
+
{
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": {
|
|
80
|
+
"kind": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"const": "content"
|
|
83
|
+
},
|
|
84
|
+
"id": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
87
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
88
|
+
},
|
|
89
|
+
"purpose": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"minLength": 1,
|
|
92
|
+
"maxLength": 200,
|
|
93
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
94
|
+
},
|
|
95
|
+
"actions": {
|
|
96
|
+
"minItems": 1,
|
|
97
|
+
"type": "array",
|
|
98
|
+
"items": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": [
|
|
101
|
+
"read",
|
|
102
|
+
"create",
|
|
103
|
+
"update",
|
|
104
|
+
"delete",
|
|
105
|
+
"publish"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"uniqueItems": true
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": [
|
|
112
|
+
"kind",
|
|
113
|
+
"id",
|
|
114
|
+
"purpose",
|
|
115
|
+
"actions"
|
|
116
|
+
],
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"description": "Contenido del proyecto: el admin elige al instalar a qué colecciones se lo da."
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {
|
|
123
|
+
"kind": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"const": "users"
|
|
126
|
+
},
|
|
127
|
+
"id": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
130
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
131
|
+
},
|
|
132
|
+
"purpose": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"minLength": 1,
|
|
135
|
+
"maxLength": 200,
|
|
136
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
137
|
+
},
|
|
138
|
+
"fields": {
|
|
139
|
+
"minItems": 1,
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"enum": [
|
|
144
|
+
"name",
|
|
145
|
+
"email",
|
|
146
|
+
"locale",
|
|
147
|
+
"createdAt"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"uniqueItems": true
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"required": [
|
|
154
|
+
"kind",
|
|
155
|
+
"id",
|
|
156
|
+
"purpose",
|
|
157
|
+
"fields"
|
|
158
|
+
],
|
|
159
|
+
"additionalProperties": false,
|
|
160
|
+
"description": "Leer campos de las cuentas del panel. Nunca la contraseña, el rol ni las sesiones."
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"type": "object",
|
|
164
|
+
"properties": {
|
|
165
|
+
"kind": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"const": "network"
|
|
168
|
+
},
|
|
169
|
+
"id": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
172
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
173
|
+
},
|
|
174
|
+
"purpose": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"minLength": 1,
|
|
177
|
+
"maxLength": 200,
|
|
178
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
179
|
+
},
|
|
180
|
+
"domains": {
|
|
181
|
+
"minItems": 1,
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
},
|
|
186
|
+
"uniqueItems": true
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"required": [
|
|
190
|
+
"kind",
|
|
191
|
+
"id",
|
|
192
|
+
"purpose",
|
|
193
|
+
"domains"
|
|
194
|
+
],
|
|
195
|
+
"additionalProperties": false,
|
|
196
|
+
"description": "Dominios a los que el plugin podrá llamar (por la recepción). Solo el nombre: api.ejemplo.com."
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"type": "object",
|
|
200
|
+
"properties": {
|
|
201
|
+
"kind": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"const": "fields"
|
|
204
|
+
},
|
|
205
|
+
"id": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
208
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
209
|
+
},
|
|
210
|
+
"purpose": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"minLength": 1,
|
|
213
|
+
"maxLength": 200,
|
|
214
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
215
|
+
},
|
|
216
|
+
"fields": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"propertyNames": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
},
|
|
221
|
+
"additionalProperties": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"properties": {
|
|
224
|
+
"type": {
|
|
225
|
+
"type": "string"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"required": [
|
|
229
|
+
"type"
|
|
230
|
+
],
|
|
231
|
+
"additionalProperties": {}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"required": [
|
|
236
|
+
"kind",
|
|
237
|
+
"id",
|
|
238
|
+
"purpose",
|
|
239
|
+
"fields"
|
|
240
|
+
],
|
|
241
|
+
"additionalProperties": false,
|
|
242
|
+
"description": "Campos que el plugin añade a colecciones del proyecto que elija el admin; con el prefijo del plugin."
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"optional": {
|
|
248
|
+
"default": [],
|
|
249
|
+
"description": "El admin puede negarlos: el plugin tiene que funcionar sin ellos.",
|
|
250
|
+
"type": "array",
|
|
251
|
+
"items": {
|
|
252
|
+
"oneOf": [
|
|
253
|
+
{
|
|
254
|
+
"type": "object",
|
|
255
|
+
"properties": {
|
|
256
|
+
"kind": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"const": "content"
|
|
259
|
+
},
|
|
260
|
+
"id": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
263
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
264
|
+
},
|
|
265
|
+
"purpose": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"minLength": 1,
|
|
268
|
+
"maxLength": 200,
|
|
269
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
270
|
+
},
|
|
271
|
+
"actions": {
|
|
272
|
+
"minItems": 1,
|
|
273
|
+
"type": "array",
|
|
274
|
+
"items": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"enum": [
|
|
277
|
+
"read",
|
|
278
|
+
"create",
|
|
279
|
+
"update",
|
|
280
|
+
"delete",
|
|
281
|
+
"publish"
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
"uniqueItems": true
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"required": [
|
|
288
|
+
"kind",
|
|
289
|
+
"id",
|
|
290
|
+
"purpose",
|
|
291
|
+
"actions"
|
|
292
|
+
],
|
|
293
|
+
"additionalProperties": false,
|
|
294
|
+
"description": "Contenido del proyecto: el admin elige al instalar a qué colecciones se lo da."
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"type": "object",
|
|
298
|
+
"properties": {
|
|
299
|
+
"kind": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"const": "users"
|
|
302
|
+
},
|
|
303
|
+
"id": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
306
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
307
|
+
},
|
|
308
|
+
"purpose": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"minLength": 1,
|
|
311
|
+
"maxLength": 200,
|
|
312
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
313
|
+
},
|
|
314
|
+
"fields": {
|
|
315
|
+
"minItems": 1,
|
|
316
|
+
"type": "array",
|
|
317
|
+
"items": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"enum": [
|
|
320
|
+
"name",
|
|
321
|
+
"email",
|
|
322
|
+
"locale",
|
|
323
|
+
"createdAt"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
"uniqueItems": true
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"required": [
|
|
330
|
+
"kind",
|
|
331
|
+
"id",
|
|
332
|
+
"purpose",
|
|
333
|
+
"fields"
|
|
334
|
+
],
|
|
335
|
+
"additionalProperties": false,
|
|
336
|
+
"description": "Leer campos de las cuentas del panel. Nunca la contraseña, el rol ni las sesiones."
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"type": "object",
|
|
340
|
+
"properties": {
|
|
341
|
+
"kind": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"const": "network"
|
|
344
|
+
},
|
|
345
|
+
"id": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
348
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
349
|
+
},
|
|
350
|
+
"purpose": {
|
|
351
|
+
"type": "string",
|
|
352
|
+
"minLength": 1,
|
|
353
|
+
"maxLength": 200,
|
|
354
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
355
|
+
},
|
|
356
|
+
"domains": {
|
|
357
|
+
"minItems": 1,
|
|
358
|
+
"type": "array",
|
|
359
|
+
"items": {
|
|
360
|
+
"type": "string"
|
|
361
|
+
},
|
|
362
|
+
"uniqueItems": true
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"required": [
|
|
366
|
+
"kind",
|
|
367
|
+
"id",
|
|
368
|
+
"purpose",
|
|
369
|
+
"domains"
|
|
370
|
+
],
|
|
371
|
+
"additionalProperties": false,
|
|
372
|
+
"description": "Dominios a los que el plugin podrá llamar (por la recepción). Solo el nombre: api.ejemplo.com."
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"type": "object",
|
|
376
|
+
"properties": {
|
|
377
|
+
"kind": {
|
|
378
|
+
"type": "string",
|
|
379
|
+
"const": "fields"
|
|
380
|
+
},
|
|
381
|
+
"id": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
384
|
+
"description": "Id estable del permiso (no cambiarlo entre versiones): así se sabe qué es nuevo al actualizar."
|
|
385
|
+
},
|
|
386
|
+
"purpose": {
|
|
387
|
+
"type": "string",
|
|
388
|
+
"minLength": 1,
|
|
389
|
+
"maxLength": 200,
|
|
390
|
+
"description": "Para qué lo quiere el plugin, en una frase: el admin lo lee antes de aceptar."
|
|
391
|
+
},
|
|
392
|
+
"fields": {
|
|
393
|
+
"type": "object",
|
|
394
|
+
"propertyNames": {
|
|
395
|
+
"type": "string"
|
|
396
|
+
},
|
|
397
|
+
"additionalProperties": {
|
|
398
|
+
"type": "object",
|
|
399
|
+
"properties": {
|
|
400
|
+
"type": {
|
|
401
|
+
"type": "string"
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"required": [
|
|
405
|
+
"type"
|
|
406
|
+
],
|
|
407
|
+
"additionalProperties": {}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"required": [
|
|
412
|
+
"kind",
|
|
413
|
+
"id",
|
|
414
|
+
"purpose",
|
|
415
|
+
"fields"
|
|
416
|
+
],
|
|
417
|
+
"additionalProperties": false,
|
|
418
|
+
"description": "Campos que el plugin añade a colecciones del proyecto que elija el admin; con el prefijo del plugin."
|
|
419
|
+
}
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
"additionalProperties": false
|
|
425
|
+
},
|
|
426
|
+
"model": {
|
|
427
|
+
"default": {
|
|
428
|
+
"collections": [],
|
|
429
|
+
"singleTypes": [],
|
|
430
|
+
"components": []
|
|
431
|
+
},
|
|
432
|
+
"description": "Colecciones, single types y componentes propios, con la gramática del modelo (JSON de pnpm model export).",
|
|
433
|
+
"type": "object",
|
|
434
|
+
"properties": {
|
|
435
|
+
"collections": {
|
|
436
|
+
"default": [],
|
|
437
|
+
"type": "array",
|
|
438
|
+
"items": {
|
|
439
|
+
"type": "object",
|
|
440
|
+
"properties": {
|
|
441
|
+
"apiId": {
|
|
442
|
+
"type": "string"
|
|
443
|
+
},
|
|
444
|
+
"fields": {
|
|
445
|
+
"type": "object",
|
|
446
|
+
"propertyNames": {
|
|
447
|
+
"type": "string"
|
|
448
|
+
},
|
|
449
|
+
"additionalProperties": {
|
|
450
|
+
"type": "object",
|
|
451
|
+
"properties": {
|
|
452
|
+
"type": {
|
|
453
|
+
"type": "string"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"required": [
|
|
457
|
+
"type"
|
|
458
|
+
],
|
|
459
|
+
"additionalProperties": {}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"required": [
|
|
464
|
+
"apiId"
|
|
465
|
+
],
|
|
466
|
+
"additionalProperties": {}
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"singleTypes": {
|
|
470
|
+
"default": [],
|
|
471
|
+
"type": "array",
|
|
472
|
+
"items": {
|
|
473
|
+
"type": "object",
|
|
474
|
+
"properties": {
|
|
475
|
+
"apiId": {
|
|
476
|
+
"type": "string"
|
|
477
|
+
},
|
|
478
|
+
"fields": {
|
|
479
|
+
"type": "object",
|
|
480
|
+
"propertyNames": {
|
|
481
|
+
"type": "string"
|
|
482
|
+
},
|
|
483
|
+
"additionalProperties": {
|
|
484
|
+
"type": "object",
|
|
485
|
+
"properties": {
|
|
486
|
+
"type": {
|
|
487
|
+
"type": "string"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
"required": [
|
|
491
|
+
"type"
|
|
492
|
+
],
|
|
493
|
+
"additionalProperties": {}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
"required": [
|
|
498
|
+
"apiId"
|
|
499
|
+
],
|
|
500
|
+
"additionalProperties": {}
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"components": {
|
|
504
|
+
"default": [],
|
|
505
|
+
"type": "array",
|
|
506
|
+
"items": {
|
|
507
|
+
"type": "object",
|
|
508
|
+
"properties": {
|
|
509
|
+
"apiId": {
|
|
510
|
+
"type": "string"
|
|
511
|
+
},
|
|
512
|
+
"fields": {
|
|
513
|
+
"type": "object",
|
|
514
|
+
"propertyNames": {
|
|
515
|
+
"type": "string"
|
|
516
|
+
},
|
|
517
|
+
"additionalProperties": {
|
|
518
|
+
"type": "object",
|
|
519
|
+
"properties": {
|
|
520
|
+
"type": {
|
|
521
|
+
"type": "string"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"required": [
|
|
525
|
+
"type"
|
|
526
|
+
],
|
|
527
|
+
"additionalProperties": {}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
"required": [
|
|
532
|
+
"apiId"
|
|
533
|
+
],
|
|
534
|
+
"additionalProperties": {}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
"additionalProperties": false
|
|
539
|
+
},
|
|
540
|
+
"settings": {
|
|
541
|
+
"default": [],
|
|
542
|
+
"description": "Ajustes que rellena el admin; los secret, cifrados.",
|
|
543
|
+
"type": "array",
|
|
544
|
+
"items": {
|
|
545
|
+
"type": "object",
|
|
546
|
+
"properties": {
|
|
547
|
+
"key": {
|
|
548
|
+
"type": "string",
|
|
549
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
550
|
+
"description": "Nombre del ajuste en el código (settings.get / secrets.get)."
|
|
551
|
+
},
|
|
552
|
+
"label": {
|
|
553
|
+
"type": "string",
|
|
554
|
+
"minLength": 1,
|
|
555
|
+
"maxLength": 60,
|
|
556
|
+
"description": "Nombre que ve el admin."
|
|
557
|
+
},
|
|
558
|
+
"description": {
|
|
559
|
+
"description": "Ayuda para el admin.",
|
|
560
|
+
"type": "string",
|
|
561
|
+
"minLength": 1,
|
|
562
|
+
"maxLength": 300
|
|
563
|
+
},
|
|
564
|
+
"type": {
|
|
565
|
+
"type": "string",
|
|
566
|
+
"enum": [
|
|
567
|
+
"text",
|
|
568
|
+
"number",
|
|
569
|
+
"boolean",
|
|
570
|
+
"select",
|
|
571
|
+
"secret"
|
|
572
|
+
],
|
|
573
|
+
"description": "secret: cifrado, nunca vuelve al navegador y solo lo lee el plugin en el servidor."
|
|
574
|
+
},
|
|
575
|
+
"required": {
|
|
576
|
+
"default": false,
|
|
577
|
+
"description": "El plugin no funciona sin él: el panel lo pide.",
|
|
578
|
+
"type": "boolean"
|
|
579
|
+
},
|
|
580
|
+
"default": {
|
|
581
|
+
"description": "Valor por defecto (no en un secreto).",
|
|
582
|
+
"anyOf": [
|
|
583
|
+
{
|
|
584
|
+
"type": "string"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"type": "number"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"type": "boolean"
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
"options": {
|
|
595
|
+
"description": "Solo en select: las opciones.",
|
|
596
|
+
"minItems": 1,
|
|
597
|
+
"type": "array",
|
|
598
|
+
"items": {
|
|
599
|
+
"type": "object",
|
|
600
|
+
"properties": {
|
|
601
|
+
"value": {
|
|
602
|
+
"type": "string",
|
|
603
|
+
"minLength": 1,
|
|
604
|
+
"maxLength": 100
|
|
605
|
+
},
|
|
606
|
+
"label": {
|
|
607
|
+
"type": "string",
|
|
608
|
+
"minLength": 1,
|
|
609
|
+
"maxLength": 100
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
"required": [
|
|
613
|
+
"value",
|
|
614
|
+
"label"
|
|
615
|
+
],
|
|
616
|
+
"additionalProperties": false
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
"required": [
|
|
621
|
+
"key",
|
|
622
|
+
"label",
|
|
623
|
+
"type"
|
|
624
|
+
],
|
|
625
|
+
"additionalProperties": false,
|
|
626
|
+
"description": "Un ajuste del plugin que rellena el admin."
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
"hooks": {
|
|
630
|
+
"default": [],
|
|
631
|
+
"description": "Hooks del plugin.",
|
|
632
|
+
"type": "array",
|
|
633
|
+
"items": {
|
|
634
|
+
"type": "object",
|
|
635
|
+
"properties": {
|
|
636
|
+
"id": {
|
|
637
|
+
"type": "string",
|
|
638
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
639
|
+
"description": "Nombre del hook en el código (hooks.<id>)."
|
|
640
|
+
},
|
|
641
|
+
"event": {
|
|
642
|
+
"type": "string",
|
|
643
|
+
"enum": [
|
|
644
|
+
"beforeCreate",
|
|
645
|
+
"beforeUpdate",
|
|
646
|
+
"beforeDelete",
|
|
647
|
+
"afterCreate",
|
|
648
|
+
"afterUpdate",
|
|
649
|
+
"afterDelete",
|
|
650
|
+
"afterPublish",
|
|
651
|
+
"afterUnpublish"
|
|
652
|
+
]
|
|
653
|
+
},
|
|
654
|
+
"on": {
|
|
655
|
+
"anyOf": [
|
|
656
|
+
{
|
|
657
|
+
"type": "object",
|
|
658
|
+
"properties": {
|
|
659
|
+
"permission": {
|
|
660
|
+
"type": "string",
|
|
661
|
+
"description": "Id de un permiso de contenido: las colecciones que elija el admin."
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
"required": [
|
|
665
|
+
"permission"
|
|
666
|
+
],
|
|
667
|
+
"additionalProperties": false
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"type": "object",
|
|
671
|
+
"properties": {
|
|
672
|
+
"collection": {
|
|
673
|
+
"type": "string",
|
|
674
|
+
"description": "Una colección o single type del propio plugin."
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
"required": [
|
|
678
|
+
"collection"
|
|
679
|
+
],
|
|
680
|
+
"additionalProperties": false
|
|
681
|
+
}
|
|
682
|
+
],
|
|
683
|
+
"description": "Sobre qué: { permission } (colecciones del proyecto que elija el admin) o { collection } (una suya)."
|
|
684
|
+
},
|
|
685
|
+
"onError": {
|
|
686
|
+
"description": "Solo en los \"antes\": si el hook falla, block impide guardar y allow deja guardar.",
|
|
687
|
+
"type": "string",
|
|
688
|
+
"enum": [
|
|
689
|
+
"block",
|
|
690
|
+
"allow"
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
"required": [
|
|
695
|
+
"id",
|
|
696
|
+
"event",
|
|
697
|
+
"on"
|
|
698
|
+
],
|
|
699
|
+
"additionalProperties": false,
|
|
700
|
+
"description": "Un hook: el motor llama a hooks.<id> del código."
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
"routes": {
|
|
704
|
+
"default": [],
|
|
705
|
+
"description": "Rutas propias en /api/plugins/<namespace>/…",
|
|
706
|
+
"type": "array",
|
|
707
|
+
"items": {
|
|
708
|
+
"type": "object",
|
|
709
|
+
"properties": {
|
|
710
|
+
"id": {
|
|
711
|
+
"type": "string",
|
|
712
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
713
|
+
"description": "Nombre de la ruta en el código (routes.<id>)."
|
|
714
|
+
},
|
|
715
|
+
"method": {
|
|
716
|
+
"type": "string",
|
|
717
|
+
"enum": [
|
|
718
|
+
"GET",
|
|
719
|
+
"POST",
|
|
720
|
+
"PUT",
|
|
721
|
+
"PATCH",
|
|
722
|
+
"DELETE"
|
|
723
|
+
]
|
|
724
|
+
},
|
|
725
|
+
"path": {
|
|
726
|
+
"type": "string",
|
|
727
|
+
"maxLength": 200,
|
|
728
|
+
"pattern": "^\\/$|^(?:\\/(?:[a-z0-9][a-z0-9-]*|:[a-z][a-zA-Z0-9]*))+$",
|
|
729
|
+
"description": "Bajo /api/plugins/<namespace>: / o tramos /algo y /:parametro."
|
|
730
|
+
},
|
|
731
|
+
"access": {
|
|
732
|
+
"type": "string",
|
|
733
|
+
"enum": [
|
|
734
|
+
"public",
|
|
735
|
+
"token"
|
|
736
|
+
],
|
|
737
|
+
"description": "public: cualquiera. token: un API token del proyecto con permiso para este plugin."
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
"required": [
|
|
741
|
+
"id",
|
|
742
|
+
"method",
|
|
743
|
+
"path",
|
|
744
|
+
"access"
|
|
745
|
+
],
|
|
746
|
+
"additionalProperties": false,
|
|
747
|
+
"description": "Una ruta propia en /api/plugins/<namespace>/…: el motor llama a routes.<id> del código."
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"tasks": {
|
|
751
|
+
"default": [],
|
|
752
|
+
"description": "Tareas programadas.",
|
|
753
|
+
"type": "array",
|
|
754
|
+
"items": {
|
|
755
|
+
"type": "object",
|
|
756
|
+
"properties": {
|
|
757
|
+
"id": {
|
|
758
|
+
"type": "string",
|
|
759
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
760
|
+
"description": "Nombre de la tarea en el código (tasks.<id>)."
|
|
761
|
+
},
|
|
762
|
+
"schedule": {
|
|
763
|
+
"type": "string",
|
|
764
|
+
"description": "Cuándo, en cron (minuto hora día-del-mes mes día-de-la-semana), en UTC. P. ej. \"*/15 * * * *\"."
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"required": [
|
|
768
|
+
"id",
|
|
769
|
+
"schedule"
|
|
770
|
+
],
|
|
771
|
+
"additionalProperties": false,
|
|
772
|
+
"description": "Una tarea programada: el motor llama a tasks.<id> del código."
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
"panel": {
|
|
776
|
+
"default": {
|
|
777
|
+
"permissions": [],
|
|
778
|
+
"nav": [],
|
|
779
|
+
"screens": [],
|
|
780
|
+
"widgets": [],
|
|
781
|
+
"actions": []
|
|
782
|
+
},
|
|
783
|
+
"type": "object",
|
|
784
|
+
"properties": {
|
|
785
|
+
"permissions": {
|
|
786
|
+
"default": [],
|
|
787
|
+
"type": "array",
|
|
788
|
+
"items": {
|
|
789
|
+
"type": "object",
|
|
790
|
+
"properties": {
|
|
791
|
+
"id": {
|
|
792
|
+
"type": "string",
|
|
793
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
794
|
+
"description": "Id del permiso (lo piden sus pantallas, widgets y acciones)."
|
|
795
|
+
},
|
|
796
|
+
"label": {
|
|
797
|
+
"type": "string",
|
|
798
|
+
"minLength": 1,
|
|
799
|
+
"maxLength": 80,
|
|
800
|
+
"description": "Nombre en Ajustes → Roles."
|
|
801
|
+
},
|
|
802
|
+
"description": {
|
|
803
|
+
"description": "Qué deja hacer, en Roles.",
|
|
804
|
+
"type": "string",
|
|
805
|
+
"minLength": 1,
|
|
806
|
+
"maxLength": 300
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
"required": [
|
|
810
|
+
"id",
|
|
811
|
+
"label"
|
|
812
|
+
],
|
|
813
|
+
"additionalProperties": false,
|
|
814
|
+
"description": "Un permiso del panel del plugin: sale en Ajustes → Roles; el admin lo tiene siempre."
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
"nav": {
|
|
818
|
+
"default": [],
|
|
819
|
+
"type": "array",
|
|
820
|
+
"items": {
|
|
821
|
+
"type": "object",
|
|
822
|
+
"properties": {
|
|
823
|
+
"id": {
|
|
824
|
+
"type": "string",
|
|
825
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$"
|
|
826
|
+
},
|
|
827
|
+
"label": {
|
|
828
|
+
"type": "string",
|
|
829
|
+
"minLength": 1,
|
|
830
|
+
"maxLength": 60,
|
|
831
|
+
"description": "Texto del enlace."
|
|
832
|
+
},
|
|
833
|
+
"screen": {
|
|
834
|
+
"type": "string",
|
|
835
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
836
|
+
"description": "La pantalla a la que lleva (panel.screens)."
|
|
837
|
+
},
|
|
838
|
+
"area": {
|
|
839
|
+
"default": "content",
|
|
840
|
+
"description": "Dónde: content, en el apartado del plugin del panel de Contenido; settings, en Ajustes.",
|
|
841
|
+
"type": "string",
|
|
842
|
+
"enum": [
|
|
843
|
+
"content",
|
|
844
|
+
"settings"
|
|
845
|
+
]
|
|
846
|
+
},
|
|
847
|
+
"permission": {
|
|
848
|
+
"description": "Permiso del plugin que hace falta para verlo.",
|
|
849
|
+
"type": "string",
|
|
850
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$"
|
|
851
|
+
}
|
|
852
|
+
},
|
|
853
|
+
"required": [
|
|
854
|
+
"id",
|
|
855
|
+
"label",
|
|
856
|
+
"screen"
|
|
857
|
+
],
|
|
858
|
+
"additionalProperties": false,
|
|
859
|
+
"description": "Una entrada de la barra lateral."
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
"screens": {
|
|
863
|
+
"default": [],
|
|
864
|
+
"type": "array",
|
|
865
|
+
"items": {
|
|
866
|
+
"type": "object",
|
|
867
|
+
"properties": {
|
|
868
|
+
"id": {
|
|
869
|
+
"type": "string",
|
|
870
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
871
|
+
"description": "Nombre de la pantalla en ui.js (screens.<id>)."
|
|
872
|
+
},
|
|
873
|
+
"title": {
|
|
874
|
+
"type": "string",
|
|
875
|
+
"minLength": 1,
|
|
876
|
+
"maxLength": 80,
|
|
877
|
+
"description": "Título de la pantalla."
|
|
878
|
+
},
|
|
879
|
+
"permission": {
|
|
880
|
+
"type": "string",
|
|
881
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$"
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
"required": [
|
|
885
|
+
"id",
|
|
886
|
+
"title"
|
|
887
|
+
],
|
|
888
|
+
"additionalProperties": false,
|
|
889
|
+
"description": "Una pantalla propia: la pinta ui.js con los componentes de Surnie."
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
"widgets": {
|
|
893
|
+
"default": [],
|
|
894
|
+
"type": "array",
|
|
895
|
+
"items": {
|
|
896
|
+
"type": "object",
|
|
897
|
+
"properties": {
|
|
898
|
+
"id": {
|
|
899
|
+
"type": "string",
|
|
900
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
901
|
+
"description": "Nombre del widget en ui.js (widgets.<id>)."
|
|
902
|
+
},
|
|
903
|
+
"title": {
|
|
904
|
+
"type": "string",
|
|
905
|
+
"minLength": 1,
|
|
906
|
+
"maxLength": 60
|
|
907
|
+
},
|
|
908
|
+
"size": {
|
|
909
|
+
"default": "m",
|
|
910
|
+
"description": "Tamaño en el dashboard: s, m, l o w.",
|
|
911
|
+
"type": "string",
|
|
912
|
+
"enum": [
|
|
913
|
+
"s",
|
|
914
|
+
"m",
|
|
915
|
+
"l",
|
|
916
|
+
"w"
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
"permission": {
|
|
920
|
+
"type": "string",
|
|
921
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$"
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
"required": [
|
|
925
|
+
"id",
|
|
926
|
+
"title"
|
|
927
|
+
],
|
|
928
|
+
"additionalProperties": false,
|
|
929
|
+
"description": "Un widget del dashboard."
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"actions": {
|
|
933
|
+
"default": [],
|
|
934
|
+
"type": "array",
|
|
935
|
+
"items": {
|
|
936
|
+
"type": "object",
|
|
937
|
+
"properties": {
|
|
938
|
+
"id": {
|
|
939
|
+
"type": "string",
|
|
940
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$",
|
|
941
|
+
"description": "Nombre de la acción en server.js (actions.<id>)."
|
|
942
|
+
},
|
|
943
|
+
"label": {
|
|
944
|
+
"type": "string",
|
|
945
|
+
"minLength": 1,
|
|
946
|
+
"maxLength": 40,
|
|
947
|
+
"description": "Texto del botón."
|
|
948
|
+
},
|
|
949
|
+
"on": {
|
|
950
|
+
"anyOf": [
|
|
951
|
+
{
|
|
952
|
+
"type": "object",
|
|
953
|
+
"properties": {
|
|
954
|
+
"collection": {
|
|
955
|
+
"type": "string",
|
|
956
|
+
"description": "Una colección del plugin."
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
"required": [
|
|
960
|
+
"collection"
|
|
961
|
+
],
|
|
962
|
+
"additionalProperties": false
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
"type": "object",
|
|
966
|
+
"properties": {
|
|
967
|
+
"permission": {
|
|
968
|
+
"type": "string",
|
|
969
|
+
"description": "Un permiso de contenido: las colecciones que el admin le concedió."
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
"required": [
|
|
973
|
+
"permission"
|
|
974
|
+
],
|
|
975
|
+
"additionalProperties": false
|
|
976
|
+
}
|
|
977
|
+
],
|
|
978
|
+
"description": "Sobre qué colecciones sale."
|
|
979
|
+
},
|
|
980
|
+
"scope": {
|
|
981
|
+
"default": "record",
|
|
982
|
+
"description": "record: en la ficha de un registro; list: sobre los marcados en el listado.",
|
|
983
|
+
"type": "string",
|
|
984
|
+
"enum": [
|
|
985
|
+
"record",
|
|
986
|
+
"list"
|
|
987
|
+
]
|
|
988
|
+
},
|
|
989
|
+
"permission": {
|
|
990
|
+
"type": "string",
|
|
991
|
+
"pattern": "^[a-z][a-zA-Z0-9]{0,39}$"
|
|
992
|
+
},
|
|
993
|
+
"confirm": {
|
|
994
|
+
"description": "Si la lleva, se pide confirmar con este texto antes de ejecutarla.",
|
|
995
|
+
"type": "string",
|
|
996
|
+
"minLength": 1,
|
|
997
|
+
"maxLength": 200
|
|
998
|
+
},
|
|
999
|
+
"tone": {
|
|
1000
|
+
"default": "default",
|
|
1001
|
+
"type": "string",
|
|
1002
|
+
"enum": [
|
|
1003
|
+
"default",
|
|
1004
|
+
"danger"
|
|
1005
|
+
]
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
"required": [
|
|
1009
|
+
"id",
|
|
1010
|
+
"label",
|
|
1011
|
+
"on"
|
|
1012
|
+
],
|
|
1013
|
+
"additionalProperties": false,
|
|
1014
|
+
"description": "Una acción (un botón) sobre registros: la ejecuta server.js (actions.<id>)."
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
"additionalProperties": false,
|
|
1019
|
+
"description": "Lo que el plugin añade al panel (docs/plugins.md §6.2)."
|
|
1020
|
+
},
|
|
1021
|
+
"defaultLocale": {
|
|
1022
|
+
"description": "El idioma de las traducciones que vale si falta una clave en otro. Obligatorio si algún texto es una clave (%clave%).",
|
|
1023
|
+
"type": "string",
|
|
1024
|
+
"pattern": "^[a-z]{2}(-[A-Z]{2})?$"
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
"required": [
|
|
1028
|
+
"contract",
|
|
1029
|
+
"namespace",
|
|
1030
|
+
"name",
|
|
1031
|
+
"description",
|
|
1032
|
+
"version"
|
|
1033
|
+
],
|
|
1034
|
+
"additionalProperties": false
|
|
1035
|
+
}
|