@quotemedia.com/streamer 2.54.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.
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
 
3
3
  <head>
4
- <script src="qmci-streamer-2.54.0.min.js"></script>
4
+ <script src="qmci-streamer-2.55.0.min.js"></script>
5
5
  </head>
6
6
 
7
7
  <body>
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
 
3
3
  <head>
4
- <script src="qmci-streamer-2.54.0.min.js"></script>
4
+ <script src="qmci-streamer-2.55.0.min.js"></script>
5
5
  </head>
6
6
 
7
7
  <body>
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
 
3
3
  <head>
4
- <script src="qmci-streamer-2.54.0.min.js"></script>
4
+ <script src="qmci-streamer-2.55.0.min.js"></script>
5
5
  </head>
6
6
 
7
7
  <body>
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
 
4
4
  <head>
5
- <script src="qmci-streamer-2.54.0.min.js"></script>
5
+ <script src="qmci-streamer-2.55.0.min.js"></script>
6
6
  <script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
7
7
  </head>
8
8
 
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
 
3
3
  <head>
4
- <script src="qmci-streamer-2.54.0.min.js"></script>
4
+ <script src="qmci-streamer-2.55.0.min.js"></script>
5
5
  </head>
6
6
 
7
7
  <body>
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
 
3
3
  <head>
4
- <script src="qmci-streamer-2.54.0.min.js"></script>
4
+ <script src="qmci-streamer-2.55.0.min.js"></script>
5
5
  </head>
6
6
 
7
7
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quotemedia.com/streamer",
3
- "version": "2.54.0",
3
+ "version": "2.55.0",
4
4
  "description": "A JavaScript client for QuoteMedia's streaming data service.",
5
5
  "main": "lib/index.js",
6
6
  "author": "QuoteMedia",
@@ -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
  };
@@ -15490,21 +15570,29 @@ exports.__esModule = true;
15490
15570
  */
15491
15571
 
15492
15572
  var LIBRARY_NAME = exports.LIBRARY_NAME = "JavaScript";
15493
- var VERSION = exports.VERSION = "2.54.0";
15573
+ var VERSION = exports.VERSION = "2.55.0";
15494
15574
 
15495
15575
  /**
15496
- * Streamer message api namespace.
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.
15497
15580
  * @namespace
15498
15581
  */
15499
15582
  var messages = exports.messages = {};
15500
15583
 
15501
15584
  /**
15502
- * Streamer control message namespace. * @namespace
15585
+ * Streamer control message namespace.
15586
+ * <p>
15587
+ * Contains message types for connection management, subscriptions, and administrative operations.
15588
+ * @namespace
15503
15589
  */
15504
15590
  messages.control = {};
15505
15591
 
15506
15592
  /**
15507
15593
  * Streamer market data message namespace.
15594
+ * <p>
15595
+ * Contains message types for various market data events and information.
15508
15596
  * @namespace
15509
15597
  */
15510
15598
  messages.market = {};
@@ -16123,6 +16211,8 @@ messages.control.ReconnectResponse = function () {
16123
16211
 
16124
16212
  /**
16125
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.
16126
16216
  * @constructor
16127
16217
  */
16128
16218
  messages.control.ConnectionClose = function () {
@@ -16137,6 +16227,8 @@ messages.control.ConnectionClose = function () {
16137
16227
 
16138
16228
  /**
16139
16229
  * The connection close reason message.
16230
+ * <p>
16231
+ * A human-readable explanation of why the connection is being closed.
16140
16232
  * @type {string}
16141
16233
  * @see {@link messages.control.ResponseCodes}
16142
16234
  */