wip
This commit is contained in:
parent
24af7cccdc
commit
36c7c6355f
|
@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { ModuleRef } from '@nestjs/core';
|
import { ModuleRef } from '@nestjs/core';
|
||||||
import { In } from 'typeorm';
|
import { In } from 'typeorm';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { AccessTokensRepository, FollowRequestsRepository, NotesRepository, User, UsersRepository } from '@/models/index.js';
|
import type { AccessTokensRepository, FollowRequestsRepository, NotesRepository, MiUser, UsersRepository } from '@/models/index.js';
|
||||||
import { awaitAll } from '@/misc/prelude/await-all.js';
|
import { awaitAll } from '@/misc/prelude/await-all.js';
|
||||||
import type { MiNotification } from '@/models/entities/Notification.js';
|
import type { MiNotification } from '@/models/entities/Notification.js';
|
||||||
import type { MiNote } from '@/models/entities/Note.js';
|
import type { MiNote } from '@/models/entities/Note.js';
|
||||||
|
@ -58,14 +58,14 @@ export class NotificationEntityService implements OnModuleInit {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async pack(
|
public async pack(
|
||||||
src: MiNotification,
|
src: MiNotification,
|
||||||
meId: User['id'],
|
meId: MiUser['id'],
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
options: {
|
options: {
|
||||||
|
|
||||||
},
|
},
|
||||||
hint?: {
|
hint?: {
|
||||||
packedNotes: Map<MiNote['id'], Packed<'Note'>>;
|
packedNotes: Map<MiNote['id'], Packed<'Note'>>;
|
||||||
packedUsers: Map<User['id'], Packed<'User'>>;
|
packedUsers: Map<MiUser['id'], Packed<'User'>>;
|
||||||
},
|
},
|
||||||
): Promise<Packed<'Notification'>> {
|
): Promise<Packed<'Notification'>> {
|
||||||
const notification = src;
|
const notification = src;
|
||||||
|
@ -109,7 +109,7 @@ export class NotificationEntityService implements OnModuleInit {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async packMany(
|
public async packMany(
|
||||||
notifications: MiNotification[],
|
notifications: MiNotification[],
|
||||||
meId: User['id'],
|
meId: MiUser['id'],
|
||||||
) {
|
) {
|
||||||
if (notifications.length === 0) return [];
|
if (notifications.length === 0) return [];
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { awaitAll } from '@/misc/prelude/await-all.js';
|
||||||
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js';
|
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js';
|
||||||
import type { MiLocalUser, MiPartialLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/entities/User.js';
|
import type { MiLocalUser, MiPartialLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/entities/User.js';
|
||||||
import { birthdaySchema, descriptionSchema, localUsernameSchema, locationSchema, nameSchema, passwordSchema } from '@/models/entities/User.js';
|
import { birthdaySchema, descriptionSchema, localUsernameSchema, locationSchema, nameSchema, passwordSchema } from '@/models/entities/User.js';
|
||||||
import type { UsersRepository, UserSecurityKeysRepository, FollowingsRepository, FollowRequestsRepository, BlockingsRepository, MutingsRepository, DriveFilesRepository, NoteUnreadsRepository, UserNotePiningsRepository, UserProfilesRepository, AnnouncementReadsRepository, AnnouncementsRepository, UserProfile, RenoteMutingsRepository, UserMemoRepository, Announcement } from '@/models/index.js';
|
import type { UsersRepository, UserSecurityKeysRepository, FollowingsRepository, FollowRequestsRepository, BlockingsRepository, MutingsRepository, DriveFilesRepository, NoteUnreadsRepository, UserNotePiningsRepository, UserProfilesRepository, AnnouncementReadsRepository, AnnouncementsRepository, MiUserProfile, RenoteMutingsRepository, UserMemoRepository } from '@/models/index.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { RoleService } from '@/core/RoleService.js';
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
||||||
|
@ -281,7 +281,7 @@ export class UserEntityService implements OnModuleInit {
|
||||||
options?: {
|
options?: {
|
||||||
detail?: D,
|
detail?: D,
|
||||||
includeSecrets?: boolean,
|
includeSecrets?: boolean,
|
||||||
userProfile?: UserProfile,
|
userProfile?: MiUserProfile,
|
||||||
},
|
},
|
||||||
): Promise<IsMeAndIsUserDetailed<ExpectsMe, D>> {
|
): Promise<IsMeAndIsUserDetailed<ExpectsMe, D>> {
|
||||||
const opts = Object.assign({
|
const opts = Object.assign({
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { IsNull, MoreThan, Not } from 'typeorm';
|
import { IsNull, MoreThan, Not } from 'typeorm';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { DriveFile, DriveFilesRepository } from '@/models/index.js';
|
import type { MiDriveFile, DriveFilesRepository } from '@/models/index.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { DriveService } from '@/core/DriveService.js';
|
import { DriveService } from '@/core/DriveService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
@ -32,7 +32,7 @@ export class CleanRemoteFilesProcessorService {
|
||||||
this.logger.info('Deleting cached remote files...');
|
this.logger.info('Deleting cached remote files...');
|
||||||
|
|
||||||
let deletedCount = 0;
|
let deletedCount = 0;
|
||||||
let cursor: DriveFile['id'] | null = null;
|
let cursor: MiDriveFile['id'] | null = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const files = await this.driveFilesRepository.find({
|
const files = await this.driveFilesRepository.find({
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { MoreThan } from 'typeorm';
|
import { MoreThan } from 'typeorm';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { UsersRepository, DriveFilesRepository, DriveFile } from '@/models/index.js';
|
import type { UsersRepository, DriveFilesRepository, MiDriveFile } from '@/models/index.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { DriveService } from '@/core/DriveService.js';
|
import { DriveService } from '@/core/DriveService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
@ -41,7 +41,7 @@ export class DeleteDriveFilesProcessorService {
|
||||||
}
|
}
|
||||||
|
|
||||||
let deletedCount = 0;
|
let deletedCount = 0;
|
||||||
let cursor: DriveFile['id'] | null = null;
|
let cursor: MiDriveFile['id'] | null = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const files = await this.driveFilesRepository.find({
|
const files = await this.driveFilesRepository.find({
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { format as DateFormat } from 'date-fns';
|
import { format as DateFormat } from 'date-fns';
|
||||||
import { In } from 'typeorm';
|
import { In } from 'typeorm';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { AntennasRepository, UsersRepository, UserListJoiningsRepository, User } from '@/models/index.js';
|
import type { AntennasRepository, UsersRepository, UserListJoiningsRepository, MiUser } from '@/models/index.js';
|
||||||
import Logger from '@/logger.js';
|
import Logger from '@/logger.js';
|
||||||
import { DriveService } from '@/core/DriveService.js';
|
import { DriveService } from '@/core/DriveService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
@ -63,7 +63,7 @@ export class ExportAntennasProcessorService {
|
||||||
const antennas = await this.antennsRepository.findBy({ userId: job.data.user.id });
|
const antennas = await this.antennsRepository.findBy({ userId: job.data.user.id });
|
||||||
write('[');
|
write('[');
|
||||||
for (const [index, antenna] of antennas.entries()) {
|
for (const [index, antenna] of antennas.entries()) {
|
||||||
let users: User[] | undefined;
|
let users: MiUser[] | undefined;
|
||||||
if (antenna.userListId !== null) {
|
if (antenna.userListId !== null) {
|
||||||
const joinings = await this.userListJoiningsRepository.findBy({ userListId: antenna.userListId });
|
const joinings = await this.userListJoiningsRepository.findBy({ userListId: antenna.userListId });
|
||||||
users = await this.usersRepository.findBy({
|
users = await this.usersRepository.findBy({
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { MoreThan } from 'typeorm';
|
import { MoreThan } from 'typeorm';
|
||||||
import { format as dateFormat } from 'date-fns';
|
import { format as dateFormat } from 'date-fns';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { UsersRepository, BlockingsRepository, Blocking } from '@/models/index.js';
|
import type { UsersRepository, BlockingsRepository, MiBlocking } from '@/models/index.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { DriveService } from '@/core/DriveService.js';
|
import { DriveService } from '@/core/DriveService.js';
|
||||||
import { createTemp } from '@/misc/create-temp.js';
|
import { createTemp } from '@/misc/create-temp.js';
|
||||||
|
@ -54,7 +54,7 @@ export class ExportBlockingProcessorService {
|
||||||
const stream = fs.createWriteStream(path, { flags: 'a' });
|
const stream = fs.createWriteStream(path, { flags: 'a' });
|
||||||
|
|
||||||
let exportedCount = 0;
|
let exportedCount = 0;
|
||||||
let cursor: Blocking['id'] | null = null;
|
let cursor: MiBlocking['id'] | null = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const blockings = await this.blockingsRepository.find({
|
const blockings = await this.blockingsRepository.find({
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { MoreThan } from 'typeorm';
|
import { MoreThan } from 'typeorm';
|
||||||
import { format as dateFormat } from 'date-fns';
|
import { format as dateFormat } from 'date-fns';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { NoteFavorite, NoteFavoritesRepository, PollsRepository, User, UsersRepository } from '@/models/index.js';
|
import type { MiNoteFavorite, NoteFavoritesRepository, PollsRepository, MiUser, UsersRepository } from '@/models/index.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { DriveService } from '@/core/DriveService.js';
|
import { DriveService } from '@/core/DriveService.js';
|
||||||
import { createTemp } from '@/misc/create-temp.js';
|
import { createTemp } from '@/misc/create-temp.js';
|
||||||
|
@ -72,7 +72,7 @@ export class ExportFavoritesProcessorService {
|
||||||
await write('[');
|
await write('[');
|
||||||
|
|
||||||
let exportedFavoritesCount = 0;
|
let exportedFavoritesCount = 0;
|
||||||
let cursor: NoteFavorite['id'] | null = null;
|
let cursor: MiNoteFavorite['id'] | null = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const favorites = await this.noteFavoritesRepository.find({
|
const favorites = await this.noteFavoritesRepository.find({
|
||||||
|
@ -85,7 +85,7 @@ export class ExportFavoritesProcessorService {
|
||||||
id: 1,
|
id: 1,
|
||||||
},
|
},
|
||||||
relations: ['note', 'note.user'],
|
relations: ['note', 'note.user'],
|
||||||
}) as (NoteFavorite & { note: MiNote & { user: User } })[];
|
}) as (MiNoteFavorite & { note: MiNote & { user: MiUser } })[];
|
||||||
|
|
||||||
if (favorites.length === 0) {
|
if (favorites.length === 0) {
|
||||||
job.updateProgress(100);
|
job.updateProgress(100);
|
||||||
|
@ -127,7 +127,7 @@ export class ExportFavoritesProcessorService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function serialize(favorite: NoteFavorite & { note: MiNote & { user: User } }, poll: MiPoll | null = null): Record<string, unknown> {
|
function serialize(favorite: MiNoteFavorite & { note: MiNote & { user: MiUser } }, poll: MiPoll | null = null): Record<string, unknown> {
|
||||||
return {
|
return {
|
||||||
id: favorite.id,
|
id: favorite.id,
|
||||||
createdAt: favorite.createdAt,
|
createdAt: favorite.createdAt,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { IsNull, MoreThan } from 'typeorm';
|
import { IsNull, MoreThan } from 'typeorm';
|
||||||
import { format as dateFormat } from 'date-fns';
|
import { format as dateFormat } from 'date-fns';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { MutingsRepository, UsersRepository, Muting } from '@/models/index.js';
|
import type { MutingsRepository, UsersRepository, MiMuting } from '@/models/index.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { DriveService } from '@/core/DriveService.js';
|
import { DriveService } from '@/core/DriveService.js';
|
||||||
import { createTemp } from '@/misc/create-temp.js';
|
import { createTemp } from '@/misc/create-temp.js';
|
||||||
|
@ -54,7 +54,7 @@ export class ExportMutingProcessorService {
|
||||||
const stream = fs.createWriteStream(path, { flags: 'a' });
|
const stream = fs.createWriteStream(path, { flags: 'a' });
|
||||||
|
|
||||||
let exportedCount = 0;
|
let exportedCount = 0;
|
||||||
let cursor: Muting['id'] | null = null;
|
let cursor: MiMuting['id'] | null = null;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const mutes = await this.mutingsRepository.find({
|
const mutes = await this.mutingsRepository.find({
|
||||||
|
|
|
@ -11,7 +11,7 @@ import rename from 'rename';
|
||||||
import sharp from 'sharp';
|
import sharp from 'sharp';
|
||||||
import { sharpBmp } from 'sharp-read-bmp';
|
import { sharpBmp } from 'sharp-read-bmp';
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import type { DriveFile, DriveFilesRepository } from '@/models/index.js';
|
import type { MiDriveFile, DriveFilesRepository } from '@/models/index.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { createTemp } from '@/misc/create-temp.js';
|
import { createTemp } from '@/misc/create-temp.js';
|
||||||
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
|
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
|
||||||
|
@ -372,8 +372,8 @@ export class FileServerService {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async getStreamAndTypeFromUrl(url: string): Promise<
|
private async getStreamAndTypeFromUrl(url: string): Promise<
|
||||||
{ state: 'remote'; fileRole?: 'thumbnail' | 'webpublic' | 'original'; file?: DriveFile; mime: string; ext: string | null; path: string; cleanup: () => void; filename: string; }
|
{ state: 'remote'; fileRole?: 'thumbnail' | 'webpublic' | 'original'; file?: MiDriveFile; mime: string; ext: string | null; path: string; cleanup: () => void; filename: string; }
|
||||||
| { state: 'stored_internal'; fileRole: 'thumbnail' | 'webpublic' | 'original'; file: DriveFile; filename: string; mime: string; ext: string | null; path: string; }
|
| { state: 'stored_internal'; fileRole: 'thumbnail' | 'webpublic' | 'original'; file: MiDriveFile; filename: string; mime: string; ext: string | null; path: string; }
|
||||||
| '404'
|
| '404'
|
||||||
| '204'
|
| '204'
|
||||||
> {
|
> {
|
||||||
|
@ -411,8 +411,8 @@ export class FileServerService {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async getFileFromKey(key: string): Promise<
|
private async getFileFromKey(key: string): Promise<
|
||||||
{ state: 'remote'; fileRole: 'thumbnail' | 'webpublic' | 'original'; file: DriveFile; filename: string; url: string; mime: string; ext: string | null; path: string; cleanup: () => void; }
|
{ state: 'remote'; fileRole: 'thumbnail' | 'webpublic' | 'original'; file: MiDriveFile; filename: string; url: string; mime: string; ext: string | null; path: string; cleanup: () => void; }
|
||||||
| { state: 'stored_internal'; fileRole: 'thumbnail' | 'webpublic' | 'original'; file: DriveFile; filename: string; mime: string; ext: string | null; path: string; }
|
| { state: 'stored_internal'; fileRole: 'thumbnail' | 'webpublic' | 'original'; file: MiDriveFile; filename: string; mime: string; ext: string | null; path: string; }
|
||||||
| '404'
|
| '404'
|
||||||
| '204'
|
| '204'
|
||||||
> {
|
> {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import bcrypt from 'bcryptjs';
|
import bcrypt from 'bcryptjs';
|
||||||
import { IsNull } from 'typeorm';
|
import { IsNull } from 'typeorm';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { RegistrationTicketsRepository, UsedUsernamesRepository, UserPendingsRepository, UserProfilesRepository, UsersRepository, RegistrationTicket } from '@/models/index.js';
|
import type { RegistrationTicketsRepository, UsedUsernamesRepository, UserPendingsRepository, UserProfilesRepository, UsersRepository, MiRegistrationTicket } from '@/models/index.js';
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
import { CaptchaService } from '@/core/CaptchaService.js';
|
import { CaptchaService } from '@/core/CaptchaService.js';
|
||||||
|
@ -114,7 +114,7 @@ export class SignupApiService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let ticket: RegistrationTicket | null = null;
|
let ticket: MiRegistrationTicket | null = null;
|
||||||
|
|
||||||
if (instance.disableRegistration) {
|
if (instance.disableRegistration) {
|
||||||
if (invitationCode == null || typeof invitationCode !== 'string') {
|
if (invitationCode == null || typeof invitationCode !== 'string') {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import * as Redis from 'ioredis';
|
import * as Redis from 'ioredis';
|
||||||
import * as WebSocket from 'ws';
|
import * as WebSocket from 'ws';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { UsersRepository, AccessToken } from '@/models/index.js';
|
import type { UsersRepository, MiAccessToken } from '@/models/index.js';
|
||||||
import { NoteReadService } from '@/core/NoteReadService.js';
|
import { NoteReadService } from '@/core/NoteReadService.js';
|
||||||
import { NotificationService } from '@/core/NotificationService.js';
|
import { NotificationService } from '@/core/NotificationService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
@ -56,7 +56,7 @@ export class StreamingApiServerService {
|
||||||
const q = new URL(request.url, `http://${request.headers.host}`).searchParams;
|
const q = new URL(request.url, `http://${request.headers.host}`).searchParams;
|
||||||
|
|
||||||
let user: MiLocalUser | null = null;
|
let user: MiLocalUser | null = null;
|
||||||
let app: AccessToken | null = null;
|
let app: MiAccessToken | null = null;
|
||||||
|
|
||||||
// https://datatracker.ietf.org/doc/html/rfc6750.html#section-2.1
|
// https://datatracker.ietf.org/doc/html/rfc6750.html#section-2.1
|
||||||
// Note that the standard WHATWG WebSocket API does not support setting any headers,
|
// Note that the standard WHATWG WebSocket API does not support setting any headers,
|
||||||
|
@ -113,7 +113,7 @@ export class StreamingApiServerService {
|
||||||
this.#wss.on('connection', async (connection: WebSocket.WebSocket, request: http.IncomingMessage, ctx: {
|
this.#wss.on('connection', async (connection: WebSocket.WebSocket, request: http.IncomingMessage, ctx: {
|
||||||
stream: MainStreamConnection,
|
stream: MainStreamConnection,
|
||||||
user: MiLocalUser | null;
|
user: MiLocalUser | null;
|
||||||
app: AccessToken | null
|
app: MiAccessToken | null
|
||||||
}) => {
|
}) => {
|
||||||
const { stream, user, app } = ctx;
|
const { stream, user, app } = ctx;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import * as Redis from 'ioredis';
|
import * as Redis from 'ioredis';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { ChannelsRepository, Note, NotesRepository } from '@/models/index.js';
|
import type { ChannelsRepository, MiNote, NotesRepository } from '@/models/index.js';
|
||||||
import { QueryService } from '@/core/QueryService.js';
|
import { QueryService } from '@/core/QueryService.js';
|
||||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||||
import ActiveUsersChart from '@/core/chart/charts/active-users.js';
|
import ActiveUsersChart from '@/core/chart/charts/active-users.js';
|
||||||
|
@ -78,7 +78,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
throw new ApiError(meta.errors.noSuchChannel);
|
throw new ApiError(meta.errors.noSuchChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
let timeline: Note[] = [];
|
let timeline: MiNote[] = [];
|
||||||
|
|
||||||
const limit = ps.limit + (ps.untilId ? 1 : 0); // untilIdに指定したものも含まれるため+1
|
const limit = ps.limit + (ps.untilId ? 1 : 0); // untilIdに指定したものも含まれるため+1
|
||||||
let noteIdsRes: [string, string[]][] = [];
|
let noteIdsRes: [string, string[]][] = [];
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
import { QueueService } from '@/core/QueueService.js';
|
||||||
import type { AntennasRepository, DriveFilesRepository, UsersRepository, Antenna as _Antenna } from '@/models/index.js';
|
import type { AntennasRepository, DriveFilesRepository, UsersRepository, MiAntenna as _Antenna } from '@/models/index.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { RoleService } from '@/core/RoleService.js';
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { DownloadService } from '@/core/DownloadService.js';
|
import { DownloadService } from '@/core/DownloadService.js';
|
||||||
|
|
|
@ -11,7 +11,7 @@ import type { NoteReadService } from '@/core/NoteReadService.js';
|
||||||
import type { NotificationService } from '@/core/NotificationService.js';
|
import type { NotificationService } from '@/core/NotificationService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { CacheService } from '@/core/CacheService.js';
|
import { CacheService } from '@/core/CacheService.js';
|
||||||
import { UserProfile } from '@/models/index.js';
|
import { MiUserProfile } from '@/models/index.js';
|
||||||
import type { ChannelsService } from './ChannelsService.js';
|
import type { ChannelsService } from './ChannelsService.js';
|
||||||
import type { EventEmitter } from 'events';
|
import type { EventEmitter } from 'events';
|
||||||
import type Channel from './channel.js';
|
import type Channel from './channel.js';
|
||||||
|
@ -28,7 +28,7 @@ export default class Connection {
|
||||||
private channels: Channel[] = [];
|
private channels: Channel[] = [];
|
||||||
private subscribingNotes: any = {};
|
private subscribingNotes: any = {};
|
||||||
private cachedNotes: Packed<'Note'>[] = [];
|
private cachedNotes: Packed<'Note'>[] = [];
|
||||||
public userProfile: UserProfile | null = null;
|
public userProfile: MiUserProfile | null = null;
|
||||||
public following: Set<string> = new Set();
|
public following: Set<string> = new Set();
|
||||||
public followingChannels: Set<string> = new Set();
|
public followingChannels: Set<string> = new Set();
|
||||||
public userIdsWhoMeMuting: Set<string> = new Set();
|
public userIdsWhoMeMuting: Set<string> = new Set();
|
||||||
|
|
|
@ -17,7 +17,7 @@ import type { MiPage } from '@/models/entities/Page.js';
|
||||||
import type { Packed } from '@/misc/json-schema.js';
|
import type { Packed } from '@/misc/json-schema.js';
|
||||||
import type { MiWebhook } from '@/models/entities/Webhook.js';
|
import type { MiWebhook } from '@/models/entities/Webhook.js';
|
||||||
import type { MiMeta } from '@/models/entities/Meta.js';
|
import type { MiMeta } from '@/models/entities/Meta.js';
|
||||||
import { Role, RoleAssignment } from '@/models/index.js';
|
import { MiRole, MiRoleAssignment } from '@/models/index.js';
|
||||||
import type Emitter from 'strict-event-emitter-types';
|
import type Emitter from 'strict-event-emitter-types';
|
||||||
import type { EventEmitter } from 'events';
|
import type { EventEmitter } from 'events';
|
||||||
|
|
||||||
|
@ -30,12 +30,12 @@ export interface InternalStreamTypes {
|
||||||
unfollow: { followerId: MiUser['id']; followeeId: MiUser['id']; };
|
unfollow: { followerId: MiUser['id']; followeeId: MiUser['id']; };
|
||||||
blockingCreated: { blockerId: MiUser['id']; blockeeId: MiUser['id']; };
|
blockingCreated: { blockerId: MiUser['id']; blockeeId: MiUser['id']; };
|
||||||
blockingDeleted: { blockerId: MiUser['id']; blockeeId: MiUser['id']; };
|
blockingDeleted: { blockerId: MiUser['id']; blockeeId: MiUser['id']; };
|
||||||
policiesUpdated: Role['policies'];
|
policiesUpdated: MiRole['policies'];
|
||||||
roleCreated: Role;
|
roleCreated: MiRole;
|
||||||
roleDeleted: Role;
|
roleDeleted: MiRole;
|
||||||
roleUpdated: Role;
|
roleUpdated: MiRole;
|
||||||
userRoleAssigned: RoleAssignment;
|
userRoleAssigned: MiRoleAssignment;
|
||||||
userRoleUnassigned: RoleAssignment;
|
userRoleUnassigned: MiRoleAssignment;
|
||||||
webhookCreated: MiWebhook;
|
webhookCreated: MiWebhook;
|
||||||
webhookDeleted: MiWebhook;
|
webhookDeleted: MiWebhook;
|
||||||
webhookUpdated: MiWebhook;
|
webhookUpdated: MiWebhook;
|
||||||
|
@ -225,7 +225,7 @@ export type StreamMessages = {
|
||||||
payload: EventUnionFromDictionary<SerializedAll<UserListStreamTypes>>;
|
payload: EventUnionFromDictionary<SerializedAll<UserListStreamTypes>>;
|
||||||
};
|
};
|
||||||
roleTimeline: {
|
roleTimeline: {
|
||||||
name: `roleTimelineStream:${Role['id']}`;
|
name: `roleTimelineStream:${MiRole['id']}`;
|
||||||
payload: EventUnionFromDictionary<SerializedAll<RoleTimelineStreamTypes>>;
|
payload: EventUnionFromDictionary<SerializedAll<RoleTimelineStreamTypes>>;
|
||||||
};
|
};
|
||||||
antenna: {
|
antenna: {
|
||||||
|
|
|
@ -31,7 +31,7 @@ import { PageEntityService } from '@/core/entities/PageEntityService.js';
|
||||||
import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js';
|
import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js';
|
||||||
import { ClipEntityService } from '@/core/entities/ClipEntityService.js';
|
import { ClipEntityService } from '@/core/entities/ClipEntityService.js';
|
||||||
import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js';
|
import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js';
|
||||||
import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, Meta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js';
|
import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { deepClone } from '@/misc/clone.js';
|
import { deepClone } from '@/misc/clone.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
@ -123,7 +123,7 @@ export class ClientServerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private generateCommonPugData(meta: Meta) {
|
private generateCommonPugData(meta: MiMeta) {
|
||||||
return {
|
return {
|
||||||
instanceName: meta.name ?? 'Misskey',
|
instanceName: meta.name ?? 'Misskey',
|
||||||
icon: meta.iconUrl,
|
icon: meta.iconUrl,
|
||||||
|
|
Loading…
Reference in New Issue