@gojinko/api-client 2.22.1 → 2.24.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 +55 -7
- package/dist/client.d.ts +11 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +41 -8
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +16 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +9 -0
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +9 -0
- package/dist/oauth.js.map +1 -1
- package/dist/tools.d.ts +23 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +17 -2
- package/dist/tools.js.map +1 -1
- package/dist/types/devplatform.d.ts +79 -16
- package/dist/types/devplatform.d.ts.map +1 -1
- package/dist/types/devplatform.js +7 -3
- package/dist/types/devplatform.js.map +1 -1
- package/dist/types/generated.d.ts +13048 -1769
- package/dist/types/generated.d.ts.map +1 -1
- package/package.json +1 -1
- package/public-api.yaml +12987 -1687
package/README.md
CHANGED
|
@@ -22,13 +22,16 @@ const client = await createJinkoClient({ apiKey: 'jnk_...' });
|
|
|
22
22
|
|
|
23
23
|
## Authentication
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Authenticate with a **tenant API key** (`jnk_...`) — get one from
|
|
26
|
+
**dashboard.gojinko.com → Developers → API keys**. The client resolves
|
|
27
|
+
credentials automatically in this order:
|
|
26
28
|
|
|
27
29
|
1. `apiKey` option passed to `createJinkoClient()`
|
|
28
30
|
2. `JINKO_API_KEY` environment variable
|
|
29
|
-
3. `~/.jinko/config.yaml` — API key
|
|
31
|
+
3. `~/.jinko/config.yaml` — API key (managed by `jinko auth login --key jnk_...`)
|
|
30
32
|
|
|
31
|
-
OAuth tokens
|
|
33
|
+
> OAuth is deprecated. Legacy OAuth tokens still present in `~/.jinko/config.yaml`
|
|
34
|
+
> continue to auto-refresh, but new logins use API keys.
|
|
32
35
|
|
|
33
36
|
## Methods
|
|
34
37
|
|
|
@@ -52,6 +55,7 @@ canonical `/v1/*` routes). Authenticate with a `jnk_` API key (`X-API-Key`).
|
|
|
52
55
|
| `client.flightSearch()` | `POST /v1/flight_search` |
|
|
53
56
|
| `client.hotelSearch()` | `POST /v1/hotel_search` |
|
|
54
57
|
| `client.hotelDetails()` | `GET /v1/hotel_details/{hotel_id}` |
|
|
58
|
+
| `client.groundSearch()` | `POST /v1/ground_search` |
|
|
55
59
|
| `client.trip()` | `POST /v1/trip` |
|
|
56
60
|
| `client.getTrip(tripId)` | `GET /v1/trip/{trip_id}` |
|
|
57
61
|
|
|
@@ -123,6 +127,35 @@ const results = await client.hotelSearch({
|
|
|
123
127
|
await client.trip({ add_item: { trip_item_token: 'htl_xxx:rate_yyy' } });
|
|
124
128
|
```
|
|
125
129
|
|
|
130
|
+
### ground_search — Live rail, coach and ferry search
|
|
131
|
+
|
|
132
|
+
Returns ground connections (Distribusion). Two things to know before your first call:
|
|
133
|
+
|
|
134
|
+
1. **Codes are ISO-country + city, not IATA** — `GBLON` for London, not `LON`. A
|
|
135
|
+
wrong code returns no inventory rather than an error, which is a confusing way
|
|
136
|
+
to fail.
|
|
137
|
+
2. **`connections[].id` *is* the trip item token.** Unlike hotels it carries no
|
|
138
|
+
`htl_`-style prefix — pass it verbatim to `trip()`.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
const results = await client.groundSearch({
|
|
142
|
+
departure_city: 'GBLON',
|
|
143
|
+
arrival_city: 'GBLON',
|
|
144
|
+
departure_date: '2026-08-28',
|
|
145
|
+
passengers: [{ pax: 1 }], // omit max_age for an adult; 0-15 prices as a child
|
|
146
|
+
currency: 'GBP',
|
|
147
|
+
});
|
|
148
|
+
// → { connections: [ { id, departure_station, arrival_station, departure_time,
|
|
149
|
+
// duration_minutes, transport_mode, marketing_carrier,
|
|
150
|
+
// fares: [ { fare_class, total_price, refundable } ] } ] }
|
|
151
|
+
|
|
152
|
+
// Add the journey to a trip — the id goes in unmodified:
|
|
153
|
+
await client.trip({ add_item: { trip_item_token: results.connections[0].id } });
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Pass `return_date` for a round trip. Ground shares the cart with flights and
|
|
157
|
+
hotels, so `checkout()` and `getTrip()` need no ground-specific handling.
|
|
158
|
+
|
|
126
159
|
### trip — Create trip, add flight or hotel, set travelers
|
|
127
160
|
|
|
128
161
|
```typescript
|
|
@@ -138,6 +171,9 @@ const trip = await client.trip({
|
|
|
138
171
|
// Optional per-traveler loyalty program. airline = IATA code of the
|
|
139
172
|
// program issuer (e.g. 'LH'), not necessarily the operating carrier.
|
|
140
173
|
frequent_flyer: { airline: 'LH', number: '992100100' },
|
|
174
|
+
// Optional US trusted-traveler identifiers (flights only). The issuing
|
|
175
|
+
// country defaults to US; a redress_number works the same way.
|
|
176
|
+
known_traveler_number: '998765432',
|
|
141
177
|
}],
|
|
142
178
|
contact: { email: 'jane@example.com', phone: '+33612345678' },
|
|
143
179
|
},
|
|
@@ -172,10 +208,15 @@ fallback instead of advancing the booking.
|
|
|
172
208
|
|
|
173
209
|
```typescript
|
|
174
210
|
const result = await client.submitAgentPayment('42', 'spt_1Nq8L2eZvKYlo2C0');
|
|
175
|
-
// { status: 'processing', payment_verified: true, fulfillment_cart_id, ... }
|
|
176
|
-
// or, on a 3DS step-up: { payment_verified: false, checkout_url }
|
|
211
|
+
// { status: 'processing', payment_verified: true, booking_ref: 'JNK-XEVGW5', fulfillment_cart_id, ... }
|
|
212
|
+
// or, on a 3DS step-up: { payment_verified: false, checkout_url } (no booking_ref)
|
|
177
213
|
```
|
|
178
214
|
|
|
215
|
+
`booking_ref` is the Jinko booking reference (`JNK-…`) — the handle
|
|
216
|
+
`getBooking()`, `hotelCancelBooking()`, refund and exchange take as
|
|
217
|
+
`booking_ref`. An agent that pays this way never opens `checkout_url`, so this
|
|
218
|
+
response (and `getTrip()` afterwards) is where it learns the reference.
|
|
219
|
+
|
|
179
220
|
### selectAncillaries — Add baggage, seats, meals
|
|
180
221
|
|
|
181
222
|
```typescript
|
|
@@ -198,6 +239,7 @@ const status = await client.getTrip('42');
|
|
|
198
239
|
// travelers, contact, items, total_amount,
|
|
199
240
|
// quote: { quoted_cart_id, status, expires_at },
|
|
200
241
|
// fulfillment: { fulfillment_cart_id, status, phase, scheduled_at },
|
|
242
|
+
// booking_ref: 'JNK-XEVGW5', // the Jinko reference — present once fulfillment is scheduled
|
|
201
243
|
// bookings: [ { item_id, booking_reference, pnr, provider_status } ],
|
|
202
244
|
// created_at, updated_at,
|
|
203
245
|
// }
|
|
@@ -205,6 +247,11 @@ const status = await client.getTrip('42');
|
|
|
205
247
|
|
|
206
248
|
Poll `getTrip()` until `status === 'fulfilled'` (or `'partially_fulfilled'`) to read the PNRs.
|
|
207
249
|
|
|
250
|
+
`booking_ref` (top level, one per trip) is the Jinko booking reference — what
|
|
251
|
+
`getBooking()`, `hotelCancelBooking()`, refund and exchange take as
|
|
252
|
+
`booking_ref`. `bookings[].booking_reference` is the SUPPLIER confirmation
|
|
253
|
+
(airline record locator, hotel confirmation number) and is not that handle.
|
|
254
|
+
|
|
208
255
|
### refundCheck / refundCommit
|
|
209
256
|
|
|
210
257
|
Two auth modes: guest (`booking_ref` + `last_name`) or authenticated (`order_id`).
|
|
@@ -220,7 +267,8 @@ const refund = await client.refundCommit({ booking_ref: 'JNK-ABC123', last_
|
|
|
220
267
|
findFlight / findDestination / flightCalendar → offer_token (cached, flights)
|
|
221
268
|
flightSearch (offer_token) → trip_item_token (live, flights)
|
|
222
269
|
hotelSearch → htl_* offer_id (live, hotels)
|
|
223
|
-
|
|
270
|
+
groundSearch → connections[].id (live, ground; raw, NOT prefixed)
|
|
271
|
+
trip (trip_item_token OR htl_* OR ground id) → trip_id (multi-domain)
|
|
224
272
|
checkout (trip_id) → checkout_url + agent_spt_params + items
|
|
225
273
|
├─ [human] user pays on checkout_url
|
|
226
274
|
└─ [agent] submitAgentPayment(trip_id, spt) → authorized server-side
|
|
@@ -238,7 +286,7 @@ try {
|
|
|
238
286
|
const client = await createJinkoClient();
|
|
239
287
|
} catch (error) {
|
|
240
288
|
if (error instanceof AuthError) {
|
|
241
|
-
// No credentials configured — run `jinko auth login
|
|
289
|
+
// No credentials configured — run `jinko auth login --key jnk_...`
|
|
242
290
|
}
|
|
243
291
|
if (error instanceof ApiError) {
|
|
244
292
|
console.error(error.code, error.message, error.statusCode);
|
package/dist/client.d.ts
CHANGED
|
@@ -30,6 +30,17 @@ export interface ClientOptions {
|
|
|
30
30
|
* producer (jinkoso/mcp-bff#1146) consumes it.
|
|
31
31
|
*/
|
|
32
32
|
readonly originAction?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The end user's request in their own words (avoid PII), forwarded to Jinko
|
|
35
|
+
* for observability and relevance. When set, it is merged into the JSON
|
|
36
|
+
* request body of every POST tool call as the optional
|
|
37
|
+
* `intent: { user_intent }` envelope (IntentInput) — the shape all 21
|
|
38
|
+
* intent-eligible public POST operations accept. Unlike the X-Origin-*
|
|
39
|
+
* headers this is a body field, so non-ASCII text (any language) passes
|
|
40
|
+
* through untouched; the value is trimmed and omitted entirely when blank.
|
|
41
|
+
* The CLI threads its per-command `--user-intent` flag here.
|
|
42
|
+
*/
|
|
43
|
+
readonly userIntent?: string;
|
|
33
44
|
}
|
|
34
45
|
export type JinkoRawClient = ReturnType<typeof createClient<paths>>;
|
|
35
46
|
export interface JinkoClient extends JinkoTools {
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,YAAiC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,YAAiC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAgDlD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;;;;;;;OASG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AAEpE,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B;AAQD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAoMzF"}
|
package/dist/client.js
CHANGED
|
@@ -36,6 +36,17 @@ function sanitizeOriginAction(value) {
|
|
|
36
36
|
.slice(0, ORIGIN_ACTION_MAX_LEN);
|
|
37
37
|
return ascii.length > 0 ? ascii : undefined;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalize the user-intent text destined for the `intent.user_intent`
|
|
41
|
+
* request-body field. Unlike X-Origin-Action this travels in the JSON body,
|
|
42
|
+
* not a header, so non-ASCII text (any language) passes through untouched —
|
|
43
|
+
* we only trim whitespace and return undefined when the result is empty so
|
|
44
|
+
* the `intent` envelope is omitted rather than sent blank.
|
|
45
|
+
*/
|
|
46
|
+
function normalizeUserIntent(value) {
|
|
47
|
+
const trimmed = value?.trim();
|
|
48
|
+
return trimmed ? trimmed : undefined;
|
|
49
|
+
}
|
|
39
50
|
/**
|
|
40
51
|
* Create a configured openapi-fetch client for the Jinko BFF.
|
|
41
52
|
*
|
|
@@ -71,8 +82,14 @@ export async function createJinkoClient(options = {}) {
|
|
|
71
82
|
// sufficient for backend trace continuity.
|
|
72
83
|
const traceId = randomBytes(16).toString('hex'); // 32 hex chars
|
|
73
84
|
const newSpanId = () => randomBytes(8).toString('hex'); // 16 hex chars
|
|
74
|
-
// Derive a best-effort user id. API-key auth
|
|
75
|
-
//
|
|
85
|
+
// Derive a best-effort user id for the legacy X-User-ID header. API-key auth
|
|
86
|
+
// (the supported path) doesn't expose one, so this stays `undefined` for every
|
|
87
|
+
// `jnk_...` request — X-User-ID is never sent on the api_key path. It is only
|
|
88
|
+
// populated for OAuth/JWT tokens via the `sub` claim. OAuth sign-in is
|
|
89
|
+
// deprecated, so this only fires for pre-existing OAuth credentials or an
|
|
90
|
+
// explicit non-`jnk_` token; the downstream side treats it as optional. Do not
|
|
91
|
+
// wire new behavior onto X-User-ID — it is legacy and effectively dead for new
|
|
92
|
+
// (API-key) auth.
|
|
76
93
|
const userId = auth.method === 'oauth' ? extractUserIdFromJwt(auth.token) : undefined;
|
|
77
94
|
// Intent-tracking provenance (Revision 2 contract). X-Origin-Source carries
|
|
78
95
|
// the caller's surface (only when the caller opts in — see ClientOptions) and
|
|
@@ -99,13 +116,15 @@ export async function createJinkoClient(options = {}) {
|
|
|
99
116
|
// (e.g. a 401 at the public ingress) — masking every auth failure as an
|
|
100
117
|
// opaque "fetch failed". Header mutation leaves the body untouched.
|
|
101
118
|
const { headers } = request;
|
|
102
|
-
headers.set('X-Tenant-ID', 'jinko');
|
|
103
119
|
headers.set('Content-Type', 'application/json');
|
|
104
120
|
headers.set('Accept', 'application/json');
|
|
105
121
|
// Observability headers — let downstream services group, filter, and trace
|
|
106
122
|
// a user's CLI flow in Datadog. `X-Session-ID` is stable per CLI session;
|
|
107
|
-
// `X-Request-ID` is unique per HTTP call
|
|
108
|
-
// OAuth is in use (JWT sub claim)
|
|
123
|
+
// `X-Request-ID` is unique per HTTP call. `X-User-ID` is legacy: it is set
|
|
124
|
+
// only when OAuth is in use (JWT sub claim) and is NEVER sent on the
|
|
125
|
+
// api_key path (`userId` is undefined there). Kept for back-compat with
|
|
126
|
+
// pre-existing OAuth tokens; the clean api_key path authenticates purely
|
|
127
|
+
// via the X-API-Key header below.
|
|
109
128
|
headers.set('X-Session-ID', sessionId);
|
|
110
129
|
headers.set('X-Request-ID', randomUUID());
|
|
111
130
|
if (userId) {
|
|
@@ -140,10 +159,12 @@ export async function createJinkoClient(options = {}) {
|
|
|
140
159
|
// public ingress and rebuilds it post-auth from the validated API key.
|
|
141
160
|
headers.set('traceparent', `00-${traceId}-${newSpanId()}-01`);
|
|
142
161
|
if (auth.method === 'api_key') {
|
|
162
|
+
// Supported, documented auth path: the tenant API key travels in
|
|
163
|
+
// X-API-Key. No Authorization bearer, no X-User-ID — just the key.
|
|
143
164
|
headers.set('X-API-Key', auth.token);
|
|
144
165
|
}
|
|
145
166
|
else {
|
|
146
|
-
// OAuth — check if we need to refresh
|
|
167
|
+
// OAuth (deprecated, legacy tokens only) — check if we need to refresh
|
|
147
168
|
let currentToken = auth.token;
|
|
148
169
|
if (tokenState && isTokenExpired({ access_token: tokenState.accessToken, refresh_token: tokenState.refreshToken, expires_at: tokenState.expiresAt })) {
|
|
149
170
|
try {
|
|
@@ -177,10 +198,19 @@ export async function createJinkoClient(options = {}) {
|
|
|
177
198
|
async onResponse({ response }) {
|
|
178
199
|
if (!response.ok) {
|
|
179
200
|
let detail = { code: 'API_ERROR', message: response.statusText };
|
|
201
|
+
let details;
|
|
180
202
|
try {
|
|
181
203
|
const body = await response.clone().json();
|
|
182
204
|
if (body?.error) {
|
|
183
205
|
detail = { ...detail, ...body.error };
|
|
206
|
+
// Everything beside `error` is a carried key (D27): `expires_at` on
|
|
207
|
+
// QUOTE_EXPIRED, `status` on TRIP_EXPIRED / TRIP_STATE_CONFLICT,
|
|
208
|
+
// `items` on PRICE_CHANGED. Spreading `body.error` alone dropped
|
|
209
|
+
// them, which left the caller holding a code it could not act on.
|
|
210
|
+
const { error: _error, ...carried } = body;
|
|
211
|
+
if (Object.keys(carried).length > 0) {
|
|
212
|
+
details = carried;
|
|
213
|
+
}
|
|
184
214
|
}
|
|
185
215
|
else if (body?.message) {
|
|
186
216
|
detail = { ...detail, message: body.message };
|
|
@@ -189,14 +219,17 @@ export async function createJinkoClient(options = {}) {
|
|
|
189
219
|
catch {
|
|
190
220
|
// Response body isn't JSON — use statusText.
|
|
191
221
|
}
|
|
192
|
-
throw new ApiError({ ...detail, statusCode: response.status });
|
|
222
|
+
throw new ApiError({ ...detail, statusCode: response.status, details });
|
|
193
223
|
}
|
|
194
224
|
return response;
|
|
195
225
|
},
|
|
196
226
|
};
|
|
197
227
|
client.use(authMiddleware);
|
|
198
228
|
client.use(errorMiddleware);
|
|
199
|
-
|
|
229
|
+
// User intent travels in the request BODY (intent.user_intent), not a
|
|
230
|
+
// header, so it is threaded into the tools layer where POST bodies are
|
|
231
|
+
// assembled rather than into the middleware above.
|
|
232
|
+
const tools = createTools(client, { userIntent: normalizeUserIntent(options.userIntent) });
|
|
200
233
|
return {
|
|
201
234
|
raw: client,
|
|
202
235
|
auth,
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA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C,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BACpC,OAAO,GAAG,OAAO,CAAC;wBACpB,CAAC;oBACH,CAAC;yBAAM,IAAI,IAAI,EAAE,OAAO,EAAE,CAAC;wBACzB,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;oBAChD,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,6CAA6C;gBAC/C,CAAC;gBACD,MAAM,IAAI,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;YAC1E,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3B,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAE5B,sEAAsE;IACtE,uEAAuE;IACvE,mDAAmD;IACnD,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAE3F,OAAO;QACL,GAAG,EAAE,MAAM;QACX,IAAI;QACJ,GAAG,KAAK;KACT,CAAC;AACJ,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -3,15 +3,31 @@ export interface ApiErrorDetail {
|
|
|
3
3
|
readonly message: string;
|
|
4
4
|
readonly doc_url?: string;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* The keys the public error envelope carries BESIDE `error`, not inside it
|
|
8
|
+
* (contract amendment D27):
|
|
9
|
+
*
|
|
10
|
+
* { "error": { "code", "message", "doc_url"? }, "expires_at": "…" }
|
|
11
|
+
*
|
|
12
|
+
* Which key appears is a function of the code: `expires_at` on QUOTE_EXPIRED
|
|
13
|
+
* (410), `status` on TRIP_EXPIRED and TRIP_STATE_CONFLICT (409), `items` on
|
|
14
|
+
* PRICE_CHANGED (409). They are what makes a code actionable, so they are
|
|
15
|
+
* captured verbatim rather than enumerated here — a code that starts carrying
|
|
16
|
+
* a new key reaches the caller without a client release.
|
|
17
|
+
*/
|
|
18
|
+
export type ApiErrorDetails = Readonly<Record<string, unknown>>;
|
|
6
19
|
export declare class ApiError extends Error {
|
|
7
20
|
readonly code: string;
|
|
8
21
|
readonly statusCode: number;
|
|
9
22
|
readonly docUrl?: string;
|
|
23
|
+
readonly details?: ApiErrorDetails;
|
|
10
24
|
constructor(detail: ApiErrorDetail & {
|
|
11
25
|
statusCode: number;
|
|
26
|
+
details?: ApiErrorDetails;
|
|
12
27
|
});
|
|
13
28
|
toJSON(): ApiErrorDetail & {
|
|
14
29
|
statusCode: number;
|
|
30
|
+
details?: ApiErrorDetails;
|
|
15
31
|
};
|
|
16
32
|
}
|
|
17
33
|
export declare class AuthError extends ApiError {
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhE,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;gBAEvB,MAAM,EAAE,cAAc,GAAG;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,eAAe,CAAA;KAAE;IAStF,MAAM,IAAI,cAAc,GAAG;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,eAAe,CAAA;KAAE;CAS7E;AAED,qBAAa,SAAU,SAAQ,QAAQ;gBAEnC,OAAO,SAAgK;CAK1K;AAED,qBAAa,eAAgB,SAAQ,QAAQ;gBAC/B,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/errors.js
CHANGED
|
@@ -2,12 +2,14 @@ export class ApiError extends Error {
|
|
|
2
2
|
code;
|
|
3
3
|
statusCode;
|
|
4
4
|
docUrl;
|
|
5
|
+
details;
|
|
5
6
|
constructor(detail) {
|
|
6
7
|
super(detail.message);
|
|
7
8
|
this.name = 'ApiError';
|
|
8
9
|
this.code = detail.code;
|
|
9
10
|
this.statusCode = detail.statusCode;
|
|
10
11
|
this.docUrl = detail.doc_url;
|
|
12
|
+
this.details = detail.details;
|
|
11
13
|
}
|
|
12
14
|
toJSON() {
|
|
13
15
|
return {
|
|
@@ -15,11 +17,12 @@ export class ApiError extends Error {
|
|
|
15
17
|
message: this.message,
|
|
16
18
|
statusCode: this.statusCode,
|
|
17
19
|
doc_url: this.docUrl,
|
|
20
|
+
...(this.details ? { details: this.details } : {}),
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
export class AuthError extends ApiError {
|
|
22
|
-
constructor(message = 'Authentication required.
|
|
25
|
+
constructor(message = 'Authentication required. Get an API key from dashboard.gojinko.com → Developers → API keys, then run `jinko auth login --key jnk_...` or set JINKO_API_KEY.') {
|
|
23
26
|
super({ code: 'AUTH_REQUIRED', message, statusCode: 401 });
|
|
24
27
|
this.name = 'AuthError';
|
|
25
28
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,IAAI,CAAS;IACb,UAAU,CAAS;IACnB,MAAM,CAAU;IAChB,OAAO,CAAmB;IAEnC,YAAY,MAA0E;QACpF,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,SAAU,SAAQ,QAAQ;IACrC,YACE,OAAO,GAAG,6JAA6J;QAEvK,KAAK,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export { createJinkoClient, type ClientOptions, type JinkoClient, type JinkoRawC
|
|
|
2
2
|
export { type JinkoTools } from './tools.js';
|
|
3
3
|
export { resolveAuth, resolveBaseUrl, resolveEnvironment, readConfigFile, writeConfigFile, writeEnvAuth, setEnvironment, clearAuthConfig, ENV_BASE_URLS, CONFIG_DIR, CONFIG_FILE, DEFAULT_ENVIRONMENT, type AuthMethod, type Environment, type ResolvedAuth, type OAuthConfig, } from './auth.js';
|
|
4
4
|
export { loadOrCreateCliSession, clearCliSession, extractUserIdFromJwt, getSessionFilePath, SESSION_TTL_MS } from './session.js';
|
|
5
|
-
export { ApiError, AuthError, ValidationError, type ApiErrorDetail } from './errors.js';
|
|
5
|
+
export { ApiError, AuthError, ValidationError, type ApiErrorDetail, type ApiErrorDetails, } from './errors.js';
|
|
6
6
|
export { requestDeviceAuthorization, pollForToken, refreshAccessToken, isTokenExpired, OAuthError, OAuthRefreshError, resolveExpiresAt, type OAuthTokens, type DeviceAuthorization, } from './oauth.js';
|
|
7
7
|
export type { paths, components } from './types/generated.js';
|
|
8
|
-
export type { Money, Amount, DateRange, Itinerary, FlightDiscoveryRequest, FlightFindRequest, FlightCalendarResponse, FindDestinationRequest, FlightDestinationSearchRequest, DestinationSuggestion, FindDestinationResponse, FlightSearchRequest, FlightSearchResponse, FlightOffer, Fare, FlightLeg, PriceMonitoringRequest, PriceMonitoringResponse, HotelOccupancy, HotelSearchRequest, HotelSearchResponse, HotelDetailsRequest, HotelDetailsResponse, Traveler, TripRequest, TripResponse, BookRequest, BookResponse, CheckoutRequest, CheckoutResponse, GetTripResponse, TripStatusResponse, TripAncillariesResponse, AncillaryOffer, AncillaryRequest, AncillaryResponse, SelectAncillariesRequest, BookingGetRequest, BookingGetResponse, BookingLookupRequest, BookingLookupResponse, RefundCheckRequest, RefundCheckResponse, RefundCommitRequest, RefundCommitResponse, RefundStatusRequest, RefundStatusResponse, ExchangeShopRequest, ExchangeShopResponse, ExchangePriceRequest, ExchangePriceResponse, ExchangeCommitRequest, ExchangeCommitResponse, ExchangeStatusRequest, ExchangeStatusResponse, HotelCancelBookingRequest, HotelCancelBookingResponse, DemandQuery, Level, TravelerType, TripType, DestinationRow, MarketRow, AudienceRow, DestinationResponse, MarketResponse, AudienceResponse, DemandTrendQuery, Granularity, TrendPoint, SeriesSummary, TrendSeries, TrendResponse, } from './types/devplatform.js';
|
|
8
|
+
export type { Money, Amount, DateRange, Itinerary, FlightDiscoveryRequest, FlightFindRequest, FlightCalendarResponse, FindDestinationRequest, FlightDestinationSearchRequest, DestinationSuggestion, FindDestinationResponse, FlightSearchRequest, FlightSearchResponse, FlightOffer, Fare, FlightLeg, TimeRange, UnappliedFilter, PriceMonitoringRequest, PriceMonitoringResponse, HotelOccupancy, GroundSearchRequest, GroundSearchResponse, GroundConnection, GroundFare, GroundStation, GroundCarrier, GroundAmount, HotelSearchRequest, HotelSearchResponse, HotelDetailsRequest, HotelDetailsResponse, Traveler, TripRequest, TripResponse, PriceChange, BookRequest, BookResponse, CheckoutRequest, CheckoutResponse, GetTripResponse, TripStatusResponse, TripAncillariesResponse, AncillaryOffer, AncillaryRequest, AncillaryResponse, SelectAncillariesRequest, BookingGetRequest, BookingGetResponse, BookingLookupRequest, BookingLookupResponse, RefundCheckRequest, RefundCheckResponse, RefundCommitRequest, RefundCommitResponse, RefundStatusRequest, RefundStatusResponse, ExchangeShopRequest, ExchangeShopResponse, ExchangePriceRequest, ExchangePriceResponse, ExchangeCommitRequest, ExchangeCommitResponse, ExchangeStatusRequest, ExchangeStatusResponse, HotelCancelBookingRequest, HotelCancelBookingResponse, DemandQuery, Level, TravelerType, TripType, DestinationRow, MarketRow, AudienceRow, DestinationResponse, MarketResponse, AudienceResponse, DemandTrendQuery, Granularity, TrendPoint, SeriesSummary, TrendSeries, TrendResponse, } from './types/devplatform.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
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,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3G,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjI,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,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ACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EAExB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAE1B,WAAW,EACX,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAEhB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createJinkoClient } from './client.js';
|
|
2
2
|
export { resolveAuth, resolveBaseUrl, resolveEnvironment, readConfigFile, writeConfigFile, writeEnvAuth, setEnvironment, clearAuthConfig, ENV_BASE_URLS, CONFIG_DIR, CONFIG_FILE, DEFAULT_ENVIRONMENT, } from './auth.js';
|
|
3
3
|
export { loadOrCreateCliSession, clearCliSession, extractUserIdFromJwt, getSessionFilePath, SESSION_TTL_MS } from './session.js';
|
|
4
|
-
export { ApiError, AuthError, ValidationError } from './errors.js';
|
|
4
|
+
export { ApiError, AuthError, ValidationError, } from './errors.js';
|
|
5
5
|
export { requestDeviceAuthorization, pollForToken, refreshAccessToken, isTokenExpired, OAuthError, OAuthRefreshError, resolveExpiresAt, } from './oauth.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA6D,MAAM,aAAa,CAAC;AAE3G,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACX,mBAAmB,GAKpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjI,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA6D,MAAM,aAAa,CAAC;AAE3G,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACX,mBAAmB,GAKpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjI,OAAO,EACL,QAAQ,EACR,SAAS,EACT,eAAe,GAGhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,gBAAgB,GAGjB,MAAM,YAAY,CAAC"}
|
package/dist/oauth.d.ts
CHANGED
|
@@ -19,11 +19,20 @@ export declare class OAuthRefreshError extends OAuthError {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Request device authorization — returns a user code and verification URL.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated OAuth sign-in was retired for the Jinko data plane. Tenant API
|
|
24
|
+
* keys (`jnk_...`) are the auth model — see `jinko auth login --key`. This
|
|
25
|
+
* device-authorization helper is no longer reachable from the CLI and is kept
|
|
26
|
+
* only for backward compatibility of the SDK's public surface.
|
|
22
27
|
*/
|
|
23
28
|
export declare function requestDeviceAuthorization(): Promise<DeviceAuthorization>;
|
|
24
29
|
/**
|
|
25
30
|
* Poll the token endpoint until the user approves or the code expires.
|
|
26
31
|
* Calls onPoll() before each attempt (for progress indicators).
|
|
32
|
+
*
|
|
33
|
+
* @deprecated OAuth sign-in was retired for the Jinko data plane. Tenant API
|
|
34
|
+
* keys (`jnk_...`) are the auth model. This device-flow poller is no longer
|
|
35
|
+
* reachable from the CLI and is kept only for SDK back-compat.
|
|
27
36
|
*/
|
|
28
37
|
export declare function pollForToken(deviceCode: string, options: {
|
|
29
38
|
readonly intervalSeconds: number;
|
package/dist/oauth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../src/oauth.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAkB,SAAQ,UA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,CAE/E;AAQD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAyBhF"}
|
package/dist/oauth.js
CHANGED
|
@@ -17,6 +17,11 @@ export class OAuthRefreshError extends OAuthError {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Request device authorization — returns a user code and verification URL.
|
|
20
|
+
*
|
|
21
|
+
* @deprecated OAuth sign-in was retired for the Jinko data plane. Tenant API
|
|
22
|
+
* keys (`jnk_...`) are the auth model — see `jinko auth login --key`. This
|
|
23
|
+
* device-authorization helper is no longer reachable from the CLI and is kept
|
|
24
|
+
* only for backward compatibility of the SDK's public surface.
|
|
20
25
|
*/
|
|
21
26
|
export async function requestDeviceAuthorization() {
|
|
22
27
|
const response = await fetch(DEVICE_AUTHORIZE_URL, {
|
|
@@ -33,6 +38,10 @@ export async function requestDeviceAuthorization() {
|
|
|
33
38
|
/**
|
|
34
39
|
* Poll the token endpoint until the user approves or the code expires.
|
|
35
40
|
* Calls onPoll() before each attempt (for progress indicators).
|
|
41
|
+
*
|
|
42
|
+
* @deprecated OAuth sign-in was retired for the Jinko data plane. Tenant API
|
|
43
|
+
* keys (`jnk_...`) are the auth model. This device-flow poller is no longer
|
|
44
|
+
* reachable from the CLI and is kept only for SDK back-compat.
|
|
36
45
|
*/
|
|
37
46
|
export async function pollForToken(deviceCode, options) {
|
|
38
47
|
const { intervalSeconds, expiresIn, onPoll } = options;
|
package/dist/oauth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../src/oauth.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,oBAAoB,GAAG,yDAAyD,CAAC;AACvF,MAAM,gBAAgB,GAAG,qDAAqD,CAAC;AAC/E,MAAM,SAAS,GAAG,qDAAqD,CAAC;AACxE,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAi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AO,KAAK,CAAC;gBACf,CAAC;gBACD,mEAAmE;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,iCAAiC;IACnC,CAAC;IAED,2EAA2E;IAC3E,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,qBAAqB,CAAC;AAC5C,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JinkoRawClient } from "./client.js";
|
|
2
|
-
import type { FlightFindRequest, FlightDestinationSearchRequest, FlightSearchRequest, FlightSearchResponse, PriceMonitoringRequest, PriceMonitoringResponse, FlightCalendarResponse, FindDestinationResponse, HotelSearchRequest, HotelSearchResponse, HotelDetailsRequest, HotelDetailsResponse, TripRequest, TripResponse, CheckoutResponse, AgentPaymentSubmitResponse, GetTripResponse, TripAncillariesResponse, AncillaryRequest, AncillaryResponse, BookingGetRequest, BookingGetResponse, RefundCheckRequest, RefundCheckResponse, RefundCommitRequest, RefundCommitResponse, RefundStatusRequest, RefundStatusResponse, ExchangeShopRequest, ExchangeShopResponse, ExchangePriceRequest, ExchangePriceResponse, ExchangeCommitRequest, ExchangeCommitResponse, ExchangeStatusRequest, ExchangeStatusResponse, HotelCancelBookingRequest, HotelCancelBookingResponse, DemandQuery, DestinationResponse, MarketResponse, AudienceResponse, DemandTrendQuery, TrendResponse } from "./types/devplatform.js";
|
|
2
|
+
import type { FlightFindRequest, FlightDestinationSearchRequest, FlightSearchRequest, FlightSearchResponse, PriceMonitoringRequest, PriceMonitoringResponse, FlightCalendarResponse, FindDestinationResponse, GroundSearchRequest, GroundSearchResponse, HotelSearchRequest, HotelSearchResponse, HotelDetailsRequest, HotelDetailsResponse, TripRequest, TripResponse, CheckoutResponse, AgentPaymentSubmitResponse, GetTripResponse, TripAncillariesResponse, AncillaryRequest, AncillaryResponse, BookingGetRequest, BookingGetResponse, RefundCheckRequest, RefundCheckResponse, RefundCommitRequest, RefundCommitResponse, RefundStatusRequest, RefundStatusResponse, ExchangeShopRequest, ExchangeShopResponse, ExchangePriceRequest, ExchangePriceResponse, ExchangeCommitRequest, ExchangeCommitResponse, ExchangeStatusRequest, ExchangeStatusResponse, HotelCancelBookingRequest, HotelCancelBookingResponse, DemandQuery, DestinationResponse, MarketResponse, AudienceResponse, DemandTrendQuery, TrendResponse } from "./types/devplatform.js";
|
|
3
3
|
/**
|
|
4
4
|
* Tool methods matching the canonical jinko-api capability names.
|
|
5
5
|
*
|
|
@@ -15,6 +15,7 @@ import type { FlightFindRequest, FlightDestinationSearchRequest, FlightSearchReq
|
|
|
15
15
|
* flight_search → flightSearch() POST /v1/flight_search
|
|
16
16
|
* price_monitoring → priceMonitoring() POST /v1/price_monitoring
|
|
17
17
|
* hotel_search → hotelSearch() POST /v1/hotel_search
|
|
18
|
+
* ground_search → groundSearch() POST /v1/ground_search
|
|
18
19
|
* hotel_details → hotelDetails() GET /v1/hotel_details/{hotel_id}
|
|
19
20
|
* trip → trip() POST /v1/trip
|
|
20
21
|
* get_trip → getTrip() GET /v1/trip/{trip_id}
|
|
@@ -47,6 +48,15 @@ export interface JinkoTools {
|
|
|
47
48
|
readonly lowestFare: (request: FlightFindRequest) => Promise<FlightCalendarResponse>;
|
|
48
49
|
/** hotel_search — live hotel search by destination, dates, occupancy. */
|
|
49
50
|
readonly hotelSearch: (request: HotelSearchRequest) => Promise<HotelSearchResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* ground_search — live rail / coach / ferry search (Distribusion).
|
|
53
|
+
*
|
|
54
|
+
* Codes are ISO-country + city (`GBLON` for London, NOT the IATA `LON`); a
|
|
55
|
+
* wrong code returns no inventory rather than an error. Each
|
|
56
|
+
* `connections[].id` is the trip item token — pass it verbatim to `trip()` as
|
|
57
|
+
* `trip_item_token`, unprefixed, then `checkout()` as normal.
|
|
58
|
+
*/
|
|
59
|
+
readonly groundSearch: (request: GroundSearchRequest) => Promise<GroundSearchResponse>;
|
|
50
60
|
/** hotel_details — rich metadata (gallery, facilities, policies, per-room details). */
|
|
51
61
|
readonly hotelDetails: (request: HotelDetailsRequest) => Promise<HotelDetailsResponse>;
|
|
52
62
|
/** trip — create trip, add/remove items, set travelers. Returns trip_id. */
|
|
@@ -110,5 +120,16 @@ export interface JinkoTools {
|
|
|
110
120
|
/** demand_audience_trend — series per traveler-type segment. GET /v1/audience/trend. */
|
|
111
121
|
readonly demandAudienceTrend: (query: DemandTrendQuery) => Promise<TrendResponse>;
|
|
112
122
|
}
|
|
113
|
-
export
|
|
123
|
+
export interface ToolsOptions {
|
|
124
|
+
/**
|
|
125
|
+
* The end user's request in their own words. When set, merged into every
|
|
126
|
+
* POST request body as the optional `intent: { user_intent }` envelope
|
|
127
|
+
* (IntentInput). Every POST on this surface is one of the 21
|
|
128
|
+
* intent-eligible public operations — they all route through the `post()`
|
|
129
|
+
* helper below, and the GET tools carry no body — so the envelope lands on
|
|
130
|
+
* exactly the eligible set.
|
|
131
|
+
*/
|
|
132
|
+
readonly userIntent?: string;
|
|
133
|
+
}
|
|
134
|
+
export declare function createTools(raw: JinkoRawClient, options?: ToolsOptions): JinkoTools;
|
|
114
135
|
//# sourceMappingURL=tools.d.ts.map
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAGhC
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,WAAW,EACX,mBAAmB,EACnB,cAA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EAAE,gBAAgB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAEhF,wFAAwF;IACxF,QAAQ,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CACnF;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,GAAE,YAAiB,GAAG,UAAU,CA6IvF"}
|
package/dist/tools.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { ApiError } from "./errors.js";
|
|
2
|
-
export function createTools(raw) {
|
|
2
|
+
export function createTools(raw, options = {}) {
|
|
3
|
+
const { userIntent } = options;
|
|
4
|
+
// Merge `intent: { user_intent }` into a JSON body when userIntent is set.
|
|
5
|
+
// A caller-provided `intent` key wins (never clobbered); non-object bodies
|
|
6
|
+
// pass through untouched.
|
|
7
|
+
function withIntent(body) {
|
|
8
|
+
if (userIntent === undefined ||
|
|
9
|
+
typeof body !== 'object' ||
|
|
10
|
+
body === null ||
|
|
11
|
+
Array.isArray(body) ||
|
|
12
|
+
'intent' in body) {
|
|
13
|
+
return body;
|
|
14
|
+
}
|
|
15
|
+
return { ...body, intent: { user_intent: userIntent } };
|
|
16
|
+
}
|
|
3
17
|
async function post(path, body) {
|
|
4
|
-
const response = await raw.POST(path, { body });
|
|
18
|
+
const response = await raw.POST(path, { body: withIntent(body) });
|
|
5
19
|
return response.data;
|
|
6
20
|
}
|
|
7
21
|
// GET with a query-string params object — used by the demand endpoints. The
|
|
@@ -30,6 +44,7 @@ export function createTools(raw) {
|
|
|
30
44
|
flightSearch: async (request) => (await post("/v1/flight_search", request)),
|
|
31
45
|
priceMonitoring: async (request) => (await post("/v1/price_monitoring", request)),
|
|
32
46
|
hotelSearch: async (request) => (await post("/v1/hotel_search", request)),
|
|
47
|
+
groundSearch: async (request) => (await post("/v1/ground_search", request)),
|
|
33
48
|
hotelDetails: async ({ hotel_id, checkin, checkout }) => {
|
|
34
49
|
const query = {};
|
|
35
50
|
if (checkin)
|