@vendit-dev/thirdparty-adapters 0.3.20 → 0.3.21

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.
@@ -161,7 +161,7 @@ var SmartAccessAdapter = /** @class */ (function () {
161
161
  _b.sent();
162
162
  throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
163
163
  case 7:
164
- parsedCredential = JSON.parse(newAuth.credential);
164
+ parsedCredential = this.parseJSONSafe(newAuth.credential);
165
165
  return [4 /*yield*/, this.redis.set(SmartAccessAdapter.indexAccommodation({ accommodationId: accommodationId }), newAuth.credential, 'EX', 60 * 5)];
166
166
  case 8:
167
167
  _b.sent();
@@ -168,7 +168,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
168
168
  this.doorlockList = function (_a) {
169
169
  var accommodationId = _a.accommodationId, _b = _a.roomAlias, roomAlias = _b === void 0 ? '' : _b;
170
170
  return __awaiter(_this, void 0, void 0, function () {
171
- var authInfo, credential, data, doorLockList, foundDoorLock;
171
+ var authInfo, credential, data, doorLockList;
172
172
  return __generator(this, function (_c) {
173
173
  switch (_c.label) {
174
174
  case 0: return [4 /*yield*/, this.getAccommodationAuthInfo({ accommodationId: accommodationId })];
@@ -182,10 +182,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
182
182
  case 2:
183
183
  data = _c.sent();
184
184
  doorLockList = (data === null || data === void 0 ? void 0 : data.list) || [];
185
- foundDoorLock = doorLockList.filter(function (doorlock) { return doorlock.roomAlias === roomAlias; });
186
- console.log('doorLockList', doorLockList);
187
- console.log('foundDoorLock', foundDoorLock);
188
- if (data.code !== 0 || !doorLockList.length || !foundDoorLock.length) {
185
+ if (data.code !== 0 || !doorLockList.length) {
189
186
  throw new Error('ERR_DOOR_LOCK_LIST_NOT_LOAD');
190
187
  }
191
188
  return [2 /*return*/, data];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {