@keystrokehq/news_api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/action.cjs +21 -0
- package/dist/action.cjs.map +1 -0
- package/dist/action.mjs +21 -0
- package/dist/action.mjs.map +1 -0
- package/dist/actions/get-everything.cjs +65 -0
- package/dist/actions/get-everything.cjs.map +1 -0
- package/dist/actions/get-everything.d.cts +9 -0
- package/dist/actions/get-everything.d.cts.map +1 -0
- package/dist/actions/get-everything.d.mts +9 -0
- package/dist/actions/get-everything.d.mts.map +1 -0
- package/dist/actions/get-everything.mjs +64 -0
- package/dist/actions/get-everything.mjs.map +1 -0
- package/dist/actions/get-sources.cjs +111 -0
- package/dist/actions/get-sources.cjs.map +1 -0
- package/dist/actions/get-sources.d.cts +9 -0
- package/dist/actions/get-sources.d.cts.map +1 -0
- package/dist/actions/get-sources.d.mts +9 -0
- package/dist/actions/get-sources.d.mts.map +1 -0
- package/dist/actions/get-sources.mjs +110 -0
- package/dist/actions/get-sources.mjs.map +1 -0
- package/dist/actions/get-top-headlines.cjs +104 -0
- package/dist/actions/get-top-headlines.cjs.map +1 -0
- package/dist/actions/get-top-headlines.d.cts +9 -0
- package/dist/actions/get-top-headlines.d.cts.map +1 -0
- package/dist/actions/get-top-headlines.d.mts +9 -0
- package/dist/actions/get-top-headlines.d.mts.map +1 -0
- package/dist/actions/get-top-headlines.mjs +103 -0
- package/dist/actions/get-top-headlines.mjs.map +1 -0
- package/dist/actions/get-v1-articles.cjs +36 -0
- package/dist/actions/get-v1-articles.cjs.map +1 -0
- package/dist/actions/get-v1-articles.d.cts +9 -0
- package/dist/actions/get-v1-articles.d.cts.map +1 -0
- package/dist/actions/get-v1-articles.d.mts +9 -0
- package/dist/actions/get-v1-articles.d.mts.map +1 -0
- package/dist/actions/get-v1-articles.mjs +35 -0
- package/dist/actions/get-v1-articles.mjs.map +1 -0
- package/dist/actions/index.cjs +9 -0
- package/dist/actions/index.d.cts +5 -0
- package/dist/actions/index.d.mts +5 -0
- package/dist/actions/index.mjs +5 -0
- package/dist/app.cjs +9 -0
- package/dist/app.cjs.map +1 -0
- package/dist/app.d.cts +5 -0
- package/dist/app.d.cts.map +1 -0
- package/dist/app.d.mts +5 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +10 -0
- package/dist/app.mjs.map +1 -0
- package/dist/catalog.cjs +15 -0
- package/dist/catalog.cjs.map +1 -0
- package/dist/catalog.d.cts +14 -0
- package/dist/catalog.d.cts.map +1 -0
- package/dist/catalog.d.mts +14 -0
- package/dist/catalog.d.mts.map +1 -0
- package/dist/catalog.mjs +15 -0
- package/dist/catalog.mjs.map +1 -0
- package/dist/execute.cjs +18 -0
- package/dist/execute.cjs.map +1 -0
- package/dist/execute.mjs +18 -0
- package/dist/execute.mjs.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +8 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @keystrokehq/news_api
|
|
2
|
+
|
|
3
|
+
Keystroke-managed integration.
|
|
4
|
+
|
|
5
|
+
**App:** `news_api`
|
|
6
|
+
**Version:** `20260615_00`
|
|
7
|
+
**Actions:** 4
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { defineAgent } from "@keystrokehq/keystroke/agent";
|
|
11
|
+
import { newsApiGetEverything } from "@keystrokehq/news_api/actions";
|
|
12
|
+
|
|
13
|
+
export default defineAgent({
|
|
14
|
+
key: "news_api-agent",
|
|
15
|
+
tools: [newsApiGetEverything],
|
|
16
|
+
});
|
|
17
|
+
```
|
package/dist/action.cjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_app = require("./app.cjs");
|
|
2
|
+
const require_execute = require("./execute.cjs");
|
|
3
|
+
require("zod");
|
|
4
|
+
//#region src/action.ts
|
|
5
|
+
/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */
|
|
6
|
+
function action(tool, def) {
|
|
7
|
+
return require_app.newsApi.action({
|
|
8
|
+
slug: def.slug,
|
|
9
|
+
name: def.name,
|
|
10
|
+
description: def.description,
|
|
11
|
+
input: def.input,
|
|
12
|
+
output: def.output,
|
|
13
|
+
async run(input) {
|
|
14
|
+
return def.output.parse(await require_execute.executeNewsApiTool(tool, input));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.action = action;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=action.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.cjs","names":["newsApi","executeNewsApiTool"],"sources":["../src/action.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { newsApi } from \"./app\";\nimport { executeNewsApiTool } from \"./execute\";\n\n/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */\nexport function action(\n tool: string,\n def: {\n slug: string;\n name: string;\n description: string;\n input: z.ZodTypeAny;\n output: z.ZodTypeAny;\n },\n) {\n return newsApi.action({\n slug: def.slug,\n name: def.name,\n description: def.description,\n input: def.input,\n output: def.output,\n async run(input) {\n return def.output.parse(await executeNewsApiTool(tool, input as Record<string, unknown>));\n },\n });\n}\n"],"mappings":";;;;;AAMA,SAAgB,OACd,MACA,KAOA;CACA,OAAOA,YAAAA,QAAQ,OAAO;EACpB,MAAM,IAAI;EACV,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,OAAO,IAAI;EACX,QAAQ,IAAI;EACZ,MAAM,IAAI,OAAO;GACf,OAAO,IAAI,OAAO,MAAM,MAAMC,gBAAAA,mBAAmB,MAAM,KAAgC,CAAC;EAC1F;CACF,CAAC;AACH"}
|
package/dist/action.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { newsApi } from "./app.mjs";
|
|
2
|
+
import { executeNewsApiTool } from "./execute.mjs";
|
|
3
|
+
import "zod";
|
|
4
|
+
//#region src/action.ts
|
|
5
|
+
/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */
|
|
6
|
+
function action(tool, def) {
|
|
7
|
+
return newsApi.action({
|
|
8
|
+
slug: def.slug,
|
|
9
|
+
name: def.name,
|
|
10
|
+
description: def.description,
|
|
11
|
+
input: def.input,
|
|
12
|
+
output: def.output,
|
|
13
|
+
async run(input) {
|
|
14
|
+
return def.output.parse(await executeNewsApiTool(tool, input));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { action };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.mjs","names":[],"sources":["../src/action.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { newsApi } from \"./app\";\nimport { executeNewsApiTool } from \"./execute\";\n\n/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */\nexport function action(\n tool: string,\n def: {\n slug: string;\n name: string;\n description: string;\n input: z.ZodTypeAny;\n output: z.ZodTypeAny;\n },\n) {\n return newsApi.action({\n slug: def.slug,\n name: def.name,\n description: def.description,\n input: def.input,\n output: def.output,\n async run(input) {\n return def.output.parse(await executeNewsApiTool(tool, input as Record<string, unknown>));\n },\n });\n}\n"],"mappings":";;;;;AAMA,SAAgB,OACd,MACA,KAOA;CACA,OAAO,QAAQ,OAAO;EACpB,MAAM,IAAI;EACV,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,OAAO,IAAI;EACX,QAAQ,IAAI;EACZ,MAAM,IAAI,OAAO;GACf,OAAO,IAAI,OAAO,MAAM,MAAM,mBAAmB,MAAM,KAAgC,CAAC;EAC1F;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const require_action = require("../action.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/actions/get-everything.ts
|
|
4
|
+
const NewsApiGetEverythingInput = zod.z.object({
|
|
5
|
+
q: zod.z.string().describe("Keywords or phrases to search for in the article title and body").optional(),
|
|
6
|
+
to: zod.z.string().describe("Newest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)").optional(),
|
|
7
|
+
from: zod.z.string().describe("Oldest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)").optional(),
|
|
8
|
+
page: zod.z.number().int().describe("Page number of results to return (default 1) When totalResults exceeds pageSize, increment page to retrieve additional results.").optional(),
|
|
9
|
+
sortBy: zod.z.enum([
|
|
10
|
+
"relevancy",
|
|
11
|
+
"popularity",
|
|
12
|
+
"publishedAt"
|
|
13
|
+
]).describe("Order to sort articles: relevancy, popularity, or publishedAt").optional(),
|
|
14
|
+
domains: zod.z.string().describe("Comma-separated list of domains to include in results").optional(),
|
|
15
|
+
sources: zod.z.string().describe("Comma-separated list of source identifiers to filter on Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs silently return empty results.").optional(),
|
|
16
|
+
language: zod.z.enum([
|
|
17
|
+
"ar",
|
|
18
|
+
"de",
|
|
19
|
+
"en",
|
|
20
|
+
"es",
|
|
21
|
+
"fr",
|
|
22
|
+
"he",
|
|
23
|
+
"it",
|
|
24
|
+
"nl",
|
|
25
|
+
"no",
|
|
26
|
+
"pt",
|
|
27
|
+
"ru",
|
|
28
|
+
"sv",
|
|
29
|
+
"ud",
|
|
30
|
+
"zh"
|
|
31
|
+
]).describe("2-letter ISO-639-1 code to restrict the search to that language").optional(),
|
|
32
|
+
pageSize: zod.z.number().int().describe("Number of results per page (default 20, max 100)").optional(),
|
|
33
|
+
qInTitle: zod.z.string().describe("Keywords or phrases to search for in the article title only").optional(),
|
|
34
|
+
excludeDomains: zod.z.string().describe("Comma-separated list of domains to exclude from results").optional()
|
|
35
|
+
}).describe("Request schema for GET /v2/everything endpoint.");
|
|
36
|
+
const NewsApiGetEverything_ArticleSourceSchema = zod.z.object({
|
|
37
|
+
id: zod.z.string().describe("Identifier for the source").nullable().optional(),
|
|
38
|
+
name: zod.z.string().describe("Name of the source")
|
|
39
|
+
});
|
|
40
|
+
const NewsApiGetEverything_ArticleSchema = zod.z.object({
|
|
41
|
+
url: zod.z.string().describe("URL to the full article"),
|
|
42
|
+
title: zod.z.string().describe("Title of the article"),
|
|
43
|
+
author: zod.z.string().describe("Author of the article").nullable().optional(),
|
|
44
|
+
source: NewsApiGetEverything_ArticleSourceSchema.nullable(),
|
|
45
|
+
content: zod.z.string().describe("Content of the article").nullable().optional(),
|
|
46
|
+
urlToImage: zod.z.string().describe("URL to the image of the article").nullable().optional(),
|
|
47
|
+
description: zod.z.string().describe("Description of the article").nullable().optional(),
|
|
48
|
+
publishedAt: zod.z.string().describe("Publication date/time in ISO8601 format")
|
|
49
|
+
});
|
|
50
|
+
const NewsApiGetEverythingOutput = zod.z.object({
|
|
51
|
+
status: zod.z.string().describe("'ok' or 'error' status of the response"),
|
|
52
|
+
articles: zod.z.array(NewsApiGetEverything_ArticleSchema).describe("List of articles matching the query"),
|
|
53
|
+
totalResults: zod.z.number().int().describe("Total number of results available")
|
|
54
|
+
});
|
|
55
|
+
const newsApiGetEverything = require_action.action("NEWS_API_GET_EVERYTHING", {
|
|
56
|
+
slug: "news_api-get-everything",
|
|
57
|
+
name: "Get Everything",
|
|
58
|
+
description: "Tool to search through every article published by over 150,000 sources. At least one of q, sources, language, or domains must be set or the API returns a parametersMissing error. Historical date range depends on your News API plan tier (free plans limited to ~1 month). No country parameter exists; target geography via sources, domains, or country-specific terms in q. Burst requests may trigger HTTP 429; apply backoff on throttling errors.",
|
|
59
|
+
input: NewsApiGetEverythingInput,
|
|
60
|
+
output: NewsApiGetEverythingOutput
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.newsApiGetEverything = newsApiGetEverything;
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=get-everything.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-everything.cjs","names":["z","action"],"sources":["../../src/actions/get-everything.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const NewsApiGetEverythingInput: z.ZodTypeAny = z.object({\n q: z.string().describe(\"Keywords or phrases to search for in the article title and body\").optional(),\n to: z.string().describe(\"Newest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)\").optional(),\n from: z.string().describe(\"Oldest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)\").optional(),\n page: z.number().int().describe(\"Page number of results to return (default 1) When totalResults exceeds pageSize, increment page to retrieve additional results.\").optional(),\n sortBy: z.enum([\"relevancy\", \"popularity\", \"publishedAt\"]).describe(\"Order to sort articles: relevancy, popularity, or publishedAt\").optional(),\n domains: z.string().describe(\"Comma-separated list of domains to include in results\").optional(),\n sources: z.string().describe(\"Comma-separated list of source identifiers to filter on Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs silently return empty results.\").optional(),\n language: z.enum([\"ar\", \"de\", \"en\", \"es\", \"fr\", \"he\", \"it\", \"nl\", \"no\", \"pt\", \"ru\", \"sv\", \"ud\", \"zh\"]).describe(\"2-letter ISO-639-1 code to restrict the search to that language\").optional(),\n pageSize: z.number().int().describe(\"Number of results per page (default 20, max 100)\").optional(),\n qInTitle: z.string().describe(\"Keywords or phrases to search for in the article title only\").optional(),\n excludeDomains: z.string().describe(\"Comma-separated list of domains to exclude from results\").optional(),\n}).describe(\"Request schema for GET /v2/everything endpoint.\");\nconst NewsApiGetEverything_ArticleSourceSchema: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Identifier for the source\").nullable().optional(),\n name: z.string().describe(\"Name of the source\"),\n});\nconst NewsApiGetEverything_ArticleSchema: z.ZodTypeAny = z.object({\n url: z.string().describe(\"URL to the full article\"),\n title: z.string().describe(\"Title of the article\"),\n author: z.string().describe(\"Author of the article\").nullable().optional(),\n source: NewsApiGetEverything_ArticleSourceSchema.nullable(),\n content: z.string().describe(\"Content of the article\").nullable().optional(),\n urlToImage: z.string().describe(\"URL to the image of the article\").nullable().optional(),\n description: z.string().describe(\"Description of the article\").nullable().optional(),\n publishedAt: z.string().describe(\"Publication date/time in ISO8601 format\"),\n});\nexport const NewsApiGetEverythingOutput: z.ZodTypeAny = z.object({\n status: z.string().describe(\"'ok' or 'error' status of the response\"),\n articles: z.array(NewsApiGetEverything_ArticleSchema).describe(\"List of articles matching the query\"),\n totalResults: z.number().int().describe(\"Total number of results available\"),\n});\n\nexport const newsApiGetEverything = action(\"NEWS_API_GET_EVERYTHING\", {\n slug: \"news_api-get-everything\",\n name: \"Get Everything\",\n description: \"Tool to search through every article published by over 150,000 sources. At least one of q, sources, language, or domains must be set or the API returns a parametersMissing error. Historical date range depends on your News API plan tier (free plans limited to ~1 month). No country parameter exists; target geography via sources, domains, or country-specific terms in q. Burst requests may trigger HTTP 429; apply backoff on throttling errors.\",\n input: NewsApiGetEverythingInput,\n output: NewsApiGetEverythingOutput,\n});\n"],"mappings":";;;AAIA,MAAa,4BAA0CA,IAAAA,EAAE,OAAO;CAC9D,GAAGA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iEAAiE,CAAC,CAAC,SAAS;CACnG,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qMAAqM,CAAC,CAAC,SAAS;CACxO,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qMAAqM,CAAC,CAAC,SAAS;CAC1O,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,iIAAiI,CAAC,CAAC,SAAS;CAC5K,QAAQA,IAAAA,EAAE,KAAK;EAAC;EAAa;EAAc;CAAa,CAAC,CAAC,CAAC,SAAS,+DAA+D,CAAC,CAAC,SAAS;CAC9I,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS;CAC/F,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yJAAyJ,CAAC,CAAC,SAAS;CACjM,UAAUA,IAAAA,EAAE,KAAK;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,iEAAiE,CAAC,CAAC,SAAS;CAC5L,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,kDAAkD,CAAC,CAAC,SAAS;CACjG,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS;CACtG,gBAAgBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yDAAyD,CAAC,CAAC,SAAS;AAC1G,CAAC,CAAC,CAAC,SAAS,iDAAiD;AAC7D,MAAM,2CAAyDA,IAAAA,EAAE,OAAO;CACtE,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,2BAA2B,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACzE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oBAAoB;AAChD,CAAC;AACD,MAAM,qCAAmDA,IAAAA,EAAE,OAAO;CAChE,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB;CAClD,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sBAAsB;CACjD,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACzE,QAAQ,yCAAyC,SAAS;CAC1D,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wBAAwB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC3E,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iCAAiC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACvF,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACnF,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yCAAyC;AAC5E,CAAC;AACD,MAAa,6BAA2CA,IAAAA,EAAE,OAAO;CAC/D,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC;CACpE,UAAUA,IAAAA,EAAE,MAAM,kCAAkC,CAAC,CAAC,SAAS,qCAAqC;CACpG,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,mCAAmC;AAC7E,CAAC;AAED,MAAa,uBAAuBC,eAAAA,OAAO,2BAA2B;CACpE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/get-everything.d.ts
|
|
4
|
+
declare const NewsApiGetEverythingInput: z.ZodTypeAny;
|
|
5
|
+
declare const NewsApiGetEverythingOutput: z.ZodTypeAny;
|
|
6
|
+
declare const newsApiGetEverything: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { newsApiGetEverything };
|
|
9
|
+
//# sourceMappingURL=get-everything.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-everything.d.cts","names":[],"sources":["../../src/actions/get-everything.ts"],"mappings":";;;cAIa,yBAAA,EAA2B,CAAA,CAAE,UAYoB;AAAA,cAejD,0BAAA,EAA4B,CAAA,CAAE,UAIzC;AAAA,cAEW,oBAAA,gCAAoB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/get-everything.d.ts
|
|
4
|
+
declare const NewsApiGetEverythingInput: z.ZodTypeAny;
|
|
5
|
+
declare const NewsApiGetEverythingOutput: z.ZodTypeAny;
|
|
6
|
+
declare const newsApiGetEverything: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { newsApiGetEverything };
|
|
9
|
+
//# sourceMappingURL=get-everything.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-everything.d.mts","names":[],"sources":["../../src/actions/get-everything.ts"],"mappings":";;;cAIa,yBAAA,EAA2B,CAAA,CAAE,UAYoB;AAAA,cAejD,0BAAA,EAA4B,CAAA,CAAE,UAIzC;AAAA,cAEW,oBAAA,gCAAoB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { action } from "../action.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/actions/get-everything.ts
|
|
4
|
+
const NewsApiGetEverythingInput = z.object({
|
|
5
|
+
q: z.string().describe("Keywords or phrases to search for in the article title and body").optional(),
|
|
6
|
+
to: z.string().describe("Newest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)").optional(),
|
|
7
|
+
from: z.string().describe("Oldest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)").optional(),
|
|
8
|
+
page: z.number().int().describe("Page number of results to return (default 1) When totalResults exceeds pageSize, increment page to retrieve additional results.").optional(),
|
|
9
|
+
sortBy: z.enum([
|
|
10
|
+
"relevancy",
|
|
11
|
+
"popularity",
|
|
12
|
+
"publishedAt"
|
|
13
|
+
]).describe("Order to sort articles: relevancy, popularity, or publishedAt").optional(),
|
|
14
|
+
domains: z.string().describe("Comma-separated list of domains to include in results").optional(),
|
|
15
|
+
sources: z.string().describe("Comma-separated list of source identifiers to filter on Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs silently return empty results.").optional(),
|
|
16
|
+
language: z.enum([
|
|
17
|
+
"ar",
|
|
18
|
+
"de",
|
|
19
|
+
"en",
|
|
20
|
+
"es",
|
|
21
|
+
"fr",
|
|
22
|
+
"he",
|
|
23
|
+
"it",
|
|
24
|
+
"nl",
|
|
25
|
+
"no",
|
|
26
|
+
"pt",
|
|
27
|
+
"ru",
|
|
28
|
+
"sv",
|
|
29
|
+
"ud",
|
|
30
|
+
"zh"
|
|
31
|
+
]).describe("2-letter ISO-639-1 code to restrict the search to that language").optional(),
|
|
32
|
+
pageSize: z.number().int().describe("Number of results per page (default 20, max 100)").optional(),
|
|
33
|
+
qInTitle: z.string().describe("Keywords or phrases to search for in the article title only").optional(),
|
|
34
|
+
excludeDomains: z.string().describe("Comma-separated list of domains to exclude from results").optional()
|
|
35
|
+
}).describe("Request schema for GET /v2/everything endpoint.");
|
|
36
|
+
const NewsApiGetEverything_ArticleSourceSchema = z.object({
|
|
37
|
+
id: z.string().describe("Identifier for the source").nullable().optional(),
|
|
38
|
+
name: z.string().describe("Name of the source")
|
|
39
|
+
});
|
|
40
|
+
const NewsApiGetEverything_ArticleSchema = z.object({
|
|
41
|
+
url: z.string().describe("URL to the full article"),
|
|
42
|
+
title: z.string().describe("Title of the article"),
|
|
43
|
+
author: z.string().describe("Author of the article").nullable().optional(),
|
|
44
|
+
source: NewsApiGetEverything_ArticleSourceSchema.nullable(),
|
|
45
|
+
content: z.string().describe("Content of the article").nullable().optional(),
|
|
46
|
+
urlToImage: z.string().describe("URL to the image of the article").nullable().optional(),
|
|
47
|
+
description: z.string().describe("Description of the article").nullable().optional(),
|
|
48
|
+
publishedAt: z.string().describe("Publication date/time in ISO8601 format")
|
|
49
|
+
});
|
|
50
|
+
const newsApiGetEverything = action("NEWS_API_GET_EVERYTHING", {
|
|
51
|
+
slug: "news_api-get-everything",
|
|
52
|
+
name: "Get Everything",
|
|
53
|
+
description: "Tool to search through every article published by over 150,000 sources. At least one of q, sources, language, or domains must be set or the API returns a parametersMissing error. Historical date range depends on your News API plan tier (free plans limited to ~1 month). No country parameter exists; target geography via sources, domains, or country-specific terms in q. Burst requests may trigger HTTP 429; apply backoff on throttling errors.",
|
|
54
|
+
input: NewsApiGetEverythingInput,
|
|
55
|
+
output: z.object({
|
|
56
|
+
status: z.string().describe("'ok' or 'error' status of the response"),
|
|
57
|
+
articles: z.array(NewsApiGetEverything_ArticleSchema).describe("List of articles matching the query"),
|
|
58
|
+
totalResults: z.number().int().describe("Total number of results available")
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { newsApiGetEverything };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=get-everything.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-everything.mjs","names":[],"sources":["../../src/actions/get-everything.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const NewsApiGetEverythingInput: z.ZodTypeAny = z.object({\n q: z.string().describe(\"Keywords or phrases to search for in the article title and body\").optional(),\n to: z.string().describe(\"Newest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)\").optional(),\n from: z.string().describe(\"Oldest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data)\").optional(),\n page: z.number().int().describe(\"Page number of results to return (default 1) When totalResults exceeds pageSize, increment page to retrieve additional results.\").optional(),\n sortBy: z.enum([\"relevancy\", \"popularity\", \"publishedAt\"]).describe(\"Order to sort articles: relevancy, popularity, or publishedAt\").optional(),\n domains: z.string().describe(\"Comma-separated list of domains to include in results\").optional(),\n sources: z.string().describe(\"Comma-separated list of source identifiers to filter on Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs silently return empty results.\").optional(),\n language: z.enum([\"ar\", \"de\", \"en\", \"es\", \"fr\", \"he\", \"it\", \"nl\", \"no\", \"pt\", \"ru\", \"sv\", \"ud\", \"zh\"]).describe(\"2-letter ISO-639-1 code to restrict the search to that language\").optional(),\n pageSize: z.number().int().describe(\"Number of results per page (default 20, max 100)\").optional(),\n qInTitle: z.string().describe(\"Keywords or phrases to search for in the article title only\").optional(),\n excludeDomains: z.string().describe(\"Comma-separated list of domains to exclude from results\").optional(),\n}).describe(\"Request schema for GET /v2/everything endpoint.\");\nconst NewsApiGetEverything_ArticleSourceSchema: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Identifier for the source\").nullable().optional(),\n name: z.string().describe(\"Name of the source\"),\n});\nconst NewsApiGetEverything_ArticleSchema: z.ZodTypeAny = z.object({\n url: z.string().describe(\"URL to the full article\"),\n title: z.string().describe(\"Title of the article\"),\n author: z.string().describe(\"Author of the article\").nullable().optional(),\n source: NewsApiGetEverything_ArticleSourceSchema.nullable(),\n content: z.string().describe(\"Content of the article\").nullable().optional(),\n urlToImage: z.string().describe(\"URL to the image of the article\").nullable().optional(),\n description: z.string().describe(\"Description of the article\").nullable().optional(),\n publishedAt: z.string().describe(\"Publication date/time in ISO8601 format\"),\n});\nexport const NewsApiGetEverythingOutput: z.ZodTypeAny = z.object({\n status: z.string().describe(\"'ok' or 'error' status of the response\"),\n articles: z.array(NewsApiGetEverything_ArticleSchema).describe(\"List of articles matching the query\"),\n totalResults: z.number().int().describe(\"Total number of results available\"),\n});\n\nexport const newsApiGetEverything = action(\"NEWS_API_GET_EVERYTHING\", {\n slug: \"news_api-get-everything\",\n name: \"Get Everything\",\n description: \"Tool to search through every article published by over 150,000 sources. At least one of q, sources, language, or domains must be set or the API returns a parametersMissing error. Historical date range depends on your News API plan tier (free plans limited to ~1 month). No country parameter exists; target geography via sources, domains, or country-specific terms in q. Burst requests may trigger HTTP 429; apply backoff on throttling errors.\",\n input: NewsApiGetEverythingInput,\n output: NewsApiGetEverythingOutput,\n});\n"],"mappings":";;;AAIA,MAAa,4BAA0C,EAAE,OAAO;CAC9D,GAAG,EAAE,OAAO,CAAC,CAAC,SAAS,iEAAiE,CAAC,CAAC,SAAS;CACnG,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,qMAAqM,CAAC,CAAC,SAAS;CACxO,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,qMAAqM,CAAC,CAAC,SAAS;CAC1O,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,iIAAiI,CAAC,CAAC,SAAS;CAC5K,QAAQ,EAAE,KAAK;EAAC;EAAa;EAAc;CAAa,CAAC,CAAC,CAAC,SAAS,+DAA+D,CAAC,CAAC,SAAS;CAC9I,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS;CAC/F,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,yJAAyJ,CAAC,CAAC,SAAS;CACjM,UAAU,EAAE,KAAK;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,iEAAiE,CAAC,CAAC,SAAS;CAC5L,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,kDAAkD,CAAC,CAAC,SAAS;CACjG,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS;CACtG,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS,yDAAyD,CAAC,CAAC,SAAS;AAC1G,CAAC,CAAC,CAAC,SAAS,iDAAiD;AAC7D,MAAM,2CAAyD,EAAE,OAAO;CACtE,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,2BAA2B,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACzE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,oBAAoB;AAChD,CAAC;AACD,MAAM,qCAAmD,EAAE,OAAO;CAChE,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB;CAClD,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,sBAAsB;CACjD,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACzE,QAAQ,yCAAyC,SAAS;CAC1D,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,wBAAwB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC3E,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS,iCAAiC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACvF,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACnF,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,yCAAyC;AAC5E,CAAC;AAOD,MAAa,uBAAuB,OAAO,2BAA2B;CACpE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAXsD,EAAE,OAAO;EAC/D,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC;EACpE,UAAU,EAAE,MAAM,kCAAkC,CAAC,CAAC,SAAS,qCAAqC;EACpG,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,mCAAmC;CAC7E,CAOU;AACV,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const require_action = require("../action.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/actions/get-sources.ts
|
|
4
|
+
const NewsApiGetSourcesInput = zod.z.object({
|
|
5
|
+
country: zod.z.enum([
|
|
6
|
+
"ae",
|
|
7
|
+
"ar",
|
|
8
|
+
"at",
|
|
9
|
+
"au",
|
|
10
|
+
"be",
|
|
11
|
+
"bg",
|
|
12
|
+
"br",
|
|
13
|
+
"ca",
|
|
14
|
+
"ch",
|
|
15
|
+
"cn",
|
|
16
|
+
"co",
|
|
17
|
+
"cu",
|
|
18
|
+
"cz",
|
|
19
|
+
"de",
|
|
20
|
+
"eg",
|
|
21
|
+
"fr",
|
|
22
|
+
"gb",
|
|
23
|
+
"gr",
|
|
24
|
+
"hk",
|
|
25
|
+
"hu",
|
|
26
|
+
"id",
|
|
27
|
+
"ie",
|
|
28
|
+
"il",
|
|
29
|
+
"in",
|
|
30
|
+
"is",
|
|
31
|
+
"it",
|
|
32
|
+
"jp",
|
|
33
|
+
"kr",
|
|
34
|
+
"lt",
|
|
35
|
+
"lv",
|
|
36
|
+
"ma",
|
|
37
|
+
"mx",
|
|
38
|
+
"my",
|
|
39
|
+
"ng",
|
|
40
|
+
"nl",
|
|
41
|
+
"no",
|
|
42
|
+
"nz",
|
|
43
|
+
"ph",
|
|
44
|
+
"pl",
|
|
45
|
+
"pt",
|
|
46
|
+
"ro",
|
|
47
|
+
"rs",
|
|
48
|
+
"ru",
|
|
49
|
+
"sa",
|
|
50
|
+
"se",
|
|
51
|
+
"sg",
|
|
52
|
+
"si",
|
|
53
|
+
"sk",
|
|
54
|
+
"th",
|
|
55
|
+
"tr",
|
|
56
|
+
"tw",
|
|
57
|
+
"ua",
|
|
58
|
+
"us",
|
|
59
|
+
"ve",
|
|
60
|
+
"za"
|
|
61
|
+
]).describe("Filter sources by this country code.").optional(),
|
|
62
|
+
category: zod.z.enum([
|
|
63
|
+
"business",
|
|
64
|
+
"entertainment",
|
|
65
|
+
"general",
|
|
66
|
+
"health",
|
|
67
|
+
"science",
|
|
68
|
+
"sports",
|
|
69
|
+
"technology"
|
|
70
|
+
]).describe("Filter sources by this news category.").optional(),
|
|
71
|
+
language: zod.z.enum([
|
|
72
|
+
"ar",
|
|
73
|
+
"de",
|
|
74
|
+
"en",
|
|
75
|
+
"es",
|
|
76
|
+
"fr",
|
|
77
|
+
"he",
|
|
78
|
+
"it",
|
|
79
|
+
"nl",
|
|
80
|
+
"no",
|
|
81
|
+
"pt",
|
|
82
|
+
"ru",
|
|
83
|
+
"se",
|
|
84
|
+
"ud",
|
|
85
|
+
"zh"
|
|
86
|
+
]).describe("Filter sources by this language code.").optional()
|
|
87
|
+
}).describe("Request parameters for GET_SOURCES.");
|
|
88
|
+
const NewsApiGetSources_SourceItemSchema = zod.z.object({
|
|
89
|
+
id: zod.z.string().describe("Unique identifier for the source."),
|
|
90
|
+
url: zod.z.string().describe("Homepage URL of the source."),
|
|
91
|
+
name: zod.z.string().describe("Display name of the source."),
|
|
92
|
+
country: zod.z.string().describe("Country code of this source."),
|
|
93
|
+
category: zod.z.string().describe("Category of news for this source."),
|
|
94
|
+
language: zod.z.string().describe("Language code of this source."),
|
|
95
|
+
description: zod.z.string().describe("Short description of the source.")
|
|
96
|
+
}).describe("Single news source item.");
|
|
97
|
+
const NewsApiGetSourcesOutput = zod.z.object({
|
|
98
|
+
status: zod.z.enum(["ok", "error"]).describe("Response status."),
|
|
99
|
+
sources: zod.z.array(NewsApiGetSources_SourceItemSchema).describe("List of available news sources.")
|
|
100
|
+
}).describe("Response schema for GET_SOURCES.");
|
|
101
|
+
const newsApiGetSources = require_action.action("NEWS_API_GET_SOURCES", {
|
|
102
|
+
slug: "news_api-get-sources",
|
|
103
|
+
name: "Get Sources",
|
|
104
|
+
description: "Tool to fetch available news sources. Use when you need to retrieve a list of publishers by optional filters like category, language, or country. Source IDs returned here are the only valid IDs for filtering in NEWS_API_GET_EVERYTHING or NEWS_API_GET_TOP_HEADLINES — unrecognized IDs cause silently empty results.",
|
|
105
|
+
input: NewsApiGetSourcesInput,
|
|
106
|
+
output: NewsApiGetSourcesOutput
|
|
107
|
+
});
|
|
108
|
+
//#endregion
|
|
109
|
+
exports.newsApiGetSources = newsApiGetSources;
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=get-sources.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sources.cjs","names":["z","action"],"sources":["../../src/actions/get-sources.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const NewsApiGetSourcesInput: z.ZodTypeAny = z.object({\n country: z.enum([\"ae\", \"ar\", \"at\", \"au\", \"be\", \"bg\", \"br\", \"ca\", \"ch\", \"cn\", \"co\", \"cu\", \"cz\", \"de\", \"eg\", \"fr\", \"gb\", \"gr\", \"hk\", \"hu\", \"id\", \"ie\", \"il\", \"in\", \"is\", \"it\", \"jp\", \"kr\", \"lt\", \"lv\", \"ma\", \"mx\", \"my\", \"ng\", \"nl\", \"no\", \"nz\", \"ph\", \"pl\", \"pt\", \"ro\", \"rs\", \"ru\", \"sa\", \"se\", \"sg\", \"si\", \"sk\", \"th\", \"tr\", \"tw\", \"ua\", \"us\", \"ve\", \"za\"]).describe(\"Filter sources by this country code.\").optional(),\n category: z.enum([\"business\", \"entertainment\", \"general\", \"health\", \"science\", \"sports\", \"technology\"]).describe(\"Filter sources by this news category.\").optional(),\n language: z.enum([\"ar\", \"de\", \"en\", \"es\", \"fr\", \"he\", \"it\", \"nl\", \"no\", \"pt\", \"ru\", \"se\", \"ud\", \"zh\"]).describe(\"Filter sources by this language code.\").optional(),\n}).describe(\"Request parameters for GET_SOURCES.\");\nconst NewsApiGetSources_SourceItemSchema: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique identifier for the source.\"),\n url: z.string().describe(\"Homepage URL of the source.\"),\n name: z.string().describe(\"Display name of the source.\"),\n country: z.string().describe(\"Country code of this source.\"),\n category: z.string().describe(\"Category of news for this source.\"),\n language: z.string().describe(\"Language code of this source.\"),\n description: z.string().describe(\"Short description of the source.\"),\n}).describe(\"Single news source item.\");\nexport const NewsApiGetSourcesOutput: z.ZodTypeAny = z.object({\n status: z.enum([\"ok\", \"error\"]).describe(\"Response status.\"),\n sources: z.array(NewsApiGetSources_SourceItemSchema).describe(\"List of available news sources.\"),\n}).describe(\"Response schema for GET_SOURCES.\");\n\nexport const newsApiGetSources = action(\"NEWS_API_GET_SOURCES\", {\n slug: \"news_api-get-sources\",\n name: \"Get Sources\",\n description: \"Tool to fetch available news sources. Use when you need to retrieve a list of publishers by optional filters like category, language, or country. Source IDs returned here are the only valid IDs for filtering in NEWS_API_GET_EVERYTHING or NEWS_API_GET_TOP_HEADLINES — unrecognized IDs cause silently empty results.\",\n input: NewsApiGetSourcesInput,\n output: NewsApiGetSourcesOutput,\n});\n"],"mappings":";;;AAIA,MAAa,yBAAuCA,IAAAA,EAAE,OAAO;CAC3D,SAASA,IAAAA,EAAE,KAAK;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,sCAAsC,CAAC,CAAC,SAAS;CACtZ,UAAUA,IAAAA,EAAE,KAAK;EAAC;EAAY;EAAiB;EAAW;EAAU;EAAW;EAAU;CAAY,CAAC,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;CACnK,UAAUA,IAAAA,EAAE,KAAK;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;AACpK,CAAC,CAAC,CAAC,SAAS,qCAAqC;AACjD,MAAM,qCAAmDA,IAAAA,EAAE,OAAO;CAChE,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;CAC3D,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B;CACtD,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B;CACvD,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8BAA8B;CAC3D,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;CACjE,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,+BAA+B;CAC7D,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC;AACrE,CAAC,CAAC,CAAC,SAAS,0BAA0B;AACtC,MAAa,0BAAwCA,IAAAA,EAAE,OAAO;CAC5D,QAAQA,IAAAA,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,SAAS,kBAAkB;CAC3D,SAASA,IAAAA,EAAE,MAAM,kCAAkC,CAAC,CAAC,SAAS,iCAAiC;AACjG,CAAC,CAAC,CAAC,SAAS,kCAAkC;AAE9C,MAAa,oBAAoBC,eAAAA,OAAO,wBAAwB;CAC9D,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/get-sources.d.ts
|
|
4
|
+
declare const NewsApiGetSourcesInput: z.ZodTypeAny;
|
|
5
|
+
declare const NewsApiGetSourcesOutput: z.ZodTypeAny;
|
|
6
|
+
declare const newsApiGetSources: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { newsApiGetSources };
|
|
9
|
+
//# sourceMappingURL=get-sources.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sources.d.cts","names":[],"sources":["../../src/actions/get-sources.ts"],"mappings":";;;cAIa,sBAAA,EAAwB,CAAA,CAAE,UAIW;AAAA,cAUrC,uBAAA,EAAyB,CAAA,CAAE,UAGO;AAAA,cAElC,iBAAA,gCAAiB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/get-sources.d.ts
|
|
4
|
+
declare const NewsApiGetSourcesInput: z.ZodTypeAny;
|
|
5
|
+
declare const NewsApiGetSourcesOutput: z.ZodTypeAny;
|
|
6
|
+
declare const newsApiGetSources: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { newsApiGetSources };
|
|
9
|
+
//# sourceMappingURL=get-sources.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sources.d.mts","names":[],"sources":["../../src/actions/get-sources.ts"],"mappings":";;;cAIa,sBAAA,EAAwB,CAAA,CAAE,UAIW;AAAA,cAUrC,uBAAA,EAAyB,CAAA,CAAE,UAGO;AAAA,cAElC,iBAAA,gCAAiB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { action } from "../action.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/actions/get-sources.ts
|
|
4
|
+
const NewsApiGetSourcesInput = z.object({
|
|
5
|
+
country: z.enum([
|
|
6
|
+
"ae",
|
|
7
|
+
"ar",
|
|
8
|
+
"at",
|
|
9
|
+
"au",
|
|
10
|
+
"be",
|
|
11
|
+
"bg",
|
|
12
|
+
"br",
|
|
13
|
+
"ca",
|
|
14
|
+
"ch",
|
|
15
|
+
"cn",
|
|
16
|
+
"co",
|
|
17
|
+
"cu",
|
|
18
|
+
"cz",
|
|
19
|
+
"de",
|
|
20
|
+
"eg",
|
|
21
|
+
"fr",
|
|
22
|
+
"gb",
|
|
23
|
+
"gr",
|
|
24
|
+
"hk",
|
|
25
|
+
"hu",
|
|
26
|
+
"id",
|
|
27
|
+
"ie",
|
|
28
|
+
"il",
|
|
29
|
+
"in",
|
|
30
|
+
"is",
|
|
31
|
+
"it",
|
|
32
|
+
"jp",
|
|
33
|
+
"kr",
|
|
34
|
+
"lt",
|
|
35
|
+
"lv",
|
|
36
|
+
"ma",
|
|
37
|
+
"mx",
|
|
38
|
+
"my",
|
|
39
|
+
"ng",
|
|
40
|
+
"nl",
|
|
41
|
+
"no",
|
|
42
|
+
"nz",
|
|
43
|
+
"ph",
|
|
44
|
+
"pl",
|
|
45
|
+
"pt",
|
|
46
|
+
"ro",
|
|
47
|
+
"rs",
|
|
48
|
+
"ru",
|
|
49
|
+
"sa",
|
|
50
|
+
"se",
|
|
51
|
+
"sg",
|
|
52
|
+
"si",
|
|
53
|
+
"sk",
|
|
54
|
+
"th",
|
|
55
|
+
"tr",
|
|
56
|
+
"tw",
|
|
57
|
+
"ua",
|
|
58
|
+
"us",
|
|
59
|
+
"ve",
|
|
60
|
+
"za"
|
|
61
|
+
]).describe("Filter sources by this country code.").optional(),
|
|
62
|
+
category: z.enum([
|
|
63
|
+
"business",
|
|
64
|
+
"entertainment",
|
|
65
|
+
"general",
|
|
66
|
+
"health",
|
|
67
|
+
"science",
|
|
68
|
+
"sports",
|
|
69
|
+
"technology"
|
|
70
|
+
]).describe("Filter sources by this news category.").optional(),
|
|
71
|
+
language: z.enum([
|
|
72
|
+
"ar",
|
|
73
|
+
"de",
|
|
74
|
+
"en",
|
|
75
|
+
"es",
|
|
76
|
+
"fr",
|
|
77
|
+
"he",
|
|
78
|
+
"it",
|
|
79
|
+
"nl",
|
|
80
|
+
"no",
|
|
81
|
+
"pt",
|
|
82
|
+
"ru",
|
|
83
|
+
"se",
|
|
84
|
+
"ud",
|
|
85
|
+
"zh"
|
|
86
|
+
]).describe("Filter sources by this language code.").optional()
|
|
87
|
+
}).describe("Request parameters for GET_SOURCES.");
|
|
88
|
+
const NewsApiGetSources_SourceItemSchema = z.object({
|
|
89
|
+
id: z.string().describe("Unique identifier for the source."),
|
|
90
|
+
url: z.string().describe("Homepage URL of the source."),
|
|
91
|
+
name: z.string().describe("Display name of the source."),
|
|
92
|
+
country: z.string().describe("Country code of this source."),
|
|
93
|
+
category: z.string().describe("Category of news for this source."),
|
|
94
|
+
language: z.string().describe("Language code of this source."),
|
|
95
|
+
description: z.string().describe("Short description of the source.")
|
|
96
|
+
}).describe("Single news source item.");
|
|
97
|
+
const newsApiGetSources = action("NEWS_API_GET_SOURCES", {
|
|
98
|
+
slug: "news_api-get-sources",
|
|
99
|
+
name: "Get Sources",
|
|
100
|
+
description: "Tool to fetch available news sources. Use when you need to retrieve a list of publishers by optional filters like category, language, or country. Source IDs returned here are the only valid IDs for filtering in NEWS_API_GET_EVERYTHING or NEWS_API_GET_TOP_HEADLINES — unrecognized IDs cause silently empty results.",
|
|
101
|
+
input: NewsApiGetSourcesInput,
|
|
102
|
+
output: z.object({
|
|
103
|
+
status: z.enum(["ok", "error"]).describe("Response status."),
|
|
104
|
+
sources: z.array(NewsApiGetSources_SourceItemSchema).describe("List of available news sources.")
|
|
105
|
+
}).describe("Response schema for GET_SOURCES.")
|
|
106
|
+
});
|
|
107
|
+
//#endregion
|
|
108
|
+
export { newsApiGetSources };
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=get-sources.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sources.mjs","names":[],"sources":["../../src/actions/get-sources.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const NewsApiGetSourcesInput: z.ZodTypeAny = z.object({\n country: z.enum([\"ae\", \"ar\", \"at\", \"au\", \"be\", \"bg\", \"br\", \"ca\", \"ch\", \"cn\", \"co\", \"cu\", \"cz\", \"de\", \"eg\", \"fr\", \"gb\", \"gr\", \"hk\", \"hu\", \"id\", \"ie\", \"il\", \"in\", \"is\", \"it\", \"jp\", \"kr\", \"lt\", \"lv\", \"ma\", \"mx\", \"my\", \"ng\", \"nl\", \"no\", \"nz\", \"ph\", \"pl\", \"pt\", \"ro\", \"rs\", \"ru\", \"sa\", \"se\", \"sg\", \"si\", \"sk\", \"th\", \"tr\", \"tw\", \"ua\", \"us\", \"ve\", \"za\"]).describe(\"Filter sources by this country code.\").optional(),\n category: z.enum([\"business\", \"entertainment\", \"general\", \"health\", \"science\", \"sports\", \"technology\"]).describe(\"Filter sources by this news category.\").optional(),\n language: z.enum([\"ar\", \"de\", \"en\", \"es\", \"fr\", \"he\", \"it\", \"nl\", \"no\", \"pt\", \"ru\", \"se\", \"ud\", \"zh\"]).describe(\"Filter sources by this language code.\").optional(),\n}).describe(\"Request parameters for GET_SOURCES.\");\nconst NewsApiGetSources_SourceItemSchema: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique identifier for the source.\"),\n url: z.string().describe(\"Homepage URL of the source.\"),\n name: z.string().describe(\"Display name of the source.\"),\n country: z.string().describe(\"Country code of this source.\"),\n category: z.string().describe(\"Category of news for this source.\"),\n language: z.string().describe(\"Language code of this source.\"),\n description: z.string().describe(\"Short description of the source.\"),\n}).describe(\"Single news source item.\");\nexport const NewsApiGetSourcesOutput: z.ZodTypeAny = z.object({\n status: z.enum([\"ok\", \"error\"]).describe(\"Response status.\"),\n sources: z.array(NewsApiGetSources_SourceItemSchema).describe(\"List of available news sources.\"),\n}).describe(\"Response schema for GET_SOURCES.\");\n\nexport const newsApiGetSources = action(\"NEWS_API_GET_SOURCES\", {\n slug: \"news_api-get-sources\",\n name: \"Get Sources\",\n description: \"Tool to fetch available news sources. Use when you need to retrieve a list of publishers by optional filters like category, language, or country. Source IDs returned here are the only valid IDs for filtering in NEWS_API_GET_EVERYTHING or NEWS_API_GET_TOP_HEADLINES — unrecognized IDs cause silently empty results.\",\n input: NewsApiGetSourcesInput,\n output: NewsApiGetSourcesOutput,\n});\n"],"mappings":";;;AAIA,MAAa,yBAAuC,EAAE,OAAO;CAC3D,SAAS,EAAE,KAAK;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,sCAAsC,CAAC,CAAC,SAAS;CACtZ,UAAU,EAAE,KAAK;EAAC;EAAY;EAAiB;EAAW;EAAU;EAAW;EAAU;CAAY,CAAC,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;CACnK,UAAU,EAAE,KAAK;EAAC;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;CAAI,CAAC,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;AACpK,CAAC,CAAC,CAAC,SAAS,qCAAqC;AACjD,MAAM,qCAAmD,EAAE,OAAO;CAChE,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;CAC3D,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B;CACtD,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B;CACvD,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,8BAA8B;CAC3D,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;CACjE,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,+BAA+B;CAC7D,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC;AACrE,CAAC,CAAC,CAAC,SAAS,0BAA0B;AAMtC,MAAa,oBAAoB,OAAO,wBAAwB;CAC9D,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAVmD,EAAE,OAAO;EAC5D,QAAQ,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,SAAS,kBAAkB;EAC3D,SAAS,EAAE,MAAM,kCAAkC,CAAC,CAAC,SAAS,iCAAiC;CACjG,CAAC,CAAC,CAAC,SAAS,kCAOF;AACV,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const require_action = require("../action.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/actions/get-top-headlines.ts
|
|
4
|
+
const NewsApiGetTopHeadlinesInput = zod.z.object({
|
|
5
|
+
q: zod.z.string().describe("Keywords or phrase to search for in the article title and body. At least one of 'country', 'category', 'sources', or 'q' must be provided.").optional(),
|
|
6
|
+
page: zod.z.number().int().default(1).describe("Page number for pagination. Default is 1.").optional(),
|
|
7
|
+
country: zod.z.enum([
|
|
8
|
+
"ae",
|
|
9
|
+
"ar",
|
|
10
|
+
"at",
|
|
11
|
+
"au",
|
|
12
|
+
"be",
|
|
13
|
+
"bg",
|
|
14
|
+
"br",
|
|
15
|
+
"ca",
|
|
16
|
+
"ch",
|
|
17
|
+
"cn",
|
|
18
|
+
"co",
|
|
19
|
+
"cu",
|
|
20
|
+
"cz",
|
|
21
|
+
"de",
|
|
22
|
+
"eg",
|
|
23
|
+
"fr",
|
|
24
|
+
"gb",
|
|
25
|
+
"gr",
|
|
26
|
+
"hk",
|
|
27
|
+
"hu",
|
|
28
|
+
"id",
|
|
29
|
+
"ie",
|
|
30
|
+
"il",
|
|
31
|
+
"in",
|
|
32
|
+
"it",
|
|
33
|
+
"jp",
|
|
34
|
+
"kr",
|
|
35
|
+
"lt",
|
|
36
|
+
"lv",
|
|
37
|
+
"ma",
|
|
38
|
+
"mx",
|
|
39
|
+
"my",
|
|
40
|
+
"ng",
|
|
41
|
+
"nl",
|
|
42
|
+
"no",
|
|
43
|
+
"nz",
|
|
44
|
+
"ph",
|
|
45
|
+
"pl",
|
|
46
|
+
"pt",
|
|
47
|
+
"ro",
|
|
48
|
+
"rs",
|
|
49
|
+
"ru",
|
|
50
|
+
"sa",
|
|
51
|
+
"se",
|
|
52
|
+
"sg",
|
|
53
|
+
"si",
|
|
54
|
+
"sk",
|
|
55
|
+
"th",
|
|
56
|
+
"tr",
|
|
57
|
+
"tw",
|
|
58
|
+
"ua",
|
|
59
|
+
"us",
|
|
60
|
+
"ve",
|
|
61
|
+
"za"
|
|
62
|
+
]).describe("2-letter ISO 3166-1 code of the country to get headlines for. At least one of 'country', 'category', 'sources', or 'q' must be provided. Cannot be used with 'sources'.").optional(),
|
|
63
|
+
sources: zod.z.string().describe("Comma-separated list of source identifiers to include (max 20). At least one of 'country', 'category', 'sources', or 'q' must be provided. Cannot be combined with 'country' or 'category'. Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs may silently return empty results.").optional(),
|
|
64
|
+
category: zod.z.enum([
|
|
65
|
+
"business",
|
|
66
|
+
"entertainment",
|
|
67
|
+
"general",
|
|
68
|
+
"health",
|
|
69
|
+
"science",
|
|
70
|
+
"sports",
|
|
71
|
+
"technology"
|
|
72
|
+
]).describe("News category to filter by. At least one of 'country', 'category', 'sources', or 'q' must be provided. Cannot be used with 'sources'.").optional(),
|
|
73
|
+
pageSize: zod.z.number().int().default(20).describe("Number of results per page. Default is 20, max is 100.").optional()
|
|
74
|
+
}).describe("Parameters for fetching top headlines. Cannot combine 'sources' with 'country' or 'category'.\nAt least one of 'sources', 'q', 'country', or 'category' must be provided.");
|
|
75
|
+
const NewsApiGetTopHeadlines_SourceModelSchema = zod.z.object({
|
|
76
|
+
id: zod.z.string().describe("Unique source identifier, if available.").nullable().optional(),
|
|
77
|
+
name: zod.z.string().describe("Name of the news source.")
|
|
78
|
+
});
|
|
79
|
+
const NewsApiGetTopHeadlines_ArticleModelSchema = zod.z.object({
|
|
80
|
+
url: zod.z.string().describe("URL to the full article."),
|
|
81
|
+
title: zod.z.string().describe("Article title."),
|
|
82
|
+
author: zod.z.string().describe("Author of the article.").nullable().optional(),
|
|
83
|
+
source: NewsApiGetTopHeadlines_SourceModelSchema.nullable(),
|
|
84
|
+
content: zod.z.string().describe("Unformatted content of the article.").nullable().optional(),
|
|
85
|
+
urlToImage: zod.z.string().describe("URL to the article's image.").nullable().optional(),
|
|
86
|
+
description: zod.z.string().describe("Short description or snippet.").nullable().optional(),
|
|
87
|
+
publishedAt: zod.z.string().describe("Publication date/time (ISO 8601).")
|
|
88
|
+
});
|
|
89
|
+
const NewsApiGetTopHeadlinesOutput = zod.z.object({
|
|
90
|
+
status: zod.z.enum(["ok", "error"]).describe("API status. 'ok' means successful."),
|
|
91
|
+
articles: zod.z.array(NewsApiGetTopHeadlines_ArticleModelSchema).describe("List of top headline articles."),
|
|
92
|
+
totalResults: zod.z.number().int().describe("Total number of results available.")
|
|
93
|
+
});
|
|
94
|
+
const newsApiGetTopHeadlines = require_action.action("NEWS_API_GET_TOP_HEADLINES", {
|
|
95
|
+
slug: "news_api-get-top-headlines",
|
|
96
|
+
name: "Get Top Headlines",
|
|
97
|
+
description: "Tool to retrieve live top and breaking headlines; does not support historical or date-bounded queries (use NEWS_API_GET_EVERYTHING for past date ranges). Results favor major outlets; use NEWS_API_GET_EVERYTHING or COMPOSIO_SEARCH_WEB for niche publications. Use when you need current headlines filtered by country, category, source(s), or keywords.",
|
|
98
|
+
input: NewsApiGetTopHeadlinesInput,
|
|
99
|
+
output: NewsApiGetTopHeadlinesOutput
|
|
100
|
+
});
|
|
101
|
+
//#endregion
|
|
102
|
+
exports.newsApiGetTopHeadlines = newsApiGetTopHeadlines;
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=get-top-headlines.cjs.map
|