2023-07-27 05:31:52 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-05-05 23:17:55 +00:00
|
|
|
import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
|
2023-09-20 02:33:36 +00:00
|
|
|
import type { MiDriveFile } from '@/models/DriveFile.js';
|
|
|
|
import type { MiNote } from '@/models/Note.js';
|
|
|
|
import type { MiUser } from '@/models/User.js';
|
|
|
|
import type { MiWebhook } from '@/models/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;
|
2023-10-17 11:56:17 +00:00
|
|
|
withReplies?: boolean;
|
2023-04-12 00:13:58 +00:00
|
|
|
}
|
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;
|
2023-11-07 02:31:47 +00:00
|
|
|
exportAccountData: DbJobDataWithUser;
|
2023-04-12 00:13:58 +00:00
|
|
|
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-11-12 14:16:27 +00:00
|
|
|
importNotes: DbNoteImportJobData;
|
2023-11-30 12:23:09 +00:00
|
|
|
importTweetsToDb: DbNoteWithParentImportToDbJobData;
|
2023-11-12 14:07:32 +00:00
|
|
|
importIGToDb: DbNoteImportToDbJobData;
|
2023-11-22 15:00:46 +00:00
|
|
|
importFBToDb: DbNoteImportToDbJobData;
|
2023-11-30 12:23:09 +00:00
|
|
|
importMastoToDb: DbNoteWithParentImportToDbJobData;
|
2023-11-12 14:07:32 +00:00
|
|
|
importPleroToDb: DbNoteImportToDbJobData;
|
2023-11-30 12:23:09 +00:00
|
|
|
importKeyNotesToDb: DbNoteWithParentImportToDbJobData;
|
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;
|
2023-08-16 08:51:28 +00:00
|
|
|
fileId: MiDriveFile['id'];
|
2023-10-17 11:56:17 +00:00
|
|
|
withReplies?: boolean;
|
2021-05-08 09:56:21 +00:00
|
|
|
};
|
|
|
|
|
2023-11-12 14:07:32 +00:00
|
|
|
export type DbNoteImportJobData = {
|
|
|
|
user: ThinUser;
|
|
|
|
fileId: MiDriveFile['id'];
|
|
|
|
type?: string;
|
|
|
|
};
|
|
|
|
|
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;
|
2023-10-17 11:56:17 +00:00
|
|
|
withReplies?: boolean;
|
2023-04-12 00:13:58 +00:00
|
|
|
};
|
|
|
|
|
2023-11-12 14:07:32 +00:00
|
|
|
export type DbNoteImportToDbJobData = {
|
|
|
|
user: ThinUser;
|
|
|
|
target: any;
|
2023-11-13 12:07:49 +00:00
|
|
|
};
|
|
|
|
|
2023-11-30 12:23:09 +00:00
|
|
|
export type DbNoteWithParentImportToDbJobData = {
|
2023-11-13 12:07:49 +00:00
|
|
|
user: ThinUser;
|
|
|
|
target: any;
|
|
|
|
note: MiNote['id'] | null;
|
2023-11-12 14:07:32 +00:00
|
|
|
};
|
|
|
|
|
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 = {
|
2023-08-16 08:51:28 +00:00
|
|
|
noteId: MiNote['id'];
|
2022-03-06 07:06:27 +00:00
|
|
|
};
|
|
|
|
|
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;
|
2023-08-16 08:51:28 +00:00
|
|
|
webhookId: MiWebhook['id'];
|
|
|
|
userId: MiUser['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 = {
|
2023-08-16 08:51:28 +00:00
|
|
|
id: MiUser['id'];
|
2021-05-08 09:56:21 +00:00
|
|
|
};
|