@gojinko/cli 0.4.5 → 1.0.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gojinko/cli
2
2
 
3
- Command-line tool for the Jinko developer platform. 11 commands matching MCP tools 1:1.
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
- # OAuth (recommended) opens browser, no API key needed
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
- OAuth tokens refresh automatically. API keys don't expire but can be revoked from the dashboard.
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 # Interactive — choose OAuth or API key
32
- jinko auth login --key jnk_... # Direct API key
33
- jinko auth status # Show current method, token, expiry
34
- jinko auth logout # Clear stored credentials
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 | MCP Tool | Description |
42
- |---------|----------|-------------|
43
- | `find-flight` | `find_flight` | Find cheapest flights, returns offer_token |
44
- | `find-destination` | `find_destination` | Discover destinations from origins |
45
- | `flight-calendar` | `flight_calendar` | Cheapest prices across a date range |
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
- ### Search & Trip (live)
42
+ ### Live search & trip building
48
43
 
49
- | Command | MCP Tool | Description |
50
- |---------|----------|-------------|
51
- | `flight-search` | `flight_search` | Live search or price-check an offer, returns trip_item_token |
52
- | `trip` | `trip` | Create trip, add flight, set travelers |
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
- ### Booking — Cart V2 (live)
49
+ ### Checkout
55
50
 
56
- | Command | MCP Tool | Description |
57
- |---------|----------|-------------|
58
- | `quote` | `book` (quote) | Schedule a quote returns items with available ancillaries and pricing |
59
- | `select-ancillaries` | `trip` (ancillaries) | Select baggage, seats, or meals for a trip item |
60
- | `checkout` | `book` (fulfillment) | Schedule fulfillment — creates Stripe payment, returns checkout_url |
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-Booking (live)
57
+ ### Post-booking
65
58
 
66
- | Command | MCP Tool | Description |
67
- |---------|----------|-------------|
68
- | `refund check` | — | Check refund eligibility and estimated amount |
69
- | `refund commit` | — | Initiate a refund for a booked flight |
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` | Set a config value |
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
- ## Token Flow (Cart V2)
71
+ ## Canonical Flow
80
72
 
81
73
  ```
82
- find-flight (filters) offer_token (cached)
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 (cached)
82
+ # Find cheapest flights
95
83
  jinko find-flight --from PAR --to NYC --date 2026-06-15
96
84
 
97
- # Discover destinations
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
- # One-shot trip: create + add flight + set travelers
113
- jinko trip --trip-item-token <token> \
114
- --travelers '[{"first_name":"John","last_name":"Doe","date_of_birth":"1990-01-15","gender":"MALE","passenger_type":"ADULT"}]' \
115
- --contact '{"email":"john@example.com","phone":"+33612345678"}'
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
- # Get quote with available ancillaries
118
- jinko quote --trip-id <trip_id>
94
+ # Schedule checkout returns checkout_url
95
+ jinko checkout --trip-id <trip_id>
119
96
 
120
- # Optionally add baggage, seats, or meals
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
- # Create Stripe payment session
129
- jinko checkout --trip-id <trip_id>
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
- # Check refund eligibility
138
- jinko refund check --booking-ref <ref> --pnr <pnr>
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 # JSON (default)
148
- jinko find-flight --from PAR --to NYC --date 2026-06-15 --format table # 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 shapes
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. Commands match MCP tools 1:1.
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: OAuth (recommended for interactive use)
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
- > **Note:** CLI OAuth tokens cannot be reused as Bearer tokens on the MCP endpoint (`https://mcp.builders.gojinko.com/mcp`). For programmatic MCP access, use an API key (`jnk_*`).
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
- ## Token Flow
15
+ ### Option 2: OAuth (interactive humans)
61
16
 
62
17
  ```
63
- find-flight (filters) → offer_token (cached)
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
- All return `offer_token` per flight.
21
+ Opens a browser for WorkOS device flow login. Token is stored in `~/.jinko/config.yaml`.
88
22
 
89
- ### Step 2: Live pricing
23
+ ## Tools
90
24
 
91
- ```bash
92
- jinko flight-search --offer-token <offer_token>
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
- Returns fare options with `trip_item_token`.
31
+ ### Trip building
32
+ - `trip` — create/update a trip (add items, set travelers + contact). Returns `trip_id`.
96
33
 
