wip
This commit is contained in:
parent
75c268cdfa
commit
325acaeef7
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { User, Note, Announcement, AnnouncementRead, App, NoteFavorite, NoteThreadMuting, NoteReaction, NoteUnread, Poll, PollVote, UserProfile, UserKeypair, UserPending, AttestationChallenge, UserSecurityKey, UserPublickey, UserList, UserListJoining, UserNotePining, UserIp, UsedUsername, Following, FollowRequest, Instance, Emoji, DriveFile, DriveFolder, Meta, Muting, RenoteMuting, Blocking, SwSubscription, Hashtag, AbuseUserReport, RegistrationTicket, AuthSession, AccessToken, Signin, Page, PageLike, GalleryPost, GalleryLike, ModerationLog, Clip, ClipNote, Antenna, PromoNote, PromoRead, Relay, MutedNote, Channel, ChannelFollowing, ChannelFavorite, RegistryItem, Webhook, Ad, PasswordResetRequest, RetentionAggregation, FlashLike, Flash, Role, RoleAssignment, ClipFavorite, UserMemo, UserListFavorite } from './index.js';
|
import { User, Note, Announcement, AnnouncementRead, App, NoteFavorite, NoteThreadMuting, NoteReaction, NoteUnread, Poll, PollVote, UserProfile, UserKeypair, UserPending, AttestationChallenge, UserSecurityKey, UserPublickey, UserList, UserListJoining, UserNotePining, UserIp, UsedUsername, Following, FollowRequest, Instance, Emoji, DriveFile, DriveFolder, Meta, Muting, RenoteMuting, Blocking, SwSubscription, Hashtag, MiAbuseUserReport, RegistrationTicket, AuthSession, AccessToken, Signin, Page, PageLike, GalleryPost, GalleryLike, ModerationLog, Clip, ClipNote, Antenna, PromoNote, PromoRead, Relay, MutedNote, Channel, ChannelFollowing, ChannelFavorite, RegistryItem, Webhook, Ad, PasswordResetRequest, RetentionAggregation, FlashLike, Flash, Role, RoleAssignment, ClipFavorite, UserMemo, UserListFavorite } from './index.js';
|
||||||
import type { DataSource } from 'typeorm';
|
import type { DataSource } from 'typeorm';
|
||||||
import type { Provider } from '@nestjs/common';
|
import type { Provider } from '@nestjs/common';
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ const $hashtagsRepository: Provider = {
|
||||||
|
|
||||||
const $abuseUserReportsRepository: Provider = {
|
const $abuseUserReportsRepository: Provider = {
|
||||||
provide: DI.abuseUserReportsRepository,
|
provide: DI.abuseUserReportsRepository,
|
||||||
useFactory: (db: DataSource) => db.getRepository(AbuseUserReport),
|
useFactory: (db: DataSource) => db.getRepository(MiAbuseUserReport),
|
||||||
inject: [DI.db],
|
inject: [DI.db],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -72,72 +72,72 @@ import { MiUserListFavorite } from './entities/UserListFavorite.js';
|
||||||
import type { Repository } from 'typeorm';
|
import type { Repository } from 'typeorm';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
MiAbuseUserReport as AbuseUserReport,
|
MiAbuseUserReport,
|
||||||
MiAccessToken as AccessToken,
|
MiAccessToken,
|
||||||
MiAd as Ad,
|
MiAd,
|
||||||
MiAnnouncement as Announcement,
|
MiAnnouncement,
|
||||||
MiAnnouncementRead as AnnouncementRead,
|
MiAnnouncementRead,
|
||||||
MiAntenna as Antenna,
|
MiAntenna,
|
||||||
MiApp as App,
|
MiApp,
|
||||||
MiAttestationChallenge as AttestationChallenge,
|
MiAttestationChallenge,
|
||||||
MiAuthSession as AuthSession,
|
MiAuthSession,
|
||||||
MiBlocking as Blocking,
|
MiBlocking,
|
||||||
MiChannelFollowing as ChannelFollowing,
|
MiChannelFollowing,
|
||||||
MiChannelFavorite as ChannelFavorite,
|
MiChannelFavorite,
|
||||||
MiClip as Clip,
|
MiClip,
|
||||||
MiClipNote as ClipNote,
|
MiClipNote,
|
||||||
MiClipFavorite as ClipFavorite,
|
MiClipFavorite,
|
||||||
MiDriveFile as DriveFile,
|
MiDriveFile,
|
||||||
MiDriveFolder as DriveFolder,
|
MiDriveFolder,
|
||||||
MiEmoji as Emoji,
|
MiEmoji,
|
||||||
MiFollowing as Following,
|
MiFollowing,
|
||||||
MiFollowRequest as FollowRequest,
|
MiFollowRequest,
|
||||||
MiGalleryLike as GalleryLike,
|
MiGalleryLike,
|
||||||
MiGalleryPost as GalleryPost,
|
MiGalleryPost,
|
||||||
MiHashtag as Hashtag,
|
MiHashtag,
|
||||||
MiInstance as Instance,
|
MiInstance,
|
||||||
MiMeta as Meta,
|
MiMeta,
|
||||||
MiModerationLog as ModerationLog,
|
MiModerationLog,
|
||||||
MiMutedNote as MutedNote,
|
MiMutedNote,
|
||||||
MiMuting as Muting,
|
MiMuting,
|
||||||
MiRenoteMuting as RenoteMuting,
|
MiRenoteMuting,
|
||||||
MiNote as Note,
|
MiNote,
|
||||||
MiNoteFavorite as NoteFavorite,
|
MiNoteFavorite,
|
||||||
MiNoteReaction as NoteReaction,
|
MiNoteReaction,
|
||||||
MiNoteThreadMuting as NoteThreadMuting,
|
MiNoteThreadMuting,
|
||||||
MiNoteUnread as NoteUnread,
|
MiNoteUnread,
|
||||||
MiPage as Page,
|
MiPage,
|
||||||
MiPageLike as PageLike,
|
MiPageLike,
|
||||||
MiPasswordResetRequest as PasswordResetRequest,
|
MiPasswordResetRequest,
|
||||||
MiPoll as Poll,
|
MiPoll,
|
||||||
MiPollVote as PollVote,
|
MiPollVote,
|
||||||
MiPromoNote as PromoNote,
|
MiPromoNote,
|
||||||
MiPromoRead as PromoRead,
|
MiPromoRead,
|
||||||
MiRegistrationTicket as RegistrationTicket,
|
MiRegistrationTicket,
|
||||||
MiRegistryItem as RegistryItem,
|
MiRegistryItem,
|
||||||
MiRelay as Relay,
|
MiRelay,
|
||||||
MiSignin as Signin,
|
MiSignin,
|
||||||
MiSwSubscription as SwSubscription,
|
MiSwSubscription,
|
||||||
MiUsedUsername as UsedUsername,
|
MiUsedUsername,
|
||||||
MiUser as User,
|
MiUser,
|
||||||
MiUserIp as UserIp,
|
MiUserIp,
|
||||||
MiUserKeypair as UserKeypair,
|
MiUserKeypair,
|
||||||
MiUserList as UserList,
|
MiUserList,
|
||||||
MiUserListFavorite as UserListFavorite,
|
MiUserListFavorite,
|
||||||
MiUserListJoining as UserListJoining,
|
MiUserListJoining,
|
||||||
MiUserNotePining as UserNotePining,
|
MiUserNotePining,
|
||||||
MiUserPending as UserPending,
|
MiUserPending,
|
||||||
MiUserProfile as UserProfile,
|
MiUserProfile,
|
||||||
MiUserPublickey as UserPublickey,
|
MiUserPublickey,
|
||||||
MiUserSecurityKey as UserSecurityKey,
|
MiUserSecurityKey,
|
||||||
MiWebhook as Webhook,
|
MiWebhook,
|
||||||
MiChannel as Channel,
|
MiChannel,
|
||||||
MiRetentionAggregation as RetentionAggregation,
|
MiRetentionAggregation,
|
||||||
MiRole as Role,
|
MiRole,
|
||||||
MiRoleAssignment as RoleAssignment,
|
MiRoleAssignment,
|
||||||
MiFlash as Flash,
|
MiFlash,
|
||||||
MiFlashLike as FlashLike,
|
MiFlashLike,
|
||||||
MiUserMemo as UserMemo,
|
MiUserMemo,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AbuseUserReportsRepository = Repository<MiAbuseUserReport>;
|
export type AbuseUserReportsRepository = Repository<MiAbuseUserReport>;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import * as assert from 'assert';
|
||||||
// node-fetch only supports it's own Blob yet
|
// node-fetch only supports it's own Blob yet
|
||||||
// https://github.com/node-fetch/node-fetch/pull/1664
|
// https://github.com/node-fetch/node-fetch/pull/1664
|
||||||
import { Blob } from 'node-fetch';
|
import { Blob } from 'node-fetch';
|
||||||
import { User } from '@/models/index.js';
|
import { MiUser } from '@/models/index.js';
|
||||||
import { startServer, signup, post, api, uploadFile, simpleGet, initTestDb } from '../utils.js';
|
import { startServer, signup, post, api, uploadFile, simpleGet, initTestDb } from '../utils.js';
|
||||||
import type { INestApplicationContext } from '@nestjs/common';
|
import type { INestApplicationContext } from '@nestjs/common';
|
||||||
import type * as misskey from 'misskey-js';
|
import type * as misskey from 'misskey-js';
|
||||||
|
@ -298,7 +298,7 @@ describe('Endpoints', () => {
|
||||||
assert.strictEqual(res.status, 200);
|
assert.strictEqual(res.status, 200);
|
||||||
|
|
||||||
const connection = await initTestDb(true);
|
const connection = await initTestDb(true);
|
||||||
const Users = connection.getRepository(User);
|
const Users = connection.getRepository(MiUser);
|
||||||
const newBob = await Users.findOneByOrFail({ id: bob.id });
|
const newBob = await Users.findOneByOrFail({ id: bob.id });
|
||||||
assert.strictEqual(newBob.followersCount, 0);
|
assert.strictEqual(newBob.followersCount, 0);
|
||||||
assert.strictEqual(newBob.followingCount, 1);
|
assert.strictEqual(newBob.followingCount, 1);
|
||||||
|
@ -360,7 +360,7 @@ describe('Endpoints', () => {
|
||||||
assert.strictEqual(res.status, 200);
|
assert.strictEqual(res.status, 200);
|
||||||
|
|
||||||
const connection = await initTestDb(true);
|
const connection = await initTestDb(true);
|
||||||
const Users = connection.getRepository(User);
|
const Users = connection.getRepository(MiUser);
|
||||||
const newBob = await Users.findOneByOrFail({ id: bob.id });
|
const newBob = await Users.findOneByOrFail({ id: bob.id });
|
||||||
assert.strictEqual(newBob.followersCount, 0);
|
assert.strictEqual(newBob.followersCount, 0);
|
||||||
assert.strictEqual(newBob.followingCount, 0);
|
assert.strictEqual(newBob.followingCount, 0);
|
||||||
|
|
|
@ -7,7 +7,7 @@ process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import { loadConfig } from '@/config.js';
|
import { loadConfig } from '@/config.js';
|
||||||
import { User, UsersRepository } from '@/models/index.js';
|
import { MiUser, UsersRepository } from '@/models/index.js';
|
||||||
import { jobQueue } from '@/boot/common.js';
|
import { jobQueue } from '@/boot/common.js';
|
||||||
import { secureRndstr } from '@/misc/secure-rndstr.js';
|
import { secureRndstr } from '@/misc/secure-rndstr.js';
|
||||||
import { uploadFile, signup, startServer, initTestDb, api, sleep, successfulApiCall } from '../utils.js';
|
import { uploadFile, signup, startServer, initTestDb, api, sleep, successfulApiCall } from '../utils.js';
|
||||||
|
@ -42,7 +42,7 @@ describe('Account Move', () => {
|
||||||
dave = await signup({ username: 'dave' });
|
dave = await signup({ username: 'dave' });
|
||||||
eve = await signup({ username: 'eve' });
|
eve = await signup({ username: 'eve' });
|
||||||
frank = await signup({ username: 'frank' });
|
frank = await signup({ username: 'frank' });
|
||||||
Users = connection.getRepository(User);
|
Users = connection.getRepository(MiUser);
|
||||||
}, 1000 * 60 * 2);
|
}, 1000 * 60 * 2);
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import { Note } from '@/models/entities/Note.js';
|
import { MiNote } from '@/models/entities/Note.js';
|
||||||
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
|
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
|
||||||
import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } from '../utils.js';
|
import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } from '../utils.js';
|
||||||
import type { INestApplicationContext } from '@nestjs/common';
|
import type { INestApplicationContext } from '@nestjs/common';
|
||||||
|
@ -22,7 +22,7 @@ describe('Note', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
const connection = await initTestDb(true);
|
const connection = await initTestDb(true);
|
||||||
Notes = connection.getRepository(Note);
|
Notes = connection.getRepository(MiNote);
|
||||||
alice = await signup({ username: 'alice' });
|
alice = await signup({ username: 'alice' });
|
||||||
bob = await signup({ username: 'bob' });
|
bob = await signup({ username: 'bob' });
|
||||||
}, 1000 * 60 * 2);
|
}, 1000 * 60 * 2);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import { Following } from '@/models/entities/Following.js';
|
import { MiFollowing } from '@/models/entities/Following.js';
|
||||||
import { connectStream, signup, api, post, startServer, initTestDb, waitFire } from '../utils.js';
|
import { connectStream, signup, api, post, startServer, initTestDb, waitFire } from '../utils.js';
|
||||||
import type { INestApplicationContext } from '@nestjs/common';
|
import type { INestApplicationContext } from '@nestjs/common';
|
||||||
import type * as misskey from 'misskey-js';
|
import type * as misskey from 'misskey-js';
|
||||||
|
@ -46,7 +46,7 @@ describe('Streaming', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
const connection = await initTestDb(true);
|
const connection = await initTestDb(true);
|
||||||
Followings = connection.getRepository(Following);
|
Followings = connection.getRepository(MiFollowing);
|
||||||
|
|
||||||
ayano = await signup({ username: 'ayano' });
|
ayano = await signup({ username: 'ayano' });
|
||||||
kyoko = await signup({ username: 'kyoko' });
|
kyoko = await signup({ username: 'kyoko' });
|
||||||
|
|
Loading…
Reference in New Issue