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

@ -64,15 +64,15 @@
"socks-proxy-agent": "^8.0.2",
"typescript": "5.1.6",
"uuid": "^9.0.1",
"ws": "8.14.2"
},
"devDependencies": {
"ws": "8.14.2",
"@types/core-js": "^2.5.6",
"@types/form-data": "^2.5.0",
"@types/jest": "^29.5.5",
"@types/object-assign-deep": "^0.4.1",
"@types/parse-link-header": "^2.0.1",
"@types/uuid": "^9.0.4",
"@types/uuid": "^9.0.4"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.49.0",

View file

@ -5,15 +5,16 @@
namespace Entity {
export type Account = {
id: string
fqn?: string
username: string
acct: string
display_name: string
locked: boolean
discoverable?: boolean
group: boolean | null
noindex: boolean | null
suspended: boolean | null
limited: boolean | null
group?: boolean | null
noindex?: boolean | null
suspended?: boolean | null
limited?: boolean | null
created_at: string
followers_count: number
following_count: number

View file

@ -17,7 +17,7 @@ namespace Entity {
in_reply_to_account_id: string | null
reblog: Status | null
content: string
plain_content: string | null
plain_content?: string | null
created_at: string
emojis: Emoji[]
replies_count: number

View file

@ -2017,7 +2017,7 @@ export default class Misskey implements MegalodonInterface {
}
if (options.exclude_type) {
params = Object.assign(params, {
excludeType: options.exclude_type.map(e => MisskeyAPI.Converter.encodeNotificationType(e))
excludeTypes: options.exclude_type.map(e => MisskeyAPI.Converter.encodeNotificationType(e))
})
}
}

View file

@ -78,8 +78,10 @@ namespace MisskeyAPI {
acct = `${u.username}@${u.host}`;
acctUrl = `https://${u.host}/@${u.username}`;
}
const fqn = `${u.username}@${u.host ?? host}`;
return {
id: u.id,
fqn: fqn,
username: u.username,
acct: acct,
display_name: u.name ? u.name : '',
@ -465,8 +467,8 @@ namespace MisskeyAPI {
export const stats = (s: Entity.Stats): MegalodonEntity.Stats => {
return {
user_count: s.usersCount,
status_count: s.notesCount,
user_count: s.originalUsersCount,
status_count: s.originalNotesCount,
domain_count: s.instances
}
}