@liveblocks/node 1.19.0-test1 → 2.0.0-alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,95 +1,7 @@
1
- import { IUserInfo, Json, PlainLsonObject, JsonObject, ThreadData, BaseMetadata, CommentData, CommentBody, CommentUserReaction } from '@liveblocks/core';
2
- export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyResolveUsersArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, Lson, LsonObject, PlainLsonObject, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionedIdsFromCommentBody, stringifyCommentBody } from '@liveblocks/core';
1
+ import { BaseUserMeta, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomNotificationSettings, ActivityData, LsonObject, ToImmutable, DU, BaseMetadata, DE, DM, DS } from '@liveblocks/core';
2
+ export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionedIdsFromCommentBody, stringifyCommentBody } from '@liveblocks/core';
3
3
  import { IncomingHttpHeaders } from 'http';
4
4
 
5
- /**
6
- * TODO Officially mark as DEPRECATED, point to migration guide.
7
- */
8
- declare type AuthorizeOptions = {
9
- /**
10
- * The secret API key for your Liveblocks account. You can find it on
11
- * https://liveblocks.io/dashboard/apikeys
12
- */
13
- secret: string;
14
- /**
15
- * The room ID for which to authorize the user. This will authorize the user
16
- * to enter the Liveblocks room.
17
- */
18
- room: string;
19
- /**
20
- * Associates a user ID to the session that is being authorized. The user ID
21
- * is typically set to the user ID from your own database.
22
- *
23
- * It can also be used to generate a token that gives access to a private
24
- * room where the userId is configured in the room accesses.
25
- *
26
- * This user ID will be used as the unique identifier to compute your
27
- * Liveblocks account's Monthly Active Users.
28
- */
29
- userId: string;
30
- /**
31
- * Arbitrary metadata associated to this user session.
32
- *
33
- * You can use it to store a small amount of static metadata for a user
34
- * session. It is public information, that will be visible to other users in
35
- * the same room, like name, avatar URL, etc.
36
- *
37
- * It's only suitable for static info that won't change during a session. If
38
- * you want to store dynamic metadata on a user session, don't keep that in
39
- * the session token, but use Presence instead.
40
- *
41
- * Can't exceed 1KB when serialized as JSON.
42
- */
43
- userInfo?: unknown;
44
- /**
45
- * Tell Liveblocks which group IDs this user belongs to. This will authorize
46
- * the user session to access private rooms that have at least one of these
47
- * group IDs listed in their room access configuration.
48
- *
49
- * See https://liveblocks.io/docs/guides/managing-rooms-users-permissions#permissions
50
- * for how to configure your room's permissions to use this feature.
51
- */
52
- groupIds?: string[];
53
- };
54
- /**
55
- * TODO Officially mark as DEPRECATED, point to migration guide.
56
- */
57
- declare type AuthorizeResponse = {
58
- status: number;
59
- body: string;
60
- error?: Error;
61
- };
62
- /**
63
- * @deprecated Since 1.2, we’re deprecating single-room tokens in favor of
64
- * either access tokens or ID tokens. Single-room tokens are still supported,
65
- * but support for them will be dropped in the future. Please refer to our
66
- * Upgrade Guide to learn how to adopt the new-style authorization, see
67
- * https://liveblocks.io/docs/platform/upgrading/1.2
68
- *
69
- * Tells Liveblocks that a user should be allowed access to a room, which user
70
- * this session is for, and what metadata to associate with the user (like
71
- * name, avatar, etc.)
72
- *
73
- * @example
74
- * export default async function auth(req, res) {
75
- *
76
- * // Implement your own security here.
77
- *
78
- * const room = req.body.room;
79
- * const response = await authorize({
80
- * room,
81
- * secret,
82
- * userId: "123",
83
- * userInfo: { // Optional
84
- * name: "Ada Lovelace"
85
- * },
86
- * groupIds: ["group1"] // Optional
87
- * });
88
- * return res.status(response.status).end(response.body);
89
- * }
90
- */
91
- declare function authorize(options: AuthorizeOptions): Promise<AuthorizeResponse>;
92
-
93
5
  declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read"];
94
6
  declare type Permission = (typeof ALL_PERMISSIONS)[number];
95
7
  /**
@@ -145,6 +57,7 @@ declare class Session {
145
57
  * @liveblocks/core has browser-specific code.
146
58
  */
147
59
 
