@gojinko/cli 2.27.0 → 2.29.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 (50) hide show
  1. package/README.md +34 -8
  2. package/SKILL.md +21 -1
  3. package/dist/commands/cars/car-cancel.d.ts +46 -0
  4. package/dist/commands/cars/car-cancel.d.ts.map +1 -0
  5. package/dist/commands/cars/car-cancel.js +136 -0
  6. package/dist/commands/cars/car-cancel.js.map +1 -0
  7. package/dist/commands/cars/car-search.d.ts +42 -0
  8. package/dist/commands/cars/car-search.d.ts.map +1 -0
  9. package/dist/commands/cars/car-search.js +184 -0
  10. package/dist/commands/cars/car-search.js.map +1 -0
  11. package/dist/commands/cars/car-shared.d.ts +54 -0
  12. package/dist/commands/cars/car-shared.d.ts.map +1 -0
  13. package/dist/commands/cars/car-shared.js +89 -0
  14. package/dist/commands/cars/car-shared.js.map +1 -0
  15. package/dist/commands/exchange.d.ts.map +1 -1
  16. package/dist/commands/exchange.js +16 -13
  17. package/dist/commands/exchange.js.map +1 -1
  18. package/dist/commands/get-booking.d.ts +4 -2
  19. package/dist/commands/get-booking.d.ts.map +1 -1
  20. package/dist/commands/get-booking.js +27 -8
  21. package/dist/commands/get-booking.js.map +1 -1
  22. package/dist/commands/hotel-cancel.d.ts +0 -15
  23. package/dist/commands/hotel-cancel.d.ts.map +1 -1
  24. package/dist/commands/hotel-cancel.js +17 -45
  25. package/dist/commands/hotel-cancel.js.map +1 -1
  26. package/dist/commands/hotel-search.d.ts +52 -1
  27. package/dist/commands/hotel-search.d.ts.map +1 -1
  28. package/dist/commands/hotel-search.js +161 -21
  29. package/dist/commands/hotel-search.js.map +1 -1
  30. package/dist/commands/refund.d.ts +7 -9
  31. package/dist/commands/refund.d.ts.map +1 -1
  32. package/dist/commands/refund.js +26 -17
  33. package/dist/commands/refund.js.map +1 -1
  34. package/dist/commands/schema.d.ts.map +1 -1
  35. package/dist/commands/schema.js +61 -5
  36. package/dist/commands/schema.js.map +1 -1
  37. package/dist/commands/trip-status.d.ts.map +1 -1
  38. package/dist/commands/trip-status.js +4 -2
  39. package/dist/commands/trip-status.js.map +1 -1
  40. package/dist/commands/trip.d.ts.map +1 -1
  41. package/dist/commands/trip.js +3 -3
  42. package/dist/commands/trip.js.map +1 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +6 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/output/servicing.d.ts +2 -0
  47. package/dist/output/servicing.d.ts.map +1 -0
  48. package/dist/output/servicing.js +81 -0
  49. package/dist/output/servicing.js.map +1 -0
  50. package/package.json +2 -2
@@ -0,0 +1,89 @@
1
+ import { tryReadMoney } from '@gojinko/api-client';
2
+ import { UsageError } from '../shared.js';
3
+ /**
4
+ * Branch-local date-time, no timezone: `2026-09-12T10:00:00`.
5
+ *
6
+ * Car rentals are quoted against the branch's own wall clock, so the contract
7
+ * deliberately carries no offset. Accepting a `Z`-suffixed or offset-bearing
8
+ * value here would send the provider a time it silently reinterprets as local,
9
+ * shifting a pick-up by hours without any error.
10
+ */
11
+ export const LOCAL_DATETIME_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/;
12
+ /** Validate a branch-local date-time, throwing a UsageError naming the flag. */
13
+ export function requireLocalDateTime(value, flag) {
14
+ if (value !== undefined && !LOCAL_DATETIME_RE.test(value)) {
15
+ throw new UsageError(`${flag} must be a branch-local date-time with no timezone, e.g. 2026-09-12T10:00:00 (got "${value}").`);
16
+ }
17
+ }
18
+ /**
19
+ * Render a CarAmount for the table view, through the api-client money reader
20
+ * (JIN-2220): the server's `display` string when the amount carries one, else
21
+ * "EUR 412.50" built from the reading — ISO code first, the same shape every
22
+ * other money line the CLI prints.
23
+ *
24
+ * A CarAmount is integer minor units under `value` with `decimal_places`. The
25
+ * reader divides by the scale that came with the amount and, when the field is
26
+ * genuinely absent, falls back to the currency's published ISO digits — never
27
+ * an assumed 2, which would print a JPY deposit of {value: 20000} as
28
+ * "JPY 200.00". An explicit 0 is a real price (a zero cancellation fee) and
29
+ * prints as one; an absent or unreadable amount prints nothing rather than a
30
+ * plausible wrong figure.
31
+ */
32
+ export function formatCarAmount(amount) {
33
+ if (!amount)
34
+ return '';
35
+ if (typeof amount.display === 'string' && amount.display !== '')
36
+ return amount.display;
37
+ const money = tryReadMoney(amount);
38
+ return money ? `${money.currency} ${money.text}` : '';
39
+ }
40
+ /**
41
+ * Parse `--*-geo <lat,lng,range>` into a CarGeo.
42
+ *
43
+ * One flag rather than three keeps the three parts inseparable: a geo search is
44
+ * meaningless with a latitude but no range, and Commander cannot express
45
+ * "these three flags are required together".
46
+ */
47
+ export function parseGeo(raw, flag) {
48
+ const parts = raw.split(',').map((p) => p.trim());
49
+ if (parts.length !== 3) {
50
+ throw new UsageError(`${flag} must be "lat,lng,range", e.g. 45.72,4.94,5000 (got "${raw}").`);
51
+ }
52
+ const [latitude, longitude, range] = parts.map(Number);
53
+ if (![latitude, longitude, range].every((n) => Number.isFinite(n))) {
54
+ throw new UsageError(`${flag} must be three numbers "lat,lng,range" (got "${raw}").`);
55
+ }
56
+ if (range < 50) {
57
+ throw new UsageError(`${flag} range must be at least 50 metres (got ${range}).`);
58
+ }
59
+ return { latitude: latitude, longitude: longitude, range: range };
60
+ }
61
+ /**
62
+ * Resolve the exactly-one-of location flags for one side of the rental.
63
+ *
64
+ * `airport_code`, `place` and `geo` are mutually exclusive server-side — a rule
65
+ * the JSON Schema cannot express, so it is enforced here rather than surfacing
66
+ * as an opaque 400.
67
+ */
68
+ export function resolveLocation(side, opts, { required }) {
69
+ const given = [
70
+ opts.airport !== undefined && `--${side}-airport`,
71
+ opts.place !== undefined && `--${side}-place`,
72
+ opts.geo !== undefined && `--${side}-geo`,
73
+ ].filter((f) => typeof f === 'string');
74
+ if (given.length > 1) {
75
+ throw new UsageError(`Provide exactly one of ${given.join(', ')} — they are mutually exclusive.`);
76
+ }
77
+ if (given.length === 0) {
78
+ if (required) {
79
+ throw new UsageError(`Provide exactly one of --${side}-airport, --${side}-place or --${side}-geo.`);
80
+ }
81
+ return {};
82
+ }
83
+ if (opts.airport !== undefined)
84
+ return { airport_code: opts.airport };
85
+ if (opts.place !== undefined)
86
+ return { place: opts.place };
87
+ return { geo: parseGeo(opts.geo, `--${side}-geo`) };
88
+ }
89
+ //# sourceMappingURL=car-shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"car-shared.js","sourceRoot":"","sources":["../../../src/commands/cars/car-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AAEzE,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,KAAyB,EAAE,IAAY;IAC1E,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,UAAU,CAClB,GAAG,IAAI,sFAAsF,KAAK,KAAK,CACxG,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,MAA6B;IAC3D,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,KAAK,EAAE;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IACvF,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,IAAY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C,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;IAEpD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,UAAU,CAAC,0BAA0B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IACpG,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,UAAU,CAClB,4BAA4B,IAAI,eAAe,IAAI,eAAe,IAAI,OAAO,CAC9E,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACtE,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3D,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAI,EAAE,KAAK,IAAI,MAAM,CAAC,EAAE,CAAC;AACvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/commands/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqF9D"}
1
+ {"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/commands/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuF9D"}
@@ -1,15 +1,17 @@
1
+ import { publicServicingResponse } from '../output/servicing.js';
1
2
  import { withClient, output, userIntentOption } from './shared.js';
2
- import { buildAuthFields } from './refund.js';
3
+ import { buildAuthFields, itemIdOption } from './refund.js';
3
4
  export function registerExchangeCommand(program) {
4
5
  const exchange = program
5
6
  .command('exchange')
6
- .description('Shop, price, commit, or poll a flight exchange.');
7
+ .description('Call get-booking first, choose item_id, then shop, price, commit, or poll a flight exchange using that booking reference and stable item ID.');
7
8
  exchange
8
9
  .command('shop')
9
10
  .summary('Shop for flight exchange alternatives')
10
11
  .description('Shop for flight exchange alternatives.')
11
12
  .requiredOption('--booking-ref <ref>', 'Jinko booking reference [required]')
12
- .requiredOption('--last-name <name>', 'Last name of the primary traveler [required]')
13
+ .option('--last-name <name>', 'Traveler surname, required for guest lookup; owning credentials may omit it.')
14
+ .addOption(itemIdOption())
13
15
  .option('--provider <provider>', 'override provider hint')
14
16
  .option('--ticket-numbers <numbers...>', 'one or more ticket numbers')
15
17
  .option('--preferred-departure-date <date>', 'preferred departure date (YYYY-MM-DD)')
@@ -19,7 +21,7 @@ export function registerExchangeCommand(program) {
19
21
  ...buildAuthFields(opts),
20
22
  ...(opts.preferredDepartureDate && { preferred_departure_date: opts.preferredDepartureDate }),
21
23
  });
22
- output(response, { format: globals.format });
24
+ output(publicServicingResponse(response), { format: globals.format });
23
25
  }));
24
26
  exchange
25
27
  .command('price')
@@ -27,7 +29,8 @@ export function registerExchangeCommand(program) {
27
29
  .description('Price a specific exchange offer.')
28
30
  .requiredOption('--offer-id <id>', 'exchange offer ID from shop response [required]')
29
31
  .requiredOption('--booking-ref <ref>', 'Jinko booking reference [required]')
30
- .requiredOption('--last-name <name>', 'Last name of the primary traveler [required]')
32
+ .option('--last-name <name>', 'Traveler surname, required for guest lookup; owning credentials may omit it.')
33
+ .addOption(itemIdOption())
31
34
  .option('--provider <provider>', 'override provider hint')
32
35
  .option('--ticket-numbers <numbers...>', 'one or more ticket numbers')
33
36
  .addOption(userIntentOption())
@@ -36,7 +39,7 @@ export function registerExchangeCommand(program) {
36
39
  ...buildAuthFields(opts),
37
40
  offer_id: opts.offerId,
38
41
  });
39
- output(response, { format: globals.format });
42
+ output(publicServicingResponse(response), { format: globals.format });
40
43
  }));
41
44
  exchange
42
45
  .command('commit')
@@ -45,7 +48,8 @@ export function registerExchangeCommand(program) {
45
48
  .requiredOption('--offer-id <id>', 'exchange offer ID [required]')
46
49
  .requiredOption('--session-reference <ref>', 'session reference from price response [required]')
47
50
  .requiredOption('--booking-ref <ref>', 'Jinko booking reference [required]')
48
- .requiredOption('--last-name <name>', 'Last name of the primary traveler [required]')
51
+ .option('--last-name <name>', 'Traveler surname, required for guest lookup; owning credentials may omit it.')
52
+ .addOption(itemIdOption())
49
53
  .option('--provider <provider>', 'override provider hint')
50
54
  .option('--ticket-numbers <numbers...>', 'one or more ticket numbers')
51
55
  .addOption(userIntentOption())
@@ -55,23 +59,22 @@ export function registerExchangeCommand(program) {
55
59
  offer_id: opts.offerId,
56
60
  session_reference: opts.sessionReference,
57
61
  });
58
- output(response, { format: globals.format });
62
+ output(publicServicingResponse(response), { format: globals.format });
59
63
  }));
60
64
  exchange
61
65
  .command('status')
62
66
  .summary('Check the status of an exchange')
63
67
  .description('Poll the status of an in-flight exchange.')
64
68
  .requiredOption('--booking-ref <ref>', 'Jinko booking reference [required]')
65
- .requiredOption('--last-name <name>', 'Last name of the primary traveler [required]')
69
+ .option('--last-name <name>', 'Traveler surname, required for guest lookup; owning credentials may omit it.')
70
+ .addOption(itemIdOption())
66
71
  .option('--provider <provider>', 'override provider hint')
