Skip to content

Commit

Permalink
Add: Support v12.109.0
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Jun 7, 2023
1 parent 65f5c0e commit bd55498
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/flaky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 3 additions & 1 deletion misskey-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions misskey-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 4 additions & 0 deletions misskey-api/src/endpoint/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
24 changes: 24 additions & 0 deletions misskey-api/src/endpoint/admin/meta.rs
Original file line number Diff line number Diff line change
@@ -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;
}
}
2 changes: 1 addition & 1 deletion misskey-api/src/endpoint/email_address.rs
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions misskey-api/src/endpoint/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions misskey-api/src/model/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ pub struct Meta {
pub error_image_url: Option<String>,
pub icon_url: Option<String>,
pub max_note_text_length: u64,
#[serde(default)]
pub emojis: Vec<Emoji>,
#[cfg(feature = "12-81-0")]
#[cfg_attr(docsrs, doc(cfg(feature = "12-81-0")))]
#[serde(default)]
pub ads: Vec<Ad>,
/// This field is [`bool`] (i.e. not [`Option`]) on <span class="module-item stab portability" style="display: inline-block; font-size: 80%;"><strong>non-<code style="background-color: transparent;">feature="12-58-0"</code></strong></span>.
#[cfg(feature = "12-58-0")]
Expand Down
1 change: 1 addition & 0 deletions misskey-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
16 changes: 16 additions & 0 deletions misskey-util/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Result<Meta, Error<Self::Error>>> {
Box::pin(async move {
let meta = self
.request(endpoint::admin::meta::Request::default())
.await
.map_err(Error::Client)?
.into_result()?;
Ok(meta)
})
}
// }}}

// {{{ Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions misskey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 1 addition & 0 deletions misskey/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit bd55498

Please sign in to comment.