@gojinko/cli 1.2.0 → 1.2.1
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/README.md +1 -1
- package/dist/commands/find-destination.js +1 -1
- package/dist/commands/get-booking.d.ts +3 -0
- package/dist/commands/get-booking.d.ts.map +1 -0
- package/dist/commands/get-booking.js +33 -0
- package/dist/commands/get-booking.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/commands/lookup-booking.d.ts +0 -3
- package/dist/commands/lookup-booking.d.ts.map +0 -1
- package/dist/commands/lookup-booking.js +0 -16
- package/dist/commands/lookup-booking.js.map +0 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ jinko auth logout # Clear stored credentials
|
|
|
66
66
|
|
|
67
67
|
| Command | Description |
|
|
68
68
|
|---|---|
|
|
69
|
-
| `
|
|
69
|
+
| `get-booking` | Retrieve a booking by reference (booking ref + last-name guest-auth). No subcommands. (Previously `lookup-booking`, which is kept as a hidden deprecated alias.) |
|
|
70
70
|
| `refund check` | Check refund eligibility for a booking |
|
|
71
71
|
| `refund commit` | Initiate a refund for a booking |
|
|
72
72
|
| `refund status` | Check the status of a previously committed refund |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { withClient, output } from './shared.js';
|
|
2
2
|
const DESCRIPTION = 'Discover travel destinations accessible from your departure airports. ' +
|
|
3
3
|
'Surface inspiration when a user knows where they want to leave from but not where they want to go. ' +
|
|
4
|
-
|
|
4
|
+
"Typical prompts include 'cheap beach getaways from New York' or 'weekend trips out of London under €200'. " +
|
|
5
5
|
'Results come back ranked by lowest available fare so the user can compare options before committing to a route. ' +
|
|
6
6
|
'Same call as `POST /api/v1/flights/destination-search` — every CLI flag maps 1:1 to a JSON field.';
|
|
7
7
|
function parseDateRange(raw) {
|
|
@@ -0,0 +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;AAapC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwBhE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
// Shared commander action used by both the canonical `get-booking` command
|
|
3
|
+
// and its deprecated `lookup-booking` alias (JIN-663).
|
|
4
|
+
const action = withClient(async (client, globals, opts) => {
|
|
5
|
+
const response = await client.getBooking({
|
|
6
|
+
booking_ref: opts.ref,
|
|
7
|
+
last_name: opts.lastName,
|
|
8
|
+
});
|
|
9
|
+
output(response, { format: globals.format });
|
|
10
|
+
});
|
|
11
|
+
export function registerGetBookingCommand(program) {
|
|
12
|
+
program
|
|
13
|
+
.command('get-booking')
|
|
14
|
+
.description('Retrieve a booking by Jinko reference + last name (guest access).')
|
|
15
|
+
.requiredOption('--ref <ref>', 'Jinko booking reference (e.g. JNK-A7B3X9)')
|
|
16
|
+
.requiredOption('--last-name <name>', 'Last name of the primary traveler')
|
|
17
|
+
.action(action);
|
|
18
|
+
// Deprecated alias (JIN-663) — hidden from `--help`, emits a one-line
|
|
19
|
+
// deprecation warning to stderr, then runs the same action. Remove once
|
|
20
|
+
// external scripts have migrated to `jinko get-booking`.
|
|
21
|
+
program
|
|
22
|
+
.command('lookup-booking', { hidden: true })
|
|
23
|
+
.description('[DEPRECATED] Alias for `get-booking`. Use `get-booking` instead.')
|
|
24
|
+
.requiredOption('--ref <ref>', 'Jinko booking reference (e.g. JNK-A7B3X9)')
|
|
25
|
+
.requiredOption('--last-name <name>', 'Last name of the primary traveler')
|
|
26
|
+
.action(function deprecatedLookupBookingAction(...args) {
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.error('[DEPRECATED] `jinko lookup-booking` is renamed to `jinko get-booking`. ' +
|
|
29
|
+
'The old name will be removed in a future release.');
|
|
30
|
+
return action.apply(this, args);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=get-booking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-booking.js","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,2EAA2E;AAC3E,uDAAuD;AACvD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACxD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC;QACvC,WAAW,EAAE,IAAI,CAAC,GAAG;QACrB,SAAS,EAAE,IAAI,CAAC,QAAQ;KACzB,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,mEAAmE,CAAC;SAChF,cAAc,CAAC,aAAa,EAAE,2CAA2C,CAAC;SAC1E,cAAc,CAAC,oBAAoB,EAAE,mCAAmC,CAAC;SACzE,MAAM,CAAC,MAAM,CAAC,CAAC;IAElB,sEAAsE;IACtE,wEAAwE;IACxE,yDAAyD;IACzD,OAAO;SACJ,OAAO,CAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SAC3C,WAAW,CAAC,kEAAkE,CAAC;SAC/E,cAAc,CAAC,aAAa,EAAE,2CAA2C,CAAC;SAC1E,cAAc,CAAC,oBAAoB,EAAE,mCAAmC,CAAC;SACzE,MAAM,CAAC,SAAS,6BAA6B,CAAgB,GAAG,IAAe;QAC9E,sCAAsC;QACtC,OAAO,CAAC,KAAK,CACX,yEAAyE;YACvE,mDAAmD,CACtD,CAAC;QACF,OAAQ,MAA6C,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { registerTripStatusCommand } from './commands/trip-status.js';
|
|
|
15
15
|
import { registerSelectAncillariesCommand } from './commands/select-ancillaries.js';
|
|
16
16
|
import { registerRefundCommand } from './commands/refund.js';
|
|
17
17
|
import { registerExchangeCommand } from './commands/exchange.js';
|
|
18
|
-
import {
|
|
18
|
+
import { registerGetBookingCommand } from './commands/get-booking.js';
|
|
19
19
|
import { registerHotelLookupBookingCommand } from './commands/hotel-lookup-booking.js';
|
|
20
20
|
import { registerHotelCancelCommand } from './commands/hotel-cancel.js';
|
|
21
21
|
import { registerAuthCommands } from './commands/auth/index.js';
|
|
@@ -46,7 +46,7 @@ export function createProgram() {
|
|
|
46
46
|
registerSelectAncillariesCommand(program);
|
|
47
47
|
registerTripStatusCommand(program);
|
|
48
48
|
// Post-booking
|
|
49
|
-
|
|
49
|
+
registerGetBookingCommand(program);
|
|
50
50
|
registerHotelLookupBookingCommand(program);
|
|
51
51
|
registerHotelCancelCommand(program);
|
|
52
52
|
registerRefundCommand(program);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAA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,OAAO,CAAC,CAAC;IACxC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACrC,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACvC,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACxC,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACpC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAErC,2BAA2B;IAC3B,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,gCAAgC,CAAC,OAAO,CAAC,CAAC;IAC1C,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEnC,eAAe;IACf,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACnC,iCAAiC,CAAC,OAAO,CAAC,CAAC;IAC3C,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACpC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC/B,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAEjC,mBAAmB;IACnB,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9B,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAChC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAE/B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gojinko/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"jinko": "./dist/bin/jinko.js"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"docs:gen": "tsx scripts/gen-cli-docs.ts"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@gojinko/api-client": "1.2.
|
|
20
|
+
"@gojinko/api-client": "1.2.1",
|
|
21
21
|
"commander": "^12.1.0",
|
|
22
22
|
"chalk": "^5.4.1",
|
|
23
23
|
"open": "^10.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-booking.d.ts","sourceRoot":"","sources":["../../src/commands/lookup-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAenE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { withClient, output } from './shared.js';
|
|
2
|
-
export function registerLookupBookingCommand(program) {
|
|
3
|
-
program
|
|
4
|
-
.command('lookup-booking')
|
|
5
|
-
.description('Look up a booking by Jinko reference + last name (guest access).')
|
|
6
|
-
.requiredOption('--ref <ref>', 'Jinko booking reference (e.g. JNK-A7B3X9)')
|
|
7
|
-
.requiredOption('--last-name <name>', 'Last name of the primary traveler')
|
|
8
|
-
.action(withClient(async (client, globals, opts) => {
|
|
9
|
-
const response = await client.lookupBooking({
|
|
10
|
-
booking_ref: opts.ref,
|
|
11
|
-
last_name: opts.lastName,
|
|
12
|
-
});
|
|
13
|
-
output(response, { format: globals.format });
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=lookup-booking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-booking.js","sourceRoot":"","sources":["../../src/commands/lookup-booking.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,kEAAkE,CAAC;SAC/E,cAAc,CAAC,aAAa,EAAE,2CAA2C,CAAC;SAC1E,cAAc,CAAC,oBAAoB,EAAE,mCAAmC,CAAC;SACzE,MAAM,CACL,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;YAC1C,WAAW,EAAE,IAAI,CAAC,GAAG;YACrB,SAAS,EAAE,IAAI,CAAC,QAAQ;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CACH,CAAC;AACN,CAAC"}
|