stream-chat 5.1.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -55,7 +55,7 @@ type AdminMessage = { priorityLevel: number };
55
55
  type ChatAttachment = { originalURL?: string };
56
56
  type CustomReaction = { size?: number };
57
57
  type ChatEvent = { quitChannel?: boolean };
58
- type CustomCommands = 'imgur';
58
+ type CustomCommands = 'giphy';
59
59
 
60
60
  // Instantiate a new client (server side)
61
61
  // you can also use `new StreamChat<T,T,...>()`
@@ -145,17 +145,26 @@ client.connectUser({ id: 'testId', nickname: 'testUser', country: 'NL' }, 'TestT
145
145
  - [Logging](docs/logging.md)
146
146
  - [User Token](docs/userToken.md)
147
147
 
148
- ## Publishing a new version
148
+ ## Contributing
149
149
 
150
- Note that you need 2FA enabled on NPM, publishing with Yarn gives error, use NPM directly for this:
150
+ We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our license file for more details.
151
151
 
152
- ```bash
153
- npm version patch|minor|major
154
- ```
152
+ ### Commit message convention
155
153
 
156
- ## Contributing
154
+ Since we're autogenerating our [CHANGELOG](./CHANGELOG.md), we need to follow a specific commit message convention.
155
+ You can read about conventional commits [here](https://www.conventionalcommits.org/). Here's how a usual commit message looks like for a new feature: `feat: allow provided config object to extend other configs`. A bugfix: `fix: prevent racing of requests`.
157
156
 
158
- We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our license file for more details.
157
+ ## Release (for Stream developers)
158
+
159
+ Releasing this package involves two GitHub Action steps:
160
+
161
+ - Kick off a job called `initiate_release` ([link](https://github.com/GetStream/stream-chat-js/actions/workflows/initiate_release.yml)).
162
+
163
+ The job creates a pull request with the changelog. Check if it looks good.
164
+
165
+ - Merge the pull request.
166
+
167
+ Once the PR is merged, it automatically kicks off another job which will create the tag and created a GitHub release.
159
168
 
160
169
  ## We are hiring
161
170
 
@@ -714,6 +714,7 @@ var EVENT_MAP = {
714
714
  'channel.created': true,
715
715
  'channel.deleted': true,
716
716
  'channel.hidden': true,
717
+ 'channel.kicked': true,
717
718
  'channel.muted': true,
718
719
  'channel.truncated': true,
719
720
  'channel.unmuted': true,
@@ -3273,7 +3274,16 @@ var Channel = /*#__PURE__*/function () {
3273
3274
 
3274
3275
  case 'channel.truncated':
3275
3276
  channelState.clearMessages();
3276
- channelState.unreadCount = 0;
3277
+ channelState.unreadCount = 0; // system messages don't increment unread counts
3278
+
3279
+ if (event.message) {
3280
+ channelState.addMessageSorted(event.message);
3281
+
3282
+ if (event.message.pinned) {
3283
+ channelState.addPinnedMessage(event.message);
3284
+ }
3285
+ }
3286
+
3277
3287
  break;
3278
3288
 
3279
3289
  case 'member.added':
@@ -9047,7 +9057,7 @@ var StreamChat = /*#__PURE__*/function () {
9047
9057
  }, {
9048
9058
  key: "getUserAgent",
9049
9059
  value: function getUserAgent() {
9050
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.2");
9060
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.2.0");
9051
9061
  }
9052
9062
  }, {
9053
9063
  key: "setUserAgent",
@@ -9305,6 +9315,11 @@ var StreamChat = /*#__PURE__*/function () {
9305
9315
 
9306
9316
  return this.post("".concat(this.baseURL, "/export_channels"), payload);
9307
9317
  }
9318
+ }, {
9319
+ key: "exportUsers",
9320
+ value: function exportUsers(request) {
9321
+ return this.post("".concat(this.baseURL, "/export/users"), request);
9322
+ }
9308
9323
  }, {
9309
9324
  key: "exportChannel",
9310
9325
  value: function exportChannel(request, options) {