@liveblocks/node 3.6.0 → 3.7.0-preview1
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.cjs +230 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -3
- package/dist/index.d.ts +100 -3
- package/dist/index.js +216 -17
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, SubscriptionData, Patchable, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
|
|
1
|
+
import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, SubscriptionData, Patchable, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
|
|
2
2
|
export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, LiveList, LiveMap, LiveObject, LiveStructure, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
|
|
3
3
|
import { IncomingHttpHeaders } from 'http';
|
|
4
4
|
|
|
@@ -75,7 +75,9 @@ type LiveblocksOptions = {
|
|
|
75
75
|
};
|
|
76
76
|
type CreateSessionOptions<U extends BaseUserMeta = DU> = PartialUnless<U["info"], {
|
|
77
77
|
userInfo: U["info"];
|
|
78
|
-
}
|
|
78
|
+
}> & {
|
|
79
|
+
tenantId?: string;
|
|
80
|
+
};
|
|
79
81
|
type IdentifyUserOptions<U extends BaseUserMeta = DU> = PartialUnless<U["info"], {
|
|
80
82
|
userInfo: U["info"];
|
|
81
83
|
}>;
|
|
@@ -246,6 +248,7 @@ type RoomsQueryCriteria = {
|
|
|
246
248
|
};
|
|
247
249
|
type InboxNotificationsQueryCriteria = {
|
|
248
250
|
userId: string;
|
|
251
|
+
tenantId?: string;
|
|
249
252
|
/**
|
|
250
253
|
* The query to filter inbox notifications by. It is based on our query language.
|
|
251
254
|
*
|
|
@@ -285,6 +288,7 @@ type CreateRoomOptions = {
|
|
|
285
288
|
groupsAccesses?: RoomAccesses;
|
|
286
289
|
usersAccesses?: RoomAccesses;
|
|
287
290
|
metadata?: RoomMetadata;
|
|
291
|
+
tenantId?: string;
|
|
288
292
|
};
|
|
289
293
|
type UpdateRoomOptions = {
|
|
290
294
|
defaultAccesses?: RoomPermission | null;
|
|
@@ -427,6 +431,8 @@ declare class Liveblocks {
|
|
|
427
431
|
* uniquely identify the user account in your system. The uniqueness of this
|
|
428
432
|
* value will determine how many MAUs will be counted/billed.
|
|
429
433
|
*
|
|
434
|
+
* @param tenantId (optional) The tenant ID to authorize the user for.
|
|
435
|
+
*
|
|
430
436
|
* @param options.userInfo Custom metadata to attach to this user. Data you
|
|
431
437
|
* add here will be visible to all other clients in the room, through the
|
|
432
438
|
* `other.info` property.
|
|
@@ -477,6 +483,7 @@ declare class Liveblocks {
|
|
|
477
483
|
* @param params.userId (optional) A filter on users accesses.
|
|
478
484
|
* @param params.metadata (optional) A filter on metadata. Multiple metadata keys can be used to filter rooms.
|
|
479
485
|
* @param params.groupIds (optional) A filter on groups accesses. Multiple groups can be used.
|
|
486
|
+
* @param params.tenantId (optional) A filter on tenant ID.
|
|
480
487
|
* @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.
|
|
481
488
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
482
489
|
* @returns A list of rooms.
|
|
@@ -506,6 +513,7 @@ declare class Liveblocks {
|
|
|
506
513
|
* @param params.groupsAccesses (optional) The group accesses for the room. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
507
514
|
* @param params.usersAccesses (optional) The user accesses for the room. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
508
515
|
* @param params.metadata (optional) The metadata for the room. Supports upto a maximum of 50 entries. Key length has a limit of 40 characters. Value length has a limit of 256 characters.
|
|
516
|
+
* @param params.tenantId (optional) The tenant ID to create the room for.
|
|
509
517
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
510
518
|
* @returns The created room.
|
|
511
519
|
*/
|
|
@@ -521,6 +529,7 @@ declare class Liveblocks {
|
|
|
521
529
|
* @param params.groupsAccesses (optional) The group accesses for the room if the room will be created. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
522
530
|
* @param params.usersAccesses (optional) The user accesses for the room if the room will be created. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
523
531
|
* @param params.metadata (optional) The metadata for the room if the room will be created. Supports upto a maximum of 50 entries. Key length has a limit of 40 characters. Value length has a limit of 256 characters.
|
|
532
|
+
* @param params.tenantId (optional) The tenant ID to create the room for.
|
|
524
533
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
525
534
|
* @returns The room.
|
|
526
535
|
*/
|
|
@@ -758,10 +767,14 @@ declare class Liveblocks {
|
|
|
758
767
|
threadId: string;
|
|
759
768
|
}, options?: RequestOptions): Promise<ThreadData<M>>;
|
|
760
769
|
/**
|
|
770
|
+
* @deprecated Prefer using `getMentionsFromCommentBody` to extract mentions
|
|
771
|
+
* from comments and threads, or `Liveblocks.getThreadSubscriptions` to get
|
|
772
|
+
* the list of users who are subscribed to a thread.
|
|
773
|
+
*
|
|
761
774
|
* Gets a thread's participants.
|
|
762
775
|
*
|
|
763
776
|
* Participants are users who have commented on the thread
|
|
764
|
-
* or users
|
|
777
|
+
* or users that have been mentioned in a comment.
|
|
765
778
|
*
|
|
766
779
|
* @param params.roomId The room ID to get the thread participants from.
|
|
767
780
|
* @param params.threadId The thread ID to get the participants from.
|
|
@@ -1006,6 +1019,7 @@ declare class Liveblocks {
|
|
|
1006
1019
|
* Returns the inbox notifications for a user.
|
|
1007
1020
|
* @param params.userId The user ID to get the inbox notifications from.
|
|
1008
1021
|
* @param params.query The query to filter inbox notifications by. It is based on our query language and can filter by unread.
|
|
1022
|
+
* @param params.tenantId (optional) The tenant ID to get the inbox notifications for.
|
|
1009
1023
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1010
1024
|
*/
|
|
1011
1025
|
getInboxNotifications(params: GetInboxNotificationsOptions, options?: RequestOptions): Promise<Page<InboxNotificationData>>;
|
|
@@ -1017,6 +1031,7 @@ declare class Liveblocks {
|
|
|
1017
1031
|
*
|
|
1018
1032
|
* @param criteria.userId The user ID to get the inbox notifications from.
|
|
1019
1033
|
* @param criteria.query The query to filter inbox notifications by. It is based on our query language and can filter by unread.
|
|
1034
|
+
* @param criteria.tenantId (optional) The tenant ID to get the inbox notifications for.
|
|
1020
1035
|
* @param options.pageSize (optional) The page size to use for each request.
|
|
1021
1036
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1022
1037
|
*/
|
|
@@ -1026,12 +1041,14 @@ declare class Liveblocks {
|
|
|
1026
1041
|
/**
|
|
1027
1042
|
* Returns all room subscription settings for a user.
|
|
1028
1043
|
* @param params.userId The user ID to get the room subscription settings from.
|
|
1044
|
+
* @param params.tenantId (optional) The tenant ID to get the room subscription settings for.
|
|
1029
1045
|
* @param params.startingAfter (optional) The cursor to start the pagination from.
|
|
1030
1046
|
* @param params.limit (optional) The number of items to return.
|
|
1031
1047
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1032
1048
|
*/
|
|
1033
1049
|
getUserRoomSubscriptionSettings(params: {
|
|
1034
1050
|
userId: string;
|
|
1051
|
+
tenantId?: string;
|
|
1035
1052
|
} & PaginationOptions, options?: RequestOptions): Promise<Page<UserRoomSubscriptionSettings>>;
|
|
1036
1053
|
/**
|
|
1037
1054
|
* Gets the user's room subscription settings.
|
|
@@ -1075,10 +1092,21 @@ declare class Liveblocks {
|
|
|
1075
1092
|
currentRoomId: string;
|
|
1076
1093
|
newRoomId: string;
|
|
1077
1094
|
}, options?: RequestOptions): Promise<RoomData>;
|
|
1095
|
+
/**
|
|
1096
|
+
* Triggers an inbox notification for a user.
|
|
1097
|
+
* @param params.userId The user ID to trigger the inbox notification for.
|
|
1098
|
+
* @param params.kind The kind of inbox notification to trigger.
|
|
1099
|
+
* @param params.subjectId The subject ID of the triggered inbox notification.
|
|
1100
|
+
* @param params.activityData The activity data of the triggered inbox notification.
|
|
1101
|
+
* @param params.roomId (optional) The room ID to trigger the inbox notification for.
|
|
1102
|
+
* @param params.tenantId (optional) The tenant ID to trigger the inbox notification for.
|
|
1103
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1104
|
+
*/
|
|
1078
1105
|
triggerInboxNotification<K extends KDAD>(params: {
|
|
1079
1106
|
userId: string;
|
|
1080
1107
|
kind: K;
|
|
1081
1108
|
roomId?: string;
|
|
1109
|
+
tenantId?: string;
|
|
1082
1110
|
subjectId: string;
|
|
1083
1111
|
activityData: DAD[K];
|
|
1084
1112
|
}, options?: RequestOptions): Promise<void>;
|
|
@@ -1095,10 +1123,12 @@ declare class Liveblocks {
|
|
|
1095
1123
|
/**
|
|
1096
1124
|
* Deletes all inbox notifications for a user.
|
|
1097
1125
|
* @param params.userId The user ID for which to delete all the inbox notifications.
|
|
1126
|
+
* @param params.tenantId (optional) The tenant ID to delete the inbox notifications for.
|
|
1098
1127
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1099
1128
|
*/
|
|
1100
1129
|
deleteAllInboxNotifications(params: {
|
|
1101
1130
|
userId: string;
|
|
1131
|
+
tenantId?: string;
|
|
1102
1132
|
}, options?: RequestOptions): Promise<void>;
|
|
1103
1133
|
/**
|
|
1104
1134
|
* Get notification settings for a user for a project.
|
|
@@ -1126,6 +1156,73 @@ declare class Liveblocks {
|
|
|
1126
1156
|
deleteNotificationSettings(params: {
|
|
1127
1157
|
userId: string;
|
|
1128
1158
|
}, options?: RequestOptions): Promise<void>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Create a group
|
|
1161
|
+
* @param params.groupId The ID of the group to create.
|
|
1162
|
+
* @param params.memberIds The IDs of the members to add to the group.
|
|
1163
|
+
* @param params.tenantId (optional) The tenant ID to create the group for.
|
|
1164
|
+
* @param params.scopes (optional) The scopes to grant to the group. The default is `{ mention: true }`.
|
|
1165
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1166
|
+
*/
|
|
1167
|
+
createGroup(params: {
|
|
1168
|
+
groupId: string;
|
|
1169
|
+
memberIds?: string[];
|
|
1170
|
+
tenantId?: string;
|
|
1171
|
+
scopes?: GroupScopes;
|
|
1172
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1173
|
+
/**
|
|
1174
|
+
* Get a group
|
|
1175
|
+
* @param params.groupId The ID of the group to get.
|
|
1176
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1177
|
+
*/
|
|
1178
|
+
getGroup(params: {
|
|
1179
|
+
groupId: string;
|
|
1180
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Add members to a group
|
|
1183
|
+
* @param params.groupId The ID of the group to add members to.
|
|
1184
|
+
* @param params.memberIds The IDs of the members to add to the group.
|
|
1185
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1186
|
+
*/
|
|
1187
|
+
addGroupMembers(params: {
|
|
1188
|
+
groupId: string;
|
|
1189
|
+
memberIds: string[];
|
|
1190
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1191
|
+
/**
|
|
1192
|
+
* Remove members from a group
|
|
1193
|
+
* @param params.groupId The ID of the group to remove members from.
|
|
1194
|
+
* @param params.memberIds The IDs of the members to remove from the group.
|
|
1195
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1196
|
+
*/
|
|
1197
|
+
removeGroupMembers(params: {
|
|
1198
|
+
groupId: string;
|
|
1199
|
+
memberIds: string[];
|
|
1200
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Delete a group
|
|
1203
|
+
* @param params.groupId The ID of the group to delete.
|
|
1204
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1205
|
+
*/
|
|
1206
|
+
deleteGroup(params: {
|
|
1207
|
+
groupId: string;
|
|
1208
|
+
}, options?: RequestOptions): Promise<void>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Get all groups
|
|
1211
|
+
* @param params.limit (optional) The number of groups to return.
|
|
1212
|
+
* @param params.startingAfter (optional) The cursor to start the pagination from.
|
|
1213
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1214
|
+
*/
|
|
1215
|
+
getGroups(params?: PaginationOptions, options?: RequestOptions): Promise<Page<GroupData>>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Returns all groups a user is a member of.
|
|
1218
|
+
* @param params.userId The user ID to get the groups for.
|
|
1219
|
+
* @param params.startingAfter (optional) The cursor to start the pagination from.
|
|
1220
|
+
* @param params.limit (optional) The number of items to return.
|
|
1221
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1222
|
+
*/
|
|
1223
|
+
getUserGroups(params: {
|
|
1224
|
+
userId: string;
|
|
1225
|
+
} & PaginationOptions, options?: RequestOptions): Promise<Page<GroupData>>;
|
|
1129
1226
|
/**
|
|
1130
1227
|
* Retrieves the current Storage contents for the given room ID and calls the
|
|
1131
1228
|
* provided callback function, in which you can mutate the Storage contents
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, SubscriptionData, Patchable, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
|
|
1
|
+
import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, SubscriptionData, Patchable, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
|
|
2
2
|
export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, LiveList, LiveMap, LiveObject, LiveStructure, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
|
|
3
3
|
import { IncomingHttpHeaders } from 'http';
|
|
4
4
|
|
|
@@ -75,7 +75,9 @@ type LiveblocksOptions = {
|
|
|
75
75
|
};
|
|
76
76
|
type CreateSessionOptions<U extends BaseUserMeta = DU> = PartialUnless<U["info"], {
|
|
77
77
|
userInfo: U["info"];
|
|
78
|
-
}
|
|
78
|
+
}> & {
|
|
79
|
+
tenantId?: string;
|
|
80
|
+
};
|
|
79
81
|
type IdentifyUserOptions<U extends BaseUserMeta = DU> = PartialUnless<U["info"], {
|
|
80
82
|
userInfo: U["info"];
|
|
81
83
|
}>;
|
|
@@ -246,6 +248,7 @@ type RoomsQueryCriteria = {
|
|
|
246
248
|
};
|
|
247
249
|
type InboxNotificationsQueryCriteria = {
|
|
248
250
|
userId: string;
|
|
251
|
+
tenantId?: string;
|
|
249
252
|
/**
|
|
250
253
|
* The query to filter inbox notifications by. It is based on our query language.
|
|
251
254
|
*
|
|
@@ -285,6 +288,7 @@ type CreateRoomOptions = {
|
|
|
285
288
|
groupsAccesses?: RoomAccesses;
|
|
286
289
|
usersAccesses?: RoomAccesses;
|
|
287
290
|
metadata?: RoomMetadata;
|
|
291
|
+
tenantId?: string;
|
|
288
292
|
};
|
|
289
293
|
type UpdateRoomOptions = {
|
|
290
294
|
defaultAccesses?: RoomPermission | null;
|
|
@@ -427,6 +431,8 @@ declare class Liveblocks {
|
|
|
427
431
|
* uniquely identify the user account in your system. The uniqueness of this
|
|
428
432
|
* value will determine how many MAUs will be counted/billed.
|
|
429
433
|
*
|
|
434
|
+
* @param tenantId (optional) The tenant ID to authorize the user for.
|
|
435
|
+
*
|
|
430
436
|
* @param options.userInfo Custom metadata to attach to this user. Data you
|
|
431
437
|
* add here will be visible to all other clients in the room, through the
|
|
432
438
|
* `other.info` property.
|
|
@@ -477,6 +483,7 @@ declare class Liveblocks {
|
|
|
477
483
|
* @param params.userId (optional) A filter on users accesses.
|
|
478
484
|
* @param params.metadata (optional) A filter on metadata. Multiple metadata keys can be used to filter rooms.
|
|
479
485
|
* @param params.groupIds (optional) A filter on groups accesses. Multiple groups can be used.
|
|
486
|
+
* @param params.tenantId (optional) A filter on tenant ID.
|
|
480
487
|
* @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.
|
|
481
488
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
482
489
|
* @returns A list of rooms.
|
|
@@ -506,6 +513,7 @@ declare class Liveblocks {
|
|
|
506
513
|
* @param params.groupsAccesses (optional) The group accesses for the room. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
507
514
|
* @param params.usersAccesses (optional) The user accesses for the room. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
508
515
|
* @param params.metadata (optional) The metadata for the room. Supports upto a maximum of 50 entries. Key length has a limit of 40 characters. Value length has a limit of 256 characters.
|
|
516
|
+
* @param params.tenantId (optional) The tenant ID to create the room for.
|
|
509
517
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
510
518
|
* @returns The created room.
|
|
511
519
|
*/
|
|
@@ -521,6 +529,7 @@ declare class Liveblocks {
|
|
|
521
529
|
* @param params.groupsAccesses (optional) The group accesses for the room if the room will be created. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
522
530
|
* @param params.usersAccesses (optional) The user accesses for the room if the room will be created. Can contain a maximum of 100 entries. Key length has a limit of 40 characters.
|
|
523
531
|
* @param params.metadata (optional) The metadata for the room if the room will be created. Supports upto a maximum of 50 entries. Key length has a limit of 40 characters. Value length has a limit of 256 characters.
|
|
532
|
+
* @param params.tenantId (optional) The tenant ID to create the room for.
|
|
524
533
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
525
534
|
* @returns The room.
|
|
526
535
|
*/
|
|
@@ -758,10 +767,14 @@ declare class Liveblocks {
|
|
|
758
767
|
threadId: string;
|
|
759
768
|
}, options?: RequestOptions): Promise<ThreadData<M>>;
|
|
760
769
|
/**
|
|
770
|
+
* @deprecated Prefer using `getMentionsFromCommentBody` to extract mentions
|
|
771
|
+
* from comments and threads, or `Liveblocks.getThreadSubscriptions` to get
|
|
772
|
+
* the list of users who are subscribed to a thread.
|
|
773
|
+
*
|
|
761
774
|
* Gets a thread's participants.
|
|
762
775
|
*
|
|
763
776
|
* Participants are users who have commented on the thread
|
|
764
|
-
* or users
|
|
777
|
+
* or users that have been mentioned in a comment.
|
|
765
778
|
*
|
|
766
779
|
* @param params.roomId The room ID to get the thread participants from.
|
|
767
780
|
* @param params.threadId The thread ID to get the participants from.
|
|
@@ -1006,6 +1019,7 @@ declare class Liveblocks {
|
|
|
1006
1019
|
* Returns the inbox notifications for a user.
|
|
1007
1020
|
* @param params.userId The user ID to get the inbox notifications from.
|
|
1008
1021
|
* @param params.query The query to filter inbox notifications by. It is based on our query language and can filter by unread.
|
|
1022
|
+
* @param params.tenantId (optional) The tenant ID to get the inbox notifications for.
|
|
1009
1023
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1010
1024
|
*/
|
|
1011
1025
|
getInboxNotifications(params: GetInboxNotificationsOptions, options?: RequestOptions): Promise<Page<InboxNotificationData>>;
|
|
@@ -1017,6 +1031,7 @@ declare class Liveblocks {
|
|
|
1017
1031
|
*
|
|
1018
1032
|
* @param criteria.userId The user ID to get the inbox notifications from.
|
|
1019
1033
|
* @param criteria.query The query to filter inbox notifications by. It is based on our query language and can filter by unread.
|
|
1034
|
+
* @param criteria.tenantId (optional) The tenant ID to get the inbox notifications for.
|
|
1020
1035
|
* @param options.pageSize (optional) The page size to use for each request.
|
|
1021
1036
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1022
1037
|
*/
|
|
@@ -1026,12 +1041,14 @@ declare class Liveblocks {
|
|
|
1026
1041
|
/**
|
|
1027
1042
|
* Returns all room subscription settings for a user.
|
|
1028
1043
|
* @param params.userId The user ID to get the room subscription settings from.
|
|
1044
|
+
* @param params.tenantId (optional) The tenant ID to get the room subscription settings for.
|
|
1029
1045
|
* @param params.startingAfter (optional) The cursor to start the pagination from.
|
|
1030
1046
|
* @param params.limit (optional) The number of items to return.
|
|
1031
1047
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1032
1048
|
*/
|
|
1033
1049
|
getUserRoomSubscriptionSettings(params: {
|
|
1034
1050
|
userId: string;
|
|
1051
|
+
tenantId?: string;
|
|
1035
1052
|
} & PaginationOptions, options?: RequestOptions): Promise<Page<UserRoomSubscriptionSettings>>;
|
|
1036
1053
|
/**
|
|
1037
1054
|
* Gets the user's room subscription settings.
|
|
@@ -1075,10 +1092,21 @@ declare class Liveblocks {
|
|
|
1075
1092
|
currentRoomId: string;
|
|
1076
1093
|
newRoomId: string;
|
|
1077
1094
|
}, options?: RequestOptions): Promise<RoomData>;
|
|
1095
|
+
/**
|
|
1096
|
+
* Triggers an inbox notification for a user.
|
|
1097
|
+
* @param params.userId The user ID to trigger the inbox notification for.
|
|
1098
|
+
* @param params.kind The kind of inbox notification to trigger.
|
|
1099
|
+
* @param params.subjectId The subject ID of the triggered inbox notification.
|
|
1100
|
+
* @param params.activityData The activity data of the triggered inbox notification.
|
|
1101
|
+
* @param params.roomId (optional) The room ID to trigger the inbox notification for.
|
|
1102
|
+
* @param params.tenantId (optional) The tenant ID to trigger the inbox notification for.
|
|
1103
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1104
|
+
*/
|
|
1078
1105
|
triggerInboxNotification<K extends KDAD>(params: {
|
|
1079
1106
|
userId: string;
|
|
1080
1107
|
kind: K;
|
|
1081
1108
|
roomId?: string;
|
|
1109
|
+
tenantId?: string;
|
|
1082
1110
|
subjectId: string;
|
|
1083
1111
|
activityData: DAD[K];
|
|
1084
1112
|
}, options?: RequestOptions): Promise<void>;
|
|
@@ -1095,10 +1123,12 @@ declare class Liveblocks {
|
|
|
1095
1123
|
/**
|
|
1096
1124
|
* Deletes all inbox notifications for a user.
|
|
1097
1125
|
* @param params.userId The user ID for which to delete all the inbox notifications.
|
|
1126
|
+
* @param params.tenantId (optional) The tenant ID to delete the inbox notifications for.
|
|
1098
1127
|
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1099
1128
|
*/
|
|
1100
1129
|
deleteAllInboxNotifications(params: {
|
|
1101
1130
|
userId: string;
|
|
1131
|
+
tenantId?: string;
|
|
1102
1132
|
}, options?: RequestOptions): Promise<void>;
|
|
1103
1133
|
/**
|
|
1104
1134
|
* Get notification settings for a user for a project.
|
|
@@ -1126,6 +1156,73 @@ declare class Liveblocks {
|
|
|
1126
1156
|
deleteNotificationSettings(params: {
|
|
1127
1157
|
userId: string;
|
|
1128
1158
|
}, options?: RequestOptions): Promise<void>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Create a group
|
|
1161
|
+
* @param params.groupId The ID of the group to create.
|
|
1162
|
+
* @param params.memberIds The IDs of the members to add to the group.
|
|
1163
|
+
* @param params.tenantId (optional) The tenant ID to create the group for.
|
|
1164
|
+
* @param params.scopes (optional) The scopes to grant to the group. The default is `{ mention: true }`.
|
|
1165
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1166
|
+
*/
|
|
1167
|
+
createGroup(params: {
|
|
1168
|
+
groupId: string;
|
|
1169
|
+
memberIds?: string[];
|
|
1170
|
+
tenantId?: string;
|
|
1171
|
+
scopes?: GroupScopes;
|
|
1172
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1173
|
+
/**
|
|
1174
|
+
* Get a group
|
|
1175
|
+
* @param params.groupId The ID of the group to get.
|
|
1176
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1177
|
+
*/
|
|
1178
|
+
getGroup(params: {
|
|
1179
|
+
groupId: string;
|
|
1180
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Add members to a group
|
|
1183
|
+
* @param params.groupId The ID of the group to add members to.
|
|
1184
|
+
* @param params.memberIds The IDs of the members to add to the group.
|
|
1185
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1186
|
+
*/
|
|
1187
|
+
addGroupMembers(params: {
|
|
1188
|
+
groupId: string;
|
|
1189
|
+
memberIds: string[];
|
|
1190
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1191
|
+
/**
|
|
1192
|
+
* Remove members from a group
|
|
1193
|
+
* @param params.groupId The ID of the group to remove members from.
|
|
1194
|
+
* @param params.memberIds The IDs of the members to remove from the group.
|
|
1195
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1196
|
+
*/
|
|
1197
|
+
removeGroupMembers(params: {
|
|
1198
|
+
groupId: string;
|
|
1199
|
+
memberIds: string[];
|
|
1200
|
+
}, options?: RequestOptions): Promise<GroupData>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Delete a group
|
|
1203
|
+
* @param params.groupId The ID of the group to delete.
|
|
1204
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1205
|
+
*/
|
|
1206
|
+
deleteGroup(params: {
|
|
1207
|
+
groupId: string;
|
|
1208
|
+
}, options?: RequestOptions): Promise<void>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Get all groups
|
|
1211
|
+
* @param params.limit (optional) The number of groups to return.
|
|
1212
|
+
* @param params.startingAfter (optional) The cursor to start the pagination from.
|
|
1213
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1214
|
+
*/
|
|
1215
|
+
getGroups(params?: PaginationOptions, options?: RequestOptions): Promise<Page<GroupData>>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Returns all groups a user is a member of.
|
|
1218
|
+
* @param params.userId The user ID to get the groups for.
|
|
1219
|
+
* @param params.startingAfter (optional) The cursor to start the pagination from.
|
|
1220
|
+
* @param params.limit (optional) The number of items to return.
|
|
1221
|
+
* @param options.signal (optional) An abort signal to cancel the request.
|
|
1222
|
+
*/
|
|
1223
|
+
getUserGroups(params: {
|
|
1224
|
+
userId: string;
|
|
1225
|
+
} & PaginationOptions, options?: RequestOptions): Promise<Page<GroupData>>;
|
|
1129
1226
|
/**
|
|
1130
1227
|
* Retrieves the current Storage contents for the given room ID and calls the
|
|
1131
1228
|
* provided callback function, in which you can mutate the Storage contents
|