@vendit-dev/thirdparty-adapters 0.3.31 → 0.4.0-beta.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.
- package/lib/adapters/amanoKorea.d.ts +75 -0
- package/lib/adapters/amanoKorea.js +292 -0
- package/lib/adapters/sanhaWings.d.ts +179 -179
- package/lib/adapters/sanhaWings.js +841 -841
- package/lib/adapters/smartAccess.d.ts +90 -103
- package/lib/adapters/smartAccess.js +465 -494
- package/lib/adapters/themrIoT.d.ts +148 -148
- package/lib/adapters/themrIoT.js +301 -305
- package/lib/index.d.ts +5 -4
- package/lib/index.js +14 -12
- package/lib/types/amanoKorea.d.ts +124 -0
- package/lib/types/amanoKorea.js +2 -0
- package/lib/utils/mutex.d.ts +14 -14
- package/lib/utils/mutex.js +93 -89
- package/package.json +43 -42
- package/readme.md +4 -4
|
@@ -1,179 +1,179 @@
|
|
|
1
|
-
import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
|
|
2
|
-
import MutexLock from '../utils/mutex';
|
|
3
|
-
declare type VenditWingsAuthInfo = {
|
|
4
|
-
scope: string;
|
|
5
|
-
credential: {
|
|
6
|
-
companyId: string;
|
|
7
|
-
vendorId: string;
|
|
8
|
-
apiKey: string;
|
|
9
|
-
kioskIp: string;
|
|
10
|
-
HOTEL_FAX_NO: string;
|
|
11
|
-
HOTEL_MAIL_ADDR: string;
|
|
12
|
-
HOTEL_TEL_NO: string;
|
|
13
|
-
BSNS_ENG_NAME: string;
|
|
14
|
-
CEO_NAME: string;
|
|
15
|
-
BSNS_OTH_NAME: string;
|
|
16
|
-
BSNS_NAME: string;
|
|
17
|
-
HOTEL_DTL_ADDR: string;
|
|
18
|
-
BSNS_CODE: string;
|
|
19
|
-
BRN: string;
|
|
20
|
-
};
|
|
21
|
-
expiresAt: number;
|
|
22
|
-
};
|
|
23
|
-
declare type WingsCommonCredential = {
|
|
24
|
-
vendorId: string;
|
|
25
|
-
companyId: string;
|
|
26
|
-
apiKey: string;
|
|
27
|
-
kioskIp: string;
|
|
28
|
-
};
|
|
29
|
-
declare type WingsApiCommonResponse = {
|
|
30
|
-
resultData: any;
|
|
31
|
-
};
|
|
32
|
-
export declare class WingsApiController {
|
|
33
|
-
URI: string;
|
|
34
|
-
CONTEXT: string;
|
|
35
|
-
constructor({ contextApi }: {
|
|
36
|
-
contextApi: string;
|
|
37
|
-
});
|
|
38
|
-
callWingsApi: ({ route, params, auth, }: {
|
|
39
|
-
route: string;
|
|
40
|
-
params?: any;
|
|
41
|
-
auth: {
|
|
42
|
-
params: any;
|
|
43
|
-
headers: any;
|
|
44
|
-
};
|
|
45
|
-
}) => Promise<WingsApiCommonResponse>;
|
|
46
|
-
}
|
|
47
|
-
export default class WingsAdapter {
|
|
48
|
-
static indexAccommodation: ({ accommodationId, }: {
|
|
49
|
-
accommodationId: string;
|
|
50
|
-
}) => string;
|
|
51
|
-
static authFromCredentials: ({ vendorId, companyId, apiKey, kioskIp, }: WingsCommonCredential) => {
|
|
52
|
-
headers: {
|
|
53
|
-
'API-KEY': string;
|
|
54
|
-
VENDOR_ID: string;
|
|
55
|
-
'API-COMPANY': string;
|
|
56
|
-
};
|
|
57
|
-
params: {
|
|
58
|
-
KIOSK_IP: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
mutexLock: MutexLock;
|
|
62
|
-
authenticator: UserServiceGrpcCaller;
|
|
63
|
-
redis: any;
|
|
64
|
-
PROVIDER_KEY: string;
|
|
65
|
-
constructor({ authenticator, redis, }: {
|
|
66
|
-
authenticator: UserServiceGrpcCaller;
|
|
67
|
-
redis: any;
|
|
68
|
-
});
|
|
69
|
-
checkWingsIntegration: ({ accommodationId, }: {
|
|
70
|
-
accommodationId: string;
|
|
71
|
-
}) => Promise<boolean>;
|
|
72
|
-
getAccommodationAuthInfo: ({ accommodationId, }: {
|
|
73
|
-
accommodationId: string;
|
|
74
|
-
}) => Promise<VenditWingsAuthInfo>;
|
|
75
|
-
getHotelInformation: ({ accommodationId, }: {
|
|
76
|
-
accommodationId: string;
|
|
77
|
-
}) => Promise<any>;
|
|
78
|
-
checkInReservation: ({ accommodationId, reservationNumber, sequenceNumber, startDate, endDate, carNumber, }: {
|
|
79
|
-
accommodationId: string;
|
|
80
|
-
reservationNumber: string;
|
|
81
|
-
sequenceNumber: string;
|
|
82
|
-
startDate: string;
|
|
83
|
-
endDate: string;
|
|
84
|
-
carNumber: string;
|
|
85
|
-
}) => Promise<any>;
|
|
86
|
-
cancelCheckInReservation: ({ accommodationId, folioNumber, }: {
|
|
87
|
-
accommodationId: string;
|
|
88
|
-
folioNumber: string;
|
|
89
|
-
}) => Promise<boolean>;
|
|
90
|
-
getReservationByNumber: ({ accommodationId, reservationNumber, }: {
|
|
91
|
-
accommodationId: string;
|
|
92
|
-
reservationNumber: string;
|
|
93
|
-
}) => Promise<any>;
|
|
94
|
-
updateReservation: ({ accommodationId, reservationNumber, mobileNumber, }: {
|
|
95
|
-
accommodationId: string;
|
|
96
|
-
reservationNumber: string;
|
|
97
|
-
mobileNumber: string;
|
|
98
|
-
}) => Promise<true | null>;
|
|
99
|
-
getPurchaseAmount: ({ accommodationId, folioNumber, }: {
|
|
100
|
-
accommodationId: string;
|
|
101
|
-
folioNumber: string;
|
|
102
|
-
}) => Promise<null | undefined>;
|
|
103
|
-
getWalkinInfo: ({ accommodationId, startDate, endDate, adultCount, childCount, langType, }: {
|
|
104
|
-
accommodationId: string;
|
|
105
|
-
startDate: string;
|
|
106
|
-
endDate: string;
|
|
107
|
-
adultCount: number;
|
|
108
|
-
childCount: number;
|
|
109
|
-
langType: string;
|
|
110
|
-
}) => Promise<{
|
|
111
|
-
walkinInfo: any;
|
|
112
|
-
roomInfo: any;
|
|
113
|
-
} | null>;
|
|
114
|
-
getWalkInRoomRate: ({ accommodationId, roomTypeCode, startDate, endDate, salesDate, }: {
|
|
115
|
-
accommodationId: string;
|
|
116
|
-
startDate: string;
|
|
117
|
-
endDate: string;
|
|
118
|
-
roomTypeCode: string;
|
|
119
|
-
salesDate: string;
|
|
120
|
-
}) => Promise<any>;
|
|
121
|
-
queryWalkinRoomTypesWithPrices: ({ accommodationId, startDate, endDate, adultCount, childCount, langType, }: {
|
|
122
|
-
accommodationId: string;
|
|
123
|
-
startDate: string;
|
|
124
|
-
endDate: string;
|
|
125
|
-
adultCount: number;
|
|
126
|
-
childCount: number;
|
|
127
|
-
langType: string;
|
|
128
|
-
}) => Promise<{
|
|
129
|
-
walkinInfo: any;
|
|
130
|
-
roomInfo: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown];
|
|
131
|
-
} | null>;
|
|
132
|
-
processWalkIn: ({ accommodationId, roomTypeCode, startDate, endDate, nights, salesDate, guestName, adultCount, childCount, dailyRoomFees, carNumber, mobileNumber, }: {
|
|
133
|
-
accommodationId: string;
|
|
134
|
-
roomTypeCode: string;
|
|
135
|
-
startDate: string;
|
|
136
|
-
endDate: string;
|
|
137
|
-
nights: number;
|
|
138
|
-
salesDate: string;
|
|
139
|
-
guestName: string;
|
|
140
|
-
adultCount: number;
|
|
141
|
-
childCount: number;
|
|
142
|
-
dailyRoomFees: Array<string>;
|
|
143
|
-
carNumber: string;
|
|
144
|
-
mobileNumber: string;
|
|
145
|
-
}) => Promise<any>;
|
|
146
|
-
getCheckOutInfo: ({ accommodationId, folioNumber, roomKey, }: {
|
|
147
|
-
accommodationId: string;
|
|
148
|
-
folioNumber: string;
|
|
149
|
-
roomKey: string;
|
|
150
|
-
}) => Promise<any>;
|
|
151
|
-
processCheckOut: ({ accommodationId, folioNumber, }: {
|
|
152
|
-
accommodationId: string;
|
|
153
|
-
folioNumber: string;
|
|
154
|
-
}) => Promise<any>;
|
|
155
|
-
reportKeyIssue: ({ accommodationId, folioNumber, roomNumber, registerDate, issuedCount, resultMessage, }: {
|
|
156
|
-
accommodationId: string;
|
|
157
|
-
folioNumber: string;
|
|
158
|
-
roomNumber: string;
|
|
159
|
-
registerDate: string;
|
|
160
|
-
issuedCount: number;
|
|
161
|
-
resultMessage: string;
|
|
162
|
-
}) => Promise<any>;
|
|
163
|
-
reportKeyRetrieve: ({ accommodationId, folioNumber, }: {
|
|
164
|
-
accommodationId: string;
|
|
165
|
-
folioNumber: string;
|
|
166
|
-
}) => Promise<any>;
|
|
167
|
-
savePayment: ({ accommodationId, folioNumber, paymentAmount, saleDate, paymentInfo, }: {
|
|
168
|
-
accommodationId: string;
|
|
169
|
-
folioNumber: string;
|
|
170
|
-
paymentAmount: string;
|
|
171
|
-
saleDate: string;
|
|
172
|
-
paymentInfo: string;
|
|
173
|
-
}) => Promise<any>;
|
|
174
|
-
savePaymentWithPaymentId: ({ paymentId, folioNumber, }: {
|
|
175
|
-
paymentId: string;
|
|
176
|
-
folioNumber: string;
|
|
177
|
-
}) => Promise<null | undefined>;
|
|
178
|
-
}
|
|
179
|
-
export {};
|
|
1
|
+
import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
|
|
2
|
+
import MutexLock from '../utils/mutex';
|
|
3
|
+
declare type VenditWingsAuthInfo = {
|
|
4
|
+
scope: string;
|
|
5
|
+
credential: {
|
|
6
|
+
companyId: string;
|
|
7
|
+
vendorId: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
kioskIp: string;
|
|
10
|
+
HOTEL_FAX_NO: string;
|
|
11
|
+
HOTEL_MAIL_ADDR: string;
|
|
12
|
+
HOTEL_TEL_NO: string;
|
|
13
|
+
BSNS_ENG_NAME: string;
|
|
14
|
+
CEO_NAME: string;
|
|
15
|
+
BSNS_OTH_NAME: string;
|
|
16
|
+
BSNS_NAME: string;
|
|
17
|
+
HOTEL_DTL_ADDR: string;
|
|
18
|
+
BSNS_CODE: string;
|
|
19
|
+
BRN: string;
|
|
20
|
+
};
|
|
21
|
+
expiresAt: number;
|
|
22
|
+
};
|
|
23
|
+
declare type WingsCommonCredential = {
|
|
24
|
+
vendorId: string;
|
|
25
|
+
companyId: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
kioskIp: string;
|
|
28
|
+
};
|
|
29
|
+
declare type WingsApiCommonResponse = {
|
|
30
|
+
resultData: any;
|
|
31
|
+
};
|
|
32
|
+
export declare class WingsApiController {
|
|
33
|
+
URI: string;
|
|
34
|
+
CONTEXT: string;
|
|
35
|
+
constructor({ contextApi }: {
|
|
36
|
+
contextApi: string;
|
|
37
|
+
});
|
|
38
|
+
callWingsApi: ({ route, params, auth, }: {
|
|
39
|
+
route: string;
|
|
40
|
+
params?: any;
|
|
41
|
+
auth: {
|
|
42
|
+
params: any;
|
|
43
|
+
headers: any;
|
|
44
|
+
};
|
|
45
|
+
}) => Promise<WingsApiCommonResponse>;
|
|
46
|
+
}
|
|
47
|
+
export default class WingsAdapter {
|
|
48
|
+
static indexAccommodation: ({ accommodationId, }: {
|
|
49
|
+
accommodationId: string;
|
|
50
|
+
}) => string;
|
|
51
|
+
static authFromCredentials: ({ vendorId, companyId, apiKey, kioskIp, }: WingsCommonCredential) => {
|
|
52
|
+
headers: {
|
|
53
|
+
'API-KEY': string;
|
|
54
|
+
VENDOR_ID: string;
|
|
55
|
+
'API-COMPANY': string;
|
|
56
|
+
};
|
|
57
|
+
params: {
|
|
58
|
+
KIOSK_IP: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
mutexLock: MutexLock;
|
|
62
|
+
authenticator: UserServiceGrpcCaller;
|
|
63
|
+
redis: any;
|
|
64
|
+
PROVIDER_KEY: string;
|
|
65
|
+
constructor({ authenticator, redis, }: {
|
|
66
|
+
authenticator: UserServiceGrpcCaller;
|
|
67
|
+
redis: any;
|
|
68
|
+
});
|
|
69
|
+
checkWingsIntegration: ({ accommodationId, }: {
|
|
70
|
+
accommodationId: string;
|
|
71
|
+
}) => Promise<boolean>;
|
|
72
|
+
getAccommodationAuthInfo: ({ accommodationId, }: {
|
|
73
|
+
accommodationId: string;
|
|
74
|
+
}) => Promise<VenditWingsAuthInfo>;
|
|
75
|
+
getHotelInformation: ({ accommodationId, }: {
|
|
76
|
+
accommodationId: string;
|
|
77
|
+
}) => Promise<any>;
|
|
78
|
+
checkInReservation: ({ accommodationId, reservationNumber, sequenceNumber, startDate, endDate, carNumber, }: {
|
|
79
|
+
accommodationId: string;
|
|
80
|
+
reservationNumber: string;
|
|
81
|
+
sequenceNumber: string;
|
|
82
|
+
startDate: string;
|
|
83
|
+
endDate: string;
|
|
84
|
+
carNumber: string;
|
|
85
|
+
}) => Promise<any>;
|
|
86
|
+
cancelCheckInReservation: ({ accommodationId, folioNumber, }: {
|
|
87
|
+
accommodationId: string;
|
|
88
|
+
folioNumber: string;
|
|
89
|
+
}) => Promise<boolean>;
|
|
90
|
+
getReservationByNumber: ({ accommodationId, reservationNumber, }: {
|
|
91
|
+
accommodationId: string;
|
|
92
|
+
reservationNumber: string;
|
|
93
|
+
}) => Promise<any>;
|
|
94
|
+
updateReservation: ({ accommodationId, reservationNumber, mobileNumber, }: {
|
|
95
|
+
accommodationId: string;
|
|
96
|
+
reservationNumber: string;
|
|
97
|
+
mobileNumber: string;
|
|
98
|
+
}) => Promise<true | null>;
|
|
99
|
+
getPurchaseAmount: ({ accommodationId, folioNumber, }: {
|
|
100
|
+
accommodationId: string;
|
|
101
|
+
folioNumber: string;
|
|
102
|
+
}) => Promise<null | undefined>;
|
|
103
|
+
getWalkinInfo: ({ accommodationId, startDate, endDate, adultCount, childCount, langType, }: {
|
|
104
|
+
accommodationId: string;
|
|
105
|
+
startDate: string;
|
|
106
|
+
endDate: string;
|
|
107
|
+
adultCount: number;
|
|
108
|
+
childCount: number;
|
|
109
|
+
langType: string;
|
|
110
|
+
}) => Promise<{
|
|
111
|
+
walkinInfo: any;
|
|
112
|
+
roomInfo: any;
|
|
113
|
+
} | null>;
|
|
114
|
+
getWalkInRoomRate: ({ accommodationId, roomTypeCode, startDate, endDate, salesDate, }: {
|
|
115
|
+
accommodationId: string;
|
|
116
|
+
startDate: string;
|
|
117
|
+
endDate: string;
|
|
118
|
+
roomTypeCode: string;
|
|
119
|
+
salesDate: string;
|
|
120
|
+
}) => Promise<any>;
|
|
121
|
+
queryWalkinRoomTypesWithPrices: ({ accommodationId, startDate, endDate, adultCount, childCount, langType, }: {
|
|
122
|
+
accommodationId: string;
|
|
123
|
+
startDate: string;
|
|
124
|
+
endDate: string;
|
|
125
|
+
adultCount: number;
|
|
126
|
+
childCount: number;
|
|
127
|
+
langType: string;
|
|
128
|
+
}) => Promise<{
|
|
129
|
+
walkinInfo: any;
|
|
130
|
+
roomInfo: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown];
|
|
131
|
+
} | null>;
|
|
132
|
+
processWalkIn: ({ accommodationId, roomTypeCode, startDate, endDate, nights, salesDate, guestName, adultCount, childCount, dailyRoomFees, carNumber, mobileNumber, }: {
|
|
133
|
+
accommodationId: string;
|
|
134
|
+
roomTypeCode: string;
|
|
135
|
+
startDate: string;
|
|
136
|
+
endDate: string;
|
|
137
|
+
nights: number;
|
|
138
|
+
salesDate: string;
|
|
139
|
+
guestName: string;
|
|
140
|
+
adultCount: number;
|
|
141
|
+
childCount: number;
|
|
142
|
+
dailyRoomFees: Array<string>;
|
|
143
|
+
carNumber: string;
|
|
144
|
+
mobileNumber: string;
|
|
145
|
+
}) => Promise<any>;
|
|
146
|
+
getCheckOutInfo: ({ accommodationId, folioNumber, roomKey, }: {
|
|
147
|
+
accommodationId: string;
|
|
148
|
+
folioNumber: string;
|
|
149
|
+
roomKey: string;
|
|
150
|
+
}) => Promise<any>;
|
|
151
|
+
processCheckOut: ({ accommodationId, folioNumber, }: {
|
|
152
|
+
accommodationId: string;
|
|
153
|
+
folioNumber: string;
|
|
154
|
+
}) => Promise<any>;
|
|
155
|
+
reportKeyIssue: ({ accommodationId, folioNumber, roomNumber, registerDate, issuedCount, resultMessage, }: {
|
|
156
|
+
accommodationId: string;
|
|
157
|
+
folioNumber: string;
|
|
158
|
+
roomNumber: string;
|
|
159
|
+
registerDate: string;
|
|
160
|
+
issuedCount: number;
|
|
161
|
+
resultMessage: string;
|
|
162
|
+
}) => Promise<any>;
|
|
163
|
+
reportKeyRetrieve: ({ accommodationId, folioNumber, }: {
|
|
164
|
+
accommodationId: string;
|
|
165
|
+
folioNumber: string;
|
|
166
|
+
}) => Promise<any>;
|
|
167
|
+
savePayment: ({ accommodationId, folioNumber, paymentAmount, saleDate, paymentInfo, }: {
|
|
168
|
+
accommodationId: string;
|
|
169
|
+
folioNumber: string;
|
|
170
|
+
paymentAmount: string;
|
|
171
|
+
saleDate: string;
|
|
172
|
+
paymentInfo: string;
|
|
173
|
+
}) => Promise<any>;
|
|
174
|
+
savePaymentWithPaymentId: ({ paymentId, folioNumber, }: {
|
|
175
|
+
paymentId: string;
|
|
176
|
+
folioNumber: string;
|
|
177
|
+
}) => Promise<null | undefined>;
|
|
178
|
+
}
|
|
179
|
+
export {};
|