egirlskey/packages/backend/src/queue/types.ts

64 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-09-17 18:27:08 +00:00
import type { DriveFile } from '@/models/entities/DriveFile.js';
import type { Note } from '@/models/entities/Note.js';
import type { User } from '@/models/entities/User.js';
import type { Webhook } from '@/models/entities/Webhook.js';
import type { IActivity } from '@/core/remote/activitypub/type.js';
import type httpSignature from '@peertube/http-signature';
2021-05-08 09:56:21 +00:00
export type DeliverJobData = {
/** Actor */
user: ThinUser;
/** Activity */
content: unknown;
/** inbox URL to deliver */
to: string;
};
export type InboxJobData = {
activity: IActivity;
signature: httpSignature.IParsedSignature;
};
export type DbJobData = DbUserJobData | DbUserImportJobData | DbUserDeleteJobData;
2021-05-08 09:56:21 +00:00
export type DbUserJobData = {
user: ThinUser;
2021-12-09 16:22:35 +00:00
excludeMuting: boolean;
excludeInactive: boolean;
2021-05-08 09:56:21 +00:00
};
export type DbUserDeleteJobData = {
user: ThinUser;
soft?: boolean;
};
2021-05-08 09:56:21 +00:00
export type DbUserImportJobData = {
user: ThinUser;
fileId: DriveFile['id'];
};
2021-11-12 01:52:10 +00:00
export type ObjectStorageJobData = ObjectStorageFileJobData | Record<string, unknown>;
2021-05-08 09:56:21 +00:00
export type ObjectStorageFileJobData = {
key: string;
};
export type EndedPollNotificationJobData = {
noteId: Note['id'];
};
export type WebhookDeliverJobData = {
2022-04-03 13:36:30 +00:00
type: string;
content: unknown;
webhookId: Webhook['id'];
userId: User['id'];
to: string;
secret: string;
2022-04-03 13:36:30 +00:00
createdAt: number;
eventId: string;
};
2021-05-08 09:56:21 +00:00
export type ThinUser = {
id: User['id'];
};