diff --git a/Cargo.lock b/Cargo.lock index 80a67c430c..66692a3d3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1819,9 +1819,9 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" [[package]] name = "napi-derive" -version = "2.16.5" +version = "3.0.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" +checksum = "c230c813bfd4d6c7aafead3c075b37f0cf7fecb38be8f4cf5cfcee0b2c273ad0" dependencies = [ "cfg-if", "convert_case", @@ -1833,9 +1833,9 @@ dependencies = [ [[package]] name = "napi-derive-backend" -version = "1.0.67" +version = "2.0.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" +checksum = "4370cc24c2e58d0f3393527b282eb00f1158b304248f549e1ec81bd2927db5fe" dependencies = [ "convert_case", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 35ec449e46..52520b57b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ macros = { path = "packages/macro-rs/macros" } macros-impl = { path = "packages/macro-rs/macros-impl" } napi = { git = "https://github.com/napi-rs/napi-rs.git", rev = "ca2cd5c35a0c39ec4a94e93c6c5695b681046df2" } -napi-derive = "2.16.5" +napi-derive = "3.0.0-alpha.1" napi-build = "2.1.3" argon2 = { version = "0.5.3", default-features = false } diff --git a/packages/backend-rs/Makefile b/packages/backend-rs/Makefile index abe6045801..57d5c66b1c 100644 --- a/packages/backend-rs/Makefile +++ b/packages/backend-rs/Makefile @@ -32,4 +32,3 @@ index.js index.d.ts: $(SRC) rm --force index.js index.d.ts cp built/index.js index.js cp built/index.d.ts index.d.ts - sed -i 's/^ \*r"/ */g' index.d.ts diff --git a/packages/backend-rs/index.d.ts b/packages/backend-rs/index.d.ts index 00381d8b4d..b7ea7eb784 100644 --- a/packages/backend-rs/index.d.ts +++ b/packages/backend-rs/index.d.ts @@ -1,159 +1,211 @@ -/* tslint:disable */ -/* eslint-disable */ - /* auto-generated by NAPI-RS */ +/* eslint-disable */ +export interface AbuseUserReport { + id: string + createdAt: DateTimeWithTimeZone + targetUserId: string + reporterId: string + assigneeId: string | null + resolved: boolean + comment: string + targetUserHost: string | null + reporterHost: string | null + forwarded: boolean +} -export const SECOND: number -export const MINUTE: number -export const HOUR: number -export const DAY: number -export const USER_ONLINE_THRESHOLD: number -export const USER_ACTIVE_THRESHOLD: number -/** - * List of file types allowed to be viewed directly in the browser - * - * Anything not included here will be responded as application/octet-stream - * SVG is not allowed because it generates XSS (TODO: fix this and later allow it to be viewed directly) - * * - * * - * * - */ -export const FILE_TYPE_BROWSERSAFE: string[] -export function fetchMeta(): Promise -export function updateMetaCache(): Promise -export interface PugArgs { - img: string | null - title: string - instanceName: string - desc: string | null - icon: string | null - splashIcon: string | null - themeColor: string | null - randomMotd: string - privateMode: boolean | null +export interface AbuseUserReportLike { + id: string + targetUserId: string + reporterId: string + comment: string } -export function metaToPugArgs(meta: Meta): PugArgs -export interface ServerConfig { + +export interface AccessToken { + id: string + createdAt: DateTimeWithTimeZone + token: string + hash: string + userId: string + appId: string | null + lastUsedAt: DateTimeWithTimeZone | null + session: string | null + name: string | null + description: string | null + iconUrl: string | null + permission: Array + fetched: boolean +} + +export interface Acct { + username: string + host: string | null +} + +export function acctToString(acct: Acct): string + +export interface Ad { + id: string + createdAt: DateTimeWithTimeZone + expiresAt: DateTimeWithTimeZone + place: string + priority: string url: string - port: number - /** the host address to bind to */ - bind?: string - disableHsts?: boolean - /** PostgreSQL configurations */ - db: DbConfig - /** Redis configurations */ - redis: RedisConfig - /** secondary Redis server configurations */ - cacheServer?: RedisConfig - /** proxy host used for HTTP requests */ - proxy?: string - /** proxy host used for SMTP requests */ - proxySmtp?: string - /** hosts to bypass the proxy */ - proxyBypassHosts?: Array - allowedPrivateNetworks?: Array - /** maximum file size that can be uploaded to the drive (in bytes) */ - maxFileSize?: number - accessLog?: string - clusterLimits?: WorkerConfigInternal - cuid?: IdConfig - outgoingAddress?: string - deliverJobConcurrency?: number - inboxJobConcurrency?: number - deliverJobPerSec?: number - inboxJobPerSec?: number - deliverJobMaxAttempts?: number - inboxJobMaxAttempts?: number - /** deprecated in favor of `max_log_level` */ - logLevel?: Array - /** verbosity of the server log. `error`, `warn`, `info`, `debug`, or `trace` */ - maxLogLevel?: string - syslog?: SysLogConfig - proxyRemoteFiles?: boolean - mediaProxy?: string - summalyProxyUrl?: string - reservedUsernames?: Array - maxUserSignups?: number - isManagedHosting?: boolean - maxNoteLength?: number - maxCaptionLength?: number - deepl?: DeepLConfig - libreTranslate?: LibreTranslateConfig - email?: EmailConfig - objectStorage?: ObjectStorageConfig + imageUrl: string + memo: string + ratio: number } -export interface DbConfig { - host: string - port: number - db: string - user: string - pass: string - disableCache?: boolean - extra?: any + +export interface Announcement { + id: string + createdAt: DateTimeWithTimeZone + text: string + title: string + imageUrl: string | null + updatedAt: DateTimeWithTimeZone | null + showPopup: boolean + isGoodNews: boolean } -export interface RedisConfig { - host: string - port: number - family?: number - user?: string - pass?: string - tls?: TlsConfig - db: number - prefix?: string + +export interface AnnouncementRead { + id: string + userId: string + announcementId: string + createdAt: DateTimeWithTimeZone } -export interface TlsConfig { - host: string - rejectUnauthorized: boolean + +export interface Antenna { + id: string + createdAt: DateTimeWithTimeZone + userId: string + name: string + src: AntennaSrc + userListId: string | null + withFile: boolean + expression: string | null + notify: boolean + caseSensitive: boolean + withReplies: boolean + userGroupJoiningId: string | null + users: Array + instances: Array + keywords: Array + excludeKeywords: Array } -export interface WorkerConfig { - web: number - queue: number + +export enum AntennaSrc { + All = 'all', + Group = 'group', + Home = 'home', + Instances = 'instances', + List = 'list', + Users = 'users' } -export interface WorkerConfigInternal { - web?: number - queue?: number + +export interface App { + id: string + createdAt: DateTimeWithTimeZone + userId: string | null + secret: string + name: string + description: string + permission: Array + callbackUrl: string | null } -export interface IdConfig { - length?: number - fingerprint?: string + +export interface AttestationChallenge { + id: string + userId: string + challenge: string + createdAt: DateTimeWithTimeZone + registrationChallenge: boolean } -export interface SysLogConfig { - host: string - port: number + +export interface AuthSession { + id: string + createdAt: DateTimeWithTimeZone + token: string + userId: string | null + appId: string } -export interface DeepLConfig { - managed?: boolean - authKey?: string - isPro?: boolean + +export interface Blocking { + id: string + createdAt: DateTimeWithTimeZone + blockeeId: string + blockerId: string } -export interface LibreTranslateConfig { - managed?: boolean - apiUrl?: string - apiKey?: string + +export interface Channel { + id: string + createdAt: DateTimeWithTimeZone + lastNotedAt: DateTimeWithTimeZone | null + userId: string | null + name: string + description: string | null + bannerId: string | null + notesCount: number + usersCount: number } -export interface EmailConfig { - managed?: boolean - address?: string - host?: string - port?: number - user?: string - pass?: string - useImplicitSslTls?: boolean + +export interface ChannelFollowing { + id: string + createdAt: DateTimeWithTimeZone + followeeId: string + followerId: string } -export interface ObjectStorageConfig { - managed?: boolean - baseUrl?: string - bucket?: string - prefix?: string - endpoint?: string - region?: string - accessKey?: string - secretKey?: string - useSsl?: boolean - connnectOverProxy?: boolean - setPublicReadOnUpload?: boolean - s3ForcePathStyle?: boolean + +export interface ChannelNotePining { + id: string + createdAt: DateTimeWithTimeZone + channelId: string + noteId: string } + +export enum ChatEvent { + Message = 0, + Read = 1, + Deleted = 2, + Typing = 3 +} + +export enum ChatIndexEvent { + Message = 0, + Read = 1 +} + +/** + * Returns whether `note` should be hard-muted. + * + * More specifically, this function returns `Ok(true)` + * if and only if one or more of these conditions are met: + * + * * the note (text or CW) contains any of the words/patterns + * * the "parent" note(s) (reply, quote) contain any of the words/patterns + * * the alt text of the attached files contains any of the words/patterns + * + * # Arguments + * + * * `note` : [PartialNoteToCheckWordMute] object + * * `muted_words` : list of muted keyword lists (each array item is a space-separated keyword list that represents an AND condition) + * * `muted_patterns` : list of JavaScript-style (e.g., `/foo/i`) regular expressions + */ +export function checkWordMute(note: PartialNoteToCheckWordMute, mutedWords: Array, mutedPatterns: Array): Promise + +export interface Clip { + id: string + createdAt: DateTimeWithTimeZone + userId: string + name: string + isPublic: boolean + description: string | null +} + +export interface ClipNote { + id: string + noteId: string + clipId: string +} + export interface Config { url: string port: number @@ -205,423 +257,44 @@ export interface Config { driveUrl: string userAgent: string } -export function loadConfig(): Config -export interface Acct { - username: string - host: string | null + +export function countReactions(reactions: Record): Record + +export interface Cpu { + model: string + cores: number } -export function stringToAcct(acct: string): Acct -export function acctToString(acct: Acct): string -/** Fetches and returns the NodeInfo (version 2.0) of a remote server. */ -export function fetchNodeinfo(host: string): Promise -export function nodeinfo_2_1(): Promise -export function nodeinfo_2_0(): Promise -export function updateNodeinfoCache(): Promise -/** NodeInfo schema version 2.0. */ -export interface Nodeinfo { - /** The schema version, must be 2.0. */ - version: string - /** Metadata about server software in use. */ - software: Software20 - /** The protocols supported on this server. */ - protocols: Array - /** The third party sites this server can connect to via their application API. */ - services: Services - /** Whether this server allows open self-registration. */ - openRegistrations: boolean - /** Usage statistics for this server. */ - usage: Usage - /** Free form key value pairs for software specific values. Clients should not rely on any specific key present. */ - metadata: Record + +export function cpuInfo(): Cpu + +export function cpuUsage(): number + +export const DAY: number + +export interface DbConfig { + host: string + port: number + db: string + user: string + pass: string + disableCache?: boolean + extra?: any } -/** Metadata about server software in use (version 2.0). */ -export interface Software20 { - /** The canonical name of this server software. */ - name: string - /** The version of this server software. */ - version: string -} -export enum Protocol { - Activitypub = 0, - Buddycloud = 1, - Dfrn = 2, - Diaspora = 3, - Libertree = 4, - Ostatus = 5, - Pumpio = 6, - Tent = 7, - Xmpp = 8, - Zot = 9 -} -/** The third party sites this server can connect to via their application API. */ -export interface Services { - /** The third party sites this server can retrieve messages from for combined display with regular traffic. */ - inbound: Array - /** The third party sites this server can publish messages to on the behalf of a user. */ - outbound: Array -} -/** The third party sites this server can retrieve messages from for combined display with regular traffic. */ -export enum Inbound { - Atom1 = 0, - Gnusocial = 1, - Imap = 2, - Pnut = 3, - Pop3 = 4, - Pumpio = 5, - Rss2 = 6, - Twitter = 7 -} -/** The third party sites this server can publish messages to on the behalf of a user. */ -export enum Outbound { - Atom1 = 0, - Blogger = 1, - Buddycloud = 2, - Diaspora = 3, - Dreamwidth = 4, - Drupal = 5, - Facebook = 6, - Friendica = 7, - Gnusocial = 8, - Google = 9, - Insanejournal = 10, - Libertree = 11, - Linkedin = 12, - Livejournal = 13, - Mediagoblin = 14, - Myspace = 15, - Pinterest = 16, - Pnut = 17, - Posterous = 18, - Pumpio = 19, - Redmatrix = 20, - Rss2 = 21, - Smtp = 22, - Tent = 23, - Tumblr = 24, - Twitter = 25, - Wordpress = 26, - Xmpp = 27 -} -/** Usage statistics for this server. */ -export interface Usage { - users: Users - localPosts: number | null - localComments: number | null -} -/** statistics about the users of this server. */ -export interface Users { - total: number | null - activeHalfyear: number | null - activeMonth: number | null -} -/** Prints the greeting message and the Firefish version to stdout. */ -export function greet(): void -/** Initializes the [tracing] logger. */ -export function initializeRustLogger(): void -/** Prints the server hardware information as the server info log. */ -export function showServerInfo(): void -/** - * Checks if a server is blocked. - * - * # Argument - * `host` - punycoded instance host - * - * # Example - * ```no_run - * # use backend_rs::misc::check_server_block::is_blocked_server; - * # async fn f() -> Result<(), Box> { - * assert_eq!(true, is_blocked_server("blocked.com").await?); - * assert_eq!(false, is_blocked_server("not-blocked.com").await?); - * assert_eq!(true, is_blocked_server("subdomain.of.blocked.com").await?); - * assert_eq!(true, is_blocked_server("xn--l8jegik.blocked.com").await?); - * # Ok(()) - * # } - * ``` - */ -export function isBlockedServer(host: string): Promise -/** - * Checks if a server is silenced. - * - * # Argument - * `host` - punycoded instance host - * - * # Example - * ```no_run - * # use backend_rs::misc::check_server_block::is_silenced_server; - * # async fn f() -> Result<(), Box> { - * assert_eq!(true, is_silenced_server("silenced.com").await?); - * assert_eq!(false, is_silenced_server("not-silenced.com").await?); - * assert_eq!(true, is_silenced_server("subdomain.of.silenced.com").await?); - * assert_eq!(true, is_silenced_server("xn--l8jegik.silenced.com").await?); - * # Ok(()) - * # } - * ``` - */ -export function isSilencedServer(host: string): Promise -/** - * Checks if a server is allowlisted. - * Returns `Ok(true)` if private mode is disabled. - * - * # Argument - * `host` - punycoded instance host - * - * # Example - * ```no_run - * # use backend_rs::misc::check_server_block::is_allowed_server; - * # async fn f() -> Result<(), Box> { - * assert_eq!(true, is_allowed_server("allowed.com").await?); - * assert_eq!(false, is_allowed_server("not-allowed.com").await?); - * assert_eq!(false, is_allowed_server("subdomain.of.allowed.com").await?); - * assert_eq!(false, is_allowed_server("xn--l8jegik.allowed.com").await?); - * # Ok(()) - * # } - * ``` - */ -export function isAllowedServer(host: string): Promise -export interface PartialNoteToCheckWordMute { - fileIds: Array - text: string | null - cw: string | null - renoteId: string | null - replyId: string | null -} -/** - * Returns whether `note` should be hard-muted. - * - * More specifically, this function returns `Ok(true)` - * if and only if one or more of these conditions are met: - * - * * the note (text or CW) contains any of the words/patterns - * * the "parent" note(s) (reply, quote) contain any of the words/patterns - * * the alt text of the attached files contains any of the words/patterns - * - * # Arguments - * - * * `note` : [PartialNoteToCheckWordMute] object - * * `muted_words` : list of muted keyword lists (each array item is a space-separated keyword list that represents an AND condition) - * * `muted_patterns` : list of JavaScript-style (e.g., `/foo/i`) regular expressions - */ -export function checkWordMute(note: PartialNoteToCheckWordMute, mutedWords: Array, mutedPatterns: Array): Promise -export function getFullApAccount(username: string, host?: string | undefined | null): string -export function isSelfHost(host?: string | undefined | null): boolean -export function isSameOrigin(uri: string): boolean -export function extractHost(uri: string): string -export function toPuny(host: string): string -export function isUnicodeEmoji(s: string): boolean -/** Escapes `%` and `\` in the given string. */ -export function sqlLikeEscape(src: string): string -/** Returns `true` if `src` does not contain suspicious characters like `%`. */ -export function safeForSql(src: string): boolean -/** Converts milliseconds to a human readable string. */ -export function formatMilliseconds(milliseconds: number): string -export interface ImageSize { - width: number - height: number -} -export function getImageSizeFromUrl(url: string): Promise -export function isQuote(note: Note): boolean -export function isSafeUrl(url: string): boolean -/** Returns the latest Firefish version. */ -export function latestVersion(): Promise -export function toMastodonId(firefishId: string): string | null -export function fromMastodonId(mastodonId: string): string | null -export function getNoteSummary(fileIds: Array, text: string | undefined | null, cw: string | undefined | null, hasPoll: boolean): string -/** - * Converts the given text into the cat language. - * - * refs: - * * - * * - * - * # Arguments - * - * * `text` : original text - * * `lang` : language code (e.g., `Some("en")`, `Some("en-US")`, `Some("uk-UA")`, `None`) - * - * # Example - * - * ``` - * # use backend_rs::misc::nyaify::nyaify; - * assert_eq!(nyaify("I'll take a nap.", Some("en")), "I'll take a nyap."); - * ``` - */ -export function nyaify(text: string, lang?: string | undefined | null): string -/** Hashes the given password using [argon2] algorithm. */ -export function hashPassword(password: string): string -/** Checks whether the given password and hash match. */ -export function verifyPassword(password: string, hash: string): boolean -/** Returns whether the [bcrypt] algorithm is used for the password hash. */ -export function isOldPasswordAlgorithm(hash: string): boolean + export interface DecodedReaction { reaction: string name: string | null host: string | null } + export function decodeReaction(reaction: string): DecodedReaction -export function countReactions(reactions: Record): Record -export function toDbReaction(reaction?: string | undefined | null, host?: string | undefined | null): Promise -/** Delete all entries in the [attestation_challenge] table created at more than 5 minutes ago */ -export function removeOldAttestationChallenges(): Promise -export interface Cpu { - model: string - cores: number -} -export interface Memory { - /** Total memory amount in bytes */ - total: number - /** Used memory amount in bytes */ - used: number - /** Available (for (re)use) memory amount in bytes */ - available: number -} -export interface Storage { - /** Total storage space in bytes */ - total: number - /** Used storage space in bytes */ - used: number -} -export function cpuInfo(): Cpu -export function cpuUsage(): number -export function memoryUsage(): Memory -export function storageUsage(): Storage | null -export interface AbuseUserReport { - id: string - createdAt: DateTimeWithTimeZone - targetUserId: string - reporterId: string - assigneeId: string | null - resolved: boolean - comment: string - targetUserHost: string | null - reporterHost: string | null - forwarded: boolean -} -export interface AccessToken { - id: string - createdAt: DateTimeWithTimeZone - token: string - hash: string - userId: string - appId: string | null - lastUsedAt: DateTimeWithTimeZone | null - session: string | null - name: string | null - description: string | null - iconUrl: string | null - permission: Array - fetched: boolean -} -export interface Ad { - id: string - createdAt: DateTimeWithTimeZone - expiresAt: DateTimeWithTimeZone - place: string - priority: string - url: string - imageUrl: string - memo: string - ratio: number -} -export interface Announcement { - id: string - createdAt: DateTimeWithTimeZone - text: string - title: string - imageUrl: string | null - updatedAt: DateTimeWithTimeZone | null - showPopup: boolean - isGoodNews: boolean -} -export interface AnnouncementRead { - id: string - userId: string - announcementId: string - createdAt: DateTimeWithTimeZone -} -export interface Antenna { - id: string - createdAt: DateTimeWithTimeZone - userId: string - name: string - src: AntennaSrc - userListId: string | null - withFile: boolean - expression: string | null - notify: boolean - caseSensitive: boolean - withReplies: boolean - userGroupJoiningId: string | null - users: Array - instances: Array - keywords: Array - excludeKeywords: Array -} -export interface App { - id: string - createdAt: DateTimeWithTimeZone - userId: string | null - secret: string - name: string - description: string - permission: Array - callbackUrl: string | null -} -export interface AttestationChallenge { - id: string - userId: string - challenge: string - createdAt: DateTimeWithTimeZone - registrationChallenge: boolean -} -export interface AuthSession { - id: string - createdAt: DateTimeWithTimeZone - token: string - userId: string | null - appId: string -} -export interface Blocking { - id: string - createdAt: DateTimeWithTimeZone - blockeeId: string - blockerId: string -} -export interface Channel { - id: string - createdAt: DateTimeWithTimeZone - lastNotedAt: DateTimeWithTimeZone | null - userId: string | null - name: string - description: string | null - bannerId: string | null - notesCount: number - usersCount: number -} -export interface ChannelFollowing { - id: string - createdAt: DateTimeWithTimeZone - followeeId: string - followerId: string -} -export interface ChannelNotePining { - id: string - createdAt: DateTimeWithTimeZone - channelId: string - noteId: string -} -export interface Clip { - id: string - createdAt: DateTimeWithTimeZone - userId: string - name: string - isPublic: boolean - description: string | null -} -export interface ClipNote { - id: string - noteId: string - clipId: string + +export interface DeepLConfig { + managed?: boolean + authKey?: string + isPro?: boolean } + export interface DriveFile { id: string createdAt: DateTimeWithTimeZone @@ -651,6 +324,18 @@ export interface DriveFile { requestIp: string | null usageHint: DriveFileUsageHint | null } + +export enum DriveFileEvent { + Create = 0, + Update = 1, + Delete = 2 +} + +export enum DriveFileUsageHint { + UserAvatar = 'userAvatar', + UserBanner = 'userBanner' +} + export interface DriveFolder { id: string createdAt: DateTimeWithTimeZone @@ -658,6 +343,23 @@ export interface DriveFolder { userId: string | null parentId: string | null } + +export enum DriveFolderEvent { + Create = 0, + Update = 1, + Delete = 2 +} + +export interface EmailConfig { + managed?: boolean + address?: string + host?: string + port?: number + user?: string + pass?: string + useImplicitSslTls?: boolean +} + export interface Emoji { id: string updatedAt: DateTimeWithTimeZone | null @@ -673,6 +375,38 @@ export interface Emoji { width: number | null height: number | null } + +export function extractHost(uri: string): string + +export function fetchMeta(): Promise + +/** Fetches and returns the NodeInfo (version 2.0) of a remote server. */ +export function fetchNodeinfo(host: string): Promise + +/** + * List of file types allowed to be viewed directly in the browser + * + * Anything not included here will be responded as application/octet-stream + * SVG is not allowed because it generates XSS (TODO: fix this and later allow it to be viewed directly) + * * + * * + * * + */ +export const FILE_TYPE_BROWSERSAFE: string[] + +export interface Following { + id: string + createdAt: DateTimeWithTimeZone + followeeId: string + followerId: string + followerHost: string | null + followerInbox: string | null + followerSharedInbox: string | null + followeeHost: string | null + followeeInbox: string | null + followeeSharedInbox: string | null +} + export interface FollowRequest { id: string createdAt: DateTimeWithTimeZone @@ -686,24 +420,19 @@ export interface FollowRequest { followeeInbox: string | null followeeSharedInbox: string | null } -export interface Following { - id: string - createdAt: DateTimeWithTimeZone - followeeId: string - followerId: string - followerHost: string | null - followerInbox: string | null - followerSharedInbox: string | null - followeeHost: string | null - followeeInbox: string | null - followeeSharedInbox: string | null -} + +/** Converts milliseconds to a human readable string. */ +export function formatMilliseconds(milliseconds: number): string + +export function fromMastodonId(mastodonId: string): string | null + export interface GalleryLike { id: string createdAt: DateTimeWithTimeZone userId: string postId: string } + export interface GalleryPost { id: string createdAt: DateTimeWithTimeZone @@ -716,6 +445,39 @@ export interface GalleryPost { likedCount: number tags: Array } + +/** Generates a random string based on [thread_rng] and [Alphanumeric]. */ +export function generateSecureRandomString(length: number): string + +export function generateUserToken(): string + +/** + * The generated ID results in the form of `[8 chars timestamp] + [cuid2]`. + * The minimum and maximum lengths are 16 and 24, respectively. + * With the length of 16, namely 8 for cuid2, roughly 1427399 IDs are needed + * in the same millisecond to reach 50% chance of collision. + * + * Ref: + */ +export function genId(): string + +/** Generate an ID using a specific datetime */ +export function genIdAt(date: Date): string + +export function getFullApAccount(username: string, host?: string | undefined | null): string + +export function getImageSizeFromUrl(url: string): Promise + +export function getNoteSummary(fileIds: Array, text: string | undefined | null, cw: string | undefined | null, hasPoll: boolean): string + +export function getTimestamp(id: string): number + +/** Prints the greeting message and the Firefish version to stdout. */ +export function greet(): void + +/** Hashes the given password using [argon2] algorithm. */ +export function hashPassword(password: string): string + export interface Hashtag { id: string name: string @@ -732,6 +494,34 @@ export interface Hashtag { attachedRemoteUserIds: Array attachedRemoteUsersCount: number } + +export const HOUR: number + +export interface IdConfig { + length?: number + fingerprint?: string +} + +export interface ImageSize { + width: number + height: number +} + +/** The third party sites this server can retrieve messages from for combined display with regular traffic. */ +export enum Inbound { + Atom1 = 0, + Gnusocial = 1, + Imap = 2, + Pnut = 3, + Pop3 = 4, + Pumpio = 5, + Rss2 = 6, + Twitter = 7 +} + +/** Initializes the [tracing] logger. */ +export function initializeRustLogger(): void + export interface Instance { id: string caughtAt: DateTimeWithTimeZone @@ -758,6 +548,103 @@ export interface Instance { themeColor: string | null faviconUrl: string | null } + +/** + * Checks if a server is allowlisted. + * Returns `Ok(true)` if private mode is disabled. + * + * # Argument + * `host` - punycoded instance host + * + * # Example + * ```no_run + * # use backend_rs::misc::check_server_block::is_allowed_server; + * # async fn f() -> Result<(), Box> { + * assert_eq!(true, is_allowed_server("allowed.com").await?); + * assert_eq!(false, is_allowed_server("not-allowed.com").await?); + * assert_eq!(false, is_allowed_server("subdomain.of.allowed.com").await?); + * assert_eq!(false, is_allowed_server("xn--l8jegik.allowed.com").await?); + * # Ok(()) + * # } + * ``` + */ +export function isAllowedServer(host: string): Promise + +/** + * Checks if a server is blocked. + * + * # Argument + * `host` - punycoded instance host + * + * # Example + * ```no_run + * # use backend_rs::misc::check_server_block::is_blocked_server; + * # async fn f() -> Result<(), Box> { + * assert_eq!(true, is_blocked_server("blocked.com").await?); + * assert_eq!(false, is_blocked_server("not-blocked.com").await?); + * assert_eq!(true, is_blocked_server("subdomain.of.blocked.com").await?); + * assert_eq!(true, is_blocked_server("xn--l8jegik.blocked.com").await?); + * # Ok(()) + * # } + * ``` + */ +export function isBlockedServer(host: string): Promise + +/** Returns whether the [bcrypt] algorithm is used for the password hash. */ +export function isOldPasswordAlgorithm(hash: string): boolean + +export function isQuote(note: Note): boolean + +export function isSafeUrl(url: string): boolean + +export function isSameOrigin(uri: string): boolean + +export function isSelfHost(host?: string | undefined | null): boolean + +/** + * Checks if a server is silenced. + * + * # Argument + * `host` - punycoded instance host + * + * # Example + * ```no_run + * # use backend_rs::misc::check_server_block::is_silenced_server; + * # async fn f() -> Result<(), Box> { + * assert_eq!(true, is_silenced_server("silenced.com").await?); + * assert_eq!(false, is_silenced_server("not-silenced.com").await?); + * assert_eq!(true, is_silenced_server("subdomain.of.silenced.com").await?); + * assert_eq!(true, is_silenced_server("xn--l8jegik.silenced.com").await?); + * # Ok(()) + * # } + * ``` + */ +export function isSilencedServer(host: string): Promise + +export function isUnicodeEmoji(s: string): boolean + +/** Returns the latest Firefish version. */ +export function latestVersion(): Promise + +export interface LibreTranslateConfig { + managed?: boolean + apiUrl?: string + apiKey?: string +} + +export function loadConfig(): Config + +export interface Memory { + /** Total memory amount in bytes */ + total: number + /** Used memory amount in bytes */ + used: number + /** Available (for (re)use) memory amount in bytes */ + available: number +} + +export function memoryUsage(): Memory + export interface MessagingMessage { id: string createdAt: DateTimeWithTimeZone @@ -770,6 +657,7 @@ export interface MessagingMessage { reads: Array uri: string | null } + export interface Meta { id: string name: string | null @@ -857,11 +745,17 @@ export interface Meta { markLocalFilesNsfwByDefault: boolean antennaLimit: number } + +export function metaToPugArgs(meta: Meta): PugArgs + export interface Migrations { id: number timestamp: number name: string } + +export const MINUTE: number + export interface ModerationLog { id: string createdAt: DateTimeWithTimeZone @@ -869,12 +763,21 @@ export interface ModerationLog { type: string info: Json } + export interface MutedNote { id: string noteId: string userId: string reason: MutedNoteReason } + +export enum MutedNoteReason { + Manual = 'manual', + Other = 'other', + Spam = 'spam', + Word = 'word' +} + export interface Muting { id: string createdAt: DateTimeWithTimeZone @@ -882,6 +785,29 @@ export interface Muting { muterId: string expiresAt: DateTimeWithTimeZone | null } + +/** NodeInfo schema version 2.0. */ +export interface Nodeinfo { + /** The schema version, must be 2.0. */ + version: string + /** Metadata about server software in use. */ + software: Software20 + /** The protocols supported on this server. */ + protocols: Array + /** The third party sites this server can connect to via their application API. */ + services: Services + /** Whether this server allows open self-registration. */ + openRegistrations: boolean + /** Usage statistics for this server. */ + usage: Usage + /** Free form key value pairs for software specific values. Clients should not rely on any specific key present. */ + metadata: Record +} + +export function nodeinfo_2_0(): Promise + +export function nodeinfo_2_1(): Promise + export interface Note { id: string createdAt: DateTimeWithTimeZone @@ -918,6 +844,7 @@ export interface Note { lang: string | null scheduledAt: DateTimeWithTimeZone | null } + export interface NoteEdit { id: string noteId: string @@ -927,17 +854,20 @@ export interface NoteEdit { updatedAt: DateTimeWithTimeZone emojis: Array } + export interface NoteFavorite { id: string createdAt: DateTimeWithTimeZone userId: string noteId: string } + export interface NoteFile { serialNo: number noteId: string fileId: string } + export interface NoteReaction { id: string createdAt: DateTimeWithTimeZone @@ -945,12 +875,14 @@ export interface NoteReaction { noteId: string reaction: string } + export interface NoteThreadMuting { id: string createdAt: DateTimeWithTimeZone userId: string threadId: string } + export interface NoteUnread { id: string userId: string @@ -960,6 +892,15 @@ export interface NoteUnread { isMentioned: boolean noteChannelId: string | null } + +export enum NoteVisibility { + Followers = 'followers', + Hidden = 'hidden', + Home = 'home', + Public = 'public', + Specified = 'specified' +} + export interface NoteWatching { id: string createdAt: DateTimeWithTimeZone @@ -967,6 +908,7 @@ export interface NoteWatching { noteId: string noteUserId: string } + export interface Notification { id: string createdAt: DateTimeWithTimeZone @@ -984,6 +926,102 @@ export interface Notification { customIcon: string | null appAccessTokenId: string | null } + +export enum NotificationType { + App = 'app', + Follow = 'follow', + FollowRequestAccepted = 'followRequestAccepted', + GroupInvited = 'groupInvited', + Mention = 'mention', + PollEnded = 'pollEnded', + PollVote = 'pollVote', + Quote = 'quote', + Reaction = 'reaction', + ReceiveFollowRequest = 'receiveFollowRequest', + Renote = 'renote', + Reply = 'reply' +} + +/** + * Converts the given text into the cat language. + * + * refs: + * * + * * + * + * # Arguments + * + * * `text` : original text + * * `lang` : language code (e.g., `Some("en")`, `Some("en-US")`, `Some("uk-UA")`, `None`) + * + * # Example + * + * ``` + * # use backend_rs::misc::nyaify::nyaify; + * assert_eq!(nyaify("I'll take a nap.", Some("en")), "I'll take a nyap."); + * ``` + */ +export function nyaify(text: string, lang?: string | undefined | null): string + +export interface ObjectStorageConfig { + managed?: boolean + baseUrl?: string + bucket?: string + prefix?: string + endpoint?: string + region?: string + accessKey?: string + secretKey?: string + useSsl?: boolean + connnectOverProxy?: boolean + setPublicReadOnUpload?: boolean + s3ForcePathStyle?: boolean +} + +/** The third party sites this server can publish messages to on the behalf of a user. */ +export enum Outbound { + Atom1 = 0, + Blogger = 1, + Buddycloud = 2, + Diaspora = 3, + Dreamwidth = 4, + Drupal = 5, + Facebook = 6, + Friendica = 7, + Gnusocial = 8, + Google = 9, + Insanejournal = 10, + Libertree = 11, + Linkedin = 12, + Livejournal = 13, + Mediagoblin = 14, + Myspace = 15, + Pinterest = 16, + Pnut = 17, + Posterous = 18, + Pumpio = 19, + Redmatrix = 20, + Rss2 = 21, + Smtp = 22, + Tent = 23, + Tumblr = 24, + Twitter = 25, + Wordpress = 26, + Xmpp = 27 +} + +export interface PackedEmoji { + id: string + aliases: Array + name: string + category: string | null + host: string | null + url: string + license: string | null + width: number | null + height: number | null +} + export interface Page { id: string createdAt: DateTimeWithTimeZone @@ -1004,18 +1042,35 @@ export interface Page { script: string isPublic: boolean } + export interface PageLike { id: string createdAt: DateTimeWithTimeZone userId: string pageId: string } + +export enum PageVisibility { + Followers = 'followers', + Public = 'public', + Specified = 'specified' +} + +export interface PartialNoteToCheckWordMute { + fileIds: Array + text: string | null + cw: string | null + renoteId: string | null + replyId: string | null +} + export interface PasswordResetRequest { id: string createdAt: DateTimeWithTimeZone token: string userId: string } + export interface Poll { noteId: string expiresAt: DateTimeWithTimeZone | null @@ -1026,6 +1081,14 @@ export interface Poll { userId: string userHost: string | null } + +export enum PollNoteVisibility { + Followers = 'followers', + Home = 'home', + Public = 'public', + Specified = 'specified' +} + export interface PollVote { id: string createdAt: DateTimeWithTimeZone @@ -1033,22 +1096,90 @@ export interface PollVote { noteId: string choice: number } + export interface PromoNote { noteId: string expiresAt: DateTimeWithTimeZone userId: string } + export interface PromoRead { id: string createdAt: DateTimeWithTimeZone userId: string noteId: string } + +export enum Protocol { + Activitypub = 0, + Buddycloud = 1, + Dfrn = 2, + Diaspora = 3, + Libertree = 4, + Ostatus = 5, + Pumpio = 6, + Tent = 7, + Xmpp = 8, + Zot = 9 +} + +export function publishToBroadcastStream(emoji: PackedEmoji): Promise + +export function publishToChannelStream(channelId: string, userId: string): Promise + +export function publishToChatIndexStream(userId: string, kind: ChatIndexEvent, object: any): Promise + +export function publishToChatStream(senderUserId: string, receiverUserId: string, kind: ChatEvent, object: any): Promise + +export function publishToDriveFileStream(userId: string, kind: DriveFileEvent, object: any): Promise + +export function publishToDriveFolderStream(userId: string, kind: DriveFolderEvent, object: any): Promise + +export function publishToGroupChatStream(groupId: string, kind: ChatEvent, object: any): Promise + +export function publishToModerationStream(moderatorId: string, report: AbuseUserReportLike): Promise + +export function publishToNotesStream(note: Note): Promise + +export interface PugArgs { + img: string | null + title: string + instanceName: string + desc: string | null + icon: string | null + splashIcon: string | null + themeColor: string | null + randomMotd: string + privateMode: boolean | null +} + +export enum PushNotificationKind { + Generic = 0, + Chat = 1, + ReadAllChats = 2, + ReadAllChatsInTheRoom = 3, + ReadNotifications = 4, + ReadAllNotifications = 5, + Mastodon = 6 +} + +export interface RedisConfig { + host: string + port: number + family?: number + user?: string + pass?: string + tls?: TlsConfig + db: number + prefix?: string +} + export interface RegistrationTicket { id: string createdAt: DateTimeWithTimeZone code: string } + export interface RegistryItem { id: string createdAt: DateTimeWithTimeZone @@ -1059,103 +1190,104 @@ export interface RegistryItem { domain: string | null value: Json | null } + export interface Relay { id: string inbox: string status: RelayStatus } + +export enum RelayStatus { + Accepted = 'accepted', + Rejected = 'rejected', + Requesting = 'requesting' +} + +/** Delete all entries in the [attestation_challenge] table created at more than 5 minutes ago */ +export function removeOldAttestationChallenges(): Promise + export interface RenoteMuting { id: string createdAt: DateTimeWithTimeZone muteeId: string muterId: string } + export interface ReplyMuting { id: string createdAt: DateTimeWithTimeZone muteeId: string muterId: string } -export enum AntennaSrc { - All = 'all', - Group = 'group', - Home = 'home', - Instances = 'instances', - List = 'list', - Users = 'users' + +/** Returns `true` if `src` does not contain suspicious characters like `%`. */ +export function safeForSql(src: string): boolean + +export const SECOND: number + +export function sendPushNotification(receiverUserId: string, kind: PushNotificationKind, content: any): Promise + +export interface ServerConfig { + url: string + port: number + /** the host address to bind to */ + bind?: string + disableHsts?: boolean + /** PostgreSQL configurations */ + db: DbConfig + /** Redis configurations */ + redis: RedisConfig + /** secondary Redis server configurations */ + cacheServer?: RedisConfig + /** proxy host used for HTTP requests */ + proxy?: string + /** proxy host used for SMTP requests */ + proxySmtp?: string + /** hosts to bypass the proxy */ + proxyBypassHosts?: Array + allowedPrivateNetworks?: Array + /** maximum file size that can be uploaded to the drive (in bytes) */ + maxFileSize?: number + accessLog?: string + clusterLimits?: WorkerConfigInternal + cuid?: IdConfig + outgoingAddress?: string + deliverJobConcurrency?: number + inboxJobConcurrency?: number + deliverJobPerSec?: number + inboxJobPerSec?: number + deliverJobMaxAttempts?: number + inboxJobMaxAttempts?: number + /** deprecated in favor of `max_log_level` */ + logLevel?: Array + /** verbosity of the server log. `error`, `warn`, `info`, `debug`, or `trace` */ + maxLogLevel?: string + syslog?: SysLogConfig + proxyRemoteFiles?: boolean + mediaProxy?: string + summalyProxyUrl?: string + reservedUsernames?: Array + maxUserSignups?: number + isManagedHosting?: boolean + maxNoteLength?: number + maxCaptionLength?: number + deepl?: DeepLConfig + libreTranslate?: LibreTranslateConfig + email?: EmailConfig + objectStorage?: ObjectStorageConfig } -export enum DriveFileUsageHint { - UserAvatar = 'userAvatar', - UserBanner = 'userBanner' -} -export enum MutedNoteReason { - Manual = 'manual', - Other = 'other', - Spam = 'spam', - Word = 'word' -} -export enum NoteVisibility { - Followers = 'followers', - Hidden = 'hidden', - Home = 'home', - Public = 'public', - Specified = 'specified' -} -export enum NotificationType { - App = 'app', - Follow = 'follow', - FollowRequestAccepted = 'followRequestAccepted', - GroupInvited = 'groupInvited', - Mention = 'mention', - PollEnded = 'pollEnded', - PollVote = 'pollVote', - Quote = 'quote', - Reaction = 'reaction', - ReceiveFollowRequest = 'receiveFollowRequest', - Renote = 'renote', - Reply = 'reply' -} -export enum PageVisibility { - Followers = 'followers', - Public = 'public', - Specified = 'specified' -} -export enum PollNoteVisibility { - Followers = 'followers', - Home = 'home', - Public = 'public', - Specified = 'specified' -} -export enum RelayStatus { - Accepted = 'accepted', - Rejected = 'rejected', - Requesting = 'requesting' -} -export enum UserEmojiModPerm { - Add = 'add', - Full = 'full', - Mod = 'mod', - Unauthorized = 'unauthorized' -} -export enum UserProfileFfvisibility { - Followers = 'followers', - Private = 'private', - Public = 'public' -} -export enum UserProfileMutingNotificationTypes { - App = 'app', - Follow = 'follow', - FollowRequestAccepted = 'followRequestAccepted', - GroupInvited = 'groupInvited', - Mention = 'mention', - PollEnded = 'pollEnded', - PollVote = 'pollVote', - Quote = 'quote', - Reaction = 'reaction', - ReceiveFollowRequest = 'receiveFollowRequest', - Renote = 'renote', - Reply = 'reply' + +/** The third party sites this server can connect to via their application API. */ +export interface Services { + /** The third party sites this server can retrieve messages from for combined display with regular traffic. */ + inbound: Array + /** The third party sites this server can publish messages to on the behalf of a user. */ + outbound: Array } + +/** Prints the server hardware information as the server info log. */ +export function showServerInfo(): void + export interface Signin { id: string createdAt: DateTimeWithTimeZone @@ -1164,6 +1296,29 @@ export interface Signin { headers: Json success: boolean } + +/** Metadata about server software in use (version 2.0). */ +export interface Software20 { + /** The canonical name of this server software. */ + name: string + /** The version of this server software. */ + version: string +} + +/** Escapes `%` and `\` in the given string. */ +export function sqlLikeEscape(src: string): string + +export interface Storage { + /** Total storage space in bytes */ + total: number + /** Used storage space in bytes */ + used: number +} + +export function storageUsage(): Storage | null + +export function stringToAcct(acct: string): Acct + export interface SwSubscription { id: string createdAt: DateTimeWithTimeZone @@ -1173,10 +1328,45 @@ export interface SwSubscription { publickey: string sendReadMessage: boolean } + +export interface SysLogConfig { + host: string + port: number +} + +export interface TlsConfig { + host: string + rejectUnauthorized: boolean +} + +export function toDbReaction(reaction?: string | undefined | null, host?: string | undefined | null): Promise + +export function toMastodonId(firefishId: string): string | null + +export function toPuny(host: string): string + +export function unwatchNote(watcherId: string, noteId: string): Promise + +export function updateAntennaCache(): Promise + +export function updateAntennasOnNewNote(note: Note, noteAuthor: Acct, noteMutedUsers: Array): Promise + +export function updateMetaCache(): Promise + +export function updateNodeinfoCache(): Promise + +/** Usage statistics for this server. */ +export interface Usage { + users: Users + localPosts: number | null + localComments: number | null +} + export interface UsedUsername { username: string createdAt: DateTimeWithTimeZone } + export interface User { id: string createdAt: DateTimeWithTimeZone @@ -1217,6 +1407,18 @@ export interface User { isIndexable: boolean alsoKnownAs: Array | null } + +export const USER_ACTIVE_THRESHOLD: number + +export const USER_ONLINE_THRESHOLD: number + +export enum UserEmojiModPerm { + Add = 'add', + Full = 'full', + Mod = 'mod', + Unauthorized = 'unauthorized' +} + export interface UserGroup { id: string createdAt: DateTimeWithTimeZone @@ -1224,53 +1426,62 @@ export interface UserGroup { userId: string isPrivate: boolean } + export interface UserGroupInvitation { id: string createdAt: DateTimeWithTimeZone userId: string userGroupId: string } + export interface UserGroupInvite { id: string createdAt: DateTimeWithTimeZone userId: string userGroupId: string } + export interface UserGroupJoining { id: string createdAt: DateTimeWithTimeZone userId: string userGroupId: string } + export interface UserIp { id: number createdAt: DateTimeWithTimeZone userId: string ip: string } + export interface UserKeypair { userId: string publicKey: string privateKey: string } + export interface UserList { id: string createdAt: DateTimeWithTimeZone userId: string name: string } + export interface UserListJoining { id: string createdAt: DateTimeWithTimeZone userId: string userListId: string } + export interface UserNotePining { id: string createdAt: DateTimeWithTimeZone userId: string noteId: string } + export interface UserPending { id: string createdAt: DateTimeWithTimeZone @@ -1279,6 +1490,7 @@ export interface UserPending { email: string password: string } + export interface UserProfile { userId: string location: string | null @@ -1316,11 +1528,41 @@ export interface UserProfile { mutedWords: Array lang: string | null } + +export enum UserProfileFfvisibility { + Followers = 'followers', + Private = 'private', + Public = 'public' +} + +export enum UserProfileMutingNotificationTypes { + App = 'app', + Follow = 'follow', + FollowRequestAccepted = 'followRequestAccepted', + GroupInvited = 'groupInvited', + Mention = 'mention', + PollEnded = 'pollEnded', + PollVote = 'pollVote', + Quote = 'quote', + Reaction = 'reaction', + ReceiveFollowRequest = 'receiveFollowRequest', + Renote = 'renote', + Reply = 'reply' +} + export interface UserPublickey { userId: string keyId: string keyPem: string } + +/** statistics about the users of this server. */ +export interface Users { + total: number | null + activeHalfyear: number | null + activeMonth: number | null +} + export interface UserSecurityKey { id: string userId: string @@ -1328,6 +1570,12 @@ export interface UserSecurityKey { lastUsed: DateTimeWithTimeZone name: string } + +/** Checks whether the given password and hash match. */ +export function verifyPassword(password: string, hash: string): boolean + +export function watchNote(watcherId: string, noteAuthorId: string, noteId: string): Promise + export interface Webhook { id: string createdAt: DateTimeWithTimeZone @@ -1340,78 +1588,14 @@ export interface Webhook { latestSentAt: DateTimeWithTimeZone | null latestStatus: number | null } -export function updateAntennasOnNewNote(note: Note, noteAuthor: Acct, noteMutedUsers: Array): Promise -export function updateAntennaCache(): Promise -export function watchNote(watcherId: string, noteAuthorId: string, noteId: string): Promise -export function unwatchNote(watcherId: string, noteId: string): Promise -export enum PushNotificationKind { - Generic = 0, - Chat = 1, - ReadAllChats = 2, - ReadAllChatsInTheRoom = 3, - ReadNotifications = 4, - ReadAllNotifications = 5, - Mastodon = 6 + +export interface WorkerConfig { + web: number + queue: number } -export function sendPushNotification(receiverUserId: string, kind: PushNotificationKind, content: any): Promise -export function publishToChannelStream(channelId: string, userId: string): Promise -export function publishToChatStream(senderUserId: string, receiverUserId: string, kind: ChatEvent, object: any): Promise -export enum ChatIndexEvent { - Message = 0, - Read = 1 + +export interface WorkerConfigInternal { + web?: number + queue?: number } -export function publishToChatIndexStream(userId: string, kind: ChatIndexEvent, object: any): Promise -export interface PackedEmoji { - id: string - aliases: Array - name: string - category: string | null - host: string | null - url: string - license: string | null - width: number | null - height: number | null -} -export function publishToBroadcastStream(emoji: PackedEmoji): Promise -export enum DriveFileEvent { - Create = 0, - Update = 1, - Delete = 2 -} -export enum DriveFolderEvent { - Create = 0, - Update = 1, - Delete = 2 -} -export function publishToDriveFileStream(userId: string, kind: DriveFileEvent, object: any): Promise -export function publishToDriveFolderStream(userId: string, kind: DriveFolderEvent, object: any): Promise -export function publishToGroupChatStream(groupId: string, kind: ChatEvent, object: any): Promise -export interface AbuseUserReportLike { - id: string - targetUserId: string - reporterId: string - comment: string -} -export function publishToModerationStream(moderatorId: string, report: AbuseUserReportLike): Promise -export function publishToNotesStream(note: Note): Promise -export enum ChatEvent { - Message = 0, - Read = 1, - Deleted = 2, - Typing = 3 -} -export function getTimestamp(id: string): number -/** - * The generated ID results in the form of `[8 chars timestamp] + [cuid2]`. - * The minimum and maximum lengths are 16 and 24, respectively. - * With the length of 16, namely 8 for cuid2, roughly 1427399 IDs are needed - * in the same millisecond to reach 50% chance of collision. - * - * Ref: - */ -export function genId(): string -/** Generate an ID using a specific datetime */ -export function genIdAt(date: Date): string -/** Generates a random string based on [thread_rng] and [Alphanumeric]. */ -export function generateSecureRandomString(length: number): string -export function generateUserToken(): string + diff --git a/packages/backend-rs/index.js b/packages/backend-rs/index.js index b971a57ecc..9cb1779766 100644 --- a/packages/backend-rs/index.js +++ b/packages/backend-rs/index.js @@ -1,404 +1,453 @@ -/* tslint:disable */ +// prettier-ignore /* eslint-disable */ -/* prettier-ignore */ - /* auto-generated by NAPI-RS */ -const { existsSync, readFileSync } = require('fs') -const { join } = require('path') - -const { platform, arch } = process +const { readFileSync } = require('fs') let nativeBinding = null -let localFileExisted = false -let loadError = null +const loadErrors = [] -function isMusl() { - // For Node 10 - if (!process.report || typeof process.report.getReport !== 'function') { - try { - const lddPath = require('child_process').execSync('which ldd').toString().trim() - return readFileSync(lddPath, 'utf8').includes('musl') - } catch (e) { - return true +const isMusl = () => { + let musl = false + if (process.platform === 'linux') { + musl = isMuslFromFilesystem() + if (musl === null) { + musl = isMuslFromReport() } - } else { - const { glibcVersionRuntime } = process.report.getReport().header - return !glibcVersionRuntime + if (musl === null) { + musl = isMuslFromChildProcess() + } + } + return musl +} + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') + +const isMuslFromFilesystem = () => { + try { + return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') + } catch { + return null } } -switch (platform) { - case 'android': - switch (arch) { - case 'arm64': - localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.android-arm64.node') - } else { - nativeBinding = require('backend-rs-android-arm64') - } - } catch (e) { - loadError = e - } - break - case 'arm': - localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm-eabi.node')) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.android-arm-eabi.node') - } else { - nativeBinding = require('backend-rs-android-arm-eabi') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Android ${arch}`) +const isMuslFromReport = () => { + const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null + if (!report) { + return null + } + if (report.header && report.header.glibcVersionRuntime) { + return false + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return true } - break - case 'win32': - switch (arch) { - case 'x64': - localFileExisted = existsSync( - join(__dirname, 'backend-rs.win32-x64-msvc.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.win32-x64-msvc.node') - } else { - nativeBinding = require('backend-rs-win32-x64-msvc') - } - } catch (e) { - loadError = e - } - break - case 'ia32': - localFileExisted = existsSync( - join(__dirname, 'backend-rs.win32-ia32-msvc.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.win32-ia32-msvc.node') - } else { - nativeBinding = require('backend-rs-win32-ia32-msvc') - } - } catch (e) { - loadError = e - } - break - case 'arm64': - localFileExisted = existsSync( - join(__dirname, 'backend-rs.win32-arm64-msvc.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.win32-arm64-msvc.node') - } else { - nativeBinding = require('backend-rs-win32-arm64-msvc') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Windows: ${arch}`) - } - break - case 'darwin': - localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-universal.node')) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.darwin-universal.node') - } else { - nativeBinding = require('backend-rs-darwin-universal') + } + return false +} + +const isMuslFromChildProcess = () => { + try { + return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') + } catch (e) { + // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false + return false + } +} + +function requireNative() { + if (process.platform === 'android') { + if (process.arch === 'arm64') { + try { + return require('./backend-rs.android-arm64.node') + } catch (e) { + loadErrors.push(e) } - break - } catch {} - switch (arch) { - case 'x64': - localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-x64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.darwin-x64.node') - } else { - nativeBinding = require('backend-rs-darwin-x64') - } - } catch (e) { - loadError = e - } - break - case 'arm64': - localFileExisted = existsSync( - join(__dirname, 'backend-rs.darwin-arm64.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.darwin-arm64.node') - } else { - nativeBinding = require('backend-rs-darwin-arm64') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on macOS: ${arch}`) - } - break - case 'freebsd': - if (arch !== 'x64') { - throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) - } - localFileExisted = existsSync(join(__dirname, 'backend-rs.freebsd-x64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.freebsd-x64.node') - } else { - nativeBinding = require('backend-rs-freebsd-x64') + try { + return require('backend-rs-android-arm64') + } catch (e) { + loadErrors.push(e) } - } catch (e) { - loadError = e + + } else if (process.arch === 'arm') { + try { + return require('./backend-rs.android-arm-eabi.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-android-arm-eabi') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) } - break - case 'linux': - switch (arch) { - case 'x64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-x64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-x64-musl.node') - } else { - nativeBinding = require('backend-rs-linux-x64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-x64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-x64-gnu.node') - } else { - nativeBinding = require('backend-rs-linux-x64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 'arm64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-arm64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-arm64-musl.node') - } else { - nativeBinding = require('backend-rs-linux-arm64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-arm64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-arm64-gnu.node') - } else { - nativeBinding = require('backend-rs-linux-arm64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 'arm': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-arm-musleabihf.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-arm-musleabihf.node') - } else { - nativeBinding = require('backend-rs-linux-arm-musleabihf') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-arm-gnueabihf.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-arm-gnueabihf.node') - } else { - nativeBinding = require('backend-rs-linux-arm-gnueabihf') - } - } catch (e) { - loadError = e - } - } - break - case 'riscv64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-riscv64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-riscv64-musl.node') - } else { - nativeBinding = require('backend-rs-linux-riscv64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-riscv64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-riscv64-gnu.node') - } else { - nativeBinding = require('backend-rs-linux-riscv64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 's390x': - localFileExisted = existsSync( - join(__dirname, 'backend-rs.linux-s390x-gnu.node') - ) + } else if (process.platform === 'win32') { + if (process.arch === 'x64') { + try { + return require('./backend-rs.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-win32-x64-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'ia32') { + try { + return require('./backend-rs.win32-ia32-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-win32-ia32-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./backend-rs.win32-arm64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-win32-arm64-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) + } + } else if (process.platform === 'darwin') { + try { + return require('./backend-rs.darwin-universal.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-darwin-universal') + } catch (e) { + loadErrors.push(e) + } + + if (process.arch === 'x64') { + try { + return require('./backend-rs.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-darwin-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./backend-rs.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-darwin-arm64') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) + } + } else if (process.platform === 'freebsd') { + if (process.arch === 'x64') { + try { + return require('./backend-rs.freebsd-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-freebsd-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./backend-rs.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-freebsd-arm64') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) + } + } else if (process.platform === 'linux') { + if (process.arch === 'x64') { + if (isMusl()) { try { - if (localFileExisted) { - nativeBinding = require('./backend-rs.linux-s390x-gnu.node') - } else { - nativeBinding = require('backend-rs-linux-s390x-gnu') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Linux: ${arch}`) + return require('./backend-rs.linux-x64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-x64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./backend-rs.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-x64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'arm64') { + if (isMusl()) { + try { + return require('./backend-rs.linux-arm64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-arm64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./backend-rs.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-arm64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'arm') { + if (isMusl()) { + try { + return require('./backend-rs.linux-arm-musleabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-arm-musleabihf') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./backend-rs.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-arm-gnueabihf') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'riscv64') { + if (isMusl()) { + try { + return require('./backend-rs.linux-riscv64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-riscv64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./backend-rs.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-riscv64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'ppc64') { + try { + return require('./backend-rs.linux-ppc64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-ppc64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 's390x') { + try { + return require('./backend-rs.linux-s390x-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('backend-rs-linux-s390x-gnu') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) } - break - default: - throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + try { + nativeBinding = require('./backend-rs.wasi.cjs') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err) + } + } + if (!nativeBinding) { + try { + nativeBinding = require('backend-rs-wasm32-wasi') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err) + } + } + } } if (!nativeBinding) { - if (loadError) { - throw loadError + if (loadErrors.length > 0) { + // TODO Link to documentation with potential fixes + // - The package owner could build/publish bindings for this arch + // - The user may need to bundle the correct files + // - The user may need to re-install node_modules to get new packages + throw new Error('Failed to load native binding', { cause: loadErrors }) } throw new Error(`Failed to load native binding`) } -const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, fetchMeta, updateMetaCache, metaToPugArgs, loadConfig, stringToAcct, acctToString, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, updateNodeinfoCache, Protocol, Inbound, Outbound, greet, initializeRustLogger, showServerInfo, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, isQuote, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, getNoteSummary, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, cpuInfo, cpuUsage, memoryUsage, storageUsage, AntennaSrc, DriveFileUsageHint, MutedNoteReason, NoteVisibility, NotificationType, PageVisibility, PollNoteVisibility, RelayStatus, UserEmojiModPerm, UserProfileFfvisibility, UserProfileMutingNotificationTypes, updateAntennasOnNewNote, updateAntennaCache, watchNote, unwatchNote, PushNotificationKind, sendPushNotification, publishToChannelStream, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, DriveFileEvent, DriveFolderEvent, publishToDriveFileStream, publishToDriveFolderStream, publishToGroupChatStream, publishToModerationStream, publishToNotesStream, ChatEvent, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding - -module.exports.SECOND = SECOND -module.exports.MINUTE = MINUTE -module.exports.HOUR = HOUR -module.exports.DAY = DAY -module.exports.USER_ONLINE_THRESHOLD = USER_ONLINE_THRESHOLD -module.exports.USER_ACTIVE_THRESHOLD = USER_ACTIVE_THRESHOLD -module.exports.FILE_TYPE_BROWSERSAFE = FILE_TYPE_BROWSERSAFE -module.exports.fetchMeta = fetchMeta -module.exports.updateMetaCache = updateMetaCache -module.exports.metaToPugArgs = metaToPugArgs -module.exports.loadConfig = loadConfig -module.exports.stringToAcct = stringToAcct -module.exports.acctToString = acctToString -module.exports.fetchNodeinfo = fetchNodeinfo -module.exports.nodeinfo_2_1 = nodeinfo_2_1 -module.exports.nodeinfo_2_0 = nodeinfo_2_0 -module.exports.updateNodeinfoCache = updateNodeinfoCache -module.exports.Protocol = Protocol -module.exports.Inbound = Inbound -module.exports.Outbound = Outbound -module.exports.greet = greet -module.exports.initializeRustLogger = initializeRustLogger -module.exports.showServerInfo = showServerInfo -module.exports.isBlockedServer = isBlockedServer -module.exports.isSilencedServer = isSilencedServer -module.exports.isAllowedServer = isAllowedServer -module.exports.checkWordMute = checkWordMute -module.exports.getFullApAccount = getFullApAccount -module.exports.isSelfHost = isSelfHost -module.exports.isSameOrigin = isSameOrigin -module.exports.extractHost = extractHost -module.exports.toPuny = toPuny -module.exports.isUnicodeEmoji = isUnicodeEmoji -module.exports.sqlLikeEscape = sqlLikeEscape -module.exports.safeForSql = safeForSql -module.exports.formatMilliseconds = formatMilliseconds -module.exports.getImageSizeFromUrl = getImageSizeFromUrl -module.exports.isQuote = isQuote -module.exports.isSafeUrl = isSafeUrl -module.exports.latestVersion = latestVersion -module.exports.toMastodonId = toMastodonId -module.exports.fromMastodonId = fromMastodonId -module.exports.getNoteSummary = getNoteSummary -module.exports.nyaify = nyaify -module.exports.hashPassword = hashPassword -module.exports.verifyPassword = verifyPassword -module.exports.isOldPasswordAlgorithm = isOldPasswordAlgorithm -module.exports.decodeReaction = decodeReaction -module.exports.countReactions = countReactions -module.exports.toDbReaction = toDbReaction -module.exports.removeOldAttestationChallenges = removeOldAttestationChallenges -module.exports.cpuInfo = cpuInfo -module.exports.cpuUsage = cpuUsage -module.exports.memoryUsage = memoryUsage -module.exports.storageUsage = storageUsage -module.exports.AntennaSrc = AntennaSrc -module.exports.DriveFileUsageHint = DriveFileUsageHint -module.exports.MutedNoteReason = MutedNoteReason -module.exports.NoteVisibility = NoteVisibility -module.exports.NotificationType = NotificationType -module.exports.PageVisibility = PageVisibility -module.exports.PollNoteVisibility = PollNoteVisibility -module.exports.RelayStatus = RelayStatus -module.exports.UserEmojiModPerm = UserEmojiModPerm -module.exports.UserProfileFfvisibility = UserProfileFfvisibility -module.exports.UserProfileMutingNotificationTypes = UserProfileMutingNotificationTypes -module.exports.updateAntennasOnNewNote = updateAntennasOnNewNote -module.exports.updateAntennaCache = updateAntennaCache -module.exports.watchNote = watchNote -module.exports.unwatchNote = unwatchNote -module.exports.PushNotificationKind = PushNotificationKind -module.exports.sendPushNotification = sendPushNotification -module.exports.publishToChannelStream = publishToChannelStream -module.exports.publishToChatStream = publishToChatStream -module.exports.ChatIndexEvent = ChatIndexEvent -module.exports.publishToChatIndexStream = publishToChatIndexStream -module.exports.publishToBroadcastStream = publishToBroadcastStream -module.exports.DriveFileEvent = DriveFileEvent -module.exports.DriveFolderEvent = DriveFolderEvent -module.exports.publishToDriveFileStream = publishToDriveFileStream -module.exports.publishToDriveFolderStream = publishToDriveFolderStream -module.exports.publishToGroupChatStream = publishToGroupChatStream -module.exports.publishToModerationStream = publishToModerationStream -module.exports.publishToNotesStream = publishToNotesStream -module.exports.ChatEvent = ChatEvent -module.exports.getTimestamp = getTimestamp -module.exports.genId = genId -module.exports.genIdAt = genIdAt -module.exports.generateSecureRandomString = generateSecureRandomString -module.exports.generateUserToken = generateUserToken +module.exports.acctToString = nativeBinding.acctToString +module.exports.AntennaSrc = nativeBinding.AntennaSrc +module.exports.ChatEvent = nativeBinding.ChatEvent +module.exports.ChatIndexEvent = nativeBinding.ChatIndexEvent +module.exports.checkWordMute = nativeBinding.checkWordMute +module.exports.countReactions = nativeBinding.countReactions +module.exports.cpuInfo = nativeBinding.cpuInfo +module.exports.cpuUsage = nativeBinding.cpuUsage +module.exports.DAY = nativeBinding.DAY +module.exports.decodeReaction = nativeBinding.decodeReaction +module.exports.DriveFileEvent = nativeBinding.DriveFileEvent +module.exports.DriveFileUsageHint = nativeBinding.DriveFileUsageHint +module.exports.DriveFolderEvent = nativeBinding.DriveFolderEvent +module.exports.extractHost = nativeBinding.extractHost +module.exports.fetchMeta = nativeBinding.fetchMeta +module.exports.fetchNodeinfo = nativeBinding.fetchNodeinfo +module.exports.FILE_TYPE_BROWSERSAFE = nativeBinding.FILE_TYPE_BROWSERSAFE +module.exports.formatMilliseconds = nativeBinding.formatMilliseconds +module.exports.fromMastodonId = nativeBinding.fromMastodonId +module.exports.generateSecureRandomString = nativeBinding.generateSecureRandomString +module.exports.generateUserToken = nativeBinding.generateUserToken +module.exports.genId = nativeBinding.genId +module.exports.genIdAt = nativeBinding.genIdAt +module.exports.getFullApAccount = nativeBinding.getFullApAccount +module.exports.getImageSizeFromUrl = nativeBinding.getImageSizeFromUrl +module.exports.getNoteSummary = nativeBinding.getNoteSummary +module.exports.getTimestamp = nativeBinding.getTimestamp +module.exports.greet = nativeBinding.greet +module.exports.hashPassword = nativeBinding.hashPassword +module.exports.HOUR = nativeBinding.HOUR +module.exports.Inbound = nativeBinding.Inbound +module.exports.initializeRustLogger = nativeBinding.initializeRustLogger +module.exports.isAllowedServer = nativeBinding.isAllowedServer +module.exports.isBlockedServer = nativeBinding.isBlockedServer +module.exports.isOldPasswordAlgorithm = nativeBinding.isOldPasswordAlgorithm +module.exports.isQuote = nativeBinding.isQuote +module.exports.isSafeUrl = nativeBinding.isSafeUrl +module.exports.isSameOrigin = nativeBinding.isSameOrigin +module.exports.isSelfHost = nativeBinding.isSelfHost +module.exports.isSilencedServer = nativeBinding.isSilencedServer +module.exports.isUnicodeEmoji = nativeBinding.isUnicodeEmoji +module.exports.latestVersion = nativeBinding.latestVersion +module.exports.loadConfig = nativeBinding.loadConfig +module.exports.memoryUsage = nativeBinding.memoryUsage +module.exports.metaToPugArgs = nativeBinding.metaToPugArgs +module.exports.MINUTE = nativeBinding.MINUTE +module.exports.MutedNoteReason = nativeBinding.MutedNoteReason +module.exports.nodeinfo_2_0 = nativeBinding.nodeinfo_2_0 +module.exports.nodeinfo_2_1 = nativeBinding.nodeinfo_2_1 +module.exports.NoteVisibility = nativeBinding.NoteVisibility +module.exports.NotificationType = nativeBinding.NotificationType +module.exports.nyaify = nativeBinding.nyaify +module.exports.Outbound = nativeBinding.Outbound +module.exports.PageVisibility = nativeBinding.PageVisibility +module.exports.PollNoteVisibility = nativeBinding.PollNoteVisibility +module.exports.Protocol = nativeBinding.Protocol +module.exports.publishToBroadcastStream = nativeBinding.publishToBroadcastStream +module.exports.publishToChannelStream = nativeBinding.publishToChannelStream +module.exports.publishToChatIndexStream = nativeBinding.publishToChatIndexStream +module.exports.publishToChatStream = nativeBinding.publishToChatStream +module.exports.publishToDriveFileStream = nativeBinding.publishToDriveFileStream +module.exports.publishToDriveFolderStream = nativeBinding.publishToDriveFolderStream +module.exports.publishToGroupChatStream = nativeBinding.publishToGroupChatStream +module.exports.publishToModerationStream = nativeBinding.publishToModerationStream +module.exports.publishToNotesStream = nativeBinding.publishToNotesStream +module.exports.PushNotificationKind = nativeBinding.PushNotificationKind +module.exports.RelayStatus = nativeBinding.RelayStatus +module.exports.removeOldAttestationChallenges = nativeBinding.removeOldAttestationChallenges +module.exports.safeForSql = nativeBinding.safeForSql +module.exports.SECOND = nativeBinding.SECOND +module.exports.sendPushNotification = nativeBinding.sendPushNotification +module.exports.showServerInfo = nativeBinding.showServerInfo +module.exports.sqlLikeEscape = nativeBinding.sqlLikeEscape +module.exports.storageUsage = nativeBinding.storageUsage +module.exports.stringToAcct = nativeBinding.stringToAcct +module.exports.toDbReaction = nativeBinding.toDbReaction +module.exports.toMastodonId = nativeBinding.toMastodonId +module.exports.toPuny = nativeBinding.toPuny +module.exports.unwatchNote = nativeBinding.unwatchNote +module.exports.updateAntennaCache = nativeBinding.updateAntennaCache +module.exports.updateAntennasOnNewNote = nativeBinding.updateAntennasOnNewNote +module.exports.updateMetaCache = nativeBinding.updateMetaCache +module.exports.updateNodeinfoCache = nativeBinding.updateNodeinfoCache +module.exports.USER_ACTIVE_THRESHOLD = nativeBinding.USER_ACTIVE_THRESHOLD +module.exports.USER_ONLINE_THRESHOLD = nativeBinding.USER_ONLINE_THRESHOLD +module.exports.UserEmojiModPerm = nativeBinding.UserEmojiModPerm +module.exports.UserProfileFfvisibility = nativeBinding.UserProfileFfvisibility +module.exports.UserProfileMutingNotificationTypes = nativeBinding.UserProfileMutingNotificationTypes +module.exports.verifyPassword = nativeBinding.verifyPassword +module.exports.watchNote = nativeBinding.watchNote diff --git a/packages/backend-rs/package.json b/packages/backend-rs/package.json index bdda932a9b..e68b00fd96 100644 --- a/packages/backend-rs/package.json +++ b/packages/backend-rs/package.json @@ -4,30 +4,29 @@ "main": "built/index.js", "types": "built/index.d.ts", "napi": { - "name": "backend-rs", - "triples": { - "additional": [ - "aarch64-apple-darwin", - "aarch64-linux-android", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "aarch64-pc-windows-msvc", - "armv7-unknown-linux-gnueabihf", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "i686-pc-windows-msvc", - "armv7-linux-androideabi", - "universal-apple-darwin" - ] - } + "binaryName": "backend-rs", + "targets": [ + "aarch64-apple-darwin", + "aarch64-linux-android", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc", + "armv7-unknown-linux-gnueabihf", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "i686-pc-windows-msvc", + "armv7-linux-androideabi", + "universal-apple-darwin" + ] }, "devDependencies": { - "@napi-rs/cli": "2.18.3" + "@napi-rs/cli": "3.0.0-alpha.55" }, "scripts": { "artifacts": "napi artifacts", - "build": "RUSTFLAGS='-C target-cpu=native' napi build --features napi --no-const-enum --platform --release ./built/", - "build:debug": "napi build --features napi --no-const-enum --platform ./built/", + "build": "RUSTFLAGS='-C target-cpu=native' napi build --features napi --no-const-enum --platform --release --output-dir ./built/", + "build:debug": "napi build --features napi --no-const-enum --platform --output-dir ./built/", "prepublishOnly": "napi prepublish -t npm", "universal": "napi universal", "version": "napi version" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec54b96320..e03c7d6ebc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -516,8 +516,8 @@ importers: packages/backend-rs: devDependencies: '@napi-rs/cli': - specifier: 2.18.3 - version: 2.18.3 + specifier: 3.0.0-alpha.55 + version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0) packages/client: devDependencies: @@ -1146,13 +1146,11 @@ packages: '@biomejs/cli-darwin-arm64@1.8.1': resolution: {integrity: sha512-XLiB7Uu6GALIOBWzQ2aMD0ru4Ly5/qSeQF7kk3AabzJ/kwsEWSe33iVySBP/SS2qv25cgqNiLksjGcw2bHT3mw==} engines: {node: '>=14.21.3'} - cpu: [arm64] os: [darwin] '@biomejs/cli-darwin-x64@1.8.1': resolution: {integrity: sha512-uMTSxVLMfqkBVqyc25hSn83jBbp+wtWjzM/pHFlKXt3htJuw7FErVGW0nmQ9Sxa9vJ7GcqoltLMl28VQRIMYzg==} engines: {node: '>=14.21.3'} - cpu: [x64] os: [darwin] '@biomejs/cli-linux-arm64-musl@1.8.1': @@ -1164,7 +1162,6 @@ packages: '@biomejs/cli-linux-arm64@1.8.1': resolution: {integrity: sha512-3SzZRuC/9Oi2P2IBNPsEj0KXxSXUEYRR2kfRF/Ve8QAfGgrt4qnwuWd6QQKKN5R+oYH691qjm+cXBKEcrP1v/Q==} engines: {node: '>=14.21.3'} - cpu: [arm64] os: [linux] '@biomejs/cli-linux-x64-musl@1.8.1': @@ -1176,7 +1173,6 @@ packages: '@biomejs/cli-linux-x64@1.8.1': resolution: {integrity: sha512-AeBycVdNrTzsyYKEOtR2R0Ph0hCD0sCshcp2aOnfGP0hCZbtFg09D0SdKLbyzKntisY41HxKVrydYiaApp+2uw==} engines: {node: '>=14.21.3'} - cpu: [x64] os: [linux] '@biomejs/cli-win32-arm64@1.8.1': @@ -1279,9 +1275,15 @@ packages: '@discordapp/twemoji@15.0.3': resolution: {integrity: sha512-5t0LLrNaSqViG0cSaomWwfR0+3fWqok+xLq40M8hJHxNX7s8gIoyNZYybQJo+s5/rGMjgdldpt8Ox8MapGvBUA==} + '@emnapi/core@1.2.0': + resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} + '@emnapi/runtime@1.2.0': resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} + '@emnapi/wasi-threads@1.0.1': + resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} + '@es-joy/jsdoccomment@0.43.1': resolution: {integrity: sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==} engines: {node: '>=16'} @@ -1645,6 +1647,10 @@ packages: cpu: [x64] os: [win32] + '@inquirer/figures@1.0.3': + resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} + engines: {node: '>=18'} + '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -1926,6 +1932,10 @@ packages: '@types/koa': optional: true + '@ljharb/through@2.3.13': + resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} + engines: {node: '>= 0.4'} + '@microsoft/tsdoc-config@0.16.2': resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} @@ -1969,10 +1979,299 @@ packages: cpu: [x64] os: [win32] - '@napi-rs/cli@2.18.3': - resolution: {integrity: sha512-L0f4kP0dyG8W5Qtc7MtP73VvLLrOLyRcUEBzknIfu8Jk4Jfhrsx1ItMHgyalYqMSslWdY3ojEfAaU5sx1VyeQQ==} - engines: {node: '>= 10'} + '@napi-rs/cli@3.0.0-alpha.55': + resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} + engines: {node: '>= 16'} hasBin: true + peerDependencies: + '@emnapi/runtime': ^1.1.0 + emnapi: ^1.1.0 + peerDependenciesMeta: + '@emnapi/runtime': + optional: true + emnapi: + optional: true + + '@napi-rs/cross-toolchain@0.0.16': + resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} + peerDependencies: + '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 + '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 + '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 + '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 + '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 + '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 + peerDependenciesMeta: + '@napi-rs/cross-toolchain-arm64-target-aarch64': + optional: true + '@napi-rs/cross-toolchain-arm64-target-armv7': + optional: true + '@napi-rs/cross-toolchain-arm64-target-x86_64': + optional: true + '@napi-rs/cross-toolchain-x64-target-aarch64': + optional: true + '@napi-rs/cross-toolchain-x64-target-armv7': + optional: true + '@napi-rs/cross-toolchain-x64-target-x86_64': + optional: true + + '@napi-rs/lzma-android-arm-eabi@1.3.1': + resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + + '@napi-rs/lzma-android-arm64@1.3.1': + resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + + '@napi-rs/lzma-darwin-arm64@1.3.1': + resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@napi-rs/lzma-darwin-x64@1.3.1': + resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@napi-rs/lzma-freebsd-x64@1.3.1': + resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + + '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': + resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@napi-rs/lzma-linux-arm64-gnu@1.3.1': + resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/lzma-linux-arm64-musl@1.3.1': + resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/lzma-linux-x64-gnu@1.3.1': + resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/lzma-linux-x64-musl@1.3.1': + resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/lzma-wasm32-wasi@1.3.1': + resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@napi-rs/lzma-win32-arm64-msvc@1.3.1': + resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@napi-rs/lzma-win32-ia32-msvc@1.3.1': + resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@napi-rs/lzma-win32-x64-msvc@1.3.1': + resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@napi-rs/lzma@1.3.1': + resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} + engines: {node: '>= 10'} + + '@napi-rs/tar-android-arm-eabi@0.1.1': + resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + + '@napi-rs/tar-android-arm64@0.1.1': + resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + + '@napi-rs/tar-darwin-arm64@0.1.1': + resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@napi-rs/tar-darwin-x64@0.1.1': + resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@napi-rs/tar-freebsd-x64@0.1.1': + resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + + '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': + resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@napi-rs/tar-linux-arm64-gnu@0.1.1': + resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/tar-linux-arm64-musl@0.1.1': + resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/tar-linux-x64-gnu@0.1.1': + resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/tar-linux-x64-musl@0.1.1': + resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/tar-wasm32-wasi@0.1.1': + resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@napi-rs/tar-win32-arm64-msvc@0.1.1': + resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@napi-rs/tar-win32-ia32-msvc@0.1.1': + resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@napi-rs/tar-win32-x64-msvc@0.1.1': + resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@napi-rs/tar@0.1.1': + resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} + engines: {node: '>= 10'} + + '@napi-rs/wasm-runtime@0.2.4': + resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} + + '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': + resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + + '@napi-rs/wasm-tools-android-arm64@0.0.2': + resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + + '@napi-rs/wasm-tools-darwin-arm64@0.0.2': + resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@napi-rs/wasm-tools-darwin-x64@0.0.2': + resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@napi-rs/wasm-tools-freebsd-x64@0.0.2': + resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + + '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': + resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': + resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': + resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': + resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': + resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': + resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': + resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': + resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@napi-rs/wasm-tools@0.0.2': + resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} + engines: {node: '>= 10'} '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} @@ -1993,6 +2292,58 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@octokit/auth-token@4.0.0': + resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} + engines: {node: '>= 18'} + + '@octokit/core@5.2.0': + resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} + engines: {node: '>= 18'} + + '@octokit/endpoint@9.0.5': + resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} + engines: {node: '>= 18'} + + '@octokit/graphql@7.1.0': + resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} + engines: {node: '>= 18'} + + '@octokit/openapi-types@22.2.0': + resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} + + '@octokit/plugin-paginate-rest@11.3.1': + resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '5' + + '@octokit/plugin-request-log@4.0.1': + resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '5' + + '@octokit/plugin-rest-endpoint-methods@13.2.2': + resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': ^5 + + '@octokit/request-error@5.1.0': + resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} + engines: {node: '>= 18'} + + '@octokit/request@8.4.0': + resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} + engines: {node: '>= 18'} + + '@octokit/rest@20.1.1': + resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} + engines: {node: '>= 18'} + + '@octokit/types@13.5.0': + resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} + '@one-ini/wasm@0.1.1': resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} @@ -2286,6 +2637,9 @@ packages: '@twemoji/parser@15.0.0': resolution: {integrity: sha512-lh9515BNsvKSNvyUqbj5yFu83iIDQ77SwVcsN/SnEGawczhsKU6qWuogewN1GweTi5Imo5ToQ9s+nNTf97IXvg==} + '@tybys/wasm-util@0.9.0': + resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} + '@types/accepts@1.3.7': resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} @@ -3109,6 +3463,9 @@ packages: bcrypt-pbkdf@1.0.2: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} + before-after-hook@2.2.3: + resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} + bin-check@4.1.0: resolution: {integrity: sha512-b6weQyEUKsDGFlACWSIOfveEnImkJyK/FGW6FAG42loyoquvjdtOIqO6yBFzHyqyVVhNgNkQxxx09SFLK28YnA==} engines: {node: '>=4'} @@ -3311,6 +3668,9 @@ packages: character-reference-invalid@1.1.4: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + chart.js@4.4.3: resolution: {integrity: sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw==} engines: {pnpm: '>=8'} @@ -3379,6 +3739,15 @@ packages: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + clipanion@3.2.1: + resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} + peerDependencies: + typanion: '*' + cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} @@ -3437,6 +3806,9 @@ packages: colorette@1.4.0: resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} + colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -3928,6 +4300,9 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} + deprecation@2.3.1: + resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} + destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -4508,6 +4883,10 @@ packages: resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} engines: {node: '>=0.10.0'} + external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + extsprintf@1.3.0: resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} engines: {'0': node >=0.6.0} @@ -5028,6 +5407,10 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + inquirer@9.2.23: + resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} + engines: {node: '>=18'} + insert-text-at-cursor@0.3.0: resolution: {integrity: sha512-/nPtyeX9xPUvxZf+r0518B7uqNKlP+LqNJqSiXFEaa2T71rWIwTVXGH7hB9xO/EVdwa5/pWlFCPwShOW81XIxQ==} @@ -5717,6 +6100,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash-es@4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + lodash.assignin@4.2.0: resolution: {integrity: sha512-yX/rx6d/UTVh7sSVWVSIMjfnz95evAgDFdb1ZozC35I9mSFCkmzptOzevxjgbQUsc78NR44LVHWjsoMQXy9FDg==} @@ -5992,6 +6378,10 @@ packages: resolution: {integrity: sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==} engines: {node: '>= 6.0.0'} + mute-stream@1.0.0: + resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -6197,6 +6587,10 @@ packages: resolution: {integrity: sha512-uksVLsqG3pVdzzPvmAHpBK0wKxYItuzZr7SziusRPoz67tGV8rL1szZ6IdeUrbqLjGDwApBtN29eEE3IqGHOjg==} engines: {node: '>=4'} + os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + otpauth@9.3.1: resolution: {integrity: sha512-E6d2tMxPofHNk4sRFp+kqW7vQ+WJGO9VLI2N/W00DnI+ThskU12Qa10kyNSGklrzhN5c+wRUsN4GijVgCU2N9w==} @@ -6875,9 +7269,16 @@ packages: rss-parser@3.13.0: resolution: {integrity: sha512-7jWUBV5yGN3rqMMj7CZufl/291QAhvrrGpDNE4k/02ZchL0npisiYYqULF71jCEKoIiHvK/Q2e6IkDwPziT7+w==} + run-async@3.0.0: + resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} + engines: {node: '>=0.12.0'} + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + rxjs@7.8.1: + resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} + s-age@1.1.2: resolution: {integrity: sha512-aSN2TlF39WLoZA/6cgYSJZhKt63kJ4EaadejPWjWY9/h4rksIqvfWY3gfd+3uAegSM1IXsA9aWeEhJtkxkFQtA==} @@ -7354,6 +7755,10 @@ packages: engines: {node: '>= 12.10.0', npm: '>= 6.12.0', yarn: '>= 1.20.0'} hasBin: true + tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + tmp@0.2.3: resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} engines: {node: '>=14.14'} @@ -7383,6 +7788,9 @@ packages: resolution: {integrity: sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==} engines: {node: '>=14.16'} + toml@3.0.0: + resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} + tough-cookie@4.1.4: resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==} engines: {node: '>=6'} @@ -7511,6 +7919,9 @@ packages: tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} + typanion@3.14.0: + resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -7673,6 +8084,9 @@ packages: unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + universal-user-agent@6.0.1: + resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -7855,6 +8269,9 @@ packages: wasm-feature-detect@1.6.1: resolution: {integrity: sha512-R1i9ED8UlLu/foILNB1ck9XS63vdtqU/tP1MCugVekETp/ySCrBZRk5I/zI67cI1wlQYeSonNm1PLjDHZDNg6g==} + wasm-sjlj@1.0.5: + resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} + watchpack@2.4.1: resolution: {integrity: sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==} engines: {node: '>=10.13.0'} @@ -8563,11 +8980,22 @@ snapshots: jsonfile: 5.0.0 universalify: 0.1.2 + '@emnapi/core@1.2.0': + dependencies: + '@emnapi/wasi-threads': 1.0.1 + tslib: 2.6.3 + optional: true + '@emnapi/runtime@1.2.0': dependencies: tslib: 2.6.3 optional: true + '@emnapi/wasi-threads@1.0.1': + dependencies: + tslib: 2.6.3 + optional: true + '@es-joy/jsdoccomment@0.43.1': dependencies: '@types/eslint': 8.56.10 @@ -8933,6 +9361,8 @@ snapshots: '@img/sharp-win32-x64@0.33.4': optional: true + '@inquirer/figures@1.0.3': {} + '@ioredis/commands@1.2.0': {} '@isaacs/cliui@8.0.2': @@ -9270,6 +9700,10 @@ snapshots: - walrus - whiskers + '@ljharb/through@2.3.13': + dependencies: + call-bind: 1.0.7 + '@microsoft/tsdoc-config@0.16.2': dependencies: '@microsoft/tsdoc': 0.14.2 @@ -9310,7 +9744,225 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true - '@napi-rs/cli@2.18.3': {} + '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)': + dependencies: + '@napi-rs/cross-toolchain': 0.0.16 + '@napi-rs/wasm-tools': 0.0.2 + '@octokit/rest': 20.1.1 + clipanion: 3.2.1(typanion@3.14.0) + colorette: 2.0.20 + debug: 4.3.5 + inquirer: 9.2.23 + js-yaml: 4.1.0 + lodash-es: 4.17.21 + semver: 7.6.2 + toml: 3.0.0 + typanion: 3.14.0 + wasm-sjlj: 1.0.5 + optionalDependencies: + '@emnapi/runtime': 1.2.0 + transitivePeerDependencies: + - '@napi-rs/cross-toolchain-arm64-target-aarch64' + - '@napi-rs/cross-toolchain-arm64-target-armv7' + - '@napi-rs/cross-toolchain-arm64-target-x86_64' + - '@napi-rs/cross-toolchain-x64-target-aarch64' + - '@napi-rs/cross-toolchain-x64-target-armv7' + - '@napi-rs/cross-toolchain-x64-target-x86_64' + - supports-color + + '@napi-rs/cross-toolchain@0.0.16': + dependencies: + '@napi-rs/lzma': 1.3.1 + '@napi-rs/tar': 0.1.1 + debug: 4.3.5 + transitivePeerDependencies: + - supports-color + + '@napi-rs/lzma-android-arm-eabi@1.3.1': + optional: true + + '@napi-rs/lzma-android-arm64@1.3.1': + optional: true + + '@napi-rs/lzma-darwin-arm64@1.3.1': + optional: true + + '@napi-rs/lzma-darwin-x64@1.3.1': + optional: true + + '@napi-rs/lzma-freebsd-x64@1.3.1': + optional: true + + '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': + optional: true + + '@napi-rs/lzma-linux-arm64-gnu@1.3.1': + optional: true + + '@napi-rs/lzma-linux-arm64-musl@1.3.1': + optional: true + + '@napi-rs/lzma-linux-x64-gnu@1.3.1': + optional: true + + '@napi-rs/lzma-linux-x64-musl@1.3.1': + optional: true + + '@napi-rs/lzma-wasm32-wasi@1.3.1': + dependencies: + '@napi-rs/wasm-runtime': 0.2.4 + optional: true + + '@napi-rs/lzma-win32-arm64-msvc@1.3.1': + optional: true + + '@napi-rs/lzma-win32-ia32-msvc@1.3.1': + optional: true + + '@napi-rs/lzma-win32-x64-msvc@1.3.1': + optional: true + + '@napi-rs/lzma@1.3.1': + optionalDependencies: + '@napi-rs/lzma-android-arm-eabi': 1.3.1 + '@napi-rs/lzma-android-arm64': 1.3.1 + '@napi-rs/lzma-darwin-arm64': 1.3.1 + '@napi-rs/lzma-darwin-x64': 1.3.1 + '@napi-rs/lzma-freebsd-x64': 1.3.1 + '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 + '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 + '@napi-rs/lzma-linux-arm64-musl': 1.3.1 + '@napi-rs/lzma-linux-x64-gnu': 1.3.1 + '@napi-rs/lzma-linux-x64-musl': 1.3.1 + '@napi-rs/lzma-wasm32-wasi': 1.3.1 + '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 + '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 + '@napi-rs/lzma-win32-x64-msvc': 1.3.1 + + '@napi-rs/tar-android-arm-eabi@0.1.1': + optional: true + + '@napi-rs/tar-android-arm64@0.1.1': + optional: true + + '@napi-rs/tar-darwin-arm64@0.1.1': + optional: true + + '@napi-rs/tar-darwin-x64@0.1.1': + optional: true + + '@napi-rs/tar-freebsd-x64@0.1.1': + optional: true + + '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': + optional: true + + '@napi-rs/tar-linux-arm64-gnu@0.1.1': + optional: true + + '@napi-rs/tar-linux-arm64-musl@0.1.1': + optional: true + + '@napi-rs/tar-linux-x64-gnu@0.1.1': + optional: true + + '@napi-rs/tar-linux-x64-musl@0.1.1': + optional: true + + '@napi-rs/tar-wasm32-wasi@0.1.1': + dependencies: + '@napi-rs/wasm-runtime': 0.2.4 + optional: true + + '@napi-rs/tar-win32-arm64-msvc@0.1.1': + optional: true + + '@napi-rs/tar-win32-ia32-msvc@0.1.1': + optional: true + + '@napi-rs/tar-win32-x64-msvc@0.1.1': + optional: true + + '@napi-rs/tar@0.1.1': + optionalDependencies: + '@napi-rs/tar-android-arm-eabi': 0.1.1 + '@napi-rs/tar-android-arm64': 0.1.1 + '@napi-rs/tar-darwin-arm64': 0.1.1 + '@napi-rs/tar-darwin-x64': 0.1.1 + '@napi-rs/tar-freebsd-x64': 0.1.1 + '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 + '@napi-rs/tar-linux-arm64-gnu': 0.1.1 + '@napi-rs/tar-linux-arm64-musl': 0.1.1 + '@napi-rs/tar-linux-x64-gnu': 0.1.1 + '@napi-rs/tar-linux-x64-musl': 0.1.1 + '@napi-rs/tar-wasm32-wasi': 0.1.1 + '@napi-rs/tar-win32-arm64-msvc': 0.1.1 + '@napi-rs/tar-win32-ia32-msvc': 0.1.1 + '@napi-rs/tar-win32-x64-msvc': 0.1.1 + + '@napi-rs/wasm-runtime@0.2.4': + dependencies: + '@emnapi/core': 1.2.0 + '@emnapi/runtime': 1.2.0 + '@tybys/wasm-util': 0.9.0 + optional: true + + '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': + optional: true + + '@napi-rs/wasm-tools-android-arm64@0.0.2': + optional: true + + '@napi-rs/wasm-tools-darwin-arm64@0.0.2': + optional: true + + '@napi-rs/wasm-tools-darwin-x64@0.0.2': + optional: true + + '@napi-rs/wasm-tools-freebsd-x64@0.0.2': + optional: true + + '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': + optional: true + + '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': + optional: true + + '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': + optional: true + + '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': + optional: true + + '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': + dependencies: + '@napi-rs/wasm-runtime': 0.2.4 + optional: true + + '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': + optional: true + + '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': + optional: true + + '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': + optional: true + + '@napi-rs/wasm-tools@0.0.2': + optionalDependencies: + '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 + '@napi-rs/wasm-tools-android-arm64': 0.0.2 + '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 + '@napi-rs/wasm-tools-darwin-x64': 0.0.2 + '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 + '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 + '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 + '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 + '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 + '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 + '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 + '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 + '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': dependencies: @@ -9330,6 +9982,69 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@octokit/auth-token@4.0.0': {} + + '@octokit/core@5.2.0': + dependencies: + '@octokit/auth-token': 4.0.0 + '@octokit/graphql': 7.1.0 + '@octokit/request': 8.4.0 + '@octokit/request-error': 5.1.0 + '@octokit/types': 13.5.0 + before-after-hook: 2.2.3 + universal-user-agent: 6.0.1 + + '@octokit/endpoint@9.0.5': + dependencies: + '@octokit/types': 13.5.0 + universal-user-agent: 6.0.1 + + '@octokit/graphql@7.1.0': + dependencies: + '@octokit/request': 8.4.0 + '@octokit/types': 13.5.0 + universal-user-agent: 6.0.1 + + '@octokit/openapi-types@22.2.0': {} + + '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': + dependencies: + '@octokit/core': 5.2.0 + '@octokit/types': 13.5.0 + + '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': + dependencies: + '@octokit/core': 5.2.0 + + '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': + dependencies: + '@octokit/core': 5.2.0 + '@octokit/types': 13.5.0 + + '@octokit/request-error@5.1.0': + dependencies: + '@octokit/types': 13.5.0 + deprecation: 2.3.1 + once: 1.4.0 + + '@octokit/request@8.4.0': + dependencies: + '@octokit/endpoint': 9.0.5 + '@octokit/request-error': 5.1.0 + '@octokit/types': 13.5.0 + universal-user-agent: 6.0.1 + + '@octokit/rest@20.1.1': + dependencies: + '@octokit/core': 5.2.0 + '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) + '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) + '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) + + '@octokit/types@13.5.0': + dependencies: + '@octokit/openapi-types': 22.2.0 + '@one-ini/wasm@0.1.1': {} '@peertube/http-signature@1.7.0': @@ -9564,6 +10279,11 @@ snapshots: '@twemoji/parser@15.0.0': {} + '@tybys/wasm-util@0.9.0': + dependencies: + tslib: 2.6.3 + optional: true + '@types/accepts@1.3.7': dependencies: '@types/node': 20.14.3 @@ -10670,6 +11390,8 @@ snapshots: dependencies: tweetnacl: 0.14.5 + before-after-hook@2.2.3: {} + bin-check@4.1.0: dependencies: execa: 0.7.0 @@ -10903,6 +11625,8 @@ snapshots: character-reference-invalid@1.1.4: {} + chardet@0.7.0: {} + chart.js@4.4.3: dependencies: '@kurkle/color': 0.3.2 @@ -10997,6 +11721,12 @@ snapshots: cli-spinners@2.9.2: {} + cli-width@4.1.0: {} + + clipanion@3.2.1(typanion@3.14.0): + dependencies: + typanion: 3.14.0 + cliui@6.0.0: dependencies: string-width: 4.2.3 @@ -11066,6 +11796,8 @@ snapshots: colorette@1.4.0: {} + colorette@2.0.20: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 @@ -11417,6 +12149,8 @@ snapshots: depd@2.0.0: {} + deprecation@2.3.1: {} + destroy@1.2.0: {} detect-libc@2.0.3: {} @@ -12297,6 +13031,12 @@ snapshots: dependencies: is-extendable: 0.1.1 + external-editor@3.1.0: + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + extsprintf@1.3.0: {} fast-blurhash@1.1.2: {} @@ -12858,6 +13598,24 @@ snapshots: ini@1.3.8: {} + inquirer@9.2.23: + dependencies: + '@inquirer/figures': 1.0.3 + '@ljharb/through': 2.3.13 + ansi-escapes: 4.3.2 + chalk: 5.3.0 + cli-cursor: 3.1.0 + cli-width: 4.1.0 + external-editor: 3.1.0 + lodash: 4.17.21 + mute-stream: 1.0.0 + ora: 5.4.1 + run-async: 3.0.0 + rxjs: 7.8.1 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + insert-text-at-cursor@0.3.0: {} internal-slot@1.0.7: @@ -13932,6 +14690,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash-es@4.17.21: {} + lodash.assignin@4.2.0: {} lodash.bind@4.2.1: {} @@ -14205,6 +14965,8 @@ snapshots: type-is: 1.6.18 xtend: 4.0.2 + mute-stream@1.0.0: {} + mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -14405,6 +15167,8 @@ snapshots: dependencies: arch: 2.2.0 + os-tmpdir@1.0.2: {} + otpauth@9.3.1: dependencies: '@noble/hashes': 1.4.0 @@ -15097,10 +15861,16 @@ snapshots: entities: 2.2.0 xml2js: 0.5.0 + run-async@3.0.0: {} + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 + rxjs@7.8.1: + dependencies: + tslib: 2.6.3 + s-age@1.1.2: {} safe-array-concat@1.1.2: @@ -15637,6 +16407,10 @@ snapshots: tinyld@1.3.4: {} + tmp@0.0.33: + dependencies: + os-tmpdir: 1.0.2 + tmp@0.2.3: {} tmpl@1.0.5: {} @@ -15658,6 +16432,8 @@ snapshots: '@tokenizer/token': 0.3.0 ieee754: 1.2.1 + toml@3.0.0: {} + tough-cookie@4.1.4: dependencies: psl: 1.9.0 @@ -15791,6 +16567,8 @@ snapshots: tweetnacl@0.14.5: {} + typanion@3.14.0: {} + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 @@ -15918,6 +16696,8 @@ snapshots: dependencies: '@types/unist': 2.0.10 + universal-user-agent@6.0.1: {} + universalify@0.1.2: {} universalify@0.2.0: {} @@ -16085,6 +16865,8 @@ snapshots: wasm-feature-detect@1.6.1: {} + wasm-sjlj@1.0.5: {} + watchpack@2.4.1: dependencies: glob-to-regexp: 0.4.1