@forgenex/cli 0.4.0 → 0.5.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/licencias.txt CHANGED
@@ -1,4 +1,4 @@
1
- Software de terceros dentro de @forgenex/cli 0.4.0:
1
+ Software de terceros dentro de @forgenex/cli 0.5.0:
2
2
 
3
3
  @jitl/quickjs-ffi-types 0.32.0 — MIT
4
4
  @jitl/quickjs-wasmfile-release-sync 0.32.0 — MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgenex/cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "CLI para crear, probar, empaquetar e instalar apps del CRM ForgeNEX.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "files": [
14
+ "kit",
14
15
  "dist",
15
16
  "ejemplos",
16
17
  "licencias",
@@ -41,17 +41,18 @@ export interface ArchivosCRM {
41
41
  /**
42
42
  * Dónde está colgada la caja (`contexto.actual`). `punto` es el montaje; en la
43
43
  * ficha, `modulo` e `id`; en «accion_tabla», `modulo` e `ids` (la selección, hasta
44
- * 500); en «vista», solo `modulo`; en «ajustes» y «publica», solo `punto`. En
44
+ * 500); en «vista», filtros, orden y selección; en «ajustes» y «publica», solo `punto`. En
45
45
  * «pagina» e «inicio_bloque», null.
46
46
  */
47
47
  export type ContextoCaja =
48
48
  | { punto: "ficha_pestana" | "ficha_bloque" | "accion_ficha"; modulo: string; id: number }
49
49
  | { punto: "accion_tabla"; modulo: string; ids: number[] }
50
- | { punto: "vista"; modulo: string }
50
+ | { punto: "vista"; modulo: string; filtros: Record<string, unknown>; orden: { campo: string; direccion: string } | null; ids: number[] }
51
51
  | { punto: "ajustes" }
52
52
  | { punto: "publica" };
53
53
 
54
54
  export interface ClienteCRM {
55
+ conexion(clave: string, valores?: Record<string, unknown>): Promise<{ data: { estado: number; cuerpo: string } }>;
55
56
  contexto(): Promise<ContextoCaja | null>;
56
57
  pedir<T = unknown>(op: string, parametros?: Record<string, unknown>, opciones?: OpcionesPeticion): Promise<T>;
57
58
  /** Solo en la página pública: llama a una de las `funciones` del montaje «publica». */
@@ -4,6 +4,10 @@ export function crearClienteCRM(ventana = window, espera = 15000) {
4
4
  let cerrado = false;
5
5
  const pendientes = new Map();
6
6
  const cliente = {
7
+ conexion(clave, valores = {}) {
8
+ return this.pedir("app.conexion_llamar", { clave, valores },
9
+ { metodo: "POST", idempotencia: `conexion-${Date.now().toString(36)}-${siguiente}` });
10
+ },
7
11
  contexto() { return this.pedir("contexto.actual"); },
8
12
  // 1.14.0: en la página pública (montaje «publica»), una de sus funciones «publica».
9
13
  publica(funcion, entrada = null) {
@@ -62,6 +62,150 @@
62
62
  "type": "string",
63
63
  "pattern": "^[a-z0-9-]{1,40}$"
64
64
  },
65
+ "conexiones": {
66
+ "type": "array",
67
+ "maxItems": 25,
68
+ "items": {
69
+ "oneOf": [
70
+ {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "tipo",
75
+ "conector"
76
+ ],
77
+ "properties": {
78
+ "clave": {
79
+ "type": "string"
80
+ },
81
+ "nombre": {
82
+ "type": "string",
83
+ "maxLength": 80
84
+ },
85
+ "tipo": {
86
+ "const": "conector"
87
+ },
88
+ "conector": {
89
+ "type": "string",
90
+ "pattern": "^[a-z][a-z0-9_-]{0,39}$"
91
+ }
92
+ }
93
+ },
94
+ {
95
+ "type": "object",
96
+ "additionalProperties": false,
97
+ "required": [
98
+ "clave",
99
+ "nombre",
100
+ "tipo"
101
+ ],
102
+ "properties": {
103
+ "clave": {
104
+ "type": "string",
105
+ "pattern": "^[a-z][a-z0-9_]{0,39}$"
106
+ },
107
+ "nombre": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 120
111
+ },
112
+ "tipo": {
113
+ "enum": [
114
+ "api",
115
+ "mcp"
116
+ ]
117
+ }
118
+ }
119
+ }
120
+ ]
121
+ }
122
+ },
123
+ "fuentesExternas": {
124
+ "type": "array",
125
+ "maxItems": 30,
126
+ "items": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "required": [
130
+ "modulo",
131
+ "conexion",
132
+ "operacion",
133
+ "filas",
134
+ "mapeo",
135
+ "modo"
136
+ ],
137
+ "properties": {
138
+ "modulo": {
139
+ "type": "string"
140
+ },
141
+ "conexion": {
142
+ "type": "string"
143
+ },
144
+ "operacion": {
145
+ "type": "string"
146
+ },
147
+ "filas": {
148
+ "type": "string",
149
+ "maxLength": 160
150
+ },
151
+ "mapeo": {
152
+ "type": "object",
153
+ "minProperties": 1,
154
+ "additionalProperties": {
155
+ "type": "string",
156
+ "maxLength": 160
157
+ }
158
+ },
159
+ "modo": {
160
+ "enum": [
161
+ "vivo",
162
+ "espejo"
163
+ ]
164
+ },
165
+ "minutos": {
166
+ "type": "integer",
167
+ "minimum": 5,
168
+ "maximum": 10080
169
+ },
170
+ "id_externo": {
171
+ "type": "string",
172
+ "maxLength": 160
173
+ },
174
+ "cursor": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "required": [
178
+ "ruta",
179
+ "parametro"
180
+ ],
181
+ "properties": {
182
+ "ruta": {
183
+ "type": "string",
184
+ "maxLength": 160
185
+ },
186
+ "parametro": {
187
+ "type": "string",
188
+ "maxLength": 80
189
+ }
190
+ }
191
+ }
192
+ },
193
+ "if": {
194
+ "properties": {
195
+ "modo": {
196
+ "const": "espejo"
197
+ }
198
+ }
199
+ },
200
+ "then": {
201
+ "required": [
202
+ "minutos",
203
+ "id_externo",
204
+ "cursor"
205
+ ]
206
+ }
207
+ }
208
+ },
65
209
  "modulos": {
66
210
  "type": "array",
67
211
  "minItems": 1,
@@ -213,6 +357,7 @@
213
357
  "firma",
214
358
  "hora",
215
359
  "articulo",
360
+ "dispositivo",
216
361
  "creado_el",
217
362
  "creado_por",
218
363
  "modificado_el",