From 1b0260dc9107a5a4dc73c83652a80c303ba3a241 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 04:45:33 +0200 Subject: [PATCH] feat(api-client-extensions): Erweitere lib/api.ts um Customer + Project Endpoints + Logou [tsc:fail] --- .phase2-state.json | 5 +++-- GENERATION_LOG.md | 28 ++++++++++++++++++++++++++++ apps/web/src/lib/api.ts | 39 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/.phase2-state.json b/.phase2-state.json index 600e847..0fdb297 100644 --- a/.phase2-state.json +++ b/.phase2-state.json @@ -1,8 +1,9 @@ { "completed_features": [], - "current_feature": "projects-crud", + "current_feature": "api-client-extensions", "started_at": "2026-05-23T04:42:59.289476", "attempted_features": [ - "customers-crud" + "customers-crud", + "projects-crud" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 6ed898f..52de2fc 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -226,3 +226,31 @@ src/routes/customers.ts(14,49): error TS7006: Parameter 'reply' implicitly has a src/routes/customers.ts(22,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'. src/routes/customers.ts(22,27): error TS7006: Parameter 'request' implicitly has an 'any' type. src/routes/customers.ts(22,36): error TS7006: Parameter +- `04:45:09` **INFO** Committed feature projects-crud +- `04:45:09` **INFO** Pushed: rc=0 +- `04:45:09` **WARN** ⚠️ Feature projects-crud partial — moving on + +## Feature: api-client-extensions (2026-05-23 04:45:09) + +- `04:45:09` **INFO** Description: Erweitere lib/api.ts um Customer + Project Endpoints + Logout fixes +- `04:45:09` **INFO** Files: 1 +- `04:45:09` **INFO** Generating apps/web/src/lib/api.ts (ERWEITERTE Version der bestehenden api.ts. Behalte alle bestehenden Fu…) +- `04:45:32` **INFO** wrote 2628 chars in 22.8s (attempt 1) +- `04:45:32` **INFO** Running tsc --noEmit on api… +- `04:45:33` **WARN** tsc errors: +src/routes/auth.ts(9,11): error TS2339: Property 'post' does not exist on type 'FastifyPluginAsync'. +src/routes/auth.ts(9,33): error TS7006: Parameter 'request' implicitly has an 'any' type. +src/routes/auth.ts(9,42): error TS7006: Parameter 'reply' implicitly has an 'any' type. +src/routes/auth.ts(22,27): error TS2339: Property 'jwt' does not exist on type 'FastifyPluginAsync'. +src/routes/auth.ts(44,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'. +src/routes/auth.ts(44,29): error TS7006: Parameter 'request' implicitly has an 'any' type. +src/routes/auth.ts(44,38): error TS7006: Parameter 'reply' implicitly has an 'any' type. +src/routes/auth.ts(70,11): error TS2339: Property 'post' does not exist on type 'FastifyPluginAsync'. +src/routes/auth.ts(70,34): error TS7006: Parameter 'request' implicitly has an 'any' type. +src/routes/auth.ts(70,43): error TS7006: Parameter 'reply' implicitly has an 'any' type. +src/routes/customers.ts(14,11): error TS2339: Property 'addHook' does not exist on type 'FastifyPluginAsync'. +src/routes/customers.ts(14,40): error TS7006: Parameter 'request' implicitly has an 'any' type. +src/routes/customers.ts(14,49): error TS7006: Parameter 'reply' implicitly has an 'any' type. +src/routes/customers.ts(22,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'. +src/routes/customers.ts(22,27): error TS7006: Parameter 'request' implicitly has an 'any' type. +src/routes/customers.ts(22,36): error TS7006: Parameter diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index 5678852..3b63902 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -1,4 +1,4 @@ -import type { TimeEntryInsert } from "@emberclone/shared" +import type { TimeEntryInsert, CustomerInsert, ProjectInsert } from "@emberclone/shared" const API_BASE = "/api" @@ -65,5 +65,40 @@ export const api = { return request(`/time-entries/${id}`, { method: "DELETE" }) + }, + + async listCustomers() { + return request( "/customers") + }, + + async createCustomer(data: Partial) { + return request("/customers", { + method: "POST", + body: JSON.stringify(data) + }) + }, + + async deleteCustomer(id: string) { + return request(`/customers/${id}`, { + method: "DELETE" + }) + }, + + async listProjects(opts?: Record) { + const query = opts ? `?${new URLSearchParams(opts).toString()}` : "" + return request(`/projects${query}`) + }, + + async createProject(data: Partial) { + return request("/projects", { + method: "POST", + body: JSON.stringify(data) + }) + }, + + async deleteProject(id: string) { + return request(`/projects/${id}`, { + method: "DELETE" + }) } -} +} \ No newline at end of file