@quotemedia.com/streamer 2.53.0 → 2.55.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/examples/enduser-example.html +1 -1
- package/examples/enterprise-token-example.html +1 -1
- package/examples/reconnect-example.html +1 -1
- package/examples/stomp-3rd-party-library-example.html +1 -1
- package/examples/subscription-example.html +1 -1
- package/examples/wmid-example.html +1 -1
- package/package.json +1 -1
- package/{qmci-streamer-2.53.0.js → qmci-streamer-2.55.0.js} +105 -3
- package/{qmci-streamer-2.53.0.min.js → qmci-streamer-2.55.0.min.js} +7 -7
package/package.json
CHANGED
|
@@ -524,7 +524,30 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
524
524
|
var CONSOLIDATED_SYMBOL_ENTITLEMENTS_COEFFICIENT = 14;
|
|
525
525
|
var CONSOLIDATED_SYMBOL_SUFFIX = ":CC";
|
|
526
526
|
|
|
527
|
+
/**
|
|
528
|
+
* Represents a bidirectional connection to the streaming service server.
|
|
529
|
+
* <p>
|
|
530
|
+
* The Stream class provides the core functionality for establishing connections to the
|
|
531
|
+
* QuoteMedia streamer service, managing subscriptions, and processing incoming messages.
|
|
532
|
+
* It handles various message types including control messages, market data, and error events.
|
|
533
|
+
* <p>
|
|
534
|
+
* Typical usage involves:
|
|
535
|
+
* 1. Creating a Stream instance
|
|
536
|
+
* 2. Setting up event handlers for messages and errors
|
|
537
|
+
* 3. Opening the connection
|
|
538
|
+
* 4. Subscribing to desired symbols and data types
|
|
539
|
+
* 5. Processing incoming data
|
|
540
|
+
* 6. Closing the connection when done
|
|
541
|
+
*/
|
|
542
|
+
|
|
527
543
|
var Stream = function () {
|
|
544
|
+
/**
|
|
545
|
+
* Creates a new Stream instance.
|
|
546
|
+
*
|
|
547
|
+
* @param {Object} streamingService - The underlying transport service
|
|
548
|
+
* @param {string} format - The message format (e.g., JSON, QMCI)
|
|
549
|
+
* @param {Object} log - The logger instance
|
|
550
|
+
*/
|
|
528
551
|
function Stream(streamingService, format, log) {
|
|
529
552
|
var _this = this;
|
|
530
553
|
|
|
@@ -575,6 +598,17 @@ var Stream = function () {
|
|
|
575
598
|
});
|
|
576
599
|
}
|
|
577
600
|
|
|
601
|
+
/**
|
|
602
|
+
* Opens a connection to the server.
|
|
603
|
+
* <p>
|
|
604
|
+
* This call will block until either the stream is opened or the attempt fails.
|
|
605
|
+
*
|
|
606
|
+
* @param {Function} callback - Called when the connection attempt completes
|
|
607
|
+
* with (error, stream) parameters
|
|
608
|
+
* @throws {Error} If the stream cannot be opened
|
|
609
|
+
*/
|
|
610
|
+
|
|
611
|
+
|
|
578
612
|
Stream.prototype.open = function open(callback) {
|
|
579
613
|
try {
|
|
580
614
|
this.pendingConnection = callback;
|
|
@@ -595,6 +629,19 @@ var Stream = function () {
|
|
|
595
629
|
return this.events.on(event, listener);
|
|
596
630
|
};
|
|
597
631
|
|
|
632
|
+
/**
|
|
633
|
+
* Subscribes to streaming data for the specified symbols and data types.
|
|
634
|
+
* <p>
|
|
635
|
+
* This method initiates subscription requests to the server and handles the responses.
|
|
636
|
+
* The callback will be invoked when all subscription requests are processed.
|
|
637
|
+
*
|
|
638
|
+
* @param {string|Array<string>} symbols - The symbol(s) to subscribe to
|
|
639
|
+
* @param {string|Array<string>} types - The data type(s) to subscribe for
|
|
640
|
+
* @param {Object|Function} optsOrCallback - Options object or callback function
|
|
641
|
+
* @param {Function} [callbackOrNothing] - Callback function if not provided as optsOrCallback
|
|
642
|
+
*/
|
|
643
|
+
|
|
644
|
+
|
|
598
645
|
Stream.prototype.subscribe = function subscribe(symbols, types, optsOrCallback, callbackOrNothing) {
|
|
599
646
|
var _this2 = this;
|
|
600
647
|
|
|
@@ -913,6 +960,19 @@ var Stream = function () {
|
|
|
913
960
|
this.send(request);
|
|
914
961
|
};
|
|
915
962
|
|
|
963
|
+
/**
|
|
964
|
+
* Unsubscribes from streaming data for the specified symbols and data types.
|
|
965
|
+
* <p>
|
|
966
|
+
* This method initiates unsubscription requests to the server and handles the responses.
|
|
967
|
+
* The callback will be invoked when all unsubscription requests are processed.
|
|
968
|
+
*
|
|
969
|
+
* @param {string|Array<string>} symbols - The symbol(s) to unsubscribe from
|
|
970
|
+
* @param {string|Array<string>} types - The data type(s) to unsubscribe from
|
|
971
|
+
* @param {Object|Function} optsOrCallback - Options object or callback function
|
|
972
|
+
* @param {Function} [callbackOrNothing] - Callback function if not provided as optsOrCallback
|
|
973
|
+
*/
|
|
974
|
+
|
|
975
|
+
|
|
916
976
|
Stream.prototype.unsubscribe = function unsubscribe(symbols, types, optsOrCallback, callbackOrNothing) {
|
|
917
977
|
var _this4 = this;
|
|
918
978
|
|
|
@@ -1995,6 +2055,15 @@ var Stream = function () {
|
|
|
1995
2055
|
}
|
|
1996
2056
|
};
|
|
1997
2057
|
|
|
2058
|
+
/**
|
|
2059
|
+
* Closes this stream and releases resources.
|
|
2060
|
+
* <p>
|
|
2061
|
+
* This call will return immediately. The callback will be called once the stream is closed.
|
|
2062
|
+
*
|
|
2063
|
+
* @param {Function} callback - Called when the stream is closed
|
|
2064
|
+
*/
|
|
2065
|
+
|
|
2066
|
+
|
|
1998
2067
|
Stream.prototype.close = function close(callback) {
|
|
1999
2068
|
this.doClose(events.close({
|
|
2000
2069
|
reason: "Manually closed",
|
|
@@ -2005,6 +2074,13 @@ var Stream = function () {
|
|
|
2005
2074
|
}
|
|
2006
2075
|
};
|
|
2007
2076
|
|
|
2077
|
+
/**
|
|
2078
|
+
* Determines if this stream is in a closed state.
|
|
2079
|
+
*
|
|
2080
|
+
* @returns {boolean} true if the stream is closed, false otherwise
|
|
2081
|
+
*/
|
|
2082
|
+
|
|
2083
|
+
|
|
2008
2084
|
Stream.prototype.isClosed = function isClosed() {
|
|
2009
2085
|
return this.conn == null;
|
|
2010
2086
|
};
|
|
@@ -6815,6 +6891,10 @@ fmt.Formatter.prototype._fmttradeNotification = function (val) {
|
|
|
6815
6891
|
s.append(val.alertable);
|
|
6816
6892
|
s.sep();
|
|
6817
6893
|
s.append(val.title);
|
|
6894
|
+
s.sep();
|
|
6895
|
+
s.append(val.eventSubtype);
|
|
6896
|
+
s.sep();
|
|
6897
|
+
s.append(JSON.stringify(val.discretionaryContent));
|
|
6818
6898
|
|
|
6819
6899
|
return s.toString();
|
|
6820
6900
|
};
|
|
@@ -15397,6 +15477,10 @@ var StompStreamingService = function () {
|
|
|
15397
15477
|
authMessage.rejectExcessiveConnection = this.config.rejectExcessiveConnection;
|
|
15398
15478
|
}
|
|
15399
15479
|
|
|
15480
|
+
if (this.config.entMax != null && this.config.entMax !== "") {
|
|
15481
|
+
authMessage.entMax = this.config.entMax;
|
|
15482
|
+
}
|
|
15483
|
+
|
|
15400
15484
|
stompClient.connect(headers, function (frame) {
|
|
15401
15485
|
stompClient.subscribe('/user/queue/messages', function (responseMessage) {
|
|
15402
15486
|
handlers(headers).onMessage(responseMessage);
|
|
@@ -15486,21 +15570,29 @@ exports.__esModule = true;
|
|
|
15486
15570
|
*/
|
|
15487
15571
|
|
|
15488
15572
|
var LIBRARY_NAME = exports.LIBRARY_NAME = "JavaScript";
|
|
15489
|
-
var VERSION = exports.VERSION = "2.
|
|
15573
|
+
var VERSION = exports.VERSION = "2.55.0";
|
|
15490
15574
|
|
|
15491
15575
|
/**
|
|
15492
|
-
* Streamer
|
|
15576
|
+
* Streamer API namespace.
|
|
15577
|
+
* <p>
|
|
15578
|
+
* Provides the foundational classes and interfaces for interacting with the QuoteMedia streaming service.
|
|
15579
|
+
* This includes message definitions, control operations, and market data types.
|
|
15493
15580
|
* @namespace
|
|
15494
15581
|
*/
|
|
15495
15582
|
var messages = exports.messages = {};
|
|
15496
15583
|
|
|
15497
15584
|
/**
|
|
15498
|
-
* Streamer control message namespace.
|
|
15585
|
+
* Streamer control message namespace.
|
|
15586
|
+
* <p>
|
|
15587
|
+
* Contains message types for connection management, subscriptions, and administrative operations.
|
|
15588
|
+
* @namespace
|
|
15499
15589
|
*/
|
|
15500
15590
|
messages.control = {};
|
|
15501
15591
|
|
|
15502
15592
|
/**
|
|
15503
15593
|
* Streamer market data message namespace.
|
|
15594
|
+
* <p>
|
|
15595
|
+
* Contains message types for various market data events and information.
|
|
15504
15596
|
* @namespace
|
|
15505
15597
|
*/
|
|
15506
15598
|
messages.market = {};
|
|
@@ -16119,6 +16211,8 @@ messages.control.ReconnectResponse = function () {
|
|
|
16119
16211
|
|
|
16120
16212
|
/**
|
|
16121
16213
|
* Creates a connection response message.
|
|
16214
|
+
* <p>
|
|
16215
|
+
* This message is sent by the server when a connection is being closed, indicating the reason for closure.
|
|
16122
16216
|
* @constructor
|
|
16123
16217
|
*/
|
|
16124
16218
|
messages.control.ConnectionClose = function () {
|
|
@@ -16133,6 +16227,8 @@ messages.control.ConnectionClose = function () {
|
|
|
16133
16227
|
|
|
16134
16228
|
/**
|
|
16135
16229
|
* The connection close reason message.
|
|
16230
|
+
* <p>
|
|
16231
|
+
* A human-readable explanation of why the connection is being closed.
|
|
16136
16232
|
* @type {string}
|
|
16137
16233
|
* @see {@link messages.control.ResponseCodes}
|
|
16138
16234
|
*/
|
|
@@ -16213,6 +16309,12 @@ messages.control.AuthenticationMessage = function () {
|
|
|
16213
16309
|
* @type {Boolean}
|
|
16214
16310
|
*/
|
|
16215
16311
|
this.rejectExcessiveConnection = false;
|
|
16312
|
+
|
|
16313
|
+
/**
|
|
16314
|
+
* EntMax
|
|
16315
|
+
* @type {String}
|
|
16316
|
+
*/
|
|
16317
|
+
this.entMax = null;
|
|
16216
16318
|
};
|
|
16217
16319
|
messages.control.AuthenticationMessage.prototype = new messages.control.CtrlMessage();
|
|
16218
16320
|
|