@roomstay/core 0.1.13 → 0.1.15
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/Company/ECompanyProvider.enum.d.ts +5 -0
- package/dist/types/Company/IAdminCompany.type.d.ts +26 -0
- package/dist/types/Company/IAdminCompanyDTO.type.d.ts +8 -0
- package/dist/types/Events/IRoomstayEvent.type.d.ts +8 -1
- package/dist/types/Hotel/IAuxiliaryFilter.type.d.ts +11 -0
- package/dist/types/Image/IRoomstayImage.type.d.ts +8 -0
- package/dist/types/Member/IRoomstayMember.type.d.ts +3 -3
- package/dist/types/Room/IRoomGroup.type.d.ts +8 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/roomstayImageResize.d.ts +14 -0
- package/dist/web.js +1 -1
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(n,
|
|
1
|
+
(()=>{"use strict";var e={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,r,i,c,d,l;function u(e){return e.toUpperCase()}e.r(n),e.d(n,{EBookingPaymentMethod:()=>t,ECompanyProvider:()=>r,EDistanceUnitType:()=>i,EHotelPriceModel:()=>c,EHotelWeekdayStartsOn:()=>d,EPlanpayBookingStatus:()=>a,ERoomstayImageSize:()=>l,IBookingStatus:()=>o,calculateTotalForMemberBooking:()=>y,resizeRoomstayImageUrl:()=>s,uppercaseString:()=>u}),function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(o||(o={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay"}(t||(t={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(a||(a={})),function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS"}(r||(r={})),function(e){e.Metric="metric",e.Imperial="imperial"}(i||(i={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(c||(c={})),function(e){e.Monday="monday",e.Sunday="sunday"}(d||(d={})),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"}(l||(l={}));const y=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},s=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e;module.exports=n})();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ECompanyProvider } from '../index.js';
|
|
2
|
+
export interface IAdminCompany {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
provider: ECompanyProvider;
|
|
6
|
+
providerLogin: string;
|
|
7
|
+
providerPassword: string;
|
|
8
|
+
hotelCount?: number;
|
|
9
|
+
rms?: {
|
|
10
|
+
clientId: number;
|
|
11
|
+
clientPassword: string;
|
|
12
|
+
useTrainingDb: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export type IAdminGetCompaiesResponse = IAdminCompany[];
|
|
16
|
+
/** What the API expects */
|
|
17
|
+
export type IAdminFetchRMSHotelsRequest = {
|
|
18
|
+
/** Passing this field will apply changes */
|
|
19
|
+
confirm?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** Response type of the Fetch RMS hotels endpoint. This endpoint will contact RMS and fetch Hotel's details directly from their database.
|
|
22
|
+
* On initial call the data won't be applied, you must call this API again and set {@link IAdminFetchRMSHotelsRequest.confirm} to true to apply the data */
|
|
23
|
+
export type IAdminFetchRMSHotelsResponse = {
|
|
24
|
+
/** If the hotels have in fact been synced, this will be true */
|
|
25
|
+
hasConfirmed: boolean;
|
|
26
|
+
};
|
|
@@ -12,16 +12,23 @@ export type IRoomstayEvent = {
|
|
|
12
12
|
image: {
|
|
13
13
|
background?: string;
|
|
14
14
|
url: string;
|
|
15
|
+
isRoomstay?: boolean;
|
|
16
|
+
id?: string;
|
|
15
17
|
};
|
|
16
18
|
checkoutUrl: string;
|
|
17
19
|
url: string;
|
|
18
20
|
endDate: string;
|
|
19
|
-
unixStartTime: number;
|
|
20
21
|
startDate: string;
|
|
22
|
+
/**
|
|
23
|
+
* Used to override the startDate (if event is repeating for example, say every thursday at 6pm)
|
|
24
|
+
*/
|
|
25
|
+
eventTimeDescription: string;
|
|
26
|
+
unixStartTime: number;
|
|
21
27
|
timezone: string;
|
|
22
28
|
searchCity: string[];
|
|
23
29
|
latitude: number;
|
|
24
30
|
longitude: number;
|
|
31
|
+
isPermanent?: boolean;
|
|
25
32
|
address: {
|
|
26
33
|
line1: string;
|
|
27
34
|
line2: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These filters can be applied to room groups currently,
|
|
3
|
+
* they add a way to add custom props on rooms, that in turn let you filter
|
|
4
|
+
* them in the front end further
|
|
5
|
+
*/
|
|
6
|
+
export type IAuxiliaryFilter = {
|
|
7
|
+
type: 'select';
|
|
8
|
+
/** If set to true, and user decides to filter by 3rd entry, 1st & 2nd also works */
|
|
9
|
+
includeAllAbove: boolean;
|
|
10
|
+
options: string[];
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IRoomstayMemberBooking, IRoomstayMemberCards } from '../index.js';
|
|
2
|
-
export
|
|
1
|
+
import { IRoomstayCognitoMember, IRoomstayMemberBooking, IRoomstayMemberCards } from '../index.js';
|
|
2
|
+
export interface IRoomstayMember extends IRoomstayCognitoMember {
|
|
3
3
|
username: string;
|
|
4
4
|
email: string;
|
|
5
5
|
forename?: string;
|
|
@@ -14,4 +14,4 @@ export type IRoomstayMember = {
|
|
|
14
14
|
defaultCard: string;
|
|
15
15
|
bookings: IRoomstayMemberBooking[];
|
|
16
16
|
cards: IRoomstayMemberCards[];
|
|
17
|
-
}
|
|
17
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
export * from './Booking/IPrice.type';
|
|
5
5
|
export * from './Booking/IBookingStatus.type';
|
|
6
6
|
export * from './Booking/IBookingPayment.type';
|
|
7
|
+
/**
|
|
8
|
+
* Company
|
|
9
|
+
*/
|
|
10
|
+
export * from './Company/IAdminCompany.type';
|
|
11
|
+
export * from './Company/ECompanyProvider.enum';
|
|
7
12
|
/**
|
|
8
13
|
* Hotel
|
|
9
14
|
*/
|
|
@@ -13,6 +18,15 @@ export * from './Hotel/IHotelOverrides.type';
|
|
|
13
18
|
export * from './Hotel/IHotelService.type';
|
|
14
19
|
export * from './Hotel/EHotelPriceModel.enum';
|
|
15
20
|
export * from './Hotel/EHotelWeekdayStartsOn.enum';
|
|
21
|
+
export * from './Hotel/IAuxiliaryFilter.type';
|
|
22
|
+
/**
|
|
23
|
+
* Room
|
|
24
|
+
*/
|
|
25
|
+
export * from './Room/IRoomGroup.type';
|
|
26
|
+
/**
|
|
27
|
+
* Image
|
|
28
|
+
*/
|
|
29
|
+
export * from './Image/IRoomstayImage.type';
|
|
16
30
|
/**
|
|
17
31
|
* Member Details
|
|
18
32
|
*/
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ERoomstayImageSize } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Converts an Image URL to a resized image URL.
|
|
4
|
+
*
|
|
5
|
+
* Right now we can only manipulate Roomstay hosted images in S3, so only where the source
|
|
6
|
+
* image URL contains cdn.app.roomstay.io can we add the resize parameters.
|
|
7
|
+
*
|
|
8
|
+
* This function will simply pass through any URL not matching the criteria
|
|
9
|
+
*
|
|
10
|
+
* @param url string
|
|
11
|
+
* @param size ImageSize
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const resizeRoomstayImageUrl: (url: string, size: ERoomstayImageSize) => string;
|
package/dist/web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
define("@roomstay/core",[],(()=>(()=>{"use strict";var e={d:(n,
|
|
1
|
+
define("@roomstay/core",[],(()=>(()=>{"use strict";var e={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,r,i,c,d,l;function u(e){return e.toUpperCase()}e.r(n),e.d(n,{EBookingPaymentMethod:()=>t,ECompanyProvider:()=>r,EDistanceUnitType:()=>i,EHotelPriceModel:()=>c,EHotelWeekdayStartsOn:()=>d,EPlanpayBookingStatus:()=>a,ERoomstayImageSize:()=>l,IBookingStatus:()=>o,calculateTotalForMemberBooking:()=>y,resizeRoomstayImageUrl:()=>s,uppercaseString:()=>u}),function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(o||(o={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay"}(t||(t={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(a||(a={})),function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS"}(r||(r={})),function(e){e.Metric="metric",e.Imperial="imperial"}(i||(i={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(c||(c={})),function(e){e.Monday="monday",e.Sunday="sunday"}(d||(d={})),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"}(l||(l={}));const y=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},s=(e,n)=>e.includes("cdn.app.roomstay.io")?e+"?w="+n:e;return n})()));
|