Commit Graph

1542 Commits

Author SHA1 Message Date
kozabrada123 218ea9aa12
Merge 81b1525ac0 into 261fe452c1 2024-08-29 07:25:47 +00:00
kozabrada123 81b1525ac0
Merge branch 'dev' into user-routes 2024-08-29 09:25:45 +02:00
bitfl0wer 261fe452c1
Bump version to v0.16.0 2024-08-28 20:10:15 +02:00
kozabrada123 1c90c8e32b
0.16.0: fix lints (#558)
* chore: fix doc lints

* fix: use different chrono function due to deprecation

* chore: format
2024-08-28 19:42:13 +02:00
bitfl0wer 411db01786
Revert d846ce9948 2024-08-26 20:05:00 +02:00
Flori 76186a08f0
Make instance GatewayOptions configurable for library consumers (#555)
* Make instance GatewayOptions configurable for library consumers

* Update example in README
2024-08-26 19:36:42 +02:00
bitfl0wer d846ce9948
move up sending identify 2024-08-26 18:19:02 +02:00
bitfl0wer e316372631
Bump package versions 2024-08-26 13:56:28 +02:00
bitfl0wer 72c5d13eaf
Update README.md 2024-08-26 13:56:11 +02:00
bitfl0wer 05b9f1c801
Add missing `impl From<Snowflake> for u64`, closes `From<Snowflake> for u64` missing #550 2024-08-26 13:38:33 +02:00
Flori 9926f8ab94
Tungstenite: Match scheme for "ws" or "wss" (#554)
Match scheme for "ws" or "wss" and choose whether to connect with TLS connector for tungstenite
2024-08-26 13:32:37 +02:00
Flori 5bee907733
Prefer `&str` over `String` when possible (#553)
Prefer &str over String where possible.
2024-08-26 12:44:58 +02:00
Flori f0dbd3410f
sqlx_bitflag_derive: Use PgU64 as translation base (#552)
* sqlx_bitflag_derive: Use PgU64 as translation base

* Bump version of chorus-macros
2024-08-25 21:51:12 +02:00
Flori ebea18c991
Snowflake: PgU64 as base for sqlx (#551)
* Bump sqlx-pg-uint, sqlx

* Use PgU64 as base for implementations of sqlx traits for Snowflake
2024-08-25 21:27:33 +02:00
bitfl0wer e9b3de2342
Uncomment and update decode_token() 2024-08-22 21:52:29 +02:00
bitfl0wer cfccae8060
Bump sqlx-pg-uint 2024-08-22 00:31:53 +02:00
Flori 86b022912f
Initial support for PostgreSQL (#548)
* Change sqlx::Any to sqlx::Postgres

* Change sqlx::Any to sqlx::Postgres

* Remove JSONified overrides when sqlx feature is enabled, where it makes sense

* Add num-bigint dep

* Remove generic impl for From<T> for Snowflake
For some reason, this trait bound conflicts with another trait bound from the sqlx-pg-uint crate, even though I personally don't get why.

* Remove num_bigint, adsd sqlx-pg-uint

* swap u64 for PgU64 in some files

* use v0.3.0 of sqlx-pg-uint

* Lots of sqlx-postgres type changes

* Lots of sqlx-postgres type changes

* gwah

* Change repr(i8) to repr(i16) in enums when sqlx feature is enabled, fix sqlx incompatibilities

* impl sqlx::postgres::PgHasArrayType for Snowflake

* Try: derive Type for FriendSourceFlags, GuildFolder

* Try: Derive FromRow, Type for DefaultReaction

* Try: Derive Type for CustomStatus

* Try: Derive Type, FromRow for Tag

* Replace conditional compiling of uNN/PgUNN with conditional compiled type alias

* Fix: Conditional compiling errors and warnings

* Bump: wasm-bindgen* crate versions
2024-08-21 23:43:42 +02:00
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 2f2407467e add test for get_user_profile 2024-08-18 14:50:13 +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 ec9541f38e
CI/CD: add cargo-doc job (#544)
* CI/CD: add cargo-doc job

* fix: make it rustdoc, totally not clippy
2024-08-09 08:53:43 +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
Flori ab82a5d49a
Update MSRV (#540)
* Update msrv
2024-08-02 21:12:38 +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