From dddd2779c0698ad3c92a1d078825f17c58a99ecc Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 16 May 2024 04:57:48 +0900 Subject: [PATCH] chore: update auto-generated files --- packages/backend-rs/index.d.ts | 49 ++++++++++++++++------------------ packages/backend-rs/index.js | 12 ++++----- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/packages/backend-rs/index.d.ts b/packages/backend-rs/index.d.ts index 6c549bd257..4aab6a46b6 100644 --- a/packages/backend-rs/index.d.ts +++ b/packages/backend-rs/index.d.ts @@ -41,7 +41,6 @@ export interface ServerConfig { proxySmtp?: string proxyBypassHosts?: Array allowedPrivateNetworks?: Array - /** `NapiValue` is not implemented for `u64` */ maxFileSize?: number accessLog?: string clusterLimits?: WorkerConfigInternal @@ -212,8 +211,8 @@ export interface Acct { } export function stringToAcct(acct: string): Acct export function acctToString(acct: Acct): string -export function initializeRustLogger(): void export function showServerInfo(): void +export function initializeRustLogger(): void export function addNoteToAntenna(antennaId: string, note: Note): void /** * Checks if a server is blocked. @@ -237,7 +236,6 @@ export function isSilencedServer(host: string): Promise * `host` - punycoded instance host */ export function isAllowedServer(host: string): Promise -/** TODO: handle name collisions better */ export interface NoteLikeForCheckWordMute { fileIds: Array userId: string | null @@ -262,7 +260,6 @@ export interface ImageSize { height: number } export function getImageSizeFromUrl(url: string): Promise -/** TODO: handle name collisions better */ export interface NoteLikeForGetNoteSummary { fileIds: Array text: string | null @@ -270,6 +267,28 @@ export interface NoteLikeForGetNoteSummary { hasPoll: boolean } export function getNoteSummary(note: NoteLikeForGetNoteSummary): string +export interface Cpu { + model: string + cores: number +} +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 +} +export interface Storage { + /** Total storage space in bytes */ + total: number + /** Used storage space in bytes */ + used: number +} +export function cpuInfo(): Cpu +export function cpuUsage(): number +export function memoryUsage(): Memory +export function storageUsage(): Storage | null export function isSafeUrl(url: string): boolean export function latestVersion(): Promise export function toMastodonId(firefishId: string): string | null @@ -301,28 +320,6 @@ export function countReactions(reactions: Record): Record /** Delete all entries in the "attestation_challenge" table created at more than 5 minutes ago */ export function removeOldAttestationChallenges(): Promise -export interface Cpu { - model: string - cores: number -} -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 -} -export interface Storage { - /** Total storage space in bytes */ - total: number - /** Used storage space in bytes */ - used: number -} -export function cpuInfo(): Cpu -export function cpuUsage(): number -export function memoryUsage(): Memory -export function storageUsage(): Storage | null export interface AbuseUserReport { id: string createdAt: Date diff --git a/packages/backend-rs/index.js b/packages/backend-rs/index.js index 7819b4e7f1..b05fc34adb 100644 --- a/packages/backend-rs/index.js +++ b/packages/backend-rs/index.js @@ -310,7 +310,7 @@ if (!nativeBinding) { throw new Error(`Failed to load native binding`) } -const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, loadEnv, loadConfig, stringToAcct, acctToString, initializeRustLogger, showServerInfo, addNoteToAntenna, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, getNoteSummary, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, cpuInfo, cpuUsage, memoryUsage, storageUsage, AntennaSrcEnum, DriveFileUsageHintEnum, MutedNoteReasonEnum, NoteVisibilityEnum, NotificationTypeEnum, PageVisibilityEnum, PollNotevisibilityEnum, RelayStatusEnum, UserEmojimodpermEnum, UserProfileFfvisibilityEnum, UserProfileMutingnotificationtypesEnum, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, Protocol, Inbound, Outbound, watchNote, unwatchNote, publishToChannelStream, ChatEvent, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, publishToGroupChatStream, publishToModerationStream, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding +const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, loadEnv, loadConfig, stringToAcct, acctToString, showServerInfo, initializeRustLogger, addNoteToAntenna, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, getNoteSummary, cpuInfo, cpuUsage, memoryUsage, storageUsage, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, AntennaSrcEnum, DriveFileUsageHintEnum, MutedNoteReasonEnum, NoteVisibilityEnum, NotificationTypeEnum, PageVisibilityEnum, PollNotevisibilityEnum, RelayStatusEnum, UserEmojimodpermEnum, UserProfileFfvisibilityEnum, UserProfileMutingnotificationtypesEnum, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, Protocol, Inbound, Outbound, watchNote, unwatchNote, publishToChannelStream, ChatEvent, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, publishToGroupChatStream, publishToModerationStream, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding module.exports.SECOND = SECOND module.exports.MINUTE = MINUTE @@ -323,8 +323,8 @@ module.exports.loadEnv = loadEnv module.exports.loadConfig = loadConfig module.exports.stringToAcct = stringToAcct module.exports.acctToString = acctToString -module.exports.initializeRustLogger = initializeRustLogger module.exports.showServerInfo = showServerInfo +module.exports.initializeRustLogger = initializeRustLogger module.exports.addNoteToAntenna = addNoteToAntenna module.exports.isBlockedServer = isBlockedServer module.exports.isSilencedServer = isSilencedServer @@ -341,6 +341,10 @@ module.exports.safeForSql = safeForSql module.exports.formatMilliseconds = formatMilliseconds module.exports.getImageSizeFromUrl = getImageSizeFromUrl module.exports.getNoteSummary = getNoteSummary +module.exports.cpuInfo = cpuInfo +module.exports.cpuUsage = cpuUsage +module.exports.memoryUsage = memoryUsage +module.exports.storageUsage = storageUsage module.exports.isSafeUrl = isSafeUrl module.exports.latestVersion = latestVersion module.exports.toMastodonId = toMastodonId @@ -355,10 +359,6 @@ module.exports.decodeReaction = decodeReaction module.exports.countReactions = countReactions module.exports.toDbReaction = toDbReaction module.exports.removeOldAttestationChallenges = removeOldAttestationChallenges -module.exports.cpuInfo = cpuInfo -module.exports.cpuUsage = cpuUsage -module.exports.memoryUsage = memoryUsage -module.exports.storageUsage = storageUsage module.exports.AntennaSrcEnum = AntennaSrcEnum module.exports.DriveFileUsageHintEnum = DriveFileUsageHintEnum module.exports.MutedNoteReasonEnum = MutedNoteReasonEnum