mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 12:05:53 +00:00
show in/out schema
This commit is contained in:
@@ -17,6 +17,30 @@ export class LabrinthTechReviewInternalModule extends AbstractModule {
|
||||
)
|
||||
}
|
||||
|
||||
public async getRuleSchema(): Promise<Labrinth.TechReview.Internal.DelphiRuleSchemaResponse> {
|
||||
return this.client.request<Labrinth.TechReview.Internal.DelphiRuleSchemaResponse>(
|
||||
'/moderation/tech-review/rules/schema',
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'GET',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
public async getRuleAffectedDetails(
|
||||
id: number,
|
||||
): Promise<Labrinth.TechReview.Internal.DelphiRuleAffectedDetail[]> {
|
||||
return this.client.request<Labrinth.TechReview.Internal.DelphiRuleAffectedDetail[]>(
|
||||
`/moderation/tech-review/rules/${id}/effects`,
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'GET',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
public async testRule(
|
||||
request: Labrinth.TechReview.Internal.TestDelphiRuleRequest,
|
||||
): Promise<Labrinth.TechReview.Internal.TestDelphiRuleResponse> {
|
||||
|
||||
@@ -2235,6 +2235,26 @@ export namespace Labrinth {
|
||||
updated_at: string
|
||||
created_by: number | null
|
||||
updated_by: number | null
|
||||
affected_details_count: number
|
||||
affected_details: DelphiRuleAffectedDetail[]
|
||||
}
|
||||
|
||||
export type DelphiRuleAffectedDetail = {
|
||||
detail_id: string
|
||||
issue_id: string
|
||||
project_id: string | null
|
||||
project_name: string | null
|
||||
project_icon_url: string | null
|
||||
version_id: string | null
|
||||
version_name: string | null
|
||||
version_number: string | null
|
||||
issue_type: string
|
||||
key: string
|
||||
jar: string | null
|
||||
file_path: string
|
||||
original_severity: DelphiSeverity
|
||||
severity: DelphiSeverity | null
|
||||
hidden: boolean
|
||||
}
|
||||
|
||||
export type WriteDelphiRule = {
|
||||
@@ -2261,6 +2281,14 @@ export namespace Labrinth {
|
||||
hidden: boolean
|
||||
}
|
||||
|
||||
export type DelphiRuleSchema = Record<string, unknown>
|
||||
|
||||
export type DelphiRuleSchemaResponse = {
|
||||
input: DelphiRuleSchema
|
||||
output: DelphiRuleSchema
|
||||
components: Record<string, DelphiRuleSchema>
|
||||
}
|
||||
|
||||
export type TestDelphiRuleResponse = {
|
||||
effects: Array<DelphiRuleEffect | null>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user