@denevads/dnv-smo 1.0.34 → 1.0.36

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/smo.js CHANGED
@@ -1,808 +1,848 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlarmaLevel = exports.LogLevel = exports.SMO_EVENT_TYPE = exports.SMO = void 0;
4
- var rxjs_1 = require("rxjs");
5
- // @ts-ignore
6
- var SMO = /** @class */ (function () {
7
- function SMO() {
8
- this.vars = {};
9
- this.id = "";
10
- this.intervalDataSource$ = (0, rxjs_1.interval)(5 * 60 * 1000);
11
- this.initOnMessage();
12
- this.smoCallBacks = new smoCallBacks(this);
13
- this.utils = new Utils(this, this.smoCallBacks);
14
- this.events = new SmoEvents(this);
15
- this.init();
16
- }
17
- SMO.prototype.init = function () {
18
- var _this = this;
19
- var match, pl = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) {
20
- return decodeURIComponent(s.replace(pl, " "));
21
- }, query = window.location.search.substring(1);
22
- while (match = search.exec(query)) {
23
- this.vars[decode(match[1])] = decode(match[2]);
24
- }
25
- //console.log("vars->",JSON.stringify(this.vars));
26
- // @ts-ignore
27
- //console.log( "resultados " +window.objJS != undefined + " " + window !== window.parent + " " + this.vars.ontop != undefined + " " + this.vars.ontop != "");
28
- // @ts-ignore
29
- if (window.objJS != undefined && this.vars != undefined && this.vars.ontop !== undefined && this.vars.ontop !== "") {
30
- // @ts-ignore
31
- console.log("Existe objJS en window -->" + JSON.stringify(window.objJS));
32
- // @ts-ignore
33
- window.sendToIframefromNet = function (target, iframeID, objData) {
34
- console.log("sendToIframefromNet->", JSON.stringify(target));
35
- switch (target) {
36
- case "SMO.setDatasource":
37
- _this.events.setDatasource.next(objData);
38
- break;
39
- case "SMO.checkHealthPrinter":
40
- _this.events.checkHealthPrinter.next(objData);
41
- break;
42
- }
43
- };
44
- // @ts-ignore
45
- window.external = {
46
- // @ts-ignore
47
- URLNext: window.objJS.urlNext,
48
- // @ts-ignore
49
- LimpiaCapa: window.objJS.limpiaCapa,
50
- // @ts-ignore
51
- LogFlash: window.objJS.logFlash,
52
- // @ts-ignore
53
- PageInit: window.objJS.pageInit,
54
- // @ts-ignore
55
- FinAviso: window.objJS.finAviso,
56
- // @ts-ignore
57
- ExitInteractivity: window.objJS.exitInteractivity,
58
- // @ts-ignore
59
- LogWeb: window.objJS.logWeb,
60
- // @ts-ignore
61
- RefreshPage: window.objJS.refreshPage,
62
- // @ts-ignore
63
- RefreshPageByError: window.objJS.refreshPageByError,
64
- // @ts-ignore
65
- RefreshPageByVideoEvent: window.objJS.refreshPageByVideoEvent,
66
- // @ts-ignore
67
- AuditarRecurso: window.objJS.auditarRecurso,
68
- // @ts-ignore
69
- InitSMO: window.objJS.initSMO,
70
- // @ts-ignore
71
- GetFile: window.objJS.getFile,
72
- // @ts-ignore
73
- ShowBrowser: window.objJS.showBrowser,
74
- // @ts-ignore
75
- closeBrowser: window.objJS.closeBrowser,
76
- // @ts-ignore
77
- RefreshDataSource: window.objJS.refreshDataSource,
78
- // @ts-ignore
79
- SetVariable: window.objJS.setVariable,
80
- // @ts-ignore
81
- GetVariable: window.objJS.getVariable,
82
- // @ts-ignore
83
- GetLocation: window.objJS.getLocation,
84
- // @ts-ignore
85
- SalirApp: window.objJS.salirApp,
86
- // @ts-ignore
87
- SetLocalData: window.objJS.setLocalData,
88
- // @ts-ignore
89
- GetLocalData: window.objJS.getLocalData,
90
- // @ts-ignore
91
- GetSalidaData: window.objJS.getSalidaData,
92
- // @ts-ignore
93
- EjecutaFuncion: window.objJS.ejecutaFuncion,
94
- // @ts-ignore
95
- AddObserver: window.objJS.addObserver,
96
- // @ts-ignore
97
- NotifyToObservers: window.objJS.notifyToObservers,
98
- // @ts-ignore
99
- PrintTextLine: window.objJS.printTextLine,
100
- // @ts-ignore
101
- PrintBarcode: window.objJS.printBarcode,
102
- // @ts-ignore
103
- CutPaper: window.objJS.cutPaper,
104
- // @ts-ignore
105
- PrintImage: window.objJS.printImage,
106
- // @ts-ignore
107
- CheckHealthPrinter: window.objJS.checkHealthPrinter,
108
- // @ts-ignore
109
- CheckHealth: window.objJS.checkHealth
110
- };
111
- }
112
- else {
113
- console.log("No existe objJS en window");
114
- if (this.vars.idSmo) {
115
- this.id = this.vars.idSmo;
116
- if (this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)) {
117
- this.smoCallBacks.onSmoLoad();
118
- return;
119
- }
120
- if (this.vars["url"] != undefined) {
121
- this.smoCallBacks.getFile(this.vars["url"]);
122
- this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
123
- _this.smoCallBacks.getFile(_this.vars["url"]);
124
- });
125
- return;
126
- }
127
- if (this.vars["LocalData"] != undefined) {
128
- this.smoCallBacks.getLocalData(this.vars["LocalData"]);
129
- this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
130
- _this.smoCallBacks.getLocalData(_this.vars["LocalData"]);
131
- });
132
- return;
133
- }
134
- return;
135
- }
136
- console.warn("No idSmo found in URL");
137
- return;
138
- }
139
- if (this.vars.idSmo) {
140
- this.id = this.vars.idSmo;
141
- return;
142
- }
143
- console.warn("No idSmo found in URL");
144
- };
145
- SMO.prototype.initOnMessage = function () {
146
- var selft = this;
147
- window.onmessage = function (e) {
148
- if (e.data.target) {
149
- var targets = e.data.target.split('.');
150
- var func = targets[targets.length - 1];
151
- if (func == SMO_EVENT_TYPE.start) {
152
- selft.start();
153
- return;
154
- }
155
- if (func == SMO_EVENT_TYPE.setDatasource) {
156
- selft.setDatasource(e.data.objData);
157
- return;
158
- }
159
- if (func == SMO_EVENT_TYPE.getVariable) {
160
- selft.getVariable(e.data.objData);
161
- return;
162
- }
163
- if (func == SMO_EVENT_TYPE.setCurrentStream) {
164
- selft.setCurrentStream(e.data.objData);
165
- return;
166
- }
167
- if (func == SMO_EVENT_TYPE.infoCurrentLocation) {
168
- selft.infoCurrentLocation(e.data.objData);
169
- return;
170
- }
171
- if (func == SMO_EVENT_TYPE.setSalidaData) {
172
- selft.setSalidaData(e.data.objData);
173
- return;
174
- }
175
- if (func == SMO_EVENT_TYPE.updatefromsalida) {
176
- selft.updatefromsalida(e.data.objData);
177
- return;
178
- }
179
- if (func == SMO_EVENT_TYPE.getRecursosByCodigo) {
180
- selft.getRecursosByCodigo(e.data.objData);
181
- return;
182
- }
183
- if (func == SMO_EVENT_TYPE.getRecursos) {
184
- selft.getRecursos(e.data.objData);
185
- }
186
- if (func == SMO_EVENT_TYPE.getRecursosDefault) {
187
- selft.getRecursosDefault(e.data.objData);
188
- }
189
- if (func == SMO_EVENT_TYPE.getRecursosRelleno) {
190
- selft.getRecursosRelleno(e.data.objData);
191
- return;
192
- }
193
- if (func == SMO_EVENT_TYPE.getVariableStorage) {
194
- selft.getVariableStorage(e.data.objData);
195
- return;
196
- }
197
- if (func == SMO_EVENT_TYPE.checkHealth) {
198
- selft.checkHealth(e.data.objData);
199
- return;
200
- }
201
- if (func == SMO_EVENT_TYPE.checkHealthPrinter) {
202
- selft.checkHealthPrinter(e.data.objData);
203
- return;
204
- }
205
- console.warn("message not implemented!!" + func);
206
- }
207
- };
208
- };
209
- SMO.prototype.start = function () {
210
- this.events.start.next({});
211
- };
212
- SMO.prototype.setDatasource = function (datasource) {
213
- this.events.setDatasource.next(datasource);
214
- this.events.setDatasourceJson.next(this.utils.xmlToJSON(datasource.xml));
215
- };
216
- SMO.prototype.getVariable = function (variable) {
217
- this.events.getVariable.next(variable);
218
- };
219
- SMO.prototype.setCurrentStream = function (stream) {
220
- this.events.setCurrentStream.next(stream);
221
- };
222
- SMO.prototype.infoCurrentLocation = function (location) {
223
- this.events.infoCurrentLocation.next(location);
224
- };
225
- SMO.prototype.setSalidaData = function (data) {
226
- this.events.setSalidaData.next(data);
227
- };
228
- SMO.prototype.updatefromsalida = function (data) {
229
- this.events.updatefromsalida.next(data);
230
- };
231
- SMO.prototype.getRecursosByCodigo = function (data) {
232
- this.events.getRecursosByCodigo.next(data);
233
- };
234
- SMO.prototype.getRecursos = function (data) {
235
- this.events.getRecursos.next(data);
236
- };
237
- SMO.prototype.getRecursosDefault = function (data) {
238
- this.events.getRecursosDefault.next(data);
239
- };
240
- SMO.prototype.getRecursosRelleno = function (data) {
241
- this.events.getRecursosRelleno.next(data);
242
- };
243
- SMO.prototype.getVariableStorage = function (variable) {
244
- this.events.getVariableStorage.next(variable);
245
- };
246
- SMO.prototype.checkHealth = function (json) {
247
- this.events.checkHealth.next(json);
248
- };
249
- SMO.prototype.checkHealthPrinter = function (json) {
250
- this.events.checkHealthPrinter.next(json);
251
- };
252
- return SMO;
253
- }());
254
- exports.SMO = SMO;
255
- var SmoEvents = /** @class */ (function () {
256
- function SmoEvents(smo) {
257
- this.start = new rxjs_1.Subject();
258
- this.setDatasource = new rxjs_1.Subject();
259
- this.setDatasourceJson = new rxjs_1.Subject();
260
- this.getVariable = new rxjs_1.Subject();
261
- this.setCurrentStream = new rxjs_1.Subject();
262
- this.infoCurrentLocation = new rxjs_1.Subject();
263
- this.setSalidaData = new rxjs_1.Subject();
264
- this.updatefromsalida = new rxjs_1.Subject();
265
- this.getRecursosByCodigo = new rxjs_1.Subject();
266
- this.getRecursos = new rxjs_1.Subject();
267
- this.getRecursosDefault = new rxjs_1.Subject();
268
- this.getRecursosRelleno = new rxjs_1.Subject();
269
- this.getVariableStorage = new rxjs_1.Subject();
270
- this.checkHealth = new rxjs_1.Subject();
271
- this.checkHealthPrinter = new rxjs_1.Subject();
272
- }
273
- return SmoEvents;
274
- }());
275
- var smoCallBacks = /** @class */ (function () {
276
- function smoCallBacks(_smo) {
277
- this.smo = _smo;
278
- }
279
- smoCallBacks.prototype.onSmoLoad = function () {
280
- this.smo.utils.sendToParent({
281
- target: "Dnv.smoCallbacks.onSmoLoad",
282
- objData: undefined,
283
- idSmo: this.smo.id
284
- }, this.smo.vars.idSmo);
285
- };
286
- smoCallBacks.prototype.onSmoReady = function () {
287
- this.smo.utils.sendToParent({
288
- target: "Dnv.smoCallbacks.onSmoReady",
289
- objData: undefined,
290
- idSmo: this.smo.id
291
- }, this.smo.vars.idSmo);
292
- };
293
- smoCallBacks.prototype.smoLog = function (msn, level) {
294
- if (level == undefined) {
295
- level = LogLevel.Info;
296
- }
297
- //level = Dnv.LogLevel.Debug...
298
- if (level == LogLevel.Debug) {
299
- console.debug(msn);
300
- }
301
- if (level == LogLevel.Info) {
302
- console.log(msn);
303
- }
304
- if (level == LogLevel.Warning) {
305
- console.warn(msn);
306
- }
307
- if (level == LogLevel.Error) {
308
- console.error(msn);
309
- }
310
- if (window.parent != window) {
311
- this.smo.utils.sendToParent({
312
- target: "Dnv.smoCallbacks.smoLog",
313
- objData: {
314
- level: level,
315
- txt: msn
316
- },
317
- idSmo: this.smo.id
318
- }, this.smo.vars.idSmo);
319
- }
320
- };
321
- smoCallBacks.prototype.smoAlarma = function (msn, level) {
322
- this.smo.utils.sendToParent({
323
- target: "Dnv.smoCallbacks.smoAlarma",
324
- objData: {
325
- level: level,
326
- txt: msn
327
- },
328
- idSmo: this.smo.id
329
- }, this.smo.vars.idSmo);
330
- };
331
- smoCallBacks.prototype.smoLogStash = function (msn) {
332
- this.smo.utils.sendToParent({
333
- target: "Dnv.smoCallbacks.smoLogStash",
334
- objData: {
335
- txt: msn
336
- },
337
- idSmo: this.smo.id
338
- }, this.smo.vars.idSmo);
339
- };
340
- smoCallBacks.prototype.smoLogNowShowing = function (msn) {
341
- this.smo.utils.sendToParent({
342
- target: "Dnv.smoCallbacks.smoNowShowing",
343
- objData: msn,
344
- idSmo: this.smo.id
345
- }, this.smo.vars.idSmo);
346
- };
347
- smoCallBacks.prototype.reiniciarDispositivo = function (msn) {
348
- //Permite reiniciar el player, proporcionando una razón para el reinicio. Solo Player HTML5
349
- this.smo.utils.sendToParent({
350
- target: "Dnv.smoCallbacks.reiniciarDispositivo",
351
- objData: {
352
- txt: msn // Razón del reinicio
353
- },
354
- idSmo: this.smo.id
355
- }, this.smo.vars.idSmo);
356
- };
357
- smoCallBacks.prototype.urlNext = function () {
358
- //Permite avanzar plantilla. Solo si Reloj Maestro activado.
359
- this.smo.utils.sendToParent({
360
- target: "Dnv.smoCallbacks.urlNext",
361
- objData: undefined,
362
- idSmo: this.smo.id
363
- }, this.smo.vars.idSmo);
364
- };
365
- smoCallBacks.prototype.exitInteractivity = function () {
366
- //Para canales interactivos, vuelve al canal de reposo. Solo Android y Player PC.
367
- this.smo.utils.sendToParent({
368
- target: "Dnv.smoCallbacks.exitInteractivity",
369
- objData: undefined,
370
- idSmo: this.smo.id
371
- }, this.smo.vars.idSmo);
372
- };
373
- smoCallBacks.prototype.showBrowser = function () {
374
- /* DEPRECATED NOT IMPLEMENTED */
375
- };
376
- smoCallBacks.prototype.closeBrowser = function () {
377
- /* DEPRECATED NOT IMPLEMENTED */
378
- };
379
- smoCallBacks.prototype.urlNextDirectamente = function () {
380
- /* NOT IMPLEMENTED */
381
- };
382
- smoCallBacks.prototype.setVariable = function (variable, valor) {
383
- this.smo.utils.sendToParent({
384
- target: "Dnv.smoCallbacks.setVariable",
385
- objData: {
386
- variable: variable,
387
- valor: valor
388
- },
389
- idSmo: this.smo.id
390
- }, this.smo.vars.idSmo);
391
- };
392
- smoCallBacks.prototype.getVariable = function (variable) {
393
- this.smo.utils.sendToParent({
394
- target: "Dnv.smoCallbacks.getVariable",
395
- objData: {
396
- variable: variable
397
- },
398
- idSmo: this.smo.id
399
- }, this.smo.vars.idSmo);
400
- /* MIRAR SMO.getVariable */
401
- };
402
- smoCallBacks.prototype.getFile = function (file) {
403
- this.smo.utils.sendToParent({
404
- target: "Dnv.smoCallbacks.getFile",
405
- objData: file,
406
- idSmo: this.smo.id
407
- }, this.smo.vars.idSmo);
408
- };
409
- smoCallBacks.prototype.setLocalData = function (variable, valor) {
410
- this.smo.utils.sendToParent({
411
- target: "Dnv.smoCallbacks.setLocalData",
412
- objData: {
413
- nameData: variable,
414
- data: valor
415
- },
416
- idSmo: this.smo.id
417
- }, this.smo.vars.idSmo);
418
- };
419
- smoCallBacks.prototype.getLocalData = function (variable) {
420
- this.smo.utils.sendToParent({
421
- target: "Dnv.smoCallbacks.getLocalData",
422
- objData: variable,
423
- idSmo: this.smo.id
424
- }, this.smo.vars.idSmo);
425
- /* MIRAR SMO.setDatasource */
426
- };
427
- smoCallBacks.prototype.getCurrentStream = function () {
428
- this.smo.utils.sendToParent({
429
- target: "Dnv.smoCallbacks.getCurrentStream",
430
- objData: undefined,
431
- idSmo: this.smo.id
432
- }, this.smo.vars.idSmo);
433
- /* MIRAR SMO.setCurrentStream' */
434
- };
435
- smoCallBacks.prototype.finAviso = function (id) {
436
- this.smo.utils.sendToParent({
437
- target: "Dnv.smoCallbacks.finAviso",
438
- objData: id,
439
- idSmo: this.smo.id
440
- }, this.smo.vars.idSmo);
441
- };
442
- smoCallBacks.prototype.refreshDatasource = function (codigo) {
443
- this.smo.utils.sendToParent({
444
- target: "Dnv.smoCallbacks.refreshDatasource",
445
- objData: codigo,
446
- idSmo: this.smo.id
447
- }, this.smo.vars.idSmo);
448
- };
449
- smoCallBacks.prototype.getLocation = function () {
450
- this.smo.utils.sendToParent({
451
- target: "Dnv.smoCallbacks.getLocation",
452
- objData: undefined,
453
- idSmo: this.smo.id
454
- }, this.smo.vars.idSmo);
455
- /* MIRAR SMO.infoCurrentLocation */
456
- };
457
- smoCallBacks.prototype.getSalidaData = function (data) {
458
- this.smo.utils.sendToParent({
459
- target: "Dnv.smoCallbacks.getSalidaData",
460
- objData: data,
461
- idSmo: this.smo.id
462
- }, this.smo.vars.idSmo);
463
- /* MIRAR SMO.setSalidaData */
464
- };
465
- smoCallBacks.prototype.ejecutaFuncion = function (data) {
466
- /*data ={
467
- funcion: "", // Nombre de la función que se debe ejecutar
468
- params: "" // Parámetros que debemos enviarle a la funcion. sin separadores ni nada, un string y se usa como tal. Solo esta implementada en un caso y se usa como tal sin parsear ni nada
469
- } */
470
- this.smo.utils.sendToParent({
471
- target: "Dnv.smoCallbacks.ejecutaFuncion",
472
- objData: data,
473
- idSmo: this.smo.id
474
- }, this.smo.vars.idSmo);
475
- };
476
- smoCallBacks.prototype.addObserver = function (data) {
477
- /*data ="fruta"
478
- */
479
- this.smo.utils.sendToParent({
480
- target: "Dnv.smoCallbacks.addObserver",
481
- objData: data,
482
- idSmo: this.smo.id
483
- }, this.smo.vars.idSmo);
484
- };
485
- smoCallBacks.prototype.notify = function (data) {
486
- /*data ={
487
- destino: "fruta",
488
- value: "{'fruta':'manzana', 'color':'roja'}"
489
- } */
490
- this.smo.utils.sendToParent({
491
- target: "Dnv.smoCallbacks.notify",
492
- objData: data,
493
- idSmo: this.smo.id
494
- }, this.smo.vars.idSmo);
495
- };
496
- smoCallBacks.prototype.playOnceChannelByTrigger = function (trigger) {
497
- this.smo.utils.sendToParent({
498
- target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
499
- objData: { triggerCanal: trigger },
500
- idSmo: this.smo.id
501
- }, this.smo.vars.idSmo);
502
- };
503
- smoCallBacks.prototype.stopPlayOnceChannelByTrigger = function () {
504
- this.smo.utils.sendToParent({ target: "Dnv.smoCallbacks.stopPlayOnceChannelByTrigger", objData: {}, idSmo: this.smo.id }, this.smo.vars.idSmo);
505
- };
506
- smoCallBacks.prototype.playOnceChannel = function (codigoCanal) {
507
- this.smo.utils.sendToParent({ target: "Dnv.smoCallbacks.playOnceChannel", objData: { codigoCanal: codigoCanal, params: "PLAYONCE_CHANNEL|" + codigoCanal }, idSmo: this.smo.id }, this.smo.vars.idSmo);
508
- };
509
- smoCallBacks.prototype.stopPlayChannel = function () {
510
- this.smo.utils.sendToParent({ target: "Dnv.smoCallbacks.stopPlayOnceChannel", objData: {}, idSmo: this.smo.id }, this.smo.vars.idSmo);
511
- };
512
- smoCallBacks.prototype.editWrapperStyle = function (obj) {
513
- /*{"posX": "0px","posY": "0px","alto": "0px","ancho": "0px","overflow": "hidden","scale": 0.1,"zindex": 0.1,"opacidad": 0.1,"isMaestro": true,duracionTransition: "1s", transitionTiming: "lineal", css: string} */
514
- this.smo.utils.sendToParent({
515
- target: "Dnv.smoCallbacks.editWrapperStyle",
516
- objData: obj,
517
- idSmo: this.smo.id
518
- }, this.smo.vars.idSmo);
519
- };
520
- smoCallBacks.prototype.getRecursosByCodigo = function (codigos) {
521
- /** ["123456","654321"] */
522
- this.smo.utils.sendToParent({
523
- target: "Dnv.smoCallbacks.getRecursosByCodigo",
524
- objData: {
525
- recursos: codigos
526
- },
527
- idSmo: this.smo.id
528
- }, this.smo.vars.idSmo);
529
- };
530
- smoCallBacks.prototype.getRecursos = function () {
531
- this.smo.utils.sendToParent({
532
- target: "Dnv.smoCallbacks.getRecursos",
533
- idSmo: this.smo.id
534
- }, this.smo.vars.idSmo);
535
- };
536
- smoCallBacks.prototype.getRecursosDefault = function () {
537
- this.smo.utils.sendToParent({
538
- target: "Dnv.smoCallbacks.getRecursosDefault",
539
- idSmo: this.smo.id
540
- }, this.smo.vars.idSmo);
541
- };
542
- smoCallBacks.prototype.getRecursosRelleno = function () {
543
- this.smo.utils.sendToParent({
544
- target: "Dnv.smoCallbacks.getRecursosRelleno",
545
- idSmo: this.smo.id
546
- }, this.smo.vars.idSmo);
547
- };
548
- smoCallBacks.prototype.setVariableStorage = function (variable, valor) {
549
- this.smo.utils.sendToParent({
550
- target: "Dnv.smoCallbacks.setVariableStorage",
551
- objData: {
552
- variable: variable,
553
- valor: valor
554
- },
555
- idSmo: this.smo.id
556
- }, this.smo.vars.idSmo);
557
- };
558
- smoCallBacks.prototype.getVariableStorage = function (variable) {
559
- this.smo.utils.sendToParent({
560
- target: "Dnv.smoCallbacks.getVariableStorage",
561
- objData: {
562
- variable: variable
563
- },
564
- idSmo: this.smo.id
565
- }, this.smo.vars.idSmo);
566
- /* MIRAR SMO.getVariable */
567
- };
568
- smoCallBacks.prototype.printTextLine = function (txt) {
569
- this.smo.utils.sendToParent({
570
- target: "Dnv.smoCallbacks.printTextLine",
571
- objData: {
572
- txt: txt
573
- },
574
- idSmo: this.smo.id
575
- }, this.smo.vars.idSmo);
576
- };
577
- smoCallBacks.prototype.printBarcode = function (code, width, height) {
578
- this.smo.utils.sendToParent({
579
- target: "Dnv.smoCallbacks.printBarcode",
580
- objData: {
581
- code: code,
582
- width: width,
583
- height: height
584
- },
585
- idSmo: this.smo.id
586
- }, this.smo.vars.idSmo);
587
- };
588
- smoCallBacks.prototype.cutPaper = function (percent) {
589
- this.smo.utils.sendToParent({
590
- target: "Dnv.smoCallbacks.cutPaper",
591
- objData: {
592
- percent: percent
593
- },
594
- idSmo: this.smo.id
595
- }, this.smo.vars.idSmo);
596
- };
597
- smoCallBacks.prototype.checkHealth = function () {
598
- this.smo.utils.sendToParent({
599
- target: "Dnv.smoCallbacks.checkHealth",
600
- idSmo: this.smo.id
601
- }, this.smo.vars.idSmo);
602
- };
603
- smoCallBacks.prototype.checkHealthPrinter = function () {
604
- this.smo.utils.sendToParent({
605
- target: "Dnv.smoCallbacks.checkHealthPrinter",
606
- idSmo: this.smo.id
607
- }, this.smo.vars.idSmo);
608
- };
609
- smoCallBacks.prototype.printImage = function (image) {
610
- this.smo.utils.sendToParent({
611
- target: "Dnv.smoCallbacks.printImage",
612
- objData: {
613
- image: image
614
- },
615
- idSmo: this.smo.id
616
- }, this.smo.vars.idSmo);
617
- };
618
- return smoCallBacks;
619
- }());
620
- var Utils = /** @class */ (function () {
621
- function Utils(_smo, _smoCallBacks) {
622
- this.smo = _smo;
623
- this.smoCallBacks = _smoCallBacks;
624
- }
625
- // Funciones para XML to JSON
626
- Utils.prototype.xmlToJSON = function (xml) {
627
- var getxml = new DOMParser();
628
- var sinSaltosYTabulaciones = xml.replace(/[\n\r\t]/g, '');
629
- var sinEspaciosEntreTags = sinSaltosYTabulaciones.replace(/>\s*</g, '><');
630
- var xmlDoc = getxml.parseFromString(sinEspaciosEntreTags, "text/xml");
631
- // gets the JSON string
632
- var json_str = this.jsonToStr(this.setJsonObj(xmlDoc));
633
- // sets and returns the JSON object, if "rstr" undefined (not passed), else, returns JSON string
634
- return json_str;
635
- };
636
- Utils.prototype.jsonToStr = function (js_obj) {
637
- var rejsn = JSON.stringify(js_obj, undefined, 2).replace(/(\\t|\\r|\\n)/g, '').replace(/"",[\n\t\r\s]+""[,]*/g, '').replace(/(\n[\t\s\r]*\n)/g, '').replace(/[\s\t]{2,}""[,]{0,1}/g, '').replace(/"[\s\t]{1,}"[,]{0,1}/g, '').replace(/\[[\t\s]*\]/g, '""');
638
- return (rejsn.indexOf('"parsererror": {') == -1) ? rejsn : 'Invalid XML format';
639
- };
640
- Utils.prototype.sendToParent = function (obj, dest) {
641
- console.log('sendToParent->', JSON.stringify(obj));
642
- //@ts-ignore
643
- if (window.objJS != undefined && this.smo.vars != undefined && this.smo.vars.ontop != undefined && this.smo.vars.ontop != "") {
644
- switch (obj.target) {
645
- case "Dnv.smoCallbacks.onSmoLoad":
646
- // @ts-ignore
647
- window.objJS.onSmoLoad();
648
- break;
649
- case "Dnv.smoCallbacks.printTextLine":
650
- // @ts-ignore
651
- window.objJS.printTextLine(obj.objData.txt);
652
- break;
653
- case "Dnv.smoCallbacks.printBarcode":
654
- // @ts-ignore
655
- window.objJS.printBarcode(obj.objData.code, obj.objData.width, obj.objData.height);
656
- break;
657
- case "Dnv.smoCallbacks.cutPaper":
658
- // @ts-ignore
659
- window.objJS.cutPaper(obj.objData.percent);
660
- break;
661
- case "Dnv.smoCallbacks.printImage":
662
- // @ts-ignore
663
- window.objJS.printImage(obj.idSmo, obj.objData.image);
664
- break;
665
- case "Dnv.smoCallbacks.checkHealthPrinter":
666
- console.log('llamo a checkhealthprinter');
667
- // @ts-ignore
668
- window.objJS.checkHealthPrinter(obj.idSmo);
669
- break;
670
- case "Dnv.smoCallbacks.checkHealth":
671
- // @ts-ignore
672
- window.objJS.checkHealth();
673
- break;
674
- case "Dnv.smoCallbacks.getFile":
675
- // @ts-ignore
676
- window.objJS.getFile(dest, obj.objData);
677
- break;
678
- }
679
- return;
680
- }
681
- /* // @ts-ignore
682
- window.parent.postMessage = (target,objData,idSmo)=> {
683
- switch (target.target) {
684
- case "Dnv.smoCallbacks.onSmoLoad":
685
- // @ts-ignore
686
- window.objJS.onSmoLoad();
687
- break;
688
-
689
- case "Dnv.smoCallbacks.printTextLine":
690
- // @ts-ignore
691
- window.objJS.printTextLine(objData.txt);
692
- break;
693
- case "Dnv.smoCallbacks.printBarcode":
694
- // @ts-ignore
695
- window.objJS.printBarcode(objData.code, objData.width, objData.height);
696
- break;
697
- case "Dnv.smoCallbacks.cutPaper":
698
- // @ts-ignore
699
- window.objJS.cutPaper(objData.percent);
700
- break;
701
- case "Dnv.smoCallbacks.printImage":
702
- // @ts-ignore
703
- window.objJS.printImage(idSmo, objData.image);
704
- break;
705
- case "Dnv.smoCallbacks.checkHealthPrinter":
706
- console.log('llamo a checkhealthprinter');
707
- // @ts-ignore
708
-
709
- window.objJS.checkHealthPrinter(idSmo);
710
- break;
711
- case "Dnv.smoCallbacks.checkHealth":
712
- // @ts-ignore
713
- window.objJS.checkHealth();
714
- break;
715
-
716
-
717
- }
718
- }*/
719
- window.parent.postMessage(obj, "*");
720
- };
721
- Utils.prototype.setJsonObj = function (xml) {
722
- var jsonObj = {};
723
- if (xml.nodeType == 1) { // Element
724
- if (xml.attributes.length > 0) {
725
- jsonObj["ATTRIBUTES"] = {};
726
- for (var j = 0; j < xml.attributes.length; j++) {
727
- var attribute = xml.attributes.item(j);
728
- jsonObj["ATTRIBUTES"][attribute.nodeName] = attribute.nodeValue;
729
- }
730
- }
731
- }
732
- else if (xml.nodeType == 3) { // Text
733
- jsonObj = xml.nodeValue.trim();
734
- }
735
- else if (xml.nodeType == 4) { // CDATA
736
- jsonObj = xml.nodeValue.trim();
737
- }
738
- if (xml.hasChildNodes()) {
739
- for (var i = 0; i < xml.childNodes.length; i++) {
740
- var item = xml.childNodes[i];
741
- var nodeName = item.nodeName;
742
- if (nodeName == "#text" && item.nodeType == 3) {
743
- jsonObj = item.nodeValue.trim();
744
- }
745
- else if (nodeName == "#cdata-section" && (item.nodeType == 4 || item.nodeType == 3)) { //Para que quede bonito
746
- jsonObj["CDATA"] = this.setJsonObj(item);
747
- }
748
- else if (typeof jsonObj[nodeName] === "undefined") {
749
- jsonObj[nodeName] = this.setJsonObj(item);
750
- }
751
- else {
752
- if (!Array.isArray(jsonObj[nodeName])) {
753
- jsonObj[nodeName] = [jsonObj[nodeName]];
754
- }
755
- jsonObj[nodeName].push(this.setJsonObj(item));
756
- }
757
- }
758
- }
759
- return jsonObj;
760
- };
761
- Utils.prototype.dataToJSON = function (data) {
762
- try {
763
- var parser = new DOMParser();
764
- var xmlDoc = parser.parseFromString(data.xml, "text/xml");
765
- var dataForJSON = xmlDoc.getElementsByTagName("item")[0].innerHTML;
766
- dataForJSON = dataForJSON.replace(/{'/g, '{"').replace(/'}/g, '"}').replace(/:'/g, ':"').replace(/':/g, '":').replace(/,'/g, ',"').replace(/',/g, '",').replace(/\['/g, '["').replace(/'\]/g, '"]').replace(/(\r\n|\n|\r)/gm, "");
767
- return JSON.parse(dataForJSON);
768
- }
769
- catch (error) {
770
- return {};
771
- }
772
- };
773
- return Utils;
774
- }());
775
- var SMO_EVENT_TYPE;
776
- (function (SMO_EVENT_TYPE) {
777
- SMO_EVENT_TYPE["start"] = "start";
778
- SMO_EVENT_TYPE["setDatasource"] = "setDatasource";
779
- SMO_EVENT_TYPE["getVariable"] = "getVariable";
780
- SMO_EVENT_TYPE["setCurrentStream"] = "setCurrentStream";
781
- SMO_EVENT_TYPE["infoCurrentLocation"] = "infoCurrentLocation";
782
- SMO_EVENT_TYPE["setSalidaData"] = "setSalidaData";
783
- SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
784
- SMO_EVENT_TYPE["setDatasourceJson"] = "setDatasourceJson";
785
- SMO_EVENT_TYPE["getRecursosByCodigo"] = "getRecursosByCodigo";
786
- SMO_EVENT_TYPE["getRecursos"] = "getRecursos";
787
- SMO_EVENT_TYPE["getRecursosDefault"] = "getRecursosDefault";
788
- SMO_EVENT_TYPE["getRecursosRelleno"] = "getRecursosRelleno";
789
- SMO_EVENT_TYPE["getVariableStorage"] = "getVariableStorage";
790
- SMO_EVENT_TYPE["checkHealth"] = "checkHealth";
791
- SMO_EVENT_TYPE["checkHealthPrinter"] = "checkHealthPrinter";
792
- })(SMO_EVENT_TYPE = exports.SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = {}));
793
- var LogLevel;
794
- (function (LogLevel) {
795
- LogLevel[LogLevel["Debug"] = 0] = "Debug";
796
- LogLevel[LogLevel["Info"] = 1] = "Info";
797
- LogLevel[LogLevel["Warning"] = 2] = "Warning";
798
- LogLevel[LogLevel["Error"] = 3] = "Error";
799
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
800
- var AlarmaLevel;
801
- (function (AlarmaLevel) {
802
- AlarmaLevel[AlarmaLevel["Ok_off"] = 0] = "Ok_off";
803
- AlarmaLevel[AlarmaLevel["Ok"] = 1] = "Ok";
804
- AlarmaLevel[AlarmaLevel["Scanning"] = 2] = "Scanning";
805
- AlarmaLevel[AlarmaLevel["Timeout"] = 3] = "Timeout";
806
- AlarmaLevel[AlarmaLevel["Warning"] = 4] = "Warning";
807
- AlarmaLevel[AlarmaLevel["Error"] = 5] = "Error";
808
- })(AlarmaLevel = exports.AlarmaLevel || (exports.AlarmaLevel = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlarmaLevel = exports.LogLevel = exports.SMO_EVENT_TYPE = exports.SMO = void 0;
4
+ var rxjs_1 = require("rxjs");
5
+ // @ts-ignore
6
+ var SMO = /** @class */ (function () {
7
+ function SMO() {
8
+ this.vars = {};
9
+ this.id = "";
10
+ this.intervalDataSource$ = (0, rxjs_1.interval)(5 * 60 * 1000);
11
+ this.initOnMessage();
12
+ this.smoCallBacks = new smoCallBacks(this);
13
+ this.utils = new Utils(this, this.smoCallBacks);
14
+ this.events = new SmoEvents(this);
15
+ this.init();
16
+ }
17
+ SMO.prototype.init = function () {
18
+ var _this = this;
19
+ var match, pl = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) {
20
+ return decodeURIComponent(s.replace(pl, " "));
21
+ }, query = window.location.search.substring(1);
22
+ while (match = search.exec(query)) {
23
+ this.vars[decode(match[1])] = decode(match[2]);
24
+ }
25
+ //console.log("vars->",JSON.stringify(this.vars));
26
+ // @ts-ignore
27
+ //console.log( "resultados " +window.objJS != undefined + " " + window !== window.parent + " " + this.vars.ontop != undefined + " " + this.vars.ontop != "");
28
+ // @ts-ignore
29
+ if (window.objJS != undefined && this.vars != undefined && this.vars.ontop !== undefined && this.vars.ontop !== "") {
30
+ // @ts-ignore
31
+ console.log("Existe objJS en window -->" + JSON.stringify(window.objJS));
32
+ // @ts-ignore
33
+ window.sendToIframefromNet = function (target, iframeID, objData) {
34
+ console.log("sendToIframefromNet->", JSON.stringify(target));
35
+ switch (target) {
36
+ case "SMO.setDatasource":
37
+ _this.events.setDatasource.next(objData);
38
+ break;
39
+ case "SMO.checkHealthPrinter":
40
+ _this.events.checkHealthPrinter.next(objData);
41
+ break;
42
+ }
43
+ };
44
+ // @ts-ignore
45
+ window.external = {
46
+ // @ts-ignore
47
+ URLNext: window.objJS.urlNext,
48
+ // @ts-ignore
49
+ LimpiaCapa: window.objJS.limpiaCapa,
50
+ // @ts-ignore
51
+ LogFlash: window.objJS.logFlash,
52
+ // @ts-ignore
53
+ PageInit: window.objJS.pageInit,
54
+ // @ts-ignore
55
+ FinAviso: window.objJS.finAviso,
56
+ // @ts-ignore
57
+ ExitInteractivity: window.objJS.exitInteractivity,
58
+ // @ts-ignore
59
+ LogWeb: window.objJS.logWeb,
60
+ // @ts-ignore
61
+ RefreshPage: window.objJS.refreshPage,
62
+ // @ts-ignore
63
+ RefreshPageByError: window.objJS.refreshPageByError,
64
+ // @ts-ignore
65
+ RefreshPageByVideoEvent: window.objJS.refreshPageByVideoEvent,
66
+ // @ts-ignore
67
+ AuditarRecurso: window.objJS.auditarRecurso,
68
+ // @ts-ignore
69
+ InitSMO: window.objJS.initSMO,
70
+ // @ts-ignore
71
+ GetFile: window.objJS.getFile,
72
+ // @ts-ignore
73
+ ShowBrowser: window.objJS.showBrowser,
74
+ // @ts-ignore
75
+ closeBrowser: window.objJS.closeBrowser,
76
+ // @ts-ignore
77
+ RefreshDataSource: window.objJS.refreshDataSource,
78
+ // @ts-ignore
79
+ SetVariable: window.objJS.setVariable,
80
+ // @ts-ignore
81
+ GetVariable: window.objJS.getVariable,
82
+ // @ts-ignore
83
+ GetLocation: window.objJS.getLocation,
84
+ // @ts-ignore
85
+ SalirApp: window.objJS.salirApp,
86
+ // @ts-ignore
87
+ SetLocalData: window.objJS.setLocalData,
88
+ // @ts-ignore
89
+ GetLocalData: window.objJS.getLocalData,
90
+ // @ts-ignore
91
+ GetSalidaData: window.objJS.getSalidaData,
92
+ // @ts-ignore
93
+ EjecutaFuncion: window.objJS.ejecutaFuncion,
94
+ // @ts-ignore
95
+ AddObserver: window.objJS.addObserver,
96
+ // @ts-ignore
97
+ NotifyToObservers: window.objJS.notifyToObservers,
98
+ // @ts-ignore
99
+ PrintTextLine: window.objJS.printTextLine,
100
+ // @ts-ignore
101
+ PrintBarcode: window.objJS.printBarcode,
102
+ // @ts-ignore
103
+ CutPaper: window.objJS.cutPaper,
104
+ // @ts-ignore
105
+ PrintImage: window.objJS.printImage,
106
+ // @ts-ignore
107
+ CheckHealthPrinter: window.objJS.checkHealthPrinter,
108
+ // @ts-ignore
109
+ CheckHealth: window.objJS.checkHealth,
110
+ // @ts-ignore
111
+ getValorCalendario: window.objJS.getValorCalendario
112
+ };
113
+ }
114
+ else {
115
+ console.log("No existe objJS en window");
116
+ if (this.vars.idSmo) {
117
+ this.id = this.vars.idSmo;
118
+ if (this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)) {
119
+ this.smoCallBacks.onSmoLoad();
120
+ return;
121
+ }
122
+ if (this.vars["url"] != undefined) {
123
+ this.smoCallBacks.getFile(this.vars["url"]);
124
+ this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
125
+ _this.smoCallBacks.getFile(_this.vars["url"]);
126
+ });
127
+ return;
128
+ }
129
+ if (this.vars["LocalData"] != undefined) {
130
+ this.smoCallBacks.getLocalData(this.vars["LocalData"]);
131
+ this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
132
+ _this.smoCallBacks.getLocalData(_this.vars["LocalData"]);
133
+ });
134
+ return;
135
+ }
136
+ return;
137
+ }
138
+ console.warn("No idSmo found in URL");
139
+ return;
140
+ }
141
+ if (this.vars.idSmo) {
142
+ this.id = this.vars.idSmo;
143
+ return;
144
+ }
145
+ console.warn("No idSmo found in URL");
146
+ };
147
+ SMO.prototype.initOnMessage = function () {
148
+ var selft = this;
149
+ window.onmessage = function (e) {
150
+ if (e.data.target) {
151
+ var targets = e.data.target.split('.');
152
+ var func = targets[targets.length - 1];
153
+ if (func == SMO_EVENT_TYPE.start) {
154
+ selft.start();
155
+ return;
156
+ }
157
+ if (func == SMO_EVENT_TYPE.setDatasource) {
158
+ selft.setDatasource(e.data.objData);
159
+ return;
160
+ }
161
+ if (func == SMO_EVENT_TYPE.getVariable) {
162
+ selft.getVariable(e.data.objData);
163
+ return;
164
+ }
165
+ if (func == SMO_EVENT_TYPE.setCurrentStream) {
166
+ selft.setCurrentStream(e.data.objData);
167
+ return;
168
+ }
169
+ if (func == SMO_EVENT_TYPE.infoCurrentLocation) {
170
+ selft.infoCurrentLocation(e.data.objData);
171
+ return;
172
+ }
173
+ if (func == SMO_EVENT_TYPE.setSalidaData) {
174
+ selft.setSalidaData(e.data.objData);
175
+ return;
176
+ }
177
+ if (func == SMO_EVENT_TYPE.updatefromsalida) {
178
+ selft.updatefromsalida(e.data.objData);
179
+ return;
180
+ }
181
+ if (func == SMO_EVENT_TYPE.getRecursosByCodigo) {
182
+ selft.getRecursosByCodigo(e.data.objData);
183
+ return;
184
+ }
185
+ if (func == SMO_EVENT_TYPE.getRecursosByMetadato) {
186
+ selft.getRecursosByMetadato(e.data.objData);
187
+ return;
188
+ }
189
+ if (func == SMO_EVENT_TYPE.getRecursos) {
190
+ selft.getRecursos(e.data.objData);
191
+ }
192
+ if (func == SMO_EVENT_TYPE.getRecursosDefault) {
193
+ selft.getRecursosDefault(e.data.objData);
194
+ }
195
+ if (func == SMO_EVENT_TYPE.getRecursosRelleno) {
196
+ selft.getRecursosRelleno(e.data.objData);
197
+ return;
198
+ }
199
+ if (func == SMO_EVENT_TYPE.getVariableStorage) {
200
+ selft.getVariableStorage(e.data.objData);
201
+ return;
202
+ }
203
+ if (func == SMO_EVENT_TYPE.checkHealth) {
204
+ selft.checkHealth(e.data.objData);
205
+ return;
206
+ }
207
+ if (func == SMO_EVENT_TYPE.checkHealthPrinter) {
208
+ selft.checkHealthPrinter(e.data.objData);
209
+ return;
210
+ }
211
+ if (func == SMO_EVENT_TYPE.getValorCalendario) {
212
+ selft.getValorCalendario(e.data.objData);
213
+ return;
214
+ }
215
+ console.warn("message not implemented!!" + func);
216
+ }
217
+ };
218
+ };
219
+ SMO.prototype.start = function () {
220
+ this.events.start.next({});
221
+ };
222
+ SMO.prototype.setDatasource = function (datasource) {
223
+ this.events.setDatasource.next(datasource);
224
+ this.events.setDatasourceJson.next(this.utils.xmlToJSON(datasource.xml));
225
+ };
226
+ SMO.prototype.getVariable = function (variable) {
227
+ this.events.getVariable.next(variable);
228
+ };
229
+ SMO.prototype.setCurrentStream = function (stream) {
230
+ this.events.setCurrentStream.next(stream);
231
+ };
232
+ SMO.prototype.infoCurrentLocation = function (location) {
233
+ this.events.infoCurrentLocation.next(location);
234
+ };
235
+ SMO.prototype.setSalidaData = function (data) {
236
+ this.events.setSalidaData.next(data);
237
+ };
238
+ SMO.prototype.updatefromsalida = function (data) {
239
+ this.events.updatefromsalida.next(data);
240
+ };
241
+ SMO.prototype.getRecursosByCodigo = function (data) {
242
+ this.events.getRecursosByCodigo.next(data);
243
+ };
244
+ SMO.prototype.getRecursosByMetadato = function (data) {
245
+ this.events.getRecursosByMetadato.next(data);
246
+ };
247
+ SMO.prototype.getRecursos = function (data) {
248
+ this.events.getRecursos.next(data);
249
+ };
250
+ SMO.prototype.getRecursosDefault = function (data) {
251
+ this.events.getRecursosDefault.next(data);
252
+ };
253
+ SMO.prototype.getRecursosRelleno = function (data) {
254
+ this.events.getRecursosRelleno.next(data);
255
+ };
256
+ SMO.prototype.getVariableStorage = function (variable) {
257
+ this.events.getVariableStorage.next(variable);
258
+ };
259
+ SMO.prototype.checkHealth = function (json) {
260
+ this.events.checkHealth.next(json);
261
+ };
262
+ SMO.prototype.checkHealthPrinter = function (json) {
263
+ this.events.checkHealthPrinter.next(json);
264
+ };
265
+ SMO.prototype.getValorCalendario = function (estado) {
266
+ this.events.getValorCalendario.next(estado);
267
+ };
268
+ return SMO;
269
+ }());
270
+ exports.SMO = SMO;
271
+ var SmoEvents = /** @class */ (function () {
272
+ function SmoEvents(smo) {
273
+ this.start = new rxjs_1.Subject();
274
+ this.setDatasource = new rxjs_1.Subject();
275
+ this.setDatasourceJson = new rxjs_1.Subject();
276
+ this.getVariable = new rxjs_1.Subject();
277
+ this.setCurrentStream = new rxjs_1.Subject();
278
+ this.infoCurrentLocation = new rxjs_1.Subject();
279
+ this.setSalidaData = new rxjs_1.Subject();
280
+ this.updatefromsalida = new rxjs_1.Subject();
281
+ this.getRecursosByCodigo = new rxjs_1.Subject();
282
+ this.getRecursosByMetadato = new rxjs_1.Subject();
283
+ this.getRecursos = new rxjs_1.Subject();
284
+ this.getRecursosDefault = new rxjs_1.Subject();
285
+ this.getRecursosRelleno = new rxjs_1.Subject();
286
+ this.getVariableStorage = new rxjs_1.Subject();
287
+ this.checkHealth = new rxjs_1.Subject();
288
+ this.checkHealthPrinter = new rxjs_1.Subject();
289
+ this.getValorCalendario = new rxjs_1.Subject();
290
+ }
291
+ return SmoEvents;
292
+ }());
293
+ var smoCallBacks = /** @class */ (function () {
294
+ function smoCallBacks(_smo) {
295
+ this.smo = _smo;
296
+ }
297
+ smoCallBacks.prototype.onSmoLoad = function () {
298
+ this.smo.utils.sendToParent({
299
+ target: "Dnv.smoCallbacks.onSmoLoad",
300
+ objData: undefined,
301
+ idSmo: this.smo.id
302
+ }, this.smo.vars.idSmo);
303
+ };
304
+ smoCallBacks.prototype.onSmoReady = function () {
305
+ this.smo.utils.sendToParent({
306
+ target: "Dnv.smoCallbacks.onSmoReady",
307
+ objData: undefined,
308
+ idSmo: this.smo.id
309
+ }, this.smo.vars.idSmo);
310
+ };
311
+ smoCallBacks.prototype.smoLog = function (msn, level) {
312
+ if (level == undefined) {
313
+ level = LogLevel.Info;
314
+ }
315
+ //level = Dnv.LogLevel.Debug...
316
+ if (level == LogLevel.Debug) {
317
+ console.debug(msn);
318
+ }
319
+ if (level == LogLevel.Info) {
320
+ console.log(msn);
321
+ }
322
+ if (level == LogLevel.Warning) {
323
+ console.warn(msn);
324
+ }
325
+ if (level == LogLevel.Error) {
326
+ console.error(msn);
327
+ }
328
+ if (window.parent != window) {
329
+ this.smo.utils.sendToParent({
330
+ target: "Dnv.smoCallbacks.smoLog",
331
+ objData: {
332
+ level: level,
333
+ txt: msn
334
+ },
335
+ idSmo: this.smo.id
336
+ }, this.smo.vars.idSmo);
337
+ }
338
+ };
339
+ smoCallBacks.prototype.smoAlarma = function (msn, level) {
340
+ this.smo.utils.sendToParent({
341
+ target: "Dnv.smoCallbacks.smoAlarma",
342
+ objData: {
343
+ level: level,
344
+ txt: msn
345
+ },
346
+ idSmo: this.smo.id
347
+ }, this.smo.vars.idSmo);
348
+ };
349
+ smoCallBacks.prototype.smoLogStash = function (msn) {
350
+ this.smo.utils.sendToParent({
351
+ target: "Dnv.smoCallbacks.smoLogStash",
352
+ objData: {
353
+ txt: msn
354
+ },
355
+ idSmo: this.smo.id
356
+ }, this.smo.vars.idSmo);
357
+ };
358
+ smoCallBacks.prototype.smoLogNowShowing = function (msn) {
359
+ this.smo.utils.sendToParent({
360
+ target: "Dnv.smoCallbacks.smoNowShowing",
361
+ objData: msn,
362
+ idSmo: this.smo.id
363
+ }, this.smo.vars.idSmo);
364
+ };
365
+ smoCallBacks.prototype.reiniciarDispositivo = function (msn) {
366
+ //Permite reiniciar el player, proporcionando una razón para el reinicio. Solo Player HTML5
367
+ this.smo.utils.sendToParent({
368
+ target: "Dnv.smoCallbacks.reiniciarDispositivo",
369
+ objData: {
370
+ txt: msn // Razón del reinicio
371
+ },
372
+ idSmo: this.smo.id
373
+ }, this.smo.vars.idSmo);
374
+ };
375
+ smoCallBacks.prototype.urlNext = function () {
376
+ //Permite avanzar plantilla. Solo si Reloj Maestro activado.
377
+ this.smo.utils.sendToParent({
378
+ target: "Dnv.smoCallbacks.urlNext",
379
+ objData: undefined,
380
+ idSmo: this.smo.id
381
+ }, this.smo.vars.idSmo);
382
+ };
383
+ smoCallBacks.prototype.exitInteractivity = function () {
384
+ //Para canales interactivos, vuelve al canal de reposo. Solo Android y Player PC.
385
+ this.smo.utils.sendToParent({
386
+ target: "Dnv.smoCallbacks.exitInteractivity",
387
+ objData: undefined,
388
+ idSmo: this.smo.id
389
+ }, this.smo.vars.idSmo);
390
+ };
391
+ smoCallBacks.prototype.showBrowser = function () {
392
+ /* DEPRECATED NOT IMPLEMENTED */
393
+ };
394
+ smoCallBacks.prototype.closeBrowser = function () {
395
+ /* DEPRECATED NOT IMPLEMENTED */
396
+ };
397
+ smoCallBacks.prototype.urlNextDirectamente = function () {
398
+ /* NOT IMPLEMENTED */
399
+ };
400
+ smoCallBacks.prototype.setVariable = function (variable, valor) {
401
+ this.smo.utils.sendToParent({
402
+ target: "Dnv.smoCallbacks.setVariable",
403
+ objData: {
404
+ variable: variable,
405
+ valor: valor
406
+ },
407
+ idSmo: this.smo.id
408
+ }, this.smo.vars.idSmo);
409
+ };
410
+ smoCallBacks.prototype.getVariable = function (variable) {
411
+ this.smo.utils.sendToParent({
412
+ target: "Dnv.smoCallbacks.getVariable",
413
+ objData: {
414
+ variable: variable
415
+ },
416
+ idSmo: this.smo.id
417
+ }, this.smo.vars.idSmo);
418
+ /* MIRAR SMO.getVariable */
419
+ };
420
+ smoCallBacks.prototype.getFile = function (file) {
421
+ this.smo.utils.sendToParent({
422
+ target: "Dnv.smoCallbacks.getFile",
423
+ objData: file,
424
+ idSmo: this.smo.id
425
+ }, this.smo.vars.idSmo);
426
+ };
427
+ smoCallBacks.prototype.setLocalData = function (variable, valor) {
428
+ this.smo.utils.sendToParent({
429
+ target: "Dnv.smoCallbacks.setLocalData",
430
+ objData: {
431
+ nameData: variable,
432
+ data: valor
433
+ },
434
+ idSmo: this.smo.id
435
+ }, this.smo.vars.idSmo);
436
+ };
437
+ smoCallBacks.prototype.getLocalData = function (variable) {
438
+ this.smo.utils.sendToParent({
439
+ target: "Dnv.smoCallbacks.getLocalData",
440
+ objData: variable, // nameData
441
+ idSmo: this.smo.id
442
+ }, this.smo.vars.idSmo);
443
+ /* MIRAR SMO.setDatasource */
444
+ };
445
+ smoCallBacks.prototype.getCurrentStream = function () {
446
+ this.smo.utils.sendToParent({
447
+ target: "Dnv.smoCallbacks.getCurrentStream",
448
+ objData: undefined,
449
+ idSmo: this.smo.id
450
+ }, this.smo.vars.idSmo);
451
+ /* MIRAR SMO.setCurrentStream' */
452
+ };
453
+ smoCallBacks.prototype.finAviso = function (id) {
454
+ this.smo.utils.sendToParent({
455
+ target: "Dnv.smoCallbacks.finAviso",
456
+ objData: id, // id del aviso
457
+ idSmo: this.smo.id
458
+ }, this.smo.vars.idSmo);
459
+ };
460
+ smoCallBacks.prototype.refreshDatasource = function (codigo) {
461
+ this.smo.utils.sendToParent({
462
+ target: "Dnv.smoCallbacks.refreshDatasource",
463
+ objData: codigo, // Codigo del datasource
464
+ idSmo: this.smo.id
465
+ }, this.smo.vars.idSmo);
466
+ };
467
+ smoCallBacks.prototype.getLocation = function () {
468
+ this.smo.utils.sendToParent({
469
+ target: "Dnv.smoCallbacks.getLocation",
470
+ objData: undefined,
471
+ idSmo: this.smo.id
472
+ }, this.smo.vars.idSmo);
473
+ /* MIRAR SMO.infoCurrentLocation */
474
+ };
475
+ smoCallBacks.prototype.getSalidaData = function (data) {
476
+ this.smo.utils.sendToParent({
477
+ target: "Dnv.smoCallbacks.getSalidaData",
478
+ objData: data, // Nombre del "data" que solicita. El player recibe ese string y hace un select case del mismo para devolver un json con datos al smo\html5 que le ha invocado.
479
+ idSmo: this.smo.id
480
+ }, this.smo.vars.idSmo);
481
+ /* MIRAR SMO.setSalidaData */
482
+ };
483
+ smoCallBacks.prototype.ejecutaFuncion = function (data) {
484
+ /*data ={
485
+ funcion: "", // Nombre de la función que se debe ejecutar
486
+ params: "" // Parámetros que debemos enviarle a la funcion. sin separadores ni nada, un string y se usa como tal. Solo esta implementada en un caso y se usa como tal sin parsear ni nada
487
+ } */
488
+ this.smo.utils.sendToParent({
489
+ target: "Dnv.smoCallbacks.ejecutaFuncion",
490
+ objData: data,
491
+ idSmo: this.smo.id
492
+ }, this.smo.vars.idSmo);
493
+ };
494
+ smoCallBacks.prototype.addObserver = function (data) {
495
+ /*data ="fruta"
496
+ */
497
+ this.smo.utils.sendToParent({
498
+ target: "Dnv.smoCallbacks.addObserver",
499
+ objData: data,
500
+ idSmo: this.smo.id
501
+ }, this.smo.vars.idSmo);
502
+ };
503
+ smoCallBacks.prototype.notify = function (data) {
504
+ /*data ={
505
+ destino: "fruta",
506
+ value: "{'fruta':'manzana', 'color':'roja'}"
507
+ } */
508
+ this.smo.utils.sendToParent({
509
+ target: "Dnv.smoCallbacks.notify",
510
+ objData: data,
511
+ idSmo: this.smo.id
512
+ }, this.smo.vars.idSmo);
513
+ };
514
+ smoCallBacks.prototype.playOnceChannelByTrigger = function (trigger) {
515
+ this.smo.utils.sendToParent({
516
+ target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
517
+ objData: { triggerCanal: trigger },
518
+ idSmo: this.smo.id
519
+ }, this.smo.vars.idSmo);
520
+ };
521
+ smoCallBacks.prototype.stopPlayOnceChannelByTrigger = function () {
522
+ this.smo.utils.sendToParent({ target: "Dnv.smoCallbacks.stopPlayOnceChannelByTrigger", objData: {}, idSmo: this.smo.id }, this.smo.vars.idSmo);
523
+ };
524
+ smoCallBacks.prototype.playOnceChannel = function (codigoCanal) {
525
+ this.smo.utils.sendToParent({ target: "Dnv.smoCallbacks.playOnceChannel", objData: { codigoCanal: codigoCanal, params: "PLAYONCE_CHANNEL|" + codigoCanal }, idSmo: this.smo.id }, this.smo.vars.idSmo);
526
+ };
527
+ smoCallBacks.prototype.stopPlayChannel = function () {
528
+ this.smo.utils.sendToParent({ target: "Dnv.smoCallbacks.stopPlayOnceChannel", objData: {}, idSmo: this.smo.id }, this.smo.vars.idSmo);
529
+ };
530
+ smoCallBacks.prototype.editWrapperStyle = function (obj) {
531
+ /*{"posX": "0px","posY": "0px","alto": "0px","ancho": "0px","overflow": "hidden","scale": 0.1,"zindex": 0.1,"opacidad": 0.1,"isMaestro": true,duracionTransition: "1s", transitionTiming: "lineal", css: string} */
532
+ this.smo.utils.sendToParent({
533
+ target: "Dnv.smoCallbacks.editWrapperStyle",
534
+ objData: obj,
535
+ idSmo: this.smo.id
536
+ }, this.smo.vars.idSmo);
537
+ };
538
+ smoCallBacks.prototype.getRecursosByCodigo = function (codigos) {
539
+ /** ["123456","654321"] */
540
+ this.smo.utils.sendToParent({
541
+ target: "Dnv.smoCallbacks.getRecursosByCodigo",
542
+ objData: {
543
+ recursos: codigos
544
+ },
545
+ idSmo: this.smo.id
546
+ }, this.smo.vars.idSmo);
547
+ };
548
+ smoCallBacks.prototype.getRecursosByMetadato = function (metadato, valor) {
549
+ this.smo.utils.sendToParent({
550
+ target: "Dnv.smoCallbacks.getRecursosByMetadato",
551
+ objData: {
552
+ metadato: metadato,
553
+ valor: valor
554
+ },
555
+ idSmo: this.smo.id
556
+ }, this.smo.vars.idSmo);
557
+ };
558
+ smoCallBacks.prototype.getRecursos = function () {
559
+ this.smo.utils.sendToParent({
560
+ target: "Dnv.smoCallbacks.getRecursos",
561
+ idSmo: this.smo.id
562
+ }, this.smo.vars.idSmo);
563
+ };
564
+ smoCallBacks.prototype.getRecursosDefault = function () {
565
+ this.smo.utils.sendToParent({
566
+ target: "Dnv.smoCallbacks.getRecursosDefault",
567
+ idSmo: this.smo.id
568
+ }, this.smo.vars.idSmo);
569
+ };
570
+ smoCallBacks.prototype.getRecursosRelleno = function () {
571
+ this.smo.utils.sendToParent({
572
+ target: "Dnv.smoCallbacks.getRecursosRelleno",
573
+ idSmo: this.smo.id
574
+ }, this.smo.vars.idSmo);
575
+ };
576
+ smoCallBacks.prototype.setVariableStorage = function (variable, valor) {
577
+ this.smo.utils.sendToParent({
578
+ target: "Dnv.smoCallbacks.setVariableStorage",
579
+ objData: {
580
+ variable: variable,
581
+ valor: valor
582
+ },
583
+ idSmo: this.smo.id
584
+ }, this.smo.vars.idSmo);
585
+ };
586
+ smoCallBacks.prototype.getVariableStorage = function (variable) {
587
+ this.smo.utils.sendToParent({
588
+ target: "Dnv.smoCallbacks.getVariableStorage",
589
+ objData: {
590
+ variable: variable
591
+ },
592
+ idSmo: this.smo.id
593
+ }, this.smo.vars.idSmo);
594
+ /* MIRAR SMO.getVariable */
595
+ };
596
+ smoCallBacks.prototype.printTextLine = function (txt) {
597
+ this.smo.utils.sendToParent({
598
+ target: "Dnv.smoCallbacks.printTextLine",
599
+ objData: {
600
+ txt: txt
601
+ },
602
+ idSmo: this.smo.id
603
+ }, this.smo.vars.idSmo);
604
+ };
605
+ smoCallBacks.prototype.printBarcode = function (code, width, height) {
606
+ this.smo.utils.sendToParent({
607
+ target: "Dnv.smoCallbacks.printBarcode",
608
+ objData: {
609
+ code: code,
610
+ width: width,
611
+ height: height
612
+ },
613
+ idSmo: this.smo.id
614
+ }, this.smo.vars.idSmo);
615
+ };
616
+ smoCallBacks.prototype.cutPaper = function (percent) {
617
+ this.smo.utils.sendToParent({
618
+ target: "Dnv.smoCallbacks.cutPaper",
619
+ objData: {
620
+ percent: percent
621
+ },
622
+ idSmo: this.smo.id
623
+ }, this.smo.vars.idSmo);
624
+ };
625
+ smoCallBacks.prototype.checkHealth = function () {
626
+ this.smo.utils.sendToParent({
627
+ target: "Dnv.smoCallbacks.checkHealth",
628
+ idSmo: this.smo.id
629
+ }, this.smo.vars.idSmo);
630
+ };
631
+ smoCallBacks.prototype.checkHealthPrinter = function () {
632
+ this.smo.utils.sendToParent({
633
+ target: "Dnv.smoCallbacks.checkHealthPrinter",
634
+ idSmo: this.smo.id
635
+ }, this.smo.vars.idSmo);
636
+ };
637
+ smoCallBacks.prototype.printImage = function (image) {
638
+ this.smo.utils.sendToParent({
639
+ target: "Dnv.smoCallbacks.printImage",
640
+ objData: {
641
+ image: image
642
+ },
643
+ idSmo: this.smo.id
644
+ }, this.smo.vars.idSmo);
645
+ };
646
+ smoCallBacks.prototype.getValorCalendario = function (codigo, tipoObjeto) {
647
+ this.smo.utils.sendToParent({
648
+ target: "Dnv.smoCallbacks.getValorCalendario",
649
+ objData: {
650
+ codigo: codigo,
651
+ tipoObjeto: tipoObjeto
652
+ },
653
+ idSmo: this.smo.id
654
+ }, this.smo.vars.idSmo);
655
+ };
656
+ return smoCallBacks;
657
+ }());
658
+ var Utils = /** @class */ (function () {
659
+ function Utils(_smo, _smoCallBacks) {
660
+ this.smo = _smo;
661
+ this.smoCallBacks = _smoCallBacks;
662
+ }
663
+ // Funciones para XML to JSON
664
+ Utils.prototype.xmlToJSON = function (xml) {
665
+ var getxml = new DOMParser();
666
+ var sinSaltosYTabulaciones = xml.replace(/[\n\r\t]/g, '');
667
+ var sinEspaciosEntreTags = sinSaltosYTabulaciones.replace(/>\s*</g, '><');
668
+ var xmlDoc = getxml.parseFromString(sinEspaciosEntreTags, "text/xml");
669
+ // gets the JSON string
670
+ var json_str = this.jsonToStr(this.setJsonObj(xmlDoc));
671
+ // sets and returns the JSON object, if "rstr" undefined (not passed), else, returns JSON string
672
+ return json_str;
673
+ };
674
+ Utils.prototype.jsonToStr = function (js_obj) {
675
+ var rejsn = JSON.stringify(js_obj, undefined, 2).replace(/(\\t|\\r|\\n)/g, '').replace(/"",[\n\t\r\s]+""[,]*/g, '').replace(/(\n[\t\s\r]*\n)/g, '').replace(/[\s\t]{2,}""[,]{0,1}/g, '').replace(/"[\s\t]{1,}"[,]{0,1}/g, '').replace(/\[[\t\s]*\]/g, '""');
676
+ return (rejsn.indexOf('"parsererror": {') == -1) ? rejsn : 'Invalid XML format';
677
+ };
678
+ Utils.prototype.sendToParent = function (obj, dest) {
679
+ console.log('sendToParent->', JSON.stringify(obj));
680
+ //@ts-ignore
681
+ if (window.objJS != undefined && this.smo.vars != undefined && this.smo.vars.ontop != undefined && this.smo.vars.ontop != "") {
682
+ switch (obj.target) {
683
+ case "Dnv.smoCallbacks.onSmoLoad":
684
+ // @ts-ignore
685
+ window.objJS.onSmoLoad();
686
+ break;
687
+ case "Dnv.smoCallbacks.printTextLine":
688
+ // @ts-ignore
689
+ window.objJS.printTextLine(obj.objData.txt);
690
+ break;
691
+ case "Dnv.smoCallbacks.printBarcode":
692
+ // @ts-ignore
693
+ window.objJS.printBarcode(obj.objData.code, obj.objData.width, obj.objData.height);
694
+ break;
695
+ case "Dnv.smoCallbacks.cutPaper":
696
+ // @ts-ignore
697
+ window.objJS.cutPaper(obj.objData.percent);
698
+ break;
699
+ case "Dnv.smoCallbacks.printImage":
700
+ // @ts-ignore
701
+ window.objJS.printImage(obj.idSmo, obj.objData.image);
702
+ break;
703
+ case "Dnv.smoCallbacks.checkHealthPrinter":
704
+ console.log('llamo a checkhealthprinter');
705
+ // @ts-ignore
706
+ window.objJS.checkHealthPrinter(obj.idSmo);
707
+ break;
708
+ case "Dnv.smoCallbacks.checkHealth":
709
+ // @ts-ignore
710
+ window.objJS.checkHealth();
711
+ break;
712
+ case "Dnv.smoCallbacks.getFile":
713
+ // @ts-ignore
714
+ window.objJS.getFile(dest, obj.objData);
715
+ break;
716
+ }
717
+ return;
718
+ }
719
+ /* // @ts-ignore
720
+ window.parent.postMessage = (target,objData,idSmo)=> {
721
+ switch (target.target) {
722
+ case "Dnv.smoCallbacks.onSmoLoad":
723
+ // @ts-ignore
724
+ window.objJS.onSmoLoad();
725
+ break;
726
+
727
+ case "Dnv.smoCallbacks.printTextLine":
728
+ // @ts-ignore
729
+ window.objJS.printTextLine(objData.txt);
730
+ break;
731
+ case "Dnv.smoCallbacks.printBarcode":
732
+ // @ts-ignore
733
+ window.objJS.printBarcode(objData.code, objData.width, objData.height);
734
+ break;
735
+ case "Dnv.smoCallbacks.cutPaper":
736
+ // @ts-ignore
737
+ window.objJS.cutPaper(objData.percent);
738
+ break;
739
+ case "Dnv.smoCallbacks.printImage":
740
+ // @ts-ignore
741
+ window.objJS.printImage(idSmo, objData.image);
742
+ break;
743
+ case "Dnv.smoCallbacks.checkHealthPrinter":
744
+ console.log('llamo a checkhealthprinter');
745
+ // @ts-ignore
746
+
747
+ window.objJS.checkHealthPrinter(idSmo);
748
+ break;
749
+ case "Dnv.smoCallbacks.checkHealth":
750
+ // @ts-ignore
751
+ window.objJS.checkHealth();
752
+ break;
753
+
754
+
755
+ }
756
+ }*/
757
+ window.parent.postMessage(obj, "*");
758
+ };
759
+ Utils.prototype.setJsonObj = function (xml) {
760
+ var jsonObj = {};
761
+ if (xml.nodeType == 1) { // Element
762
+ if (xml.attributes.length > 0) {
763
+ jsonObj["ATTRIBUTES"] = {};
764
+ for (var j = 0; j < xml.attributes.length; j++) {
765
+ var attribute = xml.attributes.item(j);
766
+ jsonObj["ATTRIBUTES"][attribute.nodeName] = attribute.nodeValue;
767
+ }
768
+ }
769
+ }
770
+ else if (xml.nodeType == 3) { // Text
771
+ jsonObj = xml.nodeValue.trim();
772
+ }
773
+ else if (xml.nodeType == 4) { // CDATA
774
+ jsonObj = xml.nodeValue.trim();
775
+ }
776
+ if (xml.hasChildNodes()) {
777
+ for (var i = 0; i < xml.childNodes.length; i++) {
778
+ var item = xml.childNodes[i];
779
+ var nodeName = item.nodeName;
780
+ if (nodeName == "#text" && item.nodeType == 3) {
781
+ jsonObj = item.nodeValue.trim();
782
+ }
783
+ else if (nodeName == "#cdata-section" && (item.nodeType == 4 || item.nodeType == 3)) { //Para que quede bonito
784
+ jsonObj["CDATA"] = this.setJsonObj(item);
785
+ }
786
+ else if (typeof jsonObj[nodeName] === "undefined") {
787
+ jsonObj[nodeName] = this.setJsonObj(item);
788
+ }
789
+ else {
790
+ if (!Array.isArray(jsonObj[nodeName])) {
791
+ jsonObj[nodeName] = [jsonObj[nodeName]];
792
+ }
793
+ jsonObj[nodeName].push(this.setJsonObj(item));
794
+ }
795
+ }
796
+ }
797
+ return jsonObj;
798
+ };
799
+ Utils.prototype.dataToJSON = function (data) {
800
+ try {
801
+ var parser = new DOMParser();
802
+ var xmlDoc = parser.parseFromString(data.xml, "text/xml");
803
+ var dataForJSON = xmlDoc.getElementsByTagName("item")[0].innerHTML;
804
+ dataForJSON = dataForJSON.replace(/{'/g, '{"').replace(/'}/g, '"}').replace(/:'/g, ':"').replace(/':/g, '":').replace(/,'/g, ',"').replace(/',/g, '",').replace(/\['/g, '["').replace(/'\]/g, '"]').replace(/(\r\n|\n|\r)/gm, "");
805
+ return JSON.parse(dataForJSON);
806
+ }
807
+ catch (error) {
808
+ return {};
809
+ }
810
+ };
811
+ return Utils;
812
+ }());
813
+ var SMO_EVENT_TYPE;
814
+ (function (SMO_EVENT_TYPE) {
815
+ SMO_EVENT_TYPE["start"] = "start";
816
+ SMO_EVENT_TYPE["setDatasource"] = "setDatasource";
817
+ SMO_EVENT_TYPE["getVariable"] = "getVariable";
818
+ SMO_EVENT_TYPE["setCurrentStream"] = "setCurrentStream";
819
+ SMO_EVENT_TYPE["infoCurrentLocation"] = "infoCurrentLocation";
820
+ SMO_EVENT_TYPE["setSalidaData"] = "setSalidaData";
821
+ SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
822
+ SMO_EVENT_TYPE["setDatasourceJson"] = "setDatasourceJson";
823
+ SMO_EVENT_TYPE["getRecursosByCodigo"] = "getRecursosByCodigo";
824
+ SMO_EVENT_TYPE["getRecursosByMetadato"] = "getRecursosByMetadato";
825
+ SMO_EVENT_TYPE["getRecursos"] = "getRecursos";
826
+ SMO_EVENT_TYPE["getRecursosDefault"] = "getRecursosDefault";
827
+ SMO_EVENT_TYPE["getRecursosRelleno"] = "getRecursosRelleno";
828
+ SMO_EVENT_TYPE["getVariableStorage"] = "getVariableStorage";
829
+ SMO_EVENT_TYPE["checkHealth"] = "checkHealth";
830
+ SMO_EVENT_TYPE["checkHealthPrinter"] = "checkHealthPrinter";
831
+ SMO_EVENT_TYPE["getValorCalendario"] = "getValorCalendario";
832
+ })(SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = SMO_EVENT_TYPE = {}));
833
+ var LogLevel;
834
+ (function (LogLevel) {
835
+ LogLevel[LogLevel["Debug"] = 0] = "Debug";
836
+ LogLevel[LogLevel["Info"] = 1] = "Info";
837
+ LogLevel[LogLevel["Warning"] = 2] = "Warning";
838
+ LogLevel[LogLevel["Error"] = 3] = "Error";
839
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
840
+ var AlarmaLevel;
841
+ (function (AlarmaLevel) {
842
+ AlarmaLevel[AlarmaLevel["Ok_off"] = 0] = "Ok_off";
843
+ AlarmaLevel[AlarmaLevel["Ok"] = 1] = "Ok";
844
+ AlarmaLevel[AlarmaLevel["Scanning"] = 2] = "Scanning";
845
+ AlarmaLevel[AlarmaLevel["Timeout"] = 3] = "Timeout";
846
+ AlarmaLevel[AlarmaLevel["Warning"] = 4] = "Warning";
847
+ AlarmaLevel[AlarmaLevel["Error"] = 5] = "Error";
848
+ })(AlarmaLevel || (exports.AlarmaLevel = AlarmaLevel = {}));