@quotemedia.com/streamer 2.24.0 → 2.25.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/README.md CHANGED
@@ -9,10 +9,10 @@ Javascript library responsible to connect to the Quotemedia Streaming Service.
9
9
  ````
10
10
 
11
11
  ### Usage
12
- Include the javascript file (qmci-streamer-2.24.0.min.js) in your html page.
12
+ Include the javascript file (qmci-streamer-2.25.0.min.js) in your html page.
13
13
 
14
14
  ````
15
- <script src="qmci-streamer-2.24.0.min.js"></script>
15
+ <script src="qmci-streamer-2.25.0.min.js"></script>
16
16
  ````
17
17
 
18
18
  After this, you should be able to use the Streamer object. It will allow you to authenticate, subscribe and unsubscribe
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
 
3
3
  <head>
4
- <script src="qmci-streamer-2.24.0.min.js"></script>
4
+ <script src="qmci-streamer-2.25.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.24.0.min.js"></script>
4
+ <script src="qmci-streamer-2.25.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.24.0",
3
+ "version": "2.25.0",
4
4
  "description": "A JavaScript client for QuoteMedia's streaming data service.",
5
5
  "main": "lib/index.js",
6
6
  "author": "QuoteMedia",
@@ -5502,8 +5502,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5502
5502
 
5503
5503
  var AUTHSERVICEURLS = {
5504
5504
  "ping": "/g/ping",
5505
- "authenticate_get": "/g/authenticate/v0",
5506
- "authenticate_post": "/p/authenticate/v0/legacy=false"
5505
+ "authenticate_post": "/p/authenticate/v0/?legacy=false"
5507
5506
  };
5508
5507
 
