@liveblocks/node 3.13.0-metadata2 → 3.13.0-rc1

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, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, 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
 
@@ -94,29 +94,16 @@ type Identity = {
94
94
  type ThreadParticipants = {
95
95
  participantIds: string[];
96
96
  };
97
- type CreateThreadOptions<TM extends BaseMetadata, CM extends BaseMetadata> = {
97
+ type CreateThreadOptions<M extends BaseMetadata> = {
98
98
  roomId: string;
99
99
  data: {
100
100
  comment: {
101
101
  userId: string;
102
102
  createdAt?: Date;
103
103
  body: CommentBody;
104
- } & PartialUnless<CM, {
105
- metadata: CM;
106
- }>;
107
- } & PartialUnless<TM, {
108
- metadata: TM;
109
- }>;
110
- };
111
- type CreateCommentOptions<CM extends BaseMetadata> = {
112
- roomId: string;
113
- threadId: string;
114
- data: {
115
- userId: string;
116
- createdAt?: Date;
117
- body: CommentBody;
118
- } & PartialUnless<CM, {
119
- metadata: CM;
104
+ };
105
+ } & PartialUnless<M, {
106
+ metadata: M;
120
107
  }>;
121
108
  };
122
109
  type RoomPermission = [] | ["room:write"] | ["room:read", "room:presence:write"] | ["room:read", "room:presence:write", "comments:write"];
@@ -222,8 +209,7 @@ type MassMutateStorageOptions = MutateStorageOptions & {
222
209
  concurrency?: number;
223
210
  };
224
211
  type E = DE;
225
- type TM = DTM;
226
- type CM = DCM;
212
+ type M = DM;
227
213
  type S = DS;
228
214
  type U = DU;
229
215
  type RoomsQueryCriteria = {
@@ -741,11 +727,11 @@ declare class Liveblocks {
741
727
  * ```
742
728
  */
743
729
  query?: string | {
744
- metadata?: Partial<QueryMetadata<TM>>;
730
+ metadata?: Partial<QueryMetadata<M>>;
745
731
  resolved?: boolean;
746
732
  };
747
733
  }, options?: RequestOptions): Promise<{
748
- data: ThreadData<TM, CM>[];
734
+ data: ThreadData<M>[];
749
735
  }>;
750
736
  /**
751
737
  * Gets a thread.
@@ -758,7 +744,7 @@ declare class Liveblocks {
758
744
  getThread(params: {
759
745
  roomId: string;
760
746
  threadId: string;
761
- }, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
747
+ }, options?: RequestOptions): Promise<ThreadData<M>>;
762
748
  /**
763
749
  * @deprecated Prefer using `getMentionsFromCommentBody` to extract mentions
764
750
  * from comments and threads, or `Liveblocks.getThreadSubscriptions` to get
@@ -805,7 +791,7 @@ declare class Liveblocks {
805
791
  roomId: string;
806
792
  threadId: string;
807
793
  commentId: string;
808
- }, options?: RequestOptions): Promise<CommentData<CM>>;
794
+ }, options?: RequestOptions): Promise<CommentData>;
809
795
  /**
810
796
  * Creates a comment.
811
797
  *
@@ -814,18 +800,24 @@ declare class Liveblocks {
814
800
  * @param params.data.userId The user ID of the user who is set to create the comment.
815
801
  * @param params.data.createdAt (optional) The date the comment is set to be created.
816
802
  * @param params.data.body The body of the comment.
817
- * @param params.data.metadata (optional) The metadata for the comment.
818
803
  * @param options.signal (optional) An abort signal to cancel the request.
819
804
  * @returns The created comment.
820
805
  */
821
- createComment(params: CreateCommentOptions<CM>, options?: RequestOptions): Promise<CommentData<CM>>;
806
+ createComment(params: {
807
+ roomId: string;
808
+ threadId: string;
809
+ data: {
810
+ userId: string;
811
+ createdAt?: Date;
812
+ body: CommentBody;
813
+ };
814
+ }, options?: RequestOptions): Promise<CommentData>;
822
815
  /**
823
816
  * Edits a comment.
824
817
  * @param params.roomId The room ID to edit the comment in.
825
818
  * @param params.threadId The thread ID to edit the comment in.
826
819
  * @param params.commentId The comment ID to edit.
827
820
  * @param params.data.body The body of the comment.
828
- * @param params.data.metadata (optional) The metadata for the comment. Value must be a string, boolean or number. Use null to delete a key.
829
821
  * @param params.data.editedAt (optional) The date the comment was edited.
830
822
  * @param options.signal (optional) An abort signal to cancel the request.
831
823
  * @returns The edited comment.
@@ -836,10 +828,9 @@ declare class Liveblocks {
836
828
  commentId: string;
837
829
  data: {
838
830
  body: CommentBody;
839
- metadata?: Patchable<CM>;
840
831
  editedAt?: Date;
841
832
  };
842
- }, options?: RequestOptions): Promise<CommentData<CM>>;
833
+ }, options?: RequestOptions): Promise<CommentData>;
843
834
  /**
844
835
  * Deletes a comment. Deletes a comment. If there are no remaining comments in the thread, the thread is also deleted.
845
836
  * @param params.roomId The room ID to delete the comment in.
@@ -860,11 +851,10 @@ declare class Liveblocks {
860
851
  * @param params.thread.comment.userId The user ID of the user who created the comment.
861
852
  * @param params.thread.comment.createdAt (optional) The date the comment was created.
862
853
  * @param params.thread.comment.body The body of the comment.
863
- * @param params.thread.comment.metadata (optional) The metadata for the comment.
864
854
  * @param options.signal (optional) An abort signal to cancel the request.
865
855
  * @returns The created thread. The thread will be created with the specified comment as its first comment.
866
856
  */
867
- createThread(params: CreateThreadOptions<TM, CM>, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
857
+ createThread(params: CreateThreadOptions<M>, options?: RequestOptions): Promise<ThreadData<M>>;
868
858
  /**
869
859
  * Deletes a thread and all of its comments.
870
860
  * @param params.roomId The room ID to delete the thread in.
@@ -889,7 +879,7 @@ declare class Liveblocks {
889
879
  data: {
890
880
  userId: string;
891
881
  };
892
- }, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
882
+ }, options?: RequestOptions): Promise<ThreadData<M>>;
893
883
  /**
894
884
  * Mark a thread as unresolved.
895
885
  * @param params.roomId The room ID of the thread.
@@ -904,7 +894,7 @@ declare class Liveblocks {
904
894
  data: {
905
895
  userId: string;
906
896
  };
907
- }, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
897
+ }, options?: RequestOptions): Promise<ThreadData<M>>;
908
898
  /**
909
899
  * Subscribes a user to a thread.
910
900
  * @param params.roomId The room ID of the thread.
@@ -948,32 +938,11 @@ declare class Liveblocks {
948
938
  roomId: string;
949
939
  threadId: string;
950
940
  data: {
951
- metadata: Patchable<TM>;
952
- userId: string;
953
- updatedAt?: Date;
954
- };
955
- }, options?: RequestOptions): Promise<TM>;
956
- /**
957
- * Updates the metadata of the specified comment in a room.
958
- * @param params.roomId The room ID to update the comment in.
959
- * @param params.threadId The thread ID to update the comment in.
960
- * @param params.commentId The comment ID to update.
961
- * @param params.data.metadata The metadata for the comment. Value must be a string, boolean or number. Use null to delete a key.
962
- * @param params.data.userId The user ID of the user who updated the comment.
963
- * @param params.data.updatedAt (optional) The date the comment metadata is set to be updated.
964
- * @param options.signal (optional) An abort signal to cancel the request.
965
- * @returns The updated comment metadata.
966
- */
967
- editCommentMetadata(params: {
968
- roomId: string;
969
- threadId: string;
970
- commentId: string;
971
- data: {
972
- metadata: Patchable<CM>;
941
+ metadata: Patchable<M>;
973
942
  userId: string;
974
943
  updatedAt?: Date;
975
944
  };
976
- }, options?: RequestOptions): Promise<CM>;
945
+ }, options?: RequestOptions): Promise<M>;
977
946
  /**
978
947
  * Adds a new comment reaction to a comment.
979
948
  * @param params.roomId The room ID to add the comment reaction in.
@@ -1422,7 +1391,7 @@ type WebhookRequest = {
1422
1391
  * as member of the augmentation
1423
1392
  */
1424
1393
  type CustomKind = `$${string}`;
1425
- type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | CommentMetadataUpdatedEvent | ThreadMetadataUpdatedEvent | NotificationEvent | ThreadCreatedEvent | ThreadDeletedEvent | ThreadMarkedAsResolvedEvent | ThreadMarkedAsUnresolvedEvent | YDocUpdatedEvent;
1394
+ type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | ThreadMetadataUpdatedEvent | NotificationEvent | ThreadCreatedEvent | ThreadDeletedEvent | ThreadMarkedAsResolvedEvent | ThreadMarkedAsUnresolvedEvent | YDocUpdatedEvent;
1426
1395
  type StorageUpdatedEvent = {
1427
1396
  type: "storageUpdated";
1428
1397
  data: {
@@ -1594,25 +1563,6 @@ type ThreadMetadataUpdatedEvent = {
1594
1563
  updatedBy: string;
1595
1564
  };
1596
1565
  };
1597
- type CommentMetadataUpdatedEvent = {
1598
- type: "commentMetadataUpdated";
1599
- data: {
1600
- projectId: string;
1601
- roomId: string;
1602
- threadId: string;
1603
- commentId: string;
1604
- /**
1605
- * ISO 8601 datestring
1606
- * @example "2021-03-01T12:00:00.000Z"
1607
- */
1608
- updatedAt: string;
1609
- /**
1610
- * ISO 8601 datestring
1611
- * @example "2021-03-01T12:00:00.000Z"
1612
- */
1613
- updatedBy: string;
1614
- };
1615
- };
1616
1566
  type ThreadCreatedEvent = {
1617
1567
  type: "threadCreated";
1618
1568
  data: {
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, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, 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
 
@@ -94,29 +94,16 @@ type Identity = {
94
94
  type ThreadParticipants = {
95
95
  participantIds: string[];
96
96
  };
97
- type CreateThreadOptions<TM extends BaseMetadata, CM extends BaseMetadata> = {
97
+ type CreateThreadOptions<M extends BaseMetadata> = {
98
98
  roomId: string;
99
99
  data: {
100
100
  comment: {
101
101
  userId: string;
102
102
  createdAt?: Date;
103
103
  body: CommentBody;
104
- } & PartialUnless<CM, {
105
- metadata: CM;
106
- }>;
107
- } & PartialUnless<TM, {
108
- metadata: TM;
109
- }>;
110
- };
111
- type CreateCommentOptions<CM extends BaseMetadata> = {
112
- roomId: string;
113
- threadId: string;
114
- data: {
115
- userId: string;
116
- createdAt?: Date;
117
- body: CommentBody;
118
- } & PartialUnless<CM, {
119
- metadata: CM;
104
+ };
105
+ } & PartialUnless<M, {
106
+ metadata: M;
120
107
  }>;
121
108
  };
122
109
  type RoomPermission = [] | ["room:write"] | ["room:read", "room:presence:write"] | ["room:read", "room:presence:write", "comments:write"];
@@ -222,8 +209,7 @@ type MassMutateStorageOptions = MutateStorageOptions & {
222
209
  concurrency?: number;
223
210
  };
224
211
  type E = DE;
225
- type TM = DTM;
226
- type CM = DCM;
212
+ type M = DM;
227
213
  type S = DS;
228
214
  type U = DU;
229
215
  type RoomsQueryCriteria = {
@@ -741,11 +727,11 @@ declare class Liveblocks {
741
727
  * ```
742
728
  */
743
729
  query?: string | {
744
- metadata?: Partial<QueryMetadata<TM>>;
730
+ metadata?: Partial<QueryMetadata<M>>;
745
731
  resolved?: boolean;
746
732
  };
747
733
  }, options?: RequestOptions): Promise<{
748
- data: ThreadData<TM, CM>[];
734
+ data: ThreadData<M>[];
749
735
  }>;
750
736
  /**
751
737
  * Gets a thread.
@@ -758,7 +744,7 @@ declare class Liveblocks {
758
744
  getThread(params: {
759
745
  roomId: string;
760
746
  threadId: string;
761
- }, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
747
+ }, options?: RequestOptions): Promise<ThreadData<M>>;
762
748
  /**
763
749
  * @deprecated Prefer using `getMentionsFromCommentBody` to extract mentions
764
750
  * from comments and threads, or `Liveblocks.getThreadSubscriptions` to get
@@ -805,7 +791,7 @@ declare class Liveblocks {
805
791
  roomId: string;
806
792
  threadId: string;
807
793
  commentId: string;
808
- }, options?: RequestOptions): Promise<CommentData<CM>>;
794
+ }, options?: RequestOptions): Promise<CommentData>;
809
795
  /**
810
796
  * Creates a comment.
811
797
  *
@@ -814,18 +800,24 @@ declare class Liveblocks {
814
800
  * @param params.data.userId The user ID of the user who is set to create the comment.
815
801
  * @param params.data.createdAt (optional) The date the comment is set to be created.
816
802
  * @param params.data.body The body of the comment.
817
- * @param params.data.metadata (optional) The metadata for the comment.
818
803
  * @param options.signal (optional) An abort signal to cancel the request.
819
804
  * @returns The created comment.
820
805
  */
821
- createComment(params: CreateCommentOptions<CM>, options?: RequestOptions): Promise<CommentData<CM>>;
806
+ createComment(params: {
807
+ roomId: string;
808
+ threadId: string;
809
+ data: {
810
+ userId: string;
811
+ createdAt?: Date;
812
+ body: CommentBody;
813
+ };
814
+ }, options?: RequestOptions): Promise<CommentData>;
822
815
  /**
823
816
  * Edits a comment.
824
817
  * @param params.roomId The room ID to edit the comment in.
825
818
  * @param params.threadId The thread ID to edit the comment in.
826
819
  * @param params.commentId The comment ID to edit.
827
820
  * @param params.data.body The body of the comment.
828
- * @param params.data.metadata (optional) The metadata for the comment. Value must be a string, boolean or number. Use null to delete a key.
829
821
  * @param params.data.editedAt (optional) The date the comment was edited.
830
822
  * @param options.signal (optional) An abort signal to cancel the request.
831
823
  * @returns The edited comment.
@@ -836,10 +828,9 @@ declare class Liveblocks {
836
828
  commentId: string;
837
829
  data: {
838
830
  body: CommentBody;
839
- metadata?: Patchable<CM>;
840
831
  editedAt?: Date;
841
832
  };
842
- }, options?: RequestOptions): Promise<CommentData<CM>>;
833
+ }, options?: RequestOptions): Promise<CommentData>;
843
834
  /**
844
835
  * Deletes a comment. Deletes a comment. If there are no remaining comments in the thread, the thread is also deleted.
845
836
  * @param params.roomId The room ID to delete the comment in.
@@ -860,11 +851,10 @@ declare class Liveblocks {
860
851
  * @param params.thread.comment.userId The user ID of the user who created the comment.
861
852
  * @param params.thread.comment.createdAt (optional) The date the comment was created.
862
853
  * @param params.thread.comment.body The body of the comment.
863
- * @param params.thread.comment.metadata (optional) The metadata for the comment.
864
854
  * @param options.signal (optional) An abort signal to cancel the request.
865
855
  * @returns The created thread. The thread will be created with the specified comment as its first comment.
866
856
  */
867
- createThread(params: CreateThreadOptions<TM, CM>, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
857
+ createThread(params: CreateThreadOptions<M>, options?: RequestOptions): Promise<ThreadData<M>>;
868
858
  /**
869
859
  * Deletes a thread and all of its comments.
870
860
  * @param params.roomId The room ID to delete the thread in.
@@ -889,7 +879,7 @@ declare class Liveblocks {
889
879
  data: {
890
880
  userId: string;
891
881
  };
892
- }, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
882
+ }, options?: RequestOptions): Promise<ThreadData<M>>;
893
883
  /**
894
884
  * Mark a thread as unresolved.
895
885
  * @param params.roomId The room ID of the thread.
@@ -904,7 +894,7 @@ declare class Liveblocks {
904
894
  data: {
905
895
  userId: string;
906
896
  };
907
- }, options?: RequestOptions): Promise<ThreadData<TM, CM>>;
897
+ }, options?: RequestOptions): Promise<ThreadData<M>>;
908
898
  /**
909
899
  * Subscribes a user to a thread.
910
900
  * @param params.roomId The room ID of the thread.
@@ -948,32 +938,11 @@ declare class Liveblocks {
948
938
  roomId: string;
949
939
  threadId: string;
950
940
  data: {
951
- metadata: Patchable<TM>;
952
- userId: string;
953
- updatedAt?: Date;
954
- };
955
- }, options?: RequestOptions): Promise<TM>;
956
- /**
957
- * Updates the metadata of the specified comment in a room.
958
- * @param params.roomId The room ID to update the comment in.
959
- * @param params.threadId The thread ID to update the comment in.
960
- * @param params.commentId The comment ID to update.
961
- * @param params.data.metadata The metadata for the comment. Value must be a string, boolean or number. Use null to delete a key.
962
- * @param params.data.userId The user ID of the user who updated the comment.
963
- * @param params.data.updatedAt (optional) The date the comment metadata is set to be updated.
964
- * @param options.signal (optional) An abort signal to cancel the request.
965
- * @returns The updated comment metadata.
966
- */
967
- editCommentMetadata(params: {
968
- roomId: string;
969
- threadId: string;
970
- commentId: string;
971
- data: {
972
- metadata: Patchable<CM>;
941
+ metadata: Patchable<M>;
973
942
  userId: string;
974
943
  updatedAt?: Date;
975
944
  };
976
- }, options?: RequestOptions): Promise<CM>;
945
+ }, options?: RequestOptions): Promise<M>;
977
946
  /**
978
947
  * Adds a new comment reaction to a comment.
979
948
  * @param params.roomId The room ID to add the comment reaction in.
@@ -1422,7 +1391,7 @@ type WebhookRequest = {
1422
1391
  * as member of the augmentation
1423
1392
  */
