@liveblocks/node 2.24.0-deque1 → 2.24.0-sub1

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.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomNotificationSettings, KDAD, DAD, UserNotificationSettings, PartialUserNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
1
+ import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, 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, getMentionedIdsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
3
3
  import { IncomingHttpHeaders } from 'http';
4
4
 
@@ -821,37 +821,75 @@ declare class Liveblocks {
821
821
  pageSize?: number;
822
822
  }): AsyncGenerator<InboxNotificationData>;
823
823
  /**
824
- * Gets the user's room notification settings.
825
- * @param params.userId The user ID to get the room notifications from.
826
- * @param params.roomId The room ID to get the room notification settings from.
824
+ * @deprecated Renamed to `getRoomSubscriptionSettings`
825
+ *
826
+ * Gets the user's room subscription settings.
827
+ * @param params.userId The user ID to get the room subscription settings from.
828
+ * @param params.roomId The room ID to get the room subscription settings from.
827
829
  * @param options.signal (optional) An abort signal to cancel the request.
828
830
  */
829
831
  getRoomNotificationSettings(params: {
830
832
  userId: string;
831
833
  roomId: string;
832
- }, options?: RequestOptions): Promise<RoomNotificationSettings>;
834
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
835
+ /**
836
+ * Gets the user's room subscription settings.
837
+ * @param params.userId The user ID to get the room subscription settings from.
838
+ * @param params.roomId The room ID to get the room subscription settings from.
839
+ * @param options.signal (optional) An abort signal to cancel the request.
840
+ */
841
+ getRoomSubscriptionSettings(params: {
842
+ userId: string;
843
+ roomId: string;
844
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
833
845
  /**
834
- * Updates the user's room notification settings.
835
- * @param params.userId The user ID to update the room notification settings for.
836
- * @param params.roomId The room ID to update the room notification settings for.
837
- * @param params.data The new room notification settings for the user.
846
+ * @deprecated Renamed to `updateRoomSubscriptionSettings`
847
+ *
848
+ * Updates the user's room subscription settings.
849
+ * @param params.userId The user ID to update the room subscription settings for.
850
+ * @param params.roomId The room ID to update the room subscription settings for.
851
+ * @param params.data The new room subscription settings for the user.
838
852
  * @param options.signal (optional) An abort signal to cancel the request.
839
853
  */
840
854
  updateRoomNotificationSettings(params: {
841
855
  userId: string;
842
856
  roomId: string;
843
- data: RoomNotificationSettings;
844
- }, options?: RequestOptions): Promise<RoomNotificationSettings>;
857
+ data: Partial<RoomSubscriptionSettings>;
858
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
845
859
  /**
846
- * Delete the user's room notification settings.
847
- * @param params.userId The user ID to delete the room notification settings from.
848
- * @param params.roomId The room ID to delete the room notification settings from.
860
+ * Updates the user's room subscription settings.
861
+ * @param params.userId The user ID to update the room subscription settings for.
862
+ * @param params.roomId The room ID to update the room subscription settings for.
863
+ * @param params.data The new room subscription settings for the user.
864
+ * @param options.signal (optional) An abort signal to cancel the request.
865
+ */
866
+ updateRoomSubscriptionSettings(params: {
867
+ userId: string;
868
+ roomId: string;
869
+ data: Partial<RoomSubscriptionSettings>;
870
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
871
+ /**
872
+ * @deprecated Renamed to `deleteRoomSubscriptionSettings`
873
+ *
874
+ * Delete the user's room subscription settings.
875
+ * @param params.userId The user ID to delete the room subscription settings from.
876
+ * @param params.roomId The room ID to delete the room subscription settings from.
849
877
  * @param options.signal (optional) An abort signal to cancel the request.
850
878
  */
851
879
  deleteRoomNotificationSettings(params: {
852
880
  userId: string;
853
881
  roomId: string;
854
882
  }, options?: RequestOptions): Promise<void>;
883
+ /**
884
+ * Delete the user's room subscription settings.
885
+ * @param params.userId The user ID to delete the room subscription settings from.
886
+ * @param params.roomId The room ID to delete the room subscription settings from.
887
+ * @param options.signal (optional) An abort signal to cancel the request.
888
+ */
889
+ deleteRoomSubscriptionSettings(params: {
890
+ userId: string;
891
+ roomId: string;
892
+ }, options?: RequestOptions): Promise<void>;
855
893
  /**
856
894
  * Update a room ID.
857
895
  * @param params.roomId The current ID of the room.
@@ -894,7 +932,7 @@ declare class Liveblocks {
894
932
  */
895
933
  getNotificationSettings(params: {
896
934
  userId: string;
897
- }, options?: RequestOptions): Promise<UserNotificationSettings>;
935
+ }, options?: RequestOptions): Promise<NotificationSettings>;
898
936
  /**
899
937
  * Update the user's notification settings.
900
938
  * @param params.userId The user ID to update the notification settings for.
@@ -903,8 +941,8 @@ declare class Liveblocks {
903
941
  */
904
942
  updateNotificationSettings(params: {
905
943
  userId: string;
906
- data: PartialUserNotificationSettings;
907
- }, options?: RequestOptions): Promise<UserNotificationSettings>;
944
+ data: PartialNotificationSettings;
945
+ }, options?: RequestOptions): Promise<NotificationSettings>;
908
946
  /**
909
947
  * Delete the user's notification settings
910
948
  * @param params.userId The user ID to update the notification settings for.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomNotificationSettings, KDAD, DAD, UserNotificationSettings, PartialUserNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
1
+ import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, 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, getMentionedIdsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
3
3
  import { IncomingHttpHeaders } from 'http';
4
4
 
@@ -821,37 +821,75 @@ declare class Liveblocks {
821
821
  pageSize?: number;
822
822
  }): AsyncGenerator<InboxNotificationData>;
823
823
  /**
824
- * Gets the user's room notification settings.
825
- * @param params.userId The user ID to get the room notifications from.
826
- * @param params.roomId The room ID to get the room notification settings from.
824
+ * @deprecated Renamed to `getRoomSubscriptionSettings`
825
+ *
826
+ * Gets the user's room subscription settings.
827
+ * @param params.userId The user ID to get the room subscription settings from.
828
+ * @param params.roomId The room ID to get the room subscription settings from.
827
829
  * @param options.signal (optional) An abort signal to cancel the request.
828
830
  */
829
831
  getRoomNotificationSettings(params: {
830
832
  userId: string;
831
833
  roomId: string;
832
- }, options?: RequestOptions): Promise<RoomNotificationSettings>;
834
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
835
+ /**
836
+ * Gets the user's room subscription settings.
837
+ * @param params.userId The user ID to get the room subscription settings from.
838
+ * @param params.roomId The room ID to get the room subscription settings from.
839
+ * @param options.signal (optional) An abort signal to cancel the request.
840
+ */
841
+ getRoomSubscriptionSettings(params: {
842
+ userId: string;
843
+ roomId: string;
844
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
833
845
  /**
834
- * Updates the user's room notification settings.
835
- * @param params.userId The user ID to update the room notification settings for.
836
- * @param params.roomId The room ID to update the room notification settings for.
837
- * @param params.data The new room notification settings for the user.
846
+ * @deprecated Renamed to `updateRoomSubscriptionSettings`
847
+ *
848
+ * Updates the user's room subscription settings.
849
+ * @param params.userId The user ID to update the room subscription settings for.
850
+ * @param params.roomId The room ID to update the room subscription settings for.
851
+ * @param params.data The new room subscription settings for the user.
838
852
  * @param options.signal (optional) An abort signal to cancel the request.
839
853
  */
840
854
  updateRoomNotificationSettings(params: {
841
855
  userId: string;
842
856
  roomId: string;
843
- data: RoomNotificationSettings;
844
- }, options?: RequestOptions): Promise<RoomNotificationSettings>;
857
+ data: Partial<RoomSubscriptionSettings>;
858
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
845
859
  /**
846
- * Delete the user's room notification settings.
847
- * @param params.userId The user ID to delete the room notification settings from.
848
- * @param params.roomId The room ID to delete the room notification settings from.
860
+ * Updates the user's room subscription settings.
861
+ * @param params.userId The user ID to update the room subscription settings for.
862
+ * @param params.roomId The room ID to update the room subscription settings for.
863
+ * @param params.data The new room subscription settings for the user.
864
+ * @param options.signal (optional) An abort signal to cancel the request.
865
+ */
866
+ updateRoomSubscriptionSettings(params: {
867
+ userId: string;
868
+ roomId: string;
869
+ data: Partial<RoomSubscriptionSettings>;
870
+ }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
871
+ /**
872
+ * @deprecated Renamed to `deleteRoomSubscriptionSettings`
873
+ *
874
+ * Delete the user's room subscription settings.
875
+ * @param params.userId The user ID to delete the room subscription settings from.
876
+ * @param params.roomId The room ID to delete the room subscription settings from.
849
877
  * @param options.signal (optional) An abort signal to cancel the request.
850
878
  */
851
879
  deleteRoomNotificationSettings(params: {
852
880
  userId: string;
853
881
  roomId: string;
854
882
  }, options?: RequestOptions): Promise<void>;
883
+ /**
884
+ * Delete the user's room subscription settings.
885
+ * @param params.userId The user ID to delete the room subscription settings from.
886
+ * @param params.roomId The room ID to delete the room subscription settings from.
887
+ * @param options.signal (optional) An abort signal to cancel the request.
888
+ */
889
+ deleteRoomSubscriptionSettings(params: {
890
+ userId: string;
891
+ roomId: string;
892
+ }, options?: RequestOptions): Promise<void>;
855
893
  /**
856
894
  * Update a room ID.
857
895
  * @param params.roomId The current ID of the room.
@@ -894,7 +932,7 @@ declare class Liveblocks {
894
932
  */
895
933
  getNotificationSettings(params: {
896
934
  userId: string;
897
- }, options?: RequestOptions): Promise<UserNotificationSettings>;
935
+ }, options?: RequestOptions): Promise<NotificationSettings>;
898
936
  /**
899
937
  * Update the user's notification settings.
900
938
  * @param params.userId The user ID to update the notification settings for.
@@ -903,8 +941,8 @@ declare class Liveblocks {
903
941
  */
904
942
  updateNotificationSettings(params: {
905
943
  userId: string;
906
- data: PartialUserNotificationSettings;
907
- }, options?: RequestOptions): Promise<UserNotificationSettings>;
944
+ data: PartialNotificationSettings;
945
+ }, options?: RequestOptions): Promise<NotificationSettings>;
908
946
  /**
909
947
  * Delete the user's notification settings
910
948
  * @param params.userId The user ID to update the notification settings for.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { detectDupes } from "@liveblocks/core";
3
3
 
4
4
  // src/version.ts
5
5
  var PKG_NAME = "@liveblocks/node";
6
- var PKG_VERSION = "2.24.0-deque1";
6
+ var PKG_VERSION = "2.24.0-sub1";
7
7
  var PKG_FORMAT = "esm";
8
8
 
9
9
  // src/client.ts
@@ -15,7 +15,7 @@ import {
15
15
  convertToInboxNotificationData,
16
16
  convertToThreadData,
17
17
  createManagedPool,
18
- createUserNotificationSettings,
18
+ createNotificationSettings,
19
19
  isPlainObject,
20
20
  LiveObject,
21
21
  makeAbortController,
@@ -1350,15 +1350,26 @@ var Liveblocks = class {
1350
1350
  }
1351
1351
  }
1352
1352
  /**
1353
- * Gets the user's room notification settings.
1354
- * @param params.userId The user ID to get the room notifications from.
1355
- * @param params.roomId The room ID to get the room notification settings from.
1353
+ * @deprecated Renamed to `getRoomSubscriptionSettings`
1354
+ *
1355
+ * Gets the user's room subscription settings.
1356
+ * @param params.userId The user ID to get the room subscription settings from.
1357
+ * @param params.roomId The room ID to get the room subscription settings from.
1356
1358
  * @param options.signal (optional) An abort signal to cancel the request.
1357
1359
  */
1358
1360
  async getRoomNotificationSettings(params, options) {
1361
+ return this.getRoomSubscriptionSettings(params, options);
1362
+ }
1363
+ /**
1364
+ * Gets the user's room subscription settings.
1365
+ * @param params.userId The user ID to get the room subscription settings from.
1366
+ * @param params.roomId The room ID to get the room subscription settings from.
1367
+ * @param options.signal (optional) An abort signal to cancel the request.
1368
+ */
1369
+ async getRoomSubscriptionSettings(params, options) {
1359
1370
  const { userId, roomId } = params;
1360
1371
  const res = await this.#get(
1361
- url2`/v2/rooms/${roomId}/users/${userId}/notification-settings`,
1372
+ url2`/v2/rooms/${roomId}/users/${userId}/subscription-settings`,
1362
1373
  void 0,
1363
1374
  options
1364
1375
  );
@@ -1368,16 +1379,28 @@ var Liveblocks = class {
1368
1379
  return await res.json();
1369
1380
  }
1370
1381
  /**
1371
- * Updates the user's room notification settings.
1372
- * @param params.userId The user ID to update the room notification settings for.
1373
- * @param params.roomId The room ID to update the room notification settings for.
1374
- * @param params.data The new room notification settings for the user.
1382
+ * @deprecated Renamed to `updateRoomSubscriptionSettings`
1383
+ *
1384
+ * Updates the user's room subscription settings.
1385
+ * @param params.userId The user ID to update the room subscription settings for.
1386
+ * @param params.roomId The room ID to update the room subscription settings for.
1387
+ * @param params.data The new room subscription settings for the user.
1375
1388
  * @param options.signal (optional) An abort signal to cancel the request.
1376
1389
  */
1377
1390
  async updateRoomNotificationSettings(params, options) {
1391
+ return this.updateRoomSubscriptionSettings(params, options);
1392
+ }
1393
+ /**
1394
+ * Updates the user's room subscription settings.
1395
+ * @param params.userId The user ID to update the room subscription settings for.
1396
+ * @param params.roomId The room ID to update the room subscription settings for.
1397
+ * @param params.data The new room subscription settings for the user.
1398
+ * @param options.signal (optional) An abort signal to cancel the request.
1399
+ */
1400
+ async updateRoomSubscriptionSettings(params, options) {
1378
1401
  const { userId, roomId, data } = params;
1379
1402
  const res = await this.#post(
1380
- url2`/v2/rooms/${roomId}/users/${userId}/notification-settings`,
1403
+ url2`/v2/rooms/${roomId}/users/${userId}/subscription-settings`,
1381
1404
  data,
1382
1405
  options
1383
1406
  );
@@ -1387,15 +1410,26 @@ var Liveblocks = class {
1387
1410
  return await res.json();
1388
1411
  }
1389
1412
  /**
1390
- * Delete the user's room notification settings.
1391
- * @param params.userId The user ID to delete the room notification settings from.
1392
- * @param params.roomId The room ID to delete the room notification settings from.
1413
+ * @deprecated Renamed to `deleteRoomSubscriptionSettings`
1414
+ *
1415
+ * Delete the user's room subscription settings.
1416
+ * @param params.userId The user ID to delete the room subscription settings from.
1417
+ * @param params.roomId The room ID to delete the room subscription settings from.
1393
1418
  * @param options.signal (optional) An abort signal to cancel the request.
1394
1419
  */
1395
1420
  async deleteRoomNotificationSettings(params, options) {
1421
+ return this.deleteRoomSubscriptionSettings(params, options);
1422
+ }
1423
+ /**
1424
+ * Delete the user's room subscription settings.
1425
+ * @param params.userId The user ID to delete the room subscription settings from.
1426
+ * @param params.roomId The room ID to delete the room subscription settings from.
1427
+ * @param options.signal (optional) An abort signal to cancel the request.
1428
+ */
1429
+ async deleteRoomSubscriptionSettings(params, options) {
1396
1430
  const { userId, roomId } = params;
1397
1431
  const res = await this.#delete(
1398
- url2`/v2/rooms/${roomId}/users/${userId}/notification-settings`,
1432
+ url2`/v2/rooms/${roomId}/users/${userId}/subscription-settings`,
1399
1433
  options
1400
1434
  );
1401
1435
  if (!res.ok) {
@@ -1478,7 +1512,7 @@ var Liveblocks = class {
1478
1512
  throw await LiveblocksError.from(res);
1479
1513
  }
1480
1514
  const plainSettings = await res.json();
1481
- const settings = createUserNotificationSettings(plainSettings);
1515
+ const settings = createNotificationSettings(plainSettings);
1482
1516
  return settings;
1483
1517
  }
1484
1518
  /**
@@ -1498,7 +1532,7 @@ var Liveblocks = class {
1498
1532
  throw await LiveblocksError.from(res);
1499
1533
  }
1500
1534
  const plainSettings = await res.json();
1501
- const settings = createUserNotificationSettings(plainSettings);
1535
+ const settings = createNotificationSettings(plainSettings);
1502
1536
  return settings;
1503
1537
  }
1504
1538
  /**