@curless/hotel-storefront 0.53.0 → 0.55.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/about.d.ts +24 -0
- package/dist/about.d.ts.map +1 -0
- package/dist/about.js +28 -0
- package/dist/about.js.map +1 -0
- package/dist/aggregate/make.js +2 -2
- package/dist/aggregate/make.js.map +1 -1
- package/dist/backend.d.ts +15 -0
- package/dist/backend.d.ts.map +1 -1
- 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/config.d.ts +33 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/coupon-words.d.ts +12 -0
- package/dist/coupon-words.d.ts.map +1 -0
- package/dist/coupon-words.js +19 -0
- package/dist/coupon-words.js.map +1 -0
- package/dist/dates.js +1 -1
- package/dist/dates.js.map +1 -1
- package/dist/demo-hotels.d.ts +6 -0
- package/dist/demo-hotels.d.ts.map +1 -1
- package/dist/demo-hotels.js +57 -17
- package/dist/demo-hotels.js.map +1 -1
- package/dist/fence.d.ts.map +1 -1
- package/dist/fence.js +4 -3
- package/dist/fence.js.map +1 -1
- package/dist/huazhu/backend.d.ts +6 -0
- package/dist/huazhu/backend.d.ts.map +1 -1
- package/dist/huazhu/backend.js +25 -22
- package/dist/huazhu/backend.js.map +1 -1
- package/dist/huazhu/catalog.d.ts +6 -6
- package/dist/huazhu/catalog.d.ts.map +1 -1
- package/dist/huazhu/catalog.js +33 -15
- package/dist/huazhu/catalog.js.map +1 -1
- package/dist/huazhu/client.js +1 -1
- package/dist/huazhu/client.js.map +1 -1
- package/dist/huazhu/make.d.ts.map +1 -1
- package/dist/huazhu/make.js +1 -0
- package/dist/huazhu/make.js.map +1 -1
- package/dist/huazhu/sandbox.d.ts.map +1 -1
- package/dist/huazhu/sandbox.js +5 -3
- package/dist/huazhu/sandbox.js.map +1 -1
- package/dist/legal.d.ts.map +1 -1
- package/dist/legal.js +104 -80
- package/dist/legal.js.map +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/otaless/backend.d.ts +31 -0
- package/dist/otaless/backend.d.ts.map +1 -0
- package/dist/otaless/backend.js +502 -0
- package/dist/otaless/backend.js.map +1 -0
- package/dist/otaless/client.d.ts +103 -0
- package/dist/otaless/client.d.ts.map +1 -0
- package/dist/otaless/client.js +110 -0
- package/dist/otaless/client.js.map +1 -0
- package/dist/otaless/fake.d.ts +27 -0
- package/dist/otaless/fake.d.ts.map +1 -0
- package/dist/otaless/fake.js +239 -0
- package/dist/otaless/fake.js.map +1 -0
- package/dist/otaless/make.d.ts +4 -0
- package/dist/otaless/make.d.ts.map +1 -0
- package/dist/otaless/make.js +71 -0
- package/dist/otaless/make.js.map +1 -0
- package/dist/paid.d.ts.map +1 -1
- package/dist/paid.js +9 -9
- package/dist/paid.js.map +1 -1
- package/dist/present.d.ts +6 -1
- package/dist/present.d.ts.map +1 -1
- package/dist/present.js +20 -5
- package/dist/present.js.map +1 -1
- package/dist/reference.d.ts.map +1 -1
- package/dist/reference.js +10 -3
- package/dist/reference.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -6
- package/dist/server.js.map +1 -1
- package/dist/supplier.d.ts +6 -0
- package/dist/supplier.d.ts.map +1 -1
- package/dist/supplier.js +4 -0
- package/dist/supplier.js.map +1 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +100 -71
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +19 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +204 -102
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +58 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vocab.d.ts +0 -14
- package/dist/vocab.d.ts.map +1 -1
- package/dist/vocab.js +19 -22
- package/dist/vocab.js.map +1 -1
- package/package.json +1 -1
package/dist/huazhu/backend.js
CHANGED
|
@@ -1147,8 +1147,8 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1147
1147
|
if (fails.some((f) => f.kind === 'prepaid'))
|
|
1148
1148
|
return {
|
|
1149
1149
|
why: prepaidType
|
|
1150
|
-
? "This hotel's rooms by the hour are sold only on payment terms
|
|
1151
|
-
: "This hotel's rooms by the hour are paid in advance, and
|
|
1150
|
+
? "This hotel's rooms by the hour are sold only on payment terms that cannot be taken here."
|
|
1151
|
+
: "This hotel's rooms by the hour are paid in advance, and only rates paid at the hotel can be booked here.",
|
|
1152
1152
|
code: 'prepaid-only',
|
|
1153
1153
|
};
|
|
1154
1154
|
const said = (re) => fails
|
|
@@ -1175,7 +1175,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1175
1175
|
const noRoomsWhy = (priced, stay, rooms) => {
|
|
1176
1176
|
if (priced.length === 0)
|
|
1177
1177
|
return {
|
|
1178
|
-
why: 'This hotel has no rooms on sale
|
|
1178
|
+
why: 'This hotel has no rooms on sale here.',
|
|
1179
1179
|
code: 'none-on-sale',
|
|
1180
1180
|
};
|
|
1181
1181
|
const fails = priced.map((p) => p.res).filter((r) => !r.ok);
|
|
@@ -1200,8 +1200,8 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1200
1200
|
if (kinds.has('prepaid') && !kinds.has('party') && !kinds.has('too-many-rooms'))
|
|
1201
1201
|
return {
|
|
1202
1202
|
why: prepaidType
|
|
1203
|
-
? 'Every room still open here for those nights is sold only on payment terms
|
|
1204
|
-
: 'Every room still open here for those nights is paid in advance, and
|
|
1203
|
+
? 'Every room still open here for those nights is sold only on payment terms that cannot be taken here.'
|
|
1204
|
+
: 'Every room still open here for those nights is paid in advance, and only rates paid at the hotel can be booked here.',
|
|
1205
1205
|
code: 'prepaid-only',
|
|
1206
1206
|
};
|
|
1207
1207
|
if (only('sold-out'))
|
|
@@ -1251,7 +1251,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1251
1251
|
for (const [i, line] of trip.lines.entries()) {
|
|
1252
1252
|
const h = catalog.get(line.hotelId);
|
|
1253
1253
|
if (!h) {
|
|
1254
|
-
dropped.push({ title: line.hotelId, why: 'That hotel is not
|
|
1254
|
+
dropped.push({ title: line.hotelId, why: 'That hotel is not offered here any more.' });
|
|
1255
1255
|
continue;
|
|
1256
1256
|
}
|
|
1257
1257
|
const hotelName = toHotel(h, view, now()).name;
|
|
@@ -1641,8 +1641,8 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1641
1641
|
const refresh = async (found) => (await lookAt(found)).booking;
|
|
1642
1642
|
/** Why a booking cannot be cancelled yet: Huazhu has not said whether it exists. */
|
|
1643
1643
|
const waitingWords = (b) => b.status === 'unconfirmed'
|
|
1644
|
-
?
|
|
1645
|
-
:
|
|
1644
|
+
? 'Huazhu has not said whether this booking was made, and a person here is confirming it. It cannot be cancelled here until then - ask again later.'
|
|
1645
|
+
: 'Huazhu has not confirmed this booking yet - that takes up to eight minutes. It can be cancelled once it is confirmed.';
|
|
1646
1646
|
const feeNow = (b, at = now()) => {
|
|
1647
1647
|
const policy = policyOf(b.cancelCode);
|
|
1648
1648
|
const amounts = {
|
|
@@ -1838,7 +1838,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1838
1838
|
if (liveForEmail + lines.length > limits.perEmailLive) {
|
|
1839
1839
|
// ⚠️ "THIS EMAIL", NEVER THE ADDRESS (2026-10-29 audit, H5): these words
|
|
1840
1840
|
// go back to the model, and what the guest typed on the card does not.
|
|
1841
|
-
throw new Error(`Nothing was booked. This email already has ${plural(liveForEmail, 'booking')} still to come
|
|
1841
|
+
throw new Error(`Nothing was booked. This email already has ${plural(liveForEmail, 'booking')} here still to come, and ${limits.perEmailLive} at once is the most - cancel one that is not needed, then ask again.`);
|
|
1842
1842
|
}
|
|
1843
1843
|
if (requestsByEmail.count(email) >= limits.perEmailPerDay) {
|
|
1844
1844
|
throw new Error(`Nothing was booked. This email has asked for ${plural(limits.perEmailPerDay, 'booking')} in the last 24 hours, which is the most here - try again later.`);
|
|
@@ -1874,7 +1874,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
1874
1874
|
console.error(`[huazhu bookings] ⚠️ NEEDS A PERSON: ${madeToday} bookings in the last 24 hours reached the ceiling of ${limits.perDeploymentPerDay}; new bookings are refused until the count falls`);
|
|
1875
1875
|
}
|
|
1876
1876
|
store.ceilingHitAt = now();
|
|
1877
|
-
throw new Error(`Nothing was booked:
|
|
1877
|
+
throw new Error(`Nothing was booked: booking here is paused for now - the limit on bookings made in a day has been reached. Try again later, or book with ${opts.brand} directly.`);
|
|
1878
1878
|
}
|
|
1879
1879
|
// The network counted once it has passed every limit - a request turned
|
|
1880
1880
|
// away is not one more against the guest, or a guest at a limit could
|
|
@@ -2335,7 +2335,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
2335
2335
|
for (let i = 0; busy.has(id) && i < 400; i += 1)
|
|
2336
2336
|
await new Promise((r) => setTimeout(r, 25));
|
|
2337
2337
|
if (closing)
|
|
2338
|
-
throw new Error('
|
|
2338
|
+
throw new Error('Booking here is briefly unavailable. Nothing changed - ask again in a moment.');
|
|
2339
2339
|
if (busy.has(id))
|
|
2340
2340
|
throw new Error('A payment on this booking is being settled right now. Ask again in a moment.');
|
|
2341
2341
|
return (await ifFree(id, fn));
|
|
@@ -2793,7 +2793,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
2793
2793
|
console.error(`[huazhu bookings] ⚠️ NEEDS A PERSON: ${unpaid} requests to pay in advance left unpaid (waiting for payment or lapsed) in the last 24 hours reached the unpaid ceiling of ${unpaidPerDay}; new requests to pay in advance are refused until the count falls`);
|
|
2794
2794
|
}
|
|
2795
2795
|
store.ceilingHitAt = now();
|
|
2796
|
-
throw new Error(`Nothing was booked:
|
|
2796
|
+
throw new Error(`Nothing was booked: booking a stay paid in advance here is paused for now - the limit on payment requests left unpaid in a day has been reached. Try again later, pay at the hotel where the rate allows it, or book with ${opts.brand} directly.`);
|
|
2797
2797
|
}
|
|
2798
2798
|
}
|
|
2799
2799
|
// Prebook is Huazhu's own check of price, rooms and rules - for each stay
|
|
@@ -4092,7 +4092,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
4092
4092
|
quote,
|
|
4093
4093
|
async requestBooking(trip, guest, who, requests) {
|
|
4094
4094
|
if (closing) {
|
|
4095
|
-
throw new Error('Nothing was booked:
|
|
4095
|
+
throw new Error('Nothing was booked: booking here is briefly unavailable. Ask again in a minute - the trip is kept.');
|
|
4096
4096
|
}
|
|
4097
4097
|
if (!guest.name.trim() || !guest.email.includes('@')) {
|
|
4098
4098
|
// Nothing is emailed from here (2026-10-05 audit): the email is how the
|
|
@@ -4241,16 +4241,19 @@ export const createHuazhuHotels = (opts) => {
|
|
|
4241
4241
|
// said for Huazhu's test system only, so in the sandbox the "nothing
|
|
4242
4242
|
// comes back" and "cannot be cancelled" previews said nothing of being a
|
|
4243
4243
|
// test - while the "all of it back" one did.
|
|
4244
|
+
// ⚠️ THE FACT, NO ENVIRONMENT'S NAME (robin, 2026-11-03: 「不用特意写不是真的」): the
|
|
4245
|
+
// simulated Huazhu's booking was not sent to Huazhu; one in Huazhu's test system
|
|
4246
|
+
// holds no room for anyone - and nothing is charged in either.
|
|
4244
4247
|
const testNote = opts.sandbox
|
|
4245
|
-
? ' This
|
|
4248
|
+
? ' This booking was not sent to Huazhu: nothing is charged to anyone.'
|
|
4246
4249
|
: opts.testEnvironment
|
|
4247
|
-
?
|
|
4250
|
+
? ' This booking holds no room for anyone: nothing is charged to anyone.'
|
|
4248
4251
|
: '';
|
|
4249
|
-
// A booking paid here in advance, in either: the money is
|
|
4252
|
+
// A booking paid here in advance, in either: the money is not real either.
|
|
4250
4253
|
const paidTestNote = opts.sandbox
|
|
4251
|
-
? ' This
|
|
4254
|
+
? ' This booking was not sent to Huazhu, and no real money moves.'
|
|
4252
4255
|
: opts.testEnvironment
|
|
4253
|
-
? ' This
|
|
4256
|
+
? ' This booking holds no room for anyone, and no real money moves.'
|
|
4254
4257
|
: '';
|
|
4255
4258
|
// Paid with UnionPay: Huazhu charged the one-time card, and gives back
|
|
4256
4259
|
// to it what its terms allow - nothing passes through here (audit P0-C:
|
|
@@ -4300,10 +4303,10 @@ export const createHuazhuHotels = (opts) => {
|
|
|
4300
4303
|
rule: forbidden
|
|
4301
4304
|
? `This rate cannot be cancelled now. ${rule}`
|
|
4302
4305
|
: opts.sandbox
|
|
4303
|
-
? `${rule} This
|
|
4306
|
+
? `${rule} This booking was not sent to Huazhu: the fee is worked out as a real booking's would be, and nothing is charged to anyone.`
|
|
4304
4307
|
: opts.testEnvironment
|
|
4305
|
-
? `${rule} This
|
|
4306
|
-
: `${rule} Nothing was paid
|
|
4308
|
+
? `${rule} This booking holds no room for anyone: the fee is worked out as a real booking's would be, and nothing is charged to anyone.`
|
|
4309
|
+
: `${rule} Nothing was paid here - the booking is paid at the hotel - so any fee is charged under the hotel's terms, and Huazhu works out the exact amount when it cancels.`,
|
|
4307
4310
|
...(freeUntil ? { freeUntil: new Date(freeUntil).toISOString() } : {}),
|
|
4308
4311
|
cancellable: !forbidden,
|
|
4309
4312
|
...facts,
|
|
@@ -4438,7 +4441,7 @@ export const createHuazhuHotels = (opts) => {
|
|
|
4438
4441
|
: 'Huazhu says this booking cannot be cancelled.');
|
|
4439
4442
|
}
|
|
4440
4443
|
else if (err instanceof HuazhuTooBusy) {
|
|
4441
|
-
throw new Error('Huazhu was not asked:
|
|
4444
|
+
throw new Error('Huazhu was not asked: too many calls were going to Huazhu just now, so nothing was cancelled. Ask again in a moment.');
|
|
4442
4445
|
}
|
|
4443
4446
|
else if (err instanceof HuazhuUnreachable) {
|
|
4444
4447
|
throw new Error('Huazhu did not answer, so it is not known whether the booking was cancelled. Asking again is safe - cancelling twice does not charge twice.');
|