@barchart/portfolio-client-js 1.2.24 → 1.2.27
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 +245 -92
- package/lib/gateway/PortfolioGateway.js +86 -14
- 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":54,"@barchart/portfolio-api-common/lib/data/ValuationType":55,"@barchart/tgam-jwt-js/lib/JwtGateway":
|
|
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":54,"@barchart/portfolio-api-common/lib/data/ValuationType":55,"@barchart/tgam-jwt-js/lib/JwtGateway":61}],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; }; }();
|
|
@@ -138,6 +138,7 @@ var TransactionType = require('@barchart/portfolio-api-common/lib/data/Transacti
|
|
|
138
138
|
|
|
139
139
|
var PortfolioSchema = require('@barchart/portfolio-api-common/lib/serialization/PortfolioSchema'),
|
|
140
140
|
PositionSummarySchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema'),
|
|
141
|
+
PositionSummaryDefinitionSchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSummaryDefinitionSchema'),
|
|
141
142
|
PositionSchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSchema'),
|
|
142
143
|
TransactionSchema = require('@barchart/portfolio-api-common/lib/serialization/TransactionSchema');
|
|
143
144
|
|
|
@@ -229,11 +230,21 @@ module.exports = function () {
|
|
|
229
230
|
return frames.map(function (f) {
|
|
230
231
|
return f.code;
|
|
231
232
|
}).join();
|
|
232
|
-
}).withVariableParameter('periods', 'periods', 'periods', true).withVariableParameter('start', 'start', 'start', true, function (
|
|
233
|
-
return
|
|
233
|
+
}).withVariableParameter('periods', 'periods', 'periods', true).withVariableParameter('start', 'start', 'start', true, function (x) {
|
|
234
|
+
return x.format();
|
|
234
235
|
});
|
|
235
236
|
}).withRequestInterceptor(requestInterceptorToUse).withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE).withResponseInterceptor(responseInterceptorForPositionSummaryDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
236
237
|
|
|
238
|
+
_this._readPositionSummaryDefinitionEndpoint = EndpointBuilder.for('read-position-summary-definitions', 'read position summary definitions').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
239
|
+
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('summaries', 'summaries').withLiteralParameter('ranges', 'ranges');
|
|
240
|
+
}).withQueryBuilder(function (qb) {
|
|
241
|
+
qb.withVariableParameter('frames', 'frames', 'frames', true, function (frames) {
|
|
242
|
+
return frames.map(function (f) {
|
|
243
|
+
return f.code;
|
|
244
|
+
}).join();
|
|
245
|
+
});
|
|
246
|
+
}).withRequestInterceptor(requestInterceptorToUse).withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE).withResponseInterceptor(responseInterceptorForPositionSummaryDefinitionDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
247
|
+
|
|
237
248
|
_this._readTransactionsEndpoint = EndpointBuilder.for('read-transactions', 'read transactions').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
238
249
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('positions', 'positions').withVariableParameter('position', 'position', 'position', false).withLiteralParameter('transactions', 'transactions');
|
|
239
250
|
}).withQueryBuilder(function (qb) {
|
|
@@ -243,8 +254,8 @@ module.exports = function () {
|
|
|
243
254
|
_this._createTransactionEndpoint = EndpointBuilder.for('create-transaction', 'create transaction').withVerb(VerbType.POST).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
244
255
|
pb.withLiteralParameter('portfolios', 'portfolios').withVariableParameter('portfolio', 'portfolio', 'portfolio', false).withLiteralParameter('positions', 'positions').withVariableParameter('position', 'position', 'position', false).withLiteralParameter('transactions', 'transactions');
|
|
245
256
|
}).withQueryBuilder(function (qb) {
|
|
246
|
-
qb.withVariableParameter('type', 'type', 'type', false, function (
|
|
247
|
-
return
|
|
257
|
+
qb.withVariableParameter('type', 'type', 'type', false, function (x) {
|
|
258
|
+
return x.code;
|
|
248
259
|
});
|
|
249
260
|
}).withBody('transaction').withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionMutateDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
250
261
|
|
|
@@ -255,15 +266,19 @@ module.exports = function () {
|
|
|
255
266
|
_this._editTransactionEndpoint = EndpointBuilder.for('edit-transaction', 'edit transaction').withVerb(VerbType.POST).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
256
267
|
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);
|
|
257
268
|
}).withQueryBuilder(function (qb) {
|
|
258
|
-
qb.withVariableParameter('type', 'type', 'type', false, function (
|
|
259
|
-
return
|
|
269
|
+
qb.withVariableParameter('type', 'type', 'type', false, function (x) {
|
|
270
|
+
return x.code;
|
|
260
271
|
});
|
|
261
272
|
}).withBody('transaction').withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionMutateDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
262
273
|
|
|
263
274
|
_this._deleteTransactionEndpoint = EndpointBuilder.for('delete-transaction', 'delete transaction').withVerb(VerbType.DELETE).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
264
275
|
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);
|
|
265
276
|
}).withQueryBuilder(function (qb) {
|
|
266
|
-
qb.withVariableParameter('force', 'force', 'force', false).withVariableParameter('
|
|
277
|
+
qb.withVariableParameter('force', 'force', 'force', false).withVariableParameter('echoStart', 'echoStart', 'echoStart', true, function (x) {
|
|
278
|
+
return x.format();
|
|
279
|
+
}).withVariableParameter('echoEnd', 'echoEnd', 'echoEnd', true, function (x) {
|
|
280
|
+
return x.format();
|
|
281
|
+
});
|
|
267
282
|
}).withRequestInterceptor(requestInterceptorToUse).withResponseInterceptor(responseInterceptorForPositionMutateDeserialization).withErrorInterceptor(ErrorInterceptor.GENERAL).endpoint;
|
|
268
283
|
|
|
269
284
|
_this._readTransactionsReportEndpoint = EndpointBuilder.for('read-transaction-report', 'read transaction report').withVerb(VerbType.GET).withProtocol(protocolType).withHost(host).withPort(port).withPathBuilder(function (pb) {
|
|
@@ -340,7 +355,7 @@ module.exports = function () {
|
|
|
340
355
|
}
|
|
341
356
|
|
|
342
357
|
/**
|
|
343
|
-
* Creates a portfolio
|
|
358
|
+
* Creates a portfolio.
|
|
344
359
|
*
|
|
345
360
|
* @public
|
|
346
361
|
* @param {Object} portfolio
|
|
@@ -384,7 +399,7 @@ module.exports = function () {
|
|
|
384
399
|
}
|
|
385
400
|
|
|
386
401
|
/**
|
|
387
|
-
* Updates a portfolio
|
|
402
|
+
* Updates a portfolio.
|
|
388
403
|
*
|
|
389
404
|
* @public
|
|
390
405
|
* @param {Object} portfolio
|
|
@@ -406,7 +421,7 @@ module.exports = function () {
|
|
|
406
421
|
}
|
|
407
422
|
|
|
408
423
|
/**
|
|
409
|
-
* Deletes a portfolio
|
|
424
|
+
* Deletes a portfolio.
|
|
410
425
|
*
|
|
411
426
|
* @public
|
|
412
427
|
* @param {String} portfolio - ID of the portfolio to update
|
|
@@ -454,7 +469,7 @@ module.exports = function () {
|
|
|
454
469
|
}
|
|
455
470
|
|
|
456
471
|
/**
|
|
457
|
-
* Updates a position
|
|
472
|
+
* Updates a position.
|
|
458
473
|
*
|
|
459
474
|
* @public
|
|
460
475
|
* @param {Object} position
|
|
@@ -595,6 +610,31 @@ module.exports = function () {
|
|
|
595
610
|
});
|
|
596
611
|
}
|
|
597
612
|
|
|
613
|
+
/**
|
|
614
|
+
* Returns all position summary definitions for a portfolio.
|
|
615
|
+
*
|
|
616
|
+
* @public
|
|
617
|
+
* @param {String} portfolio
|
|
618
|
+
* @param {Array.<PositionSummaryFrame>} frames
|
|
619
|
+
*/
|
|
620
|
+
|
|
621
|
+
}, {
|
|
622
|
+
key: 'readPositionSummaryDefinitions',
|
|
623
|
+
value: function readPositionSummaryDefinitions(portfolio, frames) {
|
|
624
|
+
var _this12 = this;
|
|
625
|
+
|
|
626
|
+
return Promise.resolve().then(function () {
|
|
627
|
+
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
628
|
+
|
|
629
|
+
var query = {};
|
|
630
|
+
|
|
631
|
+
query.portfolio = portfolio;
|
|
632
|
+
query.frames = frames;
|
|
633
|
+
|
|
634
|
+
return Gateway.invoke(_this12._readPositionSummaryDefinitionEndpoint, query);
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
|
|
598
638
|
/**
|
|
599
639
|
* Deletes a position.
|
|
600
640
|
*
|
|
@@ -607,15 +647,15 @@ module.exports = function () {
|
|
|
607
647
|
}, {
|
|
608
648
|
key: 'deletePosition',
|
|
609
649
|
value: function deletePosition(portfolio, position) {
|
|
610
|
-
var
|
|
650
|
+
var _this13 = this;
|
|
611
651
|
|
|
612
652
|
return Promise.resolve().then(function () {
|
|
613
|
-
checkStart.call(
|
|
653
|
+
checkStart.call(_this13);
|
|
614
654
|
|
|
615
655
|
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
616
656
|
assert.argumentIsRequired(position, 'position', String);
|
|
617
657
|
|
|
618
|
-
return Gateway.invoke(
|
|
658
|
+
return Gateway.invoke(_this13._deletePositionEndpoint, { portfolio: portfolio, position: position });
|
|
619
659
|
});
|
|
620
660
|
}
|
|
621
661
|
|
|
@@ -630,10 +670,10 @@ module.exports = function () {
|
|
|
630
670
|
}, {
|
|
631
671
|
key: 'createTransaction',
|
|
632
672
|
value: function createTransaction(transaction) {
|
|
633
|
-
var
|
|
673
|
+
var _this14 = this;
|
|
634
674
|
|
|
635
675
|
return Promise.resolve().then(function () {
|
|
636
|
-
checkStart.call(
|
|
676
|
+
checkStart.call(_this14);
|
|
637
677
|
|
|
638
678
|
assert.argumentIsRequired(transaction, 'transaction', Object);
|
|
639
679
|
assert.argumentIsRequired(transaction.portfolio, 'transaction.portfolio', String);
|
|
@@ -645,7 +685,7 @@ module.exports = function () {
|
|
|
645
685
|
|
|
646
686
|
var schema = getTransactionSchema(transaction);
|
|
647
687
|
|
|
648
|
-
return Gateway.invoke(
|
|
688
|
+
return Gateway.invoke(_this14._createTransactionEndpoint, schema.schema.format(transaction));
|
|
649
689
|
});
|
|
650
690
|
}
|
|
651
691
|
|
|
@@ -660,10 +700,10 @@ module.exports = function () {
|
|
|
660
700
|
}, {
|
|
661
701
|
key: 'batchTransactions',
|
|
662
702
|
value: function batchTransactions(portfolio, transactions) {
|
|
663
|
-
var
|
|
703
|
+
var _this15 = this;
|
|
664
704
|
|
|
665
705
|
return Promise.resolve().then(function () {
|
|
666
|
-
checkStart.call(
|
|
706
|
+
checkStart.call(_this15);
|
|
667
707
|
|
|
668
708
|
assert.argumentIsRequired(portfolio, 'portfolio', Object);
|
|
669
709
|
assert.argumentIsArray(transactions, 'transactions', Object);
|
|
@@ -688,7 +728,7 @@ module.exports = function () {
|
|
|
688
728
|
batchData.transactionItems.push(JSON.stringify(schema.schema.format(transaction)));
|
|
689
729
|
});
|
|
690
730
|
|
|
691
|
-
return Gateway.invoke(
|
|
731
|
+
return Gateway.invoke(_this15._batchTransactionEndpoint, batchData);
|
|
692
732
|
});
|
|
693
733
|
}
|
|
694
734
|
|
|
@@ -703,10 +743,10 @@ module.exports = function () {
|
|
|
703
743
|
}, {
|
|
704
744
|
key: 'editTransaction',
|
|
705
745
|
value: function editTransaction(transaction) {
|
|
706
|
-
var
|
|
746
|
+
var _this16 = this;
|
|
707
747
|
|
|
708
748
|
return Promise.resolve().then(function () {
|
|
709
|
-
checkStart.call(
|
|
749
|
+
checkStart.call(_this16);
|
|
710
750
|
|
|
711
751
|
assert.argumentIsRequired(transaction, 'transaction', Object);
|
|
712
752
|
assert.argumentIsRequired(transaction.portfolio, 'transaction.portfolio', String);
|
|
@@ -715,7 +755,7 @@ module.exports = function () {
|
|
|
715
755
|
|
|
716
756
|
var schema = getTransactionSchema(transaction);
|
|
717
757
|
|
|
718
|
-
return Gateway.invoke(
|
|
758
|
+
return Gateway.invoke(_this16._editTransactionEndpoint, schema.schema.format(transaction));
|
|
719
759
|
});
|
|
720
760
|
}
|
|
721
761
|
|
|
@@ -727,25 +767,42 @@ module.exports = function () {
|
|
|
727
767
|
* @param {String} position
|
|
728
768
|
* @param {Number} sequence
|
|
729
769
|
* @param {Boolean=} force
|
|
730
|
-
* @param {
|
|
770
|
+
* @param {Day=} echoStart
|
|
771
|
+
* @param {Day=} echoEnd
|
|
731
772
|
* @returns {Promise.<TransactionMutateResult>}
|
|
732
773
|
*/
|
|
733
774
|
|
|
734
775
|
}, {
|
|
735
776
|
key: 'deleteTransaction',
|
|
736
|
-
value: function deleteTransaction(portfolio, position, sequence, force,
|
|
737
|
-
var
|
|
777
|
+
value: function deleteTransaction(portfolio, position, sequence, force, echoStart, echoEnd) {
|
|
778
|
+
var _this17 = this;
|
|
738
779
|
|
|
739
780
|
return Promise.resolve().then(function () {
|
|
740
|
-
checkStart.call(
|
|
781
|
+
checkStart.call(_this17);
|
|
741
782
|
|
|
742
783
|
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
743
784
|
assert.argumentIsRequired(position, 'position', String);
|
|
744
785
|
assert.argumentIsRequired(sequence, 'sequence', Number);
|
|
745
786
|
assert.argumentIsOptional(force, 'force', Boolean);
|
|
746
|
-
assert.argumentIsOptional(
|
|
787
|
+
assert.argumentIsOptional(echoStart, 'echoStart', Day, 'Day');
|
|
788
|
+
assert.argumentIsOptional(echoEnd, 'echoEnd', Day, 'Day');
|
|
747
789
|
|
|
748
|
-
|
|
790
|
+
var payload = {};
|
|
791
|
+
|
|
792
|
+
payload.portfolio = portfolio;
|
|
793
|
+
payload.position = position;
|
|
794
|
+
payload.sequence = sequence;
|
|
795
|
+
payload.force = is.boolean(force) && force;
|
|
796
|
+
|
|
797
|
+
if (echoStart) {
|
|
798
|
+
payload.echoStart = echoStart;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
if (echoEnd) {
|
|
802
|
+
payload.echoEnd = echoEnd;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
return Gateway.invoke(_this17._deleteTransactionEndpoint, payload);
|
|
749
806
|
});
|
|
750
807
|
}
|
|
751
808
|
|
|
@@ -761,15 +818,15 @@ module.exports = function () {
|
|
|
761
818
|
}, {
|
|
762
819
|
key: 'readTransactions',
|
|
763
820
|
value: function readTransactions(portfolio, position) {
|
|
764
|
-
var
|
|
821
|
+
var _this18 = this;
|
|
765
822
|
|
|
766
823
|
return Promise.resolve().then(function () {
|
|
767
|
-
checkStart.call(
|
|
824
|
+
checkStart.call(_this18);
|
|
768
825
|
|
|
769
826
|
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
770
827
|
assert.argumentIsOptional(position, 'position', String);
|
|
771
828
|
|
|
772
|
-
return Gateway.invoke(
|
|
829
|
+
return Gateway.invoke(_this18._readTransactionsEndpoint, { portfolio: portfolio, position: position || '*' });
|
|
773
830
|
});
|
|
774
831
|
}
|
|
775
832
|
|
|
@@ -782,21 +839,23 @@ module.exports = function () {
|
|
|
782
839
|
* @param {String=} position
|
|
783
840
|
* @param {Day=} startDay
|
|
784
841
|
* @param {Day=} endDay
|
|
842
|
+
* @oaram {Boolean=} descending
|
|
785
843
|
* @returns {Promise.<Object[]>}
|
|
786
844
|
*/
|
|
787
845
|
|
|
788
846
|
}, {
|
|
789
847
|
key: 'readTransactionsFormatted',
|
|
790
|
-
value: function readTransactionsFormatted(portfolio, position, startDay, endDay) {
|
|
791
|
-
var
|
|
848
|
+
value: function readTransactionsFormatted(portfolio, position, startDay, endDay, descending) {
|
|
849
|
+
var _this19 = this;
|
|
792
850
|
|
|
793
851
|
return Promise.resolve().then(function () {
|
|
794
|
-
checkStart.call(
|
|
852
|
+
checkStart.call(_this19);
|
|
795
853
|
|
|
796
854
|
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
797
855
|
assert.argumentIsOptional(position, 'position', String);
|
|
798
856
|
assert.argumentIsOptional(startDay, 'startDay', Day, 'Day');
|
|
799
857
|
assert.argumentIsOptional(endDay, 'endDay', Day, 'Day');
|
|
858
|
+
assert.argumentIsOptional(descending, 'descending', Boolean);
|
|
800
859
|
|
|
801
860
|
var payload = {};
|
|
802
861
|
|
|
@@ -811,16 +870,18 @@ module.exports = function () {
|
|
|
811
870
|
payload.end = endDay;
|
|
812
871
|
}
|
|
813
872
|
|
|
814
|
-
|
|
873
|
+
payload.descending = is.boolean(descending) && descending;
|
|
874
|
+
|
|
875
|
+
return Gateway.invoke(_this19._readTransactionsReportEndpoint, payload);
|
|
815
876
|
});
|
|
816
877
|
}
|
|
817
878
|
}, {
|
|
818
879
|
key: 'readTransactionsFormattedPage',
|
|
819
880
|
value: function readTransactionsFormattedPage(portfolio, position, sequence, count, descending) {
|
|
820
|
-
var
|
|
881
|
+
var _this20 = this;
|
|
821
882
|
|
|
822
883
|
return Promise.resolve().then(function () {
|
|
823
|
-
checkStart.call(
|
|
884
|
+
checkStart.call(_this20);
|
|
824
885
|
|
|
825
886
|
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
826
887
|
assert.argumentIsRequired(position, 'position', String);
|
|
@@ -845,7 +906,7 @@ module.exports = function () {
|
|
|
845
906
|
|
|
846
907
|
payload.descending = is.boolean(descending) && descending;
|
|
847
908
|
|
|
848
|
-
return Gateway.invoke(
|
|
909
|
+
return Gateway.invoke(_this20._readTransactionsReportEndpoint, payload);
|
|
849
910
|
});
|
|
850
911
|
}
|
|
851
912
|
|
|
@@ -1018,6 +1079,14 @@ module.exports = function () {
|
|
|
1018
1079
|
}
|
|
1019
1080
|
});
|
|
1020
1081
|
|
|
1082
|
+
var responseInterceptorForPositionSummaryDefinitionDeserialization = ResponseInterceptor.fromDelegate(function (response, ignored) {
|
|
1083
|
+
try {
|
|
1084
|
+
return JSON.parse(response.data, PositionSummaryDefinitionSchema.CLIENT.schema.getReviver());
|
|
1085
|
+
} catch (e) {
|
|
1086
|
+
console.log('Error deserializing position summary definition', e);
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1021
1090
|
var responseInterceptorForTransactionDeserialization = ResponseInterceptor.fromDelegate(function (response, ignored) {
|
|
1022
1091
|
try {
|
|
1023
1092
|
return JSON.parse(response.data, TransactionSchema.CLIENT.schema.getReviver());
|
|
@@ -1085,7 +1154,7 @@ module.exports = function () {
|
|
|
1085
1154
|
return PortfolioGateway;
|
|
1086
1155
|
}();
|
|
1087
1156
|
|
|
1088
|
-
},{"./../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/common-js/lang/promise":42,"@barchart/portfolio-api-common/lib/data/PositionSummaryFrame":53,"@barchart/portfolio-api-common/lib/data/TransactionType":54,"@barchart/portfolio-api-common/lib/serialization/PortfolioSchema":56,"@barchart/portfolio-api-common/lib/serialization/PositionSchema":57,"@barchart/portfolio-api-common/lib/serialization/
|
|
1157
|
+
},{"./../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/common-js/lang/promise":42,"@barchart/portfolio-api-common/lib/data/PositionSummaryFrame":53,"@barchart/portfolio-api-common/lib/data/TransactionType":54,"@barchart/portfolio-api-common/lib/serialization/PortfolioSchema":56,"@barchart/portfolio-api-common/lib/serialization/PositionSchema":57,"@barchart/portfolio-api-common/lib/serialization/PositionSummaryDefinitionSchema":58,"@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema":59,"@barchart/portfolio-api-common/lib/serialization/TransactionSchema":60}],4:[function(require,module,exports){
|
|
1089
1158
|
'use strict';
|
|
1090
1159
|
|
|
1091
1160
|
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; }; }();
|
|
@@ -1436,7 +1505,7 @@ module.exports = function () {
|
|
|
1436
1505
|
return {
|
|
1437
1506
|
JwtGateway: JwtGateway,
|
|
1438
1507
|
PortfolioGateway: PortfolioGateway,
|
|
1439
|
-
version: '1.2.
|
|
1508
|
+
version: '1.2.27'
|
|
1440
1509
|
};
|
|
1441
1510
|
}();
|
|
1442
1511
|
|
|
@@ -2192,7 +2261,7 @@ module.exports = function () {
|
|
|
2192
2261
|
return Gateway;
|
|
2193
2262
|
}();
|
|
2194
2263
|
|
|
2195
|
-
},{"./../../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":
|
|
2264
|
+
},{"./../../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":63}],10:[function(require,module,exports){
|
|
2196
2265
|
'use strict';
|
|
2197
2266
|
|
|
2198
2267
|
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; }; }();
|
|
@@ -6260,7 +6329,7 @@ module.exports = function () {
|
|
|
6260
6329
|
return Decimal;
|
|
6261
6330
|
}();
|
|
6262
6331
|
|
|
6263
|
-
},{"./Enum":32,"./assert":37,"./is":40,"big.js":
|
|
6332
|
+
},{"./Enum":32,"./assert":37,"./is":40,"big.js":88}],31:[function(require,module,exports){
|
|
6264
6333
|
'use strict';
|
|
6265
6334
|
|
|
6266
6335
|
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; }; }();
|
|
@@ -6819,7 +6888,7 @@ module.exports = function () {
|
|
|
6819
6888
|
return Timestamp;
|
|
6820
6889
|
}();
|
|
6821
6890
|
|
|
6822
|
-
},{"./assert":37,"./is":40,"moment-timezone":
|
|
6891
|
+
},{"./assert":37,"./is":40,"moment-timezone":93}],35:[function(require,module,exports){
|
|
6823
6892
|
'use strict';
|
|
6824
6893
|
|
|
6825
6894
|
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; }; }();
|
|
@@ -8376,7 +8445,7 @@ module.exports = function () {
|
|
|
8376
8445
|
};
|
|
8377
8446
|
}();
|
|
8378
8447
|
|
|
8379
|
-
},{"./assert":37,"moment-timezone/builds/moment-timezone-with-data-2010-2020":
|
|
8448
|
+
},{"./assert":37,"moment-timezone/builds/moment-timezone-with-data-2010-2020":91}],44:[function(require,module,exports){
|
|
8380
8449
|
'use strict';
|
|
8381
8450
|
|
|
8382
8451
|
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; }; }();
|
|
@@ -8852,7 +8921,7 @@ module.exports = function () {
|
|
|
8852
8921
|
return DataType;
|
|
8853
8922
|
}();
|
|
8854
8923
|
|
|
8855
|
-
},{"./../../lang/AdHoc":27,"./../../lang/Day":29,"./../../lang/Decimal":30,"./../../lang/Enum":32,"./../../lang/Timestamp":34,"./../../lang/assert":37,"./../../lang/is":40,"moment":
|
|
8924
|
+
},{"./../../lang/AdHoc":27,"./../../lang/Day":29,"./../../lang/Decimal":30,"./../../lang/Enum":32,"./../../lang/Timestamp":34,"./../../lang/assert":37,"./../../lang/is":40,"moment":95}],46:[function(require,module,exports){
|
|
8856
8925
|
'use strict';
|
|
8857
8926
|
|
|
8858
8927
|
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; }; }();
|
|
@@ -10044,7 +10113,7 @@ module.exports = (() => {
|
|
|
10044
10113
|
return InstrumentType;
|
|
10045
10114
|
})();
|
|
10046
10115
|
|
|
10047
|
-
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"uuid":
|
|
10116
|
+
},{"@barchart/common-js/lang/Enum":32,"@barchart/common-js/lang/assert":37,"uuid":96}],52:[function(require,module,exports){
|
|
10048
10117
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
10049
10118
|
Decimal = require('@barchart/common-js/lang/Decimal'),
|
|
10050
10119
|
Enum = require('@barchart/common-js/lang/Enum');
|
|
@@ -10263,6 +10332,19 @@ module.exports = (() => {
|
|
|
10263
10332
|
return this._rangeCalculator(getFilteredTransactions(transactions));
|
|
10264
10333
|
}
|
|
10265
10334
|
|
|
10335
|
+
/**
|
|
10336
|
+
* Returns the range which contains a given date and all subsequent ranges.
|
|
10337
|
+
*
|
|
10338
|
+
* @public
|
|
10339
|
+
* @param {Day} date
|
|
10340
|
+
* @return {Array.<PositionSummaryRange>}
|
|
10341
|
+
*/
|
|
10342
|
+
getRangesFromDate(date) {
|
|
10343
|
+
const transaction = { date: date, snapshot: { open: Decimal.ONE } };
|
|
10344
|
+
|
|
10345
|
+
return this.getRanges([ transaction ]);
|
|
10346
|
+
}
|
|
10347
|
+
|
|
10266
10348
|
/**
|
|
10267
10349
|
* Returns the start date for a frame, a given number of periods ago.
|
|
10268
10350
|
*
|
|
@@ -10335,6 +10417,16 @@ module.exports = (() => {
|
|
|
10335
10417
|
* @property {Day} end
|
|
10336
10418
|
*/
|
|
10337
10419
|
|
|
10420
|
+
/**
|
|
10421
|
+
* The start and and date for a {@link PositionSummaryFrame} along with the frame type.
|
|
10422
|
+
*
|
|
10423
|
+
* @typedef PositionSummaryDefinition
|
|
10424
|
+
* @type {Object}
|
|
10425
|
+
* @property {Day} start
|
|
10426
|
+
* @property {Day} end
|
|
10427
|
+
* @property {PositionSummaryFrame} frame
|
|
10428
|
+
*/
|
|
10429
|
+
|
|
10338
10430
|
function getRange(start, end) {
|
|
10339
10431
|
return {
|
|
10340
10432
|
start: start,
|
|
@@ -11201,6 +11293,7 @@ module.exports = (() => {
|
|
|
11201
11293
|
.withField('legacy.portfolio', DataType.STRING, true)
|
|
11202
11294
|
.withField('legacy.position', DataType.STRING, true)
|
|
11203
11295
|
.withField('system.version', DataType.NUMBER, true)
|
|
11296
|
+
.withField('system.locked', DataType.BOOLEAN, true)
|
|
11204
11297
|
.withField('root', DataType.STRING, true)
|
|
11205
11298
|
.schema
|
|
11206
11299
|
);
|
|
@@ -11230,6 +11323,7 @@ module.exports = (() => {
|
|
|
11230
11323
|
.withField('snapshot.basis', DataType.DECIMAL)
|
|
11231
11324
|
.withField('snapshot.income', DataType.DECIMAL)
|
|
11232
11325
|
.withField('snapshot.value', DataType.DECIMAL)
|
|
11326
|
+
.withField('system.locked', DataType.BOOLEAN, true)
|
|
11233
11327
|
.withField('previous', DataType.NUMBER, true)
|
|
11234
11328
|
.schema
|
|
11235
11329
|
);
|
|
@@ -11251,8 +11345,67 @@ module.exports = (() => {
|
|
|
11251
11345
|
})();
|
|
11252
11346
|
|
|
11253
11347
|
},{"./../data/InstrumentType":51,"./../data/PositionDirection":52,"./../data/ValuationType":55,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@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){
|
|
11254
|
-
const
|
|
11255
|
-
|
|
11348
|
+
const DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
11349
|
+
Enum = require('@barchart/common-js/lang/Enum'),
|
|
11350
|
+
Schema = require('@barchart/common-js/serialization/json/Schema'),
|
|
11351
|
+
SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
|
|
11352
|
+
|
|
11353
|
+
const PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
11354
|
+
|
|
11355
|
+
module.exports = (() => {
|
|
11356
|
+
'use strict';
|
|
11357
|
+
|
|
11358
|
+
/**
|
|
11359
|
+
* The schemas which can be used to represent position summary objects.
|
|
11360
|
+
*
|
|
11361
|
+
* @public
|
|
11362
|
+
* @extends {Enum}
|
|
11363
|
+
*/
|
|
11364
|
+
class PositionSummaryDefinitionSchema extends Enum {
|
|
11365
|
+
constructor(schema) {
|
|
11366
|
+
super(schema.name, schema.name);
|
|
11367
|
+
|
|
11368
|
+
this._schema = schema;
|
|
11369
|
+
}
|
|
11370
|
+
|
|
11371
|
+
/**
|
|
11372
|
+
* The actual {@link Schema}.
|
|
11373
|
+
*
|
|
11374
|
+
* @public
|
|
11375
|
+
* @returns {Schema}
|
|
11376
|
+
*/
|
|
11377
|
+
get schema() {
|
|
11378
|
+
return this._schema;
|
|
11379
|
+
}
|
|
11380
|
+
|
|
11381
|
+
/**
|
|
11382
|
+
* The complete position summary definition schema.
|
|
11383
|
+
*
|
|
11384
|
+
* @static
|
|
11385
|
+
* @public
|
|
11386
|
+
* @returns {PositionSummaryDefinitionSchema}
|
|
11387
|
+
*/
|
|
11388
|
+
static get COMPLETE() {
|
|
11389
|
+
return complete;
|
|
11390
|
+
}
|
|
11391
|
+
|
|
11392
|
+
toString() {
|
|
11393
|
+
return '[PositionSummaryDefinitionSchema]';
|
|
11394
|
+
}
|
|
11395
|
+
}
|
|
11396
|
+
|
|
11397
|
+
const complete = new PositionSummaryDefinitionSchema(SchemaBuilder.withName('complete')
|
|
11398
|
+
.withField('start', DataType.DAY)
|
|
11399
|
+
.withField('end', DataType.DAY)
|
|
11400
|
+
.withField('frame', DataType.forEnum(PositionSummaryFrame, 'PositionSummaryFrame'))
|
|
11401
|
+
.schema
|
|
11402
|
+
);
|
|
11403
|
+
|
|
11404
|
+
return PositionSummaryDefinitionSchema;
|
|
11405
|
+
})();
|
|
11406
|
+
|
|
11407
|
+
},{"./../data/PositionSummaryFrame":53,"@barchart/common-js/lang/Enum":32,"@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){
|
|
11408
|
+
const DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
11256
11409
|
Enum = require('@barchart/common-js/lang/Enum'),
|
|
11257
11410
|
Schema = require('@barchart/common-js/serialization/json/Schema'),
|
|
11258
11411
|
SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
|
|
@@ -11368,7 +11521,7 @@ module.exports = (() => {
|
|
|
11368
11521
|
return PositionSummarySchema;
|
|
11369
11522
|
})();
|
|
11370
11523
|
|
|
11371
|
-
},{"./../data/PositionDirection":52,"./../data/PositionSummaryFrame":53,"@barchart/common-js/lang/
|
|
11524
|
+
},{"./../data/PositionDirection":52,"./../data/PositionSummaryFrame":53,"@barchart/common-js/lang/Enum":32,"@barchart/common-js/serialization/json/DataType":45,"@barchart/common-js/serialization/json/Schema":47,"@barchart/common-js/serialization/json/builders/SchemaBuilder":49}],60:[function(require,module,exports){
|
|
11372
11525
|
const is = require('@barchart/common-js/lang/is'),
|
|
11373
11526
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
11374
11527
|
DataType = require('@barchart/common-js/serialization/json/DataType'),
|
|
@@ -11724,7 +11877,7 @@ module.exports = (() => {
|
|
|
11724
11877
|
return TransactionSchema;
|
|
11725
11878
|
})();
|
|
11726
11879
|
|
|
11727
|
-
},{"./../data/InstrumentType":51,"./../data/PositionDirection":52,"./../data/TransactionType":54,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@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}],
|
|
11880
|
+
},{"./../data/InstrumentType":51,"./../data/PositionDirection":52,"./../data/TransactionType":54,"@barchart/common-js/lang/Currency":28,"@barchart/common-js/lang/Enum":32,"@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}],61:[function(require,module,exports){
|
|
11728
11881
|
'use strict';
|
|
11729
11882
|
|
|
11730
11883
|
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; }; }();
|
|
@@ -12122,7 +12275,7 @@ module.exports = function () {
|
|
|
12122
12275
|
return JwtGateway;
|
|
12123
12276
|
}();
|
|
12124
12277
|
|
|
12125
|
-
},{"./index":
|
|
12278
|
+
},{"./index":62,"@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/assert":37,"@barchart/common-js/timing/Scheduler":50}],62:[function(require,module,exports){
|
|
12126
12279
|
'use strict';
|
|
12127
12280
|
|
|
12128
12281
|
module.exports = function () {
|
|
@@ -12133,9 +12286,9 @@ module.exports = function () {
|
|
|
12133
12286
|
};
|
|
12134
12287
|
}();
|
|
12135
12288
|
|
|
12136
|
-
},{}],
|
|
12289
|
+
},{}],63:[function(require,module,exports){
|
|
12137
12290
|
module.exports = require('./lib/axios');
|
|
12138
|
-
},{"./lib/axios":
|
|
12291
|
+
},{"./lib/axios":65}],64:[function(require,module,exports){
|
|
12139
12292
|
(function (process){
|
|
12140
12293
|
'use strict';
|
|
12141
12294
|
|
|
@@ -12319,7 +12472,7 @@ module.exports = function xhrAdapter(config) {
|
|
|
12319
12472
|
};
|
|
12320
12473
|
|
|
12321
12474
|
}).call(this,require('_process'))
|
|
12322
|
-
},{"../core/createError":
|
|
12475
|
+
},{"../core/createError":71,"./../core/settle":74,"./../helpers/btoa":78,"./../helpers/buildURL":79,"./../helpers/cookies":81,"./../helpers/isURLSameOrigin":83,"./../helpers/parseHeaders":85,"./../utils":87,"_process":89}],65:[function(require,module,exports){
|
|
12323
12476
|
'use strict';
|
|
12324
12477
|
|
|
12325
12478
|
var utils = require('./utils');
|
|
@@ -12373,7 +12526,7 @@ module.exports = axios;
|
|
|
12373
12526
|
// Allow use of default import syntax in TypeScript
|
|
12374
12527
|
module.exports.default = axios;
|
|
12375
12528
|
|
|
12376
|
-
},{"./cancel/Cancel":
|
|
12529
|
+
},{"./cancel/Cancel":66,"./cancel/CancelToken":67,"./cancel/isCancel":68,"./core/Axios":69,"./defaults":76,"./helpers/bind":77,"./helpers/spread":86,"./utils":87}],66:[function(require,module,exports){
|
|
12377
12530
|
'use strict';
|
|
12378
12531
|
|
|
12379
12532
|
/**
|
|
@@ -12394,7 +12547,7 @@ Cancel.prototype.__CANCEL__ = true;
|
|
|
12394
12547
|
|
|
12395
12548
|
module.exports = Cancel;
|
|
12396
12549
|
|
|
12397
|
-
},{}],
|
|
12550
|
+
},{}],67:[function(require,module,exports){
|
|
12398
12551
|
'use strict';
|
|
12399
12552
|
|
|
12400
12553
|
var Cancel = require('./Cancel');
|
|
@@ -12453,14 +12606,14 @@ CancelToken.source = function source() {
|
|
|
12453
12606
|
|
|
12454
12607
|
module.exports = CancelToken;
|
|
12455
12608
|
|
|
12456
|
-
},{"./Cancel":
|
|
12609
|
+
},{"./Cancel":66}],68:[function(require,module,exports){
|
|
12457
12610
|
'use strict';
|
|
12458
12611
|
|
|
12459
12612
|
module.exports = function isCancel(value) {
|
|
12460
12613
|
return !!(value && value.__CANCEL__);
|
|
12461
12614
|
};
|
|
12462
12615
|
|
|
12463
|
-
},{}],
|
|
12616
|
+
},{}],69:[function(require,module,exports){
|
|
12464
12617
|
'use strict';
|
|
12465
12618
|
|
|
12466
12619
|
var defaults = require('./../defaults');
|
|
@@ -12541,7 +12694,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
12541
12694
|
|
|
12542
12695
|
module.exports = Axios;
|
|
12543
12696
|
|
|
12544
|
-
},{"./../defaults":
|
|
12697
|
+
},{"./../defaults":76,"./../utils":87,"./InterceptorManager":70,"./dispatchRequest":72}],70:[function(require,module,exports){
|
|
12545
12698
|
'use strict';
|
|
12546
12699
|
|
|
12547
12700
|
var utils = require('./../utils');
|
|
@@ -12595,7 +12748,7 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
12595
12748
|
|
|
12596
12749
|
module.exports = InterceptorManager;
|
|
12597
12750
|
|
|
12598
|
-
},{"./../utils":
|
|
12751
|
+
},{"./../utils":87}],71:[function(require,module,exports){
|
|
12599
12752
|
'use strict';
|
|
12600
12753
|
|
|
12601
12754
|
var enhanceError = require('./enhanceError');
|
|
@@ -12615,7 +12768,7 @@ module.exports = function createError(message, config, code, request, response)
|
|
|
12615
12768
|
return enhanceError(error, config, code, request, response);
|
|
12616
12769
|
};
|
|
12617
12770
|
|
|
12618
|
-
},{"./enhanceError":
|
|
12771
|
+
},{"./enhanceError":73}],72:[function(require,module,exports){
|
|
12619
12772
|
'use strict';
|
|
12620
12773
|
|
|
12621
12774
|
var utils = require('./../utils');
|
|
@@ -12703,7 +12856,7 @@ module.exports = function dispatchRequest(config) {
|
|
|
12703
12856
|
});
|
|
12704
12857
|
};
|
|
12705
12858
|
|
|
12706
|
-
},{"../cancel/isCancel":
|
|
12859
|
+
},{"../cancel/isCancel":68,"../defaults":76,"./../helpers/combineURLs":80,"./../helpers/isAbsoluteURL":82,"./../utils":87,"./transformData":75}],73:[function(require,module,exports){
|
|
12707
12860
|
'use strict';
|
|
12708
12861
|
|
|
12709
12862
|
/**
|
|
@@ -12726,7 +12879,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
12726
12879
|
return error;
|
|
12727
12880
|
};
|
|
12728
12881
|
|
|
12729
|
-
},{}],
|
|
12882
|
+
},{}],74:[function(require,module,exports){
|
|
12730
12883
|
'use strict';
|
|
12731
12884
|
|
|
12732
12885
|
var createError = require('./createError');
|
|
@@ -12754,7 +12907,7 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
12754
12907
|
}
|
|
12755
12908
|
};
|
|
12756
12909
|
|
|
12757
|
-
},{"./createError":
|
|
12910
|
+
},{"./createError":71}],75:[function(require,module,exports){
|
|
12758
12911
|
'use strict';
|
|
12759
12912
|
|
|
12760
12913
|
var utils = require('./../utils');
|
|
@@ -12776,7 +12929,7 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
12776
12929
|
return data;
|
|
12777
12930
|
};
|
|
12778
12931
|
|
|
12779
|
-
},{"./../utils":
|
|
12932
|
+
},{"./../utils":87}],76:[function(require,module,exports){
|
|
12780
12933
|
(function (process){
|
|
12781
12934
|
'use strict';
|
|
12782
12935
|
|
|
@@ -12872,7 +13025,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
12872
13025
|
module.exports = defaults;
|
|
12873
13026
|
|
|
12874
13027
|
}).call(this,require('_process'))
|
|
12875
|
-
},{"./adapters/http":
|
|
13028
|
+
},{"./adapters/http":64,"./adapters/xhr":64,"./helpers/normalizeHeaderName":84,"./utils":87,"_process":89}],77:[function(require,module,exports){
|
|
12876
13029
|
'use strict';
|
|
12877
13030
|
|
|
12878
13031
|
module.exports = function bind(fn, thisArg) {
|
|
@@ -12885,7 +13038,7 @@ module.exports = function bind(fn, thisArg) {
|
|
|
12885
13038
|
};
|
|
12886
13039
|
};
|
|
12887
13040
|
|
|
12888
|
-
},{}],
|
|
13041
|
+
},{}],78:[function(require,module,exports){
|
|
12889
13042
|
'use strict';
|
|
12890
13043
|
|
|
12891
13044
|
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
|
|
@@ -12923,7 +13076,7 @@ function btoa(input) {
|
|
|
12923
13076
|
|
|
12924
13077
|
module.exports = btoa;
|
|
12925
13078
|
|
|
12926
|
-
},{}],
|
|
13079
|
+
},{}],79:[function(require,module,exports){
|
|
12927
13080
|
'use strict';
|
|
12928
13081
|
|
|
12929
13082
|
var utils = require('./../utils');
|
|
@@ -12993,7 +13146,7 @@ module.exports = function buildURL(url, params, paramsSerializer) {
|
|
|
12993
13146
|
return url;
|
|
12994
13147
|
};
|
|
12995
13148
|
|
|
12996
|
-
},{"./../utils":
|
|
13149
|
+
},{"./../utils":87}],80:[function(require,module,exports){
|
|
12997
13150
|
'use strict';
|
|
12998
13151
|
|
|
12999
13152
|
/**
|
|
@@ -13009,7 +13162,7 @@ module.exports = function combineURLs(baseURL, relativeURL) {
|
|
|
13009
13162
|
: baseURL;
|
|
13010
13163
|
};
|
|
13011
13164
|
|
|
13012
|
-
},{}],
|
|
13165
|
+
},{}],81:[function(require,module,exports){
|
|
13013
13166
|
'use strict';
|
|
13014
13167
|
|
|
13015
13168
|
var utils = require('./../utils');
|
|
@@ -13064,7 +13217,7 @@ module.exports = (
|
|
|
13064
13217
|
})()
|
|
13065
13218
|
);
|
|
13066
13219
|
|
|
13067
|
-
},{"./../utils":
|
|
13220
|
+
},{"./../utils":87}],82:[function(require,module,exports){
|
|
13068
13221
|
'use strict';
|
|
13069
13222
|
|
|
13070
13223
|
/**
|
|
@@ -13080,7 +13233,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
13080
13233
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
13081
13234
|
};
|
|
13082
13235
|
|
|
13083
|
-
},{}],
|
|
13236
|
+
},{}],83:[function(require,module,exports){
|
|
13084
13237
|
'use strict';
|
|
13085
13238
|
|
|
13086
13239
|
var utils = require('./../utils');
|
|
@@ -13150,7 +13303,7 @@ module.exports = (
|
|
|
13150
13303
|
})()
|
|
13151
13304
|
);
|
|
13152
13305
|
|
|
13153
|
-
},{"./../utils":
|
|
13306
|
+
},{"./../utils":87}],84:[function(require,module,exports){
|
|
13154
13307
|
'use strict';
|
|
13155
13308
|
|
|
13156
13309
|
var utils = require('../utils');
|
|
@@ -13164,7 +13317,7 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
|
13164
13317
|
});
|
|
13165
13318
|
};
|
|
13166
13319
|
|
|
13167
|
-
},{"../utils":
|
|
13320
|
+
},{"../utils":87}],85:[function(require,module,exports){
|
|
13168
13321
|
'use strict';
|
|
13169
13322
|
|
|
13170
13323
|
var utils = require('./../utils');
|
|
@@ -13219,7 +13372,7 @@ module.exports = function parseHeaders(headers) {
|
|
|
13219
13372
|
return parsed;
|
|
13220
13373
|
};
|
|
13221
13374
|
|
|
13222
|
-
},{"./../utils":
|
|
13375
|
+
},{"./../utils":87}],86:[function(require,module,exports){
|
|
13223
13376
|
'use strict';
|
|
13224
13377
|
|
|
13225
13378
|
/**
|
|
@@ -13248,7 +13401,7 @@ module.exports = function spread(callback) {
|
|
|
13248
13401
|
};
|
|
13249
13402
|
};
|
|
13250
13403
|
|
|
13251
|
-
},{}],
|
|
13404
|
+
},{}],87:[function(require,module,exports){
|
|
13252
13405
|
'use strict';
|
|
13253
13406
|
|
|
13254
13407
|
var bind = require('./helpers/bind');
|
|
@@ -13553,7 +13706,7 @@ module.exports = {
|
|
|
13553
13706
|
trim: trim
|
|
13554
13707
|
};
|
|
13555
13708
|
|
|
13556
|
-
},{"./helpers/bind":
|
|
13709
|
+
},{"./helpers/bind":77,"is-buffer":90}],88:[function(require,module,exports){
|
|
13557
13710
|
/*
|
|
13558
13711
|
* big.js v5.0.3
|
|
13559
13712
|
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
|
|
@@ -14494,7 +14647,7 @@ module.exports = {
|
|
|
14494
14647
|
}
|
|
14495
14648
|
})(this);
|
|
14496
14649
|
|
|
14497
|
-
},{}],
|
|
14650
|
+
},{}],89:[function(require,module,exports){
|
|
14498
14651
|
// shim for using process in browser
|
|
14499
14652
|
var process = module.exports = {};
|
|
14500
14653
|
|
|
@@ -14680,7 +14833,7 @@ process.chdir = function (dir) {
|
|
|
14680
14833
|
};
|
|
14681
14834
|
process.umask = function() { return 0; };
|
|
14682
14835
|
|
|
14683
|
-
},{}],
|
|
14836
|
+
},{}],90:[function(require,module,exports){
|
|
14684
14837
|
/*!
|
|
14685
14838
|
* Determine if an object is a Buffer
|
|
14686
14839
|
*
|
|
@@ -14703,7 +14856,7 @@ function isSlowBuffer (obj) {
|
|
|
14703
14856
|
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
|
14704
14857
|
}
|
|
14705
14858
|
|
|
14706
|
-
},{}],
|
|
14859
|
+
},{}],91:[function(require,module,exports){
|
|
14707
14860
|
//! moment-timezone.js
|
|
14708
14861
|
//! version : 0.5.11
|
|
14709
14862
|
//! Copyright (c) JS Foundation and other contributors
|
|
@@ -15905,7 +16058,7 @@ function isSlowBuffer (obj) {
|
|
|
15905
16058
|
return moment;
|
|
15906
16059
|
}));
|
|
15907
16060
|
|
|
15908
|
-
},{"moment":
|
|
16061
|
+
},{"moment":95}],92:[function(require,module,exports){
|
|
15909
16062
|
module.exports={
|
|
15910
16063
|
"version": "2016j",
|
|
15911
16064
|
"zones": [
|
|
@@ -16505,11 +16658,11 @@ module.exports={
|
|
|
16505
16658
|
"Pacific/Pohnpei|Pacific/Ponape"
|
|
16506
16659
|
]
|
|
16507
16660
|
}
|
|
16508
|
-
},{}],
|
|
16661
|
+
},{}],93:[function(require,module,exports){
|
|
16509
16662
|
var moment = module.exports = require("./moment-timezone");
|
|
16510
16663
|
moment.tz.load(require('./data/packed/latest.json'));
|
|
16511
16664
|
|
|
16512
|
-
},{"./data/packed/latest.json":
|
|
16665
|
+
},{"./data/packed/latest.json":92,"./moment-timezone":94}],94:[function(require,module,exports){
|
|
16513
16666
|
//! moment-timezone.js
|
|
16514
16667
|
//! version : 0.5.11
|
|
16515
16668
|
//! Copyright (c) JS Foundation and other contributors
|
|
@@ -17112,7 +17265,7 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
17112
17265
|
return moment;
|
|
17113
17266
|
}));
|
|
17114
17267
|
|
|
17115
|
-
},{"moment":
|
|
17268
|
+
},{"moment":95}],95:[function(require,module,exports){
|
|
17116
17269
|
//! moment.js
|
|
17117
17270
|
|
|
17118
17271
|
;(function (global, factory) {
|
|
@@ -21620,7 +21773,7 @@ moment.tz.load(require('./data/packed/latest.json'));
|
|
|
21620
21773
|
|
|
21621
21774
|
})));
|
|
21622
21775
|
|
|
21623
|
-
},{}],
|
|
21776
|
+
},{}],96:[function(require,module,exports){
|
|
21624
21777
|
var v1 = require('./v1');
|
|
21625
21778
|
var v4 = require('./v4');
|
|
21626
21779
|
|
|
@@ -21630,7 +21783,7 @@ uuid.v4 = v4;
|
|
|
21630
21783
|
|
|
21631
21784
|
module.exports = uuid;
|
|
21632
21785
|
|
|
21633
|
-
},{"./v1":
|
|
21786
|
+
},{"./v1":99,"./v4":100}],97:[function(require,module,exports){
|
|
21634
21787
|
/**
|
|
21635
21788
|
* Convert array of 16 byte values to UUID string format of the form:
|
|
21636
21789
|
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
@@ -21655,7 +21808,7 @@ function bytesToUuid(buf, offset) {
|
|
|
21655
21808
|
|
|
21656
21809
|
module.exports = bytesToUuid;
|
|
21657
21810
|
|
|
21658
|
-
},{}],
|
|
21811
|
+
},{}],98:[function(require,module,exports){
|
|
21659
21812
|
(function (global){
|
|
21660
21813
|
// Unique ID creation requires a high quality random # generator. In the
|
|
21661
21814
|
// browser this is a little complicated due to unknown quality of Math.random()
|
|
@@ -21692,7 +21845,7 @@ if (!rng) {
|
|
|
21692
21845
|
module.exports = rng;
|
|
21693
21846
|
|
|
21694
21847
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
21695
|
-
},{}],
|
|
21848
|
+
},{}],99:[function(require,module,exports){
|
|
21696
21849
|
var rng = require('./lib/rng');
|
|
21697
21850
|
var bytesToUuid = require('./lib/bytesToUuid');
|
|
21698
21851
|
|
|
@@ -21794,7 +21947,7 @@ function v1(options, buf, offset) {
|
|
|
21794
21947
|
|
|
21795
21948
|
module.exports = v1;
|
|
21796
21949
|
|
|
21797
|
-
},{"./lib/bytesToUuid":
|
|
21950
|
+
},{"./lib/bytesToUuid":97,"./lib/rng":98}],100:[function(require,module,exports){
|
|
21798
21951
|
var rng = require('./lib/rng');
|
|
21799
21952
|
var bytesToUuid = require('./lib/bytesToUuid');
|
|
21800
21953
|
|
|
@@ -21825,5 +21978,5 @@ function v4(options, buf, offset) {
|
|
|
21825
21978
|
|
|
21826
21979
|
module.exports = v4;
|
|
21827
21980
|
|
|
21828
|
-
},{"./lib/bytesToUuid":
|
|
21981
|
+
},{"./lib/bytesToUuid":97,"./lib/rng":98}]},{},[1,5])(5)
|
|
21829
21982
|
});
|
|
@@ -9,6 +9,7 @@ const TransactionType = require('@barchart/portfolio-api-common/lib/data/Transac
|
|
|
9
9
|
|
|
10
10
|
const PortfolioSchema = require('@barchart/portfolio-api-common/lib/serialization/PortfolioSchema'),
|
|
11
11
|
PositionSummarySchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSummarySchema'),
|
|
12
|
+
PositionSummaryDefinitionSchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSummaryDefinitionSchema'),
|
|
12
13
|
PositionSchema = require('@barchart/portfolio-api-common/lib/serialization/PositionSchema'),
|
|
13
14
|
TransactionSchema = require('@barchart/portfolio-api-common/lib/serialization/TransactionSchema');
|
|
14
15
|
|
|
@@ -188,7 +189,7 @@ module.exports = (() => {
|
|
|
188
189
|
.withQueryBuilder((qb) => {
|
|
189
190
|
qb.withVariableParameter('frames', 'frames', 'frames', true, frames => frames.map(f => f.code).join())
|
|
190
191
|
.withVariableParameter('periods', 'periods', 'periods', true)
|
|
191
|
-
.withVariableParameter('start', 'start', 'start', true,
|
|
192
|
+
.withVariableParameter('start', 'start', 'start', true, x => x.format());
|
|
192
193
|
})
|
|
193
194
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
194
195
|
.withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE)
|
|
@@ -196,6 +197,26 @@ module.exports = (() => {
|
|
|
196
197
|
.withErrorInterceptor(ErrorInterceptor.GENERAL)
|
|
197
198
|
.endpoint;
|
|
198
199
|
|
|
200
|
+
this._readPositionSummaryDefinitionEndpoint = EndpointBuilder.for('read-position-summary-definitions', 'read position summary definitions')
|
|
201
|
+
.withVerb(VerbType.GET)
|
|
202
|
+
.withProtocol(protocolType)
|
|
203
|
+
.withHost(host)
|
|
204
|
+
.withPort(port)
|
|
205
|
+
.withPathBuilder((pb) => {
|
|
206
|
+
pb.withLiteralParameter('portfolios', 'portfolios')
|
|
207
|
+
.withVariableParameter('portfolio', 'portfolio', 'portfolio', false)
|
|
208
|
+
.withLiteralParameter('summaries', 'summaries')
|
|
209
|
+
.withLiteralParameter('ranges', 'ranges');
|
|
210
|
+
})
|
|
211
|
+
.withQueryBuilder((qb) => {
|
|
212
|
+
qb.withVariableParameter('frames', 'frames', 'frames', true, frames => frames.map(f => f.code).join());
|
|
213
|
+
})
|
|
214
|
+
.withRequestInterceptor(requestInterceptorToUse)
|
|
215
|
+
.withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE)
|
|
216
|
+
.withResponseInterceptor(responseInterceptorForPositionSummaryDefinitionDeserialization)
|
|
217
|
+
.withErrorInterceptor(ErrorInterceptor.GENERAL)
|
|
218
|
+
.endpoint;
|
|
219
|
+
|
|
199
220
|
this._readTransactionsEndpoint = EndpointBuilder.for('read-transactions', 'read transactions')
|
|
200
221
|
.withVerb(VerbType.GET)
|
|
201
222
|
.withProtocol(protocolType)
|
|
@@ -230,7 +251,7 @@ module.exports = (() => {
|
|
|
230
251
|
.withLiteralParameter('transactions', 'transactions');
|
|
231
252
|
})
|
|
232
253
|
.withQueryBuilder((qb) => {
|
|
233
|
-
qb.withVariableParameter('type', 'type', 'type', false,
|
|
254
|
+
qb.withVariableParameter('type', 'type', 'type', false, x => x.code);
|
|
234
255
|
})
|
|
235
256
|
.withBody('transaction')
|
|
236
257
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
@@ -270,7 +291,7 @@ module.exports = (() => {
|
|
|
270
291
|
.withVariableParameter('sequence', 'sequence', 'sequence', false);
|
|
271
292
|
})
|
|
272
293
|
.withQueryBuilder((qb) => {
|
|
273
|
-
qb.withVariableParameter('type', 'type', 'type', false,
|
|
294
|
+
qb.withVariableParameter('type', 'type', 'type', false, x => x.code);
|
|
274
295
|
})
|
|
275
296
|
.withBody('transaction')
|
|
276
297
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
@@ -293,7 +314,8 @@ module.exports = (() => {
|
|
|
293
314
|
})
|
|
294
315
|
.withQueryBuilder((qb) => {
|
|
295
316
|
qb.withVariableParameter('force', 'force', 'force', false)
|
|
296
|
-
.withVariableParameter('
|
|
317
|
+
.withVariableParameter('echoStart', 'echoStart', 'echoStart', true, x => x.format())
|
|
318
|
+
.withVariableParameter('echoEnd', 'echoEnd', 'echoEnd', true, x => x.format());
|
|
297
319
|
})
|
|
298
320
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
299
321
|
.withResponseInterceptor(responseInterceptorForPositionMutateDeserialization)
|
|
@@ -319,7 +341,7 @@ module.exports = (() => {
|
|
|
319
341
|
.withVariableParameter('page', 'page', 'page', true)
|
|
320
342
|
.withVariableParameter('sequence', 'sequence', 'sequence', true)
|
|
321
343
|
.withVariableParameter('count', 'count', 'count', true)
|
|
322
|
-
.withVariableParameter('descending', 'descending', 'descending', true)
|
|
344
|
+
.withVariableParameter('descending', 'descending', 'descending', true);
|
|
323
345
|
})
|
|
324
346
|
.withRequestInterceptor(requestInterceptorToUse)
|
|
325
347
|
.withResponseInterceptor(ResponseInterceptor.DATA)
|
|
@@ -383,7 +405,7 @@ module.exports = (() => {
|
|
|
383
405
|
}
|
|
384
406
|
|
|
385
407
|
/**
|
|
386
|
-
* Creates a portfolio
|
|
408
|
+
* Creates a portfolio.
|
|
387
409
|
*
|
|
388
410
|
* @public
|
|
389
411
|
* @param {Object} portfolio
|
|
@@ -420,7 +442,7 @@ module.exports = (() => {
|
|
|
420
442
|
}
|
|
421
443
|
|
|
422
444
|
/**
|
|
423
|
-
* Updates a portfolio
|
|
445
|
+
* Updates a portfolio.
|
|
424
446
|
*
|
|
425
447
|
* @public
|
|
426
448
|
* @param {Object} portfolio
|
|
@@ -438,7 +460,7 @@ module.exports = (() => {
|
|
|
438
460
|
}
|
|
439
461
|
|
|
440
462
|
/**
|
|
441
|
-
* Deletes a portfolio
|
|
463
|
+
* Deletes a portfolio.
|
|
442
464
|
*
|
|
443
465
|
* @public
|
|
444
466
|
* @param {String} portfolio - ID of the portfolio to update
|
|
@@ -478,7 +500,7 @@ module.exports = (() => {
|
|
|
478
500
|
}
|
|
479
501
|
|
|
480
502
|
/**
|
|
481
|
-
* Updates a position
|
|
503
|
+
* Updates a position.
|
|
482
504
|
*
|
|
483
505
|
* @public
|
|
484
506
|
* @param {Object} position
|
|
@@ -605,6 +627,27 @@ module.exports = (() => {
|
|
|
605
627
|
});
|
|
606
628
|
}
|
|
607
629
|
|
|
630
|
+
/**
|
|
631
|
+
* Returns all position summary definitions for a portfolio.
|
|
632
|
+
*
|
|
633
|
+
* @public
|
|
634
|
+
* @param {String} portfolio
|
|
635
|
+
* @param {Array.<PositionSummaryFrame>} frames
|
|
636
|
+
*/
|
|
637
|
+
readPositionSummaryDefinitions(portfolio, frames) {
|
|
638
|
+
return Promise.resolve()
|
|
639
|
+
.then(() => {
|
|
640
|
+
assert.argumentIsRequired(portfolio, 'portfolio', String);
|
|
641
|
+
|
|
642
|
+
const query = { };
|
|
643
|
+
|
|
644
|
+
query.portfolio = portfolio;
|
|
645
|
+
query.frames = frames;
|
|
646
|
+
|
|
647
|
+
return Gateway.invoke(this._readPositionSummaryDefinitionEndpoint, query);
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
|
|
608
651
|
/**
|
|
609
652
|
* Deletes a position.
|
|
610
653
|
*
|
|
@@ -721,10 +764,11 @@ module.exports = (() => {
|
|
|
721
764
|
* @param {String} position
|
|
722
765
|
* @param {Number} sequence
|
|
723
766
|
* @param {Boolean=} force
|
|
724
|
-
* @param {
|
|
767
|
+
* @param {Day=} echoStart
|
|
768
|
+
* @param {Day=} echoEnd
|
|
725
769
|
* @returns {Promise.<TransactionMutateResult>}
|
|
726
770
|
*/
|
|
727
|
-
deleteTransaction(portfolio, position, sequence, force,
|
|
771
|
+
deleteTransaction(portfolio, position, sequence, force, echoStart, echoEnd) {
|
|
728
772
|
return Promise.resolve()
|
|
729
773
|
.then(() => {
|
|
730
774
|
checkStart.call(this);
|
|
@@ -733,9 +777,25 @@ module.exports = (() => {
|
|
|
733
777
|
assert.argumentIsRequired(position, 'position', String);
|
|
734
778
|
assert.argumentIsRequired(sequence, 'sequence', Number);
|
|
735
779
|
assert.argumentIsOptional(force, 'force', Boolean);
|
|
736
|
-
assert.argumentIsOptional(
|
|
780
|
+
assert.argumentIsOptional(echoStart, 'echoStart', Day, 'Day');
|
|
781
|
+
assert.argumentIsOptional(echoEnd, 'echoEnd', Day, 'Day');
|
|
782
|
+
|
|
783
|
+
let payload = { };
|
|
784
|
+
|
|
785
|
+
payload.portfolio = portfolio;
|
|
786
|
+
payload.position = position;
|
|
787
|
+
payload.sequence = sequence;
|
|
788
|
+
payload.force = is.boolean(force) && force;
|
|
737
789
|
|
|
738
|
-
|
|
790
|
+
if (echoStart) {
|
|
791
|
+
payload.echoStart = echoStart;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
if (echoEnd) {
|
|
795
|
+
payload.echoEnd = echoEnd;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
return Gateway.invoke(this._deleteTransactionEndpoint, payload);
|
|
739
799
|
});
|
|
740
800
|
}
|
|
741
801
|
|
|
@@ -768,9 +828,10 @@ module.exports = (() => {
|
|
|
768
828
|
* @param {String=} position
|
|
769
829
|
* @param {Day=} startDay
|
|
770
830
|
* @param {Day=} endDay
|
|
831
|
+
* @oaram {Boolean=} descending
|
|
771
832
|
* @returns {Promise.<Object[]>}
|
|
772
833
|
*/
|
|
773
|
-
readTransactionsFormatted(portfolio, position, startDay, endDay) {
|
|
834
|
+
readTransactionsFormatted(portfolio, position, startDay, endDay, descending) {
|
|
774
835
|
return Promise.resolve()
|
|
775
836
|
.then(() => {
|
|
776
837
|
checkStart.call(this);
|
|
@@ -779,6 +840,7 @@ module.exports = (() => {
|
|
|
779
840
|
assert.argumentIsOptional(position, 'position', String);
|
|
780
841
|
assert.argumentIsOptional(startDay, 'startDay', Day, 'Day');
|
|
781
842
|
assert.argumentIsOptional(endDay, 'endDay', Day, 'Day');
|
|
843
|
+
assert.argumentIsOptional(descending, 'descending', Boolean);
|
|
782
844
|
|
|
783
845
|
const payload = { };
|
|
784
846
|
|
|
@@ -793,6 +855,8 @@ module.exports = (() => {
|
|
|
793
855
|
payload.end = endDay;
|
|
794
856
|
}
|
|
795
857
|
|
|
858
|
+
payload.descending = is.boolean(descending) && descending;
|
|
859
|
+
|
|
796
860
|
return Gateway.invoke(this._readTransactionsReportEndpoint, payload);
|
|
797
861
|
});
|
|
798
862
|
}
|
|
@@ -983,6 +1047,14 @@ module.exports = (() => {
|
|
|
983
1047
|
}
|
|
984
1048
|
});
|
|
985
1049
|
|
|
1050
|
+
const responseInterceptorForPositionSummaryDefinitionDeserialization = ResponseInterceptor.fromDelegate((response, ignored) => {
|
|
1051
|
+
try {
|
|
1052
|
+
return JSON.parse(response.data, PositionSummaryDefinitionSchema.CLIENT.schema.getReviver());
|
|
1053
|
+
} catch (e) {
|
|
1054
|
+
console.log('Error deserializing position summary definition', e);
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
|
|
986
1058
|
const responseInterceptorForTransactionDeserialization = ResponseInterceptor.fromDelegate((response, ignored) => {
|
|
987
1059
|
try {
|
|
988
1060
|
return JSON.parse(response.data, TransactionSchema.CLIENT.schema.getReviver());
|
package/lib/index.js
CHANGED