feat(federation): Add patch to inbox handler

This commit is contained in:
Jesse Wierzbinski 2024-06-05 21:03:09 -10:00
parent 3ed54a7c21
commit 69be6967bd
No known key found for this signature in database

View file

@ -21,6 +21,7 @@ type ParserCallbacks<T> = {
extension: ( extension: (
extension: typeof EntityValidator.$Extension, extension: typeof EntityValidator.$Extension,
) => MaybePromise<T>; ) => MaybePromise<T>;
patch: (patch: typeof EntityValidator.$Patch) => MaybePromise<T>;
}; };
/** /**
@ -78,6 +79,13 @@ export class RequestParserHandler {
break; break;
} }
case "Patch": {
const patch = await this.validator.Patch(this.body);
if (callbacks.patch) return await callbacks.patch(patch);
break;
}
case "Follow": { case "Follow": {
const follow = await this.validator.Follow(this.body); const follow = await this.validator.Follow(this.body);