Merge remote-tracking branch 'parent/main' into upstream-20241126
This commit is contained in:
commit
8a075ba4c6
303 changed files with 7495 additions and 4498 deletions
89
app/javascript/mastodon/api/antennas.ts
Normal file
89
app/javascript/mastodon/api/antennas.ts
Normal file
|
@ -0,0 +1,89 @@
|
|||
import {
|
||||
apiRequestPost,
|
||||
apiRequestPut,
|
||||
apiRequestGet,
|
||||
apiRequestDelete,
|
||||
} from 'mastodon/api';
|
||||
import type { ApiAccountJSON } from 'mastodon/api_types/accounts';
|
||||
import type { ApiAntennaJSON } from 'mastodon/api_types/antennas';
|
||||
|
||||
export const apiCreate = (antenna: Partial<ApiAntennaJSON>) =>
|
||||
apiRequestPost<ApiAntennaJSON>('v1/antennas', antenna);
|
||||
|
||||
export const apiUpdate = (antenna: Partial<ApiAntennaJSON>) =>
|
||||
apiRequestPut<ApiAntennaJSON>(`v1/antennas/${antenna.id}`, antenna);
|
||||
|
||||
export const apiGetAccounts = (antennaId: string) =>
|
||||
apiRequestGet<ApiAccountJSON[]>(`v1/antennas/${antennaId}/accounts`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetExcludeAccounts = (antennaId: string) =>
|
||||
apiRequestGet<ApiAccountJSON[]>(`v1/antennas/${antennaId}/exclude_accounts`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetDomains = (antennaId: string) =>
|
||||
apiRequestGet<string[]>(`v1/antennas/${antennaId}/domains`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetExcludeDomains = (antennaId: string) =>
|
||||
apiRequestGet<string[]>(`v1/antennas/${antennaId}/exclude_domains`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetTags = (antennaId: string) =>
|
||||
apiRequestGet<string[]>(`v1/antennas/${antennaId}/tags`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetExcludeTags = (antennaId: string) =>
|
||||
apiRequestGet<string[]>(`v1/antennas/${antennaId}/exclude_tags`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetKeywords = (antennaId: string) =>
|
||||
apiRequestGet<string[]>(`v1/antennas/${antennaId}/keywords`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetExcludeKeywords = (antennaId: string) =>
|
||||
apiRequestGet<string[]>(`v1/antennas/${antennaId}/exclude_keywords`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetAccountAntennas = (accountId: string) =>
|
||||
apiRequestGet<ApiAntennaJSON[]>(`v1/accounts/${accountId}/antennas`);
|
||||
|
||||
export const apiAddAccountToAntenna = (antennaId: string, accountId: string) =>
|
||||
apiRequestPost(`v1/antennas/${antennaId}/accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
||||
|
||||
export const apiRemoveAccountFromAntenna = (
|
||||
antennaId: string,
|
||||
accountId: string,
|
||||
) =>
|
||||
apiRequestDelete(`v1/antennas/${antennaId}/accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
||||
|
||||
export const apiGetExcludeAccountAntennas = (accountId: string) =>
|
||||
apiRequestGet<ApiAntennaJSON[]>(`v1/accounts/${accountId}/exclude_antennas`);
|
||||
|
||||
export const apiAddExcludeAccountToAntenna = (
|
||||
antennaId: string,
|
||||
accountId: string,
|
||||
) =>
|
||||
apiRequestPost(`v1/antennas/${antennaId}/exclude_accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
||||
|
||||
export const apiRemoveExcludeAccountFromAntenna = (
|
||||
antennaId: string,
|
||||
accountId: string,
|
||||
) =>
|
||||
apiRequestDelete(`v1/antennas/${antennaId}/exclude_accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
49
app/javascript/mastodon/api/bookmark_categories.ts
Normal file
49
app/javascript/mastodon/api/bookmark_categories.ts
Normal file
|
@ -0,0 +1,49 @@
|
|||
import {
|
||||
apiRequestPost,
|
||||
apiRequestPut,
|
||||
apiRequestGet,
|
||||
apiRequestDelete,
|
||||
} from 'mastodon/api';
|
||||
import type { ApiAccountJSON } from 'mastodon/api_types/accounts';
|
||||
import type { ApiBookmarkCategoryJSON } from 'mastodon/api_types/bookmark_categories';
|
||||
|
||||
export const apiCreate = (bookmarkCategory: Partial<ApiBookmarkCategoryJSON>) =>
|
||||
apiRequestPost<ApiBookmarkCategoryJSON>(
|
||||
'v1/bookmark_categories',
|
||||
bookmarkCategory,
|
||||
);
|
||||
|
||||
export const apiUpdate = (bookmarkCategory: Partial<ApiBookmarkCategoryJSON>) =>
|
||||
apiRequestPut<ApiBookmarkCategoryJSON>(
|
||||
`v1/bookmark_categories/${bookmarkCategory.id}`,
|
||||
bookmarkCategory,
|
||||
);
|
||||
|
||||
export const apiGetAccounts = (bookmarkCategoryId: string) =>
|
||||
apiRequestGet<ApiAccountJSON[]>(
|
||||
`v1/bookmark_categories/${bookmarkCategoryId}/statuses`,
|
||||
{
|
||||
limit: 0,
|
||||
},
|
||||
);
|
||||
|
||||
export const apiGetAccountBookmarkCategories = (accountId: string) =>
|
||||
apiRequestGet<ApiBookmarkCategoryJSON[]>(
|
||||
`v1/statuses/${accountId}/bookmark_categories`,
|
||||
);
|
||||
|
||||
export const apiAddAccountToBookmarkCategory = (
|
||||
bookmarkCategoryId: string,
|
||||
accountId: string,
|
||||
) =>
|
||||
apiRequestPost(`v1/bookmark_categories/${bookmarkCategoryId}/statuses`, {
|
||||
account_ids: [accountId],
|
||||
});
|
||||
|
||||
export const apiRemoveAccountFromBookmarkCategory = (
|
||||
bookmarkCategoryId: string,
|
||||
accountId: string,
|
||||
) =>
|
||||
apiRequestDelete(`v1/bookmark_categories/${bookmarkCategoryId}/statuses`, {
|
||||
account_ids: [accountId],
|
||||
});
|
35
app/javascript/mastodon/api/circles.ts
Normal file
35
app/javascript/mastodon/api/circles.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import {
|
||||
apiRequestPost,
|
||||
apiRequestPut,
|
||||
apiRequestGet,
|
||||
apiRequestDelete,
|
||||
} from 'mastodon/api';
|
||||
import type { ApiAccountJSON } from 'mastodon/api_types/accounts';
|
||||
import type { ApiCircleJSON } from 'mastodon/api_types/circles';
|
||||
|
||||
export const apiCreate = (circle: Partial<ApiCircleJSON>) =>
|
||||
apiRequestPost<ApiCircleJSON>('v1/circles', circle);
|
||||
|
||||
export const apiUpdate = (circle: Partial<ApiCircleJSON>) =>
|
||||
apiRequestPut<ApiCircleJSON>(`v1/circles/${circle.id}`, circle);
|
||||
|
||||
export const apiGetAccounts = (circleId: string) =>
|
||||
apiRequestGet<ApiAccountJSON[]>(`v1/circles/${circleId}/accounts`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetAccountCircles = (accountId: string) =>
|
||||
apiRequestGet<ApiCircleJSON[]>(`v1/accounts/${accountId}/circles`);
|
||||
|
||||
export const apiAddAccountToCircle = (circleId: string, accountId: string) =>
|
||||
apiRequestPost(`v1/circles/${circleId}/accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
||||
|
||||
export const apiRemoveAccountFromCircle = (
|
||||
circleId: string,
|
||||
accountId: string,
|
||||
) =>
|
||||
apiRequestDelete(`v1/circles/${circleId}/accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
32
app/javascript/mastodon/api/lists.ts
Normal file
32
app/javascript/mastodon/api/lists.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import {
|
||||
apiRequestPost,
|
||||
apiRequestPut,
|
||||
apiRequestGet,
|
||||
apiRequestDelete,
|
||||
} from 'mastodon/api';
|
||||
import type { ApiAccountJSON } from 'mastodon/api_types/accounts';
|
||||
import type { ApiListJSON } from 'mastodon/api_types/lists';
|
||||
|
||||
export const apiCreate = (list: Partial<ApiListJSON>) =>
|
||||
apiRequestPost<ApiListJSON>('v1/lists', list);
|
||||
|
||||
export const apiUpdate = (list: Partial<ApiListJSON>) =>
|
||||
apiRequestPut<ApiListJSON>(`v1/lists/${list.id}`, list);
|
||||
|
||||
export const apiGetAccounts = (listId: string) =>
|
||||
apiRequestGet<ApiAccountJSON[]>(`v1/lists/${listId}/accounts`, {
|
||||
limit: 0,
|
||||
});
|
||||
|
||||
export const apiGetAccountLists = (accountId: string) =>
|
||||
apiRequestGet<ApiListJSON[]>(`v1/accounts/${accountId}/lists`);
|
||||
|
||||
export const apiAddAccountToList = (listId: string, accountId: string) =>
|
||||
apiRequestPost(`v1/lists/${listId}/accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
||||
|
||||
export const apiRemoveAccountFromList = (listId: string, accountId: string) =>
|
||||
apiRequestDelete(`v1/lists/${listId}/accounts`, {
|
||||
account_ids: [accountId],
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue