@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.
- package/example/example.js +5 -7
- package/lib/gateway/PortfolioGateway.js +4 -6
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/example/example.js
CHANGED
|
@@ -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.
|
|
497
|
-
assert.
|
|
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(
|
|
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.
|
|
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.
|
|
512
|
-
assert.
|
|
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(
|
|
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