@roomstay/core 0.1.84 → 0.1.85-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.
Files changed (39) hide show
  1. package/dist/node.js +1 -1
  2. package/dist/types/Addon/Addon.enum.d.ts +14 -0
  3. package/dist/types/Addon/Addon.type.d.ts +24 -0
  4. package/dist/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts +12 -14
  5. package/dist/types/AnalyticsEvents/MetaCapiTransformer.d.ts +6 -1
  6. package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +11 -0
  7. package/dist/types/Booking/IBookingExtraFields.type.d.ts +5 -0
  8. package/dist/types/Booking/IBookingPayment.type.d.ts +5 -3
  9. package/dist/types/Booking/IBookingQuote.type.d.ts +1 -0
  10. package/dist/types/Booking/IBookingStatus.type.d.ts +5 -0
  11. package/dist/types/Booking/IPrice.type.d.ts +7 -0
  12. package/dist/types/Booking/PlaceBooking.types.d.ts +2 -0
  13. package/dist/types/Company/IAdminCompany.type.d.ts +6 -1
  14. package/dist/types/Company/IAdminCompanyUser.type.d.ts +10 -0
  15. package/dist/types/DisplayPolicy/ERuleType.d.ts +6 -0
  16. package/dist/types/DisplayPolicy/ERuleType.enum.d.ts +6 -0
  17. package/dist/types/DisplayPolicy/IDisplayPolicy.d.ts +25 -0
  18. package/dist/types/Maintenance/IMaintenanceStatus.type.d.ts +4 -1
  19. package/dist/types/Member/IMemberVerification.type.d.ts +3 -0
  20. package/dist/types/Member/IRoomstayMember.type.d.ts +2 -1
  21. package/dist/types/Member/IRoomstayMemberLoyalty.type.d.ts +16 -0
  22. package/dist/types/Newbook/ENewbookSyncStrategy.enum.d.ts +8 -1
  23. package/dist/types/Newbook/index.d.ts +3 -0
  24. package/dist/types/PMSSync/index.d.ts +15 -0
  25. package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +5 -0
  26. package/dist/types/RMS/ERMSAuthSyncHistoryStatus.type.d.ts +8 -0
  27. package/dist/types/RMS/IRMSDiscount.type.d.ts +34 -0
  28. package/dist/types/RMS/IRMSSyncResponse.type.d.ts +8 -0
  29. package/dist/types/Rule/EDayOfWeek.enum.d.ts +9 -0
  30. package/dist/types/Rule/EDisplayPolicyEffectType.enum.d.ts +11 -0
  31. package/dist/types/Rule/ERuleType.enum.d.ts +11 -0
  32. package/dist/types/Rule/IRule.type.d.ts +1 -0
  33. package/dist/types/Rule/IRuleConfigurations.type.d.ts +68 -0
  34. package/dist/types/Rule/IRuleContext.type.d.ts +13 -0
  35. package/dist/types/Rule/index.d.ts +4 -0
  36. package/dist/types/index.d.ts +28 -0
  37. package/dist/utils/roundMoney.d.ts +11 -1
  38. package/dist/web.js +1 -1
  39. package/package.json +1 -1
@@ -1,15 +1,25 @@
1
+ import type { MediaType } from '../index.js';
1
2
  export declare enum EAdminCompanyUserRole {
2
3
  SuperAdmin = "SuperAdmin",
3
4
  Admin = "Admin",
4
5
  Limited = "Limited"
5
6
  }
7
+ export type IAdminCompanyUserHotel = {
8
+ companyUserId: number;
9
+ companyId: number;
10
+ hotelId: string;
11
+ };
6
12
  export type IAdminCompanyUser = {
7
13
  id: number;
8
14
  email: string;
9
15
  title: string;
10
16
  firstName: string;
11
17
  lastName: string;
18
+ profilePicture: MediaType;
12
19
  newPassword?: string;
13
20
  deletedDate?: Date;
14
21
  role?: EAdminCompanyUserRole;
22
+ companyUserHotels?: IAdminCompanyUserHotel[];
23
+ hotelIds?: string[];
24
+ viewAllHotels?: boolean;
15
25
  };
@@ -0,0 +1,6 @@
1
+ export declare enum ERuleType {
2
+ Schedule = "Schedule",
3
+ DeviceTarget = "DeviceTarget",
4
+ GeoLock = "GeoLock",
5
+ CheapestOf = "CheapestOf"
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum ERuleType {
2
+ Schedule = "Schedule",
3
+ DeviceTarget = "DeviceTarget",
4
+ GeoLock = "GeoLock",
5
+ CheapestOf = "CheapestOf"
6
+ }
@@ -0,0 +1,25 @@
1
+ import { ERuleType } from './ERuleType';
2
+ export interface IDisplayPolicy {
3
+ id: number;
4
+ name: string;
5
+ description: string;
6
+ applicableRates: string[];
7
+ conditions: ICondition[];
8
+ }
9
+ export type IScheduleConfiguration = {
10
+ rruleSet: string;
11
+ durationMs: number;
12
+ };
13
+ export type ICondition = {
14
+ ruleType: ERuleType.Schedule;
15
+ configuration: IScheduleConfiguration;
16
+ } | {
17
+ ruleType: ERuleType.DeviceTarget;
18
+ configuration: unknown;
19
+ } | {
20
+ ruleType: ERuleType.GeoLock;
21
+ configuration: unknown;
22
+ } | {
23
+ ruleType: ERuleType.CheapestOf;
24
+ configuration: unknown;
25
+ };
@@ -1,5 +1,4 @@
1
1
  export type IMaintenanceStatus = {
2
- uuid: string;
3
2
  /**
4
3
  * Which service is currently experiencing issues.
5
4
  */
@@ -10,6 +9,10 @@ export type IMaintenanceStatus = {
10
9
  * @example 2023-10-01T00:00:00Z
11
10
  */
12
11
  startDate: string;
12
+ /**
13
+ * UUID generated on create. Is not used as a primary key, or an index.
14
+ */
15
+ uuid: string;
13
16
  endDate: string;
14
17
  /**
15
18
  * Whether the status is currently in effect or not
@@ -7,4 +7,7 @@ export interface IMemberVerification {
7
7
  firstName?: string;
8
8
  email?: string;
9
9
  password?: string;
10
+ postalCode?: string;
11
+ mobilePhone?: string;
12
+ marketingOptIn?: string;
10
13
  }
@@ -1,4 +1,4 @@
1
- import { IRoomstayCognitoMember, IRoomstayMemberBooking, IRoomstayMemberCards } from '../index.js';
1
+ import { IRoomstayCognitoMember, IRoomstayMemberBooking, IRoomstayMemberCards, IRoomstayMemberLoyalty } from '../index.js';
2
2
  export interface IRoomstayMember extends IRoomstayCognitoMember {
3
3
  username: string;
4
4
  email: string;
@@ -15,4 +15,5 @@ export interface IRoomstayMember extends IRoomstayCognitoMember {
15
15
  defaultCard: string;
16
16
  bookings: IRoomstayMemberBooking[];
17
17
  cards: IRoomstayMemberCards[];
18
+ loyalty?: IRoomstayMemberLoyalty[];
18
19
  }
@@ -0,0 +1,16 @@
1
+ export interface IRoomstayMemberLoyalty {
2
+ username: string;
3
+ companyId: number;
4
+ spendingBalance: number;
5
+ currentTier: number | null;
6
+ promoCodeId: string | null;
7
+ promoCode: string | null;
8
+ redeemedAt: string | null;
9
+ lastBookingId: string;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ export interface ILoyaltyTier {
14
+ threshold: number;
15
+ discountPercent: number;
16
+ }
@@ -1,4 +1,11 @@
1
1
  export declare enum ENewbookSyncStrategy {
2
2
  Rates = "rates",
3
- Rooms = "rooms"
3
+ Rooms = "rooms",
4
+ Availability = "availability",
5
+ Details = "details",
6
+ Tariffs = "tariffs",
7
+ Discounts = "discounts",
8
+ InventoryItems = "inventoryItems",
9
+ Sites = "sites",
10
+ SitesToAuxInputs = "sitesToAuxInputs"
4
11
  }
@@ -1,2 +1,5 @@
1
+ export * from './ENewbookDiscountType.enum';
1
2
  export * from './ENewbookRegion.enum';
2
3
  export * from './ENewbookSyncStrategy.enum';
4
+ export * from './INewbookDiscount.type';
5
+ export * from './INewbookInventoryItem.type';
@@ -1,2 +1,17 @@
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
+ };
@@ -4,3 +4,8 @@ export declare enum EGuaranteePolicyDepositMode {
4
4
  FirstNight = "FirstNight",
5
5
  None = "None"
6
6
  }
7
+ export declare enum EGuarantyPolicyPrepaymentType {
8
+ FixedAmount = "fixed",
9
+ Percentage = "percentage",
10
+ Nights = "nights"
11
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum ERMSAuthSyncHistoryStatus {
2
+ Success = "success",
3
+ Failure = "failure",
4
+ New = "new",
5
+ Queued = "queued",
6
+ InProgress = "in_progress",
7
+ RequireResume = "require_resume"
8
+ }
@@ -0,0 +1,34 @@
1
+ import { ERMSDiscountType } from './ERMSDiscountType.enum';
2
+ import { IRuleSpec } from '../Rule/IRuleConfigurations.type';
3
+ export type IRMSDiscount = {
4
+ name: string;
5
+ rmsDiscountId: number;
6
+ description: string;
7
+ discountType: ERMSDiscountType;
8
+ amount?: {
9
+ amount: number;
10
+ };
11
+ percentage?: {
12
+ percentage: number;
13
+ noGreaterThan: number;
14
+ includePackage: boolean;
15
+ includeAdditionals: boolean;
16
+ appliesToTotalRate: boolean;
17
+ };
18
+ bogo?: {
19
+ buyXNights: number;
20
+ getXNights: number;
21
+ getXNightsCycles: number;
22
+ includeAdditionals: boolean;
23
+ };
24
+ nightlyRateOverride?: {
25
+ firstXNights: number;
26
+ totalCharge: number;
27
+ includeAdditionals: boolean;
28
+ };
29
+ availableToIbe: boolean;
30
+ minimumNightStay: number;
31
+ maximumNightStay: number;
32
+ availableToMembers: boolean;
33
+ rules: IRuleSpec[];
34
+ };
@@ -0,0 +1,8 @@
1
+ import { ERMSAuthSyncHistoryStatus } from './ERMSAuthSyncHistoryStatus.type';
2
+ export type IRMSSyncResponse = {
3
+ id: number;
4
+ status: ERMSAuthSyncHistoryStatus;
5
+ additionalData: any;
6
+ syncData: string | null;
7
+ syncType: string;
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare enum EDayOfWeek {
2
+ MON = "MON",
3
+ TUE = "TUE",
4
+ WED = "WED",
5
+ THU = "THU",
6
+ FRI = "FRI",
7
+ SAT = "SAT",
8
+ SUN = "SUN"
9
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum EDisplayPolicyEffectType {
2
+ Visibility = "visibility",
3
+ Exclusivity = "exclusivity"
4
+ }
5
+ export declare enum EDisplayPolicyExclusivityMode {
6
+ Cheapest = "cheapest",
7
+ MostExpensive = "most_expensive"
8
+ }
9
+ export interface IDisplayPolicyExclusivityConfiguration {
10
+ mode: EDisplayPolicyExclusivityMode;
11
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum ERuleType {
2
+ Schedule = "Schedule",
3
+ GeoLock = "GeoLock",
4
+ DeviceTarget = "DeviceTarget",
5
+ DayOfWeek = "DayOfWeek",
6
+ HotelRestriction = "HotelRestriction",
7
+ RoomRestriction = "RoomRestriction",
8
+ RateRestriction = "RateRestriction",
9
+ NightCount = "NightCount",
10
+ AnyOf = "AnyOf"
11
+ }
@@ -0,0 +1 @@
1
+ export type { IRuleSpec } from './IRuleConfigurations.type';
@@ -0,0 +1,68 @@
1
+ import { EDayOfWeek } from './EDayOfWeek.enum';
2
+ import { ERuleType } from './ERuleType.enum';
3
+ export interface IScheduleConfig {
4
+ type: 'clock' | 'stay';
5
+ rules: Array<{
6
+ type: 'include' | 'exclude';
7
+ startDate: string;
8
+ endDate: string;
9
+ rrule?: string;
10
+ }>;
11
+ }
12
+ export interface IGeoLockConfig {
13
+ applicableCountryCodes: string[];
14
+ mode: 'allow' | 'deny';
15
+ }
16
+ export type TDeviceTarget = 'mobile' | 'desktop';
17
+ export interface IDeviceTargetConfig {
18
+ allowedDevices: TDeviceTarget[];
19
+ }
20
+ export type TDayOfWeekSource = 'arrival' | 'night' | 'booking';
21
+ export interface IDayOfWeekConfig {
22
+ source: TDayOfWeekSource;
23
+ allowedDays: EDayOfWeek[];
24
+ }
25
+ export interface IHotelRestrictionConfig {
26
+ hotelIds: string[];
27
+ }
28
+ export interface IRoomRestrictionConfig {
29
+ roomCodes: string[];
30
+ }
31
+ export interface IRateRestrictionConfig {
32
+ rateCodes: string[];
33
+ }
34
+ export interface INightCountConfig {
35
+ min?: number;
36
+ max?: number;
37
+ }
38
+ export interface IAnyOfConfig {
39
+ branches: IRuleSpec[][];
40
+ }
41
+ export type IRuleSpec = {
42
+ ruleType: ERuleType.Schedule;
43
+ configuration: IScheduleConfig;
44
+ } | {
45
+ ruleType: ERuleType.GeoLock;
46
+ configuration: IGeoLockConfig;
47
+ } | {
48
+ ruleType: ERuleType.DeviceTarget;
49
+ configuration: IDeviceTargetConfig;
50
+ } | {
51
+ ruleType: ERuleType.DayOfWeek;
52
+ configuration: IDayOfWeekConfig;
53
+ } | {
54
+ ruleType: ERuleType.HotelRestriction;
55
+ configuration: IHotelRestrictionConfig;
56
+ } | {
57
+ ruleType: ERuleType.RoomRestriction;
58
+ configuration: IRoomRestrictionConfig;
59
+ } | {
60
+ ruleType: ERuleType.RateRestriction;
61
+ configuration: IRateRestrictionConfig;
62
+ } | {
63
+ ruleType: ERuleType.NightCount;
64
+ configuration: INightCountConfig;
65
+ } | {
66
+ ruleType: ERuleType.AnyOf;
67
+ configuration: IAnyOfConfig;
68
+ };
@@ -0,0 +1,13 @@
1
+ export interface IRuleContextDescriptor {
2
+ hasHotel: true;
3
+ hasNow: true;
4
+ optional: {
5
+ checkInDate?: true;
6
+ checkOutDate?: true;
7
+ nightDate?: true;
8
+ event?: true;
9
+ geolocation?: true;
10
+ rateCode?: true;
11
+ roomCode?: true;
12
+ };
13
+ }
@@ -0,0 +1,4 @@
1
+ export * from './EDayOfWeek.enum';
2
+ export * from './EDisplayPolicyEffectType.enum';
3
+ export * from './ERuleType.enum';
4
+ export * from './IRuleConfigurations.type';
@@ -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,6 +83,7 @@ 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';
86
+ export * from './Member/IRoomstayMemberLoyalty.type';
82
87
  export * from './Member/ISession.type';
83
88
  export * from './Member/EMembershipProvider.type';
84
89
  /**
@@ -117,10 +122,16 @@ export * from './Media/IMedia.type';
117
122
  export * from './Fees/EFeeType.enum';
118
123
  export * from './Fees/IFee.type';
119
124
  export * from './Fees/IFeeConfigurationOptions.type';
125
+ /**
126
+ * Api
127
+ */
128
+ export * from './Api/Reservations.type';
129
+ export * from './Api/RoomNightRate.type';
120
130
  /**
121
131
  * Analytics
122
132
  */
123
133
  export * from './Analytics/IBigQueryResults.type';
134
+ export * from './Analytics/IAnalyticsDailyRow.type';
124
135
  /**
125
136
  * Analytics Events
126
137
  */
@@ -128,6 +139,11 @@ export * from './AnalyticsEvents/IAnalyticsEvent.type';
128
139
  export * from './AnalyticsEvents/IAnalyticsSession.type';
129
140
  export * from './AnalyticsEvents/IRoomstayEventData.type';
130
141
  export * from './AnalyticsEvents/MetaCapiTransformer';
142
+ /**
143
+ * Gift Cards
144
+ */
145
+ export * from './GiftCards/GiftCard.types';
146
+ export * from './GiftCards/GiftCardAuth.types';
131
147
  /**
132
148
  * Addons
133
149
  */
@@ -149,3 +165,15 @@ export * from './GiftCards/GiftCardLogs.enum';
149
165
  */
150
166
  export * from './DisplayPolicy/IDisplayPolicy.type';
151
167
  export * from './DisplayPolicy/EDisplayPolicyRuleType.enum';
168
+ /**
169
+ * Metasearch
170
+ */
171
+ export * from './Metasearch/IMetasearchDailyRow.type';
172
+ /**
173
+ * Google Ads
174
+ */
175
+ export * from './GoogleAds/IGoogleAdsDailyRow.type';
176
+ /**
177
+ * Meta Ads
178
+ */
179
+ export * from './MetaAds/IMetaAdsDailyRow.type';
@@ -1,3 +1,11 @@
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
+ }
1
9
  /**
2
10
  * Rounds a monetary amount to two decimal places.
3
11
  *
@@ -5,6 +13,8 @@
5
13
  * with some systems, such as RMS.
6
14
  *
7
15
  * @param amount a string or number to be rounded
16
+ * @param options an object containing precision and rounding options
8
17
  * @returns the rounded amount as a number
9
18
  */
10
- export declare const roundMoney: (amount: string | number) => number;
19
+ export declare const roundMoney: (amount: string | number, options?: RoundMoneyOptions) => number;
20
+ export {};