Add public timeline

This commit is contained in:
Jesse Wierzbinski 2023-10-01 14:07:29 -10:00
parent bff170d2e2
commit b7587f8d3f
9 changed files with 158 additions and 7 deletions

View file

@ -1,11 +1,19 @@
/* eslint-disable @typescript-eslint/require-await */
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import {
BaseEntity,
Column,
Entity,
JoinTable,
ManyToMany,
PrimaryGeneratedColumn,
} from "typeorm";
import { APActor, APImage, APOrderedCollectionPage } from "activitypub-types";
import { getConfig, getHost } from "@config";
import { appendFile } from "fs/promises";
import { errorResponse } from "@response";
import { APIAccount } from "~types/entities/account";
import { RawActivity } from "./RawActivity";
import { RawObject } from "./RawObject";
/**
* Represents a raw actor entity in the database.
@ -30,6 +38,13 @@ export class RawActor extends BaseEntity {
@Column("jsonb", { default: [] })
followers!: string[];
/**
* The list of featured objects associated with the actor.
*/
@ManyToMany(() => RawObject, { nullable: true })
@JoinTable()
featured!: RawObject[];
/**
* Retrieves a RawActor entity by actor ID.
* @param id The ID of the actor to retrieve.