@gojinko/cli 2.21.0 → 2.22.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/dist/commands/travel-demand/demand-shared.d.ts +60 -5
- package/dist/commands/travel-demand/demand-shared.d.ts.map +1 -1
- package/dist/commands/travel-demand/demand-shared.js +96 -36
- package/dist/commands/travel-demand/demand-shared.js.map +1 -1
- package/dist/commands/travel-demand/index.d.ts.map +1 -1
- package/dist/commands/travel-demand/index.js +31 -21
- package/dist/commands/travel-demand/index.js.map +1 -1
- package/dist/commands/travel-demand/trend-shared.d.ts +23 -4
- package/dist/commands/travel-demand/trend-shared.d.ts.map +1 -1
- package/dist/commands/travel-demand/trend-shared.js +35 -30
- package/dist/commands/travel-demand/trend-shared.js.map +1 -1
- package/package.json +2 -2
|
@@ -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
|
|
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
|
-
|
|
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,47 @@ 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
|
+
/**
|
|
52
|
+
* Validate a COUNTRY-only scope filter (`--origin-country` / `--destination-country`):
|
|
53
|
+
* it must be a COUNTRY selector (`Country:<code>`) and is only allowed together
|
|
54
|
+
* with `--level city` (it scopes the ranked side to one country so its cities are
|
|
55
|
+
* ranked). Mirrors resolveScopeCountry in the Go BFF.
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkScopeCountry(value: string | undefined, level: Level | undefined, flag: string): string | undefined;
|
|
58
|
+
/** market ranking: `--origin-country` scopes the ranked origin cities to one country. */
|
|
59
|
+
export declare function checkOriginCountry(value: string | undefined, level: Level | undefined): string | undefined;
|
|
60
|
+
/** destination ranking: `--destination-country` scopes the ranked destination cities to one country. */
|
|
61
|
+
export declare function checkDestinationCountry(value: string | undefined, level: Level | undefined): string | undefined;
|
|
35
62
|
export declare function checkDate(value: string | undefined, flag: string): string | undefined;
|
|
36
63
|
export declare function checkNonNegInt(value: string | undefined, flag: string): number | undefined;
|
|
37
64
|
export declare function checkRangeInt(value: string | undefined, flag: string, min: number, max: number, oneDayReason?: string): number | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Validate the optional departure-date window: both bounds together (or neither),
|
|
67
|
+
* with --departure-date-to on or after --departure-date-from. When both are omitted
|
|
68
|
+
* no departure-date filter is applied (all departure dates). Returns the validated
|
|
69
|
+
* [from, to]. Throws UsageError (exit 3) on bad input. Shared with the trend commands.
|
|
70
|
+
*/
|
|
71
|
+
export declare function checkDepartureWindow(fromRaw: string | undefined, toRaw: string | undefined): {
|
|
72
|
+
from?: string;
|
|
73
|
+
to?: string;
|
|
74
|
+
};
|
|
38
75
|
/** Validate CLI options and build the wire query. Throws UsageError (exit 3) on bad input. */
|
|
39
76
|
export declare function buildDemandQuery(opts: DemandCliOpts, build?: BuildOpts): DemandQuery;
|
|
40
77
|
/**
|
|
@@ -50,6 +87,24 @@ export declare function demandAction(build: BuildOpts, call: (client: JinkoClien
|
|
|
50
87
|
* which buckets by traveler type, nor the explicit-pairs trend command.
|
|
51
88
|
*/
|
|
52
89
|
export declare function addLevelOption(cmd: Command): Command;
|
|
53
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Register `--origin` (destination/audience rankings + their trend variants):
|
|
92
|
+
* a `<Level>:<Code>` origin filter that accepts City or Country, or `global`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function addOriginOption(cmd: Command): Command;
|
|
95
|
+
/**
|
|
96
|
+
* Register `--origin-country` (market ranking + market-trend only): a COUNTRY
|
|
97
|
+
* selector, allowed only with `--level city`, that narrows the ranking to that
|
|
98
|
+
* country's origin cities. Registered after `--level` so it reads as a modifier of it.
|
|
99
|
+
*/
|
|
100
|
+
export declare function addOriginCountryOption(cmd: Command): Command;
|
|
101
|
+
/**
|
|
102
|
+
* Register `--destination-country` (destination ranking + destination-trend only):
|
|
103
|
+
* a COUNTRY selector, allowed only with `--level city`, that narrows the ranking to
|
|
104
|
+
* that country's destination cities. The symmetric mirror of `--origin-country`.
|
|
105
|
+
* Registered after `--level` so it reads as a modifier of it.
|
|
106
|
+
*/
|
|
107
|
+
export declare function addDestinationCountryOption(cmd: Command): Command;
|
|
108
|
+
/** Register the query options shared by all three demand commands (origin is per-command). */
|
|
54
109
|
export declare function addCommonDemandOptions(cmd: Command): Command;
|
|
55
110
|
//# 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,
|
|
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,QAAQ,EACd,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAA0C,CAAC;AAC7F,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAA8B,CAAC;AACzE,eAAO,MAAM,MAAM,UAAsB,CAAC;AAC1C,2FAA2F;AAC3F,eAAO,MAAM,YAAY,EAAE,SAAS,KAAK,EAAwB,CAAC;AAGlE,gE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AAO,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,32 @@ export function checkLocation(value, flag) {
|
|
|
36
27
|
}
|
|
37
28
|
return value;
|
|
38
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Validate a COUNTRY-only scope filter (`--origin-country` / `--destination-country`):
|
|
32
|
+
* it must be a COUNTRY selector (`Country:<code>`) and is only allowed together
|
|
33
|
+
* with `--level city` (it scopes the ranked side to one country so its cities are
|
|
34
|
+
* ranked). Mirrors resolveScopeCountry in the Go BFF.
|
|
35
|
+
*/
|
|
36
|
+
export function checkScopeCountry(value, level, flag) {
|
|
37
|
+
if (value === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
const loc = checkLocation(value, flag);
|
|
40
|
+
if (!loc || !loc.startsWith('Country:')) {
|
|
41
|
+
throw new UsageError(`${flag} must be a country selector, e.g. Country:US (a City is not allowed) (got "${value}")`);
|
|
42
|
+
}
|
|
43
|
+
if (level !== 'city') {
|
|
44
|
+
throw new UsageError(`${flag} is only allowed together with --level city`);
|
|
45
|
+
}
|
|
46
|
+
return loc;
|
|
47
|
+
}
|
|
48
|
+
/** market ranking: `--origin-country` scopes the ranked origin cities to one country. */
|
|
49
|
+
export function checkOriginCountry(value, level) {
|
|
50
|
+
return checkScopeCountry(value, level, '--origin-country');
|
|
51
|
+
}
|
|
52
|
+
/** destination ranking: `--destination-country` scopes the ranked destination cities to one country. */
|
|
53
|
+
export function checkDestinationCountry(value, level) {
|
|
54
|
+
return checkScopeCountry(value, level, '--destination-country');
|
|
55
|
+
}
|
|
39
56
|
export function checkDate(value, flag) {
|
|
40
57
|
if (value === undefined)
|
|
41
58
|
return undefined;
|
|
@@ -82,30 +99,49 @@ oneDayReason = 'a 1-day window relies on the current day, whose search data is n
|
|
|
82
99
|
}
|
|
83
100
|
return n;
|
|
84
101
|
}
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
102
|
+
/**
|
|
103
|
+
* Validate the optional departure-date window: both bounds together (or neither),
|
|
104
|
+
* with --departure-date-to on or after --departure-date-from. When both are omitted
|
|
105
|
+
* no departure-date filter is applied (all departure dates). Returns the validated
|
|
106
|
+
* [from, to]. Throws UsageError (exit 3) on bad input. Shared with the trend commands.
|
|
107
|
+
*/
|
|
108
|
+
export function checkDepartureWindow(fromRaw, toRaw) {
|
|
109
|
+
const from = checkDate(fromRaw, '--departure-date-from');
|
|
110
|
+
const to = checkDate(toRaw, '--departure-date-to');
|
|
111
|
+
if ((from && !to) || (!from && to)) {
|
|
112
|
+
throw new UsageError('--departure-date-from and --departure-date-to must be provided together');
|
|
97
113
|
}
|
|
98
|
-
|
|
99
|
-
throw new UsageError('--departure-date-
|
|
114
|
+
if (from && to && to < from) {
|
|
115
|
+
throw new UsageError('--departure-date-to must be on or after --departure-date-from');
|
|
100
116
|
}
|
|
101
|
-
|
|
117
|
+
return { from, to };
|
|
118
|
+
}
|
|
119
|
+
/** Validate CLI options and build the wire query. Throws UsageError (exit 3) on bad input. */
|
|
120
|
+
export function buildDemandQuery(opts, build = {}) {
|
|
121
|
+
const { from, to } = checkDepartureWindow(opts.departureDateFrom, opts.departureDateTo);
|
|
122
|
+
const level = build.allowLevel
|
|
123
|
+
? checkEnum(opts.level, LEVEL_VALUES, '--level')
|
|
124
|
+
: undefined;
|
|
125
|
+
// destination takes --destination-country (Country-only, --level city only) in
|
|
126
|
+
// place of the plain --destination narrowing filter; market/audience take the
|
|
127
|
+
// required/optional --destination. Mutually exclusive per command.
|
|
128
|
+
const destinationCountry = build.destinationCountry
|
|
129
|
+
? checkDestinationCountry(opts.destinationCountry, level)
|
|
130
|
+
: undefined;
|
|
131
|
+
const destination = build.destinationCountry
|
|
132
|
+
? undefined
|
|
133
|
+
: checkLocation(opts.destination, '--destination');
|
|
102
134
|
if (build.requireDestination && !destination) {
|
|
103
135
|
throw new UsageError('--destination is required for this command (e.g. --destination Country:TH)');
|
|
104
136
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
137
|
+
// market takes --origin-country (Country-only, --level city only); the other
|
|
138
|
+
// rankings take --origin. The two are mutually exclusive per command.
|
|
139
|
+
const originCountry = build.originCountry
|
|
140
|
+
? checkOriginCountry(opts.originCountry, level)
|
|
108
141
|
: undefined;
|
|
142
|
+
const origin = build.originCountry
|
|
143
|
+
? undefined
|
|
144
|
+
: checkLocation(opts.origin, '--origin');
|
|
109
145
|
const travelerType = build.allowTravelerType
|
|
110
146
|
? checkEnum(opts.travelerType, TRAVELER_TYPES, '--traveler-type')
|
|
111
147
|
: undefined;
|
|
@@ -129,14 +165,16 @@ export function buildDemandQuery(opts, build = {}) {
|
|
|
129
165
|
const snapshotWindowDays = checkRangeInt(opts.snapshotWindowDays, '--snapshot-window-days', 2, 90);
|
|
130
166
|
const limit = checkLimit(opts.limit);
|
|
131
167
|
const query = {};
|
|
132
|
-
if (
|
|
133
|
-
query.
|
|
168
|
+
if (origin)
|
|
169
|
+
query.origin = origin;
|
|
170
|
+
if (originCountry)
|
|
171
|
+
query.origin_country = originCountry;
|
|
134
172
|
if (destination)
|
|
135
173
|
query.destination = destination;
|
|
174
|
+
if (destinationCountry)
|
|
175
|
+
query.destination_country = destinationCountry;
|
|
136
176
|
if (level)
|
|
137
177
|
query.level = level;
|
|
138
|
-
if (travelPeriod)
|
|
139
|
-
query.travel_period = travelPeriod;
|
|
140
178
|
if (from)
|
|
141
179
|
query.departure_date_from = from;
|
|
142
180
|
if (to)
|
|
@@ -193,13 +231,35 @@ export function demandAction(build, call) {
|
|
|
193
231
|
export function addLevelOption(cmd) {
|
|
194
232
|
return cmd.option('--level <level>', 'ranked output granularity: country (default) or city', 'country');
|
|
195
233
|
}
|
|
196
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Register `--origin` (destination/audience rankings + their trend variants):
|
|
236
|
+
* a `<Level>:<Code>` origin filter that accepts City or Country, or `global`.
|
|
237
|
+
*/
|
|
238
|
+
export function addOriginOption(cmd) {
|
|
239
|
+
return cmd.option('--origin <level:code>', "origin filter, e.g. Country:US or City:NYC (or 'global' for all origins)");
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Register `--origin-country` (market ranking + market-trend only): a COUNTRY
|
|
243
|
+
* selector, allowed only with `--level city`, that narrows the ranking to that
|
|
244
|
+
* country's origin cities. Registered after `--level` so it reads as a modifier of it.
|
|
245
|
+
*/
|
|
246
|
+
export function addOriginCountryOption(cmd) {
|
|
247
|
+
return cmd.option('--origin-country <Country:code>', "origin country to rank cities within, e.g. Country:US — allowed only with --level city");
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Register `--destination-country` (destination ranking + destination-trend only):
|
|
251
|
+
* a COUNTRY selector, allowed only with `--level city`, that narrows the ranking to
|
|
252
|
+
* that country's destination cities. The symmetric mirror of `--origin-country`.
|
|
253
|
+
* Registered after `--level` so it reads as a modifier of it.
|
|
254
|
+
*/
|
|
255
|
+
export function addDestinationCountryOption(cmd) {
|
|
256
|
+
return cmd.option('--destination-country <Country:code>', "destination country to rank cities within, e.g. Country:FR — allowed only with --level city");
|
|
257
|
+
}
|
|
258
|
+
/** Register the query options shared by all three demand commands (origin is per-command). */
|
|
197
259
|
export function addCommonDemandOptions(cmd) {
|
|
198
260
|
return cmd
|
|
199
|
-
.option('--
|
|
200
|
-
.option('--
|
|
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)')
|
|
261
|
+
.option('--departure-date-from <YYYY-MM-DD>', 'start of departure window (use with --departure-date-to; omit both for no departure-date filter)')
|
|
262
|
+
.option('--departure-date-to <YYYY-MM-DD>', 'end of departure window (use with --departure-date-from; omit both for no departure-date filter)')
|
|
203
263
|
.option('--trip-type <type>', 'One-Way|Round-Trip')
|
|
204
264
|
.option('--trip-duration-min <n>', 'minimum trip length in nights (round-trips only, >= 0)')
|
|
205
265
|
.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,
|
|
1
|
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AED,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;
|
|
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,CAuEnE"}
|
|
@@ -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,27 @@ 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
|
+
addDestinationCountryOption(addOriginOption(addLevelOption(addCommonDemandOptions(td
|
|
22
22
|
.command('destination')
|
|
23
23
|
.summary('Top destinations by search demand')
|
|
24
|
-
.description('Most-searched destinations by de-sampled request share. Optionally scope to
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
.option('--traveler-type <type>', 'Solo|Couple|Group|Family'))).action(demandAction({ allowTravelerType: true, allowLevel: true }, (client, query) => client.demandDestination(query)));
|
|
28
|
-
addLevelOption(addCommonDemandOptions(td
|
|
24
|
+
.description('Most-searched destinations by de-sampled request share. Optionally scope to a single ' +
|
|
25
|
+
'origin with --origin. Optional --destination-country (a Country selector, allowed ' +
|
|
26
|
+
"only with --level city) narrows the ranking to that country's destination cities.")
|
|
27
|
+
.option('--traveler-type <type>', 'Solo|Couple|Group|Family'))))).action(demandAction({ allowTravelerType: true, allowLevel: true, destinationCountry: true }, (client, query) => client.demandDestination(query)));
|
|
28
|
+
addOriginCountryOption(addLevelOption(addCommonDemandOptions(td
|
|
29
29
|
.command('market')
|
|
30
30
|
.summary('Top source markets for a destination')
|
|
31
|
-
.description('Which source markets generate the most demand for a destination. --destination is
|
|
31
|
+
.description('Which source markets generate the most demand for a destination. --destination is ' +
|
|
32
|
+
'required. Optional --origin-country (a Country selector, allowed only with --level ' +
|
|
33
|
+
"city) narrows the ranking to that country's origin cities.")
|
|
32
34
|
.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
|
|
35
|
+
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(demandAction({ requireDestination: true, allowTravelerType: true, allowLevel: true, originCountry: true }, (client, query) => client.demandMarket(query)));
|
|
36
|
+
addOriginOption(addCommonDemandOptions(td
|
|
35
37
|
.command('audience')
|
|
36
38
|
.summary('Traveler-type mix for a destination')
|
|
37
39
|
.description('Traveler-type composition (Solo/Couple/Family/Group) of demand for a destination. ' +
|
|
38
40
|
'--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)));
|
|
41
|
+
.option('--destination <level:code>', 'destination, e.g. Country:JP (required)'))).action(demandAction({ requireDestination: true }, (client, query) => client.demandAudience(query)));
|
|
40
42
|
registerTrendCommands(td);
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
@@ -58,29 +60,37 @@ function registerTrendCommands(td) {
|
|
|
58
60
|
.option('--origin <level:code>', 'origin selector, e.g. Country:US (repeatable)', collectLocations, [])
|
|
59
61
|
.option('--destination <level:code>', 'destination selector, e.g. Country:FR (repeatable)', collectLocations, [])
|
|
60
62
|
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(trendAction(buildPairsTrendQuery, (client, query) => client.demandTrend(query)));
|
|
61
|
-
addLevelOption(addRankedTrendOptions(td
|
|
63
|
+
addDestinationCountryOption(addOriginOption(addLevelOption(addRankedTrendOptions(td
|
|
62
64
|
.command('destination-trend')
|
|
63
65
|
.summary('Demand time series for the top-N destinations')
|
|
64
|
-
.description('Ranks destinations (optionally reachable from --origin
|
|
65
|
-
'then returns each top-N destination’s series.'
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
.description('Ranks destinations (optionally reachable from --origin) by within-window growth, ' +
|
|
67
|
+
'then returns each top-N destination’s series. Optional --destination-country (a Country ' +
|
|
68
|
+
"selector, allowed only with --level city) narrows the ranking to that country's " +
|
|
69
|
+
'destination cities.')
|
|
70
|
+
.option('--traveler-type <type>', 'Solo|Couple|Group|Family'))))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
|
|
71
|
+
allowTravelerType: true,
|
|
72
|
+
allowLevel: true,
|
|
73
|
+
destinationCountry: true,
|
|
74
|
+
}), (client, query) => client.demandDestinationTrend(query)));
|
|
75
|
+
addOriginCountryOption(addLevelOption(addRankedTrendOptions(td
|
|
69
76
|
.command('market-trend')
|
|
70
77
|
.summary('Demand time series for the top-N source markets')
|
|
71
78
|
.description('Ranks source markets for a destination by within-window growth, then returns each ' +
|
|
72
|
-
'top-N market’s series. --destination is required.'
|
|
79
|
+
'top-N market’s series. --destination is required. Optional --origin-country (a ' +
|
|
80
|
+
"Country selector, allowed only with --level city) narrows the ranking to that " +
|
|
81
|
+
"country's origin cities.")
|
|
73
82
|
.option('--destination <level:code>', 'destination, e.g. Country:TH (required)')
|
|
74
|
-
.option('--traveler-type <type>', 'Solo|Couple|Group|Family'))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
|
|
83
|
+
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
|
|
75
84
|
requireDestination: true,
|
|
76
85
|
allowTravelerType: true,
|
|
77
86
|
allowLevel: true,
|
|
87
|
+
originCountry: true,
|
|
78
88
|
}), (client, query) => client.demandMarketTrend(query)));
|
|
79
|
-
addRankedTrendOptions(td
|
|
89
|
+
addOriginOption(addRankedTrendOptions(td
|
|
80
90
|
.command('audience-trend')
|
|
81
91
|
.summary('Demand time series for the traveler-type mix')
|
|
82
92
|
.description('A series per traveler-type segment (Solo/Couple/Family/Group) of demand for a ' +
|
|
83
93
|
'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)));
|
|
94
|
+
.option('--destination <level:code>', 'destination, e.g. Country:JP (required)'))).action(trendAction((opts) => buildRankedTrendQuery(opts, { requireDestination: true }), (client, query) => client.demandAudienceTrend(query)));
|
|
85
95
|
}
|
|
86
96
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
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,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,eAAe,CAAC;SACxB,OAAO,CAAC,2DAA2D,CAAC;SACpE,WAAW,CACV,mFAAmF;QACjF,2FAA2F;QAC3F,wFAAwF,CAC3F,CAAC;IAEJ,2BAA2B,CACzB,eAAe,CACb,cAAc,CACZ,sBAAsB,CACpB,EAAE;SACC,OAAO,CAAC,aAAa,CAAC;SACtB,OAAO,CAAC,mCAAmC,CAAC;SAC5C,WAAW,CACV,uFAAuF;QACrF,oFAAoF;QACpF,mFAAmF,CACtF;SACA,MAAM,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAChE,CACF,CACF,CACF,CAAC,MAAM,CACN,YAAY,CACV,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAC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C,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;QAChB,aAAa,EAAE,IAAI;KACpB,CAAC,EACJ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CACnD,CACF,CAAC;IAEF,eAAe,CACb,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,CACF,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
|
-
|
|
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
|
-
/**
|
|
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;
|
|
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;AAgC7B,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAG3B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,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;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,wGAAwG;IACxG,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAOjF;AAwED;;;;;GAKG;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 {
|
|
4
|
+
import { checkDepartureWindow, checkDestinationCountry, checkEnum, checkLocation, checkNonNegInt, checkOriginCountry, 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
|
|
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
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
+
: checkLocation(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 (
|
|
154
|
-
query.
|
|
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('--
|
|
190
|
-
.option('--departure-date-
|
|
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
|
-
/**
|
|
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,
|
|
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,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,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAEvF,sGAAsG;AACtG,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAkD9B;;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AyB,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.
|
|
3
|
+
"version": "2.22.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.22.0",
|
|
21
21
|
"commander": "^12.1.0",
|
|
22
22
|
"chalk": "^5.4.1",
|
|
23
23
|
"open": "^10.0.0"
|