@zextras/carbonio-ws-collaboration-ui-sdk 0.5.0 → 0.7.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/README.md +1 -1
- package/dist/{asyncapi-DB0usrAf.d.cts → asyncapi-B8fJWyes.d.cts} +281 -44
- package/dist/{asyncapi-DB0usrAf.d.ts → asyncapi-B8fJWyes.d.ts} +281 -44
- package/dist/index.cjs +825 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +459 -159
- package/dist/index.d.ts +459 -159
- package/dist/index.js +815 -222
- package/dist/index.js.map +1 -1
- package/dist/testing/index.cjs +84 -24
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +10 -3
- package/dist/testing/index.d.ts +10 -3
- package/dist/testing/index.js +79 -24
- package/dist/testing/index.js.map +1 -1
- package/package.json +1 -1
package/dist/testing/index.cjs
CHANGED
|
@@ -40,8 +40,13 @@ __export(testing_exports, {
|
|
|
40
40
|
buildReactionChangedEvent: () => buildReactionChangedEvent,
|
|
41
41
|
buildReadMarker: () => buildReadMarker,
|
|
42
42
|
buildReadUpdatedEvent: () => buildReadUpdatedEvent,
|
|
43
|
+
buildRoomDescriptionChangedEvent: () => buildRoomDescriptionChangedEvent,
|
|
44
|
+
buildRoomHistoryClearedEvent: () => buildRoomHistoryClearedEvent,
|
|
43
45
|
buildRoomMemberAddedEvent: () => buildRoomMemberAddedEvent,
|
|
44
46
|
buildRoomMemberRemovedEvent: () => buildRoomMemberRemovedEvent,
|
|
47
|
+
buildRoomNameChangedEvent: () => buildRoomNameChangedEvent,
|
|
48
|
+
buildRoomPictureChangedEvent: () => buildRoomPictureChangedEvent,
|
|
49
|
+
buildRoomPictureDeletedEvent: () => buildRoomPictureDeletedEvent,
|
|
45
50
|
buildSearchResponse: () => buildSearchResponse,
|
|
46
51
|
buildSystemEvent: () => buildSystemEvent,
|
|
47
52
|
buildSystemEventTimelineItem: () => buildSystemEventTimelineItem,
|
|
@@ -111,19 +116,21 @@ function buildPinnedMessage(overrides = {}) {
|
|
|
111
116
|
};
|
|
112
117
|
}
|
|
113
118
|
function buildInboxEntry(overrides = {}) {
|
|
119
|
+
const { room, ...rest } = overrides;
|
|
114
120
|
const roomId = overrides.roomId ?? nextId("room");
|
|
115
121
|
return {
|
|
116
122
|
roomId,
|
|
123
|
+
unreadCount: 0,
|
|
124
|
+
muted: false,
|
|
125
|
+
markers: [],
|
|
126
|
+
...rest,
|
|
117
127
|
room: {
|
|
118
128
|
id: roomId,
|
|
119
129
|
type: "group",
|
|
120
130
|
members: [buildInboxMember()],
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
muted: false,
|
|
125
|
-
markers: [],
|
|
126
|
-
...overrides
|
|
131
|
+
updatedAt: "2026-01-01T00:00:00Z",
|
|
132
|
+
...room
|
|
133
|
+
}
|
|
127
134
|
};
|
|
128
135
|
}
|
|
129
136
|
function buildInboxResponse(entries) {
|
|
@@ -162,17 +169,16 @@ function buildPresenceStatus(overrides = {}) {
|
|
|
162
169
|
...overrides
|
|
163
170
|
};
|
|
164
171
|
}
|
|
165
|
-
var
|
|
172
|
+
var EVENT_INSTANT = "2026-08-01T10:00:05.123456Z";
|
|
166
173
|
function buildMessageReceivedEvent(message, overrides = {}) {
|
|
167
|
-
return { type: "MessageReceived",
|
|
174
|
+
return { type: "MessageReceived", message, ...overrides };
|
|
168
175
|
}
|
|
169
176
|
function buildMessageForwardedEvent(message, overrides = {}) {
|
|
170
|
-
return { type: "MessageForwarded",
|
|
177
|
+
return { type: "MessageForwarded", message, ...overrides };
|
|
171
178
|
}
|
|
172
179
|
function buildMessageEditedEvent(overrides = {}) {
|
|
173
180
|
return {
|
|
174
181
|
type: "MessageEdited",
|
|
175
|
-
sentDate: EVENT_SENT_DATE,
|
|
176
182
|
messageId: nextId("msg"),
|
|
177
183
|
roomId: "room-default",
|
|
178
184
|
text: "edited text",
|
|
@@ -183,7 +189,6 @@ function buildMessageEditedEvent(overrides = {}) {
|
|
|
183
189
|
function buildMessageDeletedEvent(overrides = {}) {
|
|
184
190
|
return {
|
|
185
191
|
type: "MessageDeleted",
|
|
186
|
-
sentDate: EVENT_SENT_DATE,
|
|
187
192
|
messageId: nextId("msg"),
|
|
188
193
|
roomId: "room-default",
|
|
189
194
|
deletedBy: "user-default",
|
|
@@ -194,7 +199,6 @@ function buildMessageDeletedEvent(overrides = {}) {
|
|
|
194
199
|
function buildReadUpdatedEvent(overrides = {}) {
|
|
195
200
|
return {
|
|
196
201
|
type: "ReadUpdated",
|
|
197
|
-
sentDate: EVENT_SENT_DATE,
|
|
198
202
|
roomId: "room-default",
|
|
199
203
|
userId: nextId("user"),
|
|
200
204
|
itemCreatedAt: "2026-08-01T10:00:00Z",
|
|
@@ -202,14 +206,15 @@ function buildReadUpdatedEvent(overrides = {}) {
|
|
|
202
206
|
};
|
|
203
207
|
}
|
|
204
208
|
function buildReactionChangedEvent(overrides = {}) {
|
|
209
|
+
const operation = overrides.operation ?? "added";
|
|
205
210
|
return {
|
|
206
211
|
type: "ReactionChanged",
|
|
207
|
-
sentDate: EVENT_SENT_DATE,
|
|
208
212
|
messageId: nextId("msg"),
|
|
209
213
|
roomId: "room-default",
|
|
210
214
|
userId: "user-default",
|
|
211
215
|
reaction: "\u{1F44D}",
|
|
212
|
-
operation
|
|
216
|
+
operation,
|
|
217
|
+
...operation === "removed" ? { deletedAt: EVENT_INSTANT } : { updatedAt: EVENT_INSTANT },
|
|
213
218
|
...overrides
|
|
214
219
|
};
|
|
215
220
|
}
|
|
@@ -218,7 +223,6 @@ function buildMessagePinnedEvent(overrides = {}) {
|
|
|
218
223
|
const roomId = overrides.roomId ?? "room-default";
|
|
219
224
|
return {
|
|
220
225
|
type: "MessagePinned",
|
|
221
|
-
sentDate: EVENT_SENT_DATE,
|
|
222
226
|
messageId,
|
|
223
227
|
roomId,
|
|
224
228
|
pinnedBy: "user-default",
|
|
@@ -230,7 +234,6 @@ function buildMessagePinnedEvent(overrides = {}) {
|
|
|
230
234
|
function buildMessageUnpinnedEvent(overrides = {}) {
|
|
231
235
|
return {
|
|
232
236
|
type: "MessageUnpinned",
|
|
233
|
-
sentDate: EVENT_SENT_DATE,
|
|
234
237
|
messageId: nextId("msg"),
|
|
235
238
|
roomId: "room-default",
|
|
236
239
|
unpinnedBy: "user-default",
|
|
@@ -238,75 +241,127 @@ function buildMessageUnpinnedEvent(overrides = {}) {
|
|
|
238
241
|
...overrides
|
|
239
242
|
};
|
|
240
243
|
}
|
|
244
|
+
function buildRoomNameChangedEvent(overrides = {}) {
|
|
245
|
+
return {
|
|
246
|
+
type: "roomNameChanged",
|
|
247
|
+
roomId: "room-default",
|
|
248
|
+
name: "Room name",
|
|
249
|
+
updatedBy: "user-default",
|
|
250
|
+
systemEventId: nextId("event"),
|
|
251
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
252
|
+
...overrides
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function buildRoomDescriptionChangedEvent(overrides = {}) {
|
|
256
|
+
return {
|
|
257
|
+
type: "roomDescriptionChanged",
|
|
258
|
+
roomId: "room-default",
|
|
259
|
+
description: "Room description",
|
|
260
|
+
updatedBy: "user-default",
|
|
261
|
+
systemEventId: nextId("event"),
|
|
262
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
263
|
+
...overrides
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function buildRoomPictureChangedEvent(overrides = {}) {
|
|
267
|
+
return {
|
|
268
|
+
type: "roomPictureChanged",
|
|
269
|
+
roomId: "room-default",
|
|
270
|
+
updatedAt: "2026-08-01T10:00:05.120Z",
|
|
271
|
+
updatedBy: "user-default",
|
|
272
|
+
systemEventId: nextId("event"),
|
|
273
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
274
|
+
...overrides
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function buildRoomPictureDeletedEvent(overrides = {}) {
|
|
278
|
+
return {
|
|
279
|
+
type: "roomPictureDeleted",
|
|
280
|
+
roomId: "room-default",
|
|
281
|
+
deletedBy: "user-default",
|
|
282
|
+
systemEventId: nextId("event"),
|
|
283
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
284
|
+
...overrides
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function buildRoomHistoryClearedEvent(overrides = {}) {
|
|
288
|
+
return {
|
|
289
|
+
type: "roomHistoryCleared",
|
|
290
|
+
roomId: "room-default",
|
|
291
|
+
clearedAt: "2026-08-01T10:00:05.120Z",
|
|
292
|
+
clearedBy: "user-default",
|
|
293
|
+
systemEventId: nextId("event"),
|
|
294
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
295
|
+
...overrides
|
|
296
|
+
};
|
|
297
|
+
}
|
|
241
298
|
function buildRoomMemberAddedEvent(overrides = {}) {
|
|
242
299
|
return {
|
|
243
300
|
type: "roomMemberAdded",
|
|
244
|
-
sentDate: EVENT_SENT_DATE,
|
|
245
301
|
roomId: "room-default",
|
|
246
302
|
userId: "user-added",
|
|
247
303
|
isOwner: false,
|
|
248
304
|
addedBy: "user-default",
|
|
249
305
|
systemEventId: nextId("event"),
|
|
306
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
250
307
|
...overrides
|
|
251
308
|
};
|
|
252
309
|
}
|
|
253
310
|
function buildRoomMemberRemovedEvent(overrides = {}) {
|
|
254
311
|
return {
|
|
255
312
|
type: "roomMemberRemoved",
|
|
256
|
-
sentDate: EVENT_SENT_DATE,
|
|
257
313
|
roomId: "room-default",
|
|
258
314
|
userId: "user-removed",
|
|
259
315
|
removedBy: "user-default",
|
|
260
316
|
systemEventId: nextId("event"),
|
|
317
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
261
318
|
...overrides
|
|
262
319
|
};
|
|
263
320
|
}
|
|
264
321
|
function buildMeetingStartedEvent(overrides = {}) {
|
|
265
322
|
return {
|
|
266
323
|
type: "meetingStarted",
|
|
267
|
-
sentDate: EVENT_SENT_DATE,
|
|
268
324
|
meetingId: "meeting-default",
|
|
269
325
|
starterUser: "user-default",
|
|
270
326
|
startedAt: "2026-08-01T10:00:05.120Z",
|
|
271
327
|
systemEventId: nextId("event"),
|
|
328
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
272
329
|
...overrides
|
|
273
330
|
};
|
|
274
331
|
}
|
|
275
332
|
function buildMeetingStoppedEvent(overrides = {}) {
|
|
276
333
|
return {
|
|
277
334
|
type: "meetingStopped",
|
|
278
|
-
sentDate: EVENT_SENT_DATE,
|
|
279
335
|
meetingId: "meeting-default",
|
|
280
336
|
endedBy: "user-default",
|
|
281
337
|
systemEventId: nextId("event"),
|
|
338
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
339
|
+
durationSec: 60,
|
|
282
340
|
...overrides
|
|
283
341
|
};
|
|
284
342
|
}
|
|
285
343
|
function buildMeetingDeclinedEvent(overrides = {}) {
|
|
286
344
|
return {
|
|
287
345
|
type: "meetingDeclined",
|
|
288
|
-
sentDate: EVENT_SENT_DATE,
|
|
289
346
|
meetingId: "meeting-default",
|
|
290
347
|
userId: "user-default",
|
|
291
348
|
systemEventId: nextId("event"),
|
|
349
|
+
systemEventCreatedAt: EVENT_INSTANT,
|
|
292
350
|
...overrides
|
|
293
351
|
};
|
|
294
352
|
}
|
|
295
353
|
function buildTypingEvent(overrides = {}) {
|
|
296
354
|
return {
|
|
297
355
|
type: "Typing",
|
|
298
|
-
sentDate: EVENT_SENT_DATE,
|
|
299
356
|
roomId: "room-default",
|
|
300
357
|
userId: "user-default",
|
|
301
358
|
status: "started",
|
|
302
|
-
timestamp: EVENT_SENT_DATE,
|
|
303
359
|
...overrides
|
|
304
360
|
};
|
|
305
361
|
}
|
|
306
362
|
function buildPresenceChangedEvent(overrides = {}) {
|
|
307
363
|
return {
|
|
308
364
|
type: "PresenceChanged",
|
|
309
|
-
sentDate: EVENT_SENT_DATE,
|
|
310
365
|
userId: "user-default",
|
|
311
366
|
online: true,
|
|
312
367
|
...overrides
|
|
@@ -383,8 +438,13 @@ function createFakeFetch(responses) {
|
|
|
383
438
|
buildReactionChangedEvent,
|
|
384
439
|
buildReadMarker,
|
|
385
440
|
buildReadUpdatedEvent,
|
|
441
|
+
buildRoomDescriptionChangedEvent,
|
|
442
|
+
buildRoomHistoryClearedEvent,
|
|
386
443
|
buildRoomMemberAddedEvent,
|
|
387
444
|
buildRoomMemberRemovedEvent,
|
|
445
|
+
buildRoomNameChangedEvent,
|
|
446
|
+
buildRoomPictureChangedEvent,
|
|
447
|
+
buildRoomPictureDeletedEvent,
|
|
388
448
|
buildSearchResponse,
|
|
389
449
|
buildSystemEvent,
|
|
390
450
|
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,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;AA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AAC,GAAiB;AACvE,QAAM,SAAS,KAAK,UAAU;AAC9B,QAAM,aAAqC,CAAC;AAC5C,SAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC5D,eAAW,IAAI,YAAY,CAAC,IAAI;AAAA,EACjC,CAAC;AACD,MAAI,KAAK,aAAa,UAAa,WAAW,cAAc,MAAM,QAAW;AAC5E,eAAW,cAAc,IAAI;AAAA,EAC9B;AACA,SAAO;AAAA,IACN,IAAI,UAAU,OAAO,SAAS;AAAA,IAC9B;AAAA,IACA,SAAS;AAAA,MACR,KAAK,CAAC,SAAgC,WAAW,KAAK,YAAY,CAAC,KAAK;AAAA,IACzE;AAAA,IACA,MAAM,MAAwB,QAAQ,QAAQ,KAAK,QAAQ;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/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\tbuildRoomHistoryClearedEvent,\n\tbuildRoomMemberAddedEvent,\n\tbuildRoomDescriptionChangedEvent,\n\tbuildRoomMemberRemovedEvent,\n\tbuildRoomNameChangedEvent,\n\tbuildRoomPictureChangedEvent,\n\tbuildRoomPictureDeletedEvent,\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(\n\toverrides: Partial<Omit<WireInboxEntry, 'room'>> & { room?: Partial<WireInboxEntry['room']> } = {}\n): WireInboxEntry {\n\tconst { room, ...rest } = overrides;\n\tconst roomId = overrides.roomId ?? nextId('room');\n\treturn {\n\t\troomId,\n\t\tunreadCount: 0,\n\t\tmuted: false,\n\t\tmarkers: [],\n\t\t...rest,\n\t\troom: {\n\t\t\tid: roomId,\n\t\t\ttype: 'group',\n\t\t\tmembers: [buildInboxMember()],\n\t\t\tupdatedAt: '2026-01-01T00:00:00Z',\n\t\t\t...room\n\t\t}\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` included: the shapes are\n * the generated `asyncapi.yaml` schemas. Their times are the stored database\n * values, microseconds included.\n */\nconst EVENT_INSTANT = '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', message, ...overrides };\n}\n\nexport function buildMessageForwardedEvent(\n\tmessage: WireTimelineMessage,\n\toverrides: Partial<Omit<EventSchemas['MessageForwarded'], 'message'>> = {}\n): EventSchemas['MessageForwarded'] {\n\treturn { type: 'MessageForwarded', message, ...overrides };\n}\n\nexport function buildMessageEditedEvent(\n\toverrides: Partial<EventSchemas['MessageEdited']> = {}\n): EventSchemas['MessageEdited'] {\n\treturn {\n\t\ttype: 'MessageEdited',\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\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\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\tconst operation = overrides.operation ?? 'added';\n\treturn {\n\t\ttype: 'ReactionChanged',\n\t\tmessageId: nextId('msg'),\n\t\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\treaction: '👍',\n\t\toperation,\n\t\t...(operation === 'removed' ? { deletedAt: EVENT_INSTANT } : { updatedAt: EVENT_INSTANT }),\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\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\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 buildRoomNameChangedEvent(\n\toverrides: Partial<EventSchemas['RoomNameChanged']> = {}\n): EventSchemas['RoomNameChanged'] {\n\treturn {\n\t\ttype: 'roomNameChanged',\n\t\troomId: 'room-default',\n\t\tname: 'Room name',\n\t\tupdatedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\n\t\t...overrides\n\t};\n}\n\nexport function buildRoomDescriptionChangedEvent(\n\toverrides: Partial<EventSchemas['RoomDescriptionChanged']> = {}\n): EventSchemas['RoomDescriptionChanged'] {\n\treturn {\n\t\ttype: 'roomDescriptionChanged',\n\t\troomId: 'room-default',\n\t\tdescription: 'Room description',\n\t\tupdatedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\troomId: 'room-default',\n\t\tupdatedAt: '2026-08-01T10:00:05.120Z',\n\t\tupdatedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\troomId: 'room-default',\n\t\tdeletedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\troomId: 'room-default',\n\t\tclearedAt: '2026-08-01T10:00:05.120Z',\n\t\tclearedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\troomId: 'room-default',\n\t\tuserId: 'user-added',\n\t\tisOwner: false,\n\t\taddedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\troomId: 'room-default',\n\t\tuserId: 'user-removed',\n\t\tremovedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\tmeetingId: 'meeting-default',\n\t\tstarterUser: 'user-default',\n\t\tstartedAt: '2026-08-01T10:00:05.120Z',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\tmeetingId: 'meeting-default',\n\t\tendedBy: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\n\t\tdurationSec: 60,\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\tmeetingId: 'meeting-default',\n\t\tuserId: 'user-default',\n\t\tsystemEventId: nextId('event'),\n\t\tsystemEventCreatedAt: EVENT_INSTANT,\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\troomId: 'room-default',\n\t\tuserId: 'user-default',\n\t\tstatus: 'started',\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\tuserId: 'user-default',\n\t\tonline: true,\n\t\t...overrides\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA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B,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/dist/testing/index.d.cts
CHANGED
|
@@ -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-
|
|
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-B8fJWyes.cjs';
|
|
2
2
|
|
|
3
3
|
type EventSchemas = components['schemas'];
|
|
4
4
|
declare function buildInboxMember(overrides?: Partial<WireInboxMember>): WireInboxMember;
|
|
@@ -8,7 +8,9 @@ declare function buildReadMarker(overrides?: Partial<WireReadMarker>): WireReadM
|
|
|
8
8
|
declare function buildMessage(overrides?: Partial<WireMessage>): WireMessage;
|
|
9
9
|
declare function buildSearchResponse(messages: Array<WireMessage>, hasMore?: boolean): WireMessageSearchResult;
|
|
10
10
|
declare function buildPinnedMessage(overrides?: Partial<WirePinnedMessage>): WirePinnedMessage;
|
|
11
|
-
declare function buildInboxEntry(overrides?: Partial<WireInboxEntry
|
|
11
|
+
declare function buildInboxEntry(overrides?: Partial<Omit<WireInboxEntry, 'room'>> & {
|
|
12
|
+
room?: Partial<WireInboxEntry['room']>;
|
|
13
|
+
}): WireInboxEntry;
|
|
12
14
|
declare function buildInboxResponse(entries: Array<WireInboxEntry>): WireInboxResponse;
|
|
13
15
|
declare function buildSystemEvent(overrides?: Partial<WireSystemEvent>): WireSystemEvent;
|
|
14
16
|
declare function buildMessageTimelineItem(message: WireTimelineMessage): WireTimelineItem;
|
|
@@ -23,6 +25,11 @@ declare function buildReadUpdatedEvent(overrides?: Partial<EventSchemas['ReadUpd
|
|
|
23
25
|
declare function buildReactionChangedEvent(overrides?: Partial<EventSchemas['ReactionChanged']>): EventSchemas['ReactionChanged'];
|
|
24
26
|
declare function buildMessagePinnedEvent(overrides?: Partial<EventSchemas['MessagePinned']>): EventSchemas['MessagePinned'];
|
|
25
27
|
declare function buildMessageUnpinnedEvent(overrides?: Partial<EventSchemas['MessageUnpinned']>): EventSchemas['MessageUnpinned'];
|
|
28
|
+
declare function buildRoomNameChangedEvent(overrides?: Partial<EventSchemas['RoomNameChanged']>): EventSchemas['RoomNameChanged'];
|
|
29
|
+
declare function buildRoomDescriptionChangedEvent(overrides?: Partial<EventSchemas['RoomDescriptionChanged']>): EventSchemas['RoomDescriptionChanged'];
|
|
30
|
+
declare function buildRoomPictureChangedEvent(overrides?: Partial<EventSchemas['RoomPictureChanged']>): EventSchemas['RoomPictureChanged'];
|
|
31
|
+
declare function buildRoomPictureDeletedEvent(overrides?: Partial<EventSchemas['RoomPictureDeleted']>): EventSchemas['RoomPictureDeleted'];
|
|
32
|
+
declare function buildRoomHistoryClearedEvent(overrides?: Partial<EventSchemas['RoomHistoryCleared']>): EventSchemas['RoomHistoryCleared'];
|
|
26
33
|
declare function buildRoomMemberAddedEvent(overrides?: Partial<EventSchemas['RoomMemberAdded']>): EventSchemas['RoomMemberAdded'];
|
|
27
34
|
declare function buildRoomMemberRemovedEvent(overrides?: Partial<EventSchemas['RoomMemberRemoved']>): EventSchemas['RoomMemberRemoved'];
|
|
28
35
|
declare function buildMeetingStartedEvent(overrides?: Partial<EventSchemas['MeetingStarted']>): EventSchemas['MeetingStarted'];
|
|
@@ -57,4 +64,4 @@ type FakeFetch = {
|
|
|
57
64
|
*/
|
|
58
65
|
declare function createFakeFetch(responses: Array<ResponseLike>): FakeFetch;
|
|
59
66
|
|
|
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 };
|
|
67
|
+
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, buildRoomDescriptionChangedEvent, buildRoomHistoryClearedEvent, buildRoomMemberAddedEvent, buildRoomMemberRemovedEvent, buildRoomNameChangedEvent, buildRoomPictureChangedEvent, buildRoomPictureDeletedEvent, buildSearchResponse, buildSystemEvent, buildSystemEventTimelineItem, buildTimelineResponse, buildTypingEvent, buildWireMessage, createFakeFetch, createMemoryVersionStore, fakeResponse };
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -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-
|
|
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-B8fJWyes.js';
|
|
2
2
|
|
|
3
3
|
type EventSchemas = components['schemas'];
|
|
4
4
|
declare function buildInboxMember(overrides?: Partial<WireInboxMember>): WireInboxMember;
|
|
@@ -8,7 +8,9 @@ declare function buildReadMarker(overrides?: Partial<WireReadMarker>): WireReadM
|
|
|
8
8
|
declare function buildMessage(overrides?: Partial<WireMessage>): WireMessage;
|
|
9
9
|
declare function buildSearchResponse(messages: Array<WireMessage>, hasMore?: boolean): WireMessageSearchResult;
|
|
10
10
|
declare function buildPinnedMessage(overrides?: Partial<WirePinnedMessage>): WirePinnedMessage;
|
|
11
|
-
declare function buildInboxEntry(overrides?: Partial<WireInboxEntry
|
|
11
|
+
declare function buildInboxEntry(overrides?: Partial<Omit<WireInboxEntry, 'room'>> & {
|
|
12
|
+
room?: Partial<WireInboxEntry['room']>;
|
|
13
|
+
}): WireInboxEntry;
|
|
12
14
|
declare function buildInboxResponse(entries: Array<WireInboxEntry>): WireInboxResponse;
|
|
13
15
|
declare function buildSystemEvent(overrides?: Partial<WireSystemEvent>): WireSystemEvent;
|
|
14
16
|
declare function buildMessageTimelineItem(message: WireTimelineMessage): WireTimelineItem;
|
|
@@ -23,6 +25,11 @@ declare function buildReadUpdatedEvent(overrides?: Partial<EventSchemas['ReadUpd
|
|
|
23
25
|
declare function buildReactionChangedEvent(overrides?: Partial<EventSchemas['ReactionChanged']>): EventSchemas['ReactionChanged'];
|
|
24
26
|
declare function buildMessagePinnedEvent(overrides?: Partial<EventSchemas['MessagePinned']>): EventSchemas['MessagePinned'];
|
|
25
27
|
declare function buildMessageUnpinnedEvent(overrides?: Partial<EventSchemas['MessageUnpinned']>): EventSchemas['MessageUnpinned'];
|
|
28
|
+
declare function buildRoomNameChangedEvent(overrides?: Partial<EventSchemas['RoomNameChanged']>): EventSchemas['RoomNameChanged'];
|
|
29
|
+
declare function buildRoomDescriptionChangedEvent(overrides?: Partial<EventSchemas['RoomDescriptionChanged']>): EventSchemas['RoomDescriptionChanged'];
|
|
30
|
+
declare function buildRoomPictureChangedEvent(overrides?: Partial<EventSchemas['RoomPictureChanged']>): EventSchemas['RoomPictureChanged'];
|
|
31
|
+
declare function buildRoomPictureDeletedEvent(overrides?: Partial<EventSchemas['RoomPictureDeleted']>): EventSchemas['RoomPictureDeleted'];
|
|
32
|
+
declare function buildRoomHistoryClearedEvent(overrides?: Partial<EventSchemas['RoomHistoryCleared']>): EventSchemas['RoomHistoryCleared'];
|
|
26
33
|
declare function buildRoomMemberAddedEvent(overrides?: Partial<EventSchemas['RoomMemberAdded']>): EventSchemas['RoomMemberAdded'];
|
|
27
34
|
declare function buildRoomMemberRemovedEvent(overrides?: Partial<EventSchemas['RoomMemberRemoved']>): EventSchemas['RoomMemberRemoved'];
|
|
28
35
|
declare function buildMeetingStartedEvent(overrides?: Partial<EventSchemas['MeetingStarted']>): EventSchemas['MeetingStarted'];
|
|
@@ -57,4 +64,4 @@ type FakeFetch = {
|
|
|
57
64
|
*/
|
|
58
65
|
declare function createFakeFetch(responses: Array<ResponseLike>): FakeFetch;
|
|
59
66
|
|
|
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 };
|
|
67
|
+
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, buildRoomDescriptionChangedEvent, buildRoomHistoryClearedEvent, buildRoomMemberAddedEvent, buildRoomMemberRemovedEvent, buildRoomNameChangedEvent, buildRoomPictureChangedEvent, buildRoomPictureDeletedEvent, buildSearchResponse, buildSystemEvent, buildSystemEventTimelineItem, buildTimelineResponse, buildTypingEvent, buildWireMessage, createFakeFetch, createMemoryVersionStore, fakeResponse };
|