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;
|
|
|
|
};
|
|
|
|
|
2021-09-22 08:34:48 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-09-22 08:34:48 +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;
|
|
|
|
};
|
|
|
|
|
2022-03-06 07:06:27 +00:00
|
|
|
export type EndedPollNotificationJobData = {
|
|
|
|
noteId: Note['id'];
|
|
|
|
};
|
|
|
|
|
2022-04-02 06:28:49 +00:00
|
|
|
export type WebhookDeliverJobData = {
|
2022-04-03 13:36:30 +00:00
|
|
|
type: string;
|
2022-04-02 06:28:49 +00:00
|
|
|
content: unknown;
|
|
|
|
webhookId: Webhook['id'];
|
2022-04-03 13:42:01 +00:00
|
|
|
userId: User['id'];
|
2022-04-02 06:28:49 +00:00
|
|
|
to: string;
|
|
|
|
secret: string;
|
2022-04-03 13:36:30 +00:00
|
|
|
createdAt: number;
|
|
|
|
eventId: string;
|
2022-04-02 06:28:49 +00:00
|
|
|
};
|
|
|
|
|
2021-05-08 09:56:21 +00:00
|
|
|
export type ThinUser = {
|
|
|
|
id: User['id'];
|
|
|
|
};
|