@roomstay/core 0.1.46-4 → 0.1.47-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/Booking/ICheckoutBrowserSession.type.d.ts +14 -0
- package/dist/types/Company/IAdminCompany.type.d.ts +2 -3
- package/dist/types/Fees/IFee.type.d.ts +0 -1
- package/dist/types/General/IJsonString.type.d.ts +6 -0
- package/dist/types/index.d.ts +0 -6
- package/dist/utils/calculateFee.d.ts +0 -3
- package/dist/utils/feeTypes.d.ts +1 -2
- package/dist/utils/index.d.ts +0 -2
- package/dist/web.js +1 -1
- package/package.json +1 -5
- package/dist/types/Fees/IFeeConfigurationOptions.type.d.ts +0 -6
- package/dist/types/Fees/IFeeOptions.type.d.ts +0 -6
- package/dist/utils/feeOptionRules.d.ts +0 -0
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:n=>{var
|
|
1
|
+
(()=>{"use strict";var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},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 t,o,a;e.r(n),e.d(n,{EBookingPaymentMethod:()=>t,ECompanyProvider:()=>c,EDistanceUnitType:()=>p,EGuarantyPolicyPrepaymentType:()=>m,EHotelCardProcessor:()=>o,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>u,EIntegration:()=>s,EPlanpayBookingStatus:()=>a,ERMSDiscountType:()=>g,ERoomstayImageSize:()=>P,HttpMethod:()=>S,IAuxiliaryFilterType:()=>y,IBookingStatus:()=>i,IMaintenanceStatusService:()=>f,PCIBookingCardProcessorTypes:()=>r,calculateTotalForMemberBooking:()=>E,nameof:()=>A,resizeRoomstayImageUrl:()=>O,roundMoney:()=>h,subset:()=>C,uppercaseString:()=>T}),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(t||(t={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave"}(o||(o={})),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,s,y,p,g,P,f,m,S;function T(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.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(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"}(S||(S={}));const E=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},O=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,A=e=>e,C=(e,n)=>{const t={};return n.forEach((n=>{n in e&&(t[n]=e[n])})),t},v=require("decimal.js");var M=e.n(v);const h=e=>new(M())(e).toDecimalPlaces(2).toNumber();module.exports=n})();
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ECompanyProvider, MediaType } from
|
|
1
|
+
import type { ECompanyProvider, MediaType } from "../index.js";
|
|
2
2
|
export interface IAdminCompany {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
@@ -7,7 +7,6 @@ export interface IAdminCompany {
|
|
|
7
7
|
provider: ECompanyProvider;
|
|
8
8
|
providerLogin: string;
|
|
9
9
|
providerPassword: string;
|
|
10
|
-
isGiftCardsEnabled: boolean;
|
|
11
10
|
hotels: {
|
|
12
11
|
name: string;
|
|
13
12
|
label: string;
|
|
@@ -21,7 +20,7 @@ export interface IAdminCompany {
|
|
|
21
20
|
};
|
|
22
21
|
}[];
|
|
23
22
|
}
|
|
24
|
-
export type
|
|
23
|
+
export type IAdminGetCompaiesResponse = IAdminCompany[];
|
|
25
24
|
/** What the API expects */
|
|
26
25
|
export type IAdminFetchRMSHotelsRequest = {
|
|
27
26
|
/** Passing this field will apply changes */
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,9 +2,6 @@ import { IFee } from '../types/index.js';
|
|
|
2
2
|
interface FeeCalculationParams {
|
|
3
3
|
baseAmount?: number;
|
|
4
4
|
numberOfNights?: number;
|
|
5
|
-
feeIncludedInBaseAmount?: boolean;
|
|
6
|
-
extractedFromRates?: boolean;
|
|
7
|
-
removedPercentages?: number[];
|
|
8
5
|
}
|
|
9
6
|
export declare function calculateFeeAmount(fee: IFee, params?: FeeCalculationParams): number;
|
|
10
7
|
export {};
|
package/dist/utils/feeTypes.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IFee } from '../types/index.js';
|
|
2
2
|
export declare function getFilteredBookingFees<T extends IFee>(fees: T[]): T[];
|
|
3
3
|
export declare function getFilteredBookingRateFees<T extends IFee>(fees: T[]): T[];
|
|
4
4
|
export declare function getFilteredBookingAddonFees<T extends IFee>(fees: T[]): T[];
|
|
5
|
-
export declare function getFeeOptionValidity(feeType: EFeeType): Record<keyof IFeeConfigurationOptions, boolean>;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var n={60:n=>{n.exports=e}},
|
|
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:()=>m,EHotelCardProcessor:()=>n,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>u,EIntegration:()=>s,EPlanpayBookingStatus:()=>t,ERMSDiscountType:()=>g,ERoomstayImageSize:()=>P,HttpMethod:()=>S,IAuxiliaryFilterType:()=>y,IBookingStatus:()=>i,IMaintenanceStatusService:()=>f,PCIBookingCardProcessorTypes:()=>a,calculateTotalForMemberBooking:()=>E,nameof:()=>O,resizeRoomstayImageUrl:()=>v,roundMoney:()=>h,subset:()=>A,uppercaseString:()=>T}),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"}(t||(t={}));const a=[];let i,c,d,l,u,s,y,p,g,P,f,m,S;function T(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.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(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"}(S||(S={}));const E=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},v=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e,O=e=>e,A=(e,n)=>{const t={};return n.forEach((n=>{n in e&&(t[n]=e[n])})),t};var C=o(60),M=o.n(C);const h=e=>new(M())(e).toDecimalPlaces(2).toNumber()})(),r})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomstay/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47-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": [
|
|
@@ -46,9 +46,5 @@
|
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"decimal.js": "^10.4.3"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"global": "^4.4.0",
|
|
52
|
-
"yalc": "^1.0.0-pre.53"
|
|
53
49
|
}
|
|
54
50
|
}
|
|
File without changes
|