@curless/hotel-storefront 0.8.0 → 0.10.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/__tests__/card-contract.test.js +30 -0
- package/dist/__tests__/card-contract.test.js.map +1 -1
- package/dist/__tests__/demo-hotels.test.js +126 -0
- package/dist/__tests__/demo-hotels.test.js.map +1 -1
- package/dist/__tests__/tools.test.js +160 -0
- package/dist/__tests__/tools.test.js.map +1 -1
- package/dist/backend.d.ts +37 -2
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +19 -0
- package/dist/backend.js.map +1 -1
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/demo-hotels.d.ts.map +1 -1
- package/dist/demo-hotels.js +64 -3
- package/dist/demo-hotels.js.map +1 -1
- package/dist/server.d.ts +7 -7
- package/dist/server.js +1 -1
- package/dist/tools.d.ts +15 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +247 -15
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/backend.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Booking, CancellationPreview, ChangePreview, Extra, Guest, Hotel, HotelDetail, HotelPolicy, Identity, Member, Quote, Stay, TripDraft } from './types.js';
|
|
1
|
+
import type { Booking, CancellationPreview, ChangePreview, DateOption, Extra, Guest, Hotel, HotelDetail, HotelPolicy, Identity, Member, Quote, RoomRequestKind, RoomRequests, Stay, TripDraft } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Where the rooms come from.
|
|
4
4
|
*
|
|
@@ -22,6 +22,15 @@ import type { Booking, CancellationPreview, ChangePreview, Extra, Guest, Hotel,
|
|
|
22
22
|
* `limit` used to reach `slice(0, -3)` and return ninety-three.
|
|
23
23
|
*/
|
|
24
24
|
export declare const MAX_PAGE = 50;
|
|
25
|
+
/**
|
|
26
|
+
* Every preference the desk understands. A closed list on both sides of the
|
|
27
|
+
* seam: a code that is not here is dropped rather than passed on, because a
|
|
28
|
+
* request nobody reads is worse than one nobody made - the guest was told it
|
|
29
|
+
* was asked for.
|
|
30
|
+
*/
|
|
31
|
+
export declare const REQUEST_KINDS: RoomRequestKind[];
|
|
32
|
+
/** A line for a desk to read on arrival, not a place to put a conversation. */
|
|
33
|
+
export declare const REQUEST_NOTE_MAX = 200;
|
|
25
34
|
export type HotelBackend = {
|
|
26
35
|
/** Who the data belongs to, for the card's header and the legal pages. */
|
|
27
36
|
readonly brand: string;
|
|
@@ -49,6 +58,28 @@ export type HotelBackend = {
|
|
|
49
58
|
* public rate it comes off.
|
|
50
59
|
*/
|
|
51
60
|
getHotel(id: string, stay?: Stay, who?: Identity): Promise<HotelDetail | null>;
|
|
61
|
+
/**
|
|
62
|
+
* The same nights, arriving a few days either side - one re-quote per date.
|
|
63
|
+
*
|
|
64
|
+
* ⚠️ ITS OWN CALL, DELIBERATELY. A rate calendar is a separate endpoint at
|
|
65
|
+
* every hotel API we have looked at, because it is a different query: one
|
|
66
|
+
* room type across many dates rather than many room types on one date. Bolted
|
|
67
|
+
* onto `getHotel` it would make the common call - a guest opening a hotel -
|
|
68
|
+
* pay for a window they may never look at.
|
|
69
|
+
*
|
|
70
|
+
* `rooms` is part of the question, not a filter afterwards: the cheapest type
|
|
71
|
+
* with one left is often not the cheapest with three left, so the answer for
|
|
72
|
+
* a party needing three rooms is a different number, not the same one times
|
|
73
|
+
* three.
|
|
74
|
+
*
|
|
75
|
+
* Returns one option per date in the window, the asked-for dates among them
|
|
76
|
+
* marked `chosen`. A date with nothing bookable still comes back - it is an
|
|
77
|
+
* answer, and leaving it out would silently shift the window.
|
|
78
|
+
*/
|
|
79
|
+
datesAround(id: string, stay: Stay, opts: {
|
|
80
|
+
rooms: number;
|
|
81
|
+
span: number;
|
|
82
|
+
}, who?: Identity): Promise<DateOption[]>;
|
|
52
83
|
/**
|
|
53
84
|
* A membership number and the surname on it - what a desk checks.
|
|
54
85
|
*
|
|
@@ -65,8 +96,12 @@ export type HotelBackend = {
|
|
|
65
96
|
* Ask for the rooms. TODAY THIS TAKES NO MONEY: it holds them and answers
|
|
66
97
|
* with a confirmation code and when the hold lapses. Payment is the next
|
|
67
98
|
* step to slot in (robin: 先不收款), and it slots in here.
|
|
99
|
+
*
|
|
100
|
+
* `requests` are preferences the desk will try to meet - a bed type, a floor,
|
|
101
|
+
* a late arrival. They come back on the `Booking` unchanged; nothing on this
|
|
102
|
+
* side of the seam treats one as met.
|
|
68
103
|
*/
|
|
69
|
-
requestBooking(trip: TripDraft, guest: Guest, who: Identity): Promise<Booking>;
|
|
104
|
+
requestBooking(trip: TripDraft, guest: Guest, who: Identity, requests?: RoomRequests): Promise<Booking>;
|
|
70
105
|
listBookings(who: Identity, limit?: number): Promise<Booking[]>;
|
|
71
106
|
/**
|
|
72
107
|
* What changing the nights or the room count would cost - always before it is
|
package/dist/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,aAAa,EACb,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,EACJ,SAAS,EACV,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B,MAAM,MAAM,YAAY,GAAG;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,YAAY,CAAC,CAAC,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EA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
24
|
+
/**
|
|
25
|
+
* Every preference the desk understands. A closed list on both sides of the
|
|
26
|
+
* seam: a code that is not here is dropped rather than passed on, because a
|
|
27
|
+
* request nobody reads is worse than one nobody made - the guest was told it
|
|
28
|
+
* was asked for.
|
|
29
|
+
*/
|
|
30
|
+
export const REQUEST_KINDS = [
|
|
31
|
+
'king-bed',
|
|
32
|
+
'twin-beds',
|
|
33
|
+
'high-floor',
|
|
34
|
+
'low-floor',
|
|
35
|
+
'quiet-room',
|
|
36
|
+
'connecting-rooms',
|
|
37
|
+
'early-check-in',
|
|
38
|
+
'late-arrival',
|
|
39
|
+
'accessible-room',
|
|
40
|
+
];
|
|
41
|
+
/** A line for a desk to read on arrival, not a place to put a conversation. */
|
|
42
|
+
export const REQUEST_NOTE_MAX = 200;
|
|
24
43
|
//# sourceMappingURL=backend.js.map
|
package/dist/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;GAYG;AACH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,iBAAiB;CAClB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC"}
|
package/dist/card.generated.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const HOTEL_CARD_HTML: string;
|
|
2
2
|
/** sha256 of widget/src + widget/index.html at build time - the drift guard reads this. */
|
|
3
|
-
export declare const HOTEL_CARD_SOURCE_SHA = "
|
|
3
|
+
export declare const HOTEL_CARD_SOURCE_SHA = "6e1b975c7d2c3f093263cc5ea7ae3869644f417d3dff3883406f2d408c530952";
|
|
4
4
|
//# sourceMappingURL=card.generated.d.ts.map
|