add demo delphi rules ui

This commit is contained in:
aecsocket
2026-07-22 17:43:03 +01:00
parent 023c789a31
commit b6b19e543c
32 changed files with 685 additions and 708 deletions
@@ -17,6 +17,20 @@ export class LabrinthTechReviewInternalModule extends AbstractModule {
)
}
public async testRule(
request: Labrinth.TechReview.Internal.TestDelphiRuleRequest,
): Promise<Labrinth.TechReview.Internal.TestDelphiRuleResponse> {
return this.client.request<Labrinth.TechReview.Internal.TestDelphiRuleResponse>(
'/moderation/tech-review/rules/test',
{
api: 'labrinth',
version: 'internal',
method: 'POST',
body: request,
},
)
}
public async createRule(
rule: Labrinth.TechReview.Internal.WriteDelphiRule,
): Promise<Labrinth.TechReview.Internal.DelphiRule> {
@@ -2229,21 +2229,40 @@ export namespace Labrinth {
export type DelphiRule = {
id: number
name: string
priority: number
expression: string
revision_id: number
created: string
updated: string
revision_created: string
rule: string
revision: number
created_at: string
updated_at: string
created_by: number | null
updated_by: number | null
revision_created_by: number | null
}
export type WriteDelphiRule = {
name: string
priority: number
expression: string
rule: string
}
export type TestDelphiRuleTrace = {
key: string
issue_type: string
severity: DelphiSeverity
jar: string | null
file_path: string
data: Record<string, unknown>
}
export type TestDelphiRuleRequest = {
rule: string
traces: TestDelphiRuleTrace[]
}
export type DelphiRuleEffect = {
severity: DelphiSeverity | null
hidden: boolean
}
export type TestDelphiRuleResponse = {
effects: Array<DelphiRuleEffect | null>
}
export type SearchProjectsRequest = {