@zextras/carbonio-ws-collaboration-ui-sdk 0.5.0 → 0.6.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/dist/{asyncapi-DB0usrAf.d.cts → asyncapi-DCETfyZY.d.cts} +82 -1
- package/dist/{asyncapi-DB0usrAf.d.ts → asyncapi-DCETfyZY.d.ts} +82 -1
- package/dist/index.cjs +94 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -8
- package/dist/index.d.ts +49 -8
- package/dist/index.js +94 -9
- package/dist/index.js.map +1 -1
- package/dist/testing/index.cjs +52 -0
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +6 -2
- package/dist/testing/index.d.ts +6 -2
- package/dist/testing/index.js +48 -0
- package/dist/testing/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpMethod, a as HttpPorts, c as components, W as WireMessage, b as WireInboxEntry, d as WireSystemEvent, e as WireReadMarker, f as WireTimelineMessage, g as WirePresenceStatus, h as WireTimeline } from './asyncapi-
|
|
2
|
-
export { F as FetchLike, i as HeadersLike, L as Logger, R as RequestInitLike, j as ResponseLike, V as VersionStore, k as WireInboxMember, l as WireInboxResponse, m as WireInboxRoom, n as WireMessageSearchResult, o as WirePinnedMessage, p as WireTimelineItem } from './asyncapi-
|
|
1
|
+
import { H as HttpMethod, a as HttpPorts, c as components, W as WireMessage, b as WireInboxEntry, d as WireSystemEvent, e as WireReadMarker, f as WireTimelineMessage, g as WirePresenceStatus, h as WireTimeline } from './asyncapi-DCETfyZY.cjs';
|
|
2
|
+
export { F as FetchLike, i as HeadersLike, L as Logger, R as RequestInitLike, j as ResponseLike, V as VersionStore, k as WireInboxMember, l as WireInboxResponse, m as WireInboxRoom, n as WireMessageSearchResult, o as WirePinnedMessage, p as WireTimelineItem } from './asyncapi-DCETfyZY.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Per-room FIFO queue for REST writes (send/edit/delete/forward). XMPP
|
|
@@ -243,6 +243,23 @@ type WireMessageUnpinnedEvent = WirePushEvent<Schemas['MessageUnpinned']>;
|
|
|
243
243
|
* room id: the creation lines written with the room are not announced.
|
|
244
244
|
*/
|
|
245
245
|
type WireRoomCreatedEvent = WirePushEvent<Schemas['RoomCreated']>;
|
|
246
|
+
/**
|
|
247
|
+
* `RoomUpdated` push event. `nameSystemEventId` and `descriptionSystemEventId`
|
|
248
|
+
* are present only for the field the update actually changed: the backend
|
|
249
|
+
* writes one `ROOM_NAME_CHANGED` or `ROOM_DESCRIPTION_CHANGED` system event
|
|
250
|
+
* each, name first.
|
|
251
|
+
*/
|
|
252
|
+
type WireRoomUpdatedEvent = WirePushEvent<Schemas['RoomUpdated']>;
|
|
253
|
+
/** `RoomPictureChanged` push event, with the `ROOM_PICTURE_UPDATED` system event id. */
|
|
254
|
+
type WireRoomPictureChangedEvent = WirePushEvent<Schemas['RoomPictureChanged']>;
|
|
255
|
+
/** `RoomPictureDeleted` push event, with the `ROOM_PICTURE_DELETED` system event id. */
|
|
256
|
+
type WireRoomPictureDeletedEvent = WirePushEvent<Schemas['RoomPictureDeleted']>;
|
|
257
|
+
/**
|
|
258
|
+
* `RoomHistoryCleared` push event. `clearedBy` and `systemEventId` only when an
|
|
259
|
+
* owner clears a temporary room for everyone, which writes a
|
|
260
|
+
* `ROOM_HISTORY_CLEARED` system event; the per-user clear writes none.
|
|
261
|
+
*/
|
|
262
|
+
type WireRoomHistoryClearedEvent = WirePushEvent<Schemas['RoomHistoryCleared']>;
|
|
246
263
|
/**
|
|
247
264
|
* `RoomMemberAdded` push event, one per added member. A bulk add writes one
|
|
248
265
|
* `MEMBER_ADDED` system event, so every event of the bulk carries the same
|
|
@@ -251,8 +268,9 @@ type WireRoomCreatedEvent = WirePushEvent<Schemas['RoomCreated']>;
|
|
|
251
268
|
type WireRoomMemberAddedEvent = WirePushEvent<Schemas['RoomMemberAdded']>;
|
|
252
269
|
/**
|
|
253
270
|
* `RoomMemberRemoved` push event. `removedBy` is the member itself on a
|
|
254
|
-
* leave
|
|
255
|
-
*
|
|
271
|
+
* leave and the first room owner on an automatic removal (temporary room
|
|
272
|
+
* clean-up). Backends before `ec635ad1` omit it, together with
|
|
273
|
+
* `systemEventId`, on an automatic removal, which then writes no system event.
|
|
256
274
|
*/
|
|
257
275
|
type WireRoomMemberRemovedEvent = WirePushEvent<Schemas['RoomMemberRemoved']>;
|
|
258
276
|
/**
|
|
@@ -721,9 +739,32 @@ type WscClient = {
|
|
|
721
739
|
handleRoomMemberAdded: (event: WireRoomMemberAddedEvent) => StoreConfigurationMessage | undefined;
|
|
722
740
|
/**
|
|
723
741
|
* `RoomMemberRemoved` push event: lands the `memberRemoved` line. Returns
|
|
724
|
-
* the row, or undefined
|
|
742
|
+
* the row, or undefined when the event announces no line.
|
|
725
743
|
*/
|
|
726
744
|
handleRoomMemberRemoved: (event: WireRoomMemberRemovedEvent) => StoreConfigurationMessage | undefined;
|
|
745
|
+
/**
|
|
746
|
+
* `RoomUpdated` push event: lands the `roomNameChanged` and
|
|
747
|
+
* `roomDescriptionChanged` lines the update wrote, name first. Returns the
|
|
748
|
+
* rows, none when the update changed neither field. The app still applies
|
|
749
|
+
* the new name and description to the room.
|
|
750
|
+
*/
|
|
751
|
+
handleRoomUpdated: (event: WireRoomUpdatedEvent) => Array<StoreConfigurationMessage>;
|
|
752
|
+
/**
|
|
753
|
+
* `RoomPictureChanged` push event: lands the `roomPictureUpdated` line.
|
|
754
|
+
* Returns the row, or undefined when the event announces no line.
|
|
755
|
+
*/
|
|
756
|
+
handleRoomPictureChanged: (event: WireRoomPictureChangedEvent) => StoreConfigurationMessage | undefined;
|
|
757
|
+
/**
|
|
758
|
+
* `RoomPictureDeleted` push event: lands the `roomPictureDeleted` line.
|
|
759
|
+
* Returns the row, or undefined when the event announces no line.
|
|
760
|
+
*/
|
|
761
|
+
handleRoomPictureDeleted: (event: WireRoomPictureDeletedEvent) => StoreConfigurationMessage | undefined;
|
|
762
|
+
/**
|
|
763
|
+
* `RoomHistoryCleared` push event: lands the `roomHistoryCleared` line of a
|
|
764
|
+
* temporary room cleared for everyone. Returns the row, or undefined on the
|
|
765
|
+
* per-user clear. The app still clears the conversation.
|
|
766
|
+
*/
|
|
767
|
+
handleRoomHistoryCleared: (event: WireRoomHistoryClearedEvent) => StoreConfigurationMessage | undefined;
|
|
727
768
|
/**
|
|
728
769
|
* `MeetingStarted` push event: lands the `meetingStarted` line in the
|
|
729
770
|
* meeting's room, resolved by the app. Returns the row, or undefined when
|
|
@@ -947,8 +988,8 @@ type SystemLinesDeps = {
|
|
|
947
988
|
declare function handleRoomMemberAdded({ bridge }: SystemLinesDeps, event: WireRoomMemberAddedEvent): StoreConfigurationMessage | undefined;
|
|
948
989
|
/**
|
|
949
990
|
* `RoomMemberRemoved` push event: lands the `memberRemoved` line, whose value
|
|
950
|
-
* is the removed member. Returns the row, or undefined
|
|
951
|
-
* removal
|
|
991
|
+
* is the removed member. Returns the row, or undefined when the event
|
|
992
|
+
* announces no line (an automatic removal on backends before `ec635ad1`).
|
|
952
993
|
*/
|
|
953
994
|
declare function handleRoomMemberRemoved({ bridge }: SystemLinesDeps, event: WireRoomMemberRemovedEvent): StoreConfigurationMessage | undefined;
|
|
954
995
|
/**
|
|
@@ -1068,4 +1109,4 @@ declare class WscApiError extends Error {
|
|
|
1068
1109
|
|
|
1069
1110
|
declare function buildQueryString(params: Record<string, string | number | boolean | undefined | null>): string;
|
|
1070
1111
|
|
|
1071
|
-
export { type ConfirmAttachmentUploadParams, type EditMessageParams, type FetchTimelineGapOptions, type FetchTimelineOptions, type FindPinnedMessage, type ForwardMessageRef, type HttpClient, HttpMethod, HttpPorts, type JsonBody, type MappedInboxEntry, type MappedTimelinePage, type MessagesDeps, type PresenceDeps, type PresenceUpdate, type ReadDeps, type SearchDeps, type SearchMessagesOptions, type SearchMessagesResult, type SendMessageParams, type StoreAttachment, type StoreBridge, type StoreConfigurationMessage, type StoreFasteningAction, type StoreForwardedInfo, type StoreMarker, type StoreMarkerStatus, type StoreMessage, type StoreMessageFastening, type StoreOperationType, type StoreTextMessage, type SystemLinesDeps, TYPING_EXPIRE_MS, type TimelineDeps, type TypingDeps, type TypingTimers, WSC_API_VERSION_HEADER, WireInboxEntry, type WireMeetingDeclinedEvent, type WireMeetingStartedEvent, type WireMeetingStoppedEvent, WireMessage, type WireMessageDeletedEvent, type WireMessageEditedEvent, type WireMessageForwardedEvent, type WireMessagePinnedEvent, type WireMessageReceivedEvent, type WireMessageUnpinnedEvent, type WirePresenceChangedEvent, WirePresenceStatus, type WireReactionChangedEvent, WireReadMarker, type WireReadUpdatedEvent, type WireRoomCreatedEvent, type WireRoomMemberAddedEvent, type WireRoomMemberRemovedEvent, WireSystemEvent, WireTimeline, WireTimelineMessage, type WireTypingEvent, type WireWsErrorEvent, WscApiError, type WscClient, type WscClientDeps, applyPresenceUpdates, buildQueryString, confirmAttachmentUpload, createHttpClient, createTypingTimers, createWscClient, deleteMessage, editMessage, fetchInbox, fetchPinnedMessage, fetchPresence, fetchRoomReadMarkers, fetchTimeline, fetchTimelineGap, forwardMessages, handleMeetingDeclined, handleMeetingStarted, handleMeetingStopped, handleMessageDeleted, handleMessageEdited, handleMessageForwarded, handleMessagePinned, handleMessageReceived, handleMessageUnpinned, handlePresenceChanged, handleReactionChanged, handleReadUpdated, handleRoomMemberAdded, handleRoomMemberRemoved, handleTyping, mapInboxEntry, mapPresenceStatus, mapSearchMessageToStoreMessage, mapSystemEventToStoreMessage, mapTimelinePage, mapWireMarkerToStoreMarker, mapWireMessageToStoreMessage, markAsRead, pinMessage, removeReaction, searchMessages, sendMessage, sendReaction, unpinMessage };
|
|
1112
|
+
export { type ConfirmAttachmentUploadParams, type EditMessageParams, type FetchTimelineGapOptions, type FetchTimelineOptions, type FindPinnedMessage, type ForwardMessageRef, type HttpClient, HttpMethod, HttpPorts, type JsonBody, type MappedInboxEntry, type MappedTimelinePage, type MessagesDeps, type PresenceDeps, type PresenceUpdate, type ReadDeps, type SearchDeps, type SearchMessagesOptions, type SearchMessagesResult, type SendMessageParams, type StoreAttachment, type StoreBridge, type StoreConfigurationMessage, type StoreFasteningAction, type StoreForwardedInfo, type StoreMarker, type StoreMarkerStatus, type StoreMessage, type StoreMessageFastening, type StoreOperationType, type StoreTextMessage, type SystemLinesDeps, TYPING_EXPIRE_MS, type TimelineDeps, type TypingDeps, type TypingTimers, WSC_API_VERSION_HEADER, WireInboxEntry, type WireMeetingDeclinedEvent, type WireMeetingStartedEvent, type WireMeetingStoppedEvent, WireMessage, type WireMessageDeletedEvent, type WireMessageEditedEvent, type WireMessageForwardedEvent, type WireMessagePinnedEvent, type WireMessageReceivedEvent, type WireMessageUnpinnedEvent, type WirePresenceChangedEvent, WirePresenceStatus, type WireReactionChangedEvent, WireReadMarker, type WireReadUpdatedEvent, type WireRoomCreatedEvent, type WireRoomHistoryClearedEvent, type WireRoomMemberAddedEvent, type WireRoomMemberRemovedEvent, type WireRoomPictureChangedEvent, type WireRoomPictureDeletedEvent, type WireRoomUpdatedEvent, WireSystemEvent, WireTimeline, WireTimelineMessage, type WireTypingEvent, type WireWsErrorEvent, WscApiError, type WscClient, type WscClientDeps, applyPresenceUpdates, buildQueryString, confirmAttachmentUpload, createHttpClient, createTypingTimers, createWscClient, deleteMessage, editMessage, fetchInbox, fetchPinnedMessage, fetchPresence, fetchRoomReadMarkers, fetchTimeline, fetchTimelineGap, forwardMessages, handleMeetingDeclined, handleMeetingStarted, handleMeetingStopped, handleMessageDeleted, handleMessageEdited, handleMessageForwarded, handleMessagePinned, handleMessageReceived, handleMessageUnpinned, handlePresenceChanged, handleReactionChanged, handleReadUpdated, handleRoomMemberAdded, handleRoomMemberRemoved, handleTyping, mapInboxEntry, mapPresenceStatus, mapSearchMessageToStoreMessage, mapSystemEventToStoreMessage, mapTimelinePage, mapWireMarkerToStoreMarker, mapWireMessageToStoreMessage, markAsRead, pinMessage, removeReaction, searchMessages, sendMessage, sendReaction, unpinMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpMethod, a as HttpPorts, c as components, W as WireMessage, b as WireInboxEntry, d as WireSystemEvent, e as WireReadMarker, f as WireTimelineMessage, g as WirePresenceStatus, h as WireTimeline } from './asyncapi-
|
|
2
|
-
export { F as FetchLike, i as HeadersLike, L as Logger, R as RequestInitLike, j as ResponseLike, V as VersionStore, k as WireInboxMember, l as WireInboxResponse, m as WireInboxRoom, n as WireMessageSearchResult, o as WirePinnedMessage, p as WireTimelineItem } from './asyncapi-
|
|
1
|
+
import { H as HttpMethod, a as HttpPorts, c as components, W as WireMessage, b as WireInboxEntry, d as WireSystemEvent, e as WireReadMarker, f as WireTimelineMessage, g as WirePresenceStatus, h as WireTimeline } from './asyncapi-DCETfyZY.js';
|
|
2
|
+
export { F as FetchLike, i as HeadersLike, L as Logger, R as RequestInitLike, j as ResponseLike, V as VersionStore, k as WireInboxMember, l as WireInboxResponse, m as WireInboxRoom, n as WireMessageSearchResult, o as WirePinnedMessage, p as WireTimelineItem } from './asyncapi-DCETfyZY.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Per-room FIFO queue for REST writes (send/edit/delete/forward). XMPP
|
|
@@ -243,6 +243,23 @@ type WireMessageUnpinnedEvent = WirePushEvent<Schemas['MessageUnpinned']>;
|
|
|
243
243
|
* room id: the creation lines written with the room are not announced.
|
|
244
244
|
*/
|
|
245
245
|
type WireRoomCreatedEvent = WirePushEvent<Schemas['RoomCreated']>;
|
|
246
|
+
/**
|
|
247
|
+
* `RoomUpdated` push event. `nameSystemEventId` and `descriptionSystemEventId`
|
|
248
|
+
* are present only for the field the update actually changed: the backend
|
|
249
|
+
* writes one `ROOM_NAME_CHANGED` or `ROOM_DESCRIPTION_CHANGED` system event
|
|
250
|
+
* each, name first.
|
|
251
|
+
*/
|
|
252
|
+
type WireRoomUpdatedEvent = WirePushEvent<Schemas['RoomUpdated']>;
|
|
253
|
+
/** `RoomPictureChanged` push event, with the `ROOM_PICTURE_UPDATED` system event id. */
|
|
254
|
+
type WireRoomPictureChangedEvent = WirePushEvent<Schemas['RoomPictureChanged']>;
|
|
255
|
+
/** `RoomPictureDeleted` push event, with the `ROOM_PICTURE_DELETED` system event id. */
|
|
256
|
+
type WireRoomPictureDeletedEvent = WirePushEvent<Schemas['RoomPictureDeleted']>;
|
|
257
|
+
/**
|
|
258
|
+
* `RoomHistoryCleared` push event. `clearedBy` and `systemEventId` only when an
|
|
259
|
+
* owner clears a temporary room for everyone, which writes a
|
|
260
|
+
* `ROOM_HISTORY_CLEARED` system event; the per-user clear writes none.
|
|
261
|
+
*/
|
|
262
|
+
type WireRoomHistoryClearedEvent = WirePushEvent<Schemas['RoomHistoryCleared']>;
|
|
246
263
|
/**
|
|
247
264
|
* `RoomMemberAdded` push event, one per added member. A bulk add writes one
|
|
248
265
|
* `MEMBER_ADDED` system event, so every event of the bulk carries the same
|
|
@@ -251,8 +268,9 @@ type WireRoomCreatedEvent = WirePushEvent<Schemas['RoomCreated']>;
|
|
|
251
268
|
type WireRoomMemberAddedEvent = WirePushEvent<Schemas['RoomMemberAdded']>;
|
|
252
269
|
/**
|
|
253
270
|
* `RoomMemberRemoved` push event. `removedBy` is the member itself on a
|
|
254
|
-
* leave
|
|
255
|
-
*
|
|
271
|
+
* leave and the first room owner on an automatic removal (temporary room
|
|
272
|
+
* clean-up). Backends before `ec635ad1` omit it, together with
|
|
273
|
+
* `systemEventId`, on an automatic removal, which then writes no system event.
|
|
256
274
|
*/
|
|
257
275
|
type WireRoomMemberRemovedEvent = WirePushEvent<Schemas['RoomMemberRemoved']>;
|
|
258
276
|
/**
|
|
@@ -721,9 +739,32 @@ type WscClient = {
|
|
|
721
739
|
handleRoomMemberAdded: (event: WireRoomMemberAddedEvent) => StoreConfigurationMessage | undefined;
|
|
722
740
|
/**
|
|
723
741
|
* `RoomMemberRemoved` push event: lands the `memberRemoved` line. Returns
|
|
724
|
-
* the row, or undefined
|
|
742
|
+
* the row, or undefined when the event announces no line.
|
|
725
743
|
*/
|
|
726
744
|
handleRoomMemberRemoved: (event: WireRoomMemberRemovedEvent) => StoreConfigurationMessage | undefined;
|
|
745
|
+
/**
|
|
746
|
+
* `RoomUpdated` push event: lands the `roomNameChanged` and
|
|
747
|
+
* `roomDescriptionChanged` lines the update wrote, name first. Returns the
|
|
748
|
+
* rows, none when the update changed neither field. The app still applies
|
|
749
|
+
* the new name and description to the room.
|
|
750
|
+
*/
|
|
751
|
+
handleRoomUpdated: (event: WireRoomUpdatedEvent) => Array<StoreConfigurationMessage>;
|
|
752
|
+
/**
|
|
753
|
+
* `RoomPictureChanged` push event: lands the `roomPictureUpdated` line.
|
|
754
|
+
* Returns the row, or undefined when the event announces no line.
|
|
755
|
+
*/
|
|
756
|
+
handleRoomPictureChanged: (event: WireRoomPictureChangedEvent) => StoreConfigurationMessage | undefined;
|
|
757
|
+
/**
|
|
758
|
+
* `RoomPictureDeleted` push event: lands the `roomPictureDeleted` line.
|
|
759
|
+
* Returns the row, or undefined when the event announces no line.
|
|
760
|
+
*/
|
|
761
|
+
handleRoomPictureDeleted: (event: WireRoomPictureDeletedEvent) => StoreConfigurationMessage | undefined;
|
|
762
|
+
/**
|
|
763
|
+
* `RoomHistoryCleared` push event: lands the `roomHistoryCleared` line of a
|
|
764
|
+
* temporary room cleared for everyone. Returns the row, or undefined on the
|
|
765
|
+
* per-user clear. The app still clears the conversation.
|
|
766
|
+
*/
|
|
767
|
+
handleRoomHistoryCleared: (event: WireRoomHistoryClearedEvent) => StoreConfigurationMessage | undefined;
|
|
727
768
|
/**
|
|
728
769
|
* `MeetingStarted` push event: lands the `meetingStarted` line in the
|
|
729
770
|
* meeting's room, resolved by the app. Returns the row, or undefined when
|
|
@@ -947,8 +988,8 @@ type SystemLinesDeps = {
|
|
|
947
988
|
declare function handleRoomMemberAdded({ bridge }: SystemLinesDeps, event: WireRoomMemberAddedEvent): StoreConfigurationMessage | undefined;
|
|
948
989
|
/**
|
|
949
990
|
* `RoomMemberRemoved` push event: lands the `memberRemoved` line, whose value
|
|
950
|
-
* is the removed member. Returns the row, or undefined
|
|
951
|
-
* removal
|
|
991
|
+
* is the removed member. Returns the row, or undefined when the event
|
|
992
|
+
* announces no line (an automatic removal on backends before `ec635ad1`).
|
|
952
993
|
*/
|
|
953
994
|
declare function handleRoomMemberRemoved({ bridge }: SystemLinesDeps, event: WireRoomMemberRemovedEvent): StoreConfigurationMessage | undefined;
|
|
954
995
|
/**
|
|
@@ -1068,4 +1109,4 @@ declare class WscApiError extends Error {
|
|
|
1068
1109
|
|
|
1069
1110
|
declare function buildQueryString(params: Record<string, string | number | boolean | undefined | null>): string;
|
|
1070
1111
|
|
|
1071
|
-
export { type ConfirmAttachmentUploadParams, type EditMessageParams, type FetchTimelineGapOptions, type FetchTimelineOptions, type FindPinnedMessage, type ForwardMessageRef, type HttpClient, HttpMethod, HttpPorts, type JsonBody, type MappedInboxEntry, type MappedTimelinePage, type MessagesDeps, type PresenceDeps, type PresenceUpdate, type ReadDeps, type SearchDeps, type SearchMessagesOptions, type SearchMessagesResult, type SendMessageParams, type StoreAttachment, type StoreBridge, type StoreConfigurationMessage, type StoreFasteningAction, type StoreForwardedInfo, type StoreMarker, type StoreMarkerStatus, type StoreMessage, type StoreMessageFastening, type StoreOperationType, type StoreTextMessage, type SystemLinesDeps, TYPING_EXPIRE_MS, type TimelineDeps, type TypingDeps, type TypingTimers, WSC_API_VERSION_HEADER, WireInboxEntry, type WireMeetingDeclinedEvent, type WireMeetingStartedEvent, type WireMeetingStoppedEvent, WireMessage, type WireMessageDeletedEvent, type WireMessageEditedEvent, type WireMessageForwardedEvent, type WireMessagePinnedEvent, type WireMessageReceivedEvent, type WireMessageUnpinnedEvent, type WirePresenceChangedEvent, WirePresenceStatus, type WireReactionChangedEvent, WireReadMarker, type WireReadUpdatedEvent, type WireRoomCreatedEvent, type WireRoomMemberAddedEvent, type WireRoomMemberRemovedEvent, WireSystemEvent, WireTimeline, WireTimelineMessage, type WireTypingEvent, type WireWsErrorEvent, WscApiError, type WscClient, type WscClientDeps, applyPresenceUpdates, buildQueryString, confirmAttachmentUpload, createHttpClient, createTypingTimers, createWscClient, deleteMessage, editMessage, fetchInbox, fetchPinnedMessage, fetchPresence, fetchRoomReadMarkers, fetchTimeline, fetchTimelineGap, forwardMessages, handleMeetingDeclined, handleMeetingStarted, handleMeetingStopped, handleMessageDeleted, handleMessageEdited, handleMessageForwarded, handleMessagePinned, handleMessageReceived, handleMessageUnpinned, handlePresenceChanged, handleReactionChanged, handleReadUpdated, handleRoomMemberAdded, handleRoomMemberRemoved, handleTyping, mapInboxEntry, mapPresenceStatus, mapSearchMessageToStoreMessage, mapSystemEventToStoreMessage, mapTimelinePage, mapWireMarkerToStoreMarker, mapWireMessageToStoreMessage, markAsRead, pinMessage, removeReaction, searchMessages, sendMessage, sendReaction, unpinMessage };
|
|
1112
|
+
export { type ConfirmAttachmentUploadParams, type EditMessageParams, type FetchTimelineGapOptions, type FetchTimelineOptions, type FindPinnedMessage, type ForwardMessageRef, type HttpClient, HttpMethod, HttpPorts, type JsonBody, type MappedInboxEntry, type MappedTimelinePage, type MessagesDeps, type PresenceDeps, type PresenceUpdate, type ReadDeps, type SearchDeps, type SearchMessagesOptions, type SearchMessagesResult, type SendMessageParams, type StoreAttachment, type StoreBridge, type StoreConfigurationMessage, type StoreFasteningAction, type StoreForwardedInfo, type StoreMarker, type StoreMarkerStatus, type StoreMessage, type StoreMessageFastening, type StoreOperationType, type StoreTextMessage, type SystemLinesDeps, TYPING_EXPIRE_MS, type TimelineDeps, type TypingDeps, type TypingTimers, WSC_API_VERSION_HEADER, WireInboxEntry, type WireMeetingDeclinedEvent, type WireMeetingStartedEvent, type WireMeetingStoppedEvent, WireMessage, type WireMessageDeletedEvent, type WireMessageEditedEvent, type WireMessageForwardedEvent, type WireMessagePinnedEvent, type WireMessageReceivedEvent, type WireMessageUnpinnedEvent, type WirePresenceChangedEvent, WirePresenceStatus, type WireReactionChangedEvent, WireReadMarker, type WireReadUpdatedEvent, type WireRoomCreatedEvent, type WireRoomHistoryClearedEvent, type WireRoomMemberAddedEvent, type WireRoomMemberRemovedEvent, type WireRoomPictureChangedEvent, type WireRoomPictureDeletedEvent, type WireRoomUpdatedEvent, WireSystemEvent, WireTimeline, WireTimelineMessage, type WireTypingEvent, type WireWsErrorEvent, WscApiError, type WscClient, type WscClientDeps, applyPresenceUpdates, buildQueryString, confirmAttachmentUpload, createHttpClient, createTypingTimers, createWscClient, deleteMessage, editMessage, fetchInbox, fetchPinnedMessage, fetchPresence, fetchRoomReadMarkers, fetchTimeline, fetchTimelineGap, forwardMessages, handleMeetingDeclined, handleMeetingStarted, handleMeetingStopped, handleMessageDeleted, handleMessageEdited, handleMessageForwarded, handleMessagePinned, handleMessageReceived, handleMessageUnpinned, handlePresenceChanged, handleReactionChanged, handleReadUpdated, handleRoomMemberAdded, handleRoomMemberRemoved, handleTyping, mapInboxEntry, mapPresenceStatus, mapSearchMessageToStoreMessage, mapSystemEventToStoreMessage, mapTimelinePage, mapWireMarkerToStoreMarker, mapWireMessageToStoreMessage, markAsRead, pinMessage, removeReaction, searchMessages, sendMessage, sendReaction, unpinMessage };
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,11 @@ function mapWireMessageToStoreMessage(message) {
|
|
|
63
63
|
}
|
|
64
64
|
var SYSTEM_EVENT_TO_OPERATION = {
|
|
65
65
|
ROOM_CREATED: "roomCreation",
|
|
66
|
+
ROOM_NAME_CHANGED: "roomNameChanged",
|
|
67
|
+
ROOM_DESCRIPTION_CHANGED: "roomDescriptionChanged",
|
|
68
|
+
ROOM_PICTURE_UPDATED: "roomPictureUpdated",
|
|
69
|
+
ROOM_PICTURE_DELETED: "roomPictureDeleted",
|
|
70
|
+
ROOM_HISTORY_CLEARED: "roomHistoryCleared",
|
|
66
71
|
MEMBER_ADDED: "memberAdded",
|
|
67
72
|
MEMBER_REMOVED: "memberRemoved",
|
|
68
73
|
MESSAGE_PINNED: "messagePinned",
|
|
@@ -77,6 +82,11 @@ function extractValue(type, content) {
|
|
|
77
82
|
return typeof raw === "string" ? raw : "";
|
|
78
83
|
};
|
|
79
84
|
switch (type) {
|
|
85
|
+
// The new name or description, the v1 row value; an empty description is a removal
|
|
86
|
+
case "ROOM_NAME_CHANGED":
|
|
87
|
+
return str("name");
|
|
88
|
+
case "ROOM_DESCRIPTION_CHANGED":
|
|
89
|
+
return str("description");
|
|
80
90
|
case "MEMBER_ADDED": {
|
|
81
91
|
const added = content?.addedUserIds;
|
|
82
92
|
return Array.isArray(added) && typeof added[0] === "string" ? added[0] : "";
|
|
@@ -501,7 +511,7 @@ function handleMessagePinned({ bridge }, event, pinnedMessage) {
|
|
|
501
511
|
event.roomId,
|
|
502
512
|
event.messageId,
|
|
503
513
|
event.pinnedBy,
|
|
504
|
-
event.timestamp,
|
|
514
|
+
event.systemEventCreatedAt ?? event.timestamp,
|
|
505
515
|
event.systemEventId
|
|
506
516
|
);
|
|
507
517
|
landPinRow(bridge, row);
|
|
@@ -517,7 +527,7 @@ function handleMessageUnpinned({ bridge }, event) {
|
|
|
517
527
|
event.roomId,
|
|
518
528
|
event.messageId,
|
|
519
529
|
event.unpinnedBy,
|
|
520
|
-
event.timestamp,
|
|
530
|
+
event.systemEventCreatedAt ?? event.timestamp,
|
|
521
531
|
event.systemEventId
|
|
522
532
|
);
|
|
523
533
|
landPinRow(bridge, row);
|
|
@@ -630,11 +640,11 @@ async function searchMessages({ http, bridge }, roomId, query, options = {}) {
|
|
|
630
640
|
}
|
|
631
641
|
|
|
632
642
|
// src/client/systemLines.ts
|
|
633
|
-
function buildSystemLine(operation, roomId, systemEventId, from,
|
|
643
|
+
function buildSystemLine(operation, roomId, systemEventId, from, createdAt, value = "") {
|
|
634
644
|
return {
|
|
635
645
|
id: systemEventId,
|
|
636
646
|
roomId,
|
|
637
|
-
date: toTimestamp(
|
|
647
|
+
date: toTimestamp(createdAt),
|
|
638
648
|
type: "configuration",
|
|
639
649
|
operation,
|
|
640
650
|
value,
|
|
@@ -660,7 +670,7 @@ function handleRoomMemberAdded({ bridge }, event) {
|
|
|
660
670
|
event.roomId,
|
|
661
671
|
event.systemEventId,
|
|
662
672
|
event.addedBy,
|
|
663
|
-
event.sentDate,
|
|
673
|
+
event.systemEventCreatedAt ?? event.sentDate,
|
|
664
674
|
event.userId
|
|
665
675
|
);
|
|
666
676
|
if (isKnownLine(bridge, row)) {
|
|
@@ -678,12 +688,83 @@ function handleRoomMemberRemoved({ bridge }, event) {
|
|
|
678
688
|
event.roomId,
|
|
679
689
|
event.systemEventId,
|
|
680
690
|
event.removedBy,
|
|
681
|
-
event.sentDate,
|
|
691
|
+
event.systemEventCreatedAt ?? event.sentDate,
|
|
682
692
|
event.userId
|
|
683
693
|
);
|
|
684
694
|
landSystemLine(bridge, row);
|
|
685
695
|
return row;
|
|
686
696
|
}
|
|
697
|
+
function handleRoomUpdated({ bridge }, event) {
|
|
698
|
+
const rows = [];
|
|
699
|
+
if (event.nameSystemEventId) {
|
|
700
|
+
rows.push(
|
|
701
|
+
buildSystemLine(
|
|
702
|
+
"roomNameChanged",
|
|
703
|
+
event.roomId,
|
|
704
|
+
event.nameSystemEventId,
|
|
705
|
+
event.updatedBy,
|
|
706
|
+
event.nameSystemEventCreatedAt ?? event.sentDate,
|
|
707
|
+
event.name
|
|
708
|
+
)
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
if (event.descriptionSystemEventId) {
|
|
712
|
+
rows.push(
|
|
713
|
+
buildSystemLine(
|
|
714
|
+
"roomDescriptionChanged",
|
|
715
|
+
event.roomId,
|
|
716
|
+
event.descriptionSystemEventId,
|
|
717
|
+
event.updatedBy,
|
|
718
|
+
event.descriptionSystemEventCreatedAt ?? event.sentDate,
|
|
719
|
+
event.description
|
|
720
|
+
)
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
rows.forEach((row) => landSystemLine(bridge, row));
|
|
724
|
+
return rows;
|
|
725
|
+
}
|
|
726
|
+
function handleRoomPictureChanged({ bridge }, event) {
|
|
727
|
+
if (!event.systemEventId) {
|
|
728
|
+
return void 0;
|
|
729
|
+
}
|
|
730
|
+
const row = buildSystemLine(
|
|
731
|
+
"roomPictureUpdated",
|
|
732
|
+
event.roomId,
|
|
733
|
+
event.systemEventId,
|
|
734
|
+
event.updatedBy,
|
|
735
|
+
event.systemEventCreatedAt ?? event.sentDate
|
|
736
|
+
);
|
|
737
|
+
landSystemLine(bridge, row);
|
|
738
|
+
return row;
|
|
739
|
+
}
|
|
740
|
+
function handleRoomPictureDeleted({ bridge }, event) {
|
|
741
|
+
if (!event.systemEventId) {
|
|
742
|
+
return void 0;
|
|
743
|
+
}
|
|
744
|
+
const row = buildSystemLine(
|
|
745
|
+
"roomPictureDeleted",
|
|
746
|
+
event.roomId,
|
|
747
|
+
event.systemEventId,
|
|
748
|
+
event.deletedBy,
|
|
749
|
+
event.systemEventCreatedAt ?? event.sentDate
|
|
750
|
+
);
|
|
751
|
+
landSystemLine(bridge, row);
|
|
752
|
+
return row;
|
|
753
|
+
}
|
|
754
|
+
function handleRoomHistoryCleared({ bridge }, event) {
|
|
755
|
+
if (!event.systemEventId || !event.clearedBy) {
|
|
756
|
+
return void 0;
|
|
757
|
+
}
|
|
758
|
+
const row = buildSystemLine(
|
|
759
|
+
"roomHistoryCleared",
|
|
760
|
+
event.roomId,
|
|
761
|
+
event.systemEventId,
|
|
762
|
+
event.clearedBy,
|
|
763
|
+
event.systemEventCreatedAt ?? event.sentDate
|
|
764
|
+
);
|
|
765
|
+
landSystemLine(bridge, row);
|
|
766
|
+
return row;
|
|
767
|
+
}
|
|
687
768
|
function handleMeetingStarted({ bridge }, event, roomId) {
|
|
688
769
|
if (!event.systemEventId) {
|
|
689
770
|
return void 0;
|
|
@@ -693,7 +774,7 @@ function handleMeetingStarted({ bridge }, event, roomId) {
|
|
|
693
774
|
roomId,
|
|
694
775
|
event.systemEventId,
|
|
695
776
|
event.starterUser,
|
|
696
|
-
event.sentDate
|
|
777
|
+
event.systemEventCreatedAt ?? event.sentDate
|
|
697
778
|
);
|
|
698
779
|
landSystemLine(bridge, row);
|
|
699
780
|
return row;
|
|
@@ -708,7 +789,7 @@ function handleMeetingStopped({ bridge }, event, roomId, startedAt) {
|
|
|
708
789
|
roomId,
|
|
709
790
|
event.systemEventId,
|
|
710
791
|
event.endedBy,
|
|
711
|
-
event.sentDate,
|
|
792
|
+
event.systemEventCreatedAt ?? event.sentDate,
|
|
712
793
|
durationSec === void 0 ? "" : String(durationSec)
|
|
713
794
|
);
|
|
714
795
|
landSystemLine(bridge, row);
|
|
@@ -723,7 +804,7 @@ function handleMeetingDeclined({ bridge }, event, roomId) {
|
|
|
723
804
|
roomId,
|
|
724
805
|
event.systemEventId,
|
|
725
806
|
event.userId,
|
|
726
|
-
event.sentDate
|
|
807
|
+
event.systemEventCreatedAt ?? event.sentDate
|
|
727
808
|
);
|
|
728
809
|
landSystemLine(bridge, row);
|
|
729
810
|
return row;
|
|
@@ -940,6 +1021,10 @@ function createWscClient(deps) {
|
|
|
940
1021
|
handleRoomCreated: (event) => handleRoomCreated(deps, event),
|
|
941
1022
|
handleRoomMemberAdded: (event) => handleRoomMemberAdded(deps, event),
|
|
942
1023
|
handleRoomMemberRemoved: (event) => handleRoomMemberRemoved(deps, event),
|
|
1024
|
+
handleRoomUpdated: (event) => handleRoomUpdated(deps, event),
|
|
1025
|
+
handleRoomPictureChanged: (event) => handleRoomPictureChanged(deps, event),
|
|
1026
|
+
handleRoomPictureDeleted: (event) => handleRoomPictureDeleted(deps, event),
|
|
1027
|
+
handleRoomHistoryCleared: (event) => handleRoomHistoryCleared(deps, event),
|
|
943
1028
|
handleMeetingStarted: (event, roomId) => handleMeetingStarted(deps, event, roomId),
|
|
944
1029
|
handleMeetingStopped: (event, roomId, startedAt) => handleMeetingStopped(deps, event, roomId, startedAt),
|
|
945
1030
|
handleMeetingDeclined: (event, roomId) => handleMeetingDeclined(deps, event, roomId),
|