97
- ### Step 3: Create trip with travelers
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
- ```bash
100
- jinko trip \
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
- Returns `trip_id`.
41
+ ### Post-booking
42
+ - `refund check` / `refund commit`
107
43
 
108
- ### Step 4: Quote and ancillaries
44
+ ### Utility
45
+ - `auth`, `config`, `schema`
109
46
 
110
- ```bash
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
- ### Step 5: Checkout and payment
53
+ 2. jinko flight-search --offer-token <offer_token>
54
+ → returns trip_item_token with live pricing
124
55
 
125
- ```bash
126
- # Create Stripe payment session
127
- jinko checkout --trip-id <trip_id>
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
- # User completes payment in browser at checkout_url, then:
130
- jinko confirm-payment --trip-id <trip_id> --checkout-session <cs_xxx>
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
- > **Legacy shortcut**: `jinko book --trip-id <trip_id>` combines quote + checkout in one step (skips ancillary selection).
65
+ 5. (optional) jinko select-ancillaries --trip-id <id> --item-id <id> --select <offer_ids>
66
+ → apply bag/seat selections
136
67
 
137
- ### Post-booking: Refunds
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
- ## Tool Selection Guide
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
- - **Airport codes**: IATA codes (PAR, NYC, JFK, CDG)
182
- - **Dates**: YYYY-MM-DD format
183
- - **Gender**: `MALE` or `FEMALE` (uppercase)
184
- - **Passenger types**: `ADULT`, `CHILD`, `INFANT`
185
- - **Cabin classes**: `economy`, `premium_economy`, `business`, `first`
186
- - **Cached vs Live**: `find-*` and `flight-calendar` use cached data (fast). `flight-search` uses live pricing (slower, accurate).
187
- - **v2 flow**: Use `quote` `select-ancillaries` → `checkout` → `confirm-payment` for full control. Use `book` as a one-step shortcut when ancillaries aren't needed.
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,3 +1,3 @@
1
1
  import { Command } from 'commander';
2
- export declare function registerCheckoutCommand(program: Command): void;
2
+ export declare function registerBookCommand(program: Command): void;
3
3
  //# sourceMappingURL=checkout.d.ts.map
@@ -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,CAgB9D"}
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,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAW1D"}
@@ -1,16 +1,12 @@
1
1
  import { withClient, output } from './shared.js';
2
- export function registerCheckoutCommand(program) {
2
+ export function registerBookCommand(program) {
3
3
  program
4
- .command('checkout')
5
- .description('Schedule fulfillmentcreates Stripe payment and returns checkout URL.')
6
- .requiredOption('--trip-id <id>', 'trip ID (must have a completed quote)')
7
- .option('--idempotency-key <key>', 'idempotency key to prevent duplicates')
4
+ .command('book')
5
+ .description('Book a trip schedules checkout and returns a Stripe payment URL, 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/fulfillment', {
10
- body: {
11
- trip_id: opts.tripId,
12
- ...(opts.idempotencyKey && { idempotency_key: opts.idempotencyKey }),
13
- },
8
+ const response = await client.raw.POST('/api/v1/shop/sync/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,yEAAyE,CAAC;SACtF,cAAc,CAAC,gBAAgB,EAAE,uCAAuC,CAAC;SACzE,MAAM,CAAC,yBAAyB,EAAE,uCAAuC,CAAC;SAC1E,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,2BAAoC,EAAE;YAC3E,IAAI,EAAE;gBACJ,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,eAAe,EAAE,IAAI,CAAC,cAAc,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"}
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,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,+GAA+G,CAAC;SAC5H,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,4BAAqC,EAAE;YAC5E,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;AAsHpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB5D"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwJpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB5D"}
@@ -84,10 +84,11 @@ const SCHEMAS = {
84
84
  },
85
85
  },
86
86
  'trip': {
87
- description: 'Manage a trip: create, add flight, set travelers (POST /trips).',
87
+ description: 'Manage a trip: create, add/remove flight items, set travelers (POST /shop/sync).',
88
88
  request: {
89
89
  trip_id: 'string? (omit to create new)',
90
90
  add_item: '{ trip_item_token: string }? (from flight-search)',
91
+ remove_item: '{ item_id: string }? (item_id from prior trip response items[].item_id; requires trip_id; can be combined with add_item to swap in one call)',
91
92
  upsert_travelers: '{ travelers: [{ first_name, last_name, date_of_birth, gender, passenger_type, ... }], contact?: { email, phone? } }?',
92
93
  },
93
94
  response: {
@@ -101,15 +102,48 @@ const SCHEMAS = {
101
102
  },
102
103
  },
103
104
  'book': {
104
- description: 'Checkout a trip — returns checkout_url + session_id (POST /trips/checkout).',
105
+ description: 'Book a trip — schedules checkout and returns a Stripe payment URL, plus cart items and available ancillaries (POST /shop/sync/checkout).',
105
106
  request: {
106
107
  trip_id: 'string (from trip command)',
107
108
  },
108
109
  response: {
109
- checkout_url: 'string',
110
110
  session_id: 'string',
111
- status: 'ready | pending | failed',
111
+ checkout_url: 'string',
112
112
  expires_at: 'string? (ISO datetime)',
113
+ status: 'ready | pending | failed',
114
+ total_amount: '{ amount: number, currency: string }?',
115
+ items: '[{ item_id, kind, price, pax_count, available_ancillaries: [...], selected_ancillaries: [...] }]',
116
+ },
117
+ },
118
+ 'trip-status': {
119
+ description: 'Full lifecycle state for a trip: cart, quote, fulfillment, bookings (GET /shop/sync/:id).',
120
+ request: {
121
+ trip_id: 'string',
122
+ },
123
+ response: {
124
+ trip_id: 'string',
125
+ status: 'draft | quoting | quoted | fulfillment_prepared | fulfilling | fulfilled | partially_fulfilled | failed | cancelled',
126
+ travelers: '[...]',
127
+ contact: '{ email?, phone? }?',
128
+ items: '[{ item_id, kind, price, pax_count, available_ancillaries, selected_ancillaries }]',
129
+ total_amount: '{ amount, currency }?',
130
+ quote: '{ quoted_cart_id, status, expires_at? }?',
131
+ fulfillment: '{ fulfillment_cart_id, status, phase?, scheduled_at? }?',
132
+ bookings: '[{ item_id, kind, booking_reference, pnr?, provider_status? }]?',
133
+ created_at: 'string (ISO)',
134
+ updated_at: 'string (ISO)',
135
+ },
136
+ },
137
+ 'select-ancillaries': {
138
+ description: 'Select bags / seats / meals for a trip item (POST /shop/sync/ancillaries).',
139
+ request: {
140
+ trip_id: 'string',
141
+ item_id: 'string',
142
+ selections: '[{ offer_id, pax_ref_id?, quantity? }]',
143
+ },
144
+ response: {
145
+ trip_id: 'string',
146
+ items: '[...]',
113
147
  },
114
148
  },
115
149
  };
@@ -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;gBACP,SAAS,EAAE,uBAAuB;gBAClC,KAAK,EAAE,0DAA0D;gBACjE,SAAS,EAAE,oBAAoB;aAChC;YACD,uBAAuB,EAAE,qBAAqB;YAC9C,KAAK,EAAE,sBAAsB;YAC7B,iBAAiB,EAAE,yBAAyB;SAC7C;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,wCAAwC;YAChD,YAAY,EAAE,y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;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"}
@@ -20,7 +20,7 @@ export function registerSelectAncillariesCommand(program) {
20
20
  ...(opts.pax && { pax_ref_id: opts.pax }),
21
21
  ...(parsedQuantity !== 1 && { quantity: parsedQuantity }),
22
22
  }));
23
- const response = await client.raw.POST('/api/v1/trips/ancillaries', {
23
+ const response = await client.raw.POST('/api/v1/shop/sync/ancillaries', {
24
24
  body: {
25
25
  trip_id: opts.tripId,
26
26
  item_id: opts.itemId,
@@ -1 +1 @@
1
- {"version":3,"file":"select-ancillaries.js","sourceRoot":"","sources":["../../src/commands/select-ancillaries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,gCAAgC,CAAC,OAAgB;IAC/D,OAAO;SACJ,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,6DAA6D,CAAC;SAC1E,cAAc,CAAC,gBAAgB,EAAE,S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CAAC,CAAC;QAEJ,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,+BAAwC,EAAE;YAC/E,IAAI,EAAE;gBACJ,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,UAAU;aACX;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"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerTripStatusCommand(program: Command): void;
3
+ //# sourceMappingURL=trip-status.d.ts.map
@@ -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/shop/sync/{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,wBAAiC,EAAE;YACvE,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"trip.d.ts","sourceRoot":"","sources":["../../src/commands/trip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgD1D"}
1
+ {"version":3,"file":"trip.d.ts","sourceRoot":"","sources":["../../src/commands/trip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4D1D"}
@@ -2,9 +2,10 @@ import { withClient, output } from './shared.js';
2
2
  export function registerTripCommand(program) {
3
3
  program
4
4
  .command('trip')
5
- .description('Manage a trip: create, add flight, set travelers. All actions in one command.')
5
+ .description('Manage a trip: create, add/remove flight items, set travelers. All actions in one command.')
6
6
  .option('--trip-id <id>', 'existing trip ID (omit to create new)')
7
7
  .option('--trip-item-token <token>', 'add a flight item (from flight-search)')
8
+ .option('--remove-item-id <id>', 'remove an existing item by item_id (from a prior trip response items[].item_id). Requires --trip-id. Can be combined with --trip-item-token to swap an item in one call.')
8
9
  .option('--travelers <json>', 'travelers JSON array')
9
10
  .option('--contact <json>', 'contact JSON {email, phone}')
10
11
  .action(withClient(async (client, globals, opts) => {
@@ -12,6 +13,13 @@ export function registerTripCommand(program) {
12
13
  if (opts.tripId) {
13
14
  body['trip_id'] = opts.tripId;
14
15
  }
16
+ if (opts.removeItemId) {
17
+ if (!opts.tripId) {
18
+ console.error('Error: --remove-item-id requires --trip-id.');
19
+ process.exit(3);
20
+ }
21
+ body['remove_item'] = { item_id: opts.removeItemId };
22
+ }
15
23
  if (opts.tripItemToken) {
16
24
  body['add_item'] = { trip_item_token: opts.tripItemToken };
17
25
  }
@@ -36,7 +44,7 @@ export function registerTripCommand(program) {
36
44
  }
37
45
  body['upsert_travelers'] = upsertTravelers;
38
46
  }
39
- const response = await client.raw.POST('/api/v1/trips', {
47
+ const response = await client.raw.POST('/api/v1/shop/sync', {
40
48
  body,
41
49
  });
42
50
  output(response.data, { format: globals.format });
@@ -1 +1 @@
1
- {"version":3,"file":"trip.js","sourceRoot":"","sources":["../../src/commands/trip.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,+EAA+E,CAAC;SAC5F,MAAM,CAAC,gBAAgB,EAAE,uCAAuC,CAAC;SACjE,MAAM,CAAC,2BAA2B,EAAE,wCAAwC,CAAC;SAC7E,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC;SACpD,MAAM,CAAC,kBAAkB,EAAE,6BAA6B,CAAC;SACzD,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACjD,MAAM,IAAI,GAA4B,EAAE,CAAC;QAEzC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CA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CAAc,CAAC;YACtD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAED,MAAM,eAAe,GAA4B,EAAE,SAAS,EAAE,CAAC;YAE/D,IAAI,IAAI,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,mBAA4B,EAAE;YACnE,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,aAAa,IAAI,OAAO,CA+BvC"}
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
- import { registerCheckoutCommand } from './commands/checkout.js';
10
+ import { registerBookCommand } 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('0.2.0')
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
- // Core tools (matching MCP 1:1)
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
35
  registerBookCommand(program);
31
- // V2: quote, checkout, ancillaries, payment, refunds
32
- registerQuoteCommand(program);
33
- registerCheckoutCommand(program);
34
36
  registerSelectAncillariesCommand(program);
35
- registerConfirmPaymentCommand(program);
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,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO;SACJ,IAAI,CAAC,OAAO,CAAC;SACb,WAAW,CAAC,8EAA8E,CAAC;SAC3F,OAAO,CAAC,OAAO,CAAC;SAChB,MAAM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,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.4.5",
3
+ "version": "1.0.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": "workspace:*",
19
+ "@gojinko/api-client": "1.0.0",
20
20
  "commander": "^12.1.0",
21
21
  "chalk": "^5.4.1",
22
22
  "open": "^10.0.0",
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function registerBookCommand(program: Command): void;
3
- //# sourceMappingURL=book.d.ts.map
@@ -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"}
@@ -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,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function registerConfirmPaymentCommand(program: Command): void;
3
- //# sourceMappingURL=confirm-payment.d.ts.map
@@ -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"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function registerQuoteCommand(program: Command): void;
3
- //# sourceMappingURL=quote.d.ts.map
@@ -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"}
@@ -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"}