@gojinko/cli 2.9.0 → 2.11.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
@@ -29,6 +29,18 @@ jinko auth status # Show current method, expiry
29
29
  jinko auth logout # Clear stored credentials
30
30
  ```
31
31
 
32
+ ## Environments (prod / sandbox)
33
+
34
+ Defaults to **production**. Use `--env sandbox` to target the sandbox environment (isolated data, **separate API keys**):
35
+
36
+ ```bash
37
+ jinko auth login --env sandbox --key jnk_your_sandbox_key # store the sandbox key
38
+ jinko config set environment sandbox # make sandbox the default
39
+ jinko --env prod find-destination --origins NYC # one-off prod override
40
+ ```
41
+
42
+ Prod and sandbox keys are stored separately in `~/.jinko/config.yaml`. Resolution precedence: `--env` → `JINKO_ENV` → config `environment` → `prod`. `JINKO_API_BASE` overrides the mapped URL (for dev/staging).
43
+
32
44
  ## Commands
33
45
 
34
46
  ### Exploration (cached)
@@ -65,8 +77,7 @@ jinko auth logout # Clear stored credentials
65
77
 
66
78
  | Command | Description |
67
79
  |---|---|
68
- | `get-booking` | Retrieve the whole booking (flight + hotel) by reference (booking ref + last-name guest-auth). No subcommands. (Previously `lookup-booking`, which is kept as a hidden deprecated alias.) |
69
- | `hotel-cancel` | Cancel a hotel booking (idempotent, safe to retry). Guest auth (`--ref` + `--last-name`) or authenticated shortcut (`--provider-booking-id`). |
80
+ | `get-booking` | Retrieve the whole booking (flight + hotel) by reference (booking ref + last-name guest-auth). No subcommands. |
70
81
  | `refund check` | Check refund eligibility for a booking |
71
82
  | `refund commit` | Initiate a refund for a booking |
72
83
  | `refund status` | Check the status of a previously committed refund |
@@ -80,7 +91,7 @@ jinko auth logout # Clear stored credentials
80
91
 
81
92
  | Command | Description |
82
93
  |---|---|
83
- | `config set` / `config show` | Manage local config |
94
+ | `config set` / `config show` | Manage local config — `config set environment <prod\|sandbox>`, `config set api_key <jnk_…>` (stored under the active env) |
84
95
  | `schema [cmd]` | Show request/response schemas |
85
96
 
86
97
  ## Canonical Flow
@@ -1 +1 @@
1
- {"version":3,"file":"get-booking.d.ts","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6BhE"}
1
+ {"version":3,"file":"get-booking.d.ts","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAWhE"}
@@ -1,8 +1,7 @@
1
1
  import { withClient, output, resolveDeprecatedFlag } from './shared.js';
2
- // Shared commander action used by both the canonical `get-booking` command
3
- // and its deprecated `lookup-booking` alias (JIN-663). The canonical flag is
4
- // `--booking-ref` (matches the jinko-api `booking_ref` leaf); `--ref` is kept
5
- // as a deprecated alias (JIN-665).
2
+ // Commander action for `get-booking`. The canonical flag is `--booking-ref`
3
+ // (matches the jinko-api `booking_ref` leaf); `--ref` is kept as a deprecated
4
+ // alias (JIN-665).
6
5
  const action = withClient(async (client, globals, opts) => {
7
6
  const bookingRef = resolveDeprecatedFlag(opts.bookingRef, opts.ref, '--ref', '--booking-ref');
8
7
  if (!bookingRef) {
@@ -24,20 +23,5 @@ export function registerGetBookingCommand(program) {
24
23
  .requiredOption('--last-name <name>', 'Last name of the primary traveler. JSON: `last_name`. [required]')
25
24
  .option('--ref <ref>', 'DEPRECATED: use --booking-ref.')
26
25
  .action(action);
27
- // Deprecated alias (JIN-663) — hidden from `--help`, emits a one-line
28
- // deprecation warning to stderr, then runs the same action. Remove once
29
- // external scripts have migrated to `jinko get-booking`.
30
- program
31
- .command('lookup-booking', { hidden: true })
32
- .description('[DEPRECATED] Alias for `get-booking`. Use `get-booking` instead.')
33
- .option('--booking-ref <ref>', 'Jinko booking reference (e.g. JNK-A7B3X9). JSON: `booking_ref`. [required]')
34
- .requiredOption('--last-name <name>', 'Last name of the primary traveler. JSON: `last_name`. [required]')
35
- .option('--ref <ref>', 'DEPRECATED: use --booking-ref.')
36
- .action(function deprecatedLookupBookingAction(...args) {
37
- // eslint-disable-next-line no-console
38
- console.error('[DEPRECATED] `jinko lookup-booking` is renamed to `jinko get-booking`. ' +
39
- 'The old name will be removed in a future release.');
40
- return action.apply(this, args);
41
- });
42
26
  }
43
27
  //# sourceMappingURL=get-booking.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-booking.js","sourceRoot":"","sources":["../../src/commands/get-booking.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAExE,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,mCAAmC;AACnC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACxD,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IAC9F,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC;QACvC,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE,IAAI,CAAC,QAAQ;KACzB,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,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AC,mCAAmC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC;QACvC,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE,IAAI,CAAC,QAAQ;KACzB,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,OAAO,CAAC,mFAAmF,CAAC;SAC5F,WAAW,CACV,+VAA+V,CAChW;SACA,MAAM,CAAC,qBAAqB,EAAE,4EAA4E,CAAC;SAC3G,cAAc,CAAC,oBAAoB,EAAE,kEAAkE,CAAC;SACxG,MAAM,CAAC,aAAa,EAAE,gCAAgC,CAAC;SACvD,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gojinko/cli",
3
- "version": "2.9.0",
3
+ "version": "2.11.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.9.0",
20
+ "@gojinko/api-client": "2.11.0",
21
21
  "commander": "^12.1.0",
22
22
  "chalk": "^5.4.1",
23
23
  "open": "^10.0.0"