mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-25 13:23:08 +02:00
29 lines
602 B
TypeScript
29 lines
602 B
TypeScript
import create from './create';
|
|
import performDeleteActivity from './delete';
|
|
import follow from './follow';
|
|
import undo from './undo';
|
|
import { IObject } from '../type';
|
|
|
|
export default async (actor, activity: IObject): Promise<void> => {
|
|
switch (activity.type) {
|
|
case 'Create':
|
|
await create(actor, activity);
|
|
break;
|
|
|
|
case 'Delete':
|
|
await performDeleteActivity(actor, activity);
|
|
break;
|
|
|
|
case 'Follow':
|
|
await follow(actor, activity);
|
|
break;
|
|
|
|
case 'Undo':
|
|
await undo(actor, activity);
|
|
break;
|
|
|
|
default:
|
|
console.warn(`unknown activity type: ${activity.type}`);
|
|
return null;
|
|
}
|
|
};
|