@vendit-dev/thirdparty-adapters 0.3.8 → 0.3.10

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.
@@ -102,19 +102,23 @@ var ThemrIoTAdapter = /** @class */ (function () {
102
102
  case 0: return [4 /*yield*/, this.redis.get(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }))];
103
103
  case 1:
104
104
  existingAuth = _b.sent();
105
+ console.log('FIRST', existingAuth);
105
106
  if (existingAuth) {
106
107
  if (existingAuth === 'NOT_FOUND') {
107
108
  throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
108
109
  }
109
110
  return [2 /*return*/, JSON.parse(existingAuth)];
110
111
  }
112
+ console.log('SECOND', existingAuth);
111
113
  lockId = "THEMR-HKEY|" + accommodationId;
112
114
  return [4 /*yield*/, this.mutexLock.getMutexLock(lockId)];
113
115
  case 2:
114
116
  lockHash = _b.sent();
117
+ console.log('THIRD', existingAuth);
115
118
  return [4 /*yield*/, this.redis.get(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }))];
116
119
  case 3:
117
120
  existingAuth = _b.sent();
121
+ console.log('FOURTH', existingAuth);
118
122
  _b.label = 4;
119
123
  case 4:
120
124
  _b.trys.push([4, 9, 10, 12]);
@@ -124,22 +128,27 @@ var ThemrIoTAdapter = /** @class */ (function () {
124
128
  }
125
129
  return [2 /*return*/, JSON.parse(existingAuth)];
126
130
  }
131
+ console.log('FIFTH', existingAuth);
127
132
  return [4 /*yield*/, this.authenticator.getThirdPartyCredential({
128
133
  accommodationId: accommodationId,
129
134
  provider: this.PROVIDER_KEY,
130
135
  })];
131
136
  case 5:
132
137
  newAuth = _b.sent();
138
+ console.log('SIXTH', newAuth);
133
139
  if (!!newAuth) return [3 /*break*/, 7];
134
140
  return [4 /*yield*/, this.redis.set(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }), 'NOT_FOUND', 'EX', 60 * 10)];
135
141
  case 6:
136
142
  _b.sent();
137
143
  throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
138
144
  case 7:
145
+ console.log('SEVENTH', newAuth);
139
146
  newAuth.credential = JSON.parse(newAuth.credential);
147
+ console.log('EIGHTH', newAuth);
140
148
  return [4 /*yield*/, this.redis.set(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }), JSON.stringify(newAuth), 'EX', 60 * 10)];
141
149
  case 8:
142
150
  _b.sent();
151
+ console.log('NINETH', newAuth);
143
152
  return [2 /*return*/, newAuth];
144
153
  case 9:
145
154
  err_1 = _b.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {