@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.
package/example/example.js
CHANGED
|
@@ -64,7 +64,7 @@ module.exports = function () {
|
|
|
64
64
|
}], [{
|
|
65
65
|
key: 'developmentHost',
|
|
66
66
|
get: function get() {
|
|
67
|
-
return '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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-
|
|
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
|
-
|
|
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.
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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-
|
|
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
|
-
|
|
345
|
-
|
|
344
|
+
.withLiteralParameter('barchart', 'barchart')
|
|
345
|
+
.withLiteralParameter('generator', 'generator');
|
|
346
346
|
})
|
|
347
347
|
.withQueryBuilder((qb) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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