{t("common:api.title")}
+
+
From ff4402d9aa8e9b01525ec0d809aae80f03e33389 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:07:20 +0200 Subject: [PATCH] User generatable API tokens (#2621) --- app/components/layout/Footer.tsx | 2 + app/db/tables.ts | 9 + app/features/admin/AdminRepository.server.ts | 8 + app/features/admin/actions/admin.server.ts | 12 + app/features/admin/routes/admin.tsx | 17 ++ .../api-public/api-public-utils.server.ts | 16 +- app/features/api/ApiRepository.server.test.ts | 117 +++++++++ app/features/api/ApiRepository.server.ts | 81 +++++++ app/features/api/actions/api.server.ts | 41 ++++ app/features/api/core/perms.test.ts | 170 ++++++++++++++ app/features/api/core/perms.ts | 23 ++ app/features/api/loaders/api.server.ts | 24 ++ app/features/api/routes/api.tsx | 84 +++++++ .../user-page/UserRepository.server.ts | 8 +- app/features/user-page/UserRepository.test.ts | 222 ++++++++++++++++++ app/modules/permissions/mapper.server.ts | 5 + app/modules/permissions/types.ts | 1 + app/routes.ts | 1 + app/utils/urls.ts | 3 + db-test.sqlite3 | Bin 1064960 -> 1073152 bytes docs/dev/api.md | 6 +- locales/da/common.json | 12 +- locales/de/common.json | 12 +- locales/en/common.json | 12 +- locales/es-ES/common.json | 12 +- locales/es-US/common.json | 12 +- locales/fr-CA/common.json | 12 +- locales/fr-EU/common.json | 12 +- locales/he/common.json | 12 +- locales/it/common.json | 12 +- locales/ja/common.json | 12 +- locales/ko/common.json | 12 +- locales/nl/common.json | 12 +- locales/pl/common.json | 12 +- locales/pt-BR/common.json | 12 +- locales/ru/common.json | 12 +- locales/zh/common.json | 12 +- migrations/105-api-tokens.js | 23 ++ 38 files changed, 1045 insertions(+), 20 deletions(-) create mode 100644 app/features/api/ApiRepository.server.test.ts create mode 100644 app/features/api/ApiRepository.server.ts create mode 100644 app/features/api/actions/api.server.ts create mode 100644 app/features/api/core/perms.test.ts create mode 100644 app/features/api/core/perms.ts create mode 100644 app/features/api/loaders/api.server.ts create mode 100644 app/features/api/routes/api.tsx create mode 100644 migrations/105-api-tokens.js diff --git a/app/components/layout/Footer.tsx b/app/components/layout/Footer.tsx index 972bcb0a8..8f75484e5 100644 --- a/app/components/layout/Footer.tsx +++ b/app/components/layout/Footer.tsx @@ -2,6 +2,7 @@ import { Link } from "@remix-run/react"; import { useTranslation } from "react-i18next"; import { usePatrons } from "~/hooks/swr"; import { + API_PAGE, CONTRIBUTIONS_PAGE, FAQ_PAGE, NINTENDO_COMMUNITY_TOURNAMENTS_GUIDELINES_URL, @@ -28,6 +29,7 @@ export function Footer() { {t("pages.privacy")} {t("pages.contributors")} {t("pages.faq")} + {t("pages.api")}