Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User routes update #537

Merged
merged 36 commits into from
Sep 27, 2024
Merged

User routes update #537

merged 36 commits into from
Sep 27, 2024

Conversation

kozabrada123
Copy link
Member

@kozabrada123 kozabrada123 commented Jul 28, 2024

Additions:

Changes:

  • Break User::get into User::get (now for only other users) and User::get_current
  • Change ChorusUser::delete to take an optional password
  • Refactor a few routes to use chorus_request.deserialize_response() instead of panicing

@kozabrada123 kozabrada123 linked an issue Jul 28, 2024 that may be closed by this pull request
@bitfl0wer bitfl0wer added this to the 0.16.0 milestone Aug 2, 2024
src/types/entities/user.rs Fixed Show fixed Hide fixed
src/types/entities/user.rs Fixed Show fixed Hide fixed
Adds GET /users/@me/mentions and DELETE /users/@me/mentions/{message.id}
Also adds /types/entities/harvest.rs, types for Harvest
Adds: get_user_notes, get_user_note, set_user_note
Adds the RECENT_MENTION_DELETE and USER_NOTE_UPDATE gateway events.

The events can be accessed at:
message.recent_mention_delete
&
user.note_update
bitfl0wer pushed a commit that referenced this pull request Oct 10, 2024
* feat: Add UserProfile and other types

* api: re-do a large part of the users api

* feat: add modify user profile

* feat: delete and disable user endpoints

* feat: modify email and verify email endpoints

* feat!: add discriminator parameter to get_user_by_username

* feat!: add get_user_profile query string schema

* chore: add integration expire behavior

* feat: add get_pomelo_suggestions and get_pomelo_eligibility

* feat: add create_pomelo_migration

* fix: rustdoc lints

* feat: recent_mentions endpoints

Adds GET /users/@me/mentions and DELETE /users/@me/mentions/{message.id}

* feat: add get_user_harvest & create_user_harvest

Also adds /types/entities/harvest.rs, types for Harvest

* feat: user notes endpoints

Adds: get_user_notes, get_user_note, set_user_note

* 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

* feat: add authorize_connection

Also adds: src/types/entities/connection.rs, Connection and PublicConnection,
src/api/users/connections.rs

* 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

* feat: add connected_accounts to UserProfile

* feat: add affinities

* feat: add get_premium_usage endpoint

note: not fully tested; I do not have an account with premium

* cliipy my arch nemesis strikes again

* aa

* feat: add create_domain_connection

* feat: add get_burst_credits

* grumble grumble

* clippy

* fix READY deserialization error on spacebar

* 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.

* skip serializing None query parameters

* add test for get_user_profile

* apparently Sb does not implement users/@me/notes

* 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

* minor pre merge changes

- add some extra doc comments

- and into_public() for connection

- remove a todo that is no longer valid
bitfl0wer added a commit that referenced this pull request Oct 10, 2024
Release tracker for v0.17.0 of chorus, set to release on October 10th,
2024.

## Public API changes

- #561: Add missing fields in `GatewayReady` event, create
`GatewayReadyBot` for Bots
- #560: Differentiate between instance softwares through /version and
/ping endpoints
- #537: Implement 30 user routes
- #565 : Fix sqlx En-/Decoding of PremiumType
- #567

## Internal changes

## Bugfixes

- #565 : Fix sqlx En-/Decoding of PremiumType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: API Type: Enhancement Enhances an existing feature or behaviour. Type: New feature
Projects
None yet
2 participants