@gojinko/cli 2.20.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/shared.d.ts +12 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +26 -0
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/travel-demand/demand-shared.d.ts +71 -7
- package/dist/commands/travel-demand/demand-shared.d.ts.map +1 -1
- package/dist/commands/travel-demand/demand-shared.js +120 -55
- package/dist/commands/travel-demand/demand-shared.js.map +1 -1
- package/dist/commands/travel-demand/index.d.ts +6 -6
- package/dist/commands/travel-demand/index.d.ts.map +1 -1
- package/dist/commands/travel-demand/index.js +63 -48
- package/dist/commands/travel-demand/index.js.map +1 -1
- package/dist/commands/travel-demand/trend-shared.d.ts +91 -0
- package/dist/commands/travel-demand/trend-shared.d.ts.map +1 -0
- package/dist/commands/travel-demand/{evolution-shared.js → trend-shared.js} +81 -58
- package/dist/commands/travel-demand/trend-shared.js.map +1 -0
- package/dist/output/formatter.js +3 -3
- package/dist/output/formatter.js.map +1 -1
- package/package.json +2 -2
- package/dist/commands/travel-demand/evolution-shared.d.ts +0 -67
- package/dist/commands/travel-demand/evolution-shared.d.ts.map +0 -1
- package/dist/commands/travel-demand/evolution-shared.js.map +0 -1
|
@@ -30,6 +30,18 @@ export declare function exitWithError(err: unknown, globals: GlobalOptions): nev
|
|
|
30
30
|
* Returns the resolved canonical value so callers can use it inline.
|
|
31
31
|
*/
|
|
32
32
|
export declare function resolveDeprecatedFlag<T>(canonical: T | undefined, deprecated: T | undefined, oldFlag: string, newFlag: string): T | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Build the source-native action string for the `X-Origin-Action` header: the
|
|
35
|
+
* invoked CLI command path (e.g. `flight-search`, `book`, `auth login`),
|
|
36
|
+
* excluding the root `jinko` program name. Threaded into the api-client so its
|
|
37
|
+
* middleware can stamp `X-Origin-Action` for intent tracking.
|
|
38
|
+
*
|
|
39
|
+
* Walks up the Commander parent chain until the root program (whose `.parent`
|
|
40
|
+
* is null), so the program name is never included. Returns undefined when the
|
|
41
|
+
* command cannot be determined (e.g. a stub Command in unit tests), keeping the
|
|
42
|
+
* header omitted rather than blank.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveCommandPath(cmd: Command | undefined): string | undefined;
|
|
33
45
|
/**
|
|
34
46
|
* Wraps a command handler with standard error handling and client creation.
|
|
35
47
|
* Commander calls action with varying arg counts:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAA0C,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,iEAAiE;AACjE,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBACV,OAAO,EAAE,MAAM,EAAE,IAAI,SAAkB;CAKpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAezE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,SAAS,EAAE,CAAC,GAAG,SAAS,EACxB,UAAU,EAAE,CAAC,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,CAAC,GAAG,SAAS,CAMf;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,OAAO,EA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OAAO,EAAE,aAAa,EAEtB,OAAO,CAAC,EAAE,GAAG,EACb,GAAG,CAAC,EAAE,OAAO,KACV,OAAO,CAAC,IAAI,CAAC,IAGK,MAAM,OAAO,EAAE,GAAG,MAAM,GAAG,EAAE,mBA8BrD"}
|
package/dist/commands/shared.js
CHANGED
|
@@ -53,6 +53,30 @@ export function resolveDeprecatedFlag(canonical, deprecated, oldFlag, newFlag) {
|
|
|
53
53
|
}
|
|
54
54
|
return canonical;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Build the source-native action string for the `X-Origin-Action` header: the
|
|
58
|
+
* invoked CLI command path (e.g. `flight-search`, `book`, `auth login`),
|
|
59
|
+
* excluding the root `jinko` program name. Threaded into the api-client so its
|
|
60
|
+
* middleware can stamp `X-Origin-Action` for intent tracking.
|
|
61
|
+
*
|
|
62
|
+
* Walks up the Commander parent chain until the root program (whose `.parent`
|
|
63
|
+
* is null), so the program name is never included. Returns undefined when the
|
|
64
|
+
* command cannot be determined (e.g. a stub Command in unit tests), keeping the
|
|
65
|
+
* header omitted rather than blank.
|
|
66
|
+
*/
|
|
67
|
+
export function resolveCommandPath(cmd) {
|
|
68
|
+
if (!cmd || typeof cmd.name !== 'function') {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const names = [];
|
|
72
|
+
let current = cmd;
|
|
73
|
+
while (current && current.parent) {
|
|
74
|
+
names.unshift(current.name());
|
|
75
|
+
current = current.parent;
|
|
76
|
+
}
|
|
77
|
+
const path = names.join(' ').trim();
|
|
78
|
+
return path.length > 0 ? path : undefined;
|
|
79
|
+
}
|
|
56
80
|
/**
|
|
57
81
|
* Wraps a command handler with standard error handling and client creation.
|
|
58
82
|
* Commander calls action with varying arg counts:
|
|
@@ -72,6 +96,8 @@ export function withClient(handler) {
|
|
|
72
96
|
const client = await createJinkoClient({
|
|
73
97
|
apiKey: globals.apiKey,
|
|
74
98
|
environment: globals.environment,
|
|
99
|
+
originSource: 'cli',
|
|
100
|
+
originAction: resolveCommandPath(cmd),
|
|
75
101
|
});
|
|
76
102
|
await handler(client, globals, cmdOpts, cmd);
|
|
77
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAsB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAG/B,iEAAiE;AACjE,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAS;IACtB,YAAY,OAAe,EAAE,IAAI,GAAG,eAAe;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY,EAAE,OAAsB;IAChE,IAAI,GAAG,YAAY,UAAU,EAAE,CAAC;QAC9B,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,GAAG,YAAY,SAAS,EAAE,CAAC;QAC7B,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;QACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB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1F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
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
|
|
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[];
|
|
7
|
+
/** Values accepted by --level (ranked-output granularity); lowercase, matching the API. */
|
|
8
|
+
export declare const LEVEL_VALUES: readonly Level[];
|
|
8
9
|
/** Raw option bag as parsed by Commander (camelCased flags). */
|
|
9
10
|
export interface DemandCliOpts {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
origin?: string;
|
|
12
|
+
/** market only: a Country selector, allowed only with --level city. */
|
|
13
|
+
originCountry?: string;
|
|
12
14
|
destination?: string;
|
|
13
|
-
|
|
15
|
+
/** destination only: a Country selector, allowed only with --level city. */
|
|
16
|
+
destinationCountry?: string;
|
|
17
|
+
level?: string;
|
|
14
18
|
departureDateFrom?: string;
|
|
15
19
|
departureDateTo?: string;
|
|
16
20
|
travelerType?: string;
|
|
@@ -20,18 +24,54 @@ export interface DemandCliOpts {
|
|
|
20
24
|
searchWindowMin?: string;
|
|
21
25
|
searchWindowMax?: string;
|
|
22
26
|
snapshotWindowDays?: string;
|
|
23
|
-
trendWindowDays?: string;
|
|
24
27
|
limit?: string;
|
|
25
28
|
}
|
|
26
29
|
export interface BuildOpts {
|
|
27
30
|
requireDestination?: boolean;
|
|
28
31
|
allowTravelerType?: boolean;
|
|
32
|
+
/** Whether --level (ranked-output granularity) is a valid option (destination/market, not audience). */
|
|
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;
|
|
29
48
|
}
|
|
30
49
|
export declare function checkEnum<T extends string>(value: string | undefined, allowed: readonly T[], flag: string): T | undefined;
|
|
31
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;
|
|
32
62
|
export declare function checkDate(value: string | undefined, flag: string): string | undefined;
|
|
33
63
|
export declare function checkNonNegInt(value: string | undefined, flag: string): number | undefined;
|
|
34
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
|
+
};
|
|
35
75
|
/** Validate CLI options and build the wire query. Throws UsageError (exit 3) on bad input. */
|
|
36
76
|
export declare function buildDemandQuery(opts: DemandCliOpts, build?: BuildOpts): DemandQuery;
|
|
37
77
|
/**
|
|
@@ -41,6 +81,30 @@ export declare function buildDemandQuery(opts: DemandCliOpts, build?: BuildOpts)
|
|
|
41
81
|
* commands don't use the generic withClient wrapper, which creates the client first.)
|
|
42
82
|
*/
|
|
43
83
|
export declare function demandAction(build: BuildOpts, call: (client: JinkoClient, query: DemandQuery) => Promise<unknown>): (this: Command, ...args: unknown[]) => Promise<void>;
|
|
44
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Register the `--level` (ranked-output granularity) option. Only the destination
|
|
86
|
+
* and market rankings (and their trend variants) accept it — not audience,
|
|
87
|
+
* which buckets by traveler type, nor the explicit-pairs trend command.
|
|
88
|
+
*/
|
|
89
|
+
export declare function addLevelOption(cmd: Command): Command;
|
|
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). */
|
|
45
109
|
export declare function addCommonDemandOptions(cmd: Command): Command;
|
|
46
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,
|
|
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,KAA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C,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,19 +1,11 @@
|
|
|
1
1
|
import { createJinkoClient, } from '@gojinko/api-client';
|
|
2
2
|
import { getGlobalOptions } from '../../config/config.js';
|
|
3
|
-
import { exitWithError, output, UsageError } from '../shared.js';
|
|
4
|
-
const ANALYSIS = ['snapshot', 'trend'];
|
|
5
|
-
export const TRAVEL_PERIODS = [
|
|
6
|
-
'Summer',
|
|
7
|
-
'Winter',
|
|
8
|
-
'Christmas',
|
|
9
|
-
'Easter',
|
|
10
|
-
'Next30Days',
|
|
11
|
-
'Next90Days',
|
|
12
|
-
'Custom',
|
|
13
|
-
];
|
|
3
|
+
import { exitWithError, output, resolveCommandPath, UsageError } from '../shared.js';
|
|
14
4
|
export const TRAVELER_TYPES = ['Solo', 'Couple', 'Group', 'Family'];
|
|
15
5
|
export const TRIP_TYPES = ['One-Way', 'Round-Trip'];
|
|
16
6
|
export const LEVELS = ['City', 'Country'];
|
|
7
|
+
/** Values accepted by --level (ranked-output granularity); lowercase, matching the API. */
|
|
8
|
+
export const LEVEL_VALUES = ['country', 'city'];
|
|
17
9
|
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
18
10
|
export function checkEnum(value, allowed, flag) {
|
|
19
11
|
if (value === undefined)
|
|
@@ -35,6 +27,32 @@ export function checkLocation(value, flag) {
|
|
|
35
27
|
}
|
|
36
28
|
return value;
|
|
37
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
|
+
}
|
|
38
56
|
export function checkDate(value, flag) {
|
|
39
57
|
if (value === undefined)
|
|
40
58
|
return undefined;
|
|
@@ -67,9 +85,10 @@ export function checkNonNegInt(value, flag) {
|
|
|
67
85
|
return n;
|
|
68
86
|
}
|
|
69
87
|
export function checkRangeInt(value, flag, min, max,
|
|
70
|
-
// Why "1" specifically is rejected. The snapshot
|
|
71
|
-
//
|
|
72
|
-
// so
|
|
88
|
+
// Why "1" specifically is rejected. The snapshot window includes the current
|
|
89
|
+
// (incomplete) day, hence the default reason; a trend series window ends on the
|
|
90
|
+
// last COMPLETE bucket, so the trend builder passes its own reason. `1` looks
|
|
91
|
+
// like a reasonable input either way.
|
|
73
92
|
oneDayReason = 'a 1-day window relies on the current day, whose search data is not yet complete') {
|
|
74
93
|
if (value === undefined)
|
|
75
94
|
return undefined;
|
|
@@ -80,28 +99,49 @@ oneDayReason = 'a 1-day window relies on the current day, whose search data is n
|
|
|
80
99
|
}
|
|
81
100
|
return n;
|
|
82
101
|
}
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
throw new UsageError('--departure-date-to must be on or after --departure-date-from');
|
|
95
|
-
}
|
|
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');
|
|
96
113
|
}
|
|
97
|
-
|
|
98
|
-
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');
|
|
99
116
|
}
|
|
100
|
-
|
|
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');
|
|
101
134
|
if (build.requireDestination && !destination) {
|
|
102
135
|
throw new UsageError('--destination is required for this command (e.g. --destination Country:TH)');
|
|
103
136
|
}
|
|
104
|
-
|
|
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)
|
|
141
|
+
: undefined;
|
|
142
|
+
const origin = build.originCountry
|
|
143
|
+
? undefined
|
|
144
|
+
: checkLocation(opts.origin, '--origin');
|
|
105
145
|
const travelerType = build.allowTravelerType
|
|
106
146
|
? checkEnum(opts.travelerType, TRAVELER_TYPES, '--traveler-type')
|
|
107
147
|
: undefined;
|
|
@@ -120,24 +160,21 @@ export function buildDemandQuery(opts, build = {}) {
|
|
|
120
160
|
searchWindowMax < searchWindowMin) {
|
|
121
161
|
throw new UsageError('--search-window-max must be >= --search-window-min');
|
|
122
162
|
}
|
|
123
|
-
//
|
|
124
|
-
//
|
|
163
|
+
// Recent-activity window for the snapshot ranking (2-90). A 1-day window is
|
|
164
|
+
// rejected because the current day's search data is still incomplete.
|
|
125
165
|
const snapshotWindowDays = checkRangeInt(opts.snapshotWindowDays, '--snapshot-window-days', 2, 90);
|
|
126
|
-
if (snapshotWindowDays !== undefined && analysis !== 'snapshot') {
|
|
127
|
-
throw new UsageError('--snapshot-window-days is only valid with --analysis snapshot');
|
|
128
|
-
}
|
|
129
|
-
const trendWindowDays = checkRangeInt(opts.trendWindowDays, '--trend-window-days', 2, 45);
|
|
130
|
-
if (trendWindowDays !== undefined && analysis !== 'trend') {
|
|
131
|
-
throw new UsageError('--trend-window-days is only valid with --analysis trend');
|
|
132
|
-
}
|
|
133
166
|
const limit = checkLimit(opts.limit);
|
|
134
|
-
const query = {
|
|
135
|
-
if (
|
|
136
|
-
query.
|
|
167
|
+
const query = {};
|
|
168
|
+
if (origin)
|
|
169
|
+
query.origin = origin;
|
|
170
|
+
if (originCountry)
|
|
171
|
+
query.origin_country = originCountry;
|
|
137
172
|
if (destination)
|
|
138
173
|
query.destination = destination;
|
|
139
|
-
if (
|
|
140
|
-
query.
|
|
174
|
+
if (destinationCountry)
|
|
175
|
+
query.destination_country = destinationCountry;
|
|
176
|
+
if (level)
|
|
177
|
+
query.level = level;
|
|
141
178
|
if (from)
|
|
142
179
|
query.departure_date_from = from;
|
|
143
180
|
if (to)
|
|
@@ -156,8 +193,6 @@ export function buildDemandQuery(opts, build = {}) {
|
|
|
156
193
|
query.search_window_max = searchWindowMax;
|
|
157
194
|
if (snapshotWindowDays !== undefined)
|
|
158
195
|
query.snapshot_window_days = snapshotWindowDays;
|
|
159
|
-
if (trendWindowDays !== undefined)
|
|
160
|
-
query.trend_window_days = trendWindowDays;
|
|
161
196
|
if (limit !== undefined)
|
|
162
197
|
query.limit = limit;
|
|
163
198
|
return query;
|
|
@@ -178,6 +213,8 @@ export function demandAction(build, call) {
|
|
|
178
213
|
const client = await createJinkoClient({
|
|
179
214
|
apiKey: globals.apiKey,
|
|
180
215
|
environment: globals.environment,
|
|
216
|
+
originSource: 'cli',
|
|
217
|
+
originAction: resolveCommandPath(command),
|
|
181
218
|
});
|
|
182
219
|
output(await call(client, query), { format: globals.format });
|
|
183
220
|
}
|
|
@@ -186,21 +223,49 @@ export function demandAction(build, call) {
|
|
|
186
223
|
}
|
|
187
224
|
};
|
|
188
225
|
}
|
|
189
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Register the `--level` (ranked-output granularity) option. Only the destination
|
|
228
|
+
* and market rankings (and their trend variants) accept it — not audience,
|
|
229
|
+
* which buckets by traveler type, nor the explicit-pairs trend command.
|
|
230
|
+
*/
|
|
231
|
+
export function addLevelOption(cmd) {
|
|
232
|
+
return cmd.option('--level <level>', 'ranked output granularity: country (default) or city', 'country');
|
|
233
|
+
}
|
|
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). */
|
|
190
259
|
export function addCommonDemandOptions(cmd) {
|
|
191
260
|
return cmd
|
|
192
|
-
.option('--
|
|
193
|
-
.option('--
|
|
194
|
-
.option('--travel-period <period>', 'Summer|Winter|Christmas|Easter|Next30Days|Next90Days|Custom (default Next90Days)')
|
|
195
|
-
.option('--departure-date-from <YYYY-MM-DD>', 'start of departure window (requires --travel-period Custom)')
|
|
196
|
-
.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)')
|
|
197
263
|
.option('--trip-type <type>', 'One-Way|Round-Trip')
|
|
198
264
|
.option('--trip-duration-min <n>', 'minimum trip length in nights (round-trips only, >= 0)')
|
|
199
265
|
.option('--trip-duration-max <n>', 'maximum trip length in nights (>= --trip-duration-min)')
|
|
200
266
|
.option('--search-window-min <n>', 'minimum advance-purchase window in days before departure (>= 0)')
|
|
201
267
|
.option('--search-window-max <n>', 'maximum advance-purchase window in days (>= --search-window-min)')
|
|
202
|
-
.option('--snapshot-window-days <n>', '
|
|
203
|
-
.option('--trend-window-days <n>', 'trend only: size in days of each compared window (2-45, default 7)')
|
|
268
|
+
.option('--snapshot-window-days <n>', 'days of recent search activity aggregated into the demand level (2-90, default 7)')
|
|
204
269
|
.option('--limit <n>', 'max rows, 1-200 (default 20)');
|
|
205
270
|
}
|
|
206
271
|
//# sourceMappingURL=demand-shared.js.map
|
|
@@ -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
|
+
{"version":3,"file":"demand-shared.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/demand-shared.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,GAMlB,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,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;AA4CtC,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;AACp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AsB,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"}
|
|
@@ -3,12 +3,12 @@ import type { Command } from 'commander';
|
|
|
3
3
|
* `jinko travel-demand <operation>` — Travel Demand Intelligence (JIN-1378, JIN-1471).
|
|
4
4
|
*
|
|
5
5
|
* A second-level command group (like `auth`/`config`) with seven operations:
|
|
6
|
-
* three snapshot
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* is redundant under `travel-demand`.) The SDK keeps its flat
|
|
10
|
-
* names (demandDestination/…/
|
|
11
|
-
* additive — see createProgram() in ../../index.ts.
|
|
6
|
+
* three snapshot rankings — destination / market / audience — and four
|
|
7
|
+
* time-series ("trend") deep-dives — trend / destination-trend / market-trend /
|
|
8
|
+
* audience-trend (JIN-1471, renamed from "evolution" by JIN-1529). ("demand-" is
|
|
9
|
+
* dropped — it is redundant under `travel-demand`.) The SDK keeps its flat
|
|
10
|
+
* demand* method names (demandDestination/…/demandTrend/…). Registration is
|
|
11
|
+
* purely additive — see createProgram() in ../../index.ts.
|
|
12
12
|
*/
|
|
13
13
|
export declare function registerTravelDemandCommands(program: Command): void;
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,81 +1,96 @@
|
|
|
1
|
-
import { addCommonDemandOptions, demandAction } from './demand-shared.js';
|
|
2
|
-
import {
|
|
1
|
+
import { addCommonDemandOptions, addDestinationCountryOption, addLevelOption, addOriginCountryOption, addOriginOption, demandAction, } from './demand-shared.js';
|
|
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).
|
|
5
5
|
*
|
|
6
6
|
* A second-level command group (like `auth`/`config`) with seven operations:
|
|
7
|
-
* three snapshot
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* is redundant under `travel-demand`.) The SDK keeps its flat
|
|
11
|
-
* names (demandDestination/…/
|
|
12
|
-
* additive — see createProgram() in ../../index.ts.
|
|
7
|
+
* three snapshot rankings — destination / market / audience — and four
|
|
8
|
+
* time-series ("trend") deep-dives — trend / destination-trend / market-trend /
|
|
9
|
+
* audience-trend (JIN-1471, renamed from "evolution" by JIN-1529). ("demand-" is
|
|
10
|
+
* dropped — it is redundant under `travel-demand`.) The SDK keeps its flat
|
|
11
|
+
* demand* method names (demandDestination/…/demandTrend/…). Registration is
|
|
12
|
+
* purely additive — see createProgram() in ../../index.ts.
|
|
13
13
|
*/
|
|
14
14
|
export function registerTravelDemandCommands(program) {
|
|
15
15
|
const td = program
|
|
16
16
|
.command('travel-demand')
|
|
17
|
-
.summary('Travel Demand Intelligence — rankings +
|
|
17
|
+
.summary('Travel Demand Intelligence — rankings + trend time series')
|
|
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
|
-
'mix — as point-in-time rankings
|
|
21
|
-
|
|
22
|
-
addCommonDemandOptions(td
|
|
20
|
+
'mix — as point-in-time rankings, or as "trend" time series you can plot over a window.');
|
|
21
|
+
addDestinationCountryOption(addOriginOption(addLevelOption(addCommonDemandOptions(td
|
|
23
22
|
.command('destination')
|
|
24
23
|
.summary('Top destinations by search demand')
|
|
25
|
-
.description('Most-searched destinations by de-sampled request share. Optionally scope to
|
|
26
|
-
'
|
|
27
|
-
|
|
28
|
-
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(demandAction({ allowTravelerType: true }, (client, query) => client.demandDestination(query)));
|
|
29
|
-
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
|
|
30
29
|
.command('market')
|
|
31
30
|
.summary('Top source markets for a destination')
|
|
32
|
-
.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.")
|
|
33
34
|
.option('--destination <level:code>', 'destination, e.g. Country:TH (required)')
|
|
34
|
-
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(demandAction({ requireDestination: true, allowTravelerType: true }, (client, query) => client.demandMarket(query)));
|
|
35
|
-
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
|
|
36
37
|
.command('audience')
|
|
37
38
|
.summary('Traveler-type mix for a destination')
|
|
38
39
|
.description('Traveler-type composition (Solo/Couple/Family/Group) of demand for a destination. ' +
|
|
39
40
|
'--destination is required. (traveler_type is not a filter here — it is the dimension.)')
|
|
40
|
-
.option('--destination <level:code>', 'destination, e.g. Country:JP (required)')).action(demandAction({ requireDestination: true }, (client, query) => client.demandAudience(query)));
|
|
41
|
-
|
|
41
|
+
.option('--destination <level:code>', 'destination, e.g. Country:JP (required)'))).action(demandAction({ requireDestination: true }, (client, query) => client.demandAudience(query)));
|
|
42
|
+
registerTrendCommands(td);
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
|
-
* The four
|
|
45
|
-
* a series, so there is no --analysis /
|
|
46
|
-
* --
|
|
45
|
+
* The four TREND (time-series) commands (JIN-1471, renamed from "evolution" by
|
|
46
|
+
* JIN-1529). A series is always a series, so there is no --analysis /
|
|
47
|
+
* --snapshot-window-days here; the window is --trend-window (per-granularity:
|
|
48
|
+
* day 2-60 | week 2-52 | month 2-12, default 12) and --granularity (week
|
|
49
|
+
* default) buckets it.
|
|
47
50
|
*/
|
|
48
|
-
function
|
|
51
|
+
function registerTrendCommands(td) {
|
|
49
52
|
// Deep dive over explicit pairs. --origin / --destination are repeatable and
|
|
50
53
|
// comma-splittable; v1 requires one side to be a single location.
|
|
51
|
-
|
|
52
|
-
.command('
|
|
53
|
-
.summary('
|
|
54
|
-
.description('Deep dive: one
|
|
54
|
+
addCommonTrendOptions(td
|
|
55
|
+
.command('trend')
|
|
56
|
+
.summary('Demand time series for explicit origin/destination pairs')
|
|
57
|
+
.description('Deep dive: one de-sampled search-volume series per (origin, destination) pair. ' +
|
|
55
58
|
'--origin and --destination are repeatable (or comma-separated); v1 allows a list on ' +
|
|
56
59
|
'only one side (keep the other a single location).')
|
|
57
60
|
.option('--origin <level:code>', 'origin selector, e.g. Country:US (repeatable)', collectLocations, [])
|
|
58
61
|
.option('--destination <level:code>', 'destination selector, e.g. Country:FR (repeatable)', collectLocations, [])
|
|
59
|
-
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(
|
|
60
|
-
|
|
61
|
-
.command('destination-
|
|
62
|
-
.summary('
|
|
63
|
-
.description('Ranks destinations (optionally reachable from --origin
|
|
64
|
-
'then returns each top-N destination’s
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(trendAction(buildPairsTrendQuery, (client, query) => client.demandTrend(query)));
|
|
63
|
+
addDestinationCountryOption(addOriginOption(addLevelOption(addRankedTrendOptions(td
|
|
64
|
+
.command('destination-trend')
|
|
65
|
+
.summary('Demand time series for the top-N destinations')
|
|
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
|
|
76
|
+
.command('market-trend')
|
|
77
|
+
.summary('Demand time series for the top-N source markets')
|
|
70
78
|
.description('Ranks source markets for a destination by within-window growth, then returns each ' +
|
|
71
|
-
'top-N market’s
|
|
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.")
|
|
72
82
|
.option('--destination <level:code>', 'destination, e.g. Country:TH (required)')
|
|
73
|
-
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')).action(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
.option('--traveler-type <type>', 'Solo|Couple|Group|Family')))).action(trendAction((opts) => buildRankedTrendQuery(opts, {
|
|
84
|
+
requireDestination: true,
|
|
85
|
+
allowTravelerType: true,
|
|
86
|
+
allowLevel: true,
|
|
87
|
+
originCountry: true,
|
|
88
|
+
}), (client, query) => client.demandMarketTrend(query)));
|
|
89
|
+
addOriginOption(addRankedTrendOptions(td
|
|
90
|
+
.command('audience-trend')
|
|
91
|
+
.summary('Demand time series for the traveler-type mix')
|
|
92
|
+
.description('A series per traveler-type segment (Solo/Couple/Family/Group) of demand for a ' +
|
|
78
93
|
'destination. --destination is required. (traveler_type is not a filter here — it is the dimension.)')
|
|
79
|
-
.option('--destination <level:code>', 'destination, e.g. Country:JP (required)')).action(
|
|
94
|
+
.option('--destination <level:code>', 'destination, e.g. Country:JP (required)'))).action(trendAction((opts) => buildRankedTrendQuery(opts, { requireDestination: true }), (client, query) => client.demandAudienceTrend(query)));
|
|
80
95
|
}
|
|
81
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,EACvE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CACnD,CACF,CAAC;IAEF,sBAAsB,CACpB,cAAc,CACZ,sBAAsB,CACpB,EAAE;SACC,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,sCAAsC,CAAC;SAC/C,WAAW,CACV,o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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"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared option registration + request building for the four travel-demand
|
|
3
|
+
* TREND (time-series) commands (JIN-1471, renamed from "evolution" by JIN-1529):
|
|
4
|
+
*
|
|
5
|
+
* trend — deep dive over explicit origin×destination pairs
|
|
6
|
+
* destination-trend — top-N destinations, one series each
|
|
7
|
+
* market-trend — top-N source markets (destination required)
|
|
8
|
+
* audience-trend — per traveler-type segment (destination required)
|
|
9
|
+
*
|
|
10
|
+
* Trend shares the demand filter vocabulary but drops `analysis` (a series is
|
|
11
|
+
* always a series — never snapshot/trend) and `snapshot_window_days`. The single
|
|
12
|
+
* window is `trend_window`, counted in the chosen granularity's own unit
|
|
13
|
+
* (day 2-60, week 2-52, month 2-12; default 12); the series spans the last N
|
|
14
|
+
* complete buckets, excluding the in-progress one. Granularity defaults to week.
|
|
15
|
+
* The reusable validators live in ./demand-shared.ts to avoid duplicating the
|
|
16
|
+
* rules.
|
|
17
|
+
*/
|
|
18
|
+
import type { Command } from 'commander';
|
|
19
|
+
import { type DemandTrendQuery, type JinkoClient } from '@gojinko/api-client';
|
|
20
|
+
/** Raw option bag as parsed by Commander (camelCased flags). */
|
|
21
|
+
export interface TrendCliOpts {
|
|
22
|
+
origin?: string | string[];
|
|
23
|
+
destination?: string | 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;
|
|
28
|
+
level?: string;
|
|
29
|
+
limit?: string;
|
|
30
|
+
departureDateFrom?: string;
|
|
31
|
+
departureDateTo?: string;
|
|
32
|
+
travelerType?: string;
|
|
33
|
+
tripType?: string;
|
|
34
|
+
tripDurationMin?: string;
|
|
35
|
+
tripDurationMax?: string;
|
|
36
|
+
searchWindowMin?: string;
|
|
37
|
+
searchWindowMax?: string;
|
|
38
|
+
trendWindow?: string;
|
|
39
|
+
granularity?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface TrendBuildOpts {
|
|
42
|
+
/** Ranked commands where --destination must be supplied (market / audience). */
|
|
43
|
+
requireDestination?: boolean;
|
|
44
|
+
/** Whether --traveler-type is a valid filter (false for the audience endpoint, which buckets by it). */
|
|
45
|
+
allowTravelerType?: boolean;
|
|
46
|
+
/** Whether --level (ranked-output granularity) is valid (destination/market trend, not audience). */
|
|
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;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Commander collector for the repeatable, comma-splittable `--origin` /
|
|
64
|
+
* `--destination` flags on the pairs command: `--origin A --origin B` and
|
|
65
|
+
* `--origin A,B` both accumulate into the same array.
|
|
66
|
+
*/
|
|
67
|
+
export declare function collectLocations(value: string, previous?: string[]): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Build the query for the `trend` deep-dive (explicit pairs). v1 requires at
|
|
70
|
+
* least one origin and one destination, caps each list, and allows a list on only
|
|
71
|
+
* one side (the other must be a single location). The wire forwards
|
|
72
|
+
* comma-separated strings — the BFF splits them.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildPairsTrendQuery(opts: TrendCliOpts): DemandTrendQuery;
|
|
75
|
+
/** Build the query for a ranked trend command (destination / market / audience). */
|
|
76
|
+
export declare function buildRankedTrendQuery(opts: TrendCliOpts, build: TrendBuildOpts): DemandTrendQuery;
|
|
77
|
+
/**
|
|
78
|
+
* Build a Commander action for a trend command. Same ordering contract as
|
|
79
|
+
* the snapshot ranking commands: validate input FIRST (UsageError -> exit 3), THEN
|
|
80
|
+
* construct the client (AuthError -> exit 2), THEN call the API.
|
|
81
|
+
*/
|
|
82
|
+
export declare function trendAction(buildQuery: (opts: TrendCliOpts) => DemandTrendQuery, call: (client: JinkoClient, query: DemandTrendQuery) => Promise<unknown>): (this: Command, ...args: unknown[]) => Promise<void>;
|
|
83
|
+
/** Register the filter options shared by all four trend commands. */
|
|
84
|
+
export declare function addCommonTrendOptions(cmd: Command): Command;
|
|
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
|
+
*/
|
|
90
|
+
export declare function addRankedTrendOptions(cmd: Command): Command;
|
|
91
|
+
//# sourceMappingURL=trend-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trend-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/travel-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,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,8 +1,17 @@
|
|
|
1
1
|
import { createJinkoClient, } from '@gojinko/api-client';
|
|
2
2
|
import { getGlobalOptions } from '../../config/config.js';
|
|
3
|
-
import { exitWithError, output, UsageError } from '../shared.js';
|
|
4
|
-
import {
|
|
3
|
+
import { exitWithError, output, resolveCommandPath, UsageError } from '../shared.js';
|
|
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
|
+
/** Default series bucket size when --granularity is omitted (mirrors trend.go). */
|
|
7
|
+
const DEFAULT_GRANULARITY = 'week';
|
|
8
|
+
/**
|
|
9
|
+
* Per-granularity maximum for --trend-window, in that granularity's own unit
|
|
10
|
+
* (minimum 2). Mirrors trend.go maxTrendWindow(): day <= 60, week <= 52,
|
|
11
|
+
* month <= 12 — a static numeric cap cannot express this, so the window is
|
|
12
|
+
* range-checked AFTER the granularity is resolved.
|
|
13
|
+
*/
|
|
14
|
+
const MAX_TREND_WINDOW = { day: 60, week: 52, month: 12 };
|
|
6
15
|
/** v1 caps the pairs deep-dive to a handful of locations per side to avoid an explosion of series. */
|
|
7
16
|
const MAX_PAIR_LOCATIONS = 10;
|
|
8
17
|
/**
|
|
@@ -16,7 +25,7 @@ export function collectLocations(value, previous = []) {
|
|
|
16
25
|
.map((s) => s.trim())
|
|
17
26
|
.filter((s) => s.length > 0));
|
|
18
27
|
}
|
|
19
|
-
function
|
|
28
|
+
function checkTrendLimit(value) {
|
|
20
29
|
if (value === undefined)
|
|
21
30
|
return undefined;
|
|
22
31
|
const n = Number(value);
|
|
@@ -25,22 +34,9 @@ function checkEvolutionLimit(value) {
|
|
|
25
34
|
}
|
|
26
35
|
return n;
|
|
27
36
|
}
|
|
28
|
-
/** Validate the filters shared by all four
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
const from = checkDate(opts.departureDateFrom, '--departure-date-from');
|
|
32
|
-
const to = checkDate(opts.departureDateTo, '--departure-date-to');
|
|
33
|
-
if (travelPeriod === 'Custom') {
|
|
34
|
-
if (!from || !to) {
|
|
35
|
-
throw new UsageError('--travel-period Custom requires both --departure-date-from and --departure-date-to');
|
|
36
|
-
}
|
|
37
|
-
if (to < from) {
|
|
38
|
-
throw new UsageError('--departure-date-to must be on or after --departure-date-from');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else if (from || to) {
|
|
42
|
-
throw new UsageError('--departure-date-from/--departure-date-to are only valid with --travel-period Custom');
|
|
43
|
-
}
|
|
37
|
+
/** Validate the filters shared by all four trend commands and build the common query slice. */
|
|
38
|
+
function buildCommonTrend(opts, build) {
|
|
39
|
+
const { from, to } = checkDepartureWindow(opts.departureDateFrom, opts.departureDateTo);
|
|
44
40
|
const travelerType = build.allowTravelerType
|
|
45
41
|
? checkEnum(opts.travelerType, TRAVELER_TYPES, '--traveler-type')
|
|
46
42
|
: undefined;
|
|
@@ -59,15 +55,16 @@ function buildCommonEvolution(opts, build) {
|
|
|
59
55
|
searchWindowMax < searchWindowMin) {
|
|
60
56
|
throw new UsageError('--search-window-max must be >= --search-window-min');
|
|
61
57
|
}
|
|
62
|
-
//
|
|
63
|
-
// is
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
// Granularity is resolved FIRST (default week) because the --trend-window cap
|
|
59
|
+
// is per-granularity (mirrors trend.go, which validates granularity before the
|
|
60
|
+
// window range check).
|
|
61
|
+
const granularity = checkEnum(opts.granularity, GRANULARITIES, '--granularity') ?? DEFAULT_GRANULARITY;
|
|
62
|
+
// --trend-window is the number of buckets N in the chosen granularity's own
|
|
63
|
+
// unit. It ends on the last COMPLETE bucket (the in-progress one is excluded),
|
|
64
|
+
// so a single bucket is not a series — 2 is the minimum, and the maximum
|
|
65
|
+
// depends on the granularity (day 60, week 52, month 12).
|
|
66
|
+
const trendWindow = checkRangeInt(opts.trendWindow, '--trend-window', 2, MAX_TREND_WINDOW[granularity], 'a trend series needs at least 2 buckets');
|
|
68
67
|
const query = {};
|
|
69
|
-
if (travelPeriod)
|
|
70
|
-
query.travel_period = travelPeriod;
|
|
71
68
|
if (from)
|
|
72
69
|
query.departure_date_from = from;
|
|
73
70
|
if (to)
|
|
@@ -84,20 +81,19 @@ function buildCommonEvolution(opts, build) {
|
|
|
84
81
|
query.search_window_min = searchWindowMin;
|
|
85
82
|
if (searchWindowMax !== undefined)
|
|
86
83
|
query.search_window_max = searchWindowMax;
|
|
87
|
-
if (
|
|
88
|
-
query.
|
|
89
|
-
|
|
90
|
-
query.granularity = granularity;
|
|
84
|
+
if (trendWindow !== undefined)
|
|
85
|
+
query.trend_window = trendWindow;
|
|
86
|
+
query.granularity = granularity;
|
|
91
87
|
return query;
|
|
92
88
|
}
|
|
93
89
|
/**
|
|
94
|
-
* Build the query for the `
|
|
90
|
+
* Build the query for the `trend` deep-dive (explicit pairs). v1 requires at
|
|
95
91
|
* least one origin and one destination, caps each list, and allows a list on only
|
|
96
92
|
* one side (the other must be a single location). The wire forwards
|
|
97
93
|
* comma-separated strings — the BFF splits them.
|
|
98
94
|
*/
|
|
99
|
-
export function
|
|
100
|
-
const query =
|
|
95
|
+
export function buildPairsTrendQuery(opts) {
|
|
96
|
+
const query = buildCommonTrend(opts, { allowTravelerType: true });
|
|
101
97
|
const origins = Array.isArray(opts.origin) ? opts.origin : opts.origin ? [opts.origin] : [];
|
|
102
98
|
const destinations = Array.isArray(opts.destination)
|
|
103
99
|
? opts.destination
|
|
@@ -125,29 +121,53 @@ export function buildPairsEvolutionQuery(opts) {
|
|
|
125
121
|
query.destinations = destinations.join(',');
|
|
126
122
|
return query;
|
|
127
123
|
}
|
|
128
|
-
/** Build the query for a ranked
|
|
129
|
-
export function
|
|
130
|
-
const query =
|
|
131
|
-
const
|
|
124
|
+
/** Build the query for a ranked trend command (destination / market / audience). */
|
|
125
|
+
export function buildRankedTrendQuery(opts, build) {
|
|
126
|
+
const query = buildCommonTrend(opts, build);
|
|
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');
|
|
132
139
|
if (build.requireDestination && !destination) {
|
|
133
140
|
throw new UsageError('--destination is required for this command (e.g. --destination Country:TH)');
|
|
134
141
|
}
|
|
135
|
-
|
|
136
|
-
|
|
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)
|
|
146
|
+
: undefined;
|
|
147
|
+
const origin = build.originCountry
|
|
148
|
+
? undefined
|
|
149
|
+
: checkLocation(Array.isArray(opts.origin) ? opts.origin[0] : opts.origin, '--origin');
|
|
150
|
+
const limit = checkTrendLimit(opts.limit);
|
|
137
151
|
if (destination)
|
|
138
152
|
query.destination = destination;
|
|
139
|
-
if (
|
|
140
|
-
query.
|
|
153
|
+
if (destinationCountry)
|
|
154
|
+
query.destination_country = destinationCountry;
|
|
155
|
+
if (origin)
|
|
156
|
+
query.origin = origin;
|
|
157
|
+
if (originCountry)
|
|
158
|
+
query.origin_country = originCountry;
|
|
159
|
+
if (level)
|
|
160
|
+
query.level = level;
|
|
141
161
|
if (limit !== undefined)
|
|
142
162
|
query.limit = limit;
|
|
143
163
|
return query;
|
|
144
164
|
}
|
|
145
165
|
/**
|
|
146
|
-
* Build a Commander action for
|
|
147
|
-
* the snapshot
|
|
166
|
+
* Build a Commander action for a trend command. Same ordering contract as
|
|
167
|
+
* the snapshot ranking commands: validate input FIRST (UsageError -> exit 3), THEN
|
|
148
168
|
* construct the client (AuthError -> exit 2), THEN call the API.
|
|
149
169
|
*/
|
|
150
|
-
export function
|
|
170
|
+
export function trendAction(buildQuery, call) {
|
|
151
171
|
return async function (...args) {
|
|
152
172
|
const command = args[args.length - 1];
|
|
153
173
|
const opts = args[args.length - 2] ?? {};
|
|
@@ -157,6 +177,8 @@ export function evolutionAction(buildQuery, call) {
|
|
|
157
177
|
const client = await createJinkoClient({
|
|
158
178
|
apiKey: globals.apiKey,
|
|
159
179
|
environment: globals.environment,
|
|
180
|
+
originSource: 'cli',
|
|
181
|
+
originAction: resolveCommandPath(command),
|
|
160
182
|
});
|
|
161
183
|
output(await call(client, query), { format: globals.format });
|
|
162
184
|
}
|
|
@@ -165,24 +187,25 @@ export function evolutionAction(buildQuery, call) {
|
|
|
165
187
|
}
|
|
166
188
|
};
|
|
167
189
|
}
|
|
168
|
-
/** Register the filter options shared by all four
|
|
169
|
-
export function
|
|
190
|
+
/** Register the filter options shared by all four trend commands. */
|
|
191
|
+
export function addCommonTrendOptions(cmd) {
|
|
170
192
|
return cmd
|
|
171
|
-
.option('--
|
|
172
|
-
.option('--departure-date-
|
|
173
|
-
.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)')
|
|
174
195
|
.option('--trip-type <type>', 'One-Way|Round-Trip')
|
|
175
196
|
.option('--trip-duration-min <n>', 'minimum trip length in nights (round-trips only, >= 0)')
|
|
176
197
|
.option('--trip-duration-max <n>', 'maximum trip length in nights (>= --trip-duration-min)')
|
|
177
198
|
.option('--search-window-min <n>', 'minimum advance-purchase window in days before departure (>= 0)')
|
|
178
199
|
.option('--search-window-max <n>', 'maximum advance-purchase window in days (>= --search-window-min)')
|
|
179
|
-
.option('--trend-window
|
|
180
|
-
.option('--granularity <bucket>', 'series bucket size:
|
|
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)')
|
|
201
|
+
.option('--granularity <bucket>', 'series bucket size: week (default) | day | month', DEFAULT_GRANULARITY);
|
|
181
202
|
}
|
|
182
|
-
/**
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
+
*/
|
|
208
|
+
export function addRankedTrendOptions(cmd) {
|
|
209
|
+
return addCommonTrendOptions(cmd).option('--limit <n>', 'max number of series (top-N), 1-50 (default 10)');
|
|
187
210
|
}
|
|
188
|
-
//# sourceMappingURL=
|
|
211
|
+
//# sourceMappingURL=trend-shared.js.map
|
|
@@ -0,0 +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,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;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,WAAqB,EAAE;IACrE,OAAO,QAAQ,CAAC,MAAM,CACpB,KAAK;SACF,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,E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M,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/dist/output/formatter.js
CHANGED
|
@@ -23,9 +23,9 @@ function outputTable(data) {
|
|
|
23
23
|
const entries = Object.entries(data);
|
|
24
24
|
const arrayEntry = entries.find(([, v]) => Array.isArray(v));
|
|
25
25
|
if (arrayEntry) {
|
|
26
|
-
// Object wrapping a list (e.g. {
|
|
27
|
-
// fields, then tabulate the rows — instead of collapsing the array
|
|
28
|
-
// single key/value cell. Used by the travel-demand responses.
|
|
26
|
+
// Object wrapping a list (e.g. { granularity, from, to, series }): show the
|
|
27
|
+
// scalar fields, then tabulate the rows — instead of collapsing the array
|
|
28
|
+
// into a single key/value cell. Used by the travel-demand responses.
|
|
29
29
|
const scalars = entries.filter(([, v]) => !Array.isArray(v) && (v === null || typeof v !== 'object'));
|
|
30
30
|
for (const [key, value] of scalars) {
|
|
31
31
|
console.log(`${chalk.bold(key)}: ${formatCell(value)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../src/output/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,IAAa,EAAE,OAAsB;IAC1D,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC/B,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,IAAa;IAC/B,OAAO,CAAC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CAAC,KAA2D,EAAE,OAAsB;IAC7G,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;AACH,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"
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared option registration + request building for the four travel-demand
|
|
3
|
-
* EVOLUTION (daily time-series) commands (JIN-1471):
|
|
4
|
-
*
|
|
5
|
-
* evolution — deep dive over explicit origin×destination pairs
|
|
6
|
-
* destination-evolution — top-N destinations, one series each
|
|
7
|
-
* market-evolution — top-N source markets (destination required)
|
|
8
|
-
* audience-evolution — per traveler-type segment (destination required)
|
|
9
|
-
*
|
|
10
|
-
* Evolution shares the demand filter vocabulary but drops `analysis` (a series is
|
|
11
|
-
* always a series — never snapshot/trend) and `snapshot_window_days`. The single
|
|
12
|
-
* window is `trend_window_days` (2-45, default 7); the series spans the last N
|
|
13
|
-
* complete days ending yesterday. The reusable validators live in
|
|
14
|
-
* ./demand-shared.ts to avoid duplicating the rules.
|
|
15
|
-
*/
|
|
16
|
-
import type { Command } from 'commander';
|
|
17
|
-
import { type DemandEvolutionQuery, type JinkoClient } from '@gojinko/api-client';
|
|
18
|
-
/** Raw option bag as parsed by Commander (camelCased flags). */
|
|
19
|
-
export interface EvolutionCliOpts {
|
|
20
|
-
origin?: string[];
|
|
21
|
-
destination?: string | string[];
|
|
22
|
-
originMarket?: string;
|
|
23
|
-
limit?: string;
|
|
24
|
-
travelPeriod?: string;
|
|
25
|
-
departureDateFrom?: string;
|
|
26
|
-
departureDateTo?: string;
|
|
27
|
-
travelerType?: string;
|
|
28
|
-
tripType?: string;
|
|
29
|
-
tripDurationMin?: string;
|
|
30
|
-
tripDurationMax?: string;
|
|
31
|
-
searchWindowMin?: string;
|
|
32
|
-
searchWindowMax?: string;
|
|
33
|
-
trendWindowDays?: string;
|
|
34
|
-
granularity?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface EvolutionBuildOpts {
|
|
37
|
-
/** Ranked commands where --destination must be supplied (market / audience). */
|
|
38
|
-
requireDestination?: boolean;
|
|
39
|
-
/** Whether --traveler-type is a valid filter (false for the audience endpoint, which buckets by it). */
|
|
40
|
-
allowTravelerType?: boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Commander collector for the repeatable, comma-splittable `--origin` /
|
|
44
|
-
* `--destination` flags on the pairs command: `--origin A --origin B` and
|
|
45
|
-
* `--origin A,B` both accumulate into the same array.
|
|
46
|
-
*/
|
|
47
|
-
export declare function collectLocations(value: string, previous?: string[]): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Build the query for the `evolution` deep-dive (explicit pairs). v1 requires at
|
|
50
|
-
* least one origin and one destination, caps each list, and allows a list on only
|
|
51
|
-
* one side (the other must be a single location). The wire forwards
|
|
52
|
-
* comma-separated strings — the BFF splits them.
|
|
53
|
-
*/
|
|
54
|
-
export declare function buildPairsEvolutionQuery(opts: EvolutionCliOpts): DemandEvolutionQuery;
|
|
55
|
-
/** Build the query for a ranked evolution command (destination / market / audience). */
|
|
56
|
-
export declare function buildRankedEvolutionQuery(opts: EvolutionCliOpts, build: EvolutionBuildOpts): DemandEvolutionQuery;
|
|
57
|
-
/**
|
|
58
|
-
* Build a Commander action for an evolution command. Same ordering contract as
|
|
59
|
-
* the snapshot/trend commands: validate input FIRST (UsageError -> exit 3), THEN
|
|
60
|
-
* construct the client (AuthError -> exit 2), THEN call the API.
|
|
61
|
-
*/
|
|
62
|
-
export declare function evolutionAction(buildQuery: (opts: EvolutionCliOpts) => DemandEvolutionQuery, call: (client: JinkoClient, query: DemandEvolutionQuery) => Promise<unknown>): (this: Command, ...args: unknown[]) => Promise<void>;
|
|
63
|
-
/** Register the filter options shared by all four evolution commands. */
|
|
64
|
-
export declare function addCommonEvolutionOptions(cmd: Command): Command;
|
|
65
|
-
/** Register the options common to the three RANKED evolution commands (origin-market + top-N limit). */
|
|
66
|
-
export declare function addRankedEvolutionOptions(cmd: Command): Command;
|
|
67
|
-
//# sourceMappingURL=evolution-shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evolution-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/travel-demand/evolution-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAmB7B,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAE/B,MAAM,CAAC,EAAE,MAAM,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M,OAAO,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAezE;AAED,yEAAyE;AACzE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAwB/D;AAED,wGAAwG;AACxG,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAI/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evolution-shared.js","sourceRoot":"","sources":["../../../src/commands/travel-demand/evolution-shared.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,iBAAiB,GAIlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,MAAM,aAAa,GAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvE,sGAAsG;AACtG,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAgC9B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,WAAqB,EAAE;IACrE,OAAO,QAAQ,CAAC,MAAM,CACpB,KAAK;SACF,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAC/B,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAA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