@gojinko/cli 0.4.5 → 0.5.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 +54 -86
- package/SKILL.md +49 -153
- package/dist/commands/checkout.d.ts.map +1 -1
- package/dist/commands/checkout.js +4 -8
- package/dist/commands/checkout.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +37 -4
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/trip-status.d.ts +3 -0
- package/dist/commands/trip-status.d.ts.map +1 -0
- package/dist/commands/trip-status.js +14 -0
- package/dist/commands/trip-status.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/commands/book.d.ts +0 -3
- package/dist/commands/book.d.ts.map +0 -1
- package/dist/commands/book.js +0 -14
- package/dist/commands/book.js.map +0 -1
- package/dist/commands/confirm-payment.d.ts +0 -3
- package/dist/commands/confirm-payment.d.ts.map +0 -1
- package/dist/commands/confirm-payment.js +0 -24
- package/dist/commands/confirm-payment.js.map +0 -1
- package/dist/commands/quote.d.ts +0 -3
- package/dist/commands/quote.d.ts.map +0 -1
- package/dist/commands/quote.js +0 -14
- package/dist/commands/quote.js.map +0 -1
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. Search flights, build trips, and hand users off to a Jinko-hosted checkout page.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -10,114 +10,91 @@ npm install -g @gojinko/cli
|
|
|
10
10
|
|
|
11
11
|
## Authentication
|
|
12
12
|
|
|
13
|
-
Two methods — pick one:
|
|
14
|
-
|
|
15
13
|
```bash
|
|
16
|
-
#
|
|
17
|
-
jinko auth login
|
|
18
|
-
|
|
19
|
-
# API key
|
|
20
|
-
jinko auth login --key jnk_YOUR_KEY
|
|
21
|
-
|
|
22
|
-
# Or via environment variable (skips login)
|
|
14
|
+
# API key (recommended for agents, CI/CD)
|
|
23
15
|
export JINKO_API_KEY=jnk_YOUR_KEY
|
|
16
|
+
|
|
17
|
+
# OAuth (interactive humans — opens a browser)
|
|
18
|
+
jinko auth login
|
|
24
19
|
```
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
Create API keys at https://builders.gojinko.com. OAuth tokens auto-refresh.
|
|
27
22
|
|
|
28
23
|
### Auth commands
|
|
29
24
|
|
|
30
25
|
```bash
|
|
31
|
-
jinko auth login
|
|
32
|
-
jinko auth login --key jnk_
|
|
33
|
-
jinko auth status
|
|
34
|
-
jinko auth logout
|
|
26
|
+
jinko auth login # Interactive login
|
|
27
|
+
jinko auth login --key jnk_… # Store an API key
|
|
28
|
+
jinko auth status # Show current method, expiry
|
|
29
|
+
jinko auth logout # Clear stored credentials
|
|
35
30
|
```
|
|
36
31
|
|
|
37
32
|
## Commands
|
|
38
33
|
|
|
39
34
|
### Discovery (cached)
|
|
40
35
|
|
|
41
|
-
| Command |
|
|
42
|
-
|
|
43
|
-
| `find-flight` |
|
|
44
|
-
| `find-destination` |
|
|
45
|
-
| `flight-calendar` |
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `find-flight` | Cheapest flights A → B, returns `offer_token` |
|
|
39
|
+
| `find-destination` | Discover destinations from an origin |
|
|
40
|
+
| `flight-calendar` | Cheapest prices across a date range |
|
|
46
41
|
|
|
47
|
-
###
|
|
42
|
+
### Live search & trip building
|
|
48
43
|
|
|
49
|
-
| Command |
|
|
50
|
-
|
|
51
|
-
| `flight-search` |
|
|
52
|
-
| `trip` |
|
|
44
|
+
| Command | Description |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `flight-search` | Live search or price-check an offer, returns `trip_item_token` |
|
|
47
|
+
| `trip` | Create/update a trip, add items, set travelers |
|
|
53
48
|
|
|
54
|
-
###
|
|
49
|
+
### Checkout
|
|
55
50
|
|
|
56
|
-
| Command |
|
|
57
|
-
|
|
58
|
-
| `
|
|
59
|
-
| `select-ancillaries` |
|
|
60
|
-
| `
|
|
61
|
-
| `confirm-payment` | `book` (confirm) | Verify Stripe payment after checkout |
|
|
62
|
-
| `book` | `book` | Legacy shortcut — quote + checkout in one step |
|
|
51
|
+
| Command | Description |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `checkout` | Schedule checkout, returns `checkout_url` + items + ancillaries + total |
|
|
54
|
+
| `select-ancillaries` | Optional: preselect bags / seats / meals before handoff |
|
|
55
|
+
| `trip-status` | Full lifecycle state: cart, quote, fulfillment, bookings |
|
|
63
56
|
|
|
64
|
-
### Post-
|
|
57
|
+
### Post-booking
|
|
65
58
|
|
|
66
|
-
| Command |
|
|
67
|
-
|
|
68
|
-
| `refund check` |
|
|
69
|
-
| `refund commit` |
|
|
59
|
+
| Command | Description |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `refund check` | Check refund eligibility for a booking |
|
|
62
|
+
| `refund commit` | Initiate a refund for a booking |
|
|
70
63
|
|
|
71
64
|
### Utility
|
|
72
65
|
|
|
73
66
|
| Command | Description |
|
|
74
|
-
|
|
75
|
-
| `config set` |
|
|
76
|
-
| `config show` | Show config |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `config set` / `config show` | Manage local config |
|
|
77
69
|
| `schema [cmd]` | Show request/response schemas |
|
|
78
70
|
|
|
79
|
-
##
|
|
71
|
+
## Canonical Flow
|
|
80
72
|
|
|
81
73
|
```
|
|
82
|
-
find-flight
|
|
83
|
-
flight-search (offer_token) → trip_item_token (live)
|
|
84
|
-
trip (trip_item_token + travelers + contact) → trip_id
|
|
85
|
-
quote (trip_id) → items + ancillary offers
|
|
86
|
-
select-ancillaries (trip_id, item_id, offer_ids) → updated cart
|
|
87
|
-
checkout (trip_id) → checkout_url + session_id
|
|
88
|
-
confirm-payment (trip_id) → booking confirmation
|
|
74
|
+
find-flight → flight-search → trip → checkout → user pays on checkout_url → trip-status
|
|
89
75
|
```
|
|
90
76
|
|
|
77
|
+
Quote is automatic — `checkout` handles it internally. Payment happens on the Jinko web page, not in the CLI.
|
|
78
|
+
|
|
91
79
|
## Examples
|
|
92
80
|
|
|
93
81
|
```bash
|
|
94
|
-
# Find cheapest flights
|
|
82
|
+
# Find cheapest flights
|
|
95
83
|
jinko find-flight --from PAR --to NYC --date 2026-06-15
|
|
96
84
|
|
|
97
|
-
#
|
|
98
|
-
jinko find-destination --from PAR
|
|
99
|
-
|
|
100
|
-
# Price calendar
|
|
101
|
-
jinko flight-calendar --from PAR --to NYC --month 2026-06
|
|
102
|
-
|
|
103
|
-
# Live search (city codes — default)
|
|
104
|
-
jinko flight-search --from PAR --to NYC --date 2026-06-15
|
|
105
|
-
|
|
106
|
-
# Live search (airport codes)
|
|
107
|
-
jinko flight-search --from CDG --origin-type airport --to JFK --destination-type airport --date 2026-06-15
|
|
108
|
-
|
|
109
|
-
# Price-check an offer
|
|
85
|
+
# Live price-check an offer
|
|
110
86
|
jinko flight-search --offer-token <offer_token>
|
|
111
87
|
|
|
112
|
-
#
|
|
113
|
-
jinko trip
|
|
114
|
-
--
|
|
115
|
-
--
|
|
88
|
+
# Create trip with travelers + contact
|
|
89
|
+
jinko trip \
|
|
90
|
+
--trip-item-token <token> \
|
|
91
|
+
--travelers '[{"first_name":"Jane","last_name":"Doe","date_of_birth":"1990-01-15","gender":"FEMALE","passenger_type":"ADULT"}]' \
|
|
92
|
+
--contact '{"email":"jane@example.com","phone":"+33612345678"}'
|
|
116
93
|
|
|
117
|
-
#
|
|
118
|
-
jinko
|
|
94
|
+
# Schedule checkout → returns checkout_url
|
|
95
|
+
jinko checkout --trip-id <trip_id>
|
|
119
96
|
|
|
120
|
-
#
|
|
97
|
+
# Optional: add baggage/seats/meals before handoff
|
|
121
98
|
jinko select-ancillaries \
|
|
122
99
|
--trip-id <trip_id> \
|
|
123
100
|
--item-id <item_id> \
|
|
@@ -125,33 +102,24 @@ jinko select-ancillaries \
|
|
|
125
102
|
--pax <passenger_ref> \
|
|
126
103
|
--quantity 2
|
|
127
104
|
|
|
128
|
-
#
|
|
129
|
-
jinko
|
|
130
|
-
|
|
131
|
-
# Verify payment after checkout
|
|
132
|
-
jinko confirm-payment --trip-id <trip_id> --checkout-session <cs_xxx>
|
|
133
|
-
|
|
134
|
-
# Legacy shortcut (quote + checkout in one step)
|
|
135
|
-
jinko book --trip-id <trip_id>
|
|
105
|
+
# Poll status until fulfilled
|
|
106
|
+
jinko trip-status --trip-id <trip_id>
|
|
136
107
|
|
|
137
|
-
#
|
|
138
|
-
jinko refund check
|
|
139
|
-
|
|
140
|
-
# Initiate a refund
|
|
108
|
+
# Refunds
|
|
109
|
+
jinko refund check --booking-ref <ref> --pnr <pnr>
|
|
141
110
|
jinko refund commit --booking-ref <ref> --pnr <pnr> --reason "schedule change"
|
|
142
111
|
```
|
|
143
112
|
|
|
144
113
|
## Output Formats
|
|
145
114
|
|
|
146
115
|
```bash
|
|
147
|
-
jinko find-flight --from PAR --to NYC --date 2026-06-15
|
|
148
|
-
jinko find-flight --from PAR --to NYC --date 2026-06-15 --format table
|
|
116
|
+
jinko find-flight --from PAR --to NYC --date 2026-06-15
|
|
117
|
+
jinko find-flight --from PAR --to NYC --date 2026-06-15 --format table
|
|
149
118
|
```
|
|
150
119
|
|
|
151
120
|
## Schema Introspection
|
|
152
121
|
|
|
153
122
|
```bash
|
|
154
123
|
jinko schema # List all tools
|
|
155
|
-
jinko schema find-flight # Show request/response
|
|
156
|
-
jinko schema book # Show booking contract
|
|
124
|
+
jinko schema find-flight # Show a tool's request/response schema
|
|
157
125
|
```
|
package/SKILL.md
CHANGED
|
@@ -1,187 +1,83 @@
|
|
|
1
1
|
# Jinko CLI — Agent Skill Guide
|
|
2
2
|
|
|
3
|
-
You are using `jinko`, a CLI for the Jinko developer platform.
|
|
3
|
+
You are using `jinko`, a CLI for the Jinko developer platform. Every trip ends at a Jinko-hosted web checkout page where the user pays — the CLI itself never collects payment.
|
|
4
4
|
|
|
5
5
|
## Authentication
|
|
6
6
|
|
|
7
|
-
### Option 1:
|
|
7
|
+
### Option 1: API Key (recommended for agents and CI/CD)
|
|
8
8
|
|
|
9
|
-
```bash
|
|
10
|
-
jinko auth login
|
|
11
|
-
# Opens a browser-based sign-in flow (WorkOS device authorization)
|
|
12
9
|
```
|
|
13
|
-
|
|
14
|
-
This is a CLI-specific OAuth flow — separate from MCP OAuth. Tokens are stored locally and refreshed automatically.
|
|
15
|
-
|
|
16
|
-
### Option 2: API Key (recommended for agents and CI/CD)
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
jinko auth login --key jnk_YOUR_KEY
|
|
20
|
-
# or
|
|
21
|
-
export JINKO_API_KEY=jnk_YOUR_KEY
|
|
10
|
+
export JINKO_API_KEY=jnk_...
|
|
22
11
|
```
|
|
23
12
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## 11 Tools
|
|
27
|
-
|
|
28
|
-
### Discovery (cached)
|
|
29
|
-
|
|
30
|
-
| CLI Command | Description |
|
|
31
|
-
|-------------|-------------|
|
|
32
|
-
| `find-flight` | Find cheapest flights, returns `offer_token` |
|
|
33
|
-
| `find-destination` | Discover destinations from origins |
|
|
34
|
-
| `flight-calendar` | Cheapest prices across a date range |
|
|
35
|
-
|
|
36
|
-
### Search & Trip (live)
|
|
37
|
-
|
|
38
|
-
| CLI Command | Description |
|
|
39
|
-
|-------------|-------------|
|
|
40
|
-
| `flight-search` | Live search or price-check an offer, returns `trip_item_token` |
|
|
41
|
-
| `trip` | Create trip, add flight, set travelers |
|
|
42
|
-
|
|
43
|
-
### Booking (v2 flow)
|
|
44
|
-
|
|
45
|
-
| CLI Command | Description |
|
|
46
|
-
|-------------|-------------|
|
|
47
|
-
| `quote` | Schedule a quote — returns items with available ancillaries and pricing |
|
|
48
|
-
| `select-ancillaries` | Select baggage, seats, or meals for a trip item |
|
|
49
|
-
| `checkout` | Schedule fulfillment — creates Stripe payment, returns `checkout_url` |
|
|
50
|
-
| `confirm-payment` | Verify Stripe payment after checkout |
|
|
51
|
-
| `book` | Legacy shortcut — quote + checkout in one step |
|
|
52
|
-
|
|
53
|
-
### Post-booking
|
|
54
|
-
|
|
55
|
-
| CLI Command | Description |
|
|
56
|
-
|-------------|-------------|
|
|
57
|
-
| `refund check` | Check refund eligibility and estimated amount |
|
|
58
|
-
| `refund commit` | Initiate a refund for a booked flight |
|
|
13
|
+
Create keys at https://builders.gojinko.com.
|
|
59
14
|
|
|
60
|
-
|
|
15
|
+
### Option 2: OAuth (interactive humans)
|
|
61
16
|
|
|
62
17
|
```
|
|
63
|
-
|
|
64
|
-
flight-search (offer_token) → trip_item_token (live)
|
|
65
|
-
trip (trip_item_token + travelers + contact) → trip_id
|
|
66
|
-
quote (trip_id) → items + ancillary offers
|
|
67
|
-
select-ancillaries (trip_id, item_id, offer_ids) → updated cart
|
|
68
|
-
checkout (trip_id) → checkout_url + session_id
|
|
69
|
-
confirm-payment (trip_id) → booking confirmation
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Core Workflow: Find → Price → Trip → Quote → Book
|
|
73
|
-
|
|
74
|
-
### Step 1: Discover flights
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Find cheapest flights (cached)
|
|
78
|
-
jinko find-flight --from PAR --to NYC --date 2026-04-01
|
|
79
|
-
|
|
80
|
-
# Explore destinations
|
|
81
|
-
jinko find-destination --from PAR --from CDG
|
|
82
|
-
|
|
83
|
-
# Price calendar
|
|
84
|
-
jinko flight-calendar --from PAR --to NYC --month 2026-04
|
|
18
|
+
jinko auth login
|
|
85
19
|
```
|
|
86
20
|
|
|
87
|
-
|
|
21
|
+
Opens a browser for WorkOS device flow login. Token is stored in `~/.jinko/config.yaml`.
|
|
88
22
|
|
|
89
|
-
|
|
23
|
+
## Tools
|
|
90
24
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
25
|
+
### Discovery (cached, cheap)
|
|
26
|
+
- `find-flight` — cheapest flights from A to B
|
|
27
|
+
- `find-destination` — explore destinations from an origin
|
|
28
|
+
- `flight-calendar` — price across a date range
|
|
29
|
+
- `flight-search` — live search or price-check an offer (returns `trip_item_token`)
|
|
94
30
|
|
|
95
|
-
|
|
31
|
+
### Trip building
|
|
32
|
+
- `trip` — create/update a trip (add items, set travelers + contact). Returns `trip_id`.
|
|
96
33
|
|
|
97
|
-
###
|
|
34
|
+
### Checkout
|
|
35
|
+
- `checkout` — schedule checkout for a trip; returns `checkout_url` + items + available ancillaries + total.
|
|
36
|
+
- `select-ancillaries` — (optional) preselect bags/seats/meals before sending the user to `checkout_url`.
|
|
98
37
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
--trip-item-token <trip_item_token> \
|
|
102
|
-
--travelers '[{"first_name":"John","last_name":"Doe","date_of_birth":"1990-01-15","gender":"MALE","passenger_type":"ADULT"}]' \
|
|
103
|
-
--contact '{"email":"john@example.com","phone":"+33612345678"}'
|
|
104
|
-
```
|
|
38
|
+
### Status
|
|
39
|
+
- `trip-status` — full lifecycle state: cart, quote, fulfillment, bookings (PNRs).
|
|
105
40
|
|
|
106
|
-
|
|
41
|
+
### Post-booking
|
|
42
|
+
- `refund check` / `refund commit`
|
|
107
43
|
|
|
108
|
-
###
|
|
44
|
+
### Utility
|
|
45
|
+
- `auth`, `config`, `schema`
|
|
109
46
|
|
|
110
|
-
|
|
111
|
-
# Get quote with available ancillaries
|
|
112
|
-
jinko quote --trip-id <trip_id>
|
|
47
|
+
## Canonical Flow
|
|
113
48
|
|
|
114
|
-
# Optionally add baggage, seats, or meals
|
|
115
|
-
jinko select-ancillaries \
|
|
116
|
-
--trip-id <trip_id> \
|
|
117
|
-
--item-id <item_id> \
|
|
118
|
-
--select <offer_id_1>,<offer_id_2> \
|
|
119
|
-
--pax <passenger_ref> # optional, for per-pax ancillaries
|
|
120
|
-
--quantity 2 # optional, default 1
|
|
121
49
|
```
|
|
50
|
+
1. jinko find-flight --from PAR --to NYC --date 2026-05-01
|
|
51
|
+
→ each result has an offer_token
|
|
122
52
|
|
|
123
|
-
|
|
53
|
+
2. jinko flight-search --offer-token <offer_token>
|
|
54
|
+
→ returns trip_item_token with live pricing
|
|
124
55
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
56
|
+
3. jinko trip \
|
|
57
|
+
--trip-item-token <trip_item_token> \
|
|
58
|
+
--travelers '[{"first_name":"Jane","last_name":"Doe","date_of_birth":"1990-01-15","gender":"FEMALE","passenger_type":"ADULT"}]' \
|
|
59
|
+
--contact '{"email":"jane@example.com","phone":"+33612345678"}'
|
|
60
|
+
→ returns trip_id
|
|
128
61
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
# or
|
|
132
|
-
jinko confirm-payment --trip-id <trip_id> --payment-intent <pi_xxx>
|
|
133
|
-
```
|
|
62
|
+
4. jinko checkout --trip-id <trip_id>
|
|
63
|
+
→ returns { checkout_url, items, available_ancillaries, total_amount }
|
|
134
64
|
|
|
135
|
-
|
|
65
|
+
5. (optional) jinko select-ancillaries --trip-id <id> --item-id <id> --select <offer_ids>
|
|
66
|
+
→ apply bag/seat selections
|
|
136
67
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
# Check if a booking is refundable
|
|
141
|
-
jinko refund check --booking-ref <ref> --pnr <pnr>
|
|
142
|
-
|
|
143
|
-
# Initiate the refund
|
|
144
|
-
jinko refund commit --booking-ref <ref> --pnr <pnr> --reason "schedule change"
|
|
145
|
-
```
|
|
68
|
+
6. Send the user to checkout_url — they complete payment on the Jinko web page.
|
|
146
69
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| User Intent | Command |
|
|
150
|
-
|-------------|---------|
|
|
151
|
-
| "Find flights from Paris to New York" | `find-flight --from PAR --to NYC --date ...` |
|
|
152
|
-
| "Search flights with live pricing" | `flight-search --from PAR --to NYC --date ...` |
|
|
153
|
-
| "Where can I fly from Paris?" | `find-destination --from PAR` |
|
|
154
|
-
| "What's the cheapest day to fly?" | `flight-calendar --from PAR --to NYC --month ...` |
|
|
155
|
-
| "Get exact price for this flight" | `flight-search --offer-token <token>` |
|
|
156
|
-
| "Set up a trip with this flight" | `trip --trip-item-token <token> --travelers ... --contact ...` |
|
|
157
|
-
| "Get a quote with ancillary options" | `quote --trip-id <id>` |
|
|
158
|
-
| "Add extra baggage" | `select-ancillaries --trip-id <id> --item-id <id> --select <ids>` |
|
|
159
|
-
| "Pay for this trip" | `checkout --trip-id <id>` |
|
|
160
|
-
| "Confirm my payment went through" | `confirm-payment --trip-id <id> --checkout-session <cs_id>` |
|
|
161
|
-
| "Book this trip (quick)" | `book --trip-id <id>` |
|
|
162
|
-
| "Can I get a refund?" | `refund check --booking-ref <ref> --pnr <pnr>` |
|
|
163
|
-
| "Refund my booking" | `refund commit --booking-ref <ref> --pnr <pnr>` |
|
|
164
|
-
|
|
165
|
-
## Output Format
|
|
166
|
-
|
|
167
|
-
All commands output JSON by default. Add `--format table` for human display.
|
|
168
|
-
|
|
169
|
-
## Schema Introspection
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
jinko schema # List all tools
|
|
173
|
-
jinko schema find-flight # Show find-flight schema
|
|
174
|
-
jinko schema flight-search # Show flight-search schema
|
|
175
|
-
jinko schema quote # Show quote schema
|
|
176
|
-
jinko schema checkout # Show checkout schema
|
|
70
|
+
7. jinko trip-status --trip-id <trip_id>
|
|
71
|
+
→ poll until status = "fulfilled" (or "partially_fulfilled") to get PNRs.
|
|
177
72
|
```
|
|
178
73
|
|
|
179
74
|
## Important Notes
|
|
180
75
|
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
76
|
+
- Quote is automatic — you never call it explicitly. `checkout` handles it internally.
|
|
77
|
+
- Payment happens on the Jinko web page, not via the CLI.
|
|
78
|
+
- Ancillary selection CAN happen via the CLI before handoff, or on the web page.
|
|
79
|
+
- Airport codes: IATA (PAR, NYC, JFK).
|
|
80
|
+
- Dates: YYYY-MM-DD.
|
|
81
|
+
- Gender: MALE | FEMALE (uppercase).
|
|
82
|
+
- Passenger types: ADULT | CHILD | INFANT.
|
|
83
|
+
- Cabin classes: economy | premium_economy | business | first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAW9D"}
|
|
@@ -2,15 +2,11 @@ import { withClient, output } from './shared.js';
|
|
|
2
2
|
export function registerCheckoutCommand(program) {
|
|
3
3
|
program
|
|
4
4
|
.command('checkout')
|
|
5
|
-
.description('Schedule
|
|
6
|
-
.requiredOption('--trip-id <id>', 'trip ID (
|
|
7
|
-
.option('--idempotency-key <key>', 'idempotency key to prevent duplicates')
|
|
5
|
+
.description('Schedule a checkout for a trip — returns a URL where the user completes payment, plus cart items and available ancillaries.')
|
|
6
|
+
.requiredOption('--trip-id <id>', 'trip ID (from trip command)')
|
|
8
7
|
.action(withClient(async (client, globals, opts) => {
|
|
9
|
-
const response = await client.raw.POST('/api/v1/trips/
|
|
10
|
-
body: {
|
|
11
|
-
trip_id: opts.tripId,
|
|
12
|
-
...(opts.idempotencyKey && { idempotency_key: opts.idempotencyKey }),
|
|
13
|
-
},
|
|
8
|
+
const response = await client.raw.POST('/api/v1/trips/checkout', {
|
|
9
|
+
body: { trip_id: opts.tripId },
|
|
14
10
|
});
|
|
15
11
|
output(response.data, { format: globals.format });
|
|
16
12
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,6HAA6H,CAAC;SAC1I,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,wBAAiC,EAAE;YACxE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;SACtB,CAAC,CAAC;QACZ,MAAM,CAAE,QAA+B,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,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;AAuJpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB5D"}
|
package/dist/commands/schema.js
CHANGED
|
@@ -100,16 +100,49 @@ const SCHEMAS = {
|
|
|
100
100
|
actions_performed: 'string[]',
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
|
-
'
|
|
104
|
-
description: '
|
|
103
|
+
'checkout': {
|
|
104
|
+
description: 'Schedule checkout for a trip — returns checkout_url, items, and available ancillaries (POST /trips/checkout).',
|
|
105
105
|
request: {
|
|
106
106
|
trip_id: 'string (from trip command)',
|
|
107
107
|
},
|
|
108
108
|
response: {
|
|
109
|
-
checkout_url: 'string',
|
|
110
109
|
session_id: 'string',
|
|
111
|
-
|
|
110
|
+
checkout_url: 'string',
|
|
112
111
|
expires_at: 'string? (ISO datetime)',
|
|
112
|
+
status: 'ready | pending | failed',
|
|
113
|
+
total_amount: '{ amount: number, currency: string }?',
|
|
114
|
+
items: '[{ item_id, kind, price, pax_count, available_ancillaries: [...], selected_ancillaries: [...] }]',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
'trip-status': {
|
|
118
|
+
description: 'Full lifecycle state for a trip: cart, quote, fulfillment, bookings (GET /trips/:id).',
|
|
119
|
+
request: {
|
|
120
|
+
trip_id: 'string',
|
|
121
|
+
},
|
|
122
|
+
response: {
|
|
123
|
+
trip_id: 'string',
|
|
124
|
+
status: 'draft | quoting | quoted | fulfillment_prepared | fulfilling | fulfilled | partially_fulfilled | failed | cancelled',
|
|
125
|
+
travelers: '[...]',
|
|
126
|
+
contact: '{ email?, phone? }?',
|
|
127
|
+
items: '[{ item_id, kind, price, pax_count, available_ancillaries, selected_ancillaries }]',
|
|
128
|
+
total_amount: '{ amount, currency }?',
|
|
129
|
+
quote: '{ quoted_cart_id, status, expires_at? }?',
|
|
130
|
+
fulfillment: '{ fulfillment_cart_id, status, phase?, scheduled_at? }?',
|
|
131
|
+
bookings: '[{ item_id, kind, booking_reference, pnr?, provider_status? }]?',
|
|
132
|
+
created_at: 'string (ISO)',
|
|
133
|
+
updated_at: 'string (ISO)',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
'select-ancillaries': {
|
|
137
|
+
description: 'Select bags / seats / meals for a trip item (POST /trips/ancillaries).',
|
|
138
|
+
request: {
|
|
139
|
+
trip_id: 'string',
|
|
140
|
+
item_id: 'string',
|
|
141
|
+
selections: '[{ offer_id, pax_ref_id?, quantity? }]',
|
|
142
|
+
},
|
|
143
|
+
response: {
|
|
144
|
+
trip_id: 'string',
|
|
145
|
+
items: '[...]',
|
|
113
146
|
},
|
|
114
147
|
},
|
|
115
148
|
};
|
|
@@ -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;;GAEG;AACH,MAAM,OAAO,GAAiH;IAC5H,aAAa,EAAE;QACb,WAAW,EAAE,gEAAgE;QAC7E,OAAO,EAAE;YACP,UAAU,EAAE,iDAAiD;YAC7D,OAAO,EAAE;gBACP,SAAS,EAAE,+CAA+C;gBAC1D,KAAK,EAAE,mGAAmG;gBAC1G,SAAS,EAAE,oBAAoB;gBAC/B,WAAW,EAAE,8CAA8C;gBAC3D,WAAW,EAAE,UAAU;aACxB;YACD,IAAI,EAAE,yBAAyB;YAC/B,KAAK,EAAE,sBAAsB;YAC7B,iBAAiB,EAAE,yBAAyB;SAC7C;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,8EAA8E;YAC3F,WAAW,EAAE,oCAAoC;YACjD,UAAU,EAAE,qBAAqB;SAClC;KACF;IACD,kBAAkB,EAAE;QAClB,WAAW,EAAE,gFAAgF;QAC7F,OAAO,EAAE;YACP,UAAU,EAAE,iBAAiB;YAC7B,OAAO,EAAE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OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC5D,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC,CAAC,CAAC;YACJ,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YACzC,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,CAAC,oBAAoB,WAAW,gBAAgB,SAAS,EAAE,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trip-status.d.ts","sourceRoot":"","sources":["../../src/commands/trip-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAWhE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { withClient, output } from './shared.js';
|
|
2
|
+
export function registerTripStatusCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('trip-status')
|
|
5
|
+
.description('Get full status of a trip: cart, quote, fulfillment, bookings.')
|
|
6
|
+
.requiredOption('--trip-id <id>', 'trip ID')
|
|
7
|
+
.action(withClient(async (client, globals, opts) => {
|
|
8
|
+
const response = await client.raw.GET('/api/v1/trips/{id}', {
|
|
9
|
+
params: { path: { id: opts.tripId } },
|
|
10
|
+
});
|
|
11
|
+
output(response.data, { format: globals.format });
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=trip-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trip-status.js","sourceRoot":"","sources":["../../src/commands/trip-status.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,gEAAgE,CAAC;SAC7E,cAAc,CAAC,gBAAgB,EAAE,SAAS,CAAC;SAC3C,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,oBAA6B,EAAE;YACnE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE;SAC7B,CAAC,CAAC;QACZ,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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,wBAAgB,aAAa,IAAI,OAAO,CA+BvC"}
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
1
4
|
import { Command } from 'commander';
|
|
2
5
|
import { registerFindFlightCommand } from './commands/find-flight.js';
|
|
3
6
|
import { registerFindDestinationCommand } from './commands/find-destination.js';
|
|
4
7
|
import { registerFlightSearchCommand } from './commands/flight-search.js';
|
|
5
8
|
import { registerFlightCalendarCommand } from './commands/flight-calendar.js';
|
|
6
9
|
import { registerTripCommand } from './commands/trip.js';
|
|
7
|
-
import { registerBookCommand } from './commands/book.js';
|
|
8
|
-
import { registerQuoteCommand } from './commands/quote.js';
|
|
9
10
|
import { registerCheckoutCommand } from './commands/checkout.js';
|
|
11
|
+
import { registerTripStatusCommand } from './commands/trip-status.js';
|
|
10
12
|
import { registerSelectAncillariesCommand } from './commands/select-ancillaries.js';
|
|
11
|
-
import { registerConfirmPaymentCommand } from './commands/confirm-payment.js';
|
|
12
13
|
import { registerRefundCommand } from './commands/refund.js';
|
|
13
14
|
import { registerAuthCommands } from './commands/auth/index.js';
|
|
14
15
|
import { registerSchemaCommand } from './commands/schema.js';
|
|
15
16
|
import { registerConfigCommands } from './commands/config/index.js';
|
|
17
|
+
// Read version dynamically from package.json so it never drifts.
|
|
18
|
+
// Compiled file lives at dist/index.js; package.json is one level up.
|
|
19
|
+
const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf-8'));
|
|
16
20
|
export function createProgram() {
|
|
17
21
|
const program = new Command();
|
|
18
22
|
program
|
|
19
23
|
.name('jinko')
|
|
20
24
|
.description('Jinko CLI — search flights, manage trips, and book travel from the terminal.')
|
|
21
|
-
.version(
|
|
25
|
+
.version(pkg.version)
|
|
22
26
|
.option('--format <format>', 'output format: json (default) or table', 'json')
|
|
23
27
|
.option('--api-key <key>', 'API key (jnk_...) — overrides env/config');
|
|
24
|
-
//
|
|
28
|
+
// Discovery
|
|
25
29
|
registerFindFlightCommand(program);
|
|
26
30
|
registerFindDestinationCommand(program);
|
|
27
31
|
registerFlightSearchCommand(program);
|
|
28
32
|
registerFlightCalendarCommand(program);
|
|
33
|
+
// Trip building + checkout
|
|
29
34
|
registerTripCommand(program);
|
|
30
|
-
registerBookCommand(program);
|
|
31
|
-
// V2: quote, checkout, ancillaries, payment, refunds
|
|
32
|
-
registerQuoteCommand(program);
|
|
33
35
|
registerCheckoutCommand(program);
|
|
34
36
|
registerSelectAncillariesCommand(program);
|
|
35
|
-
|
|
37
|
+
registerTripStatusCommand(program);
|
|
38
|
+
// Post-booking
|
|
36
39
|
registerRefundCommand(program);
|
|
37
40
|
// Utility commands
|
|
38
41
|
registerAuthCommands(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,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,
|
|
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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AC,OAAO,CAAC,CAAC;IACxC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACrC,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAEvC,2BAA2B;IAC3B,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjC,gCAAgC,CAAC,OAAO,CAAC,CAAC;IAC1C,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEnC,eAAe;IACf,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAE/B,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": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"jinko": "./dist/bin/jinko.js"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lint": "tsc --noEmit"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@gojinko/api-client": "
|
|
19
|
+
"@gojinko/api-client": "0.5.0",
|
|
20
20
|
"commander": "^12.1.0",
|
|
21
21
|
"chalk": "^5.4.1",
|
|
22
22
|
"open": "^10.0.0",
|
package/dist/commands/book.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/commands/book.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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/trips/checkout', {
|
|
9
|
-
body: { trip_id: opts.tripId },
|
|
10
|
-
});
|
|
11
|
-
output(response.data, { format: globals.format });
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=book.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,wBAAiC,EAAE;YACxE,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-payment.d.ts","sourceRoot":"","sources":["../../src/commands/confirm-payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuBpE"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { withClient, output } from './shared.js';
|
|
2
|
-
export function registerConfirmPaymentCommand(program) {
|
|
3
|
-
program
|
|
4
|
-
.command('confirm-payment')
|
|
5
|
-
.description('Confirm a Stripe payment after checkout.')
|
|
6
|
-
.requiredOption('--trip-id <id>', 'trip ID')
|
|
7
|
-
.option('--checkout-session <id>', 'Stripe checkout session ID')
|
|
8
|
-
.option('--payment-intent <id>', 'Stripe payment intent ID')
|
|
9
|
-
.action(withClient(async (client, globals, opts) => {
|
|
10
|
-
if (!opts.checkoutSession && !opts.paymentIntent) {
|
|
11
|
-
console.error('Error: either --checkout-session or --payment-intent is required');
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
14
|
-
const response = await client.raw.POST('/api/v1/trips/confirm-payment', {
|
|
15
|
-
body: {
|
|
16
|
-
trip_id: opts.tripId,
|
|
17
|
-
...(opts.checkoutSession && { checkout_session_id: opts.checkoutSession }),
|
|
18
|
-
...(opts.paymentIntent && { payment_intent_id: opts.paymentIntent }),
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
output(response.data, { format: globals.format });
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=confirm-payment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-payment.js","sourceRoot":"","sources":["../../src/commands/confirm-payment.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,0CAA0C,CAAC;SACvD,cAAc,CAAC,gBAAgB,EAAE,SAAS,CAAC;SAC3C,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC;SAC/D,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;SAC3D,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACjD,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAClF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,+BAAwC,EAAE;YAC/E,IAAI,EAAE;gBACJ,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,GAAG,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;gBAC1E,GAAG,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;aACrE;SACO,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/commands/quote.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/commands/quote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAY3D"}
|
package/dist/commands/quote.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { withClient, output } from './shared.js';
|
|
2
|
-
export function registerQuoteCommand(program) {
|
|
3
|
-
program
|
|
4
|
-
.command('quote')
|
|
5
|
-
.description('Schedule a quote for a trip — returns items with available ancillaries and pricing.')
|
|
6
|
-
.requiredOption('--trip-id <id>', 'trip ID (from trip command). Trip must have items and travelers.')
|
|
7
|
-
.action(withClient(async (client, globals, opts) => {
|
|
8
|
-
const response = await client.raw.POST('/api/v1/trips/checkout', {
|
|
9
|
-
body: { trip_id: opts.tripId },
|
|
10
|
-
});
|
|
11
|
-
output(response.data, { format: globals.format });
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=quote.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../src/commands/quote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qFAAqF,CAAC;SAClG,cAAc,CAAC,gBAAgB,EAAE,kEAAkE,CAAC;SACpG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAiC,EAAE;YACxE,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"}
|