@barchart/portfolio-client-js 1.2.21 → 1.2.24

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.
@@ -192,8 +192,6 @@ module.exports = function () {
192
192
  requestInterceptorToUse = RequestInterceptor.EMPTY;
193
193
  }
194
194
 
195
- _this._positionObservers = {};
196
-
197
195
  _this._readPortfoliosEndpoint = EndpointBuilder.for('read-portfolios', 'read portfolios').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
198
196
  pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false);
199
197
  }).withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE).withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPortfolioDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
@@ -493,8 +491,8 @@ module.exports = function () {
493
491
  var _this10 = this;
494
492
 
495
493
  return promise.build(function (resolveCallback) {
496
- assert.argumentIsOptional(portfolio, 'portfolio', String);
497
- assert.argumentIsOptional(position, 'position', String);
494
+ assert.argumentIsRequired(portfolio, 'portfolio', String);
495
+ assert.argumentIsRequired(position, 'position', String);
498
496
 
499
497
  var scheduleCheck = function scheduleCheck(delay) {
500
498
  setTimeout(function () {
@@ -504,8 +502,8 @@ module.exports = function () {
504
502
  });
505
503
 
506
504
  if (is.object(p)) {
507
- if (is.object(p.system) && is.object(p.system) && is.boolean(p.system.locked)) {
508
- scheduleCheck(5000);
505
+ if (is.object(p.system) && is.object(p.system) && is.boolean(p.system.locked) && p.system.locked) {
506
+ scheduleCheck(delay + 1000);
509
507
  } else {
510
508
  resolveCallback(p);
511
509
  }
@@ -1438,7 +1436,7 @@ module.exports = function () {
1438
1436
  return {
1439
1437
  JwtGateway: JwtGateway,
1440
1438
  PortfolioGateway: PortfolioGateway,
1441
- version: '1.2.21'
1439
+ version: '1.2.24'
1442
1440
  };
1443
1441
  }();
1444
1442
 
@@ -58,8 +58,6 @@ module.exports = (() => {
58
58
  requestInterceptorToUse = RequestInterceptor.EMPTY;
59
59
  }
60
60
 
61
- this._positionObservers = { };
62
-
63
61
  this._readPortfoliosEndpoint = EndpointBuilder.for('read-portfolios', 'read portfolios')
64
62
  .withVerb(VerbType.GET)
65
63
  .withProtocol(protocolType)
@@ -508,8 +506,8 @@ module.exports = (() => {
508
506
  */
509
507
  observePositionLock(portfolio, position) {
510
508
  return promise.build((resolveCallback) => {
511
- assert.argumentIsOptional(portfolio, 'portfolio', String);
512
- assert.argumentIsOptional(position, 'position', String);
509
+ assert.argumentIsRequired(portfolio, 'portfolio', String);
510
+ assert.argumentIsRequired(position, 'position', String);
513
511
 
514
512
  const scheduleCheck = (delay) => {
515
513
  setTimeout(() => {
@@ -518,8 +516,8 @@ module.exports = (() => {
518
516
  const p = positions.find(p => p.position === position);
519
517
 
520
518
  if (is.object(p)) {
521
- if (is.object(p.system) && is.object(p.system) && is.boolean(p.system.locked)) {
522
- scheduleCheck(5000);
519
+ if (is.object(p.system) && is.object(p.system) && is.boolean(p.system.locked) && p.system.locked) {
520
+ scheduleCheck(delay + 1000);
523
521
  } else {
524
522
  resolveCallback(p);
525
523
  }
package/lib/index.js CHANGED
@@ -7,6 +7,6 @@ module.exports = (() => {
7
7
  return {
8
8
  JwtGateway: JwtGateway,
9
9
  PortfolioGateway: PortfolioGateway,
10
- version: '1.2.21'
10
+ version: '1.2.24'
11
11
  };
12
12
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-client-js",
3
- "version": "1.2.21",
3
+ "version": "1.2.24",
4
4
  "description": "JavaScript library for interfacing with Barchart's Portfolio API",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",