@liveblocks/node 2.25.0-aiprivatebeta8 → 3.0.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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, SubscriptionData, Patchable, CommentUserReaction, InboxNotificationData, RoomSubscriptionSettings, UserRoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
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';
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';
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
 
5
5
  declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read"];
@@ -211,18 +211,10 @@ type PaginationOptions = {
211
211
  startingAfter?: string;
212
212
  };
213
213
  type Page<T> = {
214
- /** @deprecated Prefer to rely on `nextCursor` instead. */
215
- nextPage?: string | null;
216
214
  nextCursor: string | null;
217
215
  data: T[];
218
216
  };
219
- type GetRoomsOptions = RoomsQueryCriteria & PaginationOptions & {
220
- /**
221
- * @deprecated Use `query` property instead. Support for the `metadata`
222
- * field will be removed in a future version.
223
- */
224
- metadata?: QueryRoomMetadata;
225
- };
217
+ type GetRoomsOptions = RoomsQueryCriteria & PaginationOptions;
226
218
  type GetInboxNotificationsOptions = InboxNotificationsQueryCriteria & PaginationOptions;
227
219
  type CreateRoomOptions = {
228
220
  defaultAccesses: RoomPermission;
@@ -863,18 +855,6 @@ declare class Liveblocks {
863
855
  iterInboxNotifications(criteria: InboxNotificationsQueryCriteria, options?: RequestOptions & {
864
856
  pageSize?: number;
865
857
  }): AsyncGenerator<InboxNotificationData>;
866
- /**
867
- * @deprecated Renamed to `getRoomSubscriptionSettings`
868
- *
869
- * Gets the user's room subscription settings.
870
- * @param params.userId The user ID to get the room subscription settings from.
871
- * @param params.roomId The room ID to get the room subscription settings from.
872
- * @param options.signal (optional) An abort signal to cancel the request.
873
- */
874
- getRoomNotificationSettings(params: {
875
- userId: string;
876
- roomId: string;
877
- }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
878
858
  /**
879
859
  * Returns all room subscription settings for a user.
880
860
  * @param params.userId The user ID to get the room subscription settings from.
@@ -895,20 +875,6 @@ declare class Liveblocks {
895
875
  userId: string;
896
876
  roomId: string;
897
877
  }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
898
- /**
899
- * @deprecated Renamed to `updateRoomSubscriptionSettings`
900
- *
901
- * Updates the user's room subscription settings.
902
- * @param params.userId The user ID to update the room subscription settings for.
903
- * @param params.roomId The room ID to update the room subscription settings for.
904
- * @param params.data The new room subscription settings for the user.
905
- * @param options.signal (optional) An abort signal to cancel the request.
906
- */
907
- updateRoomNotificationSettings(params: {
908
- userId: string;
909
- roomId: string;
910
- data: Partial<RoomSubscriptionSettings>;
911
- }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
912
878
  /**
913
879
  * Updates the user's room subscription settings.
914
880
  * @param params.userId The user ID to update the room subscription settings for.
@@ -921,18 +887,6 @@ declare class Liveblocks {
921
887
  roomId: string;
922
888
  data: Partial<RoomSubscriptionSettings>;
923
889
  }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
924
- /**
925
- * @deprecated Renamed to `deleteRoomSubscriptionSettings`
926
- *
927
- * Delete the user's room subscription settings.
928
- * @param params.userId The user ID to delete the room subscription settings from.
929
- * @param params.roomId The room ID to delete the room subscription settings from.
930
- * @param options.signal (optional) An abort signal to cancel the request.
931
- */
932
- deleteRoomNotificationSettings(params: {
933
- userId: string;
934
- roomId: string;
935
- }, options?: RequestOptions): Promise<void>;
936
890
  /**
937
891
  * Delete the user's room subscription settings.
938
892
  * @param params.userId The user ID to delete the room subscription settings from.
@@ -1418,11 +1372,4 @@ declare function isTextMentionNotificationEvent(event: WebhookEvent): event is T
1418
1372
  */
1419
1373
  declare function isCustomNotificationEvent(event: WebhookEvent): event is CustomNotificationEvent;
1420
1374
 
1421
- /**
1422
- * @deprecated RoomInfo was renamed to RoomData, to avoid
1423
- * confusion with the globally augmentable RoomInfo type. This
1424
- * alias will be removed in a future version.
1425
- */
1426
- type RoomInfo = RoomData;
1427
-
1428
- export { type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateRoomOptions, type CustomNotificationEvent, type GetInboxNotificationsOptions, type GetRoomsOptions, type InboxNotificationsQueryCriteria, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomInfo, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type Schema, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
1375
+ export { type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateRoomOptions, type CustomNotificationEvent, type GetInboxNotificationsOptions, type GetRoomsOptions, type InboxNotificationsQueryCriteria, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type Schema, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { BaseUserMeta, DU, LiveObject, Awaitable, DS, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, SubscriptionData, Patchable, CommentUserReaction, InboxNotificationData, RoomSubscriptionSettings, UserRoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, NotificationChannel } from '@liveblocks/core';
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';
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';
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
 
5
5
  declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read"];
@@ -211,18 +211,10 @@ type PaginationOptions = {
211
211
  startingAfter?: string;
212
212
  };
213
213
  type Page<T> = {
214
- /** @deprecated Prefer to rely on `nextCursor` instead. */
215
- nextPage?: string | null;
216
214
  nextCursor: string | null;
217
215
  data: T[];
218
216
  };
219
- type GetRoomsOptions = RoomsQueryCriteria & PaginationOptions & {
220
- /**
221
- * @deprecated Use `query` property instead. Support for the `metadata`
222
- * field will be removed in a future version.
223
- */
224
- metadata?: QueryRoomMetadata;
225
- };
217
+ type GetRoomsOptions = RoomsQueryCriteria & PaginationOptions;
226
218
  type GetInboxNotificationsOptions = InboxNotificationsQueryCriteria & PaginationOptions;
227
219
  type CreateRoomOptions = {
228
220
  defaultAccesses: RoomPermission;
@@ -863,18 +855,6 @@ declare class Liveblocks {
863
855
  iterInboxNotifications(criteria: InboxNotificationsQueryCriteria, options?: RequestOptions & {
864
856
  pageSize?: number;
865
857
  }): AsyncGenerator<InboxNotificationData>;
866
- /**
867
- * @deprecated Renamed to `getRoomSubscriptionSettings`
868
- *
869
- * Gets the user's room subscription settings.
870
- * @param params.userId The user ID to get the room subscription settings from.
871
- * @param params.roomId The room ID to get the room subscription settings from.
872
- * @param options.signal (optional) An abort signal to cancel the request.
873
- */
874
- getRoomNotificationSettings(params: {
875
- userId: string;
876
- roomId: string;
877
- }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
878
858
  /**
879
859
  * Returns all room subscription settings for a user.
880
860
  * @param params.userId The user ID to get the room subscription settings from.
@@ -895,20 +875,6 @@ declare class Liveblocks {
895
875
  userId: string;
896
876
  roomId: string;
897
877
  }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
898
- /**
899
- * @deprecated Renamed to `updateRoomSubscriptionSettings`
900
- *
901
- * Updates the user's room subscription settings.
902
- * @param params.userId The user ID to update the room subscription settings for.
903
- * @param params.roomId The room ID to update the room subscription settings for.
904
- * @param params.data The new room subscription settings for the user.
905
- * @param options.signal (optional) An abort signal to cancel the request.
906
- */
907
- updateRoomNotificationSettings(params: {
908
- userId: string;
909
- roomId: string;
910
- data: Partial<RoomSubscriptionSettings>;
911
- }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
912
878
  /**
913
879
  * Updates the user's room subscription settings.
914
880
  * @param params.userId The user ID to update the room subscription settings for.
@@ -921,18 +887,6 @@ declare class Liveblocks {
921
887
  roomId: string;
922
888
  data: Partial<RoomSubscriptionSettings>;
923
889
  }, options?: RequestOptions): Promise<RoomSubscriptionSettings>;
924
- /**
925
- * @deprecated Renamed to `deleteRoomSubscriptionSettings`
926
- *
927
- * Delete the user's room subscription settings.
928
- * @param params.userId The user ID to delete the room subscription settings from.
929
- * @param params.roomId The room ID to delete the room subscription settings from.
930
- * @param options.signal (optional) An abort signal to cancel the request.
931
- */
932
- deleteRoomNotificationSettings(params: {
933
- userId: string;
934
- roomId: string;
935
- }, options?: RequestOptions): Promise<void>;
936
890
  /**
937
891
  * Delete the user's room subscription settings.
938
892
  * @param params.userId The user ID to delete the room subscription settings from.
@@ -1418,11 +1372,4 @@ declare function isTextMentionNotificationEvent(event: WebhookEvent): event is T
1418
1372
  */
1419
1373
  declare function isCustomNotificationEvent(event: WebhookEvent): event is CustomNotificationEvent;
1420
1374
 
1421
- /**
1422
- * @deprecated RoomInfo was renamed to RoomData, to avoid
1423
- * confusion with the globally augmentable RoomInfo type. This
1424
- * alias will be removed in a future version.
1425
- */
1426
- type RoomInfo = RoomData;
1427
-
1428
- export { type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateRoomOptions, type CustomNotificationEvent, type GetInboxNotificationsOptions, type GetRoomsOptions, type InboxNotificationsQueryCriteria, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomInfo, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type Schema, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
1375
+ export { type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateRoomOptions, type CustomNotificationEvent, type GetInboxNotificationsOptions, type GetRoomsOptions, type InboxNotificationsQueryCriteria, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type Schema, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
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.25.0-aiprivatebeta8";
6
+ var PKG_VERSION = "3.0.0";
7
7
  var PKG_FORMAT = "esm";
8
8
 
9
9
  // src/client.ts
@@ -475,13 +475,6 @@ var Liveblocks = class {
475
475
  startingAfter: params.startingAfter,
476
476
  userId: params.userId,
477
477
  groupIds: params.groupIds ? params.groupIds.join(",") : void 0,
478
- // "Flatten" {metadata: {foo: "bar"}} to {"metadata.foo": "bar"}
479
- ...Object.fromEntries(
480
- Object.entries(params.metadata ?? {}).map(([key, val]) => [
481
- `metadata.${key}`,
482
- val
483
- ])
484
- ),
485
478
  query
486
479
  };
487
480
  const res = await this.#get(path, queryParams, options);
@@ -1414,17 +1407,6 @@ var Liveblocks = class {
1414
1407
  cursor = nextCursor;
1415
1408
  }
1416
1409
  }
1417
- /**
1418
- * @deprecated Renamed to `getRoomSubscriptionSettings`
1419
- *
1420
- * Gets the user's room subscription settings.
1421
- * @param params.userId The user ID to get the room subscription settings from.
1422
- * @param params.roomId The room ID to get the room subscription settings from.
1423
- * @param options.signal (optional) An abort signal to cancel the request.
1424
- */
1425
- async getRoomNotificationSettings(params, options) {
1426
- return this.getRoomSubscriptionSettings(params, options);
1427
- }
1428
1410
  /**
1429
1411
  * Returns all room subscription settings for a user.
1430
1412
  * @param params.userId The user ID to get the room subscription settings from.
@@ -1465,18 +1447,6 @@ var Liveblocks = class {
1465
1447
  }
1466
1448
  return await res.json();
1467
1449
  }
1468
- /**
1469
- * @deprecated Renamed to `updateRoomSubscriptionSettings`
1470
- *
1471
- * Updates the user's room subscription settings.
1472
- * @param params.userId The user ID to update the room subscription settings for.
1473
- * @param params.roomId The room ID to update the room subscription settings for.
1474
- * @param params.data The new room subscription settings for the user.
1475
- * @param options.signal (optional) An abort signal to cancel the request.
1476
- */
1477
- async updateRoomNotificationSettings(params, options) {
1478
- return this.updateRoomSubscriptionSettings(params, options);
1479
- }
1480
1450
  /**
1481
1451
  * Updates the user's room subscription settings.
1482
1452
  * @param params.userId The user ID to update the room subscription settings for.
@@ -1496,17 +1466,6 @@ var Liveblocks = class {
1496
1466
  }
1497
1467
  return await res.json();
1498
1468
  }
1499
- /**
1500
- * @deprecated Renamed to `deleteRoomSubscriptionSettings`
1501
- *
1502
- * Delete the user's room subscription settings.
1503
- * @param params.userId The user ID to delete the room subscription settings from.
1504
- * @param params.roomId The room ID to delete the room subscription settings from.
1505
- * @param options.signal (optional) An abort signal to cancel the request.
1506
- */
1507
- async deleteRoomNotificationSettings(params, options) {
1508
- return this.deleteRoomSubscriptionSettings(params, options);
1509
- }
1510
1469
  /**
1511
1470
  * Delete the user's room subscription settings.
1512
1471
  * @param params.userId The user ID to delete the room subscription settings from.
@@ -1938,7 +1897,7 @@ function isCustomNotificationEvent(event) {
1938
1897
 
1939
1898
  // src/index.ts
1940
1899
  import {
1941
- getMentionedIdsFromCommentBody,
1900
+ getMentionsFromCommentBody,
1942
1901
  isNotificationChannelEnabled,
1943
1902
  LiveList,
1944
1903
  LiveMap,
@@ -1953,7 +1912,7 @@ export {
1953
1912
  Liveblocks,
1954
1913
  LiveblocksError,
1955
1914
  WebhookHandler,
1956
- getMentionedIdsFromCommentBody,
1915
+ getMentionsFromCommentBody,
1957
1916
  isCustomNotificationEvent,
1958
1917
  isNotificationChannelEnabled,
1959
1918
  isTextMentionNotificationEvent,