67
72
  .addOption(userIntentOption())
68
73
  .action(withClient(async (client, globals, opts) => {
69
74
  const response = await client.exchangeStatus({
70
- booking_ref: opts.bookingRef,
71
- last_name: opts.lastName,
72
- ...(opts.provider && { provider: opts.provider }),
75
+ ...buildAuthFields(opts),
73
76
  });
74
- output(response, { format: globals.format });
77
+ output(publicServicingResponse(response), { format: globals.format });
75
78
  }));
76
79
  }
77
80
  //# sourceMappingURL=exchange.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/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C,uBAAuB,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CACH,CAAC;IAEJ,QAAQ;SACL,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,iCAAiC,CAAC;SAC1C,WAAW,CAAC,2CAA2C,CAAC;SACxD,cAAc,CAAC,qBAAqB,EAAE,oCAAoC,CAAC;SAC3E,MAAM,CAAC,oBAAoB,EAAE,8EAA8E,CAAC;SAC5G,SAAS,CAAC,YAAY,EAAE,CAAC;SACzB,MAAM,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;SACzD,SAAS,CAAC,gBAAgB,EAAE,CAAC;SAC7B,MAAM,CACL,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC;YAC3C,GAAG,eAAe,CAAC,IAAI,CAAC;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CACH,CAAC;AACN,CAAC"}
@@ -6,18 +6,20 @@ import type { BookingGetResponse } from '@gojinko/api-client';
6
6
  *
7
7
  * The iCalendar body itself is deliberately NOT printed — it is multi-kilobyte
8
8
  * CRLF text, and a consumer that wants the bytes reads them from `--format
9
- * json`, which carries the response untouched.
9
+ * json`, which carries the public response and original calendar bytes.
10
10
  *
11
11
  * Empty when the booking carries no calendar — a booking with no flight and no
12
12
  * hotel omits it altogether — so those bookings print nothing extra. Pure —
13
13
  * exported for tests.
14
14
  */
15
15
  export declare function calendarLines(response: BookingGetResponse): string[];
16
+ /** Human-readable selection handles and eligibility for every product. */
17
+ export declare function bookingItemLines(response: BookingGetResponse): string[];
16
18
  /**
17
19
  * Print the booking, then the calendar summary under it.
18
20
  *
19
21
  * JSON output gets the calendar for free — `calendar` is a response field and
20
- * travels through `output` untouched — so only the human format needs anything
22
+ * travels through `output` with its bytes untouched — so only the human format needs anything
21
23
  * extra. There the files are summarised INSTEAD of dumped: `output` renders a
22
24
  * nested object by JSON.stringify-ing it into a single table cell, which for an
23
25
  * iCalendar body means thousands of characters of escaped CRLF on one line.
@@ -1 +1 @@
1
- {"version":3,"file":"get-booking.d.ts","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAUpE;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,MAAM,GAAG,OAAO,GACvB,IAAI,CAQN;AAkBD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAYhE"}
1
+ {"version":3,"file":"get-booking.d.ts","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAUpE;AAED,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAcvE;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,MAAM,GAAG,OAAO,GACvB,IAAI,CASN;AAkBD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAYhE"}
@@ -1,12 +1,13 @@
1
1
  import chalk from 'chalk';
2
2
  import { withClient, output, resolveDeprecatedFlag, userIntentOption } from './shared.js';
3
+ import { publicServicingResponse } from '../output/servicing.js';
3
4
  /**
4
5
  * One compact line per calendar file (JIN-2176): the iTIP method and the
5
6
  * filename the confirmation email attached that same file under.
6
7
  *
7
8
  * The iCalendar body itself is deliberately NOT printed — it is multi-kilobyte
8
9
  * CRLF text, and a consumer that wants the bytes reads them from `--format
9
- * json`, which carries the response untouched.
10
+ * json`, which carries the public response and original calendar bytes.
10
11
  *
11
12
  * Empty when the booking carries no calendar — a booking with no flight and no
12
13
  * hotel omits it altogether — so those bookings print nothing extra. Pure —
@@ -23,18 +24,35 @@ export function calendarLines(response) {
23
24
  ...files.map((file) => ` ${method(file).padEnd(width)} ${file.filename ?? '—'}`),
24
25
  ];
