1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-21 13:47:39 +02:00
unleash.unleash/frontend/src/interfaces/signal.ts
Nuno Góis a8eda9d61f
chore: event timeline signals (#8310)
https://linear.app/unleash/issue/2-2665/show-signals-in-the-event-timeline

Implements signals in the event timeline.

This merges events and signals into a unified `TimelineEvent`
abstraction, streamlining the data structure to only include properties
relevant to the timeline.

Key changes:
- Refactors the timeline logic to handle both events and signals through
the new abstraction.
- Introduces the `useSignalQuery` hook, modeled after `useEventSearch`,
as both serve similar purposes, albeit for different resource types.

Note: The signals suggestion alert is not included and will be addressed
in a future task.


![image](https://github.com/user-attachments/assets/9dad5c21-cd36-45e6-9369-ceca25936123)
2024-10-01 09:02:08 +01:00

39 lines
850 B
TypeScript

export interface ISignalEndpoint {
id: number;
enabled: boolean;
name: string;
createdAt: string;
createdByUserId: number;
description: string;
tokens: ISignalEndpointToken[];
}
export interface ISignalEndpointToken {
id: number;
name: string;
signalEndpointId: number;
createdAt: string;
createdByUserId: number;
}
export type SignalSource = 'signal-endpoint';
export interface ISignal {
id: number;
source: SignalSource;
sourceId: number;
createdAt: string;
createdBySourceTokenId: number;
payload: Record<string, unknown>;
}
export interface ISignalEndpointSignal
extends Omit<ISignal, 'createdBySourceTokenId'> {
tokenName: string;
}
export interface ISignalQuerySignal extends ISignalEndpointSignal {
sourceName?: string;
sourceDescription?: string;
}