mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
add demo delphi rules ui
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user