@vendit-dev/thirdparty-adapters 0.4.0 → 0.4.1-beta.1
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.
|
@@ -17,6 +17,22 @@ declare type SmartAccessRoom = {
|
|
|
17
17
|
roomNumber: string;
|
|
18
18
|
path: string;
|
|
19
19
|
};
|
|
20
|
+
declare type SmartAccessRoomKey = {
|
|
21
|
+
deviceId: string;
|
|
22
|
+
deviceName: string;
|
|
23
|
+
keyList: {
|
|
24
|
+
keyId: string;
|
|
25
|
+
accessStartDate: string;
|
|
26
|
+
accessEndDate: string;
|
|
27
|
+
pinCode: string;
|
|
28
|
+
userType: string;
|
|
29
|
+
keyType: string;
|
|
30
|
+
allowDayofWeek: string;
|
|
31
|
+
allowTime: string;
|
|
32
|
+
issuedDate: string;
|
|
33
|
+
issuedStatus: 'SCHEDULED' | 'COMPLETED' | 'CANCELED' | 'FAILED';
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
20
36
|
export default class SmartAccessAdapter {
|
|
21
37
|
static indexAccommodation: ({ accommodationId, }: {
|
|
22
38
|
accommodationId: string;
|
|
@@ -53,6 +69,9 @@ export default class SmartAccessAdapter {
|
|
|
53
69
|
}) => Promise<SmartAccessRoom>;
|
|
54
70
|
getRooms: (accommodationId: string) => Promise<SmartAccessRoom[]>;
|
|
55
71
|
getDevices: (accommodationId: string) => Promise<any>;
|
|
72
|
+
getRoomsKey: (accommodationId: string, roomId: string) => Promise<{
|
|
73
|
+
lockList: SmartAccessRoomKey[];
|
|
74
|
+
}>;
|
|
56
75
|
getRoomsWithDevices: (accommodationId: string) => Promise<SmartAccessRoom[]>;
|
|
57
76
|
createPinCodeForRoom: ({ roomId, accommodationId, userType, keyType, startDate, endDate, }: {
|
|
58
77
|
roomId: string;
|
|
@@ -231,6 +231,21 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
}); };
|
|
234
|
+
this.getRoomsKey = function (accommodationId, roomId) { return __awaiter(_this, void 0, void 0, function () {
|
|
235
|
+
var roomKeyResponse;
|
|
236
|
+
return __generator(this, function (_a) {
|
|
237
|
+
switch (_a.label) {
|
|
238
|
+
case 0: return [4 /*yield*/, this.callSmartAccessApi({
|
|
239
|
+
accommodationId: accommodationId,
|
|
240
|
+
method: 'get',
|
|
241
|
+
route: "v1/room/" + roomId + "/keyinfo",
|
|
242
|
+
})];
|
|
243
|
+
case 1:
|
|
244
|
+
roomKeyResponse = _a.sent();
|
|
245
|
+
return [2 /*return*/, roomKeyResponse];
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}); };
|
|
234
249
|
this.getRoomsWithDevices = function (accommodationId) { return __awaiter(_this, void 0, void 0, function () {
|
|
235
250
|
var rooms, devices, devicesRoomIdMap, roomsWithDevices;
|
|
236
251
|
return __generator(this, function (_a) {
|