@barchart/portfolio-client-js 1.1.13 → 1.1.14
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.html +3 -3
- package/example/example.js +332 -62
- package/lib/common/Configuration.js +0 -11
- package/lib/gateway/PortfolioGateway.js +11 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/example/example.html
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
that.gateway = null;
|
|
29
29
|
|
|
30
|
-
that.user = ko.observable('
|
|
31
|
-
that.userLegacy = ko.observable('
|
|
30
|
+
that.user = ko.observable('4a896279-ad66-4fba-9239-8124dc1d3967');
|
|
31
|
+
that.userLegacy = ko.observable('10000120');
|
|
32
32
|
|
|
33
33
|
that.connected = ko.observable(false);
|
|
34
34
|
that.connecting = ko.observable(false);
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
|
|
356
356
|
that.connecting(true);
|
|
357
357
|
|
|
358
|
-
Barchart.Portfolio.PortfolioGateway.
|
|
358
|
+
Barchart.Portfolio.PortfolioGateway.forDevelopment(Barchart.Portfolio.JwtGateway.forDevelopmentClient(that.user(), that.userLegacy()))
|
|
359
359
|
.then((gateway) => {
|
|
360
360
|
that.gateway = gateway;
|
|
361
361
|
|
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":52,"@barchart/portfolio-api-common/lib/data/ValuationType":53,"@barchart/tgam-jwt-js/lib/JwtGateway":57}],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; }; }();
|
|
@@ -62,20 +62,6 @@ module.exports = function () {
|
|
|
62
62
|
return '[Configuration]';
|
|
63
63
|
}
|
|
64
64
|
}], [{
|
|
65
|
-
key: 'localHost',
|
|
66
|
-
get: function get() {
|
|
67
|
-
return '127.0.0.1';
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The host of the development system.
|
|
72
|
-
*
|
|
73
|
-
* @public
|
|
74
|
-
* @static
|
|
75
|
-
* @returns {String}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
}, {
|
|
79
65
|
key: 'developmentHost',
|
|
80
66
|
get: function get() {
|
|
81
67
|
return 'g4zerhpif5.execute-api.us-east-1.amazonaws.com/dev';
|
|
@@ -121,6 +107,7 @@ var assert = require('@barchart/common-js/lang/assert'),
|
|
|
121
107
|
var TransactionType = require('@barchart/portfolio-api-common/lib/data/TransactionType');
|
|
122
108
|
|
|
123
109
|
var PortfolioSchema = require('@barchart/portfolio-api-common/lib/serialization/PortfolioSchema'),
|
|
110
|
+
PositionSummarySchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema'),
|
|
124
111
|
TransactionSchema = require('@barchart/portfolio-api-common/lib/serialization/TransactionSchema');
|
|
125
112
|
|
|
126
113
|
var EndpointBuilder = require('@barchart/common-js/api/http/builders/EndpointBuilder'),
|
|
@@ -193,9 +180,7 @@ module.exports = function () {
|
|
|
193
180
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('summaries', 'summaries').withVariableParameter('position', 'position', 'position', false);
|
|
194
181
|
}).withQueryBuilder(function (qb) {
|
|
195
182
|
qb.withVariableParameter('frame', 'frame', 'frame', true).withVariableParameter('start', 'start', 'start', true).withVariableParameter('end', 'end', 'end', true);
|
|
196
|
-
}).withRequestInterceptor(requestInterceptorToUse)
|
|
197
|
-
// .withResponseInterceptor(responseInterceptorForPositionDeserialization)
|
|
198
|
-
.withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
183
|
+
}).withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE).withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionSummaryDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
199
184
|
|
|
200
185
|
_this._deletePortfoliosEndpoint = EndpointBuilder.for('delete-portfolio', 'delete portfolios').withVerb(VerbType.DELETE).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
201
186
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('positions', 'positions').withVariableParameter('position', 'position', 'position', false);
|
|
@@ -635,6 +620,14 @@ module.exports = function () {
|
|
|
635
620
|
return response.data;
|
|
636
621
|
});
|
|
637
622
|
|
|
623
|
+
var responseInterceptorForPositionSummaryDeserialization = ResponseInterceptor.fromDelegate(function (response, ignored) {
|
|
624
|
+
try {
|
|
625
|
+
return JSON.parse(response.data, PositionSummarySchema.CLIENT.schema.getReviver());
|
|
626
|
+
} catch (e) {
|
|
627
|
+
console.log(e);
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
|
|
638
631
|
var responseInterceptorForTransactionDeserialization = ResponseInterceptor.fromDelegate(function (response, ignored) {
|
|
639
632
|
return JSON.parse(response.data, TransactionSchema.CLIENT.schema.getReviver());
|
|
640
633
|
});
|
|
@@ -658,7 +651,7 @@ module.exports = function () {
|
|
|
658
651
|
return PortfolioGateway;
|
|
659
652
|
}();
|
|
660
653
|
|
|
661
|
-
},{"./../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/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/TransactionType":
|
|
654
|
+
},{"./../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/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/TransactionType":52,"@barchart/portfolio-api-common/lib/serialization/PortfolioSchema":54,"@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema":55,"@barchart/portfolio-api-common/lib/serialization/TransactionSchema":56}],4:[function(require,module,exports){
|
|
662
655
|
'use strict';
|
|
663
656
|
|
|
664
657
|
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; }; }();
|
|
@@ -971,7 +964,7 @@ module.exports = function () {
|
|
|
971
964
|
return {
|
|
972
965
|
JwtGateway: JwtGateway,
|
|
973
966
|
PortfolioGateway: PortfolioGateway,
|
|
974
|
-
version: '1.1.
|
|
967
|
+
version: '1.1.14'
|
|
975
968
|
};
|
|
976
969
|
}();
|
|
977
970
|
|
|
@@ -1708,7 +1701,7 @@ module.exports = function () {
|
|
|
1708
1701
|
return Gateway;
|
|
1709
1702
|
}();
|
|
1710
1703
|
|
|
1711
|
-
},{"./../../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":
|
|
1704
|
+
},{"./../../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":58}],10:[function(require,module,exports){
|
|
1712
1705
|
'use strict';
|
|
1713
1706
|
|
|
1714
1707
|
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; }; }();
|
|
@@ -5585,7 +5578,7 @@ module.exports = function () {
|
|
|
5585
5578
|
return Decimal;
|
|
5586
5579
|
}();
|
|
5587
5580
|
|
|
5588
|
-
},{"./Enum":32,"./assert":37,"./is":40,"big.js":
|
|
5581
|
+
},{"./Enum":32,"./assert":37,"./is":40,"big.js":83}],31:[function(require,module,exports){
|
|
5589
5582
|
'use strict';
|
|
5590
5583
|
|
|
5591
5584
|
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; }; }();
|
|
@@ -6122,7 +6115,7 @@ module.exports = function () {
|
|
|
6122
6115
|
return Timestamp;
|
|
6123
6116
|
}();
|
|
6124
6117
|
|
|
6125
|
-
},{"./assert":37,"./is":40,"moment-timezone":
|
|
6118
|
+
},{"./assert":37,"./is":40,"moment-timezone":88}],35:[function(require,module,exports){
|
|
6126
6119
|
'use strict';
|
|
6127
6120
|
|
|
6128
6121
|
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; }; }();
|
|
@@ -7565,7 +7558,7 @@ module.exports = function () {
|
|
|
7565
7558
|
};
|
|
7566
7559
|
}();
|
|
7567
7560
|
|
|
7568
|
-
},{"./assert":37,"moment-timezone/builds/moment-timezone-with-data-2010-2020":
|
|
7561
|
+
},{"./assert":37,"moment-timezone/builds/moment-timezone-with-data-2010-2020":86}],44:[function(require,module,exports){
|
|
7569
7562
|
'use strict';
|
|
7570
7563
|
|
|
7571
7564
|
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; }; }();
|
|
@@ -8041,7 +8034,7 @@ module.exports = function () {
|
|
|
8041
8034
|
return DataType;
|
|
8042
8035
|
}();
|
|
8043
8036
|
|
|
8044
|
-
},{"./../../lang/AdHoc":27,"./../../lang/Day":29,"./../../lang/Decimal":30,"./../../lang/Enum":32,"./../../lang/Timestamp":34,"./../../lang/assert":37,"./../../lang/is":40,"moment":
|
|
8037
|
+
},{"./../../lang/AdHoc":27,"./../../lang/Day":29,"./../../lang/Decimal":30,"./../../lang/Enum":32,"./../../lang/Timestamp":34,"./../../lang/assert":37,"./../../lang/is":40,"moment":90}],46:[function(require,module,exports){
|
|
8045
8038
|
'use strict';
|
|
8046
8039
|
|
|
8047
8040
|
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; }; }();
|
|
@@ -8974,6 +8967,154 @@ module.exports = function () {
|
|
|
8974
8967
|
}();
|
|
8975
8968
|
|
|
8976
8969
|
},{"./../lang/Disposable":31,"./../lang/assert":37,"./../lang/is":40,"./../lang/object":41,"./../lang/promise":42}],51:[function(require,module,exports){
|
|
8970
|
+
const array = require('@barchart/common-js/lang/array'),
|
|
8971
|
+
assert = require('@barchart/common-js/lang/assert'),
|
|
8972
|
+
Day = require('@barchart/common-js/lang/Day'),
|
|
8973
|
+
Enum = require('@barchart/common-js/lang/Enum'),
|
|
8974
|
+
is = require('@barchart/common-js/lang/is');
|
|
8975
|
+
|
|
8976
|
+
module.exports = (() => {
|
|
8977
|
+
'use strict';
|
|
8978
|
+
|
|
8979
|
+
/**
|
|
8980
|
+
* An enumeration used to define timeframes for position summaries.
|
|
8981
|
+
*
|
|
8982
|
+
* @public
|
|
8983
|
+
* @extends {Enum}
|
|
8984
|
+
* @param {String} code
|
|
8985
|
+
* @param {String} description
|
|
8986
|
+
* @param {Function} rangeCalculator
|
|
8987
|
+
*/
|
|
8988
|
+
class PositionSummaryFrame extends Enum {
|
|
8989
|
+
constructor(code, description, rangeCalculator) {
|
|
8990
|
+
super(code, description);
|
|
8991
|
+
|
|
8992
|
+
assert.argumentIsRequired(rangeCalculator, 'rangeCalculator', Function);
|
|
8993
|
+
|
|
8994
|
+
this._rangeCalculator = rangeCalculator;
|
|
8995
|
+
}
|
|
8996
|
+
|
|
8997
|
+
getRanges(transactions) {
|
|
8998
|
+
assert.argumentIsArray(transactions, 'transactions');
|
|
8999
|
+
|
|
9000
|
+
return this._rangeCalculator(transactions);
|
|
9001
|
+
}
|
|
9002
|
+
|
|
9003
|
+
/**
|
|
9004
|
+
* A summary for a calendar year.
|
|
9005
|
+
*
|
|
9006
|
+
* @public
|
|
9007
|
+
* @returns {PositionSummaryFrame}
|
|
9008
|
+
*/
|
|
9009
|
+
static get YEARLY() {
|
|
9010
|
+
return yearly;
|
|
9011
|
+
}
|
|
9012
|
+
|
|
9013
|
+
/**
|
|
9014
|
+
* A summary for a quarter.
|
|
9015
|
+
*
|
|
9016
|
+
* @public
|
|
9017
|
+
* @returns {PositionSummaryFrame}
|
|
9018
|
+
*/
|
|
9019
|
+
static get QUARTERLY() {
|
|
9020
|
+
return quarterly;
|
|
9021
|
+
}
|
|
9022
|
+
|
|
9023
|
+
/**
|
|
9024
|
+
* A summary for a calendar month.
|
|
9025
|
+
*
|
|
9026
|
+
* @public
|
|
9027
|
+
* @returns {PositionSummaryFrame}
|
|
9028
|
+
*/
|
|
9029
|
+
static get MONTHLY() {
|
|
9030
|
+
return monthly;
|
|
9031
|
+
}
|
|
9032
|
+
|
|
9033
|
+
/**
|
|
9034
|
+
* A summary the current year (to date).
|
|
9035
|
+
*
|
|
9036
|
+
* @public
|
|
9037
|
+
* @returns {PositionSummaryFrame}
|
|
9038
|
+
*/
|
|
9039
|
+
static get YTD() {
|
|
9040
|
+
return ytd;
|
|
9041
|
+
}
|
|
9042
|
+
|
|
9043
|
+
toString() {
|
|
9044
|
+
return '[PositionSummaryFrame]';
|
|
9045
|
+
}
|
|
9046
|
+
}
|
|
9047
|
+
|
|
9048
|
+
const yearly = new PositionSummaryFrame('YEARLY', 'year', getYearlyRanges);
|
|
9049
|
+
const quarterly = new PositionSummaryFrame('QUARTER', 'quarter', getQuarterlyRanges);
|
|
9050
|
+
const monthly = new PositionSummaryFrame('MONTH', 'month', getMonthlyRanges);
|
|
9051
|
+
const ytd = new PositionSummaryFrame('YTD', 'year-to-date', getYearToDateRanges);
|
|
9052
|
+
|
|
9053
|
+
function getRange(start, end) {
|
|
9054
|
+
return {
|
|
9055
|
+
start: start,
|
|
9056
|
+
end: end
|
|
9057
|
+
};
|
|
9058
|
+
}
|
|
9059
|
+
|
|
9060
|
+
function getYearlyRanges(transactions) {
|
|
9061
|
+
const ranges = [ ];
|
|
9062
|
+
|
|
9063
|
+
if (transactions.length !== 0) {
|
|
9064
|
+
const first = array.first(transactions);
|
|
9065
|
+
const last = array.last(transactions);
|
|
9066
|
+
|
|
9067
|
+
const firstDate = first.date;
|
|
9068
|
+
const lastDate = last.date;
|
|
9069
|
+
|
|
9070
|
+
let lastYear;
|
|
9071
|
+
|
|
9072
|
+
if (last.snapshot.open.getIsZero()) {
|
|
9073
|
+
lastYear = last.date.year + 1;
|
|
9074
|
+
} else {
|
|
9075
|
+
lastYear = Day.getToday().year;
|
|
9076
|
+
}
|
|
9077
|
+
|
|
9078
|
+
for (let end = new Day(firstDate.year, 12, 31); end.year < lastYear; end = end.addYears(1)) {
|
|
9079
|
+
ranges.push(getRange(end.subtractYears(1), end));
|
|
9080
|
+
}
|
|
9081
|
+
}
|
|
9082
|
+
|
|
9083
|
+
return ranges;
|
|
9084
|
+
}
|
|
9085
|
+
|
|
9086
|
+
function getQuarterlyRanges(transactions) {
|
|
9087
|
+
return [ ];
|
|
9088
|
+
}
|
|
9089
|
+
|
|
9090
|
+
function getMonthlyRanges(transactions) {
|
|
9091
|
+
return [ ];
|
|
9092
|
+
}
|
|
9093
|
+
|
|
9094
|
+
function getYearToDateRanges(transactions) {
|
|
9095
|
+
const ranges = [ ];
|
|
9096
|
+
|
|
9097
|
+
if (transactions.length !== 0) {
|
|
9098
|
+
const first = array.first(transactions);
|
|
9099
|
+
const last = array.last(transactions);
|
|
9100
|
+
|
|
9101
|
+
const currentYear = Day.getToday().year;
|
|
9102
|
+
|
|
9103
|
+
if (!last.snapshot.open.getIsZero() || last.date.year === currentYear) {
|
|
9104
|
+
let end = new Day(Day.getToday().year, 12, 31);
|
|
9105
|
+
let start = end.subtractYears(1);
|
|
9106
|
+
|
|
9107
|
+
ranges.push(getRange(start, end));
|
|
9108
|
+
}
|
|
9109
|
+
}
|
|
9110
|
+
|
|
9111
|
+
return ranges;
|
|
9112
|
+
}
|
|
9113
|
+
|
|
9114
|
+
return PositionSummaryFrame;
|
|
9115
|
+
})();
|
|
9116
|
+
|
|
9117
|
+
},{"@barchart/common-js/lang/Day":29,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/array":36,"@barchart/common-js/lang/assert":37,"@barchart/common-js/lang/is":40}],52:[function(require,module,exports){
|
|
8977
9118
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
8978
9119
|
Enum = require('@barchart/common-js/lang/Enum');
|
|
8979
9120
|
|
|
@@ -9300,7 +9441,7 @@ module.exports = (() => {
|
|
|
9300
9441
|
return TransactionType;
|
|
9301
9442
|
})();
|
|
9302
9443
|
|
|
9303
|
-
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],
|
|
9444
|
+
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],53:[function(require,module,exports){
|
|
9304
9445
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
9305
9446
|
Enum = require('@barchart/common-js/lang/Enum');
|
|
9306
9447
|
|
|
@@ -9362,7 +9503,7 @@ module.exports = (() => {
|
|
|
9362
9503
|
return ValuationType;
|
|
9363
9504
|
})();
|
|
9364
9505
|
|
|
9365
|
-
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],
|
|
9506
|
+
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37}],54:[function(require,module,exports){
|
|
9366
9507
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
9367
9508
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
9368
9509
|
DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
@@ -9513,7 +9654,136 @@ module.exports = (() => {
|
|
|
9513
9654
|
return PortfolioSchema;
|
|
9514
9655
|
})();
|
|
9515
9656
|
|
|
9516
|
-
},{"./../data/ValuationType":
|
|
9657
|
+
},{"./../data/ValuationType":53,"@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}],55:[function(require,module,exports){
|
|
9658
|
+
const assert = require('@barchart/common-js/lang/assert'),
|
|
9659
|
+
Currency = require('@barchart/common-js/lang/Currency'),
|
|
9660
|
+
DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
9661
|
+
Enum = require('@barchart/common-js/lang/Enum'),
|
|
9662
|
+
is = require('@barchart/common-js/lang/is'),
|
|
9663
|
+
Schema = require('@barchart/common-js/serialization/json/Schema'),
|
|
9664
|
+
SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
|
|
9665
|
+
|
|
9666
|
+
const PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
9667
|
+
|
|
9668
|
+
module.exports = (() => {
|
|
9669
|
+
'use strict';
|
|
9670
|
+
|
|
9671
|
+
/**
|
|
9672
|
+
* The schemas which can be used to represent position summary objects.
|
|
9673
|
+
*
|
|
9674
|
+
* @public
|
|
9675
|
+
* @extends {Enum}
|
|
9676
|
+
*/
|
|
9677
|
+
class PositionSummarySchema extends Enum {
|
|
9678
|
+
constructor(schema) {
|
|
9679
|
+
super(schema.name, schema.name);
|
|
9680
|
+
|
|
9681
|
+
this._schema = schema;
|
|
9682
|
+
}
|
|
9683
|
+
|
|
9684
|
+
/**
|
|
9685
|
+
* The actual {@link Schema}.
|
|
9686
|
+
*
|
|
9687
|
+
* @public
|
|
9688
|
+
* @returns {Schema}
|
|
9689
|
+
*/
|
|
9690
|
+
get schema() {
|
|
9691
|
+
return this._schema;
|
|
9692
|
+
}
|
|
9693
|
+
|
|
9694
|
+
/**
|
|
9695
|
+
* The complete position summary schema.
|
|
9696
|
+
*
|
|
9697
|
+
* @static
|
|
9698
|
+
* @public
|
|
9699
|
+
* @returns {PositionSummarySchema}
|
|
9700
|
+
*/
|
|
9701
|
+
static get COMPLETE() {
|
|
9702
|
+
return complete;
|
|
9703
|
+
}
|
|
9704
|
+
|
|
9705
|
+
/**
|
|
9706
|
+
* Position summary data transmitted to the client, omitting some system data.
|
|
9707
|
+
*
|
|
9708
|
+
* @static
|
|
9709
|
+
* @public
|
|
9710
|
+
* @returns {PositionSummarySchema}
|
|
9711
|
+
*/
|
|
9712
|
+
static get CLIENT() {
|
|
9713
|
+
return client;
|
|
9714
|
+
}
|
|
9715
|
+
|
|
9716
|
+
toString() {
|
|
9717
|
+
return '[PositionSummarySchema]';
|
|
9718
|
+
}
|
|
9719
|
+
}
|
|
9720
|
+
|
|
9721
|
+
const complete = new PositionSummarySchema(SchemaBuilder.withName('complete')
|
|
9722
|
+
.withField('user', DataType.STRING)
|
|
9723
|
+
.withField('portfolio', DataType.STRING)
|
|
9724
|
+
.withField('position', DataType.STRING)
|
|
9725
|
+
.withField('instrument.id', DataType.STRING)
|
|
9726
|
+
.withField('instrument.name', DataType.STRING)
|
|
9727
|
+
.withField('instrument.type', DataType.STRING)
|
|
9728
|
+
.withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
|
|
9729
|
+
.withField('instrument.delist', DataType.DAY, true)
|
|
9730
|
+
.withField('instrument.symbol.barchart', DataType.STRING, true)
|
|
9731
|
+
.withField('instrument.symbol.display', DataType.STRING, true)
|
|
9732
|
+
.withField('frame', DataType.forEnum(PositionSummaryFrame, 'PositionSummaryFrame'))
|
|
9733
|
+
.withField('start.date', DataType.DAY)
|
|
9734
|
+
.withField('start.sequence', DataType.NUMBER)
|
|
9735
|
+
.withField('start.open', DataType.DECIMAL)
|
|
9736
|
+
.withField('start.basis', DataType.DECIMAL)
|
|
9737
|
+
.withField('start.value', DataType.DECIMAL)
|
|
9738
|
+
.withField('end.date', DataType.DAY)
|
|
9739
|
+
.withField('end.sequence', DataType.NUMBER)
|
|
9740
|
+
.withField('end.open', DataType.DECIMAL)
|
|
9741
|
+
.withField('end.basis', DataType.DECIMAL)
|
|
9742
|
+
.withField('end.value', DataType.DECIMAL)
|
|
9743
|
+
.withField('period.buys', DataType.DECIMAL)
|
|
9744
|
+
.withField('period.sells', DataType.DECIMAL)
|
|
9745
|
+
.withField('period.income', DataType.DECIMAL)
|
|
9746
|
+
.withField('period.realized', DataType.DECIMAL)
|
|
9747
|
+
.withField('period.unrealized', DataType.DECIMAL)
|
|
9748
|
+
.withField('system.sequence', DataType.NUMBER)
|
|
9749
|
+
.withField('system.version', DataType.STRING)
|
|
9750
|
+
.schema
|
|
9751
|
+
);
|
|
9752
|
+
|
|
9753
|
+
const client = new PositionSummarySchema(SchemaBuilder.withName('client')
|
|
9754
|
+
.withField('user', DataType.STRING)
|
|
9755
|
+
.withField('portfolio', DataType.STRING)
|
|
9756
|
+
.withField('position', DataType.STRING)
|
|
9757
|
+
.withField('instrument.id', DataType.STRING)
|
|
9758
|
+
.withField('instrument.name', DataType.STRING)
|
|
9759
|
+
.withField('instrument.type', DataType.STRING)
|
|
9760
|
+
.withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
|
|
9761
|
+
.withField('instrument.delist', DataType.DAY, true)
|
|
9762
|
+
.withField('instrument.symbol.barchart', DataType.STRING, true)
|
|
9763
|
+
.withField('instrument.symbol.display', DataType.STRING, true)
|
|
9764
|
+
.withField('frame', DataType.forEnum(PositionSummaryFrame, 'PositionSummaryFrame'))
|
|
9765
|
+
.withField('start.date', DataType.DAY)
|
|
9766
|
+
.withField('start.sequence', DataType.NUMBER)
|
|
9767
|
+
.withField('start.open', DataType.DECIMAL)
|
|
9768
|
+
.withField('start.basis', DataType.DECIMAL)
|
|
9769
|
+
.withField('start.value', DataType.DECIMAL)
|
|
9770
|
+
.withField('end.date', DataType.DAY)
|
|
9771
|
+
.withField('end.sequence', DataType.NUMBER)
|
|
9772
|
+
.withField('end.open', DataType.DECIMAL)
|
|
9773
|
+
.withField('end.basis', DataType.DECIMAL)
|
|
9774
|
+
.withField('end.value', DataType.DECIMAL)
|
|
9775
|
+
.withField('period.buys', DataType.DECIMAL)
|
|
9776
|
+
.withField('period.sells', DataType.DECIMAL)
|
|
9777
|
+
.withField('period.income', DataType.DECIMAL)
|
|
9778
|
+
.withField('period.realized', DataType.DECIMAL)
|
|
9779
|
+
.withField('period.unrealized', DataType.DECIMAL)
|
|
9780
|
+
.schema
|
|
9781
|
+
);
|
|
9782
|
+
|
|
9783
|
+
return PositionSummarySchema;
|
|
9784
|
+
})();
|
|
9785
|
+
|
|
9786
|
+
},{"./../data/PositionSummaryFrame":51,"@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}],56:[function(require,module,exports){
|
|
9517
9787
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
9518
9788
|
is = require('@barchart/common-js/lang/is'),
|
|
9519
9789
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
@@ -9993,7 +10263,7 @@ module.exports = (() => {
|
|
|
9993
10263
|
return TransactionSchema;
|
|
9994
10264
|
})();
|
|
9995
10265
|
|
|
9996
|
-
},{"./../data/TransactionType":
|
|
10266
|
+
},{"./../data/TransactionType":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}],57:[function(require,module,exports){
|
|
9997
10267
|
'use strict';
|
|
9998
10268
|
|
|
9999
10269
|
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; }; }();
|
|
@@ -10342,9 +10612,9 @@ module.exports = function () {
|
|
|
10342
10612
|
return JwtGateway;
|
|
10343
10613
|
}();
|
|
10344
10614
|
|
|
10345
|
-
},{"@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}],
|
|
10615
|
+
},{"@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}],58:[function(require,module,exports){
|
|
10346
10616
|
module.exports = require('./lib/axios');
|
|
10347
|
-
},{"./lib/axios":
|
|
10617
|
+
},{"./lib/axios":60}],59:[function(require,module,exports){
|
|
10348
10618
|
(function (process){
|
|
10349
10619
|
'use strict';
|
|
10350
10620
|
|
|
@@ -10528,7 +10798,7 @@ module.exports = function xhrAdapter(config) {
|
|
|
10528
10798
|
};
|
|
10529
10799
|
|
|
10530
10800
|
}).call(this,require('_process'))
|
|
10531
|
-
},{"../core/createError":
|
|
10801
|
+
},{"../core/createError":66,"./../core/settle":69,"./../helpers/btoa":73,"./../helpers/buildURL":74,"./../helpers/cookies":76,"./../helpers/isURLSameOrigin":78,"./../helpers/parseHeaders":80,"./../utils":82,"_process":84}],60:[function(require,module,exports){
|
|
10532
10802
|
'use strict';
|
|
10533
10803
|
|
|
10534
10804
|
var utils = require('./utils');
|
|
@@ -10582,7 +10852,7 @@ module.exports = axios;
|
|
|
10582
10852
|
// Allow use of default import syntax in TypeScript
|
|
10583
10853
|
module.exports.default = axios;
|
|
10584
10854
|
|
|
10585
|
-
},{"./cancel/Cancel":
|
|
10855
|
+
},{"./cancel/Cancel":61,"./cancel/CancelToken":62,"./cancel/isCancel":63,"./core/Axios":64,"./defaults":71,"./helpers/bind":72,"./helpers/spread":81,"./utils":82}],61:[function(require,module,exports){
|
|
10586
10856
|
'use strict';
|
|
10587
10857
|
|
|
10588
10858
|
/**
|
|
@@ -10603,7 +10873,7 @@ Cancel.prototype.__CANCEL__ = true;
|
|
|
10603
10873
|
|
|
10604
10874
|
module.exports = Cancel;
|
|
10605
10875
|
|
|
10606
|
-
},{}],
|
|
10876
|
+
},{}],62:[function(require,module,exports){
|
|
10607
10877
|
'use strict';
|
|
10608
10878
|
|
|
10609
10879
|
var Cancel = require('./Cancel');
|
|
@@ -10662,14 +10932,14 @@ CancelToken.source = function source() {
|
|
|
10662
10932
|
|
|
10663
10933
|
module.exports = CancelToken;
|
|
10664
10934
|
|
|
10665
|
-
},{"./Cancel":
|
|
10935
|
+
},{"./Cancel":61}],63:[function(require,module,exports){
|
|
10666
10936
|
'use strict';
|
|
10667
10937
|
|
|
10668
10938
|
module.exports = function isCancel(value) {
|
|
10669
10939
|
return !!(value && value.__CANCEL__);
|
|
10670
10940
|
};
|
|
10671
10941
|
|
|
10672
|
-
},{}],
|
|
10942
|
+
},{}],64:[function(require,module,exports){
|
|
10673
10943
|
'use strict';
|
|
10674
10944
|
|
|
10675
10945
|
var defaults = require('./../defaults');
|
|
@@ -10750,7 +11020,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
10750
11020
|
|
|
10751
11021
|
module.exports = Axios;
|
|
10752
11022
|
|
|
10753
|
-
},{"./../defaults":
|
|
11023
|
+
},{"./../defaults":71,"./../utils":82,"./InterceptorManager":65,"./dispatchRequest":67}],65:[function(require,module,exports){
|
|
10754
11024
|
'use strict';
|
|
10755
11025
|
|
|
10756
11026
|
var utils = require('./../utils');
|
|
@@ -10804,7 +11074,7 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
10804
11074
|
|
|
10805
11075
|
module.exports = InterceptorManager;
|
|
10806
11076
|
|
|
10807
|
-
},{"./../utils":
|
|
11077
|
+
},{"./../utils":82}],66:[function(require,module,exports){
|
|
10808
11078
|
'use strict';
|
|
10809
11079
|
|
|
10810
11080
|
var enhanceError = require('./enhanceError');
|
|
@@ -10824,7 +11094,7 @@ module.exports = function createError(message, config, code, request, response)
|
|
|
10824
11094
|
return enhanceError(error, config, code, request, response);
|
|
10825
11095
|
};
|
|
10826
11096
|
|
|
10827
|
-
},{"./enhanceError":
|
|
11097
|
+
},{"./enhanceError":68}],67:[function(require,module,exports){
|
|
10828
11098
|
'use strict';
|
|
10829
11099
|
|
|
10830
11100
|
var utils = require('./../utils');
|
|
@@ -10912,7 +11182,7 @@ module.exports = function dispatchRequest(config) {
|
|
|
10912
11182
|
});
|
|
10913
11183
|
};
|
|
10914
11184
|
|
|
10915
|
-
},{"../cancel/isCancel":
|
|
11185
|
+
},{"../cancel/isCancel":63,"../defaults":71,"./../helpers/combineURLs":75,"./../helpers/isAbsoluteURL":77,"./../utils":82,"./transformData":70}],68:[function(require,module,exports){
|
|
10916
11186
|
'use strict';
|
|
10917
11187
|
|
|
10918
11188
|
/**
|
|
@@ -10935,7 +11205,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
10935
11205
|
return error;
|
|
10936
11206
|
};
|
|
10937
11207
|
|
|
10938
|
-
},{}],
|
|
11208
|
+
},{}],69:[function(require,module,exports){
|
|
10939
11209
|
'use strict';
|
|
10940
11210
|
|
|
10941
11211
|
var createError = require('./createError');
|
|
@@ -10963,7 +11233,7 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
10963
11233
|
}
|
|
10964
11234
|
};
|
|
10965
11235
|
|
|
10966
|
-
},{"./createError":
|
|
11236
|
+
},{"./createError":66}],70:[function(require,module,exports){
|
|
10967
11237
|
'use strict';
|
|
10968
11238
|
|
|
10969
11239
|
var utils = require('./../utils');
|
|
@@ -10985,7 +11255,7 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
10985
11255
|
return data;
|
|
10986
11256
|
};
|
|
10987
11257
|
|
|
10988
|
-
},{"./../utils":
|
|
11258
|
+
},{"./../utils":82}],71:[function(require,module,exports){
|
|
10989
11259
|
(function (process){
|
|
10990
11260
|
'use strict';
|
|
10991
11261
|
|
|
@@ -11081,7 +11351,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
11081
11351
|
module.exports = defaults;
|
|
11082
11352
|
|
|
11083
11353
|
}).call(this,require('_process'))
|
|
11084
|
-
},{"./adapters/http":
|
|
11354
|
+
},{"./adapters/http":59,"./adapters/xhr":59,"./helpers/normalizeHeaderName":79,"./utils":82,"_process":84}],72:[function(require,module,exports){
|
|
11085
11355
|
'use strict';
|
|
11086
11356
|
|
|
11087
11357
|
module.exports = function bind(fn, thisArg) {
|
|
@@ -11094,7 +11364,7 @@ module.exports = function bind(fn, thisArg) {
|
|
|
11094
11364
|
};
|
|
11095
11365
|
};
|
|
11096
11366
|
|
|
11097
|
-
},{}],
|
|
11367
|
+
},{}],73:[function(require,module,exports){
|
|
11098
11368
|
'use strict';
|
|
11099
11369
|
|
|
11100
11370
|
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
|
|
@@ -11132,7 +11402,7 @@ function btoa(input) {
|
|
|
11132
11402
|
|
|
11133
11403
|
module.exports = btoa;
|
|
11134
11404
|
|
|
11135
|
-
},{}],
|
|
11405
|
+
},{}],74:[function(require,module,exports){
|
|
11136
11406
|
'use strict';
|
|
11137
11407
|
|
|
11138
11408
|
var utils = require('./../utils');
|
|
@@ -11202,7 +11472,7 @@ module.exports = function buildURL(url, params, paramsSerializer) {
|
|
|
11202
11472
|
return url;
|
|
11203
11473
|
};
|
|
11204
11474
|
|
|
11205
|
-
},{"./../utils":
|
|
11475
|
+
},{"./../utils":82}],75:[function(require,module,exports){
|
|
11206
11476
|
'use strict';
|
|
11207
11477
|
|
|
11208
11478
|
/**
|
|
@@ -11218,7 +11488,7 @@ module.exports = function combineURLs(baseURL, relativeURL) {
|
|
|
11218
11488
|
: baseURL;
|
|
11219
11489
|
};
|
|
11220
11490
|
|
|
11221
|
-
},{}],
|
|
11491
|
+
},{}],76:[function(require,module,exports){
|
|
11222
11492
|
'use strict';
|
|
11223
11493
|
|
|
11224
11494
|
var utils = require('./../utils');
|
|
@@ -11273,7 +11543,7 @@ module.exports = (
|
|
|
11273
11543
|
})()
|
|
11274
11544
|
);
|
|
11275
11545
|
|
|
11276
|
-
},{"./../utils":
|
|
11546
|
+
},{"./../utils":82}],77:[function(require,module,exports){
|
|
11277
11547
|
'use strict';
|
|
11278
11548
|
|
|
11279
11549
|
/**
|
|
@@ -11289,7 +11559,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
11289
11559
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
11290
11560
|
};
|
|
11291
11561
|
|
|
11292
|
-
},{}],
|
|
11562
|
+
},{}],78:[function(require,module,exports){
|
|
11293
11563
|
'use strict';
|
|
11294
11564
|
|
|
11295
11565
|
var utils = require('./../utils');
|
|
@@ -11359,7 +11629,7 @@ module.exports = (
|
|
|
11359
11629
|
})()
|
|
11360
11630
|
);
|
|
11361
11631
|
|
|
11362
|
-
},{"./../utils":
|
|
11632
|
+
},{"./../utils":82}],79:[function(require,module,exports){
|
|
11363
11633
|
'use strict';
|
|
11364
11634
|
|
|
11365
11635
|
var utils = require('../utils');
|
|
@@ -11373,7 +11643,7 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
|
11373
11643
|
});
|
|
11374
11644
|
};
|
|
11375
11645
|
|
|
11376
|
-
},{"../utils":
|
|
11646
|
+
},{"../utils":82}],80:[function(require,module,exports){
|
|
11377
11647
|
'use strict';
|
|
11378
11648
|
|
|
11379
11649
|
var utils = require('./../utils');
|
|
@@ -11428,7 +11698,7 @@ module.exports = function parseHeaders(headers) {
|
|
|
11428
11698
|
return parsed;
|
|
11429
11699
|
};
|
|
11430
11700
|
|
|
11431
|
-
},{"./../utils":
|
|
11701
|
+
},{"./../utils":82}],81:[function(require,module,exports){
|
|
11432
11702
|
'use strict';
|
|
11433
11703
|
|
|
11434
11704
|
/**
|
|
@@ -11457,7 +11727,7 @@ module.exports = function spread(callback) {
|
|
|
11457
11727
|
};
|
|
11458
11728
|
};
|
|
11459
11729
|
|
|
11460
|
-
},{}],
|
|
11730
|
+
},{}],82:[function(require,module,exports){
|
|
11461
11731
|
'use strict';
|
|
11462
11732
|
|
|
11463
11733
|
var bind = require('./helpers/bind');
|
|
@@ -11762,7 +12032,7 @@ module.exports = {
|
|
|
11762
12032
|
trim: trim
|
|
11763
12033
|
};
|
|
11764
12034
|
|
|
11765
|
-
},{"./helpers/bind":
|
|
12035
|
+
},{"./helpers/bind":72,"is-buffer":85}],83:[function(require,module,exports){
|
|
11766
12036
|
/*
|
|
11767
12037
|
* big.js v5.0.3
|
|
11768
12038
|
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
|
|
@@ -12703,7 +12973,7 @@ module.exports = {
|
|
|
12703
12973
|
}
|
|
12704
12974
|
})(this);
|
|
12705
12975
|
|
|
12706
|
-
},{}],
|
|
12976
|
+
},{}],84:[function(require,module,exports){
|
|
12707
12977
|
// shim for using process in browser
|
|
12708
12978
|
var process = module.exports = {};
|
|
12709
12979
|
|
|
@@ -12889,7 +13159,7 @@ process.chdir = function (dir) {
|
|
|
12889
13159
|
};
|
|
12890
13160
|
process.umask = function() { return 0; };
|
|
12891
13161
|
|
|
12892
|
-
},{}],
|
|
13162
|
+
},{}],85:[function(require,module,exports){
|
|
12893
13163
|
/*!
|
|
12894
13164
|
* Determine if an object is a Buffer
|
|
12895
13165
|
*
|
|
@@ -12912,7 +13182,7 @@ function isSlowBuffer (obj) {
|
|
|
12912
13182
|
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
|
12913
13183
|
}
|
|
12914
13184
|
|
|
12915
|
-
},{}],
|
|
13185
|
+
},{}],86:[function(require,module,exports){
|
|
12916
13186
|
//! moment-timezone.js
|
|
12917
13187
|
//! version : 0.5.11
|
|
12918
13188
|
//! Copyright (c) JS Foundation and other contributors
|
|
@@ -14114,7 +14384,7 @@ function isSlowBuffer (obj) {
|
|
|
14114
14384
|
return moment;
|
|
14115
14385
|
}));
|
|
14116
14386
|
|
|
14117
|
-
},{"moment":
|
|
14387
|
+
},{"moment":90}],87:[function(require,module,exports){
|
|
14118
14388
|
module.exports={
|
|
14119
14389
|
"version": "2016j",
|
|
14120
14390
|
"zones": [
|
|
@@ -14714,11 +14984,11 @@ module.exports={
|
|
|
14714
14984
|
"Pacific/Pohnpei|Pacific/Ponape"
|
|
14715
14985
|
]
|
|
14716
14986
|
}
|
|
14717
|
-
},{}],
|
|
14987
|
+
},{}],88:[function(require,module,exports){
|
|
14718
14988
|
var moment = module.exports = require("./moment-timezone");
|
|
14719
14989
|
moment.tz.load(require('./data/packed/latest.json'));
|
|
14720
14990
|
|
|
14721
|
-
},{"./data/packed/latest.json":
|
|
14991
|
+
},{"./data/packed/latest.json":87,"./moment-timezone":89}],89:[function(require,module,exports){
|
|
14722
14992
|
//! moment-timezone.js
|
|
14723
14993
|
//! version : 0.5.11
|
|
14724
14994
|
//! Copyright (c) JS Foundation and other contributors
|
|
@@ -15321,7 +15591,7 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
15321
15591
|
return moment;
|
|
15322
15592
|
}));
|
|
15323
15593
|
|
|
15324
|
-
},{"moment":
|
|
15594
|
+
},{"moment":90}],90:[function(require,module,exports){
|
|
15325
15595
|
//! moment.js
|
|
15326
15596
|
|
|
15327
15597
|
;(function (global, factory) {
|
|
@@ -11,17 +11,6 @@ module.exports = (() => {
|
|
|
11
11
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* The host of the development system.
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
* @static
|
|
19
|
-
* @returns {String}
|
|
20
|
-
*/
|
|
21
|
-
static get localHost() {
|
|
22
|
-
return '127.0.0.1';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
14
|
/**
|
|
26
15
|
* The host of the development system.
|
|
27
16
|
*
|
|
@@ -6,6 +6,7 @@ const assert = require('@barchart/common-js/lang/assert'),
|
|
|
6
6
|
const TransactionType = require('@barchart/portfolio-api-common/lib/data/TransactionType');
|
|
7
7
|
|
|
8
8
|
const PortfolioSchema = require('@barchart/portfolio-api-common/lib/serialization/PortfolioSchema'),
|
|
9
|
+
PositionSummarySchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema'),
|
|
9
10
|
TransactionSchema = require('@barchart/portfolio-api-common/lib/serialization/TransactionSchema');
|
|
10
11
|
|
|
11
12
|
const EndpointBuilder = require('@barchart/common-js/api/http/builders/EndpointBuilder'),
|
|
@@ -140,8 +141,9 @@ module.exports = (() => {
|
|
|
140
141
|
.withVariableParameter('start', 'start', 'start', true)
|
|
141
142
|
.withVariableParameter('end', 'end', 'end', true);
|
|
142
143
|
})
|
|
144
|
+
.withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE)
|
|
143
145
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
144
|
-
|
|
146
|
+
.withResponseInterceptor(responseInterceptorForPositionSummaryDeserialization)
|
|
145
147
|
.withErrorInterceptor(ErrorInterceptor.GENERAL)
|
|
146
148
|
.endpoint;
|
|
147
149
|
|
|
@@ -598,6 +600,14 @@ module.exports = (() => {
|
|
|
598
600
|
return response.data;
|
|
599
601
|
});
|
|
600
602
|
|
|
603
|
+
const responseInterceptorForPositionSummaryDeserialization = ResponseInterceptor.fromDelegate((response, ignored) => {
|
|
604
|
+
try {
|
|
605
|
+
return JSON.parse(response.data, PositionSummarySchema.CLIENT.schema.getReviver());
|
|
606
|
+
} catch (e) {
|
|
607
|
+
console.log(e);
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
|
|
601
611
|
const responseInterceptorForTransactionDeserialization = ResponseInterceptor.fromDelegate((response, ignored) => {
|
|
602
612
|
return JSON.parse(response.data, TransactionSchema.CLIENT.schema.getReviver());
|
|
603
613
|
});
|
package/lib/index.js
CHANGED