Skip to content

feat: user profile check endpoint#1503

Merged
vishalnarkhede merged 7 commits intomasterfrom
user-name-check-support
Mar 27, 2025
Merged

feat: user profile check endpoint#1503
vishalnarkhede merged 7 commits intomasterfrom
user-name-check-support

Conversation

@vishalnarkhede
Copy link
Contributor

@vishalnarkhede vishalnarkhede commented Mar 27, 2025

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

Description of the changes, What, Why and How?

Changelog

@vishalnarkhede vishalnarkhede force-pushed the user-name-check-support branch from 1cfcdba to 88e21dd Compare March 27, 2025 06:55
@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2025

Size Change: +2.44 kB (+0.46%)

Total Size: 533 kB

Filename Size Change
dist/browser.es.js 117 kB +567 B (+0.49%)
dist/browser.full-bundle.min.js 63.3 kB +166 B (+0.26%)
dist/browser.js 118 kB +568 B (+0.48%)
dist/index.es.js 117 kB +567 B (+0.49%)
dist/index.js 118 kB +568 B (+0.48%)

compressed-size-action

@vishalnarkhede vishalnarkhede force-pushed the user-name-check-support branch from 88e21dd to 1d8f3bb Compare March 27, 2025 10:25
@vishalnarkhede vishalnarkhede changed the title [MOD-461] user profile check endpoint feat: user profile check endpoint Mar 27, 2025
@vishalnarkhede vishalnarkhede marked this pull request as ready for review March 27, 2025 10:55
Co-authored-by: Santhosh Vaiyapuri <3846977+santhoshvai@users.noreply.github.com>
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');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - nit; changed profileImage to image

Comment on lines 299 to 300
texts: [profile.username as string],
images: [profile.profileImage as string],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@vishalnarkhede vishalnarkhede merged commit 8114c22 into master Mar 27, 2025
5 checks passed
@vishalnarkhede vishalnarkhede deleted the user-name-check-support branch March 27, 2025 11:33
@github-actions github-actions bot mentioned this pull request Apr 1, 2025
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)
@stream-ci-bot
Copy link

🎉 This PR is included in version 9.0.0-rc.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants