merge: Allow logged in users to refresh polls (!686)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/686

Closes #743

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
Marie 2024-10-18 21:03:07 +00:00
commit 290bfd2075
14 changed files with 205 additions and 6 deletions

View file

@ -3284,6 +3284,17 @@ declare module '../api.js' {
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:federation*
*/
request<E extends 'notes/polls/refresh', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*

View file

@ -438,6 +438,7 @@ import type {
NotesPollsRecommendationRequest,
NotesPollsRecommendationResponse,
NotesPollsVoteRequest,
NotesPollsRefreshRequest,
NotesReactionsRequest,
NotesReactionsResponse,
NotesReactionsCreateRequest,
@ -888,6 +889,7 @@ export type Endpoints = {
'notes/mentions': { req: NotesMentionsRequest; res: NotesMentionsResponse };
'notes/polls/recommendation': { req: NotesPollsRecommendationRequest; res: NotesPollsRecommendationResponse };
'notes/polls/vote': { req: NotesPollsVoteRequest; res: EmptyResponse };
'notes/polls/refresh': { req: NotesPollsRefreshRequest; res: EmptyResponse };
'notes/reactions': { req: NotesReactionsRequest; res: NotesReactionsResponse };
'notes/reactions/create': { req: NotesReactionsCreateRequest; res: EmptyResponse };
'notes/reactions/delete': { req: NotesReactionsDeleteRequest; res: EmptyResponse };
@ -1286,6 +1288,7 @@ export const endpointReqTypes: Record<keyof Endpoints, 'application/json' | 'mul
'notes/mentions': 'application/json',
'notes/polls/recommendation': 'application/json',
'notes/polls/vote': 'application/json',
'notes/polls/refresh': 'application/json',
'notes/reactions': 'application/json',
'notes/reactions/create': 'application/json',
'notes/reactions/delete': 'application/json',

View file

@ -441,6 +441,7 @@ export type NotesMentionsResponse = operations['notes___mentions']['responses'][
export type NotesPollsRecommendationRequest = operations['notes___polls___recommendation']['requestBody']['content']['application/json'];
export type NotesPollsRecommendationResponse = operations['notes___polls___recommendation']['responses']['200']['content']['application/json'];
export type NotesPollsVoteRequest = operations['notes___polls___vote']['requestBody']['content']['application/json'];
export type NotesPollsRefreshRequest = operations['notes___polls___refresh']['requestBody']['content']['application/json'];
export type NotesReactionsRequest = operations['notes___reactions']['requestBody']['content']['application/json'];
export type NotesReactionsResponse = operations['notes___reactions']['responses']['200']['content']['application/json'];
export type NotesReactionsCreateRequest = operations['notes___reactions___create']['requestBody']['content']['application/json'];

View file

@ -2845,6 +2845,15 @@ export type paths = {
*/
post: operations['notes___polls___vote'];
};
'/notes/polls/refresh': {
/**
* notes/polls/refresh
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:federation*
*/
post: operations['notes___polls___refresh'];
};
'/notes/reactions': {
/**
* notes/reactions
@ -22867,6 +22876,58 @@ export type operations = {
};
};
};
/**
* notes/polls/refresh
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:federation*
*/
notes___polls___refresh: {
requestBody: {
content: {
'application/json': {
/** Format: misskey:id */
noteId: string;
};
};
};
responses: {
/** @description OK (without any results) */
204: {
content: never;
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* notes/reactions
* @description No description provided.