▍ humdrum codex / soft
535 B raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import type { SourceModule } from "../registry";
import { fetchRss } from "../rss";
import {
  NewsConfig,
  NewsPayload,
  type NewsConfig as Config,
  type NewsPayload as Payload,
} from "@/lib/schemas/sources/news";

export const newsModule: SourceModule<Config, Payload> = {
  kind: "news",
  label: "News",
  keyless: true,
  defaultRefreshSeconds: 1800,
  configSchema: NewsConfig,
  payloadSchema: NewsPayload,

  isConfigured: (config) => config.feeds.length > 0,

  fetch: ({ config, signal }) => fetchRss(config, signal),
};