diff --git a/.dockerignore b/.dockerignore
index 30e75f6237..d4c11934d1 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -40,14 +40,11 @@ packages/backend/assets/instance.css
.gitattributes
.weblate
animated.svg
-cliff.toml
docker-compose.yml
docker-compose.example.yml
-firefish.apache.conf
-firefish.nginx.conf
title.svg
/.gitlab
-/chart
+/ci
/dev
/docs
/scripts
@@ -56,6 +53,8 @@ biome.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
-Procfile
+Makefile
README.md
SECURITY.md
+patrons.json
+renovate.json
diff --git a/.gitignore b/.gitignore
index 1c46fa0a0a..1cf6420856 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@ node_modules
report.*.json
# Cargo
+/.cargo
/target
# Cypress
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ac3db424b5..063082d28c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,10 +25,11 @@ workflow:
- when: never
stages:
- - dependency
- test
- doc
- build
+ - dependency
+ - clean
variables:
POSTGRES_DB: 'firefish_db'
@@ -36,6 +37,7 @@ variables:
POSTGRES_PASSWORD: 'password'
POSTGRES_HOST_AUTH_METHOD: 'trust'
DEBIAN_FRONTEND: 'noninteractive'
+ NODE_OPTIONS: '--max_old_space_size=3072'
CARGO_PROFILE_DEV_OPT_LEVEL: '0'
CARGO_PROFILE_DEV_LTO: 'off'
CARGO_PROFILE_DEV_DEBUG: 'none'
@@ -119,6 +121,7 @@ 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
- 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}"
@@ -199,6 +202,8 @@ build:container:
STORAGE_DRIVER: overlay
before_script:
- apt-get update && apt-get -y upgrade
+ - |-
+ sed -i -r 's/"version": "([-0-9]+)",/"version": "\1-dev",/' package.json
- apt-get install -y --no-install-recommends ca-certificates fuse-overlayfs buildah
- echo "${CI_REGISTRY_PASSWORD}" | buildah login --username "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
- export IMAGE_TAG="${CI_REGISTRY}/${CI_PROJECT_PATH}/develop:not-for-production"
@@ -221,6 +226,31 @@ build:container:
- buildah inspect "${IMAGE_TAG}"
- buildah push "${IMAGE_TAG}"
+cargo:check:msrv:
+ stage: test
+ image: docker.io/rust:1.74-slim-bookworm
+ rules:
+ - if: $TEST == 'true'
+ when: always
+ - if: $TEST == 'false'
+ when: never
+ - if: $CI_COMMIT_BRANCH == 'develop' || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'develop'
+ changes:
+ paths:
+ - packages/backend-rs/**/*
+ - packages/macro-rs/**/*
+ - Cargo.toml
+ - Cargo.lock
+ when: always
+ services: []
+ before_script:
+ - apt-get update && apt-get -y upgrade
+ - apt-get install -y --no-install-recommends build-essential clang mold python3 perl nodejs postgresql-client
+ - cp ci/cargo/config.toml /usr/local/cargo/config.toml
+ script:
+ - cargo fetch --locked --manifest-path Cargo.toml
+ - cargo check --locked --frozen --all-features
+
cargo:test:
stage: test
rules:
@@ -235,7 +265,6 @@ cargo:test:
- packages/macro-rs/**/*
- Cargo.toml
- Cargo.lock
- - package.json
when: always
script:
- curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C /usr/local/cargo/bin
@@ -287,7 +316,7 @@ cargo:doc:
- cp ci/cargo/config.toml /usr/local/cargo/config.toml
script:
- cargo doc --document-private-items
- - printf "window.ALL_CRATES = ['backend_rs', 'macro_rs'];" > target/doc/crates.js
+ - printf 'window.ALL_CRATES = ["backend_rs", "macros", "macros_impl"];' > target/doc/crates.js
- printf '' 'backend_rs' > target/doc/index.html
- cd target/doc
- npx --yes netlify-cli deploy --prod --site="${CARGO_DOC_SITE_ID}" --dir=.
@@ -303,3 +332,19 @@ renovate:
before_script: []
script:
- renovate --platform gitlab --token "${API_TOKEN}" --endpoint "${CI_SERVER_URL}/api/v4" "${CI_PROJECT_PATH}"
+
+clean:
+ stage: clean
+ rules:
+ - if: $CLEAN && $CI_PIPELINE_SOURCE == 'schedule'
+ services: []
+ before_script:
+ - apt-get update && apt-get -y upgrade
+ - apt-get -y --no-install-recommends install curl
+ - curl -fsSL 'https://deb.nodesource.com/setup_18.x' | bash -
+ - apt-get install -y --no-install-recommends nodejs
+ - corepack enable
+ - corepack prepare pnpm@latest --activate
+ - pnpm install --frozen-lockfile
+ script:
+ - pnpm run clean-all
diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md
deleted file mode 100644
index f96bdec01e..0000000000
--- a/.gitlab/issue_templates/bug.md
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-## What happened?
-
-
-## What did you expect to happen?
-
-
-## Version
-
-
-## What type of issue is this?
-
-- [ ] server-side
-- [ ] client-side
-- [ ] not sure
-
-
-
-### Instance
-
-
-### What browser are you using? (client-side issues only)
-
-
-### What operating system are you using? (client-side issues only)
-
-
-### How do you deploy Firefish on your server? (server-side issues only)
-
-
-### What operating system are you using? (Server-side issues only)
-
-
-### Relevant log output
-
-
-
-
-## Contribution Guidelines
-By submitting this issue, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md)
-- [ ] I agree to follow this project's Contribution Guidelines
-- [ ] I have searched the issue tracker for similar issues, and this is not a duplicate.
-
-## Are you willing to fix this bug? (optional)
-- [ ] Yes. I will fix this bug and open a merge request if the change is agreed upon.
diff --git a/.gitlab/issue_templates/default.md b/.gitlab/issue_templates/default.md
new file mode 100644
index 0000000000..f5823ea666
--- /dev/null
+++ b/.gitlab/issue_templates/default.md
@@ -0,0 +1,99 @@
+
+
+
+
+## What type of issue is this?
+
+
+
+
+
+
+
+
+
+
+
+
+
+## What happened?
+
+
+
+## What did you expect to happen?
+
+
+
+## Steps to reproduce the issue
+
+
+
+## Reproduces how often
+
+
+
+## What did you try to solve the issue
+
+
+
+## Version
+
+
+
+
+
+### Instance
+
+
+
+### What browser are you using? (client-side issues only)
+
+
+### What operating system are you using? (client-side issues only)
+
+
+### How do you deploy Firefish on your server? (server-side issues only)
+
+
+### What operating system are you using? (Server-side issues only)
+
+
+### Relevant log output
+
+
+
+
+
+## Contribution Guidelines
+By submitting this issue, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md)
+- [ ] I agree to follow this project's Contribution Guidelines
+- [ ] I have searched the issue tracker for similar issues, and this is not a duplicate.
+
+## Are you willing to fix this bug? (optional)
+
+
+
+
+
+
+
+
+
+/label Bug?
diff --git a/.gitlab/issue_templates/feature.md b/.gitlab/issue_templates/feature.md
index 4c9ee56226..a99265161b 100644
--- a/.gitlab/issue_templates/feature.md
+++ b/.gitlab/issue_templates/feature.md
@@ -1,18 +1,45 @@
-
+
+
+🤝 By submitting this refactor proposal, you agree to follow our [Contribution Guidelines.](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md) -->
-## What feature would you like implemented?
+## What type of refactoring is this?
+
+
+
+
+
+
+
+
+
+
+
+
+
+## What feature would you like implemented?
+
-## Why should we add this feature?
+## Why should we add this feature?
+
-## Version
+## Version
+
-## Instance
+## Instance
+
## Contribution Guidelines
@@ -21,4 +48,20 @@ By submitting this issue, you agree to follow our [Contribution Guidelines](http
- [ ] I have searched the issue tracker for similar requests, and this is not a duplicate.
## Are you willing to implement this feature? (optional)
-- [ ] Yes. I will implement this feature and open a merge request if the change is agreed upon.
+
+
+
+
+
+
+
+
+
+/label Feature
diff --git a/.gitlab/issue_templates/refactor.md b/.gitlab/issue_templates/refactor.md
new file mode 100644
index 0000000000..e9f9ffe05f
--- /dev/null
+++ b/.gitlab/issue_templates/refactor.md
@@ -0,0 +1,67 @@
+
+
+
+
+## What type of feature is this?
+
+
+
+
+
+
+
+
+
+
+
+
+
+## What parts of the code do you think should be refactored?
+
+
+
+## Why should the code be refactored that way?
+
+
+
+## Version
+
+
+
+## Instance
+
+
+
+## Contribution Guidelines
+By submitting this issue, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md)
+- [ ] I agree to follow this project's Contribution Guidelines
+- [ ] I have searched the issue tracker for similar requests, and this is not a duplicate.
+
+## Are you willing to refactor the code? (optional)
+
+
+
+
+
+
+
+
+
+/label Refactor
diff --git a/.gitlab/merge_request_templates/default.md b/.gitlab/merge_request_templates/default.md
index d13a146da0..6d09072a87 100644
--- a/.gitlab/merge_request_templates/default.md
+++ b/.gitlab/merge_request_templates/default.md
@@ -1,16 +1,19 @@
-
+
-## What does this PR do?
+## What does this merge request do?
+
## Contribution Guidelines
By submitting this merge request, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md)
-- [ ] This change is reviewed in an issue / This is a minor bug fix
-- [ ] I agree to follow this project's Contribution Guidelines
-- [ ] I have made sure to test this pull request
-- [ ] I have made sure to run `pnpm run format` before submitting this pull request
+- [ ] This closes issue #0000 (please substitute the number)
+- [ ] This is a minor bug fix or refactoring
-If this merge request makes changes to the Firefish API, please update `docs/api-change.md`
+- [ ] I agree to follow this project's Contribution Guidelines
+- [ ] I have made sure to test this merge request
+- [ ] I have made sure to run `pnpm run format` before submitting this merge request
+
+If this merge request makes changes to API, please update `docs/api-change.md`
- [ ] I updated the document / This merge request doesn't include API changes
diff --git a/.gitlab/merge_request_templates/release.md b/.gitlab/merge_request_templates/release.md
index ea40f38813..6b83d5fdc4 100644
--- a/.gitlab/merge_request_templates/release.md
+++ b/.gitlab/merge_request_templates/release.md
@@ -1,4 +1,5 @@
+/label Release
## Checklist
@@ -13,7 +14,5 @@ I have updated...
- [ ] `packages/backend-rs/index.js`
- [ ] OCI container image
-
-
## Remarks
diff --git a/Cargo.lock b/Cargo.lock
index f907f47515..d91ec63a4a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -92,7 +92,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -143,7 +143,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -154,7 +154,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -207,10 +207,10 @@ dependencies = [
"chrono",
"cuid2",
"emojis",
- "idna",
+ "idna 1.0.2",
"image",
"isahc",
- "macro-rs",
+ "macros",
"napi",
"napi-build",
"napi-derive",
@@ -226,7 +226,6 @@ dependencies = [
"serde",
"serde_json",
"serde_yaml",
- "strum 0.26.2",
"sysinfo",
"thiserror",
"tokio",
@@ -240,9 +239,9 @@ dependencies = [
[[package]]
name = "backtrace"
-version = "0.3.72"
+version = "0.3.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11"
+checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
dependencies = [
"addr2line",
"cc",
@@ -291,12 +290,11 @@ checksum = "1dbe4bb73fd931c4d1aaf53b35d1286c8a948ad00ec92c8e3c856f15fd027f43"
[[package]]
name = "bb8"
-version = "0.8.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df7c2093d15d6a1d33b1f972e1c5ea3177748742b97a5f392aa83a65262c6780"
+checksum = "b10cf871f3ff2ce56432fddc2615ac7acc3aa22ca321f8fea800846fbb32f188"
dependencies = [
"async-trait",
- "futures-channel",
"futures-util",
"tokio",
]
@@ -327,9 +325,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.5.0"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
dependencies = [
"serde",
]
@@ -382,9 +380,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "bytemuck"
-version = "1.16.0"
+version = "1.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5"
+checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e"
[[package]]
name = "byteorder"
@@ -412,9 +410,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6"
[[package]]
name = "cc"
-version = "1.0.98"
+version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f"
+checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490"
dependencies = [
"jobserver",
"libc",
@@ -631,7 +629,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -669,9 +667,9 @@ dependencies = [
[[package]]
name = "curl-sys"
-version = "0.4.72+curl-8.6.0"
+version = "0.4.73+curl-8.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29cbdc8314c447d11e8fd156dcdd031d9e02a7a976163e396b548c03153bc9ea"
+checksum = "450ab250ecf17227c39afb9a2dd9261dc0035cb80f2612472fc0c4aac2dcb84d"
dependencies = [
"cc",
"libc",
@@ -724,7 +722,7 @@ dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
- "synstructure",
+ "synstructure 0.12.6",
]
[[package]]
@@ -766,6 +764,17 @@ dependencies = [
"subtle",
]
+[[package]]
+name = "displaydoc"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
+]
+
[[package]]
name = "dotenvy"
version = "0.15.7"
@@ -816,9 +825,9 @@ dependencies = [
[[package]]
name = "either"
-version = "1.12.0"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b"
+checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
dependencies = [
"serde",
]
@@ -947,7 +956,7 @@ checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181"
dependencies = [
"futures-core",
"futures-sink",
- "spin 0.9.8",
+ "spin",
]
[[package]]
@@ -1264,6 +1273,124 @@ dependencies = [
"cc",
]
+[[package]]
+name = "icu_collections"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526"
+dependencies = [
+ "displaydoc",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locid"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637"
+dependencies = [
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locid_transform"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e"
+dependencies = [
+ "displaydoc",
+ "icu_locid",
+ "icu_locid_transform_data",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locid_transform_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e"
+
+[[package]]
+name = "icu_normalizer"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "utf16_iter",
+ "utf8_iter",
+ "write16",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516"
+
+[[package]]
+name = "icu_properties"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_locid_transform",
+ "icu_properties_data",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_properties_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569"
+
+[[package]]
+name = "icu_provider"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9"
+dependencies = [
+ "displaydoc",
+ "icu_locid",
+ "icu_provider_macros",
+ "stable_deref_trait",
+ "tinystr",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_provider_macros"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
+]
+
[[package]]
name = "idna"
version = "0.5.0"
@@ -1274,6 +1401,18 @@ dependencies = [
"unicode-normalization",
]
+[[package]]
+name = "idna"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd69211b9b519e98303c015e21a007e293db403b6c85b9b124e133d25e242cdd"
+dependencies = [
+ "icu_normalizer",
+ "icu_properties",
+ "smallvec",
+ "utf8_iter",
+]
+
[[package]]
name = "image"
version = "0.25.1"
@@ -1328,7 +1467,7 @@ checksum = "0122b7114117e64a63ac49f752a5ca4624d534c7b1c7de796ac196381cd2d947"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -1357,7 +1496,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -1477,11 +1616,11 @@ dependencies = [
[[package]]
name = "lazy_static"
-version = "1.4.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
dependencies = [
- "spin 0.5.2",
+ "spin",
]
[[package]]
@@ -1503,9 +1642,9 @@ dependencies = [
[[package]]
name = "libloading"
-version = "0.8.3"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
+checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
dependencies = [
"cfg-if",
"windows-targets 0.52.5",
@@ -1556,6 +1695,12 @@ version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
+[[package]]
+name = "litemap"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704"
+
[[package]]
name = "lock_api"
version = "0.4.12"
@@ -1568,9 +1713,9 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.21"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "loop9"
@@ -1582,18 +1727,24 @@ dependencies = [
]
[[package]]
-name = "macro-rs"
+name = "macros"
version = "0.0.0"
dependencies = [
- "convert_case",
- "napi",
- "napi-derive",
+ "macros-impl",
"proc-macro2",
"quote",
"serde",
"serde_json",
- "syn 2.0.66",
- "thiserror",
+]
+
+[[package]]
+name = "macros-impl"
+version = "0.0.0"
+dependencies = [
+ "convert_case",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
]
[[package]]
@@ -1618,9 +1769,9 @@ dependencies = [
[[package]]
name = "memchr"
-version = "2.7.2"
+version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "mime"
@@ -1636,9 +1787,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
-version = "0.7.3"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae"
+checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
dependencies = [
"adler",
"simd-adler32",
@@ -1657,12 +1808,14 @@ dependencies = [
[[package]]
name = "napi"
-version = "3.0.0-alpha.2"
-source = "git+https://github.com/napi-rs/napi-rs.git?rev=ca2cd5c35a0c39ec4a94e93c6c5695b681046df2#ca2cd5c35a0c39ec4a94e93c6c5695b681046df2"
+version = "2.16.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1bd081bbaef43600fd2c5dd4c525b8ecea7dfdacf40ebc674e87851dce6559e"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"chrono",
"ctor",
+ "napi-derive",
"napi-sys",
"once_cell",
"serde",
@@ -1678,35 +1831,38 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a"
[[package]]
name = "napi-derive"
-version = "2.16.5"
+version = "2.16.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4"
+checksum = "eafd2b920906ea5b1f5f1f9d1eff9cc74e4ff8124dca41b501c1413079589187"
dependencies = [
"cfg-if",
"convert_case",
"napi-derive-backend",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
name = "napi-derive-backend"
-version = "1.0.67"
+version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e"
+checksum = "b370b784440c65eb9001d839012eb912ee43e3a2d0361e2c30c13052372c39fe"
dependencies = [
"convert_case",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "regex",
+ "semver",
+ "syn 2.0.68",
]
[[package]]
name = "napi-sys"
version = "2.4.0"
-source = "git+https://github.com/napi-rs/napi-rs.git?rev=ca2cd5c35a0c39ec4a94e93c6c5695b681046df2#ca2cd5c35a0c39ec4a94e93c6c5695b681046df2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3"
dependencies = [
"libloading",
]
@@ -1780,9 +1936,9 @@ dependencies = [
[[package]]
name = "num-bigint"
-version = "0.4.5"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7"
+checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
@@ -1828,7 +1984,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -1884,9 +2040,9 @@ dependencies = [
[[package]]
name = "object"
-version = "0.35.0"
+version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e"
+checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
dependencies = [
"memchr",
]
@@ -1903,7 +2059,7 @@ version = "0.10.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"cfg-if",
"foreign-types",
"libc",
@@ -1920,7 +2076,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -1931,9 +2087,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
-version = "300.3.0+3.3.0"
+version = "300.3.1+3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eba8804a1c5765b18c4b3f907e6897ebabeedebc9830e1a0046c4a4cf44663e1"
+checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91"
dependencies = [
"cc",
]
@@ -1981,7 +2137,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -2038,7 +2194,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall 0.5.1",
+ "redox_syscall 0.5.2",
"smallvec",
"windows-targets 0.52.5",
]
@@ -2139,7 +2295,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -2289,9 +2445,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.84"
+version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6"
+checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
@@ -2312,7 +2468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd"
dependencies = [
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -2460,18 +2616,18 @@ dependencies = [
[[package]]
name = "redox_syscall"
-version = "0.5.1"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
+checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
]
[[package]]
name = "regex"
-version = "1.10.4"
+version = "1.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
+checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
dependencies = [
"aho-corasick",
"memchr",
@@ -2481,9 +2637,9 @@ dependencies = [
[[package]]
name = "regex-automata"
-version = "0.4.6"
+version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
+checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
dependencies = [
"aho-corasick",
"memchr",
@@ -2492,9 +2648,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
-version = "0.8.3"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
+checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]]
name = "rfc6979"
@@ -2508,9 +2664,9 @@ dependencies = [
[[package]]
name = "rgb"
-version = "0.8.37"
+version = "0.8.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8"
+checksum = "a7439be6844e40133eda024efd85bf07f59d0dd2f59b10c00dd6cfb92cc5c741"
dependencies = [
"bytemuck",
]
@@ -2525,7 +2681,7 @@ dependencies = [
"cfg-if",
"getrandom",
"libc",
- "spin 0.9.8",
+ "spin",
"untrusted",
"windows-sys 0.52.0",
]
@@ -2605,7 +2761,7 @@ version = "0.38.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"errno",
"libc",
"linux-raw-sys",
@@ -2642,12 +2798,6 @@ dependencies = [
"untrusted",
]
-[[package]]
-name = "rustversion"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
-
[[package]]
name = "ryu"
version = "1.0.18"
@@ -2689,7 +2839,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -2710,7 +2860,7 @@ dependencies = [
"serde",
"serde_json",
"sqlx",
- "strum 0.25.0",
+ "strum",
"thiserror",
"time",
"tracing",
@@ -2728,7 +2878,7 @@ dependencies = [
"proc-macro2",
"quote",
"sea-bae",
- "syn 2.0.66",
+ "syn 2.0.68",
"unicode-ident",
]
@@ -2782,6 +2932,12 @@ dependencies = [
"thiserror",
]
+[[package]]
+name = "semver"
+version = "1.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
+
[[package]]
name = "serde"
version = "1.0.203"
@@ -2799,14 +2955,14 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
name = "serde_json"
-version = "1.0.117"
+version = "1.0.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
+checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
dependencies = [
"itoa",
"ryu",
@@ -2962,12 +3118,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
[[package]]
name = "spin"
version = "0.9.8"
@@ -2999,11 +3149,10 @@ dependencies = [
[[package]]
name = "sqlformat"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c"
+checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f"
dependencies = [
- "itertools",
"nom",
"unicode_categories",
]
@@ -3111,7 +3260,7 @@ checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418"
dependencies = [
"atoi",
"base64 0.21.7",
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"byteorder",
"bytes",
"chrono",
@@ -3154,7 +3303,7 @@ checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e"
dependencies = [
"atoi",
"base64 0.21.7",
- "bitflags 2.5.0",
+ "bitflags 2.6.0",
"byteorder",
"chrono",
"crc",
@@ -3209,6 +3358,12 @@ dependencies = [
"urlencoding",
]
+[[package]]
+name = "stable_deref_trait"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
+
[[package]]
name = "static_assertions"
version = "1.1.0"
@@ -3232,33 +3387,11 @@ version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
-[[package]]
-name = "strum"
-version = "0.26.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
-dependencies = [
- "strum_macros",
-]
-
-[[package]]
-name = "strum_macros"
-version = "0.26.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
-dependencies = [
- "heck 0.4.1",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn 2.0.66",
-]
-
[[package]]
name = "subtle"
-version = "2.5.0"
+version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "syn"
@@ -3273,9 +3406,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.66"
+version = "2.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
+checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
dependencies = [
"proc-macro2",
"quote",
@@ -3294,6 +3427,17 @@ dependencies = [
"unicode-xid",
]
+[[package]]
+name = "synstructure"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
+]
+
[[package]]
name = "sysinfo"
version = "0.30.12"
@@ -3356,7 +3500,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -3411,10 +3555,20 @@ dependencies = [
]
[[package]]
-name = "tinyvec"
-version = "1.6.0"
+name = "tinystr"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
+checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
+dependencies = [
+ "displaydoc",
+ "zerovec",
+]
+
+[[package]]
+name = "tinyvec"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82"
dependencies = [
"tinyvec_macros",
]
@@ -3427,9 +3581,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.37.0"
+version = "1.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
+checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
dependencies = [
"backtrace",
"bytes",
@@ -3445,13 +3599,13 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "2.2.0"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
+checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -3493,9 +3647,9 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.8.13"
+version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba"
+checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
dependencies = [
"serde",
"serde_spanned",
@@ -3514,9 +3668,9 @@ dependencies = [
[[package]]
name = "toml_edit"
-version = "0.22.13"
+version = "0.22.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c"
+checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38"
dependencies = [
"indexmap",
"serde",
@@ -3545,7 +3699,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
]
[[package]]
@@ -3644,12 +3798,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
-version = "2.5.0"
+version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
+checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c"
dependencies = [
"form_urlencoded",
- "idna",
+ "idna 0.5.0",
"percent-encoding",
]
@@ -3660,10 +3814,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
[[package]]
-name = "uuid"
-version = "1.8.0"
+name = "utf16_iter"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
+checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
+
+[[package]]
+name = "utf8_iter"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
+
+[[package]]
+name = "uuid"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439"
dependencies = [
"serde",
]
@@ -3745,7 +3911,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
"wasm-bindgen-shared",
]
@@ -3767,7 +3933,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -4003,13 +4169,25 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]]
name = "winnow"
-version = "0.6.9"
+version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6"
+checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
dependencies = [
"memchr",
]
+[[package]]
+name = "write16"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
+
+[[package]]
+name = "writeable"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
+
[[package]]
name = "yansi"
version = "0.5.1"
@@ -4017,23 +4195,68 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
[[package]]
-name = "zerocopy"
-version = "0.7.34"
+name = "yoke"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
+checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5"
+dependencies = [
+ "serde",
+ "stable_deref_trait",
+ "yoke-derive",
+ "zerofrom",
+]
+
+[[package]]
+name = "yoke-derive"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
+ "synstructure 0.13.1",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.7.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.7.34"
+version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
+checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.66",
+ "syn 2.0.68",
+]
+
+[[package]]
+name = "zerofrom"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55"
+dependencies = [
+ "zerofrom-derive",
+]
+
+[[package]]
+name = "zerofrom-derive"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
+ "synstructure 0.13.1",
]
[[package]]
@@ -4042,6 +4265,28 @@ version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
+[[package]]
+name = "zerovec"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079"
+dependencies = [
+ "yoke",
+ "zerofrom",
+ "zerovec-derive",
+]
+
+[[package]]
+name = "zerovec-derive"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.68",
+]
+
[[package]]
name = "zune-core"
version = "0.4.12"
diff --git a/Cargo.toml b/Cargo.toml
index 8a8c3b7f54..12315f18eb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,51 +1,58 @@
[workspace]
-members = ["packages/backend-rs", "packages/macro-rs"]
+members = ["packages/backend-rs", "packages/macro-rs/macros", "packages/macro-rs/macros-impl"]
resolver = "2"
[workspace.dependencies]
-macro-rs = { path = "packages/macro-rs" }
+macros = { path = "packages/macro-rs/macros" }
+macros-impl = { path = "packages/macro-rs/macros-impl" }
-napi = { git = "https://github.com/napi-rs/napi-rs.git", rev = "ca2cd5c35a0c39ec4a94e93c6c5695b681046df2", default-features = false }
-napi-derive = { version = "2.16.5", default-features = false }
-napi-build = { version = "2.1.3", default-features = false }
+napi = "2.16.8"
+napi-derive = "2.16.8"
+napi-build = "2.1.3"
argon2 = { version = "0.5.3", default-features = false }
async-trait = { version = "0.1.80", default-features = false }
basen = { version = "0.1.0", default-features = false }
-bb8 = { version = "0.8.3", default-features = false }
+bb8 = { version = "0.8.5", default-features = false }
bcrypt = { version = "0.15.1", default-features = false }
chrono = { version = "0.4.38", default-features = false }
convert_case = { version = "0.6.0", default-features = false }
cuid2 = { version = "0.1.2", default-features = false }
emojis = { version = "0.6.2", default-features = false }
-idna = { version = "0.5.0", default-features = false }
+idna = { version = "1.0.2", default-features = false }
image = { version = "0.25.1", default-features = false }
isahc = { version = "1.7.2", default-features = false }
nom-exif = { version = "1.2.0", default-features = false }
once_cell = { version = "1.19.0", default-features = false }
-openssl = { version = "0.10.64", default-features = false }
pretty_assertions = { version = "1.4.0", default-features = false }
-proc-macro2 = { version = "1.0.84", default-features = false }
+proc-macro2 = { version = "1.0.86", default-features = false }
quote = { version = "1.0.36", default-features = false }
rand = { version = "0.8.5", default-features = false }
redis = { version = "0.25.4", default-features = false }
-regex = { version = "1.10.4", default-features = false }
+regex = { version = "1.10.5", default-features = false }
rmp-serde = { version = "1.3.0", default-features = false }
sea-orm = { version = "0.12.15", default-features = false }
serde = { version = "1.0.203", default-features = false }
-serde_json = { version = "1.0.117", default-features = false }
+serde_json = { version = "1.0.120", default-features = false }
serde_yaml = { version = "0.9.34", default-features = false }
-strum = { version = "0.26.2", default-features = false }
-syn = { version = "2.0.66", default-features = false }
+syn = { version = "2.0.68", default-features = false }
sysinfo = { version = "0.30.12", default-features = false }
thiserror = { version = "1.0.61", default-features = false }
-tokio = { version = "1.37.0", default-features = false }
+tokio = { version = "1.38.0", default-features = false }
tokio-test = { version = "0.4.4", default-features = false }
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.18", default-features = false }
-url = { version = "2.5.0", default-features = false }
+url = { version = "2.5.2", default-features = false }
urlencoding = { version = "2.1.3", default-features = false }
web-push = { git = "https://github.com/pimeys/rust-web-push.git", rev = "40febe4085e3cef9cdfd539c315e3e945aba0656", default-features = false }
+# subdependencies
+## explicitly list OpenSSL to use the vendored version
+openssl = "0.10.64"
+
+## some subdependencies require higher Rust version than 1.74 (our MSRV)
+## cargo update && cargo update ravif --precise 0.11.5 && cargo update bitstream-io --precise 2.3.0
+## to pin their versions if needed
+
[profile.release]
lto = true
diff --git a/Dockerfile b/Dockerfile
index 5bad58b949..eea100f4ce 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,23 +2,20 @@
FROM docker.io/node:20-alpine as build
WORKDIR /firefish
+# Copy only backend-rs pnpm-related files first, to cache efficiently
+COPY package.json pnpm-workspace.yaml ./
+COPY packages/backend-rs/package.json packages/backend-rs/package.json
+
# Install compilation dependencies
RUN apk update && apk add --no-cache build-base linux-headers curl ca-certificates python3 perl
RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Copy only backend-rs dependency-related files first, to cache efficiently
-COPY package.json pnpm-workspace.yaml ./
-COPY packages/backend-rs/package.json packages/backend-rs/package.json
-COPY packages/backend-rs/npm/linux-x64-musl/package.json packages/backend-rs/npm/linux-x64-musl/package.json
-COPY packages/backend-rs/npm/linux-arm64-musl/package.json packages/backend-rs/npm/linux-arm64-musl/package.json
-
-COPY Cargo.toml Cargo.toml
-COPY Cargo.lock Cargo.lock
-COPY packages/backend-rs/Cargo.toml packages/backend-rs/Cargo.toml
+COPY packages/macro-rs packages/macro-rs/
COPY packages/backend-rs/src/lib.rs packages/backend-rs/src/
-COPY packages/macro-rs/Cargo.toml packages/macro-rs/Cargo.toml
-COPY packages/macro-rs/src/lib.rs packages/macro-rs/src/
+COPY packages/backend-rs/Cargo.toml packages/backend-rs/Cargo.toml
+COPY Cargo.toml Cargo.lock ./
# Configure pnpm, and install backend-rs dependencies
RUN corepack enable && corepack prepare pnpm@latest --activate && pnpm --filter backend-rs install
@@ -26,10 +23,10 @@ RUN cargo fetch --locked --manifest-path Cargo.toml
# Copy in the rest of the rust files
COPY packages/backend-rs packages/backend-rs/
-# COPY packages/macro-rs packages/macro-rs/
# Compile backend-rs
-RUN NODE_ENV='production' pnpm run --filter backend-rs build
+RUN ln -s $(which gcc) /usr/bin/aarch64-linux-musl-gcc
+RUN NODE_ENV='production' NODE_OPTIONS='--max_old_space_size=3072' pnpm run --filter backend-rs build
# Copy/Overwrite index.js to mitigate the bug in napi-rs codegen
COPY packages/backend-rs/index.js packages/backend-rs/built/index.js
@@ -49,7 +46,7 @@ RUN pnpm install --frozen-lockfile
COPY . ./
# Build other workspaces
-RUN NODE_ENV='production' pnpm run --recursive --filter '!backend-rs' build && pnpm run build:assets
+RUN NODE_ENV='production' NODE_OPTIONS='--max_old_space_size=3072' pnpm run --recursive --filter '!backend-rs' build && pnpm run build:assets
# Trim down the dependencies to only those for production
RUN find . -path '*/node_modules/*' -delete && pnpm install --prod --frozen-lockfile
diff --git a/Procfile b/Procfile
deleted file mode 100644
index fdab9a4c81..0000000000
--- a/Procfile
+++ /dev/null
@@ -1 +0,0 @@
-web: NODE_ENV=production npm start
diff --git a/biome.json b/biome.json
index 487165266a..89897aadec 100644
--- a/biome.json
+++ b/biome.json
@@ -1,28 +1,400 @@
{
- "$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
- "organizeImports": {
- "enabled": false
- },
+ "$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
+ "organizeImports": { "enabled": false },
"linter": {
"enabled": true,
"rules": {
- "recommended": true,
+ "recommended": false,
+ "complexity": {
+ "noBannedTypes": "error",
+ "noExtraBooleanCast": "error",
+ "noMultipleSpacesInRegularExpressionLiterals": "error",
+ "noUselessCatch": "error",
+ "noUselessConstructor": "off",
+ "noUselessLoneBlockStatements": "error",
+ "noUselessRename": "error",
+ "noUselessTernary": "error",
+ "noUselessThisAlias": "error",
+ "noUselessTypeConstraint": "error",
+ "noVoid": "error",
+ "noWith": "error",
+ "useLiteralKeys": "error",
+ "useRegexLiterals": "error"
+ },
+ "correctness": {
+ "noConstAssign": "error",
+ "noConstantCondition": "error",
+ "noEmptyCharacterClassInRegex": "error",
+ "noEmptyPattern": "error",
+ "noGlobalObjectCalls": "error",
+ "noInvalidConstructorSuper": "error",
+ "noInvalidUseBeforeDeclaration": "error",
+ "noNewSymbol": "error",
+ "noPrecisionLoss": "error",
+ "noSelfAssign": "error",
+ "noSwitchDeclarations": "error",
+ "noUndeclaredVariables": "error",
+ "noUnreachable": "error",
+ "noUnreachableSuper": "error",
+ "noUnsafeFinally": "error",
+ "noUnusedVariables": "off",
+ "useArrayLiterals": "off",
+ "useIsNan": "error"
+ },
+ "security": { "noGlobalEval": "error" },
"style": {
- "noUselessElse": "off"
+ "noCommaOperator": "error",
+ "noInferrableTypes": "error",
+ "noNamespace": "error",
+ "noNonNullAssertion": "warn",
+ "noUselessElse": "off",
+ "noVar": "error",
+ "useAsConstAssertion": "error",
+ "useBlockStatements": "off",
+ "useConst": "error",
+ "useImportType": "error",
+ "useSingleVarDeclarator": "warn"
+ },
+ "suspicious": {
+ "noAssignInExpressions": "error",
+ "noAsyncPromiseExecutor": "error",
+ "noCatchAssign": "error",
+ "noClassAssign": "error",
+ "noCompareNegZero": "error",
+ "noConfusingLabels": "off",
+ "noConsoleLog": "warn",
+ "noControlCharactersInRegex": "error",
+ "noDebugger": "warn",
+ "noDoubleEquals": "error",
+ "noDuplicateCase": "error",
+ "noDuplicateClassMembers": "error",
+ "noDuplicateObjectKeys": "error",
+ "noDuplicateParameters": "error",
+ "noEmptyBlockStatements": "error",
+ "noEmptyInterface": "error",
+ "noExplicitAny": "warn",
+ "noExtraNonNullAssertion": "error",
+ "noFallthroughSwitchClause": "error",
+ "noFunctionAssign": "error",
+ "noGlobalAssign": "error",
+ "noImportAssign": "error",
+ "noMisleadingCharacterClass": "error",
+ "noMisleadingInstantiator": "error",
+ "noPrototypeBuiltins": "off",
+ "noRedeclare": "error",
+ "noSelfCompare": "error",
+ "noShadowRestrictedNames": "error",
+ "noUnsafeNegation": "error",
+ "useAwait": "off",
+ "useDefaultSwitchClauseLast": "error",
+ "useNamespaceKeyword": "error",
+ "useValidTypeof": "error"
}
- }
+ },
+ "ignore": [
+ "**/*.json5",
+ "**/*.min.*",
+ "**/dist",
+ "**/LICENSE*",
+ "**/output",
+ "**/coverage",
+ "**/public",
+ "**/temp",
+ "**/packages-lock.json",
+ "**/pnpm-lock.yaml",
+ "**/yarn.lock",
+ "**/__snapshots__"
+ ]
+ },
+ "javascript": {
+ "globals": [
+ "jest",
+ "withDefaults",
+ "$computed",
+ "$shallowRef",
+ "defineExpose",
+ "$toRef",
+ "h",
+ "$customRef",
+ "navigator",
+ "window",
+ "defineEmits",
+ "$ref",
+ "defineProps",
+ "document"
+ ]
},
"overrides": [
{
- "include": ["*.vue", "packages/client/*.ts"],
+ "include": ["**/__tests__/*.{j,t}s?(x)", "**/*.spec.{j,t}s?(x)"],
+ "linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
+ },
+ {
+ "include": ["*.vue"],
+ "linter": { "rules": { "correctness": { "noUnusedVariables": "off" } } }
+ },
+ {
+ "include": ["**/__tests__/*.{j,t}s?(x)", "**/*.spec.{j,t}s?(x)"],
+ "linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
+ },
+ { "include": ["*.vue"], "linter": { "rules": {} } },
+ { "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
+ { "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
+ { "include": ["package.json"], "linter": { "rules": {} } },
+ { "include": ["*.d.ts"], "linter": { "rules": {} } },
+ { "include": ["*.js"] },
+ {
+ "include": ["scripts/**/*.*", "cli.*"],
+ "linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
+ },
+ {
+ "include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
+ "linter": { "rules": {} }
+ },
+ {
+ "include": ["**/*.md/*.*"],
"linter": {
"rules": {
+ "correctness": {
+ "noUndeclaredVariables": "off",
+ "noUnusedVariables": "off"
+ },
+ "suspicious": { "noConsoleLog": "off" }
+ }
+ }
+ },
+ { "include": ["*.js"], "linter": { "rules": {} } },
+ {
+ "include": ["**/*.md/*.*"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noInvalidUseBeforeDeclaration": "off",
+ "noUnusedVariables": "off"
+ },
+ "suspicious": { "noRedeclare": "off" }
+ }
+ }
+ },
+ { "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
+ { "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
+ { "include": ["package.json"], "linter": { "rules": {} } },
+ { "include": ["*.d.ts"], "linter": { "rules": {} } },
+ { "include": ["*.js"] },
+ {
+ "include": ["scripts/**/*.*", "cli.*"],
+ "linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
+ },
+ {
+ "include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
+ "linter": { "rules": {} }
+ },
+ {
+ "include": ["**/*.md/*.*"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noUndeclaredVariables": "off",
+ "noUnusedVariables": "off"
+ },
+ "suspicious": { "noConsoleLog": "off" }
+ }
+ }
+ },
+ { "include": ["*.js"], "linter": { "rules": {} } },
+ {
+ "include": ["**/*.md/*.*"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noInvalidUseBeforeDeclaration": "off",
+ "noUnusedVariables": "off"
+ },
+ "suspicious": { "noRedeclare": "off" }
+ }
+ }
+ },
+ {
+ "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noConstAssign": "off",
+ "noGlobalObjectCalls": "off",
+ "noInvalidConstructorSuper": "off",
+ "noNewSymbol": "off",
+ "noSetterReturn": "off",
+ "noUndeclaredVariables": "off",
+ "noUnreachable": "off",
+ "noUnreachableSuper": "off"
+ },
"style": {
- "useImportType": "warn",
- "useShorthandFunctionType": "warn",
- "useTemplate": "warn",
- "noNonNullAssertion": "off",
- "useNodejsImportProtocol": "off"
+ "noArguments": "error",
+ "noVar": "error",
+ "useConst": "error"
+ },
+ "suspicious": {
+ "noDuplicateClassMembers": "off",
+ "noDuplicateObjectKeys": "off",
+ "noDuplicateParameters": "off",
+ "noFunctionAssign": "off",
+ "noImportAssign": "off",
+ "noRedeclare": "off",
+ "noUnsafeNegation": "off",
+ "useGetterReturn": "off",
+ "useValidTypeof": "off"
+ }
+ }
+ }
+ },
+ { "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
+ { "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
+ { "include": ["package.json"], "linter": { "rules": {} } },
+ { "include": ["*.d.ts"], "linter": { "rules": {} } },
+ { "include": ["*.js"], "linter": { "rules": {} } },
+ {
+ "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
+ "linter": { "rules": { "complexity": { "noVoid": "error" } } }
+ },
+ {
+ "include": ["script/**/*.*", "scripts/**/*.*", "cli.*"],
+ "linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
+ },
+ {
+ "include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
+ "linter": { "rules": {} }
+ },
+ {
+ "include": ["**/*.md/*.*"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noInvalidUseBeforeDeclaration": "off",
+ "noUndeclaredVariables": "off",
+ "noUnusedVariables": "off"
+ },
+ "style": { "useImportType": "off" },
+ "suspicious": { "noConsoleLog": "off", "noRedeclare": "off" }
+ }
+ }
+ },
+ { "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
+ { "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
+ { "include": ["package.json"], "linter": { "rules": {} } },
+ { "include": ["*.d.ts"], "linter": { "rules": {} } },
+ { "include": ["*.js"], "linter": { "rules": {} } },
+ {
+ "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
+ "linter": { "rules": { "complexity": { "noVoid": "error" } } }
+ },
+ {
+ "include": ["script/**/*.*", "scripts/**/*.*", "cli.*"],
+ "linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
+ },
+ {
+ "include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
+ "linter": { "rules": {} }
+ },
+ {
+ "include": ["**/*.md/*.*"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noInvalidUseBeforeDeclaration": "off",
+ "noUndeclaredVariables": "off",
+ "noUnusedVariables": "off"
+ },
+ "style": { "useImportType": "off" },
+ "suspicious": { "noConsoleLog": "off", "noRedeclare": "off" }
+ }
+ }
+ },
+ { "include": ["*.md"] },
+ {
+ "include": ["**/*.md/**"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noUndeclaredVariables": "off",
+ "noUnusedVariables": "off"
+ }
+ }
+ }
+ },
+ {
+ "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noConstAssign": "off",
+ "noGlobalObjectCalls": "off",
+ "noInvalidConstructorSuper": "off",
+ "noNewSymbol": "off",
+ "noSetterReturn": "off",
+ "noUndeclaredVariables": "off",
+ "noUnreachable": "off",
+ "noUnreachableSuper": "off"
+ },
+ "style": {
+ "noArguments": "error",
+ "noVar": "error",
+ "useConst": "error"
+ },
+ "suspicious": {
+ "noDuplicateClassMembers": "off",
+ "noDuplicateObjectKeys": "off",
+ "noDuplicateParameters": "off",
+ "noFunctionAssign": "off",
+ "noImportAssign": "off",
+ "noRedeclare": "off",
+ "noUnsafeNegation": "off",
+ "useGetterReturn": "off",
+ "useValidTypeof": "off"
+ }
+ }
+ }
+ },
+ { "include": ["*.md"] },
+ {
+ "include": ["**/*.md/**"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noUndeclaredVariables": "off",
+ "noUnusedVariables": "off"
+ }
+ }
+ }
+ },
+ {
+ "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
+ "linter": {
+ "rules": {
+ "correctness": {
+ "noConstAssign": "off",
+ "noGlobalObjectCalls": "off",
+ "noInvalidConstructorSuper": "off",
+ "noNewSymbol": "off",
+ "noSetterReturn": "off",
+ "noUndeclaredVariables": "off",
+ "noUnreachable": "off",
+ "noUnreachableSuper": "off"
+ },
+ "style": {
+ "noArguments": "error",
+ "noVar": "error",
+ "useConst": "error"
+ },
+ "suspicious": {
+ "noDuplicateClassMembers": "off",
+ "noDuplicateObjectKeys": "off",
+ "noDuplicateParameters": "off",
+ "noFunctionAssign": "off",
+ "noImportAssign": "off",
+ "noRedeclare": "off",
+ "noUnsafeNegation": "off",
+ "useGetterReturn": "off",
+ "useValidTypeof": "off"
}
}
}
diff --git a/cliff.toml b/cliff.toml
deleted file mode 100644
index 8a1e7b1002..0000000000
--- a/cliff.toml
+++ /dev/null
@@ -1,98 +0,0 @@
-# configuration file for git-cliff (0.1.0)
-
-[changelog]
-# changelog header
-header = """
-# Changelog\n
-"""
-# template for the changelog body
-# https://tera.netlify.app/docs/#introduction
-body = """
-{% if version %}\
- ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
-{% else %}\
- ## [unreleased]
-{% endif %}\
-{% for group, commits in commits | group_by(attribute="group") %}
- ### {{ group | upper_first }}
- {% for commit in commits %}
- - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
- {% endfor %}
-{% endfor %}\n
-"""
-# remove the leading and trailing whitespace from the template
-trim = true
-# changelog footer
-footer = """
-
-"""
-
-[git]
-# parse the commits based on https://www.conventionalcommits.org
-conventional_commits = false
-# filter out the commits that are not conventional
-filter_unconventional = true
-# process each line of a commit as an individual commit
-split_commits = false
-# regex for parsing and grouping commits
-commit_parsers = [
- { message = "^feat", group = "Features"},
- { message = "^add", group = "Features"},
- { message = "^fix", group = "Bug Fixes"},
- { message = "^prevent", group = "Bug Fixes"},
- { message = "^doc", group = "Documentation"},
- { message = "^perf", group = "Performance"},
- { message = "^🎨", group = "Refactor"},
- { message = "^enhance", group = "Refactor"},
- { message = "^⚡️", group = "Refactor"},
- { message = "^🔥", group = "Features"},
- { message = "^🐛", group = "Bug Fixes"},
- { message = "^🚑️", group = "Bug Fixes"},
- { message = "^block", group = "Bug Fixes"},
- { message = "^✨", group = "Features"},
- { message = "^📝", group = "Documentation"},
- { message = "^🚀", group = "Features"},
- { message = "^💄", group = "Styling"},
- { message = "^✅", group = "Testing"},
- { message = "^🔒️", group = "Security"},
- { message = "^🚨", group = "Testing"},
- { message = "^💚", group = "CI"},
- { message = "^👷", group = "CI"},
- { message = "^⬇️", group = "Miscellaneous Tasks"},
- { message = "^⬆️", group = "Miscellaneous Tasks"},
- { message = "^📌", group = "Miscellaneous Tasks"},
- { message = "^➕", group = "Miscellaneous Tasks"},
- { message = "^➖", group = "Miscellaneous Tasks"},
- { message = "^♻️", group = "Refactor"},
- { message = "^🔧", group = "CI"},
- { message = "^🔨", group = "CI"},
- { message = "^🌐", group = "Localization"},
- { message = "^✏️", group = "Localization"},
- { message = "^👽️", group = "Bug Fixes"},
- { message = "^🍱", group = "Styling"},
- { message = "^♿️", group = "Styling"},
- { message = "^🩹", group = "Bug Fixes"},
- { message = "^refactor", group = "Refactor"},
- { message = "^style", group = "Styling"},
- { message = "^test", group = "Testing"},
- { message = "^chore\\(release\\): prepare for", skip = true},
- { message = "^chore", group = "Miscellaneous Tasks"},
- { message = "^update", group = "Miscellaneous Tasks"},
- { body = ".*security", group = "Security"},
-]
-# protect breaking changes from being skipped due to matching a skipping commit_parser
-protect_breaking_commits = false
-# filter out the commits that are not matched by commit parsers
-filter_commits = false
-# glob pattern for matching git tags
-tag_pattern = "v[0-9]*"
-# regex for skipping tags
-skip_tags = "v0.1.0-beta.1"
-# regex for ignoring tags
-ignore_tags = ""
-# sort the tags chronologically
-date_order = false
-# sort the commits inside sections by oldest/newest order
-sort_commits = "oldest"
-# limit the number of commits included in the changelog.
-# limit_commits = 42
diff --git a/docker-compose.example.yml b/docker-compose.example.yml
index 9cd6d1cdce..4903205b93 100644
--- a/docker-compose.example.yml
+++ b/docker-compose.example.yml
@@ -27,10 +27,10 @@ services:
interval: 5s
timeout: 5s
retries: 5
- deploy:
- resources:
- limits:
- memory: 4096M
+ # deploy:
+ # resources:
+ # limits:
+ # memory: 2048M
redis:
restart: unless-stopped
@@ -45,11 +45,10 @@ services:
interval: 5s
timeout: 5s
retries: 5
- # deploy:
- # resources:
- # limits:
- # memory: 200M
-
+ # deploy:
+ # resources:
+ # limits:
+ # memory: 256M
db:
restart: unless-stopped
@@ -66,10 +65,10 @@ services:
interval: 5s
timeout: 5s
retries: 5
- # deploy:
- # resources:
- # limits:
- # memory: 200M
+ # deploy:
+ # resources:
+ # limits:
+ # memory: 2048M
networks:
calcnet:
diff --git a/docs/api-change.md b/docs/api-change.md
index 91b20d76f2..2ae2275707 100644
--- a/docs/api-change.md
+++ b/docs/api-change.md
@@ -2,6 +2,10 @@
Breaking changes are indicated by the :warning: icon.
+## v20240607
+
+- `GET` request is now allowed for the `latest-version` endpoint.
+
## v20240523
- Added `scheduledAt` optional parameter to `notes/create` (!10789)
diff --git a/docs/changelog.md b/docs/changelog.md
index 4b7d11bd05..513370dd63 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -2,9 +2,37 @@
Critical security updates are indicated by the :warning: icon.
-- Server administrators should check [notice-for-admins.md](./notice-for-admins.md) as well.
+- Server administrators must check [notice-for-admins.md](./notice-for-admins.md) as well.
- Third-party client/bot developers may want to check [api-change.md](./api-change.md) as well.
+## Unreleased
+
+- Fix bugs
+
+## [v20240630](https://firefish.dev/firefish/firefish/-/merge_requests/11072/commits)
+
+- Add ability to automatically append #Alt4Me hashtag when posting a file without an alt text ([What is #Alt4Me?](https://social.growyourown.services/@FediTips/112055775451305236))
+- Fix a build issue on some environments
+- Fix bugs
+
+## [v20240623](https://firefish.dev/firefish/firefish/-/merge_requests/11049/commits)
+
+- Fix bugs
+
+## [v20240613](https://firefish.dev/firefish/firefish/-/merge_requests/11003/commits)
+
+This update contains code refactoring and dependency updates, with no major user-facing changes.
+
+## [v20240607](https://firefish.dev/firefish/firefish/-/merge_requests/10978/commits)
+
+- Add the ability to share posts via QR code
+- Update the API document page (`/api-doc`)
+- Fix bugs
+
+## [v20240601](https://firefish.dev/firefish/firefish/-/merge_requests/10943/commits)
+
+- Fix bugs
+
## [v20240523](https://firefish.dev/firefish/firefish/-/merge_requests/10898/commits)
- Add scheduled posts
diff --git a/docs/downgrade.sql b/docs/downgrade.sql
index e7de398a22..895046087a 100644
--- a/docs/downgrade.sql
+++ b/docs/downgrade.sql
@@ -1,6 +1,7 @@
BEGIN;
DELETE FROM "migrations" WHERE name IN (
+ 'RefactorScheduledPosts1716804636187',
'RemoveEnumTypenameSuffix1716462794927',
'CreateScheduledNote1714728200194',
'AddBackTimezone1715351290096',
@@ -33,6 +34,38 @@ DELETE FROM "migrations" WHERE name IN (
'RemoveNativeUtilsMigration1705877093218'
);
+-- refactor-scheduled-post
+CREATE TABLE "scheduled_note" (
+ "id" character varying(32) NOT NULL PRIMARY KEY,
+ "noteId" character varying(32) NOT NULL,
+ "userId" character varying(32) NOT NULL,
+ "scheduledAt" TIMESTAMP WITH TIME ZONE NOT NULL
+);
+COMMENT ON COLUMN "scheduled_note"."noteId" IS 'The ID of the temporarily created note that corresponds to the schedule.';
+CREATE EXTENSION pgcrypto;
+CREATE FUNCTION generate_scheduled_note_id(size int) RETURNS text AS $$ DECLARE
+ characters text := 'abcdefghijklmnopqrstuvwxyz0123456789';
+ bytes bytea := gen_random_bytes(size);
+ l int := length(characters);
+ i int := 0;
+ output text := '';
+ BEGIN
+ WHILE i < size LOOP
+ output := output || substr(characters, get_byte(bytes, i) % l + 1, 1);
+ i := i + 1;
+ END LOOP;
+ RETURN output;
+ END;
+$$ LANGUAGE plpgsql VOLATILE;
+INSERT INTO "scheduled_note" ("id", "noteId", "userId", "scheduledAt") (SELECT generate_scheduled_note_id(16), "id", "userId", "scheduledAt" FROM "note" WHERE "note"."scheduledAt" IS NOT NULL);
+DROP EXTENSION pgcrypto;
+DROP FUNCTION "generate_scheduled_note_id";
+CREATE INDEX "IDX_noteId_ScheduledNote" ON "scheduled_note" ("noteId");
+CREATE INDEX "IDX_userId_ScheduledNote" ON "scheduled_note" ("userId");
+ALTER TABLE "scheduled_note" ADD FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION;
+ALTER TABLE "scheduled_note" ADD FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION;
+ALTER TABLE "note" DROP COLUMN "scheduledAt";
+
-- remove-enum-typename-suffix
ALTER TYPE "antenna_src" RENAME TO "antenna_src_enum";
ALTER TYPE "drive_file_usage_hint" RENAME TO "drive_file_usage_hint_enum";
diff --git a/firefish.nginx.conf b/docs/firefish.nginx.conf
similarity index 100%
rename from firefish.nginx.conf
rename to docs/firefish.nginx.conf
diff --git a/docs/install.md b/docs/install.md
index 80dffdaeb9..6a2079fd73 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -4,9 +4,9 @@ Firefish depends on the following software.
## Runtime dependencies
-- At least [NodeJS](https://nodejs.org/en/) v18.19.0 (v20/v21 recommended)
+- At least [NodeJS](https://nodejs.org/en/) v18.19.0 (v20/v22 recommended)
- At least [PostgreSQL](https://www.postgresql.org/) v12 (v16 recommended) with [PGroonga](https://pgroonga.github.io/) extension
-- At least [Redis](https://redis.io/) v7
+- At least [Redis](https://redis.io/) v7 or [Valkey](https://valkey.io/) v7
- Web Proxy (one of the following)
- Caddy (recommended)
- Nginx (recommended)
@@ -15,27 +15,78 @@ Firefish depends on the following software.
- Caching server (**optional**, one of the following)
- [DragonflyDB](https://www.dragonflydb.io/)
- [KeyDB](https://keydb.dev/)
- - Another [Redis](https://redis.io/) server
+ - Another [Redis](https://redis.io/) / [Valkey](https://valkey.io/) server
## Build dependencies
- At least [Rust](https://www.rust-lang.org/) v1.74
-- C/C++ compiler & build tools
+- C/C++ compiler & build tools (like [GNU Make](https://www.gnu.org/software/make/))
- `build-essential` on Debian/Ubuntu Linux
- `base-devel` on Arch Linux
+ - `"Development Tools"` on Fedora/Red Hat Linux
- [Python 3](https://www.python.org/)
- [Perl](https://www.perl.org/)
This document shows an example procedure for installing these dependencies and Firefish on Debian 12. Note that there is much room for customizing the server setup; this document merely demonstrates a simple installation.
+### Install on non-Linux systems
+
+We don't test Firefish on non-Linux systems, so please install Firefish on such an environment **only if you can address any problems yourself**. There is absolutely no support. That said, it is possible to install Firefish on some non-Linux systems.
+
+
+
+Possible setup on FreeBSD (as of version `20240630`)
+
+You can install Firefish on FreeBSD by adding these extra steps to the standard instructions:
+
+1. Install `vips` package
+2. Add the following block to [`package.json`](../package.json)
+ ```json
+ "pnpm": {
+ "overrides": {
+ "rollup": "npm:@rollup/wasm-node@4.17.2"
+ }
+ }
+ ```
+3. Create an rc script for Firefish
+ ```sh
+ #!/bin/sh
+
+ # PROVIDE: firefish
+ # REQUIRE: DAEMON redis caddy postgresql
+ # KEYWORD: shutdown
+
+ . /etc/rc.subr
+
+ name=firefish
+ rcvar=firefish_enable
+
+ desc="Firefish daemon"
+
+ load_rc_config ${name}
+
+ : ${firefish_chdir:="/path/to/firefish/local/repository"}
+ : ${firefish_env:="npm_config_cache=/tmp NODE_ENV=production NODE_OPTIONS=--max-old-space-size=3072"}
+
+ pidfile="/var/run/${name}.pid"
+ command=/usr/sbin/daemon
+ command_args="-f -S -u firefish -P ${pidfile} /usr/local/bin/pnpm run start"
+
+ run_rc_command "$1"
+ ```
+
+
+
+Please let us know if you deployed Firefish on a curious environment :smile:
+
+### Use Docker/Podman containers
+
If you want to use the pre-built container image, please refer to [`install-container.md`](./install-container.md).
-If you do not prepare your environment as document, be sure to meet the minimum dependencies given at the bottom of the page.
+## 1. Install dependencies
Make sure that you can use the `sudo` command before proceeding.
-## 1. Install dependencies
-
### Utilities
```sh
@@ -215,7 +266,7 @@ sudo ufw status
### 2. Set up a reverse proxy
-In this instruction, we use [Caddy](https://caddyserver.com/) to make the Firefish server accesible from internet. However, you can also use [Nginx](https://nginx.org/en/) if you want ([example Nginx config file](../firefish.nginx.conf)).
+In this instruction, we use [Caddy](https://caddyserver.com/) to make the Firefish server accesible from internet. However, you can also use [Nginx](https://nginx.org/en/) if you want ([example Nginx config file](./firefish.nginx.conf)).
1. Install Caddy
```sh
@@ -310,7 +361,9 @@ In this instruction, we use [Caddy](https://caddyserver.com/) to make the Firefi
sudo systemctl enable --now firefish
```
-## Upgrading
+# Maintain the server
+
+## 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:
@@ -319,6 +372,85 @@ sudo su --login firefish
cd ~/firefish
```
+## Rotate logs
+
+As the server runs longer and longer, the size of the log files increases, filling up the disk space. To prevent this, you should set up a log rotation (removing old logs automatically).
+
+You can edit the `SystemMaxUse` value in the `[journal]` section of `/etc/systemd/journald.conf` to do it:
+
+```conf
+[journal]
+... (omitted)
+SystemMaxUse=500M
+...
+```
+
+Make sure to remove the leading `#` to uncomment the line. After editing the config file, you need to restart `systemd-journald` service.
+
+```sh
+sudo systemctl restart systemd-journald
+```
+
+It is also recommended that you change the [PGroonga log level](https://pgroonga.github.io/reference/parameters/log-level.html). The default level is `notice`, but this is too verbose for daily use.
+
+To control the log level, add this line to your `postgresql.conf`:
+
+```conf
+pgroonga.log_level = error
+```
+
+You can check the `postgresql.conf` location by this command:
+
+```sh
+sudo --user=postgres psql --command='SHOW config_file'
+```
+
+The PGroonga log file (`pgroonga.log`) is located under this directory:
+
+```sh
+sudo --user=postgres psql --command='SHOW data_directory'
+```
+
+## 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.
+
+Here is an example set of parameters you can provide to PGTune:
+
+| Parameter | Value |
+|----------------------:|---------------------------------------------------------|
+| DB version | 16 (your PostgreSQL major version) |
+| OS Type | Linux |
+| DB Type | Data warehouse |
+| 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 |
+
+Since this is not a dedicated database server, be sure to leave some memory space for other software such as Firefish and Redis.
+
+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.
+
+After that, you need to restart the PostgreSQL service.
+
+```sh
+sudo systemctl stop firefish
+sudo systemctl restart postgresql
+sudo systemctl start firefish
+```
+
+## VACUUM your database
+
+If the database runs long, accumulated "garbage" can degrade its performance or cause problems. To prevent this, you should `VACUUM` your database regularly.
+
+```sh
+sudo systemctl stop firefish
+sudo --user=postgres psql --dbname=firefish_db --command='VACUUM FULL VERBOSE ANALYZE'
+sudo systemctl start firefish
+```
+
+Note that this operation takes some time.
+
## Customize
- To add custom CSS for all users, edit `./custom/assets/instance.css`.
diff --git a/docs/notice-for-admins.md b/docs/notice-for-admins.md
index 5471832c83..fbc58623fe 100644
--- a/docs/notice-for-admins.md
+++ b/docs/notice-for-admins.md
@@ -2,8 +2,29 @@
You can skip intermediate versions when upgrading from an old version, but please read the notices and follow the instructions for each intermediate version before [upgrading](./upgrade.md).
+## Upcoming breaking change (unreleased)
+
+Please take a look at #10947.
+
## Unreleased
+### For all users
+
+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. (and we welcome your docs contributions!)
+
+## v20240607
+
+The following environment variables are deprecated and no longer have any effect:
+- `MK_ONLY_QUEUE`
+- `MK_ONLY_SERVER`
+- `MK_NO_DAEMONS`
+- `MK_DISABLE_CLUSTERING`
+- `MK_VERBOSE`
+- `MK_WITH_LOG_TIME`
+- `MK_SLOW`
+
+## v20240601
+
### For systemd/pm2 users
Required Node.js version has been bumped from v18.17.0 to v18.19.0. Also, as written in the [v20240430 note](https://firefish.dev/firefish/firefish/-/blob/d3394b97f021dea323ec3ae36e39930680242482/docs/notice-for-admins.md#v20240430), it is highly recommended that you use an even newer version since v18.19.0 has known vulnerabilities.
@@ -32,7 +53,7 @@ Therefore, we have contributed to napi-rs to add support for `DateTime)).
+There is a bug where `pnpm install --frozen-lockfile` may fail on Linux 6.9.0, 6.9.1, and 6.9.2 ([GitHub issue]()).
To check your Linux kernel version, run:
diff --git a/locales/ar-SA.yml b/locales/ar-SA.yml
index 622074056c..6329fbb8b6 100644
--- a/locales/ar-SA.yml
+++ b/locales/ar-SA.yml
@@ -446,7 +446,7 @@ tooShort: "قصير جدًا"
tooLong: "طويل جدًا"
weakPassword: "الكلمة السرية ضعيفة"
normalPassword: "الكلمة السرية جيدة"
-strongPassword: "الكلمة السرية قوية"
+veryStrongPassword: "الكلمة السرية قوية"
passwordMatched: "التطابق صحيح!"
passwordNotMatched: "غير متطابقتان"
signinWith: "الولوج عبر {x}"
diff --git a/locales/bg-BG.yml b/locales/bg-BG.yml
index 86eeb6691c..03009bf588 100644
--- a/locales/bg-BG.yml
+++ b/locales/bg-BG.yml
@@ -586,7 +586,7 @@ unavailable: Не е свободно
tooShort: Твърде кратко
tooLong: Твърде дълго
weakPassword: Слаба парола
-strongPassword: Силна парола
+veryStrongPassword: Силна парола
passwordMatched: Съвпада
passwordNotMatched: Не съвпада
signinWith: Вход с {x}
diff --git a/locales/bn-BD.yml b/locales/bn-BD.yml
index d17766b499..db3874ceb9 100644
--- a/locales/bn-BD.yml
+++ b/locales/bn-BD.yml
@@ -462,7 +462,7 @@ tooShort: "খুব ছোট"
tooLong: "খুব বড়"
weakPassword: "দুর্বল পাসওয়ার্ড"
normalPassword: "সাধারণ পাসওয়ার্ড"
-strongPassword: "শক্তিশালী পাসওয়ার্ড"
+veryStrongPassword: "শক্তিশালী পাসওয়ার্ড"
passwordMatched: "মিলেছে"
passwordNotMatched: "মিলেনি"
signinWith: "{x} এর সাহায্যে সাইন ইন করুন"
diff --git a/locales/ca-ES.yml b/locales/ca-ES.yml
index 409b2e4de6..4e4f96cbb2 100644
--- a/locales/ca-ES.yml
+++ b/locales/ca-ES.yml
@@ -395,7 +395,7 @@ _profile:
metadataLabel: Etiqueta
metadataContent: Contingut
changeAvatar: Canvia l'avatar
- changeBanner: Canvia el banner
+ changeBanner: Canvia el bàner
locationDescription: Si primer introduïu la vostra ciutat, es mostrarà l'hora local
a altres usuaris.
name: Nom
@@ -1022,7 +1022,7 @@ yearsOld: '{age} anys'
copyUrl: Copia l'adreça URL
rename: Renombra
unwatch: Deixa de veure
-accept: Accepta
+accept: Acceptar
reject: Rebutja
yearX: '{year}'
pages: Pàgines
@@ -1091,7 +1091,7 @@ usernameInvalidFormat: Pots fer servir lletres en majúscules o minúscules, nom
tooShort: Massa curt
tooLong: Massa llarg
weakPassword: Contrasenya amb seguretat feble
-strongPassword: Contrasenya amb seguretat forta
+veryStrongPassword: Contrasenya amb seguretat forta
passwordMatched: Coincidències
signinWith: Inicia sessió com {x}
signinFailed: No es pot iniciar sessió. El nom d'usuari o la contrasenya són incorrectes.
@@ -1114,7 +1114,7 @@ createAccount: Crea un compte
fontSize: Mida del text
noFollowRequests: No tens cap sol·licitud de seguiment per aprovar
openImageInNewTab: Obre les imatges a una pestanya nova
-dashboard: Tauler
+dashboard: Taulell
local: Local
remote: Remot
total: Total
@@ -1551,7 +1551,7 @@ itsOn: Activat
itsOff: Desactivat
emailRequiredForSignup: Requereix una adreça de correu electrònic per registrar-te
unread: Sense llegir
-controlPanel: Tauler de control
+controlPanel: Taulell de control
manageAccounts: Gestionar comptes
makeReactionsPublic: Estableix l'historial de reaccions com a públic
classic: Centrat
@@ -2233,7 +2233,7 @@ enablePullToRefresh: Activa "Baixa per actualitzar"
pullDownToReload: Baixa per actualitzar
pullToRefreshThreshold: Distancia de baixada per actualitzar
searchWords: Paraules / ID o adreça URL que vols cercar
-noSentFollowRequests: No tens cap sol·licitud de seguiment enviada
+noSentFollowRequests: No has enviat cap sol·licitud de seguiment
sentFollowRequests: Enviar sol·licituds de seguiment
replyMute: Silencia les respostes a les línies de temps
replyUnmute: Treu el silencia de les respostes a les línies de temps
@@ -2311,7 +2311,7 @@ _later:
future: futur
justNow: ara mateix
secondsAgo: en {n}s
- minutesAgo: en {n}m
+ minutesAgo: en {n}min
daysAgo: en {n}d
weeksAgo: en {n}s
monthsAgo: en {n}me
@@ -2321,3 +2321,6 @@ scheduledDate: Publica el
scheduledPost: Programa aquesta publicació
scheduledPostAt: Aquesta publicació s'enviarà {time}
cancelScheduledPost: Elimina la planificació
+addAlt4MeTag: "Afegeix automàticament l'etiqueta #Alt4Me a les teves publicacions
+ que tinguin un fitxer adjunt sense descripció"
+strongPassword: Bona contrasenya
diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml
index 96107996cf..8a08c784c8 100644
--- a/locales/cs-CZ.yml
+++ b/locales/cs-CZ.yml
@@ -401,7 +401,7 @@ tooShort: "Příliš krátké"
tooLong: "Příliš dlouhé"
weakPassword: "Slabé heslo"
normalPassword: "Dobré heslo"
-strongPassword: "Silné heslo"
+veryStrongPassword: "Silné heslo"
passwordMatched: "Hesla se schodují"
passwordNotMatched: "Hesla se neschodují"
signinWith: "Přihlásit se s {x}"
diff --git a/locales/de-DE.yml b/locales/de-DE.yml
index 012f1ef3ea..f6093b823d 100644
--- a/locales/de-DE.yml
+++ b/locales/de-DE.yml
@@ -77,7 +77,7 @@ lists: "Listen"
noLists: "Du hast keine Listen angelegt"
note: "Beitrag"
notes: "Beiträge"
-following: "Folgen"
+following: "Folgend"
followers: "Folgen mir"
followsYou: "Folgt dir"
createList: "Liste erstellen"
@@ -95,7 +95,7 @@ youShouldUpgradeClient: "Bitte aktualisiere diese Seite, um eine neuere Version
Clients zu verwenden."
enterListName: "Gib einen Namen für die Liste ein"
privacy: "Privatsphäre"
-makeFollowManuallyApprove: "Folgeanfragen bedürfen der Genehmigung"
+makeFollowManuallyApprove: "Folgeanfragen müssen akzeptiert werden"
defaultNoteVisibility: "Standard-Sichtbarkeit"
follow: "Folgen"
followRequest: "Follow anfragen"
@@ -430,7 +430,7 @@ securityKeyName: "Schlüsselname"
registerSecurityKey: "Sicherheitsschlüssel registrieren"
lastUsed: "Zuletzt benutzt"
unregister: "Deaktivieren"
-passwordLessLogin: "Passwortloses Anmelden einrichten"
+passwordLessLogin: "Passwortloses Anmelden"
resetPassword: "Passwort zurücksetzen"
newPasswordIs: "Das neue Passwort ist „{password}“"
reduceUiAnimation: "Animationen der Benutzeroberfläche reduzieren"
@@ -480,7 +480,7 @@ tooShort: "Zu kurz"
tooLong: "Zu lang"
weakPassword: "Schwaches Passwort"
normalPassword: "Durchschnittliches Passwort"
-strongPassword: "Starkes Passwort"
+veryStrongPassword: "Starkes Passwort"
passwordMatched: "Stimmt überein"
passwordNotMatched: "Stimmt nicht überein"
signinWith: "Mit {x} anmelden"
@@ -865,7 +865,7 @@ customCss: "Benutzerdefiniertes CSS"
customCssWarn: "Verwende diese Einstellung nur, wenn du weißt, was sie tut. Ungültige
Eingaben können dazu führen, dass der Client nicht mehr normal funktioniert."
global: "Global"
-squareAvatars: "Profilbilder quadratisch anzeigen"
+squareAvatars: "Profilbilder für Accounts ohne Katzenohren quadratisch anzeigen"
sent: "Gesendet"
received: "Erhalten"
searchResult: "Suchergebnisse"
@@ -948,7 +948,7 @@ check: "Überprüfe"
driveCapOverrideLabel: "Die Cloud-Drive-Kapazität dieses Nutzers verändern"
driveCapOverrideCaption: "Gib einen Wert von 0 oder weniger ein, um die Kapazität
auf den Standard zurückzusetzen."
-requireAdminForView: "Du musst dich mit einem Administratorkonto anmelden um dies
+requireAdminForView: "Du musst dich mit einem Administratorkonto anmelden, um dies
zu sehen."
isSystemAccount: "Ein Nutzerkonto, dass durch das System erstellt und automatisch
kontrolliert wird. Jede Anpassung, Veränderung oder Löschung dieses Nutzerkontos,
@@ -1241,6 +1241,7 @@ _wordMute:
muteLangsDescription2: Sprachcode verwenden, z.B. en, fr, ja, zh..
lang: Sprache
langDescription: Beiträge in der angegebenen Sprache in der Timeline ausblenden.
+ mutePatterns: Gedämpfte Muster
_instanceMute:
instanceMuteDescription: "Schaltet alle Beiträge/Boosts stumm, die von den gelisteten
Servern stammen, inklusive Antworten von Nutzern an einen Nutzer eines stummgeschalteten
@@ -1332,7 +1333,7 @@ _sfx:
channel: "Kanalbenachrichtigung"
_ago:
future: "Zukunft"
- justNow: "Gerade eben"
+ justNow: "gerade eben"
secondsAgo: "vor {n} s"
minutesAgo: "vor {n} min"
hoursAgo: "vor {n} h"
@@ -1931,6 +1932,7 @@ _notification:
voted: haben bei deiner Umfrage abgestimmt
reacted: hat auf deinen Beitrag reagiert
renoted: hat deinen Beitrag geteilt
+ andCountUsers: und {count} mehr Nutzer {acted}
_deck:
alwaysShowMainColumn: "Hauptspalte immer zeigen"
columnAlign: "Spaltenausrichtung"
@@ -1979,8 +1981,8 @@ flagSpeakAsCatDescription: Deine Beiträge werden im Katzenmodus nyanisiert
hiddenTags: Versteckte Hashtags
antennaInstancesDescription: Geben sie einen Server-Namen pro Zeile ein
secureModeInfo: Bei Anfragen an andere Server nicht ohne Nachweis zurücksenden.
-renoteMute: Boosts stummschalten
-renoteUnmute: Stummschaltung von Boosts aufheben
+renoteMute: Boosts in Timelines stummschalten
+renoteUnmute: Stummschaltung von Boosts in der Timeline aufheben
noInstances: Keine Server gefunden
privateModeInfo: Wenn diese Option aktiviert ist, können nur als vertrauenswürdig
eingestufte Server mit diesem Server föderieren. Alle Beiträge werden für die Öffentlichkeit
@@ -2019,9 +2021,8 @@ moveAccountDescription: 'Dieser Vorgang kann nicht rückgängig gemacht werden!
wie folgt ein: @name@server.xyz'
sendPushNotificationReadMessage: Löschung der Push-Benachrichtigungen sobald die entsprechenden
Benachrichtigungen oder Nachrichten gelesen wurden
-signupsDisabled: Derzeit sind keine Anmeldungen auf diesem Server möglich! Anmeldungen
- auf anderen Servern sind jedoch möglich! Wenn Sie einen Einladungscode für diesen
- Server haben, geben Sie ihn bitte unten ein.
+signupsDisabled: Derzeit sind keine Anmeldungen auf diesem Server möglich. Wenn Sie
+ einen Einladungscode für diesen Server haben, geben Sie ihn bitte unten ein.
swipeOnDesktop: Am Desktop PC das Wischen wie bei mobilen Geräten zulassen
enterSendsMessage: Drücken sie zum Senden des Beitrages die Eingabetaste (Strg-Taste
ausgeschaltet)
@@ -2212,3 +2213,131 @@ quotes: Zitate
moreUrlsDescription: "Die Seiten, welche angepinnt werde sollen, im Hilfe-Menü in
der unteren linken Ecke in folgender Notation angeben:\n\"Anzeigename\": https://example.com/"
toQuote: Zitat
+releaseToReload: Loslassen, um neu zu laden
+pullDownToReload: Herunterziehen zum Aktualisieren
+antennaLimit: Die maximale Anzahl von Antennen, die jeder Nutzer erstellen kann
+toEdit: Bearbeiten
+squareCatAvatars: Profilbilder für Accounts mit Katzenohren quadratisch anzeigen
+moderationNote: Moderationsnotiz
+ipFirstAcknowledged: Das Datum des ersten Erwerbs der IP Adresse
+driveCapacityOverride: Benutzerdefinierte Speicherkapazität
+searchWordsDescription: "Hier den Suchbegriff für Beiträge eingeben. Mit einem Leerzeichen
+ getrennte Begriffe werden in einer UND Suche gesucht, um eine ODER Suche auszuführen
+ 'OR' (ohne Anführungszeichen) zwischen die Begriffe schreiben.\nZum Beispiel findet
+ die Suche nach \"Morgen Nacht\" Beiträge, die sowohl \"Morgen, als auch \"Nacht\"\
+ \ enthalten. Die Suchanfrage \"Morgen OR Nacht\" findet Beiträge, die entweder \"\
+ Morgen\" oder \"Nacht\" (oder beides) enthalten.\nDie AND und OR Suche ist zudem
+ kombinierbar, z.B. so: \"(Morgen OR Nacht) Eule)\".\nUm nach einer Sequenz von Wörtern
+ (z.B. einem Satz) zu suchen, muss die gesamte Wortsequenz in Anführungszeichen stehen.
+ Beispiel: \"Nachrichten von heute\"\n\nUm zu einem bestimmten Profil oder Beitrag
+ zu gelangen, muss die ID oder URL (Webadresse) eingegeben und der Suchknopf gedrückt
+ werden. Ansonsten wird nach Beiträgen gesucht, die die ID oder URL wörtlich enthalten."
+useCdnDescription: Einige statische Ressourcen, wie einen Twemoji, vom JSDelivr CDN
+ anstatt von diesem Firefish server laden.
+suggested: Vorgeschlagen
+preventMisclick: Schutz vor versehentlichen Clicks
+replaceWidgetsButtonWithReloadButton: Widget-Knopf durch Aktualisierungs-Knopf ersetzen
+hideFollowButtons: Folgen-Knopf in einer versehentlich clickbaren Position verstecken
+forMobile: Mobil
+privateDescription: Nur für Sie sichtbar machen
+makePrivate: Als privat markieren
+searchUsers: Erstellt von (optional)
+searchWords: Suchbegriffe / ID oder URL als Suchanfrage
+searchCwAndAlt: Inhaltswarnungen und Beschreibungen von Dateien einbeziehen
+searchUsersDescription: "Um nach Beiträgen eines bestimmten Nutzers/ Servers zu suchen,
+ einfach die ID (@Benutzer@beispiel.de, or @Benutzer für einen lokalen Benutzer)
+ oder Webadresse (beispiel.de) eingeben.\n\nDie Suche \"me\" (ohne Anführungszeichen)
+ findet alle Ihre Beiträge (auch nicht-gelistete, direkte, geheime Beiträge und Beiträge,
+ die nur für Follower sichtbar sind).\n\nDie Suche \"local\" (ohne Anführungszeichen)
+ sorgt dafür, dass nur Beiträge von diesem Server angezeigt werden."
+publishTimelines: Timelines für Besucher veröffentlichen
+publishTimelinesDescription: Falls konfiguriert, werden die lokale und globale Timeline
+ auf {url} auch ohne Anmeldung angezeigt.
+showNoAltTextWarning: Eine Warnung beim Hochladen von Dateien ohne Beschreibung anzeigen
+_emojiModPerm:
+ add: Hinzufügen
+ full: Alles erlauben
+ unauthorized: Kein(e)
+ mod: Hinzufügen und bearbeiten
+messagingUnencryptedInfo: Unterhaltungen auf Firefish sind nicht Ende-zu-Ende verschlüsselt.
+ Teilen Sie keine sensiblen Informationen über Firefish.
+autocorrectNoteLanguage: Eine Warnung anzeigen, wenn die Beitragssprache nicht mit
+ der automatisch ermittelten Sprache übereinstimmt
+emojiModPerm: Berechtigung, personalisierte Emojis zu verwalten
+emojiModPermDescription: "Hinzufügen: Erlauben Sie diesem Benutzer, neue benutzerdefinierte
+ Emojis hinzuzufügen und Tag/Kategorie/Lizenz für neu hinzugefügte benutzerdefinierte
+ Emojis einzustellen.\nHinzufügen und Bearbeiten: \"Hinzufügen\" Berechtigung + Erlauben
+ Sie diesem Benutzer, den Namen/die Kategorie/Tag/die Lizenz der vorhandenen benutzerdefinierten
+ Emojis zu bearbeiten.\nAlles erlauben: \"Hinzufügen und Bearbeiten\" Berechtigung
+ + Erlauben Sie diesem Benutzer, bestehende benutzerdefinierte Emojis zu löschen."
+reloading: Aktualisiert
+markLocalFilesNsfwByDefault: Standardmäßig alle neuen lokalen Dateien als sensibel
+ markieren
+markLocalFilesNsfwByDefaultDescription: Unabhäning von dieser Einstellung lässt sich
+ eine NSFW-Markierung entfernen. Bereits existierende Dateien sind nicht betroffen.
+noLanguage: Keine Sprache
+showBigPostButton: Anzeigen eines großen Knopfes zum Teilen des Beitrags im Beitragsformular
+private: Privat
+searchRange: Veröffentlicht zwischen (optional)
+searchPostsWithFiles: Nur Beiträge mit Dateien
+noAltTextWarning: Einige der angehängten Dateien haben keine Beschreibung. Haben Sie
+ vergessen, diese zu schreiben?
+toReply: Antworten
+toPost: Teilen
+sentFollowRequests: Gesendete Follow-Anfragen
+replyMute: Antworten in Timelines stummschalten
+replyUnmute: Stummschaltung von Antworten in Timelines aufheben
+noSentFollowRequests: Keine gesendeten Follow-Anfragen
+postSearch: Beitragssuche auf diesem Server
+enablePullToRefresh: '"Herunterziehen um zu aktualisieren" aktivieren'
+pullToRefreshThreshold: Benötigte heruntergezogene Distanz, um zu Aktualisieren
+showAddFileDescriptionAtFirstPost: Öffne automatisch ein Eingabefeld, um fehlende
+ Dateibeschreibungen beim Hochladen zu ergänßen
+searchRangeDescription: "Um eine Zeitspanne zu filtern, geben Sie diese in diesem
+ Format an: 20220615-20231031 (YYYYMMTT)\n\nDas Auslassen der Jahreszahl (z.B.: 0615-1031
+ oder 20220615-1031) wird automatisch wie die aktuelle Jahreszahl interpretiert.\n
+ \nZudem können das Anfangs- oder Enddatum ausgelassen werden. Zum Beispiel gibt
+ -1031 an, nach Beiträgen vor dem 31.10 dieses Jahres zu suchen. Umgekehrt führt
+ 20220615- zu einer Suche nach allen Beiträgen nach dem 15.6.2022."
+incorrectLanguageWarning: "Es sieht so aus, als wäre ihr Beitrag auf {detected}, aber
+ Sie haben {current} ausgewählt.\nMöchten Sie stattdessen die Sprache zu {detected}
+ ändern?"
+noteEditHistory: Bearbeitungsgeschichte des Beitrags
+_later:
+ justNow: gerade eben
+ secondsAgo: in {n}s
+ minutesAgo: in {n}min
+ hoursAgo: in {n}h
+ daysAgo: in {n}d
+ weeksAgo: in {n} Woche(n)
+ monthsAgo: in {n} Monat(en)
+ yearsAgo: in {n} Jahr(en)
+ future: zukünftig
+scheduledPost: Veröffentlichungszeit manuell festlegen
+scheduledDate: Geplantes Datum
+mergeRenotesInTimeline: Mehrere Boosts eines Beitrags gruppieren
+mergeThreadInTimeline: In der Timeline mehrere Beiträge im gleichen Thread zusammenlegen
+cannotEditVisibility: Die Sichtbarkeit lässt sich nicht einstellen
+useThisAccountConfirm: Mit diesem Benutzerkonto fortfahren?
+inputAccountId: Bitte gib dein Benutzerkonto an (z.B. @firefish@info.firefish.dev)
+remoteFollow: Folgen (fremde Instanz)
+foldNotification: Ähnliche Benachrichtigungen gruppieren
+i18nServerInfo: Neue Clients nutzen standardmäßig {language}.
+i18nServerChange: Stattdessen {language} benutzen.
+i18nServerSet: Für neue Clients {language} benutzen.
+getQrCode: QR Code anzeigen
+useCdn: Ressourcen von einem CDN laden
+copyRemoteFollowUrl: URL zum Folgen auf einer fremden Instanz kopieren
+showPreviewByDefault: Standardmäßig Vorschau in Beitragsform anzeigen
+replaceChatButtonWithAccountButton: Unterhaltungen-Knopf durch Knopf zum Wechseln
+ des Benutzerkontos ersetzen
+searchEngine: Verwendete Suchmaschine in der Suchleiste MFM
+makePrivateConfirm: Diese Operation sendet eine Löschungsanfrage an fremde Server
+ und ändert die Sichtbarkeit zu 'privat'. Fortfahren?
+enableTimelineStreaming: Timelines automatisch aktualisieren
+scheduledPostAt: Der Beitrag wird {time} gesendet
+cancelScheduledPost: Zeitplan entfernen
+media: Medien
+slashQuote: Kettenzitat
+addAlt4MeTag: 'Automatisch den Hashtag #Alt4Me am Ende deines Beitrags einfügen, wenn
+ eine angehängte Datei keine Beschreibung hat'
diff --git a/locales/el-GR.yml b/locales/el-GR.yml
index 2d2b657e01..f5fcc86755 100644
--- a/locales/el-GR.yml
+++ b/locales/el-GR.yml
@@ -677,7 +677,7 @@ checking: Έλεγχος...
invitationCode: Κωδικός πρόσκλησης
normalPassword: Μέτριος κωδικός
weakPassword: Αδύναμος κωδικός
-strongPassword: Δυνατός κωδικός
+veryStrongPassword: Δυνατός κωδικός
signinWith: Συνδεθείτε με {x}
tapSecurityKey: Βάλτε το κλειδί ασφάλειας
signinFailed: Αδυναμία σύνδεσης. Το όνομα μέλους ή ο κωδικός είναι λάθος.
diff --git a/locales/en-US.yml b/locales/en-US.yml
index 12c0062b22..261b0d5673 100644
--- a/locales/en-US.yml
+++ b/locales/en-US.yml
@@ -514,8 +514,9 @@ usernameInvalidFormat: "You can use upper- and lowercase letters, numbers, and u
tooShort: "Too short"
tooLong: "Too long"
weakPassword: "Weak password"
-normalPassword: "Average password"
-strongPassword: "Strong password"
+normalPassword: "Medium password"
+strongPassword: "Good password"
+veryStrongPassword: "Great password"
passwordMatched: "Matches"
passwordNotMatched: "Does not match"
signinWith: "Sign in with {x}"
@@ -542,7 +543,7 @@ existingAccount: "Existing account"
regenerate: "Regenerate"
fontSize: "Font size"
noFollowRequests: "You don't have any pending follow requests"
-noSentFollowRequests: "You don't have any sent follow requests"
+noSentFollowRequests: "You haven't sent any follow requests"
openImageInNewTab: "Open images in new tab"
dashboard: "Dashboard"
local: "Local"
@@ -1236,8 +1237,9 @@ publishTimelinesDescription: "If enabled, the Local and Global timelines will be
on {url} even when signed out."
noAltTextWarning: "Some attached file(s) have no description. Did you forget to write?"
showNoAltTextWarning: "Show a warning if you attempt to post files without a description"
-showAddFileDescriptionAtFirstPost: "Automatically open a form to write a description when you
- attempt to post files without a description"
+showAddFileDescriptionAtFirstPost: "Automatically open a form to write a description
+ when you attempt to post files without a description"
+addAlt4MeTag: "Automatically append #Alt4Me hashtag to your post if attached file has no description"
_emojiModPerm:
unauthorized: "None"
@@ -1590,7 +1592,7 @@ _later:
future: "future"
justNow: "right now"
secondsAgo: "in {n}s"
- minutesAgo: "in {n}m"
+ minutesAgo: "in {n}min"
hoursAgo: "in {n}h"
daysAgo: "in {n}d"
weeksAgo: "in {n}w"
diff --git a/locales/es-ES.yml b/locales/es-ES.yml
index 9980607521..2b45b41ff7 100644
--- a/locales/es-ES.yml
+++ b/locales/es-ES.yml
@@ -465,7 +465,7 @@ tooShort: "Demasiado corto"
tooLong: "Demasiado largo"
weakPassword: "Contraseña débil"
normalPassword: "Buena contraseña"
-strongPassword: "Muy buena contraseña"
+veryStrongPassword: "Muy buena contraseña"
passwordMatched: "Correcto"
passwordNotMatched: "Las contraseñas no son las mismas"
signinWith: "Inicie sesión con {x}"
@@ -1073,7 +1073,7 @@ _aboutFirefish:
source: "Código fuente"
translation: "Traducir Firefish"
donate: "Donar a Firefish"
- pleaseDonateToFirefish: Por favor considera donar a Firefish para apollar su desarrollo.
+ pleaseDonateToFirefish: Por favor considera donar a Firefish para apoyar su desarrollo.
donateHost: Dona a {host}
donateTitle: ¿Te gusta Firefish?
pleaseDonateToHost: También considera donar a tu propio servidor , {host}, para
diff --git a/locales/fi.yml b/locales/fi.yml
index 123498d6da..c333452f88 100644
--- a/locales/fi.yml
+++ b/locales/fi.yml
@@ -569,7 +569,7 @@ tooShort: Liian lyhyt
tooLong: Liian pitkä
weakPassword: Heikko salasana
normalPassword: Kohtalainen salasana
-strongPassword: Vahva salasana
+veryStrongPassword: Vahva salasana
passwordMatched: Vastaa
signinWith: Kirjaudu sisään {x}
signinFailed: Ei voitu kirjautua sisään. Annettu käyttäjänimi tai salasana virheellinen.
diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml
index 3780db91fc..44cec380ca 100644
--- a/locales/fr-FR.yml
+++ b/locales/fr-FR.yml
@@ -468,7 +468,7 @@ tooShort: "Trop court"
tooLong: "Trop long"
weakPassword: "Mot de passe faible"
normalPassword: "Mot de passe acceptable"
-strongPassword: "Mot de passe fort"
+veryStrongPassword: "Mot de passe fort"
passwordMatched: "Les mots de passe correspondent"
passwordNotMatched: "Les mots de passe ne correspondent pas"
signinWith: "Se connecter avec {x}"
diff --git a/locales/id-ID.yml b/locales/id-ID.yml
index b06f906000..325941779d 100644
--- a/locales/id-ID.yml
+++ b/locales/id-ID.yml
@@ -464,7 +464,7 @@ tooShort: "Terlalu pendek"
tooLong: "Terlalu panjang"
weakPassword: "Kata sandi lemah"
normalPassword: "Kata sandi baik"
-strongPassword: "Kata sandi kuat"
+veryStrongPassword: "Kata sandi kuat"
passwordMatched: "Kata sandi sama"
passwordNotMatched: "Kata sandi tidak sama"
signinWith: "Masuk dengan {x}"
diff --git a/locales/it-IT.yml b/locales/it-IT.yml
index e686df5890..8ecfd09bdc 100644
--- a/locales/it-IT.yml
+++ b/locales/it-IT.yml
@@ -454,7 +454,7 @@ tooShort: "Troppo breve"
tooLong: "Troppo lungo"
weakPassword: "Password debole"
normalPassword: "Password buona"
-strongPassword: "Password forte"
+veryStrongPassword: "Password forte"
passwordMatched: "Corretta"
passwordNotMatched: "Le password non corrispondono"
signinWith: "Accedi con {x}"
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 3881a1af89..b9b2d6745d 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -465,7 +465,7 @@ tooShort: "短すぎます"
tooLong: "長すぎます"
weakPassword: "弱いパスワード"
normalPassword: "普通のパスワード"
-strongPassword: "強いパスワード"
+veryStrongPassword: "とても強いパスワード"
passwordMatched: "一致しました"
passwordNotMatched: "一致していません"
signinWith: "{x}でログイン"
@@ -2087,3 +2087,5 @@ scheduledPost: 予約投稿
scheduledDate: 予定日
cancelScheduledPost: 予約を解除する
scheduledPostAt: '{time}に投稿されます'
+strongPassword: 強いパスワード
+addAlt4MeTag: '説明の無いファイルを投稿する際に自動で #Alt4Me のハッシュタグをつける'
diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml
index 970a27d0ed..941135e8cf 100644
--- a/locales/ja-KS.yml
+++ b/locales/ja-KS.yml
@@ -435,7 +435,7 @@ tooShort: "短すぎやろ!"
tooLong: "長すぎやろ!"
weakPassword: "へぼいパスワード"
normalPassword: "普通のパスワード"
-strongPassword: "ええ感じのパスワード"
+veryStrongPassword: "ええ感じのパスワード"
passwordMatched: "よし!一致や!"
passwordNotMatched: "一致しとらんで?"
signinWith: "{x}でログイン"
diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml
index d67e37d4cf..bad1f8ee80 100644
--- a/locales/ko-KR.yml
+++ b/locales/ko-KR.yml
@@ -442,7 +442,7 @@ tooShort: "너무 짧습니다"
tooLong: "너무 깁니다"
weakPassword: "약한 비밀번호"
normalPassword: "좋은 비밀번호"
-strongPassword: "강한 비밀번호"
+veryStrongPassword: "강한 비밀번호"
passwordMatched: "일치합니다"
passwordNotMatched: "일치하지 않습니다"
signinWith: "{x}로 로그인"
diff --git a/locales/nl-NL.yml b/locales/nl-NL.yml
index 9d120ccf79..6079d7624b 100644
--- a/locales/nl-NL.yml
+++ b/locales/nl-NL.yml
@@ -576,7 +576,7 @@ quoteAttached: Quote
noMessagesYet: Nog geen berichten
weakPassword: Zwak wachtwoord
normalPassword: Middelmatig wachtwoord
-strongPassword: Sterk wachtwoord
+veryStrongPassword: Sterk wachtwoord
onlyOneFileCanBeAttached: Je kan maar één bestand toevoegen aan je bericht
invitationCode: Uitnodigingscode
checking: Controleren...
diff --git a/locales/no-NO.yml b/locales/no-NO.yml
index b446ff4359..adafb8face 100644
--- a/locales/no-NO.yml
+++ b/locales/no-NO.yml
@@ -571,7 +571,7 @@ youHaveNoGroups: Du har ingen grupper
noHistory: Ingen historikk er tilgjengelig
aboutX: Om {x}
signinHistory: Innloggings-historikk
-strongPassword: Sterkt passord
+veryStrongPassword: Sterkt passord
noFollowRequests: Du har ingen utestående følgeforespørsler
openImageInNewTab: Åpne bilder i ny fane
dashboard: Dashbord
diff --git a/locales/pl-PL.yml b/locales/pl-PL.yml
index 43eeb3c8f0..ec27ccbe24 100644
--- a/locales/pl-PL.yml
+++ b/locales/pl-PL.yml
@@ -454,7 +454,7 @@ tooShort: "Zbyt krótka"
tooLong: "Zbyt długa"
weakPassword: "Słabe hasło"
normalPassword: "Dobre hasło"
-strongPassword: "Silne hasło"
+veryStrongPassword: "Silne hasło"
passwordMatched: "Pasuje"
passwordNotMatched: "Hasła nie pasują do siebie"
signinWith: "Zaloguj się z {x}"
diff --git a/locales/ro-RO.yml b/locales/ro-RO.yml
index a0392abc98..acf4084403 100644
--- a/locales/ro-RO.yml
+++ b/locales/ro-RO.yml
@@ -464,7 +464,7 @@ tooShort: "Prea scurt"
tooLong: "Prea lung"
weakPassword: "Parolă slabă"
normalPassword: "Parolă medie"
-strongPassword: "Parolă puternică"
+veryStrongPassword: "Parolă puternică"
passwordMatched: "Se potrivește!"
passwordNotMatched: "Nu se potrivește"
signinWith: "Autentifică-te cu {x}"
diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml
index 5c81e19a04..e360b5ae27 100644
--- a/locales/ru-RU.yml
+++ b/locales/ru-RU.yml
@@ -460,7 +460,7 @@ tooShort: "Слишком короткий"
tooLong: "Слишком длинный"
weakPassword: "Слабый пароль"
normalPassword: "Годный пароль"
-strongPassword: "Надёжный пароль"
+veryStrongPassword: "Надёжный пароль"
passwordMatched: "Совпали"
passwordNotMatched: "Не совпадают"
signinWith: "Использовать {x} для входа"
@@ -2137,3 +2137,15 @@ replies: Ответы
quotes: Цитаты
clickToShowPatterns: Нажмите, чтобы показать модуль шаблонов
renotes: Репосты
+markLocalFilesNsfwByDefaultDescription: Независимо от данной настройки, пользователи
+ могут самостоятельно удалять метку NSFW. Не применяется на существующие файлы.
+toEdit: Редактировать
+attachedToNotes: Посты с этим файлом
+showAttachedNotes: Показывать посты с этим файлом
+strongPassword: Хороший пароль
+toReply: Ответить
+toPost: Выложить
+sentFollowRequests: Отправленные запросы на подписку
+toQuote: Цитировать
+cannotEditVisibility: Вы не можете изменить видимость
+noSentFollowRequests: Вы не отправляли никаких запросов на подписку
diff --git a/locales/sk-SK.yml b/locales/sk-SK.yml
index e1ed198e4e..5d9e535491 100644
--- a/locales/sk-SK.yml
+++ b/locales/sk-SK.yml
@@ -461,7 +461,7 @@ tooShort: "Príliš krátke"
tooLong: "Príliš dlhé"
weakPassword: "Slabé heslo"
normalPassword: "Dobré heslo"
-strongPassword: "Silné heslo"
+veryStrongPassword: "Silné heslo"
passwordMatched: "Heslá sú rovnaké"
passwordNotMatched: "Heslá nie sú rovnaké"
signinWith: "Prihlásiť sa použitím {x}"
diff --git a/locales/sv-SE.yml b/locales/sv-SE.yml
index 5e7ed1d768..13cb3c66ec 100644
--- a/locales/sv-SE.yml
+++ b/locales/sv-SE.yml
@@ -381,7 +381,7 @@ noMessagesYet: Inga meddelande ännu
newMessageExists: Det finns inga nya meddelanden
weakPassword: Svagt lösenord
normalPassword: Dugligt lösenord
-strongPassword: Starkt lösenord
+veryStrongPassword: Starkt lösenord
passwordMatched: Matchar
passwordNotMatched: Matchar inte
signinWith: Logga in med {x}
diff --git a/locales/th-TH.yml b/locales/th-TH.yml
index 4a668f910a..93904a1125 100644
--- a/locales/th-TH.yml
+++ b/locales/th-TH.yml
@@ -452,7 +452,7 @@ tooShort: "สั้นเกินไปนะ"
tooLong: "ยาวเกินไปนะ"
weakPassword: "รหัสผ่าน แย่มาก"
normalPassword: "รหัสผ่านปกติ"
-strongPassword: "รหัสผ่านรัดกุมมาก"
+veryStrongPassword: "รหัสผ่านรัดกุมมาก"
passwordMatched: "ถูกต้อง!"
passwordNotMatched: "ไม่ถูกต้อง"
signinWith: "ลงชื่อเข้าใช้ด้วย {x}"
diff --git a/locales/tr-TR.yml b/locales/tr-TR.yml
index cb36a6a07c..66bfe28133 100644
--- a/locales/tr-TR.yml
+++ b/locales/tr-TR.yml
@@ -521,7 +521,7 @@ newMessageExists: Yeni mesaj yok
invitations: Davetler
invitationCode: Davet kodu
signinWith: '{x} ile giriş yap'
-strongPassword: Güçlü şifre
+veryStrongPassword: Güçlü şifre
passwordNotMatched: Uyuşmuyor
signinFailed: Giriş yapılamadı. Şifre ve ya kullanıcı adı yanlış.
tapSecurityKey: Güvenlik anahtarınıza dokunun
diff --git a/locales/uk-UA.yml b/locales/uk-UA.yml
index aa669f596f..206a52ce95 100644
--- a/locales/uk-UA.yml
+++ b/locales/uk-UA.yml
@@ -460,7 +460,7 @@ tooShort: "Занадто короткий"
tooLong: "Занадто довгий"
weakPassword: "Слабкий пароль"
normalPassword: "Достатній пароль"
-strongPassword: "Міцний пароль"
+veryStrongPassword: "Міцний пароль"
passwordMatched: "Все вірно"
passwordNotMatched: "Паролі не співпадають"
signinWith: "Увійти за допомогою {x}"
diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml
index 4c6a01f1ae..f24ef9a864 100644
--- a/locales/vi-VN.yml
+++ b/locales/vi-VN.yml
@@ -462,7 +462,7 @@ tooShort: "Quá ngắn"
tooLong: "Quá dài"
weakPassword: "Mật khẩu yếu"
normalPassword: "Mật khẩu tạm được"
-strongPassword: "Mật khẩu mạnh"
+veryStrongPassword: "Mật khẩu mạnh"
passwordMatched: "Trùng khớp"
passwordNotMatched: "Không trùng khớp"
signinWith: "Đăng nhập bằng {x}"
diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml
index 5b888cad44..5cf4c8883f 100644
--- a/locales/zh-CN.yml
+++ b/locales/zh-CN.yml
@@ -450,7 +450,7 @@ tooShort: "太短"
tooLong: "太长"
weakPassword: "密码强度:弱"
normalPassword: "密码强度:中等"
-strongPassword: "密码强度:强"
+veryStrongPassword: "密码强度:强"
passwordMatched: "密码一致"
passwordNotMatched: "密码不一致"
signinWith: "以 {x} 登录"
@@ -1950,7 +1950,7 @@ noteId: 帖子 ID
moveFrom: 从旧账号迁移至此账号
defaultReaction: 发出和收到帖子的默认表情符号反应
sendModMail: 发送管理通知
-moderationNote: "管理笔记"
+moderationNote: "管理员备注"
ipFirstAcknowledged: "首次获取此 IP 地址的日期"
driveCapacityOverride: "网盘容量变更"
isLocked: 该账号设置了关注请求
diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml
index 00a7827203..a153513f03 100644
--- a/locales/zh-TW.yml
+++ b/locales/zh-TW.yml
@@ -448,7 +448,7 @@ tooShort: "過短"
tooLong: "過長"
weakPassword: "密碼強度過弱"
normalPassword: "密碼強度普通"
-strongPassword: "密碼強度高"
+veryStrongPassword: "密碼強度高"
passwordMatched: "密碼一致"
passwordNotMatched: "密碼不一致"
signinWith: "以{x}登錄"
diff --git a/package.json b/package.json
index 4d0ab3fda8..1f6e3c65d3 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,11 @@
{
"name": "firefish",
- "version": "20240523",
+ "version": "20240630",
"repository": {
"type": "git",
"url": "https://firefish.dev/firefish/firefish.git"
},
- "packageManager": "pnpm@9.1.4",
+ "packageManager": "pnpm@9.4.0",
"private": true,
"scripts": {
"rebuild": "pnpm run clean && pnpm run build",
@@ -22,13 +22,14 @@
"dev": "pnpm node ./scripts/dev.mjs",
"dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start",
"lint": "pnpm run lint:ts; pnpm run lint:rs",
- "lint:ts": "pnpm --filter !firefish-js -r --parallel run lint",
+ "lint:ts": "pnpm --filter !firefish-js --recursive run lint ; pnpm run format:ts",
"lint:rs": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt --all --",
"debug": "pnpm run build:debug && pnpm run start",
"mocha": "pnpm --filter backend run mocha",
- "test": "pnpm run test:ts && pnpm run test:rs",
+ "test": "pnpm run test:rs && pnpm run test:rs:miri && pnpm run test:ts",
"test:ts": "pnpm run mocha",
"test:rs": "cargo test --doc && cargo nextest run",
+ "test:rs:miri": "MIRIFLAGS='-Zmiri-disable-isolation' cargo +nightly miri nextest run -j$(nproc --all)",
"format": "pnpm run format:ts; pnpm run format:rs",
"format:ts": "pnpm -r --parallel run format",
"format:rs": "cargo fmt --all --",
@@ -41,14 +42,13 @@
"js-yaml": "4.1.0"
},
"devDependencies": {
- "@biomejs/biome": "1.7.3",
- "@biomejs/cli-darwin-arm64": "1.7.3",
- "@biomejs/cli-darwin-x64": "1.7.3",
- "@biomejs/cli-linux-arm64": "1.7.3",
- "@biomejs/cli-linux-x64": "1.7.3",
- "@types/node": "20.12.13",
- "execa": "9.1.0",
- "pnpm": "9.1.4",
- "typescript": "5.4.5"
+ "@biomejs/biome": "1.8.3",
+ "@biomejs/cli-darwin-arm64": "1.8.3",
+ "@biomejs/cli-darwin-x64": "1.8.3",
+ "@biomejs/cli-linux-arm64": "1.8.3",
+ "@biomejs/cli-linux-x64": "1.8.3",
+ "@types/node": "20.14.9",
+ "execa": "9.3.0",
+ "pnpm": "9.4.0"
}
}
diff --git a/packages/backend-rs/Cargo.toml b/packages/backend-rs/Cargo.toml
index d4942cd61c..790ad0f317 100644
--- a/packages/backend-rs/Cargo.toml
+++ b/packages/backend-rs/Cargo.toml
@@ -6,13 +6,13 @@ rust-version = "1.74"
[features]
default = []
-napi = ["dep:napi", "dep:napi-derive"]
+napi = ["dep:napi", "dep:napi-derive", "dep:napi-build"]
[lib]
crate-type = ["cdylib", "lib"]
[dependencies]
-macro-rs = { workspace = true }
+macros = { workspace = true }
napi = { workspace = true, optional = true, features = ["chrono_date", "napi4", "serde-json", "tokio_rt"] }
napi-derive = { workspace = true, optional = true }
@@ -25,7 +25,7 @@ bcrypt = { workspace = true, features = ["std"] }
chrono = { workspace = true }
cuid2 = { workspace = true }
emojis = { workspace = true }
-idna = { workspace = true }
+idna = { workspace = true, features = ["std", "compiled_data"] }
image = { workspace = true, features = ["avif", "bmp", "gif", "ico", "jpeg", "png", "tiff", "webp"] }
isahc = { workspace = true, features = ["http2", "text-decoding"] }
nom-exif = { workspace = true }
@@ -39,7 +39,6 @@ sea-orm = { workspace = true, features = ["macros", "runtime-tokio-rustls", "sql
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
-strum = { workspace = true, features = ["derive"] }
sysinfo = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync", "time"] }
@@ -54,4 +53,4 @@ pretty_assertions = { workspace = true, features = ["std"] }
tokio-test = { workspace = true }
[build-dependencies]
-napi-build = { workspace = true }
+napi-build = { workspace = true, optional = true }
diff --git a/packages/backend-rs/Makefile b/packages/backend-rs/Makefile
index abe6045801..9e53b37837 100644
--- a/packages/backend-rs/Makefile
+++ b/packages/backend-rs/Makefile
@@ -11,25 +11,25 @@ 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 --
.PHONY: update-index
update-index: index.js index.d.ts
-index.js index.d.ts: $(SRC)
+index.js index.d.ts: $(SRC) package.json
NODE_OPTIONS='--max_old_space_size=3072' pnpm run build:debug
[ -f built/index.js ] && [ -f built/index.d.ts ]
rm --force index.js index.d.ts
cp built/index.js index.js
cp built/index.d.ts index.d.ts
- sed -i 's/^ \*r"/ */g' index.d.ts
diff --git a/packages/backend-rs/build.rs b/packages/backend-rs/build.rs
index 9e5e97713c..71dd87aa16 100644
--- a/packages/backend-rs/build.rs
+++ b/packages/backend-rs/build.rs
@@ -1,9 +1,8 @@
-extern crate napi_build;
-
fn main() {
// watch the version in the project root package.json
println!("cargo:rerun-if-changed=../../package.json");
// napi
+ #[cfg(feature = "napi")]
napi_build::setup();
}
diff --git a/packages/backend-rs/index.d.ts b/packages/backend-rs/index.d.ts
index 5060e38bdb..52e4e1af1a 100644
--- a/packages/backend-rs/index.d.ts
+++ b/packages/backend-rs/index.d.ts
@@ -1,155 +1,216 @@
-/* tslint:disable */
-/* eslint-disable */
-
/* auto-generated by NAPI-RS */
+/* Do NOT edit this file manually */
-export const SECOND: number
-export const MINUTE: number
-export const HOUR: number
-export const DAY: number
-export const USER_ONLINE_THRESHOLD: number
-export const USER_ACTIVE_THRESHOLD: number
-/**
- * List of file types allowed to be viewed directly in the browser
- *
- * Anything not included here will be responded as application/octet-stream
- * SVG is not allowed because it generates XSS (TODO: fix this and later allow it to be viewed directly)
- * *
- * *
- * *
- */
-export const FILE_TYPE_BROWSERSAFE: string[]
-export interface EnvConfig {
- onlyQueue: boolean
- onlyServer: boolean
- noDaemons: boolean
- disableClustering: boolean
- verbose: boolean
- withLogTime: boolean
- slow: boolean
+type DateTimeWithTimeZone = Date;
+
+type Json = any;
+
+export interface AbuseUserReport {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ targetUserId: string
+ reporterId: string
+ assigneeId: string | null
+ resolved: boolean
+ comment: string
+ targetUserHost: string | null
+ reporterHost: string | null
+ forwarded: boolean
}
-export function loadEnv(): EnvConfig
-export interface ServerConfig {
+
+export interface AbuseUserReportLike {
+ id: string
+ targetUserId: string
+ reporterId: string
+ comment: string
+}
+
+export interface AccessToken {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ token: string
+ hash: string
+ userId: string
+ appId: string | null
+ lastUsedAt: DateTimeWithTimeZone | null
+ session: string | null
+ name: string | null
+ description: string | null
+ iconUrl: string | null
+ permission: Array
+ fetched: boolean
+}
+
+export interface Acct {
+ username: string
+ host: string | null
+}
+
+export declare function acctToString(acct: Acct): string
+
+export interface Ad {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ expiresAt: DateTimeWithTimeZone
+ place: string
+ priority: string
url: string
- port: number
- /** the host address to bind to */
- bind?: string
- disableHsts?: boolean
- /** PostgreSQL configurations */
- db: DbConfig
- /** Redis configurations */
- redis: RedisConfig
- /** secondary Redis server configurations */
- cacheServer?: RedisConfig
- /** proxy host used for HTTP requests */
- proxy?: string
- /** proxy host used for SMTP requests */
- proxySmtp?: string
- /** hosts to bypass the proxy */
- proxyBypassHosts?: Array
- allowedPrivateNetworks?: Array
- /** maximum file size that can be uploaded to the drive (in bytes) */
- maxFileSize?: number
- accessLog?: string
- clusterLimits?: WorkerConfigInternal
- cuid?: IdConfig
- outgoingAddress?: string
- deliverJobConcurrency?: number
- inboxJobConcurrency?: number
- deliverJobPerSec?: number
- inboxJobPerSec?: number
- deliverJobMaxAttempts?: number
- inboxJobMaxAttempts?: number
- /** deprecated in favor of `max_log_level` */
- logLevel?: Array
- /** verbosity of the server log. `error`, `warn`, `info`, `debug`, or `trace` */
- maxLogLevel?: string
- syslog?: SysLogConfig
- proxyRemoteFiles?: boolean
- mediaProxy?: string
- summalyProxyUrl?: string
- reservedUsernames?: Array
- maxUserSignups?: number
- isManagedHosting?: boolean
- maxNoteLength?: number
- maxCaptionLength?: number
- deepl?: DeepLConfig
- libreTranslate?: LibreTranslateConfig
- email?: EmailConfig
- objectStorage?: ObjectStorageConfig
+ imageUrl: string
+ memo: string
+ ratio: number
}
-export interface DbConfig {
- host: string
- port: number
- db: string
- user: string
- pass: string
- disableCache?: boolean
- extra?: any
+
+export interface Announcement {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ text: string
+ title: string
+ imageUrl: string | null
+ updatedAt: DateTimeWithTimeZone | null
+ showPopup: boolean
+ isGoodNews: boolean
}
-export interface RedisConfig {
- host: string
- port: number
- family?: number
- user?: string
- pass?: string
- tls?: TlsConfig
- db: number
- prefix?: string
+
+export interface AnnouncementRead {
+ id: string
+ userId: string
+ announcementId: string
+ createdAt: DateTimeWithTimeZone
}
-export interface TlsConfig {
- host: string
- rejectUnauthorized: boolean
+
+export interface Antenna {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ userId: string
+ name: string
+ src: AntennaSrc
+ userListId: string | null
+ withFile: boolean
+ expression: string | null
+ notify: boolean
+ caseSensitive: boolean
+ withReplies: boolean
+ userGroupJoiningId: string | null
+ users: Array
+ instances: Array
+ keywords: Array
+ excludeKeywords: Array
}
-export interface WorkerConfig {
- web: number
- queue: number
+
+export enum AntennaSrc {
+ All = 'all',
+ Group = 'group',
+ Home = 'home',
+ Instances = 'instances',
+ List = 'list',
+ Users = 'users'
}
-export interface WorkerConfigInternal {
- web?: number
- queue?: number
+
+export interface App {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ userId: string | null
+ secret: string
+ name: string
+ description: string
+ permission: Array
+ callbackUrl: string | null
}
-export interface IdConfig {
- length?: number
- fingerprint?: string
+
+export interface AttestationChallenge {
+ id: string
+ userId: string
+ challenge: string
+ createdAt: DateTimeWithTimeZone
+ registrationChallenge: boolean
}
-export interface SysLogConfig {
- host: string
- port: number
+
+export interface AuthSession {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ token: string
+ userId: string | null
+ appId: string
}
-export interface DeepLConfig {
- managed?: boolean
- authKey?: string
- isPro?: boolean
+
+export interface Blocking {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ blockeeId: string
+ blockerId: string
}
-export interface LibreTranslateConfig {
- managed?: boolean
- apiUrl?: string
- apiKey?: string
+
+export interface Channel {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ lastNotedAt: DateTimeWithTimeZone | null
+ userId: string | null
+ name: string
+ description: string | null
+ bannerId: string | null
+ notesCount: number
+ usersCount: number
}
-export interface EmailConfig {
- managed?: boolean
- address?: string
- host?: string
- port?: number
- user?: string
- pass?: string
- useImplicitSslTls?: boolean
+
+export interface ChannelFollowing {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ followeeId: string
+ followerId: string
}
-export interface ObjectStorageConfig {
- managed?: boolean
- baseUrl?: string
- bucket?: string
- prefix?: string
- endpoint?: string
- region?: string
- accessKey?: string
- secretKey?: string
- useSsl?: boolean
- connnectOverProxy?: boolean
- setPublicReadOnUpload?: boolean
- s3ForcePathStyle?: boolean
+
+export interface ChannelNotePining {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ channelId: string
+ noteId: string
}
+
+export enum ChatEvent {
+ Message = 0,
+ Read = 1,
+ Deleted = 2,
+ Typing = 3
+}
+
+export enum ChatIndexEvent {
+ Message = 0,
+ Read = 1
+}
+
+/**
+ * Returns whether `note` should be hard-muted.
+ *
+ * More specifically, this function returns `Ok(true)`
+ * if and only if one or more of these conditions are met:
+ *
+ * * the note (text or CW) contains any of the words/patterns
+ * * the "parent" note(s) (reply, quote) contain any of the words/patterns
+ * * the alt text of the attached files contains any of the words/patterns
+ *
+ * # Arguments
+ *
+ * * `note` : [PartialNoteToCheckWordMute] object
+ * * `muted_words` : list of muted keyword lists (each array item is a space-separated keyword list that represents an AND condition)
+ * * `muted_patterns` : list of JavaScript-style (e.g., `/foo/i`) regular expressions
+ */
+export declare function checkWordMute(note: PartialNoteToCheckWordMute, mutedWords: Array, mutedPatterns: Array): Promise
+
+export interface Clip {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ userId: string
+ name: string
+ isPublic: boolean
+ description: string | null
+}
+
+export interface ClipNote {
+ id: string
+ noteId: string
+ clipId: string
+}
+
export interface Config {
url: string
port: number
@@ -201,442 +262,44 @@ export interface Config {
driveUrl: string
userAgent: string
}
-export function loadConfig(): Config
-export interface Acct {
- username: string
- host: string | null
+
+export declare function countReactions(reactions: Record): Record
+
+export interface Cpu {
+ model: string
+ cores: number
}
-export function stringToAcct(acct: string): Acct
-export function acctToString(acct: Acct): string
-/** Fetches and returns the NodeInfo of a remote server. */
-export function fetchNodeinfo(host: string): Promise
-export function nodeinfo_2_1(): Promise
-export function nodeinfo_2_0(): Promise
-/** NodeInfo schema version 2.0. */
-export interface Nodeinfo {
- /** The schema version, must be 2.0. */
- version: string
- /** Metadata about server software in use. */
- software: Software20
- /** The protocols supported on this server. */
- protocols: Array
- /** The third party sites this server can connect to via their application API. */
- services: Services
- /** Whether this server allows open self-registration. */
- openRegistrations: boolean
- /** Usage statistics for this server. */
- usage: Usage
- /** Free form key value pairs for software specific values. Clients should not rely on any specific key present. */
- metadata: Record
+
+export declare function cpuInfo(): Cpu
+
+export declare function cpuUsage(): number
+
+export const DAY: number
+
+export interface DbConfig {
+ host: string
+ port: number
+ db: string
+ user: string
+ pass: string
+ disableCache?: boolean
+ extra?: any
}
-/** Metadata about server software in use (version 2.0). */
-export interface Software20 {
- /** The canonical name of this server software. */
- name: string
- /** The version of this server software. */
- version: string
-}
-export enum Protocol {
- Activitypub = 'activitypub',
- Buddycloud = 'buddycloud',
- Dfrn = 'dfrn',
- Diaspora = 'diaspora',
- Libertree = 'libertree',
- Ostatus = 'ostatus',
- Pumpio = 'pumpio',
- Tent = 'tent',
- Xmpp = 'xmpp',
- Zot = 'zot'
-}
-/** The third party sites this server can connect to via their application API. */
-export interface Services {
- /** The third party sites this server can retrieve messages from for combined display with regular traffic. */
- inbound: Array
- /** The third party sites this server can publish messages to on the behalf of a user. */
- outbound: Array
-}
-/** The third party sites this server can retrieve messages from for combined display with regular traffic. */
-export enum Inbound {
- Atom1 = 'atom1',
- Gnusocial = 'gnusocial',
- Imap = 'imap',
- Pnut = 'pnut',
- Pop3 = 'pop3',
- Pumpio = 'pumpio',
- Rss2 = 'rss2',
- Twitter = 'twitter'
-}
-/** The third party sites this server can publish messages to on the behalf of a user. */
-export enum Outbound {
- Atom1 = 'atom1',
- Blogger = 'blogger',
- Buddycloud = 'buddycloud',
- Diaspora = 'diaspora',
- Dreamwidth = 'dreamwidth',
- Drupal = 'drupal',
- Facebook = 'facebook',
- Friendica = 'friendica',
- Gnusocial = 'gnusocial',
- Google = 'google',
- Insanejournal = 'insanejournal',
- Libertree = 'libertree',
- Linkedin = 'linkedin',
- Livejournal = 'livejournal',
- Mediagoblin = 'mediagoblin',
- Myspace = 'myspace',
- Pinterest = 'pinterest',
- Pnut = 'pnut',
- Posterous = 'posterous',
- Pumpio = 'pumpio',
- Redmatrix = 'redmatrix',
- Rss2 = 'rss2',
- Smtp = 'smtp',
- Tent = 'tent',
- Tumblr = 'tumblr',
- Twitter = 'twitter',
- Wordpress = 'wordpress',
- Xmpp = 'xmpp'
-}
-/** Usage statistics for this server. */
-export interface Usage {
- users: Users
- localPosts: number | null
- localComments: number | null
-}
-/** statistics about the users of this server. */
-export interface Users {
- total: number | null
- activeHalfyear: number | null
- activeMonth: number | null
-}
-/** Prints the greeting message and the Firefish version to stdout. */
-export function greet(): void
-/** Initializes the [tracing] logger. */
-export function initializeRustLogger(): void
-/** Prints the server hardware information as the server info log. */
-export function showServerInfo(): void
-/**
- * Checks if a server is blocked.
- *
- * # Argument
- * `host` - punycoded instance host
- *
- * # Example
- * ```no_run
- * # use backend_rs::misc::check_server_block::is_blocked_server;
- * # async fn f() -> Result<(), Box> {
- * assert_eq!(true, is_blocked_server("blocked.com").await?);
- * assert_eq!(false, is_blocked_server("not-blocked.com").await?);
- * assert_eq!(true, is_blocked_server("subdomain.of.blocked.com").await?);
- * assert_eq!(true, is_blocked_server("xn--l8jegik.blocked.com").await?);
- * # Ok(())
- * # }
- * ```
- */
-export function isBlockedServer(host: string): Promise
-/**
- * Checks if a server is silenced.
- *
- * # Argument
- * `host` - punycoded instance host
- *
- * # Example
- * ```no_run
- * # use backend_rs::misc::check_server_block::is_silenced_server;
- * # async fn f() -> Result<(), Box> {
- * assert_eq!(true, is_silenced_server("silenced.com").await?);
- * assert_eq!(false, is_silenced_server("not-silenced.com").await?);
- * assert_eq!(true, is_silenced_server("subdomain.of.silenced.com").await?);
- * assert_eq!(true, is_silenced_server("xn--l8jegik.silenced.com").await?);
- * # Ok(())
- * # }
- * ```
- */
-export function isSilencedServer(host: string): Promise
-/**
- * Checks if a server is allowlisted.
- * Returns `Ok(true)` if private mode is disabled.
- *
- * # Argument
- * `host` - punycoded instance host
- *
- * # Example
- * ```no_run
- * # use backend_rs::misc::check_server_block::is_allowed_server;
- * # async fn f() -> Result<(), Box> {
- * assert_eq!(true, is_allowed_server("allowed.com").await?);
- * assert_eq!(false, is_allowed_server("not-allowed.com").await?);
- * assert_eq!(false, is_allowed_server("subdomain.of.allowed.com").await?);
- * assert_eq!(false, is_allowed_server("xn--l8jegik.allowed.com").await?);
- * # Ok(())
- * # }
- * ```
- */
-export function isAllowedServer(host: string): Promise
-/**
- * Returns whether `note` should be hard-muted.
- *
- * More specifically, this function returns `Ok(true)`
- * if and only if one or more of these conditions are met:
- *
- * * the note (text or CW) contains any of the words/patterns
- * * the "parent" note(s) (reply, quote) contain any of the words/patterns
- * * the alt text of the attached files contains any of the words/patterns
- *
- * # Arguments
- *
- * * `note` : [NoteLike] object
- * * `muted_words` : list of muted keyword lists (each array item is a space-separated keyword list that represents an AND condition)
- * * `muted_patterns` : list of JavaScript-style (e.g., `/foo/i`) regular expressions
- */
-export function checkWordMute(note: NoteLike, mutedWords: Array, mutedPatterns: Array): Promise
-export function getFullApAccount(username: string, host?: string | undefined | null): string
-export function isSelfHost(host?: string | undefined | null): boolean
-export function isSameOrigin(uri: string): boolean
-export function extractHost(uri: string): string
-export function toPuny(host: string): string
-export function isUnicodeEmoji(s: string): boolean
-/** Escapes `%` and `\` in the given string. */
-export function sqlLikeEscape(src: string): string
-/** Returns `true` if `src` does not contain suspicious characters like `%`. */
-export function safeForSql(src: string): boolean
-/** Converts milliseconds to a human readable string. */
-export function formatMilliseconds(milliseconds: number): string
-export interface ImageSize {
- width: number
- height: number
-}
-export function getImageSizeFromUrl(url: string): Promise
-export interface NoteLikeForAllTexts {
- fileIds: Array
- userId: string
- text: string | null
- cw: string | null
- renoteId: string | null
- replyId: string | null
-}
-export interface NoteLikeForGetNoteSummary {
- fileIds: Array
- text: string | null
- cw: string | null
- hasPoll: boolean
-}
-export function getNoteSummary(note: NoteLikeForGetNoteSummary): string
-export function isQuote(note: Note): boolean
-export function isSafeUrl(url: string): boolean
-/** Returns the latest Firefish version. */
-export function latestVersion(): Promise
-export function toMastodonId(firefishId: string): string | null
-export function fromMastodonId(mastodonId: string): string | null
-export function fetchMeta(useCache: boolean): Promise
-export interface PugArgs {
- img: string | null
- title: string
- instanceName: string
- desc: string | null
- icon: string | null
- splashIcon: string | null
- themeColor: string | null
- randomMotd: string
- privateMode: boolean | null
-}
-export function metaToPugArgs(meta: Meta): PugArgs
-/**
- * Converts the given text into the cat language.
- *
- * refs:
- * *
- * *
- *
- * # Arguments
- *
- * * `text` : original text
- * * `lang` : language code (e.g., `Some("en")`, `Some("en-US")`, `Some("uk-UA")`, `None`)
- *
- * # Example
- *
- * ```
- * # use backend_rs::misc::nyaify::nyaify;
- * assert_eq!(nyaify("I'll take a nap.", Some("en")), "I'll take a nyap.");
- * ```
- */
-export function nyaify(text: string, lang?: string | undefined | null): string
-/** Hashes the given password using [Argon2] algorithm. */
-export function hashPassword(password: string): string
-/** Checks whether the given password and hash match. */
-export function verifyPassword(password: string, hash: string): boolean
-/** Returns whether the [bcrypt] algorithm is used for the password hash. */
-export function isOldPasswordAlgorithm(hash: string): boolean
+
export interface DecodedReaction {
reaction: string
name: string | null
host: string | null
}
-export function decodeReaction(reaction: string): DecodedReaction
-export function countReactions(reactions: Record): Record
-export function toDbReaction(reaction?: string | undefined | null, host?: string | undefined | null): Promise
-/** Delete all entries in the [attestation_challenge] table created at more than 5 minutes ago */
-export function removeOldAttestationChallenges(): Promise
-export interface Cpu {
- model: string
- cores: number
-}
-export interface Memory {
- /** Total memory amount in bytes */
- total: number
- /** Used memory amount in bytes */
- used: number
- /** Available (for (re)use) memory amount in bytes */
- available: number
-}
-export interface Storage {
- /** Total storage space in bytes */
- total: number
- /** Used storage space in bytes */
- used: number
-}
-export function cpuInfo(): Cpu
-export function cpuUsage(): number
-export function memoryUsage(): Memory
-export function storageUsage(): Storage | null
-export interface AbuseUserReport {
- id: string
- createdAt: DateTimeWithTimeZone
- targetUserId: string
- reporterId: string
- assigneeId: string | null
- resolved: boolean
- comment: string
- targetUserHost: string | null
- reporterHost: string | null
- forwarded: boolean
-}
-export interface AccessToken {
- id: string
- createdAt: DateTimeWithTimeZone
- token: string
- hash: string
- userId: string
- appId: string | null
- lastUsedAt: DateTimeWithTimeZone | null
- session: string | null
- name: string | null
- description: string | null
- iconUrl: string | null
- permission: Array
- fetched: boolean
-}
-export interface Ad {
- id: string
- createdAt: DateTimeWithTimeZone
- expiresAt: DateTimeWithTimeZone
- place: string
- priority: string
- url: string
- imageUrl: string
- memo: string
- ratio: number
-}
-export interface Announcement {
- id: string
- createdAt: DateTimeWithTimeZone
- text: string
- title: string
- imageUrl: string | null
- updatedAt: DateTimeWithTimeZone | null
- showPopup: boolean
- isGoodNews: boolean
-}
-export interface AnnouncementRead {
- id: string
- userId: string
- announcementId: string
- createdAt: DateTimeWithTimeZone
-}
-export interface Antenna {
- id: string
- createdAt: DateTimeWithTimeZone
- userId: string
- name: string
- src: AntennaSrc
- userListId: string | null
- withFile: boolean
- expression: string | null
- notify: boolean
- caseSensitive: boolean
- withReplies: boolean
- userGroupJoiningId: string | null
- users: Array
- instances: Array
- keywords: Array
- excludeKeywords: Array
-}
-export interface App {
- id: string
- createdAt: DateTimeWithTimeZone
- userId: string | null
- secret: string
- name: string
- description: string
- permission: Array
- callbackUrl: string | null
-}
-export interface AttestationChallenge {
- id: string
- userId: string
- challenge: string
- createdAt: DateTimeWithTimeZone
- registrationChallenge: boolean
-}
-export interface AuthSession {
- id: string
- createdAt: DateTimeWithTimeZone
- token: string
- userId: string | null
- appId: string
-}
-export interface Blocking {
- id: string
- createdAt: DateTimeWithTimeZone
- blockeeId: string
- blockerId: string
-}
-export interface Channel {
- id: string
- createdAt: DateTimeWithTimeZone
- lastNotedAt: DateTimeWithTimeZone | null
- userId: string | null
- name: string
- description: string | null
- bannerId: string | null
- notesCount: number
- usersCount: number
-}
-export interface ChannelFollowing {
- id: string
- createdAt: DateTimeWithTimeZone
- followeeId: string
- followerId: string
-}
-export interface ChannelNotePining {
- id: string
- createdAt: DateTimeWithTimeZone
- channelId: string
- noteId: string
-}
-export interface Clip {
- id: string
- createdAt: DateTimeWithTimeZone
- userId: string
- name: string
- isPublic: boolean
- description: string | null
-}
-export interface ClipNote {
- id: string
- noteId: string
- clipId: string
+
+export declare function decodeReaction(reaction: string): DecodedReaction
+
+export interface DeepLConfig {
+ managed?: boolean
+ authKey?: string
+ isPro?: boolean
}
+
export interface DriveFile {
id: string
createdAt: DateTimeWithTimeZone
@@ -666,6 +329,18 @@ export interface DriveFile {
requestIp: string | null
usageHint: DriveFileUsageHint | null
}
+
+export enum DriveFileEvent {
+ Create = 0,
+ Update = 1,
+ Delete = 2
+}
+
+export enum DriveFileUsageHint {
+ UserAvatar = 'userAvatar',
+ UserBanner = 'userBanner'
+}
+
export interface DriveFolder {
id: string
createdAt: DateTimeWithTimeZone
@@ -673,6 +348,23 @@ export interface DriveFolder {
userId: string | null
parentId: string | null
}
+
+export enum DriveFolderEvent {
+ Create = 0,
+ Update = 1,
+ Delete = 2
+}
+
+export interface EmailConfig {
+ managed?: boolean
+ address?: string
+ host?: string
+ port?: number
+ user?: string
+ pass?: string
+ useImplicitSslTls?: boolean
+}
+
export interface Emoji {
id: string
updatedAt: DateTimeWithTimeZone | null
@@ -688,6 +380,38 @@ export interface Emoji {
width: number | null
height: number | null
}
+
+export declare function extractHost(uri: string): string
+
+export declare function fetchMeta(): Promise
+
+/** Fetches and returns the NodeInfo (version 2.0) of a remote server. */
+export declare function fetchNodeinfo(host: string): Promise
+
+/**
+ * List of file types allowed to be viewed directly in the browser
+ *
+ * Anything not included here will be responded as application/octet-stream
+ * SVG is not allowed because it generates XSS (TODO: fix this and later allow it to be viewed directly)
+ * *
+ * *
+ * *
+ */
+export const FILE_TYPE_BROWSERSAFE: string[]
+
+export interface Following {
+ id: string
+ createdAt: DateTimeWithTimeZone
+ followeeId: string
+ followerId: string
+ followerHost: string | null
+ followerInbox: string | null
+ followerSharedInbox: string | null
+ followeeHost: string | null
+ followeeInbox: string | null
+ followeeSharedInbox: string | null
+}
+
export interface FollowRequest {
id: string
createdAt: DateTimeWithTimeZone
@@ -701,24 +425,19 @@ export interface FollowRequest {
followeeInbox: string | null
followeeSharedInbox: string | null
}
-export interface Following {
- id: string
- createdAt: DateTimeWithTimeZone
- followeeId: string
- followerId: string
- followerHost: string | null
- followerInbox: string | null
- followerSharedInbox: string | null
- followeeHost: string | null
- followeeInbox: string | null
- followeeSharedInbox: string | null
-}
+
+/** Converts milliseconds to a human readable string. */
+export declare function formatMilliseconds(milliseconds: number): string
+
+export declare function fromMastodonId(mastodonId: string): string | null
+
export interface GalleryLike {
id: string
createdAt: DateTimeWithTimeZone
userId: string
postId: string
}
+
export interface GalleryPost {
id: string
createdAt: DateTimeWithTimeZone
@@ -731,6 +450,39 @@ export interface GalleryPost {
likedCount: number
tags: Array
}
+
+/** Generates a random string based on [thread_rng] and [Alphanumeric]. */
+export declare function generateSecureRandomString(length: number): string
+
+export declare function generateUserToken(): string
+
+/**
+ * The generated ID results in the form of `[8 chars timestamp] + [cuid2]`.
+ * The minimum and maximum lengths are 16 and 24, respectively.
+ * With the length of 16, namely 8 for cuid2, roughly 1427399 IDs are needed
+ * in the same millisecond to reach 50% chance of collision.
+ *
+ * Ref:
+ */
+export declare function genId(): string
+
+/** Generate an ID using a specific datetime */
+export declare function genIdAt(date: Date): string
+
+export declare function getFullApAccount(username: string, host?: string | undefined | null): string
+
+export declare function getImageSizeFromUrl(url: string): Promise
+
+export declare function getNoteSummary(fileIds: Array, text: string | undefined | null, cw: string | undefined | null, hasPoll: boolean): string
+
+export declare function getTimestamp(id: string): number
+
+/** Prints the greeting message and the Firefish version to stdout. */
+export declare function greet(): void
+
+/** Hashes the given password using [argon2] algorithm. */
+export declare function hashPassword(password: string): string
+
export interface Hashtag {
id: string
name: string
@@ -747,6 +499,34 @@ export interface Hashtag {
attachedRemoteUserIds: Array
attachedRemoteUsersCount: number
}
+
+export const HOUR: number
+
+export interface IdConfig {
+ length?: number
+ fingerprint?: string
+}
+
+export interface ImageSize {
+ width: number
+ height: number
+}
+
+/** The third party sites this server can retrieve messages from for combined display with regular traffic. */
+export enum Inbound {
+ Atom1 = 0,
+ Gnusocial = 1,
+ Imap = 2,
+ Pnut = 3,
+ Pop3 = 4,
+ Pumpio = 5,
+ Rss2 = 6,
+ Twitter = 7
+}
+
+/** Initializes the [tracing] logger. */
+export declare function initializeRustLogger(): void
+
export interface Instance {
id: string
caughtAt: DateTimeWithTimeZone
@@ -773,6 +553,103 @@ export interface Instance {
themeColor: string | null
faviconUrl: string | null
}
+
+/**
+ * Checks if a server is allowlisted.
+ * Returns `Ok(true)` if private mode is disabled.
+ *
+ * # Argument
+ * `host` - punycoded instance host
+ *
+ * # Example
+ * ```no_run
+ * # use backend_rs::misc::check_server_block::is_allowed_server;
+ * # async fn f() -> Result<(), Box> {
+ * assert_eq!(true, is_allowed_server("allowed.com").await?);
+ * assert_eq!(false, is_allowed_server("not-allowed.com").await?);
+ * assert_eq!(false, is_allowed_server("subdomain.of.allowed.com").await?);
+ * assert_eq!(false, is_allowed_server("xn--l8jegik.allowed.com").await?);
+ * # Ok(())
+ * # }
+ * ```
+ */
+export declare function isAllowedServer(host: string): Promise
+
+/**
+ * Checks if a server is blocked.
+ *
+ * # Argument
+ * `host` - punycoded instance host
+ *
+ * # Example
+ * ```no_run
+ * # use backend_rs::misc::check_server_block::is_blocked_server;
+ * # async fn f() -> Result<(), Box> {
+ * assert_eq!(true, is_blocked_server("blocked.com").await?);
+ * assert_eq!(false, is_blocked_server("not-blocked.com").await?);
+ * assert_eq!(true, is_blocked_server("subdomain.of.blocked.com").await?);
+ * assert_eq!(true, is_blocked_server("xn--l8jegik.blocked.com").await?);
+ * # Ok(())
+ * # }
+ * ```
+ */
+export declare function isBlockedServer(host: string): Promise
+
+/** Returns whether the [bcrypt] algorithm is used for the password hash. */
+export declare function isOldPasswordAlgorithm(hash: string): boolean
+
+export declare function isQuote(note: NoteLikeForIsQuote): boolean
+
+export declare function isSafeUrl(url: string): boolean
+
+export declare function isSameOrigin(uri: string): boolean
+
+export declare function isSelfHost(host?: string | undefined | null): boolean
+
+/**
+ * Checks if a server is silenced.
+ *
+ * # Argument
+ * `host` - punycoded instance host
+ *
+ * # Example
+ * ```no_run
+ * # use backend_rs::misc::check_server_block::is_silenced_server;
+ * # async fn f() -> Result<(), Box> {
+ * assert_eq!(true, is_silenced_server("silenced.com").await?);
+ * assert_eq!(false, is_silenced_server("not-silenced.com").await?);
+ * assert_eq!(true, is_silenced_server("subdomain.of.silenced.com").await?);
+ * assert_eq!(true, is_silenced_server("xn--l8jegik.silenced.com").await?);
+ * # Ok(())
+ * # }
+ * ```
+ */
+export declare function isSilencedServer(host: string): Promise
+
+export declare function isUnicodeEmoji(s: string): boolean
+
+/** Returns the latest Firefish version. */
+export declare function latestVersion(): Promise
+
+export interface LibreTranslateConfig {
+ managed?: boolean
+ apiUrl?: string
+ apiKey?: string
+}
+
+export declare function loadConfig(): Config
+
+export interface Memory {
+ /** Total memory amount in bytes */
+ total: number
+ /** Used memory amount in bytes */
+ used: number
+ /** Available (for (re)use) memory amount in bytes */
+ available: number
+}
+
+export declare function memoryUsage(): Memory
+
export interface MessagingMessage {
id: string
createdAt: DateTimeWithTimeZone
@@ -785,6 +662,7 @@ export interface MessagingMessage {
reads: Array
uri: string | null
}
+
export interface Meta {
id: string
name: string | null
@@ -872,11 +750,17 @@ export interface Meta {
markLocalFilesNsfwByDefault: boolean
antennaLimit: number
}
+
+export declare function metaToPugArgs(meta: Meta): PugArgs
+
export interface Migrations {
id: number
timestamp: number
name: string
}
+
+export const MINUTE: number
+
export interface ModerationLog {
id: string
createdAt: DateTimeWithTimeZone
@@ -884,12 +768,21 @@ export interface ModerationLog {
type: string
info: Json
}
+
export interface MutedNote {
id: string
noteId: string
userId: string
reason: MutedNoteReason
}
+
+export enum MutedNoteReason {
+ Manual = 'manual',
+ Other = 'other',
+ Spam = 'spam',
+ Word = 'word'
+}
+
export interface Muting {
id: string
createdAt: DateTimeWithTimeZone
@@ -897,6 +790,27 @@ export interface Muting {
muterId: string
expiresAt: DateTimeWithTimeZone | null
}
+
+/** NodeInfo schema version 2.0. */
+export interface Nodeinfo {
+ /** Metadata about server software in use. */
+ software: Software20
+ /** The protocols supported on this server. */
+ protocols: Array
+ /** The third party sites this server can connect to via their application API. */
+ services: Services
+ /** Whether this server allows open self-registration. */
+ openRegistrations: boolean
+ /** Usage statistics for this server. */
+ usage: Usage
+ /** Free form key value pairs for software specific values. Clients should not rely on any specific key present. */
+ metadata: Record
+}
+
+export declare function nodeinfo_2_0(): Promise
+
+export declare function nodeinfo_2_1(): Promise
+
export interface Note {
id: string
createdAt: DateTimeWithTimeZone
@@ -931,7 +845,9 @@ export interface Note {
threadId: string | null
updatedAt: DateTimeWithTimeZone | null
lang: string | null
+ scheduledAt: DateTimeWithTimeZone | null
}
+
export interface NoteEdit {
id: string
noteId: string
@@ -941,17 +857,27 @@ export interface NoteEdit {
updatedAt: DateTimeWithTimeZone
emojis: Array
}
+
export interface NoteFavorite {
id: string
createdAt: DateTimeWithTimeZone
userId: string
noteId: string
}
+
export interface NoteFile {
serialNo: number
noteId: string
fileId: string
}
+
+export interface NoteLikeForIsQuote {
+ renoteId: string | null
+ text: string | null
+ hasPoll: boolean
+ fileIds: Array
+}
+
export interface NoteReaction {
id: string
createdAt: DateTimeWithTimeZone
@@ -959,12 +885,14 @@ export interface NoteReaction {
noteId: string
reaction: string
}
+
export interface NoteThreadMuting {
id: string
createdAt: DateTimeWithTimeZone
userId: string
threadId: string
}
+
export interface NoteUnread {
id: string
userId: string
@@ -974,6 +902,15 @@ export interface NoteUnread {
isMentioned: boolean
noteChannelId: string | null
}
+
+export enum NoteVisibility {
+ Followers = 'followers',
+ Hidden = 'hidden',
+ Home = 'home',
+ Public = 'public',
+ Specified = 'specified'
+}
+
export interface NoteWatching {
id: string
createdAt: DateTimeWithTimeZone
@@ -981,6 +918,7 @@ export interface NoteWatching {
noteId: string
noteUserId: string
}
+
export interface Notification {
id: string
createdAt: DateTimeWithTimeZone
@@ -998,6 +936,102 @@ export interface Notification {
customIcon: string | null
appAccessTokenId: string | null
}
+
+export enum NotificationType {
+ App = 'app',
+ Follow = 'follow',
+ FollowRequestAccepted = 'followRequestAccepted',
+ GroupInvited = 'groupInvited',
+ Mention = 'mention',
+ PollEnded = 'pollEnded',
+ PollVote = 'pollVote',
+ Quote = 'quote',
+ Reaction = 'reaction',
+ ReceiveFollowRequest = 'receiveFollowRequest',
+ Renote = 'renote',
+ Reply = 'reply'
+}
+
+/**
+ * Converts the given text into the cat language.
+ *
+ * refs:
+ * *
+ * *
+ *
+ * # Arguments
+ *
+ * * `text` : original text
+ * * `lang` : language code (e.g., `Some("en")`, `Some("en-US")`, `Some("uk-UA")`, `None`)
+ *
+ * # Example
+ *
+ * ```
+ * # use backend_rs::misc::nyaify::nyaify;
+ * assert_eq!(nyaify("I'll take a nap.", Some("en")), "I'll take a nyap.");
+ * ```
+ */
+export declare function nyaify(text: string, lang?: string | undefined | null): string
+
+export interface ObjectStorageConfig {
+ managed?: boolean
+ baseUrl?: string
+ bucket?: string
+ prefix?: string
+ endpoint?: string
+ region?: string
+ accessKey?: string
+ secretKey?: string
+ useSsl?: boolean
+ connnectOverProxy?: boolean
+ setPublicReadOnUpload?: boolean
+ s3ForcePathStyle?: boolean
+}
+
+/** The third party sites this server can publish messages to on the behalf of a user. */
+export enum Outbound {
+ Atom1 = 0,
+ Blogger = 1,
+ Buddycloud = 2,
+ Diaspora = 3,
+ Dreamwidth = 4,
+ Drupal = 5,
+ Facebook = 6,
+ Friendica = 7,
+ Gnusocial = 8,
+ Google = 9,
+ Insanejournal = 10,
+ Libertree = 11,
+ Linkedin = 12,
+ Livejournal = 13,
+ Mediagoblin = 14,
+ Myspace = 15,
+ Pinterest = 16,
+ Pnut = 17,
+ Posterous = 18,
+ Pumpio = 19,
+ Redmatrix = 20,
+ Rss2 = 21,
+ Smtp = 22,
+ Tent = 23,
+ Tumblr = 24,
+ Twitter = 25,
+ Wordpress = 26,
+ Xmpp = 27
+}
+
+export interface PackedEmoji {
+ id: string
+ aliases: Array
+ name: string
+ category: string | null
+ host: string | null
+ url: string
+ license: string | null
+ width: number | null
+ height: number | null
+}
+
export interface Page {
id: string
createdAt: DateTimeWithTimeZone
@@ -1018,18 +1052,35 @@ export interface Page {
script: string
isPublic: boolean
}
+
export interface PageLike {
id: string
createdAt: DateTimeWithTimeZone
userId: string
pageId: string
}
+
+export enum PageVisibility {
+ Followers = 'followers',
+ Public = 'public',
+ Specified = 'specified'
+}
+
+export interface PartialNoteToCheckWordMute {
+ fileIds: Array
+ text: string | null
+ cw: string | null
+ renoteId: string | null
+ replyId: string | null
+}
+
export interface PasswordResetRequest {
id: string
createdAt: DateTimeWithTimeZone
token: string
userId: string
}
+
export interface Poll {
noteId: string
expiresAt: DateTimeWithTimeZone | null
@@ -1040,6 +1091,14 @@ export interface Poll {
userId: string
userHost: string | null
}
+
+export enum PollNoteVisibility {
+ Followers = 'followers',
+ Home = 'home',
+ Public = 'public',
+ Specified = 'specified'
+}
+
export interface PollVote {
id: string
createdAt: DateTimeWithTimeZone
@@ -1047,22 +1106,90 @@ export interface PollVote {
noteId: string
choice: number
}
+
export interface PromoNote {
noteId: string
expiresAt: DateTimeWithTimeZone
userId: string
}
+
export interface PromoRead {
id: string
createdAt: DateTimeWithTimeZone
userId: string
noteId: string
}
+
+export enum Protocol {
+ Activitypub = 0,
+ Buddycloud = 1,
+ Dfrn = 2,
+ Diaspora = 3,
+ Libertree = 4,
+ Ostatus = 5,
+ Pumpio = 6,
+ Tent = 7,
+ Xmpp = 8,
+ Zot = 9
+}
+
+export declare function publishToBroadcastStream(emoji: PackedEmoji): Promise
+
+export declare function publishToChannelStream(channelId: string, userId: string): Promise
+
+export declare function publishToChatIndexStream(userId: string, kind: ChatIndexEvent, object: any): Promise
+
+export declare function publishToChatStream(senderUserId: string, receiverUserId: string, kind: ChatEvent, object: any): Promise
+
+export declare function publishToDriveFileStream(userId: string, kind: DriveFileEvent, object: any): Promise
+
+export declare function publishToDriveFolderStream(userId: string, kind: DriveFolderEvent, object: any): Promise
+
+export declare function publishToGroupChatStream(groupId: string, kind: ChatEvent, object: any): Promise
+
+export declare function publishToModerationStream(moderatorId: string, report: AbuseUserReportLike): Promise
+
+export declare function publishToNotesStream(note: Note): Promise
+
+export interface PugArgs {
+ img: string | null
+ title: string
+ instanceName: string
+ desc: string | null
+ icon: string | null
+ splashIcon: string | null
+ themeColor: string | null
+ randomMotd: string
+ privateMode: boolean | null
+}
+
+export enum PushNotificationKind {
+ Generic = 0,
+ Chat = 1,
+ ReadAllChats = 2,
+ ReadAllChatsInTheRoom = 3,
+ ReadNotifications = 4,
+ ReadAllNotifications = 5,
+ Mastodon = 6
+}
+
+export interface RedisConfig {
+ host: string
+ port: number
+ family?: number
+ user?: string
+ pass?: string
+ tls?: TlsConfig
+ db: number
+ prefix?: string
+}
+
export interface RegistrationTicket {
id: string
createdAt: DateTimeWithTimeZone
code: string
}
+
export interface RegistryItem {
id: string
createdAt: DateTimeWithTimeZone
@@ -1073,109 +1200,104 @@ export interface RegistryItem {
domain: string | null
value: Json | null
}
+
export interface Relay {
id: string
inbox: string
status: RelayStatus
}
+
+export enum RelayStatus {
+ Accepted = 'accepted',
+ Rejected = 'rejected',
+ Requesting = 'requesting'
+}
+
+/** Delete all entries in the [attestation_challenge] table created at more than 5 minutes ago */
+export declare function removeOldAttestationChallenges(): Promise
+
export interface RenoteMuting {
id: string
createdAt: DateTimeWithTimeZone
muteeId: string
muterId: string
}
+
export interface ReplyMuting {
id: string
createdAt: DateTimeWithTimeZone
muteeId: string
muterId: string
}
-export interface ScheduledNote {
- id: string
- noteId: string
- userId: string
- scheduledAt: DateTimeWithTimeZone
+
+/** Returns `true` if `src` does not contain suspicious characters like `%`. */
+export declare function safeForSql(src: string): boolean
+
+export const SECOND: number
+
+export declare function sendPushNotification(receiverUserId: string, kind: PushNotificationKind, content: any): Promise
+
+export interface ServerConfig {
+ url: string
+ port: number
+ /** the host address to bind to */
+ bind?: string
+ disableHsts?: boolean
+ /** PostgreSQL configurations */
+ db: DbConfig
+ /** Redis configurations */
+ redis: RedisConfig
+ /** secondary Redis server configurations */
+ cacheServer?: RedisConfig
+ /** proxy host used for HTTP requests */
+ proxy?: string
+ /** proxy host used for SMTP requests */
+ proxySmtp?: string
+ /** hosts to bypass the proxy */
+ proxyBypassHosts?: Array
+ allowedPrivateNetworks?: Array
+ /** maximum file size that can be uploaded to the drive (in bytes) */
+ maxFileSize?: number
+ accessLog?: string
+ clusterLimits?: WorkerConfigInternal
+ cuid?: IdConfig
+ outgoingAddress?: string
+ deliverJobConcurrency?: number
+ inboxJobConcurrency?: number
+ deliverJobPerSec?: number
+ inboxJobPerSec?: number
+ deliverJobMaxAttempts?: number
+ inboxJobMaxAttempts?: number
+ /** deprecated in favor of `max_log_level` */
+ logLevel?: Array
+ /** verbosity of the server log. `error`, `warn`, `info`, `debug`, or `trace` */
+ maxLogLevel?: string
+ syslog?: SysLogConfig
+ proxyRemoteFiles?: boolean
+ mediaProxy?: string
+ summalyProxyUrl?: string
+ reservedUsernames?: Array
+ maxUserSignups?: number
+ isManagedHosting?: boolean
+ maxNoteLength?: number
+ maxCaptionLength?: number
+ deepl?: DeepLConfig
+ libreTranslate?: LibreTranslateConfig
+ email?: EmailConfig
+ objectStorage?: ObjectStorageConfig
}
-export enum AntennaSrc {
- All = 'all',
- Group = 'group',
- Home = 'home',
- Instances = 'instances',
- List = 'list',
- Users = 'users'
-}
-export enum DriveFileUsageHint {
- UserAvatar = 'userAvatar',
- UserBanner = 'userBanner'
-}
-export enum MutedNoteReason {
- Manual = 'manual',
- Other = 'other',
- Spam = 'spam',
- Word = 'word'
-}
-export enum NoteVisibility {
- Followers = 'followers',
- Hidden = 'hidden',
- Home = 'home',
- Public = 'public',
- Specified = 'specified'
-}
-export enum NotificationType {
- App = 'app',
- Follow = 'follow',
- FollowRequestAccepted = 'followRequestAccepted',
- GroupInvited = 'groupInvited',
- Mention = 'mention',
- PollEnded = 'pollEnded',
- PollVote = 'pollVote',
- Quote = 'quote',
- Reaction = 'reaction',
- ReceiveFollowRequest = 'receiveFollowRequest',
- Renote = 'renote',
- Reply = 'reply'
-}
-export enum PageVisibility {
- Followers = 'followers',
- Public = 'public',
- Specified = 'specified'
-}
-export enum PollNoteVisibility {
- Followers = 'followers',
- Home = 'home',
- Public = 'public',
- Specified = 'specified'
-}
-export enum RelayStatus {
- Accepted = 'accepted',
- Rejected = 'rejected',
- Requesting = 'requesting'
-}
-export enum UserEmojiModPerm {
- Add = 'add',
- Full = 'full',
- Mod = 'mod',
- Unauthorized = 'unauthorized'
-}
-export enum UserProfileFfvisibility {
- Followers = 'followers',
- Private = 'private',
- Public = 'public'
-}
-export enum UserProfileMutingNotificationTypes {
- App = 'app',
- Follow = 'follow',
- FollowRequestAccepted = 'followRequestAccepted',
- GroupInvited = 'groupInvited',
- Mention = 'mention',
- PollEnded = 'pollEnded',
- PollVote = 'pollVote',
- Quote = 'quote',
- Reaction = 'reaction',
- ReceiveFollowRequest = 'receiveFollowRequest',
- Renote = 'renote',
- Reply = 'reply'
+
+/** The third party sites this server can connect to via their application API. */
+export interface Services {
+ /** The third party sites this server can retrieve messages from for combined display with regular traffic. */
+ inbound: Array
+ /** The third party sites this server can publish messages to on the behalf of a user. */
+ outbound: Array
}
+
+/** Prints the server hardware information as the server info log. */
+export declare function showServerInfo(): void
+
export interface Signin {
id: string
createdAt: DateTimeWithTimeZone
@@ -1184,6 +1306,29 @@ export interface Signin {
headers: Json
success: boolean
}
+
+/** Metadata about server software in use (version 2.0). */
+export interface Software20 {
+ /** The canonical name of this server software. */
+ name: string
+ /** The version of this server software. */
+ version: string
+}
+
+/** Escapes `%` and `\` in the given string. */
+export declare function sqlLikeEscape(src: string): string
+
+export interface Storage {
+ /** Total storage space in bytes */
+ total: number
+ /** Used storage space in bytes */
+ used: number
+}
+
+export declare function storageUsage(): Storage | null
+
+export declare function stringToAcct(acct: string): Acct
+
export interface SwSubscription {
id: string
createdAt: DateTimeWithTimeZone
@@ -1193,10 +1338,45 @@ export interface SwSubscription {
publickey: string
sendReadMessage: boolean
}
+
+export interface SysLogConfig {
+ host: string
+ port: number
+}
+
+export interface TlsConfig {
+ host: string
+ rejectUnauthorized: boolean
+}
+
+export declare function toDbReaction(reaction?: string | undefined | null, host?: string | undefined | null): Promise
+
+export declare function toMastodonId(firefishId: string): string | null
+
+export declare function toPuny(host: string): string
+
+export declare function unwatchNote(watcherId: string, noteId: string): Promise
+
+export declare function updateAntennaCache(): Promise
+
+export declare function updateAntennasOnNewNote(note: Note, noteAuthor: Acct, noteMutedUsers: Array): Promise
+
+export declare function updateMetaCache(): Promise
+
+export declare function updateNodeinfoCache(): Promise
+
+/** Usage statistics for this server. */
+export interface Usage {
+ users: Users
+ localPosts: number | null
+ localComments: number | null
+}
+
export interface UsedUsername {
username: string
createdAt: DateTimeWithTimeZone
}
+
export interface User {
id: string
createdAt: DateTimeWithTimeZone
@@ -1237,6 +1417,18 @@ export interface User {
isIndexable: boolean
alsoKnownAs: Array | null
}
+
+export const USER_ACTIVE_THRESHOLD: number
+
+export const USER_ONLINE_THRESHOLD: number
+
+export enum UserEmojiModPerm {
+ Add = 'add',
+ Full = 'full',
+ Mod = 'mod',
+ Unauthorized = 'unauthorized'
+}
+
export interface UserGroup {
id: string
createdAt: DateTimeWithTimeZone
@@ -1244,53 +1436,62 @@ export interface UserGroup {
userId: string
isPrivate: boolean
}
+
export interface UserGroupInvitation {
id: string
createdAt: DateTimeWithTimeZone
userId: string
userGroupId: string
}
+
export interface UserGroupInvite {
id: string
createdAt: DateTimeWithTimeZone
userId: string
userGroupId: string
}
+
export interface UserGroupJoining {
id: string
createdAt: DateTimeWithTimeZone
userId: string
userGroupId: string
}
+
export interface UserIp {
id: number
createdAt: DateTimeWithTimeZone
userId: string
ip: string
}
+
export interface UserKeypair {
userId: string
publicKey: string
privateKey: string
}
+
export interface UserList {
id: string
createdAt: DateTimeWithTimeZone
userId: string
name: string
}
+
export interface UserListJoining {
id: string
createdAt: DateTimeWithTimeZone
userId: string
userListId: string
}
+
export interface UserNotePining {
id: string
createdAt: DateTimeWithTimeZone
userId: string
noteId: string
}
+
export interface UserPending {
id: string
createdAt: DateTimeWithTimeZone
@@ -1299,6 +1500,7 @@ export interface UserPending {
email: string
password: string
}
+
export interface UserProfile {
userId: string
location: string | null
@@ -1336,11 +1538,41 @@ export interface UserProfile {
mutedWords: Array
lang: string | null
}
+
+export enum UserProfileFfvisibility {
+ Followers = 'followers',
+ Private = 'private',
+ Public = 'public'
+}
+
+export enum UserProfileMutingNotificationTypes {
+ App = 'app',
+ Follow = 'follow',
+ FollowRequestAccepted = 'followRequestAccepted',
+ GroupInvited = 'groupInvited',
+ Mention = 'mention',
+ PollEnded = 'pollEnded',
+ PollVote = 'pollVote',
+ Quote = 'quote',
+ Reaction = 'reaction',
+ ReceiveFollowRequest = 'receiveFollowRequest',
+ Renote = 'renote',
+ Reply = 'reply'
+}
+
export interface UserPublickey {
userId: string
keyId: string
keyPem: string
}
+
+/** statistics about the users of this server. */
+export interface Users {
+ total: number | null
+ activeHalfyear: number | null
+ activeMonth: number | null
+}
+
export interface UserSecurityKey {
id: string
userId: string
@@ -1348,6 +1580,12 @@ export interface UserSecurityKey {
lastUsed: DateTimeWithTimeZone
name: string
}
+
+/** Checks whether the given password and hash match. */
+export declare function verifyPassword(password: string, hash: string): boolean
+
+export declare function watchNote(watcherId: string, noteAuthorId: string, noteId: string): Promise
+
export interface Webhook {
id: string
createdAt: DateTimeWithTimeZone
@@ -1360,64 +1598,14 @@ export interface Webhook {
latestSentAt: DateTimeWithTimeZone | null
latestStatus: number | null
}
-export function updateAntennasOnNewNote(note: Note, noteAuthor: Acct, noteMutedUsers: Array): Promise
-export function watchNote(watcherId: string, noteAuthorId: string, noteId: string): Promise
-export function unwatchNote(watcherId: string, noteId: string): Promise
-export enum PushNotificationKind {
- Generic = 'generic',
- Chat = 'chat',
- ReadAllChats = 'readAllChats',
- ReadAllChatsInTheRoom = 'readAllChatsInTheRoom',
- ReadNotifications = 'readNotifications',
- ReadAllNotifications = 'readAllNotifications',
- Mastodon = 'mastodon'
+
+export interface WorkerConfig {
+ web: number
+ queue: number
}
-export function sendPushNotification(receiverUserId: string, kind: PushNotificationKind, content: any): Promise
-export function publishToChannelStream(channelId: string, userId: string): Promise
-export enum ChatEvent {
- Message = 'message',
- Read = 'read',
- Deleted = 'deleted',
- Typing = 'typing'
+
+export interface WorkerConfigInternal {
+ web?: number
+ queue?: number
}
-export function publishToChatStream(senderUserId: string, receiverUserId: string, kind: ChatEvent, object: any): Promise
-export enum ChatIndexEvent {
- Message = 'message',
- Read = 'read'
-}
-export function publishToChatIndexStream(userId: string, kind: ChatIndexEvent, object: any): Promise
-export interface PackedEmoji {
- id: string
- aliases: Array
- name: string
- category: string | null
- host: string | null
- url: string
- license: string | null
- width: number | null
- height: number | null
-}
-export function publishToBroadcastStream(emoji: PackedEmoji): Promise
-export function publishToGroupChatStream(groupId: string, kind: ChatEvent, object: any): Promise
-export interface AbuseUserReportLike {
- id: string
- targetUserId: string
- reporterId: string
- comment: string
-}
-export function publishToModerationStream(moderatorId: string, report: AbuseUserReportLike): Promise
-export function getTimestamp(id: string): number
-/**
- * The generated ID results in the form of `[8 chars timestamp] + [cuid2]`.
- * The minimum and maximum lengths are 16 and 24, respectively.
- * With the length of 16, namely 8 for cuid2, roughly 1427399 IDs are needed
- * in the same millisecond to reach 50% chance of collision.
- *
- * Ref:
- */
-export function genId(): string
-/** Generate an ID using a specific datetime */
-export function genIdAt(date: Date): string
-/** Generates a random string based on [thread_rng] and [Alphanumeric]. */
-export function generateSecureRandomString(length: number): string
-export function generateUserToken(): string
+
diff --git a/packages/backend-rs/index.js b/packages/backend-rs/index.js
index 1da5b752d7..9cb1779766 100644
--- a/packages/backend-rs/index.js
+++ b/packages/backend-rs/index.js
@@ -1,397 +1,453 @@
-/* tslint:disable */
+// prettier-ignore
/* eslint-disable */
-/* prettier-ignore */
-
/* auto-generated by NAPI-RS */
-const { existsSync, readFileSync } = require('fs')
-const { join } = require('path')
-
-const { platform, arch } = process
+const { readFileSync } = require('fs')
let nativeBinding = null
-let localFileExisted = false
-let loadError = null
+const loadErrors = []
-function isMusl() {
- // For Node 10
- if (!process.report || typeof process.report.getReport !== 'function') {
- try {
- const lddPath = require('child_process').execSync('which ldd').toString().trim()
- return readFileSync(lddPath, 'utf8').includes('musl')
- } catch (e) {
- return true
+const isMusl = () => {
+ let musl = false
+ if (process.platform === 'linux') {
+ musl = isMuslFromFilesystem()
+ if (musl === null) {
+ musl = isMuslFromReport()
}
- } else {
- const { glibcVersionRuntime } = process.report.getReport().header
- return !glibcVersionRuntime
+ if (musl === null) {
+ musl = isMuslFromChildProcess()
+ }
+ }
+ return musl
+}
+
+const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
+
+const isMuslFromFilesystem = () => {
+ try {
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
+ } catch {
+ return null
}
}
-switch (platform) {
- case 'android':
- switch (arch) {
- case 'arm64':
- localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm64.node'))
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.android-arm64.node')
- } else {
- nativeBinding = require('backend-rs-android-arm64')
- }
- } catch (e) {
- loadError = e
- }
- break
- case 'arm':
- localFileExisted = existsSync(join(__dirname, 'backend-rs.android-arm-eabi.node'))
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.android-arm-eabi.node')
- } else {
- nativeBinding = require('backend-rs-android-arm-eabi')
- }
- } catch (e) {
- loadError = e
- }
- break
- default:
- throw new Error(`Unsupported architecture on Android ${arch}`)
+const isMuslFromReport = () => {
+ const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
+ if (!report) {
+ return null
+ }
+ if (report.header && report.header.glibcVersionRuntime) {
+ return false
+ }
+ if (Array.isArray(report.sharedObjects)) {
+ if (report.sharedObjects.some(isFileMusl)) {
+ return true
}
- break
- case 'win32':
- switch (arch) {
- case 'x64':
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.win32-x64-msvc.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.win32-x64-msvc.node')
- } else {
- nativeBinding = require('backend-rs-win32-x64-msvc')
- }
- } catch (e) {
- loadError = e
- }
- break
- case 'ia32':
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.win32-ia32-msvc.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.win32-ia32-msvc.node')
- } else {
- nativeBinding = require('backend-rs-win32-ia32-msvc')
- }
- } catch (e) {
- loadError = e
- }
- break
- case 'arm64':
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.win32-arm64-msvc.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.win32-arm64-msvc.node')
- } else {
- nativeBinding = require('backend-rs-win32-arm64-msvc')
- }
- } catch (e) {
- loadError = e
- }
- break
- default:
- throw new Error(`Unsupported architecture on Windows: ${arch}`)
- }
- break
- case 'darwin':
- localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-universal.node'))
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.darwin-universal.node')
- } else {
- nativeBinding = require('backend-rs-darwin-universal')
+ }
+ return false
+}
+
+const isMuslFromChildProcess = () => {
+ try {
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
+ } catch (e) {
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
+ return false
+ }
+}
+
+function requireNative() {
+ if (process.platform === 'android') {
+ if (process.arch === 'arm64') {
+ try {
+ return require('./backend-rs.android-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
}
- break
- } catch {}
- switch (arch) {
- case 'x64':
- localFileExisted = existsSync(join(__dirname, 'backend-rs.darwin-x64.node'))
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.darwin-x64.node')
- } else {
- nativeBinding = require('backend-rs-darwin-x64')
- }
- } catch (e) {
- loadError = e
- }
- break
- case 'arm64':
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.darwin-arm64.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.darwin-arm64.node')
- } else {
- nativeBinding = require('backend-rs-darwin-arm64')
- }
- } catch (e) {
- loadError = e
- }
- break
- default:
- throw new Error(`Unsupported architecture on macOS: ${arch}`)
- }
- break
- case 'freebsd':
- if (arch !== 'x64') {
- throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
- }
- localFileExisted = existsSync(join(__dirname, 'backend-rs.freebsd-x64.node'))
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.freebsd-x64.node')
- } else {
- nativeBinding = require('backend-rs-freebsd-x64')
+ try {
+ return require('backend-rs-android-arm64')
+ } catch (e) {
+ loadErrors.push(e)
}
- } catch (e) {
- loadError = e
+
+ } else if (process.arch === 'arm') {
+ try {
+ return require('./backend-rs.android-arm-eabi.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-android-arm-eabi')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
}
- break
- case 'linux':
- switch (arch) {
- case 'x64':
- if (isMusl()) {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-x64-musl.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-x64-musl.node')
- } else {
- nativeBinding = require('backend-rs-linux-x64-musl')
- }
- } catch (e) {
- loadError = e
- }
- } else {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-x64-gnu.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-x64-gnu.node')
- } else {
- nativeBinding = require('backend-rs-linux-x64-gnu')
- }
- } catch (e) {
- loadError = e
- }
- }
- break
- case 'arm64':
- if (isMusl()) {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-arm64-musl.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-arm64-musl.node')
- } else {
- nativeBinding = require('backend-rs-linux-arm64-musl')
- }
- } catch (e) {
- loadError = e
- }
- } else {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-arm64-gnu.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-arm64-gnu.node')
- } else {
- nativeBinding = require('backend-rs-linux-arm64-gnu')
- }
- } catch (e) {
- loadError = e
- }
- }
- break
- case 'arm':
- if (isMusl()) {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-arm-musleabihf.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-arm-musleabihf.node')
- } else {
- nativeBinding = require('backend-rs-linux-arm-musleabihf')
- }
- } catch (e) {
- loadError = e
- }
- } else {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-arm-gnueabihf.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-arm-gnueabihf.node')
- } else {
- nativeBinding = require('backend-rs-linux-arm-gnueabihf')
- }
- } catch (e) {
- loadError = e
- }
- }
- break
- case 'riscv64':
- if (isMusl()) {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-riscv64-musl.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-riscv64-musl.node')
- } else {
- nativeBinding = require('backend-rs-linux-riscv64-musl')
- }
- } catch (e) {
- loadError = e
- }
- } else {
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-riscv64-gnu.node')
- )
- try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-riscv64-gnu.node')
- } else {
- nativeBinding = require('backend-rs-linux-riscv64-gnu')
- }
- } catch (e) {
- loadError = e
- }
- }
- break
- case 's390x':
- localFileExisted = existsSync(
- join(__dirname, 'backend-rs.linux-s390x-gnu.node')
- )
+ } else if (process.platform === 'win32') {
+ if (process.arch === 'x64') {
+ try {
+ return require('./backend-rs.win32-x64-msvc.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-win32-x64-msvc')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else if (process.arch === 'ia32') {
+ try {
+ return require('./backend-rs.win32-ia32-msvc.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-win32-ia32-msvc')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else if (process.arch === 'arm64') {
+ try {
+ return require('./backend-rs.win32-arm64-msvc.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-win32-arm64-msvc')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
+ }
+ } else if (process.platform === 'darwin') {
+ try {
+ return require('./backend-rs.darwin-universal.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-darwin-universal')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ if (process.arch === 'x64') {
+ try {
+ return require('./backend-rs.darwin-x64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-darwin-x64')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else if (process.arch === 'arm64') {
+ try {
+ return require('./backend-rs.darwin-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-darwin-arm64')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
+ }
+ } else if (process.platform === 'freebsd') {
+ if (process.arch === 'x64') {
+ try {
+ return require('./backend-rs.freebsd-x64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-freebsd-x64')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else if (process.arch === 'arm64') {
+ try {
+ return require('./backend-rs.freebsd-arm64.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-freebsd-arm64')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
+ }
+ } else if (process.platform === 'linux') {
+ if (process.arch === 'x64') {
+ if (isMusl()) {
try {
- if (localFileExisted) {
- nativeBinding = require('./backend-rs.linux-s390x-gnu.node')
- } else {
- nativeBinding = require('backend-rs-linux-s390x-gnu')
- }
- } catch (e) {
- loadError = e
- }
- break
- default:
- throw new Error(`Unsupported architecture on Linux: ${arch}`)
+ return require('./backend-rs.linux-x64-musl.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-x64-musl')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ try {
+ return require('./backend-rs.linux-x64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-x64-gnu')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ }
+ } else if (process.arch === 'arm64') {
+ if (isMusl()) {
+ try {
+ return require('./backend-rs.linux-arm64-musl.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-arm64-musl')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ try {
+ return require('./backend-rs.linux-arm64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-arm64-gnu')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ }
+ } else if (process.arch === 'arm') {
+ if (isMusl()) {
+ try {
+ return require('./backend-rs.linux-arm-musleabihf.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-arm-musleabihf')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ try {
+ return require('./backend-rs.linux-arm-gnueabihf.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-arm-gnueabihf')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ }
+ } else if (process.arch === 'riscv64') {
+ if (isMusl()) {
+ try {
+ return require('./backend-rs.linux-riscv64-musl.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-riscv64-musl')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ try {
+ return require('./backend-rs.linux-riscv64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-riscv64-gnu')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ }
+ } else if (process.arch === 'ppc64') {
+ try {
+ return require('./backend-rs.linux-ppc64-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-ppc64-gnu')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else if (process.arch === 's390x') {
+ try {
+ return require('./backend-rs.linux-s390x-gnu.node')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+ try {
+ return require('backend-rs-linux-s390x-gnu')
+ } catch (e) {
+ loadErrors.push(e)
+ }
+
+ } else {
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
}
- break
- default:
- throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
+ } else {
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
+ }
+}
+
+nativeBinding = requireNative()
+
+if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
+ try {
+ nativeBinding = require('./backend-rs.wasi.cjs')
+ } catch (err) {
+ if (process.env.NAPI_RS_FORCE_WASI) {
+ console.error(err)
+ }
+ }
+ if (!nativeBinding) {
+ try {
+ nativeBinding = require('backend-rs-wasm32-wasi')
+ } catch (err) {
+ if (process.env.NAPI_RS_FORCE_WASI) {
+ console.error(err)
+ }
+ }
+ }
}
if (!nativeBinding) {
- if (loadError) {
- throw loadError
+ if (loadErrors.length > 0) {
+ // TODO Link to documentation with potential fixes
+ // - The package owner could build/publish bindings for this arch
+ // - The user may need to bundle the correct files
+ // - The user may need to re-install node_modules to get new packages
+ throw new Error('Failed to load native binding', { cause: loadErrors })
}
throw new Error(`Failed to load native binding`)
}
-const { SECOND, MINUTE, HOUR, DAY, USER_ONLINE_THRESHOLD, USER_ACTIVE_THRESHOLD, FILE_TYPE_BROWSERSAFE, loadEnv, loadConfig, stringToAcct, acctToString, fetchNodeinfo, nodeinfo_2_1, nodeinfo_2_0, Protocol, Inbound, Outbound, greet, initializeRustLogger, showServerInfo, isBlockedServer, isSilencedServer, isAllowedServer, checkWordMute, getFullApAccount, isSelfHost, isSameOrigin, extractHost, toPuny, isUnicodeEmoji, sqlLikeEscape, safeForSql, formatMilliseconds, getImageSizeFromUrl, getNoteSummary, isQuote, isSafeUrl, latestVersion, toMastodonId, fromMastodonId, fetchMeta, metaToPugArgs, nyaify, hashPassword, verifyPassword, isOldPasswordAlgorithm, decodeReaction, countReactions, toDbReaction, removeOldAttestationChallenges, cpuInfo, cpuUsage, memoryUsage, storageUsage, AntennaSrc, DriveFileUsageHint, MutedNoteReason, NoteVisibility, NotificationType, PageVisibility, PollNoteVisibility, RelayStatus, UserEmojiModPerm, UserProfileFfvisibility, UserProfileMutingNotificationTypes, updateAntennasOnNewNote, watchNote, unwatchNote, PushNotificationKind, sendPushNotification, publishToChannelStream, ChatEvent, publishToChatStream, ChatIndexEvent, publishToChatIndexStream, publishToBroadcastStream, publishToGroupChatStream, publishToModerationStream, getTimestamp, genId, genIdAt, generateSecureRandomString, generateUserToken } = nativeBinding
-
-module.exports.SECOND = SECOND
-module.exports.MINUTE = MINUTE
-module.exports.HOUR = HOUR
-module.exports.DAY = DAY
-module.exports.USER_ONLINE_THRESHOLD = USER_ONLINE_THRESHOLD
-module.exports.USER_ACTIVE_THRESHOLD = USER_ACTIVE_THRESHOLD
-module.exports.FILE_TYPE_BROWSERSAFE = FILE_TYPE_BROWSERSAFE
-module.exports.loadEnv = loadEnv
-module.exports.loadConfig = loadConfig
-module.exports.stringToAcct = stringToAcct
-module.exports.acctToString = acctToString
-module.exports.fetchNodeinfo = fetchNodeinfo
-module.exports.nodeinfo_2_1 = nodeinfo_2_1
-module.exports.nodeinfo_2_0 = nodeinfo_2_0
-module.exports.Protocol = Protocol
-module.exports.Inbound = Inbound
-module.exports.Outbound = Outbound
-module.exports.greet = greet
-module.exports.initializeRustLogger = initializeRustLogger
-module.exports.showServerInfo = showServerInfo
-module.exports.isBlockedServer = isBlockedServer
-module.exports.isSilencedServer = isSilencedServer
-module.exports.isAllowedServer = isAllowedServer
-module.exports.checkWordMute = checkWordMute
-module.exports.getFullApAccount = getFullApAccount
-module.exports.isSelfHost = isSelfHost
-module.exports.isSameOrigin = isSameOrigin
-module.exports.extractHost = extractHost
-module.exports.toPuny = toPuny
-module.exports.isUnicodeEmoji = isUnicodeEmoji
-module.exports.sqlLikeEscape = sqlLikeEscape
-module.exports.safeForSql = safeForSql
-module.exports.formatMilliseconds = formatMilliseconds
-module.exports.getImageSizeFromUrl = getImageSizeFromUrl
-module.exports.getNoteSummary = getNoteSummary
-module.exports.isQuote = isQuote
-module.exports.isSafeUrl = isSafeUrl
-module.exports.latestVersion = latestVersion
-module.exports.toMastodonId = toMastodonId
-module.exports.fromMastodonId = fromMastodonId
-module.exports.fetchMeta = fetchMeta
-module.exports.metaToPugArgs = metaToPugArgs
-module.exports.nyaify = nyaify
-module.exports.hashPassword = hashPassword
-module.exports.verifyPassword = verifyPassword
-module.exports.isOldPasswordAlgorithm = isOldPasswordAlgorithm
-module.exports.decodeReaction = decodeReaction
-module.exports.countReactions = countReactions
-module.exports.toDbReaction = toDbReaction
-module.exports.removeOldAttestationChallenges = removeOldAttestationChallenges
-module.exports.cpuInfo = cpuInfo
-module.exports.cpuUsage = cpuUsage
-module.exports.memoryUsage = memoryUsage
-module.exports.storageUsage = storageUsage
-module.exports.AntennaSrc = AntennaSrc
-module.exports.DriveFileUsageHint = DriveFileUsageHint
-module.exports.MutedNoteReason = MutedNoteReason
-module.exports.NoteVisibility = NoteVisibility
-module.exports.NotificationType = NotificationType
-module.exports.PageVisibility = PageVisibility
-module.exports.PollNoteVisibility = PollNoteVisibility
-module.exports.RelayStatus = RelayStatus
-module.exports.UserEmojiModPerm = UserEmojiModPerm
-module.exports.UserProfileFfvisibility = UserProfileFfvisibility
-module.exports.UserProfileMutingNotificationTypes = UserProfileMutingNotificationTypes
-module.exports.updateAntennasOnNewNote = updateAntennasOnNewNote
-module.exports.watchNote = watchNote
-module.exports.unwatchNote = unwatchNote
-module.exports.PushNotificationKind = PushNotificationKind
-module.exports.sendPushNotification = sendPushNotification
-module.exports.publishToChannelStream = publishToChannelStream
-module.exports.ChatEvent = ChatEvent
-module.exports.publishToChatStream = publishToChatStream
-module.exports.ChatIndexEvent = ChatIndexEvent
-module.exports.publishToChatIndexStream = publishToChatIndexStream
-module.exports.publishToBroadcastStream = publishToBroadcastStream
-module.exports.publishToGroupChatStream = publishToGroupChatStream
-module.exports.publishToModerationStream = publishToModerationStream
-module.exports.getTimestamp = getTimestamp
-module.exports.genId = genId
-module.exports.genIdAt = genIdAt
-module.exports.generateSecureRandomString = generateSecureRandomString
-module.exports.generateUserToken = generateUserToken
+module.exports.acctToString = nativeBinding.acctToString
+module.exports.AntennaSrc = nativeBinding.AntennaSrc
+module.exports.ChatEvent = nativeBinding.ChatEvent
+module.exports.ChatIndexEvent = nativeBinding.ChatIndexEvent
+module.exports.checkWordMute = nativeBinding.checkWordMute
+module.exports.countReactions = nativeBinding.countReactions
+module.exports.cpuInfo = nativeBinding.cpuInfo
+module.exports.cpuUsage = nativeBinding.cpuUsage
+module.exports.DAY = nativeBinding.DAY
+module.exports.decodeReaction = nativeBinding.decodeReaction
+module.exports.DriveFileEvent = nativeBinding.DriveFileEvent
+module.exports.DriveFileUsageHint = nativeBinding.DriveFileUsageHint
+module.exports.DriveFolderEvent = nativeBinding.DriveFolderEvent
+module.exports.extractHost = nativeBinding.extractHost
+module.exports.fetchMeta = nativeBinding.fetchMeta
+module.exports.fetchNodeinfo = nativeBinding.fetchNodeinfo
+module.exports.FILE_TYPE_BROWSERSAFE = nativeBinding.FILE_TYPE_BROWSERSAFE
+module.exports.formatMilliseconds = nativeBinding.formatMilliseconds
+module.exports.fromMastodonId = nativeBinding.fromMastodonId
+module.exports.generateSecureRandomString = nativeBinding.generateSecureRandomString
+module.exports.generateUserToken = nativeBinding.generateUserToken
+module.exports.genId = nativeBinding.genId
+module.exports.genIdAt = nativeBinding.genIdAt
+module.exports.getFullApAccount = nativeBinding.getFullApAccount
+module.exports.getImageSizeFromUrl = nativeBinding.getImageSizeFromUrl
+module.exports.getNoteSummary = nativeBinding.getNoteSummary
+module.exports.getTimestamp = nativeBinding.getTimestamp
+module.exports.greet = nativeBinding.greet
+module.exports.hashPassword = nativeBinding.hashPassword
+module.exports.HOUR = nativeBinding.HOUR
+module.exports.Inbound = nativeBinding.Inbound
+module.exports.initializeRustLogger = nativeBinding.initializeRustLogger
+module.exports.isAllowedServer = nativeBinding.isAllowedServer
+module.exports.isBlockedServer = nativeBinding.isBlockedServer
+module.exports.isOldPasswordAlgorithm = nativeBinding.isOldPasswordAlgorithm
+module.exports.isQuote = nativeBinding.isQuote
+module.exports.isSafeUrl = nativeBinding.isSafeUrl
+module.exports.isSameOrigin = nativeBinding.isSameOrigin
+module.exports.isSelfHost = nativeBinding.isSelfHost
+module.exports.isSilencedServer = nativeBinding.isSilencedServer
+module.exports.isUnicodeEmoji = nativeBinding.isUnicodeEmoji
+module.exports.latestVersion = nativeBinding.latestVersion
+module.exports.loadConfig = nativeBinding.loadConfig
+module.exports.memoryUsage = nativeBinding.memoryUsage
+module.exports.metaToPugArgs = nativeBinding.metaToPugArgs
+module.exports.MINUTE = nativeBinding.MINUTE
+module.exports.MutedNoteReason = nativeBinding.MutedNoteReason
+module.exports.nodeinfo_2_0 = nativeBinding.nodeinfo_2_0
+module.exports.nodeinfo_2_1 = nativeBinding.nodeinfo_2_1
+module.exports.NoteVisibility = nativeBinding.NoteVisibility
+module.exports.NotificationType = nativeBinding.NotificationType
+module.exports.nyaify = nativeBinding.nyaify
+module.exports.Outbound = nativeBinding.Outbound
+module.exports.PageVisibility = nativeBinding.PageVisibility
+module.exports.PollNoteVisibility = nativeBinding.PollNoteVisibility
+module.exports.Protocol = nativeBinding.Protocol
+module.exports.publishToBroadcastStream = nativeBinding.publishToBroadcastStream
+module.exports.publishToChannelStream = nativeBinding.publishToChannelStream
+module.exports.publishToChatIndexStream = nativeBinding.publishToChatIndexStream
+module.exports.publishToChatStream = nativeBinding.publishToChatStream
+module.exports.publishToDriveFileStream = nativeBinding.publishToDriveFileStream
+module.exports.publishToDriveFolderStream = nativeBinding.publishToDriveFolderStream
+module.exports.publishToGroupChatStream = nativeBinding.publishToGroupChatStream
+module.exports.publishToModerationStream = nativeBinding.publishToModerationStream
+module.exports.publishToNotesStream = nativeBinding.publishToNotesStream
+module.exports.PushNotificationKind = nativeBinding.PushNotificationKind
+module.exports.RelayStatus = nativeBinding.RelayStatus
+module.exports.removeOldAttestationChallenges = nativeBinding.removeOldAttestationChallenges
+module.exports.safeForSql = nativeBinding.safeForSql
+module.exports.SECOND = nativeBinding.SECOND
+module.exports.sendPushNotification = nativeBinding.sendPushNotification
+module.exports.showServerInfo = nativeBinding.showServerInfo
+module.exports.sqlLikeEscape = nativeBinding.sqlLikeEscape
+module.exports.storageUsage = nativeBinding.storageUsage
+module.exports.stringToAcct = nativeBinding.stringToAcct
+module.exports.toDbReaction = nativeBinding.toDbReaction
+module.exports.toMastodonId = nativeBinding.toMastodonId
+module.exports.toPuny = nativeBinding.toPuny
+module.exports.unwatchNote = nativeBinding.unwatchNote
+module.exports.updateAntennaCache = nativeBinding.updateAntennaCache
+module.exports.updateAntennasOnNewNote = nativeBinding.updateAntennasOnNewNote
+module.exports.updateMetaCache = nativeBinding.updateMetaCache
+module.exports.updateNodeinfoCache = nativeBinding.updateNodeinfoCache
+module.exports.USER_ACTIVE_THRESHOLD = nativeBinding.USER_ACTIVE_THRESHOLD
+module.exports.USER_ONLINE_THRESHOLD = nativeBinding.USER_ONLINE_THRESHOLD
+module.exports.UserEmojiModPerm = nativeBinding.UserEmojiModPerm
+module.exports.UserProfileFfvisibility = nativeBinding.UserProfileFfvisibility
+module.exports.UserProfileMutingNotificationTypes = nativeBinding.UserProfileMutingNotificationTypes
+module.exports.verifyPassword = nativeBinding.verifyPassword
+module.exports.watchNote = nativeBinding.watchNote
diff --git a/packages/backend-rs/npm/android-arm-eabi/README.md b/packages/backend-rs/npm/android-arm-eabi/README.md
deleted file mode 100644
index 26e84675de..0000000000
--- a/packages/backend-rs/npm/android-arm-eabi/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-android-arm-eabi`
-
-This is the **armv7-linux-androideabi** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/android-arm-eabi/package.json b/packages/backend-rs/npm/android-arm-eabi/package.json
deleted file mode 100644
index ca06ebf7f3..0000000000
--- a/packages/backend-rs/npm/android-arm-eabi/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-android-arm-eabi",
- "version": "0.0.0",
- "os": [
- "android"
- ],
- "cpu": [
- "arm"
- ],
- "main": "backend-rs.android-arm-eabi.node",
- "files": [
- "backend-rs.android-arm-eabi.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/android-arm64/README.md b/packages/backend-rs/npm/android-arm64/README.md
deleted file mode 100644
index f18da53ca3..0000000000
--- a/packages/backend-rs/npm/android-arm64/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-android-arm64`
-
-This is the **aarch64-linux-android** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/android-arm64/package.json b/packages/backend-rs/npm/android-arm64/package.json
deleted file mode 100644
index b37c2f5b7c..0000000000
--- a/packages/backend-rs/npm/android-arm64/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-android-arm64",
- "version": "0.0.0",
- "os": [
- "android"
- ],
- "cpu": [
- "arm64"
- ],
- "main": "backend-rs.android-arm64.node",
- "files": [
- "backend-rs.android-arm64.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/darwin-arm64/README.md b/packages/backend-rs/npm/darwin-arm64/README.md
deleted file mode 100644
index 4c2bb5f7de..0000000000
--- a/packages/backend-rs/npm/darwin-arm64/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-darwin-arm64`
-
-This is the **aarch64-apple-darwin** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/darwin-arm64/package.json b/packages/backend-rs/npm/darwin-arm64/package.json
deleted file mode 100644
index 2ed7ccd061..0000000000
--- a/packages/backend-rs/npm/darwin-arm64/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-darwin-arm64",
- "version": "0.0.0",
- "os": [
- "darwin"
- ],
- "cpu": [
- "arm64"
- ],
- "main": "backend-rs.darwin-arm64.node",
- "files": [
- "backend-rs.darwin-arm64.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/darwin-universal/README.md b/packages/backend-rs/npm/darwin-universal/README.md
deleted file mode 100644
index fe9e88d1e4..0000000000
--- a/packages/backend-rs/npm/darwin-universal/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-darwin-universal`
-
-This is the **universal-apple-darwin** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/darwin-universal/package.json b/packages/backend-rs/npm/darwin-universal/package.json
deleted file mode 100644
index 125f60807a..0000000000
--- a/packages/backend-rs/npm/darwin-universal/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "backend-rs-darwin-universal",
- "version": "0.0.0",
- "os": [
- "darwin"
- ],
- "main": "backend-rs.darwin-universal.node",
- "files": [
- "backend-rs.darwin-universal.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/darwin-x64/README.md b/packages/backend-rs/npm/darwin-x64/README.md
deleted file mode 100644
index e7cb3c7341..0000000000
--- a/packages/backend-rs/npm/darwin-x64/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-darwin-x64`
-
-This is the **x86_64-apple-darwin** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/darwin-x64/package.json b/packages/backend-rs/npm/darwin-x64/package.json
deleted file mode 100644
index 6a90d0628e..0000000000
--- a/packages/backend-rs/npm/darwin-x64/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-darwin-x64",
- "version": "0.0.0",
- "os": [
- "darwin"
- ],
- "cpu": [
- "x64"
- ],
- "main": "backend-rs.darwin-x64.node",
- "files": [
- "backend-rs.darwin-x64.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/freebsd-x64/README.md b/packages/backend-rs/npm/freebsd-x64/README.md
deleted file mode 100644
index df06915dff..0000000000
--- a/packages/backend-rs/npm/freebsd-x64/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-freebsd-x64`
-
-This is the **x86_64-unknown-freebsd** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/freebsd-x64/package.json b/packages/backend-rs/npm/freebsd-x64/package.json
deleted file mode 100644
index 2ba1244845..0000000000
--- a/packages/backend-rs/npm/freebsd-x64/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-freebsd-x64",
- "version": "0.0.0",
- "os": [
- "freebsd"
- ],
- "cpu": [
- "x64"
- ],
- "main": "backend-rs.freebsd-x64.node",
- "files": [
- "backend-rs.freebsd-x64.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/linux-arm-gnueabihf/README.md b/packages/backend-rs/npm/linux-arm-gnueabihf/README.md
deleted file mode 100644
index fc4132cd0e..0000000000
--- a/packages/backend-rs/npm/linux-arm-gnueabihf/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-linux-arm-gnueabihf`
-
-This is the **armv7-unknown-linux-gnueabihf** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/linux-arm-gnueabihf/package.json b/packages/backend-rs/npm/linux-arm-gnueabihf/package.json
deleted file mode 100644
index 6e878bc516..0000000000
--- a/packages/backend-rs/npm/linux-arm-gnueabihf/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-linux-arm-gnueabihf",
- "version": "0.0.0",
- "os": [
- "linux"
- ],
- "cpu": [
- "arm"
- ],
- "main": "backend-rs.linux-arm-gnueabihf.node",
- "files": [
- "backend-rs.linux-arm-gnueabihf.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/linux-arm64-gnu/README.md b/packages/backend-rs/npm/linux-arm64-gnu/README.md
deleted file mode 100644
index 9126a63170..0000000000
--- a/packages/backend-rs/npm/linux-arm64-gnu/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-linux-arm64-gnu`
-
-This is the **aarch64-unknown-linux-gnu** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/linux-arm64-gnu/package.json b/packages/backend-rs/npm/linux-arm64-gnu/package.json
deleted file mode 100644
index 27b87ae1d4..0000000000
--- a/packages/backend-rs/npm/linux-arm64-gnu/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "backend-rs-linux-arm64-gnu",
- "version": "0.0.0",
- "os": [
- "linux"
- ],
- "cpu": [
- "arm64"
- ],
- "main": "backend-rs.linux-arm64-gnu.node",
- "files": [
- "backend-rs.linux-arm64-gnu.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- },
- "libc": [
- "glibc"
- ]
-}
diff --git a/packages/backend-rs/npm/linux-arm64-musl/README.md b/packages/backend-rs/npm/linux-arm64-musl/README.md
deleted file mode 100644
index 970d094e46..0000000000
--- a/packages/backend-rs/npm/linux-arm64-musl/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-linux-arm64-musl`
-
-This is the **aarch64-unknown-linux-musl** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/linux-arm64-musl/package.json b/packages/backend-rs/npm/linux-arm64-musl/package.json
deleted file mode 100644
index 49f83fb046..0000000000
--- a/packages/backend-rs/npm/linux-arm64-musl/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "backend-rs-linux-arm64-musl",
- "version": "0.0.0",
- "os": [
- "linux"
- ],
- "cpu": [
- "arm64"
- ],
- "main": "backend-rs.linux-arm64-musl.node",
- "files": [
- "backend-rs.linux-arm64-musl.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- },
- "libc": [
- "musl"
- ]
-}
diff --git a/packages/backend-rs/npm/linux-x64-gnu/README.md b/packages/backend-rs/npm/linux-x64-gnu/README.md
deleted file mode 100644
index 6a947c5e7f..0000000000
--- a/packages/backend-rs/npm/linux-x64-gnu/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-linux-x64-gnu`
-
-This is the **x86_64-unknown-linux-gnu** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/linux-x64-gnu/package.json b/packages/backend-rs/npm/linux-x64-gnu/package.json
deleted file mode 100644
index 7ba56d5212..0000000000
--- a/packages/backend-rs/npm/linux-x64-gnu/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "backend-rs-linux-x64-gnu",
- "version": "0.0.0",
- "os": [
- "linux"
- ],
- "cpu": [
- "x64"
- ],
- "main": "backend-rs.linux-x64-gnu.node",
- "files": [
- "backend-rs.linux-x64-gnu.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- },
- "libc": [
- "glibc"
- ]
-}
diff --git a/packages/backend-rs/npm/linux-x64-musl/README.md b/packages/backend-rs/npm/linux-x64-musl/README.md
deleted file mode 100644
index 4344d648ae..0000000000
--- a/packages/backend-rs/npm/linux-x64-musl/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-linux-x64-musl`
-
-This is the **x86_64-unknown-linux-musl** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/linux-x64-musl/package.json b/packages/backend-rs/npm/linux-x64-musl/package.json
deleted file mode 100644
index fcfa783c83..0000000000
--- a/packages/backend-rs/npm/linux-x64-musl/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "backend-rs-linux-x64-musl",
- "version": "0.0.0",
- "os": [
- "linux"
- ],
- "cpu": [
- "x64"
- ],
- "main": "backend-rs.linux-x64-musl.node",
- "files": [
- "backend-rs.linux-x64-musl.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- },
- "libc": [
- "musl"
- ]
-}
diff --git a/packages/backend-rs/npm/win32-arm64-msvc/README.md b/packages/backend-rs/npm/win32-arm64-msvc/README.md
deleted file mode 100644
index a89398e514..0000000000
--- a/packages/backend-rs/npm/win32-arm64-msvc/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-win32-arm64-msvc`
-
-This is the **aarch64-pc-windows-msvc** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/win32-arm64-msvc/package.json b/packages/backend-rs/npm/win32-arm64-msvc/package.json
deleted file mode 100644
index 1783c23b00..0000000000
--- a/packages/backend-rs/npm/win32-arm64-msvc/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-win32-arm64-msvc",
- "version": "0.0.0",
- "os": [
- "win32"
- ],
- "cpu": [
- "arm64"
- ],
- "main": "backend-rs.win32-arm64-msvc.node",
- "files": [
- "backend-rs.win32-arm64-msvc.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/win32-ia32-msvc/README.md b/packages/backend-rs/npm/win32-ia32-msvc/README.md
deleted file mode 100644
index 43335cfad0..0000000000
--- a/packages/backend-rs/npm/win32-ia32-msvc/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-win32-ia32-msvc`
-
-This is the **i686-pc-windows-msvc** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/win32-ia32-msvc/package.json b/packages/backend-rs/npm/win32-ia32-msvc/package.json
deleted file mode 100644
index 854de42b14..0000000000
--- a/packages/backend-rs/npm/win32-ia32-msvc/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-win32-ia32-msvc",
- "version": "0.0.0",
- "os": [
- "win32"
- ],
- "cpu": [
- "ia32"
- ],
- "main": "backend-rs.win32-ia32-msvc.node",
- "files": [
- "backend-rs.win32-ia32-msvc.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/npm/win32-x64-msvc/README.md b/packages/backend-rs/npm/win32-x64-msvc/README.md
deleted file mode 100644
index c881bdd12d..0000000000
--- a/packages/backend-rs/npm/win32-x64-msvc/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# `backend-rs-win32-x64-msvc`
-
-This is the **x86_64-pc-windows-msvc** binary for `backend-rs`
diff --git a/packages/backend-rs/npm/win32-x64-msvc/package.json b/packages/backend-rs/npm/win32-x64-msvc/package.json
deleted file mode 100644
index eb01ab78ef..0000000000
--- a/packages/backend-rs/npm/win32-x64-msvc/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "backend-rs-win32-x64-msvc",
- "version": "0.0.0",
- "os": [
- "win32"
- ],
- "cpu": [
- "x64"
- ],
- "main": "backend-rs.win32-x64-msvc.node",
- "files": [
- "backend-rs.win32-x64-msvc.node"
- ],
- "license": "MIT",
- "engines": {
- "node": ">= 10"
- }
-}
diff --git a/packages/backend-rs/package.json b/packages/backend-rs/package.json
index 4923f269b3..7b5ad60703 100644
--- a/packages/backend-rs/package.json
+++ b/packages/backend-rs/package.json
@@ -4,32 +4,13 @@
"main": "built/index.js",
"types": "built/index.d.ts",
"napi": {
- "name": "backend-rs",
- "triples": {
- "additional": [
- "aarch64-apple-darwin",
- "aarch64-linux-android",
- "aarch64-unknown-linux-gnu",
- "aarch64-unknown-linux-musl",
- "aarch64-pc-windows-msvc",
- "armv7-unknown-linux-gnueabihf",
- "x86_64-unknown-linux-musl",
- "x86_64-unknown-freebsd",
- "i686-pc-windows-msvc",
- "armv7-linux-androideabi",
- "universal-apple-darwin"
- ]
- }
+ "binaryName": "backend-rs"
},
"devDependencies": {
- "@napi-rs/cli": "2.18.3"
+ "@napi-rs/cli": "3.0.0-alpha.55"
},
"scripts": {
- "artifacts": "napi artifacts",
- "build": "napi build --features napi --no-const-enum --platform --release ./built/",
- "build:debug": "napi build --features napi --no-const-enum --platform ./built/",
- "prepublishOnly": "napi prepublish -t npm",
- "universal": "napi universal",
- "version": "napi version"
+ "build": "napi build --features napi --no-const-enum --platform --release --output-dir ./built/",
+ "build:debug": "napi build --features napi --no-const-enum --platform --output-dir ./built/ --dts-header '/* auto-generated by NAPI-RS */\n/* Do NOT edit this file manually */\n\ntype DateTimeWithTimeZone = Date;\n\ntype Json = any;\n\n'"
}
}
diff --git a/packages/backend-rs/src/config/constant.rs b/packages/backend-rs/src/config/constant.rs
index db6e7bed00..7e6b50fa52 100644
--- a/packages/backend-rs/src/config/constant.rs
+++ b/packages/backend-rs/src/config/constant.rs
@@ -1,15 +1,17 @@
-#[crate::ts_export]
+//! This module is used in the TypeScript backend only.
+
+#[macros::ts_export]
pub const SECOND: i32 = 1000;
-#[crate::ts_export]
+#[macros::ts_export]
pub const MINUTE: i32 = 60 * SECOND;
-#[crate::ts_export]
+#[macros::ts_export]
pub const HOUR: i32 = 60 * MINUTE;
-#[crate::ts_export]
+#[macros::ts_export]
pub const DAY: i32 = 24 * HOUR;
-#[crate::ts_export]
+#[macros::ts_export]
pub const USER_ONLINE_THRESHOLD: i32 = 10 * MINUTE;
-#[crate::ts_export]
+#[macros::ts_export]
pub const USER_ACTIVE_THRESHOLD: i32 = 3 * DAY;
/// List of file types allowed to be viewed directly in the browser
@@ -19,7 +21,7 @@ pub const USER_ACTIVE_THRESHOLD: i32 = 3 * DAY;
/// *
/// *
/// *
-#[crate::ts_export]
+#[macros::ts_export]
pub const FILE_TYPE_BROWSERSAFE: [&str; 41] = [
// Images
"image/png",
diff --git a/packages/backend-rs/src/config/environment.rs b/packages/backend-rs/src/config/environment.rs
deleted file mode 100644
index 1825af326a..0000000000
--- a/packages/backend-rs/src/config/environment.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// FIXME: Are these options used?
-#[crate::export(object)]
-pub struct EnvConfig {
- pub only_queue: bool,
- pub only_server: bool,
- pub no_daemons: bool,
- pub disable_clustering: bool,
- pub verbose: bool,
- pub with_log_time: bool,
- pub slow: bool,
-}
-
-#[crate::export]
-pub fn load_env() -> EnvConfig {
- let node_env = std::env::var("NODE_ENV").unwrap_or_default().to_lowercase();
- let is_testing = node_env == "test";
-
- EnvConfig {
- only_queue: std::env::var("MK_ONLY_QUEUE").is_ok(),
- only_server: std::env::var("MK_ONLY_SERVER").is_ok(),
- no_daemons: is_testing || std::env::var("MK_NO_DAEMONS").is_ok(),
- disable_clustering: is_testing || std::env::var("MK_DISABLE_CLUSTERING").is_ok(),
- verbose: std::env::var("MK_VERBOSE").is_ok(),
- with_log_time: std::env::var("MK_WITH_LOG_TIME").is_ok(),
- slow: std::env::var("MK_SLOW").is_ok(),
- }
-}
diff --git a/packages/backend-rs/src/misc/meta.rs b/packages/backend-rs/src/config/meta.rs
similarity index 76%
rename from packages/backend-rs/src/misc/meta.rs
rename to packages/backend-rs/src/config/meta.rs
index 5aed617038..969d9d35f5 100644
--- a/packages/backend-rs/src/misc/meta.rs
+++ b/packages/backend-rs/src/config/meta.rs
@@ -1,18 +1,28 @@
-use crate::database::db_conn;
-use crate::model::entity::meta;
-use rand::prelude::*;
+//! Server information
+
+use crate::{database::db_conn, model::entity::meta};
use sea_orm::{prelude::*, ActiveValue};
use std::sync::Mutex;
type Meta = meta::Model;
static CACHE: Mutex