2023-05-05 23:17:55 +00:00
|
|
|
import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
|
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';
|
2022-12-04 01:16:03 +00:00
|
|
|
import type { IActivity } from '@/core/activitypub/type.js';
|
2022-09-17 18:27:08 +00:00
|
|
|
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;
|
2023-03-14 10:11:31 +00:00
|
|
|
/** whether it is sharedInbox */
|
|
|
|
isSharedInbox: boolean;
|
2021-05-08 09:56:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export type InboxJobData = {
|
|
|
|
activity: IActivity;
|
|
|
|
signature: httpSignature.IParsedSignature;
|
|
|
|
};
|
|
|
|
|
2023-04-12 00:13:58 +00:00
|
|
|
export type RelationshipJobData = {
|
|
|
|
from: ThinUser;
|
|
|
|
to: ThinUser;
|
|
|
|
silent?: boolean;
|
|
|
|
requestId?: string;
|
|
|
|
}
|
2021-05-08 09:56:21 +00:00
|
|
|
|
2023-04-12 00:13:58 +00:00
|
|
|
export type DbJobData<T extends keyof DbJobMap> = DbJobMap[T];
|
|
|
|
|
|
|
|
export type DbJobMap = {
|
|
|
|
deleteDriveFiles: DbJobDataWithUser;
|
|
|
|
exportCustomEmojis: DbJobDataWithUser;
|
2023-05-05 23:17:55 +00:00
|
|
|
exportAntennas: DBExportAntennasData;
|
2023-04-12 00:13:58 +00:00
|
|
|
exportNotes: DbJobDataWithUser;
|
|
|
|
exportFavorites: DbJobDataWithUser;
|
|
|
|
exportFollowing: DbExportFollowingData;
|
|
|
|
exportMuting: DbJobDataWithUser;
|
|
|
|
exportBlocking: DbJobDataWithUser;
|
|
|
|
exportUserLists: DbJobDataWithUser;
|
2023-05-05 23:17:55 +00:00
|
|
|
importAntennas: DBAntennaImportJobData;
|
2023-04-12 00:13:58 +00:00
|
|
|
importFollowing: DbUserImportJobData;
|
|
|
|
importFollowingToDb: DbUserImportToDbJobData;
|
|
|
|
importMuting: DbUserImportJobData;
|
|
|
|
importBlocking: DbUserImportJobData;
|
|
|
|
importBlockingToDb: DbUserImportToDbJobData;
|
|
|
|
importUserLists: DbUserImportJobData;
|
|
|
|
importCustomEmojis: DbUserImportJobData;
|
|
|
|
deleteAccount: DbUserDeleteJobData;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type DbJobDataWithUser = {
|
|
|
|
user: ThinUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type DbExportFollowingData = {
|
2021-05-08 09:56:21 +00:00
|
|
|
user: ThinUser;
|
2021-12-09 16:22:35 +00:00
|
|
|
excludeMuting: boolean;
|
|
|
|
excludeInactive: boolean;
|
2021-05-08 09:56:21 +00:00
|
|
|
};
|
|
|
|
|
2023-05-05 23:17:55 +00:00
|
|
|
export type DBExportAntennasData = {
|
|
|
|
user: ThinUser
|
|
|
|
}
|
|
|
|
|
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'];
|
|
|
|
};
|
|
|
|
|
2023-05-05 23:17:55 +00:00
|
|
|
export type DBAntennaImportJobData = {
|
|
|
|
user: ThinUser,
|
|
|
|
antenna: Antenna
|
|
|
|
}
|
|
|
|
|
2023-04-12 00:13:58 +00:00
|
|
|
export type DbUserImportToDbJobData = {
|
|
|
|
user: ThinUser;
|
|
|
|
target: string;
|
|
|
|
};
|
|
|
|
|
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'];
|
|
|
|
};
|