Merge branch 'develop' into swn
This commit is contained in:
@@ -33,6 +33,14 @@ export const meta = {
|
||||
untilId: {
|
||||
validator: $.optional.type(ID),
|
||||
},
|
||||
|
||||
sinceDate: {
|
||||
validator: $.optional.num,
|
||||
},
|
||||
|
||||
untilDate: {
|
||||
validator: $.optional.num,
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
@@ -68,7 +76,8 @@ export default define(meta, async (ps, user) => {
|
||||
.select('joining.noteId')
|
||||
.where('joining.antennaId = :antennaId', { antennaId: antenna.id });
|
||||
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere(`note.id IN (${ antennaQuery.getQuery() })`)
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('note.reply', 'reply')
|
||||
|
@@ -1,7 +1,10 @@
|
||||
import { Emojis } from '@/models/index';
|
||||
import { initDb } from '@/db/postgre';
|
||||
import { genId } from '@/misc/gen-id';
|
||||
|
||||
async function main(name: string, url: string, alias?: string): Promise<any> {
|
||||
await initDb();
|
||||
const { Emojis } = await import('@/models/index');
|
||||
|
||||
const aliases = alias != null ? [ alias ] : [];
|
||||
|
||||
await Emojis.save({
|
||||
|
@@ -1,13 +1,11 @@
|
||||
import { initDb } from '../db/postgre';
|
||||
import { getRepository } from 'typeorm';
|
||||
import { User } from '@/models/entities/user';
|
||||
|
||||
async function main(username: string) {
|
||||
if (!username) throw `username required`;
|
||||
username = username.replace(/^@/, '');
|
||||
|
||||
await initDb();
|
||||
const Users = getRepository(User);
|
||||
const { Users } = await import('@/models/index');
|
||||
|
||||
const res = await Users.update({
|
||||
usernameLower: username.toLowerCase(),
|
||||
|
@@ -1,13 +1,11 @@
|
||||
import { initDb } from '../db/postgre';
|
||||
import { getRepository } from 'typeorm';
|
||||
import { User } from '@/models/entities/user';
|
||||
|
||||
async function main(username: string) {
|
||||
if (!username) throw `username required`;
|
||||
username = username.replace(/^@/, '');
|
||||
|
||||
await initDb();
|
||||
const Users = getRepository(User);
|
||||
const { Users } = await import('@/models/index');
|
||||
|
||||
const res = await Users.update({
|
||||
usernameLower: username.toLowerCase(),
|
||||
|
@@ -1,6 +1,9 @@
|
||||
import { updateQuestion } from '@/remote/activitypub/models/question';
|
||||
import { initDb } from '@/db/postgre';
|
||||
|
||||
async function main(uri: string): Promise<any> {
|
||||
await initDb();
|
||||
const { updateQuestion } = await import('@/remote/activitypub/models/question');
|
||||
|
||||
return await updateQuestion(uri);
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Users, Signins } from '@/models/index';
|
||||
import { initDb } from '@/db/postgre';
|
||||
|
||||
// node built/tools/show-signin-history username
|
||||
// => {Success} {Date} {IPAddrsss}
|
||||
@@ -10,6 +10,9 @@ import { Users, Signins } from '@/models/index';
|
||||
// with full request headers
|
||||
|
||||
async function main(username: string, headers?: string[]) {
|
||||
await initDb();
|
||||
const { Users, Signins } = await import('@/models/index');
|
||||
|
||||
const user = await Users.findOne({
|
||||
host: null,
|
||||
usernameLower: username.toLowerCase(),
|
||||
|
Reference in New Issue
Block a user