@gojinko/cli 2.21.0 → 2.22.1

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.
@@ -1,7 +1,6 @@
1
1
  /** Shared option registration + request building for the three travel-demand commands. */
2
2
  import type { Command } from 'commander';
3
- import { type DemandQuery, type JinkoClient, type Level, type TravelPeriod, type TravelerType, type TripType } from '@gojinko/api-client';
4
- export declare const TRAVEL_PERIODS: readonly TravelPeriod[];
3
+ import { type DemandQuery, type JinkoClient, type Level, type TravelerType, type TripType } from '@gojinko/api-client';
5
4
  export declare const TRAVELER_TYPES: readonly TravelerType[];
6
5
  export declare const TRIP_TYPES: readonly TripType[];
7
6
  export declare const LEVELS: string[];
@@ -9,10 +8,13 @@ export declare const LEVELS: string[];
9
8
  export declare const LEVEL_VALUES: readonly Level[];
10
9
  /** Raw option bag as parsed by Commander (camelCased flags). */
11
10
  export interface DemandCliOpts {
12
- originMarket?: string;
11
+ origin?: string;
12
+ /** market only: a Country selector, allowed only with --level city. */
13
+ originCountry?: string;
13
14
  destination?: string;
15
+ /** destination only: a Country selector, allowed only with --level city. */
16
+ destinationCountry?: string;
14
17
  level?: string;
15
- travelPeriod?: string;
16
18
  departureDateFrom?: string;
17
19
  departureDateTo?: string;
18
20
  travelerType?: string;
@@ -29,12 +31,57 @@ export interface BuildOpts {
29
31
  allowTravelerType?: boolean;
30
32
  /** Whether --level (ranked-output granularity) is a valid option (destination/market, not audience). */
31
33
  allowLevel?: boolean;
34
+ /**
35
+ * The market ranking takes `--origin-country` (a Country selector, allowed only
36
+ * with `--level city`) in place of the `--origin` filter used by
37
+ * destination/audience. When set, the builder reads/validates `--origin-country`
38
+ * and emits `origin_country`; otherwise it reads `--origin`.
39
+ */
40
+ originCountry?: boolean;
41
+ /**
42
+ * The destination ranking takes `--destination-country` (a Country selector,
43
+ * allowed only with `--level city`) in place of the plain `--destination`
44
+ * narrowing filter. When set, the builder reads/validates `--destination-country`
45
+ * and emits `destination_country`; otherwise it reads `--destination`.
46
+ */
47
+ destinationCountry?: boolean;
32
48
  }
33
49
  export declare function checkEnum<T extends string>(value: string | undefined, allowed: readonly T[], flag: string): T | undefined;
34
50
  export declare function checkLocation(value: string | undefined, flag: string): string | undefined;
51
+ /** The BFF's explicit "all origins" token for the `--origin` filter. */
52
+ export declare const GLOBAL_ORIGIN = "global";
53
+ /**
54
+ * Validate the ranked-origin FILTER (`--origin`, used by destination/audience and their
55
+ * trends). Like a location, but also accepts the literal `global` — the BFF's explicit
56
+ * "all origins" token (the destination endpoint requires an origin; `global` means
57
+ * "unfiltered / all source markets"). The Country-only SCOPE fields
58
+ * (`--origin-country` / `--destination-country`) do NOT accept it.
59
+ */
60
+ export declare function checkOriginFilter(value: string | undefined, flag?: string): string | undefined;
61
+ /**
62
+ * Validate a COUNTRY-only scope filter (`--origin-country` / `--destination-country`):
63
+ * it must be a COUNTRY selector (`Country:<code>`) and is only allowed together
64
+ * with `--level city` (it scopes the ranked side to one country so its cities are
65
+ * ranked). Mirrors resolveScopeCountry in the Go BFF.
66
+ */
67
+ export declare function checkScopeCountry(value: string | undefined, level: Level | undefined, flag: string): string | undefined;
68
+ /** market ranking: `--origin-country` scopes the ranked origin cities to one country. */
69
+ export declare function checkOriginCountry(value: string | undefined, level: Level | undefined): string | undefined;
70
+ /** destination ranking: `--destination-country` scopes the ranked destination cities to one country. */
71
+ export declare function checkDestinationCountry(value: string | undefined, level: Level | undefined): string | undefined;
35
72
  export declare function checkDate(value: string | undefined, flag: string): string | undefined;
36
73
  export declare function checkNonNegInt(value: string | undefined, flag: string): number | undefined;
37
74
  export declare function checkRangeInt(value: string | undefined, flag: string, min: number, max: number, oneDayReason?: string): number | undefined;
75
+ /**
76
+ * Validate the optional departure-date window: both bounds together (or neither),
77
+ * with --departure-date-to on or after --departure-date-from. When both are omitted
78
+ * no departure-date filter is applied (all departure dates). Returns the validated
79
+ * [from, to]. Throws UsageError (exit 3) on bad input. Shared with the trend commands.
80
+ */
81
+ export declare function checkDepartureWindow(fromRaw: string | undefined, toRaw: string | undefined): {
82
+ from?: string;
83
+ to?: string;
84
+ };
38
85
  /** Validate CLI options and build the wire query. Throws UsageError (exit 3) on bad input. */
39
86
  export declare function buildDemandQuery(opts: DemandCliOpts, build?: BuildOpts): DemandQuery;
40
87
  /**
@@ -50,6 +97,24 @@ export declare function demandAction(build: BuildOpts, call: (client: JinkoClien
50
97
  * which buckets by traveler type, nor the explicit-pairs trend command.
51
98
  */
52
99
  export declare function addLevelOption(cmd: Command): Command;
53
- /** Register the query options shared by all three demand commands. */
100
+ /**
101
+ * Register `--origin` (destination/audience rankings + their trend variants):
102
+ * a `<Level>:<Code>` origin filter that accepts City or Country, or `global`.
103
+ */
104
+ export declare function addOriginOption(cmd: Command): Command;
105
+ /**
106
+ * Register `--origin-country` (market ranking + market-trend only): a COUNTRY
107
+ * selector, allowed only with `--level city`, that narrows the ranking to that
108
+ * country's origin cities. Registered after `--level` so it reads as a modifier of it.
109
+ */
110
+ export declare function addOriginCountryOption(cmd: Command): Command;
111
+ /**
112
+ * Register `--destination-country` (destination ranking + destination-trend only):
113
+ * a COUNTRY selector, allowed only with `--level city`, that narrows the ranking to
114
+ * that country's destination cities. The symmetric mirror of `--origin-country`.
115
+ * Registered after `--level` so it reads as a modifier of it.
116
+ */
117
+ export declare function addDestinationCountryOption(cmd: Command): Command;
118
+ /** Register the query options shared by all three demand commands (origin is per-command). */
54
119
  export declare function addCommonDemandOptions(cmd: Command): Command;
55
120
  //# sourceMappingURL=demand-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"demand-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/travel-demand/demand-shared.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB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pB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAYhC;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,GAAE,SAAc,GAAG,WAAW,CA0ExF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,IAE5C,MAAM,OAAO,EAAE,GAAG,MAAM,OAAO,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAiBzE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMpD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKrD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAK5D;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKjE;AAED,8FAA8F;AAC9F,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA0B5D"}
@@ -1,15 +1,6 @@
1
1
  import { createJinkoClient, } from '@gojinko/api-client';
2
2
  import { getGlobalOptions } from '../../config/config.js';
3
3
  import { exitWithError, output, resolveCommandPath, UsageError } from '../shared.js';
4
- export const TRAVEL_PERIODS = [
5
- 'Summer',
6
- 'Winter',
7
- 'Christmas',
8
- 'Easter',
9
- 'Next30Days',
10
- 'Next90Days',
11
- 'Custom',
12
- ];
13
4
  export const TRAVELER_TYPES = ['Solo', 'Couple', 'Group', 'Family'];
14
5
  export const TRIP_TYPES = ['One-Way', 'Round-Trip'];
15
6
  export const LEVELS = ['City', 'Country'];
@@ -36,6 +27,48 @@ export function checkLocation(value, flag) {
36
27
  }
37
28
  return value;
38
29
  }
