@curless/hotel-storefront 0.65.2 → 0.67.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/account/fake-ota.d.ts +5 -0
- package/dist/account/fake-ota.d.ts.map +1 -1
- package/dist/account/fake-ota.js +8 -2
- package/dist/account/fake-ota.js.map +1 -1
- package/dist/account/index.d.ts +36 -0
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +208 -26
- package/dist/account/index.js.map +1 -1
- package/dist/account/ota-member.d.ts +2 -0
- package/dist/account/ota-member.d.ts.map +1 -1
- package/dist/account/ota-member.js +2 -0
- package/dist/account/ota-member.js.map +1 -1
- package/dist/account/pages.d.ts +51 -5
- package/dist/account/pages.d.ts.map +1 -1
- package/dist/account/pages.js +153 -23
- package/dist/account/pages.js.map +1 -1
- package/dist/account/requests.d.ts +2 -0
- package/dist/account/requests.d.ts.map +1 -1
- package/dist/account/requests.js.map +1 -1
- package/dist/account/store.d.ts +57 -2
- package/dist/account/store.d.ts.map +1 -1
- package/dist/account/store.js +52 -4
- package/dist/account/store.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/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/otaless/backend.d.ts +6 -2
- package/dist/otaless/backend.d.ts.map +1 -1
- package/dist/otaless/backend.js +58 -9
- package/dist/otaless/backend.js.map +1 -1
- package/dist/otaless/booking.d.ts +190 -28
- package/dist/otaless/booking.d.ts.map +1 -1
- package/dist/otaless/booking.js +929 -374
- package/dist/otaless/booking.js.map +1 -1
- package/dist/otaless/client.d.ts +120 -34
- package/dist/otaless/client.d.ts.map +1 -1
- package/dist/otaless/client.js +133 -19
- package/dist/otaless/client.js.map +1 -1
- package/dist/otaless/fake.d.ts +59 -10
- package/dist/otaless/fake.d.ts.map +1 -1
- package/dist/otaless/fake.js +132 -34
- package/dist/otaless/fake.js.map +1 -1
- package/dist/otaless/make.d.ts +2 -0
- package/dist/otaless/make.d.ts.map +1 -1
- package/dist/otaless/make.js +56 -18
- package/dist/otaless/make.js.map +1 -1
- package/dist/otaless/places.d.ts +14 -0
- package/dist/otaless/places.d.ts.map +1 -1
- package/dist/otaless/places.js +108 -1
- package/dist/otaless/places.js.map +1 -1
- package/dist/pictures.d.ts +19 -0
- package/dist/pictures.d.ts.map +1 -0
- package/dist/pictures.js +74 -0
- package/dist/pictures.js.map +1 -0
- package/dist/server.d.ts +15 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +236 -37
- package/dist/server.js.map +1 -1
- package/dist/sessions.d.ts +23 -0
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +39 -1
- package/dist/sessions.js.map +1 -1
- package/dist/supplier.js +4 -0
- package/dist/supplier.js.map +1 -1
- package/dist/surface.d.ts +24 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +35 -6
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +24 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +217 -23
- package/dist/tools.js.map +1 -1
- package/dist/trip-ids.d.ts +13 -1
- package/dist/trip-ids.d.ts.map +1 -1
- package/dist/trip-ids.js +30 -3
- package/dist/trip-ids.js.map +1 -1
- package/dist/types.d.ts +88 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { type BookingList } from '../backend.js';
|
|
2
2
|
import type { StateFile } from '../state.js';
|
|
3
3
|
import type { Booking, BookingResult, CancellationPreview, Extra, FailedStay, Guest, Hotel, Identity, Money, Names, Quote, Stay, TripDraft, Unanswered } from '../types.js';
|
|
4
|
-
import { type OtalessClient, type WirePrice } from './client.js';
|
|
4
|
+
import { type Cred, type OtalessClient, type Sent, type WirePrice } from './client.js';
|
|
5
5
|
import type { Caller } from './limits.js';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* How long terms are kept for the guest to agree to (§12.1) - and how long an
|
|
8
|
+
* order whose terms changed holds its payment page back before it is
|
|
9
|
+
* cancelled (总线程 11-11, D).
|
|
10
|
+
*/
|
|
7
11
|
export declare const TERMS_MS: number;
|
|
8
12
|
/** How long a group's `Mcp-Session-Id` is kept unused (§12.3). */
|
|
9
13
|
export declare const SESSION_IDLE_MS: number;
|
|
10
14
|
/** A payment's status is asked for at most this often per order (§12.1, 15). */
|
|
11
15
|
export declare const STATUS_EVERY_MS = 10000;
|
|
12
16
|
/**
|
|
13
|
-
* An order
|
|
17
|
+
* An order 8 did not answer for, not found in the group's list this long
|
|
14
18
|
* after it was asked for - and nothing there that could be it - no longer holds
|
|
15
19
|
* the stay back (总线程's re-review of 0.63.1, 1). Eight times the 15 minutes
|
|
16
20
|
* the document's checkout holds a room unpaid.
|
|
17
21
|
*/
|
|
18
22
|
export declare const UNCONFIRMED_GIVE_UP_MS: number;
|
|
23
|
+
/**
|
|
24
|
+
* An order a person was to see to (`needsPerson`), still not settled this long
|
|
25
|
+
* after: no longer holds the stay back - the guest is told first, as it is
|
|
26
|
+
* (总线程's review of 0.66.0, 6). The same two hours as an order 8 did not
|
|
27
|
+
* answer for: any hold on an unpaid room is long gone by then.
|
|
28
|
+
*/
|
|
29
|
+
export declare const NEEDS_PERSON_GIVE_UP_MS: number;
|
|
19
30
|
/**
|
|
20
31
|
* An order waiting for its payment with no time to pay by from 13: taken as
|
|
21
32
|
* payable this long after it was made, or after the payment status (15) last
|
|
@@ -28,11 +39,15 @@ export declare const CLOSED_PAYMENT_STATUSES: ReadonlySet<string>;
|
|
|
28
39
|
export declare const TERMS_MAX = 50000;
|
|
29
40
|
/**
|
|
30
41
|
* The payment pages a guest may be sent to, until a deployment says otherwise:
|
|
31
|
-
* the group checkout host of 13's
|
|
32
|
-
*
|
|
33
|
-
* re-review of 0.63.1, 720f5e4f): that is our own hosted
|
|
34
|
-
* any merchant and any amount
|
|
35
|
-
*
|
|
42
|
+
* the group checkout host of 13's example (`pay.discoverasr.com`). Exact host
|
|
43
|
+
* names: no wildcard, no other port. ⚠️ NOT `mcp.curless.ai` (总线程's
|
|
44
|
+
* re-review of 0.63.1, 720f5e4f; again 11-11, B): that is our own hosted
|
|
45
|
+
* checkout, which takes any merchant and any amount, and has no `/pay/cashier`
|
|
46
|
+
* behind it today - though 8's example names it. A page there is not handed
|
|
47
|
+
* on: the order is cancelled and its host logged, to ask the backend about.
|
|
48
|
+
* Should it ever be listed, it is as `mcp.curless.ai/pay/cashier?order={order}`
|
|
49
|
+
* - that page for that order alone (`payPageOf`). A page on a host listed
|
|
50
|
+
* alone must still name the order (总线程's review of 0.66.0, 2).
|
|
36
51
|
*/
|
|
37
52
|
export declare const DEFAULT_CHECKOUT_HOSTS: readonly string[];
|
|
38
53
|
/**
|
|
@@ -62,7 +77,7 @@ export type BookingAuth = {
|
|
|
62
77
|
expired?: (key: string, group: string) => void;
|
|
63
78
|
};
|
|
64
79
|
export type OrderStatus = 'awaiting-payment' | 'confirmed' | 'cancelled' | 'expired' | 'failed'
|
|
65
|
-
/**
|
|
80
|
+
/** 8 did not answer: whether the order was made is not known. Its `id` is `pending:…` until `/orders` says. */
|
|
66
81
|
| 'unconfirmed';
|
|
67
82
|
/**
|
|
68
83
|
* One order this connector made, as it keeps it (`otaless-orders.json`, on
|
|
@@ -71,7 +86,7 @@ export type OrderStatus = 'awaiting-payment' | 'confirmed' | 'cancelled' | 'expi
|
|
|
71
86
|
* email and phone only masked.
|
|
72
87
|
*/
|
|
73
88
|
export type OrderRecord = {
|
|
74
|
-
/** The backend's `unifiedOrderId` - or `pending:<hex>` while
|
|
89
|
+
/** The backend's `unifiedOrderId` - or `pending:<hex>` while 8's answer is not known. */
|
|
75
90
|
id: string;
|
|
76
91
|
/** What the guest quotes at the desk: `originalOrderId`, '' while not known. */
|
|
77
92
|
code: string;
|
|
@@ -91,17 +106,25 @@ export type OrderRecord = {
|
|
|
91
106
|
quoted: Money;
|
|
92
107
|
/** The same price in USD, as the quote gave it (`settlementAmount`). */
|
|
93
108
|
quotedUsd?: Money;
|
|
94
|
-
/** What
|
|
109
|
+
/** What 8 said it would charge. */
|
|
95
110
|
charged?: Money;
|
|
96
111
|
status: OrderStatus;
|
|
97
112
|
/** Paid - by the backend's own payment status (15) or its order list (12). */
|
|
98
113
|
paid?: boolean;
|
|
99
114
|
/** The host of the payment page the guest was sent to - never its path or query. */
|
|
100
115
|
payHost?: string;
|
|
101
|
-
/** Until when it can be paid
|
|
116
|
+
/** Until when it can be paid, ISO - 13 said it (`hold_minutes`); 8 does not, so an order of 8 has none. */
|
|
102
117
|
payBy?: string;
|
|
103
118
|
/** The group's cancellation terms, as it sent them with the order (or with the room). */
|
|
104
119
|
terms?: string;
|
|
120
|
+
/**
|
|
121
|
+
* The group answered the order with other terms than the guest agreed to
|
|
122
|
+
* (总线程 11-11, D): its payment page is not handed on until the guest agrees
|
|
123
|
+
* to these too - by `until`, or the order is cancelled.
|
|
124
|
+
*/
|
|
125
|
+
held?: {
|
|
126
|
+
until: string;
|
|
127
|
+
};
|
|
105
128
|
guest: {
|
|
106
129
|
name: string;
|
|
107
130
|
email: string;
|
|
@@ -114,8 +137,13 @@ export type OrderRecord = {
|
|
|
114
137
|
status: 'requested' | 'refunded';
|
|
115
138
|
amount?: Money;
|
|
116
139
|
};
|
|
117
|
-
/**
|
|
118
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Cancelled at once by us: 8's amount was not the price (`price`) or it said
|
|
142
|
+
* none (`amount`), it was for another number of guests (`adults`), its
|
|
143
|
+
* payment page was not on the list (`address`), or terms it came with were
|
|
144
|
+
* not agreed to (`terms`).
|
|
145
|
+
*/
|
|
146
|
+
released?: 'price' | 'amount' | 'adults' | 'address' | 'terms';
|
|
119
147
|
/** Letting it go did not go through: a person must see to it. */
|
|
120
148
|
releaseFailed?: true;
|
|
121
149
|
/**
|
|
@@ -127,22 +155,34 @@ export type OrderRecord = {
|
|
|
127
155
|
/** When the payment status (15) last said it is still waiting to be paid, ISO. */
|
|
128
156
|
pendingSeenAt?: string;
|
|
129
157
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* `
|
|
158
|
+
* A person looks (shown as `unconfirmed`, no payment link handed on): said
|
|
159
|
+
* paid at an amount that is none of the ones asked - or with none
|
|
160
|
+
* (`paid-amount`); or an order we cancel at once whose cancelling did not go
|
|
161
|
+
* through (`release` - it may still stand at the group, and must not be paid).
|
|
162
|
+
*/
|
|
163
|
+
needsPerson?: 'paid-amount' | 'release';
|
|
164
|
+
/** When `needsPerson` was set, ISO (none before 0.67: `createdAt` stands in). */
|
|
165
|
+
needsPersonAt?: string;
|
|
166
|
+
/**
|
|
167
|
+
* With `needsPerson`, past `NEEDS_PERSON_GIVE_UP_MS`: the guest was told it is
|
|
168
|
+
* still with a person and may stand at the group - it no longer holds the
|
|
169
|
+
* stay back; asked again, a new booking is made (总线程's review of 0.66.0, 6).
|
|
133
170
|
*/
|
|
134
|
-
|
|
171
|
+
rebookable?: true;
|
|
135
172
|
/**
|
|
136
|
-
*
|
|
173
|
+
* 8 did not answer, and the order could not be found in the group's list
|
|
137
174
|
* for `UNCONFIRMED_GIVE_UP_MS` - nor anything there that could be it: no
|
|
138
175
|
* longer holds the stay back (总线程's re-review of 0.63.1, 1). Still shown
|
|
139
176
|
* as not known.
|
|
140
177
|
*/
|
|
141
178
|
unverifiable?: true;
|
|
142
179
|
};
|
|
143
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* Terms for the guest to agree to - or not - before anything is ordered (§15.2),
|
|
182
|
+
* or after the group answered an order with other terms (`changed`, 总线程 11-11, D).
|
|
183
|
+
*/
|
|
144
184
|
export type TermsToAgree = {
|
|
145
|
-
/** What the guest's agreement is
|
|
185
|
+
/** What the guest's agreement is given by (`acceptTerms`): one use, `TERMS_MS`. */
|
|
146
186
|
ref: string;
|
|
147
187
|
group: string;
|
|
148
188
|
groupName: string;
|
|
@@ -154,8 +194,36 @@ export type TermsToAgree = {
|
|
|
154
194
|
stay: Stay;
|
|
155
195
|
rooms: number;
|
|
156
196
|
total: Money;
|
|
157
|
-
/** The group's terms, word for word. */
|
|
197
|
+
/** The group's terms, word for word - '' when it sent none for the room (`source: 'none'`). */
|
|
158
198
|
text: string;
|
|
199
|
+
/**
|
|
200
|
+
* Where `text` is from: the room as the group listed it (`room`), nothing -
|
|
201
|
+
* the group sent no terms for it (`none`, say so in our own words), or the
|
|
202
|
+
* group's answer to the order itself (`booking`, with `changed`).
|
|
203
|
+
*/
|
|
204
|
+
source: 'room' | 'none' | 'booking';
|
|
205
|
+
/**
|
|
206
|
+
* ⚠️ ALWAYS, UNTIL QUESTIONS #61 (3) IS ANSWERED (总线程 11-11, A): the group
|
|
207
|
+
* may have terms of its own when the booking is made, not seen here - say so.
|
|
208
|
+
*/
|
|
209
|
+
more: true;
|
|
210
|
+
/**
|
|
211
|
+
* Terms the group answered an order with, not the ones the guest agreed to:
|
|
212
|
+
* the order is made and waits for its payment, its page held back until these
|
|
213
|
+
* are agreed to; not agreed, it is cancelled. Say only that - the terms are
|
|
214
|
+
* not the ones shown before, read them and decide (总线程 11-11, D).
|
|
215
|
+
*/
|
|
216
|
+
changed?: true;
|
|
217
|
+
/**
|
|
218
|
+
* A step the group asked for when the booking was sent (8 answered
|
|
219
|
+
* `terms_required` - questions #66 - or `confirm_required` - #68 - with what
|
|
220
|
+
* to agree to or confirm, `text`): nothing is ordered; agreed to or confirmed
|
|
221
|
+
* by the guest themselves, the booking is sent once more with it. Not: nothing.
|
|
222
|
+
*/
|
|
223
|
+
askedByGroup?: GroupStep;
|
|
224
|
+
/** With `changed`: the order it holds back. */
|
|
225
|
+
bookingId?: string;
|
|
226
|
+
confirmationCode?: string;
|
|
159
227
|
/** Until when they can be agreed to, ISO. */
|
|
160
228
|
until: string;
|
|
161
229
|
};
|
|
@@ -171,8 +239,20 @@ export type OtalessCancellationPreview = CancellationPreview & {
|
|
|
171
239
|
export type OtalessBookingApi = {
|
|
172
240
|
/** The terms behind `ref`, for the agreement page or the card - this account's only. */
|
|
173
241
|
pendingTerms(ref: string, who: Identity): TermsToAgree | undefined;
|
|
174
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* The guest agreed to the terms behind `ref` (on the card's button or the
|
|
244
|
+
* page - never the model's word): the stay is ordered (8) - or, `changed`,
|
|
245
|
+
* the order's payment page is handed on.
|
|
246
|
+
*/
|
|
175
247
|
acceptTerms(ref: string, who: Identity): Promise<OtalessBookingResult>;
|
|
248
|
+
/**
|
|
249
|
+
* The guest did not agree (the page's "do not agree"): the terms go at once.
|
|
250
|
+
* `changed`: the order they held back is cancelled (9) - `booking` says how
|
|
251
|
+
* it stands. Unknown, used or not this guest's: nothing happens.
|
|
252
|
+
*/
|
|
253
|
+
discardTerms(ref: string, who: Identity): Promise<{
|
|
254
|
+
booking?: Booking;
|
|
255
|
+
}>;
|
|
176
256
|
/**
|
|
177
257
|
* What asking for a paid booking's money back would ask for - before it is
|
|
178
258
|
* asked (总线程's review of 0.63.0, B): all of what was paid, the group's own
|
|
@@ -213,6 +293,12 @@ export type BookingDeps = {
|
|
|
213
293
|
quote: (trip: TripDraft, who?: Identity) => Promise<Quote>;
|
|
214
294
|
/** One room's quote as the backend sent it - both amounts - asked as the trip's was (its cache answers it). */
|
|
215
295
|
quoteWire: (h: Hotel, roomId: string, stay: Stay, rooms: number, who?: Identity) => Promise<WirePrice>;
|
|
296
|
+
/**
|
|
297
|
+
* One room priced in the guest's session at its group (7 with their token
|
|
298
|
+
* and `Mcp-Session-Id`, never kept) - right before 8 books it, in the same
|
|
299
|
+
* session (总线程 11-11, C), the adults as the guest chose.
|
|
300
|
+
*/
|
|
301
|
+
quoteIn: (h: Hotel, roomId: string, stay: Stay, rooms: number, cred: Cred, who?: Identity) => Promise<Sent<WirePrice>>;
|
|
216
302
|
groupOf: (code: string) => Unanswered;
|
|
217
303
|
callerOf: (who?: Identity) => Caller | undefined;
|
|
218
304
|
auth?: BookingAuth;
|
|
@@ -220,6 +306,8 @@ export type BookingDeps = {
|
|
|
220
306
|
checkoutHosts: readonly string[];
|
|
221
307
|
/** Add-ons after booking (10, 11) are on (`data.otaless.addons`) - off, both refuse (`addons-off`). */
|
|
222
308
|
addonsOn?: boolean;
|
|
309
|
+
/** Runs `fn` after `ms` - a held order's time running out. Tests run it by hand. */
|
|
310
|
+
later?: (ms: number, fn: () => void) => void;
|
|
223
311
|
now: () => number;
|
|
224
312
|
log: (line: string) => void;
|
|
225
313
|
};
|
|
@@ -269,26 +357,100 @@ export type OtalessFailedStay = FailedStay & {
|
|
|
269
357
|
* a server may read as more than one segment.
|
|
270
358
|
*/
|
|
271
359
|
export declare const pathSegments: (path: string) => string[] | undefined;
|
|
272
|
-
/**
|
|
360
|
+
/**
|
|
361
|
+
* One `checkoutHosts` entry: a host; a host and the path a page must be under
|
|
362
|
+
* (`host/a/b/`); or a host, the exact path and the one query parameter that
|
|
363
|
+
* must name the order (`host/a/b?order={order}` - `order` is the parameter's
|
|
364
|
+
* name, 总线程 11-11, B). A malformed path or query matches nothing.
|
|
365
|
+
*/
|
|
273
366
|
export declare const checkoutEntryOf: (entry: string) => {
|
|
274
367
|
host: string;
|
|
275
368
|
under: string[];
|
|
369
|
+
order?: string;
|
|
276
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* What is wrong with a list of payment pages, or nothing: ⚠️ A HOST LISTED
|
|
373
|
+
* WITH ITS ORDER (`?order={order}`) IS LISTED NO WIDER (总线程 11-11, B) - no
|
|
374
|
+
* entry of it alone, or of a path a page is under, beside it: that would let
|
|
375
|
+
* any page there through. Entries naming the order are not wider than each other.
|
|
376
|
+
*/
|
|
377
|
+
export declare const checkoutHostsProblem: (hosts: readonly string[]) => string | undefined;
|
|
277
378
|
/**
|
|
278
379
|
* Where a payment page may send the guest: `https:`, an exact host on the
|
|
279
380
|
* list, no other port, no user in it - or nothing (总线程 11-10). An entry
|
|
280
|
-
* written with a path (`
|
|
281
|
-
*
|
|
381
|
+
* written with a path (`host/pay/`) also holds it to that path, by whole
|
|
382
|
+
* segments, compared after the path is put the way a server reads it
|
|
282
383
|
* (`pathSegments`: no `..`, `%2e` or `//` slips past); an entry of a host alone
|
|
283
384
|
* takes any path on it (总线程's review of 0.63.0, 8). The page handed on is
|
|
284
385
|
* the one checked: its path as compared.
|
|
386
|
+
*
|
|
387
|
+
* ⚠️ AND ONLY A PAGE NAMING THIS ORDER (总线程's review of 0.66.0, 2): through an
|
|
388
|
+
* entry without `{order}`, the order's `unifiedOrderId` or `originalOrderId` must
|
|
389
|
+
* be in the page - a whole path segment, or a whole query value. Neither there,
|
|
390
|
+
* or no order to hold it to: nothing. (`pay.discoverasr.com` until its pages'
|
|
391
|
+
* real form is known - then an exact entry naming `{order}`.)
|
|
392
|
+
*
|
|
393
|
+
* ⚠️ AN ENTRY NAMING THE ORDER (`host/pay/cashier?order={order}`, 总线程
|
|
394
|
+
* 11-11, B) TAKES ONE PAGE: that path exactly, and a query of that one
|
|
395
|
+
* parameter, once, naming `order` - this very order's `unifiedOrderId` - and
|
|
396
|
+
* no fragment. What is handed on is rebuilt from the entry and the order, never
|
|
397
|
+
* the backend's own string. No order to hold it to: nothing.
|
|
285
398
|
*/
|
|
286
|
-
export declare const payPageOf: (raw: string | undefined, hosts: readonly string[]
|
|
399
|
+
export declare const payPageOf: (raw: string | undefined, hosts: readonly string[], order?: {
|
|
400
|
+
id: string;
|
|
401
|
+
code?: string;
|
|
402
|
+
}) => {
|
|
287
403
|
url: string;
|
|
288
404
|
host: string;
|
|
289
405
|
} | undefined;
|
|
290
406
|
/**
|
|
291
|
-
* The
|
|
407
|
+
* The form of a payment page not handed on, for the log - NO VALUE OF IT
|
|
408
|
+
* (总线程 11-11 late): each path segment a plain word as it is, or its length;
|
|
409
|
+
* each parameter's name (a plain word, or its length) and its value's length;
|
|
410
|
+
* and where this order's `unifiedOrderId` / `originalOrderId` is in it - or
|
|
411
|
+
* that it is not. From the first real page, the exact `{order}` entry can be
|
|
412
|
+
* written; no payment token reaches the log.
|
|
413
|
+
*/
|
|
414
|
+
export declare const pageShape: (raw: string | undefined, order?: {
|
|
415
|
+
id: string;
|
|
416
|
+
code?: string;
|
|
417
|
+
}) => string;
|
|
418
|
+
/**
|
|
419
|
+
* Two terms the same but for spacing and punctuation (总线程 11-11, D): a
|
|
420
|
+
* group's answer formatted a little differently is not new terms to agree to.
|
|
421
|
+
*/
|
|
422
|
+
export declare const termsKey: (s: string) => string;
|
|
423
|
+
/**
|
|
424
|
+
* A second step a group asks for before it books: its own terms agreed to
|
|
425
|
+
* (`terms_required` - Ascott, robin 11-11 18:30, questions #66) or the booking
|
|
426
|
+
* confirmed (`confirm_required` - Atour, 18:57, #68).
|
|
427
|
+
*/
|
|
428
|
+
export type GroupStep = 'terms' | 'confirm';
|
|
429
|
+
/** Which step a refusal of 8 - or its status - asks for, or none. */
|
|
430
|
+
export declare const stepAsked: (said: string | undefined) => GroupStep | undefined;
|
|
431
|
+
/** What a group sent with a step it asks for - see `groupStepOf`. */
|
|
432
|
+
export type StepAsked = {
|
|
433
|
+
text: string;
|
|
434
|
+
token: string;
|
|
435
|
+
/** What it would charge, and for which nights, where it says - checked before the guest sees it. */
|
|
436
|
+
amount?: Money;
|
|
437
|
+
checkIn?: string;
|
|
438
|
+
checkOut?: string;
|
|
439
|
+
/** It named an amount we cannot read: not the guest's to confirm. */
|
|
440
|
+
amountUnread?: true;
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* What to agree to or confirm, and the token to do it with, as 8 would send
|
|
444
|
+
* them back with `terms_required` / `confirm_required` - both, or nothing.
|
|
445
|
+
* ⚠️ THE NAMES ARE THE ONES ASKED FOR IN QUESTIONS #66 AND #68
|
|
446
|
+
* (`termsText` / `termsToken`, `confirmText` / `confirmToken`, or written with
|
|
447
|
+
* `_`), not yet in 8's document: until the backend answers, an answer naming
|
|
448
|
+
* them otherwise is a refusal, as it is today. An amount or nights beside them
|
|
449
|
+
* are read by 8's own names (`totalAmount`, `currency`, `checkIn`, `checkOut`).
|
|
450
|
+
*/
|
|
451
|
+
export declare const groupStepOf: (step: GroupStep, data: unknown) => StepAsked | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* The statuses a cancellation (9 `booking/cancel`; 14 `checkout/cancel` before 11-11) is
|
|
292
454
|
* taken as DONE by - exactly these, case aside (总线程's review of 0.63.0, 4):
|
|
293
455
|
* the document's own words ("CANCELLED"; 14's "CANCELLED", "SUCCESS") and
|
|
294
456
|
* their spelling variants. ⚠️ NOT A PATTERN: /CANCEL|CLOSED|SUCCESS/ took
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/otaless/booking.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,eAAe,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EACV,OAAO,EAEP,aAAa,EACb,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,EAEL,IAAI,EACJ,SAAS,EACT,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/otaless/booking.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,eAAe,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EACV,OAAO,EAEP,aAAa,EACb,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,EAEL,IAAI,EACJ,SAAS,EACT,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,IAAI,EAGT,KAAK,aAAa,EA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