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:
RhenCloud 2026-08-18 12:19:08 +08:00
parent c955db03c3
commit c090281cb2
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
30 changed files with 1793 additions and 422 deletions

View file

@ -116,3 +116,42 @@ routes:
# targets:
# - platform: discord
# channelId: "CHANNEL_ID_HERE"
# Field filters match any payload field via a JSONPath (dot-separated) `path`,
# with an optional `op` operator (eq/ne/contains/startsWith/endsWith/regex/
# gt/gte/lt/lte/in/exists). Arrays are expanded: any matching element wins.
# - id: big-pr
# name: "Large Pull Requests"
# enabled: true
# groupId: default
# filters:
# - type: event
# match: pull_request
# - type: field
# path: "pull_request.commits"
# op: gte
# match: "10"
# targets:
# - platform: discord
# channelId: "CHANNEL_ID_HERE"
# Nested `ast` groups (all / any / not) replace the flat filters list and take
# precedence over `filters` when both are present.
# - id: grouped-owners
# name: "PRs from either owner"
# enabled: true
# groupId: default
# ast:
# all:
# - type: event
# match: pull_request
# - any:
# - type: field
# path: "pull_request.user.login"
# match: alice
# - type: field
# path: "pull_request.user.login"
# match: bob
# targets:
# - platform: discord
# channelId: "CHANNEL_ID_HERE"