@denevads/dnv-smo 1.0.35 → 1.0.37

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.
@@ -51,6 +51,15 @@ export interface GetRecursosRelleno {
51
51
  codigo: number;
52
52
  recursos: Recurso[];
53
53
  }
54
+ export interface GetRecursosMetadatos {
55
+ metadato: string;
56
+ valor: string;
57
+ }
58
+ export interface RecursosMetadato {
59
+ metadato: string;
60
+ valor: string;
61
+ recursos?: Recurso[];
62
+ }
54
63
  export interface Recurso {
55
64
  codigo: number;
56
65
  url: string;
package/dist/smo.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno } from "./interfaces/callbacks";
1
+ import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato } from "./interfaces/callbacks";
2
2
  import { Subject } from 'rxjs';
3
3
  export declare class SMO {
4
4
  vars: any;
@@ -19,6 +19,8 @@ export declare class SMO {
19
19
  setSalidaData(data: DataSalida): void;
20
20
  updatefromsalida(data: any): void;
21
21
  getRecursosByCodigo(data: GetRecursosByCodigo): void;
22
+ getRecursosByMetadato(data: GetRecursosByCodigo): void;
23
+ getRecursosByMetadatos(data: RecursosMetadato[]): void;
22
24
  getRecursos(data: GetRecursos): void;
23
25
  getRecursosDefault(data: GetRecursos): void;
24
26
  getRecursosRelleno(data: GetRecursosRelleno): void;
@@ -37,6 +39,8 @@ declare class SmoEvents {
37
39
  setSalidaData: Subject<DataSalida>;
38
40
  updatefromsalida: Subject<any>;
39
41
  getRecursosByCodigo: Subject<GetRecursosByCodigo>;
42
+ getRecursosByMetadato: Subject<GetRecursosByCodigo>;
43
+ getRecursosByMetadatos: Subject<RecursosMetadato[]>;
40
44
  getRecursos: Subject<GetRecursos>;
41
45
  getRecursosDefault: Subject<GetRecursos>;
42
46
  getRecursosRelleno: Subject<GetRecursosRelleno>;
@@ -80,6 +84,8 @@ declare class smoCallBacks {
80
84
  stopPlayChannel(): void;
81
85
  editWrapperStyle(obj: any): void;
82
86
  getRecursosByCodigo(codigos: any): void;
87
+ getRecursosByMetadato(metadato: string, valor: string): void;
88
+ getRecursosByMetadatos(data: GetRecursosMetadatos[]): void;
83
89
  getRecursos(): void;
84
90
  getRecursosDefault(): void;
85
91
  getRecursosRelleno(): void;
@@ -113,6 +119,8 @@ export declare enum SMO_EVENT_TYPE {
113
119
  updatefromsalida = "updatefromsalida",
114
120
  setDatasourceJson = "setDatasourceJson",
115
121
  getRecursosByCodigo = "getRecursosByCodigo",
122
+ getRecursosByMetadato = "getRecursosByMetadato",
123
+ getRecursosByMetadatos = "getRecursosByMetadatos",
116
124
  getRecursos = "getRecursos",
117
125
  getRecursosDefault = "getRecursosDefault",
118
126
  getRecursosRelleno = "getRecursosRelleno",
package/dist/smo.js CHANGED
@@ -182,6 +182,14 @@ var SMO = /** @class */ (function () {
182
182
  selft.getRecursosByCodigo(e.data.objData);
183
183
  return;
184
184
  }
185
+ if (func == SMO_EVENT_TYPE.getRecursosByMetadato) {
186
+ selft.getRecursosByMetadato(e.data.objData);
187
+ return;
188
+ }
189
+ if (func == SMO_EVENT_TYPE.getRecursosByMetadatos) {
190
+ selft.getRecursosByMetadatos(e.data.objData);
191
+ return;
192
+ }
185
193
  if (func == SMO_EVENT_TYPE.getRecursos) {
186
194
  selft.getRecursos(e.data.objData);
187
195
  }
@@ -237,6 +245,12 @@ var SMO = /** @class */ (function () {
237
245
  SMO.prototype.getRecursosByCodigo = function (data) {
238
246
  this.events.getRecursosByCodigo.next(data);
239
247
  };
248
+ SMO.prototype.getRecursosByMetadato = function (data) {
249
+ this.events.getRecursosByMetadato.next(data);
250
+ };
251
+ SMO.prototype.getRecursosByMetadatos = function (data) {
252
+ this.events.getRecursosByMetadatos.next(data);
253
+ };
240
254
  SMO.prototype.getRecursos = function (data) {
241
255
  this.events.getRecursos.next(data);
242
256
  };
@@ -272,6 +286,8 @@ var SmoEvents = /** @class */ (function () {
272
286
  this.setSalidaData = new rxjs_1.Subject();
273
287
  this.updatefromsalida = new rxjs_1.Subject();
274
288
  this.getRecursosByCodigo = new rxjs_1.Subject();
289
+ this.getRecursosByMetadato = new rxjs_1.Subject();
290
+ this.getRecursosByMetadatos = new rxjs_1.Subject();
275
291
  this.getRecursos = new rxjs_1.Subject();
276
292
  this.getRecursosDefault = new rxjs_1.Subject();
277
293
  this.getRecursosRelleno = new rxjs_1.Subject();
@@ -429,7 +445,7 @@ var smoCallBacks = /** @class */ (function () {
429
445
  smoCallBacks.prototype.getLocalData = function (variable) {
430
446
  this.smo.utils.sendToParent({
431
447
  target: "Dnv.smoCallbacks.getLocalData",
432
- objData: variable,
448
+ objData: variable, // nameData
433
449
  idSmo: this.smo.id
434
450
  }, this.smo.vars.idSmo);
435
451
  /* MIRAR SMO.setDatasource */
@@ -445,14 +461,14 @@ var smoCallBacks = /** @class */ (function () {
445
461
  smoCallBacks.prototype.finAviso = function (id) {
446
462
  this.smo.utils.sendToParent({
447
463
  target: "Dnv.smoCallbacks.finAviso",
448
- objData: id,
464
+ objData: id, // id del aviso
449
465
  idSmo: this.smo.id
450
466
  }, this.smo.vars.idSmo);
451
467
  };
452
468
  smoCallBacks.prototype.refreshDatasource = function (codigo) {
453
469
  this.smo.utils.sendToParent({
454
470
  target: "Dnv.smoCallbacks.refreshDatasource",
455
- objData: codigo,
471
+ objData: codigo, // Codigo del datasource
456
472
  idSmo: this.smo.id
457
473
  }, this.smo.vars.idSmo);
458
474
  };
@@ -467,7 +483,7 @@ var smoCallBacks = /** @class */ (function () {
467
483
  smoCallBacks.prototype.getSalidaData = function (data) {
468
484
  this.smo.utils.sendToParent({
469
485
  target: "Dnv.smoCallbacks.getSalidaData",
470
- objData: data,
486
+ 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.
471
487
  idSmo: this.smo.id
472
488
  }, this.smo.vars.idSmo);
473
489
  /* MIRAR SMO.setSalidaData */
@@ -537,6 +553,23 @@ var smoCallBacks = /** @class */ (function () {
537
553
  idSmo: this.smo.id
538
554
  }, this.smo.vars.idSmo);
539
555
  };
556
+ smoCallBacks.prototype.getRecursosByMetadato = function (metadato, valor) {
557
+ this.smo.utils.sendToParent({
558
+ target: "Dnv.smoCallbacks.getRecursosByMetadato",
559
+ objData: {
560
+ metadato: metadato,
561
+ valor: valor
562
+ },
563
+ idSmo: this.smo.id
564
+ }, this.smo.vars.idSmo);
565
+ };
566
+ smoCallBacks.prototype.getRecursosByMetadatos = function (data) {
567
+ this.smo.utils.sendToParent({
568
+ target: "Dnv.smoCallbacks.getRecursosByMetadatos",
569
+ objData: data,
570
+ idSmo: this.smo.id
571
+ }, this.smo.vars.idSmo);
572
+ };
540
573
  smoCallBacks.prototype.getRecursos = function () {
541
574
  this.smo.utils.sendToParent({
542
575
  target: "Dnv.smoCallbacks.getRecursos",
@@ -803,6 +836,8 @@ var SMO_EVENT_TYPE;
803
836
  SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
804
837
  SMO_EVENT_TYPE["setDatasourceJson"] = "setDatasourceJson";
805
838
  SMO_EVENT_TYPE["getRecursosByCodigo"] = "getRecursosByCodigo";
839
+ SMO_EVENT_TYPE["getRecursosByMetadato"] = "getRecursosByMetadato";
840
+ SMO_EVENT_TYPE["getRecursosByMetadatos"] = "getRecursosByMetadatos";
806
841
  SMO_EVENT_TYPE["getRecursos"] = "getRecursos";
807
842
  SMO_EVENT_TYPE["getRecursosDefault"] = "getRecursosDefault";
808
843
  SMO_EVENT_TYPE["getRecursosRelleno"] = "getRecursosRelleno";
@@ -810,14 +845,14 @@ var SMO_EVENT_TYPE;
810
845
  SMO_EVENT_TYPE["checkHealth"] = "checkHealth";
811
846
  SMO_EVENT_TYPE["checkHealthPrinter"] = "checkHealthPrinter";
812
847
  SMO_EVENT_TYPE["getValorCalendario"] = "getValorCalendario";
813
- })(SMO_EVENT_TYPE = exports.SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = {}));
848
+ })(SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = SMO_EVENT_TYPE = {}));
814
849
  var LogLevel;
815
850
  (function (LogLevel) {
816
851
  LogLevel[LogLevel["Debug"] = 0] = "Debug";
817
852
  LogLevel[LogLevel["Info"] = 1] = "Info";
818
853
  LogLevel[LogLevel["Warning"] = 2] = "Warning";
819
854
  LogLevel[LogLevel["Error"] = 3] = "Error";
820
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
855
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
821
856
  var AlarmaLevel;
822
857
  (function (AlarmaLevel) {
823
858
  AlarmaLevel[AlarmaLevel["Ok_off"] = 0] = "Ok_off";
@@ -826,4 +861,4 @@ var AlarmaLevel;
826
861
  AlarmaLevel[AlarmaLevel["Timeout"] = 3] = "Timeout";
827
862
  AlarmaLevel[AlarmaLevel["Warning"] = 4] = "Warning";
828
863
  AlarmaLevel[AlarmaLevel["Error"] = 5] = "Error";
829
- })(AlarmaLevel = exports.AlarmaLevel || (exports.AlarmaLevel = {}));
864
+ })(AlarmaLevel || (exports.AlarmaLevel = AlarmaLevel = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@denevads/dnv-smo",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "SMO module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -55,7 +55,15 @@ export interface GetRecursosRelleno {
55
55
  codigo: number;
56
56
  recursos: Recurso[];
57
57
  }
58
-
58
+ export interface GetRecursosMetadatos {
59
+ metadato: string;
60
+ valor: string;
61
+ }
62
+ export interface RecursosMetadato {
63
+ metadato: string;
64
+ valor: string;
65
+ recursos?: Recurso[];
66
+ }
59
67
  export interface Recurso {
60
68
  codigo: number;
61
69
  url: string;
package/src/smo.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  start,
9
9
  GetRecursosByCodigo,
10
10
  GetRecursos,
11
- GetRecursosRelleno
11
+ GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato
12
12
  } from "./interfaces/callbacks";
13
13
  import {interval, Subject, Subscription} from 'rxjs';
14
14
 
@@ -203,6 +203,14 @@ export class SMO {
203
203
  selft.getRecursosByCodigo(e.data.objData);
204
204
  return;
205
205
  }
206
+ if(func == SMO_EVENT_TYPE.getRecursosByMetadato){
207
+ selft.getRecursosByMetadato(e.data.objData);
208
+ return;
209
+ }
210
+ if(func == SMO_EVENT_TYPE.getRecursosByMetadatos){
211
+ selft.getRecursosByMetadatos(e.data.objData);
212
+ return;
213
+ }
206
214
  if(func == SMO_EVENT_TYPE.getRecursos){
207
215
  selft.getRecursos(e.data.objData);
208
216
  }
@@ -259,6 +267,12 @@ export class SMO {
259
267
  getRecursosByCodigo(data:GetRecursosByCodigo):void{
260
268
  this.events.getRecursosByCodigo.next(data);
261
269
  }
270
+ getRecursosByMetadato(data:GetRecursosByCodigo):void{
271
+ this.events.getRecursosByMetadato.next(data);
272
+ }
273
+ getRecursosByMetadatos(data:RecursosMetadato[]):void{
274
+ this.events.getRecursosByMetadatos.next(data);
275
+ }
262
276
  getRecursos(data:GetRecursos):void{
263
277
  this.events.getRecursos.next(data);
264
278
  }
@@ -292,6 +306,8 @@ class SmoEvents{
292
306
  public setSalidaData: Subject<DataSalida> = new Subject<DataSalida>();
293
307
  public updatefromsalida: Subject<any> = new Subject<any>();
294
308
  public getRecursosByCodigo: Subject<GetRecursosByCodigo> = new Subject<GetRecursosByCodigo>();
309
+ public getRecursosByMetadato: Subject<GetRecursosByCodigo> = new Subject<GetRecursosByCodigo>();
310
+ public getRecursosByMetadatos: Subject<RecursosMetadato[]> = new Subject<RecursosMetadato[]>();
295
311
  public getRecursos: Subject<GetRecursos> = new Subject<GetRecursos>();
296
312
  public getRecursosDefault: Subject<GetRecursos> = new Subject<GetRecursos>();
297
313
  public getRecursosRelleno: Subject<GetRecursosRelleno> = new Subject<GetRecursosRelleno>();
@@ -560,6 +576,23 @@ class smoCallBacks{
560
576
  idSmo: this.smo.id
561
577
  }, this.smo.vars.idSmo);
562
578
  }
579
+ getRecursosByMetadato(metadato: string, valor:string):void{
580
+ this.smo.utils.sendToParent({
581
+ target: "Dnv.smoCallbacks.getRecursosByMetadato",
582
+ objData: {
583
+ metadato : metadato,
584
+ valor: valor
585
+ },
586
+ idSmo: this.smo.id
587
+ }, this.smo.vars.idSmo);
588
+ }
589
+ getRecursosByMetadatos(data:GetRecursosMetadatos[]):void{
590
+ this.smo.utils.sendToParent({
591
+ target: "Dnv.smoCallbacks.getRecursosByMetadatos",
592
+ objData: data,
593
+ idSmo: this.smo.id
594
+ }, this.smo.vars.idSmo);
595
+ }
563
596
  getRecursos():void{
564
597
  this.smo.utils.sendToParent({
565
598
  target: "Dnv.smoCallbacks.getRecursos",
@@ -841,6 +874,8 @@ export enum SMO_EVENT_TYPE{
841
874
  updatefromsalida = "updatefromsalida",
842
875
  setDatasourceJson = "setDatasourceJson",
843
876
  getRecursosByCodigo = "getRecursosByCodigo",
877
+ getRecursosByMetadato = "getRecursosByMetadato",
878
+ getRecursosByMetadatos = "getRecursosByMetadatos",
844
879
  getRecursos = "getRecursos",
845
880
  getRecursosDefault = "getRecursosDefault",
846
881
  getRecursosRelleno = "getRecursosRelleno",