@denevads/dnv-smo 1.0.5 → 1.0.7

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/README.md ADDED
@@ -0,0 +1,20 @@
1
+ #Introducción
2
+ TODO: Proporcione una breve introducción del proyecto. En esta sección se deben explicar los objetivos o los motivos del proyecto.
3
+
4
+ # Tareas iniciales
5
+ TODO: Guíe a los usuarios para que apliquen el código a su sistema propio sin ningún problema. En esta sección se puede hablar sobre:
6
+ 1. El proceso de instalación
7
+ 2. Las dependencias de software
8
+ 3. Las últimas versiones
9
+ 4. Las referencias de API
10
+
11
+ # Compilación y prueba
12
+ TODO: Describa y muestre cómo compilar el código y ejecutar las pruebas.
13
+
14
+ # Contribución
15
+ TODO: Explique cómo pueden contribuir otros usuarios y desarrolladores a la mejora del código.
16
+
17
+ Si quiere obtener más información sobre cómo crear archivos Léame descriptivos, consulte las siguientes [directrices](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). También puede inspirarse en los archivos Léame siguientes:
18
+ - [ASP.NET Core](https://github.com/aspnet/Home)
19
+ - [Visual Studio Code](https://github.com/Microsoft/vscode)
20
+ - [Chakra Core](https://github.com/Microsoft/ChakraCore)
@@ -31,13 +31,13 @@ export interface Notify {
31
31
  destion: string;
32
32
  value: any;
33
33
  }
34
- export interface VideoClips {
34
+ export interface GetRecursos {
35
35
  codigo: number;
36
36
  fechaInicio: Date;
37
37
  fechaFin: Date;
38
38
  recursos: Recurso[];
39
39
  }
40
- export interface VideoClipsRelleno {
40
+ export interface GetRecursosRelleno {
41
41
  codigo: number;
42
42
  recursos: Recurso[];
43
43
  }
@@ -45,4 +45,5 @@ export interface Recurso {
45
45
  codigo: number;
46
46
  url: string;
47
47
  duracion: number;
48
+ tipo: number;
48
49
  }
package/dist/smo.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, VideoClips, VideoClipsRelleno } from "./interfaces/callbacks";
1
+ import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursos, GetRecursosRelleno } from "./interfaces/callbacks";
2
2
  import { Subject } from 'rxjs';
3
3
  export declare class SMO {
4
4
  vars: any;
@@ -18,8 +18,8 @@ export declare class SMO {
18
18
  infoCurrentLocation(location: location): void;
19
19
  setSalidaData(data: DataSalida): void;
20
20
  updatefromsalida(data: any): void;
21
- getVideoClips(data: VideoClips): void;
22
- getVideosRelleno(data: VideoClipsRelleno): void;
21
+ getRecursos(data: GetRecursos): void;
22
+ getRecursosRelleno(data: GetRecursosRelleno): void;
23
23
  getVariableStorage(variable: variable): void;
24
24
  }
25
25
  declare class SmoEvents {
@@ -31,8 +31,8 @@ declare class SmoEvents {
31
31
  infoCurrentLocation: Subject<location>;
32
32
  setSalidaData: Subject<DataSalida>;
33
33
  updatefromsalida: Subject<any>;
34
- getVideoClips: Subject<VideoClips>;
35
- getVideosRelleno: Subject<VideoClipsRelleno>;
34
+ getRecursos: Subject<GetRecursos>;
35
+ getRecursosRelleno: Subject<GetRecursosRelleno>;
36
36
  getVariableStorage: Subject<variable>;
37
37
  constructor(smo: SMO);
38
38
  }
@@ -67,8 +67,8 @@ declare class smoCallBacks {
67
67
  playOnceChannel(codigoCanal: string): void;
68
68
  stopPlayChannel(): void;
69
69
  editWrapperStyle(obj: any): void;
70
- getVideoClips(): void;
71
- getVideosRelleno(): void;
70
+ getRecursos(): void;
71
+ getRecursosRelleno(): void;
72
72
  setVariableStorage(variable: string, valor: string): void;
73
73
  getVariableStorage(variable: string): void;
74
74
  }
@@ -90,8 +90,8 @@ export declare enum SMO_EVENT_TYPE {
90
90
  setSalidaData = "setSalidaData",
91
91
  updatefromsalida = "updatefromsalida",
92
92
  setDatasourceJson = "setDatasourceJson",
93
- getVideoClips = "getVideoClips",
94
- getVideosRelleno = "getVideosRelleno",
93
+ getRecursos = "getRecursos",
94
+ getRecursosRelleno = "getRecursosRelleno",
95
95
  getVariableStorage = "getVariableStorage"
96
96
  }
97
97
  export declare enum LogLevel {
package/dist/smo.js CHANGED
@@ -7,11 +7,11 @@ var SMO = /** @class */ (function () {
7
7
  this.vars = {};
8
8
  this.id = "";
9
9
  this.intervalDataSource$ = (0, rxjs_1.interval)(5 * 60 * 1000);
10
- this.init();
11
10
  this.initOnMessage();
12
11
  this.smoCallBacks = new smoCallBacks(this);
13
12
  this.utils = new Utils(this, this.smoCallBacks);
14
13
  this.events = new SmoEvents(this);
14
+ this.init();
15
15
  }
16
16
  SMO.prototype.init = function () {
17
17
  var _this = this;
@@ -21,12 +21,6 @@ var SMO = /** @class */ (function () {
21
21
  while (match = search.exec(query)) {
22
22
  this.vars[decode(match[1])] = decode(match[2]);
23
23
  }
24
- /* let hash;
25
- let hashes = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&");
26
- for (var i = 0; i < hashes.length; i++) {
27
- hash = hashes[i].split("=");
28
- this.vars[hash[0]] = hash[1];
29
- }*/
30
24
  if (this.vars.idSmo) {
31
25
  this.id = this.vars.idSmo;
32
26
  if (this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)) {
@@ -47,24 +41,10 @@ var SMO = /** @class */ (function () {
47
41
  });
48
42
  return;
49
43
  }
44
+ return;
50
45
  }
51
46
  console.warn("No idSmo found in URL");
52
47
  };
53
- /*getDatasource():void{
54
- if(this.smo.vars.url == undefined){
55
- this.smoCallBacks.getFile(this.smo.vars.LocalData);
56
- return;
57
- }
58
- this.smoCallBacks.getFile(this.smo.vars.url);
59
-
60
- }
61
- startCheckDatasource(timeout: number = 10):void{
62
- this.getDatasource();
63
- let self = this;
64
- setInterval(function() {
65
- self.getDatasource();
66
- }, timeout * 1000);
67
- }*/
68
48
  SMO.prototype.initOnMessage = function () {
69
49
  var selft = this;
70
50
  window.onmessage = function (e) {
@@ -99,11 +79,11 @@ var SMO = /** @class */ (function () {
99
79
  selft.updatefromsalida(e.data.objdata);
100
80
  return;
101
81
  }
102
- if (func == SMO_EVENT_TYPE.getVideoClips) {
103
- selft.getVideoClips(e.data.objData);
82
+ if (func == SMO_EVENT_TYPE.getRecursos) {
83
+ selft.getRecursos(e.data.objData);
104
84
  }
105
- if (func == SMO_EVENT_TYPE.getVideosRelleno) {
106
- selft.getVideosRelleno(e.data.objData);
85
+ if (func == SMO_EVENT_TYPE.getRecursosRelleno) {
86
+ selft.getRecursosRelleno(e.data.objData);
107
87
  return;
108
88
  }
109
89
  if (func == SMO_EVENT_TYPE.getVariableStorage) {
@@ -136,11 +116,11 @@ var SMO = /** @class */ (function () {
136
116
  SMO.prototype.updatefromsalida = function (data) {
137
117
  this.events.updatefromsalida.next(data);
138
118
  };
139
- SMO.prototype.getVideoClips = function (data) {
140
- this.events.getVideoClips.next(data);
119
+ SMO.prototype.getRecursos = function (data) {
120
+ this.events.getRecursos.next(data);
141
121
  };
142
- SMO.prototype.getVideosRelleno = function (data) {
143
- this.events.getVideosRelleno.next(data);
122
+ SMO.prototype.getRecursosRelleno = function (data) {
123
+ this.events.getRecursosRelleno.next(data);
144
124
  };
145
125
  SMO.prototype.getVariableStorage = function (variable) {
146
126
  this.events.getVariableStorage.next(variable);
@@ -158,8 +138,8 @@ var SmoEvents = /** @class */ (function () {
158
138
  this.infoCurrentLocation = new rxjs_1.Subject();
159
139
  this.setSalidaData = new rxjs_1.Subject();
160
140
  this.updatefromsalida = new rxjs_1.Subject();
161
- this.getVideoClips = new rxjs_1.Subject();
162
- this.getVideosRelleno = new rxjs_1.Subject();
141
+ this.getRecursos = new rxjs_1.Subject();
142
+ this.getRecursosRelleno = new rxjs_1.Subject();
163
143
  this.getVariableStorage = new rxjs_1.Subject();
164
144
  }
165
145
  return SmoEvents;
@@ -393,15 +373,15 @@ var smoCallBacks = /** @class */ (function () {
393
373
  idSmo: this.smo.id
394
374
  }, "*");
395
375
  };
396
- smoCallBacks.prototype.getVideoClips = function () {
376
+ smoCallBacks.prototype.getRecursos = function () {
397
377
  parent.postMessage({
398
- target: "Dnv.smoCallbacks.getVideoClips",
378
+ target: "Dnv.smoCallbacks.getRecursos",
399
379
  idSmo: this.smo.id
400
380
  }, "*");
401
381
  };
402
- smoCallBacks.prototype.getVideosRelleno = function () {
382
+ smoCallBacks.prototype.getRecursosRelleno = function () {
403
383
  parent.postMessage({
404
- target: "Dnv.smoCallbacks.getVideosRelleno",
384
+ target: "Dnv.smoCallbacks.getRecursosRelleno",
405
385
  idSmo: this.smo.id
406
386
  }, "*");
407
387
  };
@@ -505,8 +485,8 @@ var SMO_EVENT_TYPE;
505
485
  SMO_EVENT_TYPE["setSalidaData"] = "setSalidaData";
506
486
  SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
507
487
  SMO_EVENT_TYPE["setDatasourceJson"] = "setDatasourceJson";
508
- SMO_EVENT_TYPE["getVideoClips"] = "getVideoClips";
509
- SMO_EVENT_TYPE["getVideosRelleno"] = "getVideosRelleno";
488
+ SMO_EVENT_TYPE["getRecursos"] = "getRecursos";
489
+ SMO_EVENT_TYPE["getRecursosRelleno"] = "getRecursosRelleno";
510
490
  SMO_EVENT_TYPE["getVariableStorage"] = "getVariableStorage";
511
491
  })(SMO_EVENT_TYPE = exports.SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = {}));
512
492
  var LogLevel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@denevads/dnv-smo",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "SMO module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -35,13 +35,13 @@ export interface Notify{
35
35
  value:any
36
36
  }
37
37
 
38
- export interface VideoClips {
38
+ export interface GetRecursos {
39
39
  codigo: number;
40
40
  fechaInicio: Date;
41
41
  fechaFin: Date;
42
42
  recursos: Recurso[];
43
43
  }
44
- export interface VideoClipsRelleno {
44
+ export interface GetRecursosRelleno {
45
45
  codigo: number;
46
46
  recursos: Recurso[];
47
47
  }
@@ -50,5 +50,6 @@ export interface Recurso {
50
50
  codigo: number;
51
51
  url: string;
52
52
  duracion: number;
53
+ tipo: number;
53
54
  }
54
55
 
package/src/smo.ts CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  ExecFunction,
7
7
  Notify,
8
8
  start,
9
- VideoClips, VideoClipsRelleno
9
+ GetRecursos, GetRecursosRelleno
10
10
  } from "./interfaces/callbacks";
11
11
  import {interval, Subject, Subscription} from 'rxjs';
12
12
  export class SMO {
@@ -18,11 +18,12 @@ export class SMO {
18
18
  public utils:Utils;
19
19
  public events:SmoEvents;
20
20
  constructor(){
21
- this.init();
21
+
22
22
  this.initOnMessage();
23
23
  this.smoCallBacks = new smoCallBacks(this);
24
24
  this.utils = new Utils(this,this.smoCallBacks);
25
25
  this.events =new SmoEvents(this);
26
+ this.init();
26
27
  }
27
28
  public init():void{
28
29
  let match,
@@ -35,12 +36,6 @@ export class SMO {
35
36
  while (match = search.exec(query)) {
36
37
  this.vars[decode(match[1])] = decode(match[2]);
37
38
  }
38
- /* let hash;
39
- let hashes = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&");
40
- for (var i = 0; i < hashes.length; i++) {
41
- hash = hashes[i].split("=");
42
- this.vars[hash[0]] = hash[1];
43
- }*/
44
39
  if (this.vars.idSmo) {
45
40
  this.id = this.vars.idSmo;
46
41
  if(this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)){
@@ -61,26 +56,10 @@ export class SMO {
61
56
  });
62
57
  return;
63
58
  }
64
- }
65
- console.warn("No idSmo found in URL");
66
-
67
-
68
- }
69
- /*getDatasource():void{
70
- if(this.smo.vars.url == undefined){
71
- this.smoCallBacks.getFile(this.smo.vars.LocalData);
72
59
  return;
73
60
  }
74
- this.smoCallBacks.getFile(this.smo.vars.url);
75
-
61
+ console.warn("No idSmo found in URL");
76
62
  }
77
- startCheckDatasource(timeout: number = 10):void{
78
- this.getDatasource();
79
- let self = this;
80
- setInterval(function() {
81
- self.getDatasource();
82
- }, timeout * 1000);
83
- }*/
84
63
  initOnMessage():void{
85
64
  let selft = this;
86
65
  window.onmessage = function(e) {
@@ -115,11 +94,11 @@ export class SMO {
115
94
  selft.updatefromsalida(e.data.objdata);
116
95
  return;
117
96
  }
118
- if(func == SMO_EVENT_TYPE.getVideoClips){
119
- selft.getVideoClips(e.data.objData);
97
+ if(func == SMO_EVENT_TYPE.getRecursos){
98
+ selft.getRecursos(e.data.objData);
120
99
  }
121
- if(func == SMO_EVENT_TYPE.getVideosRelleno){
122
- selft.getVideosRelleno(e.data.objData);
100
+ if(func == SMO_EVENT_TYPE.getRecursosRelleno){
101
+ selft.getRecursosRelleno(e.data.objData);
123
102
  return;
124
103
  }
125
104
  if(func == SMO_EVENT_TYPE.getVariableStorage){
@@ -153,11 +132,11 @@ export class SMO {
153
132
  updatefromsalida(data:any):void{
154
133
  this.events.updatefromsalida.next(data);
155
134
  }
156
- getVideoClips(data:VideoClips):void{
157
- this.events.getVideoClips.next(data);
135
+ getRecursos(data:GetRecursos):void{
136
+ this.events.getRecursos.next(data);
158
137
  }
159
- getVideosRelleno(data:VideoClipsRelleno):void{
160
- this.events.getVideosRelleno.next(data);
138
+ getRecursosRelleno(data:GetRecursosRelleno):void{
139
+ this.events.getRecursosRelleno.next(data);
161
140
  }
162
141
  getVariableStorage(variable:variable):void{
163
142
  this.events.getVariableStorage.next(variable);
@@ -174,8 +153,8 @@ class SmoEvents{
174
153
  public infoCurrentLocation: Subject<location> = new Subject<location>();
175
154
  public setSalidaData: Subject<DataSalida> = new Subject<DataSalida>();
176
155
  public updatefromsalida: Subject<any> = new Subject<any>();
177
- public getVideoClips: Subject<VideoClips> = new Subject<VideoClips>();
178
- public getVideosRelleno: Subject<VideoClipsRelleno> = new Subject<VideoClipsRelleno>();
156
+ public getRecursos: Subject<GetRecursos> = new Subject<GetRecursos>();
157
+ public getRecursosRelleno: Subject<GetRecursosRelleno> = new Subject<GetRecursosRelleno>();
179
158
  public getVariableStorage: Subject<variable> = new Subject<variable>();
180
159
  constructor(smo:SMO){}
181
160
  }
@@ -413,15 +392,15 @@ class smoCallBacks{
413
392
  idSmo: this.smo.id
414
393
  }, "*");
415
394
  }
416
- getVideoClips():void{
395
+ getRecursos():void{
417
396
  parent.postMessage({
418
- target: "Dnv.smoCallbacks.getVideoClips",
397
+ target: "Dnv.smoCallbacks.getRecursos",
419
398
  idSmo: this.smo.id
420
399
  }, "*");
421
400
  }
422
- getVideosRelleno():void{
401
+ getRecursosRelleno():void{
423
402
  parent.postMessage({
424
- target: "Dnv.smoCallbacks.getVideosRelleno",
403
+ target: "Dnv.smoCallbacks.getRecursosRelleno",
425
404
  idSmo: this.smo.id
426
405
  }, "*");
427
406
  }
@@ -537,8 +516,8 @@ export enum SMO_EVENT_TYPE{
537
516
  setSalidaData ="setSalidaData",
538
517
  updatefromsalida = "updatefromsalida",
539
518
  setDatasourceJson = "setDatasourceJson",
540
- getVideoClips = "getVideoClips",
541
- getVideosRelleno = "getVideosRelleno",
519
+ getRecursos = "getRecursos",
520
+ getRecursosRelleno = "getRecursosRelleno",
542
521
  getVariableStorage = "getVariableStorage"
543
522
  }
544
523
  export enum LogLevel {
package/.idea/dnvsmo.iml DELETED
@@ -1,12 +0,0 @@
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>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
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/dnvsmo.iml" filepath="$PROJECT_DIR$/.idea/dnvsmo.iml" />
6
- </modules>
7
- </component>
8
- </project>