@como/como-client 0.7.79 → 0.7.80
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 +40 -0
- package/package.json +1 -1
- package/src/como.js +11 -1
package/lib/como.js
CHANGED
|
@@ -2374,6 +2374,46 @@ var Como = function () {
|
|
|
2374
2374
|
|
|
2375
2375
|
return api.getAllTranslations(locationId);
|
|
2376
2376
|
}
|
|
2377
|
+
|
|
2378
|
+
/**
|
|
2379
|
+
* generate temporary token
|
|
2380
|
+
* @param {Number} timeToLive - The time in seconds till the expiration
|
|
2381
|
+
*/
|
|
2382
|
+
|
|
2383
|
+
}, {
|
|
2384
|
+
key: 'generateTemporaryTokenWithExpiryDate',
|
|
2385
|
+
value: function () {
|
|
2386
|
+
var _ref44 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee43(timeToLive) {
|
|
2387
|
+
var _comoData45, api, locationId, token, env_params, _ref45, ExpirationDate, TemporaryToken;
|
|
2388
|
+
|
|
2389
|
+
return _regenerator2.default.wrap(function _callee43$(_context43) {
|
|
2390
|
+
while (1) {
|
|
2391
|
+
switch (_context43.prev = _context43.next) {
|
|
2392
|
+
case 0:
|
|
2393
|
+
_comoData45 = this.comoData, api = _comoData45.api, locationId = _comoData45.locationId, token = _comoData45.token, env_params = _comoData45.env_params;
|
|
2394
|
+
_context43.next = 3;
|
|
2395
|
+
return api.generateTemporaryToken(env_params.services_root, locationId, token, timeToLive);
|
|
2396
|
+
|
|
2397
|
+
case 3:
|
|
2398
|
+
_ref45 = _context43.sent;
|
|
2399
|
+
ExpirationDate = _ref45.ExpirationDate;
|
|
2400
|
+
TemporaryToken = _ref45.TemporaryToken;
|
|
2401
|
+
return _context43.abrupt('return', { ExpirationDate: ExpirationDate, TemporaryToken: TemporaryToken });
|
|
2402
|
+
|
|
2403
|
+
case 7:
|
|
2404
|
+
case 'end':
|
|
2405
|
+
return _context43.stop();
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
}, _callee43, this);
|
|
2409
|
+
}));
|
|
2410
|
+
|
|
2411
|
+
function generateTemporaryTokenWithExpiryDate(_x69) {
|
|
2412
|
+
return _ref44.apply(this, arguments);
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
return generateTemporaryTokenWithExpiryDate;
|
|
2416
|
+
}()
|
|
2377
2417
|
}]);
|
|
2378
2418
|
return Como;
|
|
2379
2419
|
}();
|
package/package.json
CHANGED
package/src/como.js
CHANGED
|
@@ -982,10 +982,20 @@ class Como {
|
|
|
982
982
|
/**
|
|
983
983
|
* Get app texts for multi languages - only for apps that has project set in translation service
|
|
984
984
|
*/
|
|
985
|
-
|
|
985
|
+
getAppTextsV2() {
|
|
986
986
|
const { api, locationId } = this.comoData;
|
|
987
987
|
return api.getAllTranslations(locationId);
|
|
988
988
|
}
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* generate temporary token
|
|
992
|
+
* @param {Number} timeToLive - The time in seconds till the expiration
|
|
993
|
+
*/
|
|
994
|
+
async generateTemporaryTokenWithExpiryDate(timeToLive) {
|
|
995
|
+
const { api, locationId, token, env_params } = this.comoData;
|
|
996
|
+
const { ExpirationDate, TemporaryToken } = await api.generateTemporaryToken(env_params.services_root, locationId, token, timeToLive);
|
|
997
|
+
return { ExpirationDate, TemporaryToken };
|
|
998
|
+
}
|
|
989
999
|
}
|
|
990
1000
|
|
|
991
1001
|
module.exports = Como;
|