@ariva-mds/mds 2.66.0 → 2.67.0
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/lib/cjs/api/MdsConnection.js +38 -11
- package/lib/cjs/api/MdsConnectionState.js +3 -2
- package/lib/esm/api/MdsConnection.js +38 -11
- package/lib/esm/api/MdsConnectionState.js +3 -2
- package/lib/types/api/MdsConnection.d.ts +7 -2
- package/lib/types/api/MdsConnection.d.ts.map +1 -1
- package/lib/types/api/MdsConnectionState.d.ts +2 -0
- package/lib/types/api/MdsConnectionState.d.ts.map +1 -1
- package/lib/types/api/MdsOptions.d.ts +7 -0
- package/lib/types/api/MdsOptions.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -17,7 +17,6 @@ class MdsConnection {
|
|
|
17
17
|
*/
|
|
18
18
|
constructor(websocketUrl, authdataCallback, options = { debug: false }) {
|
|
19
19
|
this.waitingForReconnect = [];
|
|
20
|
-
this.state = new MdsConnectionState_1.MdsConnectionState();
|
|
21
20
|
this.waitingForAuthentification = [];
|
|
22
21
|
this.nextGeneratedRequestId = 0;
|
|
23
22
|
this.runningRequests = new Map();
|
|
@@ -50,6 +49,8 @@ class MdsConnection {
|
|
|
50
49
|
*/
|
|
51
50
|
this.masterdataCache = undefined;
|
|
52
51
|
this.authdataCallback = authdataCallback;
|
|
52
|
+
this.watchdogTimeoutMs = this.getWatchdogTimeoutMs(options.watchdogTimeoutMs);
|
|
53
|
+
this.state = new MdsConnectionState_1.MdsConnectionState(this.watchdogTimeoutMs);
|
|
53
54
|
this.isDebug = !!options.debug;
|
|
54
55
|
this.websocket = new reconnecting_websocket_1.default(websocketUrl, [], options.wsOptions);
|
|
55
56
|
const outer = this;
|
|
@@ -78,13 +79,25 @@ class MdsConnection {
|
|
|
78
79
|
outer.processWebsocketMessageEvent(e);
|
|
79
80
|
};
|
|
80
81
|
this.stayAuthenticated();
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
outer.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
if (this.watchdogTimeoutMs > 0) {
|
|
83
|
+
this.reconnectTimer = setInterval(() => {
|
|
84
|
+
if (outer.state.isTimedOut()) {
|
|
85
|
+
outer.debug('websocket timed out, calling reconnect');
|
|
86
|
+
outer.state.forcedDisconnect();
|
|
87
|
+
outer.websocket.reconnect();
|
|
88
|
+
}
|
|
89
|
+
}, 1000);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
getWatchdogTimeoutMs(configuredWatchdogTimeoutMs) {
|
|
93
|
+
if (configuredWatchdogTimeoutMs == null) {
|
|
94
|
+
return 20000;
|
|
95
|
+
}
|
|
96
|
+
// Explicitly allow disabling watchdog via 0 or negative values.
|
|
97
|
+
if (!Number.isFinite(configuredWatchdogTimeoutMs) || configuredWatchdogTimeoutMs <= 0) {
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
return Math.floor(configuredWatchdogTimeoutMs);
|
|
88
101
|
}
|
|
89
102
|
close() {
|
|
90
103
|
if (this.reconnectTimer) {
|
|
@@ -93,10 +106,24 @@ class MdsConnection {
|
|
|
93
106
|
this.websocket.close();
|
|
94
107
|
}
|
|
95
108
|
/**
|
|
96
|
-
*
|
|
109
|
+
* Creates a heartbeat observable that can be subscribed to.
|
|
110
|
+
* @param periodSeconds Optional heartbeat period in seconds.
|
|
111
|
+
* If omitted or invalid, the period is not sent and server defaults apply.
|
|
97
112
|
*/
|
|
98
|
-
heartbeat() {
|
|
99
|
-
|
|
113
|
+
heartbeat(periodSeconds) {
|
|
114
|
+
const heartbeatCommand = {
|
|
115
|
+
period: this.getHeartbeatPeriodSeconds(periodSeconds)
|
|
116
|
+
};
|
|
117
|
+
return this.observable({ heartbeat: heartbeatCommand }).pipe((0, rxjs_1.map)((x) => x.dataHeartbeat));
|
|
118
|
+
}
|
|
119
|
+
getHeartbeatPeriodSeconds(configuredPeriodSeconds) {
|
|
120
|
+
if (configuredPeriodSeconds == null) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
if (!Number.isFinite(configuredPeriodSeconds) || configuredPeriodSeconds <= 0) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
return Math.floor(configuredPeriodSeconds);
|
|
100
127
|
}
|
|
101
128
|
/**
|
|
102
129
|
* sets the priority for sources
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MdsConnectionState = void 0;
|
|
4
4
|
class MdsConnectionState {
|
|
5
|
-
constructor() {
|
|
5
|
+
constructor(timeoutMs = 20000) {
|
|
6
6
|
this.isConnected = false;
|
|
7
7
|
this.isAuthenticated = false;
|
|
8
8
|
this.lastUpdate = new Date();
|
|
9
|
+
this.timeoutMs = timeoutMs;
|
|
9
10
|
}
|
|
10
11
|
connectionOpened() {
|
|
11
12
|
this.isConnected = true;
|
|
@@ -26,7 +27,7 @@ class MdsConnectionState {
|
|
|
26
27
|
this.lastUpdate = new Date();
|
|
27
28
|
}
|
|
28
29
|
isTimedOut() {
|
|
29
|
-
return Date.now() - this.lastUpdate.getTime()
|
|
30
|
+
return Date.now() - this.lastUpdate.getTime() >= this.timeoutMs;
|
|
30
31
|
}
|
|
31
32
|
forcedDisconnect() {
|
|
32
33
|
this.lastUpdate = new Date();
|
|
@@ -11,7 +11,6 @@ export class MdsConnection {
|
|
|
11
11
|
*/
|
|
12
12
|
constructor(websocketUrl, authdataCallback, options = { debug: false }) {
|
|
13
13
|
this.waitingForReconnect = [];
|
|
14
|
-
this.state = new MdsConnectionState();
|
|
15
14
|
this.waitingForAuthentification = [];
|
|
16
15
|
this.nextGeneratedRequestId = 0;
|
|
17
16
|
this.runningRequests = new Map();
|
|
@@ -44,6 +43,8 @@ export class MdsConnection {
|
|
|
44
43
|
*/
|
|
45
44
|
this.masterdataCache = undefined;
|
|
46
45
|
this.authdataCallback = authdataCallback;
|
|
46
|
+
this.watchdogTimeoutMs = this.getWatchdogTimeoutMs(options.watchdogTimeoutMs);
|
|
47
|
+
this.state = new MdsConnectionState(this.watchdogTimeoutMs);
|
|
47
48
|
this.isDebug = !!options.debug;
|
|
48
49
|
this.websocket = new ReconnectingWebSocket(websocketUrl, [], options.wsOptions);
|
|
49
50
|
const outer = this;
|
|
@@ -72,13 +73,25 @@ export class MdsConnection {
|
|
|
72
73
|
outer.processWebsocketMessageEvent(e);
|
|
73
74
|
};
|
|
74
75
|
this.stayAuthenticated();
|
|
75
|
-
this.
|
|
76
|
-
|
|
77
|
-
outer.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
if (this.watchdogTimeoutMs > 0) {
|
|
77
|
+
this.reconnectTimer = setInterval(() => {
|
|
78
|
+
if (outer.state.isTimedOut()) {
|
|
79
|
+
outer.debug('websocket timed out, calling reconnect');
|
|
80
|
+
outer.state.forcedDisconnect();
|
|
81
|
+
outer.websocket.reconnect();
|
|
82
|
+
}
|
|
83
|
+
}, 1000);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
getWatchdogTimeoutMs(configuredWatchdogTimeoutMs) {
|
|
87
|
+
if (configuredWatchdogTimeoutMs == null) {
|
|
88
|
+
return 20000;
|
|
89
|
+
}
|
|
90
|
+
// Explicitly allow disabling watchdog via 0 or negative values.
|
|
91
|
+
if (!Number.isFinite(configuredWatchdogTimeoutMs) || configuredWatchdogTimeoutMs <= 0) {
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
return Math.floor(configuredWatchdogTimeoutMs);
|
|
82
95
|
}
|
|
83
96
|
close() {
|
|
84
97
|
if (this.reconnectTimer) {
|
|
@@ -87,10 +100,24 @@ export class MdsConnection {
|
|
|
87
100
|
this.websocket.close();
|
|
88
101
|
}
|
|
89
102
|
/**
|
|
90
|
-
*
|
|
103
|
+
* Creates a heartbeat observable that can be subscribed to.
|
|
104
|
+
* @param periodSeconds Optional heartbeat period in seconds.
|
|
105
|
+
* If omitted or invalid, the period is not sent and server defaults apply.
|
|
91
106
|
*/
|
|
92
|
-
heartbeat() {
|
|
93
|
-
|
|
107
|
+
heartbeat(periodSeconds) {
|
|
108
|
+
const heartbeatCommand = {
|
|
109
|
+
period: this.getHeartbeatPeriodSeconds(periodSeconds)
|
|
110
|
+
};
|
|
111
|
+
return this.observable({ heartbeat: heartbeatCommand }).pipe(map((x) => x.dataHeartbeat));
|
|
112
|
+
}
|
|
113
|
+
getHeartbeatPeriodSeconds(configuredPeriodSeconds) {
|
|
114
|
+
if (configuredPeriodSeconds == null) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
if (!Number.isFinite(configuredPeriodSeconds) || configuredPeriodSeconds <= 0) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
return Math.floor(configuredPeriodSeconds);
|
|
94
121
|
}
|
|
95
122
|
/**
|
|
96
123
|
* sets the priority for sources
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export class MdsConnectionState {
|
|
2
|
-
constructor() {
|
|
2
|
+
constructor(timeoutMs = 20000) {
|
|
3
3
|
this.isConnected = false;
|
|
4
4
|
this.isAuthenticated = false;
|
|
5
5
|
this.lastUpdate = new Date();
|
|
6
|
+
this.timeoutMs = timeoutMs;
|
|
6
7
|
}
|
|
7
8
|
connectionOpened() {
|
|
8
9
|
this.isConnected = true;
|
|
@@ -23,7 +24,7 @@ export class MdsConnectionState {
|
|
|
23
24
|
this.lastUpdate = new Date();
|
|
24
25
|
}
|
|
25
26
|
isTimedOut() {
|
|
26
|
-
return Date.now() - this.lastUpdate.getTime()
|
|
27
|
+
return Date.now() - this.lastUpdate.getTime() >= this.timeoutMs;
|
|
27
28
|
}
|
|
28
29
|
forcedDisconnect() {
|
|
29
30
|
this.lastUpdate = new Date();
|
|
@@ -14,15 +14,20 @@ export declare class MdsConnection {
|
|
|
14
14
|
private readonly runningRequests;
|
|
15
15
|
private readonly isDebug;
|
|
16
16
|
private readonly reconnectTimer;
|
|
17
|
+
private readonly watchdogTimeoutMs;
|
|
17
18
|
/**
|
|
18
19
|
* construct an MdsConnection
|
|
19
20
|
*/
|
|
20
21
|
constructor(websocketUrl: string, authdataCallback: () => Promise<MdsAuthdata>, options?: MdsOptions);
|
|
22
|
+
private getWatchdogTimeoutMs;
|
|
21
23
|
close(): void;
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* Creates a heartbeat observable that can be subscribed to.
|
|
26
|
+
* @param periodSeconds Optional heartbeat period in seconds.
|
|
27
|
+
* If omitted or invalid, the period is not sent and server defaults apply.
|
|
24
28
|
*/
|
|
25
|
-
heartbeat(): Observable<string | undefined>;
|
|
29
|
+
heartbeat(periodSeconds?: number): Observable<string | undefined>;
|
|
30
|
+
private getHeartbeatPeriodSeconds;
|
|
26
31
|
/**
|
|
27
32
|
* sets the priority for sources
|
|
28
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MdsConnection.d.ts","sourceRoot":"","sources":["../../../src/api/MdsConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAsB,MAAM,MAAM,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EAEjB,2BAA2B,EAE3B,iBAAiB,EAEjB,yBAAyB,EAGzB,6BAA6B,EAE7B,gBAAgB,EAChB,2BAA2B,EAE3B,OAAO,EACP,UAAU,EACV,UAAU,EAEV,eAAe,EAEf,SAAS,EACT,oBAAoB,EAEpB,cAAc,EAEd,WAAW,EAEX,gBAAgB,EAEhB,WAAW,EAEX,oBAAoB,EAGpB,gBAAgB,EAEjB,MAAM,WAAW,CA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D;;SAEK;IACE,wBAAwB,CAC7B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,UAAU,EACtB,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EACrB,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC;IActD;;SAEK;IACE,OAAO,CAAC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAC7B,UAAU,CAAC,WAAW,CAAC;IAgB1B,OAAO,CAAC,wCAAwC;IAYhD,OAAO,CAAC,iCAAiC;IAQzC,OAAO,CAAC,iBAAiB;IAiDzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,4BAA4B;IAiCpC,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare class MdsConnectionState {
|
|
2
|
+
private readonly timeoutMs;
|
|
2
3
|
isConnected: boolean;
|
|
3
4
|
isAuthenticated: boolean;
|
|
4
5
|
lastUpdate: Date;
|
|
6
|
+
constructor(timeoutMs?: number);
|
|
5
7
|
connectionOpened(): void;
|
|
6
8
|
connectionClosed(): void;
|
|
7
9
|
authenticationAccepted(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MdsConnectionState.d.ts","sourceRoot":"","sources":["../../../src/api/MdsConnectionState.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"MdsConnectionState.d.ts","sourceRoot":"","sources":["../../../src/api/MdsConnectionState.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAC5B,WAAW,EAAE,OAAO,CAAS;IAC7B,eAAe,EAAE,OAAO,CAAS;IACjC,UAAU,EAAE,IAAI,CAAc;gBAEzB,SAAS,GAAE,MAAc;IAIrC,gBAAgB;IAMhB,gBAAgB;IAKhB,sBAAsB;IAItB,mBAAmB;IAInB,eAAe;IAIR,UAAU;IAIjB,gBAAgB;CAGjB"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Options as ReconnectingWebSocketOptions } from 'reconnecting-websocket';
|
|
2
2
|
export type MdsOptions = {
|
|
3
3
|
debug?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Watchdog timeout in milliseconds for incoming websocket messages.
|
|
6
|
+
* If no message is received within this timeout, a reconnect is triggered.
|
|
7
|
+
* - `undefined`: use default watchdog timeout (`20000` ms)
|
|
8
|
+
* - `<= 0`: disable watchdog completely
|
|
9
|
+
*/
|
|
10
|
+
watchdogTimeoutMs?: number;
|
|
4
11
|
wsOptions?: ReconnectingWebSocketOptions;
|
|
5
12
|
};
|
|
6
13
|
//# sourceMappingURL=MdsOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MdsOptions.d.ts","sourceRoot":"","sources":["../../../src/api/MdsOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAC1C,CAAC"}
|
|
1
|
+
{"version":3,"file":"MdsOptions.d.ts","sourceRoot":"","sources":["../../../src/api/MdsOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariva-mds/mds",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.67.0",
|
|
4
4
|
"description": "Stock market data",
|
|
5
5
|
"license": "Commercial, contact sales@ariva.de",
|
|
6
6
|
"keywords": [
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"@types/chai": "^4.3.8",
|
|
37
37
|
"@types/mocha": "^10.0.2",
|
|
38
38
|
"@types/node": "^18.11.18",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
40
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
41
41
|
"chai": "^4.3.10",
|
|
42
42
|
"cross-env": "^7.0.3",
|
|
43
43
|
"eslint": "^9.28.0",
|
|
44
|
-
"mocha": "^
|
|
44
|
+
"mocha": "^11.7.5",
|
|
45
45
|
"ts-node": "^10.9.1"
|
|
46
46
|
}
|
|
47
47
|
}
|