Merge branch 'develop' into iceshrimp_mastodon

This commit is contained in:
naskya 2024-07-03 23:52:01 +09:00
commit a130917c13
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
128 changed files with 544 additions and 723 deletions

View file

@ -120,7 +120,8 @@ test:build:backend_ts:
- cp packages/backend-rs/index.js packages/backend-rs/built/index.js
- cp packages/backend-rs/index.d.ts packages/backend-rs/built/index.d.ts
- cp ci/cargo/config.toml /usr/local/cargo/config.toml
- test -f packages/backend-rs/built/backend-rs.linux-x64-gnu.node || pnpm install --frozen-lockfile && pnpm --filter 'backend-rs' run build:debug
- test -f packages/backend-rs/built/backend-rs.linux-x64-gnu.node || pnpm install --frozen-lockfile
- test -f packages/backend-rs/built/backend-rs.linux-x64-gnu.node || pnpm --filter 'backend-rs' run build:debug
- cp .config/ci.yml .config/default.yml
- export PGPASSWORD="${POSTGRES_PASSWORD}"
- psql --host postgres --user "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" --command 'CREATE EXTENSION pgroonga'

View file

@ -361,9 +361,9 @@ In this instruction, we use [Caddy](https://caddyserver.com/) to make the Firefi
sudo systemctl enable --now firefish
```
## Maintain the server
# Maintain the server
### Upgrade Firefish version
## Upgrade Firefish version
Please refer to the [upgrade instruction](./upgrade.md). Be sure to switch to `firefish` user and go to the Firefish directory before executing the `git` command:
@ -372,7 +372,7 @@ sudo su --login firefish
cd ~/firefish
```
### Rotate logs
## Rotate logs
If the server runs long, the size of log files increases, filling up disk space. To prevent this, you should set up a log rotation (removing old logs automatically).
@ -411,7 +411,7 @@ The PGroonga log file (`pgroonga.log`) is located under this directory:
psql --user postgres --command 'SHOW data_directory'
```
### Tune database configuration
## Tune database configuration
The default PostgreSQL configuration not suitable for running a Firefish server. Thus, it is highly recommended that you use [PGTune](https://pgtune.leopard.in.ua/) to tweak the configuration.
@ -422,7 +422,7 @@ Here is an example set of parameters you can provide to PGTune:
| DB version | 16 (your PostgreSQL major version) |
| OS Type | Linux |
| DB Type | Data warehouse |
| Total Memory | (total physical memory) - 700 MB |
| Total Memory | [total physical memory] minus 700 MB |
| Number of CPUs | number of CPU threads (or lower value if you have many) |
| Number of connections | 200 |
| Data storage | SSD storage |
@ -431,7 +431,7 @@ Since this is not a dedicated database server, be sure to leave some memory spac
Once you have entered the appropriate values for your environment, click the "Generate" button to generate a configuration and replace the values in `postgresql.conf` with the suggested values.
### VACUUM your database
## VACUUM your database
If the database runs long, "garbage" can degrade its performance or cause problems. To prevent this, you should execute the following commands regularly.

View file

@ -8,7 +8,7 @@ Please take a look at #10947.
## Unreleased
This is not related to the recent changes, but we have added a new subsection called "[Maintain the server](https://firefish.dev/firefish/firefish/-/blob/develop/docs/install.md#maintain-the-server)" in the installation guide. We suggest that you take a look at it.
This is not related to the recent changes, but we have added a new section called "[Maintain the server](https://firefish.dev/firefish/firefish/-/blob/develop/docs/install.md#maintain-the-server)" in the installation guide. We suggest that you take a look at it.
### For systemd/pm2 users

View file

@ -11,15 +11,16 @@ regenerate-entities:
--output-dir='src/model/entity' \
--database-url='postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@localhost:25432/$(POSTGRES_DB)' \
--date-time-crate='chrono' \
--with-serde='both' \
--model-extra-attributes='NAPI_EXTRA_ATTR_PLACEHOLDER' && \
for file in src/model/entity/*; do \
base=$$(basename -- "$${file}"); \
jsname=$$(printf '%s\n' "$${base%.*}" | perl -pe 's/(^|_)./uc($$&)/ge;s/_//g'); \
attribute=$$(printf 'cfg_attr(feature = "napi", napi_derive::napi(object, js_name = "%s", use_nullable = true))' "$${jsname}"); \
attribute=$$(printf 'macros::export(object, js_name = "%s")' "$${jsname}"); \
sed -i "s/NAPI_EXTRA_ATTR_PLACEHOLDER/$${attribute}/" "$${file}"; \
sed -i 's/#\[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)\]/#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]\n#[serde(rename_all = "camelCase")]/' "$${file}"; \
sed -i 's/#\[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)\]/#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]\n#[serde(rename_all = "camelCase")]/' "$${file}"; \
done
sed -i 's/#\[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum)\]/#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize)]\n#[serde(rename_all = "camelCase")]\n#[cfg_attr(not(feature = "napi"), derive(Clone))]\n#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]/' \
sed -i 's/#\[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)\]/#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]\n#[serde(rename_all = "camelCase")]\n#[macros::derive_clone_and_export(string_enum = "camelCase")]/' \
src/model/entity/sea_orm_active_enums.rs
cargo fmt --all --

View file

@ -1547,10 +1547,10 @@ export interface UserProfile {
preventAiLearning: boolean
isIndexable: boolean
mutedPatterns: Array<string>
mentions: Json
mutedInstances: Array<string>
mutedWords: Array<string>
lang: string | null
mentions: Json
}
export enum UserProfileFfvisibility {

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "abuse_user_report")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "AbuseUserReport", use_nullable = true)
)]
#[macros::export(object, js_name = "AbuseUserReport")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "access_token")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "AccessToken", use_nullable = true)
)]
#[macros::export(object, js_name = "AccessToken")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "ad")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Ad", use_nullable = true)
)]
#[macros::export(object, js_name = "Ad")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "announcement")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Announcement", use_nullable = true)
)]
#[macros::export(object, js_name = "Announcement")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "announcement_read")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "AnnouncementRead", use_nullable = true)
)]
#[macros::export(object, js_name = "AnnouncementRead")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::AntennaSrc;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "antenna")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Antenna", use_nullable = true)
)]
#[macros::export(object, js_name = "Antenna")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "app")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "App", use_nullable = true)
)]
#[macros::export(object, js_name = "App")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "attestation_challenge")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "AttestationChallenge", use_nullable = true)
)]
#[macros::export(object, js_name = "AttestationChallenge")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "auth_session")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "AuthSession", use_nullable = true)
)]
#[macros::export(object, js_name = "AuthSession")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "blocking")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Blocking", use_nullable = true)
)]
#[macros::export(object, js_name = "Blocking")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "channel")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Channel", use_nullable = true)
)]
#[macros::export(object, js_name = "Channel")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "channel_following")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "ChannelFollowing", use_nullable = true)
)]
#[macros::export(object, js_name = "ChannelFollowing")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "channel_note_pining")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "ChannelNotePining", use_nullable = true)
)]
#[macros::export(object, js_name = "ChannelNotePining")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "clip")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Clip", use_nullable = true)
)]
#[macros::export(object, js_name = "Clip")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "clip_note")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "ClipNote", use_nullable = true)
)]
#[macros::export(object, js_name = "ClipNote")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::DriveFileUsageHint;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "drive_file")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "DriveFile", use_nullable = true)
)]
#[macros::export(object, js_name = "DriveFile")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "drive_folder")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "DriveFolder", use_nullable = true)
)]
#[macros::export(object, js_name = "DriveFolder")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "emoji")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Emoji", use_nullable = true)
)]
#[macros::export(object, js_name = "Emoji")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "follow_request")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "FollowRequest", use_nullable = true)
)]
#[macros::export(object, js_name = "FollowRequest")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "following")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Following", use_nullable = true)
)]
#[macros::export(object, js_name = "Following")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "gallery_like")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "GalleryLike", use_nullable = true)
)]
#[macros::export(object, js_name = "GalleryLike")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "gallery_post")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "GalleryPost", use_nullable = true)
)]
#[macros::export(object, js_name = "GalleryPost")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "hashtag")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Hashtag", use_nullable = true)
)]
#[macros::export(object, js_name = "Hashtag")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "instance")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Instance", use_nullable = true)
)]
#[macros::export(object, js_name = "Instance")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "messaging_message")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "MessagingMessage", use_nullable = true)
)]
#[macros::export(object, js_name = "MessagingMessage")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "meta")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Meta", use_nullable = true)
)]
#[macros::export(object, js_name = "Meta")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "migrations")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Migrations", use_nullable = true)
)]
#[macros::export(object, js_name = "Migrations")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "moderation_log")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "ModerationLog", use_nullable = true)
)]
#[macros::export(object, js_name = "ModerationLog")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::MutedNoteReason;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "muted_note")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "MutedNote", use_nullable = true)
)]
#[macros::export(object, js_name = "MutedNote")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "muting")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Muting", use_nullable = true)
)]
#[macros::export(object, js_name = "Muting")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::NoteVisibility;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Note", use_nullable = true)
)]
#[macros::export(object, js_name = "Note")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_edit")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteEdit", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteEdit")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_favorite")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteFavorite", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteFavorite")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_file")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteFile", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteFile")]
pub struct Model {
#[sea_orm(column_name = "serialNo", primary_key)]
pub serial_no: i64,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_reaction")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteReaction", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteReaction")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_thread_muting")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteThreadMuting", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteThreadMuting")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_unread")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteUnread", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteUnread")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "note_watching")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "NoteWatching", use_nullable = true)
)]
#[macros::export(object, js_name = "NoteWatching")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::NotificationType;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "notification")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Notification", use_nullable = true)
)]
#[macros::export(object, js_name = "Notification")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::PageVisibility;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "page")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Page", use_nullable = true)
)]
#[macros::export(object, js_name = "Page")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "page_like")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "PageLike", use_nullable = true)
)]
#[macros::export(object, js_name = "PageLike")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "password_reset_request")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "PasswordResetRequest", use_nullable = true)
)]
#[macros::export(object, js_name = "PasswordResetRequest")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::PollNoteVisibility;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "poll")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Poll", use_nullable = true)
)]
#[macros::export(object, js_name = "Poll")]
pub struct Model {
#[sea_orm(column_name = "noteId", primary_key, auto_increment = false, unique)]
pub note_id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "poll_vote")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "PollVote", use_nullable = true)
)]
#[macros::export(object, js_name = "PollVote")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "promo_note")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "PromoNote", use_nullable = true)
)]
#[macros::export(object, js_name = "PromoNote")]
pub struct Model {
#[sea_orm(column_name = "noteId", primary_key, auto_increment = false, unique)]
pub note_id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "promo_read")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "PromoRead", use_nullable = true)
)]
#[macros::export(object, js_name = "PromoRead")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "registration_ticket")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "RegistrationTicket", use_nullable = true)
)]
#[macros::export(object, js_name = "RegistrationTicket")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "registry_item")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "RegistryItem", use_nullable = true)
)]
#[macros::export(object, js_name = "RegistryItem")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::RelayStatus;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "relay")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Relay", use_nullable = true)
)]
#[macros::export(object, js_name = "Relay")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "renote_muting")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "RenoteMuting", use_nullable = true)
)]
#[macros::export(object, js_name = "RenoteMuting")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "reply_muting")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "ReplyMuting", use_nullable = true)
)]
#[macros::export(object, js_name = "ReplyMuting")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,13 +1,11 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "antenna_src")]
pub enum AntennaSrc {
#[sea_orm(string_value = "all")]
@ -23,12 +21,9 @@ pub enum AntennaSrc {
#[sea_orm(string_value = "users")]
Users,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
@ -40,12 +35,9 @@ pub enum DriveFileUsageHint {
#[sea_orm(string_value = "userBanner")]
UserBanner,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "muted_note_reason")]
pub enum MutedNoteReason {
#[sea_orm(string_value = "manual")]
@ -57,12 +49,9 @@ pub enum MutedNoteReason {
#[sea_orm(string_value = "word")]
Word,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "note_visibility")]
pub enum NoteVisibility {
#[sea_orm(string_value = "followers")]
@ -76,12 +65,9 @@ pub enum NoteVisibility {
#[sea_orm(string_value = "specified")]
Specified,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "notification_type")]
pub enum NotificationType {
#[sea_orm(string_value = "app")]
@ -109,12 +95,9 @@ pub enum NotificationType {
#[sea_orm(string_value = "reply")]
Reply,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "page_visibility")]
pub enum PageVisibility {
#[sea_orm(string_value = "followers")]
@ -124,12 +107,9 @@ pub enum PageVisibility {
#[sea_orm(string_value = "specified")]
Specified,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
@ -145,12 +125,9 @@ pub enum PollNoteVisibility {
#[sea_orm(string_value = "specified")]
Specified,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
@ -178,12 +155,9 @@ pub enum PushSubscriptionType {
#[sea_orm(string_value = "update")]
Update,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "relay_status")]
pub enum RelayStatus {
#[sea_orm(string_value = "accepted")]
@ -193,12 +167,9 @@ pub enum RelayStatus {
#[sea_orm(string_value = "requesting")]
Requesting,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
@ -214,12 +185,9 @@ pub enum UserEmojiModPerm {
#[sea_orm(string_value = "unauthorized")]
Unauthorized,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
@ -233,12 +201,9 @@ pub enum UserProfileFfvisibility {
#[sea_orm(string_value = "public")]
Public,
}
#[derive(
Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(not(feature = "napi"), derive(Clone))]
#[cfg_attr(feature = "napi", napi_derive::napi(string_enum = "camelCase"))]
#[macros::derive_clone_and_export(string_enum = "camelCase")]
#[sea_orm(
rs_type = "String",
db_type = "Enum",

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "signin")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Signin", use_nullable = true)
)]
#[macros::export(object, js_name = "Signin")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::PushSubscriptionType;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "sw_subscription")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "SwSubscription", use_nullable = true)
)]
#[macros::export(object, js_name = "SwSubscription")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "used_username")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UsedUsername", use_nullable = true)
)]
#[macros::export(object, js_name = "UsedUsername")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub username: String,

View file

@ -2,14 +2,12 @@
use super::sea_orm_active_enums::UserEmojiModPerm;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "User", use_nullable = true)
)]
#[macros::export(object, js_name = "User")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_group")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserGroup", use_nullable = true)
)]
#[macros::export(object, js_name = "UserGroup")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_group_invitation")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserGroupInvitation", use_nullable = true)
)]
#[macros::export(object, js_name = "UserGroupInvitation")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_group_invite")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserGroupInvite", use_nullable = true)
)]
#[macros::export(object, js_name = "UserGroupInvite")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_group_joining")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserGroupJoining", use_nullable = true)
)]
#[macros::export(object, js_name = "UserGroupJoining")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_ip")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserIp", use_nullable = true)
)]
#[macros::export(object, js_name = "UserIp")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_keypair")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserKeypair", use_nullable = true)
)]
#[macros::export(object, js_name = "UserKeypair")]
pub struct Model {
#[sea_orm(column_name = "userId", primary_key, auto_increment = false, unique)]
pub user_id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_list")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserList", use_nullable = true)
)]
#[macros::export(object, js_name = "UserList")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_list_joining")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserListJoining", use_nullable = true)
)]
#[macros::export(object, js_name = "UserListJoining")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_note_pining")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserNotePining", use_nullable = true)
)]
#[macros::export(object, js_name = "UserNotePining")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_pending")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserPending", use_nullable = true)
)]
#[macros::export(object, js_name = "UserPending")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -3,14 +3,12 @@
use super::sea_orm_active_enums::UserProfileFfvisibility;
use super::sea_orm_active_enums::UserProfileMutingNotificationTypes;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_profile")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserProfile", use_nullable = true)
)]
#[macros::export(object, js_name = "UserProfile")]
pub struct Model {
#[sea_orm(column_name = "userId", primary_key, auto_increment = false, unique)]
pub user_id: String,
@ -70,13 +68,13 @@ pub struct Model {
pub is_indexable: bool,
#[sea_orm(column_name = "mutedPatterns")]
pub muted_patterns: Vec<String>,
#[sea_orm(column_type = "JsonBinary")]
pub mentions: Json,
#[sea_orm(column_name = "mutedInstances")]
pub muted_instances: Vec<String>,
#[sea_orm(column_name = "mutedWords")]
pub muted_words: Vec<String>,
pub lang: Option<String>,
#[sea_orm(column_type = "JsonBinary")]
pub mentions: Json,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_publickey")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserPublickey", use_nullable = true)
)]
#[macros::export(object, js_name = "UserPublickey")]
pub struct Model {
#[sea_orm(column_name = "userId", primary_key, auto_increment = false, unique)]
pub user_id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "user_security_key")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "UserSecurityKey", use_nullable = true)
)]
#[macros::export(object, js_name = "UserSecurityKey")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -1,14 +1,12 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[sea_orm(table_name = "webhook")]
#[cfg_attr(
feature = "napi",
napi_derive::napi(object, js_name = "Webhook", use_nullable = true)
)]
#[macros::export(object, js_name = "Webhook")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,

View file

@ -82,7 +82,7 @@
"typescript": "5.5.3",
"unicode-emoji-json": "0.6.0",
"uuid": "10.0.0",
"vite": "5.3.2",
"vite": "5.3.3",
"vite-plugin-compression": "0.5.1",
"vue": "3.4.31",
"vue-draggable-plus": "0.5.0",

View file

@ -100,7 +100,7 @@ import * as os from "@/os";
import { MFM_TAGS } from "@/scripts/mfm-tags";
import { defaultStore } from "@/store";
import { addSkinTone, emojilist } from "@/scripts/emojilist";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { i18n } from "@/i18n";
interface EmojiDef {
@ -141,7 +141,7 @@ for (const x of lib) {
emjdb.sort((a, b) => a.name.length - b.name.length);
// #region Construct Emoji DB
const customEmojis = instance.emojis;
const customEmojis = getInstanceInfo().emojis;
const emojiDefinitions: EmojiDef[] = [];
for (const x of customEmojis) {

View file

@ -64,7 +64,7 @@ import MkButton from "@/components/MkButton.vue";
import { host } from "@/config";
import { i18n } from "@/i18n";
import * as os from "@/os";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import icon from "@/scripts/icon";
const show = ref(false);
@ -73,6 +73,7 @@ const emit = defineEmits<{
(ev: "closed"): void;
}>();
const instance = getInstanceInfo();
const hostname =
instance.name?.length && instance.name?.length < 38 ? instance.name : host;

View file

@ -164,7 +164,7 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, ref, watch } from "vue";
import { onMounted, ref, watch } from "vue";
import type { entities } from "firefish-js";
import { FocusTrap } from "focus-trap-vue";
import XSection from "@/components/MkEmojiPicker.section.vue";
@ -175,7 +175,7 @@ import Ripple from "@/components/MkRipple.vue";
import * as os from "@/os";
import { isTouchUsing } from "@/scripts/touch";
import { deviceKind } from "@/scripts/device-kind";
import { emojiCategories, instance } from "@/instance";
import { emojiCategories, getInstanceInfo } from "@/instance";
import { i18n } from "@/i18n";
import { defaultStore } from "@/store";
import icon from "@/scripts/icon";
@ -235,7 +235,7 @@ const size = reactionPickerSize;
const width = reactionPickerWidth;
const height = reactionPickerHeight;
const customEmojiCategories = emojiCategories;
const customEmojis = instance.emojis;
const customEmojis = getInstanceInfo().emojis;
const q = ref<string | null>(null);
const searchResultCustom = ref<entities.CustomEmoji[]>([]);
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
@ -459,7 +459,6 @@ async function paste(event: ClipboardEvent) {
}
function done(query?: string | null): boolean {
// biome-ignore lint/style/noParameterAssign: assign it intentially
if (query == null) query = q.value;
if (query == null || typeof query !== "string") return false;

View file

@ -9,7 +9,7 @@
<template #header>{{ i18n.ts.forgotPassword }}</template>
<form
v-if="instance.enableEmail"
v-if="enableEmail"
class="bafeceda"
@submit.prevent="onSubmit"
>
@ -68,7 +68,7 @@ import XModalWindow from "@/components/MkModalWindow.vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import * as os from "@/os";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { i18n } from "@/i18n";
const emit = defineEmits<{
@ -82,6 +82,8 @@ const username = ref("");
const email = ref("");
const processing = ref(false);
const { enableEmail } = getInstanceInfo();
async function onSubmit() {
processing.value = true;
await os.apiWithDialog("request-reset-password", {
@ -89,7 +91,7 @@ async function onSubmit() {
email: email.value,
});
emit("done");
dialog.value!.close();
dialog.value?.close();
}
</script>

View file

@ -19,7 +19,7 @@ import { ref } from "vue";
import type { entities } from "firefish-js";
import { instanceName, version } from "@/config";
import { instance as Instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { getProxiedImageUrlNullable } from "@/scripts/media-proxy";
const props = defineProps<{
@ -28,9 +28,10 @@ const props = defineProps<{
const ticker = ref<HTMLElement | null>(null);
// FIXME: the following assumption is not necessarily correct
// if no instance data is given, this is for the local instance
const instance = props.instance ?? {
faviconUrl: Instance.iconUrl || "/favicon.ico",
faviconUrl: getInstanceInfo().iconUrl || "/favicon.ico",
name: instanceName,
themeColor: (
document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement

View file

@ -76,7 +76,7 @@ import MkButton from "@/components/MkButton.vue";
import bytes from "@/filters/bytes";
import number from "@/filters/number";
import { i18n } from "@/i18n";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
const props = withDefaults(
defineProps<{
@ -109,14 +109,14 @@ const modal = ref<InstanceType<typeof MkModal> | null>(null);
const inputValue = ref(props.input.default ? props.input.default : null);
const remainingLength = computed(() => {
const maxCaptionLength = instance.maxCaptionTextLength ?? 512;
const maxCaptionLength = getInstanceInfo().maxCaptionTextLength ?? 512;
if (typeof inputValue.value !== "string") return maxCaptionLength;
return maxCaptionLength - length(inputValue.value);
});
function done(canceled: boolean, result?: string | null) {
emit("done", { canceled, result });
modal.value!.close();
modal.value?.close();
}
async function ok() {

View file

@ -285,7 +285,7 @@ import * as os from "@/os";
import { useStream } from "@/stream";
import { useTooltip } from "@/scripts/use-tooltip";
import { defaultStore } from "@/store";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import icon from "@/scripts/icon";
const props = withDefaults(
@ -309,8 +309,9 @@ const hideFollowButton = defaultStore.state.hideFollowButtons;
const showEmojiReactions =
defaultStore.state.enableEmojiReactions ||
defaultStore.state.showEmojisInReactionNotifications;
const defaultReaction = ["⭐", "👍", "❤️"].includes(instance.defaultReaction)
? instance.defaultReaction
const realDefaultReaction = getInstanceInfo().defaultReaction;
const defaultReaction = ["⭐", "👍", "❤️"].includes(realDefaultReaction)
? realDefaultReaction
: "⭐";
let readObserver: IntersectionObserver | undefined;

View file

@ -88,7 +88,7 @@ import * as os from "@/os";
import { useStream } from "@/stream";
import { useTooltip } from "@/scripts/use-tooltip";
import { defaultStore } from "@/store";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import icon from "@/scripts/icon";
import type {
NotificationFolded,
@ -116,8 +116,9 @@ const reactionRef = ref<InstanceType<typeof XReactionIcon> | null>(null);
const showEmojiReactions =
defaultStore.state.enableEmojiReactions ||
defaultStore.state.showEmojisInReactionNotifications;
const defaultReaction = ["⭐", "👍", "❤️"].includes(instance.defaultReaction)
? instance.defaultReaction
const realDefaultReaction = getInstanceInfo().defaultReaction;
const defaultReaction = ["⭐", "👍", "❤️"].includes(realDefaultReaction)
? realDefaultReaction
: "⭐";
const users = computed(() => props.notification.users.slice(0, 5));
@ -178,7 +179,7 @@ useTooltip(reactionRef, (showing) => {
? n.reaction.replace(/^:(\w+):$/, ":$1@.:")
: n.reaction,
emojis: n.note.emojis,
targetElement: reactionRef.value!.$el,
targetElement: reactionRef.value?.$el,
},
{},
"closed",
@ -203,7 +204,7 @@ onMounted(() => {
readObserver.observe(elRef.value!);
connection = stream.useChannel("main");
connection.on("readAllNotifications", () => readObserver!.disconnect());
connection.on("readAllNotifications", () => readObserver?.disconnect());
});
onUnmounted(() => {

View file

@ -322,7 +322,7 @@ import { selectFiles } from "@/scripts/select-file";
import { defaultStore, notePostInterruptors, postFormActions } from "@/store";
import MkInfo from "@/components/MkInfo.vue";
import { i18n } from "@/i18n";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { getAccounts, openAccountMenu as openAccountMenu_ } from "@/account";
import { me } from "@/me";
import { uploadFile } from "@/scripts/upload";
@ -497,7 +497,7 @@ const textLength = computed((): number => {
});
const maxTextLength = computed((): number => {
return instance ? instance.maxNoteTextLength : 3000;
return getInstanceInfo().maxNoteTextLength ?? 3000;
});
const canPost = computed((): boolean => {

View file

@ -58,7 +58,7 @@ import { ref } from "vue";
import { getAccounts } from "@/account";
import { isSignedIn, me } from "@/me";
import MkButton from "@/components/MkButton.vue";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { api, apiWithDialog, promiseDialog } from "@/os";
import { i18n } from "@/i18n";
@ -76,6 +76,7 @@ defineProps<{
showOnlyToRegister?: boolean;
}>();
const { swPublickey } = getInstanceInfo();
// ServiceWorker registration
const registration = ref<ServiceWorkerRegistration | undefined>();
// If this browser supports push notification
@ -94,14 +95,14 @@ const pushRegistrationInServer = ref<
>();
function subscribe() {
if (!registration.value || !supported.value || !instance.swPublickey) return;
if (!registration.value || !supported.value || !swPublickey) return;
// SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters
return promiseDialog(
registration.value.pushManager
.subscribe({
userVisibleOnly: true,
applicationServerKey: urlBase64ToUint8Array(instance.swPublickey),
applicationServerKey: urlBase64ToUint8Array(swPublickey),
})
.then(
async (subscription) => {
@ -186,12 +187,7 @@ if (navigator.serviceWorker == null) {
pushSubscription.value =
await registration.value.pushManager.getSubscription();
if (
instance.swPublickey &&
"PushManager" in window &&
isSignedIn(me) &&
me.token
) {
if (swPublickey && "PushManager" in window && isSignedIn(me) && me.token) {
supported.value = true;
if (pushSubscription.value) {

View file

@ -288,7 +288,7 @@ import MkCaptcha from "@/components/MkCaptcha.vue";
import * as config from "@/config";
import * as os from "@/os";
import { signIn } from "@/account";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { i18n } from "@/i18n";
import icon from "@/scripts/icon";
@ -306,6 +306,8 @@ const emit = defineEmits<{
(ev: "signupEmailPending"): void;
}>();
const instance = getInstanceInfo();
const host = toUnicode(config.host);
const hcaptcha = ref();

View file

@ -30,11 +30,11 @@
</g>
</svg>
<i
v-else-if="instance.defaultReaction === '👍'"
v-else-if="defaultReaction === '👍'"
:class="icon('ph-thumbs-up')"
></i>
<i
v-else-if="instance.defaultReaction === '❤️'"
v-else-if="defaultReaction === '❤️'"
:class="icon('ph-heart')"
></i>
<i v-else :class="icon('ph-star')"></i>
@ -48,19 +48,20 @@ import { pleaseLogin } from "@/scripts/please-login";
import * as os from "@/os";
import { defaultStore } from "@/store";
import { i18n } from "@/i18n";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import icon from "@/scripts/icon";
const props = defineProps<{
note: entities.Note;
}>();
const { defaultReaction } = getInstanceInfo();
function star(ev?: MouseEvent): void {
pleaseLogin();
os.api("notes/reactions/create", {
noteId: props.note.id,
reaction:
defaultStore.state.woozyMode === true ? "🥴" : instance.defaultReaction,
reaction: defaultStore.state.woozyMode === true ? "🥴" : defaultReaction,
});
const el =
ev && ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined);

View file

@ -9,23 +9,23 @@
>
<span v-if="!reacted">
<i
v-if="instance.defaultReaction === '👍'"
v-if="defaultReaction === '👍'"
:class="icon('ph-thumbs-up')"
></i>
<i
v-else-if="instance.defaultReaction === '❤️'"
v-else-if="defaultReaction === '❤️'"
:class="icon('ph-heart')"
></i>
<i v-else :class="icon('ph-star')"></i>
</span>
<span v-else>
<i
v-if="instance.defaultReaction === '👍'"
v-if="defaultReaction === '👍'"
class="ph-thumbs-up ph-lg ph-fill"
:class="$style.yellow"
></i>
<i
v-else-if="instance.defaultReaction === '❤️'"
v-else-if="defaultReaction === '❤️'"
class="ph-heart ph-lg ph-fill"
:class="$style.red"
></i>
@ -45,7 +45,7 @@ import XDetails from "@/components/MkUsersTooltip.vue";
import { pleaseLogin } from "@/scripts/please-login";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { useTooltip } from "@/scripts/use-tooltip";
import icon from "@/scripts/icon";
@ -57,13 +57,15 @@ const props = defineProps<{
const buttonRef = ref<HTMLElement>();
const { defaultReaction } = getInstanceInfo();
function toggleStar(ev?: MouseEvent): void {
pleaseLogin();
if (!props.reacted) {
os.api("notes/reactions/create", {
noteId: props.note.id,
reaction: instance.defaultReaction,
reaction: defaultReaction,
});
const el =
ev && ((ev.currentTarget ?? ev.target) as HTMLElement | null | undefined);

View file

@ -212,14 +212,19 @@ import FormSwitch from "@/components/form/switch.vue";
import { defaultStore } from "@/store";
import { i18n } from "@/i18n";
import { isModerator } from "@/me";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import icon from "@/scripts/icon";
const isLocalTimelineAvailable = !instance.disableLocalTimeline || isModerator;
const {
disableLocalTimeline,
disableRecommendedTimeline,
disableGlobalTimeline,
} = getInstanceInfo();
const isLocalTimelineAvailable = !disableLocalTimeline || isModerator;
const isRecommendedTimelineAvailable =
!instance.disableRecommendedTimeline || isModerator;
const isGlobalTimelineAvailable =
!instance.disableGlobalTimeline || isModerator;
!disableRecommendedTimeline || isModerator;
const isGlobalTimelineAvailable = !disableGlobalTimeline || isModerator;
const timelines = ["home"];
@ -252,13 +257,13 @@ const tutorial = computed({
},
});
const autoplayMfm = computed(
defaultStore.makeGetterSetter(
"animatedMfm",
(v) => !v,
(v) => !v,
),
);
// const autoplayMfm = computed(
// defaultStore.makeGetterSetter(
// "animatedMfm",
// (v) => !v,
// (v) => !v,
// ),
// );
const reduceAnimation = computed(
defaultStore.makeGetterSetter(
"animation",
@ -267,9 +272,9 @@ const reduceAnimation = computed(
),
);
function close(res) {
function close(_res) {
tutorial.value = -1;
dialog.value.close();
dialog.value?.close();
}
</script>

View file

@ -40,7 +40,7 @@
<script lang="ts" setup>
import { ref } from "vue";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { host } from "@/config";
import MkButton from "@/components/MkButton.vue";
import { defaultStore } from "@/store";
@ -48,7 +48,9 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import icon from "@/scripts/icon";
type Ad = (typeof instance)["ads"][number];
// TODO?: rename to community banner
const instanceAds = getInstanceInfo().ads;
type Ad = (typeof instanceAds)[number];
const props = defineProps<{
prefer: string[];
@ -65,7 +67,7 @@ const choseAd = (): Ad | Ad[] | null => {
return props.specify;
}
const allAds = instance.ads.map((ad) =>
const allAds = instanceAds.map((ad) =>
defaultStore.state.mutedAds.includes(ad.id)
? {
...ad,

View file

@ -26,7 +26,7 @@ import type { entities } from "firefish-js";
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { char2filePath } from "@/scripts/twemoji-base";
import { defaultStore } from "@/store";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
const props = defineProps<{
emoji: string;
@ -41,7 +41,7 @@ const char = computed(() => (isCustom.value ? null : props.emoji));
const useOsNativeEmojis = computed(
() => defaultStore.state.useOsNativeEmojis && !props.isReaction,
);
const ce = computed(() => props.customEmojis ?? instance.emojis ?? []);
const ce = computed(() => props.customEmojis ?? getInstanceInfo().emojis ?? []);
const customEmoji = computed(() =>
isCustom.value
? ce.value.find(
@ -55,7 +55,7 @@ const url = computed(() => {
} else {
return defaultStore.state.disableShowingAnimatedImages
? getStaticImageUrl(customEmoji.value!.url)
: customEmoji.value!.url;
: customEmoji.value?.url;
}
});
const alt = computed(() =>

View file

@ -27,7 +27,7 @@ import { me } from "@/me";
import type { NoteTranslation, NoteType } from "@/types/note";
import { computed, ref, watch } from "vue";
import * as os from "@/os";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
const props = defineProps<{
note: NoteType;
@ -39,7 +39,7 @@ const translating = ref<boolean>();
const hasError = ref<boolean>();
const canTranslate = computed(
() =>
instance.translatorAvailable &&
getInstanceInfo().translatorAvailable &&
translation.value == null &&
translating.value !== true,
);

View file

@ -13,13 +13,13 @@ import "@phosphor-icons/web/fill";
import "@phosphor-icons/web/light";
import "@phosphor-icons/web/regular";
// #region account indexedDB migration
// #region IndexDB migrations
const accounts = localStorage.getItem("accounts");
if (accounts) {
set("accounts", JSON.parse(accounts));
localStorage.removeItem("accounts");
}
localStorage.removeItem("instance");
// #endregion
import {
@ -37,7 +37,7 @@ import components from "@/components";
import { lang, ui, version } from "@/config";
import directives from "@/directives";
import { i18n } from "@/i18n";
import { fetchInstance, instance } from "@/instance";
import { getInstanceInfo, initializeInstanceCache } from "@/instance";
import { isSignedIn, me } from "@/me";
import { alert, api, confirm, popup, post, toast } from "@/os";
import { deviceKind } from "@/scripts/device-kind";
@ -68,6 +68,7 @@ function checkForSplash() {
}
(async () => {
await initializeInstanceCache();
console.info(`Firefish v${version}`);
if (_DEV_) {
@ -177,14 +178,10 @@ function checkForSplash() {
}
// #endregion
const fetchInstanceMetaPromise = fetchInstance();
localStorage.setItem("v", getInstanceInfo().version);
fetchInstanceMetaPromise.then(() => {
localStorage.setItem("v", instance.version);
// Init service worker
initializeSw();
});
// Init service worker
initializeSw();
const app = createApp(
window.location.search === "?zen"
@ -341,21 +338,15 @@ function checkForSplash() {
};
// #endregion
fetchInstanceMetaPromise.then(() => {
if (defaultStore.state.themeInitial) {
if (instance.defaultLightTheme != null)
ColdDeviceStorage.set(
"lightTheme",
JSON.parse(instance.defaultLightTheme),
);
if (instance.defaultDarkTheme != null)
ColdDeviceStorage.set(
"darkTheme",
JSON.parse(instance.defaultDarkTheme),
);
defaultStore.set("themeInitial", false);
}
});
const { defaultLightTheme, defaultDarkTheme } = getInstanceInfo();
if (defaultStore.state.themeInitial) {
if (defaultLightTheme != null)
ColdDeviceStorage.set("lightTheme", JSON.parse(defaultLightTheme));
if (defaultDarkTheme != null)
ColdDeviceStorage.set("darkTheme", JSON.parse(defaultDarkTheme));
defaultStore.set("themeInitial", false);
}
watch(
defaultStore.reactiveState.useBlurEffectForModal,

View file

@ -1,30 +1,40 @@
import type { entities } from "firefish-js";
import { computed, reactive } from "vue";
import { computed } from "vue";
import { api } from "./os";
import { set, get } from "idb-keyval";
// TODO: 他のタブと永続化されたstateを同期
const instanceData = localStorage.getItem("instance");
// TODO: instanceをリアクティブにするかは再考の余地あり
// TODO: get("instance") requires top-level await
let instance: entities.DetailedInstanceMetadata;
export const instance: entities.DetailedInstanceMetadata = reactive(
instanceData
? JSON.parse(instanceData)
: {
// TODO: set default values
},
);
export function getInstanceInfo(): entities.DetailedInstanceMetadata {
return instance;
}
export async function fetchInstance() {
export async function initializeInstanceCache(): Promise<void> {
// Is the data stored in IndexDB?
const fromIdb = await get<string>("instance");
if (fromIdb != null) {
instance = JSON.parse(fromIdb);
}
// Call API
updateInstanceCache();
}
export async function updateInstanceCache(): Promise<void> {
const meta = await api("meta", {
detail: true,
});
// TODO: set default values
instance = {} as entities.DetailedInstanceMetadata;
for (const [k, v] of Object.entries(meta)) {
instance[k] = v;
}
localStorage.setItem("instance", JSON.stringify(instance));
set("instance", JSON.stringify(instance));
}
export const emojiCategories = computed(() => {

View file

@ -35,7 +35,7 @@
><MkEmoji
class="emoji"
:emoji="emoji.emoji"
:custom-emojis="instance.emojis"
:custom-emojis="instanceEmojis"
:is-reaction="false"
:normal="true"
:no-style="true"
@ -96,12 +96,13 @@ import { defaultReactions, defaultStore } from "@/store";
import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
let easterEggReady = false;
const easterEggEmojis = ref([]);
const easterEggEngine = ref(null);
const containerEl = ref<HTMLElement>();
const instanceEmojis = getInstanceInfo().emojis;
function iconLoaded() {
const emojis =

View file

@ -6,12 +6,6 @@
><i :class="icon('ph-magnifying-glass')"></i
></template>
</MkInput>
<!-- たくさんあると邪魔
<div class="tags">
<span class="tag _button" v-for="tag in tags" :class="{ active: selectedTags.has(tag) }" @click="toggleTag(tag)">{{ tag }}</span>
</div>
-->
</div>
<MkFolder v-if="searchEmojis" class="emojis">
@ -54,7 +48,7 @@ import MkInput from "@/components/form/input.vue";
import MkSelect from "@/components/form/select.vue";
import MkFolder from "@/components/MkFolder.vue";
import MkTab from "@/components/MkTab.vue";
import { emojiCategories, emojiTags, instance } from "@/instance";
import { emojiCategories, emojiTags, getInstanceInfo } from "@/instance";
import { i18n } from "@/i18n";
import iconify from "@/scripts/icon";
@ -72,7 +66,7 @@ export default defineComponent({
return {
q: "",
customEmojiCategories: emojiCategories,
customEmojis: instance.emojis,
customEmojis: getInstanceInfo().emojis,
tags: emojiTags,
selectedTags: new Set(),
searchEmojis: null,

View file

@ -192,7 +192,7 @@ import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import { deviceKind } from "@/scripts/device-kind";
import { isModerator } from "@/me";
import { instance } from "@/instance";
import { getInstanceInfo } from "@/instance";
import { defaultStore } from "@/store";
import icon from "@/scripts/icon";
import "swiper/scss";
@ -207,6 +207,7 @@ withDefaults(
},
);
const instance = getInstanceInfo();
const stats = ref(null);
const instanceIcon = ref<HTMLImageElement>();
let iconClicks = 0;
@ -307,7 +308,7 @@ function onSlideChange() {
}
function syncSlide(index: number) {
swiperRef!.slideTo(index);
swiperRef?.slideTo(index);
}
</script>

View file

@ -81,7 +81,7 @@ import FormButton from "@/components/MkButton.vue";
import FormSuspense from "@/components/form/suspense.vue";
import FormSlot from "@/components/form/slot.vue";
import * as os from "@/os";
import { fetchInstance } from "@/instance";
import { updateInstanceCache } from "@/instance";
import { i18n } from "@/i18n";
import icon from "@/scripts/icon";
@ -89,7 +89,7 @@ const MkCaptcha = defineAsyncComponent(
() => import("@/components/MkCaptcha.vue"),
);
const provider = ref<any>(null);
const provider = ref<string | null>(null);
const hcaptchaSiteKey = ref<string | null>(null);
const hcaptchaSecretKey = ref<string | null>(null);
const recaptchaSiteKey = ref<string | null>(null);
@ -97,14 +97,14 @@ const recaptchaSecretKey = ref<string | null>(null);
async function init() {
const meta = await os.api("admin/meta");
hcaptchaSiteKey.value = meta.hcaptchaSiteKey;
hcaptchaSecretKey.value = meta.hcaptchaSecretKey;
recaptchaSiteKey.value = meta.recaptchaSiteKey;
recaptchaSecretKey.value = meta.recaptchaSecretKey;
hcaptchaSiteKey.value = meta?.hcaptchaSiteKey;
hcaptchaSecretKey.value = meta?.hcaptchaSecretKey;
recaptchaSiteKey.value = meta?.recaptchaSiteKey;
recaptchaSecretKey.value = meta?.recaptchaSecretKey;
provider.value = meta.enableHcaptcha
provider.value = meta?.enableHcaptcha
? "hcaptcha"
: meta.enableRecaptcha
: meta?.enableRecaptcha
? "recaptcha"
: null;
}
@ -118,7 +118,7 @@ function save() {
recaptchaSiteKey: recaptchaSiteKey.value,
recaptchaSecretKey: recaptchaSecretKey.value,
}).then(() => {
fetchInstance();
updateInstanceCache();
});
}
</script>

View file

@ -100,13 +100,13 @@ import FormSuspense from "@/components/form/suspense.vue";
import FormSplit from "@/components/form/split.vue";
import FormSection from "@/components/form/section.vue";
import * as os from "@/os";
import { fetchInstance, instance } from "@/instance";
import { updateInstanceCache, getInstanceInfo } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon";
const enableEmail = ref(false);
const email: any = ref(null);
const email = ref<string | null>(null);
const smtpSecure = ref(false);
const smtpHost = ref("");
const smtpPort = ref(0);
@ -115,20 +115,22 @@ const smtpPass = ref("");
async function init() {
const meta = await os.api("admin/meta");
enableEmail.value = meta.enableEmail;
email.value = meta.email;
smtpSecure.value = meta.smtpSecure;
smtpHost.value = meta.smtpHost;
smtpPort.value = meta.smtpPort;
smtpUser.value = meta.smtpUser;
smtpPass.value = meta.smtpPass;
enableEmail.value = meta?.enableEmail;
email.value = meta?.email;
smtpSecure.value = meta?.smtpSecure;
smtpHost.value = meta?.smtpHost;
smtpPort.value = meta?.smtpPort;
smtpUser.value = meta?.smtpUser;
smtpPass.value = meta?.smtpPass;
}
const { maintainerEmail } = getInstanceInfo();
async function testEmail() {
const { canceled, result: destination } = await os.inputText({
title: i18n.ts.destination,
type: "email",
placeholder: instance.maintainerEmail,
placeholder: maintainerEmail,
});
if (canceled) return;
os.apiWithDialog("admin/send-email", {
@ -148,7 +150,7 @@ function save() {
smtpUser: smtpUser.value,
smtpPass: smtpPass.value,
}).then(() => {
fetchInstance();
updateInstanceCache();
});
}

Some files were not shown because too many files have changed in this diff Show more