This commit is contained in:
ponzischeme89
2026-08-19 06:57:59 +12:00
parent 8c847c59b8
commit 2b43b9ef12
94 changed files with 6359 additions and 778 deletions
+79
View File
@@ -601,3 +601,82 @@ export interface IngestResponse {
counts: { pending: number; done: number; failed: number };
recent: IngestJob[];
}
/* The outbound notification history — /admin/api/notification-log.
*
* Distinct from the administrative activity feed above: that is the operator's own bell,
* this is the record of what Memby sent to viewers and to external services, whichever
* feature produced it. One request carries the page, its totals, its daily shape and the
* filter options, because they all describe the same filtered window and two requests
* could disagree with each other while a filter was being typed. */
export type NotificationChannel = 'in-app' | 'broadcast' | 'webhook';
export type NotificationStatus = 'sent' | 'delivered' | 'failed' | 'pending' | 'skipped';
export interface NotificationLogEntry {
id: number;
occurredAt: string;
channel: NotificationChannel | string;
kind: string;
source: string;
userId?: string;
username?: string;
title: string;
body?: string;
itemId?: string;
/** A destination's name — an integration, never its address. */
target?: string;
sourceKey?: string;
status: NotificationStatus | string;
/** The failure, or the reason a notification was deliberately not delivered. */
detail?: string;
durationMs: number;
eventAt?: string;
metadata?: Record<string, unknown>;
}
export interface NotificationTotals {
total: number;
sent: number;
delivered: number;
failed: number;
pending: number;
skipped: number;
users: number;
}
export interface NotificationDay {
day: string;
sent: number;
failed: number;
skipped: number;
delivered: number;
}
export interface NotificationFacet {
value: string;
count: number;
}
/* Built from what has actually been sent rather than from a list of constants, so the
filters can neither offer a type that matches nothing nor miss one a feature added
after this page was written. */
export interface NotificationFacets {
kinds: NotificationFacet[];
channels: NotificationFacet[];
statuses: NotificationFacet[];
sources: NotificationFacet[];
}
export interface NotificationLogResponse {
entries: NotificationLogEntry[];
total: number;
limit: number;
offset: number;
totals: NotificationTotals;
days: NotificationDay[];
facets: NotificationFacets;
users: KnownUser[];
retentionDays: number;
}