From bf445964b54040e58bb0c5a6485d2544eafc3aae Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 15 Feb 2023 20:42:24 +0100 Subject: [PATCH 01/13] 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 = { From acaca35ff720e5b5b58a565f682bde6c96c6de5b Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 15 Feb 2023 20:42:40 +0100 Subject: [PATCH 02/13] client: fix authentication error in RSS widgets closes https://akkoma.dev/FoundKeyGang/FoundKey/issues/341 Changelog: Fixed --- packages/client/src/widgets/rss-ticker.vue | 11 +++++------ packages/client/src/widgets/rss.vue | 8 +++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/client/src/widgets/rss-ticker.vue b/packages/client/src/widgets/rss-ticker.vue index 55d9009bc..1c08078c5 100644 --- a/packages/client/src/widgets/rss-ticker.vue +++ b/packages/client/src/widgets/rss-ticker.vue @@ -25,6 +25,7 @@ import MarqueeText from '@/components/marquee.vue'; import { GetFormResultType } from '@/scripts/form'; import MkContainer from '@/components/ui/container.vue'; import { useInterval } from '@/scripts/use-interval'; +import * as os from '@/os'; const name = 'rssTicker'; @@ -77,12 +78,10 @@ const fetching = ref(true); let key = $ref(0); const tick = (): void => { - fetch(`/api/fetch-rss?url=${widgetProps.url}`, {}).then(res => { - res.json().then(feed => { - items.value = feed.items; - fetching.value = false; - key++; - }); + os.apiGet('fetch-rss', { url: widgetProps.url }).then(feed => { + items.value = feed.items; + fetching.value = false; + key++; }); }; diff --git a/packages/client/src/widgets/rss.vue b/packages/client/src/widgets/rss.vue index 72f624982..df1d88c65 100644 --- a/packages/client/src/widgets/rss.vue +++ b/packages/client/src/widgets/rss.vue @@ -51,11 +51,9 @@ const items = ref([]); const fetching = ref(true); const tick = () => { - fetch(`/api/fetch-rss?url=${widgetProps.url}`, {}).then(res => { - res.json().then(feed => { - items.value = feed.items; - fetching.value = false; - }); + os.apiGet('fetch-rss', { url: widgetProps.url }).then(feed => { + items.value = feed.items; + fetching.value = false; }); }; From 6aeb033507ec455628c4515d25d27f4d4f406c31 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 16 Feb 2023 21:49:02 +0100 Subject: [PATCH 03/13] client: change Misskey to Foundkey --- packages/client/src/init.ts | 2 +- packages/client/src/pages/admin/overview.vue | 2 +- packages/client/src/pages/welcome.setup.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 692617abd..eae153878 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -40,7 +40,7 @@ import { getUrlWithoutLoginId } from '@/scripts/login-id'; import { getAccountFromId } from '@/scripts/get-account-from-id'; (async () => { - console.info(`Misskey v${version}`); + console.info(`Foundkey v${version}`); if (_DEV_) { console.warn('Development mode!!!'); diff --git a/packages/client/src/pages/admin/overview.vue b/packages/client/src/pages/admin/overview.vue index a47a7a740..99b9e6e9f 100644 --- a/packages/client/src/pages/admin/overview.vue +++ b/packages/client/src/pages/admin/overview.vue @@ -39,7 +39,7 @@
-
Misskey
+
Foundkey
{{ version }}
diff --git a/packages/client/src/pages/welcome.setup.vue b/packages/client/src/pages/welcome.setup.vue index 26f87c52e..80bbf5950 100644 --- a/packages/client/src/pages/welcome.setup.vue +++ b/packages/client/src/pages/welcome.setup.vue @@ -1,6 +1,6 @@