25
26
  }
26
- /** The same response with `booking.calendar` dropped. */
27
+ /** Human-readable selection handles and eligibility for every product. */
28
+ export function bookingItemLines(response) {
29
+ const items = response.booking?.items ?? [];
30
+ if (!items.length)
31
+ return [];
32
+ return ['Booked items (use --item-id):', ...items.flatMap((item) => {
33
+ const s = item.servicing;
34
+ const state = (value) => value === undefined ? 'unknown' : value ? 'yes' : 'no';
35
+ return [
36
+ ` ${item.item_id} ${item.domain} ${item.summary ?? item.confirmation?.product_summary ?? ''}`,
37
+ ...(item.confirmation?.confirmation_number ? [` ${item.domain === 'flight' ? 'Airline locator' : 'Confirmation'}: ${item.confirmation.confirmation_number}`] : []),
38
+ ` refund: ${state(s?.can_refund)} (${s?.refund_support_level ?? 'unknown'}), void: ${state(s?.can_void)}, exchange: ${state(s?.can_exchange)} (${s?.exchange_support_level ?? 'unknown'})`,
39
+ ...(s?.refund_unavailable_reason ? [` Refund unavailable: ${s.refund_unavailable_reason}`] : []),
40
+ ...(s?.exchange_unavailable_reason ? [` Exchange unavailable: ${s.exchange_unavailable_reason}`] : []),
41
+ ];
42
+ })];
43
+ }
44
+ /** Calendar and items have their own concise rendering below the booking. */
27
45
  function withoutCalendar(response) {
28
46
  if (!response.booking)
29
47
  return response;
30
- const { calendar: _calendar, ...booking } = response.booking;
48
+ const { calendar: _calendar, items: _items, ...booking } = response.booking;
31
49
  return { ...response, booking };
32
50
  }
33
51
  /**
34
52
  * Print the booking, then the calendar summary under it.
35
53
  *
36
54
  * JSON output gets the calendar for free — `calendar` is a response field and
37
- * travels through `output` untouched — so only the human format needs anything
55
+ * travels through `output` with its bytes untouched — so only the human format needs anything
38
56
  * extra. There the files are summarised INSTEAD of dumped: `output` renders a
39
57
  * nested object by JSON.stringify-ing it into a single table cell, which for an
40
58
  * iCalendar body means thousands of characters of escaped CRLF on one line.
@@ -42,8 +60,9 @@ function withoutCalendar(response) {
42
60
  * `--format json` away. Exported for tests.
43
61
  */
