2024-01-22 18:31:04 +01:00
|
|
|
export interface IActionSet {
|
|
|
|
id: number;
|
2024-01-26 09:20:30 +01:00
|
|
|
enabled: boolean;
|
2024-01-22 18:31:04 +01:00
|
|
|
name: string;
|
|
|
|
project: string;
|
|
|
|
actorId: number;
|
|
|
|
match: IMatch;
|
|
|
|
actions: IAction[];
|
|
|
|
createdAt: string;
|
|
|
|
createdByUserId: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
type MatchSource = 'incoming-webhook';
|
|
|
|
|
|
|
|
export interface IMatch {
|
|
|
|
source: MatchSource;
|
|
|
|
sourceId: number;
|
|
|
|
payload: Record<string, unknown>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAction {
|
2024-02-12 18:10:33 +01:00
|
|
|
id: number;
|
2024-01-22 18:31:04 +01:00
|
|
|
action: string;
|
|
|
|
sortOrder: number;
|
|
|
|
executionParams: Record<string, unknown>;
|
2024-02-12 18:10:33 +01:00
|
|
|
createdAt: string;
|
|
|
|
createdByUserId: number;
|
2024-01-22 18:31:04 +01:00
|
|
|
}
|
2024-02-27 14:52:09 +01:00
|
|
|
|
|
|
|
export type ObservableEventSource = 'incoming-webhook';
|
|
|
|
|
|
|
|
export interface IObservableEvent {
|
|
|
|
id: number;
|
|
|
|
source: ObservableEventSource;
|
|
|
|
sourceId: number;
|
|
|
|
createdAt: string;
|
|
|
|
createdByIncomingWebhookTokenId: number;
|
|
|
|
payload: Record<string, unknown>;
|
|
|
|
}
|
|
|
|
|
|
|
|
type ActionSetState = 'started' | 'success' | 'failed';
|
|
|
|
|
|
|
|
type ActionState = ActionSetState | 'not started';
|
|
|
|
|
|
|
|
export interface IActionEvent extends IAction {
|
|
|
|
state: ActionState;
|
|
|
|
details?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IActionSetEventActionSet extends IActionSet {
|
|
|
|
actions: IActionEvent[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IActionSetEvent {
|
|
|
|
id: number;
|
|
|
|
actionSetId: number;
|
|
|
|
observableEventId: number;
|
|
|
|
createdAt: string;
|
|
|
|
state: ActionSetState;
|
|
|
|
observableEvent: IObservableEvent;
|
|
|
|
actionSet: IActionSetEventActionSet;
|
|
|
|
}
|