@como/como-client 0.7.82 → 0.7.83
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 +2 -42
- package/lib/utils/comoExternalUrlTranslator.js +1 -1
- package/package.json +1 -1
- package/src/como.js +2 -12
package/lib/como.js
CHANGED
|
@@ -408,8 +408,8 @@ var Como = function () {
|
|
|
408
408
|
case 11:
|
|
409
409
|
translatedData = _context3.sent;
|
|
410
410
|
|
|
411
|
-
if (translatedData.tempTokenData.
|
|
412
|
-
this.comoData.tempTokenData[translatedData.tempTokenData.
|
|
411
|
+
if (translatedData.tempTokenData.temporaryToken) {
|
|
412
|
+
this.comoData.tempTokenData[translatedData.tempTokenData.temporaryToken] = translatedData.tempTokenData.expirationDate;
|
|
413
413
|
}
|
|
414
414
|
return _context3.abrupt('return', translatedData);
|
|
415
415
|
|
|
@@ -2384,46 +2384,6 @@ var Como = function () {
|
|
|
2384
2384
|
|
|
2385
2385
|
return api.getAllTranslations(locationId);
|
|
2386
2386
|
}
|
|
2387
|
-
|
|
2388
|
-
/**
|
|
2389
|
-
* generate temporary token
|
|
2390
|
-
* @param {Number} timeToLive - The time in seconds till the expiration
|
|
2391
|
-
*/
|
|
2392
|
-
|
|
2393
|
-
}, {
|
|
2394
|
-
key: 'generateTemporaryTokenWithExpiryDate',
|
|
2395
|
-
value: function () {
|
|
2396
|
-
var _ref44 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee43(timeToLive) {
|
|
2397
|
-
var _comoData45, api, locationId, token, env_params, _ref45, ExpirationDate, TemporaryToken;
|
|
2398
|
-
|
|
2399
|
-
return _regenerator2.default.wrap(function _callee43$(_context43) {
|
|
2400
|
-
while (1) {
|
|
2401
|
-
switch (_context43.prev = _context43.next) {
|
|
2402
|
-
case 0:
|
|
2403
|
-
_comoData45 = this.comoData, api = _comoData45.api, locationId = _comoData45.locationId, token = _comoData45.token, env_params = _comoData45.env_params;
|
|
2404
|
-
_context43.next = 3;
|
|
2405
|
-
return api.generateTemporaryToken(env_params.services_root, locationId, token, timeToLive);
|
|
2406
|
-
|
|
2407
|
-
case 3:
|
|
2408
|
-
_ref45 = _context43.sent;
|
|
2409
|
-
ExpirationDate = _ref45.ExpirationDate;
|
|
2410
|
-
TemporaryToken = _ref45.TemporaryToken;
|
|
2411
|
-
return _context43.abrupt('return', { ExpirationDate: ExpirationDate, TemporaryToken: TemporaryToken });
|
|
2412
|
-
|
|
2413
|
-
case 7:
|
|
2414
|
-
case 'end':
|
|
2415
|
-
return _context43.stop();
|
|
2416
|
-
}
|
|
2417
|
-
}
|
|
2418
|
-
}, _callee43, this);
|
|
2419
|
-
}));
|
|
2420
|
-
|
|
2421
|
-
function generateTemporaryTokenWithExpiryDate(_x69) {
|
|
2422
|
-
return _ref44.apply(this, arguments);
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
return generateTemporaryTokenWithExpiryDate;
|
|
2426
|
-
}()
|
|
2427
2387
|
}]);
|
|
2428
2388
|
return Como;
|
|
2429
2389
|
}();
|
|
@@ -134,7 +134,7 @@ var translateElements = function () {
|
|
|
134
134
|
tempToken = _context2.sent;
|
|
135
135
|
|
|
136
136
|
item.replaceWith = tempToken && tempToken.TemporaryToken || '';
|
|
137
|
-
tempTokenData = tempToken;
|
|
137
|
+
tempTokenData = { temporaryToken: tempToken.TemporaryToken, expirationDate: tempToken.ExpirationDate };
|
|
138
138
|
return _context2.abrupt('break', 53);
|
|
139
139
|
|
|
140
140
|
case 17:
|
package/package.json
CHANGED
package/src/como.js
CHANGED
|
@@ -202,8 +202,8 @@ class Como {
|
|
|
202
202
|
locationId, token, membership, locationData, assets, gpsData, assetID, accessibilityData,
|
|
203
203
|
};
|
|
204
204
|
const translatedData = await comoExternalUrlTranslator.translateUrl(externalUrl, apiObjects, dataToUse);
|
|
205
|
-
if (translatedData.tempTokenData.
|
|
206
|
-
this.comoData.tempTokenData[translatedData.tempTokenData.
|
|
205
|
+
if (translatedData.tempTokenData.temporaryToken) {
|
|
206
|
+
this.comoData.tempTokenData[translatedData.tempTokenData.temporaryToken] = translatedData.tempTokenData.expirationDate;
|
|
207
207
|
}
|
|
208
208
|
return translatedData;
|
|
209
209
|
}
|
|
@@ -991,16 +991,6 @@ class Como {
|
|
|
991
991
|
const { api, locationId } = this.comoData;
|
|
992
992
|
return api.getAllTranslations(locationId);
|
|
993
993
|
}
|
|
994
|
-
|
|
995
|
-
/**
|
|
996
|
-
* generate temporary token
|
|
997
|
-
* @param {Number} timeToLive - The time in seconds till the expiration
|
|
998
|
-
*/
|
|
999
|
-
async generateTemporaryTokenWithExpiryDate(timeToLive) {
|
|
1000
|
-
const { api, locationId, token, env_params } = this.comoData;
|
|
1001
|
-
const { ExpirationDate, TemporaryToken } = await api.generateTemporaryToken(env_params.services_root, locationId, token, timeToLive);
|
|
1002
|
-
return { ExpirationDate, TemporaryToken };
|
|
1003
|
-
}
|
|
1004
994
|
}
|
|
1005
995
|
|
|
1006
996
|
module.exports = Como;
|