@roomstay/core 0.1.49 → 0.1.50-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/index.d.ts +0 -0
- package/dist/node.js +1 -1
- package/dist/types/Analytics/IBigQueryResponse.type.d.ts +24 -0
- package/dist/types/Analytics/IBigQueryResults.type.d.ts +35 -0
- package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +0 -0
- package/dist/types/Booking/IBookingPayment.type.d.ts +0 -0
- package/dist/types/Booking/IBookingQuote.type.d.ts +0 -0
- package/dist/types/Booking/IBookingStatus.type.d.ts +0 -0
- package/dist/types/Booking/IPrice.type.d.ts +0 -0
- package/dist/types/Company/ECompanyProvider.enum.d.ts +0 -0
- package/dist/types/Company/IAdminCompany.type.d.ts +0 -0
- package/dist/types/Company/IAdminCompanyUser.type.d.ts +0 -0
- package/dist/types/Events/IRoomstayEvent.type.d.ts +0 -0
- package/dist/types/Fees/IFeeOptions.type.d.ts +6 -0
- package/dist/types/General/HttpMethod.enum.d.ts +0 -0
- package/dist/types/Hotel/EHotelPriceModel.enum.d.ts +0 -0
- package/dist/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts +0 -0
- package/dist/types/Hotel/IAuxiliaryFilter.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelColorScheme.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelOverrides.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelReplica.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelService.type.d.ts +0 -0
- package/dist/types/Image/IRoomstayImage.type.d.ts +0 -0
- package/dist/types/Maintenance/IMaintenanceStatus.type.d.ts +25 -0
- package/dist/types/Member/IRoomstayCognitoMember.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMember.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBooking.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBookingAddress.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBookingItem.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBookingProfile.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberCards.type.d.ts +0 -0
- package/dist/types/Member/ISession.type.d.ts +0 -0
- package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -0
- package/dist/types/RMS/ERMSDiscountType.enum.d.ts +0 -0
- package/dist/types/RMS/IRMSPropertyDiscount.type.d.ts +0 -0
- package/dist/types/RMS/IRMSRequirement.type.d.ts +0 -0
- package/dist/types/Room/IRoomGroup.type.d.ts +0 -0
- package/dist/types/index.d.ts +42 -36
- package/dist/utils/bookingTotal.d.ts +0 -0
- package/dist/utils/feeOptionRules.d.ts +0 -0
- package/dist/utils/index.d.ts +0 -0
- package/dist/utils/roomstayImageResize.d.ts +0 -0
- package/dist/utils/roundMoney.d.ts +11 -1
- package/dist/utils/uppercaseString.d.ts +0 -0
- package/dist/web.js +1 -1
- package/package.json +1 -1
- package/dist/types/Booking/ICheckoutBrowserSession.type.d.ts +0 -14
- package/dist/types/General/IJsonString.type.d.ts +0 -6
- package/dist/utils/nameof.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:n=>{var o=n&&n.__esModule?()=>n.default:()=>n;return e.d(o,{a:o}),o},d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};let o,t,r;e.r(n),e.d(n,{EBookingPaymentMethod:()=>o,ECompanyProvider:()=>c,EDistanceUnitType:()=>
|
|
1
|
+
(()=>{"use strict";var e={n:n=>{var o=n&&n.__esModule?()=>n.default:()=>n;return e.d(o,{a:o}),o},d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};let o,t,r;e.r(n),e.d(n,{EBookingPaymentMethod:()=>o,ECompanyProvider:()=>c,EDistanceUnitType:()=>P,EFeeType:()=>F,EGuarantyPolicyPrepaymentType:()=>p,EHotelCardProcessor:()=>t,EHotelPriceModel:()=>u,EHotelStateFieldConfiguration:()=>d,EHotelWeekdayStartsOn:()=>g,EIntegration:()=>l,EPlanpayBookingStatus:()=>r,ERMSDiscountType:()=>y,ERoomstayEventSource:()=>O,ERoomstayImageSize:()=>f,HttpMethod:()=>R,IAuxiliaryFilterType:()=>s,IBookingStatus:()=>i,IMaintenanceStatusService:()=>m,PCIBookingCardProcessorTypes:()=>a,RoundingType:()=>D,calculateFeeAmount:()=>k,calculateTotalForMemberBooking:()=>C,getFeeOptionValidity:()=>M,getFilteredBookingAddonFees:()=>x,getFilteredBookingFees:()=>H,getFilteredBookingRateFees:()=>U,nameof:()=>E,resizeRoomstayImageUrl:()=>A,roundMoney:()=>B,subset:()=>S,uppercaseString:()=>h}),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave"}(t||(t={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(r||(r={}));const a=[];let i,c,u,d,g,l,s,P,y,f,m,p,O,R,F;function h(e){return e.toUpperCase()}!function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(i||(i={})),function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(c||(c={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(u||(u={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(d||(d={})),function(e){e.Monday="monday",e.Sunday="sunday"}(g||(g={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(l||(l={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(s||(s={})),function(e){e.Metric="metric",e.Imperial="imperial"}(P||(P={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(y||(y={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(f||(f={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(m||(m={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(p||(p={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(O||(O={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(R||(R={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(F||(F={}));const C=e=>{let n=0;const o=Object.values(e.itinerary);for(const e of o){const o=Object.keys(e.nights);for(const t of o)n+=e.nights[t].total}return n},A=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,E=e=>e,S=(e,n)=>{const o={};return n.forEach((n=>{n in e&&(o[n]=e[n])})),o},T=require("decimal.js");var N=e.n(T);const D={UP:N().ROUND_UP,DOWN:N().ROUND_DOWN,CEIL:N().ROUND_CEIL,FLOOR:N().ROUND_FLOOR,HALF_UP:N().ROUND_HALF_UP,HALF_DOWN:N().ROUND_HALF_DOWN,HALF_EVEN:N().ROUND_HALF_EVEN,HALF_CEIL:N().ROUND_HALF_CEIL,HALF_FLOOR:N().ROUND_HALF_FLOOR},B=(e,n)=>{const{precision:o=2,rounding:t=D.HALF_UP}=n||{};return new(N())(e).toDecimalPlaces(o,t).toNumber()};function k(e,n={}){const{baseAmount:o=0,numberOfNights:t=1,feeIncludedInBaseAmount:r=!1,extractedFromRates:a=!1,removedPercentages:i=[]}=n,c=B(o);switch(e.feeType){case F.PercentageOfBooking:if(r)return B(c*e.amount/(100+e.amount));if(a){const n=i.reduce(((e,n)=>e+n/(100+n)),0);return B(c/(1-n)*e.amount/(100+e.amount))}return B(c*(e.amount/100));case F.FixedChargePerRoom:case F.FixedChargePerBooking:return e.amount;case F.NightlyChargePerRoom:return B(e.amount*t);default:return 0}}const L=[F.FixedChargePerBooking],v=[F.PercentageOfBooking,F.FixedChargePerRoom,F.NightlyChargePerRoom],I=[F.PercentageOfBooking];function _(e,n){return e.filter((e=>n.includes(e.feeType)))}function H(e){return _(e,L)}function U(e){return _(e,v)}function x(e){return _(e,I)}function M(e){return{includeInRates:[F.PercentageOfBooking,F.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===F.PercentageOfBooking,appliesToAddons:e===F.PercentageOfBooking,includePreviousFeesInCalculation:e===F.PercentageOfBooking}}module.exports=n})();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type IDailyRevenue = {
|
|
2
|
+
date: string;
|
|
3
|
+
revenue: number;
|
|
4
|
+
};
|
|
5
|
+
export type IDailyRoomBreakdown = {
|
|
6
|
+
date: string;
|
|
7
|
+
roomName: string;
|
|
8
|
+
purchases: number;
|
|
9
|
+
};
|
|
10
|
+
export type IRegionBreakdown = {
|
|
11
|
+
country: string;
|
|
12
|
+
region: string;
|
|
13
|
+
purchases: number;
|
|
14
|
+
revenue: number;
|
|
15
|
+
};
|
|
16
|
+
export type IBigQueryResponse = {
|
|
17
|
+
purchases: number;
|
|
18
|
+
cancellations: number;
|
|
19
|
+
revenue: number;
|
|
20
|
+
conversionRate: number;
|
|
21
|
+
dailyRevenue: IDailyRevenue[];
|
|
22
|
+
dailyRoomsBreakdown: IDailyRoomBreakdown[];
|
|
23
|
+
regionBreakdown: IRegionBreakdown[];
|
|
24
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type IDailyMetrics = {
|
|
2
|
+
date: string;
|
|
3
|
+
revenue: number;
|
|
4
|
+
purchases: number;
|
|
5
|
+
sessionCount: number;
|
|
6
|
+
};
|
|
7
|
+
export type IDailyRoomBreakdown = {
|
|
8
|
+
date: string;
|
|
9
|
+
roomName: string;
|
|
10
|
+
purchases: number;
|
|
11
|
+
};
|
|
12
|
+
export type IRegionBreakdown = {
|
|
13
|
+
country: string;
|
|
14
|
+
region: string;
|
|
15
|
+
purchases: number;
|
|
16
|
+
revenue: number;
|
|
17
|
+
};
|
|
18
|
+
export type ICheckoutFunnel = {
|
|
19
|
+
roomName: string;
|
|
20
|
+
selectedDate: number;
|
|
21
|
+
addedToCart: number;
|
|
22
|
+
startedCheckout: number;
|
|
23
|
+
completedCheckout: number;
|
|
24
|
+
};
|
|
25
|
+
export type IBigQueryResults = {
|
|
26
|
+
purchases: number;
|
|
27
|
+
cancellations: number;
|
|
28
|
+
revenue: number;
|
|
29
|
+
conversionRate: number;
|
|
30
|
+
totalDateSelections: number;
|
|
31
|
+
dailyMetrics: IDailyMetrics[];
|
|
32
|
+
dailyRoomsBreakdown: IDailyRoomBreakdown[];
|
|
33
|
+
regionBreakdown: IRegionBreakdown[];
|
|
34
|
+
checkoutFunnel: ICheckoutFunnel[];
|
|
35
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type IMaintenanceStatus = {
|
|
2
|
+
/**
|
|
3
|
+
* Which service is currently experiencing issues.
|
|
4
|
+
*/
|
|
5
|
+
service: IMaintenanceStatusService;
|
|
6
|
+
/**
|
|
7
|
+
* The start time of the maintenance window in ISO 8601 format
|
|
8
|
+
*
|
|
9
|
+
* @example 2023-10-01T00:00:00Z
|
|
10
|
+
*/
|
|
11
|
+
startDate: string;
|
|
12
|
+
endDate: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the status is currently in effect or not
|
|
15
|
+
*/
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
status: 'error' | 'maintenance';
|
|
18
|
+
title: string;
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
export declare enum IMaintenanceStatusService {
|
|
22
|
+
Frontend = "frontend",
|
|
23
|
+
Hotel = "hotel",
|
|
24
|
+
Events = "events"
|
|
25
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Booking Details
|
|
3
3
|
*/
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
4
|
+
export * from './Booking/IBookingPayment.type';
|
|
5
|
+
export * from './Booking/IBookingStatus.type';
|
|
6
|
+
export * from './Booking/IPrice.type';
|
|
7
|
+
export * from './Booking/IBookingCreateErrorResponse';
|
|
8
|
+
export * from './Booking/IBookingQuote.type';
|
|
9
9
|
/**
|
|
10
10
|
* Company
|
|
11
11
|
*/
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
12
|
+
export * from './Company/ECompanyProvider.enum';
|
|
13
|
+
export * from './Company/IAdminCompany.type';
|
|
14
|
+
export * from './Company/IAdminCompanyUser.type';
|
|
15
15
|
/**
|
|
16
16
|
* Hotel
|
|
17
17
|
*/
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
18
|
+
export * from './Hotel/EHotelPriceModel.enum';
|
|
19
|
+
export * from './Hotel/EHotelStateFieldConfiguration.enum';
|
|
20
|
+
export * from './Hotel/EHotelWeekdayStartsOn.enum';
|
|
21
|
+
export * from './Hotel/EIntegration.enum';
|
|
22
|
+
export * from './Hotel/IAuxiliaryFilter.type';
|
|
23
|
+
export * from './Hotel/IHotelColorScheme.type';
|
|
24
|
+
export * from './Hotel/IHotelOverrides.type';
|
|
25
|
+
export * from './Hotel/IHotelReplica.type';
|
|
26
|
+
export * from './Hotel/IHotelService.type';
|
|
27
27
|
/**
|
|
28
28
|
* Room
|
|
29
29
|
*/
|
|
30
|
-
export * from
|
|
30
|
+
export * from './Room/IRoomGroup.type';
|
|
31
31
|
/**
|
|
32
32
|
* RMS
|
|
33
33
|
*/
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
34
|
+
export * from './RMS/ERMSDiscountType.enum';
|
|
35
|
+
export * from './RMS/IRMSPropertyDiscount.type';
|
|
36
|
+
export * from './RMS/IRMSRequirement.type';
|
|
37
37
|
/**
|
|
38
38
|
* Image
|
|
39
39
|
*/
|
|
40
|
-
export * from
|
|
40
|
+
export * from './Image/IRoomstayImage.type';
|
|
41
|
+
/** Maintenance */
|
|
42
|
+
export * from './Maintenance/IMaintenanceStatus.type';
|
|
41
43
|
/**
|
|
42
44
|
* Member Details
|
|
43
45
|
*/
|
|
44
|
-
export * from
|
|
45
|
-
export * from
|
|
46
|
-
export * from
|
|
47
|
-
export * from
|
|
48
|
-
export * from
|
|
49
|
-
export * from
|
|
50
|
-
export * from
|
|
51
|
-
export * from
|
|
52
|
-
export * from
|
|
53
|
-
export * from
|
|
46
|
+
export * from './Member/IMember.type';
|
|
47
|
+
export * from './Member/IMemberVerification.type';
|
|
48
|
+
export * from './Member/IRoomstayCognitoMember.type';
|
|
49
|
+
export * from './Member/IRoomstayMember.type';
|
|
50
|
+
export * from './Member/IRoomstayMemberBooking.type';
|
|
51
|
+
export * from './Member/IRoomstayMemberBookingAddress.type';
|
|
52
|
+
export * from './Member/IRoomstayMemberBookingItem.type';
|
|
53
|
+
export * from './Member/IRoomstayMemberBookingProfile.type';
|
|
54
|
+
export * from './Member/IRoomstayMemberCards.type';
|
|
55
|
+
export * from './Member/ISession.type';
|
|
54
56
|
/**
|
|
55
57
|
* Policies
|
|
56
58
|
*/
|
|
57
|
-
export * from
|
|
59
|
+
export * from './Policies/EGuaranteePolicy.enum';
|
|
58
60
|
/**
|
|
59
61
|
* Roomstay Events
|
|
60
62
|
*/
|
|
@@ -63,15 +65,19 @@ export * from "./Events/ERoomstayEventSource.enum";
|
|
|
63
65
|
/**
|
|
64
66
|
* General
|
|
65
67
|
*/
|
|
66
|
-
export * from
|
|
67
|
-
export * from
|
|
68
|
+
export * from './General/HttpMethod.enum';
|
|
69
|
+
export * from './General/IMessage.type';
|
|
68
70
|
/**
|
|
69
71
|
* Media
|
|
70
72
|
*/
|
|
71
|
-
export * from
|
|
73
|
+
export * from './Media/IMedia.type';
|
|
72
74
|
/**
|
|
73
75
|
* Fees
|
|
74
76
|
*/
|
|
75
77
|
export * from "./Fees/EFeeType.enum";
|
|
76
78
|
export * from "./Fees/IFee.type";
|
|
77
79
|
export * from "./Fees/IFeeConfigurationOptions.type";
|
|
80
|
+
/**
|
|
81
|
+
* Analytics
|
|
82
|
+
*/
|
|
83
|
+
export * from "./Analytics/IBigQueryResults.type";
|
|
File without changes
|
|
File without changes
|
package/dist/utils/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -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 {};
|
|
File without changes
|
package/dist/web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var n={60:n=>{n.exports=e}},o={};function t(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,t),a.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{let e,n,o;t.r(r),t.d(r,{EBookingPaymentMethod:()=>e,ECompanyProvider:()=>c,EDistanceUnitType:()=>
|
|
1
|
+
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var n={60:n=>{n.exports=e}},o={};function t(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,t),a.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{let e,n,o;t.r(r),t.d(r,{EBookingPaymentMethod:()=>e,ECompanyProvider:()=>c,EDistanceUnitType:()=>P,EFeeType:()=>F,EGuarantyPolicyPrepaymentType:()=>p,EHotelCardProcessor:()=>n,EHotelPriceModel:()=>u,EHotelStateFieldConfiguration:()=>d,EHotelWeekdayStartsOn:()=>g,EIntegration:()=>l,EPlanpayBookingStatus:()=>o,ERMSDiscountType:()=>y,ERoomstayEventSource:()=>O,ERoomstayImageSize:()=>f,HttpMethod:()=>R,IAuxiliaryFilterType:()=>s,IBookingStatus:()=>i,IMaintenanceStatusService:()=>m,PCIBookingCardProcessorTypes:()=>a,RoundingType:()=>D,calculateFeeAmount:()=>B,calculateTotalForMemberBooking:()=>C,getFeeOptionValidity:()=>M,getFilteredBookingAddonFees:()=>U,getFilteredBookingFees:()=>x,getFilteredBookingRateFees:()=>H,nameof:()=>E,resizeRoomstayImageUrl:()=>A,roundMoney:()=>v,subset:()=>S,uppercaseString:()=>h}),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(e||(e={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave"}(n||(n={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(o||(o={}));const a=[];let i,c,u,d,g,l,s,P,y,f,m,p,O,R,F;function h(e){return e.toUpperCase()}!function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(i||(i={})),function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(c||(c={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(u||(u={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(d||(d={})),function(e){e.Monday="monday",e.Sunday="sunday"}(g||(g={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(l||(l={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(s||(s={})),function(e){e.Metric="metric",e.Imperial="imperial"}(P||(P={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(y||(y={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(f||(f={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(m||(m={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(p||(p={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(O||(O={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(R||(R={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(F||(F={}));const C=e=>{let n=0;const o=Object.values(e.itinerary);for(const e of o){const o=Object.keys(e.nights);for(const t of o)n+=e.nights[t].total}return n},A=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,E=e=>e,S=(e,n)=>{const o={};return n.forEach((n=>{n in e&&(o[n]=e[n])})),o};var T=t(60),N=t.n(T);const D={UP:N().ROUND_UP,DOWN:N().ROUND_DOWN,CEIL:N().ROUND_CEIL,FLOOR:N().ROUND_FLOOR,HALF_UP:N().ROUND_HALF_UP,HALF_DOWN:N().ROUND_HALF_DOWN,HALF_EVEN:N().ROUND_HALF_EVEN,HALF_CEIL:N().ROUND_HALF_CEIL,HALF_FLOOR:N().ROUND_HALF_FLOOR},v=(e,n)=>{const{precision:o=2,rounding:t=D.HALF_UP}=n||{};return new(N())(e).toDecimalPlaces(o,t).toNumber()};function B(e,n={}){const{baseAmount:o=0,numberOfNights:t=1,feeIncludedInBaseAmount:r=!1,extractedFromRates:a=!1,removedPercentages:i=[]}=n,c=v(o);switch(e.feeType){case F.PercentageOfBooking:if(r)return v(c*e.amount/(100+e.amount));if(a){const n=i.reduce(((e,n)=>e+n/(100+n)),0);return v(c/(1-n)*e.amount/(100+e.amount))}return v(c*(e.amount/100));case F.FixedChargePerRoom:case F.FixedChargePerBooking:return e.amount;case F.NightlyChargePerRoom:return v(e.amount*t);default:return 0}}const k=[F.FixedChargePerBooking],L=[F.PercentageOfBooking,F.FixedChargePerRoom,F.NightlyChargePerRoom],I=[F.PercentageOfBooking];function _(e,n){return e.filter((e=>n.includes(e.feeType)))}function x(e){return _(e,k)}function H(e){return _(e,L)}function U(e){return _(e,I)}function M(e){return{includeInRates:[F.PercentageOfBooking,F.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===F.PercentageOfBooking,appliesToAddons:e===F.PercentageOfBooking,includePreviousFeesInCalculation:e===F.PercentageOfBooking}}})(),r})()));
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { EHotelCardProcessor, EHotelCardProcessorInitData } from './IBookingPayment.type';
|
|
2
|
-
export type ICheckoutBrowserSession<T extends EHotelCardProcessor | undefined = EHotelCardProcessor> = {
|
|
3
|
-
browserSessionId: string;
|
|
4
|
-
checkoutSessionId: string;
|
|
5
|
-
rows: {}[];
|
|
6
|
-
/**
|
|
7
|
-
* ISO 8601 date string
|
|
8
|
-
*/
|
|
9
|
-
expiry: string;
|
|
10
|
-
payment: {
|
|
11
|
-
processor: T;
|
|
12
|
-
data: EHotelCardProcessorInitData[T];
|
|
13
|
-
};
|
|
14
|
-
};
|
package/dist/utils/nameof.d.ts
DELETED