30
+ /** The BFF's explicit "all origins" token for the `--origin` filter. */
31
+ export const GLOBAL_ORIGIN = 'global';
32
+ /**
33
+ * Validate the ranked-origin FILTER (`--origin`, used by destination/audience and their
34
+ * trends). Like a location, but also accepts the literal `global` — the BFF's explicit
35
+ * "all origins" token (the destination endpoint requires an origin; `global` means
36
+ * "unfiltered / all source markets"). The Country-only SCOPE fields
37
+ * (`--origin-country` / `--destination-country`) do NOT accept it.
38
+ */
39
+ export function checkOriginFilter(value, flag = '--origin') {
40
+ if (value === undefined)
41
+ return undefined;
42
+ if (value === GLOBAL_ORIGIN)
43
+ return value;
44
+ return checkLocation(value, flag);
45
+ }
46
+ /**
47
+ * Validate a COUNTRY-only scope filter (`--origin-country` / `--destination-country`):
48
+ * it must be a COUNTRY selector (`Country:<code>`) and is only allowed together
49
+ * with `--level city` (it scopes the ranked side to one country so its cities are
50
+ * ranked). Mirrors resolveScopeCountry in the Go BFF.
51
+ */
52
+ export function checkScopeCountry(value, level, flag) {
53
+ if (value === undefined)
54
+ return undefined;
55
+ const loc = checkLocation(value, flag);
56
+ if (!loc || !loc.startsWith('Country:')) {
57
+ throw new UsageError(`${flag} must be a country selector, e.g. Country:US (a City is not allowed) (got "${value}")`);
58
+ }
59
+ if (level !== 'city') {
60
+ throw new UsageError(`${flag} is only allowed together with --level city`);
61
+ }
62
+ return loc;
63
+ }
64
+ /** market ranking: `--origin-country` scopes the ranked origin cities to one country. */
65
+ export function checkOriginCountry(value, level) {
66
+ return checkScopeCountry(value, level, '--origin-country');
67
+ }
68
+ /** destination ranking: `--destination-country` scopes the ranked destination cities to one country. */
69
+ export function checkDestinationCountry(value, level) {
70
+ return checkScopeCountry(value, level, '--destination-country');
71
+ }
39
72
  export function checkDate(value, flag) {
40
73
  if (value === undefined)
41
74
  return undefined;
@@ -82,30 +115,49 @@ oneDayReason = 'a 1-day window relies on the current day, whose search data is n
82
115
  }
83
116
  return n;
84
117
  }
