mirror of
https://github.com/versia-pub/api.git
synced 2026-03-13 04:09:15 +01:00
refactor: ♻️ Refactor naming and code exports for both modules
This commit is contained in:
parent
8a37e7df95
commit
dc352bc276
29 changed files with 629 additions and 312 deletions
|
|
@ -24,7 +24,9 @@ export interface Output<ReturnType> {
|
|||
|
||||
const objectToFormData = (obj: ConvertibleObject): FormData => {
|
||||
return Object.keys(obj).reduce((formData, key) => {
|
||||
if (obj[key] === undefined || obj[key] === null) return formData;
|
||||
if (obj[key] === undefined || obj[key] === null) {
|
||||
return formData;
|
||||
}
|
||||
if (obj[key] instanceof File) {
|
||||
formData.append(key, obj[key] as Blob);
|
||||
return formData;
|
||||
|
|
@ -113,12 +115,12 @@ export class BaseClient {
|
|||
};
|
||||
}
|
||||
|
||||
private async constructRequest(
|
||||
private constructRequest(
|
||||
path: string,
|
||||
method: HttpVerb,
|
||||
body?: object | FormData,
|
||||
extra?: RequestInit,
|
||||
): Promise<Request> {
|
||||
): Request {
|
||||
const headers = new Headers({
|
||||
"User-Agent": DEFAULT_UA,
|
||||
});
|
||||
|
|
@ -148,32 +150,30 @@ export class BaseClient {
|
|||
});
|
||||
}
|
||||
|
||||
public async get<ReturnType>(
|
||||
public get<ReturnType>(
|
||||
path: string,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(path, "GET", undefined, extra),
|
||||
return this.request(
|
||||
this.constructRequest(path, "GET", undefined, extra),
|
||||
);
|
||||
}
|
||||
|
||||
public async post<ReturnType>(
|
||||
public post<ReturnType>(
|
||||
path: string,
|
||||
body?: object,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(path, "POST", body, extra),
|
||||
);
|
||||
return this.request(this.constructRequest(path, "POST", body, extra));
|
||||
}
|
||||
|
||||
public async postForm<ReturnType>(
|
||||
public postForm<ReturnType>(
|
||||
path: string,
|
||||
body: FormData | ConvertibleObject,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(
|
||||
return this.request(
|
||||
this.constructRequest(
|
||||
path,
|
||||
"POST",
|
||||
body instanceof FormData ? body : objectToFormData(body),
|
||||
|
|
@ -182,23 +182,21 @@ export class BaseClient {
|
|||
);
|
||||
}
|
||||
|
||||
public async put<ReturnType>(
|
||||
public put<ReturnType>(
|
||||
path: string,
|
||||
body?: object,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(path, "PUT", body, extra),
|
||||
);
|
||||
return this.request(this.constructRequest(path, "PUT", body, extra));
|
||||
}
|
||||
|
||||
public async putForm<ReturnType>(
|
||||
public putForm<ReturnType>(
|
||||
path: string,
|
||||
body: FormData | ConvertibleObject,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(
|
||||
return this.request(
|
||||
this.constructRequest(
|
||||
path,
|
||||
"PUT",
|
||||
body instanceof FormData ? body : objectToFormData(body),
|
||||
|
|
@ -207,23 +205,21 @@ export class BaseClient {
|
|||
);
|
||||
}
|
||||
|
||||
public async patch<ReturnType>(
|
||||
public patch<ReturnType>(
|
||||
path: string,
|
||||
body?: object,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(path, "PATCH", body, extra),
|
||||
);
|
||||
return this.request(this.constructRequest(path, "PATCH", body, extra));
|
||||
}
|
||||
|
||||
public async patchForm<ReturnType>(
|
||||
public patchForm<ReturnType>(
|
||||
path: string,
|
||||
body: FormData | ConvertibleObject,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(
|
||||
return this.request(
|
||||
this.constructRequest(
|
||||
path,
|
||||
"PATCH",
|
||||
body instanceof FormData ? body : objectToFormData(body),
|
||||
|
|
@ -232,23 +228,21 @@ export class BaseClient {
|
|||
);
|
||||
}
|
||||
|
||||
public async delete<ReturnType>(
|
||||
public delete<ReturnType>(
|
||||
path: string,
|
||||
body?: object,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(path, "DELETE", body, extra),
|
||||
);
|
||||
return this.request(this.constructRequest(path, "DELETE", body, extra));
|
||||
}
|
||||
|
||||
public async deleteForm<ReturnType>(
|
||||
public deleteForm<ReturnType>(
|
||||
path: string,
|
||||
body: FormData | ConvertibleObject,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ReturnType>> {
|
||||
return await this.request(
|
||||
await this.constructRequest(
|
||||
return this.request(
|
||||
this.constructRequest(
|
||||
path,
|
||||
"DELETE",
|
||||
body instanceof FormData ? body : objectToFormData(body),
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ export class LysandClient extends BaseClient {
|
|||
*/
|
||||
public addAccountToList(
|
||||
id: string,
|
||||
account_ids: string[],
|
||||
accountIds: string[],
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<void>> {
|
||||
return this.post<void>(
|
||||
`/api/v1/lists/${id}/accounts`,
|
||||
{ account_ids },
|
||||
{ accountIds },
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ export class LysandClient extends BaseClient {
|
|||
* @param options.website URL to the application's website.
|
||||
*/
|
||||
public createApp(
|
||||
client_name: string,
|
||||
clientName: string,
|
||||
options?: Partial<{
|
||||
redirect_uris: string;
|
||||
scopes: string[];
|
||||
|
|
@ -183,7 +183,7 @@ export class LysandClient extends BaseClient {
|
|||
}>,
|
||||
): Promise<Output<ApplicationData>> {
|
||||
return this.postForm<ApplicationData>("/api/v1/apps", {
|
||||
client_name,
|
||||
clientName,
|
||||
...options,
|
||||
scopes: options?.scopes?.join(" ") || DEFAULT_SCOPE.join(" "),
|
||||
redirect_uris: options?.redirect_uris || NO_REDIRECT,
|
||||
|
|
@ -243,12 +243,12 @@ export class LysandClient extends BaseClient {
|
|||
*/
|
||||
public deleteAccountsFromList(
|
||||
id: string,
|
||||
account_ids: string[],
|
||||
accountIds: string[],
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<void>> {
|
||||
return this.delete<void>(
|
||||
`/api/v1/lists/${id}/accounts`,
|
||||
{ account_ids },
|
||||
{ accountIds },
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
|
@ -441,19 +441,19 @@ export class LysandClient extends BaseClient {
|
|||
* @param redirect_uri Must be the same URI as the time when you register your OAuth2 application
|
||||
*/
|
||||
public fetchAccessToken(
|
||||
client_id: string,
|
||||
client_secret: string,
|
||||
clientId: string,
|
||||
clientSecret: string,
|
||||
code?: string,
|
||||
redirect_uri: string = NO_REDIRECT,
|
||||
redirectUri: string = NO_REDIRECT,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<Token>> {
|
||||
return this.postForm<Token>(
|
||||
"/oauth/token",
|
||||
{
|
||||
client_id,
|
||||
client_secret,
|
||||
clientId,
|
||||
clientSecret,
|
||||
code,
|
||||
redirect_uri,
|
||||
redirectUri,
|
||||
grant_type: "authorization_code",
|
||||
},
|
||||
extra,
|
||||
|
|
@ -505,8 +505,8 @@ export class LysandClient extends BaseClient {
|
|||
* @returns
|
||||
*/
|
||||
public generateAuthUrl(
|
||||
client_id: string,
|
||||
client_secret: string,
|
||||
clientId: string,
|
||||
clientSecret: string,
|
||||
options: Partial<{
|
||||
redirect_uri: string;
|
||||
scopes: string[];
|
||||
|
|
@ -514,8 +514,8 @@ export class LysandClient extends BaseClient {
|
|||
): Promise<string> {
|
||||
const oauthClient = new OAuth2Client({
|
||||
server: this.baseUrl.toString(),
|
||||
clientId: client_id,
|
||||
clientSecret: client_secret,
|
||||
clientId: clientId,
|
||||
clientSecret: clientSecret,
|
||||
tokenEndpoint: "/oauth/token",
|
||||
authorizationEndpoint: "/oauth/authorize",
|
||||
});
|
||||
|
|
@ -560,9 +560,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(
|
||||
|
|
@ -592,9 +598,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(
|
||||
|
|
@ -647,14 +659,30 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.only_media) params.set("only_media", "true");
|
||||
if (options.pinned) params.set("pinned", "true");
|
||||
if (options.exclude_replies) params.set("exclude_replies", "true");
|
||||
if (options.exclude_reblogs) params.set("exclude_reblogs", "true");
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.only_media) {
|
||||
params.set("only_media", "true");
|
||||
}
|
||||
if (options.pinned) {
|
||||
params.set("pinned", "true");
|
||||
}
|
||||
if (options.exclude_replies) {
|
||||
params.set("exclude_replies", "true");
|
||||
}
|
||||
if (options.exclude_reblogs) {
|
||||
params.set("exclude_reblogs", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(
|
||||
|
|
@ -686,10 +714,18 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(
|
||||
|
|
@ -716,9 +752,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/blocks?${params}`);
|
||||
|
|
@ -744,10 +786,18 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(`/api/v1/bookmarks?${params}`);
|
||||
|
|
@ -775,10 +825,18 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Conversation[]>(
|
||||
|
|
@ -805,9 +863,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<string[]>(`/api/v1/domain_blocks?${params}`);
|
||||
|
|
@ -832,9 +896,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/endorsements?${params}`, extra);
|
||||
|
|
@ -858,9 +928,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(`/api/v1/favourites?${params}`);
|
||||
|
|
@ -894,7 +970,9 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/follow_requests?${params}`);
|
||||
|
|
@ -932,11 +1010,21 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.local) params.set("local", "true");
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.local) {
|
||||
params.set("local", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(`/api/v1/timelines/home?${params}`, extra);
|
||||
|
|
@ -1007,10 +1095,18 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.local) params.set("local", "true");
|
||||
if (options.offset) params.set("offset", options.offset.toString());
|
||||
if (options.order) params.set("order", options.order);
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.local) {
|
||||
params.set("local", "true");
|
||||
}
|
||||
if (options.offset) {
|
||||
params.set("offset", options.offset.toString());
|
||||
}
|
||||
if (options.order) {
|
||||
params.set("order", options.order);
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/directory?${params}`, extra);
|
||||
|
|
@ -1078,7 +1174,9 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Tag[]>(`/api/v1/trends?${params}`);
|
||||
|
|
@ -1117,10 +1215,18 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(
|
||||
|
|
@ -1162,11 +1268,21 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.only_media) params.set("only_media", "true");
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.only_media) {
|
||||
params.set("only_media", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(`/api/v1/timelines/public?${params}`, extra);
|
||||
|
|
@ -1223,9 +1339,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/mutes?${params}`);
|
||||
|
|
@ -1268,17 +1390,26 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.exclude_types) {
|
||||
for (const type of options.exclude_types) {
|
||||
params.append("exclude_types[]", type);
|
||||
}
|
||||
}
|
||||
if (options.account_id)
|
||||
if (options.account_id) {
|
||||
params.set("account_id", options.account_id);
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Notification[]>(`/api/v1/notifications?${params}`);
|
||||
|
|
@ -1326,11 +1457,21 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.only_media) params.set("only_media", "true");
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.only_media) {
|
||||
params.set("only_media", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(`/api/v1/timelines/public?${params}`, extra);
|
||||
|
|
@ -1388,7 +1529,9 @@ export class LysandClient extends BaseClient {
|
|||
}
|
||||
|
||||
if (options) {
|
||||
if (options.with_suspended) params.set("with_suspended", "true");
|
||||
if (options.with_suspended) {
|
||||
params.set("with_suspended", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Relationship[]>(
|
||||
|
|
@ -1457,10 +1600,18 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<ScheduledStatus[]>(
|
||||
|
|
@ -1501,9 +1652,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Context>(
|
||||
|
|
@ -1533,9 +1690,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(
|
||||
|
|
@ -1565,9 +1728,15 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(
|
||||
|
|
@ -1611,7 +1780,9 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/suggestions?${params}`);
|
||||
|
|
@ -1654,12 +1825,24 @@ export class LysandClient extends BaseClient {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
if (options) {
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.local) params.set("local", "true");
|
||||
if (options.only_media) params.set("only_media", "true");
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.local) {
|
||||
params.set("local", "true");
|
||||
}
|
||||
if (options.only_media) {
|
||||
params.set("only_media", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Status[]>(
|
||||
|
|
@ -1848,18 +2031,18 @@ export class LysandClient extends BaseClient {
|
|||
* @param token will be get #fetchAccessToken
|
||||
*/
|
||||
public refreshToken(
|
||||
client_id: string,
|
||||
client_secret: string,
|
||||
refresh_token: string,
|
||||
clientId: string,
|
||||
clientSecret: string,
|
||||
refreshToken: string,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<Token>> {
|
||||
return this.post<Token>(
|
||||
"/oauth/token",
|
||||
{
|
||||
client_id,
|
||||
client_secret,
|
||||
clientId,
|
||||
clientSecret,
|
||||
grant_type: "refresh_token",
|
||||
refresh_token,
|
||||
refreshToken,
|
||||
},
|
||||
extra,
|
||||
);
|
||||
|
|
@ -1900,7 +2083,7 @@ export class LysandClient extends BaseClient {
|
|||
* @param options Form Data
|
||||
*/
|
||||
public registerApp(
|
||||
client_name: string,
|
||||
clientName: string,
|
||||
options: {
|
||||
redirect_uris: string;
|
||||
scopes?: string;
|
||||
|
|
@ -1910,7 +2093,7 @@ export class LysandClient extends BaseClient {
|
|||
): Promise<Output<ApplicationData>> {
|
||||
return this.post<ApplicationData>(
|
||||
"/api/v1/apps",
|
||||
{ client_name, ...options },
|
||||
{ clientName, ...options },
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
|
@ -1976,7 +2159,7 @@ export class LysandClient extends BaseClient {
|
|||
* @return Report.
|
||||
*/
|
||||
public report(
|
||||
account_id: string,
|
||||
accountId: string,
|
||||
options: {
|
||||
status_ids?: string[];
|
||||
rule_ids?: string[];
|
||||
|
|
@ -1988,7 +2171,7 @@ export class LysandClient extends BaseClient {
|
|||
): Promise<Output<Report>> {
|
||||
return this.post<Report>(
|
||||
"/api/v1/reports",
|
||||
{ account_id, ...options },
|
||||
{ accountId, ...options },
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
|
@ -2002,14 +2185,14 @@ export class LysandClient extends BaseClient {
|
|||
* @param token will be get #fetchAccessToken
|
||||
*/
|
||||
public revokeToken(
|
||||
client_id: string,
|
||||
client_secret: string,
|
||||
clientId: string,
|
||||
clientSecret: string,
|
||||
token: string,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<void>> {
|
||||
return this.post<void>(
|
||||
"/oauth/revoke",
|
||||
{ client_id, client_secret, token },
|
||||
{ clientId, clientSecret, token },
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
|
@ -2044,12 +2227,12 @@ export class LysandClient extends BaseClient {
|
|||
*/
|
||||
public scheduleStatus(
|
||||
id: string,
|
||||
scheduled_at?: Date,
|
||||
scheduledAt?: Date,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<ScheduledStatus>> {
|
||||
return this.put<ScheduledStatus>(
|
||||
`/api/v1/scheduled_statuses/${id}`,
|
||||
{ scheduled_at: scheduled_at?.toISOString() },
|
||||
{ scheduled_at: scheduledAt?.toISOString() },
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
|
@ -2088,17 +2271,33 @@ export class LysandClient extends BaseClient {
|
|||
params.set("q", q);
|
||||
|
||||
if (options) {
|
||||
if (options.account_id)
|
||||
if (options.account_id) {
|
||||
params.set("account_id", options.account_id);
|
||||
if (options.exclude_unreviewed)
|
||||
}
|
||||
if (options.exclude_unreviewed) {
|
||||
params.set("exclude_unreviewed", "true");
|
||||
if (options.following) params.set("following", "true");
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.min_id) params.set("min_id", options.min_id);
|
||||
if (options.offset) params.set("offset", options.offset.toString());
|
||||
if (options.resolve) params.set("resolve", "true");
|
||||
if (options.type) params.set("type", options.type);
|
||||
}
|
||||
if (options.following) {
|
||||
params.set("following", "true");
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.min_id) {
|
||||
params.set("min_id", options.min_id);
|
||||
}
|
||||
if (options.offset) {
|
||||
params.set("offset", options.offset.toString());
|
||||
}
|
||||
if (options.resolve) {
|
||||
params.set("resolve", "true");
|
||||
}
|
||||
if (options.type) {
|
||||
params.set("type", options.type);
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Results>(`/api/v2/search?${params}`, extra);
|
||||
|
|
@ -2131,11 +2330,21 @@ export class LysandClient extends BaseClient {
|
|||
params.set("q", q);
|
||||
|
||||
if (options) {
|
||||
if (options.following) params.set("following", "true");
|
||||
if (options.limit) params.set("limit", options.limit.toString());
|
||||
if (options.max_id) params.set("max_id", options.max_id);
|
||||
if (options.resolve) params.set("resolve", "true");
|
||||
if (options.since_id) params.set("since_id", options.since_id);
|
||||
if (options.following) {
|
||||
params.set("following", "true");
|
||||
}
|
||||
if (options.limit) {
|
||||
params.set("limit", options.limit.toString());
|
||||
}
|
||||
if (options.max_id) {
|
||||
params.set("max_id", options.max_id);
|
||||
}
|
||||
if (options.resolve) {
|
||||
params.set("resolve", "true");
|
||||
}
|
||||
if (options.since_id) {
|
||||
params.set("since_id", options.since_id);
|
||||
}
|
||||
}
|
||||
|
||||
return this.get<Account[]>(`/api/v1/accounts/search?${params}`, extra);
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ export type Account = {
|
|||
avatar_static: string;
|
||||
header: string;
|
||||
header_static: string;
|
||||
emojis: Array<Emoji>;
|
||||
emojis: Emoji[];
|
||||
moved: Account | null;
|
||||
fields: Array<Field>;
|
||||
fields: Field[];
|
||||
bot: boolean | null;
|
||||
source?: Source;
|
||||
role?: Role;
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ export type Announcement = {
|
|||
published_at: string;
|
||||
updated_at: string | null;
|
||||
read: boolean | null;
|
||||
mentions: Array<AnnouncementAccount>;
|
||||
statuses: Array<AnnouncementStatus>;
|
||||
tags: Array<StatusTag>;
|
||||
emojis: Array<Emoji>;
|
||||
reactions: Array<AnnouncementReaction>;
|
||||
mentions: AnnouncementAccount[];
|
||||
statuses: AnnouncementStatus[];
|
||||
tags: StatusTag[];
|
||||
emojis: Emoji[];
|
||||
reactions: AnnouncementReaction[];
|
||||
};
|
||||
|
||||
export type AnnouncementAccount = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { Status } from "./status";
|
||||
|
||||
export type Context = {
|
||||
ancestors: Array<Status>;
|
||||
descendants: Array<Status>;
|
||||
ancestors: Status[];
|
||||
descendants: Status[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Status } from "./status";
|
|||
|
||||
export type Conversation = {
|
||||
id: string;
|
||||
accounts: Array<Account>;
|
||||
accounts: Account[];
|
||||
last_status: Status | null;
|
||||
unread: boolean;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export type Filter = {
|
||||
id: string;
|
||||
phrase: string;
|
||||
context: Array<FilterContext>;
|
||||
context: FilterContext[];
|
||||
expires_at: string | null;
|
||||
irreversible: boolean;
|
||||
whole_word: boolean;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ export type FollowRequest = {
|
|||
followers_count: number;
|
||||
following_count: number;
|
||||
statuses_count: number;
|
||||
emojis: Array<Emoji>;
|
||||
fields: Array<Field>;
|
||||
emojis: Emoji[];
|
||||
fields: Field[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,47 +10,48 @@ export type LysandRole = {
|
|||
|
||||
// Last updated: 2024-06-07
|
||||
export enum LysandRolePermissions {
|
||||
MANAGE_NOTES = "notes",
|
||||
MANAGE_OWN_NOTES = "owner:note",
|
||||
VIEW_NOTES = "read:note",
|
||||
VIEW_NOTE_LIKES = "read:note_likes",
|
||||
VIEW_NOTE_BOOSTS = "read:note_boosts",
|
||||
MANAGE_ACCOUNTS = "accounts",
|
||||
MANAGE_OWN_ACCOUNT = "owner:account",
|
||||
VIEW_ACCOUNT_FOLLOWS = "read:account_follows",
|
||||
MANAGE_LIKES = "likes",
|
||||
MANAGE_OWN_LIKES = "owner:like",
|
||||
MANAGE_BOOSTS = "boosts",
|
||||
MANAGE_OWN_BOOSTS = "owner:boost",
|
||||
VIEW_ACCOUNTS = "read:account",
|
||||
MANAGE_EMOJIS = "emojis",
|
||||
VIEW_EMOJIS = "read:emoji",
|
||||
MANAGE_OWN_EMOJIS = "owner:emoji",
|
||||
MANAGE_MEDIA = "media",
|
||||
MANAGE_OWN_MEDIA = "owner:media",
|
||||
MANAGE_BLOCKS = "blocks",
|
||||
MANAGE_OWN_BLOCKS = "owner:block",
|
||||
MANAGE_FILTERS = "filters",
|
||||
MANAGE_OWN_FILTERS = "owner:filter",
|
||||
MANAGE_MUTES = "mutes",
|
||||
MANAGE_OWN_MUTES = "owner:mute",
|
||||
MANAGE_REPORTS = "reports",
|
||||
MANAGE_OWN_REPORTS = "owner:report",
|
||||
MANAGE_SETTINGS = "settings",
|
||||
MANAGE_OWN_SETTINGS = "owner:settings",
|
||||
MANAGE_ROLES = "roles",
|
||||
MANAGE_NOTIFICATIONS = "notifications",
|
||||
MANAGE_OWN_NOTIFICATIONS = "owner:notification",
|
||||
MANAGE_FOLLOWS = "follows",
|
||||
MANAGE_OWN_FOLLOWS = "owner:follow",
|
||||
MANAGE_OWN_APPS = "owner:app",
|
||||
SEARCH = "search",
|
||||
VIEW_PUBLIC_TIMELINES = "public_timelines",
|
||||
VIEW_PRIVATE_TIMELINES = "private_timelines",
|
||||
IGNORE_RATE_LIMITS = "ignore_rate_limits",
|
||||
IMPERSONATE = "impersonate",
|
||||
MANAGE_INSTANCE = "instance",
|
||||
MANAGE_INSTANCE_FEDERATION = "instance:federation",
|
||||
MANAGE_INSTANCE_SETTINGS = "instance:settings",
|
||||
OAUTH = "oauth",
|
||||
ManageNotes = "notes",
|
||||
ManageOwnNotes = "owner:note",
|
||||
ViewNotes = "read:note",
|
||||
ViewNoteLikes = "read:note_likes",
|
||||
ViewNoteBoosts = "read:note_boosts",
|
||||
ManageAccounts = "accounts",
|
||||
ManageOwnAccount = "owner:account",
|
||||
ViewAccountFollows = "read:account_follows",
|
||||
ManageLikes = "likes",
|
||||
ManageOwnLikes = "owner:like",
|
||||
ManageBoosts = "boosts",
|
||||
ManageOwnBoosts = "owner:boost",
|
||||
ViewAccounts = "read:account",
|
||||
ManageEmojis = "emojis",
|
||||
ViewEmojis = "read:emoji",
|
||||
ManageOwnEmojis = "owner:emoji",
|
||||
ManageMedia = "media",
|
||||
ManageOwnMedia = "owner:media",
|
||||
ManageBlocks = "blocks",
|
||||
ManageOwnBlocks = "owner:block",
|
||||
ManageFilters = "filters",
|
||||
ManageOwnFilters = "owner:filter",
|
||||
ManageMutes = "mutes",
|
||||
ManageOwnMutes = "owner:mute",
|
||||
ManageReports = "reports",
|
||||
ManageOwnReports = "owner:report",
|
||||
ManageSettings = "settings",
|
||||
ManageOwnSettings = "owner:settings",
|
||||
ManageRoles = "roles",
|
||||
ManageNotifications = "notifications",
|
||||
ManageOwnNotifications = "owner:notification",
|
||||
ManageFollows = "follows",
|
||||
ManageOwnFollows = "owner:follow",
|
||||
ManageOwnApps = "owner:app",
|
||||
Search = "search",
|
||||
ViewPublicTimelines = "public_timelines",
|
||||
ViewPrimateTimelines = "private_timelines",
|
||||
IgnoreRateLimits = "ignore_rate_limits",
|
||||
Impersonate = "impersonate",
|
||||
ManageInstance = "instance",
|
||||
ManageInstanceFederation = "instance:federation",
|
||||
ManageInstanceSettings = "instance:settings",
|
||||
/** Users who do not have this permission will not be able to login! */
|
||||
OAuth = "oauth",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export type Poll = {
|
|||
expired: boolean;
|
||||
multiple: boolean;
|
||||
votes_count: number;
|
||||
options: Array<PollOption>;
|
||||
options: PollOption[];
|
||||
voted: boolean;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export type Reaction = {
|
|||
name: string;
|
||||
url?: string;
|
||||
static_url?: string;
|
||||
accounts?: Array<Account>;
|
||||
account_ids?: Array<string>;
|
||||
accounts?: Account[];
|
||||
account_ids?: string[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ export type Report = {
|
|||
id: string;
|
||||
action_taken: boolean;
|
||||
action_taken_at: string | null;
|
||||
status_ids: Array<string> | null;
|
||||
rule_ids: Array<string> | null;
|
||||
status_ids: string[] | null;
|
||||
rule_ids: string[] | null;
|
||||
// These parameters don't exist in Pleroma
|
||||
category: Category | null;
|
||||
comment: string | null;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { Status } from "./status";
|
|||
import type { Tag } from "./tag";
|
||||
|
||||
export type Results = {
|
||||
accounts: Array<Account>;
|
||||
statuses: Array<Status>;
|
||||
hashtags: Array<Tag>;
|
||||
accounts: Account[];
|
||||
statuses: Status[];
|
||||
hashtags: Tag[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ export type ScheduledStatus = {
|
|||
id: string;
|
||||
scheduled_at: string;
|
||||
params: StatusParams;
|
||||
media_attachments: Array<Attachment> | null;
|
||||
media_attachments: Attachment[] | null;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ export type Source = {
|
|||
sensitive: boolean | null;
|
||||
language: string | null;
|
||||
note: string;
|
||||
fields: Array<Field>;
|
||||
fields: Field[];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,15 +29,15 @@ export type Status = {
|
|||
sensitive: boolean;
|
||||
spoiler_text: string;
|
||||
visibility: StatusVisibility;
|
||||
media_attachments: Array<Attachment>;
|
||||
mentions: Array<Mention>;
|
||||
tags: Array<StatusTag>;
|
||||
media_attachments: Attachment[];
|
||||
mentions: Mention[];
|
||||
tags: StatusTag[];
|
||||
card: Card | null;
|
||||
poll: Poll | null;
|
||||
application: Application | null;
|
||||
language: string | null;
|
||||
pinned: boolean | null;
|
||||
emoji_reactions: Array<Reaction>;
|
||||
emoji_reactions: Reaction[];
|
||||
quote: Status | null;
|
||||
bookmarked: boolean;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { StatusVisibility } from "./status";
|
|||
export type StatusParams = {
|
||||
text: string;
|
||||
in_reply_to_id: string | null;
|
||||
media_ids: Array<string> | null;
|
||||
media_ids: string[] | null;
|
||||
sensitive: boolean | null;
|
||||
spoiler_text: string | null;
|
||||
visibility: StatusVisibility | null;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ import type { History } from "./history";
|
|||
export type Tag = {
|
||||
name: string;
|
||||
url: string;
|
||||
history: Array<History>;
|
||||
history: History[];
|
||||
following?: boolean;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue