test(api): Remove old tests and introduce new, better ones
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 6s
Build Docker Images / lint (push) Successful in 50s
Build Docker Images / check (push) Successful in 1m24s
Build Docker Images / tests (push) Failing after 8s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / build (push) Failing after 15s
Mirror to Codeberg / Mirror (push) Failing after 0s
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Nix Build / check (push) Failing after 33m5s

This commit is contained in:
Jesse Wierzbinski 2025-03-23 03:34:17 +01:00
parent f1ef85b314
commit ec506241f0
No known key found for this signature in database
23 changed files with 819 additions and 1001 deletions

View file

@ -2481,6 +2481,53 @@ export class Client extends BaseClient {
);
}
/**
* DELETE /api/v1/profile/avatar
*
* @return Account.
*/
public deleteAvatar(
extra?: RequestInit,
): Promise<Output<z.infer<typeof Account>>> {
return this.delete<z.infer<typeof Account>>(
"/api/v1/profile/avatar",
undefined,
extra,
);
}
/**
* DELETE /api/v1/profile/header
*
* @return Account.
*/
public deleteHeader(
extra?: RequestInit,
): Promise<Output<z.infer<typeof Account>>> {
return this.delete<z.infer<typeof Account>>(
"/api/v1/profile/header",
undefined,
extra,
);
}
/**
* POST /api/v1/accounts/:id/remove_from_followers
*
* @param id The account ID.
* @return Relationship.
*/
public removeFromFollowers(
id: string,
extra?: RequestInit,
): Promise<Output<z.infer<typeof Relationship>>> {
return this.post<z.infer<typeof Relationship>>(
`/api/v1/accounts/${id}/remove_from_followers`,
undefined,
extra,
);
}
// FIXME: Announcement schema is not defined.
/**
* DELETE /api/v1/announcements/:id/reactions/:name
@ -2971,6 +3018,25 @@ export class Client extends BaseClient {
);
}
/**
* POST /api/v1/accounts/:id/note
*
* @param id The account ID.
* @param note The note to set.
* @return Account.
*/
public updateAccountNote(
id: string,
note: string | null,
extra?: RequestInit,
): Promise<Output<z.infer<typeof Account>>> {
return this.post<z.infer<typeof Account>>(
`/api/v1/accounts/${id}/note`,
{ comment: note ?? undefined },
extra,
);
}
/**
* PATCH /api/v1/accounts/update_credentials
*
@ -2987,7 +3053,7 @@ export class Client extends BaseClient {
*/
public updateCredentials(
options: Partial<{
avatar: File;
avatar: File | URL;
bot: boolean;
discoverable: boolean;
display_name: string;
@ -2995,7 +3061,7 @@ export class Client extends BaseClient {
name: string;
value: string;
}[];
header: File;
header: File | URL;
locked: boolean;
note: string;
source: Partial<{
@ -3008,7 +3074,17 @@ export class Client extends BaseClient {
): Promise<Output<z.infer<typeof Account>>> {
return this.patchForm<z.infer<typeof Account>>(
"/api/v1/accounts/update_credentials",
options,
{
...options,
avatar:
options.avatar instanceof File
? options.avatar
: options.avatar?.toString(),
header:
options.header instanceof File
? options.header
: options.header?.toString(),
},
extra,
);
}