@vendit-dev/thirdparty-adapters 0.4.1-beta.1 → 0.4.1-beta.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.
@@ -1,109 +1,109 @@
1
- import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
2
- import MutexLock from '../utils/mutex';
3
- declare type OAuthTokenResponse = {
4
- accessToken: string;
5
- refreshToken: string;
6
- tokenType: string;
7
- expiresIn: number;
8
- };
9
- declare type OAuthRawTokenSet = {
10
- refresh_token: string;
11
- access_token: string;
12
- expires_in: number;
13
- token_type: string;
14
- };
15
- declare type SmartAccessRoom = {
16
- roomId: string;
17
- roomNumber: string;
18
- path: string;
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
- };
36
- export default class SmartAccessAdapter {
37
- static indexAccommodation: ({ accommodationId, }: {
38
- accommodationId: string;
39
- }) => string;
40
- static refineRawTokenSet: (rawTokenSet: OAuthRawTokenSet) => OAuthTokenResponse;
41
- mutexLock: MutexLock;
42
- authenticator: UserServiceGrpcCaller;
43
- redis: any;
44
- PROVIDER_KEY: string;
45
- API_HOST: string;
46
- constructor({ authenticator, redis, apiHost, }: {
47
- authenticator: UserServiceGrpcCaller;
48
- redis: any;
49
- apiHost: string;
50
- });
51
- parseJSONSafe: (str: string) => any | boolean;
52
- checkSmartAccessIntegration: ({ accommodationId, }: {
53
- accommodationId: string;
54
- }) => Promise<boolean>;
55
- getAccommodationAuthInfo: ({ accommodationId, }: {
56
- accommodationId: string;
57
- }) => Promise<OAuthTokenResponse | boolean>;
58
- getAccommodationAccessToken: (accommodationId: string) => Promise<string>;
59
- callSmartAccessApi: ({ route, accommodationId, params, method, headers, }: {
60
- route: string;
61
- accommodationId: string;
62
- params?: any;
63
- method?: string | undefined;
64
- headers?: any;
65
- }) => Promise<any>;
66
- getRoomInfo: ({ accommodationId, roomId, }: {
67
- accommodationId: string;
68
- roomId: string;
69
- }) => Promise<SmartAccessRoom>;
70
- getRooms: (accommodationId: string) => Promise<SmartAccessRoom[]>;
71
- getDevices: (accommodationId: string) => Promise<any>;
72
- getRoomsKey: (accommodationId: string, roomId: string) => Promise<{
73
- lockList: SmartAccessRoomKey[];
74
- }>;
75
- getRoomsWithDevices: (accommodationId: string) => Promise<SmartAccessRoom[]>;
76
- createPinCodeForRoom: ({ roomId, accommodationId, userType, keyType, startDate, endDate, }: {
77
- roomId: string;
78
- accommodationId: string;
79
- userType: 'GUEST' | 'EMPLOYEE';
80
- keyType: 'SCHEDULE' | 'ONETIME';
81
- startDate: Date;
82
- endDate: Date;
83
- }) => Promise<any>;
84
- modifyPinCodeByKeyId: ({ keyId, accommodationId, userType, keyType, startDate, endDate, }: {
85
- keyId: string;
86
- accommodationId: string;
87
- userType: 'GUEST' | 'EMPLOYEE';
88
- keyType: 'SCHEDULE' | 'ONETIME';
89
- startDate: Date;
90
- endDate: Date;
91
- }) => Promise<any>;
92
- deletePinCodeByKeyId: ({ keyId, accommodationId, }: {
93
- keyId: string;
94
- accommodationId: string;
95
- }) => Promise<any>;
96
- openLockByRoomId: ({ accommodationId, roomId, keyId, }: {
97
- accommodationId: string;
98
- roomId: string;
99
- keyId: string;
100
- }) => Promise<any>;
101
- getAccommodationCallbacks: ({ accommodationId, }: {
102
- accommodationId: string;
103
- }) => Promise<boolean>;
104
- getRoomByThirdPartyId: ({ accommodationId, thirdPartyId, }: {
105
- accommodationId: string;
106
- thirdPartyId: string;
107
- }) => Promise<any>;
108
- }
109
- export {};
1
+ import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
2
+ import MutexLock from '../utils/mutex';
3
+ declare type OAuthTokenResponse = {
4
+ accessToken: string;
5
+ refreshToken: string;
6
+ tokenType: string;
7
+ expiresIn: number;
8
+ };
9
+ declare type OAuthRawTokenSet = {
10
+ refresh_token: string;
11
+ access_token: string;
12
+ expires_in: number;
13
+ token_type: string;
14
+ };
15
+ declare type SmartAccessRoom = {
16
+ roomId: string;
17
+ roomNumber: string;
18
+ path: string;
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
+ };
36
+ export default class SmartAccessAdapter {
37
+ static indexAccommodation: ({ accommodationId, }: {
38
+ accommodationId: string;
39
+ }) => string;
40
+ static refineRawTokenSet: (rawTokenSet: OAuthRawTokenSet) => OAuthTokenResponse;
41
+ mutexLock: MutexLock;
42
+ authenticator: UserServiceGrpcCaller;
43
+ redis: any;
44
+ PROVIDER_KEY: string;
45
+ API_HOST: string;
46
+ constructor({ authenticator, redis, apiHost, }: {
47
+ authenticator: UserServiceGrpcCaller;
48
+ redis: any;
49
+ apiHost: string;
50
+ });
51
+ parseJSONSafe: (str: string) => any | boolean;
52
+ checkSmartAccessIntegration: ({ accommodationId, }: {
53
+ accommodationId: string;
54
+ }) => Promise<boolean>;
55
+ getAccommodationAuthInfo: ({ accommodationId, }: {
56
+ accommodationId: string;
57
+ }) => Promise<OAuthTokenResponse | boolean>;
58
+ getAccommodationAccessToken: (accommodationId: string) => Promise<string>;
59
+ callSmartAccessApi: ({ route, accommodationId, params, method, headers, }: {
60
+ route: string;
61
+ accommodationId: string;
62
+ params?: any;
63
+ method?: string | undefined;
64
+ headers?: any;
65
+ }) => Promise<any>;
66
+ getRoomInfo: ({ accommodationId, roomId, }: {
67
+ accommodationId: string;
68
+ roomId: string;
69
+ }) => Promise<SmartAccessRoom>;
70
+ getRooms: (accommodationId: string) => Promise<SmartAccessRoom[]>;
71
+ getDevices: (accommodationId: string) => Promise<any>;
72
+ getRoomsKey: (accommodationId: string, roomId: string) => Promise<{
73
+ lockList: SmartAccessRoomKey[];
74
+ }>;
75
+ getRoomsWithDevices: (accommodationId: string) => Promise<SmartAccessRoom[]>;
76
+ createPinCodeForRoom: ({ roomId, accommodationId, userType, keyType, startDate, endDate, }: {
77
+ roomId: string;
78
+ accommodationId: string;
79
+ userType: 'GUEST' | 'EMPLOYEE';
80
+ keyType: 'SCHEDULE' | 'ONETIME';
81
+ startDate: Date;
82
+ endDate: Date;
83
+ }) => Promise<any>;
84
+ modifyPinCodeByKeyId: ({ keyId, accommodationId, userType, keyType, startDate, endDate, }: {
85
+ keyId: string;
86
+ accommodationId: string;
87
+ userType: 'GUEST' | 'EMPLOYEE';
88
+ keyType: 'SCHEDULE' | 'ONETIME';
89
+ startDate: Date;
90
+ endDate: Date;
91
+ }) => Promise<any>;
92
+ deletePinCodeByKeyId: ({ keyId, accommodationId, }: {
93
+ keyId: string;
94
+ accommodationId: string;
95
+ }) => Promise<any>;
96
+ openLockByRoomId: ({ accommodationId, roomId, keyId, }: {
97
+ accommodationId: string;
98
+ roomId: string;
99
+ keyId: string;
100
+ }) => Promise<any>;
101
+ getAccommodationCallbacks: ({ accommodationId, }: {
102
+ accommodationId: string;
103
+ }) => Promise<boolean>;
104
+ getRoomByThirdPartyId: ({ accommodationId, thirdPartyId, }: {
105
+ accommodationId: string;
106
+ thirdPartyId: string;
107
+ }) => Promise<any>;
108
+ }
109
+ export {};