feat(filters): fragment presets and code-block send log detail

This commit is contained in:
RhenCloud 2026-08-18 13:45:23 +08:00
parent c090281cb2
commit 2807c97c5f
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
5 changed files with 105 additions and 8 deletions

View file

@ -208,6 +208,65 @@ export const ROUTE_TEMPLATES: RouteTemplate[] = [
},
];
export interface FragmentPreset {
id: string;
nameKey: string;
node: FilterNode;
}
export const FRAGMENT_PRESETS: FragmentPreset[] = [
{
id: "preset-pr-bot",
nameKey: "fragmentPreset.prBot",
node: {
all: [
{ type: "event", match: "pull_request" },
{ type: "field", path: "pull_request.user.type", match: "Bot" },
],
},
},
{
id: "preset-dependabot",
nameKey: "fragmentPreset.dependabot",
node: {
all: [
{ type: "event", match: "pull_request" },
{ type: "field", path: "pull_request.user.login", match: "dependabot[bot]" },
],
},
},
{
id: "preset-release-published",
nameKey: "fragmentPreset.releasePublished",
node: {
all: [
{ type: "event", match: "release" },
{ type: "action", match: "published" },
],
},
},
{
id: "preset-push-main",
nameKey: "fragmentPreset.pushMain",
node: {
all: [
{ type: "event", match: "push" },
{ type: "branch", match: "main" },
],
},
},
{
id: "preset-issue-bug",
nameKey: "fragmentPreset.issueBug",
node: {
all: [
{ type: "event", match: "issues" },
{ type: "field", path: "issue.labels.name", match: "bug" },
],
},
},
];
export const FILTER_TYPES = ["event", "repo", "actor", "action", "branch", "keyword", "field"] as const;
export const FILTER_OPS: FilterOp[] = [