@devanachat/sdk 0.13.0 → 0.15.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/CHANGELOG.md +99 -1
- package/build/index.cjs.js +686 -15
- package/build/index.cjs.js.map +1 -1
- package/build/index.mjs +684 -15
- package/build/index.mjs.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/build/types/AbstractChatClient.d.ts +28 -1
- package/build/types/Permissions.d.ts +38 -0
- package/build/types/index.d.ts +6 -3
- package/build/types/protocol/index.d.ts +35 -2
- package/build/types/protocol/schemes/Activity.d.ts +16 -0
- package/build/types/protocol/schemes/Call.d.ts +35 -0
- package/build/types/protocol/schemes/IncomingCall.d.ts +6 -0
- package/build/types/protocol/schemes/Message.d.ts +3 -1
- package/build/types/protocol/schemes/MessageCall.d.ts +9 -0
- package/build/types/protocol/schemes/Room.d.ts +2 -0
- package/build/types/protocol/schemes/RoomCall.d.ts +6 -0
- package/build/types/protocol/schemes/SavedItem.d.ts +7 -0
- package/build/types/protocol/schemes/UserData.d.ts +1 -0
- package/build/types/protocol/schemes/UserState.d.ts +4 -0
- package/build/types/protocol/schemes/commands/DeclineCall.d.ts +3 -0
- package/build/types/protocol/schemes/commands/GetActivities.d.ts +3 -0
- package/build/types/protocol/schemes/commands/GetCallMembers.d.ts +5 -0
- package/build/types/protocol/schemes/commands/GetSavedItems.d.ts +3 -0
- package/build/types/protocol/schemes/commands/InviteToCall.d.ts +5 -0
- package/build/types/protocol/schemes/commands/JoinCall.d.ts +4 -0
- package/build/types/protocol/schemes/commands/KickCallMember.d.ts +4 -0
- package/build/types/protocol/schemes/commands/MuteCallMember.d.ts +4 -0
- package/build/types/protocol/schemes/commands/SaveItem.d.ts +5 -0
- package/build/types/protocol/schemes/commands/SetPermissionOverwrites.d.ts +1 -0
- package/build/types/protocol/schemes/commands/SetSessionData.d.ts +1 -0
- package/build/types/protocol/schemes/commands/SetUserData.d.ts +1 -0
- package/build/types/protocol/schemes/commands/UnsaveItem.d.ts +5 -0
- package/build/types/protocol/schemes/commands/UpdateActivities.d.ts +4 -0
- package/build/types/protocol/schemes/commands/UpdateCallMember.d.ts +7 -0
- package/build/types/protocol/schemes/commands/UpdateRoom.d.ts +2 -0
- package/build/types/protocol/schemes/events/Activities.d.ts +9 -0
- package/build/types/protocol/schemes/events/ActivityDeleted.d.ts +3 -0
- package/build/types/protocol/schemes/events/ActivityUpdated.d.ts +4 -0
- package/build/types/protocol/schemes/events/CallJoined.d.ts +7 -0
- package/build/types/protocol/schemes/events/CallMemberJoined.d.ts +5 -0
- package/build/types/protocol/schemes/events/CallMemberLeft.d.ts +4 -0
- package/build/types/protocol/schemes/events/CallMemberUpdated.d.ts +6 -0
- package/build/types/protocol/schemes/events/CallMembers.d.ts +5 -0
- package/build/types/protocol/schemes/events/CallUpdated.d.ts +5 -0
- package/build/types/protocol/schemes/events/CallVideoLimitReached.d.ts +4 -0
- package/build/types/protocol/schemes/events/Error.d.ts +9 -1
- package/build/types/protocol/schemes/events/IncomingCallUpdated.d.ts +5 -0
- package/build/types/protocol/schemes/events/ItemSaved.d.ts +6 -0
- package/build/types/protocol/schemes/events/ItemUnsaved.d.ts +5 -0
- package/build/types/protocol/schemes/events/NewActivity.d.ts +8 -0
- package/build/types/protocol/schemes/events/SavedItems.d.ts +6 -0
- package/build/types/state-tracker/ActivitiesManager.d.ts +63 -0
- package/build/types/state-tracker/CallsManager.d.ts +74 -0
- package/build/types/state-tracker/ChatStateTracker.d.ts +18 -0
- package/build/types/state-tracker/SavedItemsManager.d.ts +46 -0
- package/build/types/state-tracker/StateSnapshot.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,105 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project follows
|
|
5
5
|
[semver](https://semver.org) (`0.x` minor releases may break the API).
|
|
6
6
|
|
|
7
|
-
## [
|
|
7
|
+
## [0.15.0]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Activities: your latest personal events from all spaces - a mention of you or of your role, a reply to you, a
|
|
12
|
+
reaction to your message, a reply in a thread you follow and a missed call - and the activities the server publishes
|
|
13
|
+
itself, with a `title`, a `description` and a `link`. Private conversations keep their own unread state: apart from a
|
|
14
|
+
missed call they make no activities. Bots have none: their `GetActivities` and `UpdateActivity` fail with
|
|
15
|
+
`UserTypeException`. The protocol: the `GetActivities` command answered with `Activities` - up to 20 `Activity`
|
|
16
|
+
objects, newest first, and the `seenAt` time; with `withMessages` also the messages they point at and their actors
|
|
17
|
+
(`users`), which are empty otherwise. The `UpdateActivity` command (`seenAt` marks the list as seen, `clear` empties
|
|
18
|
+
it) is answered with `ActivityUpdated`, which every session of the user gets. The event `NewActivity` carries the
|
|
19
|
+
new activity with its `message` and its actor (`users`), `ActivityDeleted` an activity the server deleted. Activities
|
|
20
|
+
of one group (`groupKey`: reactions to one message, replies in one thread) join while unseen: `count` grows,
|
|
21
|
+
`actorIds` keeps the last three and `messageId` points at the newest message. `Activity.isRead` is set once the
|
|
22
|
+
message of the activity is acknowledged (`Ack`; reactions excepted); a live `NewActivity` of a message comes a few
|
|
23
|
+
seconds late and only to those who have not acknowledged it by then, so an activity in the topic you are reading
|
|
24
|
+
does not show at all.
|
|
25
|
+
- `ChatStateTracker.activities` (`ActivitiesManager`): `get(fetchWithMessages)` resolves with an observable collection
|
|
26
|
+
of the activities keyed by id, `getMessages()` and `getUsers()` with the collections of their messages and actors,
|
|
27
|
+
and `seenAt` (with a `seenAtChange` event) tells when the list was last seen; the activities created later that are
|
|
28
|
+
not `isRead` are the unread ones. Nothing is fetched until you ask; afterwards a reconnect fetches again what was
|
|
29
|
+
fetched, with one request, into the same collections - also when the first fetch failed because the connection was
|
|
30
|
+
not ready. A live activity joins its group the way the server does; `ActivityUpdated`, `ActivityDeleted`,
|
|
31
|
+
`FollowedTopicUpdated` (an acknowledgement, also from another device), edits and deletions of the messages and
|
|
32
|
+
deleted rooms change the collections; leaving a room hides its activities and rejoining brings them back. The
|
|
33
|
+
collection order is not meaningful - sort by `createdAt`. Activities are not part of the state snapshot.
|
|
34
|
+
- Saved items: rooms (private conversations included) and messages you save to keep at hand. The protocol: the
|
|
35
|
+
`SaveItem` and `UnsaveItem` commands (`type` `Room` or `Message` and the `id`), answered with `ItemSaved` (the
|
|
36
|
+
`SavedItem` and, for a message, its `Message`) and `ItemUnsaved`, which the other sessions of the user get as
|
|
37
|
+
events when something changed; the `GetSavedItems` command answered with `SavedItems` - the items, newest first, and
|
|
38
|
+
with `withMessages` the saved messages too. Items of rooms you are not a member of are left out until you rejoin.
|
|
39
|
+
Saving over the server limit fails with `ErrorCode.SavedItemsLimitReached` (`subcode` `Room` or `Message`). Bots have
|
|
40
|
+
none: their commands fail with `ErrorCode.UserType`.
|
|
41
|
+
- `ChatStateTracker.savedItems` (`SavedItemsManager`): `get(fetchWithMessages)` resolves with an observable collection
|
|
42
|
+
of the items keyed by `savedItemKey(type, id)`, `getMessages()` with the collection of the saved messages, and
|
|
43
|
+
`isSaved()`. Nothing is fetched until you ask; afterwards a reconnect fetches again what was fetched, with one request,
|
|
44
|
+
into the same collections. `ItemSaved` / `ItemUnsaved` (also from another device), edits and deletions of the saved
|
|
45
|
+
messages and deleted rooms change the collections; leaving a room hides its items and rejoining brings them back. The
|
|
46
|
+
collection order is not meaningful - sort by `SavedItem.savedAt`. Saved items are not part of the state snapshot.
|
|
47
|
+
- The `StartCalls` permission (`2 ** 34`, up to the room layer): starting a call in a room, in every call mode. It
|
|
48
|
+
takes effect only together with `JoinCalls`, as whoever starts a call joins it.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- Room call permissions mean the same in every call mode. `JoinCalls` lets you join an ongoing call and no longer
|
|
53
|
+
start one: without `StartCalls` the `JoinCall` that would start a call fails with the `AccessDeniedException` error.
|
|
54
|
+
`ManageCalls` no longer lets you start an event (`Stage`). Whoever starts an event speaks in it, also without
|
|
55
|
+
`ManageCalls`. Private conversations still check none of these.
|
|
56
|
+
|
|
57
|
+
## [0.14.0]
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- Voice and video calls in rooms. The protocol: commands `JoinCall` (answered with `CallJoined`: the media server URL,
|
|
62
|
+
token and quality), `DeclineCall`, `InviteToCall`, `MuteCallMember` and `KickCallMember`; events
|
|
63
|
+
`CallUpdated` (a call started, changed or ended), `CallMemberJoined`, `CallMemberUpdated` and `CallMemberLeft`
|
|
64
|
+
(a change of a single member), `IncomingCallUpdated` (an `IncomingCall` - the call and its caller - started or
|
|
65
|
+
stopped ringing at you) and `CallVideoLimitReached` (the server took your camera or screen share away because of
|
|
66
|
+
the video limit of the call); `Session.state.calls` with the ongoing calls, each with its `location`, and
|
|
67
|
+
`Session.state.incomingCalls` with the calls ringing at you; the `Call` message type
|
|
68
|
+
with `Message.call` (status, the `mode` the call had, duration, `memberCount` and some of the members in
|
|
69
|
+
`partialMembers`) and the
|
|
70
|
+
`CallJoin` / `CallLeave` messages in the call's topic; the `GetCallMembers` command answered with `CallMembers`
|
|
71
|
+
(`CallsManager.getMembers(messageId, {limit, offset})`) for all the members of the call of a message;
|
|
72
|
+
`SessionPush.voipToken` for the iOS PushKit token; error codes `CallsUnavailable`, `CallFull`, `CallNotFound` and
|
|
73
|
+
`TooManyCallInvitees`. The SDK does the signalling only - connect to the media server with the access yourself.
|
|
74
|
+
- `ChatStateTracker.calls` (`CallsManager`): `get()` - the ongoing calls in your rooms keyed by room id, `getRinging()`
|
|
75
|
+
- the calls ringing at you, and `join`, `decline`, `invite`, `muteMember` and `kickMember`. The member events
|
|
76
|
+
replace the tracked call with a new object, and a `getRinging()` entry is replaced with a new object when its call
|
|
77
|
+
changes. `CallUpdated` of a room you are not in is ignored. Calls are not part of the state snapshot.
|
|
78
|
+
- Call modes, set per room in `Room.call` / `UpdateRoom.call` (`RoomCall`: `mode`, `userLimit`, `turnSeconds`):
|
|
79
|
+
`Conversation` (everyone speaks), `Stage` (moderators bring listeners who raised a hand on the stage) and `Queue`
|
|
80
|
+
(members raise a hand to take turns). `Call.mode`, `Call.turn` (who speaks until when, and by when they have to turn
|
|
81
|
+
the microphone on, or the turn ends - null once they did), `CallMember.handRaisedAt` (`CallsManager.getQueue(call)`
|
|
82
|
+
orders the raised hands), `CallMemberFlag` (`Camera`, `ScreenShare`, `Speaker`, `RaiseBlocked`), the optional title of a call
|
|
83
|
+
started with `JoinCall`, the `UpdateCallMember` command (`CallsManager.updateMember`: raising and lowering a hand,
|
|
84
|
+
moving on and off the stage, which also ends or skips a turn) and the `CallMode` error code for an operation the
|
|
85
|
+
mode of the call does not allow.
|
|
86
|
+
- `UserData.acceptCalls` (true by default) and `SetUserData.acceptCalls` (null or left out keeps it): with it off,
|
|
87
|
+
`JoinCall` starting a call in a one-to-one private room with you fails with the new `CallsNotAccepted` error code.
|
|
88
|
+
- `Call.autoEndAt`: when the server ends the call because nobody is left to talk with (null while it is not going to).
|
|
89
|
+
- Permissions `JoinCalls` (2^30), `ShareVideo` (2^31), `InviteToCall` (2^32) and `ManageCalls` (2^33). The last
|
|
90
|
+
three lie beyond the 31 bits JavaScript bitwise operators handle, so check and build permission masks with the
|
|
91
|
+
new `Permissions.has(mask, name)`, `Permissions.union(...masks)` and `Permissions.subtract(mask, removed)` instead
|
|
92
|
+
of `&`, `|` and `~`.
|
|
93
|
+
- `SetPermissionOverwrites.knownPermissions`: the mask of the permissions the client knows. The server changes only
|
|
94
|
+
these bits of the overwrites; without it, it keeps the bits from 2^30 up, so an older client does not clear the call
|
|
95
|
+
permissions it cannot show. `Permissions.getKnownMask()` gives the mask of all the permissions of the SDK for it.
|
|
96
|
+
|
|
97
|
+
### Changed
|
|
98
|
+
|
|
99
|
+
- `Room.call` is required, as are `UserState.calls` and `UserState.incomingCalls` - the server always sends them.
|
|
100
|
+
`MessageType` has the new `Call`, `CallJoin` and `CallLeave` values, so a `switch` over it may need new cases.
|
|
101
|
+
- State snapshots: version 4 (rooms with `call`); older snapshots are rejected.
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
|
|
105
|
+
- `PermissionsManager` computes permissions beyond the 31st bit correctly.
|
|
8
106
|
|
|
9
107
|
## [0.13.0]
|
|
10
108
|
|