5509
5508
  var EnduserAuthService = function () {
@@ -5522,15 +5521,11 @@ var EnduserAuthService = function () {
5522
5521
  this.http = http;
5523
5522
  this.host = config.host || "app.quotemedia.com";
5524
5523
  this.credentials = credentials;
5525
- this.method = config.method || "GET";
5524
+ this.method = "POST";
5526
5525
  }
5527
5526
 
5528
5527
  EnduserAuthService.prototype.login = function login(callback) {
5529
- if ('POST' == this.method) {
5530
- this.login_POST(callback);
5531
- } else {
5532
- this.login_GET(callback);
5533
- }
5528
+ this.login_POST(callback);
5534
5529
  };
5535
5530
 
5536
5531
  EnduserAuthService.prototype.login_POST = function login_POST(callback) {
@@ -5545,18 +5540,7 @@ var EnduserAuthService = function () {
5545
5540
  type: 'POST',
5546
5541
  contentType: 'application/json',
5547
5542
  data: JSON.stringify(req),
5548
- success: this.handleSuccess(callback),
5549
- failure: this.handleFailure(callback)
5550
- });
5551
- };
5552
-
5553
- EnduserAuthService.prototype.login_GET = function login_GET(callback) {
5554
- var url = this.host + AUTHSERVICEURLS.authenticate_get;
5555
- url += '/' + this.credentials.wmid + '/' + this.credentials.username + '/' + this.credentials.password + '/';
5556
- this.http({
5557
- url: url,
5558
5543
  dataType: "json",
5559
- timeout: 5000,
5560
5544
  success: this.handleSuccess(callback),
5561
5545
  failure: this.handleFailure(callback)
5562
5546
  });
@@ -5665,6 +5649,7 @@ fmt.Formatter = function () {
5665
5649
  this.formatters[_streamerApi.messages.MessageTypeNames.data.ALERT] = this._fmtalert;
5666
5650
  this.formatters[_streamerApi.messages.MessageTypeNames.data.NEWS] = this._fmtnews;
5667
5651
  this.formatters[_streamerApi.messages.MessageTypeNames.data.TRADENOTIFICATION] = this._fmttradeNotification;
5652
+ this.formatters[_streamerApi.messages.MessageTypeNames.data.NEWSCMDFILTER] = this._fmtnewscmdfilter;
5668
5653
  };
5669
5654
 
5670
5655
  fmt.Formatter._UNKOWNTYPE = '__UNKNOWN__';
@@ -6230,7 +6215,7 @@ fmt.Formatter.prototype._fmttradeNotification = function (val) {
6230
6215
  s.sep();
6231
6216
  s.append(val.accountId);
6232
6217
  s.sep();
6233
- s.append(val.brokerId);
6218
+ s.append(val.enduserId);
6234
6219
  s.sep();
6235
6220
  s.append(val.message);
6236
6221
  s.sep();
@@ -6239,6 +6224,43 @@ fmt.Formatter.prototype._fmttradeNotification = function (val) {
6239
6224
  return s.toString();
6240
6225
  };
6241
6226
 
6227
+ fmt.Formatter.prototype._fmtnewscmdfilter = function (val) {
6228
+ var s = new fmt.StringBuilder();
6229
+ s.append("NEWS CMD_FILTER");
6230
+ s.sep();
6231
+ s.append(val.srcName + ": [");
6232
+ s.append(val.srcValue);
6233
+ s.append("]");
6234
+ s.sep();
6235
+ s.append(val.topicName + ": [");
6236
+ s.append(val.topicValue);
6237
+ s.append("]");
6238
+ s.sep();
6239
+ s.append(val.symbolName + ": [");
6240
+ s.append(val.symbolValue);
6241
+ s.append("]");
6242
+ s.sep();
6243
+ s.append(val.excodeName + ": ");
6244
+ s.append(val.excodeValue);
6245
+ s.sep();
6246
+ s.append(val.exgroupName + ": ");
6247
+ s.append(val.exgroupValue);
6248
+ s.sep();
6249
+ s.append(val.summaryName + ": ");
6250
+ s.append(val.summaryValue);
6251
+ s.sep();
6252
+ s.append(val.summlenName + ": ");
6253
+ s.append(val.summlenValue);
6254
+ s.sep();
6255
+ s.append(val.constituentName + ": ");
6256
+ s.append(val.constituentValue);
6257
+ s.sep();
6258
+ s.append(val.searchByExchangeName + ": ");
6259
+ s.append(val.searchByExchangeValue);
6260
+
6261
+ return s.toString();
6262
+ };
6263
+
6242
6264
  fmt.Formatter.prototype._fmtheartbeat = function (val) {
6243
6265
  var s = new fmt.StringBuilder();
6244
6266
  s.append("HEARBEAT");
@@ -6573,8 +6595,8 @@ function http(opts) {
6573
6595
  var url = opts.url;
6574
6596
  var success = opts.success || function () {};
6575
6597
  var failure = opts.failure || function () {};
6576
- var type = opts.type || "GET";
6577
- var applicationType = opts.applicationType;
6598
+ var type = opts.type || "POST";
6599
+ var contentType = opts.contentType;
6578
6600
  var data = opts.data;
6579
6601
  var timeout = opts.timeout;
6580
6602
 
@@ -6590,10 +6612,10 @@ function http(opts) {
6590
6612
  }
6591
6613
  }
6592
6614
  };
6593
- if (applicationType) {
6594
- xhr.setRequestHeader("Content-Type", applicationType);
6595
- }
6596
6615
  xhr.open(type, url, true);
6616
+ if (contentType) {
6617
+ xhr.setRequestHeader("Content-Type", contentType);
6618
+ }
6597
6619
  if (timeout) {
6598
6620
  xhr.timeout = timeout;
6599
6621
  }
@@ -11598,7 +11620,7 @@ exports.__esModule = true;
11598
11620
  */
11599
11621
 
11600
11622
  var LIBRARY_NAME = exports.LIBRARY_NAME = "JavaScript";
11601
- var VERSION = exports.VERSION = "2.24.0";
11623
+ var VERSION = exports.VERSION = "2.25.0";
11602
11624
 
11603
11625
  /**
11604
11626
  * Streamer message api namespace.
@@ -11686,7 +11708,8 @@ messages.MessageTypeNames = {
11686
11708
  IMBALANCESTATUS: 'D16',
11687
11709
  ALERT: 'D17',
11688
11710
  NEWS: 'D18',
11689
- TRADENOTIFICATION: 'D19'
11711
+ TRADENOTIFICATION: 'D19',
11712
+ NEWSCMDFILTER: 'D20'
11690
11713
  }
11691
11714
  };
11692
11715