85
- /** Validate CLI options and build the wire query. Throws UsageError (exit 3) on bad input. */
86
- export function buildDemandQuery(opts, build = {}) {
87
- const travelPeriod = checkEnum(opts.travelPeriod, TRAVEL_PERIODS, '--travel-period');
88
- const from = checkDate(opts.departureDateFrom, '--departure-date-from');
89
- const to = checkDate(opts.departureDateTo, '--departure-date-to');
90
- if (travelPeriod === 'Custom') {
91
- if (!from || !to) {
92
- throw new UsageError('--travel-period Custom requires both --departure-date-from and --departure-date-to');
93
- }
94
- if (to < from) {
95
- throw new UsageError('--departure-date-to must be on or after --departure-date-from');
96
- }
118
+ /**
119
+ * Validate the optional departure-date window: both bounds together (or neither),
120
+ * with --departure-date-to on or after --departure-date-from. When both are omitted
121
+ * no departure-date filter is applied (all departure dates). Returns the validated
122
+ * [from, to]. Throws UsageError (exit 3) on bad input. Shared with the trend commands.
123
+ */
124
+ export function checkDepartureWindow(fromRaw, toRaw) {
125
+ const from = checkDate(fromRaw, '--departure-date-from');
126
+ const to = checkDate(toRaw, '--departure-date-to');
127
+ if ((from && !to) || (!from && to)) {
128
+ throw new UsageError('--departure-date-from and --departure-date-to must be provided together');
97
129
  }
98
- else if (from || to) {
99
- throw new UsageError('--departure-date-from/--departure-date-to are only valid with --travel-period Custom');
130
+ if (from && to && to < from) {
131
+ throw new UsageError('--departure-date-to must be on or after --departure-date-from');
100
132
  }
101
- const destination = checkLocation(opts.destination, '--destination');
133
+ return { from, to };
134
+ }
135
+ /** Validate CLI options and build the wire query. Throws UsageError (exit 3) on bad input. */
136
+ export function buildDemandQuery(opts, build = {}) {
137
+ const { from, to } = checkDepartureWindow(opts.departureDateFrom, opts.departureDateTo);
138
+ const level = build.allowLevel
139
+ ? checkEnum(opts.level, LEVEL_VALUES, '--level')
140
+ : undefined;
141
+ // destination takes --destination-country (Country-only, --level city only) in
142
+ // place of the plain --destination narrowing filter; market/audience take the
143
+ // required/optional --destination. Mutually exclusive per command.
144
+ const destinationCountry = build.destinationCountry
145
+ ? checkDestinationCountry(opts.destinationCountry, level)
146
+ : undefined;
147
+ const destination = build.destinationCountry
148
+ ? undefined
149
+ : checkLocation(opts.destination, '--destination');
102
150
  if (build.requireDestination && !destination) {
103
151
  throw new UsageError('--destination is required for this command (e.g. --destination Country:TH)');
104
152
  }
105
- const originMarket = checkLocation(opts.originMarket, '--origin-market');
106
- const level = build.allowLevel
107
- ? checkEnum(opts.level, LEVEL_VALUES, '--level')
153
+ // market takes --origin-country (Country-only, --level city only); the other
154
+ // rankings take --origin. The two are mutually exclusive per command.
155
+ const originCountry = build.originCountry
156
+ ? checkOriginCountry(opts.originCountry, level)
108
157
  : undefined;
158
+ const origin = build.originCountry
159
+ ? undefined
160
+ : checkOriginFilter(opts.origin, '--origin');
109
161
  const travelerType = build.allowTravelerType
110
162
  ? checkEnum(opts.travelerType, TRAVELER_TYPES, '--traveler-type')
111
163
  : undefined;
@@ -129,14 +181,16 @@ export function buildDemandQuery(opts, build = {}) {
129
181
  const snapshotWindowDays = checkRangeInt(opts.snapshotWindowDays, '--snapshot-window-days', 2, 90);
130
182
  const limit = checkLimit(opts.limit);
131
183
  const query = {};
132
- if (originMarket)
133
- query.origin_market = originMarket;
184
+ if (origin)
185
+ query.origin = origin;
186
+ if (originCountry)
187
+ query.origin_country = originCountry;
134
188
  if (destination)
135
189
  query.destination = destination;
190
+ if (destinationCountry)
191
+ query.destination_country = destinationCountry;
136
192
  if (level)
137
193
  query.level = level;
138
- if (travelPeriod)
139
- query.travel_period = travelPeriod;
140
194
  if (from)
141
195
  query.departure_date_from = from;
142
196
  if (to)
@@ -193,13 +247,35 @@ export function demandAction(build, call) {
193
247
  export function addLevelOption(cmd) {
194
248
  return cmd.option('--level <level>', 'ranked output granularity: country (default) or city', 'country');
195
249
  }
196
- /** Register the query options shared by all three demand commands. */
250
+ /**
251
+ * Register `--origin` (destination/audience rankings + their trend variants):
252
+ * a `<Level>:<Code>` origin filter that accepts City or Country, or `global`.
253
+ */
254
+ export function addOriginOption(cmd) {
255
+ return cmd.option('--origin <level:code>', "origin filter, e.g. Country:US or City:NYC (or 'global' for all origins)");
256
+ }
257
+ /**
258
+ * Register `--origin-country` (market ranking + market-trend only): a COUNTRY
259
+ * selector, allowed only with `--level city`, that narrows the ranking to that
260
+ * country's origin cities. Registered after `--level` so it reads as a modifier of it.
261
+ */
262
+ export function addOriginCountryOption(cmd) {
263
+ return cmd.option('--origin-country <Country:code>', "origin country to rank cities within, e.g. Country:US — allowed only with --level city");
264
+ }
265
+ /**
266
+ * Register `--destination-country` (destination ranking + destination-trend only):
267
+ * a COUNTRY selector, allowed only with `--level city`, that narrows the ranking to
268
+ * that country's destination cities. The symmetric mirror of `--origin-country`.
269
+ * Registered after `--level` so it reads as a modifier of it.
270
+ */
271
+ export function addDestinationCountryOption(cmd) {
272
+ return cmd.option('--destination-country <Country:code>', "destination country to rank cities within, e.g. Country:FR — allowed only with --level city");
273
+ }
274
+ /** Register the query options shared by all three demand commands (origin is per-command). */
197
275
  export function addCommonDemandOptions(cmd) {
198
276
  return cmd
199
- .option('--origin-market <level:code>', 'origin market filter, e.g. Country:US or City:NYC')
200
- .option('--travel-period <period>', 'Summer|Winter|Christmas|Easter|Next30Days|Next90Days|Custom (default Next90Days)')
201
- .option('--departure-date-from <YYYY-MM-DD>', 'start of departure window (requires --travel-period Custom)')
202
- .option('--departure-date-to <YYYY-MM-DD>', 'end of departure window (requires --travel-period Custom)')
277
+ .option('--departure-date-from <YYYY-MM-DD>', 'start of departure window (use with --departure-date-to; omit both for no departure-date filter)')
278
+ .option('--departure-date-to <YYYY-MM-DD>', 'end of departure window (use with --departure-date-from; omit both for no departure-date filter)')
203
279
  .option('--trip-type <type>', 'One-Way|Round-Trip')
204
280
  .option('--trip-duration-min <n>', 'minimum trip length in nights (round-trips only, >= 0)')
205
281
  .option('--trip-duration-max <n>', 'maximum trip length in nights (>= --trip-duration-min)')
@@ -1 +1 @@
1
- {"version":3,"file":"demand-shared.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/demand-shared.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,GAOlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAErF,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,QAAQ;CACT,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC1C,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAClE,MAAM,OAAO,GAAG,qBAAqB,CAAC;AA2BtC,MAAM,UAAU,SAAS,CACvB,KAAyB,EACzB,OAAqB,EACrB,IAAY;IAEZ,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAU,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,oBAAoB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,KAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAyB,EAAE,I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UAAU,cAAc,CAAC,GAAY;IACzC,OAAO,GAAG,CAAC,MAAM,CACf,iBAAiB,EACjB,sDAAsD,EACtD,SAAS,CACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,GAAG,CAAC,MAAM,CACf,uBAAuB,EACvB,0EAA0E,CAC3E,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,OAAO,GAAG,CAAC,MAAM,CACf,iCAAiC,EACjC,wFAAwF,CACzF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAY;IACtD,OAAO,GAAG,CAAC,MAAM,CACf,sCAAsC,EACtC,6FAA6F,CAC9F,CAAC;AACJ,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,OAAO,GAAG;SACP,MAAM,CACL,oCAAoC,EACpC,kGAAkG,CACnG;SACA,MAAM,CACL,kCAAkC,EAClC,kGAAkG,CACnG;SACA,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;SAClD,MAAM,CAAC,yBAAyB,EAAE,wDAAwD,CAAC;SAC3F,MAAM,CAAC,yBAAyB,EAAE,wDAAwD,CAAC;SAC3F,MAAM,CACL,yBAAyB,EACzB,iEAAiE,CAClE;SACA,MAAM,CACL,yBAAyB,EACzB,kEAAkE,CACnE;SACA,MAAM,CACL,4BAA4B,EAC5B,mFAAmF,CACpF;SACA,MAAM,CAAC,aAAa,EAAE,8BAA8B,CAAC,CAAC;AAC3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/travel-demand/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2DnE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/travel-demand/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2EnE"}
@@ -1,4 +1,4 @@
1
- import { addCommonDemandOptions, addLevelOption, demandAction } from './demand-shared.js';
1
+ import { addCommonDemandOptions, addDestinationCountryOption, addLevelOption, addOriginCountryOption, addOriginOption, demandAction, } from './demand-shared.js';
2
2
  import { addCommonTrendOptions, addRankedTrendOptions, buildPairsTrendQuery, buildRankedTrendQuery, collectLocations, trendAction, } from './trend-shared.js';
3
3
  /**
4
4
  * `jinko travel-demand <operation>` — Travel Demand Intelligence (JIN-1378, JIN-1471).
@@ -18,25 +18,31 @@ export function registerTravelDemandCommands(program) {
18
18
  .description('Query de-sampled search-demand analytics (JIN-1378, JIN-1471): the most-searched ' +
19
19
  'destinations, the source markets driving demand for a destination, and the traveler-type ' +
20
20
  'mix — as point-in-time rankings, or as "trend" time series you can plot over a window.');
21
- addLevelOption(addCommonDemandOptions(td
21
+ // Option order = --help / generated-docs order. --origin is the primary filter
22
+ // and comes FIRST; the Country-only scope filter (--destination-country) comes
23
+ // last, right after --level (it is only valid with --level city). This mirrors
24
+ // the jinko-api /v1/destination parameter order.
25
+ addDestinationCountryOption(addLevelOption(addCommonDemandOptions(addOriginOption(td
22
26
  .command('destination')
23
27
  .summary('Top destinations by search demand')
24
- .description('Most-searched destinations by de-sampled request share. Optionally scope to an origin ' +
25
- 'market with --origin-market, or filter to a single destination with --destination.')
26
- .option('--destination <level:code>', 'optional destination filter, e.g. Country:TH')
27
- .option('--traveler-type <type>', 'Solo|Couple|Group|Family'))).action(demandAction({ allowTravelerType: true, allowLevel: true }, (client, query) => client.demandDestination(query)));
28
- addLevelOption(addCommonDemandOptions(td
28
+ .description('Most-searched destinations by de-sampled request share. Optionally scope to a single ' +
29
+ 'origin with --origin. Optional --destination-country (a Country selector, allowed ' +
30
+ "only with --level city) narrows the ranking to that country's destination cities.")).option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(demandAction({ allowTravelerType: true, allowLevel: true, destinationCountry: true }, (client, query) => client.demandDestination(query)));
31
+ addOriginCountryOption(addLevelOption(addCommonDemandOptions(td
29
32
  .command('market')
30
33
  .summary('Top source markets for a destination')
31
- .description('Which source markets generate the most demand for a destination. --destination is required.')
34
+ .description('Which source markets generate the most demand for a destination. --destination is ' +
35
+ 'required. Optional --origin-country (a Country selector, allowed only with --level ' +
36
+ "city) narrows the ranking to that country's origin cities.")
32
37
  .option('--destination <level:code>', 'destination, e.g. Country:TH (required)')
33
- .option('--traveler-type <type>', 'Solo|Couple|Group|Family'))).action(demandAction({ requireDestination: true, allowTravelerType: true, allowLevel: true }, (client, query) => client.demandMarket(query)));
34
- addCommonDemandOptions(td
38
+ .option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(demandAction({ requireDestination: true, allowTravelerType: true, allowLevel: true, originCountry: true }, (client, query) => client.demandMarket(query)));
39
+ // --origin first (primary filter), then the required --destination — mirrors the
40
+ // jinko-api /v1/audience order. Audience has no --level / scope-country filter.
41
+ addCommonDemandOptions(addOriginOption(td
35
42
  .command('audience')
36
43
  .summary('Traveler-type mix for a destination')
37
44
  .description('Traveler-type composition (Solo/Couple/Family/Group) of demand for a destination. ' +
38
- '--destination is required. (traveler_type is not a filter here — it is the dimension.)')
39
- .option('--destination <level:code>', 'destination, e.g. Country:JP (required)')).action(demandAction({ requireDestination: true }, (client, query) => client.demandAudience(query)));
45
+ '--destination is required. (traveler_type is not a filter here — it is the dimension.)')).option('--destination <level:code>', 'destination, e.g. Country:JP (required)')).action(demandAction({ requireDestination: true }, (client, query) => client.demandAudience(query)));
40
46
  registerTrendCommands(td);
41
47
  }
42
48
  /**
@@ -58,29 +64,39 @@ function registerTrendCommands(td) {
58
64
  .option('--origin <level:code>', 'origin selector, e.g. Country:US (repeatable)', collectLocations, [])
59
65
  .option('--destination <level:code>', 'destination selector, e.g. Country:FR (repeatable)', collectLocations, [])
60
66
  .option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(trendAction(buildPairsTrendQuery, (client, query) => client.demandTrend(query)));
61
- addLevelOption(addRankedTrendOptions(td
67
+ // Same order as the /destination ranking: --origin first, --destination-country
68
+ // last (right after --level). Mirrors jinko-api /v1/destination/trend.
69
+ addDestinationCountryOption(addLevelOption(addRankedTrendOptions(addOriginOption(td
62
70
  .command('destination-trend')
63
71
  .summary('Demand time series for the top-N destinations')
64
- .description('Ranks destinations (optionally reachable from --origin-market) by within-window growth, ' +
65
- 'then returns each top-N destination’s series.')
66
- .option('--destination <level:code>', 'optional destination filter, e.g. Country:TH')
67
- .option('--traveler-type <type>', 'Solo|Couple|Group|Family'))).action(trendAction((opts) => buildRankedTrendQuery(opts, { allowTravelerType: true, allowLevel: true }), (client, query) => client.demandDestinationTrend(query)));
68
- addLevelOption(addRankedTrendOptions(td
72
+ .description('Ranks destinations (optionally reachable from --origin) by within-window growth, ' +
73
+ 'then returns each top-N destination’s series. Optional --destination-country (a Country ' +
74
+ "selector, allowed only with --level city) narrows the ranking to that country's " +
75
+ 'destination cities.')).option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
76
+ allowTravelerType: true,
77
+ allowLevel: true,
78
+ destinationCountry: true,
79
+ }), (client, query) => client.demandDestinationTrend(query)));
80
+ addOriginCountryOption(addLevelOption(addRankedTrendOptions(td
69
81
  .command('market-trend')
70
82
  .summary('Demand time series for the top-N source markets')
71
83
  .description('Ranks source markets for a destination by within-window growth, then returns each ' +
72
- 'top-N market’s series. --destination is required.')
84
+ 'top-N market’s series. --destination is required. Optional --origin-country (a ' +
85
+ "Country selector, allowed only with --level city) narrows the ranking to that " +
86
+ "country's origin cities.")
73
87
  .option('--destination <level:code>', 'destination, e.g. Country:TH (required)')
74
- .option('--traveler-type <type>', 'Solo|Couple|Group|Family'))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
88
+ .option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
75
89
  requireDestination: true,
76
90
  allowTravelerType: true,
77
91
  allowLevel: true,
92
+ originCountry: true,
78
93
  }), (client, query) => client.demandMarketTrend(query)));
79
- addRankedTrendOptions(td
94
+ // --origin first, then required --destination — mirrors jinko-api
95
+ // /v1/audience/trend. Audience trend has no --level / scope-country filter.
96
+ addRankedTrendOptions(addOriginOption(td
80
97
  .command('audience-trend')
81
98
  .summary('Demand time series for the traveler-type mix')
82
99
  .description('A series per traveler-type segment (Solo/Couple/Family/Group) of demand for a ' +
83
- 'destination. --destination is required. (traveler_type is not a filter here — it is the dimension.)')
84
- .option('--destination <level:code>', 'destination, e.g. Country:JP (required)')).action(trendAction((opts) => buildRankedTrendQuery(opts, { requireDestination: true }), (client, query) => client.demandAudienceTrend(query)));
100
+ 'destination. --destination is required. (traveler_type is not a filter here — it is the dimension.)')).option('--destination <level:code>', 'destination, e.g. Country:JP (required)')).action(trendAction((opts) => buildRankedTrendQuery(opts, { requireDestination: true }), (client, query) => client.demandAudienceTrend(query)));
85
101
  }
86
102
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,MAAM,EAAE,GAAG,OAAO;SACf,OAAO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,CAAC,CACxD,CACF,CAAC;IAEF,cAAc,CACZ,qBAAqB,CACnB,EAAE;SACC,OAAO,CAAC,cAAc,CAAC;SACvB,OAAO,CAAC,iDAAiD,CAAC;SAC1D,WAAW,CACV,oFAAoF;QAClF,mDAAmD,CACtD;SACA,MAAM,CAAC,4BAA4B,EAAE,yCAAyC,CAAC;SAC/E,MAAM,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAChE,CACF,CAAC,MAAM,CACN,WAAW,CACT,CAAC,IAAI,EAAE,EAAE,CACP,qBAAqB,CAAC,IAAI,EAAE;QAC1B,kBAAkB,EAAE,IAAI;QACxB,iBAAiB,EAAE,IAAI;QACvB,UAAU,EAAE,IAAI;KACjB,CAAC,EACJ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CACnD,CACF,CAAC;IAEF,qBAAqB,CACnB,EAAE;SACC,OAAO,CAAC,gBAAgB,CAAC;SACzB,OAAO,CAAC,8CAA8C,CAAC;SACvD,WAAW,CACV,gFAAgF;QAC9E,qGAAqG,CACxG;SACA,MAAM,CAAC,4BAA4B,EAAE,yCAAyC,CAAC,CACnF,CAAC,MAAM,CACN,WAAW,CACT,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,EACnE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CACrD,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,q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;QAC9E,qGAAqG,CACxG,CACJ,CAAC,MAAM,CAAC,4BAA4B,EAAE,yCAAyC,CAAC,CAClF,CAAC,MAAM,CACN,WAAW,CACT,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,EACnE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CACrD,CACF,CAAC;AACJ,CAAC"}
@@ -19,12 +19,14 @@ import type { Command } from 'commander';
19
19
  import { type DemandTrendQuery, type JinkoClient } from '@gojinko/api-client';
20
20
  /** Raw option bag as parsed by Commander (camelCased flags). */
21
21
  export interface TrendCliOpts {
22
- origin?: string[];
22
+ origin?: string | string[];
23
23
  destination?: string | string[];
24
- originMarket?: string;
24
+ /** market-trend only: a Country selector, allowed only with --level city. */
25
+ originCountry?: string;
26
+ /** destination-trend only: a Country selector, allowed only with --level city. */
27
+ destinationCountry?: string;
25
28
  level?: string;
26
29
  limit?: string;
27
- travelPeriod?: string;
28
30
  departureDateFrom?: string;
29
31
  departureDateTo?: string;
30
32
  travelerType?: string;
@@ -43,6 +45,19 @@ export interface TrendBuildOpts {
43
45
  allowTravelerType?: boolean;
44
46
  /** Whether --level (ranked-output granularity) is valid (destination/market trend, not audience). */
45
47
  allowLevel?: boolean;
48
+ /**
49
+ * market-trend takes `--origin-country` (a Country selector, allowed only with
50
+ * `--level city`) in place of `--origin`. When set, the builder
51
+ * reads/validates `--origin-country` and emits `origin_country`.
52
+ */
53
+ originCountry?: boolean;
54
+ /**
55
+ * destination-trend takes `--destination-country` (a Country selector, allowed
56
+ * only with `--level city`) in place of the plain `--destination` narrowing
57
+ * filter. When set, the builder reads/validates `--destination-country` and
58
+ * emits `destination_country`.
59
+ */
60
+ destinationCountry?: boolean;
46
61
  }
47
62
  /**
48
63
  * Commander collector for the repeatable, comma-splittable `--origin` /
@@ -67,6 +82,10 @@ export declare function buildRankedTrendQuery(opts: TrendCliOpts, build: TrendBu
67
82
  export declare function trendAction(buildQuery: (opts: TrendCliOpts) => DemandTrendQuery, call: (client: JinkoClient, query: DemandTrendQuery) => Promise<unknown>): (this: Command, ...args: unknown[]) => Promise<void>;
68
83
  /** Register the filter options shared by all four trend commands. */
69
84
  export declare function addCommonTrendOptions(cmd: Command): Command;
70
- /** Register the options common to the three RANKED trend commands (origin-market + top-N limit). */
85
+ /**
86
+ * Register the options common to the three RANKED trend commands (top-N limit).
87
+ * The origin option is per-command: destination/audience trend take
88
+ * `--origin`, market-trend takes `--origin-country` (added in index.ts).
89
+ */
71
90
  export declare function addRankedTrendOptions(cmd: Command): Command;
72
91
  //# sourceMappingURL=trend-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trend-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/travel-demand/trend-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AA+B7B,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAE3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEhC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IAC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AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAoCzE;AAED,oFAAoF;AACpF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,cAAc,GACpB,gBAAgB,CAyClB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,gBAAgB,EACpD,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,IAEjD,MAAM,OAAO,EAAE,GAAG,MAAM,OAAO,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAiBzE;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA8B3D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAK3D"}
@@ -1,7 +1,7 @@
1
1
  import { createJinkoClient, } from '@gojinko/api-client';
2
2
  import { getGlobalOptions } from '../../config/config.js';
3
3
  import { exitWithError, output, resolveCommandPath, UsageError } from '../shared.js';
4
- import { checkDate, checkEnum, checkLocation, checkNonNegInt, checkRangeInt, LEVEL_VALUES, TRAVEL_PERIODS, TRAVELER_TYPES, TRIP_TYPES, } from './demand-shared.js';
4
+ import { checkDepartureWindow, checkDestinationCountry, checkEnum, checkLocation, checkNonNegInt, checkOriginCountry, checkOriginFilter, checkRangeInt, LEVEL_VALUES, TRAVELER_TYPES, TRIP_TYPES, } from './demand-shared.js';
5
5
  const GRANULARITIES = ['day', 'week', 'month'];
6
6
  /** Default series bucket size when --granularity is omitted (mirrors trend.go). */
7
7
  const DEFAULT_GRANULARITY = 'week';
@@ -36,20 +36,7 @@ function checkTrendLimit(value) {
36
36
  }
37
37
  /** Validate the filters shared by all four trend commands and build the common query slice. */
38
38
  function buildCommonTrend(opts, build) {
39
- const travelPeriod = checkEnum(opts.travelPeriod, TRAVEL_PERIODS, '--travel-period');
40
- const from = checkDate(opts.departureDateFrom, '--departure-date-from');
41
- const to = checkDate(opts.departureDateTo, '--departure-date-to');
42
- if (travelPeriod === 'Custom') {
43
- if (!from || !to) {
44
- throw new UsageError('--travel-period Custom requires both --departure-date-from and --departure-date-to');
45
- }
46
- if (to < from) {
47
- throw new UsageError('--departure-date-to must be on or after --departure-date-from');
48
- }
49
- }
50
- else if (from || to) {
51
- throw new UsageError('--departure-date-from/--departure-date-to are only valid with --travel-period Custom');
52
- }
39
+ const { from, to } = checkDepartureWindow(opts.departureDateFrom, opts.departureDateTo);
53
40
  const travelerType = build.allowTravelerType
54
41
  ? checkEnum(opts.travelerType, TRAVELER_TYPES, '--traveler-type')
55
42
  : undefined;
@@ -78,8 +65,6 @@ function buildCommonTrend(opts, build) {
78
65
  // depends on the granularity (day 60, week 52, month 12).
79
66
  const trendWindow = checkRangeInt(opts.trendWindow, '--trend-window', 2, MAX_TREND_WINDOW[granularity], 'a trend series needs at least 2 buckets');
80
67
  const query = {};
81
- if (travelPeriod)
82
- query.travel_period = travelPeriod;
83
68
  if (from)
84
69
  query.departure_date_from = from;
85
70
  if (to)
@@ -139,19 +124,38 @@ export function buildPairsTrendQuery(opts) {
139
124
  /** Build the query for a ranked trend command (destination / market / audience). */
140
125
  export function buildRankedTrendQuery(opts, build) {
141
126
  const query = buildCommonTrend(opts, build);
142
- const destination = checkLocation(Array.isArray(opts.destination) ? opts.destination[0] : opts.destination, '--destination');
127
+ const level = build.allowLevel
128
+ ? checkEnum(opts.level, LEVEL_VALUES, '--level')
129
+ : undefined;
130
+ // destination-trend takes --destination-country (Country-only, --level city
131
+ // only) in place of the plain --destination narrowing filter; market/audience
132
+ // trend take the required/optional --destination. Mutually exclusive per command.
133
+ const destinationCountry = build.destinationCountry
134
+ ? checkDestinationCountry(opts.destinationCountry, level)
135
+ : undefined;
136
+ const destination = build.destinationCountry
137
+ ? undefined
138
+ : checkLocation(Array.isArray(opts.destination) ? opts.destination[0] : opts.destination, '--destination');
143
139
  if (build.requireDestination && !destination) {
144
140
  throw new UsageError('--destination is required for this command (e.g. --destination Country:TH)');
145
141
  }
146
- const originMarket = checkLocation(opts.originMarket, '--origin-market');
147
- const level = build.allowLevel
148
- ? checkEnum(opts.level, LEVEL_VALUES, '--level')
142
+ // market-trend takes --origin-country (Country-only, --level city only); the
143
+ // other ranked trends take --origin. Mutually exclusive per command.
144
+ const originCountry = build.originCountry
145
+ ? checkOriginCountry(opts.originCountry, level)
149
146
  : undefined;
147
+ const origin = build.originCountry
148
+ ? undefined
149
+ : checkOriginFilter(Array.isArray(opts.origin) ? opts.origin[0] : opts.origin, '--origin');
150
150
  const limit = checkTrendLimit(opts.limit);
151
151
  if (destination)
152
152
  query.destination = destination;
153
- if (originMarket)
154
- query.origin_market = originMarket;
153
+ if (destinationCountry)
154
+ query.destination_country = destinationCountry;
155
+ if (origin)
156
+ query.origin = origin;
157
+ if (originCountry)
158
+ query.origin_country = originCountry;
155
159
  if (level)
156
160
  query.level = level;
157
161
  if (limit !== undefined)
@@ -186,9 +190,8 @@ export function trendAction(buildQuery, call) {
186
190
  /** Register the filter options shared by all four trend commands. */
187
191
  export function addCommonTrendOptions(cmd) {
188
192
  return cmd
189
- .option('--travel-period <period>', 'Summer|Winter|Christmas|Easter|Next30Days|Next90Days|Custom (default Next90Days)')
190
- .option('--departure-date-from <YYYY-MM-DD>', 'start of departure window (requires --travel-period Custom)')
191
- .option('--departure-date-to <YYYY-MM-DD>', 'end of departure window (requires --travel-period Custom)')
193
+ .option('--departure-date-from <YYYY-MM-DD>', 'start of departure window (use with --departure-date-to; omit both for no departure-date filter — buckets count searches for all departure dates, recommended)')
194
+ .option('--departure-date-to <YYYY-MM-DD>', 'end of departure window (use with --departure-date-from; omit both for no departure-date filter)')
192
195
  .option('--trip-type <type>', 'One-Way|Round-Trip')
193
196
  .option('--trip-duration-min <n>', 'minimum trip length in nights (round-trips only, >= 0)')
194
197
  .option('--trip-duration-max <n>', 'maximum trip length in nights (>= --trip-duration-min)')
@@ -197,10 +200,12 @@ export function addCommonTrendOptions(cmd) {
197
200
  .option('--trend-window <n>', 'number of buckets the series spans, in the granularity unit (day 2-60 | week 2-52 | month 2-12, default 12)')
198
201
  .option('--granularity <bucket>', 'series bucket size: week (default) | day | month', DEFAULT_GRANULARITY);
199
202
  }
200
- /** Register the options common to the three RANKED trend commands (origin-market + top-N limit). */
203
+ /**
204
+ * Register the options common to the three RANKED trend commands (top-N limit).
205
+ * The origin option is per-command: destination/audience trend take
206
+ * `--origin`, market-trend takes `--origin-country` (added in index.ts).
207
+ */
201
208
  export function addRankedTrendOptions(cmd) {
202
- return addCommonTrendOptions(cmd)
203
- .option('--origin-market <level:code>', 'origin market filter/scope, e.g. Country:US or City:NYC')
204
- .option('--limit <n>', 'max number of series (top-N), 1-50 (default 10)');
209
+ return addCommonTrendOptions(cmd).option('--limit <n>', 'max number of series (top-N), 1-50 (default 10)');
205
210
  }
206
211
  //# sourceMappingURL=trend-shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trend-shared.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/trend-shared.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,iBAAiB,GAIlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,MAAM,aAAa,GAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvE,mFAAmF;AACnF,MAAM,mBAAmB,GAAgB,MAAM,CAAC;AAEhD;;;;;GAKG;AACH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AAC;SACvG,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;SAClD,MAAM,CAAC,yBAAyB,EAAE,wDAAwD,CAAC;SAC3F,MAAM,CAAC,yBAAyB,EAAE,wDAAwD,CAAC;SAC3F,MAAM,CACL,yBAAyB,EACzB,iEAAiE,CAClE;SACA,MAAM,CACL,yBAAyB,EACzB,kEAAkE,CACnE;SACA,MAAM,CACL,oBAAoB,EACpB,6GAA6G,CAC9G;SACA,MAAM,CACL,wBAAwB,EACxB,kDAAkD,EAClD,mBAAmB,CACpB,CAAC;AACN,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAChD,OAAO,qBAAqB,CAAC,GAAG,CAAC;SAC9B,MAAM,CAAC,8BAA8B,EAAE,yDAAyD,CAAC;SACjG,MAAM,CAAC,aAAa,EAAE,iDAAiD,CAAC,CAAC;AAC9E,CAAC"}
1
+ {"version":3,"file":"trend-shared.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/trend-shared.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,iBAAiB,GAIlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,MAAM,aAAa,GAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvE,mFAAmF;AACnF,MAAM,mBAAmB,GAAgB,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,gBAAgB,GAAgC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE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A,MAAM,CACL,kCAAkC,EAClC,kGAAkG,CACnG;SACA,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;SAClD,MAAM,CAAC,yBAAyB,EAAE,wDAAwD,CAAC;SAC3F,MAAM,CAAC,yBAAyB,EAAE,wDAAwD,CAAC;SAC3F,MAAM,CACL,yBAAyB,EACzB,iEAAiE,CAClE;SACA,MAAM,CACL,yBAAyB,EACzB,kEAAkE,CACnE;SACA,MAAM,CACL,oBAAoB,EACpB,6GAA6G,CAC9G;SACA,MAAM,CACL,wBAAwB,EACxB,kDAAkD,EAClD,mBAAmB,CACpB,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAChD,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC,MAAM,CACtC,aAAa,EACb,iDAAiD,CAClD,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gojinko/cli",
3
- "version": "2.21.0",
3
+ "version": "2.22.1",
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.21.0",
20
+ "@gojinko/api-client": "2.22.1",
21
21
  "commander": "^12.1.0",
22
22
  "chalk": "^5.4.1",
23
23
  "open": "^10.0.0"