@roomstay/core 0.1.14 → 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 CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={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,r,c,d;function i(e){return e.toUpperCase()}e.r(n),e.d(n,{EBookingPaymentMethod:()=>o,EDistanceUnitType:()=>r,EHotelPriceModel:()=>c,EHotelWeekdayStartsOn:()=>d,EPlanpayBookingStatus:()=>a,IBookingStatus:()=>t,calculateTotalForMemberBooking:()=>l,uppercaseString:()=>i}),function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay"}(o||(o={})),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.Metric="metric",e.Imperial="imperial"}(r||(r={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(c||(c={})),function(e){e.Monday="monday",e.Sunday="sunday"}(d||(d={}));const l=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};module.exports=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,5 @@
1
+ export declare enum ECompanyProvider {
2
+ Synxis = "Synxis",
3
+ Availpro = "Availpro",
4
+ RMS = "RMS"
5
+ }
@@ -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
+ };
@@ -0,0 +1,8 @@
1
+ export interface IAdminCompany {
2
+ id: string;
3
+ name: string;
4
+ provider: string;
5
+ }
6
+ export interface IAdminGetCompaiesResponse {
7
+ companies: IAdminCompany[];
8
+ }
@@ -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
+ };
@@ -0,0 +1,11 @@
1
+ export type IHotelColorScheme = {
2
+ accent: string;
3
+ accent2: string;
4
+ accent3: string;
5
+ success: string;
6
+ navbar?: {
7
+ background?: string;
8
+ text?: string;
9
+ textActive?: string;
10
+ };
11
+ };
@@ -0,0 +1,8 @@
1
+ export declare enum ERoomstayImageSize {
2
+ Icon = 128,
3
+ Tiny = 256,
4
+ Small = 512,
5
+ Medium = 768,
6
+ Large = 1024,
7
+ ExtraLarge = 1600
8
+ }
@@ -0,0 +1,8 @@
1
+ export type IRoomGroup = {
2
+ companyId: number;
3
+ hotelId: string;
4
+ id: string;
5
+ groupName: string;
6
+ /** this will be a list of room codes */
7
+ rooms: string[];
8
+ };
@@ -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
  */
@@ -1,2 +1,3 @@
1
1
  export * from './uppercaseString';
2
2
  export * from './bookingTotal';
3
+ export * from './roomstayImageResize';
@@ -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,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,r,a,c,d;function i(e){return e.toUpperCase()}e.r(n),e.d(n,{EBookingPaymentMethod:()=>o,EDistanceUnitType:()=>a,EHotelPriceModel:()=>c,EHotelWeekdayStartsOn:()=>d,EPlanpayBookingStatus:()=>r,IBookingStatus:()=>t,calculateTotalForMemberBooking:()=>l,uppercaseString:()=>i}),function(e){e.Pending="Pending",e.Committed="Committed",e.Cancelled="Cancelled"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay"}(o||(o={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(r||(r={})),function(e){e.Metric="metric",e.Imperial="imperial"}(a||(a={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(c||(c={})),function(e){e.Monday="monday",e.Sunday="sunday"}(d||(d={}));const l=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};return 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})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomstay/core",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [