Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
30d80a0
Refactor: Use builder in test
poppingmoon Apr 17, 2023
f298bc0
Add: Support v12.77.0
poppingmoon Apr 17, 2023
799d8d5
Add: Support v12.77.1
poppingmoon Apr 9, 2023
0c05d5d
Add: Add gallery related endpoints
poppingmoon Apr 10, 2023
bf3dc2e
Add: Support v12.79.0
poppingmoon Apr 11, 2023
ea5065d
Add: Support v12.79.2
poppingmoon Apr 11, 2023
fca0ce5
Add: Partially support v12.80.0
poppingmoon Apr 11, 2023
0e8bb73
Add: Support v12.81.0
poppingmoon Apr 11, 2023
7bd077b
Add: Support v12.82.0
poppingmoon Apr 11, 2023
e35ad27
Add: Partially support v12.88.0
poppingmoon Apr 11, 2023
a1652df
Add: Support v12.89.0
poppingmoon Apr 12, 2023
9b011c2
Add: Support v12.89.1
poppingmoon Apr 12, 2023
2bc74da
CI: Set allowedPrivateNetworks
poppingmoon Apr 12, 2023
21a3c61
Add: Support v12.91.0
poppingmoon Apr 12, 2023
13163d2
Add: Support v12.92.0
poppingmoon Apr 12, 2023
fda6b40
Add: Partially support v12.93.0
poppingmoon Apr 13, 2023
507eedf
Add: Support v12.95.0
poppingmoon Apr 13, 2023
b584d2a
Add: Support v12.96.0
poppingmoon Apr 13, 2023
1e5096f
Add: Support v12.98.0
poppingmoon Apr 13, 2023
ae07816
Add: Partially support v12.99.0
poppingmoon Apr 13, 2023
c21c824
Add: Support v12.102.0
poppingmoon Apr 13, 2023
2aec2ed
Add: Support v12.104.0
poppingmoon Apr 13, 2023
5929d0d
Add: Support v12.105.0
poppingmoon Apr 13, 2023
9e48071
Add: Support v12.106.0
poppingmoon Apr 14, 2023
08bb328
Add: Support v12.107.0
poppingmoon Apr 14, 2023
d9ec995
Add: Support v12.108.0
poppingmoon Apr 16, 2023
eb2366d
Add: Support v12.109.0
poppingmoon Apr 16, 2023
1c3eefd
Change: Use HttpClient in streaming tests and examples for making req…
poppingmoon Apr 16, 2023
568d950
Change: Remove Client trait from WebSocketClient
poppingmoon Apr 16, 2023
66340ef
Add: Add missing fields in Signin
poppingmoon Apr 16, 2023
1d21bdd
Add: Support v12.111.0
poppingmoon Apr 16, 2023
d260089
Add: Partially support v12.112.0
poppingmoon Apr 16, 2023
9693ed1
Add: Support v12.112.3
poppingmoon Apr 17, 2023
a9d26f9
Add: Add missing is_muted_thread field for Response of notes/state
poppingmoon Apr 22, 2023
4e721f3
Add: Add missing fields for Meta
poppingmoon May 2, 2023
ab6f359
Fix: Fix typo
poppingmoon May 4, 2023
db57b7d
Fix: Rename field banner_id to banner_url for Channel model
poppingmoon May 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.75.1'
MISSKEY_IMAGE: 'misskey/misskey:12.112.3'
MISSKEY_ID: aid
- run: cargo test --features 12-75-0
- run: cargo test --features 12-112-3
timeout-minutes: 15
env:
TEST_API_URL: http://localhost:3000/api/
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/flaky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,58 @@ jobs:
strategy:
matrix:
include:
- image: 'misskey/misskey:12.112.3'
flags: --features 12-112-3
- image: 'misskey/misskey:12.112.2'
flags: --features 12-112-0
- image: 'misskey/misskey:12.111.0'
flags: --features 12-111-0
- 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'
flags: --features 12-107-0
- image: 'misskey/misskey:12.106.0'
flags: --features 12-106-0
- image: 'misskey/misskey:12.105.0'
flags: --features 12-105-0
- image: 'misskey/misskey:12.102.0'
flags: --features 12-102-0
- image: 'misskey/misskey:12.99.1'
flags: --features 12-99-0
- image: 'misskey/misskey:12.98.0'
flags: --features 12-98-0
- image: 'misskey/misskey:12.97.0'
flags: --features 12-96-0
- image: 'misskey/misskey:12.95.0'
flags: --features 12-95-0
- image: 'misskey/misskey:12.93.0'
flags: --features 12-93-0
- image: 'misskey/misskey:12.92.0'
flags: --features 12-92-0
- image: 'misskey/misskey:12.91.0'
flags: --features 12-91-0
- image: 'misskey/misskey:12.89.1'
flags: --features 12-89-1
- image: 'misskey/misskey:12.89.0'
flags: --features 12-89-0
- image: 'misskey/misskey:12.88.0'
flags: --features 12-88-0
- image: 'misskey/misskey:12.82.0'
flags: --features 12-82-0
- image: 'misskey/misskey:12.81.0'
flags: --features 12-81-0
- image: 'misskey/misskey:12.80.0'
flags: --features 12-80-0
- image: 'misskey/misskey:12.79.2'
flags: --features 12-79-2
- image: 'misskey/misskey:12.79.0'
flags: --features 12-79-0
- image: 'misskey/misskey:12.77.1'
flags: --features 12-77-1
- image: 'misskey/misskey:12.77.0'
flags: --features 12-77-0
- image: 'misskey/misskey:12.75.0'
flags: --features 12-75-0
- image: 'misskey/misskey:12.71.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.75.1'
MISSKEY_IMAGE: 'misskey/misskey:12.112.3'
MISSKEY_ID: aid
- run: cargo test --features 12-75-0
- run: cargo test --features 12-112-3
timeout-minutes: 15
env:
TEST_API_URL: http://localhost:3000/api/
Expand Down
3 changes: 3 additions & 0 deletions ci/testenv/web/default.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
url: http://localhost:3000/
port: 3000
allowedPrivateNetworks: [
127.0.0.1/32
]

db:
host: db
Expand Down
2 changes: 1 addition & 1 deletion example/follow-back/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
publish = false

[dependencies]
misskey = { path = "../../misskey", version = "0.2.0", features = ["websocket-client"] }
misskey = { path = "../../misskey", version = "0.2.0", features = ["http-client", "websocket-client"] }
tokio = { version = "1.0", features = ["full"] }
structopt = "0.3.16"
url = "2.1.1"
Expand Down
15 changes: 9 additions & 6 deletions example/follow-back/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use futures::stream::TryStreamExt;
use misskey::prelude::*;
use misskey::streaming::channel::main::MainStreamEvent;
use misskey::WebSocketClient;
use misskey::{HttpClient, WebSocketClient};
use structopt::StructOpt;
use url::Url;

Expand All @@ -18,15 +18,18 @@ struct Opt {
async fn main() -> Result<()> {
let opt = Opt::from_args();

// Build a client and connect to Misskey.
let client = WebSocketClient::builder(opt.url)
// Create `HttpClient`.
let http_client = HttpClient::with_token(opt.url.clone(), opt.i.clone())?;

// Build `WebSocketClient` and connect to Misskey.
let ws_client = WebSocketClient::builder(opt.url)
.token(opt.i)
.connect()
.await?;

// Connect to the main stream.
// the main stream is a channel that streams events about the connected account, such as notifications.
let mut stream = client.main_stream().await?;
let mut stream = ws_client.main_stream().await?;

// Wait for the next event using `try_next` method from `TryStreamExt`.
while let Some(event) = stream.try_next().await? {
Expand All @@ -36,8 +39,8 @@ async fn main() -> Result<()> {
println!("followed from @{}", user.username);

// Follow back `user` if you haven't already.
if !client.is_following(&user).await? {
client.follow(&user).await?;
if !http_client.is_following(&user).await? {
http_client.follow(&user).await?;
}
}
// other events are just ignored
Expand Down
2 changes: 1 addition & 1 deletion example/ping-pong/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
publish = false

[dependencies]
misskey = { path = "../../misskey", version = "0.2.0", features = ["websocket-client"] }
misskey = { path = "../../misskey", version = "0.2.0", features = ["http-client", "websocket-client"] }
tokio = { version = "1.0", features = ["full"] }
structopt = "0.3.16"
url = "2.1.1"
Expand Down
13 changes: 8 additions & 5 deletions example/ping-pong/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use futures::stream::TryStreamExt;
use misskey::model::note::Note;
use misskey::prelude::*;
use misskey::streaming::channel::main::MainStreamEvent;
use misskey::WebSocketClient;
use misskey::{HttpClient, WebSocketClient};
use structopt::StructOpt;
use url::Url;

Expand All @@ -19,15 +19,18 @@ struct Opt {
async fn main() -> Result<()> {
let opt = Opt::from_args();

// Build a client and connect to Misskey.
let client = WebSocketClient::builder(opt.url)
// Create `HttpClient`.
let http_client = HttpClient::with_token(opt.url.clone(), opt.i.clone())?;

// Build `WebSocketClient` and connect to Misskey.
let ws_client = WebSocketClient::builder(opt.url)
.token(opt.i)
.connect()
.await?;

// Connect to the main stream.
// the main stream is a channel that streams events about the connected account, such as notifications.
let mut stream = client.main_stream().await?;
let mut stream = ws_client.main_stream().await?;

// Wait for the next event using `try_next` method from `TryStreamExt`.
while let Some(event) = stream.try_next().await? {
Expand All @@ -42,7 +45,7 @@ async fn main() -> Result<()> {
println!("got ping from @{}", user.username);

// Create a pong note as a reply to the mention
client.reply(note_id, "pong").await?;
http_client.reply(note_id, "pong").await?;
}
// other events are just ignored
_ => {}
Expand Down
2 changes: 1 addition & 1 deletion example/streaming/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
publish = false

[dependencies]
misskey = { path = "../../misskey", version = "0.2.0", features = ["websocket-client"] }
misskey = { path = "../../misskey", version = "0.2.0", features = ["http-client", "websocket-client"] }
tokio = { version = "1.0", features = ["full"] }
structopt = "0.3.16"
url = "2.1.1"
Expand Down
11 changes: 7 additions & 4 deletions example/streaming/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use futures::stream::TryStreamExt;
use misskey::prelude::*;
use misskey::WebSocketClient;
use misskey::{HttpClient, WebSocketClient};
use structopt::StructOpt;
use url::Url;

Expand All @@ -17,20 +17,23 @@ struct Opt {
async fn main() -> Result<()> {
let opt = Opt::from_args();

// Create `HttpClient`.
let http_client = HttpClient::with_token(opt.url.clone(), opt.i.clone())?;

// Configure and build a client using `WebSocketClientBuilder`.
let client = WebSocketClient::builder(opt.url)
let ws_client = WebSocketClient::builder(opt.url)
.token(opt.i)
.connect()
.await?;

// Run two asynchronous tasks simultaneously.
futures::try_join!(post(&client), timeline(&client))?;
futures::try_join!(post(&http_client), timeline(&ws_client))?;

Ok(())
}

// Post what you entered
async fn post(client: &WebSocketClient) -> Result<()> {
async fn post(client: &HttpClient) -> Result<()> {
// We use async I/O from `tokio` for now
use tokio::io::{self, AsyncBufReadExt, BufReader};

Expand Down
2 changes: 1 addition & 1 deletion example/word-reply/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
publish = false

[dependencies]
misskey = { path = "../../misskey", version = "0.2.0", features = ["websocket-client"] }
misskey = { path = "../../misskey", version = "0.2.0", features = ["http-client", "websocket-client"] }
tokio = { version = "1.0", features = ["full"] }
structopt = "0.3.16"
url = "2.1.1"
Expand Down
13 changes: 8 additions & 5 deletions example/word-reply/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use futures::stream::TryStreamExt;
use misskey::model::query::Query;
use misskey::prelude::*;
use misskey::WebSocketClient;
use misskey::{HttpClient, WebSocketClient};
use structopt::StructOpt;
use url::Url;

Expand All @@ -24,14 +24,17 @@ struct Opt {
async fn main() -> Result<()> {
let opt = Opt::from_args();

// Create `HttpClient`.
let http_client = HttpClient::with_token(opt.url.clone(), opt.i.clone())?;

// Build a client and connect to Misskey.
let client = WebSocketClient::builder(opt.url)
let ws_client = WebSocketClient::builder(opt.url)
.token(opt.i)
.connect()
.await?;

// Create a new antenna.
let antenna = client
let antenna = http_client
.build_antenna()
.name("word-reply example")
.include(Query::from_vec(
Expand All @@ -42,14 +45,14 @@ async fn main() -> Result<()> {
.await?;

// Connect to the antenna's timeline.
let mut stream = client.antenna_timeline(&antenna).await?;
let mut stream = ws_client.antenna_timeline(&antenna).await?;

// Wait for the next note using `try_next` method from `TryStreamExt`.
while let Some(note) = stream.try_next().await? {
println!("received a note from @{}", note.user.username);

// Create a note as a reply to the note
client.reply(&note, &opt.reply).await?;
http_client.reply(&note, &opt.reply).await?;
}

Ok(())
Expand Down
65 changes: 64 additions & 1 deletion misskey-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for Misskey v12.69.0
- Support for Misskey v12.70.0
- Support for Misskey v12.71.0 ~ v12.74.1
- Support for Misskey v12.75.0 ~ v12.75.1
- Support for Misskey v12.75.0 ~ v12.76.1
- `muted_notification_types` user setting which is available since v12.48.0
- Page related endpoints
- endpoint `pages/*`
- endpoint `i/pages`
- endpoint `i/page_likes`
- Support for Misskey v12.77.0
- Support for Misskey v12.77.1 ~ v12.78.0
- endpoint `notifications/read`
- Support for Misskey v12.79.0 ~ v12.79.1
- endpoint `gallery/*`
- endpoint `i/gallery/*`
- endpoint `users/gallery/posts`
- Support for Misskey v12.79.2 ~ v12.79.3
- endpoint `gallery/posts/delete`
- endpoint `gallery/posts/update`
- Partial support for Misskey v12.80.0 ~ v12.80.3
- endpoint `admin/ad/*`
- Support for Misskey v12.81.0 ~ 12.81.2
- endpoint `admin/get-index-stats`
- Support for Misskey v12.82.0 ~ v12.87.0
- Partial support for Misskey v12.88.0
- Support for Misskey v12.89.0
- Support for Misskey v12.89.1 ~ v12.90.1
- Support for Misskey v12.91.0
- endpoint `admin/accounts/delete`
- Support for Misskey v12.92.0
- endpoint `email-address/available`
- endpoint `users/groups/leave`
- Partial support for Misskey v12.93.0 ~ v12.94.1
- endpoint `users/reactions`
- Support for Misskey v12.95.0
- endpoint `notes/thread-muting/*`
- Support for Misskey v12.96.0 ~ v12.97.1
- Support for Misskey v12.98.0
- endpoint `following/invalidate`
- Partial support for Misskey v12.99.0 ~ v12.101.1
- Support for Misskey v12.102.0 ~ v12.103.1
- endpoint `admin/emoji/*`
- Support for Misskey v12.104.0
- endpoint `charts/ap-request`
- Support for Misskey v12.105.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`
- Support for Misskey v12.111.0 ~ v12.111.1
- Partial support for Misskey v12.112.0 ~ v12.112.2
- endpoint `admin/delete-account`
- endpoint `admin/get-user-ips`
- endpoint `admin/update-user-note`
- endpoint `admin/drive-capacity-override`
- endpoint `clips/remove-note`
- Support for Misskey v12.112.3 ~ v12.119.2

### Changed
### Deprecated
Expand All @@ -35,6 +84,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `ClientSettingUpdated` variant from `MainStreamEvent`
- For Misskey v12.67.0 ~ v12.68.0
- Latest version flag from being enabled as default
- endpoint `users`
- For Misskey v12.88.0
- endpoint `users/recommendation`
- For Misskey v12.88.0 ~
- endpoint `admin/logs` and `admin/delete-logs`
- For Misskey v12.93.0 ~
- endpoint `admin/emoji/remove`
- For Misskey v12.102.0 ~
- endpoint `charts/network`
- For Misskey v12.104.0 ~
- endpoint `stats`
- For Misskey v12.106.0 ~ v12.106.3
- endpoint `email-address/available`
- For Misskey v12.108.0 ~ v12.108.1

### Fixed

Expand Down
Loading