@como/como-client 0.7.73 → 0.7.75
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/lib/como.js +19 -7
- package/lib/config/env.js +16 -16
- package/package.json +1 -1
- package/src/como.js +22 -15
package/lib/como.js
CHANGED
|
@@ -358,7 +358,9 @@ var Como = function () {
|
|
|
358
358
|
this.comoData.token = credentials.accessToken;
|
|
359
359
|
this.comoData.refreshToken = credentials.refreshToken;
|
|
360
360
|
this.comoData.expiresIn = credentials.expiresIn;
|
|
361
|
-
|
|
361
|
+
if (credentials.config) {
|
|
362
|
+
this.comoData.reCaptchaSiteKey = credentials.config.recaptchaSiteKey;
|
|
363
|
+
}
|
|
362
364
|
}
|
|
363
365
|
}, {
|
|
364
366
|
key: 'getExternalUrlByID',
|
|
@@ -987,33 +989,43 @@ var Como = function () {
|
|
|
987
989
|
while (1) {
|
|
988
990
|
switch (_context15.prev = _context15.next) {
|
|
989
991
|
case 0:
|
|
992
|
+
_context15.prev = 0;
|
|
990
993
|
resource = this.comoData.mainResourcesMap[resourceId];
|
|
991
994
|
|
|
992
995
|
if (resource) {
|
|
993
|
-
_context15.next =
|
|
996
|
+
_context15.next = 5;
|
|
994
997
|
break;
|
|
995
998
|
}
|
|
996
999
|
|
|
997
1000
|
err = 'resource ' + resourceId + ' not found!';
|
|
998
1001
|
throw new Error(err);
|
|
999
1002
|
|
|
1000
|
-
case
|
|
1003
|
+
case 5:
|
|
1001
1004
|
_comoData8 = this.comoData, env = _comoData8.env_params, api = _comoData8.api;
|
|
1002
|
-
_context15.next =
|
|
1005
|
+
_context15.next = 8;
|
|
1003
1006
|
return api.getLoyaltyResource(env.services_root_cdn, resource.id, 'Namespace' in resource ? resource.Namespace : 'location_' + this.comoData.locationId, resource.Version);
|
|
1004
1007
|
|
|
1005
|
-
case
|
|
1008
|
+
case 8:
|
|
1006
1009
|
responseJson = _context15.sent;
|
|
1007
1010
|
|
|
1008
1011
|
|
|
1009
1012
|
this.comoData.mainResources[resourceId] = responseJson;
|
|
1013
|
+
_context15.next = 16;
|
|
1014
|
+
break;
|
|
1010
1015
|
|
|
1011
|
-
case
|
|
1016
|
+
case 12:
|
|
1017
|
+
_context15.prev = 12;
|
|
1018
|
+
_context15.t0 = _context15['catch'](0);
|
|
1019
|
+
|
|
1020
|
+
console.log('downloadMainResource failed, resourceId:' + resourceId + ', locationId:' + locationId + ', this.comoData.mainResourcesMap: ' + this.comoData.mainResourcesMap + ', error: ' + _context15.t0);
|
|
1021
|
+
throw new Error(_context15.t0);
|
|
1022
|
+
|
|
1023
|
+
case 16:
|
|
1012
1024
|
case 'end':
|
|
1013
1025
|
return _context15.stop();
|
|
1014
1026
|
}
|
|
1015
1027
|
}
|
|
1016
|
-
}, _callee15, this);
|
|
1028
|
+
}, _callee15, this, [[0, 12]]);
|
|
1017
1029
|
}));
|
|
1018
1030
|
|
|
1019
1031
|
function downloadMainResource(_x39) {
|
package/lib/config/env.js
CHANGED
|
@@ -2,35 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
hotfix: {
|
|
5
|
-
gateway: 'https://
|
|
5
|
+
gateway: 'https://app.qa.comosense.com',
|
|
6
6
|
zapp_root: 'loyalty-zapp',
|
|
7
7
|
services_root: 'loyalty-services',
|
|
8
|
-
services_root_cdn: 'https://
|
|
9
|
-
app_modules_root: 'https://
|
|
10
|
-
app_modules_legacy_root: 'https://appmodules
|
|
8
|
+
services_root_cdn: 'https://services.qa.bcomo.com',
|
|
9
|
+
app_modules_root: 'https://app.qa.comosense.com/app-modules',
|
|
10
|
+
app_modules_legacy_root: 'https://appmodules.qa.comosense.com'
|
|
11
11
|
},
|
|
12
12
|
qa: {
|
|
13
|
-
gateway: 'https://
|
|
13
|
+
gateway: 'https://app.qa.comosense.com',
|
|
14
14
|
zapp_root: 'loyalty-zapp',
|
|
15
15
|
services_root: 'loyalty-services',
|
|
16
|
-
services_root_cdn: 'https://
|
|
17
|
-
app_modules_root: 'https://
|
|
18
|
-
app_modules_legacy_root: 'https://appmodules
|
|
16
|
+
services_root_cdn: 'https://services.qa.bcomo.com',
|
|
17
|
+
app_modules_root: 'https://app.qa.comosense.com/app-modules',
|
|
18
|
+
app_modules_legacy_root: 'https://appmodules.qa.comosense.com'
|
|
19
19
|
},
|
|
20
20
|
prod: {
|
|
21
|
-
gateway: 'https://
|
|
21
|
+
gateway: 'https://app.comosense.com',
|
|
22
22
|
zapp_root: 'loyalty-zapp',
|
|
23
23
|
services_root: 'loyalty-services',
|
|
24
|
-
services_root_cdn: 'https://
|
|
25
|
-
app_modules_root: 'https://
|
|
26
|
-
app_modules_legacy_root: 'https://appmodules
|
|
24
|
+
services_root_cdn: 'https://services.prod.bcomo.com',
|
|
25
|
+
app_modules_root: 'https://app.comosense.com/app-modules',
|
|
26
|
+
app_modules_legacy_root: 'https://appmodules.comosense.com'
|
|
27
27
|
},
|
|
28
28
|
test: {
|
|
29
|
-
gateway: 'https://
|
|
29
|
+
gateway: 'https://app.qa.comosense.com',
|
|
30
30
|
zapp_root: 'loyalty-zapp',
|
|
31
31
|
services_root: 'loyalty-services',
|
|
32
|
-
services_root_cdn: 'https://
|
|
33
|
-
app_modules_root: 'https://
|
|
34
|
-
app_modules_legacy_root: 'https://appmodules
|
|
32
|
+
services_root_cdn: 'https://services.qa.bcomo.com',
|
|
33
|
+
app_modules_root: 'https://app.qa.comosense.com/app-modules',
|
|
34
|
+
app_modules_legacy_root: 'https://appmodules.qa.comosense.com'
|
|
35
35
|
}
|
|
36
36
|
};
|
package/package.json
CHANGED
package/src/como.js
CHANGED
|
@@ -171,7 +171,9 @@ class Como {
|
|
|
171
171
|
this.comoData.token = credentials.accessToken;
|
|
172
172
|
this.comoData.refreshToken = credentials.refreshToken;
|
|
173
173
|
this.comoData.expiresIn = credentials.expiresIn;
|
|
174
|
-
|
|
174
|
+
if(credentials.config){
|
|
175
|
+
this.comoData.reCaptchaSiteKey = credentials.config.recaptchaSiteKey;
|
|
176
|
+
}
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
getExternalUrlByID(itemID, gpsData, assetID, accessibilityData) {
|
|
@@ -407,21 +409,26 @@ class Como {
|
|
|
407
409
|
*/
|
|
408
410
|
|
|
409
411
|
async downloadMainResource(resourceId) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
try{
|
|
413
|
+
const resource = this.comoData.mainResourcesMap[resourceId];
|
|
414
|
+
if (!resource) {
|
|
415
|
+
const err = `resource ${resourceId} not found!`;
|
|
416
|
+
throw new Error(err);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const { env_params: env, api } = this.comoData;
|
|
420
|
+
const responseJson = await api.getLoyaltyResource(
|
|
421
|
+
env.services_root_cdn,
|
|
422
|
+
resource.id,
|
|
423
|
+
('Namespace' in resource) ? resource.Namespace : `location_${this.comoData.locationId}`,
|
|
424
|
+
resource.Version,
|
|
425
|
+
);
|
|
426
|
+
|
|
427
|
+
this.comoData.mainResources[resourceId] = responseJson;
|
|
428
|
+
}catch(e){
|
|
429
|
+
console.log(`downloadMainResource failed, resourceId:${resourceId}, locationId:${locationId}, this.comoData.mainResourcesMap: ${this.comoData.mainResourcesMap}, error: ${e}`);
|
|
430
|
+
throw new Error(e);
|
|
414
431
|
}
|
|
415
|
-
|
|
416
|
-
const { env_params: env, api } = this.comoData;
|
|
417
|
-
const responseJson = await api.getLoyaltyResource(
|
|
418
|
-
env.services_root_cdn,
|
|
419
|
-
resource.id,
|
|
420
|
-
('Namespace' in resource) ? resource.Namespace : `location_${this.comoData.locationId}`,
|
|
421
|
-
resource.Version,
|
|
422
|
-
);
|
|
423
|
-
|
|
424
|
-
this.comoData.mainResources[resourceId] = responseJson;
|
|
425
432
|
}
|
|
426
433
|
|
|
427
434
|
|