feat: refresh shared chat and server workflows
This commit is contained in:
@@ -72,6 +72,20 @@ export type WebPushSubscriptionPayload = {
|
||||
};
|
||||
};
|
||||
|
||||
export type WebPushSubscriptionItem = {
|
||||
id: number;
|
||||
endpoint: string;
|
||||
deviceId: string;
|
||||
clientId: string;
|
||||
userAgent: string;
|
||||
appOrigin: string;
|
||||
appDomain: string;
|
||||
enabled: boolean;
|
||||
lastRegisteredAt: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type ClientNotificationPayload = {
|
||||
title: string;
|
||||
body: string;
|
||||
@@ -97,6 +111,14 @@ export type ClientNotificationSendResult = {
|
||||
reason?: string;
|
||||
sentCount: number;
|
||||
failedCount: number;
|
||||
matchedCount?: number;
|
||||
matchedSubscriptions?: Array<{
|
||||
endpoint: string;
|
||||
deviceId: string;
|
||||
clientId: string;
|
||||
appOrigin: string;
|
||||
appDomain: string;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -539,6 +561,11 @@ export async function fetchWebPushConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchWebPushSubscriptions() {
|
||||
const response = await request<{ items: WebPushSubscriptionItem[] }>('/notifications/subscriptions/web');
|
||||
return Array.isArray(response.items) ? response.items : [];
|
||||
}
|
||||
|
||||
export async function fetchNotificationMessages(params?: {
|
||||
status?: NotificationMessageListStatus;
|
||||
limit?: number;
|
||||
|
||||
Reference in New Issue
Block a user