-
Notifications
You must be signed in to change notification settings - Fork 77
feat: add support for batch channel updates #1654
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -209,6 +209,8 @@ import type { | |||||
| TokenOrProvider, | ||||||
| TranslateResponse, | ||||||
| UnBanUserOptions, | ||||||
| UpdateChannelsBatchRequest, | ||||||
| UpdateChannelsBatchResponse, | ||||||
| UpdateChannelTypeRequest, | ||||||
| UpdateChannelTypeResponse, | ||||||
| UpdateCommandOptions, | ||||||
|
|
@@ -4762,4 +4764,17 @@ export class StreamChat { | |||||
| syncDeliveredCandidates(collections: Channel[]) { | ||||||
| this.messageDeliveryReporter.syncDeliveredCandidates(collections); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Update Channels Batch | ||||||
| * | ||||||
| * @param {UpdateChannelsBatchRequest} payload for updating channels in batch | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * @return {Promise<UpdateChannelsBatchResponse>} The server response | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not sure |
||||||
| */ | ||||||
| async updateChannelsBatch(payload: UpdateChannelsBatchRequest) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Changing Request for Options feels more descriptive to me as word "request" would probably refer more the the HTTP request that holds this payload. Also word options is already used across the SDK. |
||||||
| return await this.put<UpdateChannelsBatchResponse>( | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
May it be that the returned JSON will also contain fields from |
||||||
| this.baseURL + `/channels/batch`, | ||||||
| payload, | ||||||
| ); | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -4459,3 +4459,29 @@ export type EventHook = { | |||||||
| created_at?: string; | ||||||||
| updated_at?: string; | ||||||||
| }; | ||||||||
|
|
||||||||
| export type UpdateChannelsBatchRequest = { | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Changing Request for Options feels more descriptive to me as word "request" would probably refer more the the HTTP request that holds this payload. Also word options is already used across the SDK. |
||||||||
| operation: string; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||||||||
| filter: UpdateChannelsBatchFilters; | ||||||||
| members?: string[] | Array<NewMemberPayload>; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the newly added members, right? |
||||||||
| data?: Partial<ChannelData>; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this be only Line 584 in 39abbb6
|
||||||||
| }; | ||||||||
|
|
||||||||
| export type UpdateChannelsBatchFilters = QueryFilters<{ | ||||||||
| cids?: | ||||||||
| | RequireOnlyOne<Pick<QueryFilter<string>, '$in'>> | ||||||||
| | RequireOnlyOne<Pick<QueryFilter<string[]>, '$eq'>> | ||||||||
|
Comment on lines
+4472
to
+4473
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe could be simplified to this if we want to allow |
||||||||
| | PrimitiveFilter<string[]>; | ||||||||
| types?: | ||||||||
| | RequireOnlyOne<Pick<QueryFilter<string>, '$in'>> | ||||||||
| | RequireOnlyOne<Pick<QueryFilter<string[]>, '$eq'>> | ||||||||
|
Comment on lines
+4476
to
+4477
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe could be simplified to this if we want to allow |
||||||||
| | PrimitiveFilter<string[]>; | ||||||||
| filter_tags?: | ||||||||
| | RequireOnlyOne<Pick<QueryFilter<string>, '$in'>> | ||||||||
| | RequireOnlyOne<Pick<QueryFilter<Record<string, string>>, '$eq'>> | ||||||||
|
Comment on lines
+4480
to
+4481
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe could be simplified to this if we want to allow |
||||||||
| | PrimitiveFilter<Record<string, string>>; | ||||||||
| }>; | ||||||||
|
|
||||||||
| export type UpdateChannelsBatchResponse = { | ||||||||
| result: Record<string, string>; | ||||||||
| } & Partial<TaskResponse>; | ||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing Request for Options feels more descriptive to me as word "request" would probably refer more the the HTTP request that holds this payload. Also word options is already used across the SDK.