wip: delphi trace transform rules

This commit is contained in:
aecsocket
2026-07-19 09:46:12 +01:00
parent 6b569e4ee4
commit 023c789a31
20 changed files with 1376 additions and 5 deletions
@@ -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