From 8f1f835ee19f329c73ac3ac7e3f92c20bc8efd65 Mon Sep 17 00:00:00 2001 From: Reid Rankin Date: Mon, 2 Sep 2024 21:45:20 -0500 Subject: [PATCH] allow filtering by entity_category --- src/util/filter.ts | 4 ++++ src/util/types.ts | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/util/filter.ts b/src/util/filter.ts index 5081cd2..7b8e49f 100644 --- a/src/util/filter.ts +++ b/src/util/filter.ts @@ -137,4 +137,8 @@ export const filterValue: Record { + const entityCategory = entity.entity_category; + return compare(comparator, entityCategory, value); + }, }; diff --git a/src/util/types.ts b/src/util/types.ts index 6a9e0d8..7bc00de 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -132,6 +132,16 @@ export enum FilterType { * ``` */ hidden_by = "hidden_by", + /** + * Filter on the category of the entity. + * @example + * ```yaml + * - type: entity_category + * comparator: equal + * value: diagnostic + * ``` + */ + entity_category = "entity_category", } export enum Comparator {