mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
wip: delphi trace transform rules
This commit is contained in:
@@ -6,6 +6,54 @@ export class LabrinthTechReviewInternalModule extends AbstractModule {
|
||||
return 'labrinth_tech_review_internal'
|
||||
}
|
||||
|
||||
public async getRules(): Promise<Labrinth.TechReview.Internal.DelphiRule[]> {
|
||||
return this.client.request<Labrinth.TechReview.Internal.DelphiRule[]>(
|
||||
'/moderation/tech-review/rules',
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'GET',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
public async createRule(
|
||||
rule: Labrinth.TechReview.Internal.WriteDelphiRule,
|
||||
): Promise<Labrinth.TechReview.Internal.DelphiRule> {
|
||||
return this.client.request<Labrinth.TechReview.Internal.DelphiRule>(
|
||||
'/moderation/tech-review/rules',
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'POST',
|
||||
body: rule,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
public async updateRule(
|
||||
id: number,
|
||||
rule: Labrinth.TechReview.Internal.WriteDelphiRule,
|
||||
): Promise<Labrinth.TechReview.Internal.DelphiRule> {
|
||||
return this.client.request<Labrinth.TechReview.Internal.DelphiRule>(
|
||||
`/moderation/tech-review/rules/${id}`,
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'PUT',
|
||||
body: rule,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
public async deleteRule(id: number): Promise<void> {
|
||||
return this.client.request<void>(`/moderation/tech-review/rules/${id}`, {
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for projects awaiting technical review.
|
||||
*
|
||||
|
||||
@@ -2226,6 +2226,26 @@ export namespace Labrinth {
|
||||
|
||||
export namespace TechReview {
|
||||
export namespace Internal {
|
||||
export type DelphiRule = {
|
||||
id: number
|
||||
name: string
|
||||
priority: number
|
||||
expression: string
|
||||
revision_id: number
|
||||
created: string
|
||||
updated: string
|
||||
revision_created: string
|
||||
created_by: number | null
|
||||
updated_by: number | null
|
||||
revision_created_by: number | null
|
||||
}
|
||||
|
||||
export type WriteDelphiRule = {
|
||||
name: string
|
||||
priority: number
|
||||
expression: string
|
||||
}
|
||||
|
||||
export type SearchProjectsRequest = {
|
||||
limit?: number
|
||||
page?: number
|
||||
|
||||
Reference in New Issue
Block a user