feat(filters): add support for multiple external filters (#1030)

* feat(filters): add support for multiple ext filters

* refactor(filters): crud and check

* feat(filters): add postgres migrations

* fix(filters): field array types

* fix(filters): formatting

* fix(filters): formatting

* feat(filters): external webhook improve logs
This commit is contained in:
ze0s 2023-08-15 23:07:39 +02:00 committed by GitHub
parent db209319da
commit dde0d0ed61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1514 additions and 478 deletions

View file

@ -70,6 +70,7 @@ interface Filter {
actions_count: number;
actions: Action[];
indexers: Indexer[];
external: ExternalFilter[];
external_script_enabled: boolean;
external_script_cmd: string;
external_script_args: string;
@ -116,3 +117,23 @@ interface Action {
type ActionContentLayout = "ORIGINAL" | "SUBFOLDER_CREATE" | "SUBFOLDER_NONE";
type ActionType = "TEST" | "EXEC" | "WATCH_FOLDER" | "WEBHOOK" | DownloadClientType;
type ExternalType = "EXEC" | "WEBHOOK";
type WebhookMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
interface ExternalFilter {
id: number;
index: number;
name: string;
type: ExternalType;
enabled: boolean;
exec_cmd?: string;
exec_args?: string;
webhook_host?: string,
webhook_type?: string;
webhook_method?: WebhookMethod;
webhook_data?: string,
webhook_headers?: string;
filter_id?: number;
}