@denevads/dnv-smo 1.0.37 → 1.0.38
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/interfaces/callbacks.d.ts +7 -0
- package/dist/smo.d.ts +12 -2
- package/dist/smo.js +26 -1
- package/package.json +1 -1
- package/src/interfaces/callbacks.ts +7 -0
- package/src/smo.ts +100 -73
package/dist/smo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato } from "./interfaces/callbacks";
|
|
1
|
+
import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, DatasourceMap } from "./interfaces/callbacks";
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
export declare class SMO {
|
|
4
4
|
vars: any;
|
|
@@ -28,6 +28,7 @@ export declare class SMO {
|
|
|
28
28
|
checkHealth(json: string): void;
|
|
29
29
|
checkHealthPrinter(json: string): void;
|
|
30
30
|
getValorCalendario(estado: boolean): void;
|
|
31
|
+
getLocalDatasource(data: DatasourceMap): void;
|
|
31
32
|
}
|
|
32
33
|
declare class SmoEvents {
|
|
33
34
|
start: Subject<start>;
|
|
@@ -48,6 +49,7 @@ declare class SmoEvents {
|
|
|
48
49
|
checkHealth: Subject<string>;
|
|
49
50
|
checkHealthPrinter: Subject<string>;
|
|
50
51
|
getValorCalendario: Subject<boolean>;
|
|
52
|
+
getLocalDatasource: Subject<DatasourceMap>;
|
|
51
53
|
constructor(smo: SMO);
|
|
52
54
|
}
|
|
53
55
|
declare class smoCallBacks {
|
|
@@ -98,6 +100,12 @@ declare class smoCallBacks {
|
|
|
98
100
|
checkHealthPrinter(): void;
|
|
99
101
|
printImage(image: string): void;
|
|
100
102
|
getValorCalendario(codigo: number, tipoObjeto?: number): void;
|
|
103
|
+
/**
|
|
104
|
+
* Funcion que permite obtener uno o varios datasources pasando su/sus codigos
|
|
105
|
+
* Permite un solo codigo o un array de codigos
|
|
106
|
+
* @param codDS Puede ser un número o un array de números
|
|
107
|
+
*/
|
|
108
|
+
getLocalDatasource(codDS: number | number[]): void;
|
|
101
109
|
}
|
|
102
110
|
declare class Utils {
|
|
103
111
|
smo: SMO;
|
|
@@ -127,7 +135,8 @@ export declare enum SMO_EVENT_TYPE {
|
|
|
127
135
|
getVariableStorage = "getVariableStorage",
|
|
128
136
|
checkHealth = "checkHealth",
|
|
129
137
|
checkHealthPrinter = "checkHealthPrinter",
|
|
130
|
-
getValorCalendario = "getValorCalendario"
|
|
138
|
+
getValorCalendario = "getValorCalendario",
|
|
139
|
+
getLocalDatasource = "getLocalDatasource"
|
|
131
140
|
}
|
|
132
141
|
export declare enum LogLevel {
|
|
133
142
|
Debug = 0,
|
|
@@ -177,5 +186,6 @@ export interface ObjJSType {
|
|
|
177
186
|
checkHealthPrinter: () => void;
|
|
178
187
|
checkHealth: () => void;
|
|
179
188
|
getValorCalendario: () => void;
|
|
189
|
+
getLocalDatasource: () => void;
|
|
180
190
|
}
|
|
181
191
|
export {};
|
package/dist/smo.js
CHANGED
|
@@ -108,7 +108,9 @@ var SMO = /** @class */ (function () {
|
|
|
108
108
|
// @ts-ignore
|
|
109
109
|
CheckHealth: window.objJS.checkHealth,
|
|
110
110
|
// @ts-ignore
|
|
111
|
-
getValorCalendario: window.objJS.getValorCalendario
|
|
111
|
+
getValorCalendario: window.objJS.getValorCalendario,
|
|
112
|
+
// @ts-ignore
|
|
113
|
+
getLocalDatasource: window.objJS.getLocalDatasource,
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
else {
|
|
@@ -216,6 +218,10 @@ var SMO = /** @class */ (function () {
|
|
|
216
218
|
selft.getValorCalendario(e.data.objData);
|
|
217
219
|
return;
|
|
218
220
|
}
|
|
221
|
+
if (func == SMO_EVENT_TYPE.getLocalDatasource) {
|
|
222
|
+
selft.getLocalDatasource(e.data.objData);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
219
225
|
console.warn("message not implemented!!" + func);
|
|
220
226
|
}
|
|
221
227
|
};
|
|
@@ -272,6 +278,9 @@ var SMO = /** @class */ (function () {
|
|
|
272
278
|
SMO.prototype.getValorCalendario = function (estado) {
|
|
273
279
|
this.events.getValorCalendario.next(estado);
|
|
274
280
|
};
|
|
281
|
+
SMO.prototype.getLocalDatasource = function (data) {
|
|
282
|
+
this.events.getLocalDatasource.next(data);
|
|
283
|
+
};
|
|
275
284
|
return SMO;
|
|
276
285
|
}());
|
|
277
286
|
exports.SMO = SMO;
|
|
@@ -295,6 +304,7 @@ var SmoEvents = /** @class */ (function () {
|
|
|
295
304
|
this.checkHealth = new rxjs_1.Subject();
|
|
296
305
|
this.checkHealthPrinter = new rxjs_1.Subject();
|
|
297
306
|
this.getValorCalendario = new rxjs_1.Subject();
|
|
307
|
+
this.getLocalDatasource = new rxjs_1.Subject();
|
|
298
308
|
}
|
|
299
309
|
return SmoEvents;
|
|
300
310
|
}());
|
|
@@ -668,6 +678,20 @@ var smoCallBacks = /** @class */ (function () {
|
|
|
668
678
|
idSmo: this.smo.id
|
|
669
679
|
}, this.smo.vars.idSmo);
|
|
670
680
|
};
|
|
681
|
+
/**
|
|
682
|
+
* Funcion que permite obtener uno o varios datasources pasando su/sus codigos
|
|
683
|
+
* Permite un solo codigo o un array de codigos
|
|
684
|
+
* @param codDS Puede ser un número o un array de números
|
|
685
|
+
*/
|
|
686
|
+
smoCallBacks.prototype.getLocalDatasource = function (codDS) {
|
|
687
|
+
// Si es un solo código, lo convertimos a un array para tratar ambos casos de la misma manera
|
|
688
|
+
var codDSArray = Array.isArray(codDS) ? codDS : [codDS];
|
|
689
|
+
this.smo.utils.sendToParent({
|
|
690
|
+
target: "Dnv.smoCallbacks.getLocalDatasource",
|
|
691
|
+
objData: codDSArray, // Enviamos el array, sea de un solo código o varios
|
|
692
|
+
idSmo: this.smo.id
|
|
693
|
+
}, this.smo.vars.idSmo);
|
|
694
|
+
};
|
|
671
695
|
return smoCallBacks;
|
|
672
696
|
}());
|
|
673
697
|
var Utils = /** @class */ (function () {
|
|
@@ -845,6 +869,7 @@ var SMO_EVENT_TYPE;
|
|
|
845
869
|
SMO_EVENT_TYPE["checkHealth"] = "checkHealth";
|
|
846
870
|
SMO_EVENT_TYPE["checkHealthPrinter"] = "checkHealthPrinter";
|
|
847
871
|
SMO_EVENT_TYPE["getValorCalendario"] = "getValorCalendario";
|
|
872
|
+
SMO_EVENT_TYPE["getLocalDatasource"] = "getLocalDatasource";
|
|
848
873
|
})(SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = SMO_EVENT_TYPE = {}));
|
|
849
874
|
var LogLevel;
|
|
850
875
|
(function (LogLevel) {
|
package/package.json
CHANGED
package/src/smo.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
start,
|
|
9
9
|
GetRecursosByCodigo,
|
|
10
10
|
GetRecursos,
|
|
11
|
-
GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato
|
|
11
|
+
GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, Datasource, DatasourceMap
|
|
12
12
|
} from "./interfaces/callbacks";
|
|
13
13
|
import {interval, Subject, Subscription} from 'rxjs';
|
|
14
14
|
|
|
@@ -128,7 +128,9 @@ export class SMO {
|
|
|
128
128
|
// @ts-ignore
|
|
129
129
|
CheckHealth: window.objJS.checkHealth,
|
|
130
130
|
// @ts-ignore
|
|
131
|
-
getValorCalendario: window.objJS.getValorCalendario
|
|
131
|
+
getValorCalendario: window.objJS.getValorCalendario,
|
|
132
|
+
// @ts-ignore
|
|
133
|
+
getLocalDatasource: window.objJS.getLocalDatasource,
|
|
132
134
|
};
|
|
133
135
|
}else{
|
|
134
136
|
console.log("No existe objJS en window");
|
|
@@ -168,76 +170,80 @@ export class SMO {
|
|
|
168
170
|
initOnMessage():void{
|
|
169
171
|
let selft = this;
|
|
170
172
|
window.onmessage = function(e) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
173
|
+
if (e.data.target) {
|
|
174
|
+
var targets = e.data.target.split('.');
|
|
175
|
+
var func = targets[targets.length-1];
|
|
176
|
+
if(func == SMO_EVENT_TYPE.start){
|
|
177
|
+
selft.start();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if(func == SMO_EVENT_TYPE.setDatasource){
|
|
181
|
+
selft.setDatasource(e.data.objData);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if(func == SMO_EVENT_TYPE.getVariable){
|
|
185
|
+
selft.getVariable(e.data.objData);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if(func ==SMO_EVENT_TYPE.setCurrentStream){
|
|
189
|
+
selft.setCurrentStream(e.data.objData);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if(func==SMO_EVENT_TYPE.infoCurrentLocation){
|
|
193
|
+
selft.infoCurrentLocation(e.data.objData);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if(func==SMO_EVENT_TYPE.setSalidaData){
|
|
197
|
+
selft.setSalidaData(e.data.objData);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if(func ==SMO_EVENT_TYPE.updatefromsalida){
|
|
201
|
+
selft.updatefromsalida(e.data.objData);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if(func == SMO_EVENT_TYPE.getRecursosByCodigo){
|
|
205
|
+
selft.getRecursosByCodigo(e.data.objData);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if(func == SMO_EVENT_TYPE.getRecursosByMetadato){
|
|
209
|
+
selft.getRecursosByMetadato(e.data.objData);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if(func == SMO_EVENT_TYPE.getRecursosByMetadatos){
|
|
213
|
+
selft.getRecursosByMetadatos(e.data.objData);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if(func == SMO_EVENT_TYPE.getRecursos){
|
|
217
|
+
selft.getRecursos(e.data.objData);
|
|
218
|
+
}
|
|
219
|
+
if(func == SMO_EVENT_TYPE.getRecursosDefault){
|
|
220
|
+
selft.getRecursosDefault(e.data.objData);
|
|
221
|
+
}
|
|
222
|
+
if(func == SMO_EVENT_TYPE.getRecursosRelleno){
|
|
223
|
+
selft.getRecursosRelleno(e.data.objData);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if(func == SMO_EVENT_TYPE.getVariableStorage){
|
|
227
|
+
selft.getVariableStorage(e.data.objData);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if(func == SMO_EVENT_TYPE.checkHealth){
|
|
231
|
+
selft.checkHealth(e.data.objData);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if(func == SMO_EVENT_TYPE.checkHealthPrinter){
|
|
235
|
+
selft.checkHealthPrinter(e.data.objData);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if(func == SMO_EVENT_TYPE.getValorCalendario){
|
|
239
|
+
selft.getValorCalendario(e.data.objData);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if(func == SMO_EVENT_TYPE.getLocalDatasource){
|
|
243
|
+
selft.getLocalDatasource(e.data.objData);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
console.warn("message not implemented!!" +func);
|
|
241
247
|
}
|
|
242
248
|
}
|
|
243
249
|
}
|
|
@@ -294,6 +300,9 @@ export class SMO {
|
|
|
294
300
|
getValorCalendario(estado:boolean):void{
|
|
295
301
|
this.events.getValorCalendario.next(estado);
|
|
296
302
|
}
|
|
303
|
+
getLocalDatasource(data: DatasourceMap):void{
|
|
304
|
+
this.events.getLocalDatasource.next(data);
|
|
305
|
+
}
|
|
297
306
|
}
|
|
298
307
|
|
|
299
308
|
class SmoEvents{
|
|
@@ -315,6 +324,7 @@ class SmoEvents{
|
|
|
315
324
|
public checkHealth: Subject<string> = new Subject<string>();
|
|
316
325
|
public checkHealthPrinter: Subject<string> = new Subject<string>();
|
|
317
326
|
public getValorCalendario: Subject<boolean> = new Subject<boolean>();
|
|
327
|
+
public getLocalDatasource: Subject<DatasourceMap> = new Subject<DatasourceMap>();
|
|
318
328
|
constructor(smo:SMO){}
|
|
319
329
|
}
|
|
320
330
|
class smoCallBacks{
|
|
@@ -691,6 +701,21 @@ class smoCallBacks{
|
|
|
691
701
|
idSmo: this.smo.id
|
|
692
702
|
}, this.smo.vars.idSmo);
|
|
693
703
|
}
|
|
704
|
+
/**
|
|
705
|
+
* Funcion que permite obtener uno o varios datasources pasando su/sus codigos
|
|
706
|
+
* Permite un solo codigo o un array de codigos
|
|
707
|
+
* @param codDS Puede ser un número o un array de números
|
|
708
|
+
*/
|
|
709
|
+
getLocalDatasource(codDS: number | number[]): void {
|
|
710
|
+
// Si es un solo código, lo convertimos a un array para tratar ambos casos de la misma manera
|
|
711
|
+
const codDSArray = Array.isArray(codDS) ? codDS : [codDS];
|
|
712
|
+
|
|
713
|
+
this.smo.utils.sendToParent({
|
|
714
|
+
target: "Dnv.smoCallbacks.getLocalDatasource",
|
|
715
|
+
objData: codDSArray, // Enviamos el array, sea de un solo código o varios
|
|
716
|
+
idSmo: this.smo.id
|
|
717
|
+
}, this.smo.vars.idSmo);
|
|
718
|
+
}
|
|
694
719
|
|
|
695
720
|
}
|
|
696
721
|
class Utils{
|
|
@@ -882,7 +907,8 @@ export enum SMO_EVENT_TYPE{
|
|
|
882
907
|
getVariableStorage = "getVariableStorage",
|
|
883
908
|
checkHealth = "checkHealth",
|
|
884
909
|
checkHealthPrinter = "checkHealthPrinter",
|
|
885
|
-
getValorCalendario = "getValorCalendario"
|
|
910
|
+
getValorCalendario = "getValorCalendario",
|
|
911
|
+
getLocalDatasource = "getLocalDatasource"
|
|
886
912
|
}
|
|
887
913
|
export enum LogLevel {
|
|
888
914
|
Debug= 0,
|
|
@@ -932,5 +958,6 @@ export interface ObjJSType {
|
|
|
932
958
|
checkHealthPrinter: () => void;
|
|
933
959
|
checkHealth: () => void;
|
|
934
960
|
getValorCalendario: () => void;
|
|
961
|
+
getLocalDatasource: () => void;
|
|
935
962
|
}
|
|
936
963
|
|