@devanachat/sdk 0.9.0 → 0.11.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/build/index.cjs.js +322 -105
  3. package/build/index.cjs.js.map +1 -1
  4. package/build/index.mjs +317 -105
  5. package/build/index.mjs.map +1 -1
  6. package/build/index.umd.js +1 -1
  7. package/build/index.umd.js.map +1 -1
  8. package/build/types/AbstractChatClient.d.ts +5 -1
  9. package/build/types/Permissions.d.ts +8 -0
  10. package/build/types/index.d.ts +5 -4
  11. package/build/types/protocol/index.d.ts +9 -4
  12. package/build/types/protocol/schemes/Message.d.ts +1 -1
  13. package/build/types/protocol/schemes/PmParticipant.d.ts +8 -0
  14. package/build/types/protocol/schemes/Role.d.ts +6 -0
  15. package/build/types/protocol/schemes/Room.d.ts +3 -0
  16. package/build/types/protocol/schemes/Space.d.ts +1 -0
  17. package/build/types/protocol/schemes/Topic.d.ts +1 -0
  18. package/build/types/protocol/schemes/commands/CreateMessage.d.ts +1 -0
  19. package/build/types/protocol/schemes/commands/GetIgnoredRooms.d.ts +2 -0
  20. package/build/types/protocol/schemes/commands/LeaveRoom.d.ts +1 -0
  21. package/build/types/protocol/schemes/commands/Type.d.ts +4 -0
  22. package/build/types/protocol/schemes/commands/UpdateRole.d.ts +2 -0
  23. package/build/types/protocol/schemes/commands/UpdateSpace.d.ts +1 -0
  24. package/build/types/protocol/schemes/commands/UpdateTopic.d.ts +1 -0
  25. package/build/types/protocol/schemes/events/Error.d.ts +7 -0
  26. package/build/types/protocol/schemes/events/IgnoredRooms.d.ts +4 -0
  27. package/build/types/protocol/schemes/events/NewMessage.d.ts +1 -0
  28. package/build/types/protocol/schemes/events/Typing.d.ts +5 -0
  29. package/build/types/state-tracker/PermissionsManager.d.ts +1 -1
  30. package/build/types/state-tracker/RoomsManager.d.ts +4 -1
  31. package/build/types/state-tracker/StateSnapshot.d.ts +1 -1
  32. package/build/types/state-tracker/TypingManager.d.ts +35 -0
  33. package/build/types/state-tracker/UsersManager.d.ts +7 -1
  34. package/build/types/state-tracker/functions.d.ts +12 -1
  35. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,73 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
8
 
9
9
  ### Added
10
10
 
11
+ - Typing notifications: the `Type` command and the `Typing` event (`{location, userId}`), for rooms other than
12
+ `ClassicText`. `RoomsManager.typing.get(roomId, topicId)` returns the ids of the users typing in a topic, tracked from
13
+ the first call, each leaving `TYPING_TIMEOUT_MS` after their last notification or with their message.
14
+ `RoomsManager.typing.notify(roomId, topicId)` sends `Type` at most once per `TYPING_INTERVAL_MS`.
15
+ - Sticky messages: `Topic.stickyMessage`, `CreateMessage.sticky`, `NewMessage.sticky`, `UpdateTopic.stickyMessageId`
16
+ (a message id sticks it, `null` unsticks it) and the `ManagePins` permission. The topics tracked by `RoomsManager`
17
+ take a new sticky message from `NewMessage` and drop it when it is redacted.
18
+ - Role icons: `Role.icon` (`RoleIcon` - an emoji or an emoticon of the space, `{type, value}` like a reaction) and
19
+ `UpdateRole.icon` (an icon sets it, `null` removes it).
20
+ - Guests: `Space.guestRole` and `UpdateSpace.guestRole` (a role of the space given to temporary accounts when they
21
+ join, `null` turns it off); `SpacesManager` clears it when the role is deleted. The `SendAttachments` permission
22
+ covers attachments and links in messages.
23
+ - `Error.subcode`: an optional refinement of `code`. `ErrorCode.SpaceJoinRestricted` (`JoinSpace` refused) comes with
24
+ `Guests` (the space does not accept temporary accounts) or `Vpn` (it does not accept connections through a VPN or
25
+ Tor).
26
+
27
+ ### Changed
28
+
29
+ - `PermissionsManager.calculatePermissions` follows the server: on every layer the space default role (everyone) is
30
+ applied before the other roles, so a deny of another role overrides what everyone allows. An allow of any role still
31
+ wins over a deny of another one.
32
+ - `LeaveRoom` with `ignore: true` is answered only with `RoomLeft`: like a plain `LeaveRoom`, it requires the membership
33
+ of the room and fails for a closed conversation instead of answering `Ok`.
34
+
35
+ ### Fixed
36
+
37
+ - After a reconnect, or the first session after a snapshot import, `RoomsManager.getMembers()` of an unchanged
38
+ private conversation sent `GetRoomMembers` instead of using its participants.
39
+
40
+ ## [0.10.0]
41
+
42
+ ### Added
43
+
44
+ - Group private conversations: a `Pm` room has 1 (notes), 2 or 3-10 participants; `CreateRoom` takes up to 9
45
+ `recipientIds` and, for a new conversation of 3 or more people, a `name`.
46
+ - `Room.participants` (`PmParticipant[]`, `null` for rooms of spaces): the users of a private conversation with their
47
+ `flags`; `PmParticipantFlag.IgnoresRoom` marks a participant ignoring it. The members of a private conversation
48
+ (`RoomsManager.getMembers()`) are its participants without the ones ignoring it, rebuilt on `RoomUpdated`, and the
49
+ participants land in `UsersManager.getAvailable()`.
50
+ - `isGroupPm(room)` and `getPmPeers(room, meId)` helpers.
51
+ - Ignoring a group conversation: `LeaveRoom` takes `ignore: true` (answered with `RoomLeft`, or `Ok` when the
52
+ user was not its member); `JoinRoom` of the ignoring participant stops ignoring it. `GetIgnoredRooms` returns the
53
+ ignored conversations as `IgnoredRooms`. `CreateRoom` for an ignored conversation fails with
54
+ `ErrorCode.RoomIgnored`, its id in `Error.details.roomId`.
55
+ - `UpdateRoom` changes the name of a group conversation (only `name` is accepted for a `Pm` room).
56
+ - Message type `RoomRename` (content: the new name, empty when the name was removed); `RoomJoin` and `RoomLeave` in a
57
+ group conversation mean stopping and starting to ignore it.
58
+
59
+ ### Changed
60
+
61
+ - **Breaking:** the members of a private conversation and its users in `UsersManager` come from `Room.participants`,
62
+ so a server that does not send `participants` leaves private conversations without members.
63
+ - `STATE_SNAPSHOT_VERSION` is 2 - snapshots of the previous version (rooms without `participants`) are rejected on
64
+ import.
65
+
66
+ ### Deprecated
67
+
68
+ - `Room.recipients` - use `Room.participants`.
69
+
70
+ ### Fixed
71
+
72
+ - `RoomMemberUpdated` of a member missing from the room's collection threw instead of being skipped.
73
+
74
+ ## [0.9.0]
75
+
76
+ ### Added
77
+
11
78
  - `Permissions.list.UseExternalEmoticons` (`1 << 26`, space and room layer): using emoticons of other spaces.
12
79
  - `UserFeature.ExternalEmoticons` (`user.external_emoticons`): the account may use emoticons outside their spaces.
13
80
  - `MessageReaction.name` and `ToggledReaction.name`: the emoticon name of an `Emoticon` reaction.