feat: user profile check endpoint#1503
Merged
vishalnarkhede merged 7 commits intomasterfrom Mar 27, 2025
Merged
Conversation
1cfcdba to
88e21dd
Compare
Contributor
|
Size Change: +2.44 kB (+0.46%) Total Size: 533 kB
|
88e21dd to
1d8f3bb
Compare
santhoshvai
reviewed
Mar 27, 2025
santhoshvai
approved these changes
Mar 27, 2025
Co-authored-by: Santhosh Vaiyapuri <3846977+santhoshvai@users.noreply.github.com>
src/moderation.ts
Outdated
Comment on lines
289
to
292
| async checkUserProfile(userId: string, profile: { profileImage?: string; username?: string } = {}) { | ||
| if (!profile.username && !profile.profileImage) { | ||
| throw new Error('Either username or profileImage must be provided'); | ||
| } |
Contributor
There was a problem hiding this comment.
Let's make it partially required for TS users, I'll leave the runtime check for the JS users. :)
Suggested change
| async checkUserProfile(userId: string, profile: { profileImage?: string; username?: string } = {}) { | |
| if (!profile.username && !profile.profileImage) { | |
| throw new Error('Either username or profileImage must be provided'); | |
| } | |
| async checkUserProfile(userId: string, profile: RequireAtLeastOne<{ profile: string; image: string }>) { | |
| if (!profile.username && !profile.image) { | |
| throw new Error('Either profile.username or profile.image must be provided'); | |
| } |
Contributor
There was a problem hiding this comment.
Also - nit; changed profileImage to image
src/moderation.ts
Outdated
Comment on lines
299
to
300
| texts: [profile.username as string], | ||
| images: [profile.profileImage as string], |
Contributor
There was a problem hiding this comment.
Suggested change
| texts: [profile.username as string], | |
| images: [profile.profileImage as string], | |
| texts: [profile.username as string], | |
| images: [profile.profileImage as string], |
One of these might become: [undefined] - is that okay?
…-chat-js into user-name-check-support
arnautov-anton
approved these changes
Mar 27, 2025
MartinCupela
approved these changes
Mar 27, 2025
Merged
vishalnarkhede
pushed a commit
that referenced
this pull request
Apr 1, 2025
# 🚀 v8.58.0 Make sure to use squash & merge when merging! Once this is merged, another job will kick off automatically and publish the package. # 📝 Changelog ## [8.58.0](v8.57.6...v8.58.0) (2025-04-01) ### Features * [CHA-375] add draft messages api ([#1490](#1490)) ([3a7f732](3a7f732)) * user profile check endpoint ([#1503](#1503)) ([8114c22](8114c22)) ### Bug Fixes * provide a way for a suffix to be added to wsUrl ([#1497](#1497)) ([d14d0ff](d14d0ff)) * use URLSearchParams when building WS url ([#1498](#1498)) ([9413433](9413433)) # Co-authored-by: github-actions <release@getstream.io>
rafaelmf3
pushed a commit
that referenced
this pull request
Apr 2, 2025
- [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required). - [ ] Code changes are tested - Added a new endpoint for moderation `checkUserProfile` - Have added clear warning in description that this is subject to introducing breaking changes. - Backend PR: GetStream/chat#8424 --------- Co-authored-by: Santhosh Vaiyapuri <3846977+santhoshvai@users.noreply.github.com>
rafaelmf3
pushed a commit
that referenced
this pull request
Apr 2, 2025
Make sure to use squash & merge when merging! Once this is merged, another job will kick off automatically and publish the package. # 📝 Changelog [8.58.0](v8.57.6...v8.58.0) (2025-04-01) * [CHA-375] add draft messages api ([#1490](#1490)) ([3a7f732](3a7f732)) * user profile check endpoint ([#1503](#1503)) ([8114c22](8114c22)) * provide a way for a suffix to be added to wsUrl ([#1497](#1497)) ([d14d0ff](d14d0ff)) * use URLSearchParams when building WS url ([#1498](#1498)) ([9413433](9413433)) Co-authored-by: github-actions <release@getstream.io>
github-actions bot
pushed a commit
that referenced
this pull request
Apr 9, 2025
## [9.0.0-rc.10](v9.0.0-rc.9...v9.0.0-rc.10) (2025-04-09) ### Bug Fixes * [CHA-826] normalize queryDrafts sort ([#1509](#1509)) ([6df96c3](6df96c3)) * add event fields on creating campaign ([#1512](#1512)) ([6c76d6d](6c76d6d)) ### Features * [CHA-660] - Team based roles ([#1499](#1499)) ([dd62cff](dd62cff)) * add show_channels flag to campaigns ([#1513](#1513)) ([5344d2c](5344d2c)) * user profile check endpoint ([#1503](#1503)) ([8114c22](8114c22)) ### Chores * **deps:** upgrade @babel/runtime to v7.27.0 ([#1508](#1508)) ([eb29626](eb29626)), closes [#1502](#1502)
|
🎉 This PR is included in version 9.0.0-rc.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLA
Description of the changes, What, Why and How?
Changelog
checkUserProfile