mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
feat(federation): ✨ Port to Versia 0.6
This commit is contained in:
parent
de69f27877
commit
fca30b4dad
62 changed files with 1614 additions and 2008 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import type { z } from "zod";
|
||||
import { DeleteSchema } from "../schemas/delete.ts";
|
||||
import type { JSONObject } from "../types.ts";
|
||||
import { Entity } from "./entity.ts";
|
||||
import { Entity, Reference } from "./entity.ts";
|
||||
|
||||
export class Delete extends Entity {
|
||||
public static override name = "Delete";
|
||||
|
|
@ -10,6 +10,14 @@ export class Delete extends Entity {
|
|||
super(data);
|
||||
}
|
||||
|
||||
public get author(): Reference {
|
||||
return Reference.fromString(this.data.author);
|
||||
}
|
||||
|
||||
public get deleted(): Reference {
|
||||
return Reference.fromString(this.data.deleted);
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Promise<Delete> {
|
||||
return DeleteSchema.parseAsync(json).then((u) => new Delete(u));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue