diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a11e3f6..9b44ed3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: - id: setup_env run: ./ci/testenv/setup.sh env: - MISSKEY_IMAGE: 'misskey/misskey:12.108.1' + MISSKEY_IMAGE: 'misskey/misskey:12.109.2' MISSKEY_ID: aid - - run: cargo test --features 12-108-0 + - run: cargo test --features 12-109-0 timeout-minutes: 15 env: TEST_API_URL: http://localhost:3000/api/ diff --git a/.github/workflows/flaky.yml b/.github/workflows/flaky.yml index 33ffcd02..4eaab742 100644 --- a/.github/workflows/flaky.yml +++ b/.github/workflows/flaky.yml @@ -12,6 +12,8 @@ jobs: strategy: matrix: include: + - image: 'misskey/misskey:12.109.2' + flags: --features 12-109-0 - image: 'misskey/misskey:12.108.1' flags: --features 12-108-0 - image: 'misskey/misskey:12.107.0' diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index f809d20e..129d72e9 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -28,9 +28,9 @@ jobs: - id: setup_env run: ./ci/testenv/setup.sh env: - MISSKEY_IMAGE: 'misskey/misskey:12.108.1' + MISSKEY_IMAGE: 'misskey/misskey:12.109.2' MISSKEY_ID: aid - - run: cargo test --features 12-108-0 + - run: cargo test --features 12-109-0 timeout-minutes: 15 env: TEST_API_URL: http://localhost:3000/api/ diff --git a/misskey-api/CHANGELOG.md b/misskey-api/CHANGELOG.md index 300db77b..a11f5c64 100644 --- a/misskey-api/CHANGELOG.md +++ b/misskey-api/CHANGELOG.md @@ -66,6 +66,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for Misskey v12.106.0 ~ v12.106.3 - Support for Misskey v12.107.0 - Support for Misskey v12.108.0 ~ v12.108.1 +- Support for Misskey v12.109.0 ~ v12.110.1 + - endpoint `admin/meta` ### Changed ### Deprecated @@ -87,7 +89,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - endpoint `stats` - For Misskey v12.106.0 ~ v12.106.3 - endpoint `email-address/available` - - For Misskey v12.108.0 + - For Misskey v12.108.0 ~ v12.108.1 ### Fixed diff --git a/misskey-api/Cargo.toml b/misskey-api/Cargo.toml index 1b4d49fc..f491bae5 100644 --- a/misskey-api/Cargo.toml +++ b/misskey-api/Cargo.toml @@ -15,6 +15,7 @@ categories = ["api-bindings"] [features] default = ["aid"] +12-109-0 = ["12-108-0"] 12-108-0 = ["12-107-0"] 12-107-0 = ["12-106-0"] 12-106-0 = ["12-105-0"] diff --git a/misskey-api/src/endpoint/admin.rs b/misskey-api/src/endpoint/admin.rs index 9050ef7c..ee9b76fb 100644 --- a/misskey-api/src/endpoint/admin.rs +++ b/misskey-api/src/endpoint/admin.rs @@ -48,3 +48,7 @@ pub mod logs; #[cfg(not(feature = "12-106-0"))] #[cfg_attr(docsrs, doc(cfg(not(feature = "12-106-0"))))] pub mod resync_chart; + +#[cfg(feature = "12-109-0")] +#[cfg_attr(docsrs, doc(cfg(feature = "12-109-0")))] +pub mod meta; diff --git a/misskey-api/src/endpoint/admin/meta.rs b/misskey-api/src/endpoint/admin/meta.rs new file mode 100644 index 00000000..5eb4503f --- /dev/null +++ b/misskey-api/src/endpoint/admin/meta.rs @@ -0,0 +1,24 @@ +use crate::model::meta::Meta; + +use serde::Serialize; + +#[derive(Serialize, Default, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Request {} + +impl misskey_core::Request for Request { + type Response = Meta; + const ENDPOINT: &'static str = "admin/meta"; +} + +#[cfg(test)] +mod tests { + use super::Request; + use crate::test::{ClientExt, TestClient}; + + #[tokio::test] + async fn request() { + let client = TestClient::new(); + client.admin.test(Request::default()).await; + } +} diff --git a/misskey-api/src/endpoint/email_address.rs b/misskey-api/src/endpoint/email_address.rs index 85d19262..6b0e5c98 100644 --- a/misskey-api/src/endpoint/email_address.rs +++ b/misskey-api/src/endpoint/email_address.rs @@ -1,3 +1,3 @@ // misskey-dev/misskey#8404 -#[cfg(not(feature = "12-108-0"))] +#[cfg(any(not(feature = "12-108-0"), feature = "12-109-0"))] pub mod available; diff --git a/misskey-api/src/endpoint/meta.rs b/misskey-api/src/endpoint/meta.rs index d0070029..18a045de 100644 --- a/misskey-api/src/endpoint/meta.rs +++ b/misskey-api/src/endpoint/meta.rs @@ -25,6 +25,7 @@ mod tests { client.test(Request::default()).await; } + #[cfg(not(feature = "12-109-0"))] #[tokio::test] async fn request_by_admin() { let client = TestClient::new(); diff --git a/misskey-api/src/model/meta.rs b/misskey-api/src/model/meta.rs index d7000e5f..4be7d1e0 100644 --- a/misskey-api/src/model/meta.rs +++ b/misskey-api/src/model/meta.rs @@ -66,9 +66,11 @@ pub struct Meta { pub error_image_url: Option, pub icon_url: Option, pub max_note_text_length: u64, + #[serde(default)] pub emojis: Vec, #[cfg(feature = "12-81-0")] #[cfg_attr(docsrs, doc(cfg(feature = "12-81-0")))] + #[serde(default)] pub ads: Vec, /// This field is [`bool`] (i.e. not [`Option`]) on non-feature="12-58-0". #[cfg(feature = "12-58-0")] diff --git a/misskey-util/Cargo.toml b/misskey-util/Cargo.toml index 2d33209d..5d2ce4fa 100644 --- a/misskey-util/Cargo.toml +++ b/misskey-util/Cargo.toml @@ -14,6 +14,7 @@ keywords = ["async", "client", "misskey"] [features] default = ["aid"] +12-109-0 = ["misskey-api/12-109-0", "12-108-0"] 12-108-0 = ["misskey-api/12-108-0", "12-107-0"] 12-107-0 = ["misskey-api/12-107-0", "12-106-0"] 12-106-0 = ["misskey-api/12-106-0", "12-105-0"] diff --git a/misskey-util/src/client.rs b/misskey-util/src/client.rs index fd266f10..0ca11ca0 100644 --- a/misskey-util/src/client.rs +++ b/misskey-util/src/client.rs @@ -4258,6 +4258,22 @@ pub trait ClientExt: Client + Sync { let pager = BackwardPager::new(self, endpoint::admin::ad::list::Request::default()); PagerStream::new(Box::pin(pager)) } + + /// Gets detailed information about the instance. + /// + /// This operation may require moderator privileges. + #[cfg(feature = "12-109-0")] + #[cfg_attr(docsrs, doc(cfg(feature = "12-109-0")))] + fn admin_meta(&self) -> BoxFuture>> { + Box::pin(async move { + let meta = self + .request(endpoint::admin::meta::Request::default()) + .await + .map_err(Error::Client)? + .into_result()?; + Ok(meta) + }) + } // }}} // {{{ Miscellaneous diff --git a/misskey/Cargo.toml b/misskey/Cargo.toml index d64cd966..e8079e85 100644 --- a/misskey/Cargo.toml +++ b/misskey/Cargo.toml @@ -15,6 +15,7 @@ categories = ["api-bindings", "web-programming::http-client", "web-programming:: [features] default = ["http-client", "websocket-client", "tokio-runtime", "aid"] +12-109-0 = ["misskey-api/12-109-0", "misskey-util/12-109-0"] 12-108-0 = ["misskey-api/12-108-0", "misskey-util/12-108-0"] 12-107-0 = ["misskey-api/12-107-0", "misskey-util/12-107-0"] 12-106-0 = ["misskey-api/12-106-0", "misskey-util/12-106-0"] diff --git a/misskey/src/lib.rs b/misskey/src/lib.rs index 3062820b..0d3dc167 100644 --- a/misskey/src/lib.rs +++ b/misskey/src/lib.rs @@ -102,6 +102,7 @@ //! //! | Feature | Supported Misskey versions (inclusive) | Tested Misskey version | //! | -------------------------- | -------------------------------------- | ---------------------- | +//! | `12-109-0` | v12.109.0 ~ v12.110.1 | v12.109.2 | //! | `12-108-0` | v12.108.0 ~ v12.108.1 | v12.108.1 | //! | `12-107-0` | v12.107.0 | v12.107.0 | //! | `12-106-0` | v12.106.0 ~ v12.106.3 | v12.106.0 |