@vendit-dev/thirdparty-adapters 0.4.1-beta.6 → 0.4.1-beta.8
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.
|
@@ -295,7 +295,7 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
295
295
|
this.createPinCodeForRoom = function (_a) {
|
|
296
296
|
var roomId = _a.roomId, accommodationId = _a.accommodationId, userType = _a.userType, keyType = _a.keyType, startDate = _a.startDate, endDate = _a.endDate;
|
|
297
297
|
return __awaiter(_this, void 0, void 0, function () {
|
|
298
|
-
var foundProperty, data, parsedProperty, pinCodeResult, keyId, pinCodeQuery;
|
|
298
|
+
var foundProperty, data, parsedProperty, pinCodeResult, keyId, pinCodeQuery, lockInfo;
|
|
299
299
|
var _b;
|
|
300
300
|
return __generator(this, function (_c) {
|
|
301
301
|
switch (_c.label) {
|
|
@@ -307,9 +307,11 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
307
307
|
})];
|
|
308
308
|
case 1:
|
|
309
309
|
foundProperty = _c.sent();
|
|
310
|
+
console.log('🚀 ~ file: smartAccess.ts:345 ~ SmartAccessAdapter ~ foundProperty:', foundProperty);
|
|
310
311
|
if (!(foundProperty === null || foundProperty === void 0 ? void 0 : foundProperty.result)) return [3 /*break*/, 4];
|
|
311
312
|
data = foundProperty.data;
|
|
312
313
|
parsedProperty = JSON.parse(data);
|
|
314
|
+
console.log('🚀 ~ file: smartAccess.ts:353 ~ SmartAccessAdapter ~ parsedProperty:', parsedProperty);
|
|
313
315
|
return [4 /*yield*/, this.callSmartAccessApi({
|
|
314
316
|
accommodationId: accommodationId,
|
|
315
317
|
route: 'v1/key/pincode',
|
|
@@ -334,7 +336,8 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
334
336
|
})];
|
|
335
337
|
case 3:
|
|
336
338
|
pinCodeQuery = _c.sent();
|
|
337
|
-
|
|
339
|
+
lockInfo = ((_b = pinCodeQuery === null || pinCodeQuery === void 0 ? void 0 : pinCodeQuery.lockList) === null || _b === void 0 ? void 0 : _b[0]) || {};
|
|
340
|
+
return [2 /*return*/, __assign(__assign({}, lockInfo), { pinCode: (lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.pinCode) || (parsedProperty === null || parsedProperty === void 0 ? void 0 : parsedProperty.masterPinCode), keyId: keyId,
|
|
338
341
|
pinCodeResult: pinCodeResult })];
|
|
339
342
|
case 4: return [2 /*return*/];
|
|
340
343
|
}
|