@barchart/portfolio-client-js 1.2.41 → 1.2.44

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.
@@ -64,7 +64,7 @@ module.exports = function () {
64
64
  }], [{
65
65
  key: 'developmentHost',
66
66
  get: function get() {
67
- return 'ldnddf3nsh.execute-api.us-east-1.amazonaws.com/dev';
67
+ return 'portfolio-dev.aws.barchart.com/dev';
68
68
  }
69
69
 
70
70
  /**
@@ -78,7 +78,7 @@ module.exports = function () {
78
78
  }, {
79
79
  key: 'stagingHost',
80
80
  get: function get() {
81
- return '24ok2r76k6.execute-api.us-east-1.amazonaws.com/stage';
81
+ return 'portfolio-stage.aws.barchart.com/stage';
82
82
  }
83
83
 
84
84
  /**
@@ -92,7 +92,7 @@ module.exports = function () {
92
92
  }, {
93
93
  key: 'productionHost',
94
94
  get: function get() {
95
- return 'o77obtxxr4.execute-api.us-east-1.amazonaws.com/prod';
95
+ return 'portfolio.aws.barchart.com/prod';
96
96
  }
97
97
 
98
98
  /**
@@ -106,7 +106,7 @@ module.exports = function () {
106
106
  }, {
107
107
  key: 'adminHost',
108
108
  get: function get() {
109
- return '38moiq7ek9.execute-api.us-east-1.amazonaws.com/admin';
109
+ return 'portfolio-admin.aws.barchart.com/admin';
110
110
  }
111
111
  }]);
112
112
 
@@ -1046,7 +1046,7 @@ module.exports = function () {
1046
1046
  return Promise.resolve(requestInterceptor).then(function (requestInterceptor) {
1047
1047
  assert.argumentIsOptional(requestInterceptor, 'requestInterceptor', RequestInterceptor, 'RequestInterceptor');
1048
1048
 
1049
- return start(new PortfolioGateway('https', Configuration.adminHost, 443, requestInterceptor));
1049
+ return start(new PortfolioGateway('https', Configuration.adminHost, 443, 'admin', requestInterceptor));
1050
1050
  });
1051
1051
  }
1052
1052
  }]);
@@ -1571,10 +1571,18 @@ module.exports = function () {
1571
1571
  }
1572
1572
 
1573
1573
  function _forAdmin(userId, legacyUserId) {
1574
- return EndpointBuilder.for('read-jwt-token-for-development', 'lookup user identity').withVerb(VerbType.GET).withProtocol(ProtocolType.HTTPS).withHost(Configuration.adminHost).withPathBuilder(function (pb) {
1574
+ return EndpointBuilder.for('read-jwt-token-for-admin', 'lookup user identity').withVerb(VerbType.GET).withProtocol(ProtocolType.HTTPS).withHost(Configuration.adminHost).withPathBuilder(function (pb) {
1575
1575
  pb.withLiteralParameter('token', 'token').withLiteralParameter('barchart', 'barchart').withLiteralParameter('generator', 'generator');
1576
1576
  }).withQueryBuilder(function (qb) {
1577
- qb.withLiteralParameter('user', 'userId', userId).withLiteralParameter('legacy user', 'userLegacyId', legacyUserId).withLiteralParameter('user context', 'userContext', 'TGAM').withLiteralParameter('user permission level', 'userPermissions', 'registered');
1577
+ if (userId) {
1578
+ qb.withLiteralParameter('user', 'userId', userId);
1579
+ }
1580
+
1581
+ if (legacyUserId) {
1582
+ qb.withLiteralParameter('legacy user', 'userLegacyId', legacyUserId);
1583
+ }
1584
+
1585
+ qb.withLiteralParameter('user context', 'userContext', 'TGAM').withLiteralParameter('user permission level', 'userPermissions', 'registered');
1578
1586
  }).withResponseInterceptor(ResponseInterceptor.DATA).endpoint;
1579
1587
  }
1580
1588
 
@@ -1593,7 +1601,7 @@ module.exports = function () {
1593
1601
  return {
1594
1602
  JwtGateway: JwtGateway,
1595
1603
  PortfolioGateway: PortfolioGateway,
1596
- version: '1.2.41'
1604
+ version: '1.2.44'
1597
1605
  };
1598
1606
  }();
1599
1607
 
@@ -19,7 +19,7 @@ module.exports = (() => {
19
19
  * @returns {String}
20
20
  */
21
21
  static get developmentHost() {
22
- return 'ldnddf3nsh.execute-api.us-east-1.amazonaws.com/dev';
22
+ return 'portfolio-dev.aws.barchart.com/dev';
23
23
  }
24
24
 
25
25
  /**
@@ -30,7 +30,7 @@ module.exports = (() => {
30
30
  * @returns {String}
31
31
  */
32
32
  static get stagingHost() {
33
- return '24ok2r76k6.execute-api.us-east-1.amazonaws.com/stage';
33
+ return 'portfolio-stage.aws.barchart.com/stage';
34
34
  }
35
35
 
36
36
  /**
@@ -41,7 +41,7 @@ module.exports = (() => {
41
41
  * @returns {String}
42
42
  */
43
43
  static get productionHost() {
44
- return 'o77obtxxr4.execute-api.us-east-1.amazonaws.com/prod';
44
+ return 'portfolio.aws.barchart.com/prod';
45
45
  }
46
46
 
47
47
  /**
@@ -52,7 +52,7 @@ module.exports = (() => {
52
52
  * @return {String}
53
53
  */
54
54
  static get adminHost() {
55
- return '38moiq7ek9.execute-api.us-east-1.amazonaws.com/admin';
55
+ return 'portfolio-admin.aws.barchart.com/admin';
56
56
  }
57
57
 
58
58
  toString() {
@@ -1010,7 +1010,7 @@ module.exports = (() => {
1010
1010
  .then((requestInterceptor) => {
1011
1011
  assert.argumentIsOptional(requestInterceptor, 'requestInterceptor', RequestInterceptor, 'RequestInterceptor');
1012
1012
 
1013
- return start(new PortfolioGateway('https', Configuration.adminHost, 443, requestInterceptor));
1013
+ return start(new PortfolioGateway('https', Configuration.adminHost, 443, 'admin', requestInterceptor));
1014
1014
  });
1015
1015
  }
1016
1016
 
@@ -335,20 +335,26 @@ module.exports = (() => {
335
335
  }
336
336
 
337
337
  function forAdmin(userId, legacyUserId) {
338
- return EndpointBuilder.for('read-jwt-token-for-development', 'lookup user identity')
338
+ return EndpointBuilder.for('read-jwt-token-for-admin', 'lookup user identity')
339
339
  .withVerb(VerbType.GET)
340
340
  .withProtocol(ProtocolType.HTTPS)
341
341
  .withHost(Configuration.adminHost)
342
342
  .withPathBuilder((pb) => {
343
343
  pb.withLiteralParameter('token', 'token')
344
- .withLiteralParameter('barchart', 'barchart')
345
- .withLiteralParameter('generator', 'generator');
344
+ .withLiteralParameter('barchart', 'barchart')
345
+ .withLiteralParameter('generator', 'generator');
346
346
  })
347
347
  .withQueryBuilder((qb) => {
348
- qb.withLiteralParameter('user', 'userId', userId)
349
- .withLiteralParameter('legacy user', 'userLegacyId', legacyUserId)
350
- .withLiteralParameter('user context', 'userContext', 'TGAM')
351
- .withLiteralParameter('user permission level', 'userPermissions', 'registered');
348
+ if (userId) {
349
+ qb.withLiteralParameter('user', 'userId', userId);
350
+ }
351
+
352
+ if (legacyUserId) {
353
+ qb.withLiteralParameter('legacy user', 'userLegacyId', legacyUserId);
354
+ }
355
+
356
+ qb.withLiteralParameter('user context', 'userContext', 'TGAM')
357
+ .withLiteralParameter('user permission level', 'userPermissions', 'registered');
352
358
  })
353
359
  .withResponseInterceptor(ResponseInterceptor.DATA)
354
360
  .endpoint;
package/lib/index.js CHANGED
@@ -7,6 +7,6 @@ module.exports = (() => {
7
7
  return {
8
8
  JwtGateway: JwtGateway,
9
9
  PortfolioGateway: PortfolioGateway,
10
- version: '1.2.41'
10
+ version: '1.2.44'
11
11
  };
12
12
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-client-js",
3
- "version": "1.2.41",
3
+ "version": "1.2.44",
4
4
  "description": "JavaScript library for interfacing with Barchart's Portfolio API",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",