From 4410989fa2d15df408146b402f31474fe5d98581 Mon Sep 17 00:00:00 2001 From: limepotato Date: Mon, 17 Jun 2024 18:18:03 +0200 Subject: [PATCH] revert ba0e5eec936d033e77035e664b3bd404cc8b7b9c revert ? --- .config/ci.yml | 195 + .vscode/extensions.json | 11 + .yarn/corepack.tgz | 4 +- assets/branding | 1 + packages/backend/assets/LICENSE | 13 + .../src/queue/processors/db/delete-account.ts | 103 + .../queue/processors/db/delete-drive-files.ts | 61 + .../queue/processors/db/export-blocking.ts | 105 + .../processors/db/export-custom-emojis.ts | 132 + .../queue/processors/db/export-following.ts | 113 + .../src/queue/processors/db/export-mute.ts | 106 + .../src/queue/processors/db/export-notes.ts | 133 + .../queue/processors/db/export-user-lists.ts | 81 + .../queue/processors/db/import-blocking.ts | 79 + .../processors/db/import-custom-emojis.ts | 150 + .../processors/db/import-firefish-post.ts | 15 + .../queue/processors/db/import-following.ts | 116 + .../queue/processors/db/import-masto-post.ts | 19 + .../src/queue/processors/db/import-muting.ts | 89 + .../src/queue/processors/db/import-posts.ts | 76 + .../queue/processors/db/import-user-lists.ts | 111 + .../backend/src/queue/processors/db/index.ts | 47 + .../endpoints/drive/files/attached-notes.ts | 61 + .../endpoints/drive/files/caption-image.ts | 42 + .../endpoints/drive/files/check-existence.ts | 37 + .../api/endpoints/drive/files/create.ts | 129 + .../api/endpoints/drive/files/delete.ts | 55 + .../api/endpoints/drive/files/find-by-hash.ts | 41 + .../server/api/endpoints/drive/files/find.ts | 51 + .../server/api/endpoints/drive/files/show.ts | 89 + .../api/endpoints/drive/files/update.ts | 116 + .../endpoints/drive/files/upload-from-url.ts | 57 + packages/iceshrimp-js/etc/iceshrimp-js.api.md | 5676 ++++++++--------- .../markdown/iceshrimp-js.acct.md | 28 +- ...ceshrimp-js.api.apiclient._constructor_.md | 48 +- .../iceshrimp-js.api.apiclient.credential.md | 22 +- .../iceshrimp-js.api.apiclient.fetch.md | 22 +- .../markdown/iceshrimp-js.api.apiclient.md | 64 +- .../iceshrimp-js.api.apiclient.origin.md | 22 +- .../iceshrimp-js.api.apiclient.request.md | 114 +- .../markdown/iceshrimp-js.api.apierror.md | 34 +- .../markdown/iceshrimp-js.api.fetchlike.md | 44 +- .../markdown/iceshrimp-js.api.isapierror.md | 44 +- .../iceshrimp-js/markdown/iceshrimp-js.api.md | 50 +- ...rimp-js.channelconnection._constructor_.md | 44 +- .../iceshrimp-js.channelconnection.channel.md | 22 +- .../iceshrimp-js.channelconnection.dispose.md | 30 +- .../iceshrimp-js.channelconnection.id.md | 22 +- .../iceshrimp-js.channelconnection.incount.md | 22 +- .../iceshrimp-js.channelconnection.md | 78 +- .../iceshrimp-js.channelconnection.name.md | 22 +- ...iceshrimp-js.channelconnection.outcount.md | 22 +- .../iceshrimp-js.channelconnection.send.md | 52 +- .../iceshrimp-js.channelconnection.stream.md | 22 +- .../markdown/iceshrimp-js.channels.md | 286 +- .../markdown/iceshrimp-js.endpoints.md | 3822 +++++------ .../markdown/iceshrimp-js.entities.ad.md | 22 +- .../iceshrimp-js.entities.announcement.md | 42 +- .../markdown/iceshrimp-js.entities.antenna.md | 58 +- .../markdown/iceshrimp-js.entities.app.md | 22 +- .../iceshrimp-js.entities.authsession.md | 34 +- .../iceshrimp-js.entities.blocking.md | 36 +- .../markdown/iceshrimp-js.entities.channel.md | 30 +- .../markdown/iceshrimp-js.entities.clip.md | 22 +- .../iceshrimp-js.entities.customemoji.md | 34 +- .../iceshrimp-js.entities.datestring.md | 22 +- ...mp-js.entities.detailedinstancemetadata.md | 30 +- .../iceshrimp-js.entities.drivefile.md | 52 +- .../iceshrimp-js.entities.drivefolder.md | 22 +- .../iceshrimp-js.entities.following.md | 36 +- ...-js.entities.followingfolloweepopulated.md | 30 +- ...-js.entities.followingfollowerpopulated.md | 30 +- .../iceshrimp-js.entities.followrequest.md | 34 +- .../iceshrimp-js.entities.gallerypost.md | 22 +- .../markdown/iceshrimp-js.entities.id.md | 22 +- .../iceshrimp-js.entities.instance.md | 80 +- .../iceshrimp-js.entities.instancemetadata.md | 30 +- ...shrimp-js.entities.liteinstancemetadata.md | 90 +- .../markdown/iceshrimp-js.entities.md | 102 +- .../iceshrimp-js.entities.medetailed.md | 80 +- .../iceshrimp-js.entities.messagingmessage.md | 54 +- .../markdown/iceshrimp-js.entities.note.md | 102 +- .../iceshrimp-js.entities.notefavorite.md | 36 +- .../iceshrimp-js.entities.notereaction.md | 36 +- .../iceshrimp-js.entities.notification.md | 164 +- .../iceshrimp-js.entities.origintype.md | 22 +- .../markdown/iceshrimp-js.entities.page.md | 66 +- .../iceshrimp-js.entities.pageevent.md | 38 +- .../iceshrimp-js.entities.serverinfo.md | 48 +- .../markdown/iceshrimp-js.entities.signin.md | 38 +- .../markdown/iceshrimp-js.entities.stats.md | 38 +- .../markdown/iceshrimp-js.entities.user.md | 26 +- .../iceshrimp-js.entities.userdetailed.md | 112 +- .../iceshrimp-js.entities.usergroup.md | 22 +- .../iceshrimp-js.entities.userlist.md | 36 +- .../iceshrimp-js.entities.userlite.md | 70 +- .../iceshrimp-js.entities.usersorting.md | 34 +- .../markdown/iceshrimp-js.ffvisibility.md | 22 +- .../iceshrimp-js/markdown/iceshrimp-js.md | 84 +- .../markdown/iceshrimp-js.mutednotereasons.md | 32 +- .../markdown/iceshrimp-js.notevisibilities.md | 32 +- .../iceshrimp-js.notificationtypes.md | 48 +- .../markdown/iceshrimp-js.permissions.md | 22 +- .../iceshrimp-js.stream._constructor_.md | 60 +- .../markdown/iceshrimp-js.stream.close.md | 30 +- ...iceshrimp-js.stream.disconnecttochannel.md | 44 +- .../markdown/iceshrimp-js.stream.md | 72 +- ...shrimp-js.stream.removesharedconnection.md | 44 +- ...mp-js.stream.removesharedconnectionpool.md | 44 +- .../markdown/iceshrimp-js.stream.send.md | 46 +- .../markdown/iceshrimp-js.stream.state.md | 22 +- .../iceshrimp-js.stream.usechannel.md | 56 +- packages/iceshrimp-js/markdown/index.md | 24 +- 113 files changed, 9045 insertions(+), 6611 deletions(-) create mode 100644 .config/ci.yml create mode 100644 .vscode/extensions.json create mode 160000 assets/branding create mode 100644 packages/backend/assets/LICENSE create mode 100644 packages/backend/src/queue/processors/db/delete-account.ts create mode 100644 packages/backend/src/queue/processors/db/delete-drive-files.ts create mode 100644 packages/backend/src/queue/processors/db/export-blocking.ts create mode 100644 packages/backend/src/queue/processors/db/export-custom-emojis.ts create mode 100644 packages/backend/src/queue/processors/db/export-following.ts create mode 100644 packages/backend/src/queue/processors/db/export-mute.ts create mode 100644 packages/backend/src/queue/processors/db/export-notes.ts create mode 100644 packages/backend/src/queue/processors/db/export-user-lists.ts create mode 100644 packages/backend/src/queue/processors/db/import-blocking.ts create mode 100644 packages/backend/src/queue/processors/db/import-custom-emojis.ts create mode 100644 packages/backend/src/queue/processors/db/import-firefish-post.ts create mode 100644 packages/backend/src/queue/processors/db/import-following.ts create mode 100644 packages/backend/src/queue/processors/db/import-masto-post.ts create mode 100644 packages/backend/src/queue/processors/db/import-muting.ts create mode 100644 packages/backend/src/queue/processors/db/import-posts.ts create mode 100644 packages/backend/src/queue/processors/db/import-user-lists.ts create mode 100644 packages/backend/src/queue/processors/db/index.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/caption-image.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/check-existence.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/create.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/delete.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/find.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/show.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/update.ts create mode 100644 packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts diff --git a/.config/ci.yml b/.config/ci.yml new file mode 100644 index 000000000..fd35a7994 --- /dev/null +++ b/.config/ci.yml @@ -0,0 +1,195 @@ +#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +# Firefish configuration +#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +# ┌─────┐ +#───┘ URL └───────────────────────────────────────────────────── + +# Final accessible URL seen by a user. +url: https://example.tld/ + +# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE +# URL SETTINGS AFTER THAT! + +# ┌───────────────────────┐ +#───┘ Port and TLS settings └─────────────────────────────────── + +# +# Misskey requires a reverse proxy to support HTTPS connections. +# +# +----- https://example.tld/ ------------+ +# +------+ |+-------------+ +----------------+| +# | User | ---> || Proxy (443) | ---> | Misskey (3000) || +# +------+ |+-------------+ +----------------+| +# +---------------------------------------+ +# +# You need to set up a reverse proxy. (e.g. nginx) +# An encrypted connection with HTTPS is highly recommended +# because tokens may be transferred in GET requests. + +# The port that your Misskey server should listen on. +port: 3000 + +# ┌──────────────────────────┐ +#───┘ PostgreSQL configuration └──────────────────────────────── + +db: + host: database + port: 5432 + + # Database name + db: postgres + + # Auth + user: postgres + pass: test + + # Whether disable Caching queries + #disableCache: true + + # Extra Connection options + #extra: + # ssl: true + +# ┌─────────────────────┐ +#───┘ Redis configuration └───────────────────────────────────── + +redis: + host: redis + port: 6379 + #family: 0 # 0=Both, 4=IPv4, 6=IPv6 + #pass: example-pass + #prefix: example-prefix + #db: 1 + +# ┌─────────────────────────────┐ +#───┘ Elasticsearch configuration └───────────────────────────── + +#elasticsearch: +# host: localhost +# port: 9200 +# ssl: false +# user: +# pass: + +# ┌───────────────┐ +#───┘ ID generation └─────────────────────────────────────────── + +# You can select the ID generation method. +# You don't usually need to change this setting, but you can +# change it according to your preferences. + +# Available methods: +# aid ... Short, Millisecond accuracy +# meid ... Similar to ObjectID, Millisecond accuracy +# ulid ... Millisecond accuracy +# objectid ... This is left for backward compatibility + +# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE +# ID SETTINGS AFTER THAT! + +id: 'aid' + +# ┌─────────────────────┐ +#───┘ Other configuration └───────────────────────────────────── + +# Max note length, should be < 8000. +#maxNoteLength: 3000 + +# Whether disable HSTS +#disableHsts: true + +# Number of worker processes +#clusterLimit: 1 + +# Job concurrency per worker +# deliverJobConcurrency: 128 +# inboxJobConcurrency: 16 + +# Job rate limiter +# deliverJobPerSec: 128 +# inboxJobPerSec: 16 + +# Job attempts +# deliverJobMaxAttempts: 12 +# inboxJobMaxAttempts: 8 + +# IP address family used for outgoing request (ipv4, ipv6 or dual) +#outgoingAddressFamily: ipv4 + +# Syslog option +#syslog: +# host: localhost +# port: 514 + +# Proxy for HTTP/HTTPS +#proxy: http://127.0.0.1:3128 + +#proxyBypassHosts: [ +# 'example.com', +# '192.0.2.8' +#] + +# Proxy for SMTP/SMTPS +#proxySmtp: http://127.0.0.1:3128 # use HTTP/1.1 CONNECT +#proxySmtp: socks4://127.0.0.1:1080 # use SOCKS4 +#proxySmtp: socks5://127.0.0.1:1080 # use SOCKS5 + +# Media Proxy +#mediaProxy: https://example.com/proxy + +# Proxy remote files (default: false) +#proxyRemoteFiles: true + +#allowedPrivateNetworks: [ +# '127.0.0.1/32' +#] + +# Upload or download file size limits (bytes) +#maxFileSize: 262144000 + +# Managed hosting settings +# !!!!!!!!!! +# >>>>>> NORMAL SELF-HOSTERS, STAY AWAY! <<<<<< +# >>>>>> YOU DON'T NEED THIS! <<<<<< +# !!!!!!!!!! +# Each category is optional, but if each item in each category is mandatory! +# If you mess this up, that's on you, you've been warned... + +#maxUserSignups: 100 +#isManagedHosting: true +#deepl: +# managed: true +# authKey: '' +# isPro: false +# +#email: +# managed: true +# address: 'example@email.com' +# host: 'email.com' +# port: 587 +# user: 'example@email.com' +# pass: '' +# useImplicitSslTls: false +# +#objectStorage: +# managed: true +# baseUrl: '' +# bucket: '' +# prefix: '' +# endpoint: '' +# region: '' +# accessKey: '' +# secretKey: '' +# useSsl: true +# connnectOverProxy: false +# setPublicReadOnUpload: true +# s3ForcePathStyle: true + +# !!!!!!!!!! +# >>>>>> AGAIN, NORMAL SELF-HOSTERS, STAY AWAY! <<<<<< +# >>>>>> YOU DON'T NEED THIS, ABOVE SETTINGS ARE FOR MANAGED HOSTING ONLY! <<<<<< +# !!!!!!!!!! + +# Seriously. Do NOT fill out the above settings if you're self-hosting. +# They're much better off being set from the control panel. diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..206f1b2e9 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + "recommendations": [ + "editorconfig.editorconfig", + "eg2.vscode-npm-script", + "vue.volar", + "vue.vscode-typescript-vue-plugin", + "arcanis.vscode-zipfs", + "orta.vscode-twoslash-queries", + "biomejs.biome" + ] +} diff --git a/.yarn/corepack.tgz b/.yarn/corepack.tgz index 6aab5c972..c614eba3b 100644 --- a/.yarn/corepack.tgz +++ b/.yarn/corepack.tgz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d959daf507a8a46f1100da8fa970368fac7ecdacbf8a9ede0649163275999980 -size 985138 +oid sha256:013f0172eead8f0dfd513538725e35d13440d1fad30e2ed2cd097b83239d1624 +size 982775 diff --git a/assets/branding b/assets/branding new file mode 160000 index 000000000..1c4e96bcf --- /dev/null +++ b/assets/branding @@ -0,0 +1 @@ +Subproject commit 1c4e96bcfe61c981a1e8f23142082ac8ce7fc575 diff --git a/packages/backend/assets/LICENSE b/packages/backend/assets/LICENSE new file mode 100644 index 000000000..79f5e9541 --- /dev/null +++ b/packages/backend/assets/LICENSE @@ -0,0 +1,13 @@ +Copyright 2023 The Iceshrimp contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/packages/backend/src/queue/processors/db/delete-account.ts b/packages/backend/src/queue/processors/db/delete-account.ts new file mode 100644 index 000000000..1dca4ae1a --- /dev/null +++ b/packages/backend/src/queue/processors/db/delete-account.ts @@ -0,0 +1,103 @@ +import type Bull from "bull"; +import { queueLogger } from "../../logger.js"; +import { DriveFiles, Notes, UserProfiles, Users } from "@/models/index.js"; +import type { DbUserDeleteJobData } from "@/queue/types.js"; +import type { Note } from "@/models/entities/note.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { MoreThan } from "typeorm"; +import { deleteFileSync } from "@/services/drive/delete-file.js"; +import { sendEmail } from "@/services/send-email.js"; +import { publishInternalEvent } from "@/services/stream.js"; + +const logger = queueLogger.createSubLogger("delete-account"); + +export async function deleteAccount( + job: Bull.Job, +): Promise { + logger.info(`Deleting account of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (!user) return; + const isLocal = Users.isLocalUser(user); + + { + // Delete notes + let cursor: Note["id"] | null = null; + + while (true) { + const notes = (await Notes.find({ + where: { + userId: user.id, + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 10, + order: { + id: 1, + }, + })) as Note[]; + + if (notes.length === 0) { + break; + } + + cursor = notes[notes.length - 1].id; + + await Notes.delete(notes.map((note) => note.id)); + } + + logger.succ("All of notes deleted"); + } + + { + // Delete files + let cursor: DriveFile["id"] | null = null; + + while (true) { + const files = (await DriveFiles.find({ + where: { + userId: user.id, + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 10, + order: { + id: 1, + }, + })) as DriveFile[]; + + if (files.length === 0) { + break; + } + + cursor = files[files.length - 1].id; + + for (const file of files) { + await deleteFileSync(file); + } + } + + logger.succ("All of files deleted"); + } + + { + // Send email notification + const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); + if (profile.email && profile.emailVerified) { + sendEmail( + profile.email, + "Account deleted", + "Your account has been deleted.", + "Your account has been deleted.", + ); + } + } + + // soft指定されている場合は物理削除しない + if (job.data.soft) { + // nop + } else { + await Users.delete(job.data.user.id); + publishInternalEvent(isLocal ? "localUserDeleted" : "remoteUserDeleted", { id: user.id }); + } + + return "Account deleted"; +} diff --git a/packages/backend/src/queue/processors/db/delete-drive-files.ts b/packages/backend/src/queue/processors/db/delete-drive-files.ts new file mode 100644 index 000000000..28e477132 --- /dev/null +++ b/packages/backend/src/queue/processors/db/delete-drive-files.ts @@ -0,0 +1,61 @@ +import type Bull from "bull"; + +import { queueLogger } from "../../logger.js"; +import { deleteFileSync } from "@/services/drive/delete-file.js"; +import { Users, DriveFiles } from "@/models/index.js"; +import { MoreThan } from "typeorm"; +import type { DbUserJobData } from "@/queue/types.js"; + +const logger = queueLogger.createSubLogger("delete-drive-files"); + +export async function deleteDriveFiles( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Deleting drive files of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + let deletedCount = 0; + let cursor: any = null; + + while (true) { + const files = await DriveFiles.find({ + where: { + userId: user.id, + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 100, + order: { + id: 1, + }, + }); + + if (files.length === 0) { + job.progress(100); + break; + } + + cursor = files[files.length - 1].id; + + for (const file of files) { + await deleteFileSync(file); + deletedCount++; + } + + const total = await DriveFiles.countBy({ + userId: user.id, + }); + + job.progress(deletedCount / total); + } + + logger.succ( + `All drive files (${deletedCount}) of ${user.id} has been deleted.`, + ); + done(); +} diff --git a/packages/backend/src/queue/processors/db/export-blocking.ts b/packages/backend/src/queue/processors/db/export-blocking.ts new file mode 100644 index 000000000..90da76b87 --- /dev/null +++ b/packages/backend/src/queue/processors/db/export-blocking.ts @@ -0,0 +1,105 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; + +import { queueLogger } from "../../logger.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, Blockings } from "@/models/index.js"; +import { MoreThan } from "typeorm"; +import type { DbUserJobData } from "@/queue/types.js"; + +const logger = queueLogger.createSubLogger("export-blocking"); + +export async function exportBlocking( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Exporting blocking of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + // Create temp file + const [path, cleanup] = await createTemp(); + + logger.info(`Temp file is ${path}`); + + try { + const stream = fs.createWriteStream(path, { flags: "a" }); + + let exportedCount = 0; + let cursor: any = null; + + while (true) { + const blockings = await Blockings.find({ + where: { + blockerId: user.id, + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 100, + order: { + id: 1, + }, + }); + + if (blockings.length === 0) { + job.progress(100); + break; + } + + cursor = blockings[blockings.length - 1].id; + + for (const block of blockings) { + const u = await Users.findOneBy({ id: block.blockeeId }); + if (u == null) { + exportedCount++; + continue; + } + + const content = getFullApAccount(u.username, u.host); + await new Promise((res, rej) => { + stream.write(content + "\n", (err) => { + if (err) { + logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + exportedCount++; + } + + const total = await Blockings.countBy({ + blockerId: user.id, + }); + + job.progress(exportedCount / total); + } + + stream.end(); + logger.succ(`Exported to: ${path}`); + + const fileName = `blocking-${dateFormat( + new Date(), + "yyyy-MM-dd-HH-mm-ss", + )}.csv`; + const driveFile = await addFile({ + user, + path, + name: fileName, + force: true, + }); + + logger.succ(`Exported to: ${driveFile.id}`); + } finally { + cleanup(); + } + + done(); +} diff --git a/packages/backend/src/queue/processors/db/export-custom-emojis.ts b/packages/backend/src/queue/processors/db/export-custom-emojis.ts new file mode 100644 index 000000000..1374d6c4e --- /dev/null +++ b/packages/backend/src/queue/processors/db/export-custom-emojis.ts @@ -0,0 +1,132 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; + +import { ulid } from "ulid"; +import mime from "mime-types"; +import archiver from "archiver"; +import { queueLogger } from "../../logger.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { format as dateFormat } from "date-fns"; +import { Users, Emojis } from "@/models/index.js"; +import {} from "@/queue/types.js"; +import { createTemp, createTempDir } from "@/misc/create-temp.js"; +import { downloadUrl } from "@/misc/download-url.js"; +import config from "@/config/index.js"; +import { IsNull } from "typeorm"; + +const logger = queueLogger.createSubLogger("export-custom-emojis"); + +export async function exportCustomEmojis( + job: Bull.Job, + done: () => void, +): Promise { + logger.info("Exporting custom emojis ..."); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const [path, cleanup] = await createTempDir(); + + logger.info(`Temp dir is ${path}`); + + const metaPath = `${path}/meta.json`; + + fs.writeFileSync(metaPath, "", "utf-8"); + + const metaStream = fs.createWriteStream(metaPath, { flags: "a" }); + + const writeMeta = (text: string): Promise => { + return new Promise((res, rej) => { + metaStream.write(text, (err) => { + if (err) { + logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + }; + + await writeMeta( + `{"metaVersion":2,"host":"${ + config.host + }","exportedAt":"${new Date().toString()}","emojis":[`, + ); + + const customEmojis = await Emojis.find({ + where: { + host: IsNull(), + }, + order: { + id: "ASC", + }, + }); + + for (const emoji of customEmojis) { + const ext = mime.extension(emoji.type); + // there are some restrictions on file names, so to be safe the files are + // named after their database id instead of the actual emoji name + const fileName = emoji.id + (ext ? '.' + ext : ''); + const emojiPath = `${path}/${fileName}`; + fs.writeFileSync(emojiPath, "", "binary"); + let downloaded = false; + + try { + await downloadUrl(emoji.originalUrl, emojiPath); + downloaded = true; + } catch (e) { + // TODO: 何度か再試行 + logger.error(e instanceof Error ? e : new Error(e as string)); + } + + if (!downloaded) { + fs.unlinkSync(emojiPath); + } + + const content = JSON.stringify({ + fileName: fileName, + downloaded: downloaded, + emoji: emoji, + }); + const isFirst = customEmojis.indexOf(emoji) === 0; + + await writeMeta(isFirst ? content : ",\n" + content); + } + + await writeMeta("]}"); + + metaStream.end(); + + // Create archive + const [archivePath, archiveCleanup] = await createTemp(); + const archiveStream = fs.createWriteStream(archivePath); + const archive = archiver("zip", { + zlib: { level: 0 }, + }); + archiveStream.on("close", async () => { + logger.succ(`Exported to: ${archivePath}`); + + const fileName = `custom-emojis-${dateFormat( + new Date(), + "yyyy-MM-dd-HH-mm-ss", + )}.zip`; + const driveFile = await addFile({ + user, + path: archivePath, + name: fileName, + force: true, + }); + + logger.succ(`Exported to: ${driveFile.id}`); + cleanup(); + archiveCleanup(); + done(); + }); + archive.pipe(archiveStream); + archive.directory(path, false); + archive.finalize(); +} diff --git a/packages/backend/src/queue/processors/db/export-following.ts b/packages/backend/src/queue/processors/db/export-following.ts new file mode 100644 index 000000000..80e8e6b92 --- /dev/null +++ b/packages/backend/src/queue/processors/db/export-following.ts @@ -0,0 +1,113 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; + +import { queueLogger } from "../../logger.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, Followings, Mutings } from "@/models/index.js"; +import { In, MoreThan, Not } from "typeorm"; +import type { DbUserJobData } from "@/queue/types.js"; +import type { Following } from "@/models/entities/following.js"; + +const logger = queueLogger.createSubLogger("export-following"); + +export async function exportFollowing( + job: Bull.Job, + done: () => void, +): Promise { + logger.info(`Exporting following of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + // Create temp file + const [path, cleanup] = await createTemp(); + + logger.info(`Temp file is ${path}`); + + try { + const stream = fs.createWriteStream(path, { flags: "a" }); + + let cursor: Following["id"] | null = null; + + const mutings = job.data.excludeMuting + ? await Mutings.findBy({ + muterId: user.id, + }) + : []; + + while (true) { + const followings = (await Followings.find({ + where: { + followerId: user.id, + ...(mutings.length > 0 + ? { followeeId: Not(In(mutings.map((x) => x.muteeId))) } + : {}), + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 100, + order: { + id: 1, + }, + })) as Following[]; + + if (followings.length === 0) { + break; + } + + cursor = followings[followings.length - 1].id; + + for (const following of followings) { + const u = await Users.findOneBy({ id: following.followeeId }); + if (u == null) { + continue; + } + + if ( + job.data.excludeInactive && + u.updatedAt && + Date.now() - u.updatedAt.getTime() > 1000 * 60 * 60 * 24 * 90 + ) { + continue; + } + + const content = getFullApAccount(u.username, u.host); + await new Promise((res, rej) => { + stream.write(content + "\n", (err) => { + if (err) { + logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + } + } + + stream.end(); + logger.succ(`Exported to: ${path}`); + + const fileName = `following-${dateFormat( + new Date(), + "yyyy-MM-dd-HH-mm-ss", + )}.csv`; + const driveFile = await addFile({ + user, + path, + name: fileName, + force: true, + }); + + logger.succ(`Exported to: ${driveFile.id}`); + } finally { + cleanup(); + } + + done(); +} diff --git a/packages/backend/src/queue/processors/db/export-mute.ts b/packages/backend/src/queue/processors/db/export-mute.ts new file mode 100644 index 000000000..87b140b76 --- /dev/null +++ b/packages/backend/src/queue/processors/db/export-mute.ts @@ -0,0 +1,106 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; + +import { queueLogger } from "../../logger.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, Mutings } from "@/models/index.js"; +import { IsNull, MoreThan } from "typeorm"; +import type { DbUserJobData } from "@/queue/types.js"; + +const logger = queueLogger.createSubLogger("export-mute"); + +export async function exportMute( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Exporting mute of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + // Create temp file + const [path, cleanup] = await createTemp(); + + logger.info(`Temp file is ${path}`); + + try { + const stream = fs.createWriteStream(path, { flags: "a" }); + + let exportedCount = 0; + let cursor: any = null; + + while (true) { + const mutes = await Mutings.find({ + where: { + muterId: user.id, + expiresAt: IsNull(), + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 100, + order: { + id: 1, + }, + }); + + if (mutes.length === 0) { + job.progress(100); + break; + } + + cursor = mutes[mutes.length - 1].id; + + for (const mute of mutes) { + const u = await Users.findOneBy({ id: mute.muteeId }); + if (u == null) { + exportedCount++; + continue; + } + + const content = getFullApAccount(u.username, u.host); + await new Promise((res, rej) => { + stream.write(content + "\n", (err) => { + if (err) { + logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + exportedCount++; + } + + const total = await Mutings.countBy({ + muterId: user.id, + }); + + job.progress(exportedCount / total); + } + + stream.end(); + logger.succ(`Exported to: ${path}`); + + const fileName = `mute-${dateFormat( + new Date(), + "yyyy-MM-dd-HH-mm-ss", + )}.csv`; + const driveFile = await addFile({ + user, + path, + name: fileName, + force: true, + }); + + logger.succ(`Exported to: ${driveFile.id}`); + } finally { + cleanup(); + } + + done(); +} diff --git a/packages/backend/src/queue/processors/db/export-notes.ts b/packages/backend/src/queue/processors/db/export-notes.ts new file mode 100644 index 000000000..bf53f8360 --- /dev/null +++ b/packages/backend/src/queue/processors/db/export-notes.ts @@ -0,0 +1,133 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; + +import { queueLogger } from "../../logger.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { format as dateFormat } from "date-fns"; +import { Users, Notes, Polls, DriveFiles } from "@/models/index.js"; +import { MoreThan } from "typeorm"; +import type { Note } from "@/models/entities/note.js"; +import type { Poll } from "@/models/entities/poll.js"; +import type { DbUserJobData } from "@/queue/types.js"; +import { createTemp } from "@/misc/create-temp.js"; + +const logger = queueLogger.createSubLogger("export-notes"); + +export async function exportNotes( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Exporting notes of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + // Create temp file + const [path, cleanup] = await createTemp(); + + logger.info(`Temp file is ${path}`); + + try { + const stream = fs.createWriteStream(path, { flags: "a" }); + + const write = (text: string): Promise => { + return new Promise((res, rej) => { + stream.write(text, (err) => { + if (err) { + logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + }; + + await write("["); + + let exportedNotesCount = 0; + let cursor: Note["id"] | null = null; + + while (true) { + const notes = (await Notes.find({ + where: { + userId: user.id, + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 100, + order: { + id: 1, + }, + })) as Note[]; + + if (notes.length === 0) { + job.progress(100); + break; + } + + cursor = notes[notes.length - 1].id; + + for (const note of notes) { + let poll: Poll | undefined; + if (note.hasPoll) { + poll = await Polls.findOneByOrFail({ noteId: note.id }); + } + const content = JSON.stringify(await serialize(note, poll)); + const isFirst = exportedNotesCount === 0; + await write(isFirst ? content : ",\n" + content); + exportedNotesCount++; + } + + const total = await Notes.countBy({ + userId: user.id, + }); + + job.progress(exportedNotesCount / total); + } + + await write("]"); + + stream.end(); + logger.succ(`Exported to: ${path}`); + + const fileName = `notes-${dateFormat( + new Date(), + "yyyy-MM-dd-HH-mm-ss", + )}.json`; + const driveFile = await addFile({ + user, + path, + name: fileName, + force: true, + }); + + logger.succ(`Exported to: ${driveFile.id}`); + } finally { + cleanup(); + } + + done(); +} + +async function serialize( + note: Note, + poll: Poll | null = null, +): Promise> { + return { + id: note.id, + text: note.text, + createdAt: note.createdAt, + fileIds: note.fileIds, + files: await DriveFiles.packMany(note.fileIds), + replyId: note.replyId, + renoteId: note.renoteId, + poll: poll, + cw: note.cw, + visibility: note.visibility, + visibleUserIds: note.visibleUserIds, + localOnly: note.localOnly, + }; +} diff --git a/packages/backend/src/queue/processors/db/export-user-lists.ts b/packages/backend/src/queue/processors/db/export-user-lists.ts new file mode 100644 index 000000000..e0c9cd8f3 --- /dev/null +++ b/packages/backend/src/queue/processors/db/export-user-lists.ts @@ -0,0 +1,81 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; + +import { queueLogger } from "../../logger.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { format as dateFormat } from "date-fns"; +import { getFullApAccount } from "@/misc/convert-host.js"; +import { createTemp } from "@/misc/create-temp.js"; +import { Users, UserLists, UserListJoinings } from "@/models/index.js"; +import { In } from "typeorm"; +import type { DbUserJobData } from "@/queue/types.js"; + +const logger = queueLogger.createSubLogger("export-user-lists"); + +export async function exportUserLists( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Exporting user lists of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const lists = await UserLists.findBy({ + userId: user.id, + }); + + // Create temp file + const [path, cleanup] = await createTemp(); + + logger.info(`Temp file is ${path}`); + + try { + const stream = fs.createWriteStream(path, { flags: "a" }); + + for (const list of lists) { + const joinings = await UserListJoinings.findBy({ userListId: list.id }); + const users = await Users.findBy({ + id: In(joinings.map((j) => j.userId)), + }); + + for (const u of users) { + const acct = getFullApAccount(u.username, u.host); + const content = `${list.name},${acct}`; + await new Promise((res, rej) => { + stream.write(content + "\n", (err) => { + if (err) { + logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + } + } + + stream.end(); + logger.succ(`Exported to: ${path}`); + + const fileName = `user-lists-${dateFormat( + new Date(), + "yyyy-MM-dd-HH-mm-ss", + )}.csv`; + const driveFile = await addFile({ + user, + path, + name: fileName, + force: true, + }); + + logger.succ(`Exported to: ${driveFile.id}`); + } finally { + cleanup(); + } + + done(); +} diff --git a/packages/backend/src/queue/processors/db/import-blocking.ts b/packages/backend/src/queue/processors/db/import-blocking.ts new file mode 100644 index 000000000..2fdf80a6e --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-blocking.ts @@ -0,0 +1,79 @@ +import type Bull from "bull"; + +import { queueLogger } from "../../logger.js"; +import * as Acct from "@/misc/acct.js"; +import { resolveUser } from "@/remote/resolve-user.js"; +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { Users, DriveFiles, Blockings } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; +import block from "@/services/blocking/create.js"; +import { IsNull } from "typeorm"; + +const logger = queueLogger.createSubLogger("import-blocking"); + +export async function importBlocking( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Importing blocking of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const file = await DriveFiles.findOneBy({ + id: job.data.fileId, + }); + if (file == null) { + done(); + return; + } + + const csv = await downloadTextFile(file.url); + + let linenum = 0; + + for (const line of csv.trim().split("\n")) { + linenum++; + + try { + const acct = line.split(",")[0].trim(); + const { username, host } = Acct.parse(acct); + + let target = isSelfHost(host!) + ? await Users.findOneBy({ + host: IsNull(), + usernameLower: username.toLowerCase(), + }) + : await Users.findOneBy({ + host: toPuny(host!), + usernameLower: username.toLowerCase(), + }); + + if (host == null && target == null) continue; + + if (target == null) { + target = await resolveUser(username, host); + } + + if (target == null) { + throw new Error(`cannot resolve user: @${username}@${host}`); + } + + // skip myself + if (target.id === job.data.user.id) continue; + + logger.info(`Block[${linenum}] ${target.id} ...`); + + await block(user, target); + } catch (e) { + logger.warn(`Error in line:${linenum} ${e}`); + } + } + + logger.succ("Imported"); + done(); +} diff --git a/packages/backend/src/queue/processors/db/import-custom-emojis.ts b/packages/backend/src/queue/processors/db/import-custom-emojis.ts new file mode 100644 index 000000000..9e8b3b174 --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-custom-emojis.ts @@ -0,0 +1,150 @@ +import type Bull from "bull"; +import * as fs from "node:fs"; +import AdmZip from "adm-zip"; + +import { queueLogger } from "../../logger.js"; +import { createTempDir } from "@/misc/create-temp.js"; +import { downloadUrl } from "@/misc/download-url.js"; +import { DriveFiles, Emojis } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; +import { addFile } from "@/services/drive/add-file.js"; +import { genId } from "@/misc/gen-id.js"; +import { db } from "@/db/postgre.js"; +import probeImageSize from "probe-image-size"; +import * as path from "path"; + +const logger = queueLogger.createSubLogger("import-custom-emojis"); + +// TODO: 名前衝突時の動作を選べるようにする +export async function importCustomEmojis( + job: Bull.Job, + done: any, +): Promise { + logger.info("Importing custom emojis ..."); + + const file = await DriveFiles.findOneBy({ + id: job.data.fileId, + }); + if (file == null) { + done(); + return; + } + + const [tempPath, cleanup] = await createTempDir(); + + logger.info(`Temp dir is ${tempPath}`); + + const destPath = `${tempPath}/emojis.zip`; + + try { + fs.writeFileSync(destPath, "", "binary"); + await downloadUrl(file.url, destPath); + } catch (e) { + // TODO: 何度か再試行 + if (e instanceof Error || typeof e === "string") { + logger.error(e); + } + throw e; + } + + const outputPath = `${tempPath}/emojis`; + const unzipStream = fs.createReadStream(destPath); + const zip = new AdmZip(destPath); + zip.extractAllToAsync(outputPath, true, false, async (error) => { + if (error) throw error; + + if (fs.existsSync(`${outputPath}/meta.json`)) { + logger.info("starting emoji import with metadata"); + const metaRaw = fs.readFileSync(`${outputPath}/meta.json`, "utf-8"); + const meta = JSON.parse(metaRaw); + + for (const record of meta.emojis) { + if (!record.downloaded) continue; + const emojiInfo = record.emoji; + const emojiPath = `${outputPath}/${record.fileName}`; + await Emojis.delete({ + name: emojiInfo.name, + }); + const driveFile = await addFile({ + user: null, + path: emojiPath, + name: record.fileName, + force: true, + }); + const file = fs.createReadStream(emojiPath); + const size = await probeImageSize(file); + file.destroy(); + await Emojis.insert({ + id: genId(), + updatedAt: new Date(), + name: emojiInfo.name, + category: emojiInfo.category, + host: null, + aliases: emojiInfo.aliases, + originalUrl: driveFile.url, + publicUrl: driveFile.webpublicUrl ?? driveFile.url, + type: driveFile.webpublicType ?? driveFile.type, + license: emojiInfo.license, + width: size.width || null, + height: size.height || null, + }).then((x) => Emojis.findOneByOrFail(x.identifiers[0])); + } + } else { + logger.info("starting emoji import without metadata"); + // Since we lack metadata, we import into a randomized category name instead + let categoryName = genId(); + + let containedEmojis = fs.readdirSync(outputPath); + + // Filter out accidental JSON files + containedEmojis = containedEmojis.filter( + (emoji) => !emoji.match(/\.(json)$/i), + ); + + for (const emojiFilename of containedEmojis) { + // strip extension and get filename to use as name + const name = path.basename(emojiFilename, path.extname(emojiFilename)); + const emojiPath = `${outputPath}/${emojiFilename}`; + + logger.info(`importing ${name}`); + + await Emojis.delete({ + name: name, + }); + const driveFile = await addFile({ + user: null, + path: emojiPath, + name: path.basename(emojiFilename), + force: true, + }); + const file = fs.createReadStream(emojiPath); + const size = await probeImageSize(file); + file.destroy(); + logger.info(`emoji size: ${size.width}x${size.height}`); + + await Emojis.insert({ + id: genId(), + updatedAt: new Date(), + name: name, + category: categoryName, + host: null, + aliases: [], + originalUrl: driveFile.url, + publicUrl: driveFile.webpublicUrl ?? driveFile.url, + type: driveFile.webpublicType ?? driveFile.type, + license: null, + width: size.width || null, + height: size.height || null, + }).then((x) => Emojis.findOneByOrFail(x.identifiers[0])); + } + } + + await db.queryResultCache!.remove(["meta_emojis"]); + + cleanup(); + + logger.succ("Imported"); + done(); + }); + logger.succ(`Unzipping to ${outputPath}`); +} diff --git a/packages/backend/src/queue/processors/db/import-firefish-post.ts b/packages/backend/src/queue/processors/db/import-firefish-post.ts new file mode 100644 index 000000000..c7a6fd7f0 --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-firefish-post.ts @@ -0,0 +1,15 @@ +import * as Post from "@/misc/post.js"; +import create from "@/services/note/create.js"; +import { Users } from "@/models/index.js"; +import type { DbUserImportMastoPostJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; +import type Bull from "bull"; + +const logger = queueLogger.createSubLogger("import-firefish-post"); + +export async function importCkPost( + job: Bull.Job, + done: any, +): Promise { + done(); +} diff --git a/packages/backend/src/queue/processors/db/import-following.ts b/packages/backend/src/queue/processors/db/import-following.ts new file mode 100644 index 000000000..b1a7cd2c9 --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-following.ts @@ -0,0 +1,116 @@ +import { IsNull } from "typeorm"; +import follow from "@/services/following/create.js"; + +import * as Acct from "@/misc/acct.js"; +import { resolveUser } from "@/remote/resolve-user.js"; +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { Users, DriveFiles } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; +import type Bull from "bull"; + +const logger = queueLogger.createSubLogger("import-following"); + +export async function importFollowing( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Importing following of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const file = await DriveFiles.findOneBy({ + id: job.data.fileId, + }); + if (file == null) { + done(); + return; + } + + const csv = await downloadTextFile(file.url); + + let linenum = 0; + + if (file.type.endsWith("json")) { + for (const acct of JSON.parse(csv)) { + try { + const { username, host } = Acct.parse(acct); + + let target = isSelfHost(host!) + ? await Users.findOneBy({ + host: IsNull(), + usernameLower: username.toLowerCase(), + }) + : await Users.findOneBy({ + host: toPuny(host!), + usernameLower: username.toLowerCase(), + }); + + if (host == null && target == null) continue; + + if (target == null) { + target = await resolveUser(username, host); + } + + if (target == null) { + throw new Error(`cannot resolve user: @${username}@${host}`); + } + + // skip myself + if (target.id === job.data.user.id) continue; + + logger.info(`Follow[${linenum}] ${target.id} ...`); + + follow(user, target); + } catch (e) { + logger.warn(`Error in line:${linenum} ${e}`); + } + } + } else { + for (const line of csv.trim().split("\n")) { + linenum++; + + try { + const acct = line.split(",")[0].trim(); + const { username, host } = Acct.parse(acct); + + let target = isSelfHost(host!) + ? await Users.findOneBy({ + host: IsNull(), + usernameLower: username.toLowerCase(), + }) + : await Users.findOneBy({ + host: toPuny(host!), + usernameLower: username.toLowerCase(), + }); + + if (host == null && target == null) continue; + + if (target == null) { + target = await resolveUser(username, host); + } + + if (target == null) { + throw new Error(`cannot resolve user: @${username}@${host}`); + } + + // skip myself + if (target.id === job.data.user.id) continue; + + logger.info(`Follow[${linenum}] ${target.id} ...`); + + follow(user, target); + } catch (e) { + logger.warn(`Error in line:${linenum} ${e}`); + } + } + } + + logger.succ("Imported"); + done(); +} diff --git a/packages/backend/src/queue/processors/db/import-masto-post.ts b/packages/backend/src/queue/processors/db/import-masto-post.ts new file mode 100644 index 000000000..c6ac7346b --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-masto-post.ts @@ -0,0 +1,19 @@ +import create from "@/services/note/create.js"; +import { Users } from "@/models/index.js"; +import type { DbUserImportMastoPostJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; +import type Bull from "bull"; +import { htmlToMfm } from "@/remote/activitypub/misc/html-to-mfm.js"; +import { resolveNote } from "@/remote/activitypub/models/note.js"; +import { Note } from "@/models/entities/note.js"; +import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; +import type { DriveFile } from "@/models/entities/drive-file.js"; + +const logger = queueLogger.createSubLogger("import-masto-post"); + +export async function importMastoPost( + job: Bull.Job, + done: any, +): Promise { + done(); +} diff --git a/packages/backend/src/queue/processors/db/import-muting.ts b/packages/backend/src/queue/processors/db/import-muting.ts new file mode 100644 index 000000000..80e056739 --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-muting.ts @@ -0,0 +1,89 @@ +import type Bull from "bull"; + +import { queueLogger } from "../../logger.js"; +import * as Acct from "@/misc/acct.js"; +import { resolveUser } from "@/remote/resolve-user.js"; +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { Users, DriveFiles, Mutings } from "@/models/index.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; +import type { User } from "@/models/entities/user.js"; +import { genId } from "@/misc/gen-id.js"; +import { IsNull } from "typeorm"; + +const logger = queueLogger.createSubLogger("import-muting"); + +export async function importMuting( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Importing muting of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const file = await DriveFiles.findOneBy({ + id: job.data.fileId, + }); + if (file == null) { + done(); + return; + } + + const csv = await downloadTextFile(file.url); + + let linenum = 0; + + for (const line of csv.trim().split("\n")) { + linenum++; + + try { + const acct = line.split(",")[0].trim(); + const { username, host } = Acct.parse(acct); + + let target = isSelfHost(host!) + ? await Users.findOneBy({ + host: IsNull(), + usernameLower: username.toLowerCase(), + }) + : await Users.findOneBy({ + host: toPuny(host!), + usernameLower: username.toLowerCase(), + }); + + if (host == null && target == null) continue; + + if (target == null) { + target = await resolveUser(username, host); + } + + if (target == null) { + throw new Error(`cannot resolve user: @${username}@${host}`); + } + + // skip myself + if (target.id === job.data.user.id) continue; + + logger.info(`Mute[${linenum}] ${target.id} ...`); + + await mute(user, target); + } catch (e) { + logger.warn(`Error in line:${linenum} ${e}`); + } + } + + logger.succ("Imported"); + done(); +} + +async function mute(user: User, target: User) { + await Mutings.insert({ + id: genId(), + createdAt: new Date(), + muterId: user.id, + muteeId: target.id, + }); +} diff --git a/packages/backend/src/queue/processors/db/import-posts.ts b/packages/backend/src/queue/processors/db/import-posts.ts new file mode 100644 index 000000000..9bde7479e --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-posts.ts @@ -0,0 +1,76 @@ +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { processMastoNotes } from "@/misc/process-masto-notes.js"; +import { Users, DriveFiles } from "@/models/index.js"; +import type { DbUserImportPostsJobData } from "@/queue/types.js"; +import { queueLogger } from "../../logger.js"; +import type Bull from "bull"; +import { + createImportCkPostJob, + createImportMastoPostJob, +} from "@/queue/index.js"; + +const logger = queueLogger.createSubLogger("import-posts"); + +export async function importPosts( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Importing posts of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const file = await DriveFiles.findOneBy({ + id: job.data.fileId, + }); + if (file == null) { + done(); + return; + } + + if (file.name.endsWith("tar.gz") || file.name.endsWith("zip")) { + try { + logger.info("Reading Mastodon archive"); + const outbox = await processMastoNotes( + file.name, + file.url, + job.data.user.id, + ); + for (const post of outbox.orderedItems) { + createImportMastoPostJob(job.data.user, post, job.data.signatureCheck); + } + } catch (e) { + // handle error + logger.warn(`Failed reading Mastodon archive: ${e}`); + } + logger.succ("Mastodon archive imported"); + done(); + return; + } + + const json = await downloadTextFile(file.url); + + try { + const parsed = JSON.parse(json); + if (parsed instanceof Array) { + logger.info("Parsing key style posts"); + for (const post of JSON.parse(json)) { + createImportCkPostJob(job.data.user, post, job.data.signatureCheck); + } + } else if (parsed instanceof Object) { + logger.info("Parsing animal style posts"); + for (const post of parsed.orderedItems) { + createImportMastoPostJob(job.data.user, post, job.data.signatureCheck); + } + } + } catch (e) { + // handle error + logger.warn(`Error reading: ${e}`); + } + + logger.succ("Imported"); + done(); +} diff --git a/packages/backend/src/queue/processors/db/import-user-lists.ts b/packages/backend/src/queue/processors/db/import-user-lists.ts new file mode 100644 index 000000000..68ba001ec --- /dev/null +++ b/packages/backend/src/queue/processors/db/import-user-lists.ts @@ -0,0 +1,111 @@ +import type Bull from "bull"; + +import { queueLogger } from "../../logger.js"; +import * as Acct from "@/misc/acct.js"; +import { resolveUser } from "@/remote/resolve-user.js"; +import { pushUserToUserList } from "@/services/user-list/push.js"; +import { downloadTextFile } from "@/misc/download-text-file.js"; +import { isSelfHost, toPuny } from "@/misc/convert-host.js"; +import { + DriveFiles, + Users, + UserLists, + UserListJoinings, Blockings, Followings, +} from "@/models/index.js"; +import { genId } from "@/misc/gen-id.js"; +import type { DbUserImportJobData } from "@/queue/types.js"; +import { IsNull } from "typeorm"; + +const logger = queueLogger.createSubLogger("import-user-lists"); + +export async function importUserLists( + job: Bull.Job, + done: any, +): Promise { + logger.info(`Importing user lists of ${job.data.user.id} ...`); + + const user = await Users.findOneBy({ id: job.data.user.id }); + if (user == null) { + done(); + return; + } + + const file = await DriveFiles.findOneBy({ + id: job.data.fileId, + }); + if (file == null) { + done(); + return; + } + + const csv = await downloadTextFile(file.url); + + let linenum = 0; + + for (const line of csv.trim().split("\n")) { + linenum++; + + try { + const listName = line.split(",")[0].trim(); + const { username, host } = Acct.parse(line.split(",")[1].trim()); + + let list = await UserLists.findOneBy({ + userId: user.id, + name: listName, + }); + + if (list == null) { + list = await UserLists.insert({ + id: genId(), + createdAt: new Date(), + userId: user.id, + name: listName, + }).then((x) => UserLists.findOneByOrFail(x.identifiers[0])); + } + + let target = isSelfHost(host!) + ? await Users.findOneBy({ + host: IsNull(), + usernameLower: username.toLowerCase(), + }) + : await Users.findOneBy({ + host: toPuny(host!), + usernameLower: username.toLowerCase(), + }); + + if (target == null) { + target = await resolveUser(username, host); + } + + const isBlocked = await Blockings.exist({ + where: { + blockerId: target.id, + blockeeId: user.id, + }, + }); + const isFollowed = await Followings.exist({ + where: { + followerId: user.id, + followeeId: target.id, + }, + }); + + if (isBlocked || !isFollowed) continue; + + if ( + (await UserListJoinings.findOneBy({ + userListId: list!.id, + userId: target.id, + })) != null + ) + continue; + + pushUserToUserList(target, list!); + } catch (e) { + logger.warn(`Error in line:${linenum} ${e}`); + } + } + + logger.succ("Imported"); + done(); +} diff --git a/packages/backend/src/queue/processors/db/index.ts b/packages/backend/src/queue/processors/db/index.ts new file mode 100644 index 000000000..d20fc2c71 --- /dev/null +++ b/packages/backend/src/queue/processors/db/index.ts @@ -0,0 +1,47 @@ +import type Bull from "bull"; +import type { DbJobData } from "@/queue/types.js"; +import { deleteDriveFiles } from "./delete-drive-files.js"; +import { exportCustomEmojis } from "./export-custom-emojis.js"; +import { exportNotes } from "./export-notes.js"; +import { exportFollowing } from "./export-following.js"; +import { exportMute } from "./export-mute.js"; +import { exportBlocking } from "./export-blocking.js"; +import { exportUserLists } from "./export-user-lists.js"; +import { importFollowing } from "./import-following.js"; +import { importUserLists } from "./import-user-lists.js"; +import { deleteAccount } from "./delete-account.js"; +import { importMuting } from "./import-muting.js"; +import { importPosts } from "./import-posts.js"; +import { importMastoPost } from "./import-masto-post.js"; +import { importCkPost } from "./import-firefish-post.js"; +import { importBlocking } from "./import-blocking.js"; +import { importCustomEmojis } from "./import-custom-emojis.js"; + +const jobs = { + deleteDriveFiles, + exportCustomEmojis, + exportNotes, + exportFollowing, + exportMute, + exportBlocking, + exportUserLists, + importFollowing, + importMuting, + importBlocking, + importUserLists, + importPosts, + importMastoPost, + importCkPost, + importCustomEmojis, + deleteAccount, +} as Record< + string, + | Bull.ProcessCallbackFunction + | Bull.ProcessPromiseFunction +>; + +export default function (dbQueue: Bull.Queue) { + for (const [k, v] of Object.entries(jobs)) { + dbQueue.process(k, v); + } +} diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts new file mode 100644 index 000000000..9267da585 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -0,0 +1,61 @@ +import define from "../../../define.js"; +import { ApiError } from "../../../error.js"; +import { DriveFiles, Notes } from "@/models/index.js"; + +export const meta = { + tags: ["drive", "notes"], + + requireCredential: true, + + kind: "read:drive", + + description: "Find the notes to which the given file is attached.", + + res: { + type: "array", + optional: false, + nullable: false, + items: { + type: "object", + optional: false, + nullable: false, + ref: "Note", + }, + }, + + errors: { + noSuchFile: { + message: "No such file.", + code: "NO_SUCH_FILE", + id: "c118ece3-2e4b-4296-99d1-51756e32d232", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + fileId: { type: "string", format: "misskey:id" }, + }, + required: ["fileId"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + // Fetch file + const file = await DriveFiles.findOneBy({ + id: ps.fileId, + userId: user.id, + }); + + if (file == null) { + throw new ApiError(meta.errors.noSuchFile); + } + + const notes = await Notes.createQueryBuilder("note") + .where(":file = ANY(note.fileIds)", { file: file.id }) + .getMany(); + + return await Notes.packMany(notes, user, { + detail: true, + }); +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts b/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts new file mode 100644 index 000000000..1ab817bd0 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/caption-image.ts @@ -0,0 +1,42 @@ +import define from "../../../define.js"; +import { createWorker } from "tesseract.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + kind: "read:drive", + + description: "Return caption of image", + + res: { + type: "string", + optional: false, + nullable: false, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + url: { type: "string" }, + }, + required: ["url"], +} as const; + +export default define(meta, paramDef, async (ps) => { + const worker = createWorker({ + logger: (m) => console.log(m), + }); + + await worker.load(); + await worker.loadLanguage("eng"); + await worker.initialize("eng"); + const { + data: { text }, + } = await worker.recognize(ps.url); + await worker.terminate(); + + return text; +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts new file mode 100644 index 000000000..e26da30eb --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts @@ -0,0 +1,37 @@ +import define from "../../../define.js"; +import { DriveFiles } from "@/models/index.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + kind: "read:drive", + + description: "Check if a given file exists.", + + res: { + type: "boolean", + optional: false, + nullable: false, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + md5: { type: "string" }, + }, + required: ["md5"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + const exist = await DriveFiles.exist({ + where: { + md5: ps.md5, + userId: user.id, + }, + }); + + return exist; +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts new file mode 100644 index 000000000..0a167178b --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -0,0 +1,129 @@ +import { addFile } from "@/services/drive/add-file.js"; +import { DriveFiles } from "@/models/index.js"; +import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; +import { IdentifiableError } from "@/misc/identifiable-error.js"; +import { fetchMeta } from "@/misc/fetch-meta.js"; +import { HOUR } from "@/const.js"; +import define from "../../../define.js"; +import { apiLogger } from "../../../logger.js"; +import { ApiError } from "../../../error.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + limit: { + duration: HOUR, + max: 120, + }, + + requireFile: true, + + kind: "write:drive", + + description: "Upload a new drive file.", + + res: { + type: "object", + optional: false, + nullable: false, + ref: "DriveFile", + }, + + errors: { + invalidFileName: { + message: "Invalid file name.", + code: "INVALID_FILE_NAME", + id: "f449b209-0c60-4e51-84d5-29486263bfd4", + }, + + inappropriate: { + message: + "Cannot upload the file because it has been determined that it possibly contains inappropriate content.", + code: "INAPPROPRIATE", + id: "bec5bd69-fba3-43c9-b4fb-2894b66ad5d2", + }, + + noFreeSpace: { + message: + "Cannot upload the file because you have no free space of drive.", + code: "NO_FREE_SPACE", + id: "d08dbc37-a6a9-463a-8c47-96c32ab5f064", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + folderId: { + type: "string", + format: "misskey:id", + nullable: true, + default: null, + }, + name: { type: "string", nullable: true, default: null }, + comment: { + type: "string", + nullable: true, + maxLength: DB_MAX_IMAGE_COMMENT_LENGTH, + default: null, + }, + isSensitive: { type: "boolean", default: false }, + force: { type: "boolean", default: false }, + }, + required: [], +} as const; + +export default define( + meta, + paramDef, + async (ps, user, _, file, cleanup, ip, headers) => { + // Get 'name' parameter + let name = ps.name || file.originalname; + if (name !== undefined && name !== null) { + name = name.trim(); + if (name.length === 0) { + name = null; + } else if (name === "blob") { + name = null; + } else if (!DriveFiles.validateFileName(name)) { + throw new ApiError(meta.errors.invalidFileName); + } + } else { + name = null; + } + + const meta = await fetchMeta(); + + try { + // Create file + const driveFile = await addFile({ + user, + path: file.path, + name, + comment: ps.comment, + folderId: ps.folderId, + force: ps.force, + sensitive: ps.isSensitive, + requestIp: meta.enableIpLogging ? ip : null, + requestHeaders: meta.enableIpLogging ? headers : null, + }); + return await DriveFiles.pack(driveFile, { self: true }); + } catch (e) { + if (e instanceof Error || typeof e === "string") { + apiLogger.error(e); + } + if (e instanceof IdentifiableError) { + if (e.id === "282f77bf-5816-4f72-9264-aa14d8261a21") + throw new ApiError(meta.errors.inappropriate); + if (e.id === "c6244ed2-a39a-4e1c-bf93-f0fbd7764fa6") + throw new ApiError(meta.errors.noFreeSpace); + } + throw new ApiError(); + } finally { + cleanup!(); + } + }, +); diff --git a/packages/backend/src/server/api/endpoints/drive/files/delete.ts b/packages/backend/src/server/api/endpoints/drive/files/delete.ts new file mode 100644 index 000000000..4e8b4156f --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -0,0 +1,55 @@ +import { deleteFile } from "@/services/drive/delete-file.js"; +import { publishDriveStream } from "@/services/stream.js"; +import define from "../../../define.js"; +import { ApiError } from "../../../error.js"; +import { DriveFiles, Users } from "@/models/index.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + kind: "write:drive", + + description: "Delete an existing drive file.", + + errors: { + noSuchFile: { + message: "No such file.", + code: "NO_SUCH_FILE", + id: "908939ec-e52b-4458-b395-1025195cea58", + }, + + accessDenied: { + message: "Access denied.", + code: "ACCESS_DENIED", + id: "5eb8d909-2540-4970-90b8-dd6f86088121", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + fileId: { type: "string", format: "misskey:id" }, + }, + required: ["fileId"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + const file = await DriveFiles.findOneBy({ id: ps.fileId }); + + if (file == null) { + throw new ApiError(meta.errors.noSuchFile); + } + + if (!(user.isAdmin || user.isModerator) && file.userId !== user.id) { + throw new ApiError(meta.errors.accessDenied); + } + + // Delete + await deleteFile(file); + + // Publish fileDeleted event + publishDriveStream(user.id, "fileDeleted", file.id); +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts new file mode 100644 index 000000000..ce14f4e09 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -0,0 +1,41 @@ +import { DriveFiles } from "@/models/index.js"; +import define from "../../../define.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + kind: "read:drive", + + description: "Search for a drive file by a hash of the contents.", + + res: { + type: "array", + optional: false, + nullable: false, + items: { + type: "object", + optional: false, + nullable: false, + ref: "DriveFile", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + md5: { type: "string" }, + }, + required: ["md5"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + const files = await DriveFiles.findBy({ + md5: ps.md5, + userId: user.id, + }); + + return await DriveFiles.packMany(files, { self: true }); +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/find.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts new file mode 100644 index 000000000..c2ad95126 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -0,0 +1,51 @@ +import define from "../../../define.js"; +import { DriveFiles } from "@/models/index.js"; +import { IsNull } from "typeorm"; + +export const meta = { + requireCredential: true, + + tags: ["drive"], + + kind: "read:drive", + + description: "Search for a drive file by the given parameters.", + + res: { + type: "array", + optional: false, + nullable: false, + items: { + type: "object", + optional: false, + nullable: false, + ref: "DriveFile", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + name: { type: "string" }, + folderId: { + type: "string", + format: "misskey:id", + nullable: true, + default: null, + }, + }, + required: ["name"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + const files = await DriveFiles.findBy({ + name: ps.name, + userId: user.id, + folderId: ps.folderId ?? IsNull(), + }); + + return await Promise.all( + files.map((file) => DriveFiles.pack(file, { self: true })), + ); +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/show.ts b/packages/backend/src/server/api/endpoints/drive/files/show.ts new file mode 100644 index 000000000..291e3f56b --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -0,0 +1,89 @@ +import type { DriveFile } from "@/models/entities/drive-file.js"; +import { DriveFiles, Users } from "@/models/index.js"; +import define from "../../../define.js"; +import { ApiError } from "../../../error.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + kind: "read:drive", + + description: "Show the properties of a drive file.", + + res: { + type: "object", + optional: false, + nullable: false, + ref: "DriveFile", + }, + + errors: { + noSuchFile: { + message: "No such file.", + code: "NO_SUCH_FILE", + id: "067bc436-2718-4795-b0fb-ecbe43949e31", + }, + + accessDenied: { + message: "Access denied.", + code: "ACCESS_DENIED", + id: "25b73c73-68b1-41d0-bad1-381cfdf6579f", + }, + }, +} as const; + +export const paramDef = { + type: "object", + anyOf: [ + { + properties: { + fileId: { type: "string", format: "misskey:id" }, + }, + required: ["fileId"], + }, + { + properties: { + url: { type: "string" }, + }, + required: ["url"], + }, + ], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + let file: DriveFile | null = null; + + if (ps.fileId) { + file = await DriveFiles.findOneBy({ id: ps.fileId }); + } else if (ps.url) { + file = await DriveFiles.findOne({ + where: [ + { + url: ps.url, + }, + { + webpublicUrl: ps.url, + }, + { + thumbnailUrl: ps.url, + }, + ], + }); + } + + if (file == null) { + throw new ApiError(meta.errors.noSuchFile); + } + + if (!(user.isAdmin || user.isModerator) && file.userId !== user.id) { + throw new ApiError(meta.errors.accessDenied); + } + + return await DriveFiles.pack(file, { + detail: true, + withUser: true, + self: true, + }); +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/update.ts b/packages/backend/src/server/api/endpoints/drive/files/update.ts new file mode 100644 index 000000000..e833fddb5 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -0,0 +1,116 @@ +import { publishDriveStream } from "@/services/stream.js"; +import { DriveFiles, DriveFolders, Users } from "@/models/index.js"; +import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; +import define from "../../../define.js"; +import { ApiError } from "../../../error.js"; + +export const meta = { + tags: ["drive"], + + requireCredential: true, + + kind: "write:drive", + + description: "Update the properties of a drive file.", + + errors: { + invalidFileName: { + message: "Invalid file name.", + code: "INVALID_FILE_NAME", + id: "395e7156-f9f0-475e-af89-53c3c23080c2", + }, + + noSuchFile: { + message: "No such file.", + code: "NO_SUCH_FILE", + id: "e7778c7e-3af9-49cd-9690-6dbc3e6c972d", + }, + + accessDenied: { + message: "Access denied.", + code: "ACCESS_DENIED", + id: "01a53b27-82fc-445b-a0c1-b558465a8ed2", + }, + + noSuchFolder: { + message: "No such folder.", + code: "NO_SUCH_FOLDER", + id: "ea8fb7a5-af77-4a08-b608-c0218176cd73", + }, + }, + + res: { + type: "object", + optional: false, + nullable: false, + ref: "DriveFile", + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + fileId: { type: "string", format: "misskey:id" }, + folderId: { type: "string", format: "misskey:id", nullable: true }, + name: { type: "string" }, + isSensitive: { type: "boolean" }, + comment: { + type: "string", + nullable: true, + maxLength: DB_MAX_IMAGE_COMMENT_LENGTH, + }, + }, + required: ["fileId"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + const file = await DriveFiles.findOneBy({ id: ps.fileId }); + + if (file == null) { + throw new ApiError(meta.errors.noSuchFile); + } + + if (!(user.isAdmin || user.isModerator) && file.userId !== user.id) { + throw new ApiError(meta.errors.accessDenied); + } + + if (ps.name) file.name = ps.name; + if (!DriveFiles.validateFileName(file.name)) { + throw new ApiError(meta.errors.invalidFileName); + } + + if (ps.comment !== undefined) file.comment = ps.comment; + + if (ps.isSensitive !== undefined) file.isSensitive = ps.isSensitive; + + if (ps.folderId !== undefined) { + if (ps.folderId === null) { + file.folderId = null; + } else { + const folder = await DriveFolders.findOneBy({ + id: ps.folderId, + userId: user.id, + }); + + if (folder == null) { + throw new ApiError(meta.errors.noSuchFolder); + } + + file.folderId = folder.id; + } + } + + await DriveFiles.update(file.id, { + name: file.name, + comment: file.comment, + folderId: file.folderId, + isSensitive: file.isSensitive, + }); + + const fileObj = await DriveFiles.pack(file, { self: true }); + + // Publish fileUpdated event + publishDriveStream(user.id, "fileUpdated", fileObj); + + return fileObj; +}); diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts new file mode 100644 index 000000000..7bb47dbef --- /dev/null +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -0,0 +1,57 @@ +import { uploadFromUrl } from "@/services/drive/upload-from-url.js"; +import define from "../../../define.js"; +import { DriveFiles } from "@/models/index.js"; +import { publishMainStream } from "@/services/stream.js"; +import { HOUR } from "@/const.js"; + +export const meta = { + tags: ["drive"], + + limit: { + duration: HOUR, + max: 60, + }, + + description: + "Request the server to download a new drive file from the specified URL.", + + requireCredential: true, + + kind: "write:drive", +} as const; + +export const paramDef = { + type: "object", + properties: { + url: { type: "string" }, + folderId: { + type: "string", + format: "misskey:id", + nullable: true, + default: null, + }, + isSensitive: { type: "boolean", default: false }, + comment: { type: "string", nullable: true, maxLength: 512, default: null }, + marker: { type: "string", nullable: true, default: null }, + force: { type: "boolean", default: false }, + }, + required: ["url"], +} as const; + +export default define(meta, paramDef, async (ps, user) => { + uploadFromUrl({ + url: ps.url, + user, + folderId: ps.folderId, + sensitive: ps.isSensitive, + force: ps.force, + comment: ps.comment, + }).then((file) => { + DriveFiles.pack(file, { self: true }).then((packedFile) => { + publishMainStream(user.id, "urlUploadFinished", { + marker: ps.marker, + file: packedFile, + }); + }); + }); +}); diff --git a/packages/iceshrimp-js/etc/iceshrimp-js.api.md b/packages/iceshrimp-js/etc/iceshrimp-js.api.md index f5ced4701..ba6cc4034 100644 --- a/packages/iceshrimp-js/etc/iceshrimp-js.api.md +++ b/packages/iceshrimp-js/etc/iceshrimp-js.api.md @@ -1,2838 +1,2838 @@ -## API Report File for "iceshrimp-js" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { EventEmitter } from 'eventemitter3'; - -// @public (undocumented) -export type Acct = { - username: string; - host: string | null; -}; - -// Warning: (ae-forgotten-export) The symbol "TODO_2" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -type Ad = TODO_2; - -// @public (undocumented) -type Announcement = { - id: ID; - createdAt: DateString; - updatedAt: DateString | null; - text: string; - title: string; - imageUrl: string | null; - isRead?: boolean; -}; - -// @public (undocumented) -type Antenna = { - id: ID; - createdAt: DateString; - name: string; - keywords: string[][]; - excludeKeywords: string[][]; - src: "home" | "all" | "users" | "list" | "group" | "instances"; - userListId: ID | null; - userGroupId: ID | null; - users: string[]; - instances: string[]; - caseSensitive: boolean; - notify: boolean; - withReplies: boolean; - withFile: boolean; - hasUnreadNote: boolean; -}; - -declare namespace api { - export { - isAPIError, - APIError, - FetchLike, - APIClient - } -} -export { api } - -// @public (undocumented) -class APIClient { - constructor(opts: { - origin: APIClient["origin"]; - credential?: APIClient["credential"]; - fetch?: APIClient["fetch"] | null | undefined; - }); - // (undocumented) - credential: string | null | undefined; - // (undocumented) - fetch: FetchLike; - // (undocumented) - origin: string; - // Warning: (ae-forgotten-export) The symbol "IsCaseMatched" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "GetCaseResult" needs to be exported by the entry point index.d.ts - // - // (undocumented) - request( - endpoint: E, - params?: P, - credential?: string | null | undefined, - ): Promise< - Endpoints[E]["res"] extends { - $switch: { - $cases: [any, any][]; - $default: any; - }; - } - ? IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : Endpoints[E]["res"]["$switch"]["$default"] - : Endpoints[E]["res"] - >; -} - -// @public (undocumented) -type APIError = { - id: string; - code: string; - message: string; - kind: "client" | "server"; - info: Record; -}; - -// @public (undocumented) -type App = TODO_2; - -// @public (undocumented) -type AuthSession = { - id: ID; - app: App; - token: string; -}; - -// @public (undocumented) -type Blocking = { - id: ID; - createdAt: DateString; - blockeeId: User["id"]; - blockee: UserDetailed; -}; - -// @public (undocumented) -type Channel = { - id: ID; -}; - -// Warning: (ae-forgotten-export) The symbol "AnyOf" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export abstract class ChannelConnection< - Channel extends AnyOf = any, -> extends EventEmitter { - constructor(stream: Stream, channel: string, name?: string); - // (undocumented) - channel: string; - // (undocumented) - abstract dispose(): void; - // (undocumented) - abstract id: string; - // (undocumented) - inCount: number; - // (undocumented) - name?: string; - // (undocumented) - outCount: number; - // (undocumented) - send( - type: T, - body: Channel["receives"][T], - ): void; - // (undocumented) - protected stream: Stream; -} - -// @public (undocumented) -export type Channels = { - main: { - params: null; - events: { - notification: (payload: Notification_2) => void; - mention: (payload: Note) => void; - reply: (payload: Note) => void; - renote: (payload: Note) => void; - follow: (payload: User) => void; - followed: (payload: User) => void; - unfollow: (payload: User) => void; - meUpdated: (payload: MeDetailed) => void; - pageEvent: (payload: PageEvent) => void; - urlUploadFinished: (payload: { - marker: string; - file: DriveFile; - }) => void; - readAllNotifications: () => void; - unreadNotification: (payload: Notification_2) => void; - unreadMention: (payload: Note["id"]) => void; - readAllUnreadMentions: () => void; - unreadSpecifiedNote: (payload: Note["id"]) => void; - readAllUnreadSpecifiedNotes: () => void; - readAllMessagingMessages: () => void; - messagingMessage: (payload: MessagingMessage) => void; - unreadMessagingMessage: (payload: MessagingMessage) => void; - readAllAntennas: () => void; - unreadAntenna: (payload: Antenna) => void; - readAllAnnouncements: () => void; - readAllChannels: () => void; - unreadChannel: (payload: Note["id"]) => void; - myTokenRegenerated: () => void; - reversiNoInvites: () => void; - reversiInvited: (payload: FIXME) => void; - signin: (payload: FIXME) => void; - registryUpdated: (payload: { - scope?: string[]; - key: string; - value: any | null; - }) => void; - driveFileCreated: (payload: DriveFile) => void; - readAntenna: (payload: Antenna) => void; - }; - receives: null; - }; - homeTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - localTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - hybridTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - recommendedTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - globalTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - antenna: { - params: { - antennaId: Antenna["id"]; - }; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - messaging: { - params: { - otherparty?: User["id"] | null; - group?: UserGroup["id"] | null; - }; - events: { - message: (payload: MessagingMessage) => void; - deleted: (payload: MessagingMessage["id"]) => void; - read: (payload: MessagingMessage["id"][]) => void; - typers: (payload: User[]) => void; - }; - receives: { - read: { - id: MessagingMessage["id"]; - }; - }; - }; - serverStats: { - params: null; - events: { - stats: (payload: FIXME) => void; - }; - receives: { - requestLog: { - id: string | number; - length: number; - }; - }; - }; - queueStats: { - params: null; - events: { - stats: (payload: FIXME) => void; - }; - receives: { - requestLog: { - id: string | number; - length: number; - }; - }; - }; -}; - -// @public (undocumented) -type Clip = TODO_2; - -// @public (undocumented) -type CustomEmoji = { - id: string; - name: string; - url: string; - category: string; - aliases: string[]; -}; - -// @public (undocumented) -type DateString = string; - -// @public (undocumented) -type DetailedInstanceMetadata = LiteInstanceMetadata & { - features: Record; -}; - -// @public (undocumented) -type DriveFile = { - id: ID; - createdAt: DateString; - isSensitive: boolean; - name: string; - thumbnailUrl: string; - url: string; - type: string; - size: number; - md5: string; - blurhash: string; - comment: string | null; - properties: Record; -}; - -// @public (undocumented) -type DriveFolder = TODO_2; - -// @public (undocumented) -export type Endpoints = { - "admin/abuse-user-reports": { - req: TODO; - res: TODO; - }; - "admin/delete-all-files-of-a-user": { - req: { - userId: User["id"]; - }; - res: null; - }; - "admin/delete-logs": { - req: NoParams; - res: null; - }; - "admin/get-index-stats": { - req: TODO; - res: TODO; - }; - "admin/get-table-stats": { - req: TODO; - res: TODO; - }; - "admin/invite": { - req: TODO; - res: TODO; - }; - "admin/logs": { - req: TODO; - res: TODO; - }; - "admin/meta": { - req: TODO; - res: TODO; - }; - "admin/reset-password": { - req: TODO; - res: TODO; - }; - "admin/resolve-abuse-user-report": { - req: TODO; - res: TODO; - }; - "admin/resync-chart": { - req: TODO; - res: TODO; - }; - "admin/send-email": { - req: TODO; - res: TODO; - }; - "admin/server-info": { - req: TODO; - res: TODO; - }; - "admin/show-moderation-logs": { - req: TODO; - res: TODO; - }; - "admin/show-user": { - req: TODO; - res: TODO; - }; - "admin/show-users": { - req: TODO; - res: TODO; - }; - "admin/silence-user": { - req: TODO; - res: TODO; - }; - "admin/suspend-user": { - req: TODO; - res: TODO; - }; - "admin/unsilence-user": { - req: TODO; - res: TODO; - }; - "admin/unsuspend-user": { - req: TODO; - res: TODO; - }; - "admin/update-meta": { - req: TODO; - res: TODO; - }; - "admin/vacuum": { - req: TODO; - res: TODO; - }; - "admin/accounts/create": { - req: TODO; - res: TODO; - }; - "admin/ad/create": { - req: TODO; - res: TODO; - }; - "admin/ad/delete": { - req: { - id: Ad["id"]; - }; - res: null; - }; - "admin/ad/list": { - req: TODO; - res: TODO; - }; - "admin/ad/update": { - req: TODO; - res: TODO; - }; - "admin/announcements/create": { - req: TODO; - res: TODO; - }; - "admin/announcements/delete": { - req: { - id: Announcement["id"]; - }; - res: null; - }; - "admin/announcements/list": { - req: TODO; - res: TODO; - }; - "admin/announcements/update": { - req: TODO; - res: TODO; - }; - "admin/drive/clean-remote-files": { - req: TODO; - res: TODO; - }; - "admin/drive/cleanup": { - req: TODO; - res: TODO; - }; - "admin/drive/files": { - req: TODO; - res: TODO; - }; - "admin/drive/show-file": { - req: TODO; - res: TODO; - }; - "admin/emoji/add": { - req: TODO; - res: TODO; - }; - "admin/emoji/copy": { - req: TODO; - res: TODO; - }; - "admin/emoji/list-remote": { - req: TODO; - res: TODO; - }; - "admin/emoji/list": { - req: TODO; - res: TODO; - }; - "admin/emoji/remove": { - req: TODO; - res: TODO; - }; - "admin/emoji/update": { - req: TODO; - res: TODO; - }; - "admin/federation/delete-all-files": { - req: { - host: string; - }; - res: null; - }; - "admin/federation/refresh-remote-instance-metadata": { - req: TODO; - res: TODO; - }; - "admin/federation/remove-all-following": { - req: TODO; - res: TODO; - }; - "admin/federation/update-instance": { - req: TODO; - res: TODO; - }; - "admin/moderators/add": { - req: TODO; - res: TODO; - }; - "admin/moderators/remove": { - req: TODO; - res: TODO; - }; - "admin/promo/create": { - req: TODO; - res: TODO; - }; - "admin/queue/clear": { - req: TODO; - res: TODO; - }; - "admin/queue/deliver-delayed": { - req: TODO; - res: TODO; - }; - "admin/queue/inbox-delayed": { - req: TODO; - res: TODO; - }; - "admin/queue/jobs": { - req: TODO; - res: TODO; - }; - "admin/queue/stats": { - req: TODO; - res: TODO; - }; - "admin/relays/add": { - req: TODO; - res: TODO; - }; - "admin/relays/list": { - req: TODO; - res: TODO; - }; - "admin/relays/remove": { - req: TODO; - res: TODO; - }; - announcements: { - req: { - limit?: number; - withUnreads?: boolean; - sinceId?: Announcement["id"]; - untilId?: Announcement["id"]; - }; - res: Announcement[]; - }; - "antennas/create": { - req: TODO; - res: Antenna; - }; - "antennas/delete": { - req: { - antennaId: Antenna["id"]; - }; - res: null; - }; - "antennas/list": { - req: NoParams; - res: Antenna[]; - }; - "antennas/notes": { - req: { - antennaId: Antenna["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "antennas/show": { - req: { - antennaId: Antenna["id"]; - }; - res: Antenna; - }; - "antennas/update": { - req: TODO; - res: Antenna; - }; - "antennas/mark-read": { - req: TODO; - res: Antenna; - }; - "ap/get": { - req: { - uri: string; - }; - res: Record; - }; - "ap/show": { - req: { - uri: string; - }; - res: - | { - type: "Note"; - object: Note; - } - | { - type: "User"; - object: UserDetailed; - }; - }; - "app/create": { - req: TODO; - res: App; - }; - "app/show": { - req: { - appId: App["id"]; - }; - res: App; - }; - "auth/accept": { - req: { - token: string; - }; - res: null; - }; - "auth/session/generate": { - req: { - appSecret: string; - }; - res: { - token: string; - url: string; - }; - }; - "auth/session/show": { - req: { - token: string; - }; - res: AuthSession; - }; - "auth/session/userkey": { - req: { - appSecret: string; - token: string; - }; - res: { - accessToken: string; - user: User; - }; - }; - "blocking/create": { - req: { - userId: User["id"]; - }; - res: UserDetailed; - }; - "blocking/delete": { - req: { - userId: User["id"]; - }; - res: UserDetailed; - }; - "blocking/list": { - req: { - limit?: number; - sinceId?: Blocking["id"]; - untilId?: Blocking["id"]; - }; - res: Blocking[]; - }; - "channels/create": { - req: TODO; - res: TODO; - }; - "channels/featured": { - req: TODO; - res: TODO; - }; - "channels/follow": { - req: TODO; - res: TODO; - }; - "channels/followed": { - req: TODO; - res: TODO; - }; - "channels/owned": { - req: TODO; - res: TODO; - }; - "channels/pin-note": { - req: TODO; - res: TODO; - }; - "channels/show": { - req: TODO; - res: TODO; - }; - "channels/timeline": { - req: TODO; - res: TODO; - }; - "channels/unfollow": { - req: TODO; - res: TODO; - }; - "channels/update": { - req: TODO; - res: TODO; - }; - "charts/active-users": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - users: number[]; - }; - remote: { - users: number[]; - }; - }; - }; - "charts/drive": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - decCount: number[]; - decSize: number[]; - incCount: number[]; - incSize: number[]; - totalCount: number[]; - totalSize: number[]; - }; - remote: { - decCount: number[]; - decSize: number[]; - incCount: number[]; - incSize: number[]; - totalCount: number[]; - totalSize: number[]; - }; - }; - }; - "charts/federation": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - instance: { - dec: number[]; - inc: number[]; - total: number[]; - }; - }; - }; - "charts/hashtag": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: TODO; - }; - "charts/instance": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - host: string; - }; - res: { - drive: { - decFiles: number[]; - decUsage: number[]; - incFiles: number[]; - incUsage: number[]; - totalFiles: number[]; - totalUsage: number[]; - }; - followers: { - dec: number[]; - inc: number[]; - total: number[]; - }; - following: { - dec: number[]; - inc: number[]; - total: number[]; - }; - notes: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - requests: { - failed: number[]; - received: number[]; - succeeded: number[]; - }; - users: { - dec: number[]; - inc: number[]; - total: number[]; - }; - }; - }; - "charts/network": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: TODO; - }; - "charts/notes": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - remote: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - }; - }; - "charts/user/drive": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: { - decCount: number[]; - decSize: number[]; - incCount: number[]; - incSize: number[]; - totalCount: number[]; - totalSize: number[]; - }; - }; - "charts/user/following": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: TODO; - }; - "charts/user/notes": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - }; - "charts/user/reactions": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: TODO; - }; - "charts/users": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - dec: number[]; - inc: number[]; - total: number[]; - }; - remote: { - dec: number[]; - inc: number[]; - total: number[]; - }; - }; - }; - "clips/add-note": { - req: TODO; - res: TODO; - }; - "clips/create": { - req: TODO; - res: TODO; - }; - "clips/delete": { - req: { - clipId: Clip["id"]; - }; - res: null; - }; - "clips/list": { - req: TODO; - res: TODO; - }; - "clips/notes": { - req: TODO; - res: TODO; - }; - "clips/show": { - req: TODO; - res: TODO; - }; - "clips/update": { - req: TODO; - res: TODO; - }; - drive: { - req: NoParams; - res: { - capacity: number; - usage: number; - }; - }; - "drive/files": { - req: { - folderId?: DriveFolder["id"] | null; - type?: DriveFile["type"] | null; - limit?: number; - sinceId?: DriveFile["id"]; - untilId?: DriveFile["id"]; - }; - res: DriveFile[]; - }; - "drive/files/attached-notes": { - req: TODO; - res: TODO; - }; - "drive/files/check-existence": { - req: TODO; - res: TODO; - }; - "drive/files/create": { - req: TODO; - res: TODO; - }; - "drive/files/delete": { - req: { - fileId: DriveFile["id"]; - }; - res: null; - }; - "drive/files/find-by-hash": { - req: TODO; - res: TODO; - }; - "drive/files/find": { - req: { - name: string; - folderId?: DriveFolder["id"] | null; - }; - res: DriveFile[]; - }; - "drive/files/show": { - req: { - fileId?: DriveFile["id"]; - url?: string; - }; - res: DriveFile; - }; - "drive/files/update": { - req: { - fileId: DriveFile["id"]; - folderId?: DriveFolder["id"] | null; - name?: string; - isSensitive?: boolean; - comment?: string | null; - }; - res: DriveFile; - }; - "drive/files/upload-from-url": { - req: { - url: string; - folderId?: DriveFolder["id"] | null; - isSensitive?: boolean; - comment?: string | null; - marker?: string | null; - force?: boolean; - }; - res: null; - }; - "drive/folders": { - req: { - folderId?: DriveFolder["id"] | null; - limit?: number; - sinceId?: DriveFile["id"]; - untilId?: DriveFile["id"]; - }; - res: DriveFolder[]; - }; - "drive/folders/create": { - req: { - name?: string; - parentId?: DriveFolder["id"] | null; - }; - res: DriveFolder; - }; - "drive/folders/delete": { - req: { - folderId: DriveFolder["id"]; - }; - res: null; - }; - "drive/folders/find": { - req: { - name: string; - parentId?: DriveFolder["id"] | null; - }; - res: DriveFolder[]; - }; - "drive/folders/show": { - req: { - folderId: DriveFolder["id"]; - }; - res: DriveFolder; - }; - "drive/folders/update": { - req: { - folderId: DriveFolder["id"]; - name?: string; - parentId?: DriveFolder["id"] | null; - }; - res: DriveFolder; - }; - "drive/stream": { - req: { - type?: DriveFile["type"] | null; - limit?: number; - sinceId?: DriveFile["id"]; - untilId?: DriveFile["id"]; - }; - res: DriveFile[]; - }; - endpoint: { - req: { - endpoint: string; - }; - res: { - params: { - name: string; - type: string; - }[]; - }; - }; - endpoints: { - req: NoParams; - res: string[]; - }; - "federation/dns": { - req: { - host: string; - }; - res: { - a: string[]; - aaaa: string[]; - cname: string[]; - txt: string[]; - }; - }; - "federation/followers": { - req: { - host: string; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFolloweePopulated[]; - }; - "federation/following": { - req: { - host: string; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFolloweePopulated[]; - }; - "federation/instances": { - req: { - host?: string | null; - blocked?: boolean | null; - notResponding?: boolean | null; - suspended?: boolean | null; - federating?: boolean | null; - subscribing?: boolean | null; - publishing?: boolean | null; - limit?: number; - offset?: number; - sort?: - | "+pubSub" - | "-pubSub" - | "+notes" - | "-notes" - | "+users" - | "-users" - | "+following" - | "-following" - | "+followers" - | "-followers" - | "+caughtAt" - | "-caughtAt" - | "+lastCommunicatedAt" - | "-lastCommunicatedAt" - | "+driveUsage" - | "-driveUsage" - | "+driveFiles" - | "-driveFiles"; - }; - res: Instance[]; - }; - "federation/show-instance": { - req: { - host: string; - }; - res: Instance; - }; - "federation/update-remote-user": { - req: { - userId: User["id"]; - }; - res: null; - }; - "federation/users": { - req: { - host: string; - limit?: number; - sinceId?: User["id"]; - untilId?: User["id"]; - }; - res: UserDetailed[]; - }; - "following/create": { - req: { - userId: User["id"]; - }; - res: User; - }; - "following/delete": { - req: { - userId: User["id"]; - }; - res: User; - }; - "following/requests/accept": { - req: { - userId: User["id"]; - }; - res: null; - }; - "following/requests/cancel": { - req: { - userId: User["id"]; - }; - res: User; - }; - "following/requests/list": { - req: NoParams; - res: FollowRequest[]; - }; - "following/requests/reject": { - req: { - userId: User["id"]; - }; - res: null; - }; - "gallery/featured": { - req: TODO; - res: TODO; - }; - "gallery/popular": { - req: TODO; - res: TODO; - }; - "gallery/posts": { - req: TODO; - res: TODO; - }; - "gallery/posts/create": { - req: TODO; - res: TODO; - }; - "gallery/posts/delete": { - req: { - postId: GalleryPost["id"]; - }; - res: null; - }; - "gallery/posts/like": { - req: TODO; - res: TODO; - }; - "gallery/posts/show": { - req: TODO; - res: TODO; - }; - "gallery/posts/unlike": { - req: TODO; - res: TODO; - }; - "gallery/posts/update": { - req: TODO; - res: TODO; - }; - "games/reversi/games": { - req: TODO; - res: TODO; - }; - "games/reversi/games/show": { - req: TODO; - res: TODO; - }; - "games/reversi/games/surrender": { - req: TODO; - res: TODO; - }; - "games/reversi/invitations": { - req: TODO; - res: TODO; - }; - "games/reversi/match": { - req: TODO; - res: TODO; - }; - "games/reversi/match/cancel": { - req: TODO; - res: TODO; - }; - "get-online-users-count": { - req: NoParams; - res: { - count: number; - }; - }; - "hashtags/list": { - req: TODO; - res: TODO; - }; - "hashtags/search": { - req: TODO; - res: TODO; - }; - "hashtags/show": { - req: TODO; - res: TODO; - }; - "hashtags/trend": { - req: TODO; - res: TODO; - }; - "hashtags/users": { - req: TODO; - res: TODO; - }; - i: { - req: NoParams; - res: User; - }; - "i/apps": { - req: TODO; - res: TODO; - }; - "i/authorized-apps": { - req: TODO; - res: TODO; - }; - "i/change-password": { - req: TODO; - res: TODO; - }; - "i/delete-account": { - req: { - password: string; - }; - res: null; - }; - "i/export-blocking": { - req: TODO; - res: TODO; - }; - "i/export-following": { - req: TODO; - res: TODO; - }; - "i/export-mute": { - req: TODO; - res: TODO; - }; - "i/export-notes": { - req: TODO; - res: TODO; - }; - "i/export-user-lists": { - req: TODO; - res: TODO; - }; - "i/favorites": { - req: { - limit?: number; - sinceId?: NoteFavorite["id"]; - untilId?: NoteFavorite["id"]; - }; - res: NoteFavorite[]; - }; - "i/gallery/likes": { - req: TODO; - res: TODO; - }; - "i/gallery/posts": { - req: TODO; - res: TODO; - }; - "i/get-word-muted-notes-count": { - req: TODO; - res: TODO; - }; - "i/import-following": { - req: TODO; - res: TODO; - }; - "i/import-user-lists": { - req: TODO; - res: TODO; - }; - "i/move": { - req: TODO; - res: TODO; - }; - "i/known-as": { - req: TODO; - res: TODO; - }; - "i/notifications": { - req: { - limit?: number; - sinceId?: Notification_2["id"]; - untilId?: Notification_2["id"]; - following?: boolean; - markAsRead?: boolean; - includeTypes?: Notification_2["type"][]; - excludeTypes?: Notification_2["type"][]; - }; - res: Notification_2[]; - }; - "i/page-likes": { - req: TODO; - res: TODO; - }; - "i/pages": { - req: TODO; - res: TODO; - }; - "i/pin": { - req: { - noteId: Note["id"]; - }; - res: MeDetailed; - }; - "i/read-all-messaging-messages": { - req: TODO; - res: TODO; - }; - "i/read-all-unread-notes": { - req: TODO; - res: TODO; - }; - "i/read-announcement": { - req: TODO; - res: TODO; - }; - "i/regenerate-token": { - req: { - password: string; - }; - res: null; - }; - "i/registry/get-all": { - req: { - scope?: string[]; - }; - res: Record; - }; - "i/registry/get-detail": { - req: { - key: string; - scope?: string[]; - }; - res: { - updatedAt: DateString; - value: any; - }; - }; - "i/registry/get": { - req: { - key: string; - scope?: string[]; - }; - res: any; - }; - "i/registry/keys-with-type": { - req: { - scope?: string[]; - }; - res: Record< - string, - "null" | "array" | "number" | "string" | "boolean" | "object" - >; - }; - "i/registry/keys": { - req: { - scope?: string[]; - }; - res: string[]; - }; - "i/registry/remove": { - req: { - key: string; - scope?: string[]; - }; - res: null; - }; - "i/registry/scopes": { - req: NoParams; - res: string[][]; - }; - "i/registry/set": { - req: { - key: string; - value: any; - scope?: string[]; - }; - res: null; - }; - "i/revoke-token": { - req: TODO; - res: TODO; - }; - "i/signin-history": { - req: { - limit?: number; - sinceId?: Signin["id"]; - untilId?: Signin["id"]; - }; - res: Signin[]; - }; - "i/unpin": { - req: { - noteId: Note["id"]; - }; - res: MeDetailed; - }; - "i/update-email": { - req: { - password: string; - email?: string | null; - }; - res: MeDetailed; - }; - "i/update": { - req: { - name?: string | null; - description?: string | null; - lang?: string | null; - location?: string | null; - birthday?: string | null; - avatarId?: DriveFile["id"] | null; - bannerId?: DriveFile["id"] | null; - fields?: { - name: string; - value: string; - }[]; - isLocked?: boolean; - isExplorable?: boolean; - hideOnlineStatus?: boolean; - carefulBot?: boolean; - autoAcceptFollowed?: boolean; - noCrawle?: boolean; - preventAiLearning?: boolean; - isBot?: boolean; - isCat?: boolean; - injectFeaturedNote?: boolean; - receiveAnnouncementEmail?: boolean; - alwaysMarkNsfw?: boolean; - mutedWords?: string[][]; - mutingNotificationTypes?: Notification_2["type"][]; - emailNotificationTypes?: string[]; - }; - res: MeDetailed; - }; - "i/user-group-invites": { - req: TODO; - res: TODO; - }; - "i/2fa/done": { - req: TODO; - res: TODO; - }; - "i/2fa/key-done": { - req: TODO; - res: TODO; - }; - "i/2fa/password-less": { - req: TODO; - res: TODO; - }; - "i/2fa/register-key": { - req: TODO; - res: TODO; - }; - "i/2fa/register": { - req: TODO; - res: TODO; - }; - "i/2fa/update-key": { - req: TODO; - res: TODO; - }; - "i/2fa/remove-key": { - req: TODO; - res: TODO; - }; - "i/2fa/unregister": { - req: TODO; - res: TODO; - }; - "messaging/history": { - req: { - limit?: number; - group?: boolean; - }; - res: MessagingMessage[]; - }; - "messaging/messages": { - req: { - userId?: User["id"]; - groupId?: UserGroup["id"]; - limit?: number; - sinceId?: MessagingMessage["id"]; - untilId?: MessagingMessage["id"]; - markAsRead?: boolean; - }; - res: MessagingMessage[]; - }; - "messaging/messages/create": { - req: { - userId?: User["id"]; - groupId?: UserGroup["id"]; - text?: string; - fileId?: DriveFile["id"]; - }; - res: MessagingMessage; - }; - "messaging/messages/delete": { - req: { - messageId: MessagingMessage["id"]; - }; - res: null; - }; - "messaging/messages/read": { - req: { - messageId: MessagingMessage["id"]; - }; - res: null; - }; - meta: { - req: { - detail?: boolean; - }; - res: { - $switch: { - $cases: [ - [ - { - detail: true; - }, - DetailedInstanceMetadata, - ], - [ - { - detail: false; - }, - LiteInstanceMetadata, - ], - [ - { - detail: boolean; - }, - LiteInstanceMetadata | DetailedInstanceMetadata, - ], - ]; - $default: LiteInstanceMetadata; - }; - }; - }; - "miauth/gen-token": { - req: TODO; - res: TODO; - }; - "mute/create": { - req: TODO; - res: TODO; - }; - "mute/delete": { - req: { - userId: User["id"]; - }; - res: null; - }; - "mute/list": { - req: TODO; - res: TODO; - }; - "renote-mute/create": { - req: TODO; - res: TODO; - }; - "renote-mute/delete": { - req: { - userId: User["id"]; - }; - res: null; - }; - "renote-mute/list": { - req: TODO; - res: TODO; - }; - "my/apps": { - req: TODO; - res: TODO; - }; - notes: { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "notes/children": { - req: { - noteId: Note["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "notes/clips": { - req: TODO; - res: TODO; - }; - "notes/conversation": { - req: TODO; - res: TODO; - }; - "notes/create": { - req: NoteSubmitReq; - res: { - createdNote: Note; - }; - }; - "notes/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/edit": { - req: NoteSubmitReq; - res: { - createdNote: Note; - }; - }; - "notes/favorites/create": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/favorites/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/featured": { - req: TODO; - res: Note[]; - }; - "notes/global-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/recommended-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/hybrid-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/local-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/mentions": { - req: { - following?: boolean; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "notes/polls/recommendation": { - req: TODO; - res: TODO; - }; - "notes/polls/vote": { - req: { - noteId: Note["id"]; - choice: number; - }; - res: null; - }; - "notes/reactions": { - req: { - noteId: Note["id"]; - type?: string | null; - limit?: number; - }; - res: NoteReaction[]; - }; - "notes/reactions/create": { - req: { - noteId: Note["id"]; - reaction: string; - }; - res: null; - }; - "notes/reactions/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/renotes": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - noteId: Note["id"]; - }; - res: Note[]; - }; - "notes/replies": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - noteId: Note["id"]; - }; - res: Note[]; - }; - "notes/search-by-tag": { - req: TODO; - res: TODO; - }; - "notes/search": { - req: TODO; - res: TODO; - }; - "notes/show": { - req: { - noteId: Note["id"]; - }; - res: Note; - }; - "notes/state": { - req: TODO; - res: TODO; - }; - "notes/timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/unrenote": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/user-list-timeline": { - req: { - listId: UserList["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/watching/create": { - req: TODO; - res: TODO; - }; - "notes/watching/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notifications/create": { - req: { - body: string; - header?: string | null; - icon?: string | null; - }; - res: null; - }; - "notifications/mark-all-as-read": { - req: NoParams; - res: null; - }; - "notifications/read": { - req: { - notificationId: Notification_2["id"]; - }; - res: null; - }; - "page-push": { - req: { - pageId: Page["id"]; - event: string; - var?: any; - }; - res: null; - }; - "pages/create": { - req: TODO; - res: Page; - }; - "pages/delete": { - req: { - pageId: Page["id"]; - }; - res: null; - }; - "pages/featured": { - req: NoParams; - res: Page[]; - }; - "pages/like": { - req: { - pageId: Page["id"]; - }; - res: null; - }; - "pages/show": { - req: { - pageId?: Page["id"]; - name?: string; - username?: string; - }; - res: Page; - }; - "pages/unlike": { - req: { - pageId: Page["id"]; - }; - res: null; - }; - "pages/update": { - req: TODO; - res: null; - }; - ping: { - req: NoParams; - res: { - pong: number; - }; - }; - "pinned-users": { - req: TODO; - res: TODO; - }; - "promo/read": { - req: TODO; - res: TODO; - }; - "request-reset-password": { - req: { - username: string; - email: string; - }; - res: null; - }; - "reset-password": { - req: { - token: string; - password: string; - }; - res: null; - }; - "room/show": { - req: TODO; - res: TODO; - }; - "room/update": { - req: TODO; - res: TODO; - }; - stats: { - req: NoParams; - res: Stats; - }; - "server-info": { - req: NoParams; - res: ServerInfo; - }; - "latest-version": { - req: NoParams; - res: TODO; - }; - "sw/register": { - req: TODO; - res: TODO; - }; - "username/available": { - req: { - username: string; - }; - res: { - available: boolean; - }; - }; - users: { - req: { - limit?: number; - offset?: number; - sort?: UserSorting; - origin?: OriginType; - }; - res: User[]; - }; - "users/clips": { - req: TODO; - res: TODO; - }; - "users/followers": { - req: { - userId?: User["id"]; - username?: User["username"]; - host?: User["host"] | null; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFollowerPopulated[]; - }; - "users/following": { - req: { - userId?: User["id"]; - username?: User["username"]; - host?: User["host"] | null; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFolloweePopulated[]; - }; - "users/gallery/posts": { - req: TODO; - res: TODO; - }; - "users/get-frequently-replied-users": { - req: TODO; - res: TODO; - }; - "users/groups/create": { - req: TODO; - res: TODO; - }; - "users/groups/delete": { - req: { - groupId: UserGroup["id"]; - }; - res: null; - }; - "users/groups/invitations/accept": { - req: TODO; - res: TODO; - }; - "users/groups/invitations/reject": { - req: TODO; - res: TODO; - }; - "users/groups/invite": { - req: TODO; - res: TODO; - }; - "users/groups/joined": { - req: TODO; - res: TODO; - }; - "users/groups/owned": { - req: TODO; - res: TODO; - }; - "users/groups/pull": { - req: TODO; - res: TODO; - }; - "users/groups/show": { - req: TODO; - res: TODO; - }; - "users/groups/transfer": { - req: TODO; - res: TODO; - }; - "users/groups/update": { - req: TODO; - res: TODO; - }; - "users/lists/create": { - req: { - name: string; - }; - res: UserList; - }; - "users/lists/delete": { - req: { - listId: UserList["id"]; - }; - res: null; - }; - "users/lists/list": { - req: NoParams; - res: UserList[]; - }; - "users/lists/pull": { - req: { - listId: UserList["id"]; - userId: User["id"]; - }; - res: null; - }; - "users/lists/push": { - req: { - listId: UserList["id"]; - userId: User["id"]; - }; - res: null; - }; - "users/lists/show": { - req: { - listId: UserList["id"]; - }; - res: UserList; - }; - "users/lists/update": { - req: { - listId: UserList["id"]; - name: string; - }; - res: UserList; - }; - "users/notes": { - req: { - userId: User["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "users/pages": { - req: TODO; - res: TODO; - }; - "users/recommendation": { - req: TODO; - res: TODO; - }; - "users/relation": { - req: TODO; - res: TODO; - }; - "users/report-abuse": { - req: TODO; - res: TODO; - }; - "users/search-by-username-and-host": { - req: TODO; - res: TODO; - }; - "users/search": { - req: TODO; - res: TODO; - }; - "users/show": { - req: - | ShowUserReq - | { - userIds: User["id"][]; - }; - res: { - $switch: { - $cases: [ - [ - { - userIds: User["id"][]; - }, - UserDetailed[], - ], - ]; - $default: UserDetailed; - }; - }; - }; - "users/stats": { - req: TODO; - res: TODO; - }; -}; - -declare namespace entities { - export { - ID, - DateString, - User, - UserLite, - UserDetailed, - UserGroup, - UserList, - MeDetailed, - DriveFile, - DriveFolder, - GalleryPost, - Note, - NoteReaction, - Notification_2 as Notification, - MessagingMessage, - CustomEmoji, - LiteInstanceMetadata, - DetailedInstanceMetadata, - InstanceMetadata, - ServerInfo, - Stats, - Page, - PageEvent, - Announcement, - Antenna, - App, - AuthSession, - Ad, - Clip, - NoteFavorite, - FollowRequest, - Channel, - Following, - FollowingFolloweePopulated, - FollowingFollowerPopulated, - Blocking, - Instance, - Signin, - UserSorting, - OriginType - } -} -export { entities } - -// @public (undocumented) -type FetchLike = ( - input: string, - init?: { - method?: string; - body?: string; - credentials?: RequestCredentials; - cache?: RequestCache; - }, -) => Promise<{ - status: number; - json(): Promise; -}>; - -// @public (undocumented) -export const ffVisibility: readonly ["public", "followers", "private"]; - -// @public (undocumented) -type Following = { - id: ID; - createdAt: DateString; - followerId: User["id"]; - followeeId: User["id"]; -}; - -// @public (undocumented) -type FollowingFolloweePopulated = Following & { - followee: UserDetailed; -}; - -// @public (undocumented) -type FollowingFollowerPopulated = Following & { - follower: UserDetailed; -}; - -// @public (undocumented) -type FollowRequest = { - id: ID; - follower: User; - followee: User; -}; - -// @public (undocumented) -type GalleryPost = TODO_2; - -// @public (undocumented) -type ID = string; - -// @public (undocumented) -type Instance = { - id: ID; - caughtAt: DateString; - host: string; - usersCount: number; - notesCount: number; - followingCount: number; - followersCount: number; - driveUsage: number; - driveFiles: number; - latestRequestSentAt: DateString | null; - latestStatus: number | null; - latestRequestReceivedAt: DateString | null; - lastCommunicatedAt: DateString; - isNotResponding: boolean; - isSuspended: boolean; - softwareName: string | null; - softwareVersion: string | null; - openRegistrations: boolean | null; - name: string | null; - description: string | null; - maintainerName: string | null; - maintainerEmail: string | null; - iconUrl: string | null; - faviconUrl: string | null; - themeColor: string | null; - infoUpdatedAt: DateString | null; -}; - -// @public (undocumented) -type InstanceMetadata = - | LiteInstanceMetadata - | DetailedInstanceMetadata; - -// @public (undocumented) -function isAPIError(reason: any): reason is APIError; - -// @public (undocumented) -type LiteInstanceMetadata = { - maintainerName: string | null; - maintainerEmail: string | null; - version: string; - name: string | null; - uri: string; - description: string | null; - tosUrl: string | null; - disableRegistration: boolean; - disableLocalTimeline: boolean; - disableRecommendedTimeline: boolean; - disableGlobalTimeline: boolean; - driveCapacityPerLocalUserMb: number; - driveCapacityPerRemoteUserMb: number; - enableHcaptcha: boolean; - hcaptchaSiteKey: string | null; - enableRecaptcha: boolean; - recaptchaSiteKey: string | null; - swPublickey: string | null; - maxNoteTextLength: number; - enableEmail: boolean; - enableGithubIntegration: boolean; - enableDiscordIntegration: boolean; - enableServiceWorker: boolean; - emojis: CustomEmoji[]; - ads: { - id: ID; - ratio: number; - place: string; - url: string; - imageUrl: string; - }[]; -}; - -// @public (undocumented) -type MeDetailed = UserDetailed & { - avatarId: DriveFile["id"]; - bannerId: DriveFile["id"]; - autoAcceptFollowed: boolean; - alwaysMarkNsfw: boolean; - carefulBot: boolean; - emailNotificationTypes: string[]; - hasPendingReceivedFollowRequest: boolean; - hasUnreadAnnouncement: boolean; - hasUnreadAntenna: boolean; - hasUnreadChannel: boolean; - hasUnreadMentions: boolean; - hasUnreadMessagingMessage: boolean; - hasUnreadNotification: boolean; - hasUnreadSpecifiedNotes: boolean; - hideOnlineStatus: boolean; - injectFeaturedNote: boolean; - integrations: Record; - isDeleted: boolean; - isExplorable: boolean; - mutedWords: string[][]; - mutingNotificationTypes: string[]; - noCrawle: boolean; - preventAiLearning: boolean; - receiveAnnouncementEmail: boolean; - usePasswordLessLogin: boolean; - [other: string]: any; -}; - -// @public (undocumented) -type MessagingMessage = { - id: ID; - createdAt: DateString; - file: DriveFile | null; - fileId: DriveFile["id"] | null; - isRead: boolean; - reads: User["id"][]; - text: string | null; - user: User; - userId: User["id"]; - recipient?: User | null; - recipientId: User["id"] | null; - group?: UserGroup | null; - groupId: UserGroup["id"] | null; -}; - -// @public (undocumented) -export const mutedNoteReasons: readonly [ - "word", - "manual", - "spam", - "other", -]; - -// @public (undocumented) -type Note = { - id: ID; - createdAt: DateString; - text: string | null; - cw: string | null; - user: User; - userId: User["id"]; - reply?: Note; - replyId: Note["id"]; - renote?: Note; - renoteId: Note["id"]; - files: DriveFile[]; - fileIds: DriveFile["id"][]; - visibility: "public" | "home" | "followers" | "specified"; - visibleUserIds?: User["id"][]; - localOnly?: boolean; - channel?: Channel["id"]; - myReaction?: string; - reactions: Record; - renoteCount: number; - repliesCount: number; - poll?: { - expiresAt: DateString | null; - multiple: boolean; - choices: { - isVoted: boolean; - text: string; - votes: number; - }[]; - }; - emojis: { - name: string; - url: string; - }[]; - uri?: string; - url?: string; - updatedAt?: DateString; - isHidden?: boolean; -}; - -// @public (undocumented) -type NoteFavorite = { - id: ID; - createdAt: DateString; - noteId: Note["id"]; - note: Note; -}; - -// @public (undocumented) -type NoteReaction = { - id: ID; - createdAt: DateString; - user: UserLite; - type: string; -}; - -// @public (undocumented) -export const noteVisibilities: readonly [ - "public", - "home", - "followers", - "specified", -]; - -// @public (undocumented) -type Notification_2 = { - id: ID; - createdAt: DateString; - isRead: boolean; -} & ( - | { - type: "reaction"; - reaction: string; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "reply"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "renote"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "quote"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "mention"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "pollVote"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "follow"; - user: User; - userId: User["id"]; - } - | { - type: "followRequestAccepted"; - user: User; - userId: User["id"]; - } - | { - type: "receiveFollowRequest"; - user: User; - userId: User["id"]; - } - | { - type: "groupInvited"; - invitation: UserGroup; - user: User; - userId: User["id"]; - } - | { - type: "app"; - header?: string | null; - body: string; - icon?: string | null; - } -); - -// @public (undocumented) -export const notificationTypes: readonly [ - "follow", - "mention", - "reply", - "renote", - "quote", - "reaction", - "pollVote", - "pollEnded", - "receiveFollowRequest", - "followRequestAccepted", - "groupInvited", - "app", -]; - -// @public (undocumented) -type OriginType = "combined" | "local" | "remote"; - -// @public (undocumented) -type Page = { - id: ID; - createdAt: DateString; - updatedAt: DateString; - userId: User["id"]; - user: User; - content: Record[]; - variables: Record[]; - title: string; - name: string; - summary: string | null; - hideTitleWhenPinned: boolean; - alignCenter: boolean; - font: string; - script: string; - eyeCatchingImageId: DriveFile["id"] | null; - eyeCatchingImage: DriveFile | null; - attachedFiles: any; - likedCount: number; - isLiked?: boolean; -}; - -// @public (undocumented) -type PageEvent = { - pageId: Page["id"]; - event: string; - var: any; - userId: User["id"]; - user: User; -}; - -// @public (undocumented) -export const permissions: string[]; - -// @public (undocumented) -type ServerInfo = { - machine: string; - cpu: { - model: string; - cores: number; - }; - mem: { - total: number; - }; - fs: { - total: number; - used: number; - }; -}; - -// @public (undocumented) -type Signin = { - id: ID; - createdAt: DateString; - ip: string; - headers: Record; - success: boolean; -}; - -// @public (undocumented) -type Stats = { - notesCount: number; - originalNotesCount: number; - usersCount: number; - originalUsersCount: number; - instances: number; - driveUsageLocal: number; - driveUsageRemote: number; -}; - -// Warning: (ae-forgotten-export) The symbol "StreamEvents" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export class Stream extends EventEmitter { - constructor( - origin: string, - user: { - token: string; - } | null, - options?: { - WebSocket?: any; - }, - ); - // (undocumented) - close(): void; - // Warning: (ae-forgotten-export) The symbol "NonSharedConnection" needs to be exported by the entry point index.d.ts - // - // (undocumented) - disconnectToChannel(connection: NonSharedConnection): void; - // Warning: (ae-forgotten-export) The symbol "SharedConnection" needs to be exported by the entry point index.d.ts - // - // (undocumented) - removeSharedConnection(connection: SharedConnection): void; - // Warning: (ae-forgotten-export) The symbol "Pool" needs to be exported by the entry point index.d.ts - // - // (undocumented) - removeSharedConnectionPool(pool: Pool): void; - // (undocumented) - send(typeOrPayload: any, payload?: any): void; - // (undocumented) - state: "initializing" | "reconnecting" | "connected"; - // (undocumented) - useChannel( - channel: C, - params?: Channels[C]["params"], - name?: string, - ): ChannelConnection; - } - -// @public (undocumented) -type User = UserLite | UserDetailed; - -// @public (undocumented) -type UserDetailed = UserLite & { - bannerBlurhash: string | null; - bannerColor: string | null; - bannerUrl: string | null; - birthday: string | null; - createdAt: DateString; - description: string | null; - ffVisibility: "public" | "followers" | "private"; - fields: { - name: string; - value: string; - }[]; - followersCount: number; - followingCount: number; - hasPendingFollowRequestFromYou: boolean; - hasPendingFollowRequestToYou: boolean; - isAdmin: boolean; - isBlocked: boolean; - isBlocking: boolean; - isBot: boolean; - isCat: boolean; - isFollowed: boolean; - isFollowing: boolean; - isLocked: boolean; - isModerator: boolean; - isMuted: boolean; - isRenoteMuted: boolean; - isSilenced: boolean; - isSuspended: boolean; - lang: string | null; - lastFetchedAt?: DateString; - location: string | null; - notesCount: number; - pinnedNoteIds: ID[]; - pinnedNotes: Note[]; - pinnedPage: Page | null; - pinnedPageId: string | null; - publicReactions: boolean; - securityKeys: boolean; - twoFactorEnabled: boolean; - updatedAt: DateString | null; - uri: string | null; - url: string | null; -}; - -// @public (undocumented) -type UserGroup = TODO_2; - -// @public (undocumented) -type UserList = { - id: ID; - createdAt: DateString; - name: string; - userIds: User["id"][]; -}; - -// @public (undocumented) -type UserLite = { - id: ID; - username: string; - host: string | null; - name: string; - onlineStatus: "online" | "active" | "offline" | "unknown"; - avatarUrl: string; - avatarBlurhash: string; - alsoKnownAs: string[]; - movedToUri: any; - emojis: { - name: string; - url: string; - }[]; - instance?: { - name: Instance["name"]; - softwareName: Instance["softwareName"]; - softwareVersion: Instance["softwareVersion"]; - iconUrl: Instance["iconUrl"]; - faviconUrl: Instance["faviconUrl"]; - themeColor: Instance["themeColor"]; - }; -}; - -// @public (undocumented) -type UserSorting = - | "+follower" - | "-follower" - | "+createdAt" - | "-createdAt" - | "+updatedAt" - | "-updatedAt"; - -// Warnings were encountered during analysis: -// -// src/api.types.ts:80:37 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts -// src/api.types.ts:83:28 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts -// src/api.types.ts:853:5 - (ae-forgotten-export) The symbol "NoteSubmitReq" needs to be exported by the entry point index.d.ts -// src/api.types.ts:1094:3 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts -// src/streaming.types.ts:56:18 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "iceshrimp-js" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { EventEmitter } from 'eventemitter3'; + +// @public (undocumented) +export type Acct = { + username: string; + host: string | null; +}; + +// Warning: (ae-forgotten-export) The symbol "TODO_2" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +type Ad = TODO_2; + +// @public (undocumented) +type Announcement = { + id: ID; + createdAt: DateString; + updatedAt: DateString | null; + text: string; + title: string; + imageUrl: string | null; + isRead?: boolean; +}; + +// @public (undocumented) +type Antenna = { + id: ID; + createdAt: DateString; + name: string; + keywords: string[][]; + excludeKeywords: string[][]; + src: "home" | "all" | "users" | "list" | "group" | "instances"; + userListId: ID | null; + userGroupId: ID | null; + users: string[]; + instances: string[]; + caseSensitive: boolean; + notify: boolean; + withReplies: boolean; + withFile: boolean; + hasUnreadNote: boolean; +}; + +declare namespace api { + export { + isAPIError, + APIError, + FetchLike, + APIClient + } +} +export { api } + +// @public (undocumented) +class APIClient { + constructor(opts: { + origin: APIClient["origin"]; + credential?: APIClient["credential"]; + fetch?: APIClient["fetch"] | null | undefined; + }); + // (undocumented) + credential: string | null | undefined; + // (undocumented) + fetch: FetchLike; + // (undocumented) + origin: string; + // Warning: (ae-forgotten-export) The symbol "IsCaseMatched" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "GetCaseResult" needs to be exported by the entry point index.d.ts + // + // (undocumented) + request( + endpoint: E, + params?: P, + credential?: string | null | undefined, + ): Promise< + Endpoints[E]["res"] extends { + $switch: { + $cases: [any, any][]; + $default: any; + }; + } + ? IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : Endpoints[E]["res"]["$switch"]["$default"] + : Endpoints[E]["res"] + >; +} + +// @public (undocumented) +type APIError = { + id: string; + code: string; + message: string; + kind: "client" | "server"; + info: Record; +}; + +// @public (undocumented) +type App = TODO_2; + +// @public (undocumented) +type AuthSession = { + id: ID; + app: App; + token: string; +}; + +// @public (undocumented) +type Blocking = { + id: ID; + createdAt: DateString; + blockeeId: User["id"]; + blockee: UserDetailed; +}; + +// @public (undocumented) +type Channel = { + id: ID; +}; + +// Warning: (ae-forgotten-export) The symbol "AnyOf" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export abstract class ChannelConnection< + Channel extends AnyOf = any, +> extends EventEmitter { + constructor(stream: Stream, channel: string, name?: string); + // (undocumented) + channel: string; + // (undocumented) + abstract dispose(): void; + // (undocumented) + abstract id: string; + // (undocumented) + inCount: number; + // (undocumented) + name?: string; + // (undocumented) + outCount: number; + // (undocumented) + send( + type: T, + body: Channel["receives"][T], + ): void; + // (undocumented) + protected stream: Stream; +} + +// @public (undocumented) +export type Channels = { + main: { + params: null; + events: { + notification: (payload: Notification_2) => void; + mention: (payload: Note) => void; + reply: (payload: Note) => void; + renote: (payload: Note) => void; + follow: (payload: User) => void; + followed: (payload: User) => void; + unfollow: (payload: User) => void; + meUpdated: (payload: MeDetailed) => void; + pageEvent: (payload: PageEvent) => void; + urlUploadFinished: (payload: { + marker: string; + file: DriveFile; + }) => void; + readAllNotifications: () => void; + unreadNotification: (payload: Notification_2) => void; + unreadMention: (payload: Note["id"]) => void; + readAllUnreadMentions: () => void; + unreadSpecifiedNote: (payload: Note["id"]) => void; + readAllUnreadSpecifiedNotes: () => void; + readAllMessagingMessages: () => void; + messagingMessage: (payload: MessagingMessage) => void; + unreadMessagingMessage: (payload: MessagingMessage) => void; + readAllAntennas: () => void; + unreadAntenna: (payload: Antenna) => void; + readAllAnnouncements: () => void; + readAllChannels: () => void; + unreadChannel: (payload: Note["id"]) => void; + myTokenRegenerated: () => void; + reversiNoInvites: () => void; + reversiInvited: (payload: FIXME) => void; + signin: (payload: FIXME) => void; + registryUpdated: (payload: { + scope?: string[]; + key: string; + value: any | null; + }) => void; + driveFileCreated: (payload: DriveFile) => void; + readAntenna: (payload: Antenna) => void; + }; + receives: null; + }; + homeTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + localTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + hybridTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + recommendedTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + globalTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + antenna: { + params: { + antennaId: Antenna["id"]; + }; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + messaging: { + params: { + otherparty?: User["id"] | null; + group?: UserGroup["id"] | null; + }; + events: { + message: (payload: MessagingMessage) => void; + deleted: (payload: MessagingMessage["id"]) => void; + read: (payload: MessagingMessage["id"][]) => void; + typers: (payload: User[]) => void; + }; + receives: { + read: { + id: MessagingMessage["id"]; + }; + }; + }; + serverStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; + queueStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; +}; + +// @public (undocumented) +type Clip = TODO_2; + +// @public (undocumented) +type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; + +// @public (undocumented) +type DateString = string; + +// @public (undocumented) +type DetailedInstanceMetadata = LiteInstanceMetadata & { + features: Record; +}; + +// @public (undocumented) +type DriveFile = { + id: ID; + createdAt: DateString; + isSensitive: boolean; + name: string; + thumbnailUrl: string; + url: string; + type: string; + size: number; + md5: string; + blurhash: string; + comment: string | null; + properties: Record; +}; + +// @public (undocumented) +type DriveFolder = TODO_2; + +// @public (undocumented) +export type Endpoints = { + "admin/abuse-user-reports": { + req: TODO; + res: TODO; + }; + "admin/delete-all-files-of-a-user": { + req: { + userId: User["id"]; + }; + res: null; + }; + "admin/delete-logs": { + req: NoParams; + res: null; + }; + "admin/get-index-stats": { + req: TODO; + res: TODO; + }; + "admin/get-table-stats": { + req: TODO; + res: TODO; + }; + "admin/invite": { + req: TODO; + res: TODO; + }; + "admin/logs": { + req: TODO; + res: TODO; + }; + "admin/meta": { + req: TODO; + res: TODO; + }; + "admin/reset-password": { + req: TODO; + res: TODO; + }; + "admin/resolve-abuse-user-report": { + req: TODO; + res: TODO; + }; + "admin/resync-chart": { + req: TODO; + res: TODO; + }; + "admin/send-email": { + req: TODO; + res: TODO; + }; + "admin/server-info": { + req: TODO; + res: TODO; + }; + "admin/show-moderation-logs": { + req: TODO; + res: TODO; + }; + "admin/show-user": { + req: TODO; + res: TODO; + }; + "admin/show-users": { + req: TODO; + res: TODO; + }; + "admin/silence-user": { + req: TODO; + res: TODO; + }; + "admin/suspend-user": { + req: TODO; + res: TODO; + }; + "admin/unsilence-user": { + req: TODO; + res: TODO; + }; + "admin/unsuspend-user": { + req: TODO; + res: TODO; + }; + "admin/update-meta": { + req: TODO; + res: TODO; + }; + "admin/vacuum": { + req: TODO; + res: TODO; + }; + "admin/accounts/create": { + req: TODO; + res: TODO; + }; + "admin/ad/create": { + req: TODO; + res: TODO; + }; + "admin/ad/delete": { + req: { + id: Ad["id"]; + }; + res: null; + }; + "admin/ad/list": { + req: TODO; + res: TODO; + }; + "admin/ad/update": { + req: TODO; + res: TODO; + }; + "admin/announcements/create": { + req: TODO; + res: TODO; + }; + "admin/announcements/delete": { + req: { + id: Announcement["id"]; + }; + res: null; + }; + "admin/announcements/list": { + req: TODO; + res: TODO; + }; + "admin/announcements/update": { + req: TODO; + res: TODO; + }; + "admin/drive/clean-remote-files": { + req: TODO; + res: TODO; + }; + "admin/drive/cleanup": { + req: TODO; + res: TODO; + }; + "admin/drive/files": { + req: TODO; + res: TODO; + }; + "admin/drive/show-file": { + req: TODO; + res: TODO; + }; + "admin/emoji/add": { + req: TODO; + res: TODO; + }; + "admin/emoji/copy": { + req: TODO; + res: TODO; + }; + "admin/emoji/list-remote": { + req: TODO; + res: TODO; + }; + "admin/emoji/list": { + req: TODO; + res: TODO; + }; + "admin/emoji/remove": { + req: TODO; + res: TODO; + }; + "admin/emoji/update": { + req: TODO; + res: TODO; + }; + "admin/federation/delete-all-files": { + req: { + host: string; + }; + res: null; + }; + "admin/federation/refresh-remote-instance-metadata": { + req: TODO; + res: TODO; + }; + "admin/federation/remove-all-following": { + req: TODO; + res: TODO; + }; + "admin/federation/update-instance": { + req: TODO; + res: TODO; + }; + "admin/moderators/add": { + req: TODO; + res: TODO; + }; + "admin/moderators/remove": { + req: TODO; + res: TODO; + }; + "admin/promo/create": { + req: TODO; + res: TODO; + }; + "admin/queue/clear": { + req: TODO; + res: TODO; + }; + "admin/queue/deliver-delayed": { + req: TODO; + res: TODO; + }; + "admin/queue/inbox-delayed": { + req: TODO; + res: TODO; + }; + "admin/queue/jobs": { + req: TODO; + res: TODO; + }; + "admin/queue/stats": { + req: TODO; + res: TODO; + }; + "admin/relays/add": { + req: TODO; + res: TODO; + }; + "admin/relays/list": { + req: TODO; + res: TODO; + }; + "admin/relays/remove": { + req: TODO; + res: TODO; + }; + announcements: { + req: { + limit?: number; + withUnreads?: boolean; + sinceId?: Announcement["id"]; + untilId?: Announcement["id"]; + }; + res: Announcement[]; + }; + "antennas/create": { + req: TODO; + res: Antenna; + }; + "antennas/delete": { + req: { + antennaId: Antenna["id"]; + }; + res: null; + }; + "antennas/list": { + req: NoParams; + res: Antenna[]; + }; + "antennas/notes": { + req: { + antennaId: Antenna["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "antennas/show": { + req: { + antennaId: Antenna["id"]; + }; + res: Antenna; + }; + "antennas/update": { + req: TODO; + res: Antenna; + }; + "antennas/mark-read": { + req: TODO; + res: Antenna; + }; + "ap/get": { + req: { + uri: string; + }; + res: Record; + }; + "ap/show": { + req: { + uri: string; + }; + res: + | { + type: "Note"; + object: Note; + } + | { + type: "User"; + object: UserDetailed; + }; + }; + "app/create": { + req: TODO; + res: App; + }; + "app/show": { + req: { + appId: App["id"]; + }; + res: App; + }; + "auth/accept": { + req: { + token: string; + }; + res: null; + }; + "auth/session/generate": { + req: { + appSecret: string; + }; + res: { + token: string; + url: string; + }; + }; + "auth/session/show": { + req: { + token: string; + }; + res: AuthSession; + }; + "auth/session/userkey": { + req: { + appSecret: string; + token: string; + }; + res: { + accessToken: string; + user: User; + }; + }; + "blocking/create": { + req: { + userId: User["id"]; + }; + res: UserDetailed; + }; + "blocking/delete": { + req: { + userId: User["id"]; + }; + res: UserDetailed; + }; + "blocking/list": { + req: { + limit?: number; + sinceId?: Blocking["id"]; + untilId?: Blocking["id"]; + }; + res: Blocking[]; + }; + "channels/create": { + req: TODO; + res: TODO; + }; + "channels/featured": { + req: TODO; + res: TODO; + }; + "channels/follow": { + req: TODO; + res: TODO; + }; + "channels/followed": { + req: TODO; + res: TODO; + }; + "channels/owned": { + req: TODO; + res: TODO; + }; + "channels/pin-note": { + req: TODO; + res: TODO; + }; + "channels/show": { + req: TODO; + res: TODO; + }; + "channels/timeline": { + req: TODO; + res: TODO; + }; + "channels/unfollow": { + req: TODO; + res: TODO; + }; + "channels/update": { + req: TODO; + res: TODO; + }; + "charts/active-users": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + users: number[]; + }; + remote: { + users: number[]; + }; + }; + }; + "charts/drive": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + remote: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + }; + "charts/federation": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + instance: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "charts/hashtag": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + "charts/instance": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + host: string; + }; + res: { + drive: { + decFiles: number[]; + decUsage: number[]; + incFiles: number[]; + incUsage: number[]; + totalFiles: number[]; + totalUsage: number[]; + }; + followers: { + dec: number[]; + inc: number[]; + total: number[]; + }; + following: { + dec: number[]; + inc: number[]; + total: number[]; + }; + notes: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + requests: { + failed: number[]; + received: number[]; + succeeded: number[]; + }; + users: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "charts/network": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + "charts/notes": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + }; + "charts/user/drive": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + "charts/user/following": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: TODO; + }; + "charts/user/notes": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + "charts/user/reactions": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: TODO; + }; + "charts/users": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "clips/add-note": { + req: TODO; + res: TODO; + }; + "clips/create": { + req: TODO; + res: TODO; + }; + "clips/delete": { + req: { + clipId: Clip["id"]; + }; + res: null; + }; + "clips/list": { + req: TODO; + res: TODO; + }; + "clips/notes": { + req: TODO; + res: TODO; + }; + "clips/show": { + req: TODO; + res: TODO; + }; + "clips/update": { + req: TODO; + res: TODO; + }; + drive: { + req: NoParams; + res: { + capacity: number; + usage: number; + }; + }; + "drive/files": { + req: { + folderId?: DriveFolder["id"] | null; + type?: DriveFile["type"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFile[]; + }; + "drive/files/attached-notes": { + req: TODO; + res: TODO; + }; + "drive/files/check-existence": { + req: TODO; + res: TODO; + }; + "drive/files/create": { + req: TODO; + res: TODO; + }; + "drive/files/delete": { + req: { + fileId: DriveFile["id"]; + }; + res: null; + }; + "drive/files/find-by-hash": { + req: TODO; + res: TODO; + }; + "drive/files/find": { + req: { + name: string; + folderId?: DriveFolder["id"] | null; + }; + res: DriveFile[]; + }; + "drive/files/show": { + req: { + fileId?: DriveFile["id"]; + url?: string; + }; + res: DriveFile; + }; + "drive/files/update": { + req: { + fileId: DriveFile["id"]; + folderId?: DriveFolder["id"] | null; + name?: string; + isSensitive?: boolean; + comment?: string | null; + }; + res: DriveFile; + }; + "drive/files/upload-from-url": { + req: { + url: string; + folderId?: DriveFolder["id"] | null; + isSensitive?: boolean; + comment?: string | null; + marker?: string | null; + force?: boolean; + }; + res: null; + }; + "drive/folders": { + req: { + folderId?: DriveFolder["id"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFolder[]; + }; + "drive/folders/create": { + req: { + name?: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder; + }; + "drive/folders/delete": { + req: { + folderId: DriveFolder["id"]; + }; + res: null; + }; + "drive/folders/find": { + req: { + name: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder[]; + }; + "drive/folders/show": { + req: { + folderId: DriveFolder["id"]; + }; + res: DriveFolder; + }; + "drive/folders/update": { + req: { + folderId: DriveFolder["id"]; + name?: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder; + }; + "drive/stream": { + req: { + type?: DriveFile["type"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFile[]; + }; + endpoint: { + req: { + endpoint: string; + }; + res: { + params: { + name: string; + type: string; + }[]; + }; + }; + endpoints: { + req: NoParams; + res: string[]; + }; + "federation/dns": { + req: { + host: string; + }; + res: { + a: string[]; + aaaa: string[]; + cname: string[]; + txt: string[]; + }; + }; + "federation/followers": { + req: { + host: string; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "federation/following": { + req: { + host: string; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "federation/instances": { + req: { + host?: string | null; + blocked?: boolean | null; + notResponding?: boolean | null; + suspended?: boolean | null; + federating?: boolean | null; + subscribing?: boolean | null; + publishing?: boolean | null; + limit?: number; + offset?: number; + sort?: + | "+pubSub" + | "-pubSub" + | "+notes" + | "-notes" + | "+users" + | "-users" + | "+following" + | "-following" + | "+followers" + | "-followers" + | "+caughtAt" + | "-caughtAt" + | "+lastCommunicatedAt" + | "-lastCommunicatedAt" + | "+driveUsage" + | "-driveUsage" + | "+driveFiles" + | "-driveFiles"; + }; + res: Instance[]; + }; + "federation/show-instance": { + req: { + host: string; + }; + res: Instance; + }; + "federation/update-remote-user": { + req: { + userId: User["id"]; + }; + res: null; + }; + "federation/users": { + req: { + host: string; + limit?: number; + sinceId?: User["id"]; + untilId?: User["id"]; + }; + res: UserDetailed[]; + }; + "following/create": { + req: { + userId: User["id"]; + }; + res: User; + }; + "following/delete": { + req: { + userId: User["id"]; + }; + res: User; + }; + "following/requests/accept": { + req: { + userId: User["id"]; + }; + res: null; + }; + "following/requests/cancel": { + req: { + userId: User["id"]; + }; + res: User; + }; + "following/requests/list": { + req: NoParams; + res: FollowRequest[]; + }; + "following/requests/reject": { + req: { + userId: User["id"]; + }; + res: null; + }; + "gallery/featured": { + req: TODO; + res: TODO; + }; + "gallery/popular": { + req: TODO; + res: TODO; + }; + "gallery/posts": { + req: TODO; + res: TODO; + }; + "gallery/posts/create": { + req: TODO; + res: TODO; + }; + "gallery/posts/delete": { + req: { + postId: GalleryPost["id"]; + }; + res: null; + }; + "gallery/posts/like": { + req: TODO; + res: TODO; + }; + "gallery/posts/show": { + req: TODO; + res: TODO; + }; + "gallery/posts/unlike": { + req: TODO; + res: TODO; + }; + "gallery/posts/update": { + req: TODO; + res: TODO; + }; + "games/reversi/games": { + req: TODO; + res: TODO; + }; + "games/reversi/games/show": { + req: TODO; + res: TODO; + }; + "games/reversi/games/surrender": { + req: TODO; + res: TODO; + }; + "games/reversi/invitations": { + req: TODO; + res: TODO; + }; + "games/reversi/match": { + req: TODO; + res: TODO; + }; + "games/reversi/match/cancel": { + req: TODO; + res: TODO; + }; + "get-online-users-count": { + req: NoParams; + res: { + count: number; + }; + }; + "hashtags/list": { + req: TODO; + res: TODO; + }; + "hashtags/search": { + req: TODO; + res: TODO; + }; + "hashtags/show": { + req: TODO; + res: TODO; + }; + "hashtags/trend": { + req: TODO; + res: TODO; + }; + "hashtags/users": { + req: TODO; + res: TODO; + }; + i: { + req: NoParams; + res: User; + }; + "i/apps": { + req: TODO; + res: TODO; + }; + "i/authorized-apps": { + req: TODO; + res: TODO; + }; + "i/change-password": { + req: TODO; + res: TODO; + }; + "i/delete-account": { + req: { + password: string; + }; + res: null; + }; + "i/export-blocking": { + req: TODO; + res: TODO; + }; + "i/export-following": { + req: TODO; + res: TODO; + }; + "i/export-mute": { + req: TODO; + res: TODO; + }; + "i/export-notes": { + req: TODO; + res: TODO; + }; + "i/export-user-lists": { + req: TODO; + res: TODO; + }; + "i/favorites": { + req: { + limit?: number; + sinceId?: NoteFavorite["id"]; + untilId?: NoteFavorite["id"]; + }; + res: NoteFavorite[]; + }; + "i/gallery/likes": { + req: TODO; + res: TODO; + }; + "i/gallery/posts": { + req: TODO; + res: TODO; + }; + "i/get-word-muted-notes-count": { + req: TODO; + res: TODO; + }; + "i/import-following": { + req: TODO; + res: TODO; + }; + "i/import-user-lists": { + req: TODO; + res: TODO; + }; + "i/move": { + req: TODO; + res: TODO; + }; + "i/known-as": { + req: TODO; + res: TODO; + }; + "i/notifications": { + req: { + limit?: number; + sinceId?: Notification_2["id"]; + untilId?: Notification_2["id"]; + following?: boolean; + markAsRead?: boolean; + includeTypes?: Notification_2["type"][]; + excludeTypes?: Notification_2["type"][]; + }; + res: Notification_2[]; + }; + "i/page-likes": { + req: TODO; + res: TODO; + }; + "i/pages": { + req: TODO; + res: TODO; + }; + "i/pin": { + req: { + noteId: Note["id"]; + }; + res: MeDetailed; + }; + "i/read-all-messaging-messages": { + req: TODO; + res: TODO; + }; + "i/read-all-unread-notes": { + req: TODO; + res: TODO; + }; + "i/read-announcement": { + req: TODO; + res: TODO; + }; + "i/regenerate-token": { + req: { + password: string; + }; + res: null; + }; + "i/registry/get-all": { + req: { + scope?: string[]; + }; + res: Record; + }; + "i/registry/get-detail": { + req: { + key: string; + scope?: string[]; + }; + res: { + updatedAt: DateString; + value: any; + }; + }; + "i/registry/get": { + req: { + key: string; + scope?: string[]; + }; + res: any; + }; + "i/registry/keys-with-type": { + req: { + scope?: string[]; + }; + res: Record< + string, + "null" | "array" | "number" | "string" | "boolean" | "object" + >; + }; + "i/registry/keys": { + req: { + scope?: string[]; + }; + res: string[]; + }; + "i/registry/remove": { + req: { + key: string; + scope?: string[]; + }; + res: null; + }; + "i/registry/scopes": { + req: NoParams; + res: string[][]; + }; + "i/registry/set": { + req: { + key: string; + value: any; + scope?: string[]; + }; + res: null; + }; + "i/revoke-token": { + req: TODO; + res: TODO; + }; + "i/signin-history": { + req: { + limit?: number; + sinceId?: Signin["id"]; + untilId?: Signin["id"]; + }; + res: Signin[]; + }; + "i/unpin": { + req: { + noteId: Note["id"]; + }; + res: MeDetailed; + }; + "i/update-email": { + req: { + password: string; + email?: string | null; + }; + res: MeDetailed; + }; + "i/update": { + req: { + name?: string | null; + description?: string | null; + lang?: string | null; + location?: string | null; + birthday?: string | null; + avatarId?: DriveFile["id"] | null; + bannerId?: DriveFile["id"] | null; + fields?: { + name: string; + value: string; + }[]; + isLocked?: boolean; + isExplorable?: boolean; + hideOnlineStatus?: boolean; + carefulBot?: boolean; + autoAcceptFollowed?: boolean; + noCrawle?: boolean; + preventAiLearning?: boolean; + isBot?: boolean; + isCat?: boolean; + injectFeaturedNote?: boolean; + receiveAnnouncementEmail?: boolean; + alwaysMarkNsfw?: boolean; + mutedWords?: string[][]; + mutingNotificationTypes?: Notification_2["type"][]; + emailNotificationTypes?: string[]; + }; + res: MeDetailed; + }; + "i/user-group-invites": { + req: TODO; + res: TODO; + }; + "i/2fa/done": { + req: TODO; + res: TODO; + }; + "i/2fa/key-done": { + req: TODO; + res: TODO; + }; + "i/2fa/password-less": { + req: TODO; + res: TODO; + }; + "i/2fa/register-key": { + req: TODO; + res: TODO; + }; + "i/2fa/register": { + req: TODO; + res: TODO; + }; + "i/2fa/update-key": { + req: TODO; + res: TODO; + }; + "i/2fa/remove-key": { + req: TODO; + res: TODO; + }; + "i/2fa/unregister": { + req: TODO; + res: TODO; + }; + "messaging/history": { + req: { + limit?: number; + group?: boolean; + }; + res: MessagingMessage[]; + }; + "messaging/messages": { + req: { + userId?: User["id"]; + groupId?: UserGroup["id"]; + limit?: number; + sinceId?: MessagingMessage["id"]; + untilId?: MessagingMessage["id"]; + markAsRead?: boolean; + }; + res: MessagingMessage[]; + }; + "messaging/messages/create": { + req: { + userId?: User["id"]; + groupId?: UserGroup["id"]; + text?: string; + fileId?: DriveFile["id"]; + }; + res: MessagingMessage; + }; + "messaging/messages/delete": { + req: { + messageId: MessagingMessage["id"]; + }; + res: null; + }; + "messaging/messages/read": { + req: { + messageId: MessagingMessage["id"]; + }; + res: null; + }; + meta: { + req: { + detail?: boolean; + }; + res: { + $switch: { + $cases: [ + [ + { + detail: true; + }, + DetailedInstanceMetadata, + ], + [ + { + detail: false; + }, + LiteInstanceMetadata, + ], + [ + { + detail: boolean; + }, + LiteInstanceMetadata | DetailedInstanceMetadata, + ], + ]; + $default: LiteInstanceMetadata; + }; + }; + }; + "miauth/gen-token": { + req: TODO; + res: TODO; + }; + "mute/create": { + req: TODO; + res: TODO; + }; + "mute/delete": { + req: { + userId: User["id"]; + }; + res: null; + }; + "mute/list": { + req: TODO; + res: TODO; + }; + "renote-mute/create": { + req: TODO; + res: TODO; + }; + "renote-mute/delete": { + req: { + userId: User["id"]; + }; + res: null; + }; + "renote-mute/list": { + req: TODO; + res: TODO; + }; + "my/apps": { + req: TODO; + res: TODO; + }; + notes: { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/children": { + req: { + noteId: Note["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/clips": { + req: TODO; + res: TODO; + }; + "notes/conversation": { + req: TODO; + res: TODO; + }; + "notes/create": { + req: NoteSubmitReq; + res: { + createdNote: Note; + }; + }; + "notes/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/edit": { + req: NoteSubmitReq; + res: { + createdNote: Note; + }; + }; + "notes/favorites/create": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/favorites/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/featured": { + req: TODO; + res: Note[]; + }; + "notes/global-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/recommended-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/hybrid-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/local-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/mentions": { + req: { + following?: boolean; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/polls/recommendation": { + req: TODO; + res: TODO; + }; + "notes/polls/vote": { + req: { + noteId: Note["id"]; + choice: number; + }; + res: null; + }; + "notes/reactions": { + req: { + noteId: Note["id"]; + type?: string | null; + limit?: number; + }; + res: NoteReaction[]; + }; + "notes/reactions/create": { + req: { + noteId: Note["id"]; + reaction: string; + }; + res: null; + }; + "notes/reactions/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/renotes": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + noteId: Note["id"]; + }; + res: Note[]; + }; + "notes/replies": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + noteId: Note["id"]; + }; + res: Note[]; + }; + "notes/search-by-tag": { + req: TODO; + res: TODO; + }; + "notes/search": { + req: TODO; + res: TODO; + }; + "notes/show": { + req: { + noteId: Note["id"]; + }; + res: Note; + }; + "notes/state": { + req: TODO; + res: TODO; + }; + "notes/timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/unrenote": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/user-list-timeline": { + req: { + listId: UserList["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/watching/create": { + req: TODO; + res: TODO; + }; + "notes/watching/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notifications/create": { + req: { + body: string; + header?: string | null; + icon?: string | null; + }; + res: null; + }; + "notifications/mark-all-as-read": { + req: NoParams; + res: null; + }; + "notifications/read": { + req: { + notificationId: Notification_2["id"]; + }; + res: null; + }; + "page-push": { + req: { + pageId: Page["id"]; + event: string; + var?: any; + }; + res: null; + }; + "pages/create": { + req: TODO; + res: Page; + }; + "pages/delete": { + req: { + pageId: Page["id"]; + }; + res: null; + }; + "pages/featured": { + req: NoParams; + res: Page[]; + }; + "pages/like": { + req: { + pageId: Page["id"]; + }; + res: null; + }; + "pages/show": { + req: { + pageId?: Page["id"]; + name?: string; + username?: string; + }; + res: Page; + }; + "pages/unlike": { + req: { + pageId: Page["id"]; + }; + res: null; + }; + "pages/update": { + req: TODO; + res: null; + }; + ping: { + req: NoParams; + res: { + pong: number; + }; + }; + "pinned-users": { + req: TODO; + res: TODO; + }; + "promo/read": { + req: TODO; + res: TODO; + }; + "request-reset-password": { + req: { + username: string; + email: string; + }; + res: null; + }; + "reset-password": { + req: { + token: string; + password: string; + }; + res: null; + }; + "room/show": { + req: TODO; + res: TODO; + }; + "room/update": { + req: TODO; + res: TODO; + }; + stats: { + req: NoParams; + res: Stats; + }; + "server-info": { + req: NoParams; + res: ServerInfo; + }; + "latest-version": { + req: NoParams; + res: TODO; + }; + "sw/register": { + req: TODO; + res: TODO; + }; + "username/available": { + req: { + username: string; + }; + res: { + available: boolean; + }; + }; + users: { + req: { + limit?: number; + offset?: number; + sort?: UserSorting; + origin?: OriginType; + }; + res: User[]; + }; + "users/clips": { + req: TODO; + res: TODO; + }; + "users/followers": { + req: { + userId?: User["id"]; + username?: User["username"]; + host?: User["host"] | null; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFollowerPopulated[]; + }; + "users/following": { + req: { + userId?: User["id"]; + username?: User["username"]; + host?: User["host"] | null; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "users/gallery/posts": { + req: TODO; + res: TODO; + }; + "users/get-frequently-replied-users": { + req: TODO; + res: TODO; + }; + "users/groups/create": { + req: TODO; + res: TODO; + }; + "users/groups/delete": { + req: { + groupId: UserGroup["id"]; + }; + res: null; + }; + "users/groups/invitations/accept": { + req: TODO; + res: TODO; + }; + "users/groups/invitations/reject": { + req: TODO; + res: TODO; + }; + "users/groups/invite": { + req: TODO; + res: TODO; + }; + "users/groups/joined": { + req: TODO; + res: TODO; + }; + "users/groups/owned": { + req: TODO; + res: TODO; + }; + "users/groups/pull": { + req: TODO; + res: TODO; + }; + "users/groups/show": { + req: TODO; + res: TODO; + }; + "users/groups/transfer": { + req: TODO; + res: TODO; + }; + "users/groups/update": { + req: TODO; + res: TODO; + }; + "users/lists/create": { + req: { + name: string; + }; + res: UserList; + }; + "users/lists/delete": { + req: { + listId: UserList["id"]; + }; + res: null; + }; + "users/lists/list": { + req: NoParams; + res: UserList[]; + }; + "users/lists/pull": { + req: { + listId: UserList["id"]; + userId: User["id"]; + }; + res: null; + }; + "users/lists/push": { + req: { + listId: UserList["id"]; + userId: User["id"]; + }; + res: null; + }; + "users/lists/show": { + req: { + listId: UserList["id"]; + }; + res: UserList; + }; + "users/lists/update": { + req: { + listId: UserList["id"]; + name: string; + }; + res: UserList; + }; + "users/notes": { + req: { + userId: User["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "users/pages": { + req: TODO; + res: TODO; + }; + "users/recommendation": { + req: TODO; + res: TODO; + }; + "users/relation": { + req: TODO; + res: TODO; + }; + "users/report-abuse": { + req: TODO; + res: TODO; + }; + "users/search-by-username-and-host": { + req: TODO; + res: TODO; + }; + "users/search": { + req: TODO; + res: TODO; + }; + "users/show": { + req: + | ShowUserReq + | { + userIds: User["id"][]; + }; + res: { + $switch: { + $cases: [ + [ + { + userIds: User["id"][]; + }, + UserDetailed[], + ], + ]; + $default: UserDetailed; + }; + }; + }; + "users/stats": { + req: TODO; + res: TODO; + }; +}; + +declare namespace entities { + export { + ID, + DateString, + User, + UserLite, + UserDetailed, + UserGroup, + UserList, + MeDetailed, + DriveFile, + DriveFolder, + GalleryPost, + Note, + NoteReaction, + Notification_2 as Notification, + MessagingMessage, + CustomEmoji, + LiteInstanceMetadata, + DetailedInstanceMetadata, + InstanceMetadata, + ServerInfo, + Stats, + Page, + PageEvent, + Announcement, + Antenna, + App, + AuthSession, + Ad, + Clip, + NoteFavorite, + FollowRequest, + Channel, + Following, + FollowingFolloweePopulated, + FollowingFollowerPopulated, + Blocking, + Instance, + Signin, + UserSorting, + OriginType + } +} +export { entities } + +// @public (undocumented) +type FetchLike = ( + input: string, + init?: { + method?: string; + body?: string; + credentials?: RequestCredentials; + cache?: RequestCache; + }, +) => Promise<{ + status: number; + json(): Promise; +}>; + +// @public (undocumented) +export const ffVisibility: readonly ["public", "followers", "private"]; + +// @public (undocumented) +type Following = { + id: ID; + createdAt: DateString; + followerId: User["id"]; + followeeId: User["id"]; +}; + +// @public (undocumented) +type FollowingFolloweePopulated = Following & { + followee: UserDetailed; +}; + +// @public (undocumented) +type FollowingFollowerPopulated = Following & { + follower: UserDetailed; +}; + +// @public (undocumented) +type FollowRequest = { + id: ID; + follower: User; + followee: User; +}; + +// @public (undocumented) +type GalleryPost = TODO_2; + +// @public (undocumented) +type ID = string; + +// @public (undocumented) +type Instance = { + id: ID; + caughtAt: DateString; + host: string; + usersCount: number; + notesCount: number; + followingCount: number; + followersCount: number; + driveUsage: number; + driveFiles: number; + latestRequestSentAt: DateString | null; + latestStatus: number | null; + latestRequestReceivedAt: DateString | null; + lastCommunicatedAt: DateString; + isNotResponding: boolean; + isSuspended: boolean; + softwareName: string | null; + softwareVersion: string | null; + openRegistrations: boolean | null; + name: string | null; + description: string | null; + maintainerName: string | null; + maintainerEmail: string | null; + iconUrl: string | null; + faviconUrl: string | null; + themeColor: string | null; + infoUpdatedAt: DateString | null; +}; + +// @public (undocumented) +type InstanceMetadata = + | LiteInstanceMetadata + | DetailedInstanceMetadata; + +// @public (undocumented) +function isAPIError(reason: any): reason is APIError; + +// @public (undocumented) +type LiteInstanceMetadata = { + maintainerName: string | null; + maintainerEmail: string | null; + version: string; + name: string | null; + uri: string; + description: string | null; + tosUrl: string | null; + disableRegistration: boolean; + disableLocalTimeline: boolean; + disableRecommendedTimeline: boolean; + disableGlobalTimeline: boolean; + driveCapacityPerLocalUserMb: number; + driveCapacityPerRemoteUserMb: number; + enableHcaptcha: boolean; + hcaptchaSiteKey: string | null; + enableRecaptcha: boolean; + recaptchaSiteKey: string | null; + swPublickey: string | null; + maxNoteTextLength: number; + enableEmail: boolean; + enableGithubIntegration: boolean; + enableDiscordIntegration: boolean; + enableServiceWorker: boolean; + emojis: CustomEmoji[]; + ads: { + id: ID; + ratio: number; + place: string; + url: string; + imageUrl: string; + }[]; +}; + +// @public (undocumented) +type MeDetailed = UserDetailed & { + avatarId: DriveFile["id"]; + bannerId: DriveFile["id"]; + autoAcceptFollowed: boolean; + alwaysMarkNsfw: boolean; + carefulBot: boolean; + emailNotificationTypes: string[]; + hasPendingReceivedFollowRequest: boolean; + hasUnreadAnnouncement: boolean; + hasUnreadAntenna: boolean; + hasUnreadChannel: boolean; + hasUnreadMentions: boolean; + hasUnreadMessagingMessage: boolean; + hasUnreadNotification: boolean; + hasUnreadSpecifiedNotes: boolean; + hideOnlineStatus: boolean; + injectFeaturedNote: boolean; + integrations: Record; + isDeleted: boolean; + isExplorable: boolean; + mutedWords: string[][]; + mutingNotificationTypes: string[]; + noCrawle: boolean; + preventAiLearning: boolean; + receiveAnnouncementEmail: boolean; + usePasswordLessLogin: boolean; + [other: string]: any; +}; + +// @public (undocumented) +type MessagingMessage = { + id: ID; + createdAt: DateString; + file: DriveFile | null; + fileId: DriveFile["id"] | null; + isRead: boolean; + reads: User["id"][]; + text: string | null; + user: User; + userId: User["id"]; + recipient?: User | null; + recipientId: User["id"] | null; + group?: UserGroup | null; + groupId: UserGroup["id"] | null; +}; + +// @public (undocumented) +export const mutedNoteReasons: readonly [ + "word", + "manual", + "spam", + "other", +]; + +// @public (undocumented) +type Note = { + id: ID; + createdAt: DateString; + text: string | null; + cw: string | null; + user: User; + userId: User["id"]; + reply?: Note; + replyId: Note["id"]; + renote?: Note; + renoteId: Note["id"]; + files: DriveFile[]; + fileIds: DriveFile["id"][]; + visibility: "public" | "home" | "followers" | "specified"; + visibleUserIds?: User["id"][]; + localOnly?: boolean; + channel?: Channel["id"]; + myReaction?: string; + reactions: Record; + renoteCount: number; + repliesCount: number; + poll?: { + expiresAt: DateString | null; + multiple: boolean; + choices: { + isVoted: boolean; + text: string; + votes: number; + }[]; + }; + emojis: { + name: string; + url: string; + }[]; + uri?: string; + url?: string; + updatedAt?: DateString; + isHidden?: boolean; +}; + +// @public (undocumented) +type NoteFavorite = { + id: ID; + createdAt: DateString; + noteId: Note["id"]; + note: Note; +}; + +// @public (undocumented) +type NoteReaction = { + id: ID; + createdAt: DateString; + user: UserLite; + type: string; +}; + +// @public (undocumented) +export const noteVisibilities: readonly [ + "public", + "home", + "followers", + "specified", +]; + +// @public (undocumented) +type Notification_2 = { + id: ID; + createdAt: DateString; + isRead: boolean; +} & ( + | { + type: "reaction"; + reaction: string; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "reply"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "renote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "quote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "mention"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "pollVote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "follow"; + user: User; + userId: User["id"]; + } + | { + type: "followRequestAccepted"; + user: User; + userId: User["id"]; + } + | { + type: "receiveFollowRequest"; + user: User; + userId: User["id"]; + } + | { + type: "groupInvited"; + invitation: UserGroup; + user: User; + userId: User["id"]; + } + | { + type: "app"; + header?: string | null; + body: string; + icon?: string | null; + } +); + +// @public (undocumented) +export const notificationTypes: readonly [ + "follow", + "mention", + "reply", + "renote", + "quote", + "reaction", + "pollVote", + "pollEnded", + "receiveFollowRequest", + "followRequestAccepted", + "groupInvited", + "app", +]; + +// @public (undocumented) +type OriginType = "combined" | "local" | "remote"; + +// @public (undocumented) +type Page = { + id: ID; + createdAt: DateString; + updatedAt: DateString; + userId: User["id"]; + user: User; + content: Record[]; + variables: Record[]; + title: string; + name: string; + summary: string | null; + hideTitleWhenPinned: boolean; + alignCenter: boolean; + font: string; + script: string; + eyeCatchingImageId: DriveFile["id"] | null; + eyeCatchingImage: DriveFile | null; + attachedFiles: any; + likedCount: number; + isLiked?: boolean; +}; + +// @public (undocumented) +type PageEvent = { + pageId: Page["id"]; + event: string; + var: any; + userId: User["id"]; + user: User; +}; + +// @public (undocumented) +export const permissions: string[]; + +// @public (undocumented) +type ServerInfo = { + machine: string; + cpu: { + model: string; + cores: number; + }; + mem: { + total: number; + }; + fs: { + total: number; + used: number; + }; +}; + +// @public (undocumented) +type Signin = { + id: ID; + createdAt: DateString; + ip: string; + headers: Record; + success: boolean; +}; + +// @public (undocumented) +type Stats = { + notesCount: number; + originalNotesCount: number; + usersCount: number; + originalUsersCount: number; + instances: number; + driveUsageLocal: number; + driveUsageRemote: number; +}; + +// Warning: (ae-forgotten-export) The symbol "StreamEvents" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class Stream extends EventEmitter { + constructor( + origin: string, + user: { + token: string; + } | null, + options?: { + WebSocket?: any; + }, + ); + // (undocumented) + close(): void; + // Warning: (ae-forgotten-export) The symbol "NonSharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + disconnectToChannel(connection: NonSharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "SharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnection(connection: SharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "Pool" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnectionPool(pool: Pool): void; + // (undocumented) + send(typeOrPayload: any, payload?: any): void; + // (undocumented) + state: "initializing" | "reconnecting" | "connected"; + // (undocumented) + useChannel( + channel: C, + params?: Channels[C]["params"], + name?: string, + ): ChannelConnection; + } + +// @public (undocumented) +type User = UserLite | UserDetailed; + +// @public (undocumented) +type UserDetailed = UserLite & { + bannerBlurhash: string | null; + bannerColor: string | null; + bannerUrl: string | null; + birthday: string | null; + createdAt: DateString; + description: string | null; + ffVisibility: "public" | "followers" | "private"; + fields: { + name: string; + value: string; + }[]; + followersCount: number; + followingCount: number; + hasPendingFollowRequestFromYou: boolean; + hasPendingFollowRequestToYou: boolean; + isAdmin: boolean; + isBlocked: boolean; + isBlocking: boolean; + isBot: boolean; + isCat: boolean; + isFollowed: boolean; + isFollowing: boolean; + isLocked: boolean; + isModerator: boolean; + isMuted: boolean; + isRenoteMuted: boolean; + isSilenced: boolean; + isSuspended: boolean; + lang: string | null; + lastFetchedAt?: DateString; + location: string | null; + notesCount: number; + pinnedNoteIds: ID[]; + pinnedNotes: Note[]; + pinnedPage: Page | null; + pinnedPageId: string | null; + publicReactions: boolean; + securityKeys: boolean; + twoFactorEnabled: boolean; + updatedAt: DateString | null; + uri: string | null; + url: string | null; +}; + +// @public (undocumented) +type UserGroup = TODO_2; + +// @public (undocumented) +type UserList = { + id: ID; + createdAt: DateString; + name: string; + userIds: User["id"][]; +}; + +// @public (undocumented) +type UserLite = { + id: ID; + username: string; + host: string | null; + name: string; + onlineStatus: "online" | "active" | "offline" | "unknown"; + avatarUrl: string; + avatarBlurhash: string; + alsoKnownAs: string[]; + movedToUri: any; + emojis: { + name: string; + url: string; + }[]; + instance?: { + name: Instance["name"]; + softwareName: Instance["softwareName"]; + softwareVersion: Instance["softwareVersion"]; + iconUrl: Instance["iconUrl"]; + faviconUrl: Instance["faviconUrl"]; + themeColor: Instance["themeColor"]; + }; +}; + +// @public (undocumented) +type UserSorting = + | "+follower" + | "-follower" + | "+createdAt" + | "-createdAt" + | "+updatedAt" + | "-updatedAt"; + +// Warnings were encountered during analysis: +// +// src/api.types.ts:80:37 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// src/api.types.ts:83:28 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts +// src/api.types.ts:853:5 - (ae-forgotten-export) The symbol "NoteSubmitReq" needs to be exported by the entry point index.d.ts +// src/api.types.ts:1094:3 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts +// src/streaming.types.ts:56:18 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.acct.md b/packages/iceshrimp-js/markdown/iceshrimp-js.acct.md index 0a98e35c0..e0c7ca411 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.acct.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.acct.md @@ -1,14 +1,14 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Acct](./iceshrimp-js.acct.md) - -## Acct type - -**Signature:** - -```typescript -export declare type Acct = { - username: string; - host: string | null; -}; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Acct](./iceshrimp-js.acct.md) + +## Acct type + +**Signature:** + +```typescript +export declare type Acct = { + username: string; + host: string | null; +}; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient._constructor_.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient._constructor_.md index 99fc423be..85916a07b 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient._constructor_.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient._constructor_.md @@ -1,24 +1,24 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [(constructor)](./iceshrimp-js.api.apiclient._constructor_.md) - -## api.APIClient.(constructor) - -Constructs a new instance of the `APIClient` class - -**Signature:** - -```typescript -constructor(opts: { - origin: APIClient["origin"]; - credential?: APIClient["credential"]; - fetch?: APIClient["fetch"] | null | undefined; - }); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| opts | { origin: [APIClient](./iceshrimp-js.api.apiclient.md)\["origin"\]; credential?: [APIClient](./iceshrimp-js.api.apiclient.md)\["credential"\]; fetch?: [APIClient](./iceshrimp-js.api.apiclient.md)\["fetch"\] \| null \| undefined; } | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [(constructor)](./iceshrimp-js.api.apiclient._constructor_.md) + +## api.APIClient.(constructor) + +Constructs a new instance of the `APIClient` class + +**Signature:** + +```typescript +constructor(opts: { + origin: APIClient["origin"]; + credential?: APIClient["credential"]; + fetch?: APIClient["fetch"] | null | undefined; + }); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| opts | { origin: [APIClient](./iceshrimp-js.api.apiclient.md)\["origin"\]; credential?: [APIClient](./iceshrimp-js.api.apiclient.md)\["credential"\]; fetch?: [APIClient](./iceshrimp-js.api.apiclient.md)\["fetch"\] \| null \| undefined; } | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.credential.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.credential.md index 64ccb3a82..e4372d450 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.credential.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.credential.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [credential](./iceshrimp-js.api.apiclient.credential.md) - -## api.APIClient.credential property - -**Signature:** - -```typescript -credential: string | null | undefined; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [credential](./iceshrimp-js.api.apiclient.credential.md) + +## api.APIClient.credential property + +**Signature:** + +```typescript +credential: string | null | undefined; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.fetch.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.fetch.md index bb3aa39e0..68e51828e 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.fetch.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.fetch.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [fetch](./iceshrimp-js.api.apiclient.fetch.md) - -## api.APIClient.fetch property - -**Signature:** - -```typescript -fetch: FetchLike; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [fetch](./iceshrimp-js.api.apiclient.fetch.md) + +## api.APIClient.fetch property + +**Signature:** + +```typescript +fetch: FetchLike; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.md index 8bb1e6c2e..361903197 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.md @@ -1,32 +1,32 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) - -## api.APIClient class - -**Signature:** - -```typescript -export declare class APIClient -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(opts)](./iceshrimp-js.api.apiclient._constructor_.md) | | Constructs a new instance of the APIClient class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [credential](./iceshrimp-js.api.apiclient.credential.md) | | string \| null \| undefined | | -| [fetch](./iceshrimp-js.api.apiclient.fetch.md) | | [FetchLike](./iceshrimp-js.api.fetchlike.md) | | -| [origin](./iceshrimp-js.api.apiclient.origin.md) | | string | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [request(endpoint, params, credential)](./iceshrimp-js.api.apiclient.request.md) | | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) + +## api.APIClient class + +**Signature:** + +```typescript +export declare class APIClient +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(opts)](./iceshrimp-js.api.apiclient._constructor_.md) | | Constructs a new instance of the APIClient class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [credential](./iceshrimp-js.api.apiclient.credential.md) | | string \| null \| undefined | | +| [fetch](./iceshrimp-js.api.apiclient.fetch.md) | | [FetchLike](./iceshrimp-js.api.fetchlike.md) | | +| [origin](./iceshrimp-js.api.apiclient.origin.md) | | string | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [request(endpoint, params, credential)](./iceshrimp-js.api.apiclient.request.md) | | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.origin.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.origin.md index 486c823e5..768ae57d8 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.origin.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.origin.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [origin](./iceshrimp-js.api.apiclient.origin.md) - -## api.APIClient.origin property - -**Signature:** - -```typescript -origin: string; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [origin](./iceshrimp-js.api.apiclient.origin.md) + +## api.APIClient.origin property + +**Signature:** + +```typescript +origin: string; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.request.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.request.md index 8458c051e..66131909a 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.request.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apiclient.request.md @@ -1,57 +1,57 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [request](./iceshrimp-js.api.apiclient.request.md) - -## api.APIClient.request() method - -**Signature:** - -```typescript -request( - endpoint: E, - params?: P, - credential?: string | null | undefined, - ): Promise< - Endpoints[E]["res"] extends { - $switch: { - $cases: [any, any][]; - $default: any; - }; - } - ? IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : IsCaseMatched extends true - ? GetCaseResult - : Endpoints[E]["res"]["$switch"]["$default"] - : Endpoints[E]["res"] - >; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| endpoint | E | | -| params | P | _(Optional)_ | -| credential | string \| null \| undefined | _(Optional)_ | - -**Returns:** - -Promise< [Endpoints](./iceshrimp-js.endpoints.md)\[E\]\["res"\] extends { $switch: { $cases: \[any, any\]\[\]; $default: any; }; } ? IsCaseMatched<E, P, 0> extends true ? GetCaseResult<E, P, 0> : IsCaseMatched<E, P, 1> extends true ? GetCaseResult<E, P, 1> : IsCaseMatched<E, P, 2> extends true ? GetCaseResult<E, P, 2> : IsCaseMatched<E, P, 3> extends true ? GetCaseResult<E, P, 3> : IsCaseMatched<E, P, 4> extends true ? GetCaseResult<E, P, 4> : IsCaseMatched<E, P, 5> extends true ? GetCaseResult<E, P, 5> : IsCaseMatched<E, P, 6> extends true ? GetCaseResult<E, P, 6> : IsCaseMatched<E, P, 7> extends true ? GetCaseResult<E, P, 7> : IsCaseMatched<E, P, 8> extends true ? GetCaseResult<E, P, 8> : IsCaseMatched<E, P, 9> extends true ? GetCaseResult<E, P, 9> : [Endpoints](./iceshrimp-js.endpoints.md)\[E\]\["res"\]\["$switch"\]\["$default"\] : [Endpoints](./iceshrimp-js.endpoints.md)\[E\]\["res"\] > - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIClient](./iceshrimp-js.api.apiclient.md) > [request](./iceshrimp-js.api.apiclient.request.md) + +## api.APIClient.request() method + +**Signature:** + +```typescript +request( + endpoint: E, + params?: P, + credential?: string | null | undefined, + ): Promise< + Endpoints[E]["res"] extends { + $switch: { + $cases: [any, any][]; + $default: any; + }; + } + ? IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : Endpoints[E]["res"]["$switch"]["$default"] + : Endpoints[E]["res"] + >; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| endpoint | E | | +| params | P | _(Optional)_ | +| credential | string \| null \| undefined | _(Optional)_ | + +**Returns:** + +Promise< [Endpoints](./iceshrimp-js.endpoints.md)\[E\]\["res"\] extends { $switch: { $cases: \[any, any\]\[\]; $default: any; }; } ? IsCaseMatched<E, P, 0> extends true ? GetCaseResult<E, P, 0> : IsCaseMatched<E, P, 1> extends true ? GetCaseResult<E, P, 1> : IsCaseMatched<E, P, 2> extends true ? GetCaseResult<E, P, 2> : IsCaseMatched<E, P, 3> extends true ? GetCaseResult<E, P, 3> : IsCaseMatched<E, P, 4> extends true ? GetCaseResult<E, P, 4> : IsCaseMatched<E, P, 5> extends true ? GetCaseResult<E, P, 5> : IsCaseMatched<E, P, 6> extends true ? GetCaseResult<E, P, 6> : IsCaseMatched<E, P, 7> extends true ? GetCaseResult<E, P, 7> : IsCaseMatched<E, P, 8> extends true ? GetCaseResult<E, P, 8> : IsCaseMatched<E, P, 9> extends true ? GetCaseResult<E, P, 9> : [Endpoints](./iceshrimp-js.endpoints.md)\[E\]\["res"\]\["$switch"\]\["$default"\] : [Endpoints](./iceshrimp-js.endpoints.md)\[E\]\["res"\] > + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apierror.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apierror.md index 8035ec52b..2b286ad82 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.apierror.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.apierror.md @@ -1,17 +1,17 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIError](./iceshrimp-js.api.apierror.md) - -## api.APIError type - -**Signature:** - -```typescript -export declare type APIError = { - id: string; - code: string; - message: string; - kind: "client" | "server"; - info: Record; -}; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [APIError](./iceshrimp-js.api.apierror.md) + +## api.APIError type + +**Signature:** + +```typescript +export declare type APIError = { + id: string; + code: string; + message: string; + kind: "client" | "server"; + info: Record; +}; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.fetchlike.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.fetchlike.md index 2dff9b5a0..d2842e39e 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.fetchlike.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.fetchlike.md @@ -1,22 +1,22 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [FetchLike](./iceshrimp-js.api.fetchlike.md) - -## api.FetchLike type - -**Signature:** - -```typescript -export declare type FetchLike = ( - input: string, - init?: { - method?: string; - body?: string; - credentials?: RequestCredentials; - cache?: RequestCache; - }, -) => Promise<{ - status: number; - json(): Promise; -}>; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [FetchLike](./iceshrimp-js.api.fetchlike.md) + +## api.FetchLike type + +**Signature:** + +```typescript +export declare type FetchLike = ( + input: string, + init?: { + method?: string; + body?: string; + credentials?: RequestCredentials; + cache?: RequestCache; + }, +) => Promise<{ + status: number; + json(): Promise; +}>; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.isapierror.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.isapierror.md index c935dc602..2a7a1fd59 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.isapierror.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.isapierror.md @@ -1,22 +1,22 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [isAPIError](./iceshrimp-js.api.isapierror.md) - -## api.isAPIError() function - -**Signature:** - -```typescript -export declare function isAPIError(reason: any): reason is APIError; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| reason | any | | - -**Returns:** - -reason is [APIError](./iceshrimp-js.api.apierror.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) > [isAPIError](./iceshrimp-js.api.isapierror.md) + +## api.isAPIError() function + +**Signature:** + +```typescript +export declare function isAPIError(reason: any): reason is APIError; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| reason | any | | + +**Returns:** + +reason is [APIError](./iceshrimp-js.api.apierror.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.api.md b/packages/iceshrimp-js/markdown/iceshrimp-js.api.md index 9fa839c4d..332067bc6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.api.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.api.md @@ -1,25 +1,25 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) - -## api namespace - -## Classes - -| Class | Description | -| --- | --- | -| [APIClient](./iceshrimp-js.api.apiclient.md) | | - -## Functions - -| Function | Description | -| --- | --- | -| [isAPIError(reason)](./iceshrimp-js.api.isapierror.md) | | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [APIError](./iceshrimp-js.api.apierror.md) | | -| [FetchLike](./iceshrimp-js.api.fetchlike.md) | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [api](./iceshrimp-js.api.md) + +## api namespace + +## Classes + +| Class | Description | +| --- | --- | +| [APIClient](./iceshrimp-js.api.apiclient.md) | | + +## Functions + +| Function | Description | +| --- | --- | +| [isAPIError(reason)](./iceshrimp-js.api.isapierror.md) | | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [APIError](./iceshrimp-js.api.apierror.md) | | +| [FetchLike](./iceshrimp-js.api.fetchlike.md) | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection._constructor_.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection._constructor_.md index 17f75ce83..16a6a20eb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection._constructor_.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection._constructor_.md @@ -1,22 +1,22 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [(constructor)](./iceshrimp-js.channelconnection._constructor_.md) - -## ChannelConnection.(constructor) - -Constructs a new instance of the `Connection` class - -**Signature:** - -```typescript -constructor(stream: Stream, channel: string, name?: string); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| stream | [Stream](./iceshrimp-js.stream.md) | | -| channel | string | | -| name | string | _(Optional)_ | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [(constructor)](./iceshrimp-js.channelconnection._constructor_.md) + +## ChannelConnection.(constructor) + +Constructs a new instance of the `Connection` class + +**Signature:** + +```typescript +constructor(stream: Stream, channel: string, name?: string); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stream | [Stream](./iceshrimp-js.stream.md) | | +| channel | string | | +| name | string | _(Optional)_ | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.channel.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.channel.md index 644095652..7923f8f4d 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.channel.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.channel.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [channel](./iceshrimp-js.channelconnection.channel.md) - -## ChannelConnection.channel property - -**Signature:** - -```typescript -channel: string; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [channel](./iceshrimp-js.channelconnection.channel.md) + +## ChannelConnection.channel property + +**Signature:** + +```typescript +channel: string; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.dispose.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.dispose.md index c69157d5f..964e547fb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.dispose.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.dispose.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [dispose](./iceshrimp-js.channelconnection.dispose.md) - -## ChannelConnection.dispose() method - -**Signature:** - -```typescript -abstract dispose(): void; -``` -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [dispose](./iceshrimp-js.channelconnection.dispose.md) + +## ChannelConnection.dispose() method + +**Signature:** + +```typescript +abstract dispose(): void; +``` +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.id.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.id.md index 9946f0f9c..414a2a096 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.id.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.id.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [id](./iceshrimp-js.channelconnection.id.md) - -## ChannelConnection.id property - -**Signature:** - -```typescript -abstract id: string; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [id](./iceshrimp-js.channelconnection.id.md) + +## ChannelConnection.id property + +**Signature:** + +```typescript +abstract id: string; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.incount.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.incount.md index c8d4863ca..d20774deb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.incount.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.incount.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [inCount](./iceshrimp-js.channelconnection.incount.md) - -## ChannelConnection.inCount property - -**Signature:** - -```typescript -inCount: number; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [inCount](./iceshrimp-js.channelconnection.incount.md) + +## ChannelConnection.inCount property + +**Signature:** + +```typescript +inCount: number; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.md index a5e154797..d2d5e1bfd 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.md @@ -1,39 +1,39 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) - -## ChannelConnection class - -**Signature:** - -```typescript -export declare abstract class Connection< - Channel extends AnyOf = any, -> extends EventEmitter -``` -**Extends:** EventEmitter<Channel\["events"\]> - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(stream, channel, name)](./iceshrimp-js.channelconnection._constructor_.md) | | Constructs a new instance of the Connection class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [channel](./iceshrimp-js.channelconnection.channel.md) | | string | | -| [id](./iceshrimp-js.channelconnection.id.md) | abstract | string | | -| [inCount](./iceshrimp-js.channelconnection.incount.md) | | number | | -| [name?](./iceshrimp-js.channelconnection.name.md) | | string | _(Optional)_ | -| [outCount](./iceshrimp-js.channelconnection.outcount.md) | | number | | -| [stream](./iceshrimp-js.channelconnection.stream.md) | protected | [Stream](./iceshrimp-js.stream.md) | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [dispose()](./iceshrimp-js.channelconnection.dispose.md) | abstract | | -| [send(type, body)](./iceshrimp-js.channelconnection.send.md) | | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) + +## ChannelConnection class + +**Signature:** + +```typescript +export declare abstract class Connection< + Channel extends AnyOf = any, +> extends EventEmitter +``` +**Extends:** EventEmitter<Channel\["events"\]> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(stream, channel, name)](./iceshrimp-js.channelconnection._constructor_.md) | | Constructs a new instance of the Connection class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [channel](./iceshrimp-js.channelconnection.channel.md) | | string | | +| [id](./iceshrimp-js.channelconnection.id.md) | abstract | string | | +| [inCount](./iceshrimp-js.channelconnection.incount.md) | | number | | +| [name?](./iceshrimp-js.channelconnection.name.md) | | string | _(Optional)_ | +| [outCount](./iceshrimp-js.channelconnection.outcount.md) | | number | | +| [stream](./iceshrimp-js.channelconnection.stream.md) | protected | [Stream](./iceshrimp-js.stream.md) | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [dispose()](./iceshrimp-js.channelconnection.dispose.md) | abstract | | +| [send(type, body)](./iceshrimp-js.channelconnection.send.md) | | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.name.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.name.md index c93701fb6..fc9fbce8c 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.name.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.name.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [name](./iceshrimp-js.channelconnection.name.md) - -## ChannelConnection.name property - -**Signature:** - -```typescript -name?: string; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [name](./iceshrimp-js.channelconnection.name.md) + +## ChannelConnection.name property + +**Signature:** + +```typescript +name?: string; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.outcount.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.outcount.md index bd4294f02..269e710cf 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.outcount.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.outcount.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [outCount](./iceshrimp-js.channelconnection.outcount.md) - -## ChannelConnection.outCount property - -**Signature:** - -```typescript -outCount: number; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [outCount](./iceshrimp-js.channelconnection.outcount.md) + +## ChannelConnection.outCount property + +**Signature:** + +```typescript +outCount: number; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.send.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.send.md index 177920167..272f76f92 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.send.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.send.md @@ -1,26 +1,26 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [send](./iceshrimp-js.channelconnection.send.md) - -## ChannelConnection.send() method - -**Signature:** - -```typescript -send( - type: T, - body: Channel["receives"][T], - ): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| type | T | | -| body | Channel\["receives"\]\[T\] | | - -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [send](./iceshrimp-js.channelconnection.send.md) + +## ChannelConnection.send() method + +**Signature:** + +```typescript +send( + type: T, + body: Channel["receives"][T], + ): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| type | T | | +| body | Channel\["receives"\]\[T\] | | + +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.stream.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.stream.md index 25e95acc3..02a9b63fa 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.stream.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channelconnection.stream.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [stream](./iceshrimp-js.channelconnection.stream.md) - -## ChannelConnection.stream property - -**Signature:** - -```typescript -protected stream: Stream; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ChannelConnection](./iceshrimp-js.channelconnection.md) > [stream](./iceshrimp-js.channelconnection.stream.md) + +## ChannelConnection.stream property + +**Signature:** + +```typescript +protected stream: Stream; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.channels.md b/packages/iceshrimp-js/markdown/iceshrimp-js.channels.md index 86afc5c30..e40a3bee6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.channels.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.channels.md @@ -1,143 +1,143 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Channels](./iceshrimp-js.channels.md) - -## Channels type - -**Signature:** - -```typescript -export declare type Channels = { - main: { - params: null; - events: { - notification: (payload: Notification) => void; - mention: (payload: Note) => void; - reply: (payload: Note) => void; - renote: (payload: Note) => void; - follow: (payload: User) => void; - followed: (payload: User) => void; - unfollow: (payload: User) => void; - meUpdated: (payload: MeDetailed) => void; - pageEvent: (payload: PageEvent) => void; - urlUploadFinished: (payload: { - marker: string; - file: DriveFile; - }) => void; - readAllNotifications: () => void; - unreadNotification: (payload: Notification) => void; - unreadMention: (payload: Note["id"]) => void; - readAllUnreadMentions: () => void; - unreadSpecifiedNote: (payload: Note["id"]) => void; - readAllUnreadSpecifiedNotes: () => void; - readAllMessagingMessages: () => void; - messagingMessage: (payload: MessagingMessage) => void; - unreadMessagingMessage: (payload: MessagingMessage) => void; - readAllAntennas: () => void; - unreadAntenna: (payload: Antenna) => void; - readAllAnnouncements: () => void; - readAllChannels: () => void; - unreadChannel: (payload: Note["id"]) => void; - myTokenRegenerated: () => void; - reversiNoInvites: () => void; - reversiInvited: (payload: FIXME) => void; - signin: (payload: FIXME) => void; - registryUpdated: (payload: { - scope?: string[]; - key: string; - value: any | null; - }) => void; - driveFileCreated: (payload: DriveFile) => void; - readAntenna: (payload: Antenna) => void; - }; - receives: null; - }; - homeTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - localTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - hybridTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - recommendedTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - globalTimeline: { - params: null; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - antenna: { - params: { - antennaId: Antenna["id"]; - }; - events: { - note: (payload: Note) => void; - }; - receives: null; - }; - messaging: { - params: { - otherparty?: User["id"] | null; - group?: UserGroup["id"] | null; - }; - events: { - message: (payload: MessagingMessage) => void; - deleted: (payload: MessagingMessage["id"]) => void; - read: (payload: MessagingMessage["id"][]) => void; - typers: (payload: User[]) => void; - }; - receives: { - read: { - id: MessagingMessage["id"]; - }; - }; - }; - serverStats: { - params: null; - events: { - stats: (payload: FIXME) => void; - }; - receives: { - requestLog: { - id: string | number; - length: number; - }; - }; - }; - queueStats: { - params: null; - events: { - stats: (payload: FIXME) => void; - }; - receives: { - requestLog: { - id: string | number; - length: number; - }; - }; - }; -}; -``` -**References:** [Note](./iceshrimp-js.entities.note.md), [User](./iceshrimp-js.entities.user.md), [MeDetailed](./iceshrimp-js.entities.medetailed.md), [PageEvent](./iceshrimp-js.entities.pageevent.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md), [Antenna](./iceshrimp-js.entities.antenna.md), [UserGroup](./iceshrimp-js.entities.usergroup.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Channels](./iceshrimp-js.channels.md) + +## Channels type + +**Signature:** + +```typescript +export declare type Channels = { + main: { + params: null; + events: { + notification: (payload: Notification) => void; + mention: (payload: Note) => void; + reply: (payload: Note) => void; + renote: (payload: Note) => void; + follow: (payload: User) => void; + followed: (payload: User) => void; + unfollow: (payload: User) => void; + meUpdated: (payload: MeDetailed) => void; + pageEvent: (payload: PageEvent) => void; + urlUploadFinished: (payload: { + marker: string; + file: DriveFile; + }) => void; + readAllNotifications: () => void; + unreadNotification: (payload: Notification) => void; + unreadMention: (payload: Note["id"]) => void; + readAllUnreadMentions: () => void; + unreadSpecifiedNote: (payload: Note["id"]) => void; + readAllUnreadSpecifiedNotes: () => void; + readAllMessagingMessages: () => void; + messagingMessage: (payload: MessagingMessage) => void; + unreadMessagingMessage: (payload: MessagingMessage) => void; + readAllAntennas: () => void; + unreadAntenna: (payload: Antenna) => void; + readAllAnnouncements: () => void; + readAllChannels: () => void; + unreadChannel: (payload: Note["id"]) => void; + myTokenRegenerated: () => void; + reversiNoInvites: () => void; + reversiInvited: (payload: FIXME) => void; + signin: (payload: FIXME) => void; + registryUpdated: (payload: { + scope?: string[]; + key: string; + value: any | null; + }) => void; + driveFileCreated: (payload: DriveFile) => void; + readAntenna: (payload: Antenna) => void; + }; + receives: null; + }; + homeTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + localTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + hybridTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + recommendedTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + globalTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + antenna: { + params: { + antennaId: Antenna["id"]; + }; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + messaging: { + params: { + otherparty?: User["id"] | null; + group?: UserGroup["id"] | null; + }; + events: { + message: (payload: MessagingMessage) => void; + deleted: (payload: MessagingMessage["id"]) => void; + read: (payload: MessagingMessage["id"][]) => void; + typers: (payload: User[]) => void; + }; + receives: { + read: { + id: MessagingMessage["id"]; + }; + }; + }; + serverStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; + queueStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; +}; +``` +**References:** [Note](./iceshrimp-js.entities.note.md), [User](./iceshrimp-js.entities.user.md), [MeDetailed](./iceshrimp-js.entities.medetailed.md), [PageEvent](./iceshrimp-js.entities.pageevent.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md), [Antenna](./iceshrimp-js.entities.antenna.md), [UserGroup](./iceshrimp-js.entities.usergroup.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.endpoints.md b/packages/iceshrimp-js/markdown/iceshrimp-js.endpoints.md index e705e132d..8f841541c 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.endpoints.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.endpoints.md @@ -1,1911 +1,1911 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Endpoints](./iceshrimp-js.endpoints.md) - -## Endpoints type - -**Signature:** - -```typescript -export declare type Endpoints = { - "admin/abuse-user-reports": { - req: TODO; - res: TODO; - }; - "admin/delete-all-files-of-a-user": { - req: { - userId: User["id"]; - }; - res: null; - }; - "admin/delete-logs": { - req: NoParams; - res: null; - }; - "admin/get-index-stats": { - req: TODO; - res: TODO; - }; - "admin/get-table-stats": { - req: TODO; - res: TODO; - }; - "admin/invite": { - req: TODO; - res: TODO; - }; - "admin/logs": { - req: TODO; - res: TODO; - }; - "admin/meta": { - req: TODO; - res: TODO; - }; - "admin/reset-password": { - req: TODO; - res: TODO; - }; - "admin/resolve-abuse-user-report": { - req: TODO; - res: TODO; - }; - "admin/resync-chart": { - req: TODO; - res: TODO; - }; - "admin/send-email": { - req: TODO; - res: TODO; - }; - "admin/server-info": { - req: TODO; - res: TODO; - }; - "admin/show-moderation-logs": { - req: TODO; - res: TODO; - }; - "admin/show-user": { - req: TODO; - res: TODO; - }; - "admin/show-users": { - req: TODO; - res: TODO; - }; - "admin/silence-user": { - req: TODO; - res: TODO; - }; - "admin/suspend-user": { - req: TODO; - res: TODO; - }; - "admin/unsilence-user": { - req: TODO; - res: TODO; - }; - "admin/unsuspend-user": { - req: TODO; - res: TODO; - }; - "admin/update-meta": { - req: TODO; - res: TODO; - }; - "admin/vacuum": { - req: TODO; - res: TODO; - }; - "admin/accounts/create": { - req: TODO; - res: TODO; - }; - "admin/ad/create": { - req: TODO; - res: TODO; - }; - "admin/ad/delete": { - req: { - id: Ad["id"]; - }; - res: null; - }; - "admin/ad/list": { - req: TODO; - res: TODO; - }; - "admin/ad/update": { - req: TODO; - res: TODO; - }; - "admin/announcements/create": { - req: TODO; - res: TODO; - }; - "admin/announcements/delete": { - req: { - id: Announcement["id"]; - }; - res: null; - }; - "admin/announcements/list": { - req: TODO; - res: TODO; - }; - "admin/announcements/update": { - req: TODO; - res: TODO; - }; - "admin/drive/clean-remote-files": { - req: TODO; - res: TODO; - }; - "admin/drive/cleanup": { - req: TODO; - res: TODO; - }; - "admin/drive/files": { - req: TODO; - res: TODO; - }; - "admin/drive/show-file": { - req: TODO; - res: TODO; - }; - "admin/emoji/add": { - req: TODO; - res: TODO; - }; - "admin/emoji/copy": { - req: TODO; - res: TODO; - }; - "admin/emoji/list-remote": { - req: TODO; - res: TODO; - }; - "admin/emoji/list": { - req: TODO; - res: TODO; - }; - "admin/emoji/remove": { - req: TODO; - res: TODO; - }; - "admin/emoji/update": { - req: TODO; - res: TODO; - }; - "admin/federation/delete-all-files": { - req: { - host: string; - }; - res: null; - }; - "admin/federation/refresh-remote-instance-metadata": { - req: TODO; - res: TODO; - }; - "admin/federation/remove-all-following": { - req: TODO; - res: TODO; - }; - "admin/federation/update-instance": { - req: TODO; - res: TODO; - }; - "admin/moderators/add": { - req: TODO; - res: TODO; - }; - "admin/moderators/remove": { - req: TODO; - res: TODO; - }; - "admin/promo/create": { - req: TODO; - res: TODO; - }; - "admin/queue/clear": { - req: TODO; - res: TODO; - }; - "admin/queue/deliver-delayed": { - req: TODO; - res: TODO; - }; - "admin/queue/inbox-delayed": { - req: TODO; - res: TODO; - }; - "admin/queue/jobs": { - req: TODO; - res: TODO; - }; - "admin/queue/stats": { - req: TODO; - res: TODO; - }; - "admin/relays/add": { - req: TODO; - res: TODO; - }; - "admin/relays/list": { - req: TODO; - res: TODO; - }; - "admin/relays/remove": { - req: TODO; - res: TODO; - }; - announcements: { - req: { - limit?: number; - withUnreads?: boolean; - sinceId?: Announcement["id"]; - untilId?: Announcement["id"]; - }; - res: Announcement[]; - }; - "antennas/create": { - req: TODO; - res: Antenna; - }; - "antennas/delete": { - req: { - antennaId: Antenna["id"]; - }; - res: null; - }; - "antennas/list": { - req: NoParams; - res: Antenna[]; - }; - "antennas/notes": { - req: { - antennaId: Antenna["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "antennas/show": { - req: { - antennaId: Antenna["id"]; - }; - res: Antenna; - }; - "antennas/update": { - req: TODO; - res: Antenna; - }; - "antennas/mark-read": { - req: TODO; - res: Antenna; - }; - "ap/get": { - req: { - uri: string; - }; - res: Record; - }; - "ap/show": { - req: { - uri: string; - }; - res: - | { - type: "Note"; - object: Note; - } - | { - type: "User"; - object: UserDetailed; - }; - }; - "app/create": { - req: TODO; - res: App; - }; - "app/show": { - req: { - appId: App["id"]; - }; - res: App; - }; - "auth/accept": { - req: { - token: string; - }; - res: null; - }; - "auth/session/generate": { - req: { - appSecret: string; - }; - res: { - token: string; - url: string; - }; - }; - "auth/session/show": { - req: { - token: string; - }; - res: AuthSession; - }; - "auth/session/userkey": { - req: { - appSecret: string; - token: string; - }; - res: { - accessToken: string; - user: User; - }; - }; - "blocking/create": { - req: { - userId: User["id"]; - }; - res: UserDetailed; - }; - "blocking/delete": { - req: { - userId: User["id"]; - }; - res: UserDetailed; - }; - "blocking/list": { - req: { - limit?: number; - sinceId?: Blocking["id"]; - untilId?: Blocking["id"]; - }; - res: Blocking[]; - }; - "channels/create": { - req: TODO; - res: TODO; - }; - "channels/featured": { - req: TODO; - res: TODO; - }; - "channels/follow": { - req: TODO; - res: TODO; - }; - "channels/followed": { - req: TODO; - res: TODO; - }; - "channels/owned": { - req: TODO; - res: TODO; - }; - "channels/pin-note": { - req: TODO; - res: TODO; - }; - "channels/show": { - req: TODO; - res: TODO; - }; - "channels/timeline": { - req: TODO; - res: TODO; - }; - "channels/unfollow": { - req: TODO; - res: TODO; - }; - "channels/update": { - req: TODO; - res: TODO; - }; - "charts/active-users": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - users: number[]; - }; - remote: { - users: number[]; - }; - }; - }; - "charts/drive": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - decCount: number[]; - decSize: number[]; - incCount: number[]; - incSize: number[]; - totalCount: number[]; - totalSize: number[]; - }; - remote: { - decCount: number[]; - decSize: number[]; - incCount: number[]; - incSize: number[]; - totalCount: number[]; - totalSize: number[]; - }; - }; - }; - "charts/federation": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - instance: { - dec: number[]; - inc: number[]; - total: number[]; - }; - }; - }; - "charts/hashtag": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: TODO; - }; - "charts/instance": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - host: string; - }; - res: { - drive: { - decFiles: number[]; - decUsage: number[]; - incFiles: number[]; - incUsage: number[]; - totalFiles: number[]; - totalUsage: number[]; - }; - followers: { - dec: number[]; - inc: number[]; - total: number[]; - }; - following: { - dec: number[]; - inc: number[]; - total: number[]; - }; - notes: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - requests: { - failed: number[]; - received: number[]; - succeeded: number[]; - }; - users: { - dec: number[]; - inc: number[]; - total: number[]; - }; - }; - }; - "charts/network": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: TODO; - }; - "charts/notes": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - remote: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - }; - }; - "charts/user/drive": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: { - decCount: number[]; - decSize: number[]; - incCount: number[]; - incSize: number[]; - totalCount: number[]; - totalSize: number[]; - }; - }; - "charts/user/following": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: TODO; - }; - "charts/user/notes": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: { - dec: number[]; - inc: number[]; - total: number[]; - diffs: { - normal: number[]; - renote: number[]; - reply: number[]; - }; - }; - }; - "charts/user/reactions": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - userId: User["id"]; - }; - res: TODO; - }; - "charts/users": { - req: { - span: "day" | "hour"; - limit?: number; - offset?: number | null; - }; - res: { - local: { - dec: number[]; - inc: number[]; - total: number[]; - }; - remote: { - dec: number[]; - inc: number[]; - total: number[]; - }; - }; - }; - "clips/add-note": { - req: TODO; - res: TODO; - }; - "clips/create": { - req: TODO; - res: TODO; - }; - "clips/delete": { - req: { - clipId: Clip["id"]; - }; - res: null; - }; - "clips/list": { - req: TODO; - res: TODO; - }; - "clips/notes": { - req: TODO; - res: TODO; - }; - "clips/show": { - req: TODO; - res: TODO; - }; - "clips/update": { - req: TODO; - res: TODO; - }; - drive: { - req: NoParams; - res: { - capacity: number; - usage: number; - }; - }; - "drive/files": { - req: { - folderId?: DriveFolder["id"] | null; - type?: DriveFile["type"] | null; - limit?: number; - sinceId?: DriveFile["id"]; - untilId?: DriveFile["id"]; - }; - res: DriveFile[]; - }; - "drive/files/attached-notes": { - req: TODO; - res: TODO; - }; - "drive/files/check-existence": { - req: TODO; - res: TODO; - }; - "drive/files/create": { - req: TODO; - res: TODO; - }; - "drive/files/delete": { - req: { - fileId: DriveFile["id"]; - }; - res: null; - }; - "drive/files/find-by-hash": { - req: TODO; - res: TODO; - }; - "drive/files/find": { - req: { - name: string; - folderId?: DriveFolder["id"] | null; - }; - res: DriveFile[]; - }; - "drive/files/show": { - req: { - fileId?: DriveFile["id"]; - url?: string; - }; - res: DriveFile; - }; - "drive/files/update": { - req: { - fileId: DriveFile["id"]; - folderId?: DriveFolder["id"] | null; - name?: string; - isSensitive?: boolean; - comment?: string | null; - }; - res: DriveFile; - }; - "drive/files/upload-from-url": { - req: { - url: string; - folderId?: DriveFolder["id"] | null; - isSensitive?: boolean; - comment?: string | null; - marker?: string | null; - force?: boolean; - }; - res: null; - }; - "drive/folders": { - req: { - folderId?: DriveFolder["id"] | null; - limit?: number; - sinceId?: DriveFile["id"]; - untilId?: DriveFile["id"]; - }; - res: DriveFolder[]; - }; - "drive/folders/create": { - req: { - name?: string; - parentId?: DriveFolder["id"] | null; - }; - res: DriveFolder; - }; - "drive/folders/delete": { - req: { - folderId: DriveFolder["id"]; - }; - res: null; - }; - "drive/folders/find": { - req: { - name: string; - parentId?: DriveFolder["id"] | null; - }; - res: DriveFolder[]; - }; - "drive/folders/show": { - req: { - folderId: DriveFolder["id"]; - }; - res: DriveFolder; - }; - "drive/folders/update": { - req: { - folderId: DriveFolder["id"]; - name?: string; - parentId?: DriveFolder["id"] | null; - }; - res: DriveFolder; - }; - "drive/stream": { - req: { - type?: DriveFile["type"] | null; - limit?: number; - sinceId?: DriveFile["id"]; - untilId?: DriveFile["id"]; - }; - res: DriveFile[]; - }; - endpoint: { - req: { - endpoint: string; - }; - res: { - params: { - name: string; - type: string; - }[]; - }; - }; - endpoints: { - req: NoParams; - res: string[]; - }; - "federation/dns": { - req: { - host: string; - }; - res: { - a: string[]; - aaaa: string[]; - cname: string[]; - txt: string[]; - }; - }; - "federation/followers": { - req: { - host: string; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFolloweePopulated[]; - }; - "federation/following": { - req: { - host: string; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFolloweePopulated[]; - }; - "federation/instances": { - req: { - host?: string | null; - blocked?: boolean | null; - notResponding?: boolean | null; - suspended?: boolean | null; - federating?: boolean | null; - subscribing?: boolean | null; - publishing?: boolean | null; - limit?: number; - offset?: number; - sort?: - | "+pubSub" - | "-pubSub" - | "+notes" - | "-notes" - | "+users" - | "-users" - | "+following" - | "-following" - | "+followers" - | "-followers" - | "+caughtAt" - | "-caughtAt" - | "+lastCommunicatedAt" - | "-lastCommunicatedAt" - | "+driveUsage" - | "-driveUsage" - | "+driveFiles" - | "-driveFiles"; - }; - res: Instance[]; - }; - "federation/show-instance": { - req: { - host: string; - }; - res: Instance; - }; - "federation/update-remote-user": { - req: { - userId: User["id"]; - }; - res: null; - }; - "federation/users": { - req: { - host: string; - limit?: number; - sinceId?: User["id"]; - untilId?: User["id"]; - }; - res: UserDetailed[]; - }; - "following/create": { - req: { - userId: User["id"]; - }; - res: User; - }; - "following/delete": { - req: { - userId: User["id"]; - }; - res: User; - }; - "following/requests/accept": { - req: { - userId: User["id"]; - }; - res: null; - }; - "following/requests/cancel": { - req: { - userId: User["id"]; - }; - res: User; - }; - "following/requests/list": { - req: NoParams; - res: FollowRequest[]; - }; - "following/requests/reject": { - req: { - userId: User["id"]; - }; - res: null; - }; - "gallery/featured": { - req: TODO; - res: TODO; - }; - "gallery/popular": { - req: TODO; - res: TODO; - }; - "gallery/posts": { - req: TODO; - res: TODO; - }; - "gallery/posts/create": { - req: TODO; - res: TODO; - }; - "gallery/posts/delete": { - req: { - postId: GalleryPost["id"]; - }; - res: null; - }; - "gallery/posts/like": { - req: TODO; - res: TODO; - }; - "gallery/posts/show": { - req: TODO; - res: TODO; - }; - "gallery/posts/unlike": { - req: TODO; - res: TODO; - }; - "gallery/posts/update": { - req: TODO; - res: TODO; - }; - "games/reversi/games": { - req: TODO; - res: TODO; - }; - "games/reversi/games/show": { - req: TODO; - res: TODO; - }; - "games/reversi/games/surrender": { - req: TODO; - res: TODO; - }; - "games/reversi/invitations": { - req: TODO; - res: TODO; - }; - "games/reversi/match": { - req: TODO; - res: TODO; - }; - "games/reversi/match/cancel": { - req: TODO; - res: TODO; - }; - "get-online-users-count": { - req: NoParams; - res: { - count: number; - }; - }; - "hashtags/list": { - req: TODO; - res: TODO; - }; - "hashtags/search": { - req: TODO; - res: TODO; - }; - "hashtags/show": { - req: TODO; - res: TODO; - }; - "hashtags/trend": { - req: TODO; - res: TODO; - }; - "hashtags/users": { - req: TODO; - res: TODO; - }; - i: { - req: NoParams; - res: User; - }; - "i/apps": { - req: TODO; - res: TODO; - }; - "i/authorized-apps": { - req: TODO; - res: TODO; - }; - "i/change-password": { - req: TODO; - res: TODO; - }; - "i/delete-account": { - req: { - password: string; - }; - res: null; - }; - "i/export-blocking": { - req: TODO; - res: TODO; - }; - "i/export-following": { - req: TODO; - res: TODO; - }; - "i/export-mute": { - req: TODO; - res: TODO; - }; - "i/export-notes": { - req: TODO; - res: TODO; - }; - "i/export-user-lists": { - req: TODO; - res: TODO; - }; - "i/favorites": { - req: { - limit?: number; - sinceId?: NoteFavorite["id"]; - untilId?: NoteFavorite["id"]; - }; - res: NoteFavorite[]; - }; - "i/gallery/likes": { - req: TODO; - res: TODO; - }; - "i/gallery/posts": { - req: TODO; - res: TODO; - }; - "i/get-word-muted-notes-count": { - req: TODO; - res: TODO; - }; - "i/import-following": { - req: TODO; - res: TODO; - }; - "i/import-user-lists": { - req: TODO; - res: TODO; - }; - "i/move": { - req: TODO; - res: TODO; - }; - "i/known-as": { - req: TODO; - res: TODO; - }; - "i/notifications": { - req: { - limit?: number; - sinceId?: Notification["id"]; - untilId?: Notification["id"]; - following?: boolean; - markAsRead?: boolean; - includeTypes?: Notification["type"][]; - excludeTypes?: Notification["type"][]; - }; - res: Notification[]; - }; - "i/page-likes": { - req: TODO; - res: TODO; - }; - "i/pages": { - req: TODO; - res: TODO; - }; - "i/pin": { - req: { - noteId: Note["id"]; - }; - res: MeDetailed; - }; - "i/read-all-messaging-messages": { - req: TODO; - res: TODO; - }; - "i/read-all-unread-notes": { - req: TODO; - res: TODO; - }; - "i/read-announcement": { - req: TODO; - res: TODO; - }; - "i/regenerate-token": { - req: { - password: string; - }; - res: null; - }; - "i/registry/get-all": { - req: { - scope?: string[]; - }; - res: Record; - }; - "i/registry/get-detail": { - req: { - key: string; - scope?: string[]; - }; - res: { - updatedAt: DateString; - value: any; - }; - }; - "i/registry/get": { - req: { - key: string; - scope?: string[]; - }; - res: any; - }; - "i/registry/keys-with-type": { - req: { - scope?: string[]; - }; - res: Record< - string, - "null" | "array" | "number" | "string" | "boolean" | "object" - >; - }; - "i/registry/keys": { - req: { - scope?: string[]; - }; - res: string[]; - }; - "i/registry/remove": { - req: { - key: string; - scope?: string[]; - }; - res: null; - }; - "i/registry/scopes": { - req: NoParams; - res: string[][]; - }; - "i/registry/set": { - req: { - key: string; - value: any; - scope?: string[]; - }; - res: null; - }; - "i/revoke-token": { - req: TODO; - res: TODO; - }; - "i/signin-history": { - req: { - limit?: number; - sinceId?: Signin["id"]; - untilId?: Signin["id"]; - }; - res: Signin[]; - }; - "i/unpin": { - req: { - noteId: Note["id"]; - }; - res: MeDetailed; - }; - "i/update-email": { - req: { - password: string; - email?: string | null; - }; - res: MeDetailed; - }; - "i/update": { - req: { - name?: string | null; - description?: string | null; - lang?: string | null; - location?: string | null; - birthday?: string | null; - avatarId?: DriveFile["id"] | null; - bannerId?: DriveFile["id"] | null; - fields?: { - name: string; - value: string; - }[]; - isLocked?: boolean; - isExplorable?: boolean; - hideOnlineStatus?: boolean; - carefulBot?: boolean; - autoAcceptFollowed?: boolean; - noCrawle?: boolean; - preventAiLearning?: boolean; - isBot?: boolean; - isCat?: boolean; - injectFeaturedNote?: boolean; - receiveAnnouncementEmail?: boolean; - alwaysMarkNsfw?: boolean; - mutedWords?: string[][]; - mutingNotificationTypes?: Notification["type"][]; - emailNotificationTypes?: string[]; - }; - res: MeDetailed; - }; - "i/user-group-invites": { - req: TODO; - res: TODO; - }; - "i/2fa/done": { - req: TODO; - res: TODO; - }; - "i/2fa/key-done": { - req: TODO; - res: TODO; - }; - "i/2fa/password-less": { - req: TODO; - res: TODO; - }; - "i/2fa/register-key": { - req: TODO; - res: TODO; - }; - "i/2fa/register": { - req: TODO; - res: TODO; - }; - "i/2fa/update-key": { - req: TODO; - res: TODO; - }; - "i/2fa/remove-key": { - req: TODO; - res: TODO; - }; - "i/2fa/unregister": { - req: TODO; - res: TODO; - }; - "messaging/history": { - req: { - limit?: number; - group?: boolean; - }; - res: MessagingMessage[]; - }; - "messaging/messages": { - req: { - userId?: User["id"]; - groupId?: UserGroup["id"]; - limit?: number; - sinceId?: MessagingMessage["id"]; - untilId?: MessagingMessage["id"]; - markAsRead?: boolean; - }; - res: MessagingMessage[]; - }; - "messaging/messages/create": { - req: { - userId?: User["id"]; - groupId?: UserGroup["id"]; - text?: string; - fileId?: DriveFile["id"]; - }; - res: MessagingMessage; - }; - "messaging/messages/delete": { - req: { - messageId: MessagingMessage["id"]; - }; - res: null; - }; - "messaging/messages/read": { - req: { - messageId: MessagingMessage["id"]; - }; - res: null; - }; - meta: { - req: { - detail?: boolean; - }; - res: { - $switch: { - $cases: [ - [ - { - detail: true; - }, - DetailedInstanceMetadata, - ], - [ - { - detail: false; - }, - LiteInstanceMetadata, - ], - [ - { - detail: boolean; - }, - LiteInstanceMetadata | DetailedInstanceMetadata, - ], - ]; - $default: LiteInstanceMetadata; - }; - }; - }; - "miauth/gen-token": { - req: TODO; - res: TODO; - }; - "mute/create": { - req: TODO; - res: TODO; - }; - "mute/delete": { - req: { - userId: User["id"]; - }; - res: null; - }; - "mute/list": { - req: TODO; - res: TODO; - }; - "renote-mute/create": { - req: TODO; - res: TODO; - }; - "renote-mute/delete": { - req: { - userId: User["id"]; - }; - res: null; - }; - "renote-mute/list": { - req: TODO; - res: TODO; - }; - "my/apps": { - req: TODO; - res: TODO; - }; - notes: { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "notes/children": { - req: { - noteId: Note["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "notes/clips": { - req: TODO; - res: TODO; - }; - "notes/conversation": { - req: TODO; - res: TODO; - }; - "notes/create": { - req: NoteSubmitReq; - res: { - createdNote: Note; - }; - }; - "notes/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/edit": { - req: NoteSubmitReq; - res: { - createdNote: Note; - }; - }; - "notes/favorites/create": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/favorites/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/featured": { - req: TODO; - res: Note[]; - }; - "notes/global-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/recommended-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/hybrid-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/local-timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/mentions": { - req: { - following?: boolean; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - }; - res: Note[]; - }; - "notes/polls/recommendation": { - req: TODO; - res: TODO; - }; - "notes/polls/vote": { - req: { - noteId: Note["id"]; - choice: number; - }; - res: null; - }; - "notes/reactions": { - req: { - noteId: Note["id"]; - type?: string | null; - limit?: number; - }; - res: NoteReaction[]; - }; - "notes/reactions/create": { - req: { - noteId: Note["id"]; - reaction: string; - }; - res: null; - }; - "notes/reactions/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/renotes": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - noteId: Note["id"]; - }; - res: Note[]; - }; - "notes/replies": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - noteId: Note["id"]; - }; - res: Note[]; - }; - "notes/search-by-tag": { - req: TODO; - res: TODO; - }; - "notes/search": { - req: TODO; - res: TODO; - }; - "notes/show": { - req: { - noteId: Note["id"]; - }; - res: Note; - }; - "notes/state": { - req: TODO; - res: TODO; - }; - "notes/timeline": { - req: { - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/unrenote": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notes/user-list-timeline": { - req: { - listId: UserList["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "notes/watching/create": { - req: TODO; - res: TODO; - }; - "notes/watching/delete": { - req: { - noteId: Note["id"]; - }; - res: null; - }; - "notifications/create": { - req: { - body: string; - header?: string | null; - icon?: string | null; - }; - res: null; - }; - "notifications/mark-all-as-read": { - req: NoParams; - res: null; - }; - "notifications/read": { - req: { - notificationId: Notification["id"]; - }; - res: null; - }; - "page-push": { - req: { - pageId: Page["id"]; - event: string; - var?: any; - }; - res: null; - }; - "pages/create": { - req: TODO; - res: Page; - }; - "pages/delete": { - req: { - pageId: Page["id"]; - }; - res: null; - }; - "pages/featured": { - req: NoParams; - res: Page[]; - }; - "pages/like": { - req: { - pageId: Page["id"]; - }; - res: null; - }; - "pages/show": { - req: { - pageId?: Page["id"]; - name?: string; - username?: string; - }; - res: Page; - }; - "pages/unlike": { - req: { - pageId: Page["id"]; - }; - res: null; - }; - "pages/update": { - req: TODO; - res: null; - }; - ping: { - req: NoParams; - res: { - pong: number; - }; - }; - "pinned-users": { - req: TODO; - res: TODO; - }; - "promo/read": { - req: TODO; - res: TODO; - }; - "request-reset-password": { - req: { - username: string; - email: string; - }; - res: null; - }; - "reset-password": { - req: { - token: string; - password: string; - }; - res: null; - }; - "room/show": { - req: TODO; - res: TODO; - }; - "room/update": { - req: TODO; - res: TODO; - }; - stats: { - req: NoParams; - res: Stats; - }; - "server-info": { - req: NoParams; - res: ServerInfo; - }; - "latest-version": { - req: NoParams; - res: TODO; - }; - "sw/register": { - req: TODO; - res: TODO; - }; - "username/available": { - req: { - username: string; - }; - res: { - available: boolean; - }; - }; - users: { - req: { - limit?: number; - offset?: number; - sort?: UserSorting; - origin?: OriginType; - }; - res: User[]; - }; - "users/clips": { - req: TODO; - res: TODO; - }; - "users/followers": { - req: { - userId?: User["id"]; - username?: User["username"]; - host?: User["host"] | null; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFollowerPopulated[]; - }; - "users/following": { - req: { - userId?: User["id"]; - username?: User["username"]; - host?: User["host"] | null; - limit?: number; - sinceId?: Following["id"]; - untilId?: Following["id"]; - }; - res: FollowingFolloweePopulated[]; - }; - "users/gallery/posts": { - req: TODO; - res: TODO; - }; - "users/get-frequently-replied-users": { - req: TODO; - res: TODO; - }; - "users/groups/create": { - req: TODO; - res: TODO; - }; - "users/groups/delete": { - req: { - groupId: UserGroup["id"]; - }; - res: null; - }; - "users/groups/invitations/accept": { - req: TODO; - res: TODO; - }; - "users/groups/invitations/reject": { - req: TODO; - res: TODO; - }; - "users/groups/invite": { - req: TODO; - res: TODO; - }; - "users/groups/joined": { - req: TODO; - res: TODO; - }; - "users/groups/owned": { - req: TODO; - res: TODO; - }; - "users/groups/pull": { - req: TODO; - res: TODO; - }; - "users/groups/show": { - req: TODO; - res: TODO; - }; - "users/groups/transfer": { - req: TODO; - res: TODO; - }; - "users/groups/update": { - req: TODO; - res: TODO; - }; - "users/lists/create": { - req: { - name: string; - }; - res: UserList; - }; - "users/lists/delete": { - req: { - listId: UserList["id"]; - }; - res: null; - }; - "users/lists/list": { - req: NoParams; - res: UserList[]; - }; - "users/lists/pull": { - req: { - listId: UserList["id"]; - userId: User["id"]; - }; - res: null; - }; - "users/lists/push": { - req: { - listId: UserList["id"]; - userId: User["id"]; - }; - res: null; - }; - "users/lists/show": { - req: { - listId: UserList["id"]; - }; - res: UserList; - }; - "users/lists/update": { - req: { - listId: UserList["id"]; - name: string; - }; - res: UserList; - }; - "users/notes": { - req: { - userId: User["id"]; - limit?: number; - sinceId?: Note["id"]; - untilId?: Note["id"]; - sinceDate?: number; - untilDate?: number; - }; - res: Note[]; - }; - "users/pages": { - req: TODO; - res: TODO; - }; - "users/recommendation": { - req: TODO; - res: TODO; - }; - "users/relation": { - req: TODO; - res: TODO; - }; - "users/report-abuse": { - req: TODO; - res: TODO; - }; - "users/search-by-username-and-host": { - req: TODO; - res: TODO; - }; - "users/search": { - req: TODO; - res: TODO; - }; - "users/show": { - req: - | ShowUserReq - | { - userIds: User["id"][]; - }; - res: { - $switch: { - $cases: [ - [ - { - userIds: User["id"][]; - }, - UserDetailed[], - ], - ]; - $default: UserDetailed; - }; - }; - }; - "users/stats": { - req: TODO; - res: TODO; - }; -}; -``` -**References:** [User](./iceshrimp-js.entities.user.md), [Ad](./iceshrimp-js.entities.ad.md), [Announcement](./iceshrimp-js.entities.announcement.md), [Antenna](./iceshrimp-js.entities.antenna.md), [Note](./iceshrimp-js.entities.note.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md), [App](./iceshrimp-js.entities.app.md), [AuthSession](./iceshrimp-js.entities.authsession.md), [Blocking](./iceshrimp-js.entities.blocking.md), [Clip](./iceshrimp-js.entities.clip.md), [DriveFolder](./iceshrimp-js.entities.drivefolder.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [Following](./iceshrimp-js.entities.following.md), [FollowingFolloweePopulated](./iceshrimp-js.entities.followingfolloweepopulated.md), [Instance](./iceshrimp-js.entities.instance.md), [FollowRequest](./iceshrimp-js.entities.followrequest.md), [GalleryPost](./iceshrimp-js.entities.gallerypost.md), [NoteFavorite](./iceshrimp-js.entities.notefavorite.md), [MeDetailed](./iceshrimp-js.entities.medetailed.md), [DateString](./iceshrimp-js.entities.datestring.md), [Signin](./iceshrimp-js.entities.signin.md), [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md), [UserGroup](./iceshrimp-js.entities.usergroup.md), [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md), [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md), [NoteReaction](./iceshrimp-js.entities.notereaction.md), [UserList](./iceshrimp-js.entities.userlist.md), [Page](./iceshrimp-js.entities.page.md), [Stats](./iceshrimp-js.entities.stats.md), [ServerInfo](./iceshrimp-js.entities.serverinfo.md), [UserSorting](./iceshrimp-js.entities.usersorting.md), [OriginType](./iceshrimp-js.entities.origintype.md), [FollowingFollowerPopulated](./iceshrimp-js.entities.followingfollowerpopulated.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Endpoints](./iceshrimp-js.endpoints.md) + +## Endpoints type + +**Signature:** + +```typescript +export declare type Endpoints = { + "admin/abuse-user-reports": { + req: TODO; + res: TODO; + }; + "admin/delete-all-files-of-a-user": { + req: { + userId: User["id"]; + }; + res: null; + }; + "admin/delete-logs": { + req: NoParams; + res: null; + }; + "admin/get-index-stats": { + req: TODO; + res: TODO; + }; + "admin/get-table-stats": { + req: TODO; + res: TODO; + }; + "admin/invite": { + req: TODO; + res: TODO; + }; + "admin/logs": { + req: TODO; + res: TODO; + }; + "admin/meta": { + req: TODO; + res: TODO; + }; + "admin/reset-password": { + req: TODO; + res: TODO; + }; + "admin/resolve-abuse-user-report": { + req: TODO; + res: TODO; + }; + "admin/resync-chart": { + req: TODO; + res: TODO; + }; + "admin/send-email": { + req: TODO; + res: TODO; + }; + "admin/server-info": { + req: TODO; + res: TODO; + }; + "admin/show-moderation-logs": { + req: TODO; + res: TODO; + }; + "admin/show-user": { + req: TODO; + res: TODO; + }; + "admin/show-users": { + req: TODO; + res: TODO; + }; + "admin/silence-user": { + req: TODO; + res: TODO; + }; + "admin/suspend-user": { + req: TODO; + res: TODO; + }; + "admin/unsilence-user": { + req: TODO; + res: TODO; + }; + "admin/unsuspend-user": { + req: TODO; + res: TODO; + }; + "admin/update-meta": { + req: TODO; + res: TODO; + }; + "admin/vacuum": { + req: TODO; + res: TODO; + }; + "admin/accounts/create": { + req: TODO; + res: TODO; + }; + "admin/ad/create": { + req: TODO; + res: TODO; + }; + "admin/ad/delete": { + req: { + id: Ad["id"]; + }; + res: null; + }; + "admin/ad/list": { + req: TODO; + res: TODO; + }; + "admin/ad/update": { + req: TODO; + res: TODO; + }; + "admin/announcements/create": { + req: TODO; + res: TODO; + }; + "admin/announcements/delete": { + req: { + id: Announcement["id"]; + }; + res: null; + }; + "admin/announcements/list": { + req: TODO; + res: TODO; + }; + "admin/announcements/update": { + req: TODO; + res: TODO; + }; + "admin/drive/clean-remote-files": { + req: TODO; + res: TODO; + }; + "admin/drive/cleanup": { + req: TODO; + res: TODO; + }; + "admin/drive/files": { + req: TODO; + res: TODO; + }; + "admin/drive/show-file": { + req: TODO; + res: TODO; + }; + "admin/emoji/add": { + req: TODO; + res: TODO; + }; + "admin/emoji/copy": { + req: TODO; + res: TODO; + }; + "admin/emoji/list-remote": { + req: TODO; + res: TODO; + }; + "admin/emoji/list": { + req: TODO; + res: TODO; + }; + "admin/emoji/remove": { + req: TODO; + res: TODO; + }; + "admin/emoji/update": { + req: TODO; + res: TODO; + }; + "admin/federation/delete-all-files": { + req: { + host: string; + }; + res: null; + }; + "admin/federation/refresh-remote-instance-metadata": { + req: TODO; + res: TODO; + }; + "admin/federation/remove-all-following": { + req: TODO; + res: TODO; + }; + "admin/federation/update-instance": { + req: TODO; + res: TODO; + }; + "admin/moderators/add": { + req: TODO; + res: TODO; + }; + "admin/moderators/remove": { + req: TODO; + res: TODO; + }; + "admin/promo/create": { + req: TODO; + res: TODO; + }; + "admin/queue/clear": { + req: TODO; + res: TODO; + }; + "admin/queue/deliver-delayed": { + req: TODO; + res: TODO; + }; + "admin/queue/inbox-delayed": { + req: TODO; + res: TODO; + }; + "admin/queue/jobs": { + req: TODO; + res: TODO; + }; + "admin/queue/stats": { + req: TODO; + res: TODO; + }; + "admin/relays/add": { + req: TODO; + res: TODO; + }; + "admin/relays/list": { + req: TODO; + res: TODO; + }; + "admin/relays/remove": { + req: TODO; + res: TODO; + }; + announcements: { + req: { + limit?: number; + withUnreads?: boolean; + sinceId?: Announcement["id"]; + untilId?: Announcement["id"]; + }; + res: Announcement[]; + }; + "antennas/create": { + req: TODO; + res: Antenna; + }; + "antennas/delete": { + req: { + antennaId: Antenna["id"]; + }; + res: null; + }; + "antennas/list": { + req: NoParams; + res: Antenna[]; + }; + "antennas/notes": { + req: { + antennaId: Antenna["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "antennas/show": { + req: { + antennaId: Antenna["id"]; + }; + res: Antenna; + }; + "antennas/update": { + req: TODO; + res: Antenna; + }; + "antennas/mark-read": { + req: TODO; + res: Antenna; + }; + "ap/get": { + req: { + uri: string; + }; + res: Record; + }; + "ap/show": { + req: { + uri: string; + }; + res: + | { + type: "Note"; + object: Note; + } + | { + type: "User"; + object: UserDetailed; + }; + }; + "app/create": { + req: TODO; + res: App; + }; + "app/show": { + req: { + appId: App["id"]; + }; + res: App; + }; + "auth/accept": { + req: { + token: string; + }; + res: null; + }; + "auth/session/generate": { + req: { + appSecret: string; + }; + res: { + token: string; + url: string; + }; + }; + "auth/session/show": { + req: { + token: string; + }; + res: AuthSession; + }; + "auth/session/userkey": { + req: { + appSecret: string; + token: string; + }; + res: { + accessToken: string; + user: User; + }; + }; + "blocking/create": { + req: { + userId: User["id"]; + }; + res: UserDetailed; + }; + "blocking/delete": { + req: { + userId: User["id"]; + }; + res: UserDetailed; + }; + "blocking/list": { + req: { + limit?: number; + sinceId?: Blocking["id"]; + untilId?: Blocking["id"]; + }; + res: Blocking[]; + }; + "channels/create": { + req: TODO; + res: TODO; + }; + "channels/featured": { + req: TODO; + res: TODO; + }; + "channels/follow": { + req: TODO; + res: TODO; + }; + "channels/followed": { + req: TODO; + res: TODO; + }; + "channels/owned": { + req: TODO; + res: TODO; + }; + "channels/pin-note": { + req: TODO; + res: TODO; + }; + "channels/show": { + req: TODO; + res: TODO; + }; + "channels/timeline": { + req: TODO; + res: TODO; + }; + "channels/unfollow": { + req: TODO; + res: TODO; + }; + "channels/update": { + req: TODO; + res: TODO; + }; + "charts/active-users": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + users: number[]; + }; + remote: { + users: number[]; + }; + }; + }; + "charts/drive": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + remote: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + }; + "charts/federation": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + instance: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "charts/hashtag": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + "charts/instance": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + host: string; + }; + res: { + drive: { + decFiles: number[]; + decUsage: number[]; + incFiles: number[]; + incUsage: number[]; + totalFiles: number[]; + totalUsage: number[]; + }; + followers: { + dec: number[]; + inc: number[]; + total: number[]; + }; + following: { + dec: number[]; + inc: number[]; + total: number[]; + }; + notes: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + requests: { + failed: number[]; + received: number[]; + succeeded: number[]; + }; + users: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "charts/network": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + "charts/notes": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + }; + "charts/user/drive": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + "charts/user/following": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: TODO; + }; + "charts/user/notes": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + "charts/user/reactions": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: TODO; + }; + "charts/users": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "clips/add-note": { + req: TODO; + res: TODO; + }; + "clips/create": { + req: TODO; + res: TODO; + }; + "clips/delete": { + req: { + clipId: Clip["id"]; + }; + res: null; + }; + "clips/list": { + req: TODO; + res: TODO; + }; + "clips/notes": { + req: TODO; + res: TODO; + }; + "clips/show": { + req: TODO; + res: TODO; + }; + "clips/update": { + req: TODO; + res: TODO; + }; + drive: { + req: NoParams; + res: { + capacity: number; + usage: number; + }; + }; + "drive/files": { + req: { + folderId?: DriveFolder["id"] | null; + type?: DriveFile["type"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFile[]; + }; + "drive/files/attached-notes": { + req: TODO; + res: TODO; + }; + "drive/files/check-existence": { + req: TODO; + res: TODO; + }; + "drive/files/create": { + req: TODO; + res: TODO; + }; + "drive/files/delete": { + req: { + fileId: DriveFile["id"]; + }; + res: null; + }; + "drive/files/find-by-hash": { + req: TODO; + res: TODO; + }; + "drive/files/find": { + req: { + name: string; + folderId?: DriveFolder["id"] | null; + }; + res: DriveFile[]; + }; + "drive/files/show": { + req: { + fileId?: DriveFile["id"]; + url?: string; + }; + res: DriveFile; + }; + "drive/files/update": { + req: { + fileId: DriveFile["id"]; + folderId?: DriveFolder["id"] | null; + name?: string; + isSensitive?: boolean; + comment?: string | null; + }; + res: DriveFile; + }; + "drive/files/upload-from-url": { + req: { + url: string; + folderId?: DriveFolder["id"] | null; + isSensitive?: boolean; + comment?: string | null; + marker?: string | null; + force?: boolean; + }; + res: null; + }; + "drive/folders": { + req: { + folderId?: DriveFolder["id"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFolder[]; + }; + "drive/folders/create": { + req: { + name?: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder; + }; + "drive/folders/delete": { + req: { + folderId: DriveFolder["id"]; + }; + res: null; + }; + "drive/folders/find": { + req: { + name: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder[]; + }; + "drive/folders/show": { + req: { + folderId: DriveFolder["id"]; + }; + res: DriveFolder; + }; + "drive/folders/update": { + req: { + folderId: DriveFolder["id"]; + name?: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder; + }; + "drive/stream": { + req: { + type?: DriveFile["type"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFile[]; + }; + endpoint: { + req: { + endpoint: string; + }; + res: { + params: { + name: string; + type: string; + }[]; + }; + }; + endpoints: { + req: NoParams; + res: string[]; + }; + "federation/dns": { + req: { + host: string; + }; + res: { + a: string[]; + aaaa: string[]; + cname: string[]; + txt: string[]; + }; + }; + "federation/followers": { + req: { + host: string; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "federation/following": { + req: { + host: string; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "federation/instances": { + req: { + host?: string | null; + blocked?: boolean | null; + notResponding?: boolean | null; + suspended?: boolean | null; + federating?: boolean | null; + subscribing?: boolean | null; + publishing?: boolean | null; + limit?: number; + offset?: number; + sort?: + | "+pubSub" + | "-pubSub" + | "+notes" + | "-notes" + | "+users" + | "-users" + | "+following" + | "-following" + | "+followers" + | "-followers" + | "+caughtAt" + | "-caughtAt" + | "+lastCommunicatedAt" + | "-lastCommunicatedAt" + | "+driveUsage" + | "-driveUsage" + | "+driveFiles" + | "-driveFiles"; + }; + res: Instance[]; + }; + "federation/show-instance": { + req: { + host: string; + }; + res: Instance; + }; + "federation/update-remote-user": { + req: { + userId: User["id"]; + }; + res: null; + }; + "federation/users": { + req: { + host: string; + limit?: number; + sinceId?: User["id"]; + untilId?: User["id"]; + }; + res: UserDetailed[]; + }; + "following/create": { + req: { + userId: User["id"]; + }; + res: User; + }; + "following/delete": { + req: { + userId: User["id"]; + }; + res: User; + }; + "following/requests/accept": { + req: { + userId: User["id"]; + }; + res: null; + }; + "following/requests/cancel": { + req: { + userId: User["id"]; + }; + res: User; + }; + "following/requests/list": { + req: NoParams; + res: FollowRequest[]; + }; + "following/requests/reject": { + req: { + userId: User["id"]; + }; + res: null; + }; + "gallery/featured": { + req: TODO; + res: TODO; + }; + "gallery/popular": { + req: TODO; + res: TODO; + }; + "gallery/posts": { + req: TODO; + res: TODO; + }; + "gallery/posts/create": { + req: TODO; + res: TODO; + }; + "gallery/posts/delete": { + req: { + postId: GalleryPost["id"]; + }; + res: null; + }; + "gallery/posts/like": { + req: TODO; + res: TODO; + }; + "gallery/posts/show": { + req: TODO; + res: TODO; + }; + "gallery/posts/unlike": { + req: TODO; + res: TODO; + }; + "gallery/posts/update": { + req: TODO; + res: TODO; + }; + "games/reversi/games": { + req: TODO; + res: TODO; + }; + "games/reversi/games/show": { + req: TODO; + res: TODO; + }; + "games/reversi/games/surrender": { + req: TODO; + res: TODO; + }; + "games/reversi/invitations": { + req: TODO; + res: TODO; + }; + "games/reversi/match": { + req: TODO; + res: TODO; + }; + "games/reversi/match/cancel": { + req: TODO; + res: TODO; + }; + "get-online-users-count": { + req: NoParams; + res: { + count: number; + }; + }; + "hashtags/list": { + req: TODO; + res: TODO; + }; + "hashtags/search": { + req: TODO; + res: TODO; + }; + "hashtags/show": { + req: TODO; + res: TODO; + }; + "hashtags/trend": { + req: TODO; + res: TODO; + }; + "hashtags/users": { + req: TODO; + res: TODO; + }; + i: { + req: NoParams; + res: User; + }; + "i/apps": { + req: TODO; + res: TODO; + }; + "i/authorized-apps": { + req: TODO; + res: TODO; + }; + "i/change-password": { + req: TODO; + res: TODO; + }; + "i/delete-account": { + req: { + password: string; + }; + res: null; + }; + "i/export-blocking": { + req: TODO; + res: TODO; + }; + "i/export-following": { + req: TODO; + res: TODO; + }; + "i/export-mute": { + req: TODO; + res: TODO; + }; + "i/export-notes": { + req: TODO; + res: TODO; + }; + "i/export-user-lists": { + req: TODO; + res: TODO; + }; + "i/favorites": { + req: { + limit?: number; + sinceId?: NoteFavorite["id"]; + untilId?: NoteFavorite["id"]; + }; + res: NoteFavorite[]; + }; + "i/gallery/likes": { + req: TODO; + res: TODO; + }; + "i/gallery/posts": { + req: TODO; + res: TODO; + }; + "i/get-word-muted-notes-count": { + req: TODO; + res: TODO; + }; + "i/import-following": { + req: TODO; + res: TODO; + }; + "i/import-user-lists": { + req: TODO; + res: TODO; + }; + "i/move": { + req: TODO; + res: TODO; + }; + "i/known-as": { + req: TODO; + res: TODO; + }; + "i/notifications": { + req: { + limit?: number; + sinceId?: Notification["id"]; + untilId?: Notification["id"]; + following?: boolean; + markAsRead?: boolean; + includeTypes?: Notification["type"][]; + excludeTypes?: Notification["type"][]; + }; + res: Notification[]; + }; + "i/page-likes": { + req: TODO; + res: TODO; + }; + "i/pages": { + req: TODO; + res: TODO; + }; + "i/pin": { + req: { + noteId: Note["id"]; + }; + res: MeDetailed; + }; + "i/read-all-messaging-messages": { + req: TODO; + res: TODO; + }; + "i/read-all-unread-notes": { + req: TODO; + res: TODO; + }; + "i/read-announcement": { + req: TODO; + res: TODO; + }; + "i/regenerate-token": { + req: { + password: string; + }; + res: null; + }; + "i/registry/get-all": { + req: { + scope?: string[]; + }; + res: Record; + }; + "i/registry/get-detail": { + req: { + key: string; + scope?: string[]; + }; + res: { + updatedAt: DateString; + value: any; + }; + }; + "i/registry/get": { + req: { + key: string; + scope?: string[]; + }; + res: any; + }; + "i/registry/keys-with-type": { + req: { + scope?: string[]; + }; + res: Record< + string, + "null" | "array" | "number" | "string" | "boolean" | "object" + >; + }; + "i/registry/keys": { + req: { + scope?: string[]; + }; + res: string[]; + }; + "i/registry/remove": { + req: { + key: string; + scope?: string[]; + }; + res: null; + }; + "i/registry/scopes": { + req: NoParams; + res: string[][]; + }; + "i/registry/set": { + req: { + key: string; + value: any; + scope?: string[]; + }; + res: null; + }; + "i/revoke-token": { + req: TODO; + res: TODO; + }; + "i/signin-history": { + req: { + limit?: number; + sinceId?: Signin["id"]; + untilId?: Signin["id"]; + }; + res: Signin[]; + }; + "i/unpin": { + req: { + noteId: Note["id"]; + }; + res: MeDetailed; + }; + "i/update-email": { + req: { + password: string; + email?: string | null; + }; + res: MeDetailed; + }; + "i/update": { + req: { + name?: string | null; + description?: string | null; + lang?: string | null; + location?: string | null; + birthday?: string | null; + avatarId?: DriveFile["id"] | null; + bannerId?: DriveFile["id"] | null; + fields?: { + name: string; + value: string; + }[]; + isLocked?: boolean; + isExplorable?: boolean; + hideOnlineStatus?: boolean; + carefulBot?: boolean; + autoAcceptFollowed?: boolean; + noCrawle?: boolean; + preventAiLearning?: boolean; + isBot?: boolean; + isCat?: boolean; + injectFeaturedNote?: boolean; + receiveAnnouncementEmail?: boolean; + alwaysMarkNsfw?: boolean; + mutedWords?: string[][]; + mutingNotificationTypes?: Notification["type"][]; + emailNotificationTypes?: string[]; + }; + res: MeDetailed; + }; + "i/user-group-invites": { + req: TODO; + res: TODO; + }; + "i/2fa/done": { + req: TODO; + res: TODO; + }; + "i/2fa/key-done": { + req: TODO; + res: TODO; + }; + "i/2fa/password-less": { + req: TODO; + res: TODO; + }; + "i/2fa/register-key": { + req: TODO; + res: TODO; + }; + "i/2fa/register": { + req: TODO; + res: TODO; + }; + "i/2fa/update-key": { + req: TODO; + res: TODO; + }; + "i/2fa/remove-key": { + req: TODO; + res: TODO; + }; + "i/2fa/unregister": { + req: TODO; + res: TODO; + }; + "messaging/history": { + req: { + limit?: number; + group?: boolean; + }; + res: MessagingMessage[]; + }; + "messaging/messages": { + req: { + userId?: User["id"]; + groupId?: UserGroup["id"]; + limit?: number; + sinceId?: MessagingMessage["id"]; + untilId?: MessagingMessage["id"]; + markAsRead?: boolean; + }; + res: MessagingMessage[]; + }; + "messaging/messages/create": { + req: { + userId?: User["id"]; + groupId?: UserGroup["id"]; + text?: string; + fileId?: DriveFile["id"]; + }; + res: MessagingMessage; + }; + "messaging/messages/delete": { + req: { + messageId: MessagingMessage["id"]; + }; + res: null; + }; + "messaging/messages/read": { + req: { + messageId: MessagingMessage["id"]; + }; + res: null; + }; + meta: { + req: { + detail?: boolean; + }; + res: { + $switch: { + $cases: [ + [ + { + detail: true; + }, + DetailedInstanceMetadata, + ], + [ + { + detail: false; + }, + LiteInstanceMetadata, + ], + [ + { + detail: boolean; + }, + LiteInstanceMetadata | DetailedInstanceMetadata, + ], + ]; + $default: LiteInstanceMetadata; + }; + }; + }; + "miauth/gen-token": { + req: TODO; + res: TODO; + }; + "mute/create": { + req: TODO; + res: TODO; + }; + "mute/delete": { + req: { + userId: User["id"]; + }; + res: null; + }; + "mute/list": { + req: TODO; + res: TODO; + }; + "renote-mute/create": { + req: TODO; + res: TODO; + }; + "renote-mute/delete": { + req: { + userId: User["id"]; + }; + res: null; + }; + "renote-mute/list": { + req: TODO; + res: TODO; + }; + "my/apps": { + req: TODO; + res: TODO; + }; + notes: { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/children": { + req: { + noteId: Note["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/clips": { + req: TODO; + res: TODO; + }; + "notes/conversation": { + req: TODO; + res: TODO; + }; + "notes/create": { + req: NoteSubmitReq; + res: { + createdNote: Note; + }; + }; + "notes/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/edit": { + req: NoteSubmitReq; + res: { + createdNote: Note; + }; + }; + "notes/favorites/create": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/favorites/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/featured": { + req: TODO; + res: Note[]; + }; + "notes/global-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/recommended-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/hybrid-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/local-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/mentions": { + req: { + following?: boolean; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/polls/recommendation": { + req: TODO; + res: TODO; + }; + "notes/polls/vote": { + req: { + noteId: Note["id"]; + choice: number; + }; + res: null; + }; + "notes/reactions": { + req: { + noteId: Note["id"]; + type?: string | null; + limit?: number; + }; + res: NoteReaction[]; + }; + "notes/reactions/create": { + req: { + noteId: Note["id"]; + reaction: string; + }; + res: null; + }; + "notes/reactions/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/renotes": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + noteId: Note["id"]; + }; + res: Note[]; + }; + "notes/replies": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + noteId: Note["id"]; + }; + res: Note[]; + }; + "notes/search-by-tag": { + req: TODO; + res: TODO; + }; + "notes/search": { + req: TODO; + res: TODO; + }; + "notes/show": { + req: { + noteId: Note["id"]; + }; + res: Note; + }; + "notes/state": { + req: TODO; + res: TODO; + }; + "notes/timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/unrenote": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notes/user-list-timeline": { + req: { + listId: UserList["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/watching/create": { + req: TODO; + res: TODO; + }; + "notes/watching/delete": { + req: { + noteId: Note["id"]; + }; + res: null; + }; + "notifications/create": { + req: { + body: string; + header?: string | null; + icon?: string | null; + }; + res: null; + }; + "notifications/mark-all-as-read": { + req: NoParams; + res: null; + }; + "notifications/read": { + req: { + notificationId: Notification["id"]; + }; + res: null; + }; + "page-push": { + req: { + pageId: Page["id"]; + event: string; + var?: any; + }; + res: null; + }; + "pages/create": { + req: TODO; + res: Page; + }; + "pages/delete": { + req: { + pageId: Page["id"]; + }; + res: null; + }; + "pages/featured": { + req: NoParams; + res: Page[]; + }; + "pages/like": { + req: { + pageId: Page["id"]; + }; + res: null; + }; + "pages/show": { + req: { + pageId?: Page["id"]; + name?: string; + username?: string; + }; + res: Page; + }; + "pages/unlike": { + req: { + pageId: Page["id"]; + }; + res: null; + }; + "pages/update": { + req: TODO; + res: null; + }; + ping: { + req: NoParams; + res: { + pong: number; + }; + }; + "pinned-users": { + req: TODO; + res: TODO; + }; + "promo/read": { + req: TODO; + res: TODO; + }; + "request-reset-password": { + req: { + username: string; + email: string; + }; + res: null; + }; + "reset-password": { + req: { + token: string; + password: string; + }; + res: null; + }; + "room/show": { + req: TODO; + res: TODO; + }; + "room/update": { + req: TODO; + res: TODO; + }; + stats: { + req: NoParams; + res: Stats; + }; + "server-info": { + req: NoParams; + res: ServerInfo; + }; + "latest-version": { + req: NoParams; + res: TODO; + }; + "sw/register": { + req: TODO; + res: TODO; + }; + "username/available": { + req: { + username: string; + }; + res: { + available: boolean; + }; + }; + users: { + req: { + limit?: number; + offset?: number; + sort?: UserSorting; + origin?: OriginType; + }; + res: User[]; + }; + "users/clips": { + req: TODO; + res: TODO; + }; + "users/followers": { + req: { + userId?: User["id"]; + username?: User["username"]; + host?: User["host"] | null; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFollowerPopulated[]; + }; + "users/following": { + req: { + userId?: User["id"]; + username?: User["username"]; + host?: User["host"] | null; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "users/gallery/posts": { + req: TODO; + res: TODO; + }; + "users/get-frequently-replied-users": { + req: TODO; + res: TODO; + }; + "users/groups/create": { + req: TODO; + res: TODO; + }; + "users/groups/delete": { + req: { + groupId: UserGroup["id"]; + }; + res: null; + }; + "users/groups/invitations/accept": { + req: TODO; + res: TODO; + }; + "users/groups/invitations/reject": { + req: TODO; + res: TODO; + }; + "users/groups/invite": { + req: TODO; + res: TODO; + }; + "users/groups/joined": { + req: TODO; + res: TODO; + }; + "users/groups/owned": { + req: TODO; + res: TODO; + }; + "users/groups/pull": { + req: TODO; + res: TODO; + }; + "users/groups/show": { + req: TODO; + res: TODO; + }; + "users/groups/transfer": { + req: TODO; + res: TODO; + }; + "users/groups/update": { + req: TODO; + res: TODO; + }; + "users/lists/create": { + req: { + name: string; + }; + res: UserList; + }; + "users/lists/delete": { + req: { + listId: UserList["id"]; + }; + res: null; + }; + "users/lists/list": { + req: NoParams; + res: UserList[]; + }; + "users/lists/pull": { + req: { + listId: UserList["id"]; + userId: User["id"]; + }; + res: null; + }; + "users/lists/push": { + req: { + listId: UserList["id"]; + userId: User["id"]; + }; + res: null; + }; + "users/lists/show": { + req: { + listId: UserList["id"]; + }; + res: UserList; + }; + "users/lists/update": { + req: { + listId: UserList["id"]; + name: string; + }; + res: UserList; + }; + "users/notes": { + req: { + userId: User["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "users/pages": { + req: TODO; + res: TODO; + }; + "users/recommendation": { + req: TODO; + res: TODO; + }; + "users/relation": { + req: TODO; + res: TODO; + }; + "users/report-abuse": { + req: TODO; + res: TODO; + }; + "users/search-by-username-and-host": { + req: TODO; + res: TODO; + }; + "users/search": { + req: TODO; + res: TODO; + }; + "users/show": { + req: + | ShowUserReq + | { + userIds: User["id"][]; + }; + res: { + $switch: { + $cases: [ + [ + { + userIds: User["id"][]; + }, + UserDetailed[], + ], + ]; + $default: UserDetailed; + }; + }; + }; + "users/stats": { + req: TODO; + res: TODO; + }; +}; +``` +**References:** [User](./iceshrimp-js.entities.user.md), [Ad](./iceshrimp-js.entities.ad.md), [Announcement](./iceshrimp-js.entities.announcement.md), [Antenna](./iceshrimp-js.entities.antenna.md), [Note](./iceshrimp-js.entities.note.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md), [App](./iceshrimp-js.entities.app.md), [AuthSession](./iceshrimp-js.entities.authsession.md), [Blocking](./iceshrimp-js.entities.blocking.md), [Clip](./iceshrimp-js.entities.clip.md), [DriveFolder](./iceshrimp-js.entities.drivefolder.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [Following](./iceshrimp-js.entities.following.md), [FollowingFolloweePopulated](./iceshrimp-js.entities.followingfolloweepopulated.md), [Instance](./iceshrimp-js.entities.instance.md), [FollowRequest](./iceshrimp-js.entities.followrequest.md), [GalleryPost](./iceshrimp-js.entities.gallerypost.md), [NoteFavorite](./iceshrimp-js.entities.notefavorite.md), [MeDetailed](./iceshrimp-js.entities.medetailed.md), [DateString](./iceshrimp-js.entities.datestring.md), [Signin](./iceshrimp-js.entities.signin.md), [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md), [UserGroup](./iceshrimp-js.entities.usergroup.md), [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md), [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md), [NoteReaction](./iceshrimp-js.entities.notereaction.md), [UserList](./iceshrimp-js.entities.userlist.md), [Page](./iceshrimp-js.entities.page.md), [Stats](./iceshrimp-js.entities.stats.md), [ServerInfo](./iceshrimp-js.entities.serverinfo.md), [UserSorting](./iceshrimp-js.entities.usersorting.md), [OriginType](./iceshrimp-js.entities.origintype.md), [FollowingFollowerPopulated](./iceshrimp-js.entities.followingfollowerpopulated.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.ad.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.ad.md index 90f33766f..e9be33da1 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.ad.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.ad.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Ad](./iceshrimp-js.entities.ad.md) - -## entities.Ad type - -**Signature:** - -```typescript -export declare type Ad = TODO; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Ad](./iceshrimp-js.entities.ad.md) + +## entities.Ad type + +**Signature:** + +```typescript +export declare type Ad = TODO; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.announcement.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.announcement.md index 45955f150..47063daa4 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.announcement.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.announcement.md @@ -1,21 +1,21 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Announcement](./iceshrimp-js.entities.announcement.md) - -## entities.Announcement type - -**Signature:** - -```typescript -export declare type Announcement = { - id: ID; - createdAt: DateString; - updatedAt: DateString | null; - text: string; - title: string; - imageUrl: string | null; - isRead?: boolean; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Announcement](./iceshrimp-js.entities.announcement.md) + +## entities.Announcement type + +**Signature:** + +```typescript +export declare type Announcement = { + id: ID; + createdAt: DateString; + updatedAt: DateString | null; + text: string; + title: string; + imageUrl: string | null; + isRead?: boolean; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.antenna.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.antenna.md index efca14868..18bc2ff63 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.antenna.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.antenna.md @@ -1,29 +1,29 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Antenna](./iceshrimp-js.entities.antenna.md) - -## entities.Antenna type - -**Signature:** - -```typescript -export declare type Antenna = { - id: ID; - createdAt: DateString; - name: string; - keywords: string[][]; - excludeKeywords: string[][]; - src: "home" | "all" | "users" | "list" | "group" | "instances"; - userListId: ID | null; - userGroupId: ID | null; - users: string[]; - instances: string[]; - caseSensitive: boolean; - notify: boolean; - withReplies: boolean; - withFile: boolean; - hasUnreadNote: boolean; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Antenna](./iceshrimp-js.entities.antenna.md) + +## entities.Antenna type + +**Signature:** + +```typescript +export declare type Antenna = { + id: ID; + createdAt: DateString; + name: string; + keywords: string[][]; + excludeKeywords: string[][]; + src: "home" | "all" | "users" | "list" | "group" | "instances"; + userListId: ID | null; + userGroupId: ID | null; + users: string[]; + instances: string[]; + caseSensitive: boolean; + notify: boolean; + withReplies: boolean; + withFile: boolean; + hasUnreadNote: boolean; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.app.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.app.md index 8b44abea0..8374d4b8b 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.app.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.app.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [App](./iceshrimp-js.entities.app.md) - -## entities.App type - -**Signature:** - -```typescript -export declare type App = TODO; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [App](./iceshrimp-js.entities.app.md) + +## entities.App type + +**Signature:** + +```typescript +export declare type App = TODO; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.authsession.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.authsession.md index 3f29a99e5..497a08e83 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.authsession.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.authsession.md @@ -1,17 +1,17 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [AuthSession](./iceshrimp-js.entities.authsession.md) - -## entities.AuthSession type - -**Signature:** - -```typescript -export declare type AuthSession = { - id: ID; - app: App; - token: string; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [App](./iceshrimp-js.entities.app.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [AuthSession](./iceshrimp-js.entities.authsession.md) + +## entities.AuthSession type + +**Signature:** + +```typescript +export declare type AuthSession = { + id: ID; + app: App; + token: string; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [App](./iceshrimp-js.entities.app.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.blocking.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.blocking.md index 23e5dd1e2..18bb17e5a 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.blocking.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.blocking.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Blocking](./iceshrimp-js.entities.blocking.md) - -## entities.Blocking type - -**Signature:** - -```typescript -export declare type Blocking = { - id: ID; - createdAt: DateString; - blockeeId: User["id"]; - blockee: UserDetailed; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Blocking](./iceshrimp-js.entities.blocking.md) + +## entities.Blocking type + +**Signature:** + +```typescript +export declare type Blocking = { + id: ID; + createdAt: DateString; + blockeeId: User["id"]; + blockee: UserDetailed; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.channel.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.channel.md index 2684b1aa5..956aef7eb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.channel.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.channel.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Channel](./iceshrimp-js.entities.channel.md) - -## entities.Channel type - -**Signature:** - -```typescript -export declare type Channel = { - id: ID; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Channel](./iceshrimp-js.entities.channel.md) + +## entities.Channel type + +**Signature:** + +```typescript +export declare type Channel = { + id: ID; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.clip.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.clip.md index b4d1aa3e7..521c27862 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.clip.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.clip.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Clip](./iceshrimp-js.entities.clip.md) - -## entities.Clip type - -**Signature:** - -```typescript -export declare type Clip = TODO; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Clip](./iceshrimp-js.entities.clip.md) + +## entities.Clip type + +**Signature:** + +```typescript +export declare type Clip = TODO; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.customemoji.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.customemoji.md index 694d795ef..bfaa96191 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.customemoji.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.customemoji.md @@ -1,17 +1,17 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [CustomEmoji](./iceshrimp-js.entities.customemoji.md) - -## entities.CustomEmoji type - -**Signature:** - -```typescript -export declare type CustomEmoji = { - id: string; - name: string; - url: string; - category: string; - aliases: string[]; -}; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [CustomEmoji](./iceshrimp-js.entities.customemoji.md) + +## entities.CustomEmoji type + +**Signature:** + +```typescript +export declare type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.datestring.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.datestring.md index b254c8724..881a90be0 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.datestring.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.datestring.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DateString](./iceshrimp-js.entities.datestring.md) - -## entities.DateString type - -**Signature:** - -```typescript -export declare type DateString = string; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DateString](./iceshrimp-js.entities.datestring.md) + +## entities.DateString type + +**Signature:** + +```typescript +export declare type DateString = string; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.detailedinstancemetadata.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.detailedinstancemetadata.md index 71e9ef668..9c215eb90 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.detailedinstancemetadata.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.detailedinstancemetadata.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md) - -## entities.DetailedInstanceMetadata type - -**Signature:** - -```typescript -export declare type DetailedInstanceMetadata = LiteInstanceMetadata & { - features: Record; -}; -``` -**References:** [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md) + +## entities.DetailedInstanceMetadata type + +**Signature:** + +```typescript +export declare type DetailedInstanceMetadata = LiteInstanceMetadata & { + features: Record; +}; +``` +**References:** [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefile.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefile.md index cc178c9a6..426c7f775 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefile.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefile.md @@ -1,26 +1,26 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DriveFile](./iceshrimp-js.entities.drivefile.md) - -## entities.DriveFile type - -**Signature:** - -```typescript -export declare type DriveFile = { - id: ID; - createdAt: DateString; - isSensitive: boolean; - name: string; - thumbnailUrl: string; - url: string; - type: string; - size: number; - md5: string; - blurhash: string; - comment: string | null; - properties: Record; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DriveFile](./iceshrimp-js.entities.drivefile.md) + +## entities.DriveFile type + +**Signature:** + +```typescript +export declare type DriveFile = { + id: ID; + createdAt: DateString; + isSensitive: boolean; + name: string; + thumbnailUrl: string; + url: string; + type: string; + size: number; + md5: string; + blurhash: string; + comment: string | null; + properties: Record; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefolder.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefolder.md index 463d6ef01..72ccae0ed 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefolder.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.drivefolder.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DriveFolder](./iceshrimp-js.entities.drivefolder.md) - -## entities.DriveFolder type - -**Signature:** - -```typescript -export declare type DriveFolder = TODO; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [DriveFolder](./iceshrimp-js.entities.drivefolder.md) + +## entities.DriveFolder type + +**Signature:** + +```typescript +export declare type DriveFolder = TODO; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.following.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.following.md index bd2ac4a12..9cb789e45 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.following.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.following.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Following](./iceshrimp-js.entities.following.md) - -## entities.Following type - -**Signature:** - -```typescript -export declare type Following = { - id: ID; - createdAt: DateString; - followerId: User["id"]; - followeeId: User["id"]; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Following](./iceshrimp-js.entities.following.md) + +## entities.Following type + +**Signature:** + +```typescript +export declare type Following = { + id: ID; + createdAt: DateString; + followerId: User["id"]; + followeeId: User["id"]; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfolloweepopulated.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfolloweepopulated.md index 2d63204f0..15d559aa7 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfolloweepopulated.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfolloweepopulated.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [FollowingFolloweePopulated](./iceshrimp-js.entities.followingfolloweepopulated.md) - -## entities.FollowingFolloweePopulated type - -**Signature:** - -```typescript -export declare type FollowingFolloweePopulated = Following & { - followee: UserDetailed; -}; -``` -**References:** [Following](./iceshrimp-js.entities.following.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [FollowingFolloweePopulated](./iceshrimp-js.entities.followingfolloweepopulated.md) + +## entities.FollowingFolloweePopulated type + +**Signature:** + +```typescript +export declare type FollowingFolloweePopulated = Following & { + followee: UserDetailed; +}; +``` +**References:** [Following](./iceshrimp-js.entities.following.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfollowerpopulated.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfollowerpopulated.md index 560d1a594..4c9aca8eb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfollowerpopulated.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followingfollowerpopulated.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [FollowingFollowerPopulated](./iceshrimp-js.entities.followingfollowerpopulated.md) - -## entities.FollowingFollowerPopulated type - -**Signature:** - -```typescript -export declare type FollowingFollowerPopulated = Following & { - follower: UserDetailed; -}; -``` -**References:** [Following](./iceshrimp-js.entities.following.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [FollowingFollowerPopulated](./iceshrimp-js.entities.followingfollowerpopulated.md) + +## entities.FollowingFollowerPopulated type + +**Signature:** + +```typescript +export declare type FollowingFollowerPopulated = Following & { + follower: UserDetailed; +}; +``` +**References:** [Following](./iceshrimp-js.entities.following.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followrequest.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followrequest.md index 6db9b6472..97b698449 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followrequest.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.followrequest.md @@ -1,17 +1,17 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [FollowRequest](./iceshrimp-js.entities.followrequest.md) - -## entities.FollowRequest type - -**Signature:** - -```typescript -export declare type FollowRequest = { - id: ID; - follower: User; - followee: User; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [User](./iceshrimp-js.entities.user.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [FollowRequest](./iceshrimp-js.entities.followrequest.md) + +## entities.FollowRequest type + +**Signature:** + +```typescript +export declare type FollowRequest = { + id: ID; + follower: User; + followee: User; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [User](./iceshrimp-js.entities.user.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.gallerypost.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.gallerypost.md index ac291160b..b384458c4 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.gallerypost.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.gallerypost.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [GalleryPost](./iceshrimp-js.entities.gallerypost.md) - -## entities.GalleryPost type - -**Signature:** - -```typescript -export declare type GalleryPost = TODO; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [GalleryPost](./iceshrimp-js.entities.gallerypost.md) + +## entities.GalleryPost type + +**Signature:** + +```typescript +export declare type GalleryPost = TODO; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.id.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.id.md index 4f47084b6..262252bc6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.id.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.id.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [ID](./iceshrimp-js.entities.id.md) - -## entities.ID type - -**Signature:** - -```typescript -export declare type ID = string; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [ID](./iceshrimp-js.entities.id.md) + +## entities.ID type + +**Signature:** + +```typescript +export declare type ID = string; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instance.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instance.md index e8a2777cd..312596727 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instance.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instance.md @@ -1,40 +1,40 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Instance](./iceshrimp-js.entities.instance.md) - -## entities.Instance type - -**Signature:** - -```typescript -export declare type Instance = { - id: ID; - caughtAt: DateString; - host: string; - usersCount: number; - notesCount: number; - followingCount: number; - followersCount: number; - driveUsage: number; - driveFiles: number; - latestRequestSentAt: DateString | null; - latestStatus: number | null; - latestRequestReceivedAt: DateString | null; - lastCommunicatedAt: DateString; - isNotResponding: boolean; - isSuspended: boolean; - softwareName: string | null; - softwareVersion: string | null; - openRegistrations: boolean | null; - name: string | null; - description: string | null; - maintainerName: string | null; - maintainerEmail: string | null; - iconUrl: string | null; - faviconUrl: string | null; - themeColor: string | null; - infoUpdatedAt: DateString | null; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Instance](./iceshrimp-js.entities.instance.md) + +## entities.Instance type + +**Signature:** + +```typescript +export declare type Instance = { + id: ID; + caughtAt: DateString; + host: string; + usersCount: number; + notesCount: number; + followingCount: number; + followersCount: number; + driveUsage: number; + driveFiles: number; + latestRequestSentAt: DateString | null; + latestStatus: number | null; + latestRequestReceivedAt: DateString | null; + lastCommunicatedAt: DateString; + isNotResponding: boolean; + isSuspended: boolean; + softwareName: string | null; + softwareVersion: string | null; + openRegistrations: boolean | null; + name: string | null; + description: string | null; + maintainerName: string | null; + maintainerEmail: string | null; + iconUrl: string | null; + faviconUrl: string | null; + themeColor: string | null; + infoUpdatedAt: DateString | null; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instancemetadata.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instancemetadata.md index 4bfd8edf5..0c2e5222b 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instancemetadata.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.instancemetadata.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [InstanceMetadata](./iceshrimp-js.entities.instancemetadata.md) - -## entities.InstanceMetadata type - -**Signature:** - -```typescript -export declare type InstanceMetadata = - | LiteInstanceMetadata - | DetailedInstanceMetadata; -``` -**References:** [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md), [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [InstanceMetadata](./iceshrimp-js.entities.instancemetadata.md) + +## entities.InstanceMetadata type + +**Signature:** + +```typescript +export declare type InstanceMetadata = + | LiteInstanceMetadata + | DetailedInstanceMetadata; +``` +**References:** [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md), [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.liteinstancemetadata.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.liteinstancemetadata.md index 1de40d686..e2a6b74a9 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.liteinstancemetadata.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.liteinstancemetadata.md @@ -1,45 +1,45 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md) - -## entities.LiteInstanceMetadata type - -**Signature:** - -```typescript -export declare type LiteInstanceMetadata = { - maintainerName: string | null; - maintainerEmail: string | null; - version: string; - name: string | null; - uri: string; - description: string | null; - tosUrl: string | null; - disableRegistration: boolean; - disableLocalTimeline: boolean; - disableRecommendedTimeline: boolean; - disableGlobalTimeline: boolean; - driveCapacityPerLocalUserMb: number; - driveCapacityPerRemoteUserMb: number; - enableHcaptcha: boolean; - hcaptchaSiteKey: string | null; - enableRecaptcha: boolean; - recaptchaSiteKey: string | null; - swPublickey: string | null; - maxNoteTextLength: number; - enableEmail: boolean; - enableGithubIntegration: boolean; - enableDiscordIntegration: boolean; - enableServiceWorker: boolean; - emojis: CustomEmoji[]; - ads: { - id: ID; - ratio: number; - place: string; - url: string; - imageUrl: string; - }[]; -}; -``` -**References:** [CustomEmoji](./iceshrimp-js.entities.customemoji.md), [ID](./iceshrimp-js.entities.id.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md) + +## entities.LiteInstanceMetadata type + +**Signature:** + +```typescript +export declare type LiteInstanceMetadata = { + maintainerName: string | null; + maintainerEmail: string | null; + version: string; + name: string | null; + uri: string; + description: string | null; + tosUrl: string | null; + disableRegistration: boolean; + disableLocalTimeline: boolean; + disableRecommendedTimeline: boolean; + disableGlobalTimeline: boolean; + driveCapacityPerLocalUserMb: number; + driveCapacityPerRemoteUserMb: number; + enableHcaptcha: boolean; + hcaptchaSiteKey: string | null; + enableRecaptcha: boolean; + recaptchaSiteKey: string | null; + swPublickey: string | null; + maxNoteTextLength: number; + enableEmail: boolean; + enableGithubIntegration: boolean; + enableDiscordIntegration: boolean; + enableServiceWorker: boolean; + emojis: CustomEmoji[]; + ads: { + id: ID; + ratio: number; + place: string; + url: string; + imageUrl: string; + }[]; +}; +``` +**References:** [CustomEmoji](./iceshrimp-js.entities.customemoji.md), [ID](./iceshrimp-js.entities.id.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.md index 72644503d..0e63fd4f7 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.md @@ -1,51 +1,51 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) - -## entities namespace - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [Ad](./iceshrimp-js.entities.ad.md) | | -| [Announcement](./iceshrimp-js.entities.announcement.md) | | -| [Antenna](./iceshrimp-js.entities.antenna.md) | | -| [App](./iceshrimp-js.entities.app.md) | | -| [AuthSession](./iceshrimp-js.entities.authsession.md) | | -| [Blocking](./iceshrimp-js.entities.blocking.md) | | -| [Channel](./iceshrimp-js.entities.channel.md) | | -| [Clip](./iceshrimp-js.entities.clip.md) | | -| [CustomEmoji](./iceshrimp-js.entities.customemoji.md) | | -| [DateString](./iceshrimp-js.entities.datestring.md) | | -| [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md) | | -| [DriveFile](./iceshrimp-js.entities.drivefile.md) | | -| [DriveFolder](./iceshrimp-js.entities.drivefolder.md) | | -| [Following](./iceshrimp-js.entities.following.md) | | -| [FollowingFolloweePopulated](./iceshrimp-js.entities.followingfolloweepopulated.md) | | -| [FollowingFollowerPopulated](./iceshrimp-js.entities.followingfollowerpopulated.md) | | -| [FollowRequest](./iceshrimp-js.entities.followrequest.md) | | -| [GalleryPost](./iceshrimp-js.entities.gallerypost.md) | | -| [ID](./iceshrimp-js.entities.id.md) | | -| [Instance](./iceshrimp-js.entities.instance.md) | | -| [InstanceMetadata](./iceshrimp-js.entities.instancemetadata.md) | | -| [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md) | | -| [MeDetailed](./iceshrimp-js.entities.medetailed.md) | | -| [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md) | | -| [Note](./iceshrimp-js.entities.note.md) | | -| [NoteFavorite](./iceshrimp-js.entities.notefavorite.md) | | -| [NoteReaction](./iceshrimp-js.entities.notereaction.md) | | -| [Notification](./iceshrimp-js.entities.notification.md) | | -| [OriginType](./iceshrimp-js.entities.origintype.md) | | -| [Page](./iceshrimp-js.entities.page.md) | | -| [PageEvent](./iceshrimp-js.entities.pageevent.md) | | -| [ServerInfo](./iceshrimp-js.entities.serverinfo.md) | | -| [Signin](./iceshrimp-js.entities.signin.md) | | -| [Stats](./iceshrimp-js.entities.stats.md) | | -| [User](./iceshrimp-js.entities.user.md) | | -| [UserDetailed](./iceshrimp-js.entities.userdetailed.md) | | -| [UserGroup](./iceshrimp-js.entities.usergroup.md) | | -| [UserList](./iceshrimp-js.entities.userlist.md) | | -| [UserLite](./iceshrimp-js.entities.userlite.md) | | -| [UserSorting](./iceshrimp-js.entities.usersorting.md) | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) + +## entities namespace + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [Ad](./iceshrimp-js.entities.ad.md) | | +| [Announcement](./iceshrimp-js.entities.announcement.md) | | +| [Antenna](./iceshrimp-js.entities.antenna.md) | | +| [App](./iceshrimp-js.entities.app.md) | | +| [AuthSession](./iceshrimp-js.entities.authsession.md) | | +| [Blocking](./iceshrimp-js.entities.blocking.md) | | +| [Channel](./iceshrimp-js.entities.channel.md) | | +| [Clip](./iceshrimp-js.entities.clip.md) | | +| [CustomEmoji](./iceshrimp-js.entities.customemoji.md) | | +| [DateString](./iceshrimp-js.entities.datestring.md) | | +| [DetailedInstanceMetadata](./iceshrimp-js.entities.detailedinstancemetadata.md) | | +| [DriveFile](./iceshrimp-js.entities.drivefile.md) | | +| [DriveFolder](./iceshrimp-js.entities.drivefolder.md) | | +| [Following](./iceshrimp-js.entities.following.md) | | +| [FollowingFolloweePopulated](./iceshrimp-js.entities.followingfolloweepopulated.md) | | +| [FollowingFollowerPopulated](./iceshrimp-js.entities.followingfollowerpopulated.md) | | +| [FollowRequest](./iceshrimp-js.entities.followrequest.md) | | +| [GalleryPost](./iceshrimp-js.entities.gallerypost.md) | | +| [ID](./iceshrimp-js.entities.id.md) | | +| [Instance](./iceshrimp-js.entities.instance.md) | | +| [InstanceMetadata](./iceshrimp-js.entities.instancemetadata.md) | | +| [LiteInstanceMetadata](./iceshrimp-js.entities.liteinstancemetadata.md) | | +| [MeDetailed](./iceshrimp-js.entities.medetailed.md) | | +| [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md) | | +| [Note](./iceshrimp-js.entities.note.md) | | +| [NoteFavorite](./iceshrimp-js.entities.notefavorite.md) | | +| [NoteReaction](./iceshrimp-js.entities.notereaction.md) | | +| [Notification](./iceshrimp-js.entities.notification.md) | | +| [OriginType](./iceshrimp-js.entities.origintype.md) | | +| [Page](./iceshrimp-js.entities.page.md) | | +| [PageEvent](./iceshrimp-js.entities.pageevent.md) | | +| [ServerInfo](./iceshrimp-js.entities.serverinfo.md) | | +| [Signin](./iceshrimp-js.entities.signin.md) | | +| [Stats](./iceshrimp-js.entities.stats.md) | | +| [User](./iceshrimp-js.entities.user.md) | | +| [UserDetailed](./iceshrimp-js.entities.userdetailed.md) | | +| [UserGroup](./iceshrimp-js.entities.usergroup.md) | | +| [UserList](./iceshrimp-js.entities.userlist.md) | | +| [UserLite](./iceshrimp-js.entities.userlite.md) | | +| [UserSorting](./iceshrimp-js.entities.usersorting.md) | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.medetailed.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.medetailed.md index c6e439bce..87f9762d5 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.medetailed.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.medetailed.md @@ -1,40 +1,40 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [MeDetailed](./iceshrimp-js.entities.medetailed.md) - -## entities.MeDetailed type - -**Signature:** - -```typescript -export declare type MeDetailed = UserDetailed & { - avatarId: DriveFile["id"]; - bannerId: DriveFile["id"]; - autoAcceptFollowed: boolean; - alwaysMarkNsfw: boolean; - carefulBot: boolean; - emailNotificationTypes: string[]; - hasPendingReceivedFollowRequest: boolean; - hasUnreadAnnouncement: boolean; - hasUnreadAntenna: boolean; - hasUnreadChannel: boolean; - hasUnreadMentions: boolean; - hasUnreadMessagingMessage: boolean; - hasUnreadNotification: boolean; - hasUnreadSpecifiedNotes: boolean; - hideOnlineStatus: boolean; - injectFeaturedNote: boolean; - integrations: Record; - isDeleted: boolean; - isExplorable: boolean; - mutedWords: string[][]; - mutingNotificationTypes: string[]; - noCrawle: boolean; - preventAiLearning: boolean; - receiveAnnouncementEmail: boolean; - usePasswordLessLogin: boolean; - [other: string]: any; -}; -``` -**References:** [UserDetailed](./iceshrimp-js.entities.userdetailed.md), [DriveFile](./iceshrimp-js.entities.drivefile.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [MeDetailed](./iceshrimp-js.entities.medetailed.md) + +## entities.MeDetailed type + +**Signature:** + +```typescript +export declare type MeDetailed = UserDetailed & { + avatarId: DriveFile["id"]; + bannerId: DriveFile["id"]; + autoAcceptFollowed: boolean; + alwaysMarkNsfw: boolean; + carefulBot: boolean; + emailNotificationTypes: string[]; + hasPendingReceivedFollowRequest: boolean; + hasUnreadAnnouncement: boolean; + hasUnreadAntenna: boolean; + hasUnreadChannel: boolean; + hasUnreadMentions: boolean; + hasUnreadMessagingMessage: boolean; + hasUnreadNotification: boolean; + hasUnreadSpecifiedNotes: boolean; + hideOnlineStatus: boolean; + injectFeaturedNote: boolean; + integrations: Record; + isDeleted: boolean; + isExplorable: boolean; + mutedWords: string[][]; + mutingNotificationTypes: string[]; + noCrawle: boolean; + preventAiLearning: boolean; + receiveAnnouncementEmail: boolean; + usePasswordLessLogin: boolean; + [other: string]: any; +}; +``` +**References:** [UserDetailed](./iceshrimp-js.entities.userdetailed.md), [DriveFile](./iceshrimp-js.entities.drivefile.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.messagingmessage.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.messagingmessage.md index 4131282ed..948c630ae 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.messagingmessage.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.messagingmessage.md @@ -1,27 +1,27 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md) - -## entities.MessagingMessage type - -**Signature:** - -```typescript -export declare type MessagingMessage = { - id: ID; - createdAt: DateString; - file: DriveFile | null; - fileId: DriveFile["id"] | null; - isRead: boolean; - reads: User["id"][]; - text: string | null; - user: User; - userId: User["id"]; - recipient?: User | null; - recipientId: User["id"] | null; - group?: UserGroup | null; - groupId: UserGroup["id"] | null; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [User](./iceshrimp-js.entities.user.md), [UserGroup](./iceshrimp-js.entities.usergroup.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [MessagingMessage](./iceshrimp-js.entities.messagingmessage.md) + +## entities.MessagingMessage type + +**Signature:** + +```typescript +export declare type MessagingMessage = { + id: ID; + createdAt: DateString; + file: DriveFile | null; + fileId: DriveFile["id"] | null; + isRead: boolean; + reads: User["id"][]; + text: string | null; + user: User; + userId: User["id"]; + recipient?: User | null; + recipientId: User["id"] | null; + group?: UserGroup | null; + groupId: UserGroup["id"] | null; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [User](./iceshrimp-js.entities.user.md), [UserGroup](./iceshrimp-js.entities.usergroup.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.note.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.note.md index 6f88da476..8cefb402f 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.note.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.note.md @@ -1,51 +1,51 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Note](./iceshrimp-js.entities.note.md) - -## entities.Note type - -**Signature:** - -```typescript -export declare type Note = { - id: ID; - createdAt: DateString; - text: string | null; - cw: string | null; - user: User; - userId: User["id"]; - reply?: Note; - replyId: Note["id"]; - renote?: Note; - renoteId: Note["id"]; - files: DriveFile[]; - fileIds: DriveFile["id"][]; - visibility: "public" | "home" | "followers" | "specified"; - visibleUserIds?: User["id"][]; - localOnly?: boolean; - channel?: Channel["id"]; - myReaction?: string; - reactions: Record; - renoteCount: number; - repliesCount: number; - poll?: { - expiresAt: DateString | null; - multiple: boolean; - choices: { - isVoted: boolean; - text: string; - votes: number; - }[]; - }; - emojis: { - name: string; - url: string; - }[]; - uri?: string; - url?: string; - updatedAt?: DateString; - isHidden?: boolean; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [Note](./iceshrimp-js.entities.note.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [Channel](./iceshrimp-js.entities.channel.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Note](./iceshrimp-js.entities.note.md) + +## entities.Note type + +**Signature:** + +```typescript +export declare type Note = { + id: ID; + createdAt: DateString; + text: string | null; + cw: string | null; + user: User; + userId: User["id"]; + reply?: Note; + replyId: Note["id"]; + renote?: Note; + renoteId: Note["id"]; + files: DriveFile[]; + fileIds: DriveFile["id"][]; + visibility: "public" | "home" | "followers" | "specified"; + visibleUserIds?: User["id"][]; + localOnly?: boolean; + channel?: Channel["id"]; + myReaction?: string; + reactions: Record; + renoteCount: number; + repliesCount: number; + poll?: { + expiresAt: DateString | null; + multiple: boolean; + choices: { + isVoted: boolean; + text: string; + votes: number; + }[]; + }; + emojis: { + name: string; + url: string; + }[]; + uri?: string; + url?: string; + updatedAt?: DateString; + isHidden?: boolean; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [Note](./iceshrimp-js.entities.note.md), [DriveFile](./iceshrimp-js.entities.drivefile.md), [Channel](./iceshrimp-js.entities.channel.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notefavorite.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notefavorite.md index c77067008..f700a7630 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notefavorite.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notefavorite.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [NoteFavorite](./iceshrimp-js.entities.notefavorite.md) - -## entities.NoteFavorite type - -**Signature:** - -```typescript -export declare type NoteFavorite = { - id: ID; - createdAt: DateString; - noteId: Note["id"]; - note: Note; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [Note](./iceshrimp-js.entities.note.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [NoteFavorite](./iceshrimp-js.entities.notefavorite.md) + +## entities.NoteFavorite type + +**Signature:** + +```typescript +export declare type NoteFavorite = { + id: ID; + createdAt: DateString; + noteId: Note["id"]; + note: Note; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [Note](./iceshrimp-js.entities.note.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notereaction.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notereaction.md index 1e265014d..979dc40cb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notereaction.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notereaction.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [NoteReaction](./iceshrimp-js.entities.notereaction.md) - -## entities.NoteReaction type - -**Signature:** - -```typescript -export declare type NoteReaction = { - id: ID; - createdAt: DateString; - user: UserLite; - type: string; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [UserLite](./iceshrimp-js.entities.userlite.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [NoteReaction](./iceshrimp-js.entities.notereaction.md) + +## entities.NoteReaction type + +**Signature:** + +```typescript +export declare type NoteReaction = { + id: ID; + createdAt: DateString; + user: UserLite; + type: string; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [UserLite](./iceshrimp-js.entities.userlite.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notification.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notification.md index 5622fff51..85e2bb25c 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notification.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.notification.md @@ -1,82 +1,82 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Notification](./iceshrimp-js.entities.notification.md) - -## entities.Notification type - -**Signature:** - -```typescript -export declare type Notification = { - id: ID; - createdAt: DateString; - isRead: boolean; -} & ( - | { - type: "reaction"; - reaction: string; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "reply"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "renote"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "quote"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "mention"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "pollVote"; - user: User; - userId: User["id"]; - note: Note; - } - | { - type: "follow"; - user: User; - userId: User["id"]; - } - | { - type: "followRequestAccepted"; - user: User; - userId: User["id"]; - } - | { - type: "receiveFollowRequest"; - user: User; - userId: User["id"]; - } - | { - type: "groupInvited"; - invitation: UserGroup; - user: User; - userId: User["id"]; - } - | { - type: "app"; - header?: string | null; - body: string; - icon?: string | null; - } -); -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [Note](./iceshrimp-js.entities.note.md), [UserGroup](./iceshrimp-js.entities.usergroup.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Notification](./iceshrimp-js.entities.notification.md) + +## entities.Notification type + +**Signature:** + +```typescript +export declare type Notification = { + id: ID; + createdAt: DateString; + isRead: boolean; +} & ( + | { + type: "reaction"; + reaction: string; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "reply"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "renote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "quote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "mention"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "pollVote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "follow"; + user: User; + userId: User["id"]; + } + | { + type: "followRequestAccepted"; + user: User; + userId: User["id"]; + } + | { + type: "receiveFollowRequest"; + user: User; + userId: User["id"]; + } + | { + type: "groupInvited"; + invitation: UserGroup; + user: User; + userId: User["id"]; + } + | { + type: "app"; + header?: string | null; + body: string; + icon?: string | null; + } +); +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [Note](./iceshrimp-js.entities.note.md), [UserGroup](./iceshrimp-js.entities.usergroup.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.origintype.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.origintype.md index de4a42efa..651a0a910 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.origintype.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.origintype.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [OriginType](./iceshrimp-js.entities.origintype.md) - -## entities.OriginType type - -**Signature:** - -```typescript -export declare type OriginType = "combined" | "local" | "remote"; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [OriginType](./iceshrimp-js.entities.origintype.md) + +## entities.OriginType type + +**Signature:** + +```typescript +export declare type OriginType = "combined" | "local" | "remote"; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.page.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.page.md index 3812a809b..2e43a55c2 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.page.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.page.md @@ -1,33 +1,33 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Page](./iceshrimp-js.entities.page.md) - -## entities.Page type - -**Signature:** - -```typescript -export declare type Page = { - id: ID; - createdAt: DateString; - updatedAt: DateString; - userId: User["id"]; - user: User; - content: Record[]; - variables: Record[]; - title: string; - name: string; - summary: string | null; - hideTitleWhenPinned: boolean; - alignCenter: boolean; - font: string; - script: string; - eyeCatchingImageId: DriveFile["id"] | null; - eyeCatchingImage: DriveFile | null; - attachedFiles: any; - likedCount: number; - isLiked?: boolean; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [DriveFile](./iceshrimp-js.entities.drivefile.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Page](./iceshrimp-js.entities.page.md) + +## entities.Page type + +**Signature:** + +```typescript +export declare type Page = { + id: ID; + createdAt: DateString; + updatedAt: DateString; + userId: User["id"]; + user: User; + content: Record[]; + variables: Record[]; + title: string; + name: string; + summary: string | null; + hideTitleWhenPinned: boolean; + alignCenter: boolean; + font: string; + script: string; + eyeCatchingImageId: DriveFile["id"] | null; + eyeCatchingImage: DriveFile | null; + attachedFiles: any; + likedCount: number; + isLiked?: boolean; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md), [DriveFile](./iceshrimp-js.entities.drivefile.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.pageevent.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.pageevent.md index 6783ea963..3e3eecb41 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.pageevent.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.pageevent.md @@ -1,19 +1,19 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [PageEvent](./iceshrimp-js.entities.pageevent.md) - -## entities.PageEvent type - -**Signature:** - -```typescript -export declare type PageEvent = { - pageId: Page["id"]; - event: string; - var: any; - userId: User["id"]; - user: User; -}; -``` -**References:** [Page](./iceshrimp-js.entities.page.md), [User](./iceshrimp-js.entities.user.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [PageEvent](./iceshrimp-js.entities.pageevent.md) + +## entities.PageEvent type + +**Signature:** + +```typescript +export declare type PageEvent = { + pageId: Page["id"]; + event: string; + var: any; + userId: User["id"]; + user: User; +}; +``` +**References:** [Page](./iceshrimp-js.entities.page.md), [User](./iceshrimp-js.entities.user.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.serverinfo.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.serverinfo.md index 920ed21a7..080b21d6a 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.serverinfo.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.serverinfo.md @@ -1,24 +1,24 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [ServerInfo](./iceshrimp-js.entities.serverinfo.md) - -## entities.ServerInfo type - -**Signature:** - -```typescript -export declare type ServerInfo = { - machine: string; - cpu: { - model: string; - cores: number; - }; - mem: { - total: number; - }; - fs: { - total: number; - used: number; - }; -}; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [ServerInfo](./iceshrimp-js.entities.serverinfo.md) + +## entities.ServerInfo type + +**Signature:** + +```typescript +export declare type ServerInfo = { + machine: string; + cpu: { + model: string; + cores: number; + }; + mem: { + total: number; + }; + fs: { + total: number; + used: number; + }; +}; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.signin.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.signin.md index c84c96724..88dac7aa6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.signin.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.signin.md @@ -1,19 +1,19 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Signin](./iceshrimp-js.entities.signin.md) - -## entities.Signin type - -**Signature:** - -```typescript -export declare type Signin = { - id: ID; - createdAt: DateString; - ip: string; - headers: Record; - success: boolean; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Signin](./iceshrimp-js.entities.signin.md) + +## entities.Signin type + +**Signature:** + +```typescript +export declare type Signin = { + id: ID; + createdAt: DateString; + ip: string; + headers: Record; + success: boolean; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.stats.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.stats.md index 0271958c2..cf83560d6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.stats.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.stats.md @@ -1,19 +1,19 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Stats](./iceshrimp-js.entities.stats.md) - -## entities.Stats type - -**Signature:** - -```typescript -export declare type Stats = { - notesCount: number; - originalNotesCount: number; - usersCount: number; - originalUsersCount: number; - instances: number; - driveUsageLocal: number; - driveUsageRemote: number; -}; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [Stats](./iceshrimp-js.entities.stats.md) + +## entities.Stats type + +**Signature:** + +```typescript +export declare type Stats = { + notesCount: number; + originalNotesCount: number; + usersCount: number; + originalUsersCount: number; + instances: number; + driveUsageLocal: number; + driveUsageRemote: number; +}; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.user.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.user.md index 1ce654b2c..2e8d71436 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.user.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.user.md @@ -1,13 +1,13 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [User](./iceshrimp-js.entities.user.md) - -## entities.User type - -**Signature:** - -```typescript -export declare type User = UserLite | UserDetailed; -``` -**References:** [UserLite](./iceshrimp-js.entities.userlite.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [User](./iceshrimp-js.entities.user.md) + +## entities.User type + +**Signature:** + +```typescript +export declare type User = UserLite | UserDetailed; +``` +**References:** [UserLite](./iceshrimp-js.entities.userlite.md), [UserDetailed](./iceshrimp-js.entities.userdetailed.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userdetailed.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userdetailed.md index c4a9d73b5..3f5cd57d3 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userdetailed.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userdetailed.md @@ -1,56 +1,56 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserDetailed](./iceshrimp-js.entities.userdetailed.md) - -## entities.UserDetailed type - -**Signature:** - -```typescript -export declare type UserDetailed = UserLite & { - bannerBlurhash: string | null; - bannerColor: string | null; - bannerUrl: string | null; - birthday: string | null; - createdAt: DateString; - description: string | null; - ffVisibility: "public" | "followers" | "private"; - fields: { - name: string; - value: string; - }[]; - followersCount: number; - followingCount: number; - hasPendingFollowRequestFromYou: boolean; - hasPendingFollowRequestToYou: boolean; - isAdmin: boolean; - isBlocked: boolean; - isBlocking: boolean; - isBot: boolean; - isCat: boolean; - isFollowed: boolean; - isFollowing: boolean; - isLocked: boolean; - isModerator: boolean; - isMuted: boolean; - isRenoteMuted: boolean; - isSilenced: boolean; - isSuspended: boolean; - lang: string | null; - lastFetchedAt?: DateString; - location: string | null; - notesCount: number; - pinnedNoteIds: ID[]; - pinnedNotes: Note[]; - pinnedPage: Page | null; - pinnedPageId: string | null; - publicReactions: boolean; - securityKeys: boolean; - twoFactorEnabled: boolean; - updatedAt: DateString | null; - uri: string | null; - url: string | null; -}; -``` -**References:** [UserLite](./iceshrimp-js.entities.userlite.md), [DateString](./iceshrimp-js.entities.datestring.md), [ID](./iceshrimp-js.entities.id.md), [Note](./iceshrimp-js.entities.note.md), [Page](./iceshrimp-js.entities.page.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserDetailed](./iceshrimp-js.entities.userdetailed.md) + +## entities.UserDetailed type + +**Signature:** + +```typescript +export declare type UserDetailed = UserLite & { + bannerBlurhash: string | null; + bannerColor: string | null; + bannerUrl: string | null; + birthday: string | null; + createdAt: DateString; + description: string | null; + ffVisibility: "public" | "followers" | "private"; + fields: { + name: string; + value: string; + }[]; + followersCount: number; + followingCount: number; + hasPendingFollowRequestFromYou: boolean; + hasPendingFollowRequestToYou: boolean; + isAdmin: boolean; + isBlocked: boolean; + isBlocking: boolean; + isBot: boolean; + isCat: boolean; + isFollowed: boolean; + isFollowing: boolean; + isLocked: boolean; + isModerator: boolean; + isMuted: boolean; + isRenoteMuted: boolean; + isSilenced: boolean; + isSuspended: boolean; + lang: string | null; + lastFetchedAt?: DateString; + location: string | null; + notesCount: number; + pinnedNoteIds: ID[]; + pinnedNotes: Note[]; + pinnedPage: Page | null; + pinnedPageId: string | null; + publicReactions: boolean; + securityKeys: boolean; + twoFactorEnabled: boolean; + updatedAt: DateString | null; + uri: string | null; + url: string | null; +}; +``` +**References:** [UserLite](./iceshrimp-js.entities.userlite.md), [DateString](./iceshrimp-js.entities.datestring.md), [ID](./iceshrimp-js.entities.id.md), [Note](./iceshrimp-js.entities.note.md), [Page](./iceshrimp-js.entities.page.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usergroup.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usergroup.md index 8346ac177..40fca33fb 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usergroup.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usergroup.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserGroup](./iceshrimp-js.entities.usergroup.md) - -## entities.UserGroup type - -**Signature:** - -```typescript -export declare type UserGroup = TODO; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserGroup](./iceshrimp-js.entities.usergroup.md) + +## entities.UserGroup type + +**Signature:** + +```typescript +export declare type UserGroup = TODO; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlist.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlist.md index 1a9101093..e92535cc0 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlist.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlist.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserList](./iceshrimp-js.entities.userlist.md) - -## entities.UserList type - -**Signature:** - -```typescript -export declare type UserList = { - id: ID; - createdAt: DateString; - name: string; - userIds: User["id"][]; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserList](./iceshrimp-js.entities.userlist.md) + +## entities.UserList type + +**Signature:** + +```typescript +export declare type UserList = { + id: ID; + createdAt: DateString; + name: string; + userIds: User["id"][]; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [DateString](./iceshrimp-js.entities.datestring.md), [User](./iceshrimp-js.entities.user.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlite.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlite.md index faf95156c..530c1470e 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlite.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.userlite.md @@ -1,35 +1,35 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserLite](./iceshrimp-js.entities.userlite.md) - -## entities.UserLite type - -**Signature:** - -```typescript -export declare type UserLite = { - id: ID; - username: string; - host: string | null; - name: string; - onlineStatus: "online" | "active" | "offline" | "unknown"; - avatarUrl: string; - avatarBlurhash: string; - alsoKnownAs: string[]; - movedToUri: any; - emojis: { - name: string; - url: string; - }[]; - instance?: { - name: Instance["name"]; - softwareName: Instance["softwareName"]; - softwareVersion: Instance["softwareVersion"]; - iconUrl: Instance["iconUrl"]; - faviconUrl: Instance["faviconUrl"]; - themeColor: Instance["themeColor"]; - }; -}; -``` -**References:** [ID](./iceshrimp-js.entities.id.md), [Instance](./iceshrimp-js.entities.instance.md) - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserLite](./iceshrimp-js.entities.userlite.md) + +## entities.UserLite type + +**Signature:** + +```typescript +export declare type UserLite = { + id: ID; + username: string; + host: string | null; + name: string; + onlineStatus: "online" | "active" | "offline" | "unknown"; + avatarUrl: string; + avatarBlurhash: string; + alsoKnownAs: string[]; + movedToUri: any; + emojis: { + name: string; + url: string; + }[]; + instance?: { + name: Instance["name"]; + softwareName: Instance["softwareName"]; + softwareVersion: Instance["softwareVersion"]; + iconUrl: Instance["iconUrl"]; + faviconUrl: Instance["faviconUrl"]; + themeColor: Instance["themeColor"]; + }; +}; +``` +**References:** [ID](./iceshrimp-js.entities.id.md), [Instance](./iceshrimp-js.entities.instance.md) + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usersorting.md b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usersorting.md index a27992795..3a25a9cb6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usersorting.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.entities.usersorting.md @@ -1,17 +1,17 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserSorting](./iceshrimp-js.entities.usersorting.md) - -## entities.UserSorting type - -**Signature:** - -```typescript -export declare type UserSorting = - | "+follower" - | "-follower" - | "+createdAt" - | "-createdAt" - | "+updatedAt" - | "-updatedAt"; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [entities](./iceshrimp-js.entities.md) > [UserSorting](./iceshrimp-js.entities.usersorting.md) + +## entities.UserSorting type + +**Signature:** + +```typescript +export declare type UserSorting = + | "+follower" + | "-follower" + | "+createdAt" + | "-createdAt" + | "+updatedAt" + | "-updatedAt"; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.ffvisibility.md b/packages/iceshrimp-js/markdown/iceshrimp-js.ffvisibility.md index 107e4c8bc..a94955b0d 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.ffvisibility.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.ffvisibility.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ffVisibility](./iceshrimp-js.ffvisibility.md) - -## ffVisibility variable - -**Signature:** - -```typescript -ffVisibility: readonly ["public", "followers", "private"] -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [ffVisibility](./iceshrimp-js.ffvisibility.md) + +## ffVisibility variable + +**Signature:** + +```typescript +ffVisibility: readonly ["public", "followers", "private"] +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.md b/packages/iceshrimp-js/markdown/iceshrimp-js.md index c77b3104c..9da2a0140 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.md @@ -1,42 +1,42 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) - -## iceshrimp-js package - -## Classes - -| Class | Description | -| --- | --- | -| [Stream](./iceshrimp-js.stream.md) | | - -## Abstract Classes - -| Abstract Class | Description | -| --- | --- | -| [ChannelConnection](./iceshrimp-js.channelconnection.md) | | - -## Namespaces - -| Namespace | Description | -| --- | --- | -| [api](./iceshrimp-js.api.md) | | -| [entities](./iceshrimp-js.entities.md) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [ffVisibility](./iceshrimp-js.ffvisibility.md) | | -| [noteVisibilities](./iceshrimp-js.notevisibilities.md) | | -| [notificationTypes](./iceshrimp-js.notificationtypes.md) | | -| [permissions](./iceshrimp-js.permissions.md) | | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [Acct](./iceshrimp-js.acct.md) | | -| [Channels](./iceshrimp-js.channels.md) | | -| [Endpoints](./iceshrimp-js.endpoints.md) | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) + +## iceshrimp-js package + +## Classes + +| Class | Description | +| --- | --- | +| [Stream](./iceshrimp-js.stream.md) | | + +## Abstract Classes + +| Abstract Class | Description | +| --- | --- | +| [ChannelConnection](./iceshrimp-js.channelconnection.md) | | + +## Namespaces + +| Namespace | Description | +| --- | --- | +| [api](./iceshrimp-js.api.md) | | +| [entities](./iceshrimp-js.entities.md) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [ffVisibility](./iceshrimp-js.ffvisibility.md) | | +| [noteVisibilities](./iceshrimp-js.notevisibilities.md) | | +| [notificationTypes](./iceshrimp-js.notificationtypes.md) | | +| [permissions](./iceshrimp-js.permissions.md) | | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [Acct](./iceshrimp-js.acct.md) | | +| [Channels](./iceshrimp-js.channels.md) | | +| [Endpoints](./iceshrimp-js.endpoints.md) | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.mutednotereasons.md b/packages/iceshrimp-js/markdown/iceshrimp-js.mutednotereasons.md index 977fbfbcf..3b9b5db0b 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.mutednotereasons.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.mutednotereasons.md @@ -1,16 +1,16 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [mutedNoteReasons](./iceshrimp-js.mutednotereasons.md) - -## mutedNoteReasons variable - -**Signature:** - -```typescript -mutedNoteReasons: readonly [ - "word", - "manual", - "spam", - "other", -] -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [mutedNoteReasons](./iceshrimp-js.mutednotereasons.md) + +## mutedNoteReasons variable + +**Signature:** + +```typescript +mutedNoteReasons: readonly [ + "word", + "manual", + "spam", + "other", +] +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.notevisibilities.md b/packages/iceshrimp-js/markdown/iceshrimp-js.notevisibilities.md index 6e69e4ce1..073a35bb4 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.notevisibilities.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.notevisibilities.md @@ -1,16 +1,16 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [noteVisibilities](./iceshrimp-js.notevisibilities.md) - -## noteVisibilities variable - -**Signature:** - -```typescript -noteVisibilities: readonly [ - "public", - "home", - "followers", - "specified", -] -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [noteVisibilities](./iceshrimp-js.notevisibilities.md) + +## noteVisibilities variable + +**Signature:** + +```typescript +noteVisibilities: readonly [ + "public", + "home", + "followers", + "specified", +] +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.notificationtypes.md b/packages/iceshrimp-js/markdown/iceshrimp-js.notificationtypes.md index 855649f7c..eca70f206 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.notificationtypes.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.notificationtypes.md @@ -1,24 +1,24 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [notificationTypes](./iceshrimp-js.notificationtypes.md) - -## notificationTypes variable - -**Signature:** - -```typescript -notificationTypes: readonly [ - "follow", - "mention", - "reply", - "renote", - "quote", - "reaction", - "pollVote", - "pollEnded", - "receiveFollowRequest", - "followRequestAccepted", - "groupInvited", - "app", -] -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [notificationTypes](./iceshrimp-js.notificationtypes.md) + +## notificationTypes variable + +**Signature:** + +```typescript +notificationTypes: readonly [ + "follow", + "mention", + "reply", + "renote", + "quote", + "reaction", + "pollVote", + "pollEnded", + "receiveFollowRequest", + "followRequestAccepted", + "groupInvited", + "app", +] +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.permissions.md b/packages/iceshrimp-js/markdown/iceshrimp-js.permissions.md index cdca7f071..366b9f5f8 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.permissions.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.permissions.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [permissions](./iceshrimp-js.permissions.md) - -## permissions variable - -**Signature:** - -```typescript -permissions: string[] -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [permissions](./iceshrimp-js.permissions.md) + +## permissions variable + +**Signature:** + +```typescript +permissions: string[] +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream._constructor_.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream._constructor_.md index fbe9bf8f8..6846b1350 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream._constructor_.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream._constructor_.md @@ -1,30 +1,30 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [(constructor)](./iceshrimp-js.stream._constructor_.md) - -## Stream.(constructor) - -Constructs a new instance of the `Stream` class - -**Signature:** - -```typescript -constructor( - origin: string, - user: { - token: string; - } | null, - options?: { - WebSocket?: any; - }, - ); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| origin | string | | -| user | { token: string; } \| null | | -| options | { WebSocket?: any; } | _(Optional)_ | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [(constructor)](./iceshrimp-js.stream._constructor_.md) + +## Stream.(constructor) + +Constructs a new instance of the `Stream` class + +**Signature:** + +```typescript +constructor( + origin: string, + user: { + token: string; + } | null, + options?: { + WebSocket?: any; + }, + ); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| origin | string | | +| user | { token: string; } \| null | | +| options | { WebSocket?: any; } | _(Optional)_ | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.close.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.close.md index 28c6666fb..d89aa9ef6 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.close.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.close.md @@ -1,15 +1,15 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [close](./iceshrimp-js.stream.close.md) - -## Stream.close() method - -**Signature:** - -```typescript -close(): void; -``` -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [close](./iceshrimp-js.stream.close.md) + +## Stream.close() method + +**Signature:** + +```typescript +close(): void; +``` +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.disconnecttochannel.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.disconnecttochannel.md index 181c1bedd..c7a91f762 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.disconnecttochannel.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.disconnecttochannel.md @@ -1,22 +1,22 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [disconnectToChannel](./iceshrimp-js.stream.disconnecttochannel.md) - -## Stream.disconnectToChannel() method - -**Signature:** - -```typescript -disconnectToChannel(connection: NonSharedConnection): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| connection | NonSharedConnection | | - -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [disconnectToChannel](./iceshrimp-js.stream.disconnecttochannel.md) + +## Stream.disconnectToChannel() method + +**Signature:** + +```typescript +disconnectToChannel(connection: NonSharedConnection): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| connection | NonSharedConnection | | + +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.md index df8c67ba1..66edd9d5d 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.md @@ -1,36 +1,36 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) - -## Stream class - -**Signature:** - -```typescript -export default class Stream extends EventEmitter -``` -**Extends:** EventEmitter<StreamEvents> - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(origin, user, options)](./iceshrimp-js.stream._constructor_.md) | | Constructs a new instance of the Stream class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [state](./iceshrimp-js.stream.state.md) | | "initializing" \| "reconnecting" \| "connected" | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [close()](./iceshrimp-js.stream.close.md) | | | -| [disconnectToChannel(connection)](./iceshrimp-js.stream.disconnecttochannel.md) | | | -| [removeSharedConnection(connection)](./iceshrimp-js.stream.removesharedconnection.md) | | | -| [removeSharedConnectionPool(pool)](./iceshrimp-js.stream.removesharedconnectionpool.md) | | | -| [send(typeOrPayload, payload)](./iceshrimp-js.stream.send.md) | | | -| [useChannel(channel, params, name)](./iceshrimp-js.stream.usechannel.md) | | | - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) + +## Stream class + +**Signature:** + +```typescript +export default class Stream extends EventEmitter +``` +**Extends:** EventEmitter<StreamEvents> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(origin, user, options)](./iceshrimp-js.stream._constructor_.md) | | Constructs a new instance of the Stream class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [state](./iceshrimp-js.stream.state.md) | | "initializing" \| "reconnecting" \| "connected" | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [close()](./iceshrimp-js.stream.close.md) | | | +| [disconnectToChannel(connection)](./iceshrimp-js.stream.disconnecttochannel.md) | | | +| [removeSharedConnection(connection)](./iceshrimp-js.stream.removesharedconnection.md) | | | +| [removeSharedConnectionPool(pool)](./iceshrimp-js.stream.removesharedconnectionpool.md) | | | +| [send(typeOrPayload, payload)](./iceshrimp-js.stream.send.md) | | | +| [useChannel(channel, params, name)](./iceshrimp-js.stream.usechannel.md) | | | + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnection.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnection.md index cad996647..75341f973 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnection.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnection.md @@ -1,22 +1,22 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [removeSharedConnection](./iceshrimp-js.stream.removesharedconnection.md) - -## Stream.removeSharedConnection() method - -**Signature:** - -```typescript -removeSharedConnection(connection: SharedConnection): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| connection | SharedConnection | | - -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [removeSharedConnection](./iceshrimp-js.stream.removesharedconnection.md) + +## Stream.removeSharedConnection() method + +**Signature:** + +```typescript +removeSharedConnection(connection: SharedConnection): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| connection | SharedConnection | | + +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnectionpool.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnectionpool.md index 70482b1d4..9d992ac47 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnectionpool.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.removesharedconnectionpool.md @@ -1,22 +1,22 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [removeSharedConnectionPool](./iceshrimp-js.stream.removesharedconnectionpool.md) - -## Stream.removeSharedConnectionPool() method - -**Signature:** - -```typescript -removeSharedConnectionPool(pool: Pool): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| pool | Pool | | - -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [removeSharedConnectionPool](./iceshrimp-js.stream.removesharedconnectionpool.md) + +## Stream.removeSharedConnectionPool() method + +**Signature:** + +```typescript +removeSharedConnectionPool(pool: Pool): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| pool | Pool | | + +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.send.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.send.md index c8b0a1313..1c49469fc 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.send.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.send.md @@ -1,23 +1,23 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [send](./iceshrimp-js.stream.send.md) - -## Stream.send() method - -**Signature:** - -```typescript -send(typeOrPayload: any, payload?: any): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| typeOrPayload | any | | -| payload | any | _(Optional)_ | - -**Returns:** - -void - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [send](./iceshrimp-js.stream.send.md) + +## Stream.send() method + +**Signature:** + +```typescript +send(typeOrPayload: any, payload?: any): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| typeOrPayload | any | | +| payload | any | _(Optional)_ | + +**Returns:** + +void + diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.state.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.state.md index a3d9f688f..af173b6f1 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.state.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.state.md @@ -1,11 +1,11 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [state](./iceshrimp-js.stream.state.md) - -## Stream.state property - -**Signature:** - -```typescript -state: "initializing" | "reconnecting" | "connected"; -``` + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [state](./iceshrimp-js.stream.state.md) + +## Stream.state property + +**Signature:** + +```typescript +state: "initializing" | "reconnecting" | "connected"; +``` diff --git a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.usechannel.md b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.usechannel.md index 5ad71a779..1f5c41703 100644 --- a/packages/iceshrimp-js/markdown/iceshrimp-js.stream.usechannel.md +++ b/packages/iceshrimp-js/markdown/iceshrimp-js.stream.usechannel.md @@ -1,28 +1,28 @@ - - -[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [useChannel](./iceshrimp-js.stream.usechannel.md) - -## Stream.useChannel() method - -**Signature:** - -```typescript -useChannel( - channel: C, - params?: Channels[C]["params"], - name?: string, - ): Connection; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| channel | C | | -| params | [Channels](./iceshrimp-js.channels.md)\[C\]\["params"\] | _(Optional)_ | -| name | string | _(Optional)_ | - -**Returns:** - -[Connection](./iceshrimp-js.channelconnection.md)<[Channels](./iceshrimp-js.channels.md)\[C\]> - + + +[Home](./index.md) > [iceshrimp-js](./iceshrimp-js.md) > [Stream](./iceshrimp-js.stream.md) > [useChannel](./iceshrimp-js.stream.usechannel.md) + +## Stream.useChannel() method + +**Signature:** + +```typescript +useChannel( + channel: C, + params?: Channels[C]["params"], + name?: string, + ): Connection; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| channel | C | | +| params | [Channels](./iceshrimp-js.channels.md)\[C\]\["params"\] | _(Optional)_ | +| name | string | _(Optional)_ | + +**Returns:** + +[Connection](./iceshrimp-js.channelconnection.md)<[Channels](./iceshrimp-js.channels.md)\[C\]> + diff --git a/packages/iceshrimp-js/markdown/index.md b/packages/iceshrimp-js/markdown/index.md index 4d7abc94e..20defc5c9 100644 --- a/packages/iceshrimp-js/markdown/index.md +++ b/packages/iceshrimp-js/markdown/index.md @@ -1,12 +1,12 @@ - - -[Home](./index.md) - -## API Reference - -## Packages - -| Package | Description | -| --- | --- | -| [iceshrimp-js](./iceshrimp-js.md) | | - + + +[Home](./index.md) + +## API Reference + +## Packages + +| Package | Description | +| --- | --- | +| [iceshrimp-js](./iceshrimp-js.md) | | +