@vendit-dev/thirdparty-adapters 0.2.1 → 0.2.2

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.
@@ -88,5 +88,9 @@ export default class SmartAccessAdapter {
88
88
  getAccommodationCallbacks: ({ accommodationId }: {
89
89
  accommodationId: string;
90
90
  }) => Promise<boolean>;
91
+ getRoomByThirdPartyId: ({ accommodationId, thirdPartyId }: {
92
+ accommodationId: string;
93
+ thirdPartyId: string;
94
+ }) => Promise<any>;
91
95
  }
92
96
  export {};
@@ -422,6 +422,27 @@ var SmartAccessAdapter = /** @class */ (function () {
422
422
  });
423
423
  });
424
424
  };
425
+ this.getRoomByThirdPartyId = function (_a) {
426
+ var accommodationId = _a.accommodationId, thirdPartyId = _a.thirdPartyId;
427
+ return __awaiter(_this, void 0, void 0, function () {
428
+ var foundRoomProperty;
429
+ return __generator(this, function (_b) {
430
+ switch (_b.label) {
431
+ case 0: return [4 /*yield*/, this.authenticator.getThirdPartyPropertyByThirdPartyId({
432
+ accommodationId: accommodationId,
433
+ provider: this.PROVIDER_KEY,
434
+ thirdPartyId: thirdPartyId,
435
+ type: 'room',
436
+ })];
437
+ case 1:
438
+ foundRoomProperty = _b.sent();
439
+ if (!(foundRoomProperty === null || foundRoomProperty === void 0 ? void 0 : foundRoomProperty.result))
440
+ return [2 /*return*/, false];
441
+ return [2 /*return*/, foundRoomProperty.data];
442
+ }
443
+ });
444
+ });
445
+ };
425
446
  this.authenticator = authenticator;
426
447
  this.redis = redis;
427
448
  this.mutexLock = new MutexLock({ hashPrefix: 'RES_SMARTACCESS_MUTEX_', mutexLockInterval: 50, redis: redis });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {