@denevads/dnv-smo 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@denevads/dnv-smo",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "SMO module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -16,5 +16,8 @@
16
16
  "license": "MIT",
17
17
  "devDependencies": {
18
18
  "@types/node": "^17.0.42"
19
+ },
20
+ "dependencies": {
21
+ "rxjs": "^7.5.6"
19
22
  }
20
- }
23
+ }
@@ -1,6 +1,9 @@
1
1
 
2
2
  export interface setDatasource{
3
3
  xml:string
4
+ }
5
+ export interface start{
6
+
4
7
  }
5
8
  export interface variable{
6
9
  variable:string,
@@ -30,4 +33,4 @@ export interface ExecFunction{
30
33
  export interface Notify{
31
34
  destion:string,
32
35
  value:any
33
- }
36
+ }
package/src/smo.ts CHANGED
@@ -1,17 +1,19 @@
1
1
  import {EventEmitter} from 'events';
2
- import { setDatasource,variable,location,DataSalida, ExecFunction, Notify } from "./interfaces/callbacks";
3
-
2
+ import { setDatasource,variable,location,DataSalida, ExecFunction, Notify, start } from "./interfaces/callbacks";
3
+ import { fromEvent, Observable } from 'rxjs';
4
4
  export class SMO extends EventEmitter{
5
5
  public vars:any = {};
6
6
  public id:string ="";
7
7
  public smoCallBacks:smoCallBacks;
8
8
  public utils:Utils;
9
+ public events:SmoEvents;
9
10
  constructor(){
10
11
  super();
11
12
  this.init();
12
13
  this.initOnMessage();
13
14
  this.smoCallBacks = new smoCallBacks(this);
14
15
  this.utils = new Utils(this,this.smoCallBacks);
16
+ this.events =new SmoEvents(this);
15
17
  }
16
18
  public init():void{
17
19
  let match,
@@ -106,6 +108,24 @@ export class SMO extends EventEmitter{
106
108
  }
107
109
 
108
110
  }
111
+ class SmoEvents{
112
+ public start: Observable<start>;
113
+ public setDatasource: Observable<setDatasource>;
114
+ public getVariable: Observable<variable>;
115
+ public setCurrentStream: Observable<string>;
116
+ public infoCurrentLocation: Observable<location>;
117
+ public setSalidaData: Observable<DataSalida>;
118
+ public updatefromsalida: Observable<any>;
119
+ constructor(smo:SMO){
120
+ this.start = fromEvent<start>(smo,SMO_EVENT_TYPE.start);
121
+ this.setDatasource = fromEvent<setDatasource>(smo,SMO_EVENT_TYPE.setDatasource);
122
+ this.getVariable = fromEvent<variable>(smo,SMO_EVENT_TYPE.getVariable);
123
+ this.setCurrentStream = fromEvent<string>(smo,SMO_EVENT_TYPE.setCurrentStream);
124
+ this.infoCurrentLocation = fromEvent<location>(smo,SMO_EVENT_TYPE.infoCurrentLocation);
125
+ this.setSalidaData = fromEvent<DataSalida>(smo,SMO_EVENT_TYPE.setSalidaData);
126
+ this.updatefromsalida = fromEvent<any>(smo,SMO_EVENT_TYPE.updatefromsalida);
127
+ }
128
+ }
109
129
  class smoCallBacks{
110
130
  smo:SMO;
111
131
  constructor(_smo:SMO){