From bf445964b54040e58bb0c5a6485d2544eafc3aae Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 15 Feb 2023 20:42:24 +0100 Subject: [PATCH] improve documentation for fetch-rss endpoint Changelog: Fixed --- .../src/server/api/endpoints/fetch-rss.ts | 74 ++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index 7c32e2e4d..fc216e90e 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -10,7 +10,79 @@ export const meta = { requireCredential: true, allowGet: true, - cacheSec: 60 * 3, + cacheSec: 60 * 3, // 3min + + res: { + type: 'object', + properties: { + feedUrl: { + type: 'string', + optional: true, + }, + title: { + type: 'string', + optional: true, + }, + description: { + type: 'string', + optional: true, + }, + generator: { + type: 'string', + description: 'The application used to generate the feed (self-proclaimed).', + optional: true, + }, + link: { + type: 'string', + optional: true, + }, + lastBuildDate: { + type: 'string', + description: 'The last update timestamp, in ISO 8601 format.', + optional: true, + }, + items: { + type: 'array', + items: { + type: 'object', + properties: { + title: { + type: 'string', + optional: true, + }, + link: { + type: 'string', + optional: true, + }, + creator: { + type: 'string', + description: 'The author of this feed item.', + optional: true, + }, + content: { + type: 'string', + description: 'Content of the feed item, which possibly contains HTML.', + optional: true, + }, + contentSnippet: { + type: 'string', + description: 'The same as `content` but with HTML markup and unescaped HTML entities removed. (best effort, not guaranteed to work)', + optional: true, + }, + guid: { + type: 'string', + optional: true, + }, + isoDate: { + type: 'string', + description: 'The publication date, in ISO 8601 format.', + optional: true, + }, + }, + }, + }, + }, + }, } as const; export const paramDef = {