@curless/hotel-storefront 0.85.0 → 0.87.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/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/tools/accept-terms.d.ts +4 -0
- package/dist/tools/accept-terms.d.ts.map +1 -0
- package/dist/tools/accept-terms.js +26 -0
- package/dist/tools/accept-terms.js.map +1 -0
- package/dist/tools/add-booking-addon.d.ts +4 -0
- package/dist/tools/add-booking-addon.d.ts.map +1 -0
- package/dist/tools/add-booking-addon.js +44 -0
- package/dist/tools/add-booking-addon.js.map +1 -0
- package/dist/tools/add-to-trip.d.ts +4 -0
- package/dist/tools/add-to-trip.d.ts.map +1 -0
- package/dist/tools/add-to-trip.js +49 -0
- package/dist/tools/add-to-trip.js.map +1 -0
- package/dist/tools/all-tools.d.ts +19124 -0
- package/dist/tools/all-tools.d.ts.map +1 -0
- package/dist/tools/all-tools.js +43 -0
- package/dist/tools/all-tools.js.map +1 -0
- package/dist/tools/answer.d.ts +3 -0
- package/dist/tools/answer.d.ts.map +1 -0
- package/dist/tools/answer.js +104 -0
- package/dist/tools/answer.js.map +1 -0
- package/dist/tools/args.d.ts +149 -0
- package/dist/tools/args.d.ts.map +1 -0
- package/dist/tools/args.js +176 -0
- package/dist/tools/args.js.map +1 -0
- package/dist/tools/base-output-schemas.d.ts +3 -0
- package/dist/tools/base-output-schemas.d.ts.map +1 -0
- package/dist/tools/base-output-schemas.js +396 -0
- package/dist/tools/base-output-schemas.js.map +1 -0
- package/dist/tools/book-picked.d.ts +4 -0
- package/dist/tools/book-picked.d.ts.map +1 -0
- package/dist/tools/book-picked.js +14 -0
- package/dist/tools/book-picked.js.map +1 -0
- package/dist/tools/booking-answer.d.ts +24 -0
- package/dist/tools/booking-answer.d.ts.map +1 -0
- package/dist/tools/booking-answer.js +567 -0
- package/dist/tools/booking-answer.js.map +1 -0
- package/dist/tools/buy-shop-item.d.ts +4 -0
- package/dist/tools/buy-shop-item.d.ts.map +1 -0
- package/dist/tools/buy-shop-item.js +45 -0
- package/dist/tools/buy-shop-item.js.map +1 -0
- package/dist/tools/call.d.ts +11 -0
- package/dist/tools/call.d.ts.map +1 -0
- package/dist/tools/call.js +2 -0
- package/dist/tools/call.js.map +1 -0
- package/dist/tools/cancel-facts.d.ts +281 -0
- package/dist/tools/cancel-facts.d.ts.map +1 -0
- package/dist/tools/cancel-facts.js +309 -0
- package/dist/tools/cancel-facts.js.map +1 -0
- package/dist/tools/cancel.d.ts +4 -0
- package/dist/tools/cancel.d.ts.map +1 -0
- package/dist/tools/cancel.js +415 -0
- package/dist/tools/cancel.js.map +1 -0
- package/dist/tools/capability-adjust.d.ts +31 -0
- package/dist/tools/capability-adjust.d.ts.map +1 -0
- package/dist/tools/capability-adjust.js +299 -0
- package/dist/tools/capability-adjust.js.map +1 -0
- package/dist/tools/card-addons.d.ts +4 -0
- package/dist/tools/card-addons.d.ts.map +1 -0
- package/dist/tools/card-addons.js +76 -0
- package/dist/tools/card-addons.js.map +1 -0
- package/dist/tools/change-booking.d.ts +4 -0
- package/dist/tools/change-booking.d.ts.map +1 -0
- package/dist/tools/change-booking.js +145 -0
- package/dist/tools/change-booking.js.map +1 -0
- package/dist/tools/clear-trip.d.ts +4 -0
- package/dist/tools/clear-trip.d.ts.map +1 -0
- package/dist/tools/clear-trip.js +10 -0
- package/dist/tools/clear-trip.js.map +1 -0
- package/dist/tools/compare.d.ts +4 -0
- package/dist/tools/compare.d.ts.map +1 -0
- package/dist/tools/compare.js +114 -0
- package/dist/tools/compare.js.map +1 -0
- package/dist/tools/current-trip.d.ts +70 -0
- package/dist/tools/current-trip.d.ts.map +1 -0
- package/dist/tools/current-trip.js +269 -0
- package/dist/tools/current-trip.js.map +1 -0
- package/dist/tools/deps.d.ts +229 -0
- package/dist/tools/deps.d.ts.map +1 -0
- package/dist/tools/deps.js +2 -0
- package/dist/tools/deps.js.map +1 -0
- package/dist/tools/follow-ups.d.ts +120 -0
- package/dist/tools/follow-ups.d.ts.map +1 -0
- package/dist/tools/follow-ups.js +369 -0
- package/dist/tools/follow-ups.js.map +1 -0
- package/dist/tools/forget-preferences.d.ts +4 -0
- package/dist/tools/forget-preferences.d.ts.map +1 -0
- package/dist/tools/forget-preferences.js +24 -0
- package/dist/tools/forget-preferences.js.map +1 -0
- package/dist/tools/get-hotel.d.ts +4 -0
- package/dist/tools/get-hotel.d.ts.map +1 -0
- package/dist/tools/get-hotel.js +350 -0
- package/dist/tools/get-hotel.js.map +1 -0
- package/dist/tools/hotel-choices.d.ts +132 -0
- package/dist/tools/hotel-choices.d.ts.map +1 -0
- package/dist/tools/hotel-choices.js +587 -0
- package/dist/tools/hotel-choices.js.map +1 -0
- package/dist/tools/itinerary.d.ts +4 -0
- package/dist/tools/itinerary.d.ts.map +1 -0
- package/dist/tools/itinerary.js +158 -0
- package/dist/tools/itinerary.js.map +1 -0
- package/dist/tools/list-booking-addons.d.ts +4 -0
- package/dist/tools/list-booking-addons.d.ts.map +1 -0
- package/dist/tools/list-booking-addons.js +21 -0
- package/dist/tools/list-booking-addons.js.map +1 -0
- package/dist/tools/list-bookings.d.ts +4 -0
- package/dist/tools/list-bookings.d.ts.map +1 -0
- package/dist/tools/list-bookings.js +119 -0
- package/dist/tools/list-bookings.js.map +1 -0
- package/dist/tools/list-extras.d.ts +4 -0
- package/dist/tools/list-extras.d.ts.map +1 -0
- package/dist/tools/list-extras.js +90 -0
- package/dist/tools/list-extras.js.map +1 -0
- package/dist/tools/list-hotels-ask.d.ts +133 -0
- package/dist/tools/list-hotels-ask.d.ts.map +1 -0
- package/dist/tools/list-hotels-ask.js +326 -0
- package/dist/tools/list-hotels-ask.js.map +1 -0
- package/dist/tools/list-hotels-empty.d.ts +5 -0
- package/dist/tools/list-hotels-empty.d.ts.map +1 -0
- package/dist/tools/list-hotels-empty.js +130 -0
- package/dist/tools/list-hotels-empty.js.map +1 -0
- package/dist/tools/list-hotels-home.d.ts +9 -0
- package/dist/tools/list-hotels-home.d.ts.map +1 -0
- package/dist/tools/list-hotels-home.js +181 -0
- package/dist/tools/list-hotels-home.js.map +1 -0
- package/dist/tools/list-hotels-page.d.ts +43 -0
- package/dist/tools/list-hotels-page.d.ts.map +1 -0
- package/dist/tools/list-hotels-page.js +344 -0
- package/dist/tools/list-hotels-page.js.map +1 -0
- package/dist/tools/list-hotels.d.ts +4 -0
- package/dist/tools/list-hotels.d.ts.map +1 -0
- package/dist/tools/list-hotels.js +24 -0
- package/dist/tools/list-hotels.js.map +1 -0
- package/dist/tools/list-shop-items.d.ts +4 -0
- package/dist/tools/list-shop-items.d.ts.map +1 -0
- package/dist/tools/list-shop-items.js +34 -0
- package/dist/tools/list-shop-items.js.map +1 -0
- package/dist/tools/list-shop-orders.d.ts +4 -0
- package/dist/tools/list-shop-orders.d.ts.map +1 -0
- package/dist/tools/list-shop-orders.js +22 -0
- package/dist/tools/list-shop-orders.js.map +1 -0
- package/dist/tools/look-up.d.ts +4 -0
- package/dist/tools/look-up.d.ts.map +1 -0
- package/dist/tools/look-up.js +207 -0
- package/dist/tools/look-up.js.map +1 -0
- package/dist/tools/output-schemas.d.ts +645 -0
- package/dist/tools/output-schemas.d.ts.map +1 -0
- package/dist/tools/output-schemas.js +503 -0
- package/dist/tools/output-schemas.js.map +1 -0
- package/dist/tools/paid-lines.d.ts +718 -0
- package/dist/tools/paid-lines.d.ts.map +1 -0
- package/dist/tools/paid-lines.js +359 -0
- package/dist/tools/paid-lines.js.map +1 -0
- package/dist/tools/pay-with-union-pay.d.ts +4 -0
- package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
- package/dist/tools/pay-with-union-pay.js +112 -0
- package/dist/tools/pay-with-union-pay.js.map +1 -0
- package/dist/tools/payment-words.d.ts +269 -0
- package/dist/tools/payment-words.d.ts.map +1 -0
- package/dist/tools/payment-words.js +365 -0
- package/dist/tools/payment-words.js.map +1 -0
- package/dist/tools/pick-room.d.ts +4 -0
- package/dist/tools/pick-room.d.ts.map +1 -0
- package/dist/tools/pick-room.js +23 -0
- package/dist/tools/pick-room.js.map +1 -0
- package/dist/tools/policies.d.ts +4 -0
- package/dist/tools/policies.d.ts.map +1 -0
- package/dist/tools/policies.js +74 -0
- package/dist/tools/policies.js.map +1 -0
- package/dist/tools/pricing.d.ts +55 -0
- package/dist/tools/pricing.d.ts.map +1 -0
- package/dist/tools/pricing.js +260 -0
- package/dist/tools/pricing.js.map +1 -0
- package/dist/tools/put-room-line.d.ts +12 -0
- package/dist/tools/put-room-line.d.ts.map +1 -0
- package/dist/tools/put-room-line.js +347 -0
- package/dist/tools/put-room-line.js.map +1 -0
- package/dist/tools/quote-card.d.ts +234 -0
- package/dist/tools/quote-card.d.ts.map +1 -0
- package/dist/tools/quote-card.js +375 -0
- package/dist/tools/quote-card.js.map +1 -0
- package/dist/tools/refund-booking.d.ts +4 -0
- package/dist/tools/refund-booking.d.ts.map +1 -0
- package/dist/tools/refund-booking.js +112 -0
- package/dist/tools/refund-booking.js.map +1 -0
- package/dist/tools/request-booking.d.ts +4 -0
- package/dist/tools/request-booking.d.ts.map +1 -0
- package/dist/tools/request-booking.js +5 -0
- package/dist/tools/request-booking.js.map +1 -0
- package/dist/tools/request-words.d.ts +238 -0
- package/dist/tools/request-words.d.ts.map +1 -0
- package/dist/tools/request-words.js +487 -0
- package/dist/tools/request-words.js.map +1 -0
- package/dist/tools/room-choices.d.ts +64 -0
- package/dist/tools/room-choices.d.ts.map +1 -0
- package/dist/tools/room-choices.js +374 -0
- package/dist/tools/room-choices.js.map +1 -0
- package/dist/tools/session-notes.d.ts +164 -0
- package/dist/tools/session-notes.d.ts.map +1 -0
- package/dist/tools/session-notes.js +412 -0
- package/dist/tools/session-notes.js.map +1 -0
- package/dist/tools/sign-in.d.ts +4 -0
- package/dist/tools/sign-in.d.ts.map +1 -0
- package/dist/tools/sign-in.js +72 -0
- package/dist/tools/sign-in.js.map +1 -0
- package/dist/tools/sign-out.d.ts +4 -0
- package/dist/tools/sign-out.d.ts.map +1 -0
- package/dist/tools/sign-out.js +13 -0
- package/dist/tools/sign-out.js.map +1 -0
- package/dist/tools/terms-answer.d.ts +114 -0
- package/dist/tools/terms-answer.d.ts.map +1 -0
- package/dist/tools/terms-answer.js +492 -0
- package/dist/tools/terms-answer.js.map +1 -0
- package/dist/tools/tool-defs-account.d.ts +80 -0
- package/dist/tools/tool-defs-account.d.ts.map +1 -0
- package/dist/tools/tool-defs-account.js +65 -0
- package/dist/tools/tool-defs-account.js.map +1 -0
- package/dist/tools/tool-defs-addons.d.ts +251 -0
- package/dist/tools/tool-defs-addons.d.ts.map +1 -0
- package/dist/tools/tool-defs-addons.js +198 -0
- package/dist/tools/tool-defs-addons.js.map +1 -0
- package/dist/tools/tool-defs-booking.d.ts +410 -0
- package/dist/tools/tool-defs-booking.d.ts.map +1 -0
- package/dist/tools/tool-defs-booking.js +285 -0
- package/dist/tools/tool-defs-booking.js.map +1 -0
- package/dist/tools/tool-defs-browse.d.ts +444 -0
- package/dist/tools/tool-defs-browse.d.ts.map +1 -0
- package/dist/tools/tool-defs-browse.js +307 -0
- package/dist/tools/tool-defs-browse.js.map +1 -0
- package/dist/tools/tool-defs-trip.d.ts +136 -0
- package/dist/tools/tool-defs-trip.d.ts.map +1 -0
- package/dist/tools/tool-defs-trip.js +79 -0
- package/dist/tools/tool-defs-trip.js.map +1 -0
- package/dist/tools/tool-env.d.ts +64 -0
- package/dist/tools/tool-env.d.ts.map +1 -0
- package/dist/tools/tool-env.js +49 -0
- package/dist/tools/tool-env.js.map +1 -0
- package/dist/tools/tool-set.d.ts +1425 -0
- package/dist/tools/tool-set.d.ts.map +1 -0
- package/dist/tools/tool-set.js +244 -0
- package/dist/tools/tool-set.js.map +1 -0
- package/dist/tools/view-trip.d.ts +4 -0
- package/dist/tools/view-trip.d.ts.map +1 -0
- package/dist/tools/view-trip.js +7 -0
- package/dist/tools/view-trip.js.map +1 -0
- package/dist/tools.d.ts +13 -2089
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +11 -10685
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { GUEST_ALONE, OPENS_SIGNED_IN } from '../account/page-words.js';
|
|
2
|
+
import { nights as nightsBetween } from '../dates.js';
|
|
3
|
+
import { formatMoney } from '../money.js';
|
|
4
|
+
import { roomNamesOf } from '../names.js';
|
|
5
|
+
import { addOnsCancelPreview, addOnsCancelResult, finishAnswer, previewAnswer, shopSignInAnswer, } from '../otaless/shop-answers.js';
|
|
6
|
+
import { BOOKING_ENDED, looksLikeShopOrder } from '../otaless/shop-service.js';
|
|
7
|
+
import { str } from './args.js';
|
|
8
|
+
import { bookingForCard, cancelFactsOf, cancelShapeOf, holderOf, paidFactsOf, } from './cancel-facts.js';
|
|
9
|
+
import { common, demoBookingNote, paidLine, paymentUnknownWords } from './paid-lines.js';
|
|
10
|
+
import { clockWords, hostOf, notPaidWords } from './payment-words.js';
|
|
11
|
+
import { refreshMember } from './pricing.js';
|
|
12
|
+
import { couponBackWords } from './quote-card.js';
|
|
13
|
+
import { TOO_MANY_TRIES, guarded, identity, previewsOf, remember } from './session-notes.js';
|
|
14
|
+
import { inBrowserWords, noBookingLike } from './terms-answer.js';
|
|
15
|
+
export const answerCancel = async (call) => {
|
|
16
|
+
const { deps, args, ctx, key } = call;
|
|
17
|
+
const ref = str(args.booking);
|
|
18
|
+
const who = identity(deps, ctx, key, args);
|
|
19
|
+
const shopOrder = await shopOrderAnswer(call, who, ref);
|
|
20
|
+
if (shopOrder)
|
|
21
|
+
return shopOrder;
|
|
22
|
+
const shopApi = deps.backend.otalessShop;
|
|
23
|
+
const shopLang = deps.lang === 'zh' ? 'zh' : 'en';
|
|
24
|
+
const { found: preview, tooMany } = await guarded(deps, ctx, who, ref, () => deps.backend.previewCancellation(ref, who));
|
|
25
|
+
if (!preview) {
|
|
26
|
+
return {
|
|
27
|
+
structured: {
|
|
28
|
+
view: 'booking-not-found',
|
|
29
|
+
...common(deps, key),
|
|
30
|
+
query: ref,
|
|
31
|
+
...(tooMany ? { tooMany: true } : {}),
|
|
32
|
+
},
|
|
33
|
+
text: tooMany ? TOO_MANY_TRIES : noBookingLike(deps),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const facts = await previewFactsOf(call, who, ref, preview);
|
|
37
|
+
const addOnsOf = { confirmationCode: preview.confirmationCode, id: preview.bookingId };
|
|
38
|
+
const cx = { ...call, who, ref, shopApi, shopLang, preview, addOnsOf, ...facts };
|
|
39
|
+
const asPreview = { structured: previewStructured(cx), text: previewText(cx) };
|
|
40
|
+
// ⚠️ THE PREVIEW IS NOT ADVISORY. Cancelling without one is how a guest
|
|
41
|
+
// loses a night's rate they were never told about, so the cancel tool
|
|
42
|
+
// returns this same preview and does nothing until it is told again - and
|
|
43
|
+
// told again about the fee that was SHOWN (`shownPreviews`).
|
|
44
|
+
const shownKey = `${key}|cancel|${preview.bookingId}`;
|
|
45
|
+
const wasShown = previewsOf(deps).get(shownKey);
|
|
46
|
+
remember(deps, shownKey, preview.fee.minor);
|
|
47
|
+
const notYet = await confirmGate(cx, asPreview, wasShown);
|
|
48
|
+
if (notYet)
|
|
49
|
+
return notYet;
|
|
50
|
+
const cancelled = await deps.backend.cancelBooking(ref, who, str(args.reason) || undefined);
|
|
51
|
+
if (!cancelled)
|
|
52
|
+
return asPreview;
|
|
53
|
+
const addOnsDone = await cancelAddOns(cx, cancelled);
|
|
54
|
+
// A coupon handed back is back on the member's badge.
|
|
55
|
+
await refreshMember(deps, key);
|
|
56
|
+
// ⚠️ WHAT THE HOTEL SAYS IT CHARGED, once it has said. A group's own system
|
|
57
|
+
// answers a cancellation with its penalty; the preview was our reading of
|
|
58
|
+
// the rate's terms, and where the two differ the hotel's is the one that
|
|
59
|
+
// will be charged.
|
|
60
|
+
// ⚠️ AND WHERE THE FEE WAS NOT KNOWN, only what the group says it charged.
|
|
61
|
+
const charged = cancelled.cancellationFee ?? preview.fee;
|
|
62
|
+
const feeUnsaid = !!preview.feeUnknown && !cancelled.cancellationFee;
|
|
63
|
+
const h = holderOf(deps, cancelled.supplier);
|
|
64
|
+
const couponNow = couponAfterCancel(cancelled, charged, h);
|
|
65
|
+
return cancelledAnswer(cx, { cancelled, charged, feeUnsaid, h, couponNow, addOnsDone });
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A shop order, not a hotel booking: answered here when the id is one of this account's shop
|
|
69
|
+
* orders, and nothing otherwise (the caller goes on to the hotel booking).
|
|
70
|
+
*/
|
|
71
|
+
const shopOrderAnswer = async ({ deps, name, args, t, key }, who, ref) => {
|
|
72
|
+
// ⚠️ A SHOP ORDER, NOT A HOTEL BOOKING: a UUID-shaped id that THIS account's shop orders hold
|
|
73
|
+
// (`looksLikeShopOrder` - no hotel order id has that shape - and then `mine`). The same two steps:
|
|
74
|
+
// what it would do, then the cancel or the refund that was shown - see shop-service.ts.
|
|
75
|
+
const shopApi = deps.backend.otalessShop;
|
|
76
|
+
const shopLang = deps.lang === 'zh' ? 'zh' : 'en';
|
|
77
|
+
const shopMine = shopApi && looksLikeShopOrder(ref) ? await shopApi.mine(who, ref, shopLang) : false;
|
|
78
|
+
if (shopMine === 'shop-sign-in')
|
|
79
|
+
return shopSignInAnswer(common(deps, key), deps.shopLink);
|
|
80
|
+
if (shopApi && shopMine) {
|
|
81
|
+
const base = common(deps, key);
|
|
82
|
+
if (name === t.previewCancellation || args.confirmed !== true)
|
|
83
|
+
return previewAnswer(base, await shopApi.preview(who, ref.trim(), shopLang), t.cancelBooking, (iso) => clockWords(iso) ?? iso, deps.shopLink);
|
|
84
|
+
return finishAnswer(base, await shopApi.finish(who, ref.trim(), shopLang), t.previewCancellation, t.listBookings, deps.shopLink);
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
};
|
|
88
|
+
/** The booking and the facts of its terms, for the card and the words to say. */
|
|
89
|
+
const previewFactsOf = async ({ deps, t }, who, ref, preview) => {
|
|
90
|
+
// What is being cancelled, and on what terms, for the card to say in the
|
|
91
|
+
// guest's language (r7 jury: the code alone, and the terms in English).
|
|
92
|
+
const booked = await deps.backend.findBooking(ref, who).catch(() => null);
|
|
93
|
+
const rooms = (booked?.quote.lines ?? []).filter((l) => l.kind === 'room');
|
|
94
|
+
const which = booked
|
|
95
|
+
? {
|
|
96
|
+
hotelName: booked.hotelName,
|
|
97
|
+
...(booked.hotelNames ? { hotelNames: booked.hotelNames } : {}),
|
|
98
|
+
stay: {
|
|
99
|
+
checkIn: booked.stay.checkIn,
|
|
100
|
+
checkOut: booked.stay.checkOut,
|
|
101
|
+
nights: nightsBetween(booked.stay.checkIn, booked.stay.checkOut),
|
|
102
|
+
rooms: rooms.reduce((n, l) => n + Math.max(1, l.quantity ?? 1), 0) || 1,
|
|
103
|
+
roomName: [...new Set(rooms.map((l) => l.title))].join(' + '),
|
|
104
|
+
...roomNamesOf(rooms, true),
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: {};
|
|
108
|
+
// This connector's own demonstration: its rule is only these terms, that
|
|
109
|
+
// its add-ons go free, and that nothing is charged - which the card says
|
|
110
|
+
// in the guest's words.
|
|
111
|
+
const ownDemo = demoBookingNote(deps, preview.supplier)
|
|
112
|
+
? {
|
|
113
|
+
demoHold: true,
|
|
114
|
+
...(booked?.quote.lines.some((l) => l.kind === 'extra') ? { addOnsFree: true } : {}),
|
|
115
|
+
}
|
|
116
|
+
: {};
|
|
117
|
+
// Money already paid here, and what comes back: see `paidFactsOf`.
|
|
118
|
+
// ⚠️ NOT WHEN THE FEE IS NOT KNOWN: what comes back is then the group's to say.
|
|
119
|
+
// ⚠️ THE REFUND IS PART OF THIS YES (0.74.2, robin 11-17: one Cancel): a booking paid here
|
|
120
|
+
// at a group that refunds (`caps.refunds`) is cancelled AND its money asked back by the one
|
|
121
|
+
// confirmation - said before it is given, with what was paid and who reviews it.
|
|
122
|
+
const refundAsked = booked?.payment?.status === 'paid' &&
|
|
123
|
+
preview.cancellable &&
|
|
124
|
+
holderOf(deps, preview.supplier).caps.refunds === true
|
|
125
|
+
? { amount: formatMoney(booked.payment.amount), supplier: preview.supplier }
|
|
126
|
+
: undefined;
|
|
127
|
+
// ⚠️ NOT "NOTHING COMES BACK" WHERE THE YES ASKS IT ALL BACK (0.74.3, 总线程's review of 0.74.2,
|
|
128
|
+
// P2-2): a paid booking with no terms from its group was previewed "cancelling costs the
|
|
129
|
+
// whole amount, nothing comes back" - and confirmed, 9.1 was sent. Then `refundWithCancel`
|
|
130
|
+
// says the money, and the facts of a fee kept are not sent.
|
|
131
|
+
const paid = preview.feeUnknown || refundAsked ? undefined : paidFactsOf(booked, preview);
|
|
132
|
+
const sayTheWord = `Say the word and it is cancelled (${t.cancelBooking} with \`confirmed\`).`;
|
|
133
|
+
return { booked, rooms, which, ownDemo, refundAsked, paid, sayTheWord };
|
|
134
|
+
};
|
|
135
|
+
/** The card's structure for a cancellation preview. */
|
|
136
|
+
const previewStructured = ({ deps, t, key, preview, booked, rooms, which, ownDemo, refundAsked, paid, }) => {
|
|
137
|
+
return {
|
|
138
|
+
view: 'cancellation-preview',
|
|
139
|
+
...common(deps, key),
|
|
140
|
+
booking: { id: preview.bookingId, confirmationCode: preview.confirmationCode },
|
|
141
|
+
...which,
|
|
142
|
+
...(booked
|
|
143
|
+
? {
|
|
144
|
+
// Each room's terms as they stand now: free while its own free
|
|
145
|
+
// time lasts (the backend's \`freeUntil\` is the earliest of those
|
|
146
|
+
// still running), non-refundable, or past it and charged.
|
|
147
|
+
// ⚠️ NO GUESS WHERE THE FEE IS NOT KNOWN (0.84.2, the 11-25 UI review's P1-2): a paid
|
|
148
|
+
// Otaless booking (`feeUnknown`, no `freeUntil`) fell to "charged" - 「已过免费取消时间」 -
|
|
149
|
+
// for a stay months away, under "what cancelling costs is what the group says". Only a
|
|
150
|
+
// rate that is non-refundable says so; the others say nothing of a free time here.
|
|
151
|
+
terms: rooms
|
|
152
|
+
.filter((l) => !preview.feeUnknown || l.refundable === false)
|
|
153
|
+
.map((l) => ({
|
|
154
|
+
room: l.title,
|
|
155
|
+
...(l.titleNames ? { roomNames: l.titleNames } : {}),
|
|
156
|
+
state: l.refundable === false
|
|
157
|
+
? 'non-refundable'
|
|
158
|
+
: preview.fee.minor === 0 ||
|
|
159
|
+
(!!preview.freeUntil &&
|
|
160
|
+
!!l.freeCancellationUntil &&
|
|
161
|
+
l.freeCancellationUntil >= preview.freeUntil)
|
|
162
|
+
? 'free'
|
|
163
|
+
: 'charged',
|
|
164
|
+
...(l.freeCancellationLocal ? { until: l.freeCancellationLocal } : {}),
|
|
165
|
+
...(l.freeCancellationLocalIso ? { untilIso: l.freeCancellationLocalIso } : {}),
|
|
166
|
+
})),
|
|
167
|
+
}
|
|
168
|
+
: {}),
|
|
169
|
+
...ownDemo,
|
|
170
|
+
// ⚠️ THE FEE IS NOT KNOWN BEFORE THE GROUP CANCELS (`feeUnknown`): the rule is
|
|
171
|
+
// the group's own terms, and no figure - not even "up to" - is said.
|
|
172
|
+
...(preview.feeUnknown ? { feeUnknown: true } : { fee: formatMoney(preview.fee) }),
|
|
173
|
+
// Its `rule` is ours, for the model (0.74.5): the card says it in its own words.
|
|
174
|
+
...(preview.termsNew ? { termsNew: true } : {}),
|
|
175
|
+
// What the booking came to, so the fee is read against it (r10 #22).
|
|
176
|
+
...(booked ? { bookingTotal: formatMoney(booked.quote.total) } : {}),
|
|
177
|
+
// ⚠️ NO "REFUND": nothing was ever paid here - a demonstration takes no
|
|
178
|
+
// money and a hotel's own booking is paid at the hotel - so a figure
|
|
179
|
+
// called a refund is money that is not coming back (2026-10-05 audit, P3).
|
|
180
|
+
rule: preview.rule,
|
|
181
|
+
freeUntil: preview.freeUntil,
|
|
182
|
+
cancellable: preview.cancellable,
|
|
183
|
+
// What was paid and what comes back - the half of `rule` the card does
|
|
184
|
+
// not show once it says the terms from the facts below.
|
|
185
|
+
...(paid ? { payment: paid } : {}),
|
|
186
|
+
// The terms as facts, so the card can say them in the guest's language
|
|
187
|
+
// instead of showing `rule` as the backend wrote it. Money becomes a
|
|
188
|
+
// string here like `fee`; `free` is a step whose fee is nothing, so the
|
|
189
|
+
// card need not read it out of the string.
|
|
190
|
+
...(preview.feeIsCap ? { feeIsCap: true } : {}),
|
|
191
|
+
...(preview.reason ? { reason: preview.reason } : {}),
|
|
192
|
+
...(preview.steps?.length
|
|
193
|
+
? {
|
|
194
|
+
steps: preview.steps.map((step) => ({
|
|
195
|
+
...(step.untilLocalIso ? { untilLocalIso: step.untilLocalIso } : {}),
|
|
196
|
+
fee: step.fee ? formatMoney(step.fee) : null,
|
|
197
|
+
...(step.fee && step.fee.minor === 0 ? { free: true } : {}),
|
|
198
|
+
...(step.noShow ? { noShow: true } : {}),
|
|
199
|
+
...(step.current ? { current: true } : {}),
|
|
200
|
+
})),
|
|
201
|
+
}
|
|
202
|
+
: {}),
|
|
203
|
+
toolToConfirm: t.cancelBooking,
|
|
204
|
+
...(refundAsked ? { refundWithCancel: refundAsked } : {}),
|
|
205
|
+
// Whether cancelling hands the coupon back - the same sentence as the text.
|
|
206
|
+
...(preview.coupon
|
|
207
|
+
? {
|
|
208
|
+
coupon: {
|
|
209
|
+
...preview.coupon,
|
|
210
|
+
said: couponBackWords(preview.coupon, formatMoney(preview.fee), false, holderOf(deps, preview.supplier).notReal),
|
|
211
|
+
},
|
|
212
|
+
}
|
|
213
|
+
: {}),
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
/** The words for a cancellation preview. */
|
|
217
|
+
const previewText = ({ deps, preview, refundAsked, sayTheWord }) => {
|
|
218
|
+
return [
|
|
219
|
+
// ⚠️ NOT "WOULD COST ¥0 - NOTHING" WHERE IT CANNOT BE CANCELLED YET (0.80.1): a group that
|
|
220
|
+
// has not answered for the booking - or, paid, for the refund that cancels it (Otaless) - is
|
|
221
|
+
// no free cancellation. The card leaves the fee out there too (`reasonWords`).
|
|
222
|
+
!preview.cancellable && preview.reason === 'unconfirmed'
|
|
223
|
+
? `${preview.confirmationCode} cannot be cancelled yet.`
|
|
224
|
+
: preview.feeUnknown
|
|
225
|
+
? `Cancelling ${preview.confirmationCode}: the fee is not known until ${holderOf(deps, preview.supplier).name} cancels it - it is whatever ${holderOf(deps, preview.supplier).name} charges then, under its own terms:`
|
|
226
|
+
: `Cancelling ${preview.confirmationCode} would cost ${formatMoney(preview.fee)}${preview.fee.minor === 0 ? ' - nothing' : ''}.`,
|
|
227
|
+
preview.rule,
|
|
228
|
+
preview.coupon
|
|
229
|
+
? couponBackWords(preview.coupon, formatMoney(preview.fee), false, holderOf(deps, preview.supplier).notReal)
|
|
230
|
+
: '',
|
|
231
|
+
refundAsked
|
|
232
|
+
? `It was paid (${refundAsked.amount}): cancelling it also asks ${holderOf(deps, preview.supplier).name} for all of that back, in the same step - ${holderOf(deps, preview.supplier).name} reviews it and returns it to the card it was paid with.`
|
|
233
|
+
: '',
|
|
234
|
+
preview.cancellable ? sayTheWord : '',
|
|
235
|
+
demoBookingNote(deps, preview.supplier),
|
|
236
|
+
]
|
|
237
|
+
.filter(Boolean)
|
|
238
|
+
.join(' ');
|
|
239
|
+
};
|
|
240
|
+
// ⚠️ THE VALUE-ADDED SERVICE ORDERS BOUGHT WITH IT (0.84.2, the 11-25 UI review's P1-1), where the shop
|
|
241
|
+
// is on (never root): read fresh and said beside the preview - one awaiting payment is cancelled with
|
|
242
|
+
// the booking, one paid is NOT refunded by it (its refund is offered), and orders not read are said
|
|
243
|
+
// as that. A booking that cannot be cancelled yet says nothing of them; one no longer active does.
|
|
244
|
+
const addOnsBeside = async ({ deps, t, who, shopApi, shopLang, preview, addOnsOf }, said) => {
|
|
245
|
+
if (!shopApi || !(preview.cancellable || preview.reason === 'not-active'))
|
|
246
|
+
return said;
|
|
247
|
+
const part = addOnsCancelPreview(await shopApi.withBooking(who, addOnsOf, shopLang), preview.confirmationCode, preview.cancellable, { preview: t.previewCancellation }, deps.shopLink);
|
|
248
|
+
return part
|
|
249
|
+
? {
|
|
250
|
+
...said,
|
|
251
|
+
structured: { ...said.structured, ...part.structured },
|
|
252
|
+
text: [said.text, part.text].join('\n'),
|
|
253
|
+
}
|
|
254
|
+
: said;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* What is said before the cancel is made: the preview itself when the call only asks for it, the
|
|
258
|
+
* page for the guest's own press on a client with no card, or the fee that has changed. Nothing
|
|
259
|
+
* when the guest has confirmed what was shown - the caller then cancels.
|
|
260
|
+
*/
|
|
261
|
+
const confirmGate = async (cx, asPreview, wasShown) => {
|
|
262
|
+
const { deps, name, args, ctx, t, key, preview, booked, which, refundAsked, paid, sayTheWord } = cx;
|
|
263
|
+
const withAddOns = (said) => addOnsBeside(cx, said);
|
|
264
|
+
if (name === t.previewCancellation || args.confirmed !== true)
|
|
265
|
+
return withAddOns(asPreview);
|
|
266
|
+
if (!preview.cancellable)
|
|
267
|
+
return withAddOns(asPreview);
|
|
268
|
+
// ⚠️ ON A CLIENT THAT DRAWS NO CARD, THE GUEST'S OWN PRESS IN THEIR SIGNED-IN BROWSER (0.84.2, the 11-25
|
|
269
|
+
// code audit's P1-8, option C ④ - `account.cancelOnPage`, `deps.cancelLink`): the model's `confirmed`
|
|
270
|
+
// cancels nothing there - whoever holds the conversation's trip id can say it. It answers with a
|
|
271
|
+
// one-time page that shows this preview and one button; the press there comes back here
|
|
272
|
+
// (`ctx.cancelPressed`: the preview the page showed) and cancels only if the preview is still that.
|
|
273
|
+
// A card's own button is the guest's press, as before; with the switch off none of this exists.
|
|
274
|
+
const shape = cancelShapeOf(preview, refundAsked, paid, booked);
|
|
275
|
+
if (ctx.cancelPressed !== undefined) {
|
|
276
|
+
if (ctx.cancelPressed !== shape)
|
|
277
|
+
return withAddOns({
|
|
278
|
+
...asPreview,
|
|
279
|
+
structured: { ...asPreview.structured, changedSincePage: true },
|
|
280
|
+
text: `Nothing was cancelled: what cancelling ${preview.confirmationCode} does has changed since the page showed it. ${asPreview.text}`,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
else if (deps.cancelLink && ctx.noCards) {
|
|
284
|
+
const shown = await withAddOns(asPreview);
|
|
285
|
+
const link = deps.cancelLink(key, cancelFactsOf(deps, preview, booked, which, refundAsked, paid, shown.structured, shape));
|
|
286
|
+
if (!link)
|
|
287
|
+
return {
|
|
288
|
+
structured: { view: 'error', ...common(deps, key), error: 'no-cancel-page' },
|
|
289
|
+
text: `Nothing was cancelled: a one-time page for the guest to cancel ${preview.confirmationCode} on could not be made (they must be signed in to their account here, and not have asked for too many links at once). On this app a booking is cancelled only by the guest's own press on that page - never by your word.`,
|
|
290
|
+
isError: true,
|
|
291
|
+
};
|
|
292
|
+
const { toolToConfirm: _byWord, ...facts } = shown.structured;
|
|
293
|
+
const until = clockWords(link.expiresAt) ?? link.expiresAt;
|
|
294
|
+
return {
|
|
295
|
+
structured: {
|
|
296
|
+
...facts,
|
|
297
|
+
cancelPage: { url: link.url, host: hostOf(link.url), expiresAt: link.expiresAt },
|
|
298
|
+
},
|
|
299
|
+
text: [
|
|
300
|
+
`Nothing is cancelled yet: here a booking is cancelled by the guest's own press, on a one-time page in their own browser - not by your word. Give the guest this page to cancel ${preview.confirmationCode} on: ${link.url} - ${inBrowserWords(deps, ctx) ? `it works once, and is good until ${until}. ${OPENS_SIGNED_IN} ${GUEST_ALONE}` : `it opens only in the browser signed in to their account, works once, and is good until ${until}.`}`,
|
|
301
|
+
`The page shows what cancelling does - what follows - and one button; ${preview.confirmationCode} is cancelled only when the guest presses it there, and the page shows how it came out. Never say it is cancelled until ${t.listBookings} shows it.`,
|
|
302
|
+
shown.text.replace(` ${sayTheWord}`, '').replace(sayTheWord, ''),
|
|
303
|
+
].join(' '),
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
else if (wasShown === undefined || wasShown !== preview.fee.minor) {
|
|
307
|
+
return withAddOns({
|
|
308
|
+
...asPreview,
|
|
309
|
+
text: [
|
|
310
|
+
wasShown === undefined
|
|
311
|
+
? 'Nothing is cancelled yet: this is what cancelling would cost, for the guest to see first.'
|
|
312
|
+
: `The fee has changed since it was shown - it is now ${formatMoney(preview.fee)}. Nothing is cancelled yet.`,
|
|
313
|
+
asPreview.text,
|
|
314
|
+
].join(' '),
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
return undefined;
|
|
318
|
+
};
|
|
319
|
+
/** The value-added service orders of a booking that has just ended, cancelled or left to be refunded. */
|
|
320
|
+
const cancelAddOns = async ({ deps, t, who, shopApi, shopLang, preview, addOnsOf }, cancelled) => {
|
|
321
|
+
// ⚠️ …AND ONCE IT IS CANCELLED (0.84.2, P1-1): each of its orders still awaiting payment is cancelled
|
|
322
|
+
// at the shop - read fresh, its payment asked again: one paid meanwhile is NOT refunded and nothing is
|
|
323
|
+
// sent for it (shop-service.ts `cancelWithBooking`). A paid one's refund is offered, never asked: it
|
|
324
|
+
// is the guest's own yes on its own preview. No money moves back on the booking's yes. Only for a
|
|
325
|
+
// booking the backend answered as ended: one it did not is not "cancelled" here, and nothing is sent.
|
|
326
|
+
let addOnsDone;
|
|
327
|
+
if (shopApi && BOOKING_ENDED.has(cancelled.status)) {
|
|
328
|
+
const open = await shopApi.withBooking(who, addOnsOf, shopLang);
|
|
329
|
+
const done = [];
|
|
330
|
+
if (open.ok)
|
|
331
|
+
for (const ord of open.orders) {
|
|
332
|
+
if (ord.status !== 'awaiting-payment') {
|
|
333
|
+
done.push({ order: ord, fate: 'refund-offered' });
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
const c = await shopApi.cancelWithBooking(who, ord.id, shopLang);
|
|
337
|
+
done.push(c.outcome === 'cancelled'
|
|
338
|
+
? { order: c.order, fate: 'cancelled' }
|
|
339
|
+
: c.outcome === 'paid'
|
|
340
|
+
? { order: c.order, fate: 'refund-offered' }
|
|
341
|
+
: c.outcome === 'unknown'
|
|
342
|
+
? { order: c.order ?? ord, fate: 'not-known' }
|
|
343
|
+
: c.order?.status === 'cancelled'
|
|
344
|
+
? { order: c.order, fate: 'cancelled' }
|
|
345
|
+
: { order: c.order ?? ord, fate: 'not-cancelled' });
|
|
346
|
+
}
|
|
347
|
+
addOnsDone = addOnsCancelResult(open, done, cancelled.confirmationCode || preview.confirmationCode, { preview: t.previewCancellation }, deps.shopLink);
|
|
348
|
+
}
|
|
349
|
+
return addOnsDone;
|
|
350
|
+
};
|
|
351
|
+
/** What became of the coupon the booking used, said once and handed over in both. */
|
|
352
|
+
const couponAfterCancel = (cancelled, charged, h) => {
|
|
353
|
+
// What became of the coupon the booking used, said once and handed over in
|
|
354
|
+
// both: the structure's `coupon` and the text's sentence are this one string.
|
|
355
|
+
const couponNow = cancelled.quote.coupon && cancelled.couponReturned !== undefined
|
|
356
|
+
? (() => {
|
|
357
|
+
const returned = cancelled.couponReturned === true;
|
|
358
|
+
const c = {
|
|
359
|
+
id: cancelled.quote.coupon.id,
|
|
360
|
+
name: cancelled.quote.coupon.name,
|
|
361
|
+
...(cancelled.quote.coupon.names ? { names: cancelled.quote.coupon.names } : {}),
|
|
362
|
+
validUntil: cancelled.quote.coupon.validUntil,
|
|
363
|
+
returned,
|
|
364
|
+
// A booking cancelled before the reason was kept: a coupon not
|
|
365
|
+
// returned could then only have run out.
|
|
366
|
+
...(returned
|
|
367
|
+
? {}
|
|
368
|
+
: {
|
|
369
|
+
notReturnedBecause: cancelled.couponNotReturnedBecause ?? 'expired',
|
|
370
|
+
}),
|
|
371
|
+
};
|
|
372
|
+
return { ...c, said: couponBackWords(c, formatMoney(charged), true, h.notReal) };
|
|
373
|
+
})()
|
|
374
|
+
: undefined;
|
|
375
|
+
return couponNow;
|
|
376
|
+
};
|
|
377
|
+
/** The answer for a booking that is cancelled. */
|
|
378
|
+
const cancelledAnswer = ({ deps, key, preview, which, ownDemo }, { cancelled, charged, feeUnsaid, h, couponNow, addOnsDone, }) => {
|
|
379
|
+
return {
|
|
380
|
+
structured: {
|
|
381
|
+
view: 'cancelled',
|
|
382
|
+
...common(deps, key),
|
|
383
|
+
booking: bookingForCard(cancelled),
|
|
384
|
+
...which,
|
|
385
|
+
...ownDemo,
|
|
386
|
+
...(feeUnsaid ? { feeUnknown: true } : { fee: formatMoney(charged) }),
|
|
387
|
+
rule: preview.rule,
|
|
388
|
+
cancellable: false,
|
|
389
|
+
...(couponNow ? { coupon: couponNow } : {}),
|
|
390
|
+
...(addOnsDone?.structured ?? {}),
|
|
391
|
+
},
|
|
392
|
+
text: [
|
|
393
|
+
cancelled.payment
|
|
394
|
+
? // Paid here in advance: what becomes of the money is the answer.
|
|
395
|
+
`${cancelled.confirmationCode} is ${cancelled.status === 'expired' ? 'called off before it was paid' : 'cancelled'}. ${paidLine(deps, cancelled, feeUnsaid ? undefined : charged)}`
|
|
396
|
+
: cancelled.paymentUnknown
|
|
397
|
+
? `${cancelled.confirmationCode} is cancelled. ${paymentUnknownWords(deps, cancelled, h.name)}`
|
|
398
|
+
: feeUnsaid
|
|
399
|
+
? `${cancelled.confirmationCode} is cancelled. ${h.name} charges whatever its own terms say; the amount is not known here.`
|
|
400
|
+
: h.notReal
|
|
401
|
+
? // The fact, in no environment's word (robin, 2026-11-03); nobody charges
|
|
402
|
+
// a booking that was never sent anything (2026-10-05 audit, P2).
|
|
403
|
+
`${cancelled.confirmationCode} is cancelled. ${charged.minor === 0 ? 'No fee.' : `A real booking on this rate would be charged ${formatMoney(charged)}; this booking was never sent to ${h.name}, and nothing is charged.`}`
|
|
404
|
+
: h.test
|
|
405
|
+
? `${cancelled.confirmationCode} is cancelled. ${charged.minor === 0 ? 'No fee.' : `A real booking on this rate would be charged ${formatMoney(charged)}; this booking held no room for anyone, and nothing is charged.`}`
|
|
406
|
+
: `${cancelled.confirmationCode} is cancelled. ${charged.minor === 0 ? 'No fee.' : `The hotel charges ${formatMoney(charged)}.`}${cancelled.paymentNotConnected ? ` ${notPaidWords(cancelled)}` : ''}`,
|
|
407
|
+
couponNow?.said ?? '',
|
|
408
|
+
demoBookingNote(deps, cancelled.supplier),
|
|
409
|
+
]
|
|
410
|
+
.filter(Boolean)
|
|
411
|
+
.join(' ')
|
|
412
|
+
.concat(addOnsDone ? `\n${addOnsDone.text}` : ''),
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../src/tools/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAGL,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAEL,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAqBlE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,IAAc,E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CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,WAAW,CAAC,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;YAChN,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC;SAC1C;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC;aACT,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BackendCapabilities } from '../backend.js';
|
|
2
|
+
import type { ToolNames } from '../config.js';
|
|
3
|
+
import type { Vocabulary } from '../vocab.js';
|
|
4
|
+
export type ToolLiteral = {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: unknown;
|
|
8
|
+
};
|
|
9
|
+
/** What every step is told about the tool it is adjusting. */
|
|
10
|
+
export type AdjustContext = {
|
|
11
|
+
/** The tool as it was built, before any step. */
|
|
12
|
+
t: ToolLiteral;
|
|
13
|
+
n: ToolNames;
|
|
14
|
+
v: Vocabulary;
|
|
15
|
+
caps: BackendCapabilities;
|
|
16
|
+
};
|
|
17
|
+
/** The `inputSchema` without these properties. */
|
|
18
|
+
export declare const without: (schema: unknown, ...keys: string[]) => {
|
|
19
|
+
properties: {
|
|
20
|
+
[x: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const tonightHomeList: (input: ToolLiteral, { t, n, v, caps }: AdjustContext) => ToolLiteral;
|
|
24
|
+
export declare const readOnlyList: (input: ToolLiteral, { t, n, v, caps }: AdjustContext) => ToolLiteral;
|
|
25
|
+
export declare const withoutExtras: (input: ToolLiteral, { t, n, v, caps }: AdjustContext) => ToolLiteral;
|
|
26
|
+
export declare const withHourlyRooms: (input: ToolLiteral, { t, n, v, caps }: AdjustContext) => ToolLiteral;
|
|
27
|
+
export declare const withCoupons: (input: ToolLiteral, { t, n, caps }: AdjustContext) => ToolLiteral;
|
|
28
|
+
export declare const bookingGuestFields: (input: ToolLiteral, { t, n, v, caps }: AdjustContext) => ToolLiteral;
|
|
29
|
+
export declare const accountOrders: (input: ToolLiteral, { t, n, v, caps }: AdjustContext) => ToolLiteral;
|
|
30
|
+
export declare const bookingsAndCancelWords: (input: ToolLiteral, { t, n, caps }: AdjustContext) => ToolLiteral;
|
|
31
|
+
//# sourceMappingURL=capability-adjust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-adjust.d.ts","sourceRoot":"","sources":["../../src/tools/capability-adjust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAqB,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQ9C,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtF,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,CAAC,EAAE,WAAW,CAAC;IACf,CAAC,EAAE,SAAS,CAAC;IACb,CAAC,EAAE,UAAU,CAAC;IACd,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,EAAE,GAAG,MAAM,MAAM,EAAE;;;;CAKzD,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,WAAW,EAClB,mBA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