Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
283 changes: 282 additions & 1 deletion amd/tsl-mastodon-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,257 @@ declare module "tsl-mastodon-api/lib/JSON/Account" {
export function isAccounts(json: Partial<Array<Partial<Account>>>): json is Array<Account>;
export default Account;
}
/// <amd-module name="tsl-mastodon-api/lib/JSON/AdminReport" />
declare module "tsl-mastodon-api/lib/JSON/AdminReport" {
/*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*\

TypeScript Library for the Mastodon API

Copyright (c) TypeScriptLibs and Contributors

Licensed under the MIT License.
You may not use this file except in compliance with the License.
You can get a copy of the License at https://typescriptlibs.org/LICENSE.txt

\*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*/
import type Account from "tsl-mastodon-api/lib/JSON/Account";
/**
* Represents admin-level information about a given account.
*
* @since 2.9.1
*/
export interface AdminAccount {
/**
* User-level information about the account.
*
* @since 2.9.1
*/
account: Account;
/**
* When the account was first discovered.
*
* @since 2.9.1
*/
created_at: string;
/**
* The domain of the account, if it is remote.
*
* @since 2.9.1
*/
domain?: (string | null);
/**
* The email address associated with the account.
*
* @since 2.9.1
*/
email: string;
/**
* The ID of the account in the database.
*
* @since 2.9.1
*/
id: string;
/**
* The IP address last used to login to this account.
*
* @since 2.9.1
*/
ip?: (string | null);
/**
* All known IP addresses associated with this account.
*
* @since 3.5.0
*/
ips: Array<AdminAccountIP>;
/**
* The username of the account.
*
* @since 2.9.1
*/
username: string;
}
/**
* Represents an IP address associated with a user.
*
* @since 3.5.0
*/
export interface AdminAccountIP {
/**
* The IP address.
*
* @since 3.5.0
*/
ip: string;
/**
* Time when the IP address was last used for this account.
* (ISO 8601 Datetime)
*
* @since 3.5.0
*/
used_at: string;
}
/**
* Tests the JSON object for an AdminAccount structure.
*
* @param json
* JSON object to test.
*
* @return
* True, if the JSON object has a AdminReport structure.
*/
export function isAdminAccount(json: Partial<AdminAccount>): json is AdminAccount;
/**
* Tests the JSON object for an AdminAccountIP structure.
*
* @param json
* JSON object to test.
*
* @return
* True, if the JSON object has an AdminAccountIP structure.
*/
export function isAdminAccountIP(json?: Partial<AdminAccountIP>): json is AdminAccountIP;
/**
* Tests the JSON object for an AdminAccountIP array structure.
*
* @param json
* JSON object to test.
*
* @return
* True, if the JSON object has an AdminAccountIP array structure.
*/
export function isAdminAccountIPs(json?: Partial<Array<Partial<AdminAccountIP>>>): json is Array<AdminAccountIP>;
export default AdminAccount;
}
/// <amd-module name="tsl-mastodon-api/lib/JSON/AdminReport" />
declare module "tsl-mastodon-api/lib/JSON/AdminReport" {
/*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*\

TypeScript Library for the Mastodon API

Copyright (c) TypeScriptLibs and Contributors

Licensed under the MIT License.
You may not use this file except in compliance with the License.
You can get a copy of the License at https://typescriptlibs.org/LICENSE.txt

\*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*/
import type AdminAccount from "tsl-mastodon-api/lib/JSON/AdminReport";
/**
* Represents a report filed against a user and/or status, to be taken action on
* by moderators.
*
* @since 1.1.0
*/
export interface AdminReport {
/**
* Whether an action was taken yet.
*
* @since 1.1.0
*/
action_taken?: boolean;
/**
* When an action was taken against the report.
*
* @since 1.1.0
*/
action_taken_at?: (string | null);
/**
* The generic reason for the report.
*
* @since 4.0.0
*/
category: AdminReportCategory;
/**
* The reason for the report.
*
* @since 4.0.0
*/
comment: string;
/**
* When the report was created.
*
* @since 4.0.0
*/
created_at: string;
/**
* Whether the report was forwarded to a remote domain.
*
* @since 4.0.0
*/
forwarded?: boolean;
/**
* The ID of the report in the database.
*
* @since 1.1.0
*/
id: string;
/**
* IDs of the rules that have been cited as a violation by this report.
*
* @since 4.0.0
*/
rule_ids?: (Array<string> | null);
/**
* IDs of statuses that have been attached to this report for additional
* context.
*
* @since 4.0.0
*/
status_ids?: (Array<string> | null);
/**
* The account that was reported.
*
* @since 0.1.0
*/
target_account: AdminAccount;
}
/**
* The generic reason for a report.
*
* @since 4.0.0
*/
export enum AdminReportCategory {
/**
* Some other reason.
*
* @since 4.0.0
*/
Other = "other",
/**
* Unwanted or repetitive content.
*
* @since 4.0.0
*/
Spam = "spam",
/**
* A specific rule was violated.
*
* @since 4.0.0
*/
Violation = "violation"
}
/**
* Tests the JSON object for an AdminReport structure.
*
* @param json
* JSON object to test.
*
* @return
* True, if the JSON object has an AdminReport structure.
*/
export function isAdminReport(json: Partial<AdminReport>): json is AdminReport;
/**
* Tests a JSON array for an AdminReports structure.
*
* @param json
* JSON array to test.
*
* @return
* True, if the JSON array contains a AdminReports structure.
*/
export function isAdminReports(json: Partial<Array<Partial<AdminReport>>>): json is Array<AdminReport>;
export default AdminReport;
}
/// <amd-module name="tsl-mastodon-api/lib/JSON/Reaction" />
declare module "tsl-mastodon-api/lib/JSON/Reaction" {
/*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*\
Expand Down Expand Up @@ -2219,6 +2470,8 @@ declare module "tsl-mastodon-api/lib/JSON/index" {

\*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*/
export * from "tsl-mastodon-api/lib/JSON/Account";
export * from "tsl-mastodon-api/lib/JSON/AdminReport";
export * from "tsl-mastodon-api/lib/JSON/AdminReport";
export * from "tsl-mastodon-api/lib/JSON/Announcement";
export * from "tsl-mastodon-api/lib/JSON/Application";
export * from "tsl-mastodon-api/lib/JSON/Card";
Expand Down Expand Up @@ -2517,6 +2770,17 @@ declare module "tsl-mastodon-api/lib/API" {
* Promise with the account, if successful.
*/
getAccount(): Promise<API.Success<JSON.Account>>;
getAdminReport(adminReportID: string): Promise<API.Success<JSON.AdminReport>>;
/**
* Gets admin reports, usually filtered with query parameters.
*
* @param [queryParams]
* Query parameters to control the amount and kind of reports to get.
*
* @return
* Promise with the array of reports, if successful.
*/
getAdminReports(queryParams?: API.AdminReportsParams): Promise<API.Success<Array<JSON.AdminReport>>>;
/**
* Gets the connected account.
*
Expand Down Expand Up @@ -2813,10 +3077,27 @@ declare module "tsl-mastodon-api/lib/API" {
* @name API
*/
export namespace API {
/**
* Query parameters to retrieve admin reports.
*/
interface AdminReportsParams extends QueryParams {
/**
* Limit to reports filed by this account.
*/
account_id?: string;
/**
* Limit to resolved reports.
*/
resolved?: boolean;
/**
* Limit to reports targeting this account.
*/
target_account_id?: string;
}
/**
* Query parameters to retrieve announcements.
*/
interface AnnouncementsParams {
interface AnnouncementsParams extends QueryParams {
/**
* If true, response will include announcements dismissed by the user.
*/
Expand Down
Loading