@vendit-dev/thirdparty-adapters 0.2.0 → 0.2.3

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*/, JSON.parse(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/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import SanhaWingsAdapter from './adapters/sanhaWings';
2
- export { SanhaWingsAdapter, };
2
+ import SmartAccessAdapter from './adapters/smartAccess';
3
+ export { SanhaWingsAdapter, SmartAccessAdapter, };
package/lib/index.js CHANGED
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SanhaWingsAdapter = void 0;
6
+ exports.SmartAccessAdapter = exports.SanhaWingsAdapter = void 0;
7
7
  var sanhaWings_1 = __importDefault(require("./adapters/sanhaWings"));
8
8
  exports.SanhaWingsAdapter = sanhaWings_1.default;
9
+ var smartAccess_1 = __importDefault(require("./adapters/smartAccess"));
10
+ exports.SmartAccessAdapter = smartAccess_1.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {