@roomstay/core 0.1.42 → 0.1.43-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.
Files changed (46) hide show
  1. package/dist/index.d.ts +0 -0
  2. package/dist/node.js +1 -1
  3. package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +0 -0
  4. package/dist/types/Booking/IBookingPayment.type.d.ts +6 -2
  5. package/dist/types/Booking/IBookingQuote.type.d.ts +0 -0
  6. package/dist/types/Booking/IBookingStatus.type.d.ts +0 -0
  7. package/dist/types/Booking/IPrice.type.d.ts +0 -0
  8. package/dist/types/Company/ECompanyProvider.enum.d.ts +0 -0
  9. package/dist/types/Company/IAdminCompany.type.d.ts +0 -0
  10. package/dist/types/Company/IAdminCompanyUser.type.d.ts +0 -0
  11. package/dist/types/Events/IRoomstayEvent.type.d.ts +0 -0
  12. package/dist/types/Fees/EFeeType.enum.d.ts +7 -0
  13. package/dist/types/Fees/IFee.type.d.ts +5 -0
  14. package/dist/types/General/HttpMethod.enum.d.ts +0 -0
  15. package/dist/types/General/IJsonString.type.d.ts +0 -0
  16. package/dist/types/Hotel/EHotelPriceModel.enum.d.ts +0 -0
  17. package/dist/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts +0 -0
  18. package/dist/types/Hotel/IAuxiliaryFilter.type.d.ts +0 -0
  19. package/dist/types/Hotel/IHotelColorScheme.type.d.ts +0 -0
  20. package/dist/types/Hotel/IHotelOverrides.type.d.ts +0 -0
  21. package/dist/types/Hotel/IHotelReplica.type.d.ts +0 -0
  22. package/dist/types/Hotel/IHotelService.type.d.ts +0 -0
  23. package/dist/types/Image/IRoomstayImage.type.d.ts +0 -0
  24. package/dist/types/Member/IRoomstayCognitoMember.type.d.ts +0 -0
  25. package/dist/types/Member/IRoomstayMember.type.d.ts +0 -0
  26. package/dist/types/Member/IRoomstayMemberBooking.type.d.ts +0 -0
  27. package/dist/types/Member/IRoomstayMemberBookingAddress.type.d.ts +0 -0
  28. package/dist/types/Member/IRoomstayMemberBookingItem.type.d.ts +0 -0
  29. package/dist/types/Member/IRoomstayMemberBookingProfile.type.d.ts +0 -0
  30. package/dist/types/Member/IRoomstayMemberCards.type.d.ts +0 -0
  31. package/dist/types/Member/ISession.type.d.ts +0 -0
  32. package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -0
  33. package/dist/types/RMS/ERMSDiscountType.enum.d.ts +0 -0
  34. package/dist/types/RMS/IRMSPropertyDiscount.type.d.ts +0 -0
  35. package/dist/types/RMS/IRMSRequirement.type.d.ts +0 -0
  36. package/dist/types/Room/IRoomGroup.type.d.ts +0 -0
  37. package/dist/types/index.d.ts +5 -0
  38. package/dist/utils/bookingTotal.d.ts +0 -0
  39. package/dist/utils/calculateFee.d.ts +7 -0
  40. package/dist/utils/feeTypes.d.ts +4 -0
  41. package/dist/utils/index.d.ts +2 -0
  42. package/dist/utils/nameof.d.ts +2 -0
  43. package/dist/utils/roomstayImageResize.d.ts +0 -0
  44. package/dist/utils/uppercaseString.d.ts +0 -0
  45. package/dist/web.js +1 -1
  46. package/package.json +1 -1
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,a;e.r(n),e.d(n,{EBookingPaymentMethod:()=>o,ECompanyProvider:()=>c,EDistanceUnitType:()=>g,EGuarantyPolicyPrepaymentType:()=>m,EHotelCardProcessor:()=>t,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>u,EIntegration:()=>y,EPlanpayBookingStatus:()=>a,ERMSDiscountType:()=>p,ERoomstayImageSize:()=>P,HttpMethod:()=>f,IAuxiliaryFilterType:()=>s,IBookingStatus:()=>i,PCIBookingCardProcessorTypes:()=>r,calculateTotalForMemberBooking:()=>T,nameof:()=>O,resizeRoomstayImageUrl:()=>E,roundMoney:()=>h,subset:()=>C,uppercaseString:()=>S}),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",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"}(a||(a={}));const r=[];let i,c,d,l,u,y,s,g,p,P,m,f;function S(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"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(l||(l={})),function(e){e.Monday="monday",e.Sunday="sunday"}(u||(u={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(y||(y={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(s||(s={})),function(e){e.Metric="metric",e.Imperial="imperial"}(g||(g={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(p||(p={})),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"}(P||(P={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(m||(m={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(f||(f={}));const T=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},E=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,O=e=>e,C=(e,n)=>{const o={};return n.forEach((n=>{n in e&&(o[n]=e[n])})),o},A=require("decimal.js");var M=e.n(A);const h=e=>new(M())(e).toDecimalPlaces(2).toNumber();module.exports=n})();
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:()=>y,EFeeType:()=>h,EGuarantyPolicyPrepaymentType:()=>m,EHotelCardProcessor:()=>t,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>u,EHotelWeekdayStartsOn:()=>l,EIntegration:()=>g,EPlanpayBookingStatus:()=>r,ERMSDiscountType:()=>P,ERoomstayImageSize:()=>f,HttpMethod:()=>p,IAuxiliaryFilterType:()=>s,IBookingStatus:()=>i,PCIBookingCardProcessorTypes:()=>a,calculateFeeAmount:()=>B,calculateTotalForMemberBooking:()=>S,getFilteredBookingAddonFees:()=>I,getFilteredBookingFees:()=>b,getFilteredBookingRateFees:()=>D,nameof:()=>O,resizeRoomstayImageUrl:()=>T,roundMoney:()=>k,subset:()=>E,uppercaseString:()=>C}),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,d,u,l,g,s,y,P,f,m,p,h;function C(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"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(u||(u={})),function(e){e.Monday="monday",e.Sunday="sunday"}(l||(l={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(g||(g={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(s||(s={})),function(e){e.Metric="metric",e.Imperial="imperial"}(y||(y={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(P||(P={})),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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(m||(m={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(p||(p={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(h||(h={}));const S=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},T=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,O=e=>e,E=(e,n)=>{const o={};return n.forEach((n=>{n in e&&(o[n]=e[n])})),o},R=require("decimal.js");var A=e.n(R);const k=e=>new(A())(e).toDecimalPlaces(2).toNumber();function B(e,n={}){const{baseAmount:o=0,numberOfNights:t=1}=n;switch(e.feeType){case h.PercentageOfBooking:return o*(e.amount/100);case h.FixedChargePerRoom:case h.FixedChargePerBooking:return e.amount;case h.NightlyChargePerRoom:return e.amount*t;default:return 0}}const F=[h.FixedChargePerBooking],M=[h.PercentageOfBooking,h.FixedChargePerRoom,h.NightlyChargePerRoom],v=[h.PercentageOfBooking];function x(e,n){return e.filter((e=>n.includes(e.feeType)))}function b(e){return x(e,F)}function D(e){return x(e,M)}function I(e){return x(e,v)}module.exports=n})();
@@ -3,6 +3,7 @@ export declare enum EBookingPaymentMethod {
3
3
  SavedCard = "SavedCard",
4
4
  Planpay = "Planpay",
5
5
  Adyen = "Adyen",
6
+ Afterpay = "Afterpay",
6
7
  PCIBookingCard = "PCIBookingCard"
7
8
  }
8
9
  /**
@@ -42,14 +43,17 @@ export type EHotelCardProcessorInitData = {
42
43
  roomstayId: string;
43
44
  sessionId: string;
44
45
  sessionData: string;
45
- ww: any;
46
46
  clientKey: string;
47
47
  isLive: boolean;
48
48
  currency: string;
49
49
  amount: number;
50
50
  };
51
51
  [EHotelCardProcessor.RMSPay]: undefined;
52
- [EHotelCardProcessor.Till]: undefined;
52
+ [EHotelCardProcessor.Till]: {
53
+ redirectUrl: string;
54
+ paymentId: string;
55
+ roomstayId: string;
56
+ };
53
57
  [EHotelCardProcessor.Windcave]: {
54
58
  redirectUrl: string;
55
59
  paymentId: string;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ export declare enum EFeeType {
2
+ PercentageOfBooking = "PercentageOfBooking",
3
+ FixedChargePerRoom = "FixedChargePerRoom",
4
+ NightlyChargePerRoom = "NightlyChargePerRoom",
5
+ FixedChargePerBooking = "FixedChargePerBooking",
6
+ DepositSurcharge = "DepositSurcharge"
7
+ }
@@ -0,0 +1,5 @@
1
+ import { EFeeType } from "./EFeeType.enum";
2
+ export interface IFee {
3
+ amount: number;
4
+ feeType: EFeeType;
5
+ }
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
@@ -68,3 +68,8 @@ export * from "./General/IMessage.type";
68
68
  * Media
69
69
  */
70
70
  export * from "./Media/IMedia.type";
71
+ /**
72
+ * Fees
73
+ */
74
+ export * from "./Fees/EFeeType.enum";
75
+ export * from "./Fees/IFee.type";
File without changes
@@ -0,0 +1,7 @@
1
+ import { IFee } from '../types/index.js';
2
+ interface FeeCalculationParams {
3
+ baseAmount?: number;
4
+ numberOfNights?: number;
5
+ }
6
+ export declare function calculateFeeAmount(fee: IFee, params?: FeeCalculationParams): number;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ import { IFee } from '../types/index.js';
2
+ export declare function getFilteredBookingFees<T extends IFee>(fees: T[]): T[];
3
+ export declare function getFilteredBookingRateFees<T extends IFee>(fees: T[]): T[];
4
+ export declare function getFilteredBookingAddonFees<T extends IFee>(fees: T[]): T[];
@@ -4,3 +4,5 @@ export * from './roomstayImageResize';
4
4
  export * from './reflection';
5
5
  export * from './roundMoney';
6
6
  export * from './typeUtils';
7
+ export * from './calculateFee';
8
+ export * from './feeTypes';
@@ -0,0 +1,2 @@
1
+ export declare const nameof: <T>(name: Extract<keyof T, string>) => string;
2
+ export declare const nameofField: <T>(instance: T, name: keyof T) => string;
File without changes
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}},t={};function o(e){var r=t[e];if(void 0!==r)return r.exports;var a=t[e]={exports:{}};return n[e](a,a.exports,o),a.exports}o.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return o.d(n,{a:n}),n},o.d=(e,n)=>{for(var t in n)o.o(n,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),o.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,t;o.r(r),o.d(r,{EBookingPaymentMethod:()=>e,ECompanyProvider:()=>c,EDistanceUnitType:()=>p,EGuarantyPolicyPrepaymentType:()=>f,EHotelCardProcessor:()=>n,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>u,EIntegration:()=>s,EPlanpayBookingStatus:()=>t,ERMSDiscountType:()=>g,ERoomstayImageSize:()=>P,HttpMethod:()=>m,IAuxiliaryFilterType:()=>y,IBookingStatus:()=>i,PCIBookingCardProcessorTypes:()=>a,calculateTotalForMemberBooking:()=>T,nameof:()=>O,resizeRoomstayImageUrl:()=>E,roundMoney:()=>M,subset:()=>C,uppercaseString:()=>S}),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",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"}(t||(t={}));const a=[];let i,c,d,l,u,s,y,p,g,P,f,m;function S(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"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(l||(l={})),function(e){e.Monday="monday",e.Sunday="sunday"}(u||(u={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(s||(s={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(y||(y={})),function(e){e.Metric="metric",e.Imperial="imperial"}(p||(p={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(g||(g={})),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"}(P||(P={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(f||(f={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(m||(m={}));const T=e=>{let n=0;const t=Object.values(e.itinerary);for(const e of t){const t=Object.keys(e.nights);for(const o of t)n+=e.nights[o].total}return n},E=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,O=e=>e,C=(e,n)=>{const t={};return n.forEach((n=>{n in e&&(t[n]=e[n])})),t};var v=o(60),A=o.n(v);const M=e=>new(A())(e).toDecimalPlaces(2).toNumber()})(),r})()));
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:()=>y,EFeeType:()=>h,EGuarantyPolicyPrepaymentType:()=>p,EHotelCardProcessor:()=>n,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>u,EHotelWeekdayStartsOn:()=>l,EIntegration:()=>g,EPlanpayBookingStatus:()=>o,ERMSDiscountType:()=>P,ERoomstayImageSize:()=>f,HttpMethod:()=>m,IAuxiliaryFilterType:()=>s,IBookingStatus:()=>i,PCIBookingCardProcessorTypes:()=>a,calculateFeeAmount:()=>B,calculateTotalForMemberBooking:()=>S,getFilteredBookingAddonFees:()=>I,getFilteredBookingFees:()=>b,getFilteredBookingRateFees:()=>D,nameof:()=>O,resizeRoomstayImageUrl:()=>T,roundMoney:()=>k,subset:()=>E,uppercaseString:()=>C}),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,d,u,l,g,s,y,P,f,p,m,h;function C(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"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(u||(u={})),function(e){e.Monday="monday",e.Sunday="sunday"}(l||(l={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(g||(g={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(s||(s={})),function(e){e.Metric="metric",e.Imperial="imperial"}(y||(y={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(P||(P={})),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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(p||(p={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(m||(m={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(h||(h={}));const S=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},T=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,O=e=>e,E=(e,n)=>{const o={};return n.forEach((n=>{n in e&&(o[n]=e[n])})),o};var R=t(60),A=t.n(R);const k=e=>new(A())(e).toDecimalPlaces(2).toNumber();function B(e,n={}){const{baseAmount:o=0,numberOfNights:t=1}=n;switch(e.feeType){case h.PercentageOfBooking:return o*(e.amount/100);case h.FixedChargePerRoom:case h.FixedChargePerBooking:return e.amount;case h.NightlyChargePerRoom:return e.amount*t;default:return 0}}const v=[h.FixedChargePerBooking],x=[h.PercentageOfBooking,h.FixedChargePerRoom,h.NightlyChargePerRoom],F=[h.PercentageOfBooking];function M(e,n){return e.filter((e=>n.includes(e.feeType)))}function b(e){return M(e,v)}function D(e){return M(e,x)}function I(e){return M(e,F)}})(),r})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomstay/core",
3
- "version": "0.1.42",
3
+ "version": "0.1.43-0",
4
4
  "description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [