stream-chat 10.0.0-rc.17 → 10.0.0-rc.19
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 +4 -2
- package/dist/cjs/index.browser.js +1291 -2050
- package/dist/cjs/index.browser.js.map +4 -4
- package/dist/cjs/index.node.js +1291 -2050
- package/dist/cjs/index.node.js.map +4 -4
- package/dist/esm/index.mjs +1291 -2050
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/api-client.d.ts +9 -5
- package/dist/types/channel.d.ts +29 -68
- package/dist/types/client.d.ts +24 -37
- package/dist/types/errors.d.ts +5 -1
- package/dist/types/gen/chat/ChatApi.d.ts +122 -104
- package/dist/types/gen/models/index.d.ts +314 -9
- package/dist/types/gen/moderation/ModerationApi.d.ts +15 -13
- package/dist/types/messageOperations/FailedSendCache.d.ts +34 -0
- package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +2 -2
- package/dist/types/messageOperations/MessageOperations.d.ts +37 -31
- package/dist/types/messageOperations/createMessageOperations.d.ts +1 -1
- package/dist/types/messageOperations/index.d.ts +1 -5
- package/dist/types/messageOperations/types.d.ts +14 -4
- package/dist/types/offline-support/queueableOperations.d.ts +21 -1
- package/dist/types/offline-support/types.d.ts +7 -7
- package/dist/types/poll.d.ts +21 -3
- package/dist/types/poll_optimistic_votes.d.ts +61 -0
- package/dist/types/reminders/ReminderManager.d.ts +5 -4
- package/dist/types/thread.d.ts +1 -18
- package/dist/types/types.d.ts +7 -24
- package/package.json +1 -1
- package/src/api-client.ts +27 -4
- package/src/channel.ts +68 -146
- package/src/client.ts +44 -91
- package/src/connection/wsConnection/StableWSConnection.ts +2 -19
- package/src/errors.ts +11 -1
- package/src/gen/chat/ChannelApi.ts +46 -36
- package/src/gen/chat/ChatApi.ts +443 -1531
- package/src/gen/models/index.ts +327 -9
- package/src/gen/moderation/ModerationApi.ts +87 -371
- package/src/messageComposer/messageComposer.ts +2 -2
- package/src/messageOperations/FailedSendCache.ts +90 -0
- package/src/messageOperations/MessageOperationStatePolicy.ts +85 -68
- package/src/messageOperations/MessageOperations.ts +173 -198
- package/src/messageOperations/createMessageOperations.ts +103 -50
- package/src/messageOperations/index.ts +1 -15
- package/src/messageOperations/types.ts +18 -3
- package/src/offline-support/offline_support_api.ts +1 -1
- package/src/offline-support/queueableOperations.ts +63 -11
- package/src/offline-support/types.ts +7 -7
- package/src/pagination/paginators/MessageIntervalPaginator.ts +7 -6
- package/src/pagination/paginators/ReminderPaginator.ts +3 -2
- package/src/poll.ts +107 -95
- package/src/poll_optimistic_votes.ts +335 -0
- package/src/reminders/ReminderManager.ts +12 -17
- package/src/thread.ts +22 -6
- package/src/types.ts +11 -28
- package/dist/types/messageOperations/WithMessageOperations.d.ts +0 -35
- package/dist/types/messageOperations/optimistic.d.ts +0 -118
- package/dist/types/messageOperations/persistence.d.ts +0 -21
- package/src/messageOperations/WithMessageOperations.ts +0 -60
- package/src/messageOperations/optimistic.ts +0 -257
- package/src/messageOperations/persistence.ts +0 -40
package/README.md
CHANGED
|
@@ -60,10 +60,12 @@ const channel = client.channel('messaging', 'test-channel', {
|
|
|
60
60
|
await channel.create();
|
|
61
61
|
|
|
62
62
|
// send message
|
|
63
|
-
const { message } = await channel.sendMessage({
|
|
63
|
+
const { message } = await channel.sendMessage({
|
|
64
|
+
message: { text: 'This is a test message' },
|
|
65
|
+
});
|
|
64
66
|
|
|
65
67
|
// send reaction
|
|
66
|
-
await
|
|
68
|
+
await client.sendReaction({ id: message.id }, { reaction: { type: 'love' } });
|
|
67
69
|
```
|
|
68
70
|
|
|
69
71
|
The `StreamChat` client is set up to allow extension of the base types through use of module augmentation, custom types will carry through to all client returns and provide code-completion to queries (if supported). To extend Stream's entities with custom data you'll have to create a declaration file and make sure it's loaded by TypeScript, [see the list of extendable interfaces](https://github.com/GetStream/stream-chat-js/blob/master/src/custom_types.ts) and the example bellow using two of the most common ones:
|