feat(documents): suggest inbox folder and type with AI
All checks were successful
Build and Release FEDEO / verify (push) Successful in 56s
Build and Release FEDEO / build-and-release (push) Successful in 5m54s

This commit is contained in:
2026-10-01 18:11:41 +02:00
parent 07adca417e
commit 23d49f7186
10 changed files with 597 additions and 109 deletions

View File

@@ -60,7 +60,7 @@ function signature(method: string, path: string, timestamp: string, body: string
return createHmac("sha256", secrets.PUSH_SERVER_SECRET).update(canonical).digest("hex")
}
async function requestPushServer<T>(method: "GET" | "POST" | "DELETE", path: string, payload?: unknown): Promise<T> {
async function requestPushServer<T>(method: "GET" | "POST" | "DELETE", path: string, payload?: unknown, signal?: AbortSignal): Promise<T> {
if (!configured()) {
throw new Error("Zentraler Push-Server ist nicht konfiguriert")
}
@@ -70,6 +70,7 @@ async function requestPushServer<T>(method: "GET" | "POST" | "DELETE", path: str
const signedPath = path.split("?")[0]
const response = await fetch(`${normalizeBaseUrl()}${path}`, {
method,
signal,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
@@ -125,8 +126,8 @@ export const centralServicesClient = {
}>("POST", "/v1/instances/heartbeat", input)
},
aiChatCompletions(payload: Record<string, unknown>) {
return requestPushServer<any>("POST", "/v1/services/ai/chat-completions", payload)
aiChatCompletions(payload: Record<string, unknown>, signal?: AbortSignal) {
return requestPushServer<any>("POST", "/v1/services/ai/chat-completions", payload, signal)
},
bankingInstitutions(country = "DE") {