44
62
  export function renderGetBookingResponse(response, format) {
45
- const lines = format === 'table' ? calendarLines(response) : [];
46
- output(lines.length > 0 ? withoutCalendar(response) : response, { format });
63
+ const publicResponse = publicServicingResponse(response, ['provider_booking_id', 'connector_reference']);
64
+ const lines = format === 'table' ? [...bookingItemLines(publicResponse), ...calendarLines(publicResponse)] : [];
65
+ output(lines.length > 0 ? withoutCalendar(publicResponse) : publicResponse, { format });
47
66
  if (lines.length === 0)
48
67
  return;
49
68
  console.log('');
@@ -70,9 +89,9 @@ export function registerGetBookingCommand(program) {
70
89
  program
71
90
  .command('get-booking')
72
91
  .summary("Retrieve a booking using the Jinko booking reference and the traveler's last name")
73
- .description("Anonymous retrieval for a booking the user already made. Use it when the traveler has their Jinko booking reference and last name, for example to look up the itinerary days later without signing in. Returns the full booking envelope: status, travelers, and itinerary items with confirmation numbers (PNR for flights, confirmation number for hotels), plus `calendar` — the iCalendar (.ics) files for the booking's flights and stays, the same bytes the confirmation email attaches. The human format lists one line per file; `--format json` carries the file contents.")
92
+ .description("Call this first before refund, exchange or cancellation. Read each stable items[].item_id and items[].servicing eligibility, then pass --booking-ref and --item-id to the action. Retrieve a booking the user already made. Use it when the traveler has their Jinko booking reference and last name, for example to look up the itinerary days later without signing in. Returns the full booking envelope: status, travelers, and itinerary items with confirmation numbers (airline locator for flights, confirmation number for hotels), plus `calendar` — the iCalendar (.ics) files for the booking's flights and stays, the same bytes the confirmation email attaches. The human format lists one line per file; `--format json` carries the file contents.")
74
93
  .option('--booking-ref <ref>', 'Jinko booking reference (e.g. JNK-A7B3X9) — the `booking_ref` returned by trip-status / agent-pay submit, not a supplier PNR. JSON: `booking_ref`. [required]')
75
- .requiredOption('--last-name <name>', 'Last name of the primary traveler. JSON: `last_name`. [required]')
94
+ .option('--last-name <name>', 'Traveler surname, required for guest lookup; owning credentials may omit it. JSON: last_name.')
76
95
  .addOption(userIntentOption())
77
96
  .option('--ref <ref>', 'DEPRECATED: use --booking-ref.')
78
97
  .action(action);
@@ -1 +1 @@
1
- {"version":3,"file":"get-booking.js","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1F;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,QAA4B;IACxD,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC;IACtD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,MAAM,GAAG,CAAC,IAA4B,EAAU,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC;IAC5E,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACpE,OAAO;QACL,W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CAAC;IACH,wBAAwB,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,OAAO,CAAC,mFAAmF,CAAC;SAC5F,WAAW,CACV,quBAAquB,CACtuB;SACA,MAAM,CAAC,qBAAqB,EAAE,+JAA+J,CAAC;SAC9L,MAAM,CAAC,oBAAoB,EAAE,+FAA+F,CAAC;SAC7H,SAAS,CAAC,gBAAgB,EAAE,CAAC;SAC7B,MAAM,CAAC,aAAa,EAAE,gCAAgC,CAAC;SACvD,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC"}
@@ -1,18 +1,3 @@
1
1
  import { Command } from 'commander';
2
- /**
3
- * `gojinko hotel-cancel` — hotel cancellation, idempotent.
4
- *
5
- * Dual-auth (JIN-281, mirrors flight_refund):
6
- * - Guest: --booking-ref + --last-name (must be provided together)
7
- * - Authenticated: --provider-booking-id [+ --provider]
8
- *
9
- * The two modes are mutually exclusive at the BFF. Idempotent: the BFF
10
- * persists the cancellation result and re-serves the stored response on
11
- * subsequent calls (with `idempotent: true`). Safe to retry.
12
- *
13
- * Wraps jinko-api POST /v1/hotel_cancel. The canonical guest flag is
14
- * `--booking-ref` (matches the `booking_ref` leaf); `--ref` is kept as a
15
- * deprecated alias (JIN-665).
16
- */
17
2
  export declare function registerHotelCancelCommand(program: Command): void;
18
3
  //# sourceMappingURL=hotel-cancel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hotel-cancel.d.ts","sourceRoot":"","sources":["../../src/commands/hotel-cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkDjE"}
1
+ {"version":3,"file":"hotel-cancel.d.ts","sourceRoot":"","sources":["../../src/commands/hotel-cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoBjE"}
@@ -1,54 +1,26 @@
1
1
  import { withClient, output, resolveDeprecatedFlag, userIntentOption } from './shared.js';
2
- /**
3
- * `gojinko hotel-cancel` — hotel cancellation, idempotent.
4
- *
5
- * Dual-auth (JIN-281, mirrors flight_refund):
6
- * - Guest: --booking-ref + --last-name (must be provided together)
7
- * - Authenticated: --provider-booking-id [+ --provider]
8
- *
9
- * The two modes are mutually exclusive at the BFF. Idempotent: the BFF
10
- * persists the cancellation result and re-serves the stored response on
11
- * subsequent calls (with `idempotent: true`). Safe to retry.
12
- *
13
- * Wraps jinko-api POST /v1/hotel_cancel. The canonical guest flag is
14
- * `--booking-ref` (matches the `booking_ref` leaf); `--ref` is kept as a
15
- * deprecated alias (JIN-665).
16
- */
2
+ import { buildAuthFields, itemIdOption } from './refund.js';
3
+ import { publicServicingResponse } from '../output/servicing.js';
17
4
  export function registerHotelCancelCommand(program) {
18
5
  program
19
6
  .command('hotel-cancel')
20
- .summary('Cancel a hotel booking and get a refund when eligible')
21
- .description('Cancel a hotel booking when the traveler can no longer make the stay or wants to drop a hotel from a multi-item trip. The call is idempotent: retrying the same cancellation re-serves the stored result rather than charging or refunding twice. Works with guest auth (booking ref + last name) or the authenticated shortcut (provider booking ID).')
22
- .option('--booking-ref <ref>', 'Jinko booking reference (e.g. JNK-A7B3X9) — the `booking_ref` returned by trip-status / agent-pay submit, not the hotel confirmation number. Guest path — pair with --last-name. JSON: `booking_ref`. [required: guest mode]')
23
- .option('--last-name <name>', 'Last name of the lead guest. Guest path — pair with --booking-ref. JSON: `last_name`. [required: guest mode]')
24
- .option('--provider-booking-id <id>', 'Provider booking ID (authenticated shortcut). Mutually exclusive with --booking-ref + --last-name. JSON: `provider_booking_id`. [required: authenticated mode]')
25
- .option('--provider <code>', 'Provider code (e.g. "nuitee"). Optional, only meaningful with --provider-booking-id. JSON: `provider`.')
26
- .addOption(userIntentOption())
7
+ .summary('Cancel a booked hotel item and get a refund when eligible')
8
+ .description('Call get-booking first, choose the hotel item_id and check its servicing eligibility. Cancel with booking_ref and the selected stable item_id. Guests must send last_name; an owning credential may omit it. Cancellation is idempotent.')
9
+ .option('--booking-ref <ref>', 'Jinko booking reference from get-booking. JSON: booking_ref. [required]')
27
10
  .option('--ref <ref>', 'DEPRECATED: use --booking-ref.')
28
- .action(withClient(async (client, globals, opts) => {
11
+ .option('--last-name <name>', 'Lead guest surname, required for guest lookup; owning credentials may omit it.')
12
+ .addOption(itemIdOption())
13
+ .addOption(userIntentOption())
14
+ .hook('preAction', (command) => {
15
+ const opts = command.opts();
29
16
  const bookingRef = resolveDeprecatedFlag(opts.bookingRef, opts.ref, '--ref', '--booking-ref');
30
- const hasGuest = Boolean(bookingRef) && Boolean(opts.lastName);
31
- const guestPartial = (Boolean(bookingRef) && !opts.lastName) || (!bookingRef && Boolean(opts.lastName));
32
- const hasProviderId = Boolean(opts.providerBookingId);
33
- if (guestPartial) {
34
- console.error('Error: --booking-ref and --last-name must be provided together.');
35
- process.exit(3);
36
- }
37
- if (hasGuest && hasProviderId) {
38
- console.error('Error: --booking-ref + --last-name and --provider-booking-id are mutually exclusive. Pass one mode.');
39
- process.exit(3);
40
- }
41
- if (!hasGuest && !hasProviderId) {
42
- console.error('Error: provide either --booking-ref + --last-name (guest) or --provider-booking-id (authenticated).');
43
- process.exit(3);
44
- }
45
- const response = await client.hotelCancelBooking({
46
- booking_ref: bookingRef,
47
- last_name: opts.lastName,
48
- provider_booking_id: opts.providerBookingId,
49
- provider: opts.provider,
50
- });
51
- output(response, { format: globals.format });
17
+ if (!bookingRef)
18
+ command.error("option '--booking-ref <ref>' is required", { exitCode: 3 });
19
+ command.setOptionValue('bookingRef', bookingRef);
20
+ })
21
+ .action(withClient(async (client, globals, opts) => {
22
+ const response = await client.hotelCancelBooking(buildAuthFields(opts));
23
+ output(publicServicingResponse(response, ['provider_booking_id', 'connector_reference']), { format: globals.format });
52
24
  }));
53
25
  }
54
26
  //# sourceMappingURL=hotel-cancel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hotel-cancel.js","sourceRoot":"","sources":["../../src/commands/hotel-cancel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1F;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACzD,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;SACvB,OAAO,CAAC,uDAAuD,CAAC;SAChE,WAAW,CACV,wVAAwV,CACzV;SACA,MAAM,CAAC,qBAAqB,EAAE,8NAA8N,CAAC;SAC7P,MAAM,CAAC,oBAAoB,EAAE,8GAA8G,CAAC;SAC5I,MAAM,CACL,4BAA4B,EAC5B,gKAAgK,CACjK;SACA,MAAM,CAAC,mBAAmB,EAAE,wGAAwG,CAAC;SACrI,SAAS,CAAC,gBAAgB,EAAE,CAAC;SAC7B,MAAM,CAAC,aAAa,EAAE,gCAAgC,CAAC;SACvD,MAAM,CACL,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzC,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC9F,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/D,MAAM,YAAY,GAChB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ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,OAAO,CAAC,cAAc,CAAC;SACvB,OAAO,CAAC,2DAA2D,CAAC;SACpE,WAAW,CAAC,0OAA0O,CAAC;SACvP,MAAM,CAAC,qBAAqB,EAAE,yEAAyE,CAAC;SACxG,MAAM,CAAC,aAAa,EAAE,gCAAgC,CAAC;SACvD,MAAM,CAAC,oBAAoB,EAAE,gFAAgF,CAAC;SAC9G,SAAS,CAAC,YAAY,EAAE,CAAC;SACzB,SAAS,CAAC,gBAAgB,EAAE,CAAC;SAC7B,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC9F,IAAI,CAAC,UAAU;YAAE,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5F,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC,CAAC;SACD,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,MAAM,CAAC,uBAAuB,CAAC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxH,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import { Command } from 'commander';
2
- import type { HotelSearchRequest } from '@gojinko/api-client';
2
+ import { type HotelSearchRequest, type HotelSearchResponse } from '@gojinko/api-client';
3
3
  export type HotelsShopBody = HotelSearchRequest & {
4
4
  hotel_name?: string;
5
5
  };
6
+ export type HotelsShopResponse = HotelSearchResponse & {
7
+ destination_resolution?: DestinationResolution;
8
+ };
6
9
  export interface HotelSearchBodyOpts {
7
10
  checkin: string;
8
11
  checkout: string;
@@ -29,5 +32,53 @@ export interface HotelSearchBodyOpts {
29
32
  maxBudgetPerNight?: string;
30
33
  }
31
34
  export declare function buildHotelSearchBody(o: HotelSearchBodyOpts): HotelsShopBody;
35
+ export interface HotelNameCandidate {
36
+ hotel_id: string;
37
+ name: string;
38
+ city?: string;
39
+ score: number;
40
+ }
41
+ export interface DestinationCandidate {
42
+ city: string;
43
+ country_code: string;
44
+ hotel_count: number;
45
+ score: number;
46
+ }
47
+ export interface SuggestedRetry {
48
+ destination: Record<string, unknown>;
49
+ rationale?: string;
50
+ }
51
+ export type LowConfidenceErrorBody = {
52
+ error: {
53
+ code: 'HOTEL_NAME_LOW_CONFIDENCE';
54
+ message: string;
55
+ top_candidates: HotelNameCandidate[];
56
+ suggested_retry?: SuggestedRetry;
57
+ };
58
+ } | {
59
+ error: {
60
+ code: 'DESTINATION_LOW_CONFIDENCE';
61
+ message: string;
62
+ top_candidates: DestinationCandidate[];
63
+ suggested_retry?: SuggestedRetry;
64
+ };
65
+ };
66
+ export declare function isLowConfidenceError(body: unknown): body is LowConfidenceErrorBody;
67
+ export declare function lowConfidenceBodyFromApiError(err: unknown): LowConfidenceErrorBody | undefined;
68
+ export declare function formatLowConfidenceError(body: LowConfidenceErrorBody, format: 'json' | 'table'): void;
69
+ export interface DestinationResolution {
70
+ shape?: 'city' | 'coordinates' | 'place_id' | 'query' | 'hotel_name' | 'hotel_ids';
71
+ match?: 'exact' | 'fuzzy' | 'provider_matched' | 'fallback_string';
72
+ status?: 'resolved' | 'unknown_city' | 'implausible_spread' | 'unsupported_shape' | 'resolver_unavailable' | 'not_attempted';
73
+ requested_city?: string;
74
+ requested_country?: string;
75
+ resolved_city?: string;
76
+ resolved_country?: string;
77
+ score?: number;
78
+ hotel_id?: string;
79
+ hotel_name?: string;
80
+ hotel_city?: string;
81
+ }
82
+ export declare function buildDestinationResolutionLine(dr: DestinationResolution | undefined): string | undefined;
32
83
  export declare function registerHotelSearchCommand(program: Command): void;
33
84
  //# sourceMappingURL=hotel-search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hotel-search.d.ts","sourceRoot":"","sources":["../../src/commands/hotel-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQ9D,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAI1E,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAA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