mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
feat(filters): JSONPath field filters, operators, AST groups, fragments, and test-match
Add a field filter type reading any payload value by JSONPath with array expansion, 12 comparison operators (eq/ne/contains/startsWith/endsWith/regex/gt/gte/lt/lte/in/exists), a visual AST builder (all/any/not) in the route editor, chip-based multi-value input, a stateless POST /admin/api/test-match dry-run, and named filter fragments stored in D1 (d1_fragments, migration 0010) inlined into route ASTs on insert.
This commit is contained in:
parent
c955db03c3
commit
c090281cb2
30 changed files with 1793 additions and 422 deletions
|
|
@ -151,10 +151,43 @@ export interface Group {
|
|||
logTarget?: RouteTarget;
|
||||
}
|
||||
|
||||
export type FilterType =
|
||||
| "event"
|
||||
| "repo"
|
||||
| "actor"
|
||||
| "action"
|
||||
| "branch"
|
||||
| "keyword"
|
||||
| "field";
|
||||
|
||||
export type FilterOp =
|
||||
| "eq"
|
||||
| "ne"
|
||||
| "contains"
|
||||
| "startsWith"
|
||||
| "endsWith"
|
||||
| "regex"
|
||||
| "gt"
|
||||
| "gte"
|
||||
| "lt"
|
||||
| "lte"
|
||||
| "in"
|
||||
| "exists";
|
||||
|
||||
export interface Filter {
|
||||
type: "event" | "repo" | "actor" | "action" | "branch" | "keyword";
|
||||
match: string | string[];
|
||||
type: FilterType;
|
||||
match?: string | string[];
|
||||
exclude?: boolean;
|
||||
/**
|
||||
* JSONPath (dot notation, arrays expanded so any element matches) into
|
||||
* `payload` used by `type: "field"` filters. E.g. `pull_request.user.login`.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* Comparison operator. Defaults to `eq`, which keeps the legacy glob/regex/
|
||||
* case-insensitive-exact semantics. `exists` ignores `match`.
|
||||
*/
|
||||
op?: FilterOp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue