@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.
@@ -40,8 +40,12 @@ __export(testing_exports, {
40
40
  buildReactionChangedEvent: () => buildReactionChangedEvent,
41
41
  buildReadMarker: () => buildReadMarker,
42
42
  buildReadUpdatedEvent: () => buildReadUpdatedEvent,
43
+ buildRoomHistoryClearedEvent: () => buildRoomHistoryClearedEvent,
43
44
  buildRoomMemberAddedEvent: () => buildRoomMemberAddedEvent,
44
45
  buildRoomMemberRemovedEvent: () => buildRoomMemberRemovedEvent,
46
+ buildRoomPictureChangedEvent: () => buildRoomPictureChangedEvent,
47
+ buildRoomPictureDeletedEvent: () => buildRoomPictureDeletedEvent,
48
+ buildRoomUpdatedEvent: () => buildRoomUpdatedEvent,
45
49
  buildSearchResponse: () => buildSearchResponse,
46
50
  buildSystemEvent: () => buildSystemEvent,
47
51
  buildSystemEventTimelineItem: () => buildSystemEventTimelineItem,
@@ -238,6 +242,50 @@ function buildMessageUnpinnedEvent(overrides = {}) {
238
242
  ...overrides
239
243
  };
240
244
  }
245
+ function buildRoomUpdatedEvent(overrides = {}) {
246
+ return {
247
+ type: "roomUpdated",
248
+ sentDate: EVENT_SENT_DATE,
249
+ roomId: "room-default",
250
+ name: "Room name",
251
+ description: "Room description",
252
+ updatedBy: "user-default",
253
+ nameSystemEventId: nextId("event"),
254
+ ...overrides
255
+ };
256
+ }
257
+ function buildRoomPictureChangedEvent(overrides = {}) {
258
+ return {
259
+ type: "roomPictureChanged",
260
+ sentDate: EVENT_SENT_DATE,
261
+ roomId: "room-default",
262
+ updatedAt: "2026-08-01T10:00:05.120Z",
263
+ updatedBy: "user-default",
264
+ systemEventId: nextId("event"),
265
+ ...overrides
266
+ };
267
+ }
268
+ function buildRoomPictureDeletedEvent(overrides = {}) {
269
+ return {
270
+ type: "roomPictureDeleted",
271
+ sentDate: EVENT_SENT_DATE,
272
+ roomId: "room-default",
273
+ deletedBy: "user-default",
274
+ systemEventId: nextId("event"),
275
+ ...overrides
276
+ };
277
+ }
278
+ function buildRoomHistoryClearedEvent(overrides = {}) {
279
+ return {
280
+ type: "roomHistoryCleared",
281
+ sentDate: EVENT_SENT_DATE,
282
+ roomId: "room-default",
283
+ clearedAt: "2026-08-01T10:00:05.120Z",
284
+ clearedBy: "user-default",
285
+ systemEventId: nextId("event"),
286
+ ...overrides
287
+ };
288
+ }
241
289
  function buildRoomMemberAddedEvent(overrides = {}) {
242
290
  return {
243
291
  type: "roomMemberAdded",
@@ -383,8 +431,12 @@ function createFakeFetch(responses) {
383
431
  buildReactionChangedEvent,
384
432
  buildReadMarker,
385
433
  buildReadUpdatedEvent,
434
+ buildRoomHistoryClearedEvent,
386
435
  buildRoomMemberAddedEvent,
387
436
  buildRoomMemberRemovedEvent,
437
+ buildRoomPictureChangedEvent,
438
+ buildRoomPictureDeletedEvent,
439
+ buildRoomUpdatedEvent,
388
440
  buildSearchResponse,
389
441
  buildSystemEvent,
390
442
  buildSystemEventTimelineItem,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/testing/index.ts","../../src/testing/fixtures.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type { FetchLike, RequestInitLike, ResponseLike, VersionStore } from '../types/ports';\n\nexport {\n\tbuildInboxEntry,\n\tbuildInboxMember,\n\tbuildInboxResponse,\n\tbuildMeetingDeclinedEvent,\n\tbuildMeetingStartedEvent,\n\tbuildMeetingStoppedEvent,\n\tbuildMessage,\n\tbuildMessageDeletedEvent,\n\tbuildMessageEditedEvent,\n\tbuildMessageForwardedEvent,\n\tbuildMessagePinnedEvent,\n\tbuildMessageReceivedEvent,\n\tbuildMessageTimelineItem,\n\tbuildMessageUnpinnedEvent,\n\tbuildPinnedMessage,\n\tbuildPresenceChangedEvent,\n\tbuildPresenceStatus,\n\tbuildReactionChangedEvent,\n\tbuildReadMarker,\n\tbuildReadUpdatedEvent,\n\tbuildRoomMemberAddedEvent,\n\tbuildRoomMemberRemovedEvent,\n\tbuildSearchResponse,\n\tbuildSystemEvent,\n\tbuildSystemEventTimelineItem,\n\tbuildTimelineResponse,\n\tbuildTypingEvent,\n\tbuildWireMessage\n} from './fixtures';\n\nexport type MemoryVersionStore = VersionStore & {\n\thistory: Array<string>;\n};\n\nexport function createMemoryVersionStore(\n\tinitialVersion: string | undefined,\n\tsupportedVersions: ReadonlyArray<string>\n): MemoryVersionStore {\n\tlet current = initialVersion;\n\tconst history: Array<string> = [];\n\treturn {\n\t\thistory,\n\t\tgetApiVersion: (): string | undefined => current,\n\t\tsetApiVersion: (version: string): void => {\n\t\t\tcurrent = version;\n\t\t\thistory.push(version);\n\t\t},\n\t\tgetSupportedVersions: (): ReadonlyArray<string> => supportedVersions\n\t};\n}\n\nexport type FakeResponseInit = {\n\tstatus?: number;\n\theaders?: Record<string, string>;\n\tjsonBody?: unknown;\n\tblobBody?: unknown;\n};\n\nexport function fakeResponse(init: FakeResponseInit = {}): ResponseLike {\n\tconst status = init.status ?? 200;\n\tconst lowerCased: Record<string, string> = {};\n\tObject.entries(init.headers ?? {}).forEach(([key, value]) => {\n\t\tlowerCased[key.toLowerCase()] = value;\n\t});\n\tif (init.jsonBody !== undefined && lowerCased['content-type'] === undefined) {\n\t\tlowerCased['content-type'] = 'application/json';\n\t}\n\treturn {\n\t\tok: status >= 200 && status < 300,\n\t\tstatus,\n\t\theaders: {\n\t\t\tget: (name: string): string | null => lowerCased[name.toLowerCase()] ?? null\n\t\t},\n\t\tjson: (): Promise<unknown> => Promise.resolve(init.jsonBody),\n\t\tblob: (): Promise<unknown> => Promise.resolve(init.blobBody)\n\t};\n}\n\nexport type RecordedCall = {\n\turl: string;\n\tinit: RequestInitLike;\n};\n\nexport type FakeFetch = {\n\tfetch: FetchLike;\n\tcalls: Array<RecordedCall>;\n};\n\n/**\n * FIFO fetch stub: each call consumes the next queued response and records\n * `(url, init)` for assertions. Throws when the queue is exhausted, so a test\n * making more requests than expected fails loudly instead of hanging.\n */\nexport function createFakeFetch(responses: Array<ResponseLike>): FakeFetch {\n\tconst queue = [...responses];\n\tconst calls: Array<RecordedCall> = [];\n\treturn {\n\t\tcalls,\n\t\tfetch: (url: string, init: RequestInitLike): Promise<ResponseLike> => {\n\t\t\tcalls.push({ url, init });\n\t\t\tconst next = queue.shift();\n\t\t\tif (!next) {\n\t\t\t\treturn Promise.reject(new Error('createFakeFetch: no more queued responses'));\n\t\t\t}\n\t\t\treturn Promise.resolve(next);\n\t\t}\n\t};\n}\n","/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type {\n\tWireInboxEntry,\n\tWireInboxMember,\n\tWireInboxResponse,\n\tWireMessage,\n\tWireMessageSearchResult,\n\tWirePinnedMessage,\n\tWirePresenceStatus,\n\tWireReadMarker,\n\tWireSystemEvent,\n\tWireTimeline,\n\tWireTimelineItem,\n\tWireTimelineMessage\n} from '../types/api';\nimport type { components as EventComponents } from '../types/asyncapi';\n\ntype EventSchemas = EventComponents['schemas'];\n\nlet counter = 0;\nfunction nextId(prefix: string): string {\n\tcounter += 1;\n\treturn `${prefix}-${counter.toString().padStart(4, '0')}`;\n}\n\nexport function buildInboxMember(overrides: Partial<WireInboxMember> = {}): WireInboxMember {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\towner: false,\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/** The required fields `TimelineMessage` and `Message` share. */\nfunction buildMessageFields(): Pick<\n\tWireMessage,\n\t'id' | 'roomId' | 'senderId' | 'text' | 'createdAt'\n> {\n\treturn {\n\t\tid: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tsenderId: 'user-default',\n\t\ttext: 'hello world',\n\t\tcreatedAt: '2026-08-01T10:00:00Z'\n\t};\n}\n\nexport function buildWireMessage(\n\toverrides: Partial<WireTimelineMessage> = {}\n): WireTimelineMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildReadMarker(overrides: Partial<WireReadMarker> = {}): WireReadMarker {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\n/** The `Message` DTO: write responses (send, edit, forward) and search entries. */\nexport function buildMessage(overrides: Partial<WireMessage> = {}): WireMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildSearchResponse(\n\tmessages: Array<WireMessage>,\n\thasMore = false\n): WireMessageSearchResult {\n\treturn { messages, hasMore };\n}\n\nexport function buildPinnedMessage(overrides: Partial<WirePinnedMessage> = {}): WirePinnedMessage {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tpinnedAt: '2026-08-01T12:00:00Z',\n\t\tmessage: buildWireMessage({\n\t\t\tid: messageId,\n\t\t\troomId,\n\t\t\ttext: 'pinned text',\n\t\t\tsenderId: 'user-sender'\n\t\t}),\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxEntry(overrides: Partial<WireInboxEntry> = {}): WireInboxEntry {\n\tconst roomId = overrides.roomId ?? nextId('room');\n\treturn {\n\t\troomId,\n\t\troom: {\n\t\t\tid: roomId,\n\t\t\ttype: 'group',\n\t\t\tmembers: [buildInboxMember()],\n\t\t\t...(overrides.room ?? {})\n\t\t},\n\t\tunreadCount: 0,\n\t\tmuted: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxResponse(entries: Array<WireInboxEntry>): WireInboxResponse {\n\treturn { conversations: entries };\n}\n\nexport function buildSystemEvent(overrides: Partial<WireSystemEvent> = {}): WireSystemEvent {\n\treturn {\n\t\tid: nextId('event'),\n\t\troomId: 'room-default',\n\t\ttype: 'ROOM_CREATED',\n\t\tactorId: 'user-default',\n\t\tcontent: {},\n\t\tcreatedAt: '2026-08-01T08:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageTimelineItem(message: WireTimelineMessage): WireTimelineItem {\n\treturn { itemType: 'message', createdAt: message.createdAt, message };\n}\n\nexport function buildSystemEventTimelineItem(event: WireSystemEvent): WireTimelineItem {\n\treturn { itemType: 'system_event', createdAt: event.createdAt, systemEvent: event };\n}\n\nexport function buildTimelineResponse(\n\titems: Array<WireTimelineItem>,\n\toverrides: Partial<Omit<WireTimeline, 'items'>> = {}\n): WireTimeline {\n\treturn {\n\t\titems,\n\t\thasMoreBefore: false,\n\t\thasMoreAfter: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceStatus(\n\toverrides: Partial<WirePresenceStatus> = {}\n): WirePresenceStatus {\n\treturn {\n\t\tuserId: 'user-default',\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/**\n * Push events as the socket delivers them, `type` and `sentDate` included:\n * the shapes are the generated `asyncapi.yaml` schemas. `sentDate` carries\n * microseconds, like the backend's `OffsetDateTime.now()`.\n */\nconst EVENT_SENT_DATE = '2026-08-01T10:00:05.123456Z';\n\nexport function buildMessageReceivedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageReceived'], 'message'>> = {}\n): EventSchemas['MessageReceived'] {\n\treturn { type: 'MessageReceived', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageForwardedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageForwarded'], 'message'>> = {}\n): EventSchemas['MessageForwarded'] {\n\treturn { type: 'MessageForwarded', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageEditedEvent(\n\toverrides: Partial<EventSchemas['MessageEdited']> = {}\n): EventSchemas['MessageEdited'] {\n\treturn {\n\t\ttype: 'MessageEdited',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\ttext: 'edited text',\n\t\teditedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageDeletedEvent(\n\toverrides: Partial<EventSchemas['MessageDeleted']> = {}\n): EventSchemas['MessageDeleted'] {\n\treturn {\n\t\ttype: 'MessageDeleted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tdeletedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReadUpdatedEvent(\n\toverrides: Partial<EventSchemas['ReadUpdated']> = {}\n): EventSchemas['ReadUpdated'] {\n\treturn {\n\t\ttype: 'ReadUpdated',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReactionChangedEvent(\n\toverrides: Partial<EventSchemas['ReactionChanged']> = {}\n): EventSchemas['ReactionChanged'] {\n\treturn {\n\t\ttype: 'ReactionChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\treaction: '👍',\n\t\toperation: 'added',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessagePinnedEvent(\n\toverrides: Partial<EventSchemas['MessagePinned']> = {}\n): EventSchemas['MessagePinned'] {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\ttype: 'MessagePinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tmessage: buildWireMessage({ id: messageId, roomId }),\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageUnpinnedEvent(\n\toverrides: Partial<EventSchemas['MessageUnpinned']> = {}\n): EventSchemas['MessageUnpinned'] {\n\treturn {\n\t\ttype: 'MessageUnpinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tunpinnedBy: 'user-default',\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberAddedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberAdded']> = {}\n): EventSchemas['RoomMemberAdded'] {\n\treturn {\n\t\ttype: 'roomMemberAdded',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-added',\n\t\tisOwner: false,\n\t\taddedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberRemovedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberRemoved']> = {}\n): EventSchemas['RoomMemberRemoved'] {\n\treturn {\n\t\ttype: 'roomMemberRemoved',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-removed',\n\t\tremovedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStartedEvent(\n\toverrides: Partial<EventSchemas['MeetingStarted']> = {}\n): EventSchemas['MeetingStarted'] {\n\treturn {\n\t\ttype: 'meetingStarted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tstarterUser: 'user-default',\n\t\tstartedAt: '2026-08-01T10:00:05.120Z',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStoppedEvent(\n\toverrides: Partial<EventSchemas['MeetingStopped']> = {}\n): EventSchemas['MeetingStopped'] {\n\treturn {\n\t\ttype: 'meetingStopped',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tendedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingDeclinedEvent(\n\toverrides: Partial<EventSchemas['MeetingDeclined']> = {}\n): EventSchemas['MeetingDeclined'] {\n\treturn {\n\t\ttype: 'meetingDeclined',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tuserId: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildTypingEvent(\n\toverrides: Partial<EventSchemas['Typing']> = {}\n): EventSchemas['Typing'] {\n\treturn {\n\t\ttype: 'Typing',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\tstatus: 'started',\n\t\ttimestamp: EVENT_SENT_DATE,\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceChangedEvent(\n\toverrides: Partial<EventSchemas['PresenceChanged']> = {}\n): EventSchemas['PresenceChanged'] {\n\treturn {\n\t\ttype: 'PresenceChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tuserId: 'user-default',\n\t\tonline: true,\n\t\t...overrides\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACwBA,IAAI,UAAU;AACd,SAAS,OAAO,QAAwB;AACvC,aAAW;AACX,SAAO,GAAG,MAAM,IAAI,QAAQ,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;AACxD;AAEO,SAAS,iBAAiB,YAAsC,CAAC,GAAoB;AAC3F,SAAO;AAAA,IACN,QAAQ,OA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ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type { FetchLike, RequestInitLike, ResponseLike, VersionStore } from '../types/ports';\n\nexport {\n\tbuildInboxEntry,\n\tbuildInboxMember,\n\tbuildInboxResponse,\n\tbuildMeetingDeclinedEvent,\n\tbuildMeetingStartedEvent,\n\tbuildMeetingStoppedEvent,\n\tbuildMessage,\n\tbuildMessageDeletedEvent,\n\tbuildMessageEditedEvent,\n\tbuildMessageForwardedEvent,\n\tbuildMessagePinnedEvent,\n\tbuildMessageReceivedEvent,\n\tbuildMessageTimelineItem,\n\tbuildMessageUnpinnedEvent,\n\tbuildPinnedMessage,\n\tbuildPresenceChangedEvent,\n\tbuildPresenceStatus,\n\tbuildReactionChangedEvent,\n\tbuildReadMarker,\n\tbuildReadUpdatedEvent,\n\tbuildRoomHistoryClearedEvent,\n\tbuildRoomMemberAddedEvent,\n\tbuildRoomMemberRemovedEvent,\n\tbuildRoomPictureChangedEvent,\n\tbuildRoomPictureDeletedEvent,\n\tbuildRoomUpdatedEvent,\n\tbuildSearchResponse,\n\tbuildSystemEvent,\n\tbuildSystemEventTimelineItem,\n\tbuildTimelineResponse,\n\tbuildTypingEvent,\n\tbuildWireMessage\n} from './fixtures';\n\nexport type MemoryVersionStore = VersionStore & {\n\thistory: Array<string>;\n};\n\nexport function createMemoryVersionStore(\n\tinitialVersion: string | undefined,\n\tsupportedVersions: ReadonlyArray<string>\n): MemoryVersionStore {\n\tlet current = initialVersion;\n\tconst history: Array<string> = [];\n\treturn {\n\t\thistory,\n\t\tgetApiVersion: (): string | undefined => current,\n\t\tsetApiVersion: (version: string): void => {\n\t\t\tcurrent = version;\n\t\t\thistory.push(version);\n\t\t},\n\t\tgetSupportedVersions: (): ReadonlyArray<string> => supportedVersions\n\t};\n}\n\nexport type FakeResponseInit = {\n\tstatus?: number;\n\theaders?: Record<string, string>;\n\tjsonBody?: unknown;\n\tblobBody?: unknown;\n};\n\nexport function fakeResponse(init: FakeResponseInit = {}): ResponseLike {\n\tconst status = init.status ?? 200;\n\tconst lowerCased: Record<string, string> = {};\n\tObject.entries(init.headers ?? {}).forEach(([key, value]) => {\n\t\tlowerCased[key.toLowerCase()] = value;\n\t});\n\tif (init.jsonBody !== undefined && lowerCased['content-type'] === undefined) {\n\t\tlowerCased['content-type'] = 'application/json';\n\t}\n\treturn {\n\t\tok: status >= 200 && status < 300,\n\t\tstatus,\n\t\theaders: {\n\t\t\tget: (name: string): string | null => lowerCased[name.toLowerCase()] ?? null\n\t\t},\n\t\tjson: (): Promise<unknown> => Promise.resolve(init.jsonBody),\n\t\tblob: (): Promise<unknown> => Promise.resolve(init.blobBody)\n\t};\n}\n\nexport type RecordedCall = {\n\turl: string;\n\tinit: RequestInitLike;\n};\n\nexport type FakeFetch = {\n\tfetch: FetchLike;\n\tcalls: Array<RecordedCall>;\n};\n\n/**\n * FIFO fetch stub: each call consumes the next queued response and records\n * `(url, init)` for assertions. Throws when the queue is exhausted, so a test\n * making more requests than expected fails loudly instead of hanging.\n */\nexport function createFakeFetch(responses: Array<ResponseLike>): FakeFetch {\n\tconst queue = [...responses];\n\tconst calls: Array<RecordedCall> = [];\n\treturn {\n\t\tcalls,\n\t\tfetch: (url: string, init: RequestInitLike): Promise<ResponseLike> => {\n\t\t\tcalls.push({ url, init });\n\t\t\tconst next = queue.shift();\n\t\t\tif (!next) {\n\t\t\t\treturn Promise.reject(new Error('createFakeFetch: no more queued responses'));\n\t\t\t}\n\t\t\treturn Promise.resolve(next);\n\t\t}\n\t};\n}\n","/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type {\n\tWireInboxEntry,\n\tWireInboxMember,\n\tWireInboxResponse,\n\tWireMessage,\n\tWireMessageSearchResult,\n\tWirePinnedMessage,\n\tWirePresenceStatus,\n\tWireReadMarker,\n\tWireSystemEvent,\n\tWireTimeline,\n\tWireTimelineItem,\n\tWireTimelineMessage\n} from '../types/api';\nimport type { components as EventComponents } from '../types/asyncapi';\n\ntype EventSchemas = EventComponents['schemas'];\n\nlet counter = 0;\nfunction nextId(prefix: string): string {\n\tcounter += 1;\n\treturn `${prefix}-${counter.toString().padStart(4, '0')}`;\n}\n\nexport function buildInboxMember(overrides: Partial<WireInboxMember> = {}): WireInboxMember {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\towner: false,\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/** The required fields `TimelineMessage` and `Message` share. */\nfunction buildMessageFields(): Pick<\n\tWireMessage,\n\t'id' | 'roomId' | 'senderId' | 'text' | 'createdAt'\n> {\n\treturn {\n\t\tid: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tsenderId: 'user-default',\n\t\ttext: 'hello world',\n\t\tcreatedAt: '2026-08-01T10:00:00Z'\n\t};\n}\n\nexport function buildWireMessage(\n\toverrides: Partial<WireTimelineMessage> = {}\n): WireTimelineMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildReadMarker(overrides: Partial<WireReadMarker> = {}): WireReadMarker {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\n/** The `Message` DTO: write responses (send, edit, forward) and search entries. */\nexport function buildMessage(overrides: Partial<WireMessage> = {}): WireMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildSearchResponse(\n\tmessages: Array<WireMessage>,\n\thasMore = false\n): WireMessageSearchResult {\n\treturn { messages, hasMore };\n}\n\nexport function buildPinnedMessage(overrides: Partial<WirePinnedMessage> = {}): WirePinnedMessage {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tpinnedAt: '2026-08-01T12:00:00Z',\n\t\tmessage: buildWireMessage({\n\t\t\tid: messageId,\n\t\t\troomId,\n\t\t\ttext: 'pinned text',\n\t\t\tsenderId: 'user-sender'\n\t\t}),\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxEntry(overrides: Partial<WireInboxEntry> = {}): WireInboxEntry {\n\tconst roomId = overrides.roomId ?? nextId('room');\n\treturn {\n\t\troomId,\n\t\troom: {\n\t\t\tid: roomId,\n\t\t\ttype: 'group',\n\t\t\tmembers: [buildInboxMember()],\n\t\t\t...(overrides.room ?? {})\n\t\t},\n\t\tunreadCount: 0,\n\t\tmuted: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxResponse(entries: Array<WireInboxEntry>): WireInboxResponse {\n\treturn { conversations: entries };\n}\n\nexport function buildSystemEvent(overrides: Partial<WireSystemEvent> = {}): WireSystemEvent {\n\treturn {\n\t\tid: nextId('event'),\n\t\troomId: 'room-default',\n\t\ttype: 'ROOM_CREATED',\n\t\tactorId: 'user-default',\n\t\tcontent: {},\n\t\tcreatedAt: '2026-08-01T08:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageTimelineItem(message: WireTimelineMessage): WireTimelineItem {\n\treturn { itemType: 'message', createdAt: message.createdAt, message };\n}\n\nexport function buildSystemEventTimelineItem(event: WireSystemEvent): WireTimelineItem {\n\treturn { itemType: 'system_event', createdAt: event.createdAt, systemEvent: event };\n}\n\nexport function buildTimelineResponse(\n\titems: Array<WireTimelineItem>,\n\toverrides: Partial<Omit<WireTimeline, 'items'>> = {}\n): WireTimeline {\n\treturn {\n\t\titems,\n\t\thasMoreBefore: false,\n\t\thasMoreAfter: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceStatus(\n\toverrides: Partial<WirePresenceStatus> = {}\n): WirePresenceStatus {\n\treturn {\n\t\tuserId: 'user-default',\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/**\n * Push events as the socket delivers them, `type` and `sentDate` included:\n * the shapes are the generated `asyncapi.yaml` schemas. `sentDate` carries\n * microseconds, like the backend's `OffsetDateTime.now()`.\n */\nconst EVENT_SENT_DATE = '2026-08-01T10:00:05.123456Z';\n\nexport function buildMessageReceivedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageReceived'], 'message'>> = {}\n): EventSchemas['MessageReceived'] {\n\treturn { type: 'MessageReceived', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageForwardedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageForwarded'], 'message'>> = {}\n): EventSchemas['MessageForwarded'] {\n\treturn { type: 'MessageForwarded', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageEditedEvent(\n\toverrides: Partial<EventSchemas['MessageEdited']> = {}\n): EventSchemas['MessageEdited'] {\n\treturn {\n\t\ttype: 'MessageEdited',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\ttext: 'edited text',\n\t\teditedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageDeletedEvent(\n\toverrides: Partial<EventSchemas['MessageDeleted']> = {}\n): EventSchemas['MessageDeleted'] {\n\treturn {\n\t\ttype: 'MessageDeleted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tdeletedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReadUpdatedEvent(\n\toverrides: Partial<EventSchemas['ReadUpdated']> = {}\n): EventSchemas['ReadUpdated'] {\n\treturn {\n\t\ttype: 'ReadUpdated',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReactionChangedEvent(\n\toverrides: Partial<EventSchemas['ReactionChanged']> = {}\n): EventSchemas['ReactionChanged'] {\n\treturn {\n\t\ttype: 'ReactionChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\treaction: '👍',\n\t\toperation: 'added',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessagePinnedEvent(\n\toverrides: Partial<EventSchemas['MessagePinned']> = {}\n): EventSchemas['MessagePinned'] {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\ttype: 'MessagePinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tmessage: buildWireMessage({ id: messageId, roomId }),\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageUnpinnedEvent(\n\toverrides: Partial<EventSchemas['MessageUnpinned']> = {}\n): EventSchemas['MessageUnpinned'] {\n\treturn {\n\t\ttype: 'MessageUnpinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tunpinnedBy: 'user-default',\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomUpdatedEvent(\n\toverrides: Partial<EventSchemas['RoomUpdated']> = {}\n): EventSchemas['RoomUpdated'] {\n\treturn {\n\t\ttype: 'roomUpdated',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tname: 'Room name',\n\t\tdescription: 'Room description',\n\t\tupdatedBy: 'user-default',\n\t\tnameSystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomPictureChangedEvent(\n\toverrides: Partial<EventSchemas['RoomPictureChanged']> = {}\n): EventSchemas['RoomPictureChanged'] {\n\treturn {\n\t\ttype: 'roomPictureChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tupdatedAt: '2026-08-01T10:00:05.120Z',\n\t\tupdatedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomPictureDeletedEvent(\n\toverrides: Partial<EventSchemas['RoomPictureDeleted']> = {}\n): EventSchemas['RoomPictureDeleted'] {\n\treturn {\n\t\ttype: 'roomPictureDeleted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomHistoryClearedEvent(\n\toverrides: Partial<EventSchemas['RoomHistoryCleared']> = {}\n): EventSchemas['RoomHistoryCleared'] {\n\treturn {\n\t\ttype: 'roomHistoryCleared',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tclearedAt: '2026-08-01T10:00:05.120Z',\n\t\tclearedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberAddedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberAdded']> = {}\n): EventSchemas['RoomMemberAdded'] {\n\treturn {\n\t\ttype: 'roomMemberAdded',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-added',\n\t\tisOwner: false,\n\t\taddedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberRemovedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberRemoved']> = {}\n): EventSchemas['RoomMemberRemoved'] {\n\treturn {\n\t\ttype: 'roomMemberRemoved',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-removed',\n\t\tremovedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStartedEvent(\n\toverrides: Partial<EventSchemas['MeetingStarted']> = {}\n): EventSchemas['MeetingStarted'] {\n\treturn {\n\t\ttype: 'meetingStarted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tstarterUser: 'user-default',\n\t\tstartedAt: '2026-08-01T10:00:05.120Z',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStoppedEvent(\n\toverrides: Partial<EventSchemas['MeetingStopped']> = {}\n): EventSchemas['MeetingStopped'] {\n\treturn {\n\t\ttype: 'meetingStopped',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tendedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingDeclinedEvent(\n\toverrides: Partial<EventSchemas['MeetingDeclined']> = {}\n): EventSchemas['MeetingDeclined'] {\n\treturn {\n\t\ttype: 'meetingDeclined',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tuserId: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildTypingEvent(\n\toverrides: Partial<EventSchemas['Typing']> = {}\n): EventSchemas['Typing'] {\n\treturn {\n\t\ttype: 'Typing',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\tstatus: 'started',\n\t\ttimestamp: EVENT_SENT_DATE,\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceChangedEvent(\n\toverrides: Partial<EventSchemas['PresenceChanged']> = {}\n): EventSchemas['PresenceChanged'] {\n\treturn {\n\t\ttype: 'PresenceChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tuserId: 'user-default',\n\t\tonline: true,\n\t\t...overrides\n\t};\n}\n"],"mappings":";;;;;;;;;;;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import { b as WireInboxEntry, k as WireInboxMember, l as WireInboxResponse, c as components, W as WireMessage, f as WireTimelineMessage, p as WireTimelineItem, o as WirePinnedMessage, g as WirePresenceStatus, e as WireReadMarker, n as WireMessageSearchResult, d as WireSystemEvent, h as WireTimeline, F as FetchLike, R as RequestInitLike, V as VersionStore, j as ResponseLike } from '../asyncapi-DB0usrAf.cjs';
1
+ import { b as WireInboxEntry, k as WireInboxMember, l as WireInboxResponse, c as components, W as WireMessage, f as WireTimelineMessage, p as WireTimelineItem, o as WirePinnedMessage, g as WirePresenceStatus, e as WireReadMarker, n as WireMessageSearchResult, d as WireSystemEvent, h as WireTimeline, F as FetchLike, R as RequestInitLike, V as VersionStore, j as ResponseLike } from '../asyncapi-DCETfyZY.cjs';
2
2
 
3
3
  type EventSchemas = components['schemas'];
4
4
  declare function buildInboxMember(overrides?: Partial<WireInboxMember>): WireInboxMember;
@@ -23,6 +23,10 @@ declare function buildReadUpdatedEvent(overrides?: Partial<EventSchemas['ReadUpd
23
23
  declare function buildReactionChangedEvent(overrides?: Partial<EventSchemas['ReactionChanged']>): EventSchemas['ReactionChanged'];
24
24
  declare function buildMessagePinnedEvent(overrides?: Partial<EventSchemas['MessagePinned']>): EventSchemas['MessagePinned'];
25
25
  declare function buildMessageUnpinnedEvent(overrides?: Partial<EventSchemas['MessageUnpinned']>): EventSchemas['MessageUnpinned'];
26
+ declare function buildRoomUpdatedEvent(overrides?: Partial<EventSchemas['RoomUpdated']>): EventSchemas['RoomUpdated'];
27
+ declare function buildRoomPictureChangedEvent(overrides?: Partial<EventSchemas['RoomPictureChanged']>): EventSchemas['RoomPictureChanged'];
28
+ declare function buildRoomPictureDeletedEvent(overrides?: Partial<EventSchemas['RoomPictureDeleted']>): EventSchemas['RoomPictureDeleted'];
29
+ declare function buildRoomHistoryClearedEvent(overrides?: Partial<EventSchemas['RoomHistoryCleared']>): EventSchemas['RoomHistoryCleared'];
26
30
  declare function buildRoomMemberAddedEvent(overrides?: Partial<EventSchemas['RoomMemberAdded']>): EventSchemas['RoomMemberAdded'];
27
31
  declare function buildRoomMemberRemovedEvent(overrides?: Partial<EventSchemas['RoomMemberRemoved']>): EventSchemas['RoomMemberRemoved'];
28
32
  declare function buildMeetingStartedEvent(overrides?: Partial<EventSchemas['MeetingStarted']>): EventSchemas['MeetingStarted'];
@@ -57,4 +61,4 @@ type FakeFetch = {
57
61
  */
58
62
  declare function createFakeFetch(responses: Array<ResponseLike>): FakeFetch;
59
63
 
60
- export { type FakeFetch, type FakeResponseInit, type MemoryVersionStore, type RecordedCall, buildInboxEntry, buildInboxMember, buildInboxResponse, buildMeetingDeclinedEvent, buildMeetingStartedEvent, buildMeetingStoppedEvent, buildMessage, buildMessageDeletedEvent, buildMessageEditedEvent, buildMessageForwardedEvent, buildMessagePinnedEvent, buildMessageReceivedEvent, buildMessageTimelineItem, buildMessageUnpinnedEvent, buildPinnedMessage, buildPresenceChangedEvent, buildPresenceStatus, buildReactionChangedEvent, buildReadMarker, buildReadUpdatedEvent, buildRoomMemberAddedEvent, buildRoomMemberRemovedEvent, buildSearchResponse, buildSystemEvent, buildSystemEventTimelineItem, buildTimelineResponse, buildTypingEvent, buildWireMessage, createFakeFetch, createMemoryVersionStore, fakeResponse };
64
+ export { type FakeFetch, type FakeResponseInit, type MemoryVersionStore, type RecordedCall, buildInboxEntry, buildInboxMember, buildInboxResponse, buildMeetingDeclinedEvent, buildMeetingStartedEvent, buildMeetingStoppedEvent, buildMessage, buildMessageDeletedEvent, buildMessageEditedEvent, buildMessageForwardedEvent, buildMessagePinnedEvent, buildMessageReceivedEvent, buildMessageTimelineItem, buildMessageUnpinnedEvent, buildPinnedMessage, buildPresenceChangedEvent, buildPresenceStatus, buildReactionChangedEvent, buildReadMarker, buildReadUpdatedEvent, buildRoomHistoryClearedEvent, buildRoomMemberAddedEvent, buildRoomMemberRemovedEvent, buildRoomPictureChangedEvent, buildRoomPictureDeletedEvent, buildRoomUpdatedEvent, buildSearchResponse, buildSystemEvent, buildSystemEventTimelineItem, buildTimelineResponse, buildTypingEvent, buildWireMessage, createFakeFetch, createMemoryVersionStore, fakeResponse };
@@ -1,4 +1,4 @@
1
- import { b as WireInboxEntry, k as WireInboxMember, l as WireInboxResponse, c as components, W as WireMessage, f as WireTimelineMessage, p as WireTimelineItem, o as WirePinnedMessage, g as WirePresenceStatus, e as WireReadMarker, n as WireMessageSearchResult, d as WireSystemEvent, h as WireTimeline, F as FetchLike, R as RequestInitLike, V as VersionStore, j as ResponseLike } from '../asyncapi-DB0usrAf.js';
1
+ import { b as WireInboxEntry, k as WireInboxMember, l as WireInboxResponse, c as components, W as WireMessage, f as WireTimelineMessage, p as WireTimelineItem, o as WirePinnedMessage, g as WirePresenceStatus, e as WireReadMarker, n as WireMessageSearchResult, d as WireSystemEvent, h as WireTimeline, F as FetchLike, R as RequestInitLike, V as VersionStore, j as ResponseLike } from '../asyncapi-DCETfyZY.js';
2
2
 
3
3
  type EventSchemas = components['schemas'];
4
4
  declare function buildInboxMember(overrides?: Partial<WireInboxMember>): WireInboxMember;
@@ -23,6 +23,10 @@ declare function buildReadUpdatedEvent(overrides?: Partial<EventSchemas['ReadUpd
23
23
  declare function buildReactionChangedEvent(overrides?: Partial<EventSchemas['ReactionChanged']>): EventSchemas['ReactionChanged'];
24
24
  declare function buildMessagePinnedEvent(overrides?: Partial<EventSchemas['MessagePinned']>): EventSchemas['MessagePinned'];
25
25
  declare function buildMessageUnpinnedEvent(overrides?: Partial<EventSchemas['MessageUnpinned']>): EventSchemas['MessageUnpinned'];
26
+ declare function buildRoomUpdatedEvent(overrides?: Partial<EventSchemas['RoomUpdated']>): EventSchemas['RoomUpdated'];
27
+ declare function buildRoomPictureChangedEvent(overrides?: Partial<EventSchemas['RoomPictureChanged']>): EventSchemas['RoomPictureChanged'];
28
+ declare function buildRoomPictureDeletedEvent(overrides?: Partial<EventSchemas['RoomPictureDeleted']>): EventSchemas['RoomPictureDeleted'];
29
+ declare function buildRoomHistoryClearedEvent(overrides?: Partial<EventSchemas['RoomHistoryCleared']>): EventSchemas['RoomHistoryCleared'];
26
30
  declare function buildRoomMemberAddedEvent(overrides?: Partial<EventSchemas['RoomMemberAdded']>): EventSchemas['RoomMemberAdded'];
27
31
  declare function buildRoomMemberRemovedEvent(overrides?: Partial<EventSchemas['RoomMemberRemoved']>): EventSchemas['RoomMemberRemoved'];
28
32
  declare function buildMeetingStartedEvent(overrides?: Partial<EventSchemas['MeetingStarted']>): EventSchemas['MeetingStarted'];
@@ -57,4 +61,4 @@ type FakeFetch = {
57
61
  */
58
62
  declare function createFakeFetch(responses: Array<ResponseLike>): FakeFetch;
59
63
 
60
- export { type FakeFetch, type FakeResponseInit, type MemoryVersionStore, type RecordedCall, buildInboxEntry, buildInboxMember, buildInboxResponse, buildMeetingDeclinedEvent, buildMeetingStartedEvent, buildMeetingStoppedEvent, buildMessage, buildMessageDeletedEvent, buildMessageEditedEvent, buildMessageForwardedEvent, buildMessagePinnedEvent, buildMessageReceivedEvent, buildMessageTimelineItem, buildMessageUnpinnedEvent, buildPinnedMessage, buildPresenceChangedEvent, buildPresenceStatus, buildReactionChangedEvent, buildReadMarker, buildReadUpdatedEvent, buildRoomMemberAddedEvent, buildRoomMemberRemovedEvent, buildSearchResponse, buildSystemEvent, buildSystemEventTimelineItem, buildTimelineResponse, buildTypingEvent, buildWireMessage, createFakeFetch, createMemoryVersionStore, fakeResponse };
64
+ export { type FakeFetch, type FakeResponseInit, type MemoryVersionStore, type RecordedCall, buildInboxEntry, buildInboxMember, buildInboxResponse, buildMeetingDeclinedEvent, buildMeetingStartedEvent, buildMeetingStoppedEvent, buildMessage, buildMessageDeletedEvent, buildMessageEditedEvent, buildMessageForwardedEvent, buildMessagePinnedEvent, buildMessageReceivedEvent, buildMessageTimelineItem, buildMessageUnpinnedEvent, buildPinnedMessage, buildPresenceChangedEvent, buildPresenceStatus, buildReactionChangedEvent, buildReadMarker, buildReadUpdatedEvent, buildRoomHistoryClearedEvent, buildRoomMemberAddedEvent, buildRoomMemberRemovedEvent, buildRoomPictureChangedEvent, buildRoomPictureDeletedEvent, buildRoomUpdatedEvent, buildSearchResponse, buildSystemEvent, buildSystemEventTimelineItem, buildTimelineResponse, buildTypingEvent, buildWireMessage, createFakeFetch, createMemoryVersionStore, fakeResponse };
@@ -182,6 +182,50 @@ function buildMessageUnpinnedEvent(overrides = {}) {
182
182
  ...overrides
183
183
  };
184
184
  }
185
+ function buildRoomUpdatedEvent(overrides = {}) {
186
+ return {
187
+ type: "roomUpdated",
188
+ sentDate: EVENT_SENT_DATE,
189
+ roomId: "room-default",
190
+ name: "Room name",
191
+ description: "Room description",
192
+ updatedBy: "user-default",
193
+ nameSystemEventId: nextId("event"),
194
+ ...overrides
195
+ };
196
+ }
197
+ function buildRoomPictureChangedEvent(overrides = {}) {
198
+ return {
199
+ type: "roomPictureChanged",
200
+ sentDate: EVENT_SENT_DATE,
201
+ roomId: "room-default",
202
+ updatedAt: "2026-08-01T10:00:05.120Z",
203
+ updatedBy: "user-default",
204
+ systemEventId: nextId("event"),
205
+ ...overrides
206
+ };
207
+ }
208
+ function buildRoomPictureDeletedEvent(overrides = {}) {
209
+ return {
210
+ type: "roomPictureDeleted",
211
+ sentDate: EVENT_SENT_DATE,
212
+ roomId: "room-default",
213
+ deletedBy: "user-default",
214
+ systemEventId: nextId("event"),
215
+ ...overrides
216
+ };
217
+ }
218
+ function buildRoomHistoryClearedEvent(overrides = {}) {
219
+ return {
220
+ type: "roomHistoryCleared",
221
+ sentDate: EVENT_SENT_DATE,
222
+ roomId: "room-default",
223
+ clearedAt: "2026-08-01T10:00:05.120Z",
224
+ clearedBy: "user-default",
225
+ systemEventId: nextId("event"),
226
+ ...overrides
227
+ };
228
+ }
185
229
  function buildRoomMemberAddedEvent(overrides = {}) {
186
230
  return {
187
231
  type: "roomMemberAdded",
@@ -326,8 +370,12 @@ export {
326
370
  buildReactionChangedEvent,
327
371
  buildReadMarker,
328
372
  buildReadUpdatedEvent,
373
+ buildRoomHistoryClearedEvent,
329
374
  buildRoomMemberAddedEvent,
330
375
  buildRoomMemberRemovedEvent,
376
+ buildRoomPictureChangedEvent,
377
+ buildRoomPictureDeletedEvent,
378
+ buildRoomUpdatedEvent,
331
379
  buildSearchResponse,
332
380
  buildSystemEvent,
333
381
  buildSystemEventTimelineItem,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/testing/fixtures.ts","../../src/testing/index.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type {\n\tWireInboxEntry,\n\tWireInboxMember,\n\tWireInboxResponse,\n\tWireMessage,\n\tWireMessageSearchResult,\n\tWirePinnedMessage,\n\tWirePresenceStatus,\n\tWireReadMarker,\n\tWireSystemEvent,\n\tWireTimeline,\n\tWireTimelineItem,\n\tWireTimelineMessage\n} from '../types/api';\nimport type { components as EventComponents } from '../types/asyncapi';\n\ntype EventSchemas = EventComponents['schemas'];\n\nlet counter = 0;\nfunction nextId(prefix: string): string {\n\tcounter += 1;\n\treturn `${prefix}-${counter.toString().padStart(4, '0')}`;\n}\n\nexport function buildInboxMember(overrides: Partial<WireInboxMember> = {}): WireInboxMember {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\towner: false,\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/** The required fields `TimelineMessage` and `Message` share. */\nfunction buildMessageFields(): Pick<\n\tWireMessage,\n\t'id' | 'roomId' | 'senderId' | 'text' | 'createdAt'\n> {\n\treturn {\n\t\tid: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tsenderId: 'user-default',\n\t\ttext: 'hello world',\n\t\tcreatedAt: '2026-08-01T10:00:00Z'\n\t};\n}\n\nexport function buildWireMessage(\n\toverrides: Partial<WireTimelineMessage> = {}\n): WireTimelineMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildReadMarker(overrides: Partial<WireReadMarker> = {}): WireReadMarker {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\n/** The `Message` DTO: write responses (send, edit, forward) and search entries. */\nexport function buildMessage(overrides: Partial<WireMessage> = {}): WireMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildSearchResponse(\n\tmessages: Array<WireMessage>,\n\thasMore = false\n): WireMessageSearchResult {\n\treturn { messages, hasMore };\n}\n\nexport function buildPinnedMessage(overrides: Partial<WirePinnedMessage> = {}): WirePinnedMessage {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tpinnedAt: '2026-08-01T12:00:00Z',\n\t\tmessage: buildWireMessage({\n\t\t\tid: messageId,\n\t\t\troomId,\n\t\t\ttext: 'pinned text',\n\t\t\tsenderId: 'user-sender'\n\t\t}),\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxEntry(overrides: Partial<WireInboxEntry> = {}): WireInboxEntry {\n\tconst roomId = overrides.roomId ?? nextId('room');\n\treturn {\n\t\troomId,\n\t\troom: {\n\t\t\tid: roomId,\n\t\t\ttype: 'group',\n\t\t\tmembers: [buildInboxMember()],\n\t\t\t...(overrides.room ?? {})\n\t\t},\n\t\tunreadCount: 0,\n\t\tmuted: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxResponse(entries: Array<WireInboxEntry>): WireInboxResponse {\n\treturn { conversations: entries };\n}\n\nexport function buildSystemEvent(overrides: Partial<WireSystemEvent> = {}): WireSystemEvent {\n\treturn {\n\t\tid: nextId('event'),\n\t\troomId: 'room-default',\n\t\ttype: 'ROOM_CREATED',\n\t\tactorId: 'user-default',\n\t\tcontent: {},\n\t\tcreatedAt: '2026-08-01T08:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageTimelineItem(message: WireTimelineMessage): WireTimelineItem {\n\treturn { itemType: 'message', createdAt: message.createdAt, message };\n}\n\nexport function buildSystemEventTimelineItem(event: WireSystemEvent): WireTimelineItem {\n\treturn { itemType: 'system_event', createdAt: event.createdAt, systemEvent: event };\n}\n\nexport function buildTimelineResponse(\n\titems: Array<WireTimelineItem>,\n\toverrides: Partial<Omit<WireTimeline, 'items'>> = {}\n): WireTimeline {\n\treturn {\n\t\titems,\n\t\thasMoreBefore: false,\n\t\thasMoreAfter: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceStatus(\n\toverrides: Partial<WirePresenceStatus> = {}\n): WirePresenceStatus {\n\treturn {\n\t\tuserId: 'user-default',\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/**\n * Push events as the socket delivers them, `type` and `sentDate` included:\n * the shapes are the generated `asyncapi.yaml` schemas. `sentDate` carries\n * microseconds, like the backend's `OffsetDateTime.now()`.\n */\nconst EVENT_SENT_DATE = '2026-08-01T10:00:05.123456Z';\n\nexport function buildMessageReceivedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageReceived'], 'message'>> = {}\n): EventSchemas['MessageReceived'] {\n\treturn { type: 'MessageReceived', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageForwardedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageForwarded'], 'message'>> = {}\n): EventSchemas['MessageForwarded'] {\n\treturn { type: 'MessageForwarded', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageEditedEvent(\n\toverrides: Partial<EventSchemas['MessageEdited']> = {}\n): EventSchemas['MessageEdited'] {\n\treturn {\n\t\ttype: 'MessageEdited',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\ttext: 'edited text',\n\t\teditedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageDeletedEvent(\n\toverrides: Partial<EventSchemas['MessageDeleted']> = {}\n): EventSchemas['MessageDeleted'] {\n\treturn {\n\t\ttype: 'MessageDeleted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tdeletedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReadUpdatedEvent(\n\toverrides: Partial<EventSchemas['ReadUpdated']> = {}\n): EventSchemas['ReadUpdated'] {\n\treturn {\n\t\ttype: 'ReadUpdated',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReactionChangedEvent(\n\toverrides: Partial<EventSchemas['ReactionChanged']> = {}\n): EventSchemas['ReactionChanged'] {\n\treturn {\n\t\ttype: 'ReactionChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\treaction: '👍',\n\t\toperation: 'added',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessagePinnedEvent(\n\toverrides: Partial<EventSchemas['MessagePinned']> = {}\n): EventSchemas['MessagePinned'] {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\ttype: 'MessagePinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tmessage: buildWireMessage({ id: messageId, roomId }),\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageUnpinnedEvent(\n\toverrides: Partial<EventSchemas['MessageUnpinned']> = {}\n): EventSchemas['MessageUnpinned'] {\n\treturn {\n\t\ttype: 'MessageUnpinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tunpinnedBy: 'user-default',\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberAddedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberAdded']> = {}\n): EventSchemas['RoomMemberAdded'] {\n\treturn {\n\t\ttype: 'roomMemberAdded',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-added',\n\t\tisOwner: false,\n\t\taddedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberRemovedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberRemoved']> = {}\n): EventSchemas['RoomMemberRemoved'] {\n\treturn {\n\t\ttype: 'roomMemberRemoved',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-removed',\n\t\tremovedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStartedEvent(\n\toverrides: Partial<EventSchemas['MeetingStarted']> = {}\n): EventSchemas['MeetingStarted'] {\n\treturn {\n\t\ttype: 'meetingStarted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tstarterUser: 'user-default',\n\t\tstartedAt: '2026-08-01T10:00:05.120Z',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStoppedEvent(\n\toverrides: Partial<EventSchemas['MeetingStopped']> = {}\n): EventSchemas['MeetingStopped'] {\n\treturn {\n\t\ttype: 'meetingStopped',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tendedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingDeclinedEvent(\n\toverrides: Partial<EventSchemas['MeetingDeclined']> = {}\n): EventSchemas['MeetingDeclined'] {\n\treturn {\n\t\ttype: 'meetingDeclined',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tuserId: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildTypingEvent(\n\toverrides: Partial<EventSchemas['Typing']> = {}\n): EventSchemas['Typing'] {\n\treturn {\n\t\ttype: 'Typing',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\tstatus: 'started',\n\t\ttimestamp: EVENT_SENT_DATE,\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceChangedEvent(\n\toverrides: Partial<EventSchemas['PresenceChanged']> = {}\n): EventSchemas['PresenceChanged'] {\n\treturn {\n\t\ttype: 'PresenceChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tuserId: 'user-default',\n\t\tonline: true,\n\t\t...overrides\n\t};\n}\n","/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type { FetchLike, RequestInitLike, ResponseLike, VersionStore } from '../types/ports';\n\nexport {\n\tbuildInboxEntry,\n\tbuildInboxMember,\n\tbuildInboxResponse,\n\tbuildMeetingDeclinedEvent,\n\tbuildMeetingStartedEvent,\n\tbuildMeetingStoppedEvent,\n\tbuildMessage,\n\tbuildMessageDeletedEvent,\n\tbuildMessageEditedEvent,\n\tbuildMessageForwardedEvent,\n\tbuildMessagePinnedEvent,\n\tbuildMessageReceivedEvent,\n\tbuildMessageTimelineItem,\n\tbuildMessageUnpinnedEvent,\n\tbuildPinnedMessage,\n\tbuildPresenceChangedEvent,\n\tbuildPresenceStatus,\n\tbuildReactionChangedEvent,\n\tbuildReadMarker,\n\tbuildReadUpdatedEvent,\n\tbuildRoomMemberAddedEvent,\n\tbuildRoomMemberRemovedEvent,\n\tbuildSearchResponse,\n\tbuildSystemEvent,\n\tbuildSystemEventTimelineItem,\n\tbuildTimelineResponse,\n\tbuildTypingEvent,\n\tbuildWireMessage\n} from './fixtures';\n\nexport type MemoryVersionStore = VersionStore & {\n\thistory: Array<string>;\n};\n\nexport function createMemoryVersionStore(\n\tinitialVersion: string | undefined,\n\tsupportedVersions: ReadonlyArray<string>\n): MemoryVersionStore {\n\tlet current = initialVersion;\n\tconst history: Array<string> = [];\n\treturn {\n\t\thistory,\n\t\tgetApiVersion: (): string | undefined => current,\n\t\tsetApiVersion: (version: string): void => {\n\t\t\tcurrent = version;\n\t\t\thistory.push(version);\n\t\t},\n\t\tgetSupportedVersions: (): ReadonlyArray<string> => supportedVersions\n\t};\n}\n\nexport type FakeResponseInit = {\n\tstatus?: number;\n\theaders?: Record<string, string>;\n\tjsonBody?: unknown;\n\tblobBody?: unknown;\n};\n\nexport function fakeResponse(init: FakeResponseInit = {}): ResponseLike {\n\tconst status = init.status ?? 200;\n\tconst lowerCased: Record<string, string> = {};\n\tObject.entries(init.headers ?? {}).forEach(([key, value]) => {\n\t\tlowerCased[key.toLowerCase()] = value;\n\t});\n\tif (init.jsonBody !== undefined && lowerCased['content-type'] === undefined) {\n\t\tlowerCased['content-type'] = 'application/json';\n\t}\n\treturn {\n\t\tok: status >= 200 && status < 300,\n\t\tstatus,\n\t\theaders: {\n\t\t\tget: (name: string): string | null => lowerCased[name.toLowerCase()] ?? null\n\t\t},\n\t\tjson: (): Promise<unknown> => Promise.resolve(init.jsonBody),\n\t\tblob: (): Promise<unknown> => Promise.resolve(init.blobBody)\n\t};\n}\n\nexport type RecordedCall = {\n\turl: string;\n\tinit: RequestInitLike;\n};\n\nexport type FakeFetch = {\n\tfetch: FetchLike;\n\tcalls: Array<RecordedCall>;\n};\n\n/**\n * FIFO fetch stub: each call consumes the next queued response and records\n * `(url, init)` for assertions. Throws when the queue is exhausted, so a test\n * making more requests than expected fails loudly instead of hanging.\n */\nexport function createFakeFetch(responses: Array<ResponseLike>): FakeFetch {\n\tconst queue = [...responses];\n\tconst calls: Array<RecordedCall> = [];\n\treturn {\n\t\tcalls,\n\t\tfetch: (url: string, init: RequestInitLike): Promise<ResponseLike> => {\n\t\t\tcalls.push({ url, init });\n\t\t\tconst next = queue.shift();\n\t\t\tif (!next) {\n\t\t\t\treturn Promise.reject(new Error('createFakeFetch: no more queued responses'));\n\t\t\t}\n\t\t\treturn Promise.resolve(next);\n\t\t}\n\t};\n}\n"],"mappings":";AAwBA,IAAI,UAAU;AACd,SAAS,OAAO,QAAwB;AACvC,aAAW;AACX,SAAO,GAAG,MAAM,IAAI,QAAQ,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;AACxD;AAEO,SAAS,iBAAiB,YAAsC,CAAC,GAAoB;AAC3F,SAAO;AAAA,IACN,QAAQ,OAAO,MAAM;AAAA,IACrB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAG;AAAA,EACJ;AACD;AAGA,SAAS,qBAGP;AACD,SAAO;AAAA,IACN,IAAI,OAAO,KAAK;AAAA,IAChB,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACZ;AACD;AAEO,SAAS,iBACf,YAA0C,CAAC,GACrB;AACtB,SAAO,EAAE,GAAG,mBAAmB,GAAG,GAAG,UAAU;AAChD;AAEO,SAAS,gBAAgB,YAAqC,CAAC,GAAmB;AACxF,SAAO;AAAA,IACN,QAAQ,OAAO,MAAM;AAAA,IACrB,eAAe;AAAA,IACf,GAAG;AAAA,EACJ;AACD;AAGO,SAAS,aAAa,YAAkC,CAAC,GAAgB;AAC/E,SAAO,EAAE,GAAG,mBAAmB,GAAG,GAAG,UAAU;AAChD;AAEO,SAAS,oBACf,UACA,UAAU,OACgB;AAC1B,SAAO,EAAE,UAAU,QAAQ;AAC5B;AAEO,SAAS,mBAAmB,YAAwC,CAAC,GAAsB;AACjG,QAAM,YAAY,UAAU,aAAa,OAAO,KAAK;AACrD,QAAM,SAAS,UAAU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AAAA,IAC3D,MAAM,MAAwB,QAAQ,QAAQ,KAAK,QAAQ;AAAA,EAC5D;AACD;AAiBO,SAAS,gBAAgB,WAA2C;AAC1E,QAAM,QAAQ,CAAC,GAAG,SAAS;AAC3B,QAAM,QAA6B,CAAC;AACpC,SAAO;AAAA,IACN;AAAA,IACA,OAAO,CAAC,KAAa,SAAiD;AACrE,YAAM,KAAK,EAAE,KAAK,KAAK,CAAC;AACxB,YAAM,OAAO,MAAM,MAAM;AACzB,UAAI,CAAC,MAAM;AACV,eAAO,QAAQ,OAAO,IAAI,MAAM,2CAA2C,CAAC;AAAA,MAC7E;AACA,aAAO,QAAQ,QAAQ,IAAI;AAAA,IAC5B;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../src/testing/fixtures.ts","../../src/testing/index.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type {\n\tWireInboxEntry,\n\tWireInboxMember,\n\tWireInboxResponse,\n\tWireMessage,\n\tWireMessageSearchResult,\n\tWirePinnedMessage,\n\tWirePresenceStatus,\n\tWireReadMarker,\n\tWireSystemEvent,\n\tWireTimeline,\n\tWireTimelineItem,\n\tWireTimelineMessage\n} from '../types/api';\nimport type { components as EventComponents } from '../types/asyncapi';\n\ntype EventSchemas = EventComponents['schemas'];\n\nlet counter = 0;\nfunction nextId(prefix: string): string {\n\tcounter += 1;\n\treturn `${prefix}-${counter.toString().padStart(4, '0')}`;\n}\n\nexport function buildInboxMember(overrides: Partial<WireInboxMember> = {}): WireInboxMember {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\towner: false,\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/** The required fields `TimelineMessage` and `Message` share. */\nfunction buildMessageFields(): Pick<\n\tWireMessage,\n\t'id' | 'roomId' | 'senderId' | 'text' | 'createdAt'\n> {\n\treturn {\n\t\tid: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tsenderId: 'user-default',\n\t\ttext: 'hello world',\n\t\tcreatedAt: '2026-08-01T10:00:00Z'\n\t};\n}\n\nexport function buildWireMessage(\n\toverrides: Partial<WireTimelineMessage> = {}\n): WireTimelineMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildReadMarker(overrides: Partial<WireReadMarker> = {}): WireReadMarker {\n\treturn {\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\n/** The `Message` DTO: write responses (send, edit, forward) and search entries. */\nexport function buildMessage(overrides: Partial<WireMessage> = {}): WireMessage {\n\treturn { ...buildMessageFields(), ...overrides };\n}\n\nexport function buildSearchResponse(\n\tmessages: Array<WireMessage>,\n\thasMore = false\n): WireMessageSearchResult {\n\treturn { messages, hasMore };\n}\n\nexport function buildPinnedMessage(overrides: Partial<WirePinnedMessage> = {}): WirePinnedMessage {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tpinnedAt: '2026-08-01T12:00:00Z',\n\t\tmessage: buildWireMessage({\n\t\t\tid: messageId,\n\t\t\troomId,\n\t\t\ttext: 'pinned text',\n\t\t\tsenderId: 'user-sender'\n\t\t}),\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxEntry(overrides: Partial<WireInboxEntry> = {}): WireInboxEntry {\n\tconst roomId = overrides.roomId ?? nextId('room');\n\treturn {\n\t\troomId,\n\t\troom: {\n\t\t\tid: roomId,\n\t\t\ttype: 'group',\n\t\t\tmembers: [buildInboxMember()],\n\t\t\t...(overrides.room ?? {})\n\t\t},\n\t\tunreadCount: 0,\n\t\tmuted: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildInboxResponse(entries: Array<WireInboxEntry>): WireInboxResponse {\n\treturn { conversations: entries };\n}\n\nexport function buildSystemEvent(overrides: Partial<WireSystemEvent> = {}): WireSystemEvent {\n\treturn {\n\t\tid: nextId('event'),\n\t\troomId: 'room-default',\n\t\ttype: 'ROOM_CREATED',\n\t\tactorId: 'user-default',\n\t\tcontent: {},\n\t\tcreatedAt: '2026-08-01T08:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageTimelineItem(message: WireTimelineMessage): WireTimelineItem {\n\treturn { itemType: 'message', createdAt: message.createdAt, message };\n}\n\nexport function buildSystemEventTimelineItem(event: WireSystemEvent): WireTimelineItem {\n\treturn { itemType: 'system_event', createdAt: event.createdAt, systemEvent: event };\n}\n\nexport function buildTimelineResponse(\n\titems: Array<WireTimelineItem>,\n\toverrides: Partial<Omit<WireTimeline, 'items'>> = {}\n): WireTimeline {\n\treturn {\n\t\titems,\n\t\thasMoreBefore: false,\n\t\thasMoreAfter: false,\n\t\tmarkers: [],\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceStatus(\n\toverrides: Partial<WirePresenceStatus> = {}\n): WirePresenceStatus {\n\treturn {\n\t\tuserId: 'user-default',\n\t\tonline: false,\n\t\t...overrides\n\t};\n}\n\n/**\n * Push events as the socket delivers them, `type` and `sentDate` included:\n * the shapes are the generated `asyncapi.yaml` schemas. `sentDate` carries\n * microseconds, like the backend's `OffsetDateTime.now()`.\n */\nconst EVENT_SENT_DATE = '2026-08-01T10:00:05.123456Z';\n\nexport function buildMessageReceivedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageReceived'], 'message'>> = {}\n): EventSchemas['MessageReceived'] {\n\treturn { type: 'MessageReceived', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageForwardedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageForwarded'], 'message'>> = {}\n): EventSchemas['MessageForwarded'] {\n\treturn { type: 'MessageForwarded', sentDate: EVENT_SENT_DATE, message, ...overrides };\n}\n\nexport function buildMessageEditedEvent(\n\toverrides: Partial<EventSchemas['MessageEdited']> = {}\n): EventSchemas['MessageEdited'] {\n\treturn {\n\t\ttype: 'MessageEdited',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\ttext: 'edited text',\n\t\teditedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageDeletedEvent(\n\toverrides: Partial<EventSchemas['MessageDeleted']> = {}\n): EventSchemas['MessageDeleted'] {\n\treturn {\n\t\ttype: 'MessageDeleted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tdeletedAt: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReadUpdatedEvent(\n\toverrides: Partial<EventSchemas['ReadUpdated']> = {}\n): EventSchemas['ReadUpdated'] {\n\treturn {\n\t\ttype: 'ReadUpdated',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: nextId('user'),\n\t\titemCreatedAt: '2026-08-01T10:00:00Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildReactionChangedEvent(\n\toverrides: Partial<EventSchemas['ReactionChanged']> = {}\n): EventSchemas['ReactionChanged'] {\n\treturn {\n\t\ttype: 'ReactionChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\treaction: '👍',\n\t\toperation: 'added',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessagePinnedEvent(\n\toverrides: Partial<EventSchemas['MessagePinned']> = {}\n): EventSchemas['MessagePinned'] {\n\tconst messageId = overrides.messageId ?? nextId('msg');\n\tconst roomId = overrides.roomId ?? 'room-default';\n\treturn {\n\t\ttype: 'MessagePinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId,\n\t\troomId,\n\t\tpinnedBy: 'user-default',\n\t\tmessage: buildWireMessage({ id: messageId, roomId }),\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildMessageUnpinnedEvent(\n\toverrides: Partial<EventSchemas['MessageUnpinned']> = {}\n): EventSchemas['MessageUnpinned'] {\n\treturn {\n\t\ttype: 'MessageUnpinned',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tunpinnedBy: 'user-default',\n\t\ttimestamp: '2026-08-01T10:00:05.120Z',\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomUpdatedEvent(\n\toverrides: Partial<EventSchemas['RoomUpdated']> = {}\n): EventSchemas['RoomUpdated'] {\n\treturn {\n\t\ttype: 'roomUpdated',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tname: 'Room name',\n\t\tdescription: 'Room description',\n\t\tupdatedBy: 'user-default',\n\t\tnameSystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomPictureChangedEvent(\n\toverrides: Partial<EventSchemas['RoomPictureChanged']> = {}\n): EventSchemas['RoomPictureChanged'] {\n\treturn {\n\t\ttype: 'roomPictureChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tupdatedAt: '2026-08-01T10:00:05.120Z',\n\t\tupdatedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomPictureDeletedEvent(\n\toverrides: Partial<EventSchemas['RoomPictureDeleted']> = {}\n): EventSchemas['RoomPictureDeleted'] {\n\treturn {\n\t\ttype: 'roomPictureDeleted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomHistoryClearedEvent(\n\toverrides: Partial<EventSchemas['RoomHistoryCleared']> = {}\n): EventSchemas['RoomHistoryCleared'] {\n\treturn {\n\t\ttype: 'roomHistoryCleared',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tclearedAt: '2026-08-01T10:00:05.120Z',\n\t\tclearedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberAddedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberAdded']> = {}\n): EventSchemas['RoomMemberAdded'] {\n\treturn {\n\t\ttype: 'roomMemberAdded',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-added',\n\t\tisOwner: false,\n\t\taddedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomMemberRemovedEvent(\n\toverrides: Partial<EventSchemas['RoomMemberRemoved']> = {}\n): EventSchemas['RoomMemberRemoved'] {\n\treturn {\n\t\ttype: 'roomMemberRemoved',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-removed',\n\t\tremovedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStartedEvent(\n\toverrides: Partial<EventSchemas['MeetingStarted']> = {}\n): EventSchemas['MeetingStarted'] {\n\treturn {\n\t\ttype: 'meetingStarted',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tstarterUser: 'user-default',\n\t\tstartedAt: '2026-08-01T10:00:05.120Z',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingStoppedEvent(\n\toverrides: Partial<EventSchemas['MeetingStopped']> = {}\n): EventSchemas['MeetingStopped'] {\n\treturn {\n\t\ttype: 'meetingStopped',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tendedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildMeetingDeclinedEvent(\n\toverrides: Partial<EventSchemas['MeetingDeclined']> = {}\n): EventSchemas['MeetingDeclined'] {\n\treturn {\n\t\ttype: 'meetingDeclined',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tmeetingId: 'meeting-default',\n\t\tuserId: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\t...overrides\n\t};\n}\n\nexport function buildTypingEvent(\n\toverrides: Partial<EventSchemas['Typing']> = {}\n): EventSchemas['Typing'] {\n\treturn {\n\t\ttype: 'Typing',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\tstatus: 'started',\n\t\ttimestamp: EVENT_SENT_DATE,\n\t\t...overrides\n\t};\n}\n\nexport function buildPresenceChangedEvent(\n\toverrides: Partial<EventSchemas['PresenceChanged']> = {}\n): EventSchemas['PresenceChanged'] {\n\treturn {\n\t\ttype: 'PresenceChanged',\n\t\tsentDate: EVENT_SENT_DATE,\n\t\tuserId: 'user-default',\n\t\tonline: true,\n\t\t...overrides\n\t};\n}\n","/*\n * SPDX-FileCopyrightText: 2026 Zextras <https://www.zextras.com>\n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport type { FetchLike, RequestInitLike, ResponseLike, VersionStore } from '../types/ports';\n\nexport {\n\tbuildInboxEntry,\n\tbuildInboxMember,\n\tbuildInboxResponse,\n\tbuildMeetingDeclinedEvent,\n\tbuildMeetingStartedEvent,\n\tbuildMeetingStoppedEvent,\n\tbuildMessage,\n\tbuildMessageDeletedEvent,\n\tbuildMessageEditedEvent,\n\tbuildMessageForwardedEvent,\n\tbuildMessagePinnedEvent,\n\tbuildMessageReceivedEvent,\n\tbuildMessageTimelineItem,\n\tbuildMessageUnpinnedEvent,\n\tbuildPinnedMessage,\n\tbuildPresenceChangedEvent,\n\tbuildPresenceStatus,\n\tbuildReactionChangedEvent,\n\tbuildReadMarker,\n\tbuildReadUpdatedEvent,\n\tbuildRoomHistoryClearedEvent,\n\tbuildRoomMemberAddedEvent,\n\tbuildRoomMemberRemovedEvent,\n\tbuildRoomPictureChangedEvent,\n\tbuildRoomPictureDeletedEvent,\n\tbuildRoomUpdatedEvent,\n\tbuildSearchResponse,\n\tbuildSystemEvent,\n\tbuildSystemEventTimelineItem,\n\tbuildTimelineResponse,\n\tbuildTypingEvent,\n\tbuildWireMessage\n} from './fixtures';\n\nexport type MemoryVersionStore = VersionStore & {\n\thistory: Array<string>;\n};\n\nexport function createMemoryVersionStore(\n\tinitialVersion: string | undefined,\n\tsupportedVersions: ReadonlyArray<string>\n): MemoryVersionStore {\n\tlet current = initialVersion;\n\tconst history: Array<string> = [];\n\treturn {\n\t\thistory,\n\t\tgetApiVersion: (): string | undefined => current,\n\t\tsetApiVersion: (version: string): void => {\n\t\t\tcurrent = version;\n\t\t\thistory.push(version);\n\t\t},\n\t\tgetSupportedVersions: (): ReadonlyArray<string> => supportedVersions\n\t};\n}\n\nexport type FakeResponseInit = {\n\tstatus?: number;\n\theaders?: Record<string, string>;\n\tjsonBody?: unknown;\n\tblobBody?: unknown;\n};\n\nexport function fakeResponse(init: FakeResponseInit = {}): ResponseLike {\n\tconst status = init.status ?? 200;\n\tconst lowerCased: Record<string, string> = {};\n\tObject.entries(init.headers ?? {}).forEach(([key, value]) => {\n\t\tlowerCased[key.toLowerCase()] = value;\n\t});\n\tif (init.jsonBody !== undefined && lowerCased['content-type'] === undefined) {\n\t\tlowerCased['content-type'] = 'application/json';\n\t}\n\treturn {\n\t\tok: status >= 200 && status < 300,\n\t\tstatus,\n\t\theaders: {\n\t\t\tget: (name: string): string | null => lowerCased[name.toLowerCase()] ?? null\n\t\t},\n\t\tjson: (): Promise<unknown> => Promise.resolve(init.jsonBody),\n\t\tblob: (): Promise<unknown> => Promise.resolve(init.blobBody)\n\t};\n}\n\nexport type RecordedCall = {\n\turl: string;\n\tinit: RequestInitLike;\n};\n\nexport type FakeFetch = {\n\tfetch: FetchLike;\n\tcalls: Array<RecordedCall>;\n};\n\n/**\n * FIFO fetch stub: each call consumes the next queued response and records\n * `(url, init)` for assertions. Throws when the queue is exhausted, so a test\n * making more requests than expected fails loudly instead of hanging.\n */\nexport function createFakeFetch(responses: Array<ResponseLike>): FakeFetch {\n\tconst queue = [...responses];\n\tconst calls: Array<RecordedCall> = [];\n\treturn {\n\t\tcalls,\n\t\tfetch: (url: string, init: RequestInitLike): Promise<ResponseLike> => {\n\t\t\tcalls.push({ url, init });\n\t\t\tconst next = queue.shift();\n\t\t\tif (!next) {\n\t\t\t\treturn Promise.reject(new Error('createFakeFetch: no more queued responses'));\n\t\t\t}\n\t\t\treturn Promise.resolve(next);\n\t\t}\n\t};\n}\n"],"mappings":";AAwBA,IAAI,UAAU;AACd,SAAS,OAAO,QAAwB;AACvC,aAAW;AACX,SAAO,GAAG,MAAM,IAAI,QAAQ,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;AACxD;AAEO,SAAS,iBAAiB,YAAsC,CAAC,GAAoB;AAC3F,SAAO;AAAA,IACN,QAAQ,OAAO,MAAM;AAAA,IACrB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAG;AAAA,EACJ;AACD;AAGA,SAAS,qBAGP;AACD,SAAO;AAAA,IACN,IAAI,OAAO,KAAK;AAAA,IAChB,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACZ;AACD;AAEO,SAAS,iBACf,YAA0C,CAAC,GACrB;AACtB,SAAO,EAAE,GAAG,mBAAmB,GAAG,GAAG,UAAU;AAChD;AAEO,SAAS,gBAAgB,YAAqC,CAAC,GAAmB;AACxF,SAAO;AAAA,IACN,QAAQ,OAAO,MAAM;AAAA,IACrB,eAAe;AAAA,IACf,GAAG;AAAA,EACJ;AACD;AAGO,SAAS,aAAa,YAAkC,CAAC,GAAgB;AAC/E,SAAO,EAAE,GAAG,mBAAmB,GAAG,GA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M,KAAK,EAAE,KAAK,KAAK,CAAC;AACxB,YAAM,OAAO,MAAM,MAAM;AACzB,UAAI,CAAC,MAAM;AACV,eAAO,QAAQ,OAAO,IAAI,MAAM,2CAA2C,CAAC;AAAA,MAC7E;AACA,aAAO,QAAQ,QAAQ,IAAI;AAAA,IAC5B;AAAA,EACD;AACD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zextras/carbonio-ws-collaboration-ui-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Shared SDK for the Carbonio WS Collaboration REST+WS protocol (backend >= 2.0.0), consumed by the web and mobile clients",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {