apinoa-mcp 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,17 @@ product photo into Korean"*.
16
16
  Create a key under **Dashboard > API keys** at [apinoa.com](https://apinoa.com). Calls are billed to it
17
17
  at the API's normal rates; a call that fails is not billed.
18
18
 
19
+ **Get a key from the terminal**
20
+
21
+ ```sh
22
+ npx apinoa-mcp login
23
+ ```
24
+
25
+ It prints a code and opens an apinoa page in your browser, where you sign in and enter the code. The new key is
26
+ saved to `.env` in the current folder as `APINOA_API_KEY` (`--out <path>` writes it to another file,
27
+ `--no-browser` only prints the address). It expires after 90 days and is listed under **Dashboard > API keys**,
28
+ where you can revoke it. Give it to your client as below.
29
+
19
30
  **Claude Code**
20
31
 
21
32
  ```sh
@@ -109,6 +120,7 @@ characters keeps as many whole items as fit, with a note saying how many were le
109
120
  |---|---|---|
110
121
  | `APINOA_API_KEY` | — | Required for every data call. |
111
122
  | `APINOA_BASE_URL` | `https://gateway.apinoa.com` | |
123
+ | `APINOA_API_URL` | `https://api.apinoa.com` | Where `login` signs in. https only (http for localhost). |
112
124
  | `APINOA_MCP_MODE` | `code` | `tools` for the 0.1 tool set. |
113
125
  | `APINOA_MCP_DATA_DIR` | `~/.apinoa-mcp` | Where the cache, `store` and saved files live. |
114
126
  | `APINOA_MCP_MAX_BUDGET` | `20000` | The most units one run may be given. |
@@ -1428,6 +1428,101 @@ const snapshot = [
1428
1428
  }
1429
1429
  }
1430
1430
  },
1431
+ {
1432
+ "id": "company",
1433
+ "kind": "company",
1434
+ "operations": [
1435
+ "technologies"
1436
+ ],
1437
+ "includes": [],
1438
+ "regions": [
1439
+ "US"
1440
+ ],
1441
+ "cost": {
1442
+ "technologies": {
1443
+ "base": 1,
1444
+ "max": 1
1445
+ }
1446
+ },
1447
+ "params": {
1448
+ "technologies": {
1449
+ "type": "object",
1450
+ "properties": {
1451
+ "domain": {
1452
+ "type": "string",
1453
+ "minLength": 3,
1454
+ "maxLength": 2048,
1455
+ "description": "The company's domain, e.g. stripe.com. A web address (https://stripe.com/pricing) is accepted and read as its host."
1456
+ }
1457
+ },
1458
+ "required": [
1459
+ "domain"
1460
+ ],
1461
+ "additionalProperties": false,
1462
+ "$schema": "http://json-schema.org/draft-07/schema#"
1463
+ }
1464
+ }
1465
+ },
1466
+ {
1467
+ "id": "copilot",
1468
+ "kind": "answers",
1469
+ "operations": [
1470
+ "answer"
1471
+ ],
1472
+ "includes": [
1473
+ "page"
1474
+ ],
1475
+ "regions": [
1476
+ "US"
1477
+ ],
1478
+ "cost": {
1479
+ "answer": {
1480
+ "base": 1,
1481
+ "max": 1
1482
+ }
1483
+ },
1484
+ "params": {
1485
+ "answer": {
1486
+ "type": "object",
1487
+ "properties": {
1488
+ "prompt": {
1489
+ "type": "string",
1490
+ "minLength": 1,
1491
+ "maxLength": 16000,
1492
+ "description": "The question, as a person would type it."
1493
+ },
1494
+ "country": {
1495
+ "type": "string",
1496
+ "pattern": "^[A-Za-z]{2}$",
1497
+ "description": "The market the answer is asked from, as an ISO 3166 country code. Each engine's page lists its countries."
1498
+ },
1499
+ "include": {
1500
+ "anyOf": [
1501
+ {
1502
+ "type": "array",
1503
+ "items": {
1504
+ "type": "string",
1505
+ "enum": [
1506
+ "details",
1507
+ "page"
1508
+ ]
1509
+ }
1510
+ },
1511
+ {
1512
+ "type": "string"
1513
+ }
1514
+ ],
1515
+ "description": "`page`: also return the answer as a self-contained HTML page, in `page`."
1516
+ }
1517
+ },
1518
+ "required": [
1519
+ "prompt"
1520
+ ],
1521
+ "additionalProperties": false,
1522
+ "$schema": "http://json-schema.org/draft-07/schema#"
1523
+ }
1524
+ }
1525
+ },
1431
1526
  {
1432
1527
  "id": "daum",
1433
1528
  "kind": "serp",
@@ -1681,6 +1776,150 @@ const snapshot = [
1681
1776
  }
1682
1777
  }
1683
1778
  },
1779
+ {
1780
+ "id": "facebook",
1781
+ "kind": "sns",
1782
+ "operations": [
1783
+ "profile",
1784
+ "ads"
1785
+ ],
1786
+ "includes": [],
1787
+ "regions": [
1788
+ "US"
1789
+ ],
1790
+ "cost": {
1791
+ "profile": {
1792
+ "base": 1,
1793
+ "max": 1
1794
+ },
1795
+ "ads": {
1796
+ "base": 1,
1797
+ "max": 1
1798
+ }
1799
+ },
1800
+ "params": {
1801
+ "profile": {
1802
+ "type": "object",
1803
+ "properties": {
1804
+ "username": {
1805
+ "type": "string",
1806
+ "minLength": 1,
1807
+ "description": "The Page's vanity name (e.g. nasa), its numeric id, or the Page URL."
1808
+ }
1809
+ },
1810
+ "additionalProperties": false,
1811
+ "$schema": "http://json-schema.org/draft-07/schema#"
1812
+ },
1813
+ "ads": {
1814
+ "type": "object",
1815
+ "properties": {
1816
+ "query": {
1817
+ "type": "string",
1818
+ "minLength": 1,
1819
+ "description": "Keywords to search the Ad Library for."
1820
+ },
1821
+ "pageId": {
1822
+ "type": "string",
1823
+ "pattern": "^\\d+$",
1824
+ "description": "Every ad one advertiser runs: its numeric Page id (`profile` returns it as `id`)."
1825
+ },
1826
+ "exact": {
1827
+ "type": "boolean",
1828
+ "description": "query: match the exact phrase instead of any of its words."
1829
+ },
1830
+ "country": {
1831
+ "type": "string",
1832
+ "description": "Where the ads ran: an ISO 3166-1 alpha-2 code, or ALL (default)."
1833
+ },
1834
+ "status": {
1835
+ "type": "string",
1836
+ "enum": [
1837
+ "active",
1838
+ "inactive",
1839
+ "all"
1840
+ ],
1841
+ "description": "active (default), inactive or all."
1842
+ },
1843
+ "adType": {
1844
+ "type": "string",
1845
+ "enum": [
1846
+ "all",
1847
+ "political",
1848
+ "housing",
1849
+ "employment",
1850
+ "credit"
1851
+ ],
1852
+ "description": "all (default), or one special category: political (social issues, elections or politics), housing, employment, credit."
1853
+ },
1854
+ "mediaType": {
1855
+ "type": "string",
1856
+ "enum": [
1857
+ "all",
1858
+ "image",
1859
+ "video",
1860
+ "meme",
1861
+ "image_and_meme",
1862
+ "none"
1863
+ ],
1864
+ "description": "all (default), image, video, meme, image_and_meme, none."
1865
+ },
1866
+ "platforms": {
1867
+ "anyOf": [
1868
+ {
1869
+ "type": "string"
1870
+ },
1871
+ {
1872
+ "type": "array",
1873
+ "items": {
1874
+ "type": "string"
1875
+ }
1876
+ }
1877
+ ],
1878
+ "description": "Only ads that ran on these platforms."
1879
+ },
1880
+ "languages": {
1881
+ "anyOf": [
1882
+ {
1883
+ "type": "string"
1884
+ },
1885
+ {
1886
+ "type": "array",
1887
+ "items": {
1888
+ "type": "string"
1889
+ }
1890
+ }
1891
+ ],
1892
+ "description": "Only ads in these languages (ISO 639-1)."
1893
+ },
1894
+ "startDate": {
1895
+ "type": "string",
1896
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
1897
+ "description": "Only ads that started running on or after this day (YYYY-MM-DD)."
1898
+ },
1899
+ "endDate": {
1900
+ "type": "string",
1901
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
1902
+ "description": "Only ads that started running on or before this day (YYYY-MM-DD)."
1903
+ },
1904
+ "sort": {
1905
+ "type": "string",
1906
+ "enum": [
1907
+ "relevance",
1908
+ "impressions"
1909
+ ],
1910
+ "description": "relevance (default), or impressions (highest first; Facebook states impressions for political ads)."
1911
+ },
1912
+ "cursor": {
1913
+ "type": "string",
1914
+ "minLength": 1,
1915
+ "description": "Opaque cursor from the previous page's `cursor`. Pass it alone for the next page."
1916
+ }
1917
+ },
1918
+ "additionalProperties": false,
1919
+ "$schema": "http://json-schema.org/draft-07/schema#"
1920
+ }
1921
+ }
1922
+ },
1684
1923
  {
1685
1924
  "id": "gemini",
1686
1925
  "kind": "answers",
@@ -3716,7 +3955,7 @@ const snapshot = [
3716
3955
  },
3717
3956
  "jobs": {
3718
3957
  "base": 1,
3719
- "max": 1
3958
+ "max": 2
3720
3959
  }
3721
3960
  },
