import { RpcMethod } from './commonTypes'; export type NewsService_ListNewsFeeds = RpcMethod; export type NewsService_SetNewsFeed = RpcMethod; export type NewsService_DeleteNewsFeed = RpcMethod; /** * NewsService manages the registry of news feeds an application's email news * blocks read from. Feeds are imported hourly by the recommender. */ export interface NewsService { /** Lists the news feeds registered for an application (code XXXXX-XXXXX), each with the outcome of its last hourly import. Use to fill the feed selector of an email news block and to show why a feed went quiet. */ ListNewsFeeds: NewsService_ListNewsFeeds; /** Registers an RSS/Atom news feed for an application (code XXXXX-XXXXX), or updates one when code is given. Articles are imported hourly; an application may have several feeds. */ SetNewsFeed: NewsService_SetNewsFeed; /** Removes a news feed of an application (code XXXXX-XXXXX) from the registry. Imported articles are no longer refreshed and stop being served once they fall out of the 30-day freshness window. */ DeleteNewsFeed: NewsService_DeleteNewsFeed; } export type NewsFeed = { /** Stable feed id; an email block references the feed by this code. */ code: string; /** Human-readable name shown in the feed selector. */ name: string; /** RSS/Atom feed URL. */ url: string; /** A disabled feed keeps its articles but stops being imported. */ enabled: boolean; created: Date; updated: Date; /** Outcome of the last hourly import: "ok" | "error", empty before the first run. */ lastStatus: string; /** Why that import failed; empty when it succeeded. */ lastError: string; /** When it finished, successful or not. Absent before the first run. */ lastSyncedAt?: Date; /** Articles the last successful import stored. */ lastSyncedArticles: number; }; export type ListNewsFeedsRequest = { /** Pushwoosh application code (XXXXX-XXXXX). */ applicationCode?: string; }; export type ListNewsFeedsResponse = { feeds: NewsFeed[]; }; export type SetNewsFeedRequest = { /** Pushwoosh application code (XXXXX-XXXXX). */ applicationCode?: string; /** Empty registers a new feed; a code updates that feed. */ code?: string; name?: string; /** http(s) URL of an RSS or Atom feed. */ url?: string; enabled?: boolean; }; export type SetNewsFeedResponse = { feed: NewsFeed; }; export type DeleteNewsFeedRequest = { /** Pushwoosh application code (XXXXX-XXXXX). */ applicationCode?: string; code?: string; }; export type DeleteNewsFeedResponse = {};