@barchart/portfolio-client-js 3.4.0 → 3.4.1

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.
@@ -0,0 +1,3 @@
1
+ **Bug Fix**
2
+
3
+ * Fixed ```PortfolioGateway.readMarketValue``` function.
@@ -425,18 +425,19 @@ module.exports = (() => {
425
425
  .endpoint;
426
426
 
427
427
  this._readMarketValueEndpoint = EndpointBuilder.for('read-market-value', 'read market value')
428
- .withVerb(VerbType.POST)
428
+ .withVerb(VerbType.GET)
429
429
  .withProtocol(protocolType)
430
430
  .withHost(host)
431
431
  .withPort(port)
432
432
  .withPathBuilder((pb) => {
433
- pb.withLiteralParameter('version', 'v1');
433
+ pb.withLiteralParameter('version', 'v1')
434
+ .withLiteralParameter('values', 'values');
434
435
  })
435
436
  .withQueryBuilder((qb) => {
436
- qb.withVariableParameter('symbol', 'symbol', 'symbol', false, x => x.symbol);
437
+ qb.withVariableParameter('symbol', 'symbol', 'symbol', false);
437
438
  })
438
439
  .withRequestInterceptor(requestInterceptor)
439
- .withResponseInterceptor(responseInterceptorForMarketValues)
440
+ .withResponseInterceptor(ResponseInterceptor.DATA)
440
441
  .withErrorInterceptor(ErrorInterceptor.GENERAL)
441
442
  .endpoint;
442
443
 
@@ -1463,14 +1464,6 @@ module.exports = (() => {
1463
1464
  }
1464
1465
  });
1465
1466
 
1466
- const responseInterceptorForMarketValues = ResponseInterceptor.fromDelegate((response, ignored) => {
1467
- try {
1468
- return JSON.parse(response.data);
1469
- } catch (e) {
1470
- console.error('Error deserializing data', e);
1471
- }
1472
- });
1473
-
1474
1467
  function start(gateway, jwtProvider) {
1475
1468
  return gateway.connect(jwtProvider)
1476
1469
  .then(() => {
package/lib/index.js CHANGED
@@ -7,6 +7,6 @@ module.exports = (() => {
7
7
  return {
8
8
  JwtProvider: JwtProvider,
9
9
  PortfolioGateway: PortfolioGateway,
10
- version: '3.4.0'
10
+ version: '3.4.1'
11
11
  };
12
12
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-client-js",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "JavaScript library for interfacing with Barchart's Portfolio API",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",