feat(router-phase19): Mount invitations + accept-invite public route [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 07:49:19 +02:00
parent 8b1755b085
commit 002007a4c8
4 changed files with 45 additions and 19 deletions

View File

@ -1,11 +1,12 @@
{ {
"completed_features": [], "completed_features": [],
"current_feature": "api-client-phase19", "current_feature": "router-phase19",
"started_at": "2026-05-23T07:42:47.919364", "started_at": "2026-05-23T07:42:47.919364",
"attempted_features": [ "attempted_features": [
"invitation-flow", "invitation-flow",
"rate-limiting-stub", "rate-limiting-stub",
"search-history", "search-history",
"presence-stub" "presence-stub",
"api-client-phase19"
] ]
} }

View File

@ -2343,3 +2343,22 @@ src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
- `07:48:04` **INFO** Committed feature api-client-phase19
- `07:48:04` **INFO** Pushed: rc=0
## Phase-3 Feature: router-phase19 (2026-05-23 07:48:04)
- `07:48:04` **INFO** Description: Mount invitations + accept-invite public route
- `07:48:04` **INFO** Generating apps/api/src/routes/index.ts (ERWEITERT — füge invitationRoutes ('/api/invitations'). Behalte alles.…)
- `07:48:22` **INFO** wrote 2176 chars in 17.2s (attempt 1)
- `07:48:22` **INFO** Generating apps/web/src/App.tsx (ERWEITERT — füge /accept-invite Route (public). Behalte alles.…)
- `07:49:17` **INFO** wrote 6774 chars in 55.5s (attempt 1)
- `07:49:17` **INFO** Running tsc --noEmit on api…
- `07:49:19` **WARN** tsc errors:
src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'.
Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy

View File

@ -17,6 +17,7 @@ import invoiceRoutes from "./invoices"
import savedViewRoutes from "./saved-views" import savedViewRoutes from "./saved-views"
import notificationRoutes from "./notifications" import notificationRoutes from "./notifications"
import apiKeyRoutes from "./api-keys" import apiKeyRoutes from "./api-keys"
import invitationRoutes from "./invitations"
export async function setupRoutes(server: FastifyInstance) { export async function setupRoutes(server: FastifyInstance) {
server.register(authRoutes, { prefix: "/api/auth" }) server.register(authRoutes, { prefix: "/api/auth" })
@ -37,4 +38,5 @@ export async function setupRoutes(server: FastifyInstance) {
server.register(savedViewRoutes, { prefix: "/api/saved-views" }) server.register(savedViewRoutes, { prefix: "/api/saved-views" })
server.register(notificationRoutes, { prefix: "/api/notifications" }) server.register(notificationRoutes, { prefix: "/api/notifications" })
server.register(apiKeyRoutes, { prefix: "/api/api-keys" }) server.register(apiKeyRoutes, { prefix: "/api/api-keys" })
server.register(invitationRoutes, { prefix: "/api/invitations" })
} }

View File

@ -21,6 +21,7 @@ import Integrations from "./pages/Integrations"
import ProjectTemplates from "./pages/ProjectTemplates" import ProjectTemplates from "./pages/ProjectTemplates"
import Invoices from "./pages/Invoices" import Invoices from "./pages/Invoices"
import ApiKeys from "./pages/ApiKeys" import ApiKeys from "./pages/ApiKeys"
import AcceptInvite from "./pages/AcceptInvite"
import Nav from "./components/Nav" import Nav from "./components/Nav"
import CommandPalette from "./components/CommandPalette" import CommandPalette from "./components/CommandPalette"
import KeyboardHelp from "./components/KeyboardHelp" import KeyboardHelp from "./components/KeyboardHelp"
@ -71,6 +72,12 @@ const resetPasswordRoute = createRoute({
component: ResetPassword component: ResetPassword
}) })
const acceptInviteRoute = createRoute({
getParentRoute: () => rootRoute,
path: "/accept-invite",
component: AcceptInvite
})
const authCheck = async () => { const authCheck = async () => {
try { try {
await api.getMe() await api.getMe()
@ -169,7 +176,7 @@ const settingsRoute = createRoute({
const auditLogRoute = createRoute({ const auditLogRoute = createRoute({
getParentRoute: () => rootRoute, getParentRoute: () => rootRoute,
path: "/audit-log", path: "/admin/audit-log",
beforeLoad: adminCheck, beforeLoad: adminCheck,
component: AuditLog component: AuditLog
}) })
@ -183,8 +190,8 @@ const documentsRoute = createRoute({
const webhooksRoute = createRoute({ const webhooksRoute = createRoute({
getParentRoute: () => rootRoute, getParentRoute: () => rootRoute,
path: "/webhooks", path: "/admin/webhooks",
beforeLoad: authCheck, beforeLoad: adminCheck,
component: Webhooks component: Webhooks
}) })
@ -211,30 +218,31 @@ const integrationsRoute = createRoute({
const projectTemplatesRoute = createRoute({ const projectTemplatesRoute = createRoute({
getParentRoute: () => rootRoute, getParentRoute: () => rootRoute,
path: "/projects/templates", path: "/admin/project-templates",
beforeLoad: authCheck, beforeLoad: adminCheck,
component: ProjectTemplates component: ProjectTemplates
}) })
const invoicesRoute = createRoute({ const invoicesRoute = createRoute({
getParentRoute: () => rootRoute, getParentRoute: () => rootRoute,
path: "/invoices", path: "/billing/invoices",
beforeLoad: authCheck, beforeLoad: authCheck,
component: Invoices component: Invoices
}) })
const apiKeysRoute = createRoute({ const apiKeysRoute = createRoute({
getParentRoute: () => rootRoute, getParentRoute: () => rootRoute,
path: "/api-keys", path: "/settings/api-keys",
beforeLoad: authCheck, beforeLoad: authCheck,
component: ApiKeys component: ApiKeys
}) })
const routeTree = [ const routeTree = rootRoute.addChildren([
indexRoute, indexRoute,
loginRoute, loginRoute,
forgotPasswordRoute, forgotPasswordRoute,
resetPasswordRoute, resetPasswordRoute,
acceptInviteRoute,
timeEntriesRoute, timeEntriesRoute,
calendarRoute, calendarRoute,
customersRoute, customersRoute,
@ -253,12 +261,9 @@ const routeTree = [
projectTemplatesRoute, projectTemplatesRoute,
invoicesRoute, invoicesRoute,
apiKeysRoute apiKeysRoute
] ])
const router = createRouter({ const router = createRouter({ routeTree })
routeTree,
defaultPreload: 'intent'
})
declare module "@tanstack/react-router" { declare module "@tanstack/react-router" {
interface Register { interface Register {
@ -268,9 +273,8 @@ declare module "@tanstack/react-router" {
export default function App() { export default function App() {
return ( return (
<RouterProvider <ErrorBoundary>
router={router} <RouterProvider router={router} />
fallback={<div>Loading...</div>} </ErrorBoundary>
/>
) )
} }