@vendit-dev/thirdparty-adapters 0.4.1-beta.3 → 0.4.1-beta.5

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
- return __generator(this, function (_b) {
300
- switch (_b.label) {
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 = _b.sent();
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,8 +325,7 @@ var SmartAccessAdapter = /** @class */ (function () {
324
325
  },
325
326
  })];
326
327
  case 2:
327
- pinCodeResult = _b.sent();
328
- console.log('🚀 ~ file: smartAccess.ts:364 ~ SmartAccessAdapter ~ pinCodeResult:', pinCodeResult);
328
+ pinCodeResult = _c.sent();
329
329
  keyId = pinCodeResult.keyId;
330
330
  return [4 /*yield*/, this.callSmartAccessApi({
331
331
  accommodationId: accommodationId,
@@ -333,8 +333,8 @@ var SmartAccessAdapter = /** @class */ (function () {
333
333
  route: "v1/key/" + keyId + "/pincode",
334
334
  })];
335
335
  case 3:
336
- pinCodeQuery = _b.sent();
337
- return [2 /*return*/, __assign(__assign({}, pinCodeQuery.lockList[0]), { keyId: keyId })];
336
+ pinCodeQuery = _c.sent();
337
+ return [2 /*return*/, __assign(__assign({}, (((_b = pinCodeQuery === null || pinCodeQuery === void 0 ? void 0 : pinCodeQuery.lockList) === null || _b === void 0 ? void 0 : _b[0]) || {})), { keyId: keyId, pinCodeResult: pinCodeResult })];
338
338
  case 4: return [2 /*return*/];
339
339
  }
340
340
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.4.1-beta.3",
3
+ "version": "0.4.1-beta.5",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {