Skip to content

Commit

Permalink
feat: Add ruleIds and category param to reports
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Apr 3, 2022
1 parent 2761173 commit 44edad9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/entities/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export interface Instance {
thumbnail?: string | null;
/** A user that can be contacted, as an alternative to `email`. */
contactAccount?: Account | null;

rules?: InstanceRule[] | null;
}

export interface InstanceURLs {
Expand All @@ -84,3 +86,8 @@ export interface InstanceStats {
/** Domains federated with this instance. Number. */
domainCount: number;
}

export interface InstanceRule {
id: string;
text: string;
}
6 changes: 6 additions & 0 deletions src/repositories/report-repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { version } from '../decorators';
import { Http } from '../http';

export type ReportCategory = 'spam' | 'violation' | 'other';

export interface ReportAccountParams {
/** ID of the account to report */
readonly accountId: string;
Expand All @@ -10,6 +12,10 @@ export interface ReportAccountParams {
readonly comment?: string | null;
/** If the account is remote, should the report be forwarded to the remote admin? */
readonly forward?: boolean | null;
/** category can be one of: spam, violation, other (default) */
readonly category?: ReportCategory | null;
/** must reference rules returned in GET /api/v1/instance */
readonly ruleIds?: string[] | null;
}

export class ReportRepository {
Expand Down

0 comments on commit 44edad9

Please sign in to comment.