@koda-sl/baker-cli 0.9.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -20
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -1
- package/dist/client.js.map +1 -1
- package/dist/commands/ads/cache.d.ts +0 -1
- package/dist/commands/ads/cache.d.ts.map +1 -1
- package/dist/commands/ads/cache.js +0 -6
- package/dist/commands/ads/cache.js.map +1 -1
- package/dist/commands/ads/google/accounts.d.ts.map +1 -1
- package/dist/commands/ads/google/accounts.js +2 -1
- package/dist/commands/ads/google/accounts.js.map +1 -1
- package/dist/commands/ads/google/changes.d.ts +5 -0
- package/dist/commands/ads/google/changes.d.ts.map +1 -1
- package/dist/commands/ads/google/changes.js +6 -3
- package/dist/commands/ads/google/changes.js.map +1 -1
- package/dist/commands/ads/google/correction-table.d.ts.map +1 -1
- package/dist/commands/ads/google/correction-table.js +11 -3
- package/dist/commands/ads/google/correction-table.js.map +1 -1
- package/dist/commands/ads/google/currency.d.ts.map +1 -1
- package/dist/commands/ads/google/currency.js +8 -2
- package/dist/commands/ads/google/currency.js.map +1 -1
- package/dist/commands/ads/google/error-parser.d.ts.map +1 -1
- package/dist/commands/ads/google/error-parser.js +3 -1
- package/dist/commands/ads/google/error-parser.js.map +1 -1
- package/dist/commands/ads/google/keywords/discover.d.ts.map +1 -1
- package/dist/commands/ads/google/keywords/discover.js +20 -6
- package/dist/commands/ads/google/keywords/discover.js.map +1 -1
- package/dist/commands/ads/google/keywords/index.d.ts.map +1 -1
- package/dist/commands/ads/google/keywords/index.js +8 -2
- package/dist/commands/ads/google/keywords/index.js.map +1 -1
- package/dist/commands/ads/google/keywords/languages.d.ts +2 -0
- package/dist/commands/ads/google/keywords/languages.d.ts.map +1 -0
- package/dist/commands/ads/google/keywords/languages.js +23 -0
- package/dist/commands/ads/google/keywords/languages.js.map +1 -0
- package/dist/commands/ads/google/keywords/locations.d.ts +2 -0
- package/dist/commands/ads/google/keywords/locations.d.ts.map +1 -0
- package/dist/commands/ads/google/keywords/locations.js +23 -0
- package/dist/commands/ads/google/keywords/locations.js.map +1 -0
- package/dist/commands/ads/google/keywords/metrics.d.ts.map +1 -1
- package/dist/commands/ads/google/keywords/metrics.js +20 -6
- package/dist/commands/ads/google/keywords/metrics.js.map +1 -1
- package/dist/commands/ads/google/query.d.ts +0 -5
- package/dist/commands/ads/google/query.d.ts.map +1 -1
- package/dist/commands/ads/google/query.js +11 -12
- package/dist/commands/ads/google/query.js.map +1 -1
- package/dist/commands/ads/output.d.ts +5 -1
- package/dist/commands/ads/output.d.ts.map +1 -1
- package/dist/commands/ads/output.js +53 -4
- package/dist/commands/ads/output.js.map +1 -1
- package/dist/commands/research/advertisers.d.ts +5 -0
- package/dist/commands/research/advertisers.d.ts.map +1 -1
- package/dist/commands/research/advertisers.js +12 -5
- package/dist/commands/research/advertisers.js.map +1 -1
- package/dist/commands/research/countries.d.ts +2 -0
- package/dist/commands/research/countries.d.ts.map +1 -0
- package/dist/commands/research/countries.js +69 -0
- package/dist/commands/research/countries.js.map +1 -0
- package/dist/commands/research/index.d.ts.map +1 -1
- package/dist/commands/research/index.js +6 -0
- package/dist/commands/research/index.js.map +1 -1
- package/dist/commands/research/intent.d.ts +5 -0
- package/dist/commands/research/intent.d.ts.map +1 -1
- package/dist/commands/research/intent.js +14 -3
- package/dist/commands/research/intent.js.map +1 -1
- package/dist/commands/research/keyword-gap.d.ts +5 -0
- package/dist/commands/research/keyword-gap.d.ts.map +1 -1
- package/dist/commands/research/keyword-gap.js +19 -4
- package/dist/commands/research/keyword-gap.js.map +1 -1
- package/dist/commands/research/keywords-for-site.d.ts +5 -0
- package/dist/commands/research/keywords-for-site.d.ts.map +1 -1
- package/dist/commands/research/keywords-for-site.js +16 -5
- package/dist/commands/research/keywords-for-site.js.map +1 -1
- package/dist/commands/research/languages.d.ts +2 -0
- package/dist/commands/research/languages.d.ts.map +1 -0
- package/dist/commands/research/languages.js +42 -0
- package/dist/commands/research/languages.js.map +1 -0
- package/dist/commands/research/lighthouse.d.ts +5 -0
- package/dist/commands/research/lighthouse.d.ts.map +1 -1
- package/dist/commands/research/lighthouse.js +11 -1
- package/dist/commands/research/lighthouse.js.map +1 -1
- package/dist/commands/research/output.d.ts +3 -0
- package/dist/commands/research/output.d.ts.map +1 -1
- package/dist/commands/research/output.js +1 -0
- package/dist/commands/research/output.js.map +1 -1
- package/dist/geo-context.d.ts +21 -0
- package/dist/geo-context.d.ts.map +1 -0
- package/dist/geo-context.js +208 -0
- package/dist/geo-context.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { apiPost } from "../../client.js";
|
|
3
|
+
import { buildResearchQueryContext, warnDefaults } from "../../geo-context.js";
|
|
3
4
|
import { registerSchema } from "../../schemas.js";
|
|
4
|
-
import { handleResearchError, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
|
+
import { handleResearchError, RESEARCH_DATA_NOTE, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
6
|
registerSchema({
|
|
6
7
|
command: "research.advertisers",
|
|
7
|
-
description: "Find domains competing for a keyword in Google SERPs. Shows who's competing for the same search term with their visibility and estimated traffic.",
|
|
8
|
+
description: "Find domains competing for a keyword in Google SERPs. Shows who's competing for the same search term with their visibility and estimated traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
8
9
|
args: {
|
|
9
10
|
keyword: { type: "string", description: "Keyword to search (positional)", required: true },
|
|
10
11
|
location: {
|
|
11
12
|
type: "string",
|
|
12
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
13
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. DEFAULTS TO us (United States) if omitted — always set this for non-US markets",
|
|
13
14
|
required: false,
|
|
14
15
|
},
|
|
15
16
|
language: {
|
|
16
17
|
type: "string",
|
|
17
|
-
description: "Language code or name (en, es, spanish...).
|
|
18
|
+
description: "Language code or name (en, es, spanish...). DEFAULTS TO en (English) if omitted — always set this for non-English markets",
|
|
18
19
|
required: false,
|
|
19
20
|
},
|
|
20
21
|
limit: { type: "string", description: "Max results (default: 20, max: 100)", required: false },
|
|
22
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
21
23
|
},
|
|
22
24
|
});
|
|
23
25
|
const FIELDS = {
|
|
@@ -43,25 +45,30 @@ Examples:
|
|
|
43
45
|
language: { type: "string", description: "Language code or name (default: en)", required: false },
|
|
44
46
|
limit: { type: "string", description: "Max results (default: 20, max: 100)", required: false },
|
|
45
47
|
output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
|
|
48
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
46
49
|
},
|
|
47
50
|
run: async ({ args }) => {
|
|
48
51
|
const keyword = args.keyword;
|
|
49
52
|
const location = args.location || undefined;
|
|
50
53
|
const language = args.language || undefined;
|
|
51
54
|
const limit = args.limit ? Number(args.limit) : undefined;
|
|
55
|
+
const skipCache = args["no-cache"] ? true : undefined;
|
|
56
|
+
const queryContext = buildResearchQueryContext(location, language);
|
|
52
57
|
try {
|
|
53
58
|
const data = await apiPost("/api/research/advertisers", {
|
|
54
59
|
keyword,
|
|
55
60
|
location,
|
|
56
61
|
language,
|
|
57
62
|
limit,
|
|
63
|
+
skipCache,
|
|
58
64
|
});
|
|
65
|
+
warnDefaults(queryContext);
|
|
59
66
|
const format = args.output || "json";
|
|
60
67
|
if (format !== "json") {
|
|
61
68
|
writeResearchOutput(data, format);
|
|
62
69
|
return;
|
|
63
70
|
}
|
|
64
|
-
writeResearchJson({ ok: true, data, fields: FIELDS });
|
|
71
|
+
writeResearchJson({ ok: true, data, fields: FIELDS, note: RESEARCH_DATA_NOTE, query_context: queryContext });
|
|
65
72
|
}
|
|
66
73
|
catch (err) {
|
|
67
74
|
handleResearchError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advertisers.js","sourceRoot":"","sources":["../../../src/commands/research/advertisers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"advertisers.js","sourceRoot":"","sources":["../../../src/commands/research/advertisers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9G,cAAc,CAAC;IACb,OAAO,EAAE,sBAAsB;IAC/B,WAAW,EACT,iVAAiV;IACnV,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1F,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,8IAA8I;YAChJ,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2HAA2H;YAC7H,QAAQ,EAAE,KAAK;SAChB;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC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1,69 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { registerSchema } from "../../schemas.js";
|
|
3
|
+
import { writeResearchJson } from "./output.js";
|
|
4
|
+
registerSchema({
|
|
5
|
+
command: "research.countries",
|
|
6
|
+
description: "List all supported country codes for --location flag in research commands.",
|
|
7
|
+
args: {},
|
|
8
|
+
});
|
|
9
|
+
const COUNTRIES = [
|
|
10
|
+
{ code: "us", name: "United States" },
|
|
11
|
+
{ code: "uk", name: "United Kingdom" },
|
|
12
|
+
{ code: "ca", name: "Canada" },
|
|
13
|
+
{ code: "au", name: "Australia" },
|
|
14
|
+
{ code: "de", name: "Germany" },
|
|
15
|
+
{ code: "fr", name: "France" },
|
|
16
|
+
{ code: "es", name: "Spain" },
|
|
17
|
+
{ code: "it", name: "Italy" },
|
|
18
|
+
{ code: "br", name: "Brazil" },
|
|
19
|
+
{ code: "mx", name: "Mexico" },
|
|
20
|
+
{ code: "nl", name: "Netherlands" },
|
|
21
|
+
{ code: "be", name: "Belgium" },
|
|
22
|
+
{ code: "at", name: "Austria" },
|
|
23
|
+
{ code: "ch", name: "Switzerland" },
|
|
24
|
+
{ code: "pt", name: "Portugal" },
|
|
25
|
+
{ code: "se", name: "Sweden" },
|
|
26
|
+
{ code: "no", name: "Norway" },
|
|
27
|
+
{ code: "dk", name: "Denmark" },
|
|
28
|
+
{ code: "fi", name: "Finland" },
|
|
29
|
+
{ code: "ie", name: "Ireland" },
|
|
30
|
+
{ code: "nz", name: "New Zealand" },
|
|
31
|
+
{ code: "in", name: "India" },
|
|
32
|
+
{ code: "jp", name: "Japan" },
|
|
33
|
+
{ code: "kr", name: "South Korea" },
|
|
34
|
+
{ code: "sg", name: "Singapore" },
|
|
35
|
+
{ code: "ar", name: "Argentina" },
|
|
36
|
+
{ code: "cl", name: "Chile" },
|
|
37
|
+
{ code: "co", name: "Colombia" },
|
|
38
|
+
{ code: "pe", name: "Peru" },
|
|
39
|
+
{ code: "pl", name: "Poland" },
|
|
40
|
+
{ code: "cz", name: "Czech Republic" },
|
|
41
|
+
{ code: "ro", name: "Romania" },
|
|
42
|
+
{ code: "hu", name: "Hungary" },
|
|
43
|
+
{ code: "za", name: "South Africa" },
|
|
44
|
+
{ code: "il", name: "Israel" },
|
|
45
|
+
{ code: "ae", name: "United Arab Emirates" },
|
|
46
|
+
{ code: "sa", name: "Saudi Arabia" },
|
|
47
|
+
{ code: "tr", name: "Turkey" },
|
|
48
|
+
{ code: "ph", name: "Philippines" },
|
|
49
|
+
{ code: "th", name: "Thailand" },
|
|
50
|
+
{ code: "my", name: "Malaysia" },
|
|
51
|
+
{ code: "id", name: "Indonesia" },
|
|
52
|
+
{ code: "vn", name: "Vietnam" },
|
|
53
|
+
{ code: "tw", name: "Taiwan" },
|
|
54
|
+
{ code: "hk", name: "Hong Kong" },
|
|
55
|
+
];
|
|
56
|
+
const FIELDS = {
|
|
57
|
+
code: "Country code to pass as --location",
|
|
58
|
+
name: "Country name",
|
|
59
|
+
};
|
|
60
|
+
export const countriesCommand = defineCommand({
|
|
61
|
+
meta: {
|
|
62
|
+
name: "countries",
|
|
63
|
+
description: "List all supported country codes for --location flag.",
|
|
64
|
+
},
|
|
65
|
+
run: () => {
|
|
66
|
+
writeResearchJson({ ok: true, data: COUNTRIES, fields: FIELDS });
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=countries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countries.js","sourceRoot":"","sources":["../../../src/commands/research/countries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,CAAC;IACb,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,4EAA4E;IACzF,IAAI,EAAE,EAAE;CACT,CAAC,CAAC;A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,UAAU,EAAE;IAChC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE;IAChC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE;IACjC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE;CAClC,CAAC;AAEF,MAAM,MAAM,GAA2B;IACrC,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,uDAAuD;KACrE;IACD,GAAG,EAAE,GAAG,EAAE;QACR,iBAAiB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/research/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/research/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,qDA8B1B,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { advertisersCommand } from "./advertisers.js";
|
|
3
|
+
import { countriesCommand } from "./countries.js";
|
|
3
4
|
import { intentCommand } from "./intent.js";
|
|
4
5
|
import { keywordGapCommand } from "./keyword-gap.js";
|
|
5
6
|
import { keywordsForSiteCommand } from "./keywords-for-site.js";
|
|
7
|
+
import { languagesCommand } from "./languages.js";
|
|
6
8
|
import { lighthouseCommand } from "./lighthouse.js";
|
|
7
9
|
export const researchCommand = defineCommand({
|
|
8
10
|
meta: {
|
|
@@ -15,6 +17,8 @@ Commands:
|
|
|
15
17
|
keywords-for-site — Keywords a domain bids on
|
|
16
18
|
keyword-gap — Keywords they have that we don't
|
|
17
19
|
lighthouse — Landing page performance audit
|
|
20
|
+
countries — List supported country codes
|
|
21
|
+
languages — List supported language codes
|
|
18
22
|
|
|
19
23
|
Examples:
|
|
20
24
|
baker research advertisers "running shoes"
|
|
@@ -25,9 +29,11 @@ Examples:
|
|
|
25
29
|
},
|
|
26
30
|
subCommands: {
|
|
27
31
|
advertisers: advertisersCommand,
|
|
32
|
+
countries: countriesCommand,
|
|
28
33
|
intent: intentCommand,
|
|
29
34
|
"keywords-for-site": keywordsForSiteCommand,
|
|
30
35
|
"keyword-gap": keywordGapCommand,
|
|
36
|
+
languages: languagesCommand,
|
|
31
37
|
lighthouse: lighthouseCommand,
|
|
32
38
|
},
|
|
33
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/research/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/research/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;;;;;;;;;;;;;;;;0DAgByC;KACvD;IACD,WAAW,EAAE;QACX,WAAW,EAAE,kBAAkB;QAC/B,SAAS,EAAE,gBAAgB;QAC3B,MAAM,EAAE,aAAa;QACrB,mBAAmB,EAAE,sBAAsB;QAC3C,aAAa,EAAE,iBAAiB;QAChC,SAAS,EAAE,gBAAgB;QAC3B,UAAU,EAAE,iBAAiB;KAC9B;CACF,CAAC,CAAC"}
|
|
@@ -15,5 +15,10 @@ export declare const intentCommand: import("citty").CommandDef<{
|
|
|
15
15
|
readonly required: false;
|
|
16
16
|
readonly default: "json";
|
|
17
17
|
};
|
|
18
|
+
readonly "no-cache": {
|
|
19
|
+
readonly type: "boolean";
|
|
20
|
+
readonly description: "Skip server cache, hit API directly";
|
|
21
|
+
readonly required: false;
|
|
22
|
+
};
|
|
18
23
|
}>;
|
|
19
24
|
//# sourceMappingURL=intent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../src/commands/research/intent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../src/commands/research/intent.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;EAoDxB,CAAC"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { apiPost } from "../../client.js";
|
|
3
|
+
import { buildResearchQueryContext, warnDefaults } from "../../geo-context.js";
|
|
3
4
|
import { registerSchema } from "../../schemas.js";
|
|
4
5
|
import { handleResearchError, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
6
|
registerSchema({
|
|
6
7
|
command: "research.intent",
|
|
7
|
-
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate.",
|
|
8
|
+
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
|
|
8
9
|
args: {
|
|
9
10
|
keywords: {
|
|
10
11
|
type: "string",
|
|
11
12
|
description: "Comma-separated keywords (min 3 chars each, max 1000 keywords)",
|
|
12
13
|
required: true,
|
|
13
14
|
},
|
|
14
|
-
language: {
|
|
15
|
+
language: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Language code or name. DEFAULTS TO en (English) if omitted — always set this for non-English keywords",
|
|
18
|
+
required: false,
|
|
19
|
+
},
|
|
20
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
15
21
|
},
|
|
16
22
|
});
|
|
17
23
|
const FIELDS = {
|
|
@@ -32,6 +38,7 @@ Examples:
|
|
|
32
38
|
keywords: { type: "positional", description: "Comma-separated keywords", required: true },
|
|
33
39
|
language: { type: "string", description: "Language code or name (default: en)", required: false },
|
|
34
40
|
output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
|
|
41
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
35
42
|
},
|
|
36
43
|
run: async ({ args }) => {
|
|
37
44
|
const rawKeywords = args.keywords;
|
|
@@ -47,17 +54,21 @@ Examples:
|
|
|
47
54
|
process.exit(1);
|
|
48
55
|
}
|
|
49
56
|
const language = args.language || undefined;
|
|
57
|
+
const skipCache = args["no-cache"] ? true : undefined;
|
|
58
|
+
const queryContext = buildResearchQueryContext(undefined, language, { skipLocation: true });
|
|
50
59
|
try {
|
|
51
60
|
const data = await apiPost("/api/research/intent", {
|
|
52
61
|
keywords,
|
|
53
62
|
language,
|
|
63
|
+
skipCache,
|
|
54
64
|
});
|
|
65
|
+
warnDefaults(queryContext);
|
|
55
66
|
const format = args.output || "json";
|
|
56
67
|
if (format !== "json") {
|
|
57
68
|
writeResearchOutput(data, format);
|
|
58
69
|
return;
|
|
59
70
|
}
|
|
60
|
-
writeResearchJson({ ok: true, data, fields: FIELDS });
|
|
71
|
+
writeResearchJson({ ok: true, data, fields: FIELDS, query_context: queryContext });
|
|
61
72
|
}
|
|
62
73
|
catch (err) {
|
|
63
74
|
handleResearchError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../src/commands/research/intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE1F,cAAc,CAAC;IACb,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../src/commands/research/intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAA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AAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;QACrF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -40,5 +40,10 @@ export declare const keywordGapCommand: import("citty").CommandDef<{
|
|
|
40
40
|
readonly required: false;
|
|
41
41
|
readonly default: "json";
|
|
42
42
|
};
|
|
43
|
+
readonly "no-cache": {
|
|
44
|
+
readonly type: "boolean";
|
|
45
|
+
readonly description: "Skip server cache, hit API directly";
|
|
46
|
+
readonly required: false;
|
|
47
|
+
};
|
|
43
48
|
}>;
|
|
44
49
|
//# sourceMappingURL=keyword-gap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyword-gap.d.ts","sourceRoot":"","sources":["../../../src/commands/research/keyword-gap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keyword-gap.d.ts","sourceRoot":"","sources":["../../../src/commands/research/keyword-gap.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0E5B,CAAC"}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { apiPost } from "../../client.js";
|
|
3
|
+
import { buildResearchQueryContext, warnDefaults } from "../../geo-context.js";
|
|
3
4
|
import { registerSchema } from "../../schemas.js";
|
|
4
|
-
import { handleResearchError, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
|
+
import { handleResearchError, RESEARCH_DATA_NOTE, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
6
|
registerSchema({
|
|
6
7
|
command: "research.keyword-gap",
|
|
7
|
-
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities.",
|
|
8
|
+
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
8
9
|
args: {
|
|
9
10
|
competitor: { type: "string", description: "Competitor domain (positional 1)", required: true },
|
|
10
11
|
ours: { type: "string", description: "Your domain (positional 2)", required: true },
|
|
11
12
|
location: {
|
|
12
13
|
type: "string",
|
|
13
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
14
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. DEFAULTS TO us (United States) if omitted — always set this for non-US markets",
|
|
15
|
+
required: false,
|
|
16
|
+
},
|
|
17
|
+
language: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Language code or name. DEFAULTS TO en (English) if omitted — always set this for non-English markets",
|
|
14
20
|
required: false,
|
|
15
21
|
},
|
|
16
|
-
language: { type: "string", description: "Language code or name (default: en)", required: false },
|
|
17
22
|
type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
|
|
18
23
|
limit: { type: "string", description: "Max results per page (default: 50, max: 1000)", required: false },
|
|
19
24
|
offset: { type: "string", description: "Pagination offset (default: 0)", required: false },
|
|
25
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
20
26
|
},
|
|
21
27
|
});
|
|
22
28
|
const FIELDS = {
|
|
@@ -44,6 +50,7 @@ Examples:
|
|
|
44
50
|
limit: { type: "string", description: "Max results per page (default: 50, max: 1000)", required: false },
|
|
45
51
|
offset: { type: "string", description: "Pagination offset (default: 0)", required: false },
|
|
46
52
|
output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
|
|
53
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
47
54
|
},
|
|
48
55
|
run: async ({ args }) => {
|
|
49
56
|
const competitor = args.competitor;
|
|
@@ -53,6 +60,8 @@ Examples:
|
|
|
53
60
|
const type = args.type || undefined;
|
|
54
61
|
const limit = args.limit ? Number(args.limit) : undefined;
|
|
55
62
|
const offset = args.offset ? Number(args.offset) : undefined;
|
|
63
|
+
const skipCache = args["no-cache"] ? true : undefined;
|
|
64
|
+
const queryContext = buildResearchQueryContext(location, language);
|
|
56
65
|
try {
|
|
57
66
|
const result = await apiPost("/api/research/keyword-gap", {
|
|
58
67
|
competitor,
|
|
@@ -62,10 +71,12 @@ Examples:
|
|
|
62
71
|
type,
|
|
63
72
|
limit,
|
|
64
73
|
offset,
|
|
74
|
+
skipCache,
|
|
65
75
|
});
|
|
66
76
|
const currentOffset = offset ?? 0;
|
|
67
77
|
const currentLimit = limit ?? 50;
|
|
68
78
|
const hasMore = currentOffset + result.data.length < result.total_count;
|
|
79
|
+
warnDefaults(queryContext);
|
|
69
80
|
const format = args.output || "json";
|
|
70
81
|
if (format !== "json") {
|
|
71
82
|
writeResearchOutput(result.data, format);
|
|
@@ -73,9 +84,13 @@ Examples:
|
|
|
73
84
|
}
|
|
74
85
|
writeResearchJson({
|
|
75
86
|
ok: true,
|
|
87
|
+
your_domain: ours,
|
|
88
|
+
competitor_domain: competitor,
|
|
76
89
|
data: result.data,
|
|
77
90
|
fields: FIELDS,
|
|
91
|
+
note: RESEARCH_DATA_NOTE,
|
|
78
92
|
total_count: result.total_count,
|
|
93
|
+
query_context: queryContext,
|
|
79
94
|
pagination: {
|
|
80
95
|
offset: currentOffset,
|
|
81
96
|
limit: currentLimit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyword-gap.js","sourceRoot":"","sources":["../../../src/commands/research/keyword-gap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,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M,CAAC,WAAW,CAAC;YAExE,YAAY,CAAC,YAAY,CAAC,CAAC;YAC3B,MAAM,MAAM,GAAI,IAAI,CAAC,MAAiB,IAAI,MAAM,CAAC;YACjD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,mBAAmB,CAAC,MAAM,CAAC,IAAiD,EAAE,MAAM,CAAC,CAAC;gBACtF,OAAO;YACT,CAAC;YACD,iBAAiB,CAAC;gBAChB,EAAE,EAAE,IAAI;gBACR,WAAW,EAAE,IAAI;gBACjB,iBAAiB,EAAE,UAAU;gBAC7B,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,kBAAkB;gBACxB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,aAAa,EAAE,YAAY;gBAC3B,UAAU,EAAE;oBACV,MAAM,EAAE,aAAa;oBACrB,KAAK,EAAE,YAAY;oBACnB,QAAQ,EAAE,OAAO;oBACjB,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS;iBAChE;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -35,5 +35,10 @@ export declare const keywordsForSiteCommand: import("citty").CommandDef<{
|
|
|
35
35
|
readonly required: false;
|
|
36
36
|
readonly default: "json";
|
|
37
37
|
};
|
|
38
|
+
readonly "no-cache": {
|
|
39
|
+
readonly type: "boolean";
|
|
40
|
+
readonly description: "Skip server cache, hit API directly";
|
|
41
|
+
readonly required: false;
|
|
42
|
+
};
|
|
38
43
|
}>;
|
|
39
44
|
//# sourceMappingURL=keywords-for-site.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keywords-for-site.d.ts","sourceRoot":"","sources":["../../../src/commands/research/keywords-for-site.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keywords-for-site.d.ts","sourceRoot":"","sources":["../../../src/commands/research/keywords-for-site.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDjC,CAAC"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { apiPost } from "../../client.js";
|
|
3
|
+
import { buildResearchQueryContext, warnDefaults } from "../../geo-context.js";
|
|
3
4
|
import { registerSchema } from "../../schemas.js";
|
|
4
|
-
import { handleResearchError, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
|
+
import { handleResearchError, RESEARCH_DATA_NOTE, writeResearchJson, writeResearchOutput } from "./output.js";
|
|
5
6
|
registerSchema({
|
|
6
7
|
command: "research.keywords-for-site",
|
|
7
|
-
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only.",
|
|
8
|
+
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
8
9
|
args: {
|
|
9
10
|
target: { type: "string", description: "Domain or URL to analyze (positional)", required: true },
|
|
10
11
|
location: {
|
|
11
12
|
type: "string",
|
|
12
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
13
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. DEFAULTS TO us (United States) if omitted — always set this for non-US markets",
|
|
14
|
+
required: false,
|
|
15
|
+
},
|
|
16
|
+
language: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Language code or name. DEFAULTS TO en (English) if omitted — always set this for non-English markets",
|
|
13
19
|
required: false,
|
|
14
20
|
},
|
|
15
|
-
language: { type: "string", description: "Language code or name (default: en)", required: false },
|
|
16
21
|
sort: {
|
|
17
22
|
type: "string",
|
|
18
23
|
description: "Sort: relevance, search_volume, competition, cpc (default: search_volume)",
|
|
@@ -20,6 +25,7 @@ registerSchema({
|
|
|
20
25
|
},
|
|
21
26
|
type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
|
|
22
27
|
limit: { type: "string", description: "Max results (default: 50, max: 1000)", required: false },
|
|
28
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
23
29
|
},
|
|
24
30
|
});
|
|
25
31
|
const FIELDS = {
|
|
@@ -47,6 +53,7 @@ Examples:
|
|
|
47
53
|
type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
|
|
48
54
|
limit: { type: "string", description: "Max results (default: 50, max: 1000)", required: false },
|
|
49
55
|
output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },
|
|
56
|
+
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false },
|
|
50
57
|
},
|
|
51
58
|
run: async ({ args }) => {
|
|
52
59
|
const target = args.target;
|
|
@@ -55,6 +62,8 @@ Examples:
|
|
|
55
62
|
const sort = args.sort || undefined;
|
|
56
63
|
const type = args.type || undefined;
|
|
57
64
|
const limit = args.limit ? Number(args.limit) : undefined;
|
|
65
|
+
const skipCache = args["no-cache"] ? true : undefined;
|
|
66
|
+
const queryContext = buildResearchQueryContext(location, language);
|
|
58
67
|
try {
|
|
59
68
|
const data = await apiPost("/api/research/keywords-for-site", {
|
|
60
69
|
target,
|
|
@@ -63,13 +72,15 @@ Examples:
|
|
|
63
72
|
sort,
|
|
64
73
|
type,
|
|
65
74
|
limit,
|
|
75
|
+
skipCache,
|
|
66
76
|
});
|
|
77
|
+
warnDefaults(queryContext);
|
|
67
78
|
const format = args.output || "json";
|
|
68
79
|
if (format !== "json") {
|
|
69
80
|
writeResearchOutput(data, format);
|
|
70
81
|
return;
|
|
71
82
|
}
|
|
72
|
-
writeResearchJson({ ok: true, data, fields: FIELDS });
|
|
83
|
+
writeResearchJson({ ok: true, data, fields: FIELDS, note: RESEARCH_DATA_NOTE, query_context: queryContext });
|
|
73
84
|
}
|
|
74
85
|
catch (err) {
|
|
75
86
|
handleResearchError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keywords-for-site.js","sourceRoot":"","sources":["../../../src/commands/research/keywords-for-site.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"keywords-for-site.js","sourceRoot":"","sources":["../../../src/commands/research/keywords-for-site.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9G,cAAc,CAAC;IACb,OAAO,EAAE,4BAA4B;IACrC,WAAW,EACT,wTAAwT;IAC1T,IAAI,EAAE;QACJ,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChG,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,8IAA8I;YAChJ,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sGAAsG;YACxG,QAAQ,EAAE,KAAK;SAChB;QACD,IAAI,EAAE;YACJ,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I,IAAI,CAAC,MAAiB,IAAI,MAAM,CAAC;YACjD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,mBAAmB,CAAC,IAAiD,EAAE,MAAM,CAAC,CAAC;gBAC/E,OAAO;YACT,CAAC;YACD,iBAAiB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;QAC/G,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/commands/research/languages.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,gBAAgB,qDAQ3B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { registerSchema } from "../../schemas.js";
|
|
3
|
+
import { writeResearchJson } from "./output.js";
|
|
4
|
+
registerSchema({
|
|
5
|
+
command: "research.languages",
|
|
6
|
+
description: "List all supported language codes for --language flag in research commands.",
|
|
7
|
+
args: {},
|
|
8
|
+
});
|
|
9
|
+
const LANGUAGES = [
|
|
10
|
+
{ code: "en", name: "english" },
|
|
11
|
+
{ code: "es", name: "spanish" },
|
|
12
|
+
{ code: "fr", name: "french" },
|
|
13
|
+
{ code: "de", name: "german" },
|
|
14
|
+
{ code: "it", name: "italian" },
|
|
15
|
+
{ code: "pt", name: "portuguese" },
|
|
16
|
+
{ code: "nl", name: "dutch" },
|
|
17
|
+
{ code: "ja", name: "japanese" },
|
|
18
|
+
{ code: "ko", name: "korean" },
|
|
19
|
+
{ code: "zh", name: "chinese" },
|
|
20
|
+
{ code: "ar", name: "arabic" },
|
|
21
|
+
{ code: "ru", name: "russian" },
|
|
22
|
+
{ code: "pl", name: "polish" },
|
|
23
|
+
{ code: "tr", name: "turkish" },
|
|
24
|
+
{ code: "sv", name: "swedish" },
|
|
25
|
+
{ code: "no", name: "norwegian" },
|
|
26
|
+
{ code: "da", name: "danish" },
|
|
27
|
+
{ code: "fi", name: "finnish" },
|
|
28
|
+
];
|
|
29
|
+
const FIELDS = {
|
|
30
|
+
code: "Language code to pass as --language",
|
|
31
|
+
name: "Language name (also accepted by --language)",
|
|
32
|
+
};
|
|
33
|
+
export const languagesCommand = defineCommand({
|
|
34
|
+
meta: {
|
|
35
|
+
name: "languages",
|
|
36
|
+
description: "List all supported language codes for --language flag.",
|
|
37
|
+
},
|
|
38
|
+
run: () => {
|
|
39
|
+
writeResearchJson({ ok: true, data: LANGUAGES, fields: FIELDS });
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../../src/commands/research/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,CAAC;IACb,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,6EAA6E;IAC1F,IAAI,EAAE,EAAE;CACT,CAAC,CAAC;AAEH,MAAM,SAAS,GAA0C;IACvD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,E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,10 @@ export declare const lighthouseCommand: import("citty").CommandDef<{
|
|
|
15
15
|
readonly required: false;
|
|
16
16
|
readonly default: "json";
|
|
17
17
|
};
|
|
18
|
+
readonly "no-cache": {
|
|
19
|
+
readonly type: "boolean";
|
|
20
|
+
readonly description: "Skip server cache, hit API directly";
|
|
21
|
+
readonly required: false;
|
|
22
|
+
};
|
|
18
23
|
}>;
|
|
19
24
|
//# sourceMappingURL=lighthouse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lighthouse.d.ts","sourceRoot":"","sources":["../../../src/commands/research/lighthouse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lighthouse.d.ts","sourceRoot":"","sources":["../../../src/commands/research/lighthouse.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;EAqC5B,CAAC"}
|