@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.
Files changed (99) hide show
  1. package/dist/about.d.ts +24 -0
  2. package/dist/about.d.ts.map +1 -0
  3. package/dist/about.js +28 -0
  4. package/dist/about.js.map +1 -0
  5. package/dist/aggregate/make.js +2 -2
  6. package/dist/aggregate/make.js.map +1 -1
  7. package/dist/backend.d.ts +15 -0
  8. package/dist/backend.d.ts.map +1 -1
  9. package/dist/backend.js.map +1 -1
  10. package/dist/card.generated.d.ts +1 -1
  11. package/dist/card.generated.js +2 -2
  12. package/dist/card.generated.js.map +1 -1
  13. package/dist/config.d.ts +33 -2
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js.map +1 -1
  16. package/dist/coupon-words.d.ts +12 -0
  17. package/dist/coupon-words.d.ts.map +1 -0
  18. package/dist/coupon-words.js +19 -0
  19. package/dist/coupon-words.js.map +1 -0
  20. package/dist/dates.js +1 -1
  21. package/dist/dates.js.map +1 -1
  22. package/dist/demo-hotels.d.ts +6 -0
  23. package/dist/demo-hotels.d.ts.map +1 -1
  24. package/dist/demo-hotels.js +57 -17
  25. package/dist/demo-hotels.js.map +1 -1
  26. package/dist/fence.d.ts.map +1 -1
  27. package/dist/fence.js +4 -3
  28. package/dist/fence.js.map +1 -1
  29. package/dist/huazhu/backend.d.ts +6 -0
  30. package/dist/huazhu/backend.d.ts.map +1 -1
  31. package/dist/huazhu/backend.js +25 -22
  32. package/dist/huazhu/backend.js.map +1 -1
  33. package/dist/huazhu/catalog.d.ts +6 -6
  34. package/dist/huazhu/catalog.d.ts.map +1 -1
  35. package/dist/huazhu/catalog.js +33 -15
  36. package/dist/huazhu/catalog.js.map +1 -1
  37. package/dist/huazhu/client.js +1 -1
  38. package/dist/huazhu/client.js.map +1 -1
  39. package/dist/huazhu/make.d.ts.map +1 -1
  40. package/dist/huazhu/make.js +1 -0
  41. package/dist/huazhu/make.js.map +1 -1
  42. package/dist/huazhu/sandbox.d.ts.map +1 -1
  43. package/dist/huazhu/sandbox.js +5 -3
  44. package/dist/huazhu/sandbox.js.map +1 -1
  45. package/dist/legal.d.ts.map +1 -1
  46. package/dist/legal.js +104 -80
  47. package/dist/legal.js.map +1 -1
  48. package/dist/lib.d.ts +1 -1
  49. package/dist/lib.d.ts.map +1 -1
  50. package/dist/lib.js +1 -1
  51. package/dist/lib.js.map +1 -1
  52. package/dist/otaless/backend.d.ts +31 -0
  53. package/dist/otaless/backend.d.ts.map +1 -0
  54. package/dist/otaless/backend.js +502 -0
  55. package/dist/otaless/backend.js.map +1 -0
  56. package/dist/otaless/client.d.ts +103 -0
  57. package/dist/otaless/client.d.ts.map +1 -0
  58. package/dist/otaless/client.js +110 -0
  59. package/dist/otaless/client.js.map +1 -0
  60. package/dist/otaless/fake.d.ts +27 -0
  61. package/dist/otaless/fake.d.ts.map +1 -0
  62. package/dist/otaless/fake.js +239 -0
  63. package/dist/otaless/fake.js.map +1 -0
  64. package/dist/otaless/make.d.ts +4 -0
  65. package/dist/otaless/make.d.ts.map +1 -0
  66. package/dist/otaless/make.js +71 -0
  67. package/dist/otaless/make.js.map +1 -0
  68. package/dist/paid.d.ts.map +1 -1
  69. package/dist/paid.js +9 -9
  70. package/dist/paid.js.map +1 -1
  71. package/dist/present.d.ts +6 -1
  72. package/dist/present.d.ts.map +1 -1
  73. package/dist/present.js +20 -5
  74. package/dist/present.js.map +1 -1
  75. package/dist/reference.d.ts.map +1 -1
  76. package/dist/reference.js +10 -3
  77. package/dist/reference.js.map +1 -1
  78. package/dist/server.d.ts +2 -2
  79. package/dist/server.d.ts.map +1 -1
  80. package/dist/server.js +8 -6
  81. package/dist/server.js.map +1 -1
  82. package/dist/supplier.d.ts +6 -0
  83. package/dist/supplier.d.ts.map +1 -1
  84. package/dist/supplier.js +4 -0
  85. package/dist/supplier.js.map +1 -1
  86. package/dist/surface.d.ts.map +1 -1
  87. package/dist/surface.js +100 -71
  88. package/dist/surface.js.map +1 -1
  89. package/dist/tools.d.ts +19 -0
  90. package/dist/tools.d.ts.map +1 -1
  91. package/dist/tools.js +204 -102
  92. package/dist/tools.js.map +1 -1
  93. package/dist/types.d.ts +58 -0
  94. package/dist/types.d.ts.map +1 -1
  95. package/dist/vocab.d.ts +0 -14
  96. package/dist/vocab.d.ts.map +1 -1
  97. package/dist/vocab.js +19 -22
  98. package/dist/vocab.js.map +1 -1
  99. package/package.json +1 -1
@@ -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 this connector cannot take."
1151
- : "This hotel's rooms by the hour are paid in advance, and this connector books rates paid at the hotel.",
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 through this connector.',
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 this connector cannot take.'
1204
- : 'Every room still open here for those nights is paid in advance, and this connector books rates paid at the hotel.',
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 in this connector any more.' });
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
- ? `${opts.sandbox ? 'The simulated Huazhu' : '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
- : `${opts.sandbox ? 'The simulated Huazhu' : 'Huazhu'} has not confirmed this booking yet - that takes up to eight minutes. It can be cancelled once it is confirmed.`;
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 through this connector, and ${limits.perEmailLive} at once is the most - cancel one that is not needed, then ask again.`);
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: bookings through this connector are paused for now - the limit on bookings made in a day has been reached. Try again later, or book with ${opts.brand} directly.`);
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('This connector is restarting. Nothing changed - ask again in a moment.');
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: bookings paid in advance through this connector are 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.`);
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: this connector is restarting. Ask again in a minute - the trip is kept.');
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 is a test booking in the simulated Huazhu: nothing is charged to anyone.'
4248
+ ? ' This booking was not sent to Huazhu: nothing is charged to anyone.'
4246
4249
  : opts.testEnvironment
4247
- ? " This is a test booking in Huazhu's test system: nothing is charged to anyone."
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 a test too.
4252
+ // A booking paid here in advance, in either: the money is not real either.
4250
4253
  const paidTestNote = opts.sandbox
4251
- ? ' This is a test booking in the simulated Huazhu, paid in Stripe’s test mode: no real money moves.'
4254
+ ? ' This booking was not sent to Huazhu, and no real money moves.'
4252
4255
  : opts.testEnvironment
4253
- ? ' This is a test booking in Huazhu’s test system, paid in test mode: no real money moves.'
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 is a test booking in the simulated Huazhu: the fee is worked out as a real booking's would be, and nothing is charged to anyone.`
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 is a test booking in Huazhu's test system: the fee is worked out as a real booking's would be, and nothing is charged to anyone.`
4306
- : `${rule} Nothing was paid through this connector - 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.`,
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: this connector is calling Huazhu at its own limit just now, so nothing was cancelled. Ask again in a moment.');
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.');