chore: auto-fix lint & formatting [skip ci]

This commit is contained in:
github-actions[bot] 2026-08-24 14:52:59 +00:00
parent a77ac8ad91
commit df16dc94f7
17 changed files with 142 additions and 125 deletions

View file

@ -19,8 +19,8 @@ The console itself is served at `/admin`; its tabs are deep-linkable via the URL
| `PUT /admin/api/groups` | Replace groups (super: all; owner: own only) |
| `GET /admin/api/groups/:id/routes` | List a group's routes |
| `PUT /admin/api/groups/:id/routes` | Replace a group's routes (owner/admin) |
| `GET /admin/api/groups/:id/fragments` | List a group's named filter fragments |
| `PUT /admin/api/groups/:id/fragments` | Replace a group's named filter fragments (owner/admin) |
| `GET /admin/api/groups/:id/fragments` | List a group's named filter fragments |
| `PUT /admin/api/groups/:id/fragments` | Replace a group's named filter fragments (owner/admin) |
| `PUT /admin/api/groups/:id/rename` | Rename a group (owner); routes, webhook secret and invites follow |
| `GET /admin/api/groups/:id/invites` | List pending invites (owner) |
| `POST /admin/api/groups/:id/invites` | Create an invite link (owner) |
@ -33,7 +33,7 @@ The console itself is served at `/admin`; its tabs are deep-linkable via the URL
| `GET /admin/api/audit` | Audit log (scoped to accessible groups) |
| `GET /admin/api/metrics` | Delivery stats (totals, failure rate, per platform/event/status, recent failures); optional `?groupId=` scope; recent failures scoped to accessible groups for non-super |
| `GET /admin/api/delivery/:deliveryId` | All send-log attempts for one delivery (group-scoped) |
| `POST /admin/api/test-match` | Stateless filter dry-run — evaluate a filter node against a pasted JSON payload (no event is stored) |
| `POST /admin/api/test-match` | Stateless filter dry-run — evaluate a filter node against a pasted JSON payload (no event is stored) |
## Validation

View file

@ -66,15 +66,15 @@ All management endpoints (`/admin/api/*`) are documented in the [Admin API](../a
See the [Filter Tutorial](./filters) for a hands-on guide with worked examples.
| Type | Matches | Example |
| --------- | -------------------- | ---------------------------------- |
| `event` | GitHub event name | `push`, `pull_*`, `pull_request` |
| `repo` | Repository full name | `org/repo`, `org/*` |
| `actor` | Sender login | `username`, `[bot]`, `*[bot]` |
| `action` | Event action | `opened`, `closed`, `published` |
| `branch` | Branch name | `main`, `feature-?`, `/^release-/` |
| `field` | Any payload field (JSONPath) | `path: "pull_request.user.login"` |
| `keyword` | Text in payload body | `deploy`, `/fix\s+\d+/` |
| Type | Matches | Example |
| --------- | ---------------------------- | ---------------------------------- |
| `event` | GitHub event name | `push`, `pull_*`, `pull_request` |
| `repo` | Repository full name | `org/repo`, `org/*` |
| `actor` | Sender login | `username`, `[bot]`, `*[bot]` |
| `action` | Event action | `opened`, `closed`, `published` |
| `branch` | Branch name | `main`, `feature-?`, `/^release-/` |
| `field` | Any payload field (JSONPath) | `path: "pull_request.user.login"` |
| `keyword` | Text in payload body | `deploy`, `/fix\s+\d+/` |
### Filter Behavior

View file

@ -210,18 +210,18 @@ Matches an arbitrary field of the webhook payload using a dot-separated path, e.
Field filters (and every filter type except `keyword`) accept an `op` to change how the value is compared. The default `eq` keeps the classic glob/regex/exact behaviour.
| Operator | Meaning |
| -------------- | -------------------------------------------------------------------- |
| `eq` (default) | Equal — globs, regexes and plain text, case-insensitive |
| `ne` | Not equal (inverse of `eq`) |
| `contains` | Value contains the pattern (substring) |
| `startsWith` | Value starts with the pattern |
| `endsWith` | Value ends with the pattern |
| `regex` | Explicit regular expression match |
| `gt` / `gte` | Numeric greater-than / greater-or-equal |
| `lt` / `lte` | Numeric less-than / less-or-equal |
| `in` | Value equals any of the listed patterns |
| `exists` | The field is present (non-null); `match` is ignored |
| Operator | Meaning |
| -------------- | ------------------------------------------------------- |
| `eq` (default) | Equal — globs, regexes and plain text, case-insensitive |
| `ne` | Not equal (inverse of `eq`) |
| `contains` | Value contains the pattern (substring) |
| `startsWith` | Value starts with the pattern |
| `endsWith` | Value ends with the pattern |
| `regex` | Explicit regular expression match |
| `gt` / `gte` | Numeric greater-than / greater-or-equal |
| `lt` / `lte` | Numeric less-than / less-or-equal |
| `in` | Value equals any of the listed patterns |
| `exists` | The field is present (non-null); `match` is ignored |
```json
{ "type": "field", "path": "pull_request.commits", "op": "gt", "match": "1" }
@ -242,10 +242,12 @@ A route can use a nested `ast` to combine filters with explicit grouping instead
"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" }
]}
{
"any": [
{ "type": "field", "path": "pull_request.user.login", "match": "alice" },
{ "type": "field", "path": "pull_request.user.login", "match": "bob" }
]
}
]
},
"targets": [{ "channelId": "..." }]

View file

@ -31,12 +31,12 @@ There are **no default routes** — each route must define its own target. If no
Each entry of `targets` is a push destination, so one route can forward to several channels at once (e.g. a Discord channel **and** a Telegram group). `target.platform` selects the platform: `discord` (default) or `telegram`. For **Discord**, `target.channelId` is required (a thread in `target.threadId` is optional). For **Telegram**, `target.chatId` (the group/supergroup chat id, e.g. `-1001234567890`) is required and `target.topicId` (the `message_thread_id` of a topic, equivalent of a Discord thread) is optional. There is no fallback to a default channel.
| Field | Type | Required | Description |
| ---------------- | -------- | -------- | ----------------------------------------------------------------------------------------------- |
| `groupId` | string | Yes | Id of the [group](./groups) this route belongs to |
| `fallback` | boolean | No | When `true`, fires only if no non-fallback route matched the event; its own filters are ignored |
| `stop` | boolean | No | When `true` and this route matches, no further routes are evaluated for this event |
| `discordRoleIds` | string[] | No | Discord role ids to ping when this route fires; applied to Discord targets only |
| Field | Type | Required | Description |
| ---------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `groupId` | string | Yes | Id of the [group](./groups) this route belongs to |
| `fallback` | boolean | No | When `true`, fires only if no non-fallback route matched the event; its own filters are ignored |
| `stop` | boolean | No | When `true` and this route matches, no further routes are evaluated for this event |
| `discordRoleIds` | string[] | No | Discord role ids to ping when this route fires; applied to Discord targets only |
| `ast` | object | No | Boolean filter tree (`{all:[...]}` / `{any:[...]}` / `{not:{...}}`); takes precedence over `filters` when present |
## Discord Role Mentions

View file

@ -65,15 +65,15 @@ WebHooker 在 `/admin` 提供内置配置控制台,可在浏览器中管理路
实操指南见[过滤器教程](./filters),包含完整示例。
| 类型 | 匹配对象 | 示例 |
| --------- | ---------------- | ---------------------------------- |
| `event` | GitHub 事件名称 | `push`, `pull_*`, `pull_request` |
| `repo` | 仓库全名 | `org/repo`, `org/*` |
| `actor` | 发送者登录名 | `username`, `[bot]`, `*[bot]` |
| `action` | 事件操作 | `opened`, `closed`, `published` |
| `branch` | 分支名称 | `main`, `feature-?`, `/^release-/` |
| `field` | 任意载荷字段JSONPath | `path: "pull_request.user.login"` |
| `keyword` | 载荷正文中的文本 | `deploy`, `/fix\s+\d+/` |
| 类型 | 匹配对象 | 示例 |
| --------- | ------------------------ | ---------------------------------- |
| `event` | GitHub 事件名称 | `push`, `pull_*`, `pull_request` |
| `repo` | 仓库全名 | `org/repo`, `org/*` |
| `actor` | 发送者登录名 | `username`, `[bot]`, `*[bot]` |
| `action` | 事件操作 | `opened`, `closed`, `published` |
| `branch` | 分支名称 | `main`, `feature-?`, `/^release-/` |
| `field` | 任意载荷字段JSONPath | `path: "pull_request.user.login"` |
| `keyword` | 载荷正文中的文本 | `deploy`, `/fix\s+\d+/` |
### 过滤器行为

View file

@ -210,18 +210,18 @@
字段过滤器(以及除 `keyword` 之外的所有过滤器类型)可通过 `op` 改变值的比较方式。默认的 `eq` 保持经典的 glob/正则/精确匹配行为。
| 操作符 | 含义 |
| -------------- | ------------------------------------------ |
| `eq`(默认) | 相等——通配符、正则与纯文本,不区分大小写 |
| `ne` | 不相等(`eq` 的反义) |
| `contains` | 值包含模式(子串) |
| `startsWith` | 值以模式开头 |
| `endsWith` | 值以模式结尾 |
| `regex` | 显式正则表达式匹配 |
| `gt` / `gte` | 数值大于 / 大于等于 |
| `lt` / `lte` | 数值小于 / 小于等于 |
| `in` | 值等于任一列出的模式 |
| `exists` | 字段存在(非 null忽略 `match` |
| 操作符 | 含义 |
| ------------ | ---------------------------------------- |
| `eq`(默认) | 相等——通配符、正则与纯文本,不区分大小写 |
| `ne` | 不相等(`eq` 的反义) |
| `contains` | 值包含模式(子串) |
| `startsWith` | 值以模式开头 |
| `endsWith` | 值以模式结尾 |
| `regex` | 显式正则表达式匹配 |
| `gt` / `gte` | 数值大于 / 大于等于 |
| `lt` / `lte` | 数值小于 / 小于等于 |
| `in` | 值等于任一列出的模式 |
| `exists` | 字段存在(非 null忽略 `match` |
```json
{ "type": "field", "path": "pull_request.commits", "op": "gt", "match": "1" }
@ -242,10 +242,12 @@
"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" }
]}
{
"any": [
{ "type": "field", "path": "pull_request.user.login", "match": "alice" },
{ "type": "field", "path": "pull_request.user.login", "match": "bob" }
]
}
]
},
"targets": [{ "channelId": "..." }]

View file

@ -31,12 +31,12 @@
`targets` 的每一项都是一个推送目标,因此一条路由可同时转发到多个频道(例如一个 Discord 频道**和**一个 Telegram 群组)。`target.platform` 选择平台:`discord`(默认)或 `telegram`。**Discord** 目标要求 `target.channelId`(可选 `target.threadId` 指定子区);**Telegram** 目标要求 `target.chatId`(群组/超级群组 id`-1001234567890`),可选 `target.topicId`(话题的 `message_thread_id`,相当于 Discord 子区)。没有默认频道回退。
| 字段 | 类型 | 必需 | 说明 |
| ---------------- | -------- | ---- | ------------------------------------------------------------------------ |
| `groupId` | string | 是 | 路由所属[分组](./groups)的 id |
| `fallback` | boolean | 否 | 为 `true` 时仅在没有其他非 fallback 路由匹配时才触发;其自身过滤器被忽略 |
| `stop` | boolean | 否 | 为 `true` 且该路由匹配时,不再评估后续路由 |
| `discordRoleIds` | string[] | 否 | 路由触发时要提醒的 Discord 身份组 id仅对 Discord 目标生效 |
| 字段 | 类型 | 必需 | 说明 |
| ---------------- | -------- | ---- | ------------------------------------------------------------------------------------- |
| `groupId` | string | 是 | 路由所属[分组](./groups)的 id |
| `fallback` | boolean | 否 | 为 `true` 时仅在没有其他非 fallback 路由匹配时才触发;其自身过滤器被忽略 |
| `stop` | boolean | 否 | 为 `true` 且该路由匹配时,不再评估后续路由 |
| `discordRoleIds` | string[] | 否 | 路由触发时要提醒的 Discord 身份组 id仅对 Discord 目标生效 |
| `ast` | object | 否 | 布尔过滤器树(`{all:[...]}` / `{any:[...]}` / `{not:{...}}`);存在时优先于 `filters` |
## Discord 身份组提醒