@como/como-client 0.8.4 → 0.8.6
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 +36 -0
- package/lib/services/auth.service.js +2 -2
- package/package.json +1 -1
- package/src/como.js +10 -0
package/lib/como.js
CHANGED
|
@@ -2483,6 +2483,42 @@ var Como = function () {
|
|
|
2483
2483
|
|
|
2484
2484
|
return api.getAllTranslations(locationId);
|
|
2485
2485
|
}
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* Generate a temporary token for the location
|
|
2489
|
+
* @param {number} timeToLive time to live in seconds
|
|
2490
|
+
* @returns {string} temporary token
|
|
2491
|
+
*/
|
|
2492
|
+
|
|
2493
|
+
}, {
|
|
2494
|
+
key: 'generateTemporaryToken',
|
|
2495
|
+
value: function () {
|
|
2496
|
+
var _ref46 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee45() {
|
|
2497
|
+
var timeToLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
|
|
2498
|
+
|
|
2499
|
+
var _comoData45, api, locationId, env;
|
|
2500
|
+
|
|
2501
|
+
return _regenerator2.default.wrap(function _callee45$(_context45) {
|
|
2502
|
+
while (1) {
|
|
2503
|
+
switch (_context45.prev = _context45.next) {
|
|
2504
|
+
case 0:
|
|
2505
|
+
_comoData45 = this.comoData, api = _comoData45.api, locationId = _comoData45.locationId, env = _comoData45.env_params;
|
|
2506
|
+
return _context45.abrupt('return', api.generateTemporaryToken(env.services_root, locationId, timeToLive));
|
|
2507
|
+
|
|
2508
|
+
case 2:
|
|
2509
|
+
case 'end':
|
|
2510
|
+
return _context45.stop();
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
}, _callee45, this);
|
|
2514
|
+
}));
|
|
2515
|
+
|
|
2516
|
+
function generateTemporaryToken() {
|
|
2517
|
+
return _ref46.apply(this, arguments);
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
return generateTemporaryToken;
|
|
2521
|
+
}()
|
|
2486
2522
|
}]);
|
|
2487
2523
|
return Como;
|
|
2488
2524
|
}();
|
|
@@ -279,7 +279,7 @@ exports.logIn = function (service) {
|
|
|
279
279
|
};
|
|
280
280
|
headers = getHashHeader(params);
|
|
281
281
|
_context8.next = 4;
|
|
282
|
-
return service.post('/auth/
|
|
282
|
+
return service.post('/auth/v4/auth/logIn', params, { headers: headers });
|
|
283
283
|
|
|
284
284
|
case 4:
|
|
285
285
|
_ref16 = _context8.sent;
|
|
@@ -319,7 +319,7 @@ exports.logInVerify = function (service) {
|
|
|
319
319
|
};
|
|
320
320
|
headers = getHashHeader(params);
|
|
321
321
|
_context9.next = 4;
|
|
322
|
-
return service.post('/auth/
|
|
322
|
+
return service.post('/auth/v4/auth/logInVerify', params, { headers: headers });
|
|
323
323
|
|
|
324
324
|
case 4:
|
|
325
325
|
_ref18 = _context9.sent;
|
package/package.json
CHANGED
package/src/como.js
CHANGED
|
@@ -1033,6 +1033,16 @@ class Como {
|
|
|
1033
1033
|
const { api, locationId } = this.comoData;
|
|
1034
1034
|
return api.getAllTranslations(locationId);
|
|
1035
1035
|
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Generate a temporary token for the location
|
|
1039
|
+
* @param {number} timeToLive time to live in seconds
|
|
1040
|
+
* @returns {string} temporary token
|
|
1041
|
+
*/
|
|
1042
|
+
async generateTemporaryToken(timeToLive = 60) {
|
|
1043
|
+
const { api, locationId, env_params: env } = this.comoData;
|
|
1044
|
+
return api.generateTemporaryToken(env.services_root, locationId, timeToLive);
|
|
1045
|
+
}
|
|
1036
1046
|
}
|
|
1037
1047
|
|
|
1038
1048
|
module.exports = Como;
|