2024-07-26 18:51:39 +02:00
|
|
|
import type { Undo } from "@lysand-org/federation/types";
|
2024-04-10 07:51:00 +02:00
|
|
|
import { config } from "config-manager";
|
2024-05-29 02:59:49 +02:00
|
|
|
import type { User } from "~/packages/database-interface/user";
|
2024-04-10 07:51:00 +02:00
|
|
|
|
2024-06-20 01:21:02 +02:00
|
|
|
export const undoFederationRequest = (undoer: User, uri: string): Undo => {
|
2024-06-06 07:25:49 +02:00
|
|
|
const id = crypto.randomUUID();
|
|
|
|
|
return {
|
|
|
|
|
type: "Undo",
|
|
|
|
|
id,
|
|
|
|
|
author: undoer.getUri(),
|
|
|
|
|
created_at: new Date().toISOString(),
|
|
|
|
|
object: uri,
|
|
|
|
|
uri: new URL(`/undos/${id}`, config.http.base_url).toString(),
|
|
|
|
|
};
|
|
|
|
|
};
|