@roomstay/core 0.2.0-9 → 0.2.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.
- package/dist/node.js +1 -1
- package/dist/types/Analytics/IAnalyticsDailyRow.type.d.ts +26 -0
- package/dist/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts +14 -12
- package/dist/types/AnalyticsEvents/MetaCapiTransformer.d.ts +1 -6
- package/dist/types/Availability/Availability.types.d.ts +1 -0
- package/dist/types/Booking/IBookingExtraFields.type.d.ts +5 -0
- package/dist/types/Booking/PlaceBooking.types.d.ts +0 -1
- package/dist/types/Company/IAdminCompany.type.d.ts +3 -0
- package/dist/types/Company/IAdminCompanyUser.type.d.ts +10 -0
- package/dist/types/DisplayPolicy/EDisplayPolicyRuleType.enum.d.ts +1 -1
- package/dist/types/DisplayPolicy/IDisplayPolicy.type.d.ts +9 -2
- package/dist/types/General/IEntityValidity.type.d.ts +11 -0
- package/dist/types/GoogleAds/IGoogleAdsDailyRow.type.d.ts +4 -0
- package/dist/types/Hotel/IAuxiliaryFilter.type.d.ts +5 -1
- package/dist/types/Maintenance/IMaintenanceStatus.type.d.ts +1 -4
- package/dist/types/Member/IMemberVerification.type.d.ts +0 -3
- package/dist/types/Member/IRoomstayMember.type.d.ts +1 -2
- package/dist/types/MetaAds/IMetaAdsDailyRow.type.d.ts +4 -0
- package/dist/types/Metasearch/IMetasearchDailyRow.type.d.ts +8 -0
- package/dist/types/Newbook/ENewbookSyncStrategy.enum.d.ts +0 -1
- package/dist/types/PMSSync/index.d.ts +0 -15
- package/dist/types/Package/Package.types.d.ts +1 -0
- package/dist/types/Permission/IPermission.type.d.ts +152 -0
- package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -5
- package/dist/types/Role/IRole.type.d.ts +15 -0
- package/dist/types/Rules/DisplayPolicyEffect.schema.d.ts +22 -0
- package/dist/types/Rules/ERuleType.enum.d.ts +19 -0
- package/dist/types/Rules/Rule.schema.d.ts +124 -0
- package/dist/types/index.d.ts +17 -11
- package/dist/utils/roundMoney.d.ts +1 -11
- package/dist/web.js +1 -1
- package/package.json +1 -1
- package/dist/types/Addon/Addon.enum.d.ts +0 -14
- package/dist/types/Addon/Addon.type.d.ts +0 -24
- package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +0 -11
- package/dist/types/Booking/IBookingStatus.type.d.ts +0 -5
- package/dist/types/Booking/IPrice.type.d.ts +0 -7
- package/dist/types/DisplayPolicy/ERuleType.d.ts +0 -6
- package/dist/types/DisplayPolicy/ERuleType.enum.d.ts +0 -6
- package/dist/types/DisplayPolicy/IDisplayPolicy.d.ts +0 -25
- package/dist/types/Member/IRoomstayMemberLoyalty.type.d.ts +0 -16
- package/dist/types/RMS/ERMSAuthSyncHistoryStatus.type.d.ts +0 -8
- package/dist/types/RMS/IRMSSyncResponse.type.d.ts +0 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type IMaintenanceStatus = {
|
|
2
|
+
uuid: string;
|
|
2
3
|
/**
|
|
3
4
|
* Which service is currently experiencing issues.
|
|
4
5
|
*/
|
|
@@ -9,10 +10,6 @@ export type IMaintenanceStatus = {
|
|
|
9
10
|
* @example 2023-10-01T00:00:00Z
|
|
10
11
|
*/
|
|
11
12
|
startDate: string;
|
|
12
|
-
/**
|
|
13
|
-
* UUID generated on create. Is not used as a primary key, or an index.
|
|
14
|
-
*/
|
|
15
|
-
uuid: string;
|
|
16
13
|
endDate: string;
|
|
17
14
|
/**
|
|
18
15
|
* Whether the status is currently in effect or not
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRoomstayCognitoMember, IRoomstayMemberBooking, IRoomstayMemberCards
|
|
1
|
+
import { IRoomstayCognitoMember, IRoomstayMemberBooking, IRoomstayMemberCards } from '../index.js';
|
|
2
2
|
export interface IRoomstayMember extends IRoomstayCognitoMember {
|
|
3
3
|
username: string;
|
|
4
4
|
email: string;
|
|
@@ -15,5 +15,4 @@ export interface IRoomstayMember extends IRoomstayCognitoMember {
|
|
|
15
15
|
defaultCard: string;
|
|
16
16
|
bookings: IRoomstayMemberBooking[];
|
|
17
17
|
cards: IRoomstayMemberCards[];
|
|
18
|
-
loyalty?: IRoomstayMemberLoyalty[];
|
|
19
18
|
}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
export * from './EPMSSyncStatus.enum';
|
|
2
2
|
export * from './IPMSSyncResponse.type';
|
|
3
|
-
export declare enum ERMSAuthSyncHistoryStatus {
|
|
4
|
-
Success = "success",
|
|
5
|
-
Failure = "failure",
|
|
6
|
-
New = "new",
|
|
7
|
-
Queued = "queued",
|
|
8
|
-
InProgress = "in_progress",
|
|
9
|
-
RequireResume = "require_resume"
|
|
10
|
-
}
|
|
11
|
-
export type IRMSSyncResponse = {
|
|
12
|
-
id: number;
|
|
13
|
-
status: ERMSAuthSyncHistoryStatus;
|
|
14
|
-
additionalData: any;
|
|
15
|
-
syncData: string | null;
|
|
16
|
-
syncType: string;
|
|
17
|
-
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export type IPermission = {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
group: string;
|
|
6
|
+
deletedDate?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function getAllPermissions(): readonly Omit<IPermission, 'id'>[];
|
|
9
|
+
export declare function getAllLimitedPermissions(): readonly Omit<IPermission, 'id'>[];
|
|
10
|
+
export declare const Permissions: {
|
|
11
|
+
readonly USER_VIEW: {
|
|
12
|
+
readonly name: "user:view";
|
|
13
|
+
readonly label: "View User";
|
|
14
|
+
readonly group: "User Management";
|
|
15
|
+
};
|
|
16
|
+
readonly USER_MODIFY: {
|
|
17
|
+
readonly name: "user:modify";
|
|
18
|
+
readonly label: "Modify User";
|
|
19
|
+
readonly group: "User Management";
|
|
20
|
+
};
|
|
21
|
+
readonly ROLE_VIEW: {
|
|
22
|
+
readonly name: "role:view";
|
|
23
|
+
readonly label: "View Role";
|
|
24
|
+
readonly group: "User Management";
|
|
25
|
+
};
|
|
26
|
+
readonly ROLE_MODIFY: {
|
|
27
|
+
readonly name: "role:modify";
|
|
28
|
+
readonly label: "Modify Role";
|
|
29
|
+
readonly group: "User Management";
|
|
30
|
+
};
|
|
31
|
+
readonly HOTEL_MODIFY: {
|
|
32
|
+
readonly name: "hotel:modify";
|
|
33
|
+
readonly label: "Modify Hotel";
|
|
34
|
+
readonly group: "Property Configuration";
|
|
35
|
+
};
|
|
36
|
+
readonly HOTEL_INTEGRATIONS: {
|
|
37
|
+
readonly name: "hotelIntegrations:modify";
|
|
38
|
+
readonly label: "Modify Hotel Integrations";
|
|
39
|
+
readonly group: "Property Configuration";
|
|
40
|
+
};
|
|
41
|
+
readonly FEE_VIEW: {
|
|
42
|
+
readonly name: "fee:view";
|
|
43
|
+
readonly label: "View Fee";
|
|
44
|
+
readonly group: "Property Configuration";
|
|
45
|
+
};
|
|
46
|
+
readonly FEE_MODIFY: {
|
|
47
|
+
readonly name: "fee:modify";
|
|
48
|
+
readonly label: "Modify Fee";
|
|
49
|
+
readonly group: "Property Configuration";
|
|
50
|
+
};
|
|
51
|
+
readonly GUARANTEE_POLICIES_VIEW: {
|
|
52
|
+
readonly name: "guaranteePolicies:view";
|
|
53
|
+
readonly label: "View Guarantee Policies";
|
|
54
|
+
readonly group: "Policy Management";
|
|
55
|
+
};
|
|
56
|
+
readonly GUARANTEE_POLICIES_MODIFY: {
|
|
57
|
+
readonly name: "guaranteePolicies:modify";
|
|
58
|
+
readonly label: "Modify Guarantee Policies";
|
|
59
|
+
readonly group: "Policy Management";
|
|
60
|
+
};
|
|
61
|
+
readonly CANCELLATION_POLICIES_VIEW: {
|
|
62
|
+
readonly name: "cancellationPolicies:view";
|
|
63
|
+
readonly label: "View Cancellation Policies";
|
|
64
|
+
readonly group: "Policy Management";
|
|
65
|
+
};
|
|
66
|
+
readonly CANCELLATION_POLICIES_MODIFY: {
|
|
67
|
+
readonly name: "cancellationPolicies:modify";
|
|
68
|
+
readonly label: "Modify Cancellation Policies";
|
|
69
|
+
readonly group: "Policy Management";
|
|
70
|
+
};
|
|
71
|
+
readonly ROOM_VIEW: {
|
|
72
|
+
readonly name: "room:view";
|
|
73
|
+
readonly label: "View Room";
|
|
74
|
+
readonly group: "Room, Rate and Addon Management";
|
|
75
|
+
};
|
|
76
|
+
readonly ROOM_MODIFY: {
|
|
77
|
+
readonly name: "room:modify";
|
|
78
|
+
readonly label: "Modify Room";
|
|
79
|
+
readonly group: "Room, Rate and Addon Management";
|
|
80
|
+
};
|
|
81
|
+
readonly ROOM_GROUPING_VIEW: {
|
|
82
|
+
readonly name: "roomGrouping:view";
|
|
83
|
+
readonly label: "View Room Grouping";
|
|
84
|
+
readonly group: "Room, Rate and Addon Management";
|
|
85
|
+
};
|
|
86
|
+
readonly ROOM_GROUPING_MODIFY: {
|
|
87
|
+
readonly name: "roomGrouping:modify";
|
|
88
|
+
readonly label: "Modify Room Grouping";
|
|
89
|
+
readonly group: "Room, Rate and Addon Management";
|
|
90
|
+
};
|
|
91
|
+
readonly RATE_VIEW: {
|
|
92
|
+
readonly name: "rate:view";
|
|
93
|
+
readonly label: "View Rate";
|
|
94
|
+
readonly group: "Room, Rate and Addon Management";
|
|
95
|
+
};
|
|
96
|
+
readonly RATE_MODIFY: {
|
|
97
|
+
readonly name: "rate:modify";
|
|
98
|
+
readonly label: "Modify Rate";
|
|
99
|
+
readonly group: "Room, Rate and Addon Management";
|
|
100
|
+
};
|
|
101
|
+
readonly ADDON_VIEW: {
|
|
102
|
+
readonly name: "addon:view";
|
|
103
|
+
readonly label: "View Addon";
|
|
104
|
+
readonly group: "Room, Rate and Addon Management";
|
|
105
|
+
};
|
|
106
|
+
readonly ADDON_MODIFY: {
|
|
107
|
+
readonly name: "addon:modify";
|
|
108
|
+
readonly label: "Modify Addon";
|
|
109
|
+
readonly group: "Room, Rate and Addon Management";
|
|
110
|
+
};
|
|
111
|
+
readonly PROMO_CODE_VIEW: {
|
|
112
|
+
readonly name: "promoCode:view";
|
|
113
|
+
readonly label: "View Promo Code";
|
|
114
|
+
readonly group: "Room, Rate and Addon Management";
|
|
115
|
+
};
|
|
116
|
+
readonly PROMO_CODE_MODIFY: {
|
|
117
|
+
readonly name: "promoCode:modify";
|
|
118
|
+
readonly label: "Modify Promo Code";
|
|
119
|
+
readonly group: "Room, Rate and Addon Management";
|
|
120
|
+
};
|
|
121
|
+
readonly BOOKING_VIEW: {
|
|
122
|
+
readonly name: "booking:view";
|
|
123
|
+
readonly label: "View Booking";
|
|
124
|
+
readonly group: "Booking Management";
|
|
125
|
+
};
|
|
126
|
+
readonly BOOKING_EXPORT: {
|
|
127
|
+
readonly name: "booking:export";
|
|
128
|
+
readonly label: "Export Booking";
|
|
129
|
+
readonly group: "Booking Management";
|
|
130
|
+
};
|
|
131
|
+
readonly EVENTS_VIEW: {
|
|
132
|
+
readonly name: "events:view";
|
|
133
|
+
readonly label: "View Event";
|
|
134
|
+
readonly group: "Events and Calendar Highlights";
|
|
135
|
+
};
|
|
136
|
+
readonly EVENTS_MODIFY: {
|
|
137
|
+
readonly name: "events:modify";
|
|
138
|
+
readonly label: "Modify Event";
|
|
139
|
+
readonly group: "Events and Calendar Highlights";
|
|
140
|
+
};
|
|
141
|
+
readonly CALENDAR_HIGHLIGHTS_VIEW: {
|
|
142
|
+
readonly name: "calendarHighlights:view";
|
|
143
|
+
readonly label: "View Calendar Highlight";
|
|
144
|
+
readonly group: "Events and Calendar Highlights";
|
|
145
|
+
};
|
|
146
|
+
readonly CALENDAR_HIGHLIGHTS_MODIFY: {
|
|
147
|
+
readonly name: "calendarHighlights:modify";
|
|
148
|
+
readonly label: "Modify Calendar Highlight";
|
|
149
|
+
readonly group: "Events and Calendar Highlights";
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export type PermissionType = typeof Permissions[keyof typeof Permissions];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IPermission } from '../Permission/IPermission.type';
|
|
2
|
+
import { IAdminCompany } from '../Company/IAdminCompany.type';
|
|
3
|
+
export interface IRole {
|
|
4
|
+
id: number;
|
|
5
|
+
companyId: IAdminCompany['id'];
|
|
6
|
+
name: string;
|
|
7
|
+
totalPermissions?: number;
|
|
8
|
+
permissions?: IPermission[];
|
|
9
|
+
deletedDate?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IRolePayload {
|
|
12
|
+
id: number;
|
|
13
|
+
name: string;
|
|
14
|
+
permissionIds?: IPermission['id'][];
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { EDisplayPolicyExclusiveMode } from '../DisplayPolicy/IDisplayPolicy.type';
|
|
3
|
+
/**
|
|
4
|
+
* Every DisplayPolicy has *rules* (predicates that gate when it applies) and an *effect*
|
|
5
|
+
* (what it does to its bound rates):
|
|
6
|
+
*
|
|
7
|
+
* - `visibility` — show the bound rates only when the rules pass (no config needed).
|
|
8
|
+
* - `exclusivity` — show only the cheapest / most expensive of the bound rates.
|
|
9
|
+
*/
|
|
10
|
+
export type EDisplayPolicyEffectType = 'visibility' | 'exclusivity';
|
|
11
|
+
export declare const DISPLAY_POLICY_EFFECT_TYPES: EDisplayPolicyEffectType[];
|
|
12
|
+
export declare const EDisplayPolicyEffectTypeSchema: z.ZodEnum<{
|
|
13
|
+
visibility: "visibility";
|
|
14
|
+
exclusivity: "exclusivity";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const ExclusivityEffectConfigSchema: z.ZodObject<{
|
|
17
|
+
mode: z.ZodEnum<{
|
|
18
|
+
Cheapest: EDisplayPolicyExclusiveMode.Cheapest;
|
|
19
|
+
MostExpensive: EDisplayPolicyExclusiveMode.MostExpensive;
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type IExclusivityEffectConfig = z.infer<typeof ExclusivityEffectConfigSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared library of reusable Rules — predicates over a context, written once
|
|
3
|
+
* and used by every subject (DisplayPolicy rate visibility, RMS discount applicability,
|
|
4
|
+
* PromoCode eligibility).
|
|
5
|
+
*
|
|
6
|
+
* `AnyOf` = OR (`.some`), `AllOf` = AND (`.every`); both are shaped `{ rules: IRule[] }`.
|
|
7
|
+
* The top-level rule list of any subject is an implicit root AND.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ERuleType {
|
|
10
|
+
Schedule = "Schedule",
|
|
11
|
+
GeoLock = "GeoLock",
|
|
12
|
+
DeviceTarget = "DeviceTarget",
|
|
13
|
+
HotelRestriction = "HotelRestriction",
|
|
14
|
+
RoomRestriction = "RoomRestriction",
|
|
15
|
+
RateRestriction = "RateRestriction",
|
|
16
|
+
StayLength = "StayLength",
|
|
17
|
+
AnyOf = "AnyOf",
|
|
18
|
+
AllOf = "AllOf"
|
|
19
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { EDisplayPolicyDeviceTarget } from '../DisplayPolicy/IDisplayPolicy.type';
|
|
3
|
+
import { ERuleType } from './ERuleType.enum';
|
|
4
|
+
/**
|
|
5
|
+
* Which date a Schedule rule's windows test.
|
|
6
|
+
*
|
|
7
|
+
* - `bookingTime` → `hotel.now()` (the moment the booking is being made)
|
|
8
|
+
* - `arrivalDate` → the stay's check-in date
|
|
9
|
+
* - `stayDates` → a single night under test (per-night pass only)
|
|
10
|
+
*
|
|
11
|
+
* `mode` replaces the legacy `type: 'clock' | 'stay'` field, which collided with the
|
|
12
|
+
* per-window `type: 'include' | 'exclude'` and misleadingly called the arrival date "stay".
|
|
13
|
+
*/
|
|
14
|
+
export declare enum EScheduleMode {
|
|
15
|
+
BookingTime = "bookingTime",
|
|
16
|
+
ArrivalDate = "arrivalDate",
|
|
17
|
+
StayDates = "stayDates"
|
|
18
|
+
}
|
|
19
|
+
export declare const ScheduleWindowSchema: z.ZodObject<{
|
|
20
|
+
type: z.ZodEnum<{
|
|
21
|
+
include: "include";
|
|
22
|
+
exclude: "exclude";
|
|
23
|
+
}>;
|
|
24
|
+
startDate: z.ZodString;
|
|
25
|
+
endDate: z.ZodString;
|
|
26
|
+
rrule: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const ScheduleConfigSchema: z.ZodObject<{
|
|
29
|
+
mode: z.ZodEnum<{
|
|
30
|
+
bookingTime: EScheduleMode.BookingTime;
|
|
31
|
+
arrivalDate: EScheduleMode.ArrivalDate;
|
|
32
|
+
stayDates: EScheduleMode.StayDates;
|
|
33
|
+
}>;
|
|
34
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
35
|
+
type: z.ZodEnum<{
|
|
36
|
+
include: "include";
|
|
37
|
+
exclude: "exclude";
|
|
38
|
+
}>;
|
|
39
|
+
startDate: z.ZodString;
|
|
40
|
+
endDate: z.ZodString;
|
|
41
|
+
rrule: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const GeoLockConfigSchema: z.ZodObject<{
|
|
45
|
+
applicableCountryCodes: z.ZodArray<z.ZodString>;
|
|
46
|
+
mode: z.ZodEnum<{
|
|
47
|
+
block: "block";
|
|
48
|
+
allow: "allow";
|
|
49
|
+
}>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const DeviceTargetConfigSchema: z.ZodObject<{
|
|
52
|
+
allowedDevices: z.ZodArray<z.ZodEnum<{
|
|
53
|
+
desktop: EDisplayPolicyDeviceTarget.Desktop;
|
|
54
|
+
mobile: EDisplayPolicyDeviceTarget.Mobile;
|
|
55
|
+
}>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export declare const HotelRestrictionConfigSchema: z.ZodObject<{
|
|
58
|
+
providerIds: z.ZodArray<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare const RoomRestrictionConfigSchema: z.ZodObject<{
|
|
61
|
+
roomCodes: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const RateRestrictionConfigSchema: z.ZodObject<{
|
|
64
|
+
rateCodes: z.ZodArray<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const StayLengthConfigSchema: z.ZodObject<{
|
|
67
|
+
minNights: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
maxNights: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type IScheduleConfig = z.infer<typeof ScheduleConfigSchema>;
|
|
71
|
+
export type IScheduleWindow = z.infer<typeof ScheduleWindowSchema>;
|
|
72
|
+
export type IGeoLockConfig = z.infer<typeof GeoLockConfigSchema>;
|
|
73
|
+
export type IDeviceTargetConfig = z.infer<typeof DeviceTargetConfigSchema>;
|
|
74
|
+
export type IHotelRestrictionConfig = z.infer<typeof HotelRestrictionConfigSchema>;
|
|
75
|
+
export type IRoomRestrictionConfig = z.infer<typeof RoomRestrictionConfigSchema>;
|
|
76
|
+
export type IRateRestrictionConfig = z.infer<typeof RateRestrictionConfigSchema>;
|
|
77
|
+
export type IStayLengthConfig = z.infer<typeof StayLengthConfigSchema>;
|
|
78
|
+
/** `AnyOf`/`AllOf` config: a nested rule list. `AnyOf` = OR, `AllOf` = AND. */
|
|
79
|
+
export interface ICompositeConfig {
|
|
80
|
+
rules: IRule[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The canonical rule — a discriminated union that ties each `ruleType` to its config shape,
|
|
84
|
+
* so constructing a rule with the wrong configuration is a compile error. Use this everywhere
|
|
85
|
+
* rules are *built* (the RMS sync mapper, the write path).
|
|
86
|
+
*/
|
|
87
|
+
export type IRule = {
|
|
88
|
+
ruleType: ERuleType.Schedule;
|
|
89
|
+
configuration: IScheduleConfig;
|
|
90
|
+
} | {
|
|
91
|
+
ruleType: ERuleType.GeoLock;
|
|
92
|
+
configuration: IGeoLockConfig;
|
|
93
|
+
} | {
|
|
94
|
+
ruleType: ERuleType.DeviceTarget;
|
|
95
|
+
configuration: IDeviceTargetConfig;
|
|
96
|
+
} | {
|
|
97
|
+
ruleType: ERuleType.HotelRestriction;
|
|
98
|
+
configuration: IHotelRestrictionConfig;
|
|
99
|
+
} | {
|
|
100
|
+
ruleType: ERuleType.RoomRestriction;
|
|
101
|
+
configuration: IRoomRestrictionConfig;
|
|
102
|
+
} | {
|
|
103
|
+
ruleType: ERuleType.RateRestriction;
|
|
104
|
+
configuration: IRateRestrictionConfig;
|
|
105
|
+
} | {
|
|
106
|
+
ruleType: ERuleType.StayLength;
|
|
107
|
+
configuration: IStayLengthConfig;
|
|
108
|
+
} | {
|
|
109
|
+
ruleType: ERuleType.AnyOf;
|
|
110
|
+
configuration: ICompositeConfig;
|
|
111
|
+
} | {
|
|
112
|
+
ruleType: ERuleType.AllOf;
|
|
113
|
+
configuration: ICompositeConfig;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* A persisted / dynamically-edited rule row whose `configuration` hasn't been validated yet
|
|
117
|
+
* (a JSON DB column, an HTTP body, an admin field-array row). Narrow it to {@link IRule} with
|
|
118
|
+
* {@link RuleSchema}.parse — parse returns the typed value, so narrowing never needs a cast.
|
|
119
|
+
*/
|
|
120
|
+
export type IStoredRule = {
|
|
121
|
+
ruleType: ERuleType;
|
|
122
|
+
configuration: unknown;
|
|
123
|
+
};
|
|
124
|
+
export declare const RuleSchema: z.ZodType<IRule>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export * from './Booking/PlaceBooking.types';
|
|
|
22
22
|
export * from './Company/ECompanyProvider.enum';
|
|
23
23
|
export * from './Company/IAdminCompany.type';
|
|
24
24
|
export * from './Company/IAdminCompanyUser.type';
|
|
25
|
+
/**
|
|
26
|
+
* Media
|
|
27
|
+
*/
|
|
28
|
+
export * from './Media/IMedia.type';
|
|
25
29
|
/**
|
|
26
30
|
* Hotel
|
|
27
31
|
*/
|
|
@@ -79,7 +83,6 @@ export * from './Member/IRoomstayMemberBookingItem.type';
|
|
|
79
83
|
export * from './Member/IRoomstayMemberBookingProfile.type';
|
|
80
84
|
export * from './Member/IRoomstayMemberCards.type';
|
|
81
85
|
export * from './Member/IRoomstayMemberJWTData.type';
|
|
82
|
-
export * from './Member/IRoomstayMemberLoyalty.type';
|
|
83
86
|
export * from './Member/ISession.type';
|
|
84
87
|
export * from './Member/EMembershipProvider.type';
|
|
85
88
|
/**
|
|
@@ -118,15 +121,11 @@ export * from './Media/IMedia.type';
|
|
|
118
121
|
export * from './Fees/EFeeType.enum';
|
|
119
122
|
export * from './Fees/IFee.type';
|
|
120
123
|
export * from './Fees/IFeeConfigurationOptions.type';
|
|
121
|
-
/**
|
|
122
|
-
* Api
|
|
123
|
-
*/
|
|
124
|
-
export * from './Api/Reservations.type';
|
|
125
|
-
export * from './Api/RoomNightRate.type';
|
|
126
124
|
/**
|
|
127
125
|
* Analytics
|
|
128
126
|
*/
|
|
129
127
|
export * from './Analytics/IBigQueryResults.type';
|
|
128
|
+
export * from './Analytics/IAnalyticsDailyRow.type';
|
|
130
129
|
/**
|
|
131
130
|
* Analytics Events
|
|
132
131
|
*/
|
|
@@ -134,11 +133,6 @@ export * from './AnalyticsEvents/IAnalyticsEvent.type';
|
|
|
134
133
|
export * from './AnalyticsEvents/IAnalyticsSession.type';
|
|
135
134
|
export * from './AnalyticsEvents/IRoomstayEventData.type';
|
|
136
135
|
export * from './AnalyticsEvents/MetaCapiTransformer';
|
|
137
|
-
/**
|
|
138
|
-
* Gift Cards
|
|
139
|
-
*/
|
|
140
|
-
export * from './GiftCards/GiftCard.types';
|
|
141
|
-
export * from './GiftCards/GiftCardAuth.types';
|
|
142
136
|
/**
|
|
143
137
|
* Addons
|
|
144
138
|
*/
|
|
@@ -160,3 +154,15 @@ export * from './GiftCards/GiftCardLogs.enum';
|
|
|
160
154
|
*/
|
|
161
155
|
export * from './DisplayPolicy/IDisplayPolicy.type';
|
|
162
156
|
export * from './DisplayPolicy/EDisplayPolicyRuleType.enum';
|
|
157
|
+
/**
|
|
158
|
+
* Metasearch
|
|
159
|
+
*/
|
|
160
|
+
export * from './Metasearch/IMetasearchDailyRow.type';
|
|
161
|
+
/**
|
|
162
|
+
* Google Ads
|
|
163
|
+
*/
|
|
164
|
+
export * from './GoogleAds/IGoogleAdsDailyRow.type';
|
|
165
|
+
/**
|
|
166
|
+
* Meta Ads
|
|
167
|
+
*/
|
|
168
|
+
export * from './MetaAds/IMetaAdsDailyRow.type';
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import Decimal from "decimal.js";
|
|
2
|
-
export declare const RoundingType: {
|
|
3
|
-
[key: string]: Decimal.Rounding;
|
|
4
|
-
};
|
|
5
|
-
interface RoundMoneyOptions {
|
|
6
|
-
precision?: number;
|
|
7
|
-
rounding?: Decimal.Rounding;
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
2
|
* Rounds a monetary amount to two decimal places.
|
|
11
3
|
*
|
|
@@ -13,8 +5,6 @@ interface RoundMoneyOptions {
|
|
|
13
5
|
* with some systems, such as RMS.
|
|
14
6
|
*
|
|
15
7
|
* @param amount a string or number to be rounded
|
|
16
|
-
* @param options an object containing precision and rounding options
|
|
17
8
|
* @returns the rounded amount as a number
|
|
18
9
|
*/
|
|
19
|
-
export declare const roundMoney: (amount: string | number
|
|
20
|
-
export {};
|
|
10
|
+
export declare const roundMoney: (amount: string | number) => number;
|