@barchart/portfolio-client-js 1.2.2 → 1.2.3
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 +74 -529
- package/lib/gateway/PortfolioGateway.js +7 -5
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/example/example.js
CHANGED
|
@@ -26,7 +26,7 @@ module.exports = function () {
|
|
|
26
26
|
window.Barchart.ValuationType = ValuationType;
|
|
27
27
|
}();
|
|
28
28
|
|
|
29
|
-
},{"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Decimal":30,"@barchart/common-js/lang/Timezones":35,"@barchart/portfolio-api-common/lib/data/TransactionType":
|
|
29
|
+
},{"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Decimal":30,"@barchart/common-js/lang/Timezones":35,"@barchart/portfolio-api-common/lib/data/TransactionType":53,"@barchart/portfolio-api-common/lib/data/ValuationType":54,"@barchart/tgam-jwt-js/lib/JwtGateway":59}],2:[function(require,module,exports){
|
|
30
30
|
'use strict';
|
|
31
31
|
|
|
32
32
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -219,7 +219,7 @@ module.exports = function () {
|
|
|
219
219
|
|
|
220
220
|
_this._deletePositionEndpoint = EndpointBuilder.for('delete-position', 'delete position').withVerb(VerbType.DELETE).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
221
221
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('positions', 'positions').withVariableParameter('position', 'position', 'position', false);
|
|
222
|
-
}).withRequestInterceptor(requestInterceptorToUse).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
222
|
+
}).withBody('transaction').withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionMutateDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
223
223
|
|
|
224
224
|
_this._readPositionSummariesEndpoint = EndpointBuilder.for('read-position-summaries', 'read position summaries').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
225
225
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('summaries', 'summaries').withVariableParameter('position', 'position', 'position', false);
|
|
@@ -245,13 +245,13 @@ module.exports = function () {
|
|
|
245
245
|
qb.withVariableParameter('type', 'type', 'type', false, function (i) {
|
|
246
246
|
return i.code;
|
|
247
247
|
});
|
|
248
|
-
}).withBody('
|
|
248
|
+
}).withBody('transaction').withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionMutateDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
249
249
|
|
|
250
250
|
_this._deleteTransactionEndpoint = EndpointBuilder.for('delete-transaction', 'delete transaction').withVerb(VerbType.DELETE).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
251
251
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('positions', 'positions').withVariableParameter('position', 'position', 'position', false).withLiteralParameter('transactions', 'transactions').withVariableParameter('sequence', 'sequence', 'sequence', false);
|
|
252
252
|
}).withQueryBuilder(function (qb) {
|
|
253
253
|
qb.withVariableParameter('force', 'force', 'force', false).withVariableParameter('echo', 'echo', 'echo', false);
|
|
254
|
-
}).withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(
|
|
254
|
+
}).withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionMutateDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
255
255
|
|
|
256
256
|
_this._readTransactionsReportEndpoint = EndpointBuilder.for('read-transaction-report', 'read transaction report').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
257
257
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('positions', 'positions').withVariableParameter('position', 'position', 'position', true).withLiteralParameter('transactions', 'transactions').withLiteralParameter('formatted', 'formatted');
|
|
@@ -800,7 +800,7 @@ module.exports = function () {
|
|
|
800
800
|
}
|
|
801
801
|
});
|
|
802
802
|
|
|
803
|
-
var
|
|
803
|
+
var responseInterceptorForPositionMutateDeserialization = ResponseInterceptor.fromDelegate(function (response, ignored) {
|
|
804
804
|
try {
|
|
805
805
|
var saved = response.data.positions.saved.map(function (p) {
|
|
806
806
|
return JSON.parse(p, PositionSchema.CLIENT.schema.getReviver());
|
|
@@ -826,7 +826,7 @@ module.exports = function () {
|
|
|
826
826
|
|
|
827
827
|
return returnRef;
|
|
828
828
|
} catch (e) {
|
|
829
|
-
console.error('Error deserializing mutate
|
|
829
|
+
console.error('Error deserializing position mutate data', e);
|
|
830
830
|
}
|
|
831
831
|
});
|
|
832
832
|
|
|
@@ -859,7 +859,7 @@ module.exports = function () {
|
|
|
859
859
|
return PortfolioGateway;
|
|
860
860
|
}();
|
|
861
861
|
|
|
862
|
-
},{"./../common/Configuration":2,"@barchart/common-js/api/failures/FailureReason":6,"@barchart/common-js/api/http/Gateway":9,"@barchart/common-js/api/http/builders/EndpointBuilder":10,"@barchart/common-js/api/http/definitions/ProtocolType":15,"@barchart/common-js/api/http/definitions/VerbType":16,"@barchart/common-js/api/http/interceptors/ErrorInterceptor":20,"@barchart/common-js/api/http/interceptors/RequestInterceptor":21,"@barchart/common-js/api/http/interceptors/ResponseInterceptor":22,"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Disposable":31,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/portfolio-api-common/lib/data/PositionSummaryFrame":
|
|
862
|
+
},{"./../common/Configuration":2,"@barchart/common-js/api/failures/FailureReason":6,"@barchart/common-js/api/http/Gateway":9,"@barchart/common-js/api/http/builders/EndpointBuilder":10,"@barchart/common-js/api/http/definitions/ProtocolType":15,"@barchart/common-js/api/http/definitions/VerbType":16,"@barchart/common-js/api/http/interceptors/ErrorInterceptor":20,"@barchart/common-js/api/http/interceptors/RequestInterceptor":21,"@barchart/common-js/api/http/interceptors/ResponseInterceptor":22,"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Disposable":31,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/portfolio-api-common/lib/data/PositionSummaryFrame":52,"@barchart/portfolio-api-common/lib/data/TransactionType":53,"@barchart/portfolio-api-common/lib/serialization/PortfolioSchema":55,"@barchart/portfolio-api-common/lib/serialization/PositionSchema":56,"@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema":57,"@barchart/portfolio-api-common/lib/serialization/TransactionSchema":58}],4:[function(require,module,exports){
|
|
863
863
|
'use strict';
|
|
864
864
|
|
|
865
865
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -1210,7 +1210,7 @@ module.exports = function () {
|
|
|
1210
1210
|
return {
|
|
1211
1211
|
JwtGateway: JwtGateway,
|
|
1212
1212
|
PortfolioGateway: PortfolioGateway,
|
|
1213
|
-
version: '1.2.
|
|
1213
|
+
version: '1.2.3'
|
|
1214
1214
|
};
|
|
1215
1215
|
}();
|
|
1216
1216
|
|
|
@@ -1947,7 +1947,7 @@ module.exports = function () {
|
|
|
1947
1947
|
return Gateway;
|
|
1948
1948
|
}();
|
|
1949
1949
|
|
|
1950
|
-
},{"./../../lang/array":36,"./../../lang/assert":37,"./../../lang/attributes":38,"./../../lang/promise":42,"./../failures/FailureReason":6,"./../failures/FailureType":8,"./definitions/Endpoint":12,"./definitions/VerbType":16,"axios":
|
|
1950
|
+
},{"./../../lang/array":36,"./../../lang/assert":37,"./../../lang/attributes":38,"./../../lang/promise":42,"./../failures/FailureReason":6,"./../failures/FailureType":8,"./definitions/Endpoint":12,"./definitions/VerbType":16,"axios":61}],10:[function(require,module,exports){
|
|
1951
1951
|
'use strict';
|
|
1952
1952
|
|
|
1953
1953
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -5903,7 +5903,7 @@ module.exports = function () {
|
|
|
5903
5903
|
return Decimal;
|
|
5904
5904
|
}();
|
|
5905
5905
|
|
|
5906
|
-
},{"./Enum":32,"./assert":37,"./is":40,"big.js":
|
|
5906
|
+
},{"./Enum":32,"./assert":37,"./is":40,"big.js":86}],31:[function(require,module,exports){
|
|
5907
5907
|
'use strict';
|
|
5908
5908
|
|
|
5909
5909
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -6440,7 +6440,7 @@ module.exports = function () {
|
|
|
6440
6440
|
return Timestamp;
|
|
6441
6441
|
}();
|
|
6442
6442
|
|
|
6443
|
-
},{"./assert":37,"./is":40,"moment-timezone":
|
|
6443
|
+
},{"./assert":37,"./is":40,"moment-timezone":91}],35:[function(require,module,exports){
|
|
6444
6444
|
'use strict';
|
|
6445
6445
|
|
|
6446
6446
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -7923,7 +7923,7 @@ module.exports = function () {
|
|
|
7923
7923
|
};
|
|
7924
7924
|
}();
|
|
7925
7925
|
|
|
7926
|
-
},{"./assert":37,"moment-timezone/builds/moment-timezone-with-data-2010-2020":
|
|
7926
|
+
},{"./assert":37,"moment-timezone/builds/moment-timezone-with-data-2010-2020":89}],44:[function(require,module,exports){
|
|
7927
7927
|
'use strict';
|
|
7928
7928
|
|
|
7929
7929
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -8399,7 +8399,7 @@ module.exports = function () {
|
|
|
8399
8399
|
return DataType;
|
|
8400
8400
|
}();
|
|
8401
8401
|
|
|
8402
|
-
},{"./../../lang/AdHoc":27,"./../../lang/Day":29,"./../../lang/Decimal":30,"./../../lang/Enum":32,"./../../lang/Timestamp":34,"./../../lang/assert":37,"./../../lang/is":40,"moment":
|
|
8402
|
+
},{"./../../lang/AdHoc":27,"./../../lang/Day":29,"./../../lang/Decimal":30,"./../../lang/Enum":32,"./../../lang/Timestamp":34,"./../../lang/assert":37,"./../../lang/is":40,"moment":93}],46:[function(require,module,exports){
|
|
8403
8403
|
'use strict';
|
|
8404
8404
|
|
|
8405
8405
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -9332,8 +9332,6 @@ module.exports = function () {
|
|
|
9332
9332
|
}();
|
|
9333
9333
|
|
|
9334
9334
|
},{"./../lang/Disposable":31,"./../lang/assert":37,"./../lang/is":40,"./../lang/object":41,"./../lang/promise":42}],51:[function(require,module,exports){
|
|
9335
|
-
const uuid = require('uuid');
|
|
9336
|
-
|
|
9337
9335
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
9338
9336
|
Enum = require('@barchart/common-js/lang/Enum');
|
|
9339
9337
|
|
|
@@ -9349,29 +9347,19 @@ module.exports = (() => {
|
|
|
9349
9347
|
* @param {String} alternateDescription
|
|
9350
9348
|
* @param {String} code
|
|
9351
9349
|
* @param {Boolean} canReinvest
|
|
9352
|
-
* @param {Boolean} canShort
|
|
9353
|
-
* @param {Boolean} canSwitchDirection
|
|
9354
9350
|
* @param {Boolean} usesSymbols
|
|
9355
|
-
* @param {Function} usesSymbols
|
|
9356
9351
|
*/
|
|
9357
9352
|
class InstrumentType extends Enum {
|
|
9358
|
-
constructor(code, description, alternateDescription, canReinvest,
|
|
9353
|
+
constructor(code, description, alternateDescription, canReinvest, usesSymbols) {
|
|
9359
9354
|
super(code, description);
|
|
9360
9355
|
|
|
9361
9356
|
assert.argumentIsRequired(alternateDescription, 'alternateDescription', String);
|
|
9362
9357
|
assert.argumentIsRequired(canReinvest, 'canReinvest', Boolean);
|
|
9363
|
-
assert.argumentIsRequired(canShort, 'canShort', Boolean);
|
|
9364
|
-
assert.argumentIsRequired(canSwitchDirection, 'canSwitchDirection', Boolean);
|
|
9365
9358
|
assert.argumentIsRequired(usesSymbols, 'usesSymbols', Boolean);
|
|
9366
|
-
assert.argumentIsRequired(generator, 'generator', Function);
|
|
9367
9359
|
|
|
9368
9360
|
this._alternateDescription = alternateDescription;
|
|
9369
9361
|
this._canReinvest = canReinvest;
|
|
9370
|
-
this._canShort = canShort;
|
|
9371
|
-
this._canSwitchDirection = canSwitchDirection;
|
|
9372
9362
|
this._usesSymbols = usesSymbols;
|
|
9373
|
-
|
|
9374
|
-
this._generator = generator;
|
|
9375
9363
|
}
|
|
9376
9364
|
|
|
9377
9365
|
/**
|
|
@@ -9394,27 +9382,6 @@ module.exports = (() => {
|
|
|
9394
9382
|
return this._canReinvest;
|
|
9395
9383
|
}
|
|
9396
9384
|
|
|
9397
|
-
/**
|
|
9398
|
-
* Indicates if short-selling is possible for this instrument type.
|
|
9399
|
-
*
|
|
9400
|
-
* @public
|
|
9401
|
-
* @returns {Boolean}
|
|
9402
|
-
*/
|
|
9403
|
-
get canShort() {
|
|
9404
|
-
return this._canShort;
|
|
9405
|
-
}
|
|
9406
|
-
|
|
9407
|
-
/**
|
|
9408
|
-
* Indicates if one transaction is allowed to switch a position size from
|
|
9409
|
-
* positive to negative (or vice versa).
|
|
9410
|
-
*
|
|
9411
|
-
* @public
|
|
9412
|
-
* @returns {Boolean}
|
|
9413
|
-
*/
|
|
9414
|
-
get canSwitchDirection() {
|
|
9415
|
-
return this._canSwitchDirection;
|
|
9416
|
-
}
|
|
9417
|
-
|
|
9418
9385
|
/**
|
|
9419
9386
|
* Indicates if an instrument of this type can be represented by a symbol.
|
|
9420
9387
|
*
|
|
@@ -9425,23 +9392,6 @@ module.exports = (() => {
|
|
|
9425
9392
|
return this._usesSymbols;
|
|
9426
9393
|
}
|
|
9427
9394
|
|
|
9428
|
-
/**
|
|
9429
|
-
* Generates an identifier for the instrument.
|
|
9430
|
-
*
|
|
9431
|
-
* @public
|
|
9432
|
-
* @param {Object} instrument
|
|
9433
|
-
* @returns {String}
|
|
9434
|
-
*/
|
|
9435
|
-
generateIdentifier(instrument) {
|
|
9436
|
-
assert.argumentIsRequired(instrument, 'instrument');
|
|
9437
|
-
|
|
9438
|
-
if (instrument.type !== this) {
|
|
9439
|
-
throw new Error('Unable to generate instrument identifier for incompatible type.');
|
|
9440
|
-
}
|
|
9441
|
-
|
|
9442
|
-
return this._generator(instrument);
|
|
9443
|
-
}
|
|
9444
|
-
|
|
9445
9395
|
/**
|
|
9446
9396
|
* Cash.
|
|
9447
9397
|
*
|
|
@@ -9486,169 +9436,20 @@ module.exports = (() => {
|
|
|
9486
9436
|
return other;
|
|
9487
9437
|
}
|
|
9488
9438
|
|
|
9489
|
-
/**
|
|
9490
|
-
* Generates an identifier for the instrument.
|
|
9491
|
-
*
|
|
9492
|
-
* @static
|
|
9493
|
-
* @public
|
|
9494
|
-
* @param {Object} instrument
|
|
9495
|
-
* @returns {String}
|
|
9496
|
-
*/
|
|
9497
|
-
static generateIdentifier(instrument) {
|
|
9498
|
-
return map[instrument.type.code].generateIdentifier(instrument);
|
|
9499
|
-
}
|
|
9500
|
-
|
|
9501
9439
|
toString() {
|
|
9502
9440
|
return '[InstrumentType]';
|
|
9503
9441
|
}
|
|
9504
9442
|
}
|
|
9505
9443
|
|
|
9506
|
-
const cash = new InstrumentType('CASH', 'cash', 'Cash', false, false
|
|
9507
|
-
const equity = new InstrumentType('EQUITY', 'equity', 'Equities', true, true
|
|
9508
|
-
const fund = new InstrumentType('FUND', 'mutual fund', 'Funds', true,
|
|
9509
|
-
const other = new InstrumentType('OTHER', 'other', 'Other', false, false
|
|
9510
|
-
|
|
9511
|
-
const map = { };
|
|
9512
|
-
|
|
9513
|
-
map[cash.code] = cash;
|
|
9514
|
-
map[equity.code] = equity;
|
|
9515
|
-
map[fund.code] = fund;
|
|
9516
|
-
map[other.code] = other;
|
|
9444
|
+
const cash = new InstrumentType('CASH', 'cash', 'Cash', false, false);
|
|
9445
|
+
const equity = new InstrumentType('EQUITY', 'equity', 'Equities', true, true);
|
|
9446
|
+
const fund = new InstrumentType('FUND', 'mutual fund', 'Funds', true, true);
|
|
9447
|
+
const other = new InstrumentType('OTHER', 'other', 'Other', false, false);
|
|
9517
9448
|
|
|
9518
9449
|
return InstrumentType;
|
|
9519
9450
|
})();
|
|
9520
9451
|
|
|
9521
|
-
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37
|
|
9522
|
-
const assert = require('@barchart/common-js/lang/assert'),
|
|
9523
|
-
Decimal = require('@barchart/common-js/lang/Decimal'),
|
|
9524
|
-
Enum = require('@barchart/common-js/lang/Enum');
|
|
9525
|
-
|
|
9526
|
-
module.exports = (() => {
|
|
9527
|
-
'use strict';
|
|
9528
|
-
|
|
9529
|
-
/**
|
|
9530
|
-
* Describes a position size -- positive values are long, negative values
|
|
9531
|
-
* are short and zero values are even.
|
|
9532
|
-
*
|
|
9533
|
-
* @public
|
|
9534
|
-
* @extends {Enum}
|
|
9535
|
-
* @param {String} code
|
|
9536
|
-
* @param {String} description
|
|
9537
|
-
* @param {sign} sign
|
|
9538
|
-
*/
|
|
9539
|
-
class PositionDirection extends Enum {
|
|
9540
|
-
constructor(code, description, sign) {
|
|
9541
|
-
super(code, description);
|
|
9542
|
-
|
|
9543
|
-
assert.argumentIsRequired(sign, 'sign', String);
|
|
9544
|
-
|
|
9545
|
-
this._sign = sign;
|
|
9546
|
-
}
|
|
9547
|
-
|
|
9548
|
-
/**
|
|
9549
|
-
* A description of the positiveness or negativeness of the size of the
|
|
9550
|
-
* position.
|
|
9551
|
-
*
|
|
9552
|
-
* @public
|
|
9553
|
-
* @returns {String}
|
|
9554
|
-
*/
|
|
9555
|
-
get sign() {
|
|
9556
|
-
return this._sign;
|
|
9557
|
-
}
|
|
9558
|
-
|
|
9559
|
-
/**
|
|
9560
|
-
* Indicates if the position size is positive (i.e. is {@link PositionDirection.LONG}).
|
|
9561
|
-
*
|
|
9562
|
-
* @public
|
|
9563
|
-
* @returns {boolean}
|
|
9564
|
-
*/
|
|
9565
|
-
get positive() {
|
|
9566
|
-
return this === long;
|
|
9567
|
-
}
|
|
9568
|
-
|
|
9569
|
-
/**
|
|
9570
|
-
* Indicates if the position size is negative (i.e. is {@link PositionDirection.SHORT}).
|
|
9571
|
-
*
|
|
9572
|
-
* @public
|
|
9573
|
-
* @returns {boolean}
|
|
9574
|
-
*/
|
|
9575
|
-
get negative() {
|
|
9576
|
-
return this === short;
|
|
9577
|
-
}
|
|
9578
|
-
|
|
9579
|
-
/**
|
|
9580
|
-
* Indicates if the position size is zero (i.e. is {@link PositionDirection.EVEN}).
|
|
9581
|
-
*
|
|
9582
|
-
* @public
|
|
9583
|
-
* @returns {boolean}
|
|
9584
|
-
*/
|
|
9585
|
-
get closed() {
|
|
9586
|
-
return this === even;
|
|
9587
|
-
}
|
|
9588
|
-
|
|
9589
|
-
/**
|
|
9590
|
-
* A positive quantity position.
|
|
9591
|
-
*
|
|
9592
|
-
* @public
|
|
9593
|
-
* @static
|
|
9594
|
-
* @returns {PositionDirection}
|
|
9595
|
-
*/
|
|
9596
|
-
static get LONG() {
|
|
9597
|
-
return long;
|
|
9598
|
-
}
|
|
9599
|
-
|
|
9600
|
-
/**
|
|
9601
|
-
* A positive quantity position.
|
|
9602
|
-
*
|
|
9603
|
-
* @public
|
|
9604
|
-
* @static
|
|
9605
|
-
* @returns {PositionDirection}
|
|
9606
|
-
*/
|
|
9607
|
-
static get SHORT() {
|
|
9608
|
-
return short;
|
|
9609
|
-
}
|
|
9610
|
-
|
|
9611
|
-
/**
|
|
9612
|
-
* A zero quantity position.
|
|
9613
|
-
*
|
|
9614
|
-
* @public
|
|
9615
|
-
* @static
|
|
9616
|
-
* @returns {PositionDirection}
|
|
9617
|
-
*/
|
|
9618
|
-
static get EVEN() {
|
|
9619
|
-
return even;
|
|
9620
|
-
}
|
|
9621
|
-
|
|
9622
|
-
/**
|
|
9623
|
-
* Given an open quantity, returns a {@link PositionDirection} that
|
|
9624
|
-
* describes the quantity.
|
|
9625
|
-
*
|
|
9626
|
-
* @public
|
|
9627
|
-
* @static
|
|
9628
|
-
* @param {Decimal} open
|
|
9629
|
-
* @returns {PositionDirection}
|
|
9630
|
-
*/
|
|
9631
|
-
static for(open) {
|
|
9632
|
-
assert.argumentIsRequired(open, 'open', Decimal, 'Decimal');
|
|
9633
|
-
|
|
9634
|
-
if (open.getIsPositive()) {
|
|
9635
|
-
return long;
|
|
9636
|
-
} else if (open.getIsNegative()) {
|
|
9637
|
-
return short;
|
|
9638
|
-
} else {
|
|
9639
|
-
return even;
|
|
9640
|
-
}
|
|
9641
|
-
}
|
|
9642
|
-
}
|
|
9643
|
-
|
|
9644
|
-
const long = new PositionDirection('LONG', 'Long', 'positive');
|
|
9645
|
-
const short = new PositionDirection('SHORT', 'Short', 'negative');
|
|
9646
|
-
const even = new PositionDirection('EVEN', 'Even', 'zero');
|
|
9647
|
-
|
|
9648
|
-
return PositionDirection;
|
|
9649
|
-
})();
|
|
9650
|
-
|
|
9651
|
-
},{"@barchart/common-js/lang/Decimal":30,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],53:[function(require,module,exports){
|
|
9452
|
+
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],52:[function(require,module,exports){
|
|
9652
9453
|
const array = require('@barchart/common-js/lang/array'),
|
|
9653
9454
|
assert = require('@barchart/common-js/lang/assert'),
|
|
9654
9455
|
Day = require('@barchart/common-js/lang/Day'),
|
|
@@ -9905,7 +9706,7 @@ module.exports = (() => {
|
|
|
9905
9706
|
return PositionSummaryFrame;
|
|
9906
9707
|
})();
|
|
9907
9708
|
|
|
9908
|
-
},{"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Decimal":30,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/array":36,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40}],
|
|
9709
|
+
},{"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Decimal":30,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/array":36,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40}],53:[function(require,module,exports){
|
|
9909
9710
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
9910
9711
|
Enum = require('@barchart/common-js/lang/Enum');
|
|
9911
9712
|
|
|
@@ -10245,7 +10046,7 @@ module.exports = (() => {
|
|
|
10245
10046
|
return TransactionType;
|
|
10246
10047
|
})();
|
|
10247
10048
|
|
|
10248
|
-
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],
|
|
10049
|
+
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],54:[function(require,module,exports){
|
|
10249
10050
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
10250
10051
|
Enum = require('@barchart/common-js/lang/Enum');
|
|
10251
10052
|
|
|
@@ -10307,7 +10108,7 @@ module.exports = (() => {
|
|
|
10307
10108
|
return ValuationType;
|
|
10308
10109
|
})();
|
|
10309
10110
|
|
|
10310
|
-
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],
|
|
10111
|
+
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],55:[function(require,module,exports){
|
|
10311
10112
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
10312
10113
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
10313
10114
|
DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
@@ -10477,7 +10278,7 @@ module.exports = (() => {
|
|
|
10477
10278
|
return PortfolioSchema;
|
|
10478
10279
|
})();
|
|
10479
10280
|
|
|
10480
|
-
},{"./../data/ValuationType":
|
|
10281
|
+
},{"./../data/ValuationType":54,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/Timezones":35,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/common-js/serialization/json/DataType":45,"@barchart/common-js/serialization/json/Schema":47,"@barchart/common-js/serialization/json/builders/SchemaBuilder":49}],56:[function(require,module,exports){
|
|
10481
10282
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
10482
10283
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
10483
10284
|
DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
@@ -10487,7 +10288,6 @@ const assert = require('@barchart/common-js/lang/assert'),
|
|
|
10487
10288
|
SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
|
|
10488
10289
|
|
|
10489
10290
|
const InstrumentType = require('./../data/InstrumentType'),
|
|
10490
|
-
PositionDirection = require('./../data/PositionDirection'),
|
|
10491
10291
|
ValuationType = require('./../data/ValuationType');
|
|
10492
10292
|
|
|
10493
10293
|
module.exports = (() => {
|
|
@@ -10560,7 +10360,6 @@ module.exports = (() => {
|
|
|
10560
10360
|
.withField('reinvest', DataType.BOOLEAN)
|
|
10561
10361
|
.withField('snapshot.date', DataType.DAY)
|
|
10562
10362
|
.withField('snapshot.open', DataType.DECIMAL)
|
|
10563
|
-
.withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10564
10363
|
.withField('snapshot.buys', DataType.DECIMAL)
|
|
10565
10364
|
.withField('snapshot.sells', DataType.DECIMAL)
|
|
10566
10365
|
.withField('snapshot.gain', DataType.DECIMAL)
|
|
@@ -10592,7 +10391,6 @@ module.exports = (() => {
|
|
|
10592
10391
|
.withField('reinvest', DataType.BOOLEAN)
|
|
10593
10392
|
.withField('snapshot.date', DataType.DAY)
|
|
10594
10393
|
.withField('snapshot.open', DataType.DECIMAL)
|
|
10595
|
-
.withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10596
10394
|
.withField('snapshot.buys', DataType.DECIMAL)
|
|
10597
10395
|
.withField('snapshot.sells', DataType.DECIMAL)
|
|
10598
10396
|
.withField('snapshot.gain', DataType.DECIMAL)
|
|
@@ -10606,7 +10404,7 @@ module.exports = (() => {
|
|
|
10606
10404
|
return PositionSchema;
|
|
10607
10405
|
})();
|
|
10608
10406
|
|
|
10609
|
-
},{"./../data/InstrumentType":51,"./../data/
|
|
10407
|
+
},{"./../data/InstrumentType":51,"./../data/ValuationType":54,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/common-js/serialization/json/DataType":45,"@barchart/common-js/serialization/json/Schema":47,"@barchart/common-js/serialization/json/builders/SchemaBuilder":49}],57:[function(require,module,exports){
|
|
10610
10408
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
10611
10409
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
10612
10410
|
DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
@@ -10615,8 +10413,7 @@ const assert = require('@barchart/common-js/lang/assert'),
|
|
|
10615
10413
|
Schema = require('@barchart/common-js/serialization/json/Schema'),
|
|
10616
10414
|
SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
|
|
10617
10415
|
|
|
10618
|
-
const
|
|
10619
|
-
PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
10416
|
+
const PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
10620
10417
|
|
|
10621
10418
|
module.exports = (() => {
|
|
10622
10419
|
'use strict';
|
|
@@ -10686,13 +10483,11 @@ module.exports = (() => {
|
|
|
10686
10483
|
.withField('start.date', DataType.DAY)
|
|
10687
10484
|
.withField('start.sequence', DataType.NUMBER)
|
|
10688
10485
|
.withField('start.open', DataType.DECIMAL)
|
|
10689
|
-
.withField('start.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10690
10486
|
.withField('start.basis', DataType.DECIMAL)
|
|
10691
10487
|
.withField('start.value', DataType.DECIMAL)
|
|
10692
10488
|
.withField('end.date', DataType.DAY)
|
|
10693
10489
|
.withField('end.sequence', DataType.NUMBER)
|
|
10694
10490
|
.withField('end.open', DataType.DECIMAL)
|
|
10695
|
-
.withField('end.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10696
10491
|
.withField('end.basis', DataType.DECIMAL)
|
|
10697
10492
|
.withField('end.value', DataType.DECIMAL)
|
|
10698
10493
|
.withField('period.buys', DataType.DECIMAL)
|
|
@@ -10720,13 +10515,11 @@ module.exports = (() => {
|
|
|
10720
10515
|
.withField('start.date', DataType.DAY)
|
|
10721
10516
|
.withField('start.sequence', DataType.NUMBER)
|
|
10722
10517
|
.withField('start.open', DataType.DECIMAL)
|
|
10723
|
-
.withField('start.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10724
10518
|
.withField('start.basis', DataType.DECIMAL)
|
|
10725
10519
|
.withField('start.value', DataType.DECIMAL)
|
|
10726
10520
|
.withField('end.date', DataType.DAY)
|
|
10727
10521
|
.withField('end.sequence', DataType.NUMBER)
|
|
10728
10522
|
.withField('end.open', DataType.DECIMAL)
|
|
10729
|
-
.withField('end.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10730
10523
|
.withField('end.basis', DataType.DECIMAL)
|
|
10731
10524
|
.withField('end.value', DataType.DECIMAL)
|
|
10732
10525
|
.withField('period.buys', DataType.DECIMAL)
|
|
@@ -10740,7 +10533,7 @@ module.exports = (() => {
|
|
|
10740
10533
|
return PositionSummarySchema;
|
|
10741
10534
|
})();
|
|
10742
10535
|
|
|
10743
|
-
},{"./../data/
|
|
10536
|
+
},{"./../data/PositionSummaryFrame":52,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/common-js/serialization/json/DataType":45,"@barchart/common-js/serialization/json/Schema":47,"@barchart/common-js/serialization/json/builders/SchemaBuilder":49}],58:[function(require,module,exports){
|
|
10744
10537
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
10745
10538
|
is = require('@barchart/common-js/lang/is'),
|
|
10746
10539
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
@@ -10750,7 +10543,6 @@ const assert = require('@barchart/common-js/lang/assert'),
|
|
|
10750
10543
|
SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
|
|
10751
10544
|
|
|
10752
10545
|
const InstrumentType = require('./../data/InstrumentType'),
|
|
10753
|
-
PositionDirection = require('./../data/PositionDirection'),
|
|
10754
10546
|
TransactionType = require('./../data/TransactionType');
|
|
10755
10547
|
|
|
10756
10548
|
module.exports = (() => {
|
|
@@ -10920,7 +10712,6 @@ module.exports = (() => {
|
|
|
10920
10712
|
.withField('reference.position', DataType.STRING, true)
|
|
10921
10713
|
.withField('reference.sequence', DataType.NUMBER, true)
|
|
10922
10714
|
.withField('snapshot.open', DataType.DECIMAL)
|
|
10923
|
-
.withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10924
10715
|
.withField('snapshot.buys', DataType.DECIMAL)
|
|
10925
10716
|
.withField('snapshot.sells', DataType.DECIMAL)
|
|
10926
10717
|
.withField('snapshot.gain', DataType.DECIMAL)
|
|
@@ -10964,7 +10755,6 @@ module.exports = (() => {
|
|
|
10964
10755
|
.withField('reference.position', DataType.STRING, true)
|
|
10965
10756
|
.withField('reference.sequence', DataType.NUMBER, true)
|
|
10966
10757
|
.withField('snapshot.open', DataType.DECIMAL)
|
|
10967
|
-
.withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
10968
10758
|
.withField('snapshot.buys', DataType.DECIMAL)
|
|
10969
10759
|
.withField('snapshot.sells', DataType.DECIMAL)
|
|
10970
10760
|
.withField('snapshot.gain', DataType.DECIMAL)
|
|
@@ -11194,6 +10984,7 @@ module.exports = (() => {
|
|
|
11194
10984
|
.withField('type', DataType.forEnum(TransactionType, 'TransactionType'))
|
|
11195
10985
|
.withField('date', DataType.DAY)
|
|
11196
10986
|
.withField('value', DataType.DECIMAL)
|
|
10987
|
+
.withField('fee', DataType.DECIMAL, true)
|
|
11197
10988
|
.withField('force', DataType.BOOLEAN, true)
|
|
11198
10989
|
.schema
|
|
11199
10990
|
);
|
|
@@ -11233,7 +11024,7 @@ module.exports = (() => {
|
|
|
11233
11024
|
return TransactionSchema;
|
|
11234
11025
|
})();
|
|
11235
11026
|
|
|
11236
|
-
},{"./../data/InstrumentType":51,"./../data/
|
|
11027
|
+
},{"./../data/InstrumentType":51,"./../data/TransactionType":53,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/common-js/serialization/json/DataType":45,"@barchart/common-js/serialization/json/Schema":47,"@barchart/common-js/serialization/json/builders/SchemaBuilder":49}],59:[function(require,module,exports){
|
|
11237
11028
|
'use strict';
|
|
11238
11029
|
|
|
11239
11030
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
@@ -11271,27 +11062,26 @@ module.exports = function () {
|
|
|
11271
11062
|
* Web service gateway for obtaining JWT tokens from TGAM (The Globe and Mail).
|
|
11272
11063
|
*
|
|
11273
11064
|
* @public
|
|
11274
|
-
* @param {Enpoint
|
|
11065
|
+
* @param {Enpoint} endpoint
|
|
11275
11066
|
* @param {Number=} refreshInterval - Interval, in milliseconds, which a token refresh should occur. If zero, the token does not need to be refreshed.
|
|
11276
|
-
* @param {Function=} overrideDelegate - Bypasses the standard token lookup, instead calls a delegate, which returns the token.
|
|
11277
11067
|
* @extends {Disposable}
|
|
11278
11068
|
*/
|
|
11279
11069
|
|
|
11280
11070
|
var JwtGateway = function (_Disposable) {
|
|
11281
11071
|
_inherits(JwtGateway, _Disposable);
|
|
11282
11072
|
|
|
11283
|
-
function JwtGateway(
|
|
11073
|
+
function JwtGateway(endpoint, refreshInterval) {
|
|
11284
11074
|
_classCallCheck(this, JwtGateway);
|
|
11285
11075
|
|
|
11286
11076
|
var _this = _possibleConstructorReturn(this, (JwtGateway.__proto__ || Object.getPrototypeOf(JwtGateway)).call(this));
|
|
11287
11077
|
|
|
11288
|
-
assert.argumentIsRequired(
|
|
11078
|
+
assert.argumentIsRequired(endpoint, 'endpoint', Endpoint, 'Endpoint');
|
|
11289
11079
|
assert.argumentIsOptional(refreshInterval, 'refreshInterval', Number);
|
|
11290
11080
|
|
|
11291
11081
|
_this._started = false;
|
|
11292
11082
|
_this._startPromise = null;
|
|
11293
11083
|
|
|
11294
|
-
_this.
|
|
11084
|
+
_this._endpoint = endpoint;
|
|
11295
11085
|
|
|
11296
11086
|
_this._refreshInterval = refreshInterval || 0;
|
|
11297
11087
|
_this._refreshJitter = Math.floor(_this._refreshInterval / 10);
|
|
@@ -11344,7 +11134,7 @@ module.exports = function () {
|
|
|
11344
11134
|
return Promise.resolve().then(function () {
|
|
11345
11135
|
checkStart.call(_this3);
|
|
11346
11136
|
|
|
11347
|
-
return _this3.
|
|
11137
|
+
return Gateway.invoke(_this3._endpoint);
|
|
11348
11138
|
}).catch(function (e) {
|
|
11349
11139
|
var failure = FailureReason.forRequest({ endpoint: _this3._endpoint }).addItem(FailureType.REQUEST_IDENTITY_FAILURE).format();
|
|
11350
11140
|
|
|
@@ -11459,9 +11249,7 @@ module.exports = function () {
|
|
|
11459
11249
|
key: 'forDevelopment',
|
|
11460
11250
|
value: function forDevelopment(endpoint) {
|
|
11461
11251
|
return Promise.resolve(endpoint).then(function (e) {
|
|
11462
|
-
return start(new JwtGateway(
|
|
11463
|
-
return Gateway.invoke(e);
|
|
11464
|
-
}, 60000));
|
|
11252
|
+
return start(new JwtGateway(e, 60000));
|
|
11465
11253
|
});
|
|
11466
11254
|
}
|
|
11467
11255
|
|
|
@@ -11470,7 +11258,7 @@ module.exports = function () {
|
|
|
11470
11258
|
*
|
|
11471
11259
|
* @public
|
|
11472
11260
|
* @static
|
|
11473
|
-
* @param {Promise.<Endpoint>|Endpoint}
|
|
11261
|
+
* @param {Promise.<Endpoint>|Endpoint}endpoint - The endpoint which vends JWT tokens.
|
|
11474
11262
|
* @returns {Promise.<RequestInterceptor>}
|
|
11475
11263
|
*/
|
|
11476
11264
|
|
|
@@ -11541,40 +11329,6 @@ module.exports = function () {
|
|
|
11541
11329
|
return jwtGateway.toRequestInterceptor();
|
|
11542
11330
|
});
|
|
11543
11331
|
}
|
|
11544
|
-
|
|
11545
|
-
/**
|
|
11546
|
-
* Creates and starts a new {@link JwtGateway} for use by the "tracker" system.
|
|
11547
|
-
*
|
|
11548
|
-
* @public
|
|
11549
|
-
* @static
|
|
11550
|
-
* @param {Function} tokenDelegate - A function which returns the JWT token.
|
|
11551
|
-
* @returns {Promise.<JwtGateway>}
|
|
11552
|
-
*/
|
|
11553
|
-
|
|
11554
|
-
}, {
|
|
11555
|
-
key: 'forTracker',
|
|
11556
|
-
value: function forTracker(tokenDelegate) {
|
|
11557
|
-
return Promise.resolve().then(function () {
|
|
11558
|
-
return start(new JwtGateway(tokenDelegate, 0));
|
|
11559
|
-
});
|
|
11560
|
-
}
|
|
11561
|
-
|
|
11562
|
-
/**
|
|
11563
|
-
* Creates and starts a new {@link RequestInterceptor} for use by "tracker" system.
|
|
11564
|
-
*
|
|
11565
|
-
* @public
|
|
11566
|
-
* @static
|
|
11567
|
-
* @param {Function} tokenDelegate - A function which returns the JWT token.
|
|
11568
|
-
* @returns {Promise.<RequestInterceptor>}
|
|
11569
|
-
*/
|
|
11570
|
-
|
|
11571
|
-
}, {
|
|
11572
|
-
key: 'forTrackerClient',
|
|
11573
|
-
value: function forTrackerClient(tokenDelegate) {
|
|
11574
|
-
return JwtGateway.forTracker(tokenDelegate).then(function (jwtGateway) {
|
|
11575
|
-
return jwtGateway.toRequestInterceptor();
|
|
11576
|
-
});
|
|
11577
|
-
}
|
|
11578
11332
|
}]);
|
|
11579
11333
|
|
|
11580
11334
|
return JwtGateway;
|
|
@@ -11605,7 +11359,7 @@ module.exports = function () {
|
|
|
11605
11359
|
}
|
|
11606
11360
|
|
|
11607
11361
|
function forTgam(host, secret, environment) {
|
|
11608
|
-
|
|
11362
|
+
return EndpointBuilder.for('read-jwt-token-for-' + environment, 'lookup user identity').withVerb(VerbType.GET).withProtocol(ProtocolType.HTTPS).withHeadersBuilder(function (hb) {
|
|
11609
11363
|
return hb.withLiteralParameter('X-GAM-CLIENT-APP-ID', 'X-GAM-CLIENT-APP-ID', '1348').withLiteralParameter('X-GAM-CLIENT-APP-SECRET', 'X-GAM-CLIENT-APP-SECRET', secret);
|
|
11610
11364
|
}).withHost(host).withRequestInterceptor(RequestInterceptor.fromDelegate(function (request) {
|
|
11611
11365
|
request.withCredentials = true;
|
|
@@ -11614,10 +11368,6 @@ module.exports = function () {
|
|
|
11614
11368
|
})).withResponseInterceptor(ResponseInterceptor.DATA).withResponseInterceptor(ResponseInterceptor.fromDelegate(function (response) {
|
|
11615
11369
|
return response.token;
|
|
11616
11370
|
})).endpoint;
|
|
11617
|
-
|
|
11618
|
-
return function () {
|
|
11619
|
-
return Gateway.invoke(endpoint);
|
|
11620
|
-
};
|
|
11621
11371
|
}
|
|
11622
11372
|
|
|
11623
11373
|
function getTime() {
|
|
@@ -11627,7 +11377,7 @@ module.exports = function () {
|
|
|
11627
11377
|
return JwtGateway;
|
|
11628
11378
|
}();
|
|
11629
11379
|
|
|
11630
|
-
},{"./index":
|
|
11380
|
+
},{"./index":60,"@barchart/common-js/api/failures/FailureReason":6,"@barchart/common-js/api/failures/FailureType":8,"@barchart/common-js/api/http/Gateway":9,"@barchart/common-js/api/http/builders/EndpointBuilder":10,"@barchart/common-js/api/http/definitions/Endpoint":12,"@barchart/common-js/api/http/definitions/ProtocolType":15,"@barchart/common-js/api/http/definitions/VerbType":16,"@barchart/common-js/api/http/interceptors/RequestInterceptor":21,"@barchart/common-js/api/http/interceptors/ResponseInterceptor":22,"@barchart/common-js/lang/Disposable":31,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40,"@barchart/common-js/timing/Scheduler":50}],60:[function(require,module,exports){
|
|
11631
11381
|
'use strict';
|
|
11632
11382
|
|
|
11633
11383
|
var JwtGateway = require('./JwtGateway');
|
|
@@ -11637,13 +11387,13 @@ module.exports = function () {
|
|
|
11637
11387
|
|
|
11638
11388
|
return {
|
|
11639
11389
|
JwtGateway: JwtGateway,
|
|
11640
|
-
version: '1.0.
|
|
11390
|
+
version: '1.0.38'
|
|
11641
11391
|
};
|
|
11642
11392
|
}();
|
|
11643
11393
|
|
|
11644
|
-
},{"./JwtGateway":
|
|
11394
|
+
},{"./JwtGateway":59}],61:[function(require,module,exports){
|
|
11645
11395
|
module.exports = require('./lib/axios');
|
|
11646
|
-
},{"./lib/axios":
|
|
11396
|
+
},{"./lib/axios":63}],62:[function(require,module,exports){
|
|
11647
11397
|
(function (process){
|
|
11648
11398
|
'use strict';
|
|
11649
11399
|
|
|
@@ -11827,7 +11577,7 @@ module.exports = function xhrAdapter(config) {
|
|
|
11827
11577
|
};
|
|
11828
11578
|
|
|
11829
11579
|
}).call(this,require('_process'))
|
|
11830
|
-
},{"../core/createError":
|
|
11580
|
+
},{"../core/createError":69,"./../core/settle":72,"./../helpers/btoa":76,"./../helpers/buildURL":77,"./../helpers/cookies":79,"./../helpers/isURLSameOrigin":81,"./../helpers/parseHeaders":83,"./../utils":85,"_process":87}],63:[function(require,module,exports){
|
|
11831
11581
|
'use strict';
|
|
11832
11582
|
|
|
11833
11583
|
var utils = require('./utils');
|
|
@@ -11881,7 +11631,7 @@ module.exports = axios;
|
|
|
11881
11631
|
// Allow use of default import syntax in TypeScript
|
|
11882
11632
|
module.exports.default = axios;
|
|
11883
11633
|
|
|
11884
|
-
},{"./cancel/Cancel":
|
|
11634
|
+
},{"./cancel/Cancel":64,"./cancel/CancelToken":65,"./cancel/isCancel":66,"./core/Axios":67,"./defaults":74,"./helpers/bind":75,"./helpers/spread":84,"./utils":85}],64:[function(require,module,exports){
|
|
11885
11635
|
'use strict';
|
|
11886
11636
|
|
|
11887
11637
|
/**
|
|
@@ -11902,7 +11652,7 @@ Cancel.prototype.__CANCEL__ = true;
|
|
|
11902
11652
|
|
|
11903
11653
|
module.exports = Cancel;
|
|
11904
11654
|
|
|
11905
|
-
},{}],
|
|
11655
|
+
},{}],65:[function(require,module,exports){
|
|
11906
11656
|
'use strict';
|
|
11907
11657
|
|
|
11908
11658
|
var Cancel = require('./Cancel');
|
|
@@ -11961,14 +11711,14 @@ CancelToken.source = function source() {
|
|
|
11961
11711
|
|
|
11962
11712
|
module.exports = CancelToken;
|
|
11963
11713
|
|
|
11964
|
-
},{"./Cancel":
|
|
11714
|
+
},{"./Cancel":64}],66:[function(require,module,exports){
|
|
11965
11715
|
'use strict';
|
|
11966
11716
|
|
|
11967
11717
|
module.exports = function isCancel(value) {
|
|
11968
11718
|
return !!(value && value.__CANCEL__);
|
|
11969
11719
|
};
|
|
11970
11720
|
|
|
11971
|
-
},{}],
|
|
11721
|
+
},{}],67:[function(require,module,exports){
|
|
11972
11722
|
'use strict';
|
|
11973
11723
|
|
|
11974
11724
|
var defaults = require('./../defaults');
|
|
@@ -12049,7 +11799,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
12049
11799
|
|
|
12050
11800
|
module.exports = Axios;
|
|
12051
11801
|
|
|
12052
|
-
},{"./../defaults":
|
|
11802
|
+
},{"./../defaults":74,"./../utils":85,"./InterceptorManager":68,"./dispatchRequest":70}],68:[function(require,module,exports){
|
|
12053
11803
|
'use strict';
|
|
12054
11804
|
|
|
12055
11805
|
var utils = require('./../utils');
|
|
@@ -12103,7 +11853,7 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
12103
11853
|
|
|
12104
11854
|
module.exports = InterceptorManager;
|
|
12105
11855
|
|
|
12106
|
-
},{"./../utils":
|
|
11856
|
+
},{"./../utils":85}],69:[function(require,module,exports){
|
|
12107
11857
|
'use strict';
|
|
12108
11858
|
|
|
12109
11859
|
var enhanceError = require('./enhanceError');
|
|
@@ -12123,7 +11873,7 @@ module.exports = function createError(message, config, code, request, response)
|
|
|
12123
11873
|
return enhanceError(error, config, code, request, response);
|
|
12124
11874
|
};
|
|
12125
11875
|
|
|
12126
|
-
},{"./enhanceError":
|
|
11876
|
+
},{"./enhanceError":71}],70:[function(require,module,exports){
|
|
12127
11877
|
'use strict';
|
|
12128
11878
|
|
|
12129
11879
|
var utils = require('./../utils');
|
|
@@ -12211,7 +11961,7 @@ module.exports = function dispatchRequest(config) {
|
|
|
12211
11961
|
});
|
|
12212
11962
|
};
|
|
12213
11963
|
|
|
12214
|
-
},{"../cancel/isCancel":
|
|
11964
|
+
},{"../cancel/isCancel":66,"../defaults":74,"./../helpers/combineURLs":78,"./../helpers/isAbsoluteURL":80,"./../utils":85,"./transformData":73}],71:[function(require,module,exports){
|
|
12215
11965
|
'use strict';
|
|
12216
11966
|
|
|
12217
11967
|
/**
|
|
@@ -12234,7 +11984,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
12234
11984
|
return error;
|
|
12235
11985
|
};
|
|
12236
11986
|
|
|
12237
|
-
},{}],
|
|
11987
|
+
},{}],72:[function(require,module,exports){
|
|
12238
11988
|
'use strict';
|
|
12239
11989
|
|
|
12240
11990
|
var createError = require('./createError');
|
|
@@ -12262,7 +12012,7 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
12262
12012
|
}
|
|
12263
12013
|
};
|
|
12264
12014
|
|
|
12265
|
-
},{"./createError":
|
|
12015
|
+
},{"./createError":69}],73:[function(require,module,exports){
|
|
12266
12016
|
'use strict';
|
|
12267
12017
|
|
|
12268
12018
|
var utils = require('./../utils');
|
|
@@ -12284,7 +12034,7 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
12284
12034
|
return data;
|
|
12285
12035
|
};
|
|
12286
12036
|
|
|
12287
|
-
},{"./../utils":
|
|
12037
|
+
},{"./../utils":85}],74:[function(require,module,exports){
|
|
12288
12038
|
(function (process){
|
|
12289
12039
|
'use strict';
|
|
12290
12040
|
|
|
@@ -12380,7 +12130,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
12380
12130
|
module.exports = defaults;
|
|
12381
12131
|
|
|
12382
12132
|
}).call(this,require('_process'))
|
|
12383
|
-
},{"./adapters/http":
|
|
12133
|
+
},{"./adapters/http":62,"./adapters/xhr":62,"./helpers/normalizeHeaderName":82,"./utils":85,"_process":87}],75:[function(require,module,exports){
|
|
12384
12134
|
'use strict';
|
|
12385
12135
|
|
|
12386
12136
|
module.exports = function bind(fn, thisArg) {
|
|
@@ -12393,7 +12143,7 @@ module.exports = function bind(fn, thisArg) {
|
|
|
12393
12143
|
};
|
|
12394
12144
|
};
|
|
12395
12145
|
|
|
12396
|
-
},{}],
|
|
12146
|
+
},{}],76:[function(require,module,exports){
|
|
12397
12147
|
'use strict';
|
|
12398
12148
|
|
|
12399
12149
|
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
|
|
@@ -12431,7 +12181,7 @@ function btoa(input) {
|
|
|
12431
12181
|
|
|
12432
12182
|
module.exports = btoa;
|
|
12433
12183
|
|
|
12434
|
-
},{}],
|
|
12184
|
+
},{}],77:[function(require,module,exports){
|
|
12435
12185
|
'use strict';
|
|
12436
12186
|
|
|
12437
12187
|
var utils = require('./../utils');
|
|
@@ -12501,7 +12251,7 @@ module.exports = function buildURL(url, params, paramsSerializer) {
|
|
|
12501
12251
|
return url;
|
|
12502
12252
|
};
|
|
12503
12253
|
|
|
12504
|
-
},{"./../utils":
|
|
12254
|
+
},{"./../utils":85}],78:[function(require,module,exports){
|
|
12505
12255
|
'use strict';
|
|
12506
12256
|
|
|
12507
12257
|
/**
|
|
@@ -12517,7 +12267,7 @@ module.exports = function combineURLs(baseURL, relativeURL) {
|
|
|
12517
12267
|
: baseURL;
|
|
12518
12268
|
};
|
|
12519
12269
|
|
|
12520
|
-
},{}],
|
|
12270
|
+
},{}],79:[function(require,module,exports){
|
|
12521
12271
|
'use strict';
|
|
12522
12272
|
|
|
12523
12273
|
var utils = require('./../utils');
|
|
@@ -12572,7 +12322,7 @@ module.exports = (
|
|
|
12572
12322
|
})()
|
|
12573
12323
|
);
|
|
12574
12324
|
|
|
12575
|
-
},{"./../utils":
|
|
12325
|
+
},{"./../utils":85}],80:[function(require,module,exports){
|
|
12576
12326
|
'use strict';
|
|
12577
12327
|
|
|
12578
12328
|
/**
|
|
@@ -12588,7 +12338,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
12588
12338
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
12589
12339
|
};
|
|
12590
12340
|
|
|
12591
|
-
},{}],
|
|
12341
|
+
},{}],81:[function(require,module,exports){
|
|
12592
12342
|
'use strict';
|
|
12593
12343
|
|
|
12594
12344
|
var utils = require('./../utils');
|
|
@@ -12658,7 +12408,7 @@ module.exports = (
|
|
|
12658
12408
|
})()
|
|
12659
12409
|
);
|
|
12660
12410
|
|
|
12661
|
-
},{"./../utils":
|
|
12411
|
+
},{"./../utils":85}],82:[function(require,module,exports){
|
|
12662
12412
|
'use strict';
|
|
12663
12413
|
|
|
12664
12414
|
var utils = require('../utils');
|
|
@@ -12672,7 +12422,7 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
|
12672
12422
|
});
|
|
12673
12423
|
};
|
|
12674
12424
|
|
|
12675
|
-
},{"../utils":
|
|
12425
|
+
},{"../utils":85}],83:[function(require,module,exports){
|
|
12676
12426
|
'use strict';
|
|
12677
12427
|
|
|
12678
12428
|
var utils = require('./../utils');
|
|
@@ -12727,7 +12477,7 @@ module.exports = function parseHeaders(headers) {
|
|
|
12727
12477
|
return parsed;
|
|
12728
12478
|
};
|
|
12729
12479
|
|
|
12730
|
-
},{"./../utils":
|
|
12480
|
+
},{"./../utils":85}],84:[function(require,module,exports){
|
|
12731
12481
|
'use strict';
|
|
12732
12482
|
|
|
12733
12483
|
/**
|
|
@@ -12756,7 +12506,7 @@ module.exports = function spread(callback) {
|
|
|
12756
12506
|
};
|
|
12757
12507
|
};
|
|
12758
12508
|
|
|
12759
|
-
},{}],
|
|
12509
|
+
},{}],85:[function(require,module,exports){
|
|
12760
12510
|
'use strict';
|
|
12761
12511
|
|
|
12762
12512
|
var bind = require('./helpers/bind');
|
|
@@ -13061,7 +12811,7 @@ module.exports = {
|
|
|
13061
12811
|
trim: trim
|
|
13062
12812
|
};
|
|
13063
12813
|
|
|
13064
|
-
},{"./helpers/bind":
|
|
12814
|
+
},{"./helpers/bind":75,"is-buffer":88}],86:[function(require,module,exports){
|
|
13065
12815
|
/*
|
|
13066
12816
|
* big.js v5.0.3
|
|
13067
12817
|
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
|
|
@@ -14002,7 +13752,7 @@ module.exports = {
|
|
|
14002
13752
|
}
|
|
14003
13753
|
})(this);
|
|
14004
13754
|
|
|
14005
|
-
},{}],
|
|
13755
|
+
},{}],87:[function(require,module,exports){
|
|
14006
13756
|
// shim for using process in browser
|
|
14007
13757
|
var process = module.exports = {};
|
|
14008
13758
|
|
|
@@ -14188,7 +13938,7 @@ process.chdir = function (dir) {
|
|
|
14188
13938
|
};
|
|
14189
13939
|
process.umask = function() { return 0; };
|
|
14190
13940
|
|
|
14191
|
-
},{}],
|
|
13941
|
+
},{}],88:[function(require,module,exports){
|
|
14192
13942
|
/*!
|
|
14193
13943
|
* Determine if an object is a Buffer
|
|
14194
13944
|
*
|
|
@@ -14211,7 +13961,7 @@ function isSlowBuffer (obj) {
|
|
|
14211
13961
|
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
|
14212
13962
|
}
|
|
14213
13963
|
|
|
14214
|
-
},{}],
|
|
13964
|
+
},{}],89:[function(require,module,exports){
|
|
14215
13965
|
//! moment-timezone.js
|
|
14216
13966
|
//! version : 0.5.11
|
|
14217
13967
|
//! Copyright (c) JS Foundation and other contributors
|
|
@@ -15413,7 +15163,7 @@ function isSlowBuffer (obj) {
|
|
|
15413
15163
|
return moment;
|
|
15414
15164
|
}));
|
|
15415
15165
|
|
|
15416
|
-
},{"moment":
|
|
15166
|
+
},{"moment":93}],90:[function(require,module,exports){
|
|
15417
15167
|
module.exports={
|
|
15418
15168
|
"version": "2016j",
|
|
15419
15169
|
"zones": [
|
|
@@ -16013,11 +15763,11 @@ module.exports={
|
|
|
16013
15763
|
"Pacific/Pohnpei|Pacific/Ponape"
|
|
16014
15764
|
]
|
|
16015
15765
|
}
|
|
16016
|
-
},{}],
|
|
15766
|
+
},{}],91:[function(require,module,exports){
|
|
16017
15767
|
var moment = module.exports = require("./moment-timezone");
|
|
16018
15768
|
moment.tz.load(require('./data/packed/latest.json'));
|
|
16019
15769
|
|
|
16020
|
-
},{"./data/packed/latest.json":
|
|
15770
|
+
},{"./data/packed/latest.json":90,"./moment-timezone":92}],92:[function(require,module,exports){
|
|
16021
15771
|
//! moment-timezone.js
|
|
16022
15772
|
//! version : 0.5.11
|
|
16023
15773
|
//! Copyright (c) JS Foundation and other contributors
|
|
@@ -16620,7 +16370,7 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
16620
16370
|
return moment;
|
|
16621
16371
|
}));
|
|
16622
16372
|
|
|
16623
|
-
},{"moment":
|
|
16373
|
+
},{"moment":93}],93:[function(require,module,exports){
|
|
16624
16374
|
//! moment.js
|
|
16625
16375
|
|
|
16626
16376
|
;(function (global, factory) {
|
|
@@ -20282,7 +20032,7 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
20282
20032
|
|
|
20283
20033
|
addUnitAlias('date', 'D');
|
|
20284
20034
|
|
|
20285
|
-
//
|
|
20035
|
+
// PRIOROITY
|
|
20286
20036
|
addUnitPriority('date', 9);
|
|
20287
20037
|
|
|
20288
20038
|
// PARSING
|
|
@@ -21079,7 +20829,7 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
21079
20829
|
// Side effect imports
|
|
21080
20830
|
|
|
21081
20831
|
|
|
21082
|
-
hooks.version = '2.22.
|
|
20832
|
+
hooks.version = '2.22.0';
|
|
21083
20833
|
|
|
21084
20834
|
setHookCallback(createLocal);
|
|
21085
20835
|
|
|
@@ -21128,210 +20878,5 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
21128
20878
|
|
|
21129
20879
|
})));
|
|
21130
20880
|
|
|
21131
|
-
},{}],
|
|
21132
|
-
var v1 = require('./v1');
|
|
21133
|
-
var v4 = require('./v4');
|
|
21134
|
-
|
|
21135
|
-
var uuid = v4;
|
|
21136
|
-
uuid.v1 = v1;
|
|
21137
|
-
uuid.v4 = v4;
|
|
21138
|
-
|
|
21139
|
-
module.exports = uuid;
|
|
21140
|
-
|
|
21141
|
-
},{"./v1":98,"./v4":99}],96:[function(require,module,exports){
|
|
21142
|
-
/**
|
|
21143
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
21144
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
21145
|
-
*/
|
|
21146
|
-
var byteToHex = [];
|
|
21147
|
-
for (var i = 0; i < 256; ++i) {
|
|
21148
|
-
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
|
21149
|
-
}
|
|
21150
|
-
|
|
21151
|
-
function bytesToUuid(buf, offset) {
|
|
21152
|
-
var i = offset || 0;
|
|
21153
|
-
var bth = byteToHex;
|
|
21154
|
-
return bth[buf[i++]] + bth[buf[i++]] +
|
|
21155
|
-
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
|
21156
|
-
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
|
21157
|
-
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
|
21158
|
-
bth[buf[i++]] + bth[buf[i++]] + '-' +
|
|
21159
|
-
bth[buf[i++]] + bth[buf[i++]] +
|
|
21160
|
-
bth[buf[i++]] + bth[buf[i++]] +
|
|
21161
|
-
bth[buf[i++]] + bth[buf[i++]];
|
|
21162
|
-
}
|
|
21163
|
-
|
|
21164
|
-
module.exports = bytesToUuid;
|
|
21165
|
-
|
|
21166
|
-
},{}],97:[function(require,module,exports){
|
|
21167
|
-
(function (global){
|
|
21168
|
-
// Unique ID creation requires a high quality random # generator. In the
|
|
21169
|
-
// browser this is a little complicated due to unknown quality of Math.random()
|
|
21170
|
-
// and inconsistent support for the `crypto` API. We do the best we can via
|
|
21171
|
-
// feature-detection
|
|
21172
|
-
var rng;
|
|
21173
|
-
|
|
21174
|
-
var crypto = global.crypto || global.msCrypto; // for IE 11
|
|
21175
|
-
if (crypto && crypto.getRandomValues) {
|
|
21176
|
-
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
|
21177
|
-
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
|
21178
|
-
rng = function whatwgRNG() {
|
|
21179
|
-
crypto.getRandomValues(rnds8);
|
|
21180
|
-
return rnds8;
|
|
21181
|
-
};
|
|
21182
|
-
}
|
|
21183
|
-
|
|
21184
|
-
if (!rng) {
|
|
21185
|
-
// Math.random()-based (RNG)
|
|
21186
|
-
//
|
|
21187
|
-
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
|
21188
|
-
// quality.
|
|
21189
|
-
var rnds = new Array(16);
|
|
21190
|
-
rng = function() {
|
|
21191
|
-
for (var i = 0, r; i < 16; i++) {
|
|
21192
|
-
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
|
21193
|
-
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
|
21194
|
-
}
|
|
21195
|
-
|
|
21196
|
-
return rnds;
|
|
21197
|
-
};
|
|
21198
|
-
}
|
|
21199
|
-
|
|
21200
|
-
module.exports = rng;
|
|
21201
|
-
|
|
21202
|
-
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
21203
|
-
},{}],98:[function(require,module,exports){
|
|
21204
|
-
var rng = require('./lib/rng');
|
|
21205
|
-
var bytesToUuid = require('./lib/bytesToUuid');
|
|
21206
|
-
|
|
21207
|
-
// **`v1()` - Generate time-based UUID**
|
|
21208
|
-
//
|
|
21209
|
-
// Inspired by https://github.com/LiosK/UUID.js
|
|
21210
|
-
// and http://docs.python.org/library/uuid.html
|
|
21211
|
-
|
|
21212
|
-
// random #'s we need to init node and clockseq
|
|
21213
|
-
var _seedBytes = rng();
|
|
21214
|
-
|
|
21215
|
-
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
21216
|
-
var _nodeId = [
|
|
21217
|
-
_seedBytes[0] | 0x01,
|
|
21218
|
-
_seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
|
|
21219
|
-
];
|
|
21220
|
-
|
|
21221
|
-
// Per 4.2.2, randomize (14 bit) clockseq
|
|
21222
|
-
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
|
|
21223
|
-
|
|
21224
|
-
// Previous uuid creation time
|
|
21225
|
-
var _lastMSecs = 0, _lastNSecs = 0;
|
|
21226
|
-
|
|
21227
|
-
// See https://github.com/broofa/node-uuid for API details
|
|
21228
|
-
function v1(options, buf, offset) {
|
|
21229
|
-
var i = buf && offset || 0;
|
|
21230
|
-
var b = buf || [];
|
|
21231
|
-
|
|
21232
|
-
options = options || {};
|
|
21233
|
-
|
|
21234
|
-
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
|
|
21235
|
-
|
|
21236
|
-
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
21237
|
-
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
21238
|
-
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
21239
|
-
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
21240
|
-
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
|
|
21241
|
-
|
|
21242
|
-
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
21243
|
-
// cycle to simulate higher resolution clock
|
|
21244
|
-
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
|
21245
|
-
|
|
21246
|
-
// Time since last uuid creation (in msecs)
|
|
21247
|
-
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
|
|
21248
|
-
|
|
21249
|
-
// Per 4.2.1.2, Bump clockseq on clock regression
|
|
21250
|
-
if (dt < 0 && options.clockseq === undefined) {
|
|
21251
|
-
clockseq = clockseq + 1 & 0x3fff;
|
|
21252
|
-
}
|
|
21253
|
-
|
|
21254
|
-
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
21255
|
-
// time interval
|
|
21256
|
-
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
21257
|
-
nsecs = 0;
|
|
21258
|
-
}
|
|
21259
|
-
|
|
21260
|
-
// Per 4.2.1.2 Throw error if too many uuids are requested
|
|
21261
|
-
if (nsecs >= 10000) {
|
|
21262
|
-
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
|
|
21263
|
-
}
|
|
21264
|
-
|
|
21265
|
-
_lastMSecs = msecs;
|
|
21266
|
-
_lastNSecs = nsecs;
|
|
21267
|
-
_clockseq = clockseq;
|
|
21268
|
-
|
|
21269
|
-
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
21270
|
-
msecs += 12219292800000;
|
|
21271
|
-
|
|
21272
|
-
// `time_low`
|
|
21273
|
-
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
21274
|
-
b[i++] = tl >>> 24 & 0xff;
|
|
21275
|
-
b[i++] = tl >>> 16 & 0xff;
|
|
21276
|
-
b[i++] = tl >>> 8 & 0xff;
|
|
21277
|
-
b[i++] = tl & 0xff;
|
|
21278
|
-
|
|
21279
|
-
// `time_mid`
|
|
21280
|
-
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
|
|
21281
|
-
b[i++] = tmh >>> 8 & 0xff;
|
|
21282
|
-
b[i++] = tmh & 0xff;
|
|
21283
|
-
|
|
21284
|
-
// `time_high_and_version`
|
|
21285
|
-
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
21286
|
-
b[i++] = tmh >>> 16 & 0xff;
|
|
21287
|
-
|
|
21288
|
-
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
21289
|
-
b[i++] = clockseq >>> 8 | 0x80;
|
|
21290
|
-
|
|
21291
|
-
// `clock_seq_low`
|
|
21292
|
-
b[i++] = clockseq & 0xff;
|
|
21293
|
-
|
|
21294
|
-
// `node`
|
|
21295
|
-
var node = options.node || _nodeId;
|
|
21296
|
-
for (var n = 0; n < 6; ++n) {
|
|
21297
|
-
b[i + n] = node[n];
|
|
21298
|
-
}
|
|
21299
|
-
|
|
21300
|
-
return buf ? buf : bytesToUuid(b);
|
|
21301
|
-
}
|
|
21302
|
-
|
|
21303
|
-
module.exports = v1;
|
|
21304
|
-
|
|
21305
|
-
},{"./lib/bytesToUuid":96,"./lib/rng":97}],99:[function(require,module,exports){
|
|
21306
|
-
var rng = require('./lib/rng');
|
|
21307
|
-
var bytesToUuid = require('./lib/bytesToUuid');
|
|
21308
|
-
|
|
21309
|
-
function v4(options, buf, offset) {
|
|
21310
|
-
var i = buf && offset || 0;
|
|
21311
|
-
|
|
21312
|
-
if (typeof(options) == 'string') {
|
|
21313
|
-
buf = options == 'binary' ? new Array(16) : null;
|
|
21314
|
-
options = null;
|
|
21315
|
-
}
|
|
21316
|
-
options = options || {};
|
|
21317
|
-
|
|
21318
|
-
var rnds = options.random || (options.rng || rng)();
|
|
21319
|
-
|
|
21320
|
-
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
21321
|
-
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
21322
|
-
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
21323
|
-
|
|
21324
|
-
// Copy bytes to buffer, if provided
|
|
21325
|
-
if (buf) {
|
|
21326
|
-
for (var ii = 0; ii < 16; ++ii) {
|
|
21327
|
-
buf[i + ii] = rnds[ii];
|
|
21328
|
-
}
|
|
21329
|
-
}
|
|
21330
|
-
|
|
21331
|
-
return buf || bytesToUuid(rnds);
|
|
21332
|
-
}
|
|
21333
|
-
|
|
21334
|
-
module.exports = v4;
|
|
21335
|
-
|
|
21336
|
-
},{"./lib/bytesToUuid":96,"./lib/rng":97}]},{},[1,5])(5)
|
|
20881
|
+
},{}]},{},[1,5])(5)
|
|
21337
20882
|
});
|
|
@@ -168,7 +168,9 @@ module.exports = (() => {
|
|
|
168
168
|
.withLiteralParameter('positions', 'positions')
|
|
169
169
|
.withVariableParameter('position', 'position', 'position', false);
|
|
170
170
|
})
|
|
171
|
+
.withBody('transaction')
|
|
171
172
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
173
|
+
.withResponseInterceptor(responseInterceptorForPositionMutateDeserialization)
|
|
172
174
|
.withErrorInterceptor(ErrorInterceptor.GENERAL)
|
|
173
175
|
.endpoint;
|
|
174
176
|
|
|
@@ -230,9 +232,9 @@ module.exports = (() => {
|
|
|
230
232
|
.withQueryBuilder((qb) => {
|
|
231
233
|
qb.withVariableParameter('type', 'type', 'type', false, i => i.code);
|
|
232
234
|
})
|
|
233
|
-
.withBody('
|
|
235
|
+
.withBody('transaction')
|
|
234
236
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
235
|
-
.withResponseInterceptor(
|
|
237
|
+
.withResponseInterceptor(responseInterceptorForPositionMutateDeserialization)
|
|
236
238
|
.withErrorInterceptor(ErrorInterceptor.GENERAL)
|
|
237
239
|
.endpoint;
|
|
238
240
|
|
|
@@ -254,7 +256,7 @@ module.exports = (() => {
|
|
|
254
256
|
.withVariableParameter('echo', 'echo', 'echo', false);
|
|
255
257
|
})
|
|
256
258
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
257
|
-
.withResponseInterceptor(
|
|
259
|
+
.withResponseInterceptor(responseInterceptorForPositionMutateDeserialization)
|
|
258
260
|
.withErrorInterceptor(ErrorInterceptor.GENERAL)
|
|
259
261
|
.endpoint;
|
|
260
262
|
|
|
@@ -755,7 +757,7 @@ module.exports = (() => {
|
|
|
755
757
|
}
|
|
756
758
|
});
|
|
757
759
|
|
|
758
|
-
const
|
|
760
|
+
const responseInterceptorForPositionMutateDeserialization = ResponseInterceptor.fromDelegate((response, ignored) => {
|
|
759
761
|
try {
|
|
760
762
|
const saved = response.data.positions.saved.map(p => JSON.parse(p, PositionSchema.CLIENT.schema.getReviver()));
|
|
761
763
|
const deleted = response.data.positions.deleted.map(p => JSON.parse(p, PositionSchema.CLIENT.schema.getReviver()));
|
|
@@ -775,7 +777,7 @@ module.exports = (() => {
|
|
|
775
777
|
|
|
776
778
|
return returnRef;
|
|
777
779
|
} catch (e) {
|
|
778
|
-
console.error('Error deserializing mutate
|
|
780
|
+
console.error('Error deserializing position mutate data', e);
|
|
779
781
|
}
|
|
780
782
|
});
|
|
781
783
|
|
package/lib/index.js
CHANGED