KI-AGENT: Mobile Push Registrierung anbinden

This commit is contained in:
2026-05-22 17:34:52 +02:00
parent 5400fd7ad5
commit cacfce4d15
14 changed files with 630 additions and 20 deletions

View File

@@ -150,6 +150,21 @@ export type PrintLabelResponse = {
base64?: string;
};
export type MobilePushRegistrationInput = {
localDeviceId: string;
platform: 'ios' | 'android';
providerToken: string;
deviceLabel?: string | null;
meta?: Record<string, unknown>;
};
export type MobilePushRegistrationResponse = {
success: boolean;
id?: string;
centralDeviceId?: string;
status?: string;
};
export type WikiTreeItem = {
id: string;
parentId?: string | null;
@@ -582,6 +597,24 @@ export async function fetchMe(token: string): Promise<MeResponse> {
});
}
export async function registerMobilePushDevice(
token: string,
payload: MobilePushRegistrationInput
): Promise<MobilePushRegistrationResponse> {
return apiRequest<MobilePushRegistrationResponse>('/api/notifications/push/mobile/register', {
method: 'POST',
token,
body: payload,
});
}
export async function sendMobileTestPush(token: string): Promise<{ accepted: number; rejected: number; deliveryJobId: string }> {
return apiRequest<{ accepted: number; rejected: number; deliveryJobId: string }>('/api/notifications/test-mobile-push', {
method: 'POST',
token,
});
}
export async function switchTenantRequest(tenantId: number, token: string): Promise<string> {
const payload = await apiRequest<{ token?: string }>('/api/tenant/switch', {
method: 'POST',