mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
30 lines
575 B
TypeScript
30 lines
575 B
TypeScript
import {
|
|
BaseEntity,
|
|
Column,
|
|
Entity,
|
|
JoinTable,
|
|
ManyToMany,
|
|
PrimaryGeneratedColumn,
|
|
} from "typeorm";
|
|
import { APActivity } from "activitypub-types";
|
|
import { RawObject } from "./RawObject";
|
|
|
|
/**
|
|
* Stores an ActivityPub activity as raw JSON-LD data
|
|
*/
|
|
@Entity({
|
|
name: "activities",
|
|
})
|
|
export class RawActivity extends BaseEntity {
|
|
@PrimaryGeneratedColumn("uuid")
|
|
id!: string;
|
|
|
|
@Column("jsonb")
|
|
data!: APActivity;
|
|
|
|
// Any associated objects (there is typically only one)
|
|
@ManyToMany(() => RawObject, object => object.id)
|
|
@JoinTable()
|
|
objects!: RawObject[];
|
|
}
|