@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.cjs +10 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -76
- package/dist/index.d.ts +26 -76
- package/dist/index.js +2 -36
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ var _core = require('@liveblocks/core');
|
|
|
3
3
|
|
|
4
4
|
// src/version.ts
|
|
5
5
|
var PKG_NAME = "@liveblocks/node";
|
|
6
|
-
var PKG_VERSION = "3.13.0-
|
|
6
|
+
var PKG_VERSION = "3.13.0-rc1";
|
|
7
7
|
var PKG_FORMAT = "cjs";
|
|
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
|
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}`,
|
|
1027
|
-
{
|
|
1028
|
-
body: data.body,
|
|
1029
|
-
editedAt: _optionalChain([data, 'access', _13 => _13.editedAt, 'optionalAccess', _14 => _14.toISOString, 'call', _15 => _15()]),
|
|
1030
|
-
metadata: data.metadata
|
|
1031
|
-
},
|
|
1025
|
+
{ ...data, editedAt: _optionalChain([data, 'access', _13 => _13.editedAt, 'optionalAccess', _14 => _14.toISOString, 'call', _15 => _15()]) },
|
|
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
|
-
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}/metadata`,
|
|
1224
|
-
{
|
|
1225
|
-
...data,
|
|
1226
|
-
updatedAt: _optionalChain([data, 'access', _23 => _23.updatedAt, 'optionalAccess', _24 => _24.toISOString, 'call', _25 => _25()])
|
|
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.
|
|
@@ -1249,7 +1216,7 @@ var Liveblocks = class {
|
|
|
1249
1216
|
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}/add-reaction`,
|
|
1250
1217
|
{
|
|
1251
1218
|
...data,
|
|
1252
|
-
createdAt: _optionalChain([data, 'access',
|
|
1219
|
+
createdAt: _optionalChain([data, 'access', _23 => _23.createdAt, 'optionalAccess', _24 => _24.toISOString, 'call', _25 => _25()])
|
|
1253
1220
|
},
|
|
1254
1221
|
options
|
|
1255
1222
|
);
|
|
@@ -1275,7 +1242,7 @@ var Liveblocks = class {
|
|
|
1275
1242
|
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${params.commentId}/remove-reaction`,
|
|
1276
1243
|
{
|
|
1277
1244
|
...data,
|
|
1278
|
-
removedAt: _optionalChain([data, 'access',
|
|
1245
|
+
removedAt: _optionalChain([data, 'access', _26 => _26.removedAt, 'optionalAccess', _27 => _27.toISOString, 'call', _28 => _28()])
|
|
1279
1246
|
},
|
|
1280
1247
|
options
|
|
1281
1248
|
);
|
|
@@ -1351,7 +1318,7 @@ var Liveblocks = class {
|
|
|
1351
1318
|
*/
|
|
1352
1319
|
async *iterInboxNotifications(criteria, options) {
|
|
1353
1320
|
const { signal } = _nullishCoalesce(options, () => ( {}));
|
|
1354
|
-
const pageSize = _core.checkBounds.call(void 0, "pageSize", _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1321
|
+
const pageSize = _core.checkBounds.call(void 0, "pageSize", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _29 => _29.pageSize]), () => ( 50)), 10);
|
|
1355
1322
|
let cursor = void 0;
|
|
1356
1323
|
while (true) {
|
|
1357
1324
|
const { nextCursor, data } = await this.getInboxNotifications(
|
|
@@ -1675,7 +1642,7 @@ var Liveblocks = class {
|
|
|
1675
1642
|
async getGroups(params, options) {
|
|
1676
1643
|
const res = await this.#get(
|
|
1677
1644
|
_core.url`/v2/groups`,
|
|
1678
|
-
{ startingAfter: _optionalChain([params, 'optionalAccess',
|
|
1645
|
+
{ startingAfter: _optionalChain([params, 'optionalAccess', _30 => _30.startingAfter]), limit: _optionalChain([params, 'optionalAccess', _31 => _31.limit]) },
|
|
1679
1646
|
options
|
|
1680
1647
|
);
|
|
1681
1648
|
if (!res.ok) {
|
|
@@ -1737,7 +1704,7 @@ var Liveblocks = class {
|
|
|
1737
1704
|
async massMutateStorage(criteria, callback, massOptions) {
|
|
1738
1705
|
const concurrency = _core.checkBounds.call(void 0,
|
|
1739
1706
|
"concurrency",
|
|
1740
|
-
_nullishCoalesce(_optionalChain([massOptions, 'optionalAccess',
|
|
1707
|
+
_nullishCoalesce(_optionalChain([massOptions, 'optionalAccess', _32 => _32.concurrency]), () => ( 8)),
|
|
1741
1708
|
1,
|
|
1742
1709
|
20
|
|
1743
1710
|
);
|
|
@@ -1753,7 +1720,7 @@ var Liveblocks = class {
|
|
|
1753
1720
|
}
|
|
1754
1721
|
async #_mutateOneRoom(roomId, room, callback, options) {
|
|
1755
1722
|
const debounceInterval = 200;
|
|
1756
|
-
const { signal, abort } = _core.makeAbortController.call(void 0, _optionalChain([options, 'optionalAccess',
|
|
1723
|
+
const { signal, abort } = _core.makeAbortController.call(void 0, _optionalChain([options, 'optionalAccess', _33 => _33.signal]));
|
|
1757
1724
|
let opsBuffer = [];
|
|
1758
1725
|
let outstandingFlush$ = void 0;
|
|
1759
1726
|
let lastFlush = performance.now();
|
|
@@ -1819,7 +1786,7 @@ var Liveblocks = class {
|
|
|
1819
1786
|
const res = await this.#post(
|
|
1820
1787
|
_core.url`/v2/rooms/${roomId}/send-message`,
|
|
1821
1788
|
{ messages },
|
|
1822
|
-
{ signal: _optionalChain([options, 'optionalAccess',
|
|
1789
|
+
{ signal: _optionalChain([options, 'optionalAccess', _34 => _34.signal]) }
|
|
1823
1790
|
);
|
|
1824
1791
|
if (!res.ok) {
|
|
1825
1792
|
throw await LiveblocksError.from(res);
|
|
@@ -1956,7 +1923,7 @@ var Liveblocks = class {
|
|
|
1956
1923
|
"Content-Type": params.file.type,
|
|
1957
1924
|
"Content-Length": String(params.file.size)
|
|
1958
1925
|
},
|
|
1959
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
1926
|
+
signal: _optionalChain([options, 'optionalAccess', _35 => _35.signal])
|
|
1960
1927
|
}
|
|
1961
1928
|
);
|
|
1962
1929
|
if (!res.ok) {
|
|
@@ -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",
|