refactor? (backend): move consts to backend-rs
This commit is contained in:
parent
5891a90f71
commit
b9c3dfbd3d
61 changed files with 179 additions and 194 deletions
19
packages/backend-rs/index.d.ts
vendored
19
packages/backend-rs/index.d.ts
vendored
|
@ -3,6 +3,21 @@
|
|||
|
||||
/* auto-generated by NAPI-RS */
|
||||
|
||||
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 <- we need to fix this and later allow it to be viewed directly
|
||||
* https://github.com/sindresorhus/file-type/blob/main/supported.js
|
||||
* https://github.com/sindresorhus/file-type/blob/main/core.js
|
||||
* https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
||||
*/
|
||||
export const FILE_TYPE_BROWSERSAFE: string[]
|
||||
export interface EnvConfig {
|
||||
onlyQueue: boolean
|
||||
onlyServer: boolean
|
||||
|
@ -160,8 +175,8 @@ export interface Config {
|
|||
reservedUsernames?: Array<string>
|
||||
maxUserSignups?: number
|
||||
isManagedHosting?: boolean
|
||||
maxNoteLength?: number
|
||||
maxCaptionLength?: number
|
||||
maxNoteLength: number
|
||||
maxCaptionLength: number
|
||||
deepl?: DeepLConfig
|
||||
libreTranslate?: LibreTranslateConfig
|
||||
email?: EmailConfig
|
||||
|
|
|
@ -310,8 +310,15 @@ if (!nativeBinding) {
|
|||
throw new Error(`Failed to load native binding`)
|
||||
}
|
||||
|
||||
const { loadEnv, loadConfig, stringToAcct, acctToString, addNoteToAntenna, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getNoteSummary, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, AntennaSrcEnum, DriveFileUsageHintEnum, MutedNoteReasonEnum, NoteVisibilityEnum, NotificationTypeEnum, PageVisibilityEnum, PollNotevisibilityEnum, RelayStatusEnum, UserEmojimodpermEnum, UserProfileFfvisibilityEnum, UserProfileMutingnotificationtypesEnum, initializeRustLogger, watchNote, unwatchNote, ChatEvent, publishToChatStream, getTimestamp, genId, genIdAt, secureRndstr } = nativeBinding
|
||||
const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, loadEnv, loadConfig, stringToAcct, acctToString, addNoteToAntenna, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getNoteSummary, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, AntennaSrcEnum, DriveFileUsageHintEnum, MutedNoteReasonEnum, NoteVisibilityEnum, NotificationTypeEnum, PageVisibilityEnum, PollNotevisibilityEnum, RelayStatusEnum, UserEmojimodpermEnum, UserProfileFfvisibilityEnum, UserProfileMutingnotificationtypesEnum, initializeRustLogger, watchNote, unwatchNote, ChatEvent, publishToChatStream, getTimestamp, genId, genIdAt, secureRndstr } = 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.loadEnv = loadEnv
|
||||
module.exports.loadConfig = loadConfig
|
||||
module.exports.stringToAcct = stringToAcct
|
||||
|
|
67
packages/backend-rs/src/config/constant.rs
Normal file
67
packages/backend-rs/src/config/constant.rs
Normal file
|
@ -0,0 +1,67 @@
|
|||
#[crate::export]
|
||||
pub const SECOND: i32 = 1000;
|
||||
#[crate::export]
|
||||
pub const MINUTE: i32 = 60 * SECOND;
|
||||
#[crate::export]
|
||||
pub const HOUR: i32 = 60 * MINUTE;
|
||||
#[crate::export]
|
||||
pub const DAY: i32 = 24 * HOUR;
|
||||
|
||||
#[crate::export]
|
||||
pub const USER_ONLINE_THRESHOLD: i32 = 10 * MINUTE;
|
||||
#[crate::export]
|
||||
pub const USER_ACTIVE_THRESHOLD: i32 = 3 * DAY;
|
||||
|
||||
/// 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 <- we need to fix this and later allow it to be viewed directly
|
||||
/// https://github.com/sindresorhus/file-type/blob/main/supported.js
|
||||
/// https://github.com/sindresorhus/file-type/blob/main/core.js
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
||||
#[crate::export]
|
||||
pub const FILE_TYPE_BROWSERSAFE: [&str; 41] = [
|
||||
// Images
|
||||
"image/png",
|
||||
"image/gif", // TODO: deprecated, but still used by old posts, new gifs should be converted to webp in the future
|
||||
"image/jpeg",
|
||||
"image/webp", // TODO: make this the default image format
|
||||
"image/apng",
|
||||
"image/bmp",
|
||||
"image/tiff",
|
||||
"image/x-icon",
|
||||
"image/avif", // not as good supported now, but its good to introduce initial support for the future
|
||||
// OggS
|
||||
"audio/opus",
|
||||
"video/ogg",
|
||||
"audio/ogg",
|
||||
"application/ogg",
|
||||
// ISO/IEC base media file format
|
||||
"video/quicktime",
|
||||
"video/mp4", // TODO: we need to check for av1 later
|
||||
"video/vnd.avi", // also av1
|
||||
"audio/mp4",
|
||||
"video/x-m4v",
|
||||
"audio/x-m4a",
|
||||
"video/3gpp",
|
||||
"video/3gpp2",
|
||||
"video/3gp2",
|
||||
"audio/3gpp",
|
||||
"audio/3gpp2",
|
||||
"audio/3gp2",
|
||||
"video/mpeg",
|
||||
"audio/mpeg",
|
||||
"video/webm",
|
||||
"audio/webm",
|
||||
"audio/aac",
|
||||
"audio/x-flac",
|
||||
"audio/flac",
|
||||
"audio/vnd.wave",
|
||||
"audio/mod",
|
||||
"audio/x-mod",
|
||||
"audio/s3m",
|
||||
"audio/x-s3m",
|
||||
"audio/xm",
|
||||
"audio/x-xm",
|
||||
"audio/it",
|
||||
"audio/x-it",
|
||||
];
|
|
@ -1,4 +1,5 @@
|
|||
pub use server::CONFIG;
|
||||
|
||||
pub mod constant;
|
||||
pub mod environment;
|
||||
pub mod server;
|
||||
|
|
|
@ -200,8 +200,10 @@ pub struct Config {
|
|||
pub inbox_job_per_sec: Option<u32>,
|
||||
pub deliver_job_max_attempts: Option<u32>,
|
||||
pub inbox_job_max_attempts: Option<u32>,
|
||||
|
||||
/// deprecated
|
||||
pub log_level: Option<Vec<String>>,
|
||||
|
||||
pub max_log_level: Option<String>,
|
||||
pub syslog: Option<SysLogConfig>,
|
||||
pub proxy_remote_files: Option<bool>,
|
||||
|
@ -210,8 +212,8 @@ pub struct Config {
|
|||
pub reserved_usernames: Option<Vec<String>>,
|
||||
pub max_user_signups: Option<u32>,
|
||||
pub is_managed_hosting: Option<bool>,
|
||||
pub max_note_length: Option<u32>,
|
||||
pub max_caption_length: Option<u32>,
|
||||
pub max_note_length: u32,
|
||||
pub max_caption_length: u32,
|
||||
pub deepl: Option<DeepLConfig>,
|
||||
pub libre_translate: Option<LibreTranslateConfig>,
|
||||
pub email: Option<EmailConfig>,
|
||||
|
@ -359,8 +361,8 @@ fn load_config() -> Config {
|
|||
reserved_usernames: server_config.reserved_usernames,
|
||||
max_user_signups: server_config.max_user_signups,
|
||||
is_managed_hosting: server_config.is_managed_hosting,
|
||||
max_note_length: server_config.max_note_length,
|
||||
max_caption_length: server_config.max_caption_length,
|
||||
max_note_length: server_config.max_note_length.unwrap_or(3000),
|
||||
max_caption_length: server_config.max_caption_length.unwrap_or(1500),
|
||||
deepl: server_config.deepl,
|
||||
libre_translate: server_config.libre_translate,
|
||||
email: server_config.email,
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
import { config } from "@/config.js";
|
||||
import {
|
||||
DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||
DB_MAX_NOTE_TEXT_LENGTH,
|
||||
} from "@/misc/hard-limits.js";
|
||||
|
||||
export const MAX_NOTE_TEXT_LENGTH = Math.min(
|
||||
config.maxNoteLength ?? 3000,
|
||||
DB_MAX_NOTE_TEXT_LENGTH,
|
||||
);
|
||||
export const MAX_CAPTION_TEXT_LENGTH = Math.min(
|
||||
config.maxCaptionLength ?? 1500,
|
||||
DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||
);
|
||||
|
||||
export const SECOND = 1000;
|
||||
export const MINUTE = 60 * SECOND;
|
||||
export const HOUR = 60 * MINUTE;
|
||||
export const DAY = 24 * HOUR;
|
||||
|
||||
export const USER_ONLINE_THRESHOLD = 10 * MINUTE;
|
||||
export const USER_ACTIVE_THRESHOLD = 3 * DAY;
|
||||
|
||||
// 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 <- we need to fix this and later allow it to be viewed directly
|
||||
export const FILE_TYPE_BROWSERSAFE = [
|
||||
// Images
|
||||
"image/png",
|
||||
"image/gif", // TODO: deprecated, but still used by old notes, new gifs should be converted to webp in the future
|
||||
"image/jpeg",
|
||||
"image/webp", // TODO: make this the default image format
|
||||
"image/apng",
|
||||
"image/bmp",
|
||||
"image/tiff",
|
||||
"image/x-icon",
|
||||
"image/avif", // not as good supported now, but its good to introduce initial support for the future
|
||||
|
||||
// OggS
|
||||
"audio/opus",
|
||||
"video/ogg",
|
||||
"audio/ogg",
|
||||
"application/ogg",
|
||||
|
||||
// ISO/IEC base media file format
|
||||
"video/quicktime",
|
||||
"video/mp4", // TODO: we need to check for av1 later
|
||||
"video/vnd.avi", // also av1
|
||||
"audio/mp4",
|
||||
"video/x-m4v",
|
||||
"audio/x-m4a",
|
||||
"video/3gpp",
|
||||
"video/3gpp2",
|
||||
"video/3gp2",
|
||||
"audio/3gpp",
|
||||
"audio/3gpp2",
|
||||
"audio/3gp2",
|
||||
|
||||
"video/mpeg",
|
||||
"audio/mpeg",
|
||||
|
||||
"video/webm",
|
||||
"audio/webm",
|
||||
|
||||
"audio/aac",
|
||||
"audio/x-flac",
|
||||
"audio/flac",
|
||||
"audio/vnd.wave",
|
||||
|
||||
"audio/mod",
|
||||
"audio/x-mod",
|
||||
"audio/s3m",
|
||||
"audio/x-s3m",
|
||||
"audio/xm",
|
||||
"audio/x-xm",
|
||||
"audio/it",
|
||||
"audio/x-it",
|
||||
];
|
||||
/*
|
||||
https://github.com/sindresorhus/file-type/blob/main/supported.js
|
||||
https://github.com/sindresorhus/file-type/blob/main/core.js
|
||||
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
||||
*/
|
|
@ -1,7 +1,7 @@
|
|||
import probeImageSize from "probe-image-size";
|
||||
import { Mutex } from "redis-semaphore";
|
||||
|
||||
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "backend-rs";
|
||||
import Logger from "@/services/logger.js";
|
||||
import { Cache } from "./cache.js";
|
||||
import { redisClient } from "@/db/redis.js";
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
// If you change DB_* values, you must also change the DB schema.
|
||||
|
||||
/**
|
||||
* Maximum note text length that can be stored in DB.
|
||||
* Surrogate pairs count as one
|
||||
*
|
||||
* NOTE: this can hypothetically be pushed further
|
||||
* (up to 250000000), but will likely cause truncations
|
||||
* and incompatibilities with other servers,
|
||||
* as well as potential performance issues.
|
||||
*/
|
||||
export const DB_MAX_NOTE_TEXT_LENGTH = 100000;
|
||||
|
||||
/**
|
||||
* Maximum image description length that can be stored in DB.
|
||||
* Surrogate pairs count as one
|
||||
*/
|
||||
export const DB_MAX_IMAGE_COMMENT_LENGTH = 8192;
|
|
@ -1,4 +1,4 @@
|
|||
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "backend-rs";
|
||||
|
||||
const dictionary = {
|
||||
"safe-file": FILE_TYPE_BROWSERSAFE,
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Brackets } from "typeorm";
|
|||
import { isBlockedServer } from "backend-rs";
|
||||
import { Instances } from "@/models/index.js";
|
||||
import type { Instance } from "@/models/entities/instance.js";
|
||||
import { DAY } from "@/const.js";
|
||||
import { DAY } from "backend-rs";
|
||||
|
||||
// Threshold from last contact after which an instance will be considered
|
||||
// "dead" and should no longer get activities delivered to it.
|
||||
|
|
|
@ -13,7 +13,6 @@ import { id } from "../id.js";
|
|||
import { Note } from "./note.js";
|
||||
import { User } from "./user.js";
|
||||
import { DriveFolder } from "./drive-folder.js";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { NoteFile } from "./note-file.js";
|
||||
|
||||
export type DriveFileUsageHint = "userAvatar" | "userBanner" | null;
|
||||
|
@ -73,7 +72,7 @@ export class DriveFile {
|
|||
|
||||
@Index() // USING pgroonga pgroonga_varchar_full_text_search_ops_v2
|
||||
@Column("varchar", {
|
||||
length: DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||
length: 8192,
|
||||
nullable: true,
|
||||
comment: "The comment of the DriveFile.",
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@ import type { Packed } from "@/misc/schema.js";
|
|||
import type { Promiseable } from "@/prelude/await-all.js";
|
||||
import { awaitAll } from "@/prelude/await-all.js";
|
||||
import { populateEmojis } from "@/misc/populate-emojis.js";
|
||||
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "@/const.js";
|
||||
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from "backend-rs";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
import { isActor, getApId } from "@/remote/activitypub/type.js";
|
||||
|
|
|
@ -9,7 +9,7 @@ import type {
|
|||
} from "@/models/entities/drive-file.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { truncate } from "@/misc/truncate.js";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { config } from "@/config.js";
|
||||
|
||||
/**
|
||||
* create an Image.
|
||||
|
@ -44,7 +44,7 @@ export async function createImage(
|
|||
uri: image.url,
|
||||
sensitive: image.sensitive,
|
||||
isLink: !instance.cacheRemoteFiles,
|
||||
comment: truncate(image.name, DB_MAX_IMAGE_COMMENT_LENGTH),
|
||||
comment: truncate(image.name, config.maxCaptionLength),
|
||||
usageHint: usage,
|
||||
});
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ import { publishNoteStream } from "@/services/stream.js";
|
|||
import { extractHashtags } from "@/misc/extract-hashtags.js";
|
||||
import { UserProfiles } from "@/models/index.js";
|
||||
import { In } from "typeorm";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { config } from "@/config.js";
|
||||
import { truncate } from "@/misc/truncate.js";
|
||||
import { type Size, getEmojiSize } from "@/misc/emoji-meta.js";
|
||||
import { langmap } from "@/misc/langmap.js";
|
||||
|
@ -622,7 +622,7 @@ export async function updateNote(value: string | IObject, resolver?: Resolver) {
|
|||
const file = await resolveImage(actor, x, null);
|
||||
const update: Partial<DriveFile> = {};
|
||||
|
||||
const altText = truncate(x.name, DB_MAX_IMAGE_COMMENT_LENGTH);
|
||||
const altText = truncate(x.name, config.maxCaptionLength);
|
||||
if (file.comment !== altText) {
|
||||
update.comment = altText;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { config } from "@/config.js";
|
||||
import { fetchMeta } from "backend-rs";
|
||||
import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
|
@ -506,8 +505,8 @@ export default define(meta, paramDef, async () => {
|
|||
iconUrl: instance.iconUrl,
|
||||
backgroundImageUrl: instance.backgroundImageUrl,
|
||||
logoImageUrl: instance.logoImageUrl,
|
||||
maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, // 後方互換性のため
|
||||
maxCaptionTextLength: MAX_CAPTION_TEXT_LENGTH,
|
||||
maxNoteTextLength: config.maxNoteLength, // for backward compatibility
|
||||
maxCaptionTextLength: config.maxCaptionLength,
|
||||
defaultLightTheme: instance.defaultLightTheme,
|
||||
defaultDarkTheme: instance.defaultDarkTheme,
|
||||
enableEmail: instance.enableEmail,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import Resolver from "@/remote/activitypub/resolver.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["federation"],
|
||||
|
|
|
@ -4,13 +4,12 @@ import { createNote } from "@/remote/activitypub/models/note.js";
|
|||
import DbResolver from "@/remote/activitypub/db-resolver.js";
|
||||
import Resolver from "@/remote/activitypub/resolver.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { extractHost, isBlockedServer } from "backend-rs";
|
||||
import { MINUTE, extractHost, isBlockedServer } from "backend-rs";
|
||||
import { Users, Notes } from "@/models/index.js";
|
||||
import type { Note } from "@/models/entities/note.js";
|
||||
import type { CacheableLocalUser, User } from "@/models/entities/user.js";
|
||||
import { isActor, isPost, getApId } from "@/remote/activitypub/type.js";
|
||||
import type { SchemaType } from "@/misc/schema.js";
|
||||
import { MINUTE } from "@/const.js";
|
||||
import { updateQuestion } from "@/remote/activitypub/models/question.js";
|
||||
import { populatePoll } from "@/models/repositories/note.js";
|
||||
import { redisClient } from "@/db/redis.js";
|
||||
|
|
|
@ -3,7 +3,7 @@ import define from "@/server/api/define.js";
|
|||
import { ApiError } from "@/server/api/error.js";
|
||||
import { getUser } from "@/server/api/common/getters.js";
|
||||
import { Blockings, NoteWatchings, Users } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["account"],
|
||||
|
|
|
@ -3,7 +3,7 @@ import define from "@/server/api/define.js";
|
|||
import { ApiError } from "@/server/api/error.js";
|
||||
import { getUser } from "@/server/api/common/getters.js";
|
||||
import { Blockings, Users } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["account"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Emojis } from "@/models/index.js";
|
||||
import type { Emoji } from "@/models/entities/emoji.js";
|
||||
import { IsNull, In } from "typeorm";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "backend-rs";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import { addFile } from "@/services/drive/add-file.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { config } from "@/config.js";
|
||||
import { IdentifiableError } from "@/misc/identifiable-error.js";
|
||||
import { fetchMeta } from "backend-rs";
|
||||
import { MINUTE } from "@/const.js";
|
||||
import { MINUTE, fetchMeta } from "backend-rs";
|
||||
import define from "@/server/api/define.js";
|
||||
import { apiLogger } from "@/server/api/logger.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
@ -68,7 +67,7 @@ export const paramDef = {
|
|||
comment: {
|
||||
type: "string",
|
||||
nullable: true,
|
||||
maxLength: DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||
maxLength: config.maxCaptionLength,
|
||||
default: null,
|
||||
},
|
||||
isSensitive: { type: "boolean", default: false },
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { publishDriveStream } from "@/services/stream.js";
|
||||
import { DriveFiles, DriveFolders, Users } from "@/models/index.js";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
|
||||
import { DriveFiles, DriveFolders } from "@/models/index.js";
|
||||
import { config } from "@/config.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
||||
|
@ -57,7 +57,7 @@ export const paramDef = {
|
|||
comment: {
|
||||
type: "string",
|
||||
nullable: true,
|
||||
maxLength: DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||
maxLength: config.maxCaptionLength,
|
||||
},
|
||||
},
|
||||
required: ["fileId"],
|
||||
|
|
|
@ -2,7 +2,7 @@ import { uploadFromUrl } from "@/services/drive/upload-from-url.js";
|
|||
import define from "@/server/api/define.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { publishMainStream } from "@/services/stream.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["drive"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { createExportCustomEmojisJob } from "@/queue/index.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -4,7 +4,7 @@ import { ApiError } from "@/server/api/error.js";
|
|||
import { getUser } from "@/server/api/common/getters.js";
|
||||
import { Followings, Users } from "@/models/index.js";
|
||||
import { IdentifiableError } from "@/misc/identifiable-error.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["following", "users"],
|
||||
|
|
|
@ -3,7 +3,7 @@ import define from "@/server/api/define.js";
|
|||
import { ApiError } from "@/server/api/error.js";
|
||||
import { getUser } from "@/server/api/common/getters.js";
|
||||
import { Followings, Users } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["following", "users"],
|
||||
|
|
|
@ -3,7 +3,7 @@ import define from "@/server/api/define.js";
|
|||
import { ApiError } from "@/server/api/error.js";
|
||||
import { getUser } from "@/server/api/common/getters.js";
|
||||
import { Followings, Users } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["following", "users"],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { DriveFiles, GalleryPosts } from "@/models/index.js";
|
||||
import { genId } from "backend-rs";
|
||||
import { HOUR, genId } from "backend-rs";
|
||||
import { GalleryPost } from "@/models/entities/gallery-post.js";
|
||||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["gallery"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { DriveFiles, GalleryPosts } from "@/models/index.js";
|
||||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["gallery"],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MoreThan } from "typeorm";
|
||||
import { USER_ONLINE_THRESHOLD } from "@/const.js";
|
||||
import { USER_ONLINE_THRESHOLD } from "backend-rs";
|
||||
import { Users } from "@/models/index.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { createExportBlockingJob } from "@/queue/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { createExportFollowingJob } from "@/queue/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { createExportMuteJob } from "@/queue/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { createExportNotesJob } from "@/queue/index.js";
|
||||
import { DAY } from "@/const.js";
|
||||
import { DAY } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import define from "@/server/api/define.js";
|
||||
import { createExportUserListsJob } from "@/queue/index.js";
|
||||
import { MINUTE } from "@/const.js";
|
||||
import { MINUTE } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -2,7 +2,7 @@ import define from "@/server/api/define.js";
|
|||
import { createImportBlockingJob } from "@/queue/index.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -2,7 +2,7 @@ import define from "@/server/api/define.js";
|
|||
import { createImportFollowingJob } from "@/queue/index.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -2,7 +2,7 @@ import define from "@/server/api/define.js";
|
|||
import { createImportMutingJob } from "@/queue/index.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -2,7 +2,7 @@ import define from "@/server/api/define.js";
|
|||
import { createImportPostsJob } from "@/queue/index.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { DAY } from "@/const.js";
|
||||
import { DAY } from "backend-rs";
|
||||
import { fetchMeta } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -2,7 +2,7 @@ import define from "@/server/api/define.js";
|
|||
import { createImportUserListsJob } from "@/queue/index.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { DriveFiles } from "@/models/index.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
|
|
|
@ -4,7 +4,7 @@ import { resolveUser } from "@/remote/resolve-user.js";
|
|||
import acceptAllFollowRequests from "@/services/following/requests/accept-all.js";
|
||||
import { publishToFollowers } from "@/services/i/update.js";
|
||||
import { publishMainStream } from "@/services/stream.js";
|
||||
import { DAY } from "@/const.js";
|
||||
import { DAY } from "backend-rs";
|
||||
import { apiLogger } from "@/server/api/logger.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { User } from "@/models/entities/user.js";
|
||||
import { resolveUser } from "@/remote/resolve-user.js";
|
||||
import { DAY } from "@/const.js";
|
||||
import { DAY } from "backend-rs";
|
||||
import DeliverManager from "@/remote/activitypub/deliver-manager.js";
|
||||
import { renderActivity } from "@/remote/activitypub/renderer/index.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
|
|
@ -6,8 +6,7 @@ import { Users, UserProfiles } from "@/models/index.js";
|
|||
import { sendEmail } from "@/services/send-email.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { validateEmailForAccount } from "@/services/validate-email-for-account.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { verifyPassword } from "backend-rs";
|
||||
import { HOUR, verifyPassword } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
|
|
|
@ -2,7 +2,7 @@ import define from "@/server/api/define.js";
|
|||
import { ApiError } from "@/server/api/error.js";
|
||||
import { MessagingMessages } from "@/models/index.js";
|
||||
import { deleteMessage } from "@/services/messages/delete.js";
|
||||
import { SECOND, HOUR } from "@/const.js";
|
||||
import { SECOND, HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["messaging"],
|
||||
|
|
|
@ -3,7 +3,6 @@ import { IsNull, MoreThan } from "typeorm";
|
|||
import { config } from "@/config.js";
|
||||
import { fetchMeta } from "backend-rs";
|
||||
import { Ads, Emojis, Users } from "@/models/index.js";
|
||||
import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js";
|
||||
import define from "@/server/api/define.js";
|
||||
|
||||
export const meta = {
|
||||
|
@ -464,8 +463,8 @@ export default define(meta, paramDef, async (ps, me) => {
|
|||
iconUrl: instance.iconUrl,
|
||||
backgroundImageUrl: instance.backgroundImageUrl,
|
||||
logoImageUrl: instance.logoImageUrl,
|
||||
maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, // 後方互換性のため
|
||||
maxCaptionTextLength: MAX_CAPTION_TEXT_LENGTH,
|
||||
maxNoteTextLength: config.maxNoteLength, // for backward compatibility
|
||||
maxCaptionTextLength: config.maxCaptionLength,
|
||||
emojis: instance.privateMode && !me ? [] : await Emojis.packMany(emojis),
|
||||
// クライアントの手間を減らすためあらかじめJSONに変換しておく
|
||||
defaultLightTheme: instance.defaultLightTheme
|
||||
|
|
|
@ -11,11 +11,11 @@ import {
|
|||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import type { Note } from "@/models/entities/note.js";
|
||||
import type { Channel } from "@/models/entities/channel.js";
|
||||
import { MAX_NOTE_TEXT_LENGTH } from "@/const.js";
|
||||
import { config } from "@/config.js";
|
||||
import { noteVisibilities } from "@/types.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { langmap } from "@/misc/langmap.js";
|
||||
|
||||
|
@ -108,13 +108,13 @@ export const paramDef = {
|
|||
format: "misskey:id",
|
||||
},
|
||||
},
|
||||
text: { type: "string", maxLength: MAX_NOTE_TEXT_LENGTH, nullable: true },
|
||||
text: { type: "string", maxLength: config.maxNoteLength, nullable: true },
|
||||
lang: {
|
||||
type: "string",
|
||||
enum: Object.keys(langmap),
|
||||
nullable: true,
|
||||
},
|
||||
cw: { type: "string", nullable: true, maxLength: MAX_NOTE_TEXT_LENGTH },
|
||||
cw: { type: "string", nullable: true, maxLength: config.maxNoteLength },
|
||||
localOnly: { type: "boolean", default: false },
|
||||
noExtractMentions: { type: "boolean", default: false },
|
||||
noExtractHashtags: { type: "boolean", default: false },
|
||||
|
@ -164,7 +164,7 @@ export const paramDef = {
|
|||
text: {
|
||||
type: "string",
|
||||
minLength: 1,
|
||||
maxLength: MAX_NOTE_TEXT_LENGTH,
|
||||
maxLength: config.maxNoteLength,
|
||||
nullable: false,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Users } from "@/models/index.js";
|
|||
import define from "@/server/api/define.js";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { SECOND, HOUR } from "@/const.js";
|
||||
import { SECOND, HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["notes"],
|
||||
|
|
|
@ -14,11 +14,11 @@ import {
|
|||
import type { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import type { IMentionedRemoteUsers, Note } from "@/models/entities/note.js";
|
||||
import type { Channel } from "@/models/entities/channel.js";
|
||||
import { MAX_NOTE_TEXT_LENGTH } from "@/const.js";
|
||||
import { config } from "@/config.js";
|
||||
import { noteVisibilities } from "@/types.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { Poll } from "@/models/entities/poll.js";
|
||||
import * as mfm from "mfm-js";
|
||||
|
@ -168,7 +168,7 @@ export const paramDef = {
|
|||
format: "misskey:id",
|
||||
},
|
||||
},
|
||||
text: { type: "string", maxLength: MAX_NOTE_TEXT_LENGTH, nullable: true },
|
||||
text: { type: "string", maxLength: config.maxNoteLength, nullable: true },
|
||||
lang: {
|
||||
type: "string",
|
||||
enum: Object.keys(langmap),
|
||||
|
@ -224,7 +224,7 @@ export const paramDef = {
|
|||
text: {
|
||||
type: "string",
|
||||
minLength: 1,
|
||||
maxLength: MAX_NOTE_TEXT_LENGTH,
|
||||
maxLength: config.maxNoteLength,
|
||||
nullable: false,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Notes } from "@/models/index.js";
|
|||
import define from "@/server/api/define.js";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { SECOND, HOUR } from "@/const.js";
|
||||
import { SECOND, HOUR } from "backend-rs";
|
||||
import { publishNoteStream } from "@/services/stream.js";
|
||||
|
||||
export const meta = {
|
||||
|
|
|
@ -2,7 +2,7 @@ import deleteReaction from "@/services/note/reaction/delete.js";
|
|||
import define from "@/server/api/define.js";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { SECOND, HOUR } from "@/const.js";
|
||||
import { SECOND, HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["reactions", "notes"],
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Notes, Users } from "@/models/index.js";
|
|||
import define from "@/server/api/define.js";
|
||||
import { getNote } from "@/server/api/common/getters.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { SECOND, HOUR } from "@/const.js";
|
||||
import { SECOND, HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["notes"],
|
||||
|
|
|
@ -3,7 +3,7 @@ import { genId } from "backend-rs";
|
|||
import { Page } from "@/models/entities/page.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["pages"],
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Not } from "typeorm";
|
|||
import { Pages, DriveFiles } from "@/models/index.js";
|
||||
import define from "@/server/api/define.js";
|
||||
import { ApiError } from "@/server/api/error.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
import { HOUR } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["pages"],
|
||||
|
|
|
@ -3,9 +3,8 @@ import { IsNull } from "typeorm";
|
|||
import { config } from "@/config.js";
|
||||
import { Users, UserProfiles, PasswordResetRequests } from "@/models/index.js";
|
||||
import { sendEmail } from "@/services/send-email.js";
|
||||
import { genId } from "backend-rs";
|
||||
import { HOUR, genId } from "backend-rs";
|
||||
import define from "@/server/api/define.js";
|
||||
import { HOUR } from "@/const.js";
|
||||
|
||||
export const meta = {
|
||||
tags: ["reset password"],
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
generateBlockedUserQuery,
|
||||
generateBlockQueryForUsers,
|
||||
} from "@/server/api/common/generate-block-query.js";
|
||||
import { DAY } from "@/const.js";
|
||||
import { DAY } from "backend-rs";
|
||||
|
||||
export const meta = {
|
||||
tags: ["users"],
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import { Entity } from "megalodon";
|
||||
import type { Entity } from "megalodon";
|
||||
import { config } from "@/config.js";
|
||||
import { fetchMeta } from "backend-rs";
|
||||
import { FILE_TYPE_BROWSERSAFE, fetchMeta } from "backend-rs";
|
||||
import { Users, Notes } from "@/models/index.js";
|
||||
import { IsNull } from "typeorm";
|
||||
import { MAX_NOTE_TEXT_LENGTH, FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
|
||||
export async function getInstance(
|
||||
response: Entity.Instance,
|
||||
|
@ -41,7 +40,7 @@ export async function getInstance(
|
|||
max_featured_tags: 20,
|
||||
},
|
||||
statuses: {
|
||||
max_characters: MAX_NOTE_TEXT_LENGTH,
|
||||
max_characters: config.maxNoteLength,
|
||||
max_media_attachments: 16,
|
||||
characters_reserved_per_url: response.uri.length,
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@ import { convertToWebp } from "@/services/drive/image-processor.js";
|
|||
import { GenerateVideoThumbnail } from "@/services/drive/generate-video-thumbnail.js";
|
||||
import { StatusError } from "@/misc/fetch.js";
|
||||
import { ByteRangeReadable } from "./byte-range-readable.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "backend-rs";
|
||||
import { inspect } from "node:util";
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
|
|
|
@ -3,7 +3,6 @@ import { config } from "@/config.js";
|
|||
import { fetchMeta } from "backend-rs";
|
||||
import { Users, Notes } from "@/models/index.js";
|
||||
import { IsNull, MoreThan } from "typeorm";
|
||||
import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
|
||||
const router = new Router();
|
||||
|
@ -86,8 +85,8 @@ const nodeinfo2 = async () => {
|
|||
postImports: meta.experimentalFeatures?.postImports || false,
|
||||
enableHcaptcha: meta.enableHcaptcha,
|
||||
enableRecaptcha: meta.enableRecaptcha,
|
||||
maxNoteTextLength: MAX_NOTE_TEXT_LENGTH,
|
||||
maxCaptionTextLength: MAX_CAPTION_TEXT_LENGTH,
|
||||
maxNoteTextLength: config.maxNoteLength,
|
||||
maxCaptionTextLength: config.maxCaptionLength,
|
||||
enableEmail: meta.enableEmail,
|
||||
enableServiceWorker: meta.enableServiceWorker,
|
||||
proxyAccountName: proxyAccount ? proxyAccount.username : null,
|
||||
|
@ -113,6 +112,7 @@ router.get(nodeinfo2_0path, async (ctx) => {
|
|||
|
||||
// @ts-ignore
|
||||
base.software.repository = undefined;
|
||||
// @ts-ignore
|
||||
base.software.homepage = undefined;
|
||||
|
||||
ctx.body = { version: "2.0", ...base };
|
||||
|
|
|
@ -9,7 +9,7 @@ import { createTemp } from "@/misc/create-temp.js";
|
|||
import { downloadUrl } from "@/misc/download-url.js";
|
||||
import { detectType } from "@/misc/get-file-info.js";
|
||||
import { StatusError } from "@/misc/fetch.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "backend-rs";
|
||||
import { serverLogger } from "../index.js";
|
||||
import { isMimeImage } from "@/misc/is-mime-image.js";
|
||||
import { inspect } from "node:util";
|
||||
|
|
|
@ -15,7 +15,14 @@ import { BullAdapter } from "@bull-board/api/bullAdapter.js";
|
|||
import { KoaAdapter } from "@bull-board/koa";
|
||||
|
||||
import { In, IsNull } from "typeorm";
|
||||
import { fetchMeta, metaToPugArgs } from "backend-rs";
|
||||
import {
|
||||
MINUTE,
|
||||
DAY,
|
||||
getNoteSummary,
|
||||
stringToAcct,
|
||||
fetchMeta,
|
||||
metaToPugArgs,
|
||||
} from "backend-rs";
|
||||
import { config } from "@/config.js";
|
||||
import {
|
||||
Users,
|
||||
|
@ -27,13 +34,11 @@ import {
|
|||
Emojis,
|
||||
GalleryPosts,
|
||||
} from "@/models/index.js";
|
||||
import { getNoteSummary, stringToAcct } from "backend-rs";
|
||||
import { queues } from "@/queue/queues.js";
|
||||
import { genOpenapiSpec } from "../api/openapi/gen-spec.js";
|
||||
import { urlPreviewHandler } from "./url-preview.js";
|
||||
import { manifestHandler } from "./manifest.js";
|
||||
import packFeed from "./feed.js";
|
||||
import { MINUTE, DAY } from "@/const.js";
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
|
|
@ -6,7 +6,7 @@ import type S3 from "aws-sdk/clients/s3.js"; // TODO: migrate to SDK v3
|
|||
import sharp from "sharp";
|
||||
import { IsNull } from "typeorm";
|
||||
import { publishMainStream, publishDriveStream } from "@/services/stream.js";
|
||||
import { fetchMeta } from "backend-rs";
|
||||
import { FILE_TYPE_BROWSERSAFE, fetchMeta, genId } from "backend-rs";
|
||||
import { contentDisposition } from "@/misc/content-disposition.js";
|
||||
import { getFileInfo } from "@/misc/get-file-info.js";
|
||||
import {
|
||||
|
@ -18,9 +18,7 @@ import {
|
|||
import { DriveFile } from "@/models/entities/drive-file.js";
|
||||
import type { DriveFileUsageHint } from "@/models/entities/drive-file.js";
|
||||
import type { IRemoteUser, User } from "@/models/entities/user.js";
|
||||
import { genId } from "backend-rs";
|
||||
import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js";
|
||||
import { FILE_TYPE_BROWSERSAFE } from "@/const.js";
|
||||
import { IdentifiableError } from "@/misc/identifiable-error.js";
|
||||
import { getS3 } from "./s3.js";
|
||||
import { InternalStorage } from "./internal-storage.js";
|
||||
|
|
Loading…
Reference in a new issue