2024-04-12 04:59:44 +02:00
|
|
|
/* auto-generated by NAPI-RS */
|
2024-06-27 23:42:26 +02:00
|
|
|
/* Do NOT edit this file manually */
|
|
|
|
|
|
|
|
type DateTimeWithTimeZone = Date;
|
|
|
|
|
|
|
|
type Json = any;
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface AbuseUserReport {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
targetUserId: string
|
|
|
|
reporterId: string
|
|
|
|
assigneeId: string | null
|
|
|
|
resolved: boolean
|
|
|
|
comment: string
|
|
|
|
targetUserHost: string | null
|
|
|
|
reporterHost: string | null
|
|
|
|
forwarded: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface AbuseUserReportLike {
|
|
|
|
id: string
|
|
|
|
targetUserId: string
|
|
|
|
reporterId: string
|
|
|
|
comment: string
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface AccessToken {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
token: string
|
|
|
|
hash: string
|
2024-05-29 16:40:56 +02:00
|
|
|
userId: string | null
|
2024-04-12 04:59:44 +02:00
|
|
|
appId: string | null
|
2024-05-19 12:15:58 +02:00
|
|
|
lastUsedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
session: string | null
|
|
|
|
name: string | null
|
|
|
|
description: string | null
|
|
|
|
iconUrl: string | null
|
|
|
|
permission: Array<string>
|
|
|
|
fetched: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface Acct {
|
|
|
|
username: string
|
|
|
|
host: string | null
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function acctToString(acct: Acct): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Ad {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
expiresAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
place: string
|
|
|
|
priority: string
|
|
|
|
url: string
|
|
|
|
imageUrl: string
|
|
|
|
memo: string
|
|
|
|
ratio: number
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Announcement {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
text: string
|
|
|
|
title: string
|
|
|
|
imageUrl: string | null
|
2024-05-19 12:15:58 +02:00
|
|
|
updatedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
showPopup: boolean
|
|
|
|
isGoodNews: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface AnnouncementRead {
|
|
|
|
id: string
|
|
|
|
userId: string
|
|
|
|
announcementId: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Antenna {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
name: string
|
2024-05-23 13:49:49 +02:00
|
|
|
src: AntennaSrc
|
2024-04-12 04:59:44 +02:00
|
|
|
userListId: string | null
|
|
|
|
withFile: boolean
|
|
|
|
expression: string | null
|
|
|
|
notify: boolean
|
|
|
|
caseSensitive: boolean
|
|
|
|
withReplies: boolean
|
|
|
|
userGroupJoiningId: string | null
|
|
|
|
users: Array<string>
|
2024-05-17 10:59:45 +02:00
|
|
|
instances: Array<string>
|
|
|
|
keywords: Array<string>
|
|
|
|
excludeKeywords: Array<string>
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type AntennaSrc = 'all'|
|
|
|
|
'group'|
|
|
|
|
'home'|
|
|
|
|
'instances'|
|
|
|
|
'list'|
|
|
|
|
'users';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface App {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string | null
|
|
|
|
secret: string
|
|
|
|
name: string
|
|
|
|
description: string
|
|
|
|
permission: Array<string>
|
|
|
|
callbackUrl: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface AttestationChallenge {
|
|
|
|
id: string
|
|
|
|
userId: string
|
|
|
|
challenge: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
registrationChallenge: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface AuthSession {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
token: string
|
|
|
|
userId: string | null
|
|
|
|
appId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Blocking {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
blockeeId: string
|
|
|
|
blockerId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Channel {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
lastNotedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string | null
|
|
|
|
name: string
|
|
|
|
description: string | null
|
|
|
|
bannerId: string | null
|
|
|
|
notesCount: number
|
|
|
|
usersCount: number
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface ChannelFollowing {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
followeeId: string
|
|
|
|
followerId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface ChannelNotePining {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
channelId: string
|
|
|
|
noteId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type ChatEvent = 'message'|
|
|
|
|
'read'|
|
|
|
|
'deleted'|
|
|
|
|
'typing';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type ChatIndexEvent = 'message'|
|
|
|
|
'read';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether `note` should be hard-muted.
|
|
|
|
*
|
|
|
|
* More specifically, this function returns `Ok(true)`
|
|
|
|
* if and only if one or more of these conditions are met:
|
|
|
|
*
|
|
|
|
* * the note (text or CW) contains any of the words/patterns
|
|
|
|
* * the "parent" note(s) (reply, quote) contain any of the words/patterns
|
|
|
|
* * the alt text of the attached files contains any of the words/patterns
|
|
|
|
*
|
|
|
|
* # Arguments
|
|
|
|
*
|
|
|
|
* * `note` : [PartialNoteToCheckWordMute] object
|
|
|
|
* * `muted_words` : list of muted keyword lists (each array item is a space-separated keyword list that represents an AND condition)
|
|
|
|
* * `muted_patterns` : list of JavaScript-style (e.g., `/foo/i`) regular expressions
|
|
|
|
*/
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function checkWordMute(note: PartialNoteToCheckWordMute, mutedWords: Array<string>, mutedPatterns: Array<string>): Promise<boolean>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Clip {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
name: string
|
|
|
|
isPublic: boolean
|
|
|
|
description: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface ClipNote {
|
|
|
|
id: string
|
|
|
|
noteId: string
|
|
|
|
clipId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface Config {
|
|
|
|
url: string
|
|
|
|
port: number
|
|
|
|
bind?: string
|
|
|
|
disableHsts?: boolean
|
|
|
|
db: DbConfig
|
|
|
|
redis: RedisConfig
|
|
|
|
cacheServer?: RedisConfig
|
|
|
|
proxy?: string
|
|
|
|
proxySmtp?: string
|
|
|
|
proxyBypassHosts?: Array<string>
|
|
|
|
allowedPrivateNetworks?: Array<string>
|
|
|
|
maxFileSize?: number
|
|
|
|
accessLog?: string
|
|
|
|
clusterLimits: WorkerConfig
|
|
|
|
cuid?: IdConfig
|
|
|
|
outgoingAddress?: string
|
|
|
|
deliverJobConcurrency?: number
|
|
|
|
inboxJobConcurrency?: number
|
|
|
|
deliverJobPerSec?: number
|
|
|
|
inboxJobPerSec?: number
|
|
|
|
deliverJobMaxAttempts?: number
|
|
|
|
inboxJobMaxAttempts?: number
|
|
|
|
/** deprecated */
|
|
|
|
logLevel?: Array<string>
|
|
|
|
maxLogLevel?: string
|
|
|
|
syslog?: SysLogConfig
|
|
|
|
proxyRemoteFiles?: boolean
|
|
|
|
mediaProxy?: string
|
|
|
|
summalyProxyUrl?: string
|
|
|
|
reservedUsernames?: Array<string>
|
|
|
|
maxUserSignups?: number
|
|
|
|
isManagedHosting?: boolean
|
|
|
|
maxNoteLength: number
|
|
|
|
maxCaptionLength: number
|
|
|
|
deepl?: DeepLConfig
|
|
|
|
libreTranslate?: LibreTranslateConfig
|
|
|
|
email?: EmailConfig
|
|
|
|
objectStorage?: ObjectStorageConfig
|
|
|
|
version: string
|
|
|
|
host: string
|
|
|
|
hostname: string
|
|
|
|
redisKeyPrefix: string
|
|
|
|
scheme: string
|
|
|
|
wsScheme: string
|
|
|
|
apiUrl: string
|
|
|
|
wsUrl: string
|
|
|
|
authUrl: string
|
|
|
|
driveUrl: string
|
|
|
|
userAgent: string
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function countReactions(reactions: Record<string, number>): Record<string, number>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface Cpu {
|
|
|
|
model: string
|
|
|
|
cores: number
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function cpuInfo(): Cpu
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function cpuUsage(): number
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export const DAY: number
|
|
|
|
|
|
|
|
export interface DbConfig {
|
|
|
|
host: string
|
|
|
|
port: number
|
|
|
|
db: string
|
|
|
|
user: string
|
|
|
|
pass: string
|
|
|
|
disableCache?: boolean
|
|
|
|
extra?: any
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DecodedReaction {
|
|
|
|
reaction: string
|
|
|
|
name: string | null
|
|
|
|
host: string | null
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function decodeReaction(reaction: string): DecodedReaction
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface DeepLConfig {
|
|
|
|
managed?: boolean
|
|
|
|
authKey?: string
|
|
|
|
isPro?: boolean
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface DriveFile {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string | null
|
|
|
|
userHost: string | null
|
|
|
|
md5: string
|
|
|
|
name: string
|
|
|
|
type: string
|
|
|
|
size: number
|
|
|
|
comment: string | null
|
|
|
|
properties: Json
|
|
|
|
storedInternal: boolean
|
|
|
|
url: string
|
|
|
|
thumbnailUrl: string | null
|
|
|
|
webpublicUrl: string | null
|
|
|
|
accessKey: string | null
|
|
|
|
thumbnailAccessKey: string | null
|
|
|
|
webpublicAccessKey: string | null
|
|
|
|
uri: string | null
|
|
|
|
src: string | null
|
|
|
|
folderId: string | null
|
|
|
|
isSensitive: boolean
|
|
|
|
isLink: boolean
|
|
|
|
blurhash: string | null
|
|
|
|
webpublicType: string | null
|
|
|
|
requestHeaders: Json | null
|
|
|
|
requestIp: string | null
|
2024-05-23 13:49:49 +02:00
|
|
|
usageHint: DriveFileUsageHint | null
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type DriveFileEvent = 'create'|
|
|
|
|
'update'|
|
|
|
|
'delete';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type DriveFileUsageHint = 'userAvatar'|
|
|
|
|
'userBanner';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface DriveFolder {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
name: string
|
|
|
|
userId: string | null
|
|
|
|
parentId: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type DriveFolderEvent = 'create'|
|
|
|
|
'update'|
|
|
|
|
'delete';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface EmailConfig {
|
|
|
|
managed?: boolean
|
|
|
|
address?: string
|
|
|
|
host?: string
|
|
|
|
port?: number
|
|
|
|
user?: string
|
|
|
|
pass?: string
|
|
|
|
useImplicitSslTls?: boolean
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Emoji {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
updatedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
name: string
|
|
|
|
host: string | null
|
|
|
|
originalUrl: string
|
|
|
|
uri: string | null
|
|
|
|
type: string | null
|
|
|
|
aliases: Array<string>
|
|
|
|
category: string | null
|
|
|
|
publicUrl: string
|
|
|
|
license: string | null
|
|
|
|
width: number | null
|
|
|
|
height: number | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function extractHost(uri: string): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function fetchMeta(): Promise<Meta>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Fetches and returns the NodeInfo (version 2.0) of a remote server. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function fetchNodeinfo(host: string): Promise<Nodeinfo>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* List of file types allowed to be viewed directly in the browser
|
|
|
|
*
|
|
|
|
* Anything not included here will be responded as application/octet-stream
|
|
|
|
* SVG is not allowed because it generates XSS (TODO: fix this and later allow it to be viewed directly)
|
|
|
|
* * <https://github.com/sindresorhus/file-type/blob/main/supported.js>
|
|
|
|
* * <https://github.com/sindresorhus/file-type/blob/main/core.js>
|
|
|
|
* * <https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers>
|
|
|
|
*/
|
|
|
|
export const FILE_TYPE_BROWSERSAFE: string[]
|
|
|
|
|
|
|
|
export interface Following {
|
2024-04-12 04:59:44 +02:00
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
followeeId: string
|
|
|
|
followerId: string
|
|
|
|
followerHost: string | null
|
|
|
|
followerInbox: string | null
|
|
|
|
followerSharedInbox: string | null
|
|
|
|
followeeHost: string | null
|
|
|
|
followeeInbox: string | null
|
|
|
|
followeeSharedInbox: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface FollowRequest {
|
2024-04-12 04:59:44 +02:00
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
followeeId: string
|
|
|
|
followerId: string
|
2024-06-18 02:17:25 +02:00
|
|
|
requestId: string | null
|
2024-04-12 04:59:44 +02:00
|
|
|
followerHost: string | null
|
|
|
|
followerInbox: string | null
|
|
|
|
followerSharedInbox: string | null
|
|
|
|
followeeHost: string | null
|
|
|
|
followeeInbox: string | null
|
|
|
|
followeeSharedInbox: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Converts milliseconds to a human readable string. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function formatMilliseconds(milliseconds: number): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface GalleryLike {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
postId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface GalleryPost {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
updatedAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
title: string
|
|
|
|
description: string | null
|
|
|
|
userId: string
|
|
|
|
fileIds: Array<string>
|
|
|
|
isSensitive: boolean
|
|
|
|
likedCount: number
|
|
|
|
tags: Array<string>
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Generates a random string based on [thread_rng] and [Alphanumeric]. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function generateSecureRandomString(length: number): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function generateUserToken(): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The generated ID results in the form of `[8 chars timestamp] + [cuid2]`.
|
|
|
|
* The minimum and maximum lengths are 16 and 24, respectively.
|
|
|
|
* With the length of 16, namely 8 for cuid2, roughly 1427399 IDs are needed
|
|
|
|
* in the same millisecond to reach 50% chance of collision.
|
|
|
|
*
|
|
|
|
* Ref: <https://github.com/paralleldrive/cuid2#parameterized-length>
|
|
|
|
*/
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function genId(): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Generate an ID using a specific datetime */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function genIdAt(date: Date): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function getFullApAccount(username: string, host?: string | undefined | null): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function getImageSizeFromUrl(url: string): Promise<ImageSize>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function getNoteSummary(fileIds: Array<string>, text: string | undefined | null, cw: string | undefined | null, hasPoll: boolean): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function getTimestamp(id: string): number
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Prints the greeting message and the Firefish version to stdout. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function greet(): void
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Hashes the given password using [argon2] algorithm. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function hashPassword(password: string): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Hashtag {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
mentionedUserIds: Array<string>
|
|
|
|
mentionedUsersCount: number
|
|
|
|
mentionedLocalUserIds: Array<string>
|
|
|
|
mentionedLocalUsersCount: number
|
|
|
|
mentionedRemoteUserIds: Array<string>
|
|
|
|
mentionedRemoteUsersCount: number
|
|
|
|
attachedUserIds: Array<string>
|
|
|
|
attachedUsersCount: number
|
|
|
|
attachedLocalUserIds: Array<string>
|
|
|
|
attachedLocalUsersCount: number
|
|
|
|
attachedRemoteUserIds: Array<string>
|
|
|
|
attachedRemoteUsersCount: number
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export const HOUR: number
|
|
|
|
|
|
|
|
export interface IdConfig {
|
|
|
|
length?: number
|
|
|
|
fingerprint?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ImageSize {
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
}
|
|
|
|
|
|
|
|
/** The third party sites this server can retrieve messages from for combined display with regular traffic. */
|
2024-07-05 09:21:16 +02:00
|
|
|
export declare enum Inbound {
|
2024-06-18 02:17:25 +02:00
|
|
|
Atom1 = 0,
|
|
|
|
Gnusocial = 1,
|
|
|
|
Imap = 2,
|
|
|
|
Pnut = 3,
|
|
|
|
Pop3 = 4,
|
|
|
|
Pumpio = 5,
|
|
|
|
Rss2 = 6,
|
|
|
|
Twitter = 7
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Initializes the [tracing] logger. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function initializeRustLogger(): void
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Instance {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
caughtAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
host: string
|
|
|
|
usersCount: number
|
|
|
|
notesCount: number
|
|
|
|
followingCount: number
|
|
|
|
followersCount: number
|
2024-05-19 12:15:58 +02:00
|
|
|
latestRequestSentAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
latestStatus: number | null
|
2024-05-19 12:15:58 +02:00
|
|
|
latestRequestReceivedAt: DateTimeWithTimeZone | null
|
|
|
|
lastCommunicatedAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
isNotResponding: boolean
|
|
|
|
softwareName: string | null
|
|
|
|
softwareVersion: string | null
|
|
|
|
openRegistrations: boolean | null
|
|
|
|
name: string | null
|
|
|
|
description: string | null
|
|
|
|
maintainerName: string | null
|
|
|
|
maintainerEmail: string | null
|
2024-05-19 12:15:58 +02:00
|
|
|
infoUpdatedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
isSuspended: boolean
|
|
|
|
iconUrl: string | null
|
|
|
|
themeColor: string | null
|
|
|
|
faviconUrl: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if a server is allowlisted.
|
|
|
|
* Returns `Ok(true)` if private mode is disabled.
|
|
|
|
*
|
|
|
|
* # Argument
|
|
|
|
* `host` - punycoded instance host
|
|
|
|
*
|
|
|
|
* # Example
|
|
|
|
* ```no_run
|
|
|
|
* # use backend_rs::misc::check_server_block::is_allowed_server;
|
|
|
|
* # async fn f() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
* assert_eq!(true, is_allowed_server("allowed.com").await?);
|
|
|
|
* assert_eq!(false, is_allowed_server("not-allowed.com").await?);
|
|
|
|
* assert_eq!(false, is_allowed_server("subdomain.of.allowed.com").await?);
|
|
|
|
* assert_eq!(false, is_allowed_server("xn--l8jegik.allowed.com").await?);
|
|
|
|
* # Ok(())
|
|
|
|
* # }
|
|
|
|
* ```
|
|
|
|
*/
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isAllowedServer(host: string): Promise<boolean>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if a server is blocked.
|
|
|
|
*
|
|
|
|
* # Argument
|
|
|
|
* `host` - punycoded instance host
|
|
|
|
*
|
|
|
|
* # Example
|
|
|
|
* ```no_run
|
|
|
|
* # use backend_rs::misc::check_server_block::is_blocked_server;
|
|
|
|
* # async fn f() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
* assert_eq!(true, is_blocked_server("blocked.com").await?);
|
|
|
|
* assert_eq!(false, is_blocked_server("not-blocked.com").await?);
|
|
|
|
* assert_eq!(true, is_blocked_server("subdomain.of.blocked.com").await?);
|
|
|
|
* assert_eq!(true, is_blocked_server("xn--l8jegik.blocked.com").await?);
|
|
|
|
* # Ok(())
|
|
|
|
* # }
|
|
|
|
* ```
|
|
|
|
*/
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isBlockedServer(host: string): Promise<boolean>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Returns whether the [bcrypt] algorithm is used for the password hash. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isOldPasswordAlgorithm(hash: string): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isQuote(note: NoteLikeForIsQuote): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isSafeUrl(url: string): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isSameOrigin(uri: string): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isSelfHost(host?: string | undefined | null): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if a server is silenced.
|
|
|
|
*
|
|
|
|
* # Argument
|
|
|
|
* `host` - punycoded instance host
|
|
|
|
*
|
|
|
|
* # Example
|
|
|
|
* ```no_run
|
|
|
|
* # use backend_rs::misc::check_server_block::is_silenced_server;
|
|
|
|
* # async fn f() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
* assert_eq!(true, is_silenced_server("silenced.com").await?);
|
|
|
|
* assert_eq!(false, is_silenced_server("not-silenced.com").await?);
|
|
|
|
* assert_eq!(true, is_silenced_server("subdomain.of.silenced.com").await?);
|
|
|
|
* assert_eq!(true, is_silenced_server("xn--l8jegik.silenced.com").await?);
|
|
|
|
* # Ok(())
|
|
|
|
* # }
|
|
|
|
* ```
|
|
|
|
*/
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isSilencedServer(host: string): Promise<boolean>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function isUnicodeEmoji(s: string): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Returns the latest Firefish version. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function latestVersion(): Promise<string>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface LibreTranslateConfig {
|
|
|
|
managed?: boolean
|
|
|
|
apiUrl?: string
|
|
|
|
apiKey?: string
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function loadConfig(): Config
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface Memory {
|
|
|
|
/** Total memory amount in bytes */
|
|
|
|
total: number
|
|
|
|
/** Used memory amount in bytes */
|
|
|
|
used: number
|
|
|
|
/** Available (for (re)use) memory amount in bytes */
|
|
|
|
available: number
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function memoryUsage(): Memory
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface MessagingMessage {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
recipientId: string | null
|
|
|
|
text: string | null
|
|
|
|
isRead: boolean
|
|
|
|
fileId: string | null
|
|
|
|
groupId: string | null
|
|
|
|
reads: Array<string>
|
|
|
|
uri: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Meta {
|
|
|
|
id: string
|
|
|
|
name: string | null
|
|
|
|
description: string | null
|
|
|
|
maintainerName: string | null
|
|
|
|
maintainerEmail: string | null
|
|
|
|
disableRegistration: boolean
|
|
|
|
disableLocalTimeline: boolean
|
|
|
|
disableGlobalTimeline: boolean
|
|
|
|
useStarForReactionFallback: boolean
|
|
|
|
langs: Array<string>
|
|
|
|
hiddenTags: Array<string>
|
|
|
|
blockedHosts: Array<string>
|
|
|
|
mascotImageUrl: string | null
|
|
|
|
bannerUrl: string | null
|
|
|
|
errorImageUrl: string | null
|
|
|
|
iconUrl: string | null
|
|
|
|
cacheRemoteFiles: boolean
|
|
|
|
enableRecaptcha: boolean
|
|
|
|
recaptchaSiteKey: string | null
|
|
|
|
recaptchaSecretKey: string | null
|
|
|
|
localDriveCapacityMb: number
|
|
|
|
remoteDriveCapacityMb: number
|
|
|
|
summalyProxy: string | null
|
|
|
|
enableEmail: boolean
|
|
|
|
email: string | null
|
|
|
|
smtpSecure: boolean
|
|
|
|
smtpHost: string | null
|
|
|
|
smtpPort: number | null
|
|
|
|
smtpUser: string | null
|
|
|
|
smtpPass: string | null
|
|
|
|
enableServiceWorker: boolean
|
|
|
|
swPublicKey: string | null
|
|
|
|
swPrivateKey: string | null
|
|
|
|
pinnedUsers: Array<string>
|
|
|
|
tosUrl: string | null
|
|
|
|
repositoryUrl: string
|
|
|
|
feedbackUrl: string | null
|
|
|
|
useObjectStorage: boolean
|
|
|
|
objectStorageBucket: string | null
|
|
|
|
objectStoragePrefix: string | null
|
|
|
|
objectStorageBaseUrl: string | null
|
|
|
|
objectStorageEndpoint: string | null
|
|
|
|
objectStorageRegion: string | null
|
|
|
|
objectStorageAccessKey: string | null
|
|
|
|
objectStorageSecretKey: string | null
|
|
|
|
objectStoragePort: number | null
|
|
|
|
objectStorageUseSsl: boolean
|
|
|
|
proxyAccountId: string | null
|
|
|
|
objectStorageUseProxy: boolean
|
|
|
|
enableHcaptcha: boolean
|
|
|
|
hcaptchaSiteKey: string | null
|
|
|
|
hcaptchaSecretKey: string | null
|
|
|
|
objectStorageSetPublicRead: boolean
|
|
|
|
pinnedPages: Array<string>
|
|
|
|
backgroundImageUrl: string | null
|
|
|
|
logoImageUrl: string | null
|
|
|
|
pinnedClipId: string | null
|
|
|
|
objectStorageS3ForcePathStyle: boolean
|
|
|
|
allowedHosts: Array<string> | null
|
|
|
|
secureMode: boolean | null
|
|
|
|
privateMode: boolean | null
|
|
|
|
deeplAuthKey: string | null
|
|
|
|
deeplIsPro: boolean
|
|
|
|
emailRequiredForSignup: boolean
|
|
|
|
themeColor: string | null
|
|
|
|
defaultLightTheme: string | null
|
|
|
|
defaultDarkTheme: string | null
|
|
|
|
enableIpLogging: boolean
|
|
|
|
enableActiveEmailValidation: boolean
|
|
|
|
customMotd: Array<string>
|
|
|
|
customSplashIcons: Array<string>
|
|
|
|
disableRecommendedTimeline: boolean
|
|
|
|
recommendedInstances: Array<string>
|
|
|
|
enableGuestTimeline: boolean
|
|
|
|
defaultReaction: string
|
|
|
|
libreTranslateApiUrl: string | null
|
|
|
|
libreTranslateApiKey: string | null
|
|
|
|
silencedHosts: Array<string>
|
|
|
|
experimentalFeatures: Json
|
|
|
|
enableServerMachineStats: boolean
|
|
|
|
enableIdenticonGeneration: boolean
|
|
|
|
donationLink: string | null
|
|
|
|
moreUrls: Json
|
|
|
|
markLocalFilesNsfwByDefault: boolean
|
2024-04-22 01:31:28 +02:00
|
|
|
antennaLimit: number
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function metaToPugArgs(meta: Meta): PugArgs
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Migrations {
|
|
|
|
id: number
|
|
|
|
timestamp: number
|
|
|
|
name: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export const MINUTE: number
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface ModerationLog {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
type: string
|
|
|
|
info: Json
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface MutedNote {
|
|
|
|
id: string
|
|
|
|
noteId: string
|
|
|
|
userId: string
|
2024-05-23 13:49:49 +02:00
|
|
|
reason: MutedNoteReason
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type MutedNoteReason = 'manual'|
|
|
|
|
'other'|
|
|
|
|
'spam'|
|
|
|
|
'word';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Muting {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
muteeId: string
|
|
|
|
muterId: string
|
2024-05-19 12:15:58 +02:00
|
|
|
expiresAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** NodeInfo schema version 2.0. <https://nodeinfo.diaspora.software/docson/index.html#/ns/schema/2.0> */
|
|
|
|
export interface Nodeinfo {
|
|
|
|
/** Metadata about server software in use. */
|
|
|
|
software: Software20
|
|
|
|
/** The protocols supported on this server. */
|
|
|
|
protocols: Array<Protocol>
|
|
|
|
/** The third party sites this server can connect to via their application API. */
|
|
|
|
services: Services
|
|
|
|
/** Whether this server allows open self-registration. */
|
|
|
|
openRegistrations: boolean
|
|
|
|
/** Usage statistics for this server. */
|
|
|
|
usage: Usage
|
|
|
|
/** Free form key value pairs for software specific values. Clients should not rely on any specific key present. */
|
|
|
|
metadata: Record<string, any>
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function nodeinfo_2_0(): Promise<any>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function nodeinfo_2_1(): Promise<any>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Note {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
replyId: string | null
|
|
|
|
renoteId: string | null
|
|
|
|
text: string | null
|
|
|
|
name: string | null
|
|
|
|
cw: string | null
|
|
|
|
userId: string
|
|
|
|
localOnly: boolean
|
|
|
|
renoteCount: number
|
|
|
|
repliesCount: number
|
|
|
|
reactions: Json
|
2024-05-23 13:49:49 +02:00
|
|
|
visibility: NoteVisibility
|
2024-04-12 04:59:44 +02:00
|
|
|
uri: string | null
|
|
|
|
score: number
|
|
|
|
fileIds: Array<string>
|
|
|
|
attachedFileTypes: Array<string>
|
|
|
|
visibleUserIds: Array<string>
|
|
|
|
mentions: Array<string>
|
|
|
|
mentionedRemoteUsers: string
|
|
|
|
emojis: Array<string>
|
|
|
|
tags: Array<string>
|
|
|
|
hasPoll: boolean
|
|
|
|
userHost: string | null
|
|
|
|
replyUserId: string | null
|
|
|
|
replyUserHost: string | null
|
|
|
|
renoteUserId: string | null
|
|
|
|
renoteUserHost: string | null
|
|
|
|
url: string | null
|
|
|
|
channelId: string | null
|
|
|
|
threadId: string | null
|
2024-05-19 12:15:58 +02:00
|
|
|
updatedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
lang: string | null
|
2024-05-27 14:01:42 +02:00
|
|
|
scheduledAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteEdit {
|
|
|
|
id: string
|
|
|
|
noteId: string
|
|
|
|
text: string | null
|
|
|
|
cw: string | null
|
|
|
|
fileIds: Array<string>
|
2024-05-19 12:15:58 +02:00
|
|
|
updatedAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
emojis: Array<string>
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteFavorite {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteFile {
|
|
|
|
serialNo: number
|
|
|
|
noteId: string
|
|
|
|
fileId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-06-22 16:54:37 +02:00
|
|
|
export interface NoteLikeForIsQuote {
|
|
|
|
renoteId: string | null
|
|
|
|
text: string | null
|
|
|
|
hasPoll: boolean
|
|
|
|
fileIds: Array<string>
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteReaction {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
reaction: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteThreadMuting {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
threadId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteUnread {
|
|
|
|
id: string
|
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
noteUserId: string
|
|
|
|
isSpecified: boolean
|
|
|
|
isMentioned: boolean
|
|
|
|
noteChannelId: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type NoteVisibility = 'followers'|
|
|
|
|
'hidden'|
|
|
|
|
'home'|
|
|
|
|
'public'|
|
|
|
|
'specified';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface NoteWatching {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
noteUserId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface Notification {
|
|
|
|
id: string
|
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
notifieeId: string
|
|
|
|
notifierId: string | null
|
|
|
|
isRead: boolean
|
|
|
|
noteId: string | null
|
|
|
|
reaction: string | null
|
|
|
|
choice: number | null
|
|
|
|
followRequestId: string | null
|
|
|
|
type: NotificationType
|
|
|
|
userGroupInvitationId: string | null
|
|
|
|
customBody: string | null
|
|
|
|
customHeader: string | null
|
|
|
|
customIcon: string | null
|
|
|
|
appAccessTokenId: string | null
|
|
|
|
}
|
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type NotificationType = 'app'|
|
|
|
|
'follow'|
|
|
|
|
'followRequestAccepted'|
|
|
|
|
'groupInvited'|
|
|
|
|
'mention'|
|
|
|
|
'pollEnded'|
|
|
|
|
'pollVote'|
|
|
|
|
'quote'|
|
|
|
|
'reaction'|
|
|
|
|
'receiveFollowRequest'|
|
|
|
|
'renote'|
|
|
|
|
'reply';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Converts the given text into the cat language.
|
|
|
|
*
|
|
|
|
* refs:
|
|
|
|
* * <https://misskey-hub.net/ns#isCat>
|
|
|
|
* * <https://firefish.dev/ns#speakAsCat>
|
|
|
|
*
|
|
|
|
* # Arguments
|
|
|
|
*
|
|
|
|
* * `text` : original text
|
|
|
|
* * `lang` : language code (e.g., `Some("en")`, `Some("en-US")`, `Some("uk-UA")`, `None`)
|
|
|
|
*
|
|
|
|
* # Example
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
* # use backend_rs::misc::nyaify::nyaify;
|
|
|
|
* assert_eq!(nyaify("I'll take a nap.", Some("en")), "I'll take a nyap.");
|
|
|
|
* ```
|
|
|
|
*/
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function nyaify(text: string, lang?: string | undefined | null): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface ObjectStorageConfig {
|
|
|
|
managed?: boolean
|
|
|
|
baseUrl?: string
|
|
|
|
bucket?: string
|
|
|
|
prefix?: string
|
|
|
|
endpoint?: string
|
|
|
|
region?: string
|
|
|
|
accessKey?: string
|
|
|
|
secretKey?: string
|
|
|
|
useSsl?: boolean
|
|
|
|
connnectOverProxy?: boolean
|
|
|
|
setPublicReadOnUpload?: boolean
|
|
|
|
s3ForcePathStyle?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
/** The third party sites this server can publish messages to on the behalf of a user. */
|
2024-07-05 09:21:16 +02:00
|
|
|
export declare enum Outbound {
|
2024-06-18 02:17:25 +02:00
|
|
|
Atom1 = 0,
|
|
|
|
Blogger = 1,
|
|
|
|
Buddycloud = 2,
|
|
|
|
Diaspora = 3,
|
|
|
|
Dreamwidth = 4,
|
|
|
|
Drupal = 5,
|
|
|
|
Facebook = 6,
|
|
|
|
Friendica = 7,
|
|
|
|
Gnusocial = 8,
|
|
|
|
Google = 9,
|
|
|
|
Insanejournal = 10,
|
|
|
|
Libertree = 11,
|
|
|
|
Linkedin = 12,
|
|
|
|
Livejournal = 13,
|
|
|
|
Mediagoblin = 14,
|
|
|
|
Myspace = 15,
|
|
|
|
Pinterest = 16,
|
|
|
|
Pnut = 17,
|
|
|
|
Posterous = 18,
|
|
|
|
Pumpio = 19,
|
|
|
|
Redmatrix = 20,
|
|
|
|
Rss2 = 21,
|
|
|
|
Smtp = 22,
|
|
|
|
Tent = 23,
|
|
|
|
Tumblr = 24,
|
|
|
|
Twitter = 25,
|
|
|
|
Wordpress = 26,
|
|
|
|
Xmpp = 27
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface PackedEmoji {
|
2024-04-12 04:59:44 +02:00
|
|
|
id: string
|
2024-06-18 02:17:25 +02:00
|
|
|
aliases: Array<string>
|
|
|
|
name: string
|
|
|
|
category: string | null
|
|
|
|
host: string | null
|
|
|
|
url: string
|
|
|
|
license: string | null
|
|
|
|
width: number | null
|
|
|
|
height: number | null
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Page {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
updatedAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
title: string
|
|
|
|
name: string
|
|
|
|
summary: string | null
|
|
|
|
alignCenter: boolean
|
|
|
|
font: string
|
|
|
|
userId: string
|
|
|
|
eyeCatchingImageId: string | null
|
|
|
|
content: Json
|
|
|
|
variables: Json
|
2024-05-23 13:49:49 +02:00
|
|
|
visibility: PageVisibility
|
2024-04-12 04:59:44 +02:00
|
|
|
visibleUserIds: Array<string>
|
|
|
|
likedCount: number
|
|
|
|
hideTitleWhenPinned: boolean
|
|
|
|
script: string
|
|
|
|
isPublic: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface PageLike {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
pageId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type PageVisibility = 'followers'|
|
|
|
|
'public'|
|
|
|
|
'specified';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface PartialNoteToCheckWordMute {
|
|
|
|
fileIds: Array<string>
|
|
|
|
text: string | null
|
|
|
|
cw: string | null
|
|
|
|
renoteId: string | null
|
|
|
|
replyId: string | null
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface PasswordResetRequest {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
token: string
|
|
|
|
userId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Poll {
|
|
|
|
noteId: string
|
2024-05-19 12:15:58 +02:00
|
|
|
expiresAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
multiple: boolean
|
|
|
|
choices: Array<string>
|
|
|
|
votes: Array<number>
|
2024-05-23 13:49:49 +02:00
|
|
|
noteVisibility: PollNoteVisibility
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
userHost: string | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type PollNoteVisibility = 'followers'|
|
|
|
|
'home'|
|
|
|
|
'public'|
|
|
|
|
'specified';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface PollVote {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
choice: number
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface PromoNote {
|
|
|
|
noteId: string
|
2024-05-19 12:15:58 +02:00
|
|
|
expiresAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface PromoRead {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export declare enum Protocol {
|
2024-06-18 02:17:25 +02:00
|
|
|
Activitypub = 0,
|
|
|
|
Buddycloud = 1,
|
|
|
|
Dfrn = 2,
|
|
|
|
Diaspora = 3,
|
|
|
|
Libertree = 4,
|
|
|
|
Ostatus = 5,
|
|
|
|
Pumpio = 6,
|
|
|
|
Tent = 7,
|
|
|
|
Xmpp = 8,
|
|
|
|
Zot = 9
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToBroadcastStream(emoji: PackedEmoji): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToChannelStream(channelId: string, userId: string): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToChatIndexStream(userId: string, kind: ChatIndexEvent, object: any): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToChatStream(senderUserId: string, receiverUserId: string, kind: ChatEvent, object: any): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToDriveFileStream(userId: string, kind: DriveFileEvent, object: any): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToDriveFolderStream(userId: string, kind: DriveFolderEvent, object: any): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToGroupChatStream(groupId: string, kind: ChatEvent, object: any): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToModerationStream(moderatorId: string, report: AbuseUserReportLike): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function publishToNotesStream(note: Note): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface PugArgs {
|
|
|
|
img: string | null
|
|
|
|
title: string
|
|
|
|
instanceName: string
|
|
|
|
desc: string | null
|
|
|
|
icon: string | null
|
|
|
|
splashIcon: string | null
|
|
|
|
themeColor: string | null
|
|
|
|
randomMotd: string
|
|
|
|
privateMode: boolean | null
|
|
|
|
}
|
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type PushNotificationKind = 'generic'|
|
|
|
|
'chat'|
|
|
|
|
'readAllChats'|
|
|
|
|
'readAllChatsInTheRoom'|
|
|
|
|
'readNotifications'|
|
|
|
|
'readAllNotifications'|
|
|
|
|
'mastodon';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-08 17:42:27 +02:00
|
|
|
export type PushSubscriptionType = 'adminReport'|
|
|
|
|
'adminSignUp'|
|
|
|
|
'favourite'|
|
|
|
|
'follow'|
|
|
|
|
'followRequest'|
|
|
|
|
'mention'|
|
|
|
|
'poll'|
|
|
|
|
'reblog'|
|
|
|
|
'status'|
|
|
|
|
'update';
|
2024-06-22 16:54:37 +02:00
|
|
|
|
2024-06-18 02:17:25 +02:00
|
|
|
export interface RedisConfig {
|
|
|
|
host: string
|
|
|
|
port: number
|
|
|
|
family?: number
|
|
|
|
user?: string
|
|
|
|
pass?: string
|
|
|
|
tls?: TlsConfig
|
|
|
|
db: number
|
|
|
|
prefix?: string
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface RegistrationTicket {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
code: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface RegistryItem {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
updatedAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
key: string
|
|
|
|
scope: Array<string>
|
|
|
|
domain: string | null
|
|
|
|
value: Json | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Relay {
|
|
|
|
id: string
|
|
|
|
inbox: string
|
2024-05-23 13:49:49 +02:00
|
|
|
status: RelayStatus
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type RelayStatus = 'accepted'|
|
|
|
|
'rejected'|
|
|
|
|
'requesting';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Delete all entries in the [attestation_challenge] table created at more than 5 minutes ago */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function removeOldAttestationChallenges(): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface RenoteMuting {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
muteeId: string
|
|
|
|
muterId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface ReplyMuting {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
muteeId: string
|
|
|
|
muterId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Returns `true` if `src` does not contain suspicious characters like `%`. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function safeForSql(src: string): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export const SECOND: number
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function sendPushNotification(receiverUserId: string, kind: PushNotificationKind, content: any): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface ServerConfig {
|
|
|
|
url: string
|
|
|
|
port: number
|
|
|
|
/** the host address to bind to */
|
|
|
|
bind?: string
|
|
|
|
disableHsts?: boolean
|
|
|
|
/** PostgreSQL configurations */
|
|
|
|
db: DbConfig
|
|
|
|
/** Redis configurations */
|
|
|
|
redis: RedisConfig
|
|
|
|
/** secondary Redis server configurations */
|
|
|
|
cacheServer?: RedisConfig
|
|
|
|
/** proxy host used for HTTP requests */
|
|
|
|
proxy?: string
|
|
|
|
/** proxy host used for SMTP requests */
|
|
|
|
proxySmtp?: string
|
|
|
|
/** hosts to bypass the proxy */
|
|
|
|
proxyBypassHosts?: Array<string>
|
|
|
|
allowedPrivateNetworks?: Array<string>
|
|
|
|
/** maximum file size that can be uploaded to the drive (in bytes) */
|
|
|
|
maxFileSize?: number
|
|
|
|
accessLog?: string
|
|
|
|
clusterLimits?: WorkerConfigInternal
|
|
|
|
cuid?: IdConfig
|
|
|
|
outgoingAddress?: string
|
|
|
|
deliverJobConcurrency?: number
|
|
|
|
inboxJobConcurrency?: number
|
|
|
|
deliverJobPerSec?: number
|
|
|
|
inboxJobPerSec?: number
|
|
|
|
deliverJobMaxAttempts?: number
|
|
|
|
inboxJobMaxAttempts?: number
|
|
|
|
/** deprecated in favor of `max_log_level` */
|
|
|
|
logLevel?: Array<string>
|
|
|
|
/** verbosity of the server log. `error`, `warn`, `info`, `debug`, or `trace` */
|
|
|
|
maxLogLevel?: string
|
|
|
|
syslog?: SysLogConfig
|
|
|
|
proxyRemoteFiles?: boolean
|
|
|
|
mediaProxy?: string
|
|
|
|
summalyProxyUrl?: string
|
|
|
|
reservedUsernames?: Array<string>
|
|
|
|
maxUserSignups?: number
|
|
|
|
isManagedHosting?: boolean
|
|
|
|
maxNoteLength?: number
|
|
|
|
maxCaptionLength?: number
|
|
|
|
deepl?: DeepLConfig
|
|
|
|
libreTranslate?: LibreTranslateConfig
|
|
|
|
email?: EmailConfig
|
|
|
|
objectStorage?: ObjectStorageConfig
|
2024-04-19 14:59:12 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** The third party sites this server can connect to via their application API. */
|
|
|
|
export interface Services {
|
|
|
|
/** The third party sites this server can retrieve messages from for combined display with regular traffic. */
|
|
|
|
inbound: Array<Inbound>
|
|
|
|
/** The third party sites this server can publish messages to on the behalf of a user. */
|
|
|
|
outbound: Array<Outbound>
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-04 18:24:14 +02:00
|
|
|
export declare function shouldNyaify(readerUserId: string): Promise<boolean>
|
|
|
|
|
2024-06-18 02:17:25 +02:00
|
|
|
/** Prints the server hardware information as the server info log. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function showServerInfo(): void
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Signin {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
ip: string
|
|
|
|
headers: Json
|
|
|
|
success: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Metadata about server software in use (version 2.0). */
|
|
|
|
export interface Software20 {
|
|
|
|
/** The canonical name of this server software. */
|
|
|
|
name: string
|
|
|
|
/** The version of this server software. */
|
|
|
|
version: string
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Escapes `%` and `\` in the given string. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function sqlLikeEscape(src: string): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:54:11 +02:00
|
|
|
export declare function sqlRegexEscape(src: string): string
|
2024-06-22 16:54:37 +02:00
|
|
|
|
2024-06-18 02:17:25 +02:00
|
|
|
export interface Storage {
|
|
|
|
/** Total storage space in bytes */
|
|
|
|
total: number
|
|
|
|
/** Used storage space in bytes */
|
|
|
|
used: number
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function storageUsage(): Storage | null
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function stringToAcct(acct: string): Acct
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface SwSubscription {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
endpoint: string
|
|
|
|
auth: string
|
|
|
|
publickey: string
|
|
|
|
sendReadMessage: boolean
|
2024-05-29 16:40:56 +02:00
|
|
|
appAccessTokenId: string | null
|
2024-06-05 00:14:13 +02:00
|
|
|
subscriptionTypes: Array<PushSubscriptionType>
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface SysLogConfig {
|
|
|
|
host: string
|
|
|
|
port: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TlsConfig {
|
|
|
|
host: string
|
|
|
|
rejectUnauthorized: boolean
|
|
|
|
}
|
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function toDbReaction(reaction?: string | undefined | null, host?: string | undefined | null): Promise<string>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function toPuny(host: string): string
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function unwatchNote(watcherId: string, noteId: string): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function updateAntennaCache(): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function updateAntennasOnNewNote(note: Note, noteAuthor: Acct, noteMutedUsers: Array<string>): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function updateMetaCache(): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function updateNodeinfoCache(): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Usage statistics for this server. */
|
|
|
|
export interface Usage {
|
|
|
|
users: Users
|
|
|
|
localPosts: number | null
|
|
|
|
localComments: number | null
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UsedUsername {
|
|
|
|
username: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface User {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
|
|
|
updatedAt: DateTimeWithTimeZone | null
|
|
|
|
lastFetchedAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
username: string
|
|
|
|
usernameLower: string
|
|
|
|
name: string | null
|
|
|
|
followersCount: number
|
|
|
|
followingCount: number
|
|
|
|
notesCount: number
|
|
|
|
avatarId: string | null
|
|
|
|
bannerId: string | null
|
|
|
|
tags: Array<string>
|
|
|
|
isSuspended: boolean
|
|
|
|
isSilenced: boolean
|
|
|
|
isLocked: boolean
|
|
|
|
isBot: boolean
|
|
|
|
isCat: boolean
|
|
|
|
isAdmin: boolean
|
|
|
|
isModerator: boolean
|
|
|
|
emojis: Array<string>
|
|
|
|
host: string | null
|
|
|
|
inbox: string | null
|
|
|
|
sharedInbox: string | null
|
|
|
|
featured: string | null
|
|
|
|
uri: string | null
|
|
|
|
token: string | null
|
|
|
|
isExplorable: boolean
|
|
|
|
followersUri: string | null
|
2024-05-19 12:15:58 +02:00
|
|
|
lastActiveDate: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
hideOnlineStatus: boolean
|
|
|
|
isDeleted: boolean
|
|
|
|
driveCapacityOverrideMb: number | null
|
|
|
|
movedToUri: string | null
|
|
|
|
speakAsCat: boolean
|
2024-05-23 13:49:49 +02:00
|
|
|
emojiModPerm: UserEmojiModPerm
|
2024-04-12 04:59:44 +02:00
|
|
|
isIndexable: boolean
|
2024-04-26 05:14:34 +02:00
|
|
|
alsoKnownAs: Array<string> | null
|
2024-07-04 18:24:14 +02:00
|
|
|
readCatLanguage: boolean
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export const USER_ACTIVE_THRESHOLD: number
|
|
|
|
|
|
|
|
export const USER_ONLINE_THRESHOLD: number
|
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type UserEmojiModPerm = 'add'|
|
|
|
|
'full'|
|
|
|
|
'mod'|
|
|
|
|
'unauthorized';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserGroup {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
name: string
|
|
|
|
userId: string
|
|
|
|
isPrivate: boolean
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserGroupInvitation {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
userGroupId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserGroupInvite {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
userGroupId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserGroupJoining {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
userGroupId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserIp {
|
|
|
|
id: number
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
ip: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserKeypair {
|
|
|
|
userId: string
|
|
|
|
publicKey: string
|
|
|
|
privateKey: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserList {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
name: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserListJoining {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
userListId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserNotePining {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
noteId: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserPending {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
code: string
|
|
|
|
username: string
|
|
|
|
email: string
|
|
|
|
password: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserProfile {
|
|
|
|
userId: string
|
|
|
|
location: string | null
|
|
|
|
birthday: string | null
|
|
|
|
description: string | null
|
|
|
|
fields: Json
|
|
|
|
url: string | null
|
|
|
|
email: string | null
|
|
|
|
emailVerifyCode: string | null
|
|
|
|
emailVerified: boolean
|
|
|
|
twoFactorTempSecret: string | null
|
|
|
|
twoFactorSecret: string | null
|
|
|
|
twoFactorEnabled: boolean
|
|
|
|
password: string | null
|
|
|
|
autoAcceptFollowed: boolean
|
|
|
|
alwaysMarkNsfw: boolean
|
|
|
|
carefulBot: boolean
|
|
|
|
userHost: string | null
|
|
|
|
securityKeysAvailable: boolean
|
|
|
|
usePasswordLessLogin: boolean
|
|
|
|
pinnedPageId: string | null
|
|
|
|
injectFeaturedNote: boolean
|
|
|
|
enableWordMute: boolean
|
2024-05-23 13:49:49 +02:00
|
|
|
mutingNotificationTypes: Array<UserProfileMutingNotificationTypes>
|
2024-04-12 04:59:44 +02:00
|
|
|
noCrawle: boolean
|
|
|
|
receiveAnnouncementEmail: boolean
|
|
|
|
emailNotificationTypes: Json
|
|
|
|
publicReactions: boolean
|
2024-05-23 13:49:49 +02:00
|
|
|
ffVisibility: UserProfileFfvisibility
|
2024-04-12 04:59:44 +02:00
|
|
|
moderationNote: string
|
|
|
|
preventAiLearning: boolean
|
|
|
|
isIndexable: boolean
|
|
|
|
mutedPatterns: Array<string>
|
2024-07-04 18:38:52 +02:00
|
|
|
mentions: Json
|
2024-05-17 10:59:45 +02:00
|
|
|
mutedInstances: Array<string>
|
|
|
|
mutedWords: Array<string>
|
2024-05-06 16:13:31 +02:00
|
|
|
lang: string | null
|
2024-04-12 04:59:44 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-05 09:21:16 +02:00
|
|
|
export type UserProfileFfvisibility = 'followers'|
|
|
|
|
'private'|
|
|
|
|
'public';
|
|
|
|
|
|
|
|
export type UserProfileMutingNotificationTypes = 'app'|
|
|
|
|
'follow'|
|
|
|
|
'followRequestAccepted'|
|
|
|
|
'groupInvited'|
|
|
|
|
'mention'|
|
|
|
|
'pollEnded'|
|
|
|
|
'pollVote'|
|
|
|
|
'quote'|
|
|
|
|
'reaction'|
|
|
|
|
'receiveFollowRequest'|
|
|
|
|
'renote'|
|
|
|
|
'reply';
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserPublickey {
|
|
|
|
userId: string
|
|
|
|
keyId: string
|
|
|
|
keyPem: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** statistics about the users of this server. */
|
|
|
|
export interface Users {
|
|
|
|
total: number | null
|
|
|
|
activeHalfyear: number | null
|
|
|
|
activeMonth: number | null
|
|
|
|
}
|
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface UserSecurityKey {
|
|
|
|
id: string
|
|
|
|
userId: string
|
|
|
|
publicKey: string
|
2024-05-19 12:15:58 +02:00
|
|
|
lastUsed: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
name: string
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
/** Checks whether the given password and hash match. */
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function verifyPassword(password: string, hash: string): boolean
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-07-02 16:31:28 +02:00
|
|
|
export declare function watchNote(watcherId: string, noteAuthorId: string, noteId: string): Promise<void>
|
2024-06-18 02:17:25 +02:00
|
|
|
|
2024-04-12 04:59:44 +02:00
|
|
|
export interface Webhook {
|
|
|
|
id: string
|
2024-05-19 12:15:58 +02:00
|
|
|
createdAt: DateTimeWithTimeZone
|
2024-04-12 04:59:44 +02:00
|
|
|
userId: string
|
|
|
|
name: string
|
|
|
|
on: Array<string>
|
|
|
|
url: string
|
|
|
|
secret: string
|
|
|
|
active: boolean
|
2024-05-19 12:15:58 +02:00
|
|
|
latestSentAt: DateTimeWithTimeZone | null
|
2024-04-12 04:59:44 +02:00
|
|
|
latestStatus: number | null
|
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface WorkerConfig {
|
|
|
|
web: number
|
|
|
|
queue: number
|
2024-04-25 22:44:37 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|
|
|
|
export interface WorkerConfigInternal {
|
|
|
|
web?: number
|
|
|
|
queue?: number
|
2024-06-06 10:10:39 +02:00
|
|
|
}
|
2024-06-18 02:17:25 +02:00
|
|
|
|