67 lines
1.4 KiB
TypeScript
67 lines
1.4 KiB
TypeScript
/** Standard v1 paginated list response wrapper */
|
|
export interface PaginatedListV1<T> {
|
|
data: T[];
|
|
totalCount: number;
|
|
pageSize: number;
|
|
page: number;
|
|
hasMore: boolean;
|
|
}
|
|
|
|
/** Standard v2 cursor-based paginated response (used by Topics) */
|
|
export interface PaginatedListV2<T> {
|
|
data: T[];
|
|
next: string | null;
|
|
previous: string | null;
|
|
totalCount: number;
|
|
totalCountCapped: boolean;
|
|
}
|
|
|
|
/** Subscriber shape from Novu API */
|
|
export interface Subscriber {
|
|
id?: string;
|
|
subscriberId?: string;
|
|
firstName?: string | null;
|
|
lastName?: string | null;
|
|
email?: string | null;
|
|
phone?: string | null;
|
|
avatar?: string | null;
|
|
locale?: string | null;
|
|
timezone?: string | null;
|
|
data?: Record<string, unknown> | null;
|
|
isOnline?: boolean | null;
|
|
lastOnlineAt?: string | null;
|
|
createdAt?: string;
|
|
updatedAt?: string;
|
|
}
|
|
|
|
/** Topic shape */
|
|
export interface Topic {
|
|
_id: string;
|
|
key: string;
|
|
name?: string;
|
|
createdAt?: string;
|
|
updatedAt?: string;
|
|
}
|
|
|
|
/** Workflow shape */
|
|
export interface Workflow {
|
|
id?: string;
|
|
name?: string;
|
|
description?: string;
|
|
active?: boolean;
|
|
draft?: boolean;
|
|
tags?: string[];
|
|
steps?: unknown[];
|
|
triggers?: unknown[];
|
|
createdAt?: string;
|
|
updatedAt?: string;
|
|
}
|
|
|
|
/** Trigger event response */
|
|
export interface TriggerResponse {
|
|
acknowledged: boolean;
|
|
status: string;
|
|
error?: string[];
|
|
transactionId?: string;
|
|
}
|