1424
1393
  type CustomKind = `$${string}`;
1425
- type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | CommentMetadataUpdatedEvent | ThreadMetadataUpdatedEvent | NotificationEvent | ThreadCreatedEvent | ThreadDeletedEvent | ThreadMarkedAsResolvedEvent | ThreadMarkedAsUnresolvedEvent | YDocUpdatedEvent;
1394
+ type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | ThreadMetadataUpdatedEvent | NotificationEvent | ThreadCreatedEvent | ThreadDeletedEvent | ThreadMarkedAsResolvedEvent | ThreadMarkedAsUnresolvedEvent | YDocUpdatedEvent;
1426
1395
  type StorageUpdatedEvent = {
1427
1396
  type: "storageUpdated";
1428
1397
  data: {
@@ -1594,25 +1563,6 @@ type ThreadMetadataUpdatedEvent = {
1594
1563
  updatedBy: string;
1595
1564
  };
1596
1565
  };
1597
- type CommentMetadataUpdatedEvent = {
1598
- type: "commentMetadataUpdated";
1599
- data: {
1600
- projectId: string;
1601
- roomId: string;
1602
- threadId: string;
1603
- commentId: string;
1604
- /**
1605
- * ISO 8601 datestring
1606
- * @example "2021-03-01T12:00:00.000Z"
1607
- */
1608
- updatedAt: string;
1609
- /**
1610
- * ISO 8601 datestring
1611
- * @example "2021-03-01T12:00:00.000Z"
1612
- */
1613
- updatedBy: string;
1614
- };
1615
- };
1616
1566
  type ThreadCreatedEvent = {
1617
1567
  type: "threadCreated";
1618
1568
  data: {
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 = "3.13.0-metadata2";
6
+ var PKG_VERSION = "3.13.0-rc1";
7
7
  var PKG_FORMAT = "esm";
8
8
 
9
9
  // src/client.ts
@@ -990,7 +990,6 @@ var Liveblocks = class {
990
990
  * @param params.data.userId The user ID of the user who is set to create the comment.
991
991
  * @param params.data.createdAt (optional) The date the comment is set to be created.
992
992
  * @param params.data.body The body of the comment.
993
- * @param params.data.metadata (optional) The metadata for the comment.
994
993
  * @param options.signal (optional) An abort signal to cancel the request.
995
994
  * @returns The created comment.
996
995
  */
@@ -1015,7 +1014,6 @@ var Liveblocks = class {
1015
1014
  * @param params.threadId The thread ID to edit the comment in.
1016
1015
  * @param params.commentId The comment ID to edit.
1017
1016
  * @param params.data.body The body of the comment.
1018
- * @param params.data.metadata (optional) The metadata for the comment. Value must be a string, boolean or number. Use null to delete a key.
1019
1017
  * @param params.data.editedAt (optional) The date the comment was edited.
1020
1018
  * @param options.signal (optional) An abort signal to cancel the request.
1021
1019
  * @returns The edited comment.
@@ -1024,11 +1022,7 @@ var Liveblocks = class {
1024
1022
  const { roomId, threadId, commentId, data } = params;
1025
1023
  const res = await this.#post(
1026
1024
  url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}`,
1027
- {
1028
- body: data.body,
1029
- editedAt: data.editedAt?.toISOString(),
1030
- metadata: data.metadata
1031
- },
1025
+ { ...data, editedAt: data.editedAt?.toISOString() },
1032
1026
  options
1033
1027
  );
1034
1028
  if (!res.ok) {
@@ -1062,7 +1056,6 @@ var Liveblocks = class {
1062
1056
  * @param params.thread.comment.userId The user ID of the user who created the comment.
1063
1057
  * @param params.thread.comment.createdAt (optional) The date the comment was created.
1064
1058
  * @param params.thread.comment.body The body of the comment.
1065
- * @param params.thread.comment.metadata (optional) The metadata for the comment.
1066
1059
  * @param options.signal (optional) An abort signal to cancel the request.
1067
1060
  * @returns The created thread. The thread will be created with the specified comment as its first comment.
1068
1061
  */
@@ -1206,32 +1199,6 @@ var Liveblocks = class {
1206
1199
  }
1207
1200
  return await res.json();
1208
1201
  }
1209
- /**
1210
- * Updates the metadata of the specified comment in a room.
1211
- * @param params.roomId The room ID to update the comment in.
1212
- * @param params.threadId The thread ID to update the comment in.
1213
- * @param params.commentId The comment ID to update.
1214
- * @param params.data.metadata The metadata for the comment. Value must be a string, boolean or number. Use null to delete a key.
1215
- * @param params.data.userId The user ID of the user who updated the comment.
1216
- * @param params.data.updatedAt (optional) The date the comment metadata is set to be updated.
1217
- * @param options.signal (optional) An abort signal to cancel the request.
1218
- * @returns The updated comment metadata.
1219
- */
1220
- async editCommentMetadata(params, options) {
1221
- const { roomId, threadId, commentId, data } = params;
1222
- const res = await this.#post(
1223
- url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}/metadata`,
1224
- {
1225
- ...data,
1226
- updatedAt: data.updatedAt?.toISOString()
1227
- },
1228
- options
1229
- );
1230
- if (!res.ok) {
1231
- throw await LiveblocksError.from(res);
1232
- }
1233
- return await res.json();
1234
- }
1235
1202
  /**
1236
1203
  * Adds a new comment reaction to a comment.
1237
1204
  * @param params.roomId The room ID to add the comment reaction in.
@@ -2232,7 +2199,6 @@ var WebhookHandler = class _WebhookHandler {
2232
2199
  "commentDeleted",
2233
2200
  "commentReactionAdded",
2234
2201
  "commentReactionRemoved",
2235
- "commentMetadataUpdated",
2236
2202
  "threadMetadataUpdated",
2237
2203
  "threadCreated",
2238
2204
  "threadDeleted",