3722
3961
  "params": {
@@ -3817,6 +4056,11 @@ const snapshot = [
3817
4056
  "minLength": 1,
3818
4057
  "description": "Job search keywords (e.g. software engineer)."
3819
4058
  },
4059
+ "company": {
4060
+ "type": "string",
4061
+ "minLength": 1,
4062
+ "description": "Only this company's jobs: its vanity name (e.g. stripe), its company URL, or its numeric LinkedIn company id."
4063
+ },
3820
4064
  "location": {
3821
4065
  "type": "string",
3822
4066
  "minLength": 1,
package/dist/cli.js CHANGED
@@ -3,11 +3,30 @@
3
3
  * apinoa-mcp over stdio, for Claude Desktop, Claude Code, Cursor and any MCP client:
4
4
  *
5
5
  * APINOA_API_KEY=... npx -y apinoa-mcp
6
+ *
7
+ * and `npx apinoa-mcp login`, which gets a key in the browser and writes it to .env (see login.ts).
6
8
  */
7
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
8
10
  import { createApinoaServer } from "./server.js";
9
- const server = await createApinoaServer();
10
- await server.connect(new StdioServerTransport());
11
- if (!process.env.APINOA_API_KEY) {
12
- console.error("apinoa-mcp: APINOA_API_KEY is not set — list_platforms works, every data call will answer 401.");
11
+ if (process.argv[2] === "login") {
12
+ const { login, openInBrowser } = await import("./login.js");
13
+ process.exitCode = await login({
14
+ argv: process.argv.slice(3),
15
+ env: process.env,
16
+ cwd: process.cwd(),
17
+ fetch: globalThis.fetch,
18
+ sleep: (ms) => new Promise((done) => setTimeout(done, ms)),
19
+ now: Date.now,
20
+ stdout: process.stdout,
21
+ stderr: process.stderr,
22
+ isTTY: process.stdout.isTTY === true,
23
+ openBrowser: openInBrowser,
24
+ });
25
+ }
26
+ else {
27
+ const server = await createApinoaServer();
28
+ await server.connect(new StdioServerTransport());
29
+ if (!process.env.APINOA_API_KEY) {
30
+ console.error("apinoa-mcp: APINOA_API_KEY is not set — list_platforms works, every data call will answer 401.");
31
+ }
13
32
  }
@@ -0,0 +1,36 @@
1
+ export interface LoginIO {
2
+ /** The arguments after `login`. */
3
+ argv: string[];
4
+ env: Record<string, string | undefined>;
5
+ cwd: string;
6
+ fetch: typeof fetch;
7
+ sleep: (ms: number) => Promise<void>;
8
+ /** Milliseconds, like Date.now. */
9
+ now: () => number;
10
+ stdout: {
11
+ write(text: string): unknown;
12
+ };
13
+ stderr: {
14
+ write(text: string): unknown;
15
+ };
16
+ /** Whether stdout is a terminal. The browser is opened only when it is. */
17
+ isTTY: boolean;
18
+ openBrowser: (url: string) => void;
19
+ }
20
+ /** Runs `login` and returns the process exit code: 0 once a key is saved, 1 otherwise. */
21
+ export declare function login(io: LoginIO): Promise<number>;
22
+ /** `apinoa_mcp_…3f9a`: enough to tell keys apart in the dashboard, never enough to use one. */
23
+ export declare function maskKey(key: string): string;
24
+ /**
25
+ * The .env text with every APINOA_API_KEY line (also `export APINOA_API_KEY=`) set to the key, and every other
26
+ * line and line ending untouched; with none, one line is appended in the file's own line-ending style. The
27
+ * text is read and written as latin1, so bytes that are not UTF-8 survive.
28
+ */
29
+ export declare function setEnvKey(text: string, key: string): {
30
+ text: string;
31
+ replaced: number;
32
+ };
33
+ /** The display prefixes of the keys the server says this sign-in revoked (apinoa_revoked_keys), safe to print. */
34
+ export declare function revokedKeys(value: unknown): string[];
35
+ /** Opens a URL in the default browser without a shell; failures are ignored (the address is printed anyway). */
36
+ export declare function openInBrowser(url: string): void;
package/dist/login.js ADDED
@@ -0,0 +1,395 @@
1
+ /**
2
+ * `apinoa-mcp login`: gets an API key through the OAuth 2.0 device authorization grant (RFC 8628) and writes
3
+ * it to a .env file as APINOA_API_KEY.
4
+ *
5
+ * The person opens apinoa's page, signs in and types the code shown here; this side polls the token endpoint
6
+ * until they approve, cancel, or the code expires. The key is never printed: only its prefix and last four
7
+ * characters.
8
+ *
9
+ * Everything the command touches comes in through `LoginIO`, so it runs in tests without a terminal, a
10
+ * network or a browser; cli.ts passes the real ones.
11
+ */
12
+ import { spawn } from "node:child_process";
13
+ import { constants } from "node:fs";
14
+ import { access, chmod, readFile, realpath, stat, writeFile } from "node:fs/promises";
15
+ import { basename, dirname, isAbsolute, relative, resolve } from "node:path";
16
+ const DEFAULT_API = "https://api.apinoa.com";
17
+ const CLIENT_ID = "apinoa-cli";
18
+ const GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
19
+ const KEY_NAME = "APINOA_API_KEY";
20
+ const KEY_PREFIX = "apinoa_mcp_";
21
+ const MAX_BACKOFF_MS = 60_000;
22
+ const REQUEST_TIMEOUT_MS = 30_000;
23
+ const AGAIN = "Run `npx apinoa-mcp login` again.";
24
+ const DASHBOARD = "Dashboard → API keys at apinoa.com";
25
+ // RFC 6750 b64token: what a bearer token may contain. Anything else (a newline above all) could add lines to .env.
26
+ const TOKEN = /^[A-Za-z0-9\-._~+/]+=*$/;
27
+ const USAGE = `Usage: npx apinoa-mcp login [--out <path>] [--no-browser]
28
+
29
+ Signs in to apinoa in your browser and saves a new API key to .env as ${KEY_NAME}.
30
+
31
+ --out <path> Write the key to this file instead of .env in the current folder
32
+ --no-browser Print the address without opening it
33
+ -h, --help Show this help
34
+ `;
35
+ /** Runs `login` and returns the process exit code: 0 once a key is saved, 1 otherwise. */
36
+ export async function login(io) {
37
+ const out = (line = "") => void io.stdout.write(line + "\n");
38
+ const fail = (line) => {
39
+ io.stderr.write(line + "\n");
40
+ return 1;
41
+ };
42
+ const args = parseArgs(io.argv);
43
+ if ("error" in args) {
44
+ io.stderr.write(`${args.error}\n\n${USAGE}`);
45
+ return 1;
46
+ }
47
+ if (args.help) {
48
+ io.stdout.write(USAGE);
49
+ return 0;
50
+ }
51
+ const base = apiBase(io.env.APINOA_API_URL);
52
+ if (!base)
53
+ return fail(`APINOA_API_URL must be an https:// address (http:// only for localhost): ${clean(io.env.APINOA_API_URL ?? "")}`);
54
+ const file = resolve(io.cwd, args.envFile ?? ".env");
55
+ const shown = display(io.cwd, file);
56
+ // Before a key exists, so a file that cannot be written does not leave one behind.
57
+ const unwritable = await cannotWrite(file, shown);
58
+ if (unwritable)
59
+ return fail(unwritable);
60
+ // Step 1: a device code and the code the person types.
61
+ let start;
62
+ try {
63
+ start = await post(io, `${base}/oauth/device_authorization`, { client_id: CLIENT_ID, scope: "apinoa" });
64
+ }
65
+ catch (err) {
66
+ return fail(`Could not reach ${base} (${reason(err)}).`);
67
+ }
68
+ if (start.status !== 200) {
69
+ const busy = start.status === 429 || start.status >= 500;
70
+ return fail(`apinoa could not start a sign-in (${describe(start)}).${busy ? " Try again in a minute." : ""}`);
71
+ }
72
+ const grant = start.body ?? {};
73
+ const deviceCode = typeof grant.device_code === "string" ? grant.device_code : "";
74
+ const userCode = typeof grant.user_code === "string" ? clean(grant.user_code).slice(0, 64) : "";
75
+ const page = typeof grant.verification_uri === "string" ? parseUrl(grant.verification_uri) : undefined;
76
+ if (!deviceCode || !userCode || !page || !/^https?:$/.test(page.protocol)) {
77
+ return fail("apinoa answered the sign-in request with something this version does not understand. Update apinoa-mcp and try again.");
78
+ }
79
+ const expiresIn = positive(grant.expires_in) ?? 600;
80
+ let interval = (positive(grant.interval) ?? 5) * 1000;
81
+ const deadline = io.now() + expiresIn * 1000;
82
+ const ours = page.origin === new URL(base).origin;
83
+ out("To create an API key, open this page:");
84
+ out();
85
+ out(` ${clean(page.href)}`);
86
+ out();
87
+ out("and enter the code:");
88
+ out();
89
+ out(` ${userCode}`);
90
+ out();
91
+ out("Enter it only on that apinoa page, and only because you started this yourself. Anyone else who asks you to enter a code is trying to get into your account.");
92
+ out();
93
+ if (!ours) {
94
+ io.stderr.write(`Warning: that address is not on ${new URL(base).origin}. Check it before you visit it.\n`);
95
+ }
96
+ else if (io.isTTY && !io.env.CI && !args.noBrowser) {
97
+ io.openBrowser(page.href);
98
+ out("Opening it in your browser…");
99
+ }
100
+ out("Waiting for approval…");
101
+ // Step 2: poll until the person approves or cancels, or the code expires.
102
+ let wait = interval;
103
+ let lastProblem = "";
104
+ for (;;) {
105
+ const left = deadline - io.now();
106
+ if (left <= wait) {
107
+ if (left > 0)
108
+ await io.sleep(left);
109
+ return fail(`The code expired.${lastProblem ? ` The last attempt to reach apinoa failed (${lastProblem}).` : ""} ${AGAIN}`);
110
+ }
111
+ await io.sleep(wait);
112
+ let answer;
113
+ try {
114
+ answer = await post(io, `${base}/oauth/token`, { grant_type: GRANT_TYPE, device_code: deviceCode, client_id: CLIENT_ID });
115
+ }
116
+ catch (err) {
117
+ lastProblem = reason(err);
118
+ wait = Math.min(Math.max(wait, 1000) * 2, MAX_BACKOFF_MS);
119
+ continue;
120
+ }
121
+ if (answer.status === 429 || answer.status >= 500) {
122
+ lastProblem = `HTTP ${answer.status}`;
123
+ wait = Math.min(Math.max(wait, 1000) * 2, MAX_BACKOFF_MS);
124
+ continue;
125
+ }
126
+ lastProblem = "";
127
+ if (answer.status !== 200) {
128
+ const error = answer.body?.error;
129
+ if (error === "authorization_pending") {
130
+ wait = interval;
131
+ continue;
132
+ }
133
+ if (error === "slow_down") {
134
+ interval += 5000;
135
+ wait = interval;
136
+ continue;
137
+ }
138
+ if (error === "access_denied")
139
+ return fail("The sign-in was cancelled, so no key was created.");
140
+ if (error === "expired_token")
141
+ return fail(`The code expired. ${AGAIN}`);
142
+ return fail(`apinoa refused the sign-in (${describe(answer)}). ${AGAIN}`);
143
+ }
144
+ const token = answer.body ?? {};
145
+ const key = token.access_token;
146
+ if (typeof key !== "string" || !TOKEN.test(key)) {
147
+ return fail("apinoa approved the sign-in but answered with a key this version cannot save. Update apinoa-mcp and try again.");
148
+ }
149
+ return saved(io, file, shown, key, token);
150
+ }
151
+ }
152
+ /** Writes the key, says where it went, and warns when the file is not ignored by git. */
153
+ async function saved(io, file, shown, key, body) {
154
+ const masked = maskKey(key);
155
+ let how;
156
+ try {
157
+ how = await saveKey(file, key);
158
+ }
159
+ catch (err) {
160
+ io.stderr.write(`Could not save the key to ${shown} (${reason(err)}). Revoke it (${masked}) in ${DASHBOARD}, then run \`npx apinoa-mcp login\` again.\n`);
161
+ return 1;
162
+ }
163
+ const lines = [`Approved. The key (${masked}) is saved in ${shown} as ${KEY_NAME}${how === "replaced" ? ", replacing the one that was there" : ""}.`];
164
+ const seconds = positive(body.expires_in);
165
+ const days = seconds === undefined ? undefined : seconds >= 86_400 ? Math.round(seconds / 86_400) : 0;
166
+ const expiry = days === undefined ? "" : days === 0 ? "It expires in less than a day. " : `It expires in ${days} day${days === 1 ? "" : "s"}. `;
167
+ lines.push(`${expiry}It is listed in ${DASHBOARD}, where you can revoke it.`);
168
+ const credit = creditUsd(body.apinoa_credit_usd);
169
+ if (credit)
170
+ lines.push(`Your account received $${credit} of evaluation credit.`);
171
+ const revoked = revokedKeys(body.apinoa_revoked_keys);
172
+ if (revoked.length) {
173
+ lines.push(`apinoa keeps a few CLI keys per account, so this sign-in revoked the oldest (${revoked.map((p) => `${p}…`).join(", ")}). A project still using ${revoked.length === 1 ? "it" : "them"} needs \`npx apinoa-mcp login\` again.`);
174
+ }
175
+ io.stdout.write(lines.join("\n") + "\n");
176
+ if ((await gitIgnored(file)) === false) {
177
+ io.stderr.write(`Warning: ${shown} is not ignored by git. Add it to .gitignore so the key is never committed.\n`);
178
+ }
179
+ if (process.platform !== "win32") {
180
+ const mode = await stat(file).then((s) => s.mode & 0o777, () => undefined);
181
+ if (mode !== undefined && mode & 0o077) {
182
+ io.stderr.write(`Warning: other users on this computer can read ${shown} (mode ${mode.toString(8)}). Run \`chmod 600 ${shown}\`.\n`);
183
+ }
184
+ }
185
+ return 0;
186
+ }
187
+ function parseArgs(argv) {
188
+ const args = { envFile: undefined, noBrowser: false, help: false };
189
+ for (let i = 0; i < argv.length; i++) {
190
+ const a = argv[i];
191
+ if (a === "-h" || a === "--help")
192
+ args.help = true;
193
+ else if (a === "--no-browser")
194
+ args.noBrowser = true;
195
+ // Not --env-file: Node reads that flag anywhere on the command line, past the script name, and
196
+ // exits before this runs when the file does not exist yet (or loads it into this process when it does).
197
+ else if (a === "--out" || a.startsWith("--out=")) {
198
+ const value = a === "--out" ? argv[++i] : a.slice("--out=".length);
199
+ if (!value)
200
+ return { error: "--out needs a path." };
201
+ args.envFile = value;
202
+ }
203
+ else
204
+ return { error: `Unknown option: ${clean(a)}` };
205
+ }
206
+ return args;
207
+ }
208
+ /** The API's base URL, or undefined when it is not https (http is allowed for this machine only). */
209
+ function apiBase(value) {
210
+ const raw = value?.trim() || DEFAULT_API;
211
+ const url = parseUrl(raw);
212
+ if (!url)
213
+ return undefined;
214
+ const local = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
215
+ if (url.protocol !== "https:" && !(url.protocol === "http:" && local))
216
+ return undefined;
217
+ return raw.replace(/\/+$/, "");
218
+ }
219
+ async function post(io, url, form) {
220
+ const res = await io.fetch(url, {
221
+ method: "POST",
222
+ headers: { "content-type": "application/x-www-form-urlencoded", accept: "application/json", "user-agent": "apinoa-mcp" },
223
+ body: new URLSearchParams(form).toString(),
224
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
225
+ });
226
+ const text = await res.text();
227
+ let body;
228
+ try {
229
+ body = JSON.parse(text);
230
+ }
231
+ catch {
232
+ body = undefined;
233
+ }
234
+ return { status: res.status, body: body && typeof body === "object" && !Array.isArray(body) ? body : undefined };
235
+ }
236
+ /** An RFC 6749 error answer as `code: description`, or the HTTP status when it is not one. */
237
+ function describe(a) {
238
+ const code = typeof a.body?.error === "string" ? clean(a.body.error).slice(0, 80) : `HTTP ${a.status}`;
239
+ const text = typeof a.body?.error_description === "string" ? clean(a.body.error_description).slice(0, 300) : "";
240
+ return text ? `${code}: ${text}` : code;
241
+ }
242
+ /** `apinoa_mcp_…3f9a`: enough to tell keys apart in the dashboard, never enough to use one. */
243
+ export function maskKey(key) {
244
+ const tail = key.length >= 12 ? key.slice(-4) : "";
245
+ return `${key.startsWith(KEY_PREFIX) ? KEY_PREFIX : ""}…${tail}`;
246
+ }
247
+ /**
248
+ * The .env text with every APINOA_API_KEY line (also `export APINOA_API_KEY=`) set to the key, and every other
249
+ * line and line ending untouched; with none, one line is appended in the file's own line-ending style. The
250
+ * text is read and written as latin1, so bytes that are not UTF-8 survive.
251
+ */
252
+ export function setEnvKey(text, key) {
253
+ const eol = text.match(/\r?\n/)?.[0] ?? "\n";
254
+ const line = new RegExp(`^((?:\\xEF\\xBB\\xBF)?[ \\t]*)(export[ \\t]+)?${KEY_NAME}[ \\t]*=`);
255
+ let replaced = 0;
256
+ const chunks = text.split(/(?<=\n)/).map((chunk) => {
257
+ const end = chunk.endsWith("\r\n") ? "\r\n" : chunk.endsWith("\n") ? "\n" : "";
258
+ const m = line.exec(chunk.slice(0, chunk.length - end.length));
259
+ if (!m)
260
+ return chunk;
261
+ replaced++;
262
+ return `${m[1]}${m[2] ? "export " : ""}${KEY_NAME}=${key}${end}`;
263
+ });
264
+ if (replaced)
265
+ return { text: chunks.join(""), replaced };
266
+ const sep = text === "" || text.endsWith("\n") ? "" : eol;
267
+ return { text: `${text}${sep}${KEY_NAME}=${key}${eol}`, replaced };
268
+ }
269
+ async function saveKey(file, key) {
270
+ let before;
271
+ try {
272
+ before = await readFile(file, "latin1");
273
+ }
274
+ catch (err) {
275
+ if (err.code !== "ENOENT")
276
+ throw err;
277
+ }
278
+ if (before === undefined) {
279
+ await writeFile(file, `${KEY_NAME}=${key}\n`, { encoding: "latin1", mode: 0o600, flag: "wx" });
280
+ await chmod(file, 0o600).catch(() => { });
281
+ return "created";
282
+ }
283
+ const next = setEnvKey(before, key);
284
+ await writeFile(file, next.text, "latin1");
285
+ return next.replaced ? "replaced" : "added";
286
+ }
287
+ /** Why the key could not be written to `file`, checked before one is created; undefined when it can. */
288
+ async function cannotWrite(file, shown) {
289
+ try {
290
+ if (!(await stat(file)).isFile())
291
+ return `${shown} is not a file.`;
292
+ await access(file, constants.R_OK | constants.W_OK);
293
+ return undefined;
294
+ }
295
+ catch (err) {
296
+ const code = err.code;
297
+ if (code !== "ENOENT")
298
+ return `Cannot write ${shown} (${code ?? reason(err)}).`;
299
+ }
300
+ try {
301
+ if (!(await stat(dirname(file))).isDirectory())
302
+ throw new Error("not a folder");
303
+ await access(dirname(file), constants.W_OK);
304
+ return undefined;
305
+ }
306
+ catch {
307
+ return `Cannot create ${shown}: its folder does not exist or cannot be written to.`;
308
+ }
309
+ }
310
+ /** The display prefixes of the keys the server says this sign-in revoked (apinoa_revoked_keys), safe to print. */
311
+ export function revokedKeys(value) {
312
+ if (!Array.isArray(value))
313
+ return [];
314
+ return value.filter((v) => typeof v === "string" && /^[A-Za-z0-9_]{1,64}$/.test(v)).slice(0, 10);
315
+ }
316
+ /**
317
+ * true when git ignores the file, false when it does not, undefined when git cannot tell (no git, no
318
+ * repository). A symlinked .env is checked at both ends: git ignoring the link says nothing about the file
319
+ * it points to, which may sit in a repository of its own.
320
+ */
321
+ async function gitIgnored(file) {
322
+ const here = await checkIgnore(file);
323
+ const real = await realpath(file).catch(() => file);
324
+ if (real === file)
325
+ return here;
326
+ const there = await checkIgnore(real);
327
+ if (here === false || there === false)
328
+ return false;
329
+ return here ?? there;
330
+ }
331
+ function checkIgnore(file) {
332
+ return new Promise((done) => {
333
+ try {
334
+ const child = spawn("git", ["check-ignore", "-q", "--", basename(file)], { cwd: dirname(file), stdio: "ignore", timeout: 10_000 });
335
+ child.on("error", () => done(undefined));
336
+ child.on("close", (code) => done(code === 0 ? true : code === 1 ? false : undefined));
337
+ }
338
+ catch {
339
+ done(undefined);
340
+ }
341
+ });
342
+ }
343
+ /** Opens a URL in the default browser without a shell; failures are ignored (the address is printed anyway). */
344
+ export function openInBrowser(url) {
345
+ let cmd;
346
+ let args;
347
+ if (process.platform === "darwin")
348
+ [cmd, args] = ["open", [url]];
349
+ else if (process.platform === "win32") {
350
+ // cmd reads its own command line, so a character it treats specially is not passed to it at all.
351
+ if (/[&|<>^%!"\s]/.test(url))
352
+ return;
353
+ [cmd, args] = ["cmd", ["/c", "start", "", url]];
354
+ }
355
+ else
356
+ [cmd, args] = ["xdg-open", [url]];
357
+ try {
358
+ const child = spawn(cmd, args, { detached: true, stdio: "ignore", windowsHide: true });
359
+ child.on("error", () => { });
360
+ child.unref();
361
+ }
362
+ catch {
363
+ // The address is on screen; opening it is a convenience.
364
+ }
365
+ }
366
+ function creditUsd(value) {
367
+ const text = typeof value === "number" && Number.isFinite(value) ? value.toFixed(2) : typeof value === "string" ? value.trim() : "";
368
+ return /^\d{1,9}(\.\d{1,6})?$/.test(text) && Number(text) > 0 ? text : undefined;
369
+ }
370
+ function positive(value) {
371
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;
372
+ }
373
+ function parseUrl(value) {
374
+ try {
375
+ return new URL(value);
376
+ }
377
+ catch {
378
+ return undefined;
379
+ }
380
+ }
381
+ /** A path as typed relative to the folder the command ran in, or absolute when it is outside it. */
382
+ function display(cwd, file) {
383
+ const rel = relative(cwd, file);
384
+ return rel && !rel.startsWith("..") && !isAbsolute(rel) ? rel : file;
385
+ }
386
+ function reason(err) {
387
+ const e = err;
388
+ if (e?.name === "TimeoutError")
389
+ return "timed out";
390
+ return clean(e?.cause?.code ?? e?.code ?? e?.cause?.message ?? e?.message ?? String(err)).slice(0, 200);
391
+ }
392
+ /** Text from elsewhere, without control characters, so it cannot move the cursor or recolour the terminal. */
393
+ function clean(text) {
394
+ return text.replace(/[\u0000-\u001f\u007f-\u009f]/g, "");
395
+ }
@@ -1,6 +1,6 @@
1
1
  // GENERATED by scripts/gen-schema.mjs from the OpenAPI document (tools/public/generate-sdks.sh). Do not edit.
2
2
  // The response types code in `execute` is checked against, and the type each operation returns.
3
- export const SCHEMA_TYPES = "interface Account {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n id?: string;\n handle: string;\n displayName?: string;\n bio?: string;\n url: string;\n avatarUrl?: string;\n bannerUrl?: string;\n verified?: boolean;\n createdAt?: string;\n counts?: {\n followers?: number;\n following?: number;\n posts?: number;\n };\n links?: Link[];\n private?: boolean;\n category?: string;\n location?: string;\n ext?: Record<string, unknown>;\n}\ninterface AccountPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n items: Account[];\n cursor?: string;\n ext?: Record<string, unknown>;\n}\ninterface AccountRef {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n id?: string;\n handle?: string;\n displayName?: string;\n url?: string;\n avatarUrl?: string;\n verified?: boolean;\n counts?: {\n followers?: number;\n following?: number;\n posts?: number;\n };\n bio?: string;\n bannerUrl?: string;\n createdAt?: string;\n links?: Link[];\n private?: boolean;\n category?: string;\n location?: string;\n ext?: Record<string, unknown>;\n}\ninterface Address {\n full?: string;\n street?: string;\n city?: string;\n region?: string;\n postalCode?: string;\n country?: string;\n}\ninterface Answer {\n engine: \"google-aio\" | \"google-ai-mode\" | \"chatgpt\" | \"gemini\" | \"perplexity\" | \"copilot\" | \"naver-ai-brief\" | \"naver-ai-tab\" | \"qwen\";\n outcome: \"answered\" | \"noAnswer\" | \"refused\" | \"partial\";\n prompt: string;\n askedAt: string;\n country: string;\n language?: string;\n conversation?: Conversation;\n title?: string;\n blocks: Block[];\n text: string;\n markdown: string;\n citations: Citation[];\n sources: Source[];\n mentions: AnswerMention[];\n cards: Card[];\n suggestions: Suggestion[];\n results?: Result[];\n page?: string;\n ext?: Record<string, unknown>;\n}\ninterface AnswerMention {\n name: string;\n kind: \"brand\" | \"product\" | \"place\" | \"other\";\n category?: string;\n at?: number;\n card?: number;\n ext?: Record<string, unknown>;\n}\ninterface App {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n related?: {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n }[];\n moreByDeveloper?: {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n }[];\n privacyPolicyUrl?: string;\n chart?: {\n name: string;\n position: number;\n };\n}\ninterface AppReview {\n id?: string;\n author?: string;\n rating: number;\n title?: string;\n body?: string;\n date?: string;\n helpfulCount?: number;\n images: string[];\n reply?: {\n body: string;\n date?: string;\n author?: string;\n };\n ext?: Ext;\n}\ninterface AppReviewsPage {\n engine: \"google-play\" | \"app-store\";\n appId: string;\n sort?: \"relevant\" | \"newest\" | \"highest\" | \"lowest\";\n country?: string;\n lang?: string;\n page: Page;\n reviews: AppReview[];\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface AppsPage {\n engine: \"google-play\" | \"app-store\";\n query: string;\n outcome: \"results\" | \"noResults\";\n country?: string;\n lang?: string;\n apps: {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n rank: number;\n }[];\n page: Page;\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Attribute {\n name: string;\n value: string;\n}\ninterface Audio {\n id?: string;\n title?: string;\n artist?: string;\n url?: string;\n coverUrl?: string;\n durationSec?: number;\n original?: boolean;\n album?: string;\n ext?: Record<string, unknown>;\n}\ntype Block = {\n type: \"heading\";\n level: number;\n markdown: string;\n} | {\n type: \"paragraph\";\n markdown: string;\n} | {\n type: \"list\";\n ordered: boolean;\n items: {\n markdown: string;\n depth: number;\n }[];\n} | {\n type: \"table\";\n header: string[];\n rows: string[][];\n} | {\n type: \"code\";\n language?: string;\n text: string;\n} | {\n type: \"quote\";\n markdown: string;\n} | {\n type: \"cards\";\n cards: number[];\n} | {\n type: \"rule\";\n};\ninterface Broadcast {\n status: \"scheduled\" | \"live\" | \"ended\";\n ext?: Record<string, unknown>;\n}\ninterface CaptionTrack {\n url: string;\n lang?: string;\n format?: string;\n ext?: Record<string, unknown>;\n}\ninterface Card {\n type: \"product\" | \"place\" | \"video\" | \"image\" | \"other\";\n title?: string;\n url?: string;\n image?: string;\n thumbnail?: string;\n width?: number;\n height?: number;\n price?: Price;\n originalPrice?: Price;\n rating?: number;\n reviews?: number;\n merchant?: string;\n site?: string;\n badges?: string[];\n address?: string;\n coordinates?: {\n lat: number;\n lng: number;\n };\n sponsored: boolean;\n ext?: Record<string, unknown>;\n}\ninterface Catalog {\n marketplaces: ({\n id: string;\n kind: \"marketplace\" | \"sns\";\n operations: string[];\n regions?: string[];\n cost?: Record<string, unknown>;\n /** Each operation's input, as JSON Schema. */\n params?: Record<string, unknown>;\n })[];\n pricing?: Record<string, unknown>;\n}\ninterface CategoryList {\n marketplace: string;\n path: CategoryStep[];\n categories: CategoryNode[];\n ext?: Ext;\n}\ninterface CategoryNode {\n id: string;\n name: string;\n parentId?: string;\n hasChildren?: boolean;\n browsable?: boolean;\n imageUrl?: string;\n ext?: Ext;\n}\ninterface CategoryStep {\n id?: string;\n name?: string;\n}\ninterface Citation {\n start: number;\n end: number;\n sources: number[];\n}\ninterface Comment {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n id: string;\n url?: string;\n postId: string;\n parentId?: string;\n author: AccountRef;\n text: string;\n entities?: Entities;\n createdAt?: string;\n editedAt?: string;\n edited?: boolean;\n lang?: string;\n pinned?: boolean;\n byAuthor?: boolean;\n likedByAuthor?: boolean;\n metrics?: {\n likes?: number;\n replies?: number;\n };\n media?: SocialMedia[];\n replies: Comment[];\n moreReplies?: {\n count?: number;\n cursor?: string;\n ext?: Record<string, unknown>;\n };\n ext?: Record<string, unknown>;\n}\ninterface CommentPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n items: Comment[];\n cursor?: string;\n total?: number;\n order?: string;\n ext?: Record<string, unknown>;\n post?: Post;\n}\ninterface Conversation {\n id: string;\n turn: number;\n expiresAt?: string;\n}\ninterface DeliveryOption {\n carrier?: string;\n code?: string;\n estimate?: string;\n cost?: Money;\n free?: boolean;\n minDays?: number;\n maxDays?: number;\n handlingDays?: number;\n cutoff?: string;\n condition?: string;\n available?: boolean;\n minimumOrder?: Money;\n shipsFrom?: string;\n ext?: Ext;\n}\ninterface Developer {\n id?: string;\n name: string;\n url?: string;\n website?: string;\n email?: string;\n address?: string;\n}\ninterface Entities {\n mentions?: Mention[];\n urls?: Url[];\n hashtags?: string[];\n}\ntype Ext = Record<string, unknown>;\ninterface Facet {\n id: string;\n name: string;\n kind: \"select\" | \"range\";\n values: FacetValue[];\n min?: number;\n max?: number;\n maps_to?: string;\n}\ninterface FacetValue {\n value: string;\n name: string;\n selected?: boolean;\n}\ninterface Group {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n kind: \"community\" | \"channel\" | \"company\" | \"hashtag\" | \"sound\" | \"topic\" | \"location\" | \"list\";\n id: string;\n name: string;\n url: string;\n description?: string;\n avatarUrl?: string;\n bannerUrl?: string;\n createdAt?: string;\n counts?: {\n members?: number;\n posts?: number;\n };\n sensitive?: boolean;\n ext?: Record<string, unknown>;\n}\ninterface GroupPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n items: Group[];\n cursor?: string;\n order?: string;\n ext?: Record<string, unknown>;\n}\ntype Hours = {\n day: string;\n hours: string;\n}[];\ninterface Identifiers {\n gtin?: string;\n mpn?: string;\n model?: string;\n}\ninterface InReplyTo {\n id: string;\n url?: string;\n author?: AccountRef;\n}\ninterface Job {\n platform: \"linkedin\";\n id: string;\n url: string;\n title: string;\n company: {\n name: string;\n slug?: string;\n url?: string;\n logoUrl?: string;\n };\n location?: string;\n postedText?: string;\n applicants?: number;\n applicantsAtLeast?: number;\n seniority?: string;\n employmentType?: string;\n jobFunction?: string;\n industries?: string;\n description?: string;\n descriptionHtml?: string;\n applyMethod?: \"linkedin\" | \"external\";\n}\ninterface JobPage {\n platform: \"linkedin\";\n items: {\n platform: \"linkedin\";\n id: string;\n url: string;\n title: string;\n company: {\n name: string;\n url?: string;\n };\n location?: string;\n listedAt?: string;\n logoUrl?: string;\n insights?: string[];\n }[];\n cursor?: string;\n}\ninterface Link {\n url: string;\n title?: string;\n}\ninterface LinkPreview {\n url: string;\n title?: string;\n description?: string;\n thumbnailUrl?: string;\n domain?: string;\n ext?: Record<string, unknown>;\n}\ninterface Media {\n images: string[];\n videos: MediaVideo[];\n}\ninterface MediaFile {\n platform: string;\n postId: string;\n /** The file's MIME type, e.g. video/mp4 or image/jpeg. */\n contentType: string;\n /** The decoded file's size in bytes. */\n bytes: number;\n encoding: \"base64\";\n /** The file, base64-encoded. */\n data: string;\n /** Photo posts: which picture this is, 1-based. */\n index?: number;\n /** Photo posts: how many pictures the post has. */\n count?: number;\n}\ninterface MediaTag {\n account: AccountRef;\n ext?: Record<string, unknown>;\n}\ninterface MediaVariant {\n url: string;\n width?: number;\n height?: number;\n bitrate?: number;\n contentType?: string;\n codec?: string;\n sizeBytes?: number;\n fps?: number;\n quality?: string;\n ext?: Record<string, unknown>;\n}\ninterface MediaVideo {\n thumbnailUrl?: string;\n url?: string;\n title?: string;\n duration?: string;\n ext?: Ext;\n}\ninterface Mention {\n handle: string;\n id?: string;\n displayName?: string;\n ext?: Record<string, unknown>;\n}\ninterface Money {\n currency: string;\n amount: number;\n}\ninterface OcrResult {\n regions: TextRegion[];\n regions_found?: number;\n src_w?: number;\n src_h?: number;\n}\ninterface Offer {\n seller?: Seller;\n price: Money;\n listPrice?: Money;\n condition?: string;\n conditionNote?: string;\n fulfilledBy?: string;\n inStock?: boolean;\n status?: string;\n delivery?: DeliveryOption;\n shippingOptions?: DeliveryOption[];\n unitPrice?: {\n price: Money;\n unit?: string;\n };\n promotions?: string[];\n paymentOptions?: string[];\n ext?: Ext;\n}\ninterface Option {\n id: string;\n name: string;\n values: OptionValue[];\n}\ninterface OptionValue {\n id: string;\n name: string;\n imageUrl?: string;\n}\ninterface Page {\n index: number;\n size: number;\n total?: number;\n}\ninterface Place {\n name: string;\n id?: string;\n lat?: number;\n lng?: number;\n address?: string;\n city?: string;\n type?: string;\n country?: string;\n ext?: Record<string, unknown>;\n}\ninterface PlaceReview {\n id?: string;\n author?: string;\n authorAvatarUrl?: string;\n rating?: number;\n title?: string;\n body?: string;\n date?: string;\n helpfulCount?: number;\n language?: string;\n images: string[];\n reply?: {\n body: string;\n date?: string;\n author?: string;\n };\n ext?: Ext;\n authorId?: string;\n authorUrl?: string;\n pinned?: boolean;\n}\ninterface PlaceReviewsPage {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n placeId: string;\n summary?: Rating;\n starCounts?: Record<string, unknown>;\n sort?: \"relevant\" | \"newest\" | \"highest\" | \"lowest\";\n page: Page;\n reviews: PlaceReview[];\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface PlacesPage {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n query: string;\n outcome: \"results\" | \"noResults\";\n type?: \"maps\" | \"local\";\n location?: string;\n near?: string;\n country?: string;\n lang?: string;\n places: SerpPlace[];\n page: Page;\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Poll {\n options: {\n text: string;\n votes?: number;\n }[];\n totalVotes?: number;\n endsAt?: string;\n ext?: Record<string, unknown>;\n}\ninterface Post {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n id: string;\n url: string;\n author: AccountRef;\n title?: string;\n text?: string;\n createdAt?: string;\n editedAt?: string;\n edited?: boolean;\n lang?: string;\n media: SocialMedia[];\n metrics?: {\n likes?: number;\n comments?: number;\n shares?: number;\n views?: number;\n reposts?: number;\n quotes?: number;\n saves?: number;\n };\n entities?: Entities;\n linkPreview?: LinkPreview;\n poll?: Poll;\n place?: Place;\n audio?: Audio;\n live?: boolean;\n broadcast?: Broadcast;\n repostOf?: Post;\n quoteOf?: Post;\n inReplyTo?: InReplyTo;\n sponsored?: boolean;\n pinned?: boolean;\n aiGenerated?: boolean;\n sensitive?: boolean;\n ext?: Record<string, unknown>;\n}\ninterface PostPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\";\n items: Post[];\n cursor?: string;\n total?: number;\n order?: string;\n ext?: Record<string, unknown>;\n}\ninterface Price {\n text: string;\n amount?: number;\n currency?: string;\n}\ninterface Product {\n marketplace: string;\n id: string;\n url?: string;\n title: string;\n price?: Money;\n listPrice?: Money;\n subscriptionPrice?: Money;\n description?: string;\n fulfilledBy?: string;\n condition?: string;\n unitPrice?: {\n price: Money;\n unit?: string;\n };\n brand?: string;\n rating?: Rating;\n seller?: Seller;\n salesCount?: number;\n salesLabel?: string;\n inStock?: boolean;\n status?: string;\n delivery?: ShippingOption;\n shippingOptions?: ShippingOption[];\n stock?: number;\n identifiers?: Identifiers;\n listingFormat?: string;\n paymentOptions?: string[];\n returnsPolicy?: string;\n badges: string[];\n promotions: string[];\n groupId?: string;\n attributes: Attribute[];\n offersSummary?: {\n count?: number;\n fromPrice?: Money;\n ext?: Ext;\n };\n priceRange?: {\n min: Money;\n max: Money;\n };\n endsAt?: string;\n deliveryTo?: {\n label?: string;\n country?: string;\n postalCode?: string;\n };\n ext?: Ext;\n conditionNote?: string;\n purchaseLimit?: number;\n listedAt?: string;\n features: string[];\n highlights?: string[];\n media: Media;\n category: CategoryStep[];\n options: Option[];\n variants: Variant[];\n offers: Offer[];\n protectionPlans?: ProtectionPlan[];\n reviewSummary?: string;\n reviewAspects: {\n name: string;\n mentions?: number;\n positive?: number;\n negative?: number;\n }[];\n boxContents: string[];\n brandUrl?: string;\n replacedBy?: string;\n reviews: Review[];\n package?: {\n weightKg?: number;\n ext?: Ext;\n };\n}\ninterface ProtectionPlan {\n id?: string;\n name: string;\n price?: Money;\n provider?: string;\n ext?: Ext;\n}\ninterface Rating {\n average: number;\n count?: number;\n distribution?: Record<string, unknown>;\n starCounts?: Record<string, unknown>;\n grouped?: boolean;\n}\ninterface Related {\n term: string;\n topics?: {\n top: RelatedItem[];\n rising: RelatedItem[];\n };\n queries?: {\n top: RelatedItem[];\n rising: RelatedItem[];\n };\n}\ninterface RelatedItem {\n title: string;\n kind?: string;\n id?: string;\n value?: number;\n growth?: string;\n growthValue?: number;\n url?: string;\n}\ninterface Result {\n position: number;\n title: string;\n url: string;\n site?: string;\n favicon?: string;\n image?: string;\n snippet?: string;\n publishedAt?: string;\n breadcrumbs?: string[];\n sitelinks?: {\n title: string;\n url: string;\n ext?: Record<string, unknown>;\n }[];\n ext?: Record<string, unknown>;\n}\ninterface ResultsPage {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n query: string;\n type: \"web\" | \"news\" | \"images\" | \"videos\" | \"image\";\n outcome: \"results\" | \"noResults\";\n country?: string;\n lang?: string;\n device?: \"desktop\" | \"mobile\";\n timeRange?: \"hour\" | \"day\" | \"week\" | \"month\" | \"year\";\n safe?: \"on\" | \"off\";\n image?: string;\n correctedQuery?: string;\n totalResults?: number;\n page: number;\n items: SerpItem[];\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Review {\n id?: string;\n author?: string;\n authorAvatarUrl?: string;\n rating: number;\n title?: string;\n body?: string;\n date?: string;\n country?: string;\n verified?: boolean;\n helpfulCount?: number;\n unhelpfulCount?: number;\n recommended?: boolean;\n badges?: string[];\n syndicatedFrom?: string;\n productId?: string;\n productImageUrl?: string;\n variant?: string;\n variantId?: string;\n language?: string;\n images: string[];\n incentivized?: boolean;\n reply?: {\n body: string;\n date?: string;\n author?: string;\n };\n ext?: Ext;\n}\ninterface ReviewPage {\n marketplace: string;\n productId: string;\n summary?: Rating;\n page: Page;\n reviews: Review[];\n cursor?: string;\n grouped?: boolean;\n reviewSummary?: string;\n reviewAspects?: {\n name: string;\n mentions?: number;\n positive?: number;\n negative?: number;\n }[];\n ext?: Ext;\n}\ninterface SearchItem {\n marketplace: string;\n id: string;\n url?: string;\n title: string;\n price?: Money;\n listPrice?: Money;\n subscriptionPrice?: Money;\n description?: string;\n fulfilledBy?: string;\n condition?: string;\n unitPrice?: {\n price: Money;\n unit?: string;\n };\n brand?: string;\n rating?: Rating;\n seller?: Seller;\n salesCount?: number;\n salesLabel?: string;\n inStock?: boolean;\n status?: string;\n delivery?: ShippingOption;\n shippingOptions?: ShippingOption[];\n stock?: number;\n identifiers?: Identifiers;\n listingFormat?: string;\n paymentOptions?: string[];\n returnsPolicy?: string;\n badges: string[];\n promotions: string[];\n groupId?: string;\n attributes: Attribute[];\n offersSummary?: {\n count?: number;\n fromPrice?: Money;\n ext?: Ext;\n };\n priceRange?: {\n min: Money;\n max: Money;\n };\n endsAt?: string;\n deliveryTo?: {\n label?: string;\n country?: string;\n postalCode?: string;\n };\n ext?: Ext;\n imageUrl?: string;\n sponsored?: boolean;\n variantCount?: number;\n category?: CategoryStep[];\n matchScore?: number;\n offers?: Offer[];\n variants?: Variant[];\n}\ninterface SearchResult {\n marketplace: string;\n query?: string;\n page: Page;\n items: SearchItem[];\n cursor?: string;\n facets?: Facet[];\n relatedSearches?: string[];\n ext?: Ext;\n}\ninterface Seller {\n id?: string;\n name?: string;\n url?: string;\n logoUrl?: string;\n rating?: Rating;\n country?: string;\n positivePercent?: number;\n productCount?: number;\n ext?: Ext;\n}\ntype SerpItem = {\n type: \"organic\";\n rank: number;\n ext?: Record<string, unknown>;\n position: number;\n url: string;\n title: string;\n snippet?: string;\n site?: string;\n displayUrl?: string;\n date?: string;\n sitelinks?: SerpLink[];\n thumbnail?: string;\n image?: string;\n imageWidth?: number;\n imageHeight?: number;\n images?: string[];\n durationSec?: number;\n lang?: string;\n favicon?: string;\n badges?: string[];\n facts?: {\n label: string;\n value: string;\n }[];\n rating?: number;\n ratingScale?: number;\n reviewCount?: number;\n} | {\n type: \"ad\";\n rank: number;\n ext?: Record<string, unknown>;\n block?: \"top\" | \"bottom\" | \"side\";\n url: string;\n title: string;\n snippet?: string;\n advertiser?: string;\n displayUrl?: string;\n sitelinks?: SerpLink[];\n thumbnail?: string;\n phone?: string;\n extensions?: {\n text: string;\n url?: string;\n }[];\n favicon?: string;\n badges?: string[];\n rating?: number;\n reviewCount?: number;\n promotion?: {\n text: string;\n url?: string;\n };\n} | {\n type: \"news\";\n rank: number;\n ext?: Record<string, unknown>;\n url: string;\n title: string;\n snippet?: string;\n source?: string;\n sourceUrl?: string;\n sourceLogo?: string;\n date?: string;\n thumbnail?: string;\n favicon?: string;\n} | {\n type: \"image\";\n rank: number;\n ext?: Record<string, unknown>;\n imageUrl: string;\n thumbnail?: string;\n width?: number;\n height?: number;\n title?: string;\n url?: string;\n source?: string;\n date?: string;\n format?: string;\n favicon?: string;\n} | {\n type: \"video\";\n rank: number;\n ext?: Record<string, unknown>;\n url: string;\n title: string;\n snippet?: string;\n source?: string;\n channel?: string;\n channelUrl?: string;\n avatar?: string;\n date?: string;\n durationSec?: number;\n views?: number;\n viewsText?: string;\n thumbnail?: string;\n embedUrl?: string;\n preview?: string;\n favicon?: string;\n} | {\n type: \"topStories\" | \"videoCarousel\" | \"imagePack\" | \"shopping\" | \"twitter\" | \"discussions\";\n rank: number;\n ext?: Record<string, unknown>;\n title?: string;\n items: Record<string, unknown>[];\n sponsored?: boolean;\n moreUrl?: string;\n total?: number;\n} | {\n type: \"peopleAlsoAsk\";\n rank: number;\n ext?: Record<string, unknown>;\n title?: string;\n questions: {\n question: string;\n answer?: string;\n url?: string;\n title?: string;\n }[];\n} | {\n type: \"relatedSearches\";\n rank: number;\n ext?: Record<string, unknown>;\n title?: string;\n queries: string[];\n} | {\n type: \"knowledgePanel\";\n rank: number;\n ext?: Record<string, unknown>;\n title: string;\n subtitle?: string;\n description?: string;\n source?: SerpLink;\n facts?: {\n label: string;\n value: string;\n }[];\n images?: string[];\n website?: string;\n links?: SerpLink[];\n} | {\n type: \"localPack\";\n rank: number;\n ext?: Record<string, unknown>;\n places: SerpPlace[];\n moreUrl?: string;\n total?: number;\n} | {\n type: \"aiOverview\";\n rank: number;\n ext?: Record<string, unknown>;\n answer: Answer;\n} | {\n type: \"other\";\n rank: number;\n ext?: Record<string, unknown>;\n kind: string;\n title?: string;\n text?: string;\n links?: SerpLink[];\n};\ninterface SerpLink {\n url: string;\n title?: string;\n snippet?: string;\n}\ninterface SerpPlace {\n id: string;\n name: string;\n url?: string;\n address?: Address;\n coordinates?: {\n lat: number;\n lng: number;\n };\n categories?: string[];\n rating?: number;\n reviewCount?: number;\n priceLevel?: string;\n phone?: string;\n website?: string;\n hours?: Hours;\n photos?: string[];\n photoCount?: number;\n attributes?: {\n group?: string;\n label: string;\n value?: string;\n }[];\n status?: \"open\" | \"closed\" | \"temporarilyClosed\" | \"permanentlyClosed\";\n statusText?: string;\n description?: string;\n neighborhood?: string;\n lotAddress?: string;\n logo?: string;\n verifiedOwner?: boolean;\n reviewsUrl?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n}\ninterface ShippingOption {\n carrier?: string;\n code?: string;\n estimate?: string;\n cost?: Money;\n free?: boolean;\n minDays?: number;\n maxDays?: number;\n handlingDays?: number;\n cutoff?: string;\n condition?: string;\n available?: boolean;\n minimumOrder?: Money;\n shipsFrom?: string;\n ext?: Ext;\n}\ninterface ShippingQuote {\n marketplace: string;\n productId: string;\n skuId?: string;\n region: string;\n quantity: number;\n available: boolean;\n options: ShippingOption[];\n}\ninterface SocialMedia {\n type: \"image\" | \"gif\" | \"video\" | \"embed\";\n id?: string;\n url: string;\n width?: number;\n height?: number;\n thumbnailUrl?: string;\n durationSec?: number;\n variants?: MediaVariant[];\n altText?: string;\n caption?: string;\n title?: string;\n hasAudio?: boolean;\n tags?: MediaTag[];\n captions?: CaptionTrack[];\n ext?: Record<string, unknown>;\n}\ninterface Source {\n url: string;\n title?: string;\n site?: string;\n favicon?: string;\n image?: string;\n snippet?: string;\n publishedAt?: string;\n cited: boolean;\n ext?: Record<string, unknown>;\n}\ninterface Suggestion {\n text: string;\n prompt?: string;\n}\ninterface Suggestions {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n query: string;\n country?: string;\n lang?: string;\n suggestions: {\n text: string;\n type?: string;\n ext?: Record<string, unknown>;\n }[];\n ext?: Record<string, unknown>;\n}\ninterface SupportedFonts {\n fontsByLanguage?: Record<string, unknown>;\n defaultByLanguage?: Record<string, unknown>;\n allFonts?: string[];\n allWeights?: string[];\n supportedSourceLanguages?: string[];\n userFonts?: Record<string, unknown>[];\n}\ninterface TextRegion {\n /** The region's number, starting at 0. */\n index: number;\n /** Four corner points, in the original image's coordinates. */\n polygon: number[][];\n bbox: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n /** The text that was read. */\n text: string;\n /** Recognition confidence, 0–1. */\n confidence?: number;\n text_color?: {\n r: number;\n g: number;\n b: number;\n };\n bg_color?: {\n r: number;\n g: number;\n b: number;\n };\n /** How uneven the background is behind the text; near 0 is a flat colour. */\n bg_std?: number;\n font_weight?: string;\n /** True for text on a filled label, such as a price tag. */\n is_badge?: boolean;\n}\ninterface TranslatedRegion {\n /** The region's number, starting at 0. */\n index: number;\n /** Four corner points, in the original image's coordinates. */\n polygon: number[][];\n bbox: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n /** The text that was read. */\n text: string;\n /** Recognition confidence, 0–1. */\n confidence?: number;\n text_color?: {\n r: number;\n g: number;\n b: number;\n };\n bg_color?: {\n r: number;\n g: number;\n b: number;\n };\n /** How uneven the background is behind the text; near 0 is a flat colour. */\n bg_std?: number;\n font_weight?: string;\n /** True for text on a filled label, such as a price tag. */\n is_badge?: boolean;\n /** The translation, in target_language (the field name is historical). */\n text_kr?: string;\n}\ninterface TranslatedRegions {\n /** The image with the source text removed, as a base64 JPEG. */\n inpainted_base64: string;\n regions: TranslatedRegion[];\n regions_count?: number;\n}\ninterface TrendPoint {\n date: string;\n values: number[];\n partial?: boolean;\n noData?: boolean[];\n}\ninterface TrendRegion {\n code?: string;\n name: string;\n values: number[];\n noData?: boolean;\n coordinates?: {\n lat: number;\n lng: number;\n };\n}\ninterface TrendingItem {\n rank: number;\n query: string;\n volume?: string;\n minVolume?: number;\n growth?: string;\n startedAt?: string;\n endedAt?: string;\n active?: boolean;\n categories?: string[];\n related?: string[];\n articles?: {\n title: string;\n url: string;\n source?: string;\n date?: string;\n image?: string;\n }[];\n ext?: Record<string, unknown>;\n}\ninterface TrendingPage {\n engine: \"google-trends\";\n country: string;\n subregion?: string;\n window?: string;\n category?: number;\n lang?: string;\n items: TrendingItem[];\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface TrendsExplore {\n engine: \"google-trends\";\n terms: string[];\n country?: string;\n subregion?: string;\n timeRange: string;\n category?: number;\n property?: \"web\" | \"images\" | \"news\" | \"shopping\" | \"youtube\";\n lang?: string;\n interestOverTime?: {\n points: TrendPoint[];\n averages?: number[];\n };\n interestByRegion?: {\n resolution?: \"country\" | \"region\" | \"metro\" | \"city\";\n measure?: \"interest\" | \"share\";\n regions: TrendRegion[];\n };\n related?: Related[];\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Url {\n url: string;\n displayUrl?: string;\n}\ninterface Variant {\n id: string;\n productId?: string;\n name?: string;\n images?: string[];\n price?: Money;\n listPrice?: Money;\n purchaseLimit?: number;\n inStock?: boolean;\n stock?: number;\n selections: VariantSelection[];\n identifiers?: Identifiers;\n weightKg?: number;\n ext?: Ext;\n}\ninterface VariantSelection {\n optionId: string;\n valueId: string;\n optionName: string;\n valueName: string;\n}";
3
+ export const SCHEMA_TYPES = "interface Account {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n id?: string;\n handle: string;\n displayName?: string;\n bio?: string;\n url: string;\n avatarUrl?: string;\n bannerUrl?: string;\n verified?: boolean;\n createdAt?: string;\n counts?: {\n followers?: number;\n following?: number;\n posts?: number;\n };\n links?: Link[];\n private?: boolean;\n category?: string;\n location?: string;\n ext?: Record<string, unknown>;\n}\ninterface AccountPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n items: Account[];\n cursor?: string;\n ext?: Record<string, unknown>;\n}\ninterface AccountRef {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n id?: string;\n handle?: string;\n displayName?: string;\n url?: string;\n avatarUrl?: string;\n verified?: boolean;\n counts?: {\n followers?: number;\n following?: number;\n posts?: number;\n };\n bio?: string;\n bannerUrl?: string;\n createdAt?: string;\n links?: Link[];\n private?: boolean;\n category?: string;\n location?: string;\n ext?: Record<string, unknown>;\n}\ninterface Address {\n full?: string;\n street?: string;\n city?: string;\n region?: string;\n postalCode?: string;\n country?: string;\n}\ninterface Answer {\n engine: \"google-aio\" | \"google-ai-mode\" | \"chatgpt\" | \"gemini\" | \"perplexity\" | \"copilot\" | \"naver-ai-brief\" | \"naver-ai-tab\" | \"qwen\";\n outcome: \"answered\" | \"noAnswer\" | \"refused\" | \"partial\";\n prompt: string;\n askedAt: string;\n country: string;\n language?: string;\n conversation?: Conversation;\n title?: string;\n blocks: Block[];\n text: string;\n markdown: string;\n citations: Citation[];\n sources: Source[];\n mentions: AnswerMention[];\n cards: Card[];\n suggestions: Suggestion[];\n results?: Result[];\n page?: string;\n ext?: Record<string, unknown>;\n}\ninterface AnswerMention {\n name: string;\n kind: \"brand\" | \"product\" | \"place\" | \"other\";\n category?: string;\n at?: number;\n card?: number;\n ext?: Record<string, unknown>;\n}\ninterface App {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n related?: {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n }[];\n moreByDeveloper?: {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n }[];\n privacyPolicyUrl?: string;\n chart?: {\n name: string;\n position: number;\n };\n}\ninterface AppReview {\n id?: string;\n author?: string;\n rating: number;\n title?: string;\n body?: string;\n date?: string;\n helpfulCount?: number;\n images: string[];\n reply?: {\n body: string;\n date?: string;\n author?: string;\n };\n ext?: Ext;\n}\ninterface AppReviewsPage {\n engine: \"google-play\" | \"app-store\";\n appId: string;\n sort?: \"relevant\" | \"newest\" | \"highest\" | \"lowest\";\n country?: string;\n lang?: string;\n page: Page;\n reviews: AppReview[];\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface AppsPage {\n engine: \"google-play\" | \"app-store\";\n query: string;\n outcome: \"results\" | \"noResults\";\n country?: string;\n lang?: string;\n apps: {\n id: string;\n name: string;\n url?: string;\n developer?: Developer;\n icon?: string;\n screenshots?: string[];\n video?: string;\n summary?: string;\n description?: string;\n categories?: string[];\n rating?: Rating;\n starCounts?: Record<string, unknown>;\n editorsChoice?: boolean;\n price?: Money;\n inAppPurchases?: boolean;\n contentRating?: string;\n version?: string;\n requires?: string;\n releasedAt?: string;\n updatedAt?: string;\n whatsNew?: string;\n country?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n rank: number;\n }[];\n page: Page;\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Attribute {\n name: string;\n value: string;\n}\ninterface Audio {\n id?: string;\n title?: string;\n artist?: string;\n url?: string;\n coverUrl?: string;\n durationSec?: number;\n original?: boolean;\n album?: string;\n ext?: Record<string, unknown>;\n}\ntype Block = {\n type: \"heading\";\n level: number;\n markdown: string;\n} | {\n type: \"paragraph\";\n markdown: string;\n} | {\n type: \"list\";\n ordered: boolean;\n items: {\n markdown: string;\n depth: number;\n }[];\n} | {\n type: \"table\";\n header: string[];\n rows: string[][];\n} | {\n type: \"code\";\n language?: string;\n text: string;\n} | {\n type: \"quote\";\n markdown: string;\n} | {\n type: \"cards\";\n cards: number[];\n} | {\n type: \"rule\";\n};\ninterface Broadcast {\n status: \"scheduled\" | \"live\" | \"ended\";\n ext?: Record<string, unknown>;\n}\ninterface CaptionTrack {\n url: string;\n lang?: string;\n format?: string;\n ext?: Record<string, unknown>;\n}\ninterface Card {\n type: \"product\" | \"place\" | \"video\" | \"image\" | \"other\";\n title?: string;\n url?: string;\n image?: string;\n thumbnail?: string;\n width?: number;\n height?: number;\n price?: Price;\n originalPrice?: Price;\n rating?: number;\n reviews?: number;\n merchant?: string;\n site?: string;\n badges?: string[];\n address?: string;\n coordinates?: {\n lat: number;\n lng: number;\n };\n sponsored: boolean;\n ext?: Record<string, unknown>;\n}\ninterface Catalog {\n marketplaces: ({\n id: string;\n kind: \"marketplace\" | \"sns\";\n operations: string[];\n regions?: string[];\n cost?: Record<string, unknown>;\n /** Each operation's input, as JSON Schema. */\n params?: Record<string, unknown>;\n })[];\n pricing?: Record<string, unknown>;\n}\ninterface CategoryList {\n marketplace: string;\n path: CategoryStep[];\n categories: CategoryNode[];\n ext?: Ext;\n}\ninterface CategoryNode {\n id: string;\n name: string;\n parentId?: string;\n hasChildren?: boolean;\n browsable?: boolean;\n imageUrl?: string;\n ext?: Ext;\n}\ninterface CategoryStep {\n id?: string;\n name?: string;\n}\ninterface Citation {\n start: number;\n end: number;\n sources: number[];\n}\ninterface Comment {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n id: string;\n url?: string;\n postId: string;\n parentId?: string;\n author: AccountRef;\n text: string;\n entities?: Entities;\n createdAt?: string;\n editedAt?: string;\n edited?: boolean;\n lang?: string;\n pinned?: boolean;\n byAuthor?: boolean;\n likedByAuthor?: boolean;\n metrics?: {\n likes?: number;\n replies?: number;\n };\n media?: SocialMedia[];\n replies: Comment[];\n moreReplies?: {\n count?: number;\n cursor?: string;\n ext?: Record<string, unknown>;\n };\n ext?: Record<string, unknown>;\n}\ninterface CommentPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n items: Comment[];\n cursor?: string;\n total?: number;\n order?: string;\n ext?: Record<string, unknown>;\n post?: Post;\n}\ninterface CompanyPage {\n url: string;\n finalUrl?: string;\n status?: number;\n title?: string;\n redirects?: Redirect[];\n headers?: Record<string, unknown>;\n cookies?: string[];\n meta?: Record<string, unknown>;\n scripts?: string[];\n lang?: string;\n blocked?: true;\n error?: \"timeout\" | \"unreachable\" | \"too_many_redirects\";\n}\ninterface Conversation {\n id: string;\n turn: number;\n expiresAt?: string;\n}\ninterface DeliveryOption {\n carrier?: string;\n code?: string;\n estimate?: string;\n cost?: Money;\n free?: boolean;\n minDays?: number;\n maxDays?: number;\n handlingDays?: number;\n cutoff?: string;\n condition?: string;\n available?: boolean;\n minimumOrder?: Money;\n shipsFrom?: string;\n ext?: Ext;\n}\ninterface Developer {\n id?: string;\n name: string;\n url?: string;\n website?: string;\n email?: string;\n address?: string;\n}\ninterface Dns {\n a: string[];\n aaaa: string[];\n cname: string[];\n mx: {\n exchange: string;\n priority: number;\n }[];\n ns: string[];\n txt: string[];\n soa?: {\n nsname: string;\n hostmaster: string;\n };\n}\ninterface Entities {\n mentions?: Mention[];\n urls?: Url[];\n hashtags?: string[];\n}\ninterface Evidence {\n source: \"url\" | \"header\" | \"cookie\" | \"meta\" | \"html\" | \"script\" | \"robots\" | \"dns\" | \"implied\";\n field?: string;\n match: string;\n}\ntype Ext = Record<string, unknown>;\ninterface FacebookAd {\n platform: \"facebook\";\n id: string;\n url: string;\n adId?: string;\n active?: boolean;\n startedAt?: string;\n endedAt?: string;\n activeSeconds?: number;\n platforms: string[];\n page: FacebookAdPage;\n format?: string;\n title?: string;\n body?: string;\n caption?: string;\n linkUrl?: string;\n linkDescription?: string;\n ctaText?: string;\n ctaType?: string;\n images: FacebookAdImage[];\n videos: FacebookAdVideo[];\n cards: FacebookAdCard[];\n categories?: string[];\n spend?: FacebookRange;\n impressions?: FacebookRange;\n reach?: FacebookRange;\n currency?: string;\n disclaimer?: FacebookAdDisclaimer;\n countries?: string[];\n collationId?: string;\n collationCount?: number;\n sensitive?: boolean;\n aiGenerated?: boolean;\n ext?: Record<string, unknown>;\n}\ninterface FacebookAdCard {\n title?: string;\n body?: string;\n caption?: string;\n linkUrl?: string;\n linkDescription?: string;\n ctaText?: string;\n ctaType?: string;\n image?: FacebookAdImage;\n video?: FacebookAdVideo;\n ext?: Record<string, unknown>;\n}\ninterface FacebookAdDisclaimer {\n label?: string;\n byline?: string;\n confirmation?: string;\n submittedOn?: string;\n phone?: string;\n email?: string;\n website?: string;\n address?: string;\n ext?: Record<string, unknown>;\n}\ninterface FacebookAdImage {\n url: string;\n resizedUrl?: string;\n watermarkedUrl?: string;\n crops?: unknown[];\n}\ninterface FacebookAdPage {\n id: string;\n name?: string;\n nameInAd?: string;\n url?: string;\n avatarUrl?: string;\n likes?: number;\n categories?: string[];\n deleted?: boolean;\n}\ninterface FacebookAdVideo {\n hdUrl?: string;\n sdUrl?: string;\n previewUrl?: string;\n watermarkedHdUrl?: string;\n watermarkedSdUrl?: string;\n}\ninterface FacebookAdsPage {\n platform: \"facebook\";\n items: FacebookAd[];\n cursor?: string;\n total?: number;\n totalAtLeast?: number;\n ext?: Record<string, unknown>;\n}\ninterface FacebookRange {\n text: string;\n lower?: number;\n upper?: number;\n}\ninterface Facet {\n id: string;\n name: string;\n kind: \"select\" | \"range\";\n values: FacetValue[];\n min?: number;\n max?: number;\n maps_to?: string;\n}\ninterface FacetValue {\n value: string;\n name: string;\n selected?: boolean;\n}\ninterface Group {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n kind: \"community\" | \"channel\" | \"company\" | \"hashtag\" | \"sound\" | \"topic\" | \"location\" | \"list\";\n id: string;\n name: string;\n url: string;\n description?: string;\n avatarUrl?: string;\n bannerUrl?: string;\n createdAt?: string;\n counts?: {\n members?: number;\n posts?: number;\n };\n sensitive?: boolean;\n ext?: Record<string, unknown>;\n}\ninterface GroupPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n items: Group[];\n cursor?: string;\n order?: string;\n ext?: Record<string, unknown>;\n}\ntype Hours = {\n day: string;\n hours: string;\n}[];\ninterface Identifiers {\n gtin?: string;\n mpn?: string;\n model?: string;\n}\ninterface InReplyTo {\n id: string;\n url?: string;\n author?: AccountRef;\n}\ninterface Job {\n platform: \"linkedin\";\n id: string;\n url: string;\n title: string;\n company: {\n name: string;\n slug?: string;\n url?: string;\n logoUrl?: string;\n };\n location?: string;\n postedText?: string;\n applicants?: number;\n applicantsAtLeast?: number;\n seniority?: string;\n employmentType?: string;\n jobFunction?: string;\n industries?: string;\n description?: string;\n descriptionHtml?: string;\n applyMethod?: \"linkedin\" | \"external\";\n}\ninterface JobPage {\n platform: \"linkedin\";\n items: {\n platform: \"linkedin\";\n id: string;\n url: string;\n title: string;\n company: {\n name: string;\n url?: string;\n };\n location?: string;\n listedAt?: string;\n logoUrl?: string;\n insights?: string[];\n }[];\n cursor?: string;\n}\ninterface Link {\n url: string;\n title?: string;\n}\ninterface LinkPreview {\n url: string;\n title?: string;\n description?: string;\n thumbnailUrl?: string;\n domain?: string;\n ext?: Record<string, unknown>;\n}\ninterface Media {\n images: string[];\n videos: MediaVideo[];\n}\ninterface MediaFile {\n platform: string;\n postId: string;\n /** The file's MIME type, e.g. video/mp4 or image/jpeg. */\n contentType: string;\n /** The decoded file's size in bytes. */\n bytes: number;\n encoding: \"base64\";\n /** The file, base64-encoded. */\n data: string;\n /** Photo posts: which picture this is, 1-based. */\n index?: number;\n /** Photo posts: how many pictures the post has. */\n count?: number;\n}\ninterface MediaTag {\n account: AccountRef;\n ext?: Record<string, unknown>;\n}\ninterface MediaVariant {\n url: string;\n width?: number;\n height?: number;\n bitrate?: number;\n contentType?: string;\n codec?: string;\n sizeBytes?: number;\n fps?: number;\n quality?: string;\n ext?: Record<string, unknown>;\n}\ninterface MediaVideo {\n thumbnailUrl?: string;\n url?: string;\n title?: string;\n duration?: string;\n ext?: Ext;\n}\ninterface Mention {\n handle: string;\n id?: string;\n displayName?: string;\n ext?: Record<string, unknown>;\n}\ninterface Money {\n currency: string;\n amount: number;\n}\ninterface OcrResult {\n regions: TextRegion[];\n regions_found?: number;\n src_w?: number;\n src_h?: number;\n}\ninterface Offer {\n seller?: Seller;\n price: Money;\n listPrice?: Money;\n condition?: string;\n conditionNote?: string;\n fulfilledBy?: string;\n inStock?: boolean;\n status?: string;\n delivery?: DeliveryOption;\n shippingOptions?: DeliveryOption[];\n unitPrice?: {\n price: Money;\n unit?: string;\n };\n promotions?: string[];\n paymentOptions?: string[];\n ext?: Ext;\n}\ninterface Option {\n id: string;\n name: string;\n values: OptionValue[];\n}\ninterface OptionValue {\n id: string;\n name: string;\n imageUrl?: string;\n}\ninterface Page {\n index: number;\n size: number;\n total?: number;\n}\ninterface Place {\n name: string;\n id?: string;\n lat?: number;\n lng?: number;\n address?: string;\n city?: string;\n type?: string;\n country?: string;\n ext?: Record<string, unknown>;\n}\ninterface PlaceReview {\n id?: string;\n author?: string;\n authorAvatarUrl?: string;\n rating?: number;\n title?: string;\n body?: string;\n date?: string;\n helpfulCount?: number;\n language?: string;\n images: string[];\n reply?: {\n body: string;\n date?: string;\n author?: string;\n };\n ext?: Ext;\n authorId?: string;\n authorUrl?: string;\n pinned?: boolean;\n}\ninterface PlaceReviewsPage {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n placeId: string;\n summary?: Rating;\n starCounts?: Record<string, unknown>;\n sort?: \"relevant\" | \"newest\" | \"highest\" | \"lowest\";\n page: Page;\n reviews: PlaceReview[];\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface PlacesPage {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n query: string;\n outcome: \"results\" | \"noResults\";\n type?: \"maps\" | \"local\";\n location?: string;\n near?: string;\n country?: string;\n lang?: string;\n places: SerpPlace[];\n page: Page;\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Poll {\n options: {\n text: string;\n votes?: number;\n }[];\n totalVotes?: number;\n endsAt?: string;\n ext?: Record<string, unknown>;\n}\ninterface Post {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n id: string;\n url: string;\n author: AccountRef;\n title?: string;\n text?: string;\n createdAt?: string;\n editedAt?: string;\n edited?: boolean;\n lang?: string;\n media: SocialMedia[];\n metrics?: {\n likes?: number;\n comments?: number;\n shares?: number;\n views?: number;\n reposts?: number;\n quotes?: number;\n saves?: number;\n };\n entities?: Entities;\n linkPreview?: LinkPreview;\n poll?: Poll;\n place?: Place;\n audio?: Audio;\n live?: boolean;\n broadcast?: Broadcast;\n repostOf?: Post;\n quoteOf?: Post;\n inReplyTo?: InReplyTo;\n sponsored?: boolean;\n pinned?: boolean;\n aiGenerated?: boolean;\n sensitive?: boolean;\n ext?: Record<string, unknown>;\n}\ninterface PostPage {\n platform: \"reddit\" | \"linkedin\" | \"tiktok\" | \"youtube\" | \"instagram\" | \"threads\" | \"x\" | \"facebook\";\n items: Post[];\n cursor?: string;\n total?: number;\n order?: string;\n ext?: Record<string, unknown>;\n}\ninterface Price {\n text: string;\n amount?: number;\n currency?: string;\n}\ninterface Product {\n marketplace: string;\n id: string;\n url?: string;\n title: string;\n price?: Money;\n listPrice?: Money;\n subscriptionPrice?: Money;\n description?: string;\n fulfilledBy?: string;\n condition?: string;\n unitPrice?: {\n price: Money;\n unit?: string;\n };\n brand?: string;\n rating?: Rating;\n seller?: Seller;\n salesCount?: number;\n salesLabel?: string;\n inStock?: boolean;\n status?: string;\n delivery?: ShippingOption;\n shippingOptions?: ShippingOption[];\n stock?: number;\n identifiers?: Identifiers;\n listingFormat?: string;\n paymentOptions?: string[];\n returnsPolicy?: string;\n badges: string[];\n promotions: string[];\n groupId?: string;\n attributes: Attribute[];\n offersSummary?: {\n count?: number;\n fromPrice?: Money;\n ext?: Ext;\n };\n priceRange?: {\n min: Money;\n max: Money;\n };\n endsAt?: string;\n deliveryTo?: {\n label?: string;\n country?: string;\n postalCode?: string;\n };\n ext?: Ext;\n conditionNote?: string;\n purchaseLimit?: number;\n listedAt?: string;\n features: string[];\n highlights?: string[];\n media: Media;\n category: CategoryStep[];\n options: Option[];\n variants: Variant[];\n offers: Offer[];\n protectionPlans?: ProtectionPlan[];\n reviewSummary?: string;\n reviewAspects: {\n name: string;\n mentions?: number;\n positive?: number;\n negative?: number;\n }[];\n boxContents: string[];\n brandUrl?: string;\n replacedBy?: string;\n reviews: Review[];\n package?: {\n weightKg?: number;\n ext?: Ext;\n };\n}\ninterface ProtectionPlan {\n id?: string;\n name: string;\n price?: Money;\n provider?: string;\n ext?: Ext;\n}\ninterface Rating {\n average: number;\n count?: number;\n distribution?: Record<string, unknown>;\n starCounts?: Record<string, unknown>;\n grouped?: boolean;\n}\ninterface Redirect {\n url: string;\n status: number;\n}\ninterface Related {\n term: string;\n topics?: {\n top: RelatedItem[];\n rising: RelatedItem[];\n };\n queries?: {\n top: RelatedItem[];\n rising: RelatedItem[];\n };\n}\ninterface RelatedItem {\n title: string;\n kind?: string;\n id?: string;\n value?: number;\n growth?: string;\n growthValue?: number;\n url?: string;\n}\ninterface Result {\n position: number;\n title: string;\n url: string;\n site?: string;\n favicon?: string;\n image?: string;\n snippet?: string;\n publishedAt?: string;\n breadcrumbs?: string[];\n sitelinks?: {\n title: string;\n url: string;\n ext?: Record<string, unknown>;\n }[];\n ext?: Record<string, unknown>;\n}\ninterface ResultsPage {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n query: string;\n type: \"web\" | \"news\" | \"images\" | \"videos\" | \"image\";\n outcome: \"results\" | \"noResults\";\n country?: string;\n lang?: string;\n device?: \"desktop\" | \"mobile\";\n timeRange?: \"hour\" | \"day\" | \"week\" | \"month\" | \"year\";\n safe?: \"on\" | \"off\";\n image?: string;\n correctedQuery?: string;\n totalResults?: number;\n page: number;\n items: SerpItem[];\n cursor?: string;\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Review {\n id?: string;\n author?: string;\n authorAvatarUrl?: string;\n rating: number;\n title?: string;\n body?: string;\n date?: string;\n country?: string;\n verified?: boolean;\n helpfulCount?: number;\n unhelpfulCount?: number;\n recommended?: boolean;\n badges?: string[];\n syndicatedFrom?: string;\n productId?: string;\n productImageUrl?: string;\n variant?: string;\n variantId?: string;\n language?: string;\n images: string[];\n incentivized?: boolean;\n reply?: {\n body: string;\n date?: string;\n author?: string;\n };\n ext?: Ext;\n}\ninterface ReviewPage {\n marketplace: string;\n productId: string;\n summary?: Rating;\n page: Page;\n reviews: Review[];\n cursor?: string;\n grouped?: boolean;\n reviewSummary?: string;\n reviewAspects?: {\n name: string;\n mentions?: number;\n positive?: number;\n negative?: number;\n }[];\n ext?: Ext;\n}\ninterface Robots {\n status: number;\n sitemaps: string[];\n}\ninterface SearchItem {\n marketplace: string;\n id: string;\n url?: string;\n title: string;\n price?: Money;\n listPrice?: Money;\n subscriptionPrice?: Money;\n description?: string;\n fulfilledBy?: string;\n condition?: string;\n unitPrice?: {\n price: Money;\n unit?: string;\n };\n brand?: string;\n rating?: Rating;\n seller?: Seller;\n salesCount?: number;\n salesLabel?: string;\n inStock?: boolean;\n status?: string;\n delivery?: ShippingOption;\n shippingOptions?: ShippingOption[];\n stock?: number;\n identifiers?: Identifiers;\n listingFormat?: string;\n paymentOptions?: string[];\n returnsPolicy?: string;\n badges: string[];\n promotions: string[];\n groupId?: string;\n attributes: Attribute[];\n offersSummary?: {\n count?: number;\n fromPrice?: Money;\n ext?: Ext;\n };\n priceRange?: {\n min: Money;\n max: Money;\n };\n endsAt?: string;\n deliveryTo?: {\n label?: string;\n country?: string;\n postalCode?: string;\n };\n ext?: Ext;\n imageUrl?: string;\n sponsored?: boolean;\n variantCount?: number;\n category?: CategoryStep[];\n matchScore?: number;\n offers?: Offer[];\n variants?: Variant[];\n}\ninterface SearchResult {\n marketplace: string;\n query?: string;\n page: Page;\n items: SearchItem[];\n cursor?: string;\n facets?: Facet[];\n relatedSearches?: string[];\n ext?: Ext;\n}\ninterface Seller {\n id?: string;\n name?: string;\n url?: string;\n logoUrl?: string;\n rating?: Rating;\n country?: string;\n positivePercent?: number;\n productCount?: number;\n ext?: Ext;\n}\ntype SerpItem = {\n type: \"organic\";\n rank: number;\n ext?: Record<string, unknown>;\n position: number;\n url: string;\n title: string;\n snippet?: string;\n site?: string;\n displayUrl?: string;\n date?: string;\n sitelinks?: SerpLink[];\n thumbnail?: string;\n image?: string;\n imageWidth?: number;\n imageHeight?: number;\n images?: string[];\n durationSec?: number;\n lang?: string;\n favicon?: string;\n badges?: string[];\n facts?: {\n label: string;\n value: string;\n }[];\n rating?: number;\n ratingScale?: number;\n reviewCount?: number;\n} | {\n type: \"ad\";\n rank: number;\n ext?: Record<string, unknown>;\n block?: \"top\" | \"bottom\" | \"side\";\n url: string;\n title: string;\n snippet?: string;\n advertiser?: string;\n displayUrl?: string;\n sitelinks?: SerpLink[];\n thumbnail?: string;\n phone?: string;\n extensions?: {\n text: string;\n url?: string;\n }[];\n favicon?: string;\n badges?: string[];\n rating?: number;\n reviewCount?: number;\n promotion?: {\n text: string;\n url?: string;\n };\n} | {\n type: \"news\";\n rank: number;\n ext?: Record<string, unknown>;\n url: string;\n title: string;\n snippet?: string;\n source?: string;\n sourceUrl?: string;\n sourceLogo?: string;\n date?: string;\n thumbnail?: string;\n favicon?: string;\n} | {\n type: \"image\";\n rank: number;\n ext?: Record<string, unknown>;\n imageUrl: string;\n thumbnail?: string;\n width?: number;\n height?: number;\n title?: string;\n url?: string;\n source?: string;\n date?: string;\n format?: string;\n favicon?: string;\n} | {\n type: \"video\";\n rank: number;\n ext?: Record<string, unknown>;\n url: string;\n title: string;\n snippet?: string;\n source?: string;\n channel?: string;\n channelUrl?: string;\n avatar?: string;\n date?: string;\n durationSec?: number;\n views?: number;\n viewsText?: string;\n thumbnail?: string;\n embedUrl?: string;\n preview?: string;\n favicon?: string;\n} | {\n type: \"topStories\" | \"videoCarousel\" | \"imagePack\" | \"shopping\" | \"twitter\" | \"discussions\";\n rank: number;\n ext?: Record<string, unknown>;\n title?: string;\n items: Record<string, unknown>[];\n sponsored?: boolean;\n moreUrl?: string;\n total?: number;\n} | {\n type: \"peopleAlsoAsk\";\n rank: number;\n ext?: Record<string, unknown>;\n title?: string;\n questions: {\n question: string;\n answer?: string;\n url?: string;\n title?: string;\n }[];\n} | {\n type: \"relatedSearches\";\n rank: number;\n ext?: Record<string, unknown>;\n title?: string;\n queries: string[];\n} | {\n type: \"knowledgePanel\";\n rank: number;\n ext?: Record<string, unknown>;\n title: string;\n subtitle?: string;\n description?: string;\n source?: SerpLink;\n facts?: {\n label: string;\n value: string;\n }[];\n images?: string[];\n website?: string;\n links?: SerpLink[];\n} | {\n type: \"localPack\";\n rank: number;\n ext?: Record<string, unknown>;\n places: SerpPlace[];\n moreUrl?: string;\n total?: number;\n} | {\n type: \"aiOverview\";\n rank: number;\n ext?: Record<string, unknown>;\n answer: Answer;\n} | {\n type: \"other\";\n rank: number;\n ext?: Record<string, unknown>;\n kind: string;\n title?: string;\n text?: string;\n links?: SerpLink[];\n};\ninterface SerpLink {\n url: string;\n title?: string;\n snippet?: string;\n}\ninterface SerpPlace {\n id: string;\n name: string;\n url?: string;\n address?: Address;\n coordinates?: {\n lat: number;\n lng: number;\n };\n categories?: string[];\n rating?: number;\n reviewCount?: number;\n priceLevel?: string;\n phone?: string;\n website?: string;\n hours?: Hours;\n photos?: string[];\n photoCount?: number;\n attributes?: {\n group?: string;\n label: string;\n value?: string;\n }[];\n status?: \"open\" | \"closed\" | \"temporarilyClosed\" | \"permanentlyClosed\";\n statusText?: string;\n description?: string;\n neighborhood?: string;\n lotAddress?: string;\n logo?: string;\n verifiedOwner?: boolean;\n reviewsUrl?: string;\n lang?: string;\n ext?: Record<string, unknown>;\n}\ninterface ShippingOption {\n carrier?: string;\n code?: string;\n estimate?: string;\n cost?: Money;\n free?: boolean;\n minDays?: number;\n maxDays?: number;\n handlingDays?: number;\n cutoff?: string;\n condition?: string;\n available?: boolean;\n minimumOrder?: Money;\n shipsFrom?: string;\n ext?: Ext;\n}\ninterface ShippingQuote {\n marketplace: string;\n productId: string;\n skuId?: string;\n region: string;\n quantity: number;\n available: boolean;\n options: ShippingOption[];\n}\ninterface SocialMedia {\n type: \"image\" | \"gif\" | \"video\" | \"embed\";\n id?: string;\n url: string;\n width?: number;\n height?: number;\n thumbnailUrl?: string;\n durationSec?: number;\n variants?: MediaVariant[];\n altText?: string;\n caption?: string;\n title?: string;\n hasAudio?: boolean;\n tags?: MediaTag[];\n captions?: CaptionTrack[];\n ext?: Record<string, unknown>;\n}\ninterface Source {\n url: string;\n title?: string;\n site?: string;\n favicon?: string;\n image?: string;\n snippet?: string;\n publishedAt?: string;\n cited: boolean;\n ext?: Record<string, unknown>;\n}\ninterface Suggestion {\n text: string;\n prompt?: string;\n}\ninterface Suggestions {\n engine: \"google\" | \"bing\" | \"yahoo\" | \"duckduckgo\" | \"yandex\" | \"baidu\" | \"naver\" | \"yahoo-japan\" | \"seznam\" | \"daum\" | \"sogou\" | \"tripadvisor\";\n query: string;\n country?: string;\n lang?: string;\n suggestions: {\n text: string;\n type?: string;\n ext?: Record<string, unknown>;\n }[];\n ext?: Record<string, unknown>;\n}\ninterface SupportedFonts {\n fontsByLanguage?: Record<string, unknown>;\n defaultByLanguage?: Record<string, unknown>;\n allFonts?: string[];\n allWeights?: string[];\n supportedSourceLanguages?: string[];\n userFonts?: Record<string, unknown>[];\n}\ninterface TechnologiesResult {\n domain: string;\n technologies: Technology[];\n accounts: Technology[];\n page: CompanyPage;\n dns: Dns;\n robots?: Robots;\n}\ninterface Technology {\n name: string;\n categories: string[];\n confidence: number;\n version?: string;\n website?: string;\n evidence: Evidence[];\n}\ninterface TextRegion {\n /** The region's number, starting at 0. */\n index: number;\n /** Four corner points, in the original image's coordinates. */\n polygon: number[][];\n bbox: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n /** The text that was read. */\n text: string;\n /** Recognition confidence, 0–1. */\n confidence?: number;\n text_color?: {\n r: number;\n g: number;\n b: number;\n };\n bg_color?: {\n r: number;\n g: number;\n b: number;\n };\n /** How uneven the background is behind the text; near 0 is a flat colour. */\n bg_std?: number;\n font_weight?: string;\n /** True for text on a filled label, such as a price tag. */\n is_badge?: boolean;\n}\ninterface TranslatedRegion {\n /** The region's number, starting at 0. */\n index: number;\n /** Four corner points, in the original image's coordinates. */\n polygon: number[][];\n bbox: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n /** The text that was read. */\n text: string;\n /** Recognition confidence, 0–1. */\n confidence?: number;\n text_color?: {\n r: number;\n g: number;\n b: number;\n };\n bg_color?: {\n r: number;\n g: number;\n b: number;\n };\n /** How uneven the background is behind the text; near 0 is a flat colour. */\n bg_std?: number;\n font_weight?: string;\n /** True for text on a filled label, such as a price tag. */\n is_badge?: boolean;\n /** The translation, in target_language (the field name is historical). */\n text_kr?: string;\n}\ninterface TranslatedRegions {\n /** The image with the source text removed, as a base64 JPEG. */\n inpainted_base64: string;\n regions: TranslatedRegion[];\n regions_count?: number;\n}\ninterface TrendPoint {\n date: string;\n values: number[];\n partial?: boolean;\n noData?: boolean[];\n}\ninterface TrendRegion {\n code?: string;\n name: string;\n values: number[];\n noData?: boolean;\n coordinates?: {\n lat: number;\n lng: number;\n };\n}\ninterface TrendingItem {\n rank: number;\n query: string;\n volume?: string;\n minVolume?: number;\n growth?: string;\n startedAt?: string;\n endedAt?: string;\n active?: boolean;\n categories?: string[];\n related?: string[];\n articles?: {\n title: string;\n url: string;\n source?: string;\n date?: string;\n image?: string;\n }[];\n ext?: Record<string, unknown>;\n}\ninterface TrendingPage {\n engine: \"google-trends\";\n country: string;\n subregion?: string;\n window?: string;\n category?: number;\n lang?: string;\n items: TrendingItem[];\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface TrendsExplore {\n engine: \"google-trends\";\n terms: string[];\n country?: string;\n subregion?: string;\n timeRange: string;\n category?: number;\n property?: \"web\" | \"images\" | \"news\" | \"shopping\" | \"youtube\";\n lang?: string;\n interestOverTime?: {\n points: TrendPoint[];\n averages?: number[];\n };\n interestByRegion?: {\n resolution?: \"country\" | \"region\" | \"metro\" | \"city\";\n measure?: \"interest\" | \"share\";\n regions: TrendRegion[];\n };\n related?: Related[];\n fetchedAt: string;\n ext?: Record<string, unknown>;\n}\ninterface Url {\n url: string;\n displayUrl?: string;\n}\ninterface Variant {\n id: string;\n productId?: string;\n name?: string;\n images?: string[];\n price?: Money;\n listPrice?: Money;\n purchaseLimit?: number;\n inStock?: boolean;\n stock?: number;\n selections: VariantSelection[];\n identifiers?: Identifiers;\n weightKg?: number;\n ext?: Ext;\n}\ninterface VariantSelection {\n optionId: string;\n valueId: string;\n optionName: string;\n valueName: string;\n}";
4
4
  export const RETURNS = {
5
5
  "aliexpress/search": "SearchResult",
6
6
  "aliexpress/browse": "SearchResult",
@@ -21,10 +21,14 @@ export const RETURNS = {
21
21
  "bing/search": "ResultsPage",
22
22
  "bing/suggestions": "Suggestions",
23
23
  "chatgpt/answer": "Answer",
24
+ "company/technologies": "TechnologiesResult",
25
+ "copilot/answer": "Answer",
24
26
  "daum/search": "ResultsPage",
25
27
  "daum/suggestions": "Suggestions",
26
28
  "duckduckgo/search": "ResultsPage",
27
29
  "duckduckgo/suggestions": "Suggestions",
30
+ "facebook/profile": "Account",
31
+ "facebook/ads": "FacebookAdsPage",
28
32
  "gemini/answer": "Answer",
29
33
  "google/search": "ResultsPage",
30
34
  "google/suggestions": "Suggestions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apinoa-mcp",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "mcpName": "io.github.apinoahq/apinoa-mcp",
5
5
  "description": "MCP server for apinoa: marketplace products, social posts, search results and AI answers (Amazon, TikTok, Google, ChatGPT and more) for Claude Code, Codex, Cursor and any MCP client. Code mode: the model writes TypeScript against a typed client, run in a sandbox.",
6
6
  "license": "MIT",