@vendit-dev/thirdparty-adapters 0.4.1-beta.4 → 0.4.1-beta.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.
|
@@ -296,8 +296,9 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
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
298
|
var foundProperty, data, parsedProperty, pinCodeResult, keyId, pinCodeQuery;
|
|
299
|
-
|
|
300
|
-
|
|
299
|
+
var _b;
|
|
300
|
+
return __generator(this, function (_c) {
|
|
301
|
+
switch (_c.label) {
|
|
301
302
|
case 0: return [4 /*yield*/, this.authenticator.getThirdPartyPropertyByRelatedId({
|
|
302
303
|
accommodationId: accommodationId,
|
|
303
304
|
provider: this.PROVIDER_KEY,
|
|
@@ -305,7 +306,7 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
305
306
|
type: 'room',
|
|
306
307
|
})];
|
|
307
308
|
case 1:
|
|
308
|
-
foundProperty =
|
|
309
|
+
foundProperty = _c.sent();
|
|
309
310
|
if (!(foundProperty === null || foundProperty === void 0 ? void 0 : foundProperty.result)) return [3 /*break*/, 4];
|
|
310
311
|
data = foundProperty.data;
|
|
311
312
|
parsedProperty = JSON.parse(data);
|
|
@@ -324,7 +325,7 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
324
325
|
},
|
|
325
326
|
})];
|
|
326
327
|
case 2:
|
|
327
|
-
pinCodeResult =
|
|
328
|
+
pinCodeResult = _c.sent();
|
|
328
329
|
keyId = pinCodeResult.keyId;
|
|
329
330
|
return [4 /*yield*/, this.callSmartAccessApi({
|
|
330
331
|
accommodationId: accommodationId,
|
|
@@ -332,8 +333,9 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
332
333
|
route: "v1/key/" + keyId + "/pincode",
|
|
333
334
|
})];
|
|
334
335
|
case 3:
|
|
335
|
-
pinCodeQuery =
|
|
336
|
-
return [2 /*return*/, __assign(__assign({}, pinCodeQuery.lockList[0]), { keyId: keyId,
|
|
336
|
+
pinCodeQuery = _c.sent();
|
|
337
|
+
return [2 /*return*/, __assign(__assign({ pinCode: parsedProperty === null || parsedProperty === void 0 ? void 0 : parsedProperty.masterPinCode }, (((_b = pinCodeQuery === null || pinCodeQuery === void 0 ? void 0 : pinCodeQuery.lockList) === null || _b === void 0 ? void 0 : _b[0]) || {})), { keyId: keyId,
|
|
338
|
+
pinCodeResult: pinCodeResult })];
|
|
337
339
|
case 4: return [2 /*return*/];
|
|
338
340
|
}
|
|
339
341
|
});
|