@gojinko/cli 0.1.6 → 0.2.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/README.md +46 -65
- package/SKILL.md +54 -66
- package/dist/commands/book.d.ts +3 -0
- package/dist/commands/book.d.ts.map +1 -0
- package/dist/commands/book.js +14 -0
- package/dist/commands/book.js.map +1 -0
- package/dist/commands/find-destination.d.ts +3 -0
- package/dist/commands/find-destination.d.ts.map +1 -0
- package/dist/commands/find-destination.js +53 -0
- package/dist/commands/find-destination.js.map +1 -0
- package/dist/commands/find-flight.d.ts +3 -0
- package/dist/commands/find-flight.d.ts.map +1 -0
- package/dist/commands/find-flight.js +43 -0
- package/dist/commands/find-flight.js.map +1 -0
- package/dist/commands/flight-calendar.d.ts +3 -0
- package/dist/commands/flight-calendar.d.ts.map +1 -0
- package/dist/commands/flight-calendar.js +48 -0
- package/dist/commands/flight-calendar.js.map +1 -0
- package/dist/commands/flight-search.d.ts +3 -0
- package/dist/commands/flight-search.d.ts.map +1 -0
- package/dist/commands/flight-search.js +58 -0
- package/dist/commands/flight-search.js.map +1 -0
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +46 -51
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/trip.d.ts +3 -0
- package/dist/commands/trip.d.ts.map +1 -0
- package/dist/commands/trip.js +45 -0
- package/dist/commands/trip.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @gojinko/cli
|
|
2
2
|
|
|
3
|
-
Command-line tool for the Jinko developer platform.
|
|
3
|
+
Command-line tool for the Jinko developer platform. 6 commands matching MCP tools 1:1.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -11,98 +11,79 @@ npm install -g @gojinko/cli
|
|
|
11
11
|
## Authentication
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
# Configure via CLI
|
|
15
14
|
jinko auth login --key jnk_YOUR_KEY
|
|
16
|
-
|
|
17
|
-
# Or environment variable
|
|
15
|
+
# or
|
|
18
16
|
export JINKO_API_KEY=jnk_YOUR_KEY
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
## Quick Start
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
# Find cheapest flights (cached)
|
|
25
|
-
jinko flights find --from PAR --to NYC --date 2026-04-15
|
|
26
|
-
|
|
27
|
-
# Live flight search
|
|
28
|
-
jinko flights search --from PAR --to NYC --date 2026-04-15
|
|
29
|
-
|
|
30
|
-
# Explore destinations
|
|
31
|
-
jinko flights destinations --from PAR
|
|
32
|
-
|
|
33
|
-
# Price-check a specific offer (live pricing)
|
|
34
|
-
jinko flights search --offer-token <offer_token>
|
|
35
|
-
|
|
36
|
-
# One-shot booking → returns checkout URL
|
|
37
|
-
jinko book \
|
|
38
|
-
--trip-item-token <token> \
|
|
39
|
-
--travelers '[{"first_name":"John","last_name":"Doe","date_of_birth":"1990-01-15","gender":"MALE","passenger_type":"ADULT"}]' \
|
|
40
|
-
--contact '{"email":"john@example.com","phone":"+33612345678"}'
|
|
41
|
-
```
|
|
42
|
-
|
|
43
19
|
## Commands
|
|
44
20
|
|
|
45
|
-
|
|
21
|
+
| Command | MCP Tool | Mode | Description |
|
|
22
|
+
|---------|----------|------|-------------|
|
|
23
|
+
| `find-flight` | `find_flight` | Cached | Find cheapest flights, returns offer_token |
|
|
24
|
+
| `find-destination` | `find_destination` | Cached | Discover destinations from origins |
|
|
25
|
+
| `flight-calendar` | `flight_calendar` | Cached | Cheapest prices across a date range |
|
|
26
|
+
| `flight-search` | `flight_search` | Live | Live search or price-check an offer |
|
|
27
|
+
| `trip` | `trip` | Live | Create trip, add flight, set travelers |
|
|
28
|
+
| `book` | `book` | Live | Checkout a trip, returns checkout_url |
|
|
29
|
+
|
|
30
|
+
### Utility
|
|
46
31
|
|
|
47
32
|
| Command | Description |
|
|
48
33
|
|---------|-------------|
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
34
|
+
| `auth login` | Configure API key |
|
|
35
|
+
| `auth status` | Show auth status |
|
|
36
|
+
| `config set` | Set a config value |
|
|
37
|
+
| `config show` | Show config |
|
|
38
|
+
| `schema [cmd]` | Show request/response schemas |
|
|
52
39
|
|
|
53
|
-
|
|
40
|
+
## Token Flow
|
|
54
41
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
```
|
|
43
|
+
find-flight (filters) → offer_token (cached)
|
|
44
|
+
flight-search (offer_token) → trip_item_token (live)
|
|
45
|
+
trip (trip_item_token + travelers + contact) → trip_id
|
|
46
|
+
book (trip_id) → checkout_url
|
|
47
|
+
```
|
|
58
48
|
|
|
59
|
-
|
|
49
|
+
## Examples
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| `trip show` | Show trip details |
|
|
65
|
-
| `trip add-flight` | Add a flight to a trip |
|
|
66
|
-
| `trip travelers` | Set travelers on a trip |
|
|
51
|
+
```bash
|
|
52
|
+
# Find cheapest flights (cached)
|
|
53
|
+
jinko find-flight --from PAR --to NYC --date 2026-06-15
|
|
67
54
|
|
|
68
|
-
|
|
55
|
+
# Discover destinations
|
|
56
|
+
jinko find-destination --from PAR
|
|
69
57
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
| `book` | One-shot or existing trip checkout → returns checkout URL |
|
|
58
|
+
# Price calendar
|
|
59
|
+
jinko flight-calendar --from PAR --to NYC --month 2026-06
|
|
73
60
|
|
|
74
|
-
|
|
61
|
+
# Live search
|
|
62
|
+
jinko flight-search --from PAR --to NYC --date 2026-06-15
|
|
75
63
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
| `auth login` | Configure API key or OAuth token |
|
|
79
|
-
| `auth status` | Show current auth status |
|
|
80
|
-
| `config set` | Set a config value |
|
|
81
|
-
| `config show` | Show current config |
|
|
82
|
-
| `schema [cmd]` | Show request/response schemas |
|
|
64
|
+
# Price-check an offer
|
|
65
|
+
jinko flight-search --offer-token <offer_token>
|
|
83
66
|
|
|
84
|
-
|
|
67
|
+
# One-shot trip: create + add flight + set travelers
|
|
68
|
+
jinko trip --trip-item-token <token> \
|
|
69
|
+
--travelers '[{"first_name":"John","last_name":"Doe","date_of_birth":"1990-01-15","gender":"MALE","passenger_type":"ADULT"}]' \
|
|
70
|
+
--contact '{"email":"john@example.com","phone":"+33612345678"}'
|
|
85
71
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
flights search (offer_token) → trip_item_token (live pricing)
|
|
89
|
-
book (trip_item_token + travelers + contact) → checkout_url
|
|
72
|
+
# Checkout
|
|
73
|
+
jinko book --trip-id <trip_id>
|
|
90
74
|
```
|
|
91
75
|
|
|
92
76
|
## Output Formats
|
|
93
77
|
|
|
94
78
|
```bash
|
|
95
|
-
# JSON (default
|
|
96
|
-
jinko
|
|
97
|
-
|
|
98
|
-
# Table (human-readable)
|
|
99
|
-
jinko flights search --from PAR --to NYC --date 2026-04-15 --format table
|
|
79
|
+
jinko find-flight --from PAR --to NYC --date 2026-06-15 # JSON (default)
|
|
80
|
+
jinko find-flight --from PAR --to NYC --date 2026-06-15 --format table # Table
|
|
100
81
|
```
|
|
101
82
|
|
|
102
83
|
## Schema Introspection
|
|
103
84
|
|
|
104
85
|
```bash
|
|
105
|
-
jinko schema # List all
|
|
106
|
-
jinko schema
|
|
86
|
+
jinko schema # List all tools
|
|
87
|
+
jinko schema find-flight # Show request/response shapes
|
|
107
88
|
jinko schema book # Show booking contract
|
|
108
89
|
```
|
package/SKILL.md
CHANGED
|
@@ -1,121 +1,109 @@
|
|
|
1
1
|
# Jinko CLI — Agent Skill Guide
|
|
2
2
|
|
|
3
|
-
You are using `jinko`, a CLI for
|
|
3
|
+
You are using `jinko`, a CLI for the Jinko developer platform. Commands match MCP tools 1:1.
|
|
4
4
|
|
|
5
5
|
## Authentication
|
|
6
6
|
|
|
7
|
-
Before any command, configure your API key:
|
|
8
|
-
|
|
9
7
|
```bash
|
|
10
8
|
jinko auth login --key jnk_YOUR_KEY
|
|
11
9
|
# or
|
|
12
10
|
export JINKO_API_KEY=jnk_YOUR_KEY
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## 6 Tools
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
| CLI Command | MCP Tool | Mode | Description |
|
|
16
|
+
|-------------|----------|------|-------------|
|
|
17
|
+
| `find-flight` | `find_flight` | Cached | Find cheapest flights, returns offer_token |
|
|
18
|
+
| `find-destination` | `find_destination` | Cached | Discover destinations from origins |
|
|
19
|
+
| `flight-calendar` | `flight_calendar` | Cached | Cheapest prices across a date range |
|
|
20
|
+
| `flight-search` | `flight_search` | Live | Live search or price-check an offer |
|
|
21
|
+
| `trip` | `trip` | Live | Create trip, add flight, set travelers |
|
|
22
|
+
| `book` | `book` | Live | Checkout a trip, returns checkout_url |
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
## Token Flow
|
|
20
25
|
|
|
21
|
-
**Find cheapest flights (cached):**
|
|
22
|
-
```bash
|
|
23
|
-
jinko flights find --from PAR --to NYC --date 2026-04-01
|
|
24
26
|
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
find-flight (filters) → offer_token (cached)
|
|
28
|
+
flight-search (offer_token) → trip_item_token (live)
|
|
29
|
+
trip (trip_item_token + travelers + contact) → trip_id
|
|
30
|
+
book (trip_id) → checkout_url
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
## Core Workflow: Find → Price → Trip → Book
|
|
34
|
+
|
|
35
|
+
### Step 1: Discover flights
|
|
36
|
+
|
|
32
37
|
```bash
|
|
33
|
-
|
|
38
|
+
# Find cheapest flights (cached)
|
|
39
|
+
jinko find-flight --from PAR --to NYC --date 2026-04-01
|
|
40
|
+
|
|
41
|
+
# Explore destinations
|
|
42
|
+
jinko find-destination --from PAR --from CDG
|
|
43
|
+
|
|
44
|
+
# Price calendar
|
|
45
|
+
jinko flight-calendar --from PAR --to NYC --month 2026-04
|
|
34
46
|
```
|
|
35
47
|
|
|
36
|
-
All
|
|
48
|
+
All return `offer_token` per flight.
|
|
37
49
|
|
|
38
|
-
### Step 2:
|
|
50
|
+
### Step 2: Live pricing
|
|
39
51
|
|
|
40
52
|
```bash
|
|
41
|
-
jinko
|
|
53
|
+
jinko flight-search --offer-token <offer_token>
|
|
42
54
|
```
|
|
43
55
|
|
|
44
|
-
Returns fare options with `trip_item_token
|
|
56
|
+
Returns fare options with `trip_item_token`.
|
|
45
57
|
|
|
46
|
-
### Step 3:
|
|
58
|
+
### Step 3: Create trip with travelers
|
|
47
59
|
|
|
48
|
-
**One-shot booking (recommended):**
|
|
49
60
|
```bash
|
|
50
|
-
jinko
|
|
61
|
+
jinko trip \
|
|
51
62
|
--trip-item-token <trip_item_token> \
|
|
52
63
|
--travelers '[{"first_name":"John","last_name":"Doe","date_of_birth":"1990-01-15","gender":"MALE","passenger_type":"ADULT"}]' \
|
|
53
64
|
--contact '{"email":"john@example.com","phone":"+33612345678"}'
|
|
54
65
|
```
|
|
55
66
|
|
|
56
|
-
Returns `
|
|
67
|
+
Returns `trip_id`.
|
|
68
|
+
|
|
69
|
+
### Step 4: Book
|
|
57
70
|
|
|
58
|
-
**Step-by-step booking (advanced):**
|
|
59
71
|
```bash
|
|
60
|
-
jinko trip create
|
|
61
|
-
jinko trip add-flight --trip-item-token <token> --trip-id <trip_id>
|
|
62
|
-
jinko trip travelers --trip-id <trip_id> --travelers '[...]' --contact '{...}'
|
|
63
72
|
jinko book --trip-id <trip_id>
|
|
64
73
|
```
|
|
65
74
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
flights find (filters) → offer_token (per flight) [cached]
|
|
70
|
-
flights search (offer_token) → trip_item_token (per fare) [live]
|
|
71
|
-
book (trip_item_token + travelers + contact) → checkout_url
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## API Endpoints
|
|
75
|
-
|
|
76
|
-
All calls use `/api/v1/devplatform/` prefix.
|
|
77
|
-
|
|
78
|
-
| Endpoint | Type | Used by |
|
|
79
|
-
|----------|------|---------|
|
|
80
|
-
| `POST /flights/search` | Cached | `flights find`, `flights calendar` |
|
|
81
|
-
| `POST /flights/destination-search` | Cached | `flights destinations` |
|
|
82
|
-
| `POST /flights/shop` | Live | `flights search` |
|
|
83
|
-
| `POST /trips` | Live | `trip create/show/add-flight/travelers`, `book` |
|
|
84
|
-
| `POST /trips/checkout` | Live | `book` |
|
|
75
|
+
Returns `checkout_url` — user opens in browser to complete payment.
|
|
85
76
|
|
|
86
77
|
## Tool Selection Guide
|
|
87
78
|
|
|
88
79
|
| User Intent | Command |
|
|
89
80
|
|-------------|---------|
|
|
90
|
-
| "Find flights from Paris to New York" | `
|
|
91
|
-
| "Search flights with live pricing" | `
|
|
92
|
-
| "Where can I fly from Paris?" | `
|
|
93
|
-
| "What's the cheapest day to fly?" | `
|
|
94
|
-
| "Get exact price for this flight" | `
|
|
95
|
-
| "
|
|
81
|
+
| "Find flights from Paris to New York" | `find-flight --from PAR --to NYC --date ...` |
|
|
82
|
+
| "Search flights with live pricing" | `flight-search --from PAR --to NYC --date ...` |
|
|
83
|
+
| "Where can I fly from Paris?" | `find-destination --from PAR` |
|
|
84
|
+
| "What's the cheapest day to fly?" | `flight-calendar --from PAR --to NYC --month ...` |
|
|
85
|
+
| "Get exact price for this flight" | `flight-search --offer-token <token>` |
|
|
86
|
+
| "Set up a trip with this flight" | `trip --trip-item-token <token> --travelers ... --contact ...` |
|
|
87
|
+
| "Book this trip" | `book --trip-id <id>` |
|
|
96
88
|
|
|
97
89
|
## Output Format
|
|
98
90
|
|
|
99
|
-
All commands output JSON by default
|
|
91
|
+
All commands output JSON by default. Add `--format table` for human display.
|
|
100
92
|
|
|
101
93
|
## Schema Introspection
|
|
102
94
|
|
|
103
|
-
To see the exact request/response shape for any command:
|
|
104
|
-
|
|
105
95
|
```bash
|
|
106
|
-
jinko schema # List all
|
|
107
|
-
jinko schema
|
|
108
|
-
jinko schema
|
|
96
|
+
jinko schema # List all tools
|
|
97
|
+
jinko schema find-flight # Show find-flight schema
|
|
98
|
+
jinko schema flight-search # Show flight-search schema
|
|
109
99
|
jinko schema book # Show booking schema
|
|
110
100
|
```
|
|
111
101
|
|
|
112
102
|
## Important Notes
|
|
113
103
|
|
|
114
|
-
- **Airport codes**:
|
|
115
|
-
- **Dates**:
|
|
116
|
-
- **Gender**: `MALE` or `FEMALE` (uppercase)
|
|
117
|
-
- **Passenger types**: `ADULT`, `CHILD`, `INFANT
|
|
118
|
-
- **Cabin classes**: `economy`, `premium_economy`, `business`, `first
|
|
119
|
-
- **
|
|
120
|
-
- **Checkout URL**: Opens the Jinko checkout page. User completes payment there.
|
|
121
|
-
- **Cached vs Live**: `flights find`, `destinations`, `calendar` use cached data (fast, cheap). `flights search` uses live pricing (slower, accurate). Use cached for discovery, live for final pricing.
|
|
104
|
+
- **Airport codes**: IATA codes (PAR, NYC, JFK, CDG)
|
|
105
|
+
- **Dates**: YYYY-MM-DD format
|
|
106
|
+
- **Gender**: `MALE` or `FEMALE` (uppercase)
|
|
107
|
+
- **Passenger types**: `ADULT`, `CHILD`, `INFANT`
|
|
108
|
+
- **Cabin classes**: `economy`, `premium_economy`, `business`, `first`
|
|
109
|
+
- **Cached vs Live**: `find-*` and `flight-calendar` use cached data (fast). `flight-search` uses live pricing (slower, accurate).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../src/commands/book.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAY1D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerBookCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('book')
|
|
5
|
+
.description('Checkout a trip — returns checkout_url + session_id.')
|
|
6
|
+
.requiredOption('--trip-id <id>', 'trip ID (from trip command)')
|
|
7
|
+
.action(withClient(async (client, globals, opts) => {
|
|
8
|
+
const response = await client.raw.POST('/api/v1/devplatform/trips/checkout', {
|
|
9
|
+
body: { trip_id: opts.tripId },
|
|
10
|
+
});
|
|
11
|
+
output(response.data, { format: globals.format });
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=book.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"book.js","sourceRoot":"","sources":["../../src/commands/book.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,sDAAsD,CAAC;SACnE,cAAc,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;SAC/D,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,oCAA6C,EAAE;YACpF,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;SACtB,CAAC,CAAC;QAEZ,MAAM,CAAE,QAA+B,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-destination.d.ts","sourceRoot":"","sources":["../../src/commands/find-destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsDrE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerFindDestinationCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('find-destination')
|
|
5
|
+
.description('Discover destinations from one or more origins.')
|
|
6
|
+
.requiredOption('--from <origins...>', 'origin airport code(s) (e.g. PAR or PAR CDG)')
|
|
7
|
+
.option('--date <date>', 'departure date (YYYY-MM-DD)')
|
|
8
|
+
.option('--return <date>', 'return date (YYYY-MM-DD)')
|
|
9
|
+
.option('--direct-only', 'only direct flights')
|
|
10
|
+
.option('--cabin <class>', 'cabin class', 'economy')
|
|
11
|
+
.option('--max-price <amount>', 'maximum price filter')
|
|
12
|
+
.option('--sort <sort>', 'sort: lowest, recommendation', 'lowest')
|
|
13
|
+
.option('--limit <n>', 'max destinations', '20')
|
|
14
|
+
.action(withClient(async (client, globals, opts) => {
|
|
15
|
+
const origins = Array.isArray(opts.from) ? opts.from : [opts.from];
|
|
16
|
+
const body = {
|
|
17
|
+
passengers: { adt: 1 },
|
|
18
|
+
filters: {
|
|
19
|
+
locations: {
|
|
20
|
+
origins,
|
|
21
|
+
},
|
|
22
|
+
trip_type: opts.return ? 'roundtrip' : 'oneway',
|
|
23
|
+
},
|
|
24
|
+
flights_per_destination: 1,
|
|
25
|
+
sort: opts.sort,
|
|
26
|
+
limit: Number(opts.limit) || 20,
|
|
27
|
+
};
|
|
28
|
+
// BFF requires dates — use provided date or default to next 12 months.
|
|
29
|
+
if (opts.date) {
|
|
30
|
+
body['filters']['dates'] = {
|
|
31
|
+
departure_dates: [opts.date],
|
|
32
|
+
...(opts.return ? { return_dates: [opts.return] } : {}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const today = new Date();
|
|
37
|
+
const start = today.toISOString().slice(0, 10);
|
|
38
|
+
const end = new Date(today.getFullYear() + 1, today.getMonth(), today.getDate())
|
|
39
|
+
.toISOString().slice(0, 10);
|
|
40
|
+
body['filters']['dates'] = {
|
|
41
|
+
departure_date_ranges: [{ start, end }],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (opts.maxPrice) {
|
|
45
|
+
body['price_constraints'] = { max_total: Number(opts.maxPrice) };
|
|
46
|
+
}
|
|
47
|
+
const response = await client.raw.POST('/api/v1/devplatform/flights/destination-search', {
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
output(response.data, { format: globals.format });
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=find-destination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-destination.js","sourceRoot":"","sources":["../../src/commands/find-destination.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,8BAA8B,CAAC,OAAgB;IAC7D,OAAO;SACJ,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,iDAAiD,CAAC;SAC9D,cAAc,CAAC,qBAAqB,EAAE,8CAA8C,CAAC;SACrF,MAAM,CAAC,eAAe,EAAE,6BAA6B,CAAC;SACtD,MAAM,CAAC,iBAAiB,EAAE,0BAA0B,CAAC;SACrD,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC;SAC9C,MAAM,CAAC,iBAAiB,EAAE,aAAa,EAAE,SAAS,CAAC;SACnD,MAAM,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;SACtD,MAAM,CAAC,eAAe,EAAE,8BAA8B,EAAE,QAAQ,CAAC;SACjE,MAAM,CAAC,aAAa,EAAE,kBAAkB,EAAE,IAAI,CAAC;SAC/C,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,OAAO,GAAG,KAAK,C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AAC,GAAG;gBACtD,qBAAqB,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;aACxC,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnE,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,gDAAyD,EAAE;YAChG,IAAI;SACI,CAAC,CAAC;QAEZ,MAAM,CAAE,QAA+B,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-flight.d.ts","sourceRoot":"","sources":["../../src/commands/find-flight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2ChE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerFindFlightCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('find-flight')
|
|
5
|
+
.description('Find cheapest flights from cached data. Returns offer_tokens for live pricing.')
|
|
6
|
+
.requiredOption('--from <origin>', 'origin airport code (e.g. PAR)')
|
|
7
|
+
.requiredOption('--to <destination>', 'destination airport code (e.g. NYC)')
|
|
8
|
+
.requiredOption('--date <date>', 'departure date (YYYY-MM-DD)')
|
|
9
|
+
.option('--return <date>', 'return date for round-trip (YYYY-MM-DD)')
|
|
10
|
+
.option('--cabin <class>', 'cabin class: economy, premium_economy, business, first', 'economy')
|
|
11
|
+
.option('--direct-only', 'only show direct flights')
|
|
12
|
+
.option('--max-price <amount>', 'maximum price filter')
|
|
13
|
+
.option('--sort <sort>', 'sort: lowest, recommendation', 'lowest')
|
|
14
|
+
.option('--limit <n>', 'max results', '10')
|
|
15
|
+
.action(withClient(async (client, globals, opts) => {
|
|
16
|
+
const body = {
|
|
17
|
+
passengers: { adt: 1 },
|
|
18
|
+
filters: {
|
|
19
|
+
locations: {
|
|
20
|
+
origins: [opts.from],
|
|
21
|
+
destinations: [opts.to],
|
|
22
|
+
},
|
|
23
|
+
dates: {
|
|
24
|
+
departure_dates: [opts.date],
|
|
25
|
+
...(opts.return ? { return_dates: [opts.return] } : {}),
|
|
26
|
+
},
|
|
27
|
+
trip_type: opts.return ? 'roundtrip' : 'oneway',
|
|
28
|
+
cabin_class: opts.cabin,
|
|
29
|
+
direct_only: opts.directOnly ?? false,
|
|
30
|
+
},
|
|
31
|
+
sort: opts.sort,
|
|
32
|
+
limit: Number(opts.limit) || 10,
|
|
33
|
+
};
|
|
34
|
+
if (opts.maxPrice) {
|
|
35
|
+
body['price_constraints'] = { max_total: Number(opts.maxPrice) };
|
|
36
|
+
}
|
|
37
|
+
const response = await client.raw.POST('/api/v1/devplatform/flights/search', {
|
|
38
|
+
body,
|
|
39
|
+
});
|
|
40
|
+
output(response.data, { format: globals.format });
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=find-flight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-flight.js","sourceRoot":"","sources":["../../src/commands/find-flight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,gFAAgF,CAAC;SAC7F,cAAc,CAAC,iBAAiB,EAAE,gCAAgC,CAAC;SACnE,cAAc,CAAC,oBAAoB,EAAE,qCAAqC,CAAC;SAC3E,cAAc,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AAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnE,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,oCAA6C,EAAE;YACpF,IAAI;SACI,CAAC,CAAC;QAEZ,MAAM,CAAE,QAA+B,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight-calendar.d.ts","sourceRoot":"","sources":["../../src/commands/flight-calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmDpE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerFlightCalendarCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('flight-calendar')
|
|
5
|
+
.description('Show cheapest prices across a date range for a route.')
|
|
6
|
+
.requiredOption('--from <origin>', 'origin airport code')
|
|
7
|
+
.requiredOption('--to <destination>', 'destination airport code')
|
|
8
|
+
.option('--month <month>', 'month to display (YYYY-MM), defaults to current month')
|
|
9
|
+
.option('--cabin <class>', 'cabin class', 'economy')
|
|
10
|
+
.option('--direct-only', 'only direct flights')
|
|
11
|
+
.action(withClient(async (client, globals, opts) => {
|
|
12
|
+
const month = opts.month ?? new Date().toISOString().slice(0, 7);
|
|
13
|
+
const [year, mon] = month.split('-').map(Number);
|
|
14
|
+
if (!year || !mon) {
|
|
15
|
+
console.error('Error: --month must be in YYYY-MM format.');
|
|
16
|
+
process.exit(3);
|
|
17
|
+
}
|
|
18
|
+
const startDate = `${month}-01`;
|
|
19
|
+
const lastDay = new Date(year, mon, 0).getDate();
|
|
20
|
+
const endDate = `${month}-${String(lastDay).padStart(2, '0')}`;
|
|
21
|
+
const body = {
|
|
22
|
+
passengers: { adt: 1 },
|
|
23
|
+
filters: {
|
|
24
|
+
locations: {
|
|
25
|
+
origins: [opts.from],
|
|
26
|
+
destinations: [opts.to],
|
|
27
|
+
},
|
|
28
|
+
dates: {
|
|
29
|
+
departure_date_ranges: [{ start: startDate, end: endDate }],
|
|
30
|
+
},
|
|
31
|
+
trip_type: 'oneway',
|
|
32
|
+
cabin_class: opts.cabin,
|
|
33
|
+
direct_only: opts.directOnly ?? false,
|
|
34
|
+
},
|
|
35
|
+
sort: 'lowest',
|
|
36
|
+
};
|
|
37
|
+
const response = await client.raw.POST('/api/v1/devplatform/flights/search', {
|
|
38
|
+
body,
|
|
39
|
+
});
|
|
40
|
+
const data = response.data;
|
|
41
|
+
if (globals.format === 'table') {
|
|
42
|
+
console.log(`\nFlight calendar: ${opts.from} → ${opts.to} (${month})`);
|
|
43
|
+
console.log(`Date range: ${startDate} to ${endDate}\n`);
|
|
44
|
+
}
|
|
45
|
+
output(data, { format: globals.format });
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=flight-calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight-calendar.js","sourceRoot":"","sources":["../../src/commands/flight-calendar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,6BAA6B,CAAC,OAAgB;IAC5D,OAAO;SACJ,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,uDAAuD,CAAC;SACpE,cAAc,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;SACxD,cAAc,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;SAChE,MAAM,CAAC,iBAAiB,EAAE,uDAAuD,CAAC;SAClF,MAAM,CAAC,iBAAiB,EAAE,aAAa,EAAE,SAAS,CAAC;SACn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CAAC,UAAU,IAAI,KAAK;aACtC;YACD,IAAI,EAAE,QAAQ;SACf,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,oCAA6C,EAAE;YACpF,IAAI;SACI,CAAC,CAAC;QAEZ,MAAM,IAAI,GAAI,QAA+B,CAAC,IAAI,CAAC;QAEnD,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,KAAK,KAAK,GAAG,CAAC,CAAC;YACvE,OAAO,CAAC,GAAG,CAAC,eAAe,SAAS,OAAO,OAAO,IAAI,CAAC,CAAC;QAC1D,CAAC;QAED,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight-search.d.ts","sourceRoot":"","sources":["../../src/commands/flight-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0DlE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerFlightSearchCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('flight-search')
|
|
5
|
+
.description('Live flight search or price-check a specific offer.')
|
|
6
|
+
.option('--from <origin>', 'origin airport code (e.g. PAR)')
|
|
7
|
+
.option('--to <destination>', 'destination airport code (e.g. NYC)')
|
|
8
|
+
.option('--date <date>', 'departure date (YYYY-MM-DD)')
|
|
9
|
+
.option('--return <date>', 'return date for round-trip (YYYY-MM-DD)')
|
|
10
|
+
.option('--passengers <n>', 'number of passengers', '1')
|
|
11
|
+
.option('--cabin <class>', 'cabin class: economy, premium_economy, business, first', 'economy')
|
|
12
|
+
.option('--direct-only', 'only show direct flights')
|
|
13
|
+
.option('--max-price <amount>', 'maximum price filter')
|
|
14
|
+
.option('--offer-token <token>', 'price-check a specific offer (live pricing)')
|
|
15
|
+
.action(withClient(async (client, globals, opts) => {
|
|
16
|
+
const isOfferCheck = Boolean(opts.offerToken);
|
|
17
|
+
if (isOfferCheck) {
|
|
18
|
+
// Price-check mode
|
|
19
|
+
const response = await client.raw.POST('/api/v1/devplatform/flights/shop', {
|
|
20
|
+
body: {
|
|
21
|
+
offer_token: opts.offerToken,
|
|
22
|
+
passengers: {
|
|
23
|
+
adults: Number(opts.passengers) || 1,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
output(response.data, { format: globals.format });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// Search mode
|
|
31
|
+
if (!opts.from || !opts.to || !opts.date) {
|
|
32
|
+
console.error('Error: --from, --to, and --date are required for search mode.');
|
|
33
|
+
console.error(' Or provide --offer-token for price-check mode.');
|
|
34
|
+
process.exit(3);
|
|
35
|
+
}
|
|
36
|
+
const body = {
|
|
37
|
+
origin: opts.from,
|
|
38
|
+
destination: opts.to,
|
|
39
|
+
departure_date: opts.date,
|
|
40
|
+
trip_type: opts.return ? 'roundtrip' : 'oneway',
|
|
41
|
+
cabin_class: opts.cabin,
|
|
42
|
+
direct_only: opts.directOnly ?? false,
|
|
43
|
+
passengers: {
|
|
44
|
+
adults: Number(opts.passengers) || 1,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
if (opts.return)
|
|
48
|
+
body['return_date'] = opts.return;
|
|
49
|
+
if (opts.maxPrice)
|
|
50
|
+
body['max_price'] = Number(opts.maxPrice);
|
|
51
|
+
const response = await client.raw.POST('/api/v1/devplatform/flights/shop', {
|
|
52
|
+
body,
|
|
53
|
+
});
|
|
54
|
+
output(response.data, { format: globals.format });
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=flight-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight-search.js","sourceRoot":"","sources":["../../src/commands/flight-search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,2BAA2B,CAAC,OAAgB;IAC1D,OAAO;SACJ,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,qDAAqD,CAAC;SAClE,MAAM,CAAC,iBAAiB,EAAE,gCAAgC,CAAC;SAC3D,MAAM,CAAC,oBAAoB,EAAE,qCAAqC,CAAC;SACnE,MAAM,CAAC,eAAe,EAAE,6BAA6B,CAAC;SACtD,MAAM,CAAC,iBAAiB,EAAE,yCAAyC,CAAC;SACpE,MAAM,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,GAAG,CAAC;SACvD,MAAM,CAAC,iBAAiB,EAAE,wDAAwD,EAAE,SAAS,CAAC;SAC9F,MAAM,CAAC,eAAe,EAAE,0BAA0B,CAAC;SACnD,MAAM,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;SACtD,MAAM,CAAC,uBAAuB,EAAE,6CAA6C,CAAC;SAC9E,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE9C,IAAI,YAAY,EAAE,CAAC;YACjB,mBAAmB;YACnB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,kCAA2C,EAAE;gBAClF,IAAI,EAAE;oBACJ,WAAW,EAAE,IAAI,CAAC,UAAU;oBAC5B,UAAU,EAAE;wBACV,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;qBACrC;iBACF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AAM,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsHpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB5D"}
|
package/dist/commands/schema.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { output } from './shared.js';
|
|
2
2
|
import { getGlobalOptions } from '../config/config.js';
|
|
3
3
|
/**
|
|
4
|
-
* Schema definitions for CLI commands.
|
|
5
|
-
* request/response shapes for agent consumption.
|
|
4
|
+
* Schema definitions for CLI commands. Names match MCP tools 1:1.
|
|
6
5
|
*/
|
|
7
6
|
const SCHEMAS = {
|
|
8
|
-
'
|
|
7
|
+
'find-flight': {
|
|
9
8
|
description: 'Find cheapest flights from cached data (POST /flights/search).',
|
|
10
9
|
request: {
|
|
11
10
|
passengers: '{ adt: number, chd?: number, inf_lap?: number }',
|
|
@@ -26,7 +25,27 @@ const SCHEMAS = {
|
|
|
26
25
|
pagination: '{ next_page_token }',
|
|
27
26
|
},
|
|
28
27
|
},
|
|
29
|
-
'
|
|
28
|
+
'find-destination': {
|
|
29
|
+
description: 'Discover destinations from origin airports (POST /flights/destination-search).',
|
|
30
|
+
request: {
|
|
31
|
+
passengers: '{ adt: number }',
|
|
32
|
+
filters: {
|
|
33
|
+
locations: '{ origins: string[] }',
|
|
34
|
+
dates: '{ departure_dates?: string[], return_dates?: string[] }?',
|
|
35
|
+
trip_type: 'oneway | roundtrip',
|
|
36
|
+
},
|
|
37
|
+
flights_per_destination: 'number? (default 1)',
|
|
38
|
+
limit: 'number? (default 20)',
|
|
39
|
+
price_constraints: '{ max_total?: number }?',
|
|
40
|
+
},
|
|
41
|
+
response: {
|
|
42
|
+
origin: '{ city_code, city_name, country_code }',
|
|
43
|
+
destinations: '[{ iata_code, city_name, lowest_fare_flight, flights }]',
|
|
44
|
+
pagination: '{ next_page_token }',
|
|
45
|
+
total: 'number',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
'flight-search': {
|
|
30
49
|
description: 'Live flight search or price-check a specific offer (POST /flights/shop).',
|
|
31
50
|
request: {
|
|
32
51
|
mode_a_search: {
|
|
@@ -41,7 +60,7 @@ const SCHEMAS = {
|
|
|
41
60
|
passengers: '{ adults?: number, children?: number, infants?: number }',
|
|
42
61
|
},
|
|
43
62
|
mode_b_price_check: {
|
|
44
|
-
offer_token: 'string (from find results)',
|
|
63
|
+
offer_token: 'string (from find-flight results)',
|
|
45
64
|
passengers: '{ adults?: number, children?: number, infants?: number }',
|
|
46
65
|
},
|
|
47
66
|
},
|
|
@@ -51,32 +70,12 @@ const SCHEMAS = {
|
|
|
51
70
|
fares: '(price_check only) [{ trip_item_token, brand_name, cabin_class, total_price, is_refundable, ... }]',
|
|
52
71
|
},
|
|
53
72
|
},
|
|
54
|
-
'
|
|
55
|
-
description: '
|
|
56
|
-
request: {
|
|
57
|
-
passengers: '{ adt: number }',
|
|
58
|
-
filters: {
|
|
59
|
-
locations: '{ origins: string[] }',
|
|
60
|
-
dates: '{ departure_dates?: string[], return_dates?: string[] }?',
|
|
61
|
-
trip_type: 'oneway | roundtrip',
|
|
62
|
-
},
|
|
63
|
-
flights_per_destination: 'number? (default 1)',
|
|
64
|
-
limit: 'number? (default 20)',
|
|
65
|
-
price_constraints: '{ max_total?: number }?',
|
|
66
|
-
},
|
|
67
|
-
response: {
|
|
68
|
-
origin: '{ city_code, city_name, country_code }',
|
|
69
|
-
destinations: '[{ iata_code, city_name, lowest_fare_flight, flights }]',
|
|
70
|
-
pagination: '{ next_page_token }',
|
|
71
|
-
total: 'number',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
'flights.calendar': {
|
|
75
|
-
description: 'Browse prices across a date range (uses /flights/search with date range).',
|
|
73
|
+
'flight-calendar': {
|
|
74
|
+
description: 'Cheapest prices across a date range (POST /flights/search with date range).',
|
|
76
75
|
request: {
|
|
77
76
|
from: 'string (IATA code, origin)',
|
|
78
77
|
to: 'string (IATA code, destination)',
|
|
79
|
-
month: 'string (YYYY-MM
|
|
78
|
+
month: 'string (YYYY-MM)',
|
|
80
79
|
cabin_class: 'string? (default economy)',
|
|
81
80
|
direct_only: 'boolean?',
|
|
82
81
|
},
|
|
@@ -84,38 +83,35 @@ const SCHEMAS = {
|
|
|
84
83
|
itineraries: '[{ id, slices, total_amount, ... }]',
|
|
85
84
|
},
|
|
86
85
|
},
|
|
87
|
-
'
|
|
88
|
-
description: '
|
|
86
|
+
'trip': {
|
|
87
|
+
description: 'Manage a trip: create, add flight, set travelers (POST /trips).',
|
|
89
88
|
request: {
|
|
90
|
-
trip_id: 'string? (
|
|
91
|
-
trip_item_token:
|
|
92
|
-
travelers:
|
|
93
|
-
contact: '{ email: string, phone?: string }',
|
|
94
|
-
},
|
|
95
|
-
response: {
|
|
96
|
-
checkout_url: 'string (https://app.gojinko.com/checkout?sid=XXX)',
|
|
97
|
-
session_id: 'string',
|
|
98
|
-
status: 'ready | pending | failed',
|
|
99
|
-
expires_at: 'string? (ISO datetime)',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
'trip.travelers': {
|
|
103
|
-
description: 'Set travelers on a trip (POST /trips with upsert_travelers).',
|
|
104
|
-
request: {
|
|
105
|
-
trip_id: 'string',
|
|
106
|
-
upsert_travelers: {
|
|
107
|
-
travelers: '[{ first_name, last_name, date_of_birth, gender, passenger_type, ... }]',
|
|
108
|
-
contact: '{ email: string, phone?: string }?',
|
|
109
|
-
},
|
|
89
|
+
trip_id: 'string? (omit to create new)',
|
|
90
|
+
add_item: '{ trip_item_token: string }? (from flight-search)',
|
|
91
|
+
upsert_travelers: '{ travelers: [{ first_name, last_name, date_of_birth, gender, passenger_type, ... }], contact?: { email, phone? } }?',
|
|
110
92
|
},
|
|
111
93
|
response: {
|
|
112
94
|
trip_id: 'string',
|
|
113
95
|
status: 'string',
|
|
96
|
+
items: '[{ item_id, type, description, price, currency }]',
|
|
114
97
|
travelers: '[...]',
|
|
115
98
|
contact: '{ email, phone }',
|
|
99
|
+
totals: '{ total, currency }',
|
|
116
100
|
actions_performed: 'string[]',
|
|
117
101
|
},
|
|
118
102
|
},
|
|
103
|
+
'book': {
|
|
104
|
+
description: 'Checkout a trip — returns checkout_url + session_id (POST /trips/checkout).',
|
|
105
|
+
request: {
|
|
106
|
+
trip_id: 'string (from trip command)',
|
|
107
|
+
},
|
|
108
|
+
response: {
|
|
109
|
+
checkout_url: 'string',
|
|
110
|
+
session_id: 'string',
|
|
111
|
+
status: 'ready | pending | failed',
|
|
112
|
+
expires_at: 'string? (ISO datetime)',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
119
115
|
};
|
|
120
116
|
export function registerSchemaCommand(program) {
|
|
121
117
|
program
|
|
@@ -124,7 +120,6 @@ export function registerSchemaCommand(program) {
|
|
|
124
120
|
.action((commandName, _opts, cmd) => {
|
|
125
121
|
const globals = getGlobalOptions(cmd);
|
|
126
122
|
if (!commandName) {
|
|
127
|
-
// List all available schemas.
|
|
128
123
|
const list = Object.entries(SCHEMAS).map(([name, schema]) => ({
|
|
129
124
|
command: name,
|
|
130
125
|
description: schema.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src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,OAAO,EAAE,OAAO,GAAG,IAAI,CAgD1D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerTripCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('trip')
|
|
5
|
+
.description('Manage a trip: create, add flight, set travelers. All actions in one command.')
|
|
6
|
+
.option('--trip-id <id>', 'existing trip ID (omit to create new)')
|
|
7
|
+
.option('--trip-item-token <token>', 'add a flight item (from flight-search)')
|
|
8
|
+
.option('--travelers <json>', 'travelers JSON array')
|
|
9
|
+
.option('--contact <json>', 'contact JSON {email, phone}')
|
|
10
|
+
.action(withClient(async (client, globals, opts) => {
|
|
11
|
+
const body = {};
|
|
12
|
+
if (opts.tripId) {
|
|
13
|
+
body['trip_id'] = opts.tripId;
|
|
14
|
+
}
|
|
15
|
+
if (opts.tripItemToken) {
|
|
16
|
+
body['add_item'] = { trip_item_token: opts.tripItemToken };
|
|
17
|
+
}
|
|
18
|
+
if (opts.travelers) {
|
|
19
|
+
let travelers;
|
|
20
|
+
try {
|
|
21
|
+
travelers = JSON.parse(opts.travelers);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
console.error('Error: --travelers must be valid JSON array.');
|
|
25
|
+
process.exit(3);
|
|
26
|
+
}
|
|
27
|
+
const upsertTravelers = { travelers };
|
|
28
|
+
if (opts.contact) {
|
|
29
|
+
try {
|
|
30
|
+
upsertTravelers['contact'] = JSON.parse(opts.contact);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
console.error('Error: --contact must be valid JSON object.');
|
|
34
|
+
process.exit(3);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
body['upsert_travelers'] = upsertTravelers;
|
|
38
|
+
}
|
|
39
|
+
const response = await client.raw.POST('/api/v1/devplatform/trips', {
|
|
40
|
+
body,
|
|
41
|
+
});
|
|
42
|
+
output(response.data, { format: globals.format });
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
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CAAC,OAAO,EAAE,CAAC;gBACjB,IAAI,CAAC;oBACH,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACxD,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;oBAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC;YAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,eAAe,CAAC;QAC7C,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,2BAAoC,EAAE;YAC3E,IAAI;SACI,CAAC,CAAC;QAEZ,MAAM,CAAE,QAA+B,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,aAAa,IAAI,OAAO,CAwBvC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { registerFindFlightCommand } from './commands/find-flight.js';
|
|
3
|
+
import { registerFindDestinationCommand } from './commands/find-destination.js';
|
|
4
|
+
import { registerFlightSearchCommand } from './commands/flight-search.js';
|
|
5
|
+
import { registerFlightCalendarCommand } from './commands/flight-calendar.js';
|
|
6
|
+
import { registerTripCommand } from './commands/trip.js';
|
|
7
|
+
import { registerBookCommand } from './commands/book.js';
|
|
5
8
|
import { registerAuthCommands } from './commands/auth/index.js';
|
|
6
9
|
import { registerSchemaCommand } from './commands/schema.js';
|
|
7
10
|
import { registerConfigCommands } from './commands/config/index.js';
|
|
@@ -10,12 +13,17 @@ export function createProgram() {
|
|
|
10
13
|
program
|
|
11
14
|
.name('jinko')
|
|
12
15
|
.description('Jinko CLI — search flights, manage trips, and book travel from the terminal.')
|
|
13
|
-
.version('0.
|
|
16
|
+
.version('0.2.0')
|
|
14
17
|
.option('--format <format>', 'output format: json (default) or table', 'json')
|
|
15
18
|
.option('--api-key <key>', 'API key (jnk_...) — overrides env/config');
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
// 6 tools matching MCP 1:1
|
|
20
|
+
registerFindFlightCommand(program);
|
|
21
|
+
registerFindDestinationCommand(program);
|
|
22
|
+
registerFlightSearchCommand(program);
|
|
23
|
+
registerFlightCalendarCommand(program);
|
|
24
|
+
registerTripCommand(program);
|
|
18
25
|
registerBookCommand(program);
|
|
26
|
+
// Utility commands
|
|
19
27
|
registerAuthCommands(program);
|
|
20
28
|
registerConfigCommands(program);
|
|
21
29
|
registerSchemaCommand(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,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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,MAAM,6BAA6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"./dist/bin/jinko.js"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"chalk": "^5.4.1",
|
|
13
13
|
"zod": "^3.23.8",
|
|
14
14
|
"yaml": "^2.7.0",
|
|
15
|
-
"@gojinko/api-client": "0.
|
|
15
|
+
"@gojinko/api-client": "0.2.0"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|