Commit Graph

1020 Commits

Author SHA1 Message Date
kozabrada123 53f08ff1f9 add some tests, minor connection updates
- Document that create_domain_connection is unimplemented on Spacebar

- Add Discord connection type

- Change ConnectionType::array() into ConnectionType::vector() - returning a fixed size array is dubious, since it'll likely be expanded. Returning a vector is easier keep up to variable length

- Add ConnectionType::discord_vector() and ConnectionType::spacebar_vector() to return a vector ConnectionTypes available on the respective server backends

- add tests test_modify_user_profile, test_disable_user, test_get_user_note, test_set_user_note, test_get_user_affinities, test_get_guild_affinities, test_get_connections

Note: connections are hard to test, since they require secrets / an external service's account
2024-08-21 18:26:11 +02:00
kozabrada123 a9b1a61d84 apparently Sb does not implement users/@me/notes 2024-08-21 16:58:41 +02:00
kozabrada123 ade43f2a97 skip serializing None query parameters 2024-08-18 14:47:01 +02:00
kozabrada123 fa859f616a fix a deserialization error on Spacebar
See spacebarchat/server#1188

A deserialization error was happening with get_user_profile, where pronouns should have been serialized as an empty string, but were instead serialized as null.
2024-08-18 14:45:12 +02:00
kozabrada123 28e3f21cbf fix READY deserialization error on spacebar 2024-08-18 14:20:21 +02:00
kozabrada123 e0ae1a9ec6 clippy 2024-08-18 11:18:18 +02:00
kozabrada123 f63c6a7c75 grumble grumble 2024-08-18 10:41:03 +02:00
kozabrada123 7e2e85988b feat: add get_burst_credits 2024-08-18 10:33:01 +02:00
kozabrada123 2f4198c0a4 feat: add create_domain_connection 2024-08-18 10:14:51 +02:00
kozabrada123 b7d549756a aa 2024-08-16 16:41:51 +02:00
kozabrada123 38d5fffc81 cliipy my arch nemesis strikes again 2024-08-16 15:40:33 +02:00
kozabrada123 9a4c9bce2d feat: add get_premium_usage endpoint
note: not fully tested; I do not have an account with premium
2024-08-16 14:12:47 +02:00
kozabrada123 e06bc147b4 feat: add affinities 2024-08-13 09:21:59 +02:00
kozabrada123 f966a787d9 feat: add connected_accounts to UserProfile 2024-08-13 08:48:13 +02:00
kozabrada123 a1caa38bfd feat: add rest* of Connections api
* The only thing not added yet is create_domain_connection, because it uses errors in a funky way

adds:
- create_connection_callback
- create_contact_sync_connection
- get_connections
- refresh_connection
- modify_connection
- delete_connection
- get_connection_access_token
- get_connection_subreddits

+ related schema for all those routes, and some supporting types
2024-08-13 08:43:37 +02:00
kozabrada123 170f79bbd1 feat: add authorize_connection
Also adds: src/types/entities/connection.rs, Connection and PublicConnection,
src/api/users/connections.rs
2024-08-10 11:34:56 +02:00
kozabrada123 6c6a87ce5b feat: add #545 and #546
Adds the RECENT_MENTION_DELETE and USER_NOTE_UPDATE gateway events.

The events can be accessed at:
message.recent_mention_delete
&
user.note_update
2024-08-09 11:23:38 +02:00
kozabrada123 1dfbd216a4 feat: user notes endpoints
Adds: get_user_notes, get_user_note, set_user_note
2024-08-09 11:10:25 +02:00
kozabrada123 87aad461fd feat: add get_user_harvest & create_user_harvest
Also adds /types/entities/harvest.rs, types for Harvest
2024-08-09 10:24:38 +02:00
kozabrada123 9d847906be feat: recent_mentions endpoints
Adds GET /users/@me/mentions and DELETE /users/@me/mentions/{message.id}
2024-08-09 09:29:48 +02:00
kozabrada123 fa70c55944 fix: rustdoc lints 2024-08-09 09:11:20 +02:00
kozabrada123 754c212b39 Merge dev into user-routes 2024-08-09 08:55:38 +02:00
kozabrada123 7683ce49a3 feat: add create_pomelo_migration 2024-08-08 19:14:39 +02:00
kozabrada123 926f89e1cf feat: add get_pomelo_suggestions and get_pomelo_eligibility 2024-08-08 09:57:23 +02:00
kozabrada123 80c99753c4 chore: add integration expire behavior 2024-08-08 09:09:46 +02:00
kozabrada123 1fa84b4b63 feat!: add get_user_profile query string schema 2024-08-08 08:58:57 +02:00
kozabrada123 e6a4cc30a6 feat!: add discriminator parameter to get_user_by_username 2024-08-08 08:37:08 +02:00
Flori e4dd31ef78
sqlx related improvements (#542)
* Bump sqlx to 0.8.0

* Update sqlx syntax to 0.8.0, change MySql for sqlx:: Any

* Update sqlx syntax to 0.8.0, change MySql for sqlx:: Any

* Modify chorus_macros::SqlxBitflagDerive to use sqlx::Any over sqlx::MySql (broken!)

* Fix: `cannot infer type for type parameter `DB` declared on the trait...`

* Change remaining impls of sqlx traits for MySql to sqlx::Any

* Alter chorus_macros to correctly derive SqlxBitFlag for sqlx::Any

* rustc/clippy>=v1.80.0: Do not warn when encountering cfg(tarpaulin_include)

* Port compare_* methods to sqlx v0.8.0
2024-08-04 13:08:56 +02:00
kozabrada123 0a1c51dddd feat: modify email and verify email endpoints 2024-07-29 10:42:14 +02:00
kozabrada123 5d0a65a9a9 feat: delete and disable user endpoints 2024-07-29 09:23:09 +02:00
kozabrada123 62d48d61fe feat: add modify user profile 2024-07-29 08:50:10 +02:00
kozabrada123 20bdb3247a api: re-do a large part of the users api 2024-07-28 12:20:27 +02:00
kozabrada123 7db5015c07 feat: Add UserProfile and other types 2024-07-28 11:42:26 +02:00
bitfl0wer 7bba7c6fcb
Manually implement std::default::Default for GatewayHeartbeat and GatewayHeartbeatAck 2024-07-27 15:31:47 +02:00
Flori 274b9ab0ca
More accurate "GatewayHello::default()" (#534)
Replaces the derived `std::default::Default` with

```rs
impl std::default::Default for GatewayHello {
    fn default() -> Self {
        Self {
            // "HELLO" opcode is 10
            op: 10,
            d: Default::default(),
        }
    }
}

impl std::default::Default for HelloData {
    fn default() -> Self {
        Self {
            // Discord docs mention 45000 seconds - discord.sex mentions 41250. Defaulting to 45s
            heartbeat_interval: 45000,
        }
    }
}
```
2024-07-26 23:37:28 +02:00
bitfl0wer d4f6a7e98a
More accurate "GatewayHello::default()" 2024-07-26 23:28:23 +02:00
bitfl0wer 9dbb5ea77b
impl sqlx::Type for ThemeColors 2024-07-26 17:40:42 +02:00
bitfl0wer ffcf15d058
Custom ThemeColors type with sqlx::Encode and sqlx::Decode impls 2024-07-26 17:30:43 +02:00
bitfl0wer 111a8c42f5
change theme_colors from Vec<u32> to (u32, u32) 2024-07-26 14:54:55 +02:00
kozabrada123 4292ab88e9
Fix #525 (pr #532) 2024-07-26 10:02:11 +02:00
kozabrada123 b9bc37fcd4 Readd Observer trait as reexport 2024-07-25 11:29:35 +02:00
bitfl0wer feb2b1b64c
Bump browser_version according to https://www.useragents.me/#most-common-desktop-useragents 2024-07-24 21:55:10 +02:00
bitfl0wer 7bb35e5ed8
Increase limit integer size to match spacebars' possibilities 2024-07-24 15:57:12 +02:00
bitfl0wer dd85a7de17
Fix/Correct UnavailableGuild object 2024-07-24 15:55:29 +02:00
bitfl0wer 76146b0e8c
Fix: Compile error with no default features 2024-07-20 17:54:49 +02:00
bitfl0wer 88efef6015
Fix: Turn unconditional import of sqlx::types::Json into conditional one 2024-07-20 17:30:21 +02:00
bitfl0wer 0beb4484ca
Fix: Wrong function name 2024-07-20 17:25:33 +02:00
bitfl0wer 599969e2c7
Merge branch 'one-billion-derives' of https://github.com/polyphony-chat/chorus into one-billion-derives 2024-07-20 17:21:52 +02:00
bitfl0wer 98b129aca0
Provide alternative implementations for PartialEq for some types when sqlx feature is enabled 2024-07-20 17:18:23 +02:00
bitfl0wer cd0230e64d
Provide alternative implementations for PartialEq for some types when sqlx feature is enabled 2024-07-20 16:54:47 +02:00