@vendit-dev/thirdparty-adapters 0.4.1 → 0.7.0

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.
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -65,8 +65,8 @@ var WINGS_COMMON_REQUEST_PARAMS = {
65
65
  };
66
66
  var WingsApiController = /** @class */ (function () {
67
67
  function WingsApiController(_a) {
68
- var _this = this;
69
68
  var contextApi = _a.contextApi;
69
+ var _this = this;
70
70
  this.callWingsApi = function (_a) {
71
71
  var route = _a.route, _b = _a.params, params = _b === void 0 ? {} : _b, auth = _a.auth;
72
72
  return __awaiter(_this, void 0, void 0, function () {
@@ -79,9 +79,9 @@ var WingsApiController = /** @class */ (function () {
79
79
  headers: __assign(__assign({}, WINGS_COMMON_REQUEST_HEADERS), auth.headers),
80
80
  body: JSON.stringify(__assign(__assign(__assign({}, auth.params), WINGS_COMMON_REQUEST_PARAMS), params)),
81
81
  };
82
- console.log(this.URI + "/" + this.CONTEXT + "/" + route);
82
+ console.log("".concat(this.URI, "/").concat(this.CONTEXT, "/").concat(route));
83
83
  console.log(requestOptions);
84
- return [4 /*yield*/, node_fetch_1.default(this.URI + "/" + this.CONTEXT + "/" + route, requestOptions)];
84
+ return [4 /*yield*/, (0, node_fetch_1.default)("".concat(this.URI, "/").concat(this.CONTEXT, "/").concat(route), requestOptions)];
85
85
  case 1:
86
86
  response = _c.sent();
87
87
  console.log(response);
@@ -105,8 +105,8 @@ var apiController = new WingsApiController({
105
105
  });
106
106
  var WingsAdapter = /** @class */ (function () {
107
107
  function WingsAdapter(_a) {
108
- var _this = this;
109
108
  var authenticator = _a.authenticator, redis = _a.redis;
109
+ var _this = this;
110
110
  this.PROVIDER_KEY = 'SanhaWings';
111
111
  this.checkWingsIntegration = function (_a) {
112
112
  var accommodationId = _a.accommodationId;
@@ -129,7 +129,7 @@ var WingsAdapter = /** @class */ (function () {
129
129
  }
130
130
  return [2 /*return*/, JSON.parse(existingAuth)];
131
131
  }
132
- lockId = "WINGS-HKEY|" + accommodationId;
132
+ lockId = "WINGS-HKEY|".concat(accommodationId);
133
133
  return [4 /*yield*/, this.mutexLock.getMutexLock(lockId)];
134
134
  case 2:
135
135
  lockHash = _b.sent();
@@ -220,7 +220,7 @@ var WingsAdapter = /** @class */ (function () {
220
220
  response = _b.sent();
221
221
  resultData = response.resultData;
222
222
  if (!resultData) {
223
- throw new Error("FAILED_TO_CHECKIN_" + JSON.stringify(response));
223
+ throw new Error("FAILED_TO_CHECKIN_".concat(JSON.stringify(response)));
224
224
  }
225
225
  return [2 /*return*/, resultData];
226
226
  case 4:
@@ -384,8 +384,8 @@ var WingsAdapter = /** @class */ (function () {
384
384
  route: 'ki02/kioskWalkInInfo',
385
385
  auth: WingsAdapter.authFromCredentials(authInfo.credential),
386
386
  params: {
387
- ARRV_DATE: moment_1.default(startDate).format('YYYYMMDD'),
388
- DEPT_DATE: moment_1.default(endDate).format('YYYYMMDD'),
387
+ ARRV_DATE: (0, moment_1.default)(startDate).format('YYYYMMDD'),
388
+ DEPT_DATE: (0, moment_1.default)(endDate).format('YYYYMMDD'),
389
389
  ADULT_CNT: adultCount,
390
390
  CHILD_CNT: childCount,
391
391
  LANG_TYPE: langType,
@@ -423,10 +423,10 @@ var WingsAdapter = /** @class */ (function () {
423
423
  route: 'ki02/kioskWalkInRoomRate',
424
424
  auth: WingsAdapter.authFromCredentials(authInfo.credential),
425
425
  params: {
426
- ARRV_DATE: moment_1.default(startDate).format('YYYYMMDD'),
427
- DEPT_DATE: moment_1.default(endDate).format('YYYYMMDD'),
426
+ ARRV_DATE: (0, moment_1.default)(startDate).format('YYYYMMDD'),
427
+ DEPT_DATE: (0, moment_1.default)(endDate).format('YYYYMMDD'),
428
428
  ROOM_TYPE_CODE: roomTypeCode,
429
- SALES_DATE: moment_1.default(salesDate).format('YYYYMMDD'),
429
+ SALES_DATE: (0, moment_1.default)(salesDate).format('YYYYMMDD'),
430
430
  BSNS_CODE: authInfo.credential.BSNS_CODE,
431
431
  },
432
432
  })];
@@ -460,8 +460,8 @@ var WingsAdapter = /** @class */ (function () {
460
460
  route: 'ki02/kioskWalkInInfo',
461
461
  auth: WingsAdapter.authFromCredentials(authInfo.credential),
462
462
  params: {
463
- ARRV_DATE: moment_1.default(startDate).format('YYYYMMDD'),
464
- DEPT_DATE: moment_1.default(endDate).format('YYYYMMDD'),
463
+ ARRV_DATE: (0, moment_1.default)(startDate).format('YYYYMMDD'),
464
+ DEPT_DATE: (0, moment_1.default)(endDate).format('YYYYMMDD'),
465
465
  ADULT_CNT: adultCount,
466
466
  CHILD_CNT: childCount,
467
467
  LANG_TYPE: langType,
@@ -638,7 +638,7 @@ var WingsAdapter = /** @class */ (function () {
638
638
  FOLIO_NO: folioNumber,
639
639
  ROOM_NO: roomNumber,
640
640
  REG_DATE: registerDate,
641
- REG_TIME: moment_1.default().format('HHmmSS'),
641
+ REG_TIME: (0, moment_1.default)().format('HHmmSS'),
642
642
  ISSUE_CNT: issuedCount,
643
643
  RESULT_MSG: resultMessage,
644
644
  },
@@ -722,9 +722,9 @@ var WingsAdapter = /** @class */ (function () {
722
722
  RSPNS_CODE: parsedData.CORPRESPCODE.trim(),
723
723
  TERM_NO: parsedData.TERMID.trim(),
724
724
  APPR_NO: parsedData.APPROVALNO.trim(),
725
- APPR_DATE: "20" + parsedData.TRADETIME.slice(0, 6),
725
+ APPR_DATE: "20".concat(parsedData.TRADETIME.slice(0, 6)),
726
726
  APPR_TIME: parsedData.TRADETIME.slice(6, 10),
727
- CNFM_DATE: "20" + parsedData.TRADETIME.slice(0, 6),
727
+ CNFM_DATE: "20".concat(parsedData.TRADETIME.slice(0, 6)),
728
728
  CNFM_TYPE: parsedData.TRADETIME.slice(6, 10),
729
729
  // Generated data
730
730
  INSTA_MMS_CNT: parsedData.INSTA_MMS_CNT || '00',
@@ -783,7 +783,7 @@ var WingsAdapter = /** @class */ (function () {
783
783
  var foundPaymentInfo, parsedPayment, err_16;
784
784
  return __generator(this, function (_b) {
785
785
  switch (_b.label) {
786
- case 0: return [4 /*yield*/, this.redis.get("SanhaWings|" + paymentId)];
786
+ case 0: return [4 /*yield*/, this.redis.get("SanhaWings|".concat(paymentId))];
787
787
  case 1:
788
788
  foundPaymentInfo = _b.sent();
789
789
  if (!foundPaymentInfo)
@@ -797,7 +797,7 @@ var WingsAdapter = /** @class */ (function () {
797
797
  folioNumber: folioNumber,
798
798
  paymentAmount: parsedPayment.amount.toString(),
799
799
  paymentInfo: parsedPayment.data,
800
- saleDate: moment_1.default(parsedPayment.createdAt).format('YYYYMMDD'),
800
+ saleDate: (0, moment_1.default)(parsedPayment.createdAt).format('YYYYMMDD'),
801
801
  })];
802
802
  case 3:
803
803
  _b.sent();
@@ -821,7 +821,7 @@ var WingsAdapter = /** @class */ (function () {
821
821
  }
822
822
  WingsAdapter.indexAccommodation = function (_a) {
823
823
  var accommodationId = _a.accommodationId;
824
- return "AUTH|WINGS-API|" + accommodationId;
824
+ return "AUTH|WINGS-API|".concat(accommodationId);
825
825
  };
826
826
  WingsAdapter.authFromCredentials = function (_a) {
827
827
  var vendorId = _a.vendorId, companyId = _a.companyId, apiKey = _a.apiKey, kioskIp = _a.kioskIp;
@@ -1,23 +1,23 @@
1
1
  import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
2
2
  import MutexLock from '../utils/mutex';
3
- declare type OAuthTokenResponse = {
3
+ type OAuthTokenResponse = {
4
4
  accessToken: string;
5
5
  refreshToken: string;
6
6
  tokenType: string;
7
7
  expiresIn: number;
8
8
  };
9
- declare type OAuthRawTokenSet = {
9
+ type OAuthRawTokenSet = {
10
10
  refresh_token: string;
11
11
  access_token: string;
12
12
  expires_in: number;
13
13
  token_type: string;
14
14
  };
15
- declare type SmartAccessRoom = {
15
+ type SmartAccessRoom = {
16
16
  roomId: string;
17
17
  roomNumber: string;
18
18
  path: string;
19
19
  };
20
- declare type SmartAccessRoomKey = {
20
+ type SmartAccessRoomKey = {
21
21
  deviceId: string;
22
22
  deviceName: string;
23
23
  keyList: {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -55,8 +55,8 @@ var node_fetch_1 = __importDefault(require("node-fetch"));
55
55
  var mutex_1 = __importDefault(require("../utils/mutex"));
56
56
  var SmartAccessAdapter = /** @class */ (function () {
57
57
  function SmartAccessAdapter(_a) {
58
- var _this = this;
59
58
  var authenticator = _a.authenticator, redis = _a.redis, apiHost = _a.apiHost;
59
+ var _this = this;
60
60
  this.PROVIDER_KEY = 'SamsungSmartAccess';
61
61
  this.parseJSONSafe = function (str) {
62
62
  try {
@@ -91,7 +91,7 @@ var SmartAccessAdapter = /** @class */ (function () {
91
91
  }
92
92
  return [2 /*return*/, this.parseJSONSafe(existingAuth)];
93
93
  }
94
- lockId = "SMARTACCESS-HKEY|" + accommodationId;
94
+ lockId = "SMARTACCESS-HKEY|".concat(accommodationId);
95
95
  return [4 /*yield*/, this.mutexLock.getMutexLock(lockId)];
96
96
  case 2:
97
97
  lockHash = _b.sent();
@@ -152,27 +152,28 @@ var SmartAccessAdapter = /** @class */ (function () {
152
152
  this.callSmartAccessApi = function (_a) {
153
153
  var route = _a.route, accommodationId = _a.accommodationId, params = _a.params, _b = _a.method, method = _b === void 0 ? 'post' : _b, headers = _a.headers;
154
154
  return __awaiter(_this, void 0, void 0, function () {
155
- var requestArgs, _c, _d, _e, _f, _g, _h, response, jsonResponse;
155
+ var requestArgs, _c, _d, _e, _f, response, jsonResponse;
156
+ var _g, _h;
156
157
  return __generator(this, function (_j) {
157
158
  switch (_j.label) {
158
159
  case 0:
159
160
  _c = [__assign({ method: method }, (method !== 'get' && {
160
161
  body: JSON.stringify(__assign({}, params)),
161
162
  }))];
162
- _d = {};
163
- _e = [{ 'Content-Type': 'application/json' }];
164
- _f = accommodationId;
165
- if (!_f) return [3 /*break*/, 2];
166
163
  _g = {};
167
- _h = "Bearer ";
164
+ _d = [{ 'Content-Type': 'application/json' }];
165
+ _e = accommodationId;
166
+ if (!_e) return [3 /*break*/, 2];
167
+ _h = {};
168
+ _f = "Bearer ".concat;
168
169
  return [4 /*yield*/, this.getAccommodationAccessToken(accommodationId)];
169
170
  case 1:
170
- _f = (_g.Authorization = _h + (_j.sent()),
171
- _g);
171
+ _e = (_h.Authorization = _f.apply("Bearer ", [_j.sent()]),
172
+ _h);
172
173
  _j.label = 2;
173
174
  case 2:
174
- requestArgs = __assign.apply(void 0, _c.concat([(_d.headers = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_f)])), headers]), _d)]));
175
- return [4 /*yield*/, node_fetch_1.default(this.API_HOST + "/sa/oauth/" + route, requestArgs)];
175
+ requestArgs = __assign.apply(void 0, _c.concat([(_g.headers = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_e)])), headers]), _g)]));
176
+ return [4 /*yield*/, (0, node_fetch_1.default)("".concat(this.API_HOST, "/sa/oauth/").concat(route), requestArgs)];
176
177
  case 3:
177
178
  response = _j.sent();
178
179
  return [4 /*yield*/, response.json()];
@@ -192,7 +193,7 @@ var SmartAccessAdapter = /** @class */ (function () {
192
193
  case 0: return [4 /*yield*/, this.callSmartAccessApi({
193
194
  accommodationId: accommodationId,
194
195
  method: 'get',
195
- route: "v1/room/" + roomId + "/roominfo",
196
+ route: "v1/room/".concat(roomId, "/roominfo"),
196
197
  })];
197
198
  case 1:
198
199
  roomResponse = _b.sent();
@@ -253,7 +254,7 @@ var SmartAccessAdapter = /** @class */ (function () {
253
254
  return [4 /*yield*/, this.callSmartAccessApi({
254
255
  accommodationId: accommodationId,
255
256
  method: 'get',
256
- route: "v1/room/" + parsedProperty.thirdPartyId + "/keyinfo",
257
+ route: "v1/room/".concat(parsedProperty.thirdPartyId, "/keyinfo"),
257
258
  })];
258
259
  case 3:
259
260
  roomKeyResponse = _a.sent();
@@ -318,10 +319,10 @@ var SmartAccessAdapter = /** @class */ (function () {
318
319
  keyType: keyType,
319
320
  pinCode: null,
320
321
  roomId: parsedProperty.thirdPartyId,
321
- accessStartDate: moment_1.default(startDate)
322
+ accessStartDate: (0, moment_1.default)(startDate)
322
323
  .add(9, 'hours')
323
324
  .format('YYYYMMDDHHmm'),
324
- accessEndDate: moment_1.default(endDate).add(9, 'hours').format('YYYYMMDDHHmm'),
325
+ accessEndDate: (0, moment_1.default)(endDate).add(9, 'hours').format('YYYYMMDDHHmm'),
325
326
  },
326
327
  })];
327
328
  case 2:
@@ -330,13 +331,12 @@ var SmartAccessAdapter = /** @class */ (function () {
330
331
  return [4 /*yield*/, this.callSmartAccessApi({
331
332
  accommodationId: accommodationId,
332
333
  method: 'get',
333
- route: "v1/key/" + keyId + "/pincode",
334
+ route: "v1/key/".concat(keyId, "/pincode"),
334
335
  })];
335
336
  case 3:
336
337
  pinCodeQuery = _c.sent();
337
338
  lockInfo = ((_b = pinCodeQuery === null || pinCodeQuery === void 0 ? void 0 : pinCodeQuery.lockList) === null || _b === void 0 ? void 0 : _b[0]) || {};
338
- return [2 /*return*/, __assign(__assign({}, lockInfo), { pinCode: (lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.pinCode) || (parsedData === null || parsedData === void 0 ? void 0 : parsedData.masterPinCode), keyId: keyId,
339
- pinCodeResult: pinCodeResult })];
339
+ return [2 /*return*/, __assign(__assign({}, lockInfo), { pinCode: (lockInfo === null || lockInfo === void 0 ? void 0 : lockInfo.pinCode) || (parsedData === null || parsedData === void 0 ? void 0 : parsedData.masterPinCode), keyId: keyId, pinCodeResult: pinCodeResult })];
340
340
  case 4: return [2 /*return*/];
341
341
  }
342
342
  });
@@ -351,14 +351,14 @@ var SmartAccessAdapter = /** @class */ (function () {
351
351
  case 0: return [4 /*yield*/, this.callSmartAccessApi({
352
352
  accommodationId: accommodationId,
353
353
  method: 'put',
354
- route: "v1/key/" + keyId + "/pincode",
354
+ route: "v1/key/".concat(keyId, "/pincode"),
355
355
  params: {
356
356
  userType: userType,
357
357
  keyType: keyType,
358
- accessStartDate: moment_1.default(startDate)
358
+ accessStartDate: (0, moment_1.default)(startDate)
359
359
  .add(9, 'hours')
360
360
  .format('YYYYMMDDHHmm'),
361
- accessEndDate: moment_1.default(endDate).add(9, 'hours').format('YYYYMMDDHHmm'),
361
+ accessEndDate: (0, moment_1.default)(endDate).add(9, 'hours').format('YYYYMMDDHHmm'),
362
362
  },
363
363
  })];
364
364
  case 1:
@@ -366,7 +366,7 @@ var SmartAccessAdapter = /** @class */ (function () {
366
366
  return [4 /*yield*/, this.callSmartAccessApi({
367
367
  accommodationId: accommodationId,
368
368
  method: 'get',
369
- route: "v1/key/" + keyId + "/pincode",
369
+ route: "v1/key/".concat(keyId, "/pincode"),
370
370
  })];
371
371
  case 2:
372
372
  pinCodeQuery = _b.sent();
@@ -384,7 +384,7 @@ var SmartAccessAdapter = /** @class */ (function () {
384
384
  case 0: return [4 /*yield*/, this.callSmartAccessApi({
385
385
  accommodationId: accommodationId,
386
386
  method: 'put',
387
- route: "v1/key/" + keyId + "/delete",
387
+ route: "v1/key/".concat(keyId, "/delete"),
388
388
  })];
389
389
  case 1:
390
390
  pinCodeResult = _b.sent();
@@ -423,7 +423,7 @@ var SmartAccessAdapter = /** @class */ (function () {
423
423
  deviceId = parsedProperty.thirdPartyId;
424
424
  return [4 /*yield*/, this.callSmartAccessApi({
425
425
  accommodationId: accommodationId,
426
- route: "v1/device/" + deviceId + "/open",
426
+ route: "v1/device/".concat(deviceId, "/open"),
427
427
  params: {
428
428
  keyId: keyId,
429
429
  },
@@ -486,7 +486,7 @@ var SmartAccessAdapter = /** @class */ (function () {
486
486
  }
487
487
  SmartAccessAdapter.indexAccommodation = function (_a) {
488
488
  var accommodationId = _a.accommodationId;
489
- return "AUTH|SMARTACCESS-API|" + accommodationId;
489
+ return "AUTH|SMARTACCESS-API|".concat(accommodationId);
490
490
  };
491
491
  SmartAccessAdapter.refineRawTokenSet = function (rawTokenSet) {
492
492
  var refreshToken = rawTokenSet.refresh_token, accessToken = rawTokenSet.access_token, expiresIn = rawTokenSet.expires_in, tokenType = rawTokenSet.token_type;
@@ -1,6 +1,6 @@
1
1
  import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
2
2
  import MutexLock from '../utils/mutex';
3
- declare type VenditThemrIoTAuthInfo = {
3
+ type VenditThemrIoTAuthInfo = {
4
4
  scope: string;
5
5
  credential: {
6
6
  hotel_id: string;
@@ -10,7 +10,7 @@ declare type VenditThemrIoTAuthInfo = {
10
10
  expiresAt: number;
11
11
  };
12
12
  };
13
- declare type DoorlockListResponse = {
13
+ type DoorlockListResponse = {
14
14
  code: number;
15
15
  message: string;
16
16
  count?: number;
@@ -25,62 +25,65 @@ declare type DoorlockListResponse = {
25
25
  gatewayState: number;
26
26
  }[];
27
27
  };
28
- declare type DoorlockDetailResponse = [{
29
- code: number;
30
- message: string;
31
- }, {
32
- date: number;
33
- lockAlias: string;
34
- lockSound: number;
35
- modelNum: string;
36
- lockMac: string;
37
- privacyLock: number;
38
- deletePwd: string;
39
- featureValue: string;
40
- adminPwd: string;
41
- soundVolume: number;
42
- hasGateway: number;
43
- autoLockTime: number;
44
- wirelessKeypadFeatureValue: string;
45
- floorNumber: number;
46
- buildingNumber: number;
47
- lockKey: string;
48
- isFrozen: number;
49
- lockName: string;
50
- sector: string;
51
- resetButton: number;
52
- firmwareRevision: string;
53
- tamperAlert: number;
54
- specialValue: number;
55
- displayPasscode: number;
56
- noKeyPwd: string;
57
- passageMode: number;
58
- passageModeAutoUnlock: number;
59
- timezoneRawOffset: number;
60
- lockId: number;
61
- electricQuantity: number;
62
- lockFlagPos: number;
63
- lockUpdateDate: number;
64
- keyboardPwdVersion: number;
65
- aesKeyStr: string;
66
- hardwareRevision: string;
67
- openDirection: number;
68
- lockVersion: {
69
- groupId: number;
70
- protocolVersion: number;
71
- protocolType: number;
72
- orgId: number;
73
- scene: number;
74
- };
75
- sensitivity: number;
76
- }];
77
- declare type GetOTPPassCodeResponse = {
28
+ type DoorlockDetailResponse = [
29
+ {
30
+ code: number;
31
+ message: string;
32
+ },
33
+ {
34
+ date: number;
35
+ lockAlias: string;
36
+ lockSound: number;
37
+ modelNum: string;
38
+ lockMac: string;
39
+ privacyLock: number;
40
+ deletePwd: string;
41
+ featureValue: string;
42
+ adminPwd: string;
43
+ soundVolume: number;
44
+ hasGateway: number;
45
+ autoLockTime: number;
46
+ wirelessKeypadFeatureValue: string;
47
+ floorNumber: number;
48
+ buildingNumber: number;
49
+ lockKey: string;
50
+ isFrozen: number;
51
+ lockName: string;
52
+ sector: string;
53
+ resetButton: number;
54
+ firmwareRevision: string;
55
+ tamperAlert: number;
56
+ specialValue: number;
57
+ displayPasscode: number;
58
+ noKeyPwd: string;
59
+ passageMode: number;
60
+ passageModeAutoUnlock: number;
61
+ timezoneRawOffset: number;
62
+ lockId: number;
63
+ electricQuantity: number;
64
+ lockFlagPos: number;
65
+ lockUpdateDate: number;
66
+ keyboardPwdVersion: number;
67
+ aesKeyStr: string;
68
+ hardwareRevision: string;
69
+ openDirection: number;
70
+ lockVersion: {
71
+ groupId: number;
72
+ protocolVersion: number;
73
+ protocolType: number;
74
+ orgId: number;
75
+ scene: number;
76
+ };
77
+ sensitivity: number;
78
+ }
79
+ ];
80
+ type GetOTPPassCodeResponse = {
78
81
  code: number;
79
82
  message: string;
80
83
  passcode: string;
81
84
  passcodeId: number;
82
85
  };
83
- declare type writeAsyncRFCardRes = {
86
+ type writeAsyncRFCardRes = {
84
87
  code: string;
85
88
  issue_cd: string;
86
89
  message: string;
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -55,8 +55,8 @@ var node_fetch_1 = __importDefault(require("node-fetch"));
55
55
  var mutex_1 = __importDefault(require("../utils/mutex"));
56
56
  var ThemrIoTAdapter = /** @class */ (function () {
57
57
  function ThemrIoTAdapter(_a) {
58
- var _this = this;
59
58
  var authenticator = _a.authenticator, redis = _a.redis, apiHost = _a.apiHost;
59
+ var _this = this;
60
60
  this.API_HOST = 'http://api.hotel-lock.co.kr';
61
61
  this.timeFormat = 'YYYY-MM-DD HH:mm:ss';
62
62
  this.PROVIDER_KEY = 'TheMR';
@@ -72,7 +72,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
72
72
  headers: { 'Content-Type': 'application/json' },
73
73
  body: JSON.stringify(__assign({}, params)),
74
74
  };
75
- return [4 /*yield*/, node_fetch_1.default("" + this.API_HOST + route, requestOptions)];
75
+ return [4 /*yield*/, (0, node_fetch_1.default)("".concat(this.API_HOST).concat(route), requestOptions)];
76
76
  case 1:
77
77
  res = _c.sent();
78
78
  return [4 /*yield*/, res.json()];
@@ -116,7 +116,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
116
116
  }
117
117
  return [2 /*return*/, this.parseJSONSafe(existingAuth)];
118
118
  }
119
- lockId = "THEMR-HKEY|" + accommodationId;
119
+ lockId = "THEMR-HKEY|".concat(accommodationId);
120
120
  return [4 /*yield*/, this.mutexLock.getMutexLock(lockId)];
121
121
  case 2:
122
122
  lockHash = _b.sent();
@@ -159,8 +159,8 @@ var ThemrIoTAdapter = /** @class */ (function () {
159
159
  });
160
160
  });
161
161
  };
162
- this.getDefaultCheckInDate = function () { return moment_1.default().add(9, 'hours').format(_this.timeFormat); };
163
- this.getDefaultCheckOutDate = function () { return moment_1.default().add(9, 'hours').add(3, 'd').format(_this.timeFormat); };
162
+ this.getDefaultCheckInDate = function () { return (0, moment_1.default)().add(9, 'hours').format(_this.timeFormat); };
163
+ this.getDefaultCheckOutDate = function () { return (0, moment_1.default)().add(9, 'hours').add(3, 'd').format(_this.timeFormat); };
164
164
  this.getAccommodationAccessToken = function (accommodationId) { return __awaiter(_this, void 0, void 0, function () {
165
165
  var authInfo;
166
166
  return __generator(this, function (_a) {
@@ -294,7 +294,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
294
294
  }
295
295
  ThemrIoTAdapter.indexAccommodation = function (_a) {
296
296
  var accommodationId = _a.accommodationId;
297
- return "AUTH|THEMR-IOT-API|" + accommodationId;
297
+ return "AUTH|THEMR-IOT-API|".concat(accommodationId);
298
298
  };
299
299
  return ThemrIoTAdapter;
300
300
  }());
package/lib/index.d.ts CHANGED
@@ -2,4 +2,6 @@ import AmanoKoreaAdapter from './adapters/amanoKorea';
2
2
  import SanhaWingsAdapter from './adapters/sanhaWings';
3
3
  import SmartAccessAdapter from './adapters/smartAccess';
4
4
  import ThemrIoTAdapter from './adapters/themrIoT';
5
- export { AmanoKoreaAdapter, SanhaWingsAdapter, SmartAccessAdapter, ThemrIoTAdapter as TheMRIoTAdapter, };
5
+ import { NiceParkThirdParty } from './adapters/parking/nicePark';
6
+ export { default as ParkingThirdPartyCaller } from './adapters/parking/parkingThridPartyCaller';
7
+ export { AmanoKoreaAdapter, SanhaWingsAdapter, NiceParkThirdParty, SmartAccessAdapter, ThemrIoTAdapter as TheMRIoTAdapter, };
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@ 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.TheMRIoTAdapter = exports.SmartAccessAdapter = exports.SanhaWingsAdapter = exports.AmanoKoreaAdapter = void 0;
6
+ exports.TheMRIoTAdapter = exports.SmartAccessAdapter = exports.NiceParkThirdParty = exports.SanhaWingsAdapter = exports.AmanoKoreaAdapter = exports.ParkingThirdPartyCaller = void 0;
7
7
  var amanoKorea_1 = __importDefault(require("./adapters/amanoKorea"));
8
8
  exports.AmanoKoreaAdapter = amanoKorea_1.default;
9
9
  var sanhaWings_1 = __importDefault(require("./adapters/sanhaWings"));
@@ -12,3 +12,7 @@ var smartAccess_1 = __importDefault(require("./adapters/smartAccess"));
12
12
  exports.SmartAccessAdapter = smartAccess_1.default;
13
13
  var themrIoT_1 = __importDefault(require("./adapters/themrIoT"));
14
14
  exports.TheMRIoTAdapter = themrIoT_1.default;
15
+ var nicePark_1 = require("./adapters/parking/nicePark");
16
+ Object.defineProperty(exports, "NiceParkThirdParty", { enumerable: true, get: function () { return nicePark_1.NiceParkThirdParty; } });
17
+ var parkingThridPartyCaller_1 = require("./adapters/parking/parkingThridPartyCaller");
18
+ Object.defineProperty(exports, "ParkingThirdPartyCaller", { enumerable: true, get: function () { return __importDefault(parkingThridPartyCaller_1).default; } });
@@ -1,4 +1,4 @@
1
- declare type PreDiscountListInfoInput = {
1
+ type PreDiscountListInfoInput = {
2
2
  lotAreaNo: number;
3
3
  registUserId?: string;
4
4
  discCodeNo: number;
@@ -8,7 +8,7 @@ declare type PreDiscountListInfoInput = {
8
8
  dongcode?: string;
9
9
  hocode?: string;
10
10
  };
11
- declare type InsertPreDiscountInfoInput = {
11
+ type InsertPreDiscountInfoInput = {
12
12
  lotAreaNo: number;
13
13
  registUserId: string;
14
14
  registUserName?: string;
@@ -23,7 +23,7 @@ declare type InsertPreDiscountInfoInput = {
23
23
  memo?: string;
24
24
  mobile?: string;
25
25
  };
26
- declare type UpdatePreDiscountInfoInput = {
26
+ type UpdatePreDiscountInfoInput = {
27
27
  lotAreaNo: number;
28
28
  registUserId: string;
29
29
  registUserName?: string;
@@ -38,12 +38,12 @@ declare type UpdatePreDiscountInfoInput = {
38
38
  memo?: string;
39
39
  mobile?: string;
40
40
  };
41
- declare type DeletePreDiscountInfoInput = {
41
+ type DeletePreDiscountInfoInput = {
42
42
  lotAreaNo: number;
43
43
  registUserId?: string;
44
44
  preDiscountId: number;
45
45
  };
46
- declare type FeeCarSearchInput = {
46
+ type FeeCarSearchInput = {
47
47
  lotAreaNo: number;
48
48
  eqpmNo: number;
49
49
  carNo4Dight: string;
@@ -89,11 +89,11 @@ interface DeletePreDiscountInfoResponse {
89
89
  eventName: 'Delete pre-discount information';
90
90
  eventType: 'DeletePreDiscountInfo';
91
91
  }
92
- declare type AmanoPaymentType = 'PAY_FLAG_NONE' | 'PAY_FLAG_COMPLETE' | 'PAY_FLAG_RECALCULATE' | 'PAY_FLAG_DEBITCARD_RECHARGE' | 'PAY_FLAG_DEBITCARD_SALE' | 'PAY_FLAG_USED_PASSCARD' | 'PAY_FLAG_USED_DEBITCARD' | 'PAY_FLAG_USED_EVENTCARD' | 'PAY_FLAG_CANSEL' | 'PAY_FLAG_LOSTTICKET' | 'PAY_FLAG_MINAB';
92
+ type AmanoPaymentType = 'PAY_FLAG_NONE' | 'PAY_FLAG_COMPLETE' | 'PAY_FLAG_RECALCULATE' | 'PAY_FLAG_DEBITCARD_RECHARGE' | 'PAY_FLAG_DEBITCARD_SALE' | 'PAY_FLAG_USED_PASSCARD' | 'PAY_FLAG_USED_DEBITCARD' | 'PAY_FLAG_USED_EVENTCARD' | 'PAY_FLAG_CANSEL' | 'PAY_FLAG_LOSTTICKET' | 'PAY_FLAG_MINAB';
93
93
  /**
94
94
  * 0 : 입차 1 : 출차
95
95
  */
96
- declare type AmanoInOutStatus = 0 | 1;
96
+ type AmanoInOutStatus = 0 | 1;
97
97
  interface GetFeeCarSearchResponse {
98
98
  eventName: 'Get Fee Car search';
99
99
  eventType: 'GetFeeCarSearch';
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -42,9 +42,9 @@ var sleep = function (sleepTime) {
42
42
  };
43
43
  var MutexLock = /** @class */ (function () {
44
44
  function MutexLock(_a) {
45
- var _this = this;
46
45
  var redis = _a.redis, hashPrefix = _a.hashPrefix, _b = _a.mutexLockInterval, mutexLockInterval = _b === void 0 ? 50 : _b;
47
- this.getMutexLockKey = function (id) { return "" + _this.hashPrefix + id; };
46
+ var _this = this;
47
+ this.getMutexLockKey = function (id) { return "".concat(_this.hashPrefix).concat(id); };
48
48
  this.tryMutexLock = function (streamId, lockHash) {
49
49
  return _this.redis.set(_this.getMutexLockKey(streamId), lockHash, 'EX', 60, 'NX');
50
50
  };
@@ -53,7 +53,7 @@ var MutexLock = /** @class */ (function () {
53
53
  return __generator(this, function (_a) {
54
54
  switch (_a.label) {
55
55
  case 0:
56
- lockHash = uuid_1.v4();
56
+ lockHash = (0, uuid_1.v4)();
57
57
  _a.label = 1;
58
58
  case 1:
59
59
  if (!!lock) return [3 /*break*/, 4];