wip
This commit is contained in:
parent
c3fd848750
commit
fd8d9f322c
200 changed files with 1607 additions and 1607 deletions
|
|
@ -9,8 +9,8 @@ import { DI } from '@/di-symbols.js';
|
|||
import type { DriveFilesRepository, NotesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { DriveService } from '@/core/DriveService.js';
|
||||
import type { DriveFile } from '@/models/entities/DriveFile.js';
|
||||
import type { Note } from '@/models/entities/Note.js';
|
||||
import type { MiDriveFile } from '@/models/entities/DriveFile.js';
|
||||
import type { MiNote } from '@/models/entities/Note.js';
|
||||
import { EmailService } from '@/core/EmailService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { SearchService } from '@/core/SearchService.js';
|
||||
|
|
@ -53,7 +53,7 @@ export class DeleteAccountProcessorService {
|
|||
}
|
||||
|
||||
{ // Delete notes
|
||||
let cursor: Note['id'] | null = null;
|
||||
let cursor: MiNote['id'] | null = null;
|
||||
|
||||
while (true) {
|
||||
const notes = await this.notesRepository.find({
|
||||
|
|
@ -65,7 +65,7 @@ export class DeleteAccountProcessorService {
|
|||
order: {
|
||||
id: 1,
|
||||
},
|
||||
}) as Note[];
|
||||
}) as MiNote[];
|
||||
|
||||
if (notes.length === 0) {
|
||||
break;
|
||||
|
|
@ -84,7 +84,7 @@ export class DeleteAccountProcessorService {
|
|||
}
|
||||
|
||||
{ // Delete files
|
||||
let cursor: DriveFile['id'] | null = null;
|
||||
let cursor: MiDriveFile['id'] | null = null;
|
||||
|
||||
while (true) {
|
||||
const files = await this.driveFilesRepository.find({
|
||||
|
|
@ -96,7 +96,7 @@ export class DeleteAccountProcessorService {
|
|||
order: {
|
||||
id: 1,
|
||||
},
|
||||
}) as DriveFile[];
|
||||
}) as MiDriveFile[];
|
||||
|
||||
if (files.length === 0) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { ApRequestService } from '@/core/activitypub/ApRequestService.js';
|
|||
import { FederatedInstanceService } from '@/core/FederatedInstanceService.js';
|
||||
import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js';
|
||||
import { MemorySingleCache } from '@/misc/cache.js';
|
||||
import type { Instance } from '@/models/entities/Instance.js';
|
||||
import type { MiInstance } from '@/models/entities/Instance.js';
|
||||
import InstanceChart from '@/core/chart/charts/instance.js';
|
||||
import ApRequestChart from '@/core/chart/charts/ap-request.js';
|
||||
import FederationChart from '@/core/chart/charts/federation.js';
|
||||
|
|
@ -26,7 +26,7 @@ import type { DeliverJobData } from '../types.js';
|
|||
@Injectable()
|
||||
export class DeliverProcessorService {
|
||||
private logger: Logger;
|
||||
private suspendedHostsCache: MemorySingleCache<Instance[]>;
|
||||
private suspendedHostsCache: MemorySingleCache<MiInstance[]>;
|
||||
private latest: string | null;
|
||||
|
||||
constructor(
|
||||
|
|
@ -44,7 +44,7 @@ export class DeliverProcessorService {
|
|||
private queueLoggerService: QueueLoggerService,
|
||||
) {
|
||||
this.logger = this.queueLoggerService.logger.createSubLogger('deliver');
|
||||
this.suspendedHostsCache = new MemorySingleCache<Instance[]>(1000 * 60 * 60);
|
||||
this.suspendedHostsCache = new MemorySingleCache<MiInstance[]>(1000 * 60 * 60);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import type { NoteFavorite, NoteFavoritesRepository, PollsRepository, User, User
|
|||
import type Logger from '@/logger.js';
|
||||
import { DriveService } from '@/core/DriveService.js';
|
||||
import { createTemp } from '@/misc/create-temp.js';
|
||||
import type { Poll } from '@/models/entities/Poll.js';
|
||||
import type { Note } from '@/models/entities/Note.js';
|
||||
import type { MiPoll } from '@/models/entities/Poll.js';
|
||||
import type { MiNote } from '@/models/entities/Note.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||
import type * as Bull from 'bullmq';
|
||||
|
|
@ -85,7 +85,7 @@ export class ExportFavoritesProcessorService {
|
|||
id: 1,
|
||||
},
|
||||
relations: ['note', 'note.user'],
|
||||
}) as (NoteFavorite & { note: Note & { user: User } })[];
|
||||
}) as (NoteFavorite & { note: MiNote & { user: User } })[];
|
||||
|
||||
if (favorites.length === 0) {
|
||||
job.updateProgress(100);
|
||||
|
|
@ -95,7 +95,7 @@ export class ExportFavoritesProcessorService {
|
|||
cursor = favorites.at(-1)?.id ?? null;
|
||||
|
||||
for (const favorite of favorites) {
|
||||
let poll: Poll | undefined;
|
||||
let poll: MiPoll | undefined;
|
||||
if (favorite.note.hasPoll) {
|
||||
poll = await this.pollsRepository.findOneByOrFail({ noteId: favorite.note.id });
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ export class ExportFavoritesProcessorService {
|
|||
}
|
||||
}
|
||||
|
||||
function serialize(favorite: NoteFavorite & { note: Note & { user: User } }, poll: Poll | null = null): Record<string, unknown> {
|
||||
function serialize(favorite: NoteFavorite & { note: MiNote & { user: User } }, poll: MiPoll | null = null): Record<string, unknown> {
|
||||
return {
|
||||
id: favorite.id,
|
||||
createdAt: favorite.createdAt,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import type { UsersRepository, FollowingsRepository, MutingsRepository } from '@
|
|||
import type Logger from '@/logger.js';
|
||||
import { DriveService } from '@/core/DriveService.js';
|
||||
import { createTemp } from '@/misc/create-temp.js';
|
||||
import type { Following } from '@/models/entities/Following.js';
|
||||
import type { MiFollowing } from '@/models/entities/Following.js';
|
||||
import { UtilityService } from '@/core/UtilityService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||
|
|
@ -57,7 +57,7 @@ export class ExportFollowingProcessorService {
|
|||
try {
|
||||
const stream = fs.createWriteStream(path, { flags: 'a' });
|
||||
|
||||
let cursor: Following['id'] | null = null;
|
||||
let cursor: MiFollowing['id'] | null = null;
|
||||
|
||||
const mutings = job.data.excludeMuting ? await this.mutingsRepository.findBy({
|
||||
muterId: user.id,
|
||||
|
|
@ -74,7 +74,7 @@ export class ExportFollowingProcessorService {
|
|||
order: {
|
||||
id: 1,
|
||||
},
|
||||
}) as Following[];
|
||||
}) as MiFollowing[];
|
||||
|
||||
if (followings.length === 0) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import type { NotesRepository, PollsRepository, UsersRepository } from '@/models
|
|||
import type Logger from '@/logger.js';
|
||||
import { DriveService } from '@/core/DriveService.js';
|
||||
import { createTemp } from '@/misc/create-temp.js';
|
||||
import type { Poll } from '@/models/entities/Poll.js';
|
||||
import type { Note } from '@/models/entities/Note.js';
|
||||
import type { MiPoll } from '@/models/entities/Poll.js';
|
||||
import type { MiNote } from '@/models/entities/Note.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js';
|
||||
import { Packed } from '@/misc/json-schema.js';
|
||||
|
|
@ -76,7 +76,7 @@ export class ExportNotesProcessorService {
|
|||
await write('[');
|
||||
|
||||
let exportedNotesCount = 0;
|
||||
let cursor: Note['id'] | null = null;
|
||||
let cursor: MiNote['id'] | null = null;
|
||||
|
||||
while (true) {
|
||||
const notes = await this.notesRepository.find({
|
||||
|
|
@ -88,7 +88,7 @@ export class ExportNotesProcessorService {
|
|||
order: {
|
||||
id: 1,
|
||||
},
|
||||
}) as Note[];
|
||||
}) as MiNote[];
|
||||
|
||||
if (notes.length === 0) {
|
||||
job.updateProgress(100);
|
||||
|
|
@ -98,7 +98,7 @@ export class ExportNotesProcessorService {
|
|||
cursor = notes.at(-1)?.id ?? null;
|
||||
|
||||
for (const note of notes) {
|
||||
let poll: Poll | undefined;
|
||||
let poll: MiPoll | undefined;
|
||||
if (note.hasPoll) {
|
||||
poll = await this.pollsRepository.findOneByOrFail({ noteId: note.id });
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ export class ExportNotesProcessorService {
|
|||
}
|
||||
}
|
||||
|
||||
function serialize(note: Note, poll: Poll | null = null, files: Packed<'DriveFile'>[]): Record<string, unknown> {
|
||||
function serialize(note: MiNote, poll: MiPoll | null = null, files: Packed<'DriveFile'>[]): Record<string, unknown> {
|
||||
return {
|
||||
id: note.id,
|
||||
text: note.text,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import ApRequestChart from '@/core/chart/charts/ap-request.js';
|
|||
import FederationChart from '@/core/chart/charts/federation.js';
|
||||
import { getApId } from '@/core/activitypub/type.js';
|
||||
import type { RemoteUser } from '@/models/entities/User.js';
|
||||
import type { UserPublickey } from '@/models/entities/UserPublickey.js';
|
||||
import type { MiUserPublickey } from '@/models/entities/UserPublickey.js';
|
||||
import { ApDbResolverService } from '@/core/activitypub/ApDbResolverService.js';
|
||||
import { StatusError } from '@/misc/status-error.js';
|
||||
import { UtilityService } from '@/core/UtilityService.js';
|
||||
|
|
@ -75,7 +75,7 @@ export class InboxProcessorService {
|
|||
// HTTP-Signature keyIdを元にDBから取得
|
||||
let authUser: {
|
||||
user: RemoteUser;
|
||||
key: UserPublickey | null;
|
||||
key: MiUserPublickey | null;
|
||||
} | null = await this.apDbResolverService.getAuthUserFromKeyId(signature.keyId);
|
||||
|
||||
// keyIdでわからなければ、activity.actorを元にDBから取得 || activity.actorを元にリモートから取得
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
*/
|
||||
|
||||
import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
|
||||
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 { MiDriveFile } from '@/models/entities/DriveFile.js';
|
||||
import type { MiNote } from '@/models/entities/Note.js';
|
||||
import type { MiUser } from '@/models/entities/User.js';
|
||||
import type { MiWebhook } from '@/models/entities/Webhook.js';
|
||||
import type { IActivity } from '@/core/activitypub/type.js';
|
||||
import type httpSignature from '@peertube/http-signature';
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ export type DbUserDeleteJobData = {
|
|||
|
||||
export type DbUserImportJobData = {
|
||||
user: ThinUser;
|
||||
fileId: DriveFile['id'];
|
||||
fileId: MiDriveFile['id'];
|
||||
};
|
||||
|
||||
export type DBAntennaImportJobData = {
|
||||
|
|
@ -98,14 +98,14 @@ export type ObjectStorageFileJobData = {
|
|||
};
|
||||
|
||||
export type EndedPollNotificationJobData = {
|
||||
noteId: Note['id'];
|
||||
noteId: MiNote['id'];
|
||||
};
|
||||
|
||||
export type WebhookDeliverJobData = {
|
||||
type: string;
|
||||
content: unknown;
|
||||
webhookId: Webhook['id'];
|
||||
userId: User['id'];
|
||||
webhookId: MiWebhook['id'];
|
||||
userId: MiUser['id'];
|
||||
to: string;
|
||||
secret: string;
|
||||
createdAt: number;
|
||||
|
|
@ -113,5 +113,5 @@ export type WebhookDeliverJobData = {
|
|||
};
|
||||
|
||||
export type ThinUser = {
|
||||
id: User['id'];
|
||||
id: MiUser['id'];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue