@liveblocks/core 3.12.1 → 3.13.0-metadata1
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 +37 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -62
- package/dist/index.d.ts +104 -62
- package/dist/index.js +37 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "3.
|
|
9
|
+
var PKG_VERSION = "3.13.0-metadata1";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -1606,6 +1606,7 @@ function createApiClient({
|
|
|
1606
1606
|
comment: {
|
|
1607
1607
|
id: commentId,
|
|
1608
1608
|
body: options.body,
|
|
1609
|
+
metadata: options.commentMetadata,
|
|
1609
1610
|
attachmentIds: options.attachmentIds
|
|
1610
1611
|
},
|
|
1611
1612
|
metadata: options.metadata
|
|
@@ -1659,6 +1660,16 @@ function createApiClient({
|
|
|
1659
1660
|
options.metadata
|
|
1660
1661
|
);
|
|
1661
1662
|
}
|
|
1663
|
+
async function editCommentMetadata(options) {
|
|
1664
|
+
return await httpClient.post(
|
|
1665
|
+
url`/v2/c/rooms/${options.roomId}/threads/${options.threadId}/comments/${options.commentId}/metadata`,
|
|
1666
|
+
await authManager.getAuthValue({
|
|
1667
|
+
requestedScope: "comments:read",
|
|
1668
|
+
roomId: options.roomId
|
|
1669
|
+
}),
|
|
1670
|
+
options.metadata
|
|
1671
|
+
);
|
|
1672
|
+
}
|
|
1662
1673
|
async function createComment(options) {
|
|
1663
1674
|
const commentId = _nullishCoalesce(options.commentId, () => ( createCommentId()));
|
|
1664
1675
|
const comment = await httpClient.post(
|
|
@@ -1670,6 +1681,7 @@ function createApiClient({
|
|
|
1670
1681
|
{
|
|
1671
1682
|
id: commentId,
|
|
1672
1683
|
body: options.body,
|
|
1684
|
+
metadata: options.metadata,
|
|
1673
1685
|
attachmentIds: options.attachmentIds
|
|
1674
1686
|
}
|
|
1675
1687
|
);
|
|
@@ -1684,7 +1696,8 @@ function createApiClient({
|
|
|
1684
1696
|
}),
|
|
1685
1697
|
{
|
|
1686
1698
|
body: options.body,
|
|
1687
|
-
attachmentIds: options.attachmentIds
|
|
1699
|
+
attachmentIds: options.attachmentIds,
|
|
1700
|
+
metadata: options.metadata
|
|
1688
1701
|
}
|
|
1689
1702
|
);
|
|
1690
1703
|
return convertToCommentData(comment);
|
|
@@ -2426,6 +2439,7 @@ function createApiClient({
|
|
|
2426
2439
|
editThreadMetadata,
|
|
2427
2440
|
createComment,
|
|
2428
2441
|
editComment,
|
|
2442
|
+
editCommentMetadata,
|
|
2429
2443
|
deleteComment,
|
|
2430
2444
|
addReaction,
|
|
2431
2445
|
removeReaction,
|
|
@@ -3104,6 +3118,7 @@ var ServerMsgCode = Object.freeze({
|
|
|
3104
3118
|
COMMENT_DELETED: 404,
|
|
3105
3119
|
COMMENT_REACTION_ADDED: 405,
|
|
3106
3120
|
COMMENT_REACTION_REMOVED: 406,
|
|
3121
|
+
COMMENT_METADATA_UPDATED: 409,
|
|
3107
3122
|
// Error codes
|
|
3108
3123
|
REJECT_STORAGE_OP: 299
|
|
3109
3124
|
// Sent if a mutation was not allowed on the server (i.e. due to permissions, limit exceeded, etc)
|
|
@@ -8663,6 +8678,8 @@ function defaultMessageFromContext(context) {
|
|
|
8663
8678
|
return "Could not delete thread";
|
|
8664
8679
|
case "EDIT_THREAD_METADATA_ERROR":
|
|
8665
8680
|
return "Could not edit thread metadata";
|
|
8681
|
+
case "EDIT_COMMENT_METADATA_ERROR":
|
|
8682
|
+
return "Could not edit comment metadata";
|
|
8666
8683
|
case "MARK_THREAD_AS_RESOLVED_ERROR":
|
|
8667
8684
|
return "Could not mark thread as resolved";
|
|
8668
8685
|
case "MARK_THREAD_AS_UNRESOLVED_ERROR":
|
|
@@ -9507,7 +9524,8 @@ function createRoom(options, config) {
|
|
|
9507
9524
|
case ServerMsgCode.COMMENT_REACTION_REMOVED:
|
|
9508
9525
|
case ServerMsgCode.COMMENT_CREATED:
|
|
9509
9526
|
case ServerMsgCode.COMMENT_EDITED:
|
|
9510
|
-
case ServerMsgCode.COMMENT_DELETED:
|
|
9527
|
+
case ServerMsgCode.COMMENT_DELETED:
|
|
9528
|
+
case ServerMsgCode.COMMENT_METADATA_UPDATED: {
|
|
9511
9529
|
eventHub.comments.notify(message);
|
|
9512
9530
|
break;
|
|
9513
9531
|
}
|
|
@@ -9851,6 +9869,7 @@ function createRoom(options, config) {
|
|
|
9851
9869
|
commentId: options2.commentId,
|
|
9852
9870
|
metadata: options2.metadata,
|
|
9853
9871
|
body: options2.body,
|
|
9872
|
+
commentMetadata: options2.commentMetadata,
|
|
9854
9873
|
attachmentIds: options2.attachmentIds
|
|
9855
9874
|
});
|
|
9856
9875
|
}
|
|
@@ -9863,6 +9882,18 @@ function createRoom(options, config) {
|
|
|
9863
9882
|
}) {
|
|
9864
9883
|
return httpClient.editThreadMetadata({ roomId, threadId, metadata });
|
|
9865
9884
|
}
|
|
9885
|
+
async function editCommentMetadata({
|
|
9886
|
+
threadId,
|
|
9887
|
+
commentId,
|
|
9888
|
+
metadata
|
|
9889
|
+
}) {
|
|
9890
|
+
return httpClient.editCommentMetadata({
|
|
9891
|
+
roomId,
|
|
9892
|
+
threadId,
|
|
9893
|
+
commentId,
|
|
9894
|
+
metadata
|
|
9895
|
+
});
|
|
9896
|
+
}
|
|
9866
9897
|
async function markThreadAsResolved(threadId) {
|
|
9867
9898
|
return httpClient.markThreadAsResolved({ roomId, threadId });
|
|
9868
9899
|
}
|
|
@@ -9884,6 +9915,7 @@ function createRoom(options, config) {
|
|
|
9884
9915
|
threadId: options2.threadId,
|
|
9885
9916
|
commentId: options2.commentId,
|
|
9886
9917
|
body: options2.body,
|
|
9918
|
+
metadata: options2.metadata,
|
|
9887
9919
|
attachmentIds: options2.attachmentIds
|
|
9888
9920
|
});
|
|
9889
9921
|
}
|
|
@@ -9893,6 +9925,7 @@ function createRoom(options, config) {
|
|
|
9893
9925
|
threadId: options2.threadId,
|
|
9894
9926
|
commentId: options2.commentId,
|
|
9895
9927
|
body: options2.body,
|
|
9928
|
+
metadata: options2.metadata,
|
|
9896
9929
|
attachmentIds: options2.attachmentIds
|
|
9897
9930
|
});
|
|
9898
9931
|
}
|
|
@@ -10080,6 +10113,7 @@ function createRoom(options, config) {
|
|
|
10080
10113
|
unsubscribeFromThread,
|
|
10081
10114
|
createComment,
|
|
10082
10115
|
editComment,
|
|
10116
|
+
editCommentMetadata,
|
|
10083
10117
|
deleteComment,
|
|
10084
10118
|
addReaction,
|
|
10085
10119
|
removeReaction,
|