diff --git a/.phase19-state.json b/.phase19-state.json index 569a50f..76bb696 100644 --- a/.phase19-state.json +++ b/.phase19-state.json @@ -1,10 +1,11 @@ { "completed_features": [], - "current_feature": "presence-stub", + "current_feature": "api-client-phase19", "started_at": "2026-05-23T07:42:47.919364", "attempted_features": [ "invitation-flow", "rate-limiting-stub", - "search-history" + "search-history", + "presence-stub" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 3011665..caaf5c9 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -2326,3 +2326,20 @@ 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. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `07:47:20` **INFO** Committed feature presence-stub +- `07:47:20` **INFO** Pushed: rc=0 + +## Phase-3 Feature: api-client-phase19 (2026-05-23 07:47:20) + +- `07:47:20` **INFO** Description: API erweitern um invitations, accept, presence +- `07:47:20` **INFO** Generating apps/web/src/lib/api.ts (ERWEITERT — behalte ALLES. Füge: createInvitation({email, role}), list…) +- `07:48:02` **INFO** wrote 4835 chars in 42.2s (attempt 1) +- `07:48:02` **INFO** Running tsc --noEmit on api… +- `07:48:04` **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' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, 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' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index d080a9d..757826d 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -166,42 +166,31 @@ export const api = { }) }, - async listApiKeys() { - return request("/api-keys") - }, - - async createApiKey(name: string) { - return request("/api-keys", { + async createInvitation(data: { email: string; role: "admin" | "user" }) { + return request("/invitations", { method: "POST", - body: JSON.stringify({ name }) + body: JSON.stringify(data) }) }, - async revokeApiKey(id: string) { - return request(`/api-keys/${id}`, { + async listInvitations() { + return request("/invitations") + }, + + async deleteInvitation(id: string) { + return request(`/invitations/${id}`, { method: "DELETE" }) }, - async listAuditLog(filters?: Record) { - const query = filters ? `?${new URLSearchParams(filters).toString()}` : "" - return request(`/audit-log${query}`) - }, - - async listEntryComments(entryId: string) { - return request(`/time-entries/${entryId}/comments`) - }, - - async createEntryComment(entryId: string, body: string) { - return request(`/time-entries/${entryId}/comments`, { + async acceptInvite(token: string, name: string, password: string) { + return request("/invitations/accept", { method: "POST", - body: JSON.stringify({ body }) + body: JSON.stringify({ token, name, password }) }) }, - async deleteEntryComment(id: string) { - return request(`/comments/${id}`, { - method: "DELETE" - }) + async getPresence() { + return request("/presence") } } \ No newline at end of file