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

47 lines
989 B
TypeScript
Raw Normal View History

import { DriveFile } from '@/models/entities/drive-file';
import { User } from '@/models/entities/user';
import { IActivity } from '@/remote/activitypub/type';
2021-05-08 09:56:21 +00:00
import * as httpSignature from 'http-signature';
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 ThinUser = {
id: User['id'];
};