@gojinko/cli 2.23.0 → 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 +45 -4
- package/SKILL.md +19 -5
- package/dist/commands/checkout.d.ts.map +1 -1
- package/dist/commands/checkout.js +5 -0
- package/dist/commands/checkout.js.map +1 -1
- package/dist/commands/flight-search.d.ts +106 -0
- package/dist/commands/flight-search.d.ts.map +1 -1
- package/dist/commands/flight-search.js +451 -45
- package/dist/commands/flight-search.js.map +1 -1
- package/dist/commands/get-booking.js +1 -1
- package/dist/commands/get-booking.js.map +1 -1
- package/dist/commands/hotel-cancel.js +1 -1
- package/dist/commands/hotel-cancel.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +88 -24
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +5 -2
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/trip-status.d.ts.map +1 -1
- package/dist/commands/trip-status.js +2 -0
- package/dist/commands/trip-status.js.map +1 -1
- package/dist/commands/trip.d.ts.map +1 -1
- package/dist/commands/trip.js +2 -0
- package/dist/commands/trip.js.map +1 -1
- package/dist/output/formatter.d.ts +19 -7
- package/dist/output/formatter.d.ts.map +1 -1
- package/dist/output/formatter.js +22 -8
- package/dist/output/formatter.js.map +1 -1
- package/dist/output/price-change.d.ts +45 -0
- package/dist/output/price-change.d.ts.map +1 -0
- package/dist/output/price-change.js +86 -0
- package/dist/output/price-change.js.map +1 -0
- package/dist/output/remedies.d.ts +30 -0
- package/dist/output/remedies.d.ts.map +1 -0
- package/dist/output/remedies.js +45 -0
- package/dist/output/remedies.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-line remedies for the public error codes that have an actionable next
|
|
3
|
+
* step (JIN-2117, JIN-2118 / contracts C13, C14, C15).
|
|
4
|
+
*
|
|
5
|
+
* `error.code` is a closed enum on the public contract, so a caller is meant to
|
|
6
|
+
* branch on it. The CLI is a human surface as well as a scripting one, and a
|
|
7
|
+
* bare code plus the server's message leaves a developer to go and look the
|
|
8
|
+
* code up. These lines are the condensed form of the remedy column on
|
|
9
|
+
* https://docs.gojinko.com/concepts/errors — deliberately the same advice, so
|
|
10
|
+
* the terminal and the docs never disagree.
|
|
11
|
+
*
|
|
12
|
+
* Eleven of the twenty public codes appear here, plus `PRICE_CHANGED`, which the
|
|
13
|
+
* published enum does not list. The other nine are omitted rather than given
|
|
14
|
+
* invented prose: `BAD_REQUEST`, `NOT_FOUND`, `CONFLICT`, `INTERNAL` and the
|
|
15
|
+
* four `UPSTREAM_*` codes carry a server message that is already the specific
|
|
16
|
+
* part, so a generic "try again" line would add noise without adding
|
|
17
|
+
* information; `AUTH_REQUIRED` is omitted because `AuthError` already carries a
|
|
18
|
+
* full self-describing message naming where to get a key.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: jinko-api now publishes a machine-readable table of all twenty codes
|
|
21
|
+
* with statuses, summaries and remedies at `docs/error-codes.json`. Only
|
|
22
|
+
* `public-api.yaml` is vendored here, so this list is still hand-kept and its
|
|
23
|
+
* wording is a close paraphrase rather than a copy. Deriving it from that file
|
|
24
|
+
* would remove the drift risk entirely — worth doing, but it is a design change
|
|
25
|
+
* beyond the contract this round settles.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ERROR_REMEDIES: Readonly<Record<string, string>>;
|
|
28
|
+
/** The remedy for a code, or undefined when it has no actionable next step. */
|
|
29
|
+
export declare function remedyFor(code: string | undefined): string | undefined;
|
|
30
|
+
//# sourceMappingURL=remedies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remedies.d.ts","sourceRoot":"","sources":["../../src/output/remedies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB1D,CAAC;AAEH,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEtE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-line remedies for the public error codes that have an actionable next
|
|
3
|
+
* step (JIN-2117, JIN-2118 / contracts C13, C14, C15).
|
|
4
|
+
*
|
|
5
|
+
* `error.code` is a closed enum on the public contract, so a caller is meant to
|
|
6
|
+
* branch on it. The CLI is a human surface as well as a scripting one, and a
|
|
7
|
+
* bare code plus the server's message leaves a developer to go and look the
|
|
8
|
+
* code up. These lines are the condensed form of the remedy column on
|
|
9
|
+
* https://docs.gojinko.com/concepts/errors — deliberately the same advice, so
|
|
10
|
+
* the terminal and the docs never disagree.
|
|
11
|
+
*
|
|
12
|
+
* Eleven of the twenty public codes appear here, plus `PRICE_CHANGED`, which the
|
|
13
|
+
* published enum does not list. The other nine are omitted rather than given
|
|
14
|
+
* invented prose: `BAD_REQUEST`, `NOT_FOUND`, `CONFLICT`, `INTERNAL` and the
|
|
15
|
+
* four `UPSTREAM_*` codes carry a server message that is already the specific
|
|
16
|
+
* part, so a generic "try again" line would add noise without adding
|
|
17
|
+
* information; `AUTH_REQUIRED` is omitted because `AuthError` already carries a
|
|
18
|
+
* full self-describing message naming where to get a key.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: jinko-api now publishes a machine-readable table of all twenty codes
|
|
21
|
+
* with statuses, summaries and remedies at `docs/error-codes.json`. Only
|
|
22
|
+
* `public-api.yaml` is vendored here, so this list is still hand-kept and its
|
|
23
|
+
* wording is a close paraphrase rather than a copy. Deriving it from that file
|
|
24
|
+
* would remove the drift risk entirely — worth doing, but it is a design change
|
|
25
|
+
* beyond the contract this round settles.
|
|
26
|
+
*/
|
|
27
|
+
export const ERROR_REMEDIES = Object.freeze({
|
|
28
|
+
PRICE_CHANGED: 'Read `items` for what moved, then call `checkout` again without `--fail-on-price-change` to accept the new price. Nothing was charged.',
|
|
29
|
+
GONE: 'Re-acquire what this command named — search again, or `checkout` again to re-quote — then retry with the new identifier. Repeating this one cannot succeed.',
|
|
30
|
+
QUOTE_EXPIRED: 'Call `checkout` again for a fresh quote and re-mint the payment token. Nothing was charged.',
|
|
31
|
+
TRIP_EXPIRED: 'This trip lapsed after 24 hours idle and cannot be revived. Start a new trip and add the items again.',
|
|
32
|
+
TRIP_STATE_CONFLICT: 'The trip is busy or already finished — read `status` to see which. Nothing was written.',
|
|
33
|
+
OFFER_EXPIRED: 'The offer token is no longer cached. Search again and add the item with a fresh token.',
|
|
34
|
+
OFFER_UNAVAILABLE: 'Search again for the occupancy you intend to book and pick a rate that covers it; this one cannot be quoted at any price.',
|
|
35
|
+
MISSING_CUSTOMER_DETAILS: 'Attach travelers and a contact carrying both an email and a phone, then check out again.',
|
|
36
|
+
CURRENCY_UNSUPPORTED: 'Retry in a supported currency. Agent payment in particular is dollar-only.',
|
|
37
|
+
FORBIDDEN: 'Do not rotate the key — it is working. Check that it is entitled to this operation, and on this environment.',
|
|
38
|
+
PAYMENT_REQUIRED: 'Your wallet is out of balance. Top it up in the dashboard, then retry.',
|
|
39
|
+
RATE_LIMITED: 'You are sending requests too fast. Back off, then retry.',
|
|
40
|
+
});
|
|
41
|
+
/** The remedy for a code, or undefined when it has no actionable next step. */
|
|
42
|
+
export function remedyFor(code) {
|
|
43
|
+
return code ? ERROR_REMEDIES[code] : undefined;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=remedies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remedies.js","sourceRoot":"","sources":["../../src/output/remedies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqC,MAAM,CAAC,MAAM,CAAC;IAC5E,aAAa,EACX,wIAAwI;IAC1I,IAAI,EACF,6JAA6J;IAC/J,aAAa,EACX,6FAA6F;IAC/F,YAAY,EACV,uGAAuG;IACzG,mBAAmB,EACjB,yFAAyF;IAC3F,aAAa,EACX,wFAAwF;IAC1F,iBAAiB,EACf,2HAA2H;IAC7H,wBAAwB,EACtB,0FAA0F;IAC5F,oBAAoB,EAClB,4EAA4E;IAC9E,SAAS,EACP,8GAA8G;IAChH,gBAAgB,EAAE,wEAAwE;IAC1F,YAAY,EAAE,0DAA0D;CACzE,CAAC,CAAC;AAEH,+EAA+E;AAC/E,MAAM,UAAU,SAAS,CAAC,IAAwB;IAChD,OAAO,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gojinko/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"jinko": "./dist/bin/jinko.js"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"docs:gen": "tsx scripts/gen-cli-docs.ts"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@gojinko/api-client": "2.
|
|
20
|
+
"@gojinko/api-client": "2.24.0",
|
|
21
21
|
"commander": "^12.1.0",
|
|
22
22
|
"chalk": "^5.4.1"
|
|
23
23
|
},
|