Add stub status history endpoint

This commit is contained in:
Laura Hausmann 2023-07-05 16:59:08 +02:00
parent 6973d24172
commit 30d6ae45f3
Signed by: zotan
GPG key ID: D044E84C5BE01605
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,23 @@
/// <reference path="account.ts" />
/// <reference path="application.ts" />
/// <reference path="mention.ts" />
/// <reference path="tag.ts" />
/// <reference path="attachment.ts" />
/// <reference path="emoji.ts" />
/// <reference path="card.ts" />
/// <reference path="poll.ts" />
/// <reference path="reaction.ts" />
namespace Entity {
export type StatusEdit = {
account: Account
content: string
plain_content: string | null
created_at: string
emojis: Emoji[]
sensitive: boolean
spoiler_text: string
media_attachments: Array<Attachment>
poll: Poll | null
}
}

View file

@ -695,6 +695,14 @@ export interface MegalodonInterface {
* @return Context
*/
getStatusContext(id: string, options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Entity.Context>>
/**
* GET /api/v1/statuses/:id/history
*
* Get status edit history.
* @param id The target status id.
* @return StatusEdit
*/
getStatusHistory(id: string): Promise<Response<Array<Entity.StatusEdit>>>
/**
* GET /api/v1/statuses/:id/reblogged_by
*

View file

@ -1325,6 +1325,17 @@ export default class Misskey implements MegalodonInterface {
return result;
}
public async getStatusHistory(): Promise<Response<Array<Entity.StatusEdit>>> {
const history : Entity.StatusEdit[] = [];
const res : Response = {
headers: undefined,
statusText: "",
status: 200,
data: history
};
return new Promise(resolve => resolve(res))
}
/**
* POST /api/notes/renotes