Skip to content

Commit

Permalink
feat: Add bsky-sdk (#185)
Browse files Browse the repository at this point in the history
* Add bsky-sdk

* chore: Tweak

* Add moderation tests

* Add tests, add tests

* Implement blocking behavior

* Implement muted behaviors

* Complete behaviors tests

* Add Hash to api types

* WIP: Add BskyAgent.moderator()

* Add interpret_label_value_definition

* Add workflows

* Add tests::custom_labels

* Add moderation for mutewords

* Add moderation::tests::quoteposts

* Fix warnings

* Add labels

* Add rich_text

* Add RichText::segment, add tests

* WIP: Add RichText::detect_facets

* Add link detection, add tests

* Implement tag detection

* Add tests for has_muted_word

* Update tests

* Add default-client feature

* Update interface, and tests

* Add docs

* Add docs for agent

* Add docs

* Ready for publish
  • Loading branch information
sugyan committed Jun 13, 2024
1 parent c9bcaa3 commit f8cecb4
Show file tree
Hide file tree
Showing 42 changed files with 9,205 additions and 36 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/bsky-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: bsky-sdk

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cargo build -p bsky-sdk --verbose
cargo build -p bsky-sdk --verbose --no-default-features
cargo build -p bsky-sdk --verbose --no-default-features --features default-client
cargo build -p bsky-sdk --verbose --no-default-features --features rich-text
cargo build -p bsky-sdk --verbose --all-features
- name: Run tests
run: |
cargo test -p bsky-sdk
cargo test -p bsky-sdk --lib --no-default-features
cargo test -p bsky-sdk --lib --no-default-features --features default-client
cargo test -p bsky-sdk --lib --no-default-features --features rich-text
cargo test -p bsky-sdk --lib --all-features
125 changes: 108 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"atrium-cli",
"atrium-xrpc",
"atrium-xrpc-client",
"bsky-sdk",
]
# Examples show how to use the latest published crates, not the workspace state.
exclude = [
Expand All @@ -27,7 +28,7 @@ atrium-xrpc-client = { version = "0.5.4", path = "atrium-xrpc-client" }

# async in traits
# Can be removed once MSRV is at least 1.75.0.
async-trait = "0.1.68"
async-trait = "0.1.80"

# DAG-CBOR codec
ipld-core = { version = "0.4.0", default-features = false, features = ["std"] }
Expand All @@ -37,9 +38,9 @@ serde_ipld_dagcbor = { version = "0.6.0", default-features = false, features = [
chrono = "0.4"
langtag = "0.3"
regex = "1"
serde = "1.0.160"
serde = "1.0.202"
serde_bytes = "0.11.9"
serde_json = "1.0.96"
serde_json = "1.0.117"
serde_html_form = "0.2.6"

# Networking
Expand All @@ -52,7 +53,7 @@ isahc = "1.7.2"
reqwest = { version = "0.12", default-features = false }

# Errors
anyhow = "1.0.80"
anyhow = "1.0.86"
thiserror = "1.0"

# CLI
Expand Down
6 changes: 3 additions & 3 deletions atrium-api/src/types/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{de::Error, Deserialize};
macro_rules! uint {
($primitive:ident, $nz:ident, $lim:ident, $lim_nz:ident, $bounded:ident) => {
/// An unsigned integer with a maximum value of `MAX`.
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize, Hash)]
#[repr(transparent)]
#[serde(transparent)]
pub struct $lim<const MAX: $primitive>($primitive);
Expand Down Expand Up @@ -53,7 +53,7 @@ macro_rules! uint {
}

/// An unsigned integer with a minimum value of 1 and a maximum value of `MAX`.
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize, Hash)]
#[repr(transparent)]
#[serde(transparent)]
pub struct $lim_nz<const MAX: $primitive>($nz);
Expand Down Expand Up @@ -111,7 +111,7 @@ macro_rules! uint {
/// An unsigned integer with a minimum value of `MIN` and a maximum value of `MAX`.
///
/// `MIN` must be non-zero.
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize, Hash)]
#[repr(transparent)]
#[serde(transparent)]
pub struct $bounded<const MIN: $primitive, const MAX: $primitive>($nz);
Expand Down
Loading

0 comments on commit f8cecb4

Please sign in to comment.