@denevads/dnv-smo 1.0.16 → 1.0.17

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,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/denevads_dnv-smo.iml" filepath="$PROJECT_DIR$/.idea/denevads_dnv-smo.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/README.md CHANGED
@@ -1,80 +1,18 @@
1
- #Introducción
2
- Librería de interfaz de comunicaciones entre un objeto HTML5 y las funciones de un player de DenevaDS.
1
+ # DnvSMO
2
+ Libreria de conexión con la API de la salida.
3
3
 
4
- Aquí definiremos el uso de la librería y las funciones que la misma provee
4
+ ## Conexión con NPM
5
5
 
6
+ Para conexión con NPM se deben de ejecutar los siguientes comandos. La cuenta de login es denevads
6
7
 
7
- # Instalación
8
- La librería esta pensada para ser usada junto con Angular, de manera que si no contamos con el cli de angular en el sistema conviene instalarlo para inicializar el proyecto.
9
- ```sh
10
- npm install -g @angular/cli
11
- ```
12
- Inicializamos un proyecto de prueba llamado html-deneva en la ruta en la que estemos.
13
- ```sh
14
- ng new html-deneva
15
- ```
16
- Una vez que ya tenemos la estructura básica del proyecto podemos instalar la librería en el proyecto ejecutando la siguiente liena dentro de la carpeta del mismo:
17
- ```sh
18
- npm install @denevads/dnv-smo
19
- ```
20
8
 
21
- # Inicialización
9
+ npm run build
22
10
 
23
- Una vez que tengamos el proyecto de angular inicializado, procedemos importar el módulo.
11
+ npm login
24
12
 
25
- Dentro de la definición del app.module en la carpeta app, importamos la librería.
26
- ```ts
27
- import { SMO } from '@denevads/dnv-smo/dist/smo';
28
- ```
29
- y lo añadimos como provider en @NgModule
30
- ```ts
31
- providers: [SMO]
32
- ```
13
+ npm publish
33
14
 
34
- Ahora ya solo bastaría con añadirlo al componente del angular y empezar a usarlo.
15
+ ## Instalación.
35
16
 
36
- De nuevo en app.component importamos la librería
37
- ```js
38
- import { LogLevel, SMO } from '@denevads/dnv-smo/dist/smo'
39
- ```
40
- Y en la exportación de la clase AppComponent añadimos el constructor
41
- ```js
42
- constructor(private smo:SMO){ }
43
- ```
44
- De esta manera ya tendríamos disponible para su uso todas las llamadas que aporta la librería usando
45
- ```js
46
- this.smo.
47
- ```
48
- También en la importacion hemos traído la enumeración de los niveles de log, que sirven para loggear en el disco del equipo.
49
- El uso sería de la siguiente forma.
50
- ```js
51
- this.smo.smoCallBacks.smoLog('Mensaje de prueba',LogLevel.Info);
52
- ```
17
+ Para instalar la librería hay que ejecutar: npm install @denevads/dnv-smo
53
18
 
54
- # Compilación y empaquetado.
55
-
56
- Para que el proyecto pueda funcionar en un equipo sin problemas hay que hacer un par de cambios en el código del proyecto por defecto.
57
-
58
- El primero de ellos es modificar el tsconfig.json para que el "target" sea "ES5" en lugar de "ES2022"
59
-
60
-
61
- Y el segundo cambio es en archivo de index. Aquí haremos dos cosas.
62
- -Borraremos la importación del favicon (además de borrarlo de la carpeta de archivos).
63
- -Y cambiamos la línea
64
- ```html
65
- <base href="/">
66
- ```
67
- por
68
- ```html
69
- <script>document.write('<base href="' + document.location + '" />');</script>
70
- ```
71
- Con estos cambios hechos, podemos compilar el proyecto ejecutando la línea
72
- ```sh
73
- ng b
74
- ```
75
- Esto nos generara una carpeta dist, con el contenido de nuestro HTML5 compilado.
76
-
77
- Para poder subirlo al player de deneva, simplemente tenemos que crear un zip con el contenido en la raíz, y le cambiaremos la extensión por
78
- ```sh
79
- .wgt
80
- ```
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./";
1
+ export * from "./";
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./"), exports);
@@ -1,62 +1,62 @@
1
- export interface setDatasource {
2
- xml: string;
3
- }
4
- export interface start {
5
- }
6
- export interface variable {
7
- variable: string;
8
- valor: string;
9
- }
10
- export interface location {
11
- top: string;
12
- left: string;
13
- width: string;
14
- height: string;
15
- }
16
- export interface Slide {
17
- codigo: string;
18
- idioma: string;
19
- denominacion: string;
20
- hash: string;
21
- }
22
- export interface DataSalida {
23
- dataKey: string;
24
- data: Slide[];
25
- }
26
- export interface ExecFunction {
27
- funcion: string;
28
- params: string;
29
- }
30
- export interface Notify {
31
- destion: string;
32
- value: any;
33
- }
34
- export interface GetRecursos {
35
- codigo: number;
36
- fechaInicio: string;
37
- fechaFin: string;
38
- recursos?: [];
39
- canales?: Canal[];
40
- }
41
- export interface Canal {
42
- codigo: number;
43
- pases: number;
44
- recursos: Recurso[];
45
- }
46
- export interface GetRecursosRelleno {
47
- codigo: number;
48
- recursos: Recurso[];
49
- }
50
- export interface Recurso {
51
- codigo: number;
52
- url: string;
53
- duracion: number;
54
- tipo: number;
55
- disponible: boolean;
56
- vigencia_inicio: string;
57
- vigencia_fin: string;
58
- hora_inicio: string;
59
- hora_fin: string;
60
- dias: string;
61
- nombre: string;
62
- }
1
+ export interface setDatasource {
2
+ xml: string;
3
+ }
4
+ export interface start {
5
+ }
6
+ export interface variable {
7
+ variable: string;
8
+ valor: string;
9
+ }
10
+ export interface location {
11
+ top: string;
12
+ left: string;
13
+ width: string;
14
+ height: string;
15
+ }
16
+ export interface Slide {
17
+ codigo: string;
18
+ idioma: string;
19
+ denominacion: string;
20
+ hash: string;
21
+ }
22
+ export interface DataSalida {
23
+ dataKey: string;
24
+ data: Slide[];
25
+ }
26
+ export interface ExecFunction {
27
+ funcion: string;
28
+ params: string;
29
+ }
30
+ export interface Notify {
31
+ destion: string;
32
+ value: any;
33
+ }
34
+ export interface GetRecursos {
35
+ codigo: number;
36
+ fechaInicio: string;
37
+ fechaFin: string;
38
+ recursos?: [];
39
+ canales?: Canal[];
40
+ }
41
+ export interface Canal {
42
+ codigo: number;
43
+ pases: number;
44
+ recursos: Recurso[];
45
+ }
46
+ export interface GetRecursosRelleno {
47
+ codigo: number;
48
+ recursos: Recurso[];
49
+ }
50
+ export interface Recurso {
51
+ codigo: number;
52
+ url: string;
53
+ duracion: number;
54
+ tipo: number;
55
+ disponible: boolean;
56
+ vigencia_inicio: string;
57
+ vigencia_fin: string;
58
+ hora_inicio: string;
59
+ hora_fin: string;
60
+ dias: string;
61
+ nombre: string;
62
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/smo.d.ts CHANGED
@@ -1,129 +1,163 @@
1
- import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursos, GetRecursosRelleno } from "./interfaces/callbacks";
2
- import { Subject } from 'rxjs';
3
- export declare class SMO {
4
- vars: any;
5
- id: string;
6
- private intervalsubscriptionDataSource;
7
- intervalDataSource$: import("rxjs").Observable<number>;
8
- smoCallBacks: smoCallBacks;
9
- utils: Utils;
10
- events: SmoEvents;
11
- constructor();
12
- init(): void;
13
- initOnMessage(): void;
14
- start(): void;
15
- setDatasource(datasource: setDatasource): void;
16
- getVariable(variable: variable): void;
17
- setCurrentStream(stream: string): void;
18
- infoCurrentLocation(location: location): void;
19
- setSalidaData(data: DataSalida): void;
20
- updatefromsalida(data: any): void;
21
- getRecursos(data: GetRecursos): void;
22
- getRecursosDefault(data: GetRecursos): void;
23
- getRecursosRelleno(data: GetRecursosRelleno): void;
24
- getVariableStorage(variable: variable): void;
25
- checkHealth(json: string): void;
26
- checkHealthPrinter(json: string): void;
27
- }
28
- declare class SmoEvents {
29
- start: Subject<start>;
30
- setDatasource: Subject<setDatasource>;
31
- setDatasourceJson: Subject<any>;
32
- getVariable: Subject<variable>;
33
- setCurrentStream: Subject<string>;
34
- infoCurrentLocation: Subject<location>;
35
- setSalidaData: Subject<DataSalida>;
36
- updatefromsalida: Subject<any>;
37
- getRecursos: Subject<GetRecursos>;
38
- getRecursosDefault: Subject<GetRecursos>;
39
- getRecursosRelleno: Subject<GetRecursosRelleno>;
40
- getVariableStorage: Subject<variable>;
41
- checkHealth: Subject<string>;
42
- checkHealthPrinter: Subject<String>;
43
- constructor(smo: SMO);
44
- }
45
- declare class smoCallBacks {
46
- smo: SMO;
47
- constructor(_smo: SMO);
48
- onSmoLoad(): void;
49
- onSmoReady(): void;
50
- smoLog(msn: string, level: LogLevel): void;
51
- smoAlarma(msn: string, level: AlarmaLevel): void;
52
- smoLogStash(msn: string): void;
53
- smoLogNowShowing(msn: any): void;
54
- reiniciarDispositivo(msn: string): void;
55
- urlNext(): void;
56
- exitInteractivity(): void;
57
- showBrowser(): void;
58
- closeBrowser(): void;
59
- urlNextDirectamente(): void;
60
- setVariable(variable: string, valor: string): void;
61
- getVariable(variable: string): void;
62
- getFile(file: string): void;
63
- setLocalData(variable: string, valor: string): void;
64
- getLocalData(variable: string): void;
65
- getCurrentStream(): void;
66
- finAviso(id: string): void;
67
- refreshDatasource(codigo: string): void;
68
- getLocation(): void;
69
- getSalidaData(data: string): void;
70
- ejecutaFuncion(data: ExecFunction): void;
71
- addObserver(data: string): void;
72
- notify(data: Notify): void;
73
- playOnceChannelByTrigger(trigger: string): void;
74
- stopPlayOnceChannelByTrigger(): void;
75
- playOnceChannel(codigoCanal: string): void;
76
- stopPlayChannel(): void;
77
- editWrapperStyle(obj: any): void;
78
- getRecursos(): void;
79
- getRecursosDefault(): void;
80
- getRecursosRelleno(): void;
81
- setVariableStorage(variable: string, valor: string): void;
82
- getVariableStorage(variable: string): void;
83
- printTextLine(txt: string): void;
84
- printBarcode(code: string, width: number, height: number): void;
85
- cutPaper(percent: number): void;
86
- checkHealth(): void;
87
- checkHealthPrinter(): void;
88
- printImage(image: string): void;
89
- }
90
- declare class Utils {
91
- smo: SMO;
92
- smoCallBacks: smoCallBacks;
93
- constructor(_smo: SMO, _smoCallBacks: smoCallBacks);
94
- xmlToJSON(xml: string): string;
95
- jsonToStr(js_obj: any): string;
96
- setJsonObj(xml: any): any;
97
- dataToJSON(data: setDatasource): any;
98
- }
99
- export declare enum SMO_EVENT_TYPE {
100
- start = "start",
101
- setDatasource = "setDatasource",
102
- getVariable = "getVariable",
103
- setCurrentStream = "setCurrentStream",
104
- infoCurrentLocation = "infoCurrentLocation",
105
- setSalidaData = "setSalidaData",
106
- updatefromsalida = "updatefromsalida",
107
- setDatasourceJson = "setDatasourceJson",
108
- getRecursos = "getRecursos",
109
- getRecursosDefault = "getRecursosDefault",
110
- getRecursosRelleno = "getRecursosRelleno",
111
- getVariableStorage = "getVariableStorage",
112
- checkHealth = "checkHealth",
113
- checkHealthPrinter = "checkHealthPrinter"
114
- }
115
- export declare enum LogLevel {
116
- Debug = 0,
117
- Info = 1,
118
- Warning = 2,
119
- Error = 3
120
- }
121
- export declare enum AlarmaLevel {
122
- Ok_off = 0,
123
- Ok = 1,
124
- Scanning = 2,
125
- Timeout = 3,
126
- Warning = 4,
127
- Error = 5
128
- }
129
- export {};
1
+ import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursos, GetRecursosRelleno } from "./interfaces/callbacks";
2
+ import { Subject } from 'rxjs';
3
+ export declare class SMO {
4
+ vars: any;
5
+ id: string;
6
+ private intervalsubscriptionDataSource;
7
+ intervalDataSource$: import("rxjs").Observable<number>;
8
+ smoCallBacks: smoCallBacks;
9
+ utils: Utils;
10
+ events: SmoEvents;
11
+ constructor();
12
+ init(): void;
13
+ initOnMessage(): void;
14
+ start(): void;
15
+ setDatasource(datasource: setDatasource): void;
16
+ getVariable(variable: variable): void;
17
+ setCurrentStream(stream: string): void;
18
+ infoCurrentLocation(location: location): void;
19
+ setSalidaData(data: DataSalida): void;
20
+ updatefromsalida(data: any): void;
21
+ getRecursos(data: GetRecursos): void;
22
+ getRecursosDefault(data: GetRecursos): void;
23
+ getRecursosRelleno(data: GetRecursosRelleno): void;
24
+ getVariableStorage(variable: variable): void;
25
+ checkHealth(json: string): void;
26
+ checkHealthPrinter(json: string): void;
27
+ }
28
+ declare class SmoEvents {
29
+ start: Subject<start>;
30
+ setDatasource: Subject<setDatasource>;
31
+ setDatasourceJson: Subject<any>;
32
+ getVariable: Subject<variable>;
33
+ setCurrentStream: Subject<string>;
34
+ infoCurrentLocation: Subject<location>;
35
+ setSalidaData: Subject<DataSalida>;
36
+ updatefromsalida: Subject<any>;
37
+ getRecursos: Subject<GetRecursos>;
38
+ getRecursosDefault: Subject<GetRecursos>;
39
+ getRecursosRelleno: Subject<GetRecursosRelleno>;
40
+ getVariableStorage: Subject<variable>;
41
+ checkHealth: Subject<string>;
42
+ checkHealthPrinter: Subject<String>;
43
+ constructor(smo: SMO);
44
+ }
45
+ declare class smoCallBacks {
46
+ smo: SMO;
47
+ constructor(_smo: SMO);
48
+ onSmoLoad(): void;
49
+ onSmoReady(): void;
50
+ smoLog(msn: string, level: LogLevel): void;
51
+ smoAlarma(msn: string, level: AlarmaLevel): void;
52
+ smoLogStash(msn: string): void;
53
+ smoLogNowShowing(msn: any): void;
54
+ reiniciarDispositivo(msn: string): void;
55
+ urlNext(): void;
56
+ exitInteractivity(): void;
57
+ showBrowser(): void;
58
+ closeBrowser(): void;
59
+ urlNextDirectamente(): void;
60
+ setVariable(variable: string, valor: string): void;
61
+ getVariable(variable: string): void;
62
+ getFile(file: string): void;
63
+ setLocalData(variable: string, valor: string): void;
64
+ getLocalData(variable: string): void;
65
+ getCurrentStream(): void;
66
+ finAviso(id: string): void;
67
+ refreshDatasource(codigo: string): void;
68
+ getLocation(): void;
69
+ getSalidaData(data: string): void;
70
+ ejecutaFuncion(data: ExecFunction): void;
71
+ addObserver(data: string): void;
72
+ notify(data: Notify): void;
73
+ playOnceChannelByTrigger(trigger: string): void;
74
+ stopPlayOnceChannelByTrigger(): void;
75
+ playOnceChannel(codigoCanal: string): void;
76
+ stopPlayChannel(): void;
77
+ editWrapperStyle(obj: any): void;
78
+ getRecursos(): void;
79
+ getRecursosDefault(): void;
80
+ getRecursosRelleno(): void;
81
+ setVariableStorage(variable: string, valor: string): void;
82
+ getVariableStorage(variable: string): void;
83
+ printTextLine(txt: string): void;
84
+ printBarcode(code: string, width: number, height: number): void;
85
+ cutPaper(percent: number): void;
86
+ checkHealth(): void;
87
+ checkHealthPrinter(): void;
88
+ printImage(image: string): void;
89
+ }
90
+ declare class Utils {
91
+ smo: SMO;
92
+ smoCallBacks: smoCallBacks;
93
+ constructor(_smo: SMO, _smoCallBacks: smoCallBacks);
94
+ xmlToJSON(xml: string): string;
95
+ jsonToStr(js_obj: any): string;
96
+ setJsonObj(xml: any): any;
97
+ dataToJSON(data: setDatasource): any;
98
+ }
99
+ export declare enum SMO_EVENT_TYPE {
100
+ start = "start",
101
+ setDatasource = "setDatasource",
102
+ getVariable = "getVariable",
103
+ setCurrentStream = "setCurrentStream",
104
+ infoCurrentLocation = "infoCurrentLocation",
105
+ setSalidaData = "setSalidaData",
106
+ updatefromsalida = "updatefromsalida",
107
+ setDatasourceJson = "setDatasourceJson",
108
+ getRecursos = "getRecursos",
109
+ getRecursosDefault = "getRecursosDefault",
110
+ getRecursosRelleno = "getRecursosRelleno",
111
+ getVariableStorage = "getVariableStorage",
112
+ checkHealth = "checkHealth",
113
+ checkHealthPrinter = "checkHealthPrinter"
114
+ }
115
+ export declare enum LogLevel {
116
+ Debug = 0,
117
+ Info = 1,
118
+ Warning = 2,
119
+ Error = 3
120
+ }
121
+ export declare enum AlarmaLevel {
122
+ Ok_off = 0,
123
+ Ok = 1,
124
+ Scanning = 2,
125
+ Timeout = 3,
126
+ Warning = 4,
127
+ Error = 5
128
+ }
129
+ export interface ObjJSType {
130
+ urlNext: () => void;
131
+ limpiaCapa: () => void;
132
+ logFlash: () => void;
133
+ pageInit: () => void;
134
+ finAviso: () => void;
135
+ exitInteractivity: () => void;
136
+ logWeb: () => void;
137
+ refreshPage: () => void;
138
+ refreshPageByError: () => void;
139
+ refreshPageByVideoEvent: () => void;
140
+ auditarRecurso: () => void;
141
+ initSMO: () => void;
142
+ getFile: () => void;
143
+ showBrowser: () => void;
144
+ closeBrowser: () => void;
145
+ refreshDataSource: () => void;
146
+ setVariable: () => void;
147
+ getVariable: () => void;
148
+ getLocation: () => void;
149
+ salirApp: () => void;
150
+ setLocalData: () => void;
151
+ getLocalData: () => void;
152
+ getSalidaData: () => void;
153
+ ejecutaFuncion: () => void;
154
+ addObserver: () => void;
155
+ notifyToObservers: () => void;
156
+ printTextLine: () => void;
157
+ printBarcode: () => void;
158
+ cutPaper: () => void;
159
+ printImage: () => void;
160
+ checkHealthPrinter: () => void;
161
+ checkHealth: () => void;
162
+ }
163
+ export {};