@forgenex/cli 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.
@@ -0,0 +1,1188 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://forgenex.com/sdk/solucion-v2.schema.json",
4
+ "title": "Solución del CRM ForgeNEX",
5
+ "description": "Formato «forgenex.solucion», versión 2. Valida la forma; «forgenex-sdk validar» valida todo (el mismo validador que el CRM).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "formato",
10
+ "version",
11
+ "nombre",
12
+ "modulos"
13
+ ],
14
+ "properties": {
15
+ "formato": {
16
+ "const": "forgenex.solucion"
17
+ },
18
+ "version": {
19
+ "type": "integer",
20
+ "minimum": 1,
21
+ "maximum": 2,
22
+ "description": "Versión del FORMATO (el CRM lee esta y las anteriores)."
23
+ },
24
+ "plantilla": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": [
28
+ "id",
29
+ "version",
30
+ "sector"
31
+ ],
32
+ "properties": {
33
+ "id": {
34
+ "type": "string",
35
+ "pattern": "^[a-z][a-z0-9_]{0,59}$"
36
+ },
37
+ "version": {
38
+ "type": "integer",
39
+ "minimum": 1
40
+ },
41
+ "sector": {
42
+ "type": "string",
43
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
44
+ },
45
+ "nivel": {
46
+ "enum": [
47
+ "completa",
48
+ "basica"
49
+ ]
50
+ }
51
+ }
52
+ },
53
+ "nombre": {
54
+ "type": "string",
55
+ "maxLength": 80
56
+ },
57
+ "descripcion": {
58
+ "type": "string",
59
+ "maxLength": 500
60
+ },
61
+ "icono": {
62
+ "type": "string",
63
+ "pattern": "^[a-z0-9-]{1,40}$"
64
+ },
65
+ "modulos": {
66
+ "type": "array",
67
+ "minItems": 1,
68
+ "maxItems": 30,
69
+ "items": {
70
+ "type": "object",
71
+ "required": [
72
+ "clave",
73
+ "nombre",
74
+ "nombre_plural",
75
+ "campos"
76
+ ],
77
+ "properties": {
78
+ "clave": {
79
+ "type": "string",
80
+ "pattern": "^[a-z][a-z_]{1,40}$"
81
+ },
82
+ "nombre": {
83
+ "type": "string",
84
+ "maxLength": 60
85
+ },
86
+ "nombre_plural": {
87
+ "type": "string",
88
+ "maxLength": 60
89
+ },
90
+ "articulo": {
91
+ "enum": [
92
+ "un",
93
+ "una",
94
+ null
95
+ ]
96
+ },
97
+ "descripcion": {
98
+ "type": "string",
99
+ "maxLength": 500
100
+ },
101
+ "icono": {
102
+ "enum": [
103
+ "box",
104
+ "boxes",
105
+ "package",
106
+ "folder",
107
+ "folder-open",
108
+ "file-text",
109
+ "clipboard-list",
110
+ "list-checks",
111
+ "calendar",
112
+ "calendar-days",
113
+ "clock",
114
+ "map-pin",
115
+ "truck",
116
+ "car",
117
+ "wrench",
118
+ "hammer",
119
+ "hard-hat",
120
+ "building",
121
+ "home",
122
+ "store",
123
+ "warehouse",
124
+ "factory",
125
+ "briefcase",
126
+ "shopping-cart",
127
+ "receipt",
128
+ "wallet",
129
+ "credit-card",
130
+ "piggy-bank",
131
+ "tag",
132
+ "tags",
133
+ "star",
134
+ "heart",
135
+ "flag",
136
+ "bookmark",
137
+ "user",
138
+ "users",
139
+ "graduation-cap",
140
+ "stethoscope",
141
+ "pill",
142
+ "utensils",
143
+ "coffee",
144
+ "shirt",
145
+ "camera",
146
+ "image",
147
+ "monitor",
148
+ "smartphone",
149
+ "server",
150
+ "database",
151
+ "key",
152
+ "shield",
153
+ "leaf",
154
+ "paw-print",
155
+ "dumbbell",
156
+ "ticket",
157
+ "gift",
158
+ "megaphone",
159
+ "mail",
160
+ "phone",
161
+ "message-square"
162
+ ]
163
+ },
164
+ "campos": {
165
+ "type": "array",
166
+ "maxItems": 200,
167
+ "items": {
168
+ "type": "object",
169
+ "required": [
170
+ "clave",
171
+ "etiqueta",
172
+ "tipo"
173
+ ],
174
+ "properties": {
175
+ "clave": {
176
+ "type": "string"
177
+ },
178
+ "etiqueta": {
179
+ "type": "string",
180
+ "maxLength": 80
181
+ },
182
+ "tipo": {
183
+ "enum": [
184
+ "texto",
185
+ "texto_largo",
186
+ "numero",
187
+ "importe",
188
+ "fecha",
189
+ "fecha_hora",
190
+ "booleano",
191
+ "seleccion",
192
+ "seleccion_multiple",
193
+ "etiquetas",
194
+ "url",
195
+ "correo",
196
+ "telefono",
197
+ "relacion",
198
+ "archivos",
199
+ "busqueda",
200
+ "resumen",
201
+ "duracion",
202
+ "hecho",
203
+ "porcentaje",
204
+ "valoracion",
205
+ "contador",
206
+ "cronometro",
207
+ "secreto",
208
+ "color",
209
+ "ubicacion",
210
+ "checklist",
211
+ "codigo",
212
+ "firma",
213
+ "hora",
214
+ "articulo",
215
+ "creado_el",
216
+ "creado_por",
217
+ "modificado_el",
218
+ "modificado_por",
219
+ "autonumero",
220
+ "formula",
221
+ "subtabla",
222
+ "boton",
223
+ "qr"
224
+ ]
225
+ },
226
+ "formulaNativa": {
227
+ "type": "string",
228
+ "maxLength": 4000
229
+ },
230
+ "defectoNativo": {
231
+ "type": "string",
232
+ "maxLength": 4000
233
+ },
234
+ "completarNativo": {
235
+ "type": [
236
+ "object",
237
+ "null"
238
+ ],
239
+ "description": "Variante compilada de una copia nativa personalizada, sin alterar el autocompletado histórico."
240
+ },
241
+ "ajustesNativos": {
242
+ "type": "object",
243
+ "additionalProperties": false,
244
+ "properties": {
245
+ "contacts": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "properties": {
249
+ "etiqueta": {},
250
+ "ayuda": {},
251
+ "enTabla": {},
252
+ "obligatorio": {},
253
+ "visibleSi": {},
254
+ "obligatorioSi": {},
255
+ "permisos": {},
256
+ "siVacio": {},
257
+ "completarDesde": {}
258
+ }
259
+ },
260
+ "companies": {
261
+ "type": "object",
262
+ "additionalProperties": false,
263
+ "properties": {
264
+ "etiqueta": {},
265
+ "ayuda": {},
266
+ "enTabla": {},
267
+ "obligatorio": {},
268
+ "visibleSi": {},
269
+ "obligatorioSi": {},
270
+ "permisos": {},
271
+ "siVacio": {},
272
+ "completarDesde": {}
273
+ }
274
+ }
275
+ }
276
+ },
277
+ "siVacio": {
278
+ "type": "string",
279
+ "pattern": "^[a-z][a-z0-9_]{0,40}$",
280
+ "description": "Búsqueda escalar alternativa del mismo tipo, sin cadenas, si el valor es nulo o texto vacío. Conserva RLS y máscaras de ambos caminos."
281
+ },
282
+ "completarDesde": {
283
+ "type": "object",
284
+ "additionalProperties": false,
285
+ "required": [
286
+ "relacion",
287
+ "campo"
288
+ ],
289
+ "properties": {
290
+ "relacion": {
291
+ "type": "string",
292
+ "pattern": "^[a-z][a-z0-9_]{0,40}$"
293
+ },
294
+ "campo": {
295
+ "type": "string",
296
+ "pattern": "^[a-z][a-z0-9_.]{0,80}$"
297
+ },
298
+ "alternativa": {
299
+ "type": "object",
300
+ "additionalProperties": false,
301
+ "required": [
302
+ "relacion",
303
+ "campo"
304
+ ],
305
+ "properties": {
306
+ "relacion": {
307
+ "type": "string",
308
+ "pattern": "^[a-z][a-z0-9_]{0,40}$"
309
+ },
310
+ "campo": {
311
+ "type": "string",
312
+ "pattern": "^[a-z][a-z0-9_.]{0,80}$"
313
+ }
314
+ }
315
+ }
316
+ },
317
+ "description": "Copia al destino vacío un campo del mismo tipo desde una relación, con permisos de fila y campo. Un origen múltiple exige relación destino múltiple; el portal solo copia campos de sus secciones visibles."
318
+ }
319
+ }
320
+ }
321
+ },
322
+ "paginas": {
323
+ "type": "boolean"
324
+ },
325
+ "ficha": {
326
+ "type": "object"
327
+ },
328
+ "impresion": {
329
+ "type": "object"
330
+ },
331
+ "validaciones": {
332
+ "type": "array"
333
+ },
334
+ "vistas": {
335
+ "type": "array"
336
+ },
337
+ "funcionesNativas": {
338
+ "type": "object",
339
+ "additionalProperties": false,
340
+ "properties": {
341
+ "relacionadas": {
342
+ "type": "array",
343
+ "maxItems": 20
344
+ },
345
+ "siguientes": {
346
+ "type": "array",
347
+ "maxItems": 5
348
+ }
349
+ }
350
+ },
351
+ "recurso": {
352
+ "type": "object",
353
+ "description": "Sus registros son recursos (capacidad, persona): ver la guía, «Recursos y reservas»."
354
+ },
355
+ "reserva": {
356
+ "type": "object",
357
+ "description": "Cada registro ocupa un recurso (puntual o semanal): ver la guía, «Recursos y reservas»."
358
+ },
359
+ "asignacion": {
360
+ "type": "object",
361
+ "description": "«Asignar al mejor con hueco» (en la demanda): ver la guía, «Asignar con cupo y puntos»."
362
+ },
363
+ "pertenencia": {
364
+ "type": "object",
365
+ "description": "Un módulo de pertenencias (demanda, oferta, desde, hasta, correccion_dias): ver la guía."
366
+ },
367
+ "stock": {
368
+ "type": "object",
369
+ "description": "El stock: artículo (con lotes o series), ubicación, documento que lo mueve (entrada, salida, ajuste, traspaso, recuento, reserva) y punto de pedido (con lo que está en camino): ver la guía, «Stock»."
370
+ },
371
+ "liquidacion": {
372
+ "type": "object",
373
+ "description": "Liquidaciones de comisiones (en el módulo de liquidaciones): origen, importe, fecha, agente, reglas con tramos y dónde va cada cosa: ver la guía, «Liquidaciones»."
374
+ },
375
+ "cuota": {
376
+ "type": "object",
377
+ "description": "Cuotas periódicas por registro: {proxima: fecha, periodicidad: semanal|quincenal|mensual|bimestral|trimestral|semestral|anual o {campo, valores}, hasta?: fecha}: ver la guía, «Cuotas»."
378
+ },
379
+ "relacionadas": {
380
+ "type": "array",
381
+ "maxItems": 20,
382
+ "description": "Columnas de OTROS módulos en la tabla (se calculan al leer, con lo que ve quien mira): {clave, etiqueta, via, campo} trae un campo del relacionado (editable desde la tabla); {clave, etiqueta, de, via, calculo: recuento|suma|media|minimo|maximo|ultimo, campo?, filtro?} calcula sobre los que citan a este.",
383
+ "items": {
384
+ "type": "object",
385
+ "additionalProperties": false,
386
+ "required": [
387
+ "clave",
388
+ "etiqueta",
389
+ "via"
390
+ ],
391
+ "properties": {
392
+ "clave": {
393
+ "type": "string",
394
+ "pattern": "^[a-z][a-z0-9_]{0,40}$"
395
+ },
396
+ "etiqueta": {
397
+ "type": "string",
398
+ "maxLength": 80
399
+ },
400
+ "via": {
401
+ "type": "string"
402
+ },
403
+ "siVacio": {
404
+ "type": "string",
405
+ "description": "Otra columna de traer escalar del mismo tipo, sin cadenas. Conserva el origen de edición por fila."
406
+ },
407
+ "campo": {
408
+ "type": "string"
409
+ },
410
+ "de": {
411
+ "type": "string"
412
+ },
413
+ "calculo": {
414
+ "enum": [
415
+ "recuento",
416
+ "suma",
417
+ "minimo",
418
+ "maximo",
419
+ "ultimo",
420
+ "media"
421
+ ]
422
+ },
423
+ "filtro": {
424
+ "type": "array",
425
+ "maxItems": 5
426
+ }
427
+ }
428
+ }
429
+ },
430
+ "siguientes": {
431
+ "type": "array",
432
+ "maxItems": 5,
433
+ "description": "Siguientes pasos del proceso: un botón que crea el registro siguiente en «destino» (mod_<clave>), enlazado por «enlace» (la relación del destino a este) y con «campos» copiados {campo del destino: campo de aquí}.",
434
+ "items": {
435
+ "type": "object",
436
+ "additionalProperties": false,
437
+ "required": [
438
+ "clave",
439
+ "nombre",
440
+ "destino",
441
+ "enlace"
442
+ ],
443
+ "properties": {
444
+ "clave": {
445
+ "type": "string",
446
+ "pattern": "^[a-z][a-z0-9_]{0,40}$"
447
+ },
448
+ "nombre": {
449
+ "type": "string",
450
+ "maxLength": 60
451
+ },
452
+ "destino": {
453
+ "type": "string",
454
+ "pattern": "^mod_[a-z][a-z0-9_]{0,40}$"
455
+ },
456
+ "enlace": {
457
+ "type": "string"
458
+ },
459
+ "campos": {
460
+ "type": "object",
461
+ "additionalProperties": {
462
+ "type": "string"
463
+ }
464
+ }
465
+ }
466
+ }
467
+ },
468
+ "personas": {
469
+ "type": "object",
470
+ "additionalProperties": false,
471
+ "required": [
472
+ "objeto",
473
+ "tipo",
474
+ "etiqueta",
475
+ "plural",
476
+ "icono",
477
+ "campos"
478
+ ],
479
+ "properties": {
480
+ "objeto": {
481
+ "enum": [
482
+ "contacts",
483
+ "companies"
484
+ ]
485
+ },
486
+ "tipo": {
487
+ "type": "string",
488
+ "pattern": "^[a-z0-9][a-z0-9-]{0,59}$"
489
+ },
490
+ "de": {
491
+ "enum": [
492
+ "cliente",
493
+ "proveedor"
494
+ ]
495
+ },
496
+ "etiqueta": {
497
+ "type": "string",
498
+ "minLength": 1,
499
+ "maxLength": 60
500
+ },
501
+ "plural": {
502
+ "type": "string",
503
+ "minLength": 1,
504
+ "maxLength": 60
505
+ },
506
+ "icono": {
507
+ "type": "string",
508
+ "pattern": "^[a-z0-9-]{1,40}$"
509
+ },
510
+ "campos": {
511
+ "type": "object",
512
+ "minProperties": 1,
513
+ "additionalProperties": {
514
+ "type": "string"
515
+ }
516
+ },
517
+ "configuracion": {
518
+ "type": "object",
519
+ "additionalProperties": false,
520
+ "description": "Ficha, impresión, columnas relacionadas y siguientes por objeto. Claves de origen de la solución, sin ids del espacio.",
521
+ "properties": {
522
+ "contacts": {
523
+ "type": "object",
524
+ "additionalProperties": false,
525
+ "properties": {
526
+ "ficha": {
527
+ "type": [
528
+ "object",
529
+ "null"
530
+ ]
531
+ },
532
+ "impresion": {
533
+ "type": [
534
+ "object",
535
+ "null"
536
+ ]
537
+ },
538
+ "relacionadas": {
539
+ "type": [
540
+ "array",
541
+ "null"
542
+ ]
543
+ },
544
+ "siguientes": {
545
+ "type": [
546
+ "array",
547
+ "null"
548
+ ]
549
+ }
550
+ }
551
+ },
552
+ "companies": {
553
+ "type": "object",
554
+ "additionalProperties": false,
555
+ "properties": {
556
+ "ficha": {
557
+ "type": [
558
+ "object",
559
+ "null"
560
+ ]
561
+ },
562
+ "impresion": {
563
+ "type": [
564
+ "object",
565
+ "null"
566
+ ]
567
+ },
568
+ "relacionadas": {
569
+ "type": [
570
+ "array",
571
+ "null"
572
+ ]
573
+ },
574
+ "siguientes": {
575
+ "type": [
576
+ "array",
577
+ "null"
578
+ ]
579
+ }
580
+ }
581
+ }
582
+ }
583
+ },
584
+ "alternativa": {
585
+ "type": "object",
586
+ "additionalProperties": false,
587
+ "required": [
588
+ "objeto",
589
+ "campos"
590
+ ],
591
+ "description": "Segundo destino separado. El principal es contacts; cada relación se expande en su clave de Persona y <clave>_empresa. No es una relación polimórfica.",
592
+ "properties": {
593
+ "objeto": {
594
+ "const": "companies"
595
+ },
596
+ "campos": {
597
+ "type": "object",
598
+ "minProperties": 1,
599
+ "additionalProperties": {
600
+ "type": "string"
601
+ }
602
+ },
603
+ "conversiones": {
604
+ "type": "object",
605
+ "additionalProperties": {
606
+ "type": "object",
607
+ "additionalProperties": {
608
+ "type": "string"
609
+ }
610
+ }
611
+ }
612
+ }
613
+ },
614
+ "clasificacion": {
615
+ "type": "object",
616
+ "additionalProperties": false,
617
+ "required": [
618
+ "campo",
619
+ "valores"
620
+ ],
621
+ "description": "Todas las opciones de una selección, o true/false de un booleano, a contacts/companies. vacio decide explícitamente el valor ausente. Nunca se adivina por nombre o identificador.",
622
+ "properties": {
623
+ "campo": {
624
+ "type": "string"
625
+ },
626
+ "valores": {
627
+ "type": "object",
628
+ "minProperties": 2,
629
+ "additionalProperties": {
630
+ "enum": [
631
+ "contacts",
632
+ "companies"
633
+ ]
634
+ }
635
+ },
636
+ "vacio": {
637
+ "enum": [
638
+ "contacts",
639
+ "companies"
640
+ ]
641
+ },
642
+ "formas": {
643
+ "type": "object",
644
+ "description": "Opciones de Empresa a claves de legalForms. Conserva etiqueta y color de la opción histórica, sin pisar listas existentes.",
645
+ "additionalProperties": {
646
+ "type": "string",
647
+ "pattern": "^[a-z0-9][a-z0-9-]{0,59}$"
648
+ }
649
+ },
650
+ "etiquetas": {
651
+ "type": "array",
652
+ "uniqueItems": true,
653
+ "description": "Opciones de Persona que conservan su significado como etiqueta, con nombre y color de la opción histórica.",
654
+ "items": {
655
+ "type": "string"
656
+ }
657
+ }
658
+ }
659
+ },
660
+ "conversiones": {
661
+ "type": "object",
662
+ "description": "Mapa completo e inyectivo de opciones históricas a claves nativas de sector o forma jurídica. Conserva etiquetas/colores del campo. No clasifica objetos.",
663
+ "additionalProperties": {
664
+ "type": "object",
665
+ "minProperties": 1,
666
+ "maxProperties": 100,
667
+ "additionalProperties": {
668
+ "type": "string",
669
+ "minLength": 1,
670
+ "maxLength": 80
671
+ }
672
+ }
673
+ }
674
+ }
675
+ }
676
+ }
677
+ }
678
+ },
679
+ "vistasTabla": {
680
+ "type": "array",
681
+ "maxItems": 20,
682
+ "items": {
683
+ "type": "object",
684
+ "additionalProperties": false,
685
+ "required": [
686
+ "objeto",
687
+ "nombre",
688
+ "disposicion"
689
+ ],
690
+ "properties": {
691
+ "objeto": {
692
+ "type": "string",
693
+ "pattern": "^(contacts|companies|mod_[a-z][a-z0-9_]{0,40})$"
694
+ },
695
+ "tipoContacto": {
696
+ "type": "string",
697
+ "pattern": "^[a-z0-9][a-z0-9-]{0,59}$"
698
+ },
699
+ "nombre": {
700
+ "type": "string",
701
+ "maxLength": 60
702
+ },
703
+ "config": {
704
+ "type": "object"
705
+ },
706
+ "disposicion": {
707
+ "type": [
708
+ "object",
709
+ "null"
710
+ ]
711
+ }
712
+ }
713
+ },
714
+ "description": "Vistas por objeto/tipo con preferencias y widgets. Un módulo omitido con dos destinos crea una vista por objeto. Actualización aditiva sin reponer bajas ni pisar personalizaciones."
715
+ },
716
+ "separadores": {
717
+ "type": "array",
718
+ "maxItems": 20,
719
+ "items": {
720
+ "type": "object",
721
+ "additionalProperties": false,
722
+ "required": [
723
+ "antes"
724
+ ],
725
+ "properties": {
726
+ "antes": {
727
+ "type": [
728
+ "string",
729
+ "null"
730
+ ],
731
+ "description": "Clave de módulo de la solución, o null al final. Si se omite el módulo, se conserva delante del siguiente módulo real."
732
+ },
733
+ "titulo": {
734
+ "type": [
735
+ "string",
736
+ "null"
737
+ ],
738
+ "maxLength": 40
739
+ }
740
+ }
741
+ }
742
+ },
743
+ "paneles": {
744
+ "type": "array",
745
+ "maxItems": 10,
746
+ "description": "Paneles de métricas (número, barras, barras horizontales/apiladas/agrupadas, líneas, área, varias líneas, dona, embudo, medidor con meta, tendencia, tabla, tabla dinámica, mapa de calor; cálculos de recuento, suma, media, min, max, mediana, % del total, acumulado, tasa de conversión, media por)."
747
+ },
748
+ "automatizaciones": {
749
+ "type": "array",
750
+ "maxItems": 40,
751
+ "description": "Se instalan APAGADAS: una persona las revisa y las enciende."
752
+ },
753
+ "ejemplos": {
754
+ "type": "object",
755
+ "description": "Datos de ejemplo por clave de módulo (hasta 50 cada uno).",
756
+ "additionalProperties": {
757
+ "type": "array",
758
+ "maxItems": 50
759
+ }
760
+ },
761
+ "informes": {
762
+ "type": "array",
763
+ "maxItems": 30,
764
+ "description": "Informes de Análisis que se crean al publicar (de equipo).",
765
+ "items": {
766
+ "type": "object",
767
+ "additionalProperties": false,
768
+ "required": [
769
+ "nombre",
770
+ "definicion"
771
+ ],
772
+ "properties": {
773
+ "nombre": {
774
+ "type": "string",
775
+ "maxLength": 80
776
+ },
777
+ "descripcion": {
778
+ "type": "string",
779
+ "maxLength": 500
780
+ },
781
+ "definicion": {
782
+ "type": "object"
783
+ }
784
+ }
785
+ }
786
+ },
787
+ "principal": {
788
+ "type": "string",
789
+ "description": "La clave de su módulo PRINCIPAL (ahí se abre el importador al acabar la bienvenida)."
790
+ },
791
+ "mensajes": {
792
+ "type": "array",
793
+ "maxItems": 50,
794
+ "description": "Plantillas de mensaje (WhatsApp o correo) de sus módulos (mod_<clave>) o de contacts, companies y deals.",
795
+ "items": {
796
+ "type": "object",
797
+ "additionalProperties": false,
798
+ "required": [
799
+ "recurso",
800
+ "canal",
801
+ "nombre",
802
+ "texto"
803
+ ],
804
+ "properties": {
805
+ "recurso": {
806
+ "type": "string"
807
+ },
808
+ "tipoContacto": {
809
+ "type": "string",
810
+ "pattern": "^[a-z0-9][a-z0-9-]{0,59}$",
811
+ "description": "Ámbito opcional de una plantilla de Personas o Empresas."
812
+ },
813
+ "canal": {
814
+ "enum": [
815
+ "whatsapp",
816
+ "correo"
817
+ ]
818
+ },
819
+ "nombre": {
820
+ "type": "string",
821
+ "maxLength": 80
822
+ },
823
+ "asunto": {
824
+ "type": "string",
825
+ "maxLength": 300
826
+ },
827
+ "texto": {
828
+ "type": "string",
829
+ "maxLength": 5000
830
+ }
831
+ }
832
+ }
833
+ },
834
+ "papeles": {
835
+ "type": "array",
836
+ "maxItems": 10,
837
+ "description": "Papeles personalizados que se crean al publicar: a partir de uno de serie, con permisos de la matriz o de sus módulos (mod_<clave>.ver|editar|borrar|exportar). Nunca gestionar miembros ni la configuración.",
838
+ "items": {
839
+ "type": "object",
840
+ "additionalProperties": false,
841
+ "required": [
842
+ "nombre",
843
+ "base"
844
+ ],
845
+ "properties": {
846
+ "nombre": {
847
+ "type": "string",
848
+ "maxLength": 40
849
+ },
850
+ "base": {
851
+ "enum": [
852
+ "administrador",
853
+ "miembro",
854
+ "lectura"
855
+ ]
856
+ },
857
+ "permisos": {
858
+ "type": "object",
859
+ "additionalProperties": {
860
+ "enum": [
861
+ "si",
862
+ "no",
863
+ "suyos"
864
+ ]
865
+ }
866
+ }
867
+ }
868
+ }
869
+ },
870
+ "portales": {
871
+ "type": "array",
872
+ "maxItems": 10,
873
+ "description": "PORTALES (P15): personas de fuera (clientes, propietarios, huéspedes, familias, trabajadores) que entran con su usuario y ven SOLO lo alcanzable desde su ficha. Se crean al publicar, DESACTIVADOS (los activa una persona). Ver la guía, «Portal».",
874
+ "items": {
875
+ "type": "object",
876
+ "additionalProperties": false,
877
+ "required": [
878
+ "clave",
879
+ "nombre",
880
+ "personas",
881
+ "secciones"
882
+ ],
883
+ "properties": {
884
+ "clave": {
885
+ "type": "string",
886
+ "pattern": "^[a-z][a-z0-9_]{0,30}$"
887
+ },
888
+ "nombre": {
889
+ "type": "string",
890
+ "maxLength": 80
891
+ },
892
+ "personas": {
893
+ "oneOf": [
894
+ {
895
+ "type": "object",
896
+ "additionalProperties": false,
897
+ "required": [
898
+ "modulo",
899
+ "correo"
900
+ ],
901
+ "properties": {
902
+ "modulo": {
903
+ "type": "string",
904
+ "description": "mod_<clave> del módulo de personas."
905
+ },
906
+ "correo": {
907
+ "type": "string",
908
+ "description": "Su campo de correo (tipo correo)."
909
+ }
910
+ }
911
+ },
912
+ {
913
+ "type": "object",
914
+ "additionalProperties": false,
915
+ "required": [
916
+ "objeto"
917
+ ],
918
+ "properties": {
919
+ "objeto": {
920
+ "enum": [
921
+ "contacts",
922
+ "companies"
923
+ ]
924
+ },
925
+ "tipo": {
926
+ "type": "string",
927
+ "pattern": "^[a-z0-9][a-z0-9-]{0,59}$"
928
+ }
929
+ }
930
+ }
931
+ ]
932
+ },
933
+ "secciones": {
934
+ "type": "array",
935
+ "minItems": 1,
936
+ "maxItems": 10,
937
+ "items": {
938
+ "type": "object",
939
+ "additionalProperties": false,
940
+ "required": [
941
+ "clave",
942
+ "titulo",
943
+ "campos"
944
+ ],
945
+ "properties": {
946
+ "clave": {
947
+ "type": "string",
948
+ "pattern": "^[a-z][a-z0-9_]{0,30}$"
949
+ },
950
+ "titulo": {
951
+ "type": "string",
952
+ "maxLength": 60
953
+ },
954
+ "modulo": {
955
+ "type": "string",
956
+ "description": "mod_<clave> (opcional: lo dice el camino)."
957
+ },
958
+ "camino": {
959
+ "type": "array",
960
+ "maxItems": 2,
961
+ "description": "Desde la ficha de la persona, cada paso por una relación: {modulo: el que TIENE el campo, campo}. Vacío: su propia ficha.",
962
+ "items": {
963
+ "type": "object",
964
+ "additionalProperties": false,
965
+ "required": [
966
+ "modulo",
967
+ "campo"
968
+ ],
969
+ "properties": {
970
+ "modulo": {
971
+ "type": "string"
972
+ },
973
+ "campo": {
974
+ "type": "string"
975
+ }
976
+ }
977
+ }
978
+ },
979
+ "campos": {
980
+ "type": "array",
981
+ "items": {
982
+ "type": "string"
983
+ },
984
+ "maxItems": 40,
985
+ "description": "La LISTA BLANCA de lo que se ve (nunca un secreto, un botón ni una búsqueda)."
986
+ },
987
+ "subtablas": {
988
+ "type": "object",
989
+ "additionalProperties": {
990
+ "type": "array",
991
+ "items": {
992
+ "type": "string"
993
+ }
994
+ }
995
+ },
996
+ "crear": {
997
+ "type": "object",
998
+ "additionalProperties": false,
999
+ "required": [
1000
+ "campos"
1001
+ ],
1002
+ "properties": {
1003
+ "campos": {
1004
+ "type": "array",
1005
+ "items": {
1006
+ "type": "string"
1007
+ }
1008
+ }
1009
+ }
1010
+ },
1011
+ "editar": {
1012
+ "type": "object",
1013
+ "additionalProperties": false,
1014
+ "required": [
1015
+ "campos"
1016
+ ],
1017
+ "properties": {
1018
+ "campos": {
1019
+ "type": "array",
1020
+ "items": {
1021
+ "type": "string"
1022
+ }
1023
+ },
1024
+ "estado": {
1025
+ "type": "object",
1026
+ "additionalProperties": false,
1027
+ "required": [
1028
+ "campo",
1029
+ "valores"
1030
+ ],
1031
+ "properties": {
1032
+ "campo": {
1033
+ "type": "string"
1034
+ },
1035
+ "valores": {
1036
+ "type": "array",
1037
+ "items": {
1038
+ "type": "string"
1039
+ }
1040
+ }
1041
+ }
1042
+ }
1043
+ }
1044
+ },
1045
+ "adjuntar": {
1046
+ "type": "object",
1047
+ "additionalProperties": false,
1048
+ "required": [
1049
+ "campo"
1050
+ ],
1051
+ "properties": {
1052
+ "campo": {
1053
+ "type": "string"
1054
+ },
1055
+ "tipos": {
1056
+ "type": "array",
1057
+ "items": {
1058
+ "enum": [
1059
+ "image/png",
1060
+ "image/jpeg",
1061
+ "image/webp",
1062
+ "image/gif",
1063
+ "application/pdf"
1064
+ ]
1065
+ }
1066
+ },
1067
+ "max_mb": {
1068
+ "type": "integer",
1069
+ "minimum": 1,
1070
+ "maximum": 25
1071
+ }
1072
+ }
1073
+ },
1074
+ "comentar": {
1075
+ "type": "boolean"
1076
+ }
1077
+ }
1078
+ }
1079
+ },
1080
+ "textos": {
1081
+ "type": "object",
1082
+ "additionalProperties": false,
1083
+ "properties": {
1084
+ "titulo": {
1085
+ "type": "string",
1086
+ "maxLength": 80
1087
+ },
1088
+ "bienvenida": {
1089
+ "type": "string",
1090
+ "maxLength": 2000
1091
+ },
1092
+ "pie": {
1093
+ "type": "string",
1094
+ "maxLength": 500
1095
+ }
1096
+ }
1097
+ },
1098
+ "marca": {
1099
+ "type": "object",
1100
+ "additionalProperties": false,
1101
+ "properties": {
1102
+ "color": {
1103
+ "type": "string",
1104
+ "pattern": "^#[0-9a-fA-F]{6}$"
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+ }
1110
+ },
1111
+ "proyectos": {
1112
+ "type": "array",
1113
+ "items": {
1114
+ "type": "object",
1115
+ "required": [
1116
+ "clave",
1117
+ "nombre"
1118
+ ],
1119
+ "properties": {
1120
+ "clave": {
1121
+ "type": "string",
1122
+ "pattern": "^[A-Z0-9]{2,10}$"
1123
+ },
1124
+ "nombre": {
1125
+ "type": "string",
1126
+ "maxLength": 100
1127
+ },
1128
+ "descripcion": {
1129
+ "type": "string",
1130
+ "maxLength": 500
1131
+ },
1132
+ "color": {
1133
+ "type": "string"
1134
+ },
1135
+ "icono": {
1136
+ "type": "string"
1137
+ },
1138
+ "columnas": {
1139
+ "type": "array"
1140
+ }
1141
+ }
1142
+ }
1143
+ },
1144
+ "plantillas_proyecto": {
1145
+ "type": "array",
1146
+ "items": {
1147
+ "type": "object",
1148
+ "required": [
1149
+ "nombre"
1150
+ ],
1151
+ "properties": {
1152
+ "nombre": {
1153
+ "type": "string",
1154
+ "maxLength": 200
1155
+ },
1156
+ "clave_sugerida": {
1157
+ "type": "string",
1158
+ "pattern": "^[A-Z0-9]{2,10}$"
1159
+ },
1160
+ "descripcion": {
1161
+ "type": "string",
1162
+ "maxLength": 500
1163
+ },
1164
+ "categoria": {
1165
+ "type": "string",
1166
+ "maxLength": 50
1167
+ },
1168
+ "color": {
1169
+ "type": "string"
1170
+ },
1171
+ "icono": {
1172
+ "type": "string"
1173
+ },
1174
+ "columnas": {
1175
+ "type": "array"
1176
+ },
1177
+ "tareas": {
1178
+ "type": "array"
1179
+ }
1180
+ }
1181
+ }
1182
+ }
1183
+ },
1184
+ "x-forgenex": {
1185
+ "tamanoMaximoBytes": 1000000,
1186
+ "topeCampos": 200
1187
+ }
1188
+ }