60
+ declare type ToSimplifiedJson<S extends LsonObject> = LsonObject extends S ? JsonObject : ToImmutable<S>;
148
61
  declare type LiveblocksOptions = {
149
62
  /**
150
63
  * The Liveblocks secret key. Must start with "sk_".
@@ -152,11 +65,11 @@ declare type LiveblocksOptions = {
152
65
  */
153
66
  secret: string;
154
67
  };
155
- declare type Nullable<T> = {
156
- [P in keyof T]: T[P] | null;
68
+ declare type CreateSessionOptions<U extends BaseUserMeta = DU> = {
69
+ userInfo: U["info"];
157
70
  };
158
- declare type CreateSessionOptions = {
159
- userInfo: IUserInfo;
71
+ declare type IdentifyUserOptions<U extends BaseUserMeta = DU> = {
72
+ userInfo: U["info"];
160
73
  };
161
74
  declare type AuthResponse = {
162
75
  status: number;
@@ -170,26 +83,41 @@ declare type Identity = {
170
83
  declare type ThreadParticipants = {
171
84
  participantIds: string[];
172
85
  };
86
+ declare type CreateThreadOptions<M extends BaseMetadata> = {
87
+ roomId: string;
88
+ data: {
89
+ comment: {
90
+ userId: string;
91
+ createdAt?: Date;
92
+ body: CommentBody;
93
+ };
94
+ } & (Record<string, never> extends M ? {
95
+ metadata?: M;
96
+ } : {
97
+ metadata: M;
98
+ });
99
+ };
173
100
  declare type RoomPermission = [] | ["room:write"] | ["room:read", "room:presence:write"];
174
101
  declare type RoomAccesses = Record<string, [
175
102
  "room:write"
176
103
  ] | ["room:read", "room:presence:write"]>;
177
104
  declare type RoomMetadata = Record<string, string | string[]>;
178
- declare type RoomInfo = {
105
+ declare type QueryRoomMetadata = Record<string, string>;
106
+ declare type RoomData = {
179
107
  type: "room";
180
108
  id: string;
181
- metadata: RoomMetadata;
182
- groupsAccesses: RoomAccesses;
183
- usersAccesses: RoomAccesses;
184
- defaultAccesses: RoomPermission;
109
+ createdAt: Date;
185
110
  lastConnectionAt?: Date;
186
- createdAt?: Date;
111
+ defaultAccesses: RoomPermission;
112
+ usersAccesses: RoomAccesses;
113
+ groupsAccesses: RoomAccesses;
114
+ metadata: RoomMetadata;
187
115
  };
188
- declare type RoomUser<Info> = {
116
+ declare type RoomUser<U extends BaseUserMeta> = {
189
117
  type: "user";
190
118
  id: string | null;
191
119
  connectionId: number;
192
- info: Info;
120
+ info: U["info"];
193
121
  };
194
122
  declare type Schema = {
195
123
  id: string;
@@ -199,6 +127,10 @@ declare type Schema = {
199
127
  createdAt: Date;
200
128
  updatedAt: Date;
201
129
  };
130
+ declare type E = DE;
131
+ declare type M = DM;
132
+ declare type S = DS;
133
+ declare type U = DU;
202
134
  /**
203
135
  * Interact with the Liveblocks API from your Node.js backend.
204
136
  */
@@ -223,7 +155,7 @@ declare class Liveblocks {
223
155
  * `other.info` property.
224
156
  *
225
157
  */
226
- prepareSession(userId: string, options?: CreateSessionOptions): Session;
158
+ prepareSession(userId: string, options?: CreateSessionOptions<U>): Session;
227
159
  /**
228
160
  * Call this to authenticate the user as an actor you want to allow to use
229
161
  * Liveblocks.
@@ -256,9 +188,7 @@ declare class Liveblocks {
256
188
  * add here will be visible to all other clients in the room, through the
257
189
  * `other.info` property.
258
190
  */
259
- identifyUser(identity: string | Identity, options?: {
260
- userInfo: IUserInfo;
261
- }): Promise<AuthResponse>;
191
+ identifyUser(identity: string | Identity, options?: IdentifyUserOptions<U>): Promise<AuthResponse>;
262
192
  /**
263
193
  * Returns a list of your rooms. The rooms are returned sorted by creation date, from newest to oldest. You can filter rooms by metadata, users accesses and groups accesses.
264
194
  * @param params.limit (optional) A limit on the number of rooms to be returned. The limit can range between 1 and 100, and defaults to 20.
@@ -266,17 +196,51 @@ declare class Liveblocks {
266
196
  * @param params.userId (optional) A filter on users accesses.
267
197
  * @param params.metadata (optional) A filter on metadata. Multiple metadata keys can be used to filter rooms.
268
198
  * @param params.groupIds (optional) A filter on groups accesses. Multiple groups can be used.
199
+ * @param params.query (optional) A query to filter rooms by. It is based on our query language. You can filter by metadata and room ID.
269
200
  * @returns A list of rooms.
270
201
  */
271
202
  getRooms(params?: {
272
203
  limit?: number;
273
204
  startingAfter?: string;
274
- metadata?: RoomMetadata;
205
+ /**
206
+ * @deprecated Use `query` property instead. Support for the `metadata`
207
+ * field will be removed in a future version.
208
+ */
209
+ metadata?: QueryRoomMetadata;
275
210
  userId?: string;
276
211
  groupIds?: string[];
212
+ /**
213
+ * The query to filter rooms by. It is based on our query language.
214
+ * @example
215
+ * ```
216
+ * {
217
+ * query: 'metadata["status"]:"open" AND roomId^"liveblocks:"'
218
+ * }
219
+ * ```
220
+ * @example
221
+ * ```
222
+ * {
223
+ * query: {
224
+ * metadata: {
225
+ * status: "open",
226
+ * },
227
+ * roomId: {
228
+ * startsWith: "liveblocks:"
229
+ * }
230
+ * }
231
+ * }
232
+ * ```
233
+ */
234
+ query?: string | {
235
+ metadata?: QueryRoomMetadata;
236
+ roomId?: {
237
+ startsWith: string;
238
+ };
239
+ };
277
240
  }): Promise<{
278
241
  nextPage: string | null;
279
- data: RoomInfo[];
242
+ nextCursor: string | null;
243
+ data: RoomData[];
280
244
  }>;
281
245
  /**
282
246
  * Creates a new room with the given id.
@@ -292,13 +256,13 @@ declare class Liveblocks {
292
256
  groupsAccesses?: RoomAccesses;
293
257
  usersAccesses?: RoomAccesses;
294
258
  metadata?: RoomMetadata;
295
- }): Promise<RoomInfo>;
259
+ }): Promise<RoomData>;
296
260
  /**
297
261
  * Returns a room with the given id.
298
262
  * @param roomId The id of the room to return.
299
263
  * @returns The room with the given id.
300
264
  */
301
- getRoom(roomId: string): Promise<RoomInfo>;
265
+ getRoom(roomId: string): Promise<RoomData>;
302
266
  /**
303
267
  * Updates specific properties of a room. It’s not necessary to provide the entire room’s information.
304
268
  * Setting a property to `null` means to delete this property.
@@ -318,7 +282,7 @@ declare class Liveblocks {
318
282
  "room:write"
319
283
  ] | ["room:read", "room:presence:write"] | null>;
320
284
  metadata?: Record<string, string | string[] | null>;
321
- }): Promise<RoomInfo>;
285
+ }): Promise<RoomData>;
322
286
  /**
323
287
  * Deletes a room with the given id. A deleted room is no longer accessible from the API or the dashboard and it cannot be restored.
324
288
  * @param roomId The id of the room to delete.
@@ -329,15 +293,15 @@ declare class Liveblocks {
329
293
  * @param roomId The id of the room to get the users from.
330
294
  * @returns A list of users currently present in the requested room.
331
295
  */
332
- getActiveUsers<T = unknown>(roomId: string): Promise<{
333
- data: RoomUser<T>[];
296
+ getActiveUsers(roomId: string): Promise<{
297
+ data: RoomUser<U>[];
334
298
  }>;
335
299
  /**
336
300
  * Boadcasts an event to a room without having to connect to it via the client from @liveblocks/client. The connectionId passed to event listeners is -1 when using this API.
337
301
  * @param roomId The id of the room to broadcast the event to.
338
302
  * @param message The message to broadcast. It can be any JSON serializable value.
339
303
  */
340
- broadcastEvent(roomId: string, message: Json): Promise<void>;
304
+ broadcastEvent(roomId: string, message: E): Promise<void>;
341
305
  /**
342
306
  * Returns the contents of the room’s Storage tree.
343
307
  * The default outputted format is called “plain LSON”, which includes information on the Live data structures in the tree.
@@ -358,7 +322,7 @@ declare class Liveblocks {
358
322
  */
359
323
  getStorageDocument(roomId: string, format: "plain-lson"): Promise<PlainLsonObject>;
360
324
  getStorageDocument(roomId: string): Promise<PlainLsonObject>;
361
- getStorageDocument(roomId: string, format: "json"): Promise<JsonObject>;
325
+ getStorageDocument(roomId: string, format: "json"): Promise<ToSimplifiedJson<S>>;
362
326
  /**
363
327
  * Initializes a room’s Storage. The room must already exist and have an empty Storage.
364
328
  * Calling this endpoint will disconnect all users from the room if there are any.
@@ -389,18 +353,22 @@ declare class Liveblocks {
389
353
  /**
390
354
  * Send a Yjs binary update to the room’s Yjs document. You can use this endpoint to initialize Yjs data for the room or to update the room’s Yjs document.
391
355
  * @param roomId The id of the room to send the Yjs binary update to.
392
- * @param params The Yjs binary update to send. Read the [Yjs documentation](https://docs.yjs.dev/api/document-updates) to learn how to create a binary update.
356
+ * @param update The Yjs update to send. Typically the result of calling `Yjs.encodeStateAsUpdate(doc)`. Read the [Yjs documentation](https://docs.yjs.dev/api/document-updates) to learn how to create a binary update.
357
+ * @param params.guid (optional) If provided, the binary update will be applied to the Yjs subdocument with the given guid. If not provided, the binary update will be applied to the root Yjs document.
393
358
  */
394
- sendYjsBinaryUpdate(roomId: string, params: {
395
- update: string;
359
+ sendYjsBinaryUpdate(roomId: string, update: Uint8Array, params?: {
360
+ guid?: string;
396
361
  }): Promise<void>;
397
362
  /**
398
363
  * Returns the room’s Yjs document encoded as a single binary update. This can be used by Y.applyUpdate(responseBody) to get a copy of the document in your backend.
399
364
  * See [Yjs documentation](https://docs.yjs.dev/api/document-updates) for more information on working with updates.
400
365
  * @param roomId The id of the room to get the Yjs document from.
366
+ * @param params.guid (optional) If provided, returns the binary update of the Yjs subdocument with the given guid. If not provided, returns the binary update of the root Yjs document.
401
367
  * @returns The room’s Yjs document encoded as a single binary update.
402
368
  */
403
- getYjsDocumentAsBinaryUpdate(roomId: string): Promise<ArrayBuffer>;
369
+ getYjsDocumentAsBinaryUpdate(roomId: string, params?: {
370
+ guid?: string;
371
+ }): Promise<ArrayBuffer>;
404
372
  /**
405
373
  * Creates a new schema which can be referenced later to enforce a room’s Storage data structure.
406
374
  * @param name The name used to reference the schema. Must be a non-empty string with less than 65 characters and only contain lowercase letters, numbers and dashes
@@ -451,12 +419,41 @@ declare class Liveblocks {
451
419
  * Gets all the threads in a room.
452
420
  *
453
421
  * @param params.roomId The room ID to get the threads from.
422
+ * @param params.query The query to filter threads by. It is based on our query language and can filter by metadata.
454
423
  * @returns A list of threads.
455
424
  */
456
425
  getThreads(params: {
457
426
  roomId: string;
427
+ /**
428
+ * The query to filter threads by. It is based on our query language.
429
+ *
430
+ * @example
431
+ * ```
432
+ * {
433
+ * query: "metadata['organization']^'liveblocks:' AND metadata['status']:'open' AND metadata['resolved']:false AND metadata['priority']:3"
434
+ * }
435
+ * ```
436
+ * @example
437
+ * ```
438
+ * {
439
+ * query: {
440
+ * metadata: {
441
+ * status: "open",
442
+ * resolved: false,
443
+ * priority: 3,
444
+ * organization: {
445
+ * startsWith: "liveblocks:"
446
+ * }
447
+ * }
448
+ * }
449
+ * }
450
+ * ```
451
+ */
452
+ query?: string | {
453
+ metadata?: Partial<QueryMetadata<M>>;
454
+ };
458
455
  }): Promise<{
459
- data: ThreadData[];
456
+ data: ThreadData<M>[];
460
457
  }>;
461
458
  /**
462
459
  * Gets a thread.
@@ -465,10 +462,10 @@ declare class Liveblocks {
465
462
  * @param params.threadId The thread ID.
466
463
  * @returns A thread.
467
464
  */
468
- getThread<TThreadMetadata extends BaseMetadata = never>(params: {
465
+ getThread(params: {
469
466
  roomId: string;
470
467
  threadId: string;
471
- }): Promise<ThreadData<TThreadMetadata>>;
468
+ }): Promise<ThreadData<M>>;
472
469
  /**
473
470
  * Gets a thread's participants.
474
471
  *
@@ -554,17 +551,7 @@ declare class Liveblocks {
554
551
  * @param params.thread.comment.body The body of the comment.
555
552
  * @returns The created thread. The thread will be created with the specified comment as its first comment.
556
553
  */
557
- createThread<TThreadMetadata extends BaseMetadata = never>(params: {
558
- roomId: string;
559
- data: {
560
- metadata?: [TThreadMetadata] extends [never] ? Record<string, never> : TThreadMetadata;
561
- comment: {
562
- userId: string;
563
- createdAt?: Date;
564
- body: CommentBody;
565
- };
566
- };
567
- }): Promise<ThreadData<TThreadMetadata>>;
554
+ createThread(params: CreateThreadOptions<M>): Promise<ThreadData<M>>;
568
555
  /**
569
556
  * Updates the metadata of the specified thread in a room.
570
557
  * @param params.roomId The room ID to update the thread in.
@@ -574,15 +561,15 @@ declare class Liveblocks {
574
561
  * @param params.data.updatedAt (optional) The date the thread is set to be updated.
575
562
  * @returns The updated thread.
576
563
  */
577
- editThreadMetadata<TThreadMetadata extends BaseMetadata = never>(params: {
564
+ editThreadMetadata(params: {
578
565
  roomId: string;
579
566
  threadId: string;
580
567
  data: {
581
- metadata: Nullable<BaseMetadata>;
568
+ metadata: Patchable<M>;
582
569
  userId: string;
583
570
  updatedAt?: Date;
584
571
  };
585
- }): Promise<TThreadMetadata>;
572
+ }): Promise<M>;
586
573
  /**
587
574
  * Adds a new comment reaction to a comment.
588
575
  * @param params.roomId The room ID to add the comment reaction in.
@@ -622,6 +609,64 @@ declare class Liveblocks {
622
609
  removedAt?: Date;
623
610
  };
624
611
  }): Promise<void>;
612
+ /**
613
+ * Returns the inbox notifications for a user.
614
+ * @param params.userId The user ID to get the inbox notifications from.
615
+ * @param params.inboxNotificationId The ID of the inbox notification to get.
616
+ */
617
+ getInboxNotification(params: {
618
+ userId: string;
619
+ inboxNotificationId: string;
620
+ }): Promise<InboxNotificationData>;
621
+ /**
622
+ * Gets the user's room notification settings.
623
+ * @param params.userId The user ID to get the room notifications from.
624
+ * @param params.roomId The room ID to get the room notification settings from.
625
+ */
626
+ getRoomNotificationSettings(params: {
627
+ userId: string;
628
+ roomId: string;
629
+ }): Promise<RoomNotificationSettings>;
630
+ /**
631
+ * Updates the user's room notification settings.
632
+ * @param params.userId The user ID to update the room notification settings for.
633
+ * @param params.roomId The room ID to update the room notification settings for.
634
+ * @param params.data The new room notification settings for the user.
635
+ */
636
+ updateRoomNotificationSettings(params: {
637
+ userId: string;
638
+ roomId: string;
639
+ data: RoomNotificationSettings;
640
+ }): Promise<RoomNotificationSettings>;
641
+ /**
642
+ * Delete the user's room notification settings.
643
+ * @param params.userId The user ID to delete the room notification settings from.
644
+ * @param params.roomId The room ID to delete the room notification settings from.
645
+ */
646
+ deleteRoomNotificationSettings(params: {
647
+ userId: string;
648
+ roomId: string;
649
+ }): Promise<void>;
650
+ /**
651
+ * Update a room ID.
652
+ * @param params.roomId The current ID of the room.
653
+ * @param params.newRoomId The new room ID.
654
+ */
655
+ updateRoomId(params: {
656
+ currentRoomId: string;
657
+ newRoomId: string;
658
+ }): Promise<RoomData>;
659
+ triggerInboxNotification(params: {
660
+ userId: string;
661
+ kind: `$${string}`;
662
+ roomId?: string;
663
+ subjectId: string;
664
+ activityData: ActivityData;
665
+ }): Promise<void>;
666
+ }
667
+ declare class LiveblocksError extends Error {
668
+ status: number;
669
+ constructor(status: number, message?: string);
625
670
  }
626
671
 
627
672
  declare class WebhookHandler {
@@ -680,7 +725,7 @@ declare type WebhookRequest = {
680
725
  */
681
726
  rawBody: string;
682
727
  };
683
- declare type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | ThreadMetadataUpdatedEvent | ThreadCreatedEvent | YDocUpdatedEvent;
728
+ declare type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | ThreadMetadataUpdatedEvent | NotificationEvent | ThreadCreatedEvent | YDocUpdatedEvent;
684
729
  declare type StorageUpdatedEvent = {
685
730
  type: "storageUpdated";
686
731
  data: {
@@ -831,6 +876,11 @@ declare type YDocUpdatedEvent = {
831
876
  data: {
832
877
  projectId: string;
833
878
  roomId: string;
879
+ /**
880
+ * ISO 8601 datestring
881
+ * @example "2021-03-01T12:00:00.000Z"
882
+ */
883
+ updatedAt: string;
834
884
  };
835
885
  };
836
886
  declare type ThreadMetadataUpdatedEvent = {
@@ -861,5 +911,65 @@ declare type ThreadCreatedEvent = {
861
911
  createdBy: string;
862
912
  };
863
913
  };
914
+ declare type ThreadNotificationEvent = {
915
+ type: "notification";
916
+ data: {
917
+ channel: "email";
918
+ kind: "thread";
919
+ projectId: string;
920
+ roomId: string;
921
+ userId: string;
922
+ threadId: string;
923
+ inboxNotificationId: string;
924
+ /**
925
+ * ISO 8601 datestring
926
+ * @example "2021-03-01T12:00:00.000Z"
927
+ */
928
+ createdAt: string;
929
+ };
930
+ };
931
+ declare type TextMentionNotificationEvent = {
932
+ type: "notification";
933
+ data: {
934
+ channel: "email";
935
+ kind: "textMention";
936
+ projectId: string;
937
+ roomId: string;
938
+ userId: string;
939
+ mentionId: string;
940
+ inboxNotificationId: string;
941
+ /**
942
+ * ISO 8601 datestring
943
+ * @example "2021-03-01T12:00:00.000Z"
944
+ */
945
+ createdAt: string;
946
+ };
947
+ };
948
+ declare type CustomKind = `$${string}`;
949
+ declare type CustomNotificationEvent = {
950
+ type: "notification";
951
+ data: {
952
+ channel: "email";
953
+ kind: CustomKind;
954
+ projectId: string;
955
+ roomId: string | null;
956
+ userId: string;
957
+ subjectId: string;
958
+ inboxNotificationId: string;
959
+ /**
960
+ * ISO 8601 datestring
961
+ * @example "2021-03-01T12:00:00.000Z"
962
+ */
963
+ createdAt: string;
964
+ };
965
+ };
966
+ declare type NotificationEvent = ThreadNotificationEvent | TextMentionNotificationEvent | CustomNotificationEvent;
967
+
968
+ /**
969
+ * @deprecated RoomInfo was renamed to RoomData, to avoid
970
+ * confusion with the globally augmentable RoomInfo type. This
971
+ * alias will be removed in a future version.
972
+ */
973
+ declare type RoomInfo = RoomData;
864
974
 
865
- export { type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, Liveblocks, type LiveblocksOptions, type RoomAccesses, type RoomCreatedEvent, type RoomDeletedEvent, type RoomInfo, type RoomPermission, type RoomUser, type Schema, type StorageUpdatedEvent, type ThreadCreatedEvent, type ThreadMetadataUpdatedEvent, type ThreadParticipants, type UserEnteredEvent, type UserLeftEvent, type WebhookEvent, WebhookHandler, type WebhookRequest, authorize };
975
+ export { type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, Liveblocks, LiveblocksError, type LiveblocksOptions, type NotificationEvent, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomInfo, type RoomPermission, type RoomUser, type Schema, type StorageUpdatedEvent, type ThreadCreatedEvent, type ThreadMetadataUpdatedEvent, type ThreadParticipants, type UserEnteredEvent, type UserLeftEvent, type WebhookEvent, WebhookHandler, type WebhookRequest };