meow
Co-authored-by: cutls <web-pro@cutls.com>
This commit is contained in:
parent
254a9e8716
commit
c135d16024
3 changed files with 24 additions and 5 deletions
|
@ -79,7 +79,7 @@
|
|||
"koa-send": "5.0.1",
|
||||
"koa-slow": "2.1.0",
|
||||
"koa-views": "7.0.2",
|
||||
"@cutls/megalodon": "5.1.15",
|
||||
"@cutls/megalodon": "5.1.16",
|
||||
"mfm-js": "0.23.2",
|
||||
"mime-types": "2.1.35",
|
||||
"multer": "1.4.4-lts.1",
|
||||
|
|
|
@ -4,6 +4,23 @@ import { koaBody } from "koa-body";
|
|||
import { getClient } from "../ApiMastodonCompatibleService.js";
|
||||
import { toLimitToInt } from "./timeline.js";
|
||||
|
||||
const relationshopModel = {
|
||||
id: '',
|
||||
following: false,
|
||||
followed_by: false,
|
||||
delivery_following: false,
|
||||
blocking: false,
|
||||
blocked_by: false,
|
||||
muting: false,
|
||||
muting_notifications: false,
|
||||
requested: false,
|
||||
domain_blocking: false,
|
||||
showing_reblogs: false,
|
||||
endorsed: false,
|
||||
notifying: false,
|
||||
note: ''
|
||||
}
|
||||
|
||||
export function apiAccountMastodon(router: Router): void {
|
||||
router.get("/v1/accounts/verify_credentials", async (ctx, next) => {
|
||||
const BASE_URL = `${ctx.protocol}://${ctx.hostname}`;
|
||||
|
@ -258,6 +275,8 @@ export function apiAccountMastodon(router: Router): void {
|
|||
try {
|
||||
const idsRaw = (ctx.query as any)["id[]"];
|
||||
const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw;
|
||||
relationshopModel.id = idsRaw || '1'
|
||||
if (!idsRaw) return [relationshopModel]
|
||||
const data = (await client.getRelationships(ids)) as any;
|
||||
ctx.body = data.data;
|
||||
} catch (e: any) {
|
||||
|
|
|
@ -57,7 +57,7 @@ importers:
|
|||
'@bull-board/api': ^4.6.4
|
||||
'@bull-board/koa': ^4.6.4
|
||||
'@bull-board/ui': ^4.6.4
|
||||
'@cutls/megalodon': 5.1.15
|
||||
'@cutls/megalodon': 5.1.16
|
||||
'@discordapp/twemoji': 14.0.2
|
||||
'@elastic/elasticsearch': 7.17.0
|
||||
'@koa/cors': 3.4.3
|
||||
|
@ -223,7 +223,7 @@ importers:
|
|||
'@bull-board/api': 4.10.2
|
||||
'@bull-board/koa': 4.10.2_6tybghmia4wsnt33xeid7y4rby
|
||||
'@bull-board/ui': 4.10.2
|
||||
'@cutls/megalodon': 5.1.15
|
||||
'@cutls/megalodon': 5.1.16
|
||||
'@discordapp/twemoji': 14.0.2
|
||||
'@elastic/elasticsearch': 7.17.0
|
||||
'@koa/cors': 3.4.3
|
||||
|
@ -847,8 +847,8 @@ packages:
|
|||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.9
|
||||
|
||||
/@cutls/megalodon/5.1.15:
|
||||
resolution: {integrity: sha512-4+mIKUYYr2CLY3idSxXk56WSTG9ww3opeenmsPRxftTwcjQTYxGntNkWmJWEbzeJ4rPslnvpwD7cFR62bPf41g==}
|
||||
/@cutls/megalodon/5.1.16:
|
||||
resolution: {integrity: sha512-s2U3qjcs86v0/p0EPwlQqSMh4UhAqTNxu8xUVsPvzrwXr5TrrJ5AVKunBm5582AEkx47nZkqm/98ZF2iHb0GtQ==}
|
||||
engines: {node: '>=15.0.0'}
|
||||
dependencies:
|
||||
'@types/oauth': 0.9.1
|
||||
|
|
Loading…
Reference in a new issue