upd: change deps, fix a few bugs, update converter

Fixes User and Notes count bug (transfem-org/Sharkey#113)
Fixes build issues due to types (transfem-org/Sharkey#111)
Return accounts and notes like Iceshrimp
Use MFM class from Iceshrimp to fix HTML output for mastodon
This commit is contained in:
Mar0xy 2023-10-29 00:50:00 +02:00
parent b0a7fd6ddb
commit 82c10de265
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
14 changed files with 421 additions and 242 deletions

View file

@ -1,6 +1,6 @@
import { Converter } from 'megalodon';
import { convertAccount, convertStatus } from '../converters.js';
import { convertTimelinesArgsId, limitToInt } from './timeline.js';
import { limitToInt } from './timeline.js';
import type { MegalodonInterface } from 'megalodon';
import type { FastifyRequest } from 'fastify';
@ -71,7 +71,7 @@ export class ApiSearchMastodon {
public async SearchV1() {
try {
const query: any = convertTimelinesArgsId(limitToInt(this.request.query as any));
const query: any = limitToInt(this.request.query as any);
const type = query.type || '';
const data = await this.client.search(query.q, { type: type, ...query });
return data.data;
@ -83,7 +83,7 @@ export class ApiSearchMastodon {
public async SearchV2() {
try {
const query: any = convertTimelinesArgsId(limitToInt(this.request.query as any));
const query: any = limitToInt(this.request.query as any);
const type = query.type;
const acct = !type || type === 'accounts' ? await this.client.search(query.q, { type: 'accounts', ...query }) : null;
const stat = !type || type === 'statuses' ? await this.client.search(query.q, { type: 'statuses', ...query }) : null;