@liveblocks/core 2.24.0-deque1 → 2.24.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.cjs +141 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +254 -117
- package/dist/index.d.ts +254 -117
- package/dist/index.js +142 -36
- 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 = "2.24.0
|
|
9
|
+
var PKG_VERSION = "2.24.0";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -118,6 +118,20 @@ function convertToInboxNotificationData(data) {
|
|
|
118
118
|
readAt
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
+
function convertToSubscriptionData(data) {
|
|
122
|
+
const createdAt = new Date(data.createdAt);
|
|
123
|
+
return {
|
|
124
|
+
...data,
|
|
125
|
+
createdAt
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function convertToUserSubscriptionData(data) {
|
|
129
|
+
const createdAt = new Date(data.createdAt);
|
|
130
|
+
return {
|
|
131
|
+
...data,
|
|
132
|
+
createdAt
|
|
133
|
+
};
|
|
134
|
+
}
|
|
121
135
|
function convertToThreadDeleteInfo(data) {
|
|
122
136
|
const deletedAt = new Date(data.deletedAt);
|
|
123
137
|
return {
|
|
@@ -132,6 +146,13 @@ function convertToInboxNotificationDeleteInfo(data) {
|
|
|
132
146
|
deletedAt
|
|
133
147
|
};
|
|
134
148
|
}
|
|
149
|
+
function convertToSubscriptionDeleteInfo(data) {
|
|
150
|
+
const deletedAt = new Date(data.deletedAt);
|
|
151
|
+
return {
|
|
152
|
+
...data,
|
|
153
|
+
deletedAt
|
|
154
|
+
};
|
|
155
|
+
}
|
|
135
156
|
|
|
136
157
|
// src/lib/fancy-console.ts
|
|
137
158
|
var fancy_console_exports = {};
|
|
@@ -1115,6 +1136,12 @@ function createApiClient({
|
|
|
1115
1136
|
convertToInboxNotificationDeleteInfo
|
|
1116
1137
|
)
|
|
1117
1138
|
},
|
|
1139
|
+
subscriptions: {
|
|
1140
|
+
updated: result.subscriptions.map(convertToSubscriptionData),
|
|
1141
|
+
deleted: result.deletedSubscriptions.map(
|
|
1142
|
+
convertToSubscriptionDeleteInfo
|
|
1143
|
+
)
|
|
1144
|
+
},
|
|
1118
1145
|
requestedAt: new Date(result.meta.requestedAt),
|
|
1119
1146
|
permissionHints: result.meta.permissionHints
|
|
1120
1147
|
};
|
|
@@ -1143,6 +1170,7 @@ function createApiClient({
|
|
|
1143
1170
|
inboxNotifications: result.inboxNotifications.map(
|
|
1144
1171
|
convertToInboxNotificationData
|
|
1145
1172
|
),
|
|
1173
|
+
subscriptions: result.subscriptions.map(convertToSubscriptionData),
|
|
1146
1174
|
nextCursor: result.meta.nextCursor,
|
|
1147
1175
|
requestedAt: new Date(result.meta.requestedAt),
|
|
1148
1176
|
permissionHints: result.meta.permissionHints
|
|
@@ -1152,6 +1180,7 @@ function createApiClient({
|
|
|
1152
1180
|
return {
|
|
1153
1181
|
threads: [],
|
|
1154
1182
|
inboxNotifications: [],
|
|
1183
|
+
subscriptions: [],
|
|
1155
1184
|
nextCursor: null,
|
|
1156
1185
|
//
|
|
1157
1186
|
// HACK
|
|
@@ -1210,12 +1239,14 @@ function createApiClient({
|
|
|
1210
1239
|
const json = await response.json();
|
|
1211
1240
|
return {
|
|
1212
1241
|
thread: convertToThreadData(json.thread),
|
|
1213
|
-
inboxNotification: json.inboxNotification ? convertToInboxNotificationData(json.inboxNotification) : void 0
|
|
1242
|
+
inboxNotification: json.inboxNotification ? convertToInboxNotificationData(json.inboxNotification) : void 0,
|
|
1243
|
+
subscription: json.subscription ? convertToSubscriptionData(json.subscription) : void 0
|
|
1214
1244
|
};
|
|
1215
1245
|
} else if (response.status === 404) {
|
|
1216
1246
|
return {
|
|
1217
1247
|
thread: void 0,
|
|
1218
|
-
inboxNotification: void 0
|
|
1248
|
+
inboxNotification: void 0,
|
|
1249
|
+
subscription: void 0
|
|
1219
1250
|
};
|
|
1220
1251
|
} else {
|
|
1221
1252
|
throw new Error(
|
|
@@ -1310,6 +1341,25 @@ function createApiClient({
|
|
|
1310
1341
|
})
|
|
1311
1342
|
);
|
|
1312
1343
|
}
|
|
1344
|
+
async function subscribeToThread(options) {
|
|
1345
|
+
const subscription = await httpClient.post(
|
|
1346
|
+
url`/v2/c/rooms/${options.roomId}/threads/${options.threadId}/subscribe`,
|
|
1347
|
+
await authManager.getAuthValue({
|
|
1348
|
+
requestedScope: "comments:read",
|
|
1349
|
+
roomId: options.roomId
|
|
1350
|
+
})
|
|
1351
|
+
);
|
|
1352
|
+
return convertToSubscriptionData(subscription);
|
|
1353
|
+
}
|
|
1354
|
+
async function unsubscribeFromThread(options) {
|
|
1355
|
+
await httpClient.post(
|
|
1356
|
+
url`/v2/c/rooms/${options.roomId}/threads/${options.threadId}/unsubscribe`,
|
|
1357
|
+
await authManager.getAuthValue({
|
|
1358
|
+
requestedScope: "comments:read",
|
|
1359
|
+
roomId: options.roomId
|
|
1360
|
+
})
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1313
1363
|
async function uploadAttachment(options) {
|
|
1314
1364
|
const roomId = options.roomId;
|
|
1315
1365
|
const abortSignal = options.signal;
|
|
@@ -1480,9 +1530,9 @@ function createApiClient({
|
|
|
1480
1530
|
const batch2 = getOrCreateAttachmentUrlsStore(options.roomId).batch;
|
|
1481
1531
|
return batch2.get(options.attachmentId);
|
|
1482
1532
|
}
|
|
1483
|
-
async function
|
|
1533
|
+
async function getSubscriptionSettings(options) {
|
|
1484
1534
|
return httpClient.get(
|
|
1485
|
-
url`/v2/c/rooms/${options.roomId}/
|
|
1535
|
+
url`/v2/c/rooms/${options.roomId}/subscription-settings`,
|
|
1486
1536
|
await authManager.getAuthValue({
|
|
1487
1537
|
requestedScope: "comments:read",
|
|
1488
1538
|
roomId: options.roomId
|
|
@@ -1493,9 +1543,9 @@ function createApiClient({
|
|
|
1493
1543
|
}
|
|
1494
1544
|
);
|
|
1495
1545
|
}
|
|
1496
|
-
async function
|
|
1546
|
+
async function updateSubscriptionSettings(options) {
|
|
1497
1547
|
return httpClient.post(
|
|
1498
|
-
url`/v2/c/rooms/${options.roomId}/
|
|
1548
|
+
url`/v2/c/rooms/${options.roomId}/subscription-settings`,
|
|
1499
1549
|
await authManager.getAuthValue({
|
|
1500
1550
|
requestedScope: "comments:read",
|
|
1501
1551
|
roomId: options.roomId
|
|
@@ -1676,6 +1726,7 @@ function createApiClient({
|
|
|
1676
1726
|
convertToInboxNotificationData
|
|
1677
1727
|
),
|
|
1678
1728
|
threads: json.threads.map(convertToThreadData),
|
|
1729
|
+
subscriptions: json.subscriptions.map(convertToSubscriptionData),
|
|
1679
1730
|
nextCursor: json.meta.nextCursor,
|
|
1680
1731
|
requestedAt: new Date(json.meta.requestedAt)
|
|
1681
1732
|
};
|
|
@@ -1698,6 +1749,10 @@ function createApiClient({
|
|
|
1698
1749
|
updated: json.threads.map(convertToThreadData),
|
|
1699
1750
|
deleted: json.deletedThreads.map(convertToThreadDeleteInfo)
|
|
1700
1751
|
},
|
|
1752
|
+
subscriptions: {
|
|
1753
|
+
updated: json.subscriptions.map(convertToSubscriptionData),
|
|
1754
|
+
deleted: json.deletedSubscriptions.map(convertToSubscriptionDeleteInfo)
|
|
1755
|
+
},
|
|
1701
1756
|
requestedAt: new Date(json.meta.requestedAt)
|
|
1702
1757
|
};
|
|
1703
1758
|
}
|
|
@@ -1749,7 +1804,7 @@ function createApiClient({
|
|
|
1749
1804
|
await authManager.getAuthValue({ requestedScope: "comments:read" })
|
|
1750
1805
|
);
|
|
1751
1806
|
}
|
|
1752
|
-
async function
|
|
1807
|
+
async function getNotificationSettings(options) {
|
|
1753
1808
|
return httpClient.get(
|
|
1754
1809
|
url`/v2/c/notification-settings`,
|
|
1755
1810
|
await authManager.getAuthValue({ requestedScope: "comments:read" }),
|
|
@@ -1757,7 +1812,7 @@ function createApiClient({
|
|
|
1757
1812
|
{ signal: _optionalChain([options, 'optionalAccess', _18 => _18.signal]) }
|
|
1758
1813
|
);
|
|
1759
1814
|
}
|
|
1760
|
-
async function
|
|
1815
|
+
async function updateNotificationSettings(settings) {
|
|
1761
1816
|
return httpClient.post(
|
|
1762
1817
|
url`/v2/c/notification-settings`,
|
|
1763
1818
|
await authManager.getAuthValue({ requestedScope: "comments:read" }),
|
|
@@ -1784,6 +1839,7 @@ function createApiClient({
|
|
|
1784
1839
|
inboxNotifications: json.inboxNotifications.map(
|
|
1785
1840
|
convertToInboxNotificationData
|
|
1786
1841
|
),
|
|
1842
|
+
subscriptions: json.subscriptions.map(convertToSubscriptionData),
|
|
1787
1843
|
nextCursor: json.meta.nextCursor,
|
|
1788
1844
|
requestedAt: new Date(json.meta.requestedAt),
|
|
1789
1845
|
permissionHints: json.meta.permissionHints
|
|
@@ -1807,6 +1863,10 @@ function createApiClient({
|
|
|
1807
1863
|
convertToInboxNotificationDeleteInfo
|
|
1808
1864
|
)
|
|
1809
1865
|
},
|
|
1866
|
+
subscriptions: {
|
|
1867
|
+
updated: json.subscriptions.map(convertToSubscriptionData),
|
|
1868
|
+
deleted: json.deletedSubscriptions.map(convertToSubscriptionDeleteInfo)
|
|
1869
|
+
},
|
|
1810
1870
|
requestedAt: new Date(json.meta.requestedAt),
|
|
1811
1871
|
permissionHints: json.meta.permissionHints
|
|
1812
1872
|
};
|
|
@@ -1826,10 +1886,12 @@ function createApiClient({
|
|
|
1826
1886
|
removeReaction,
|
|
1827
1887
|
markThreadAsResolved,
|
|
1828
1888
|
markThreadAsUnresolved,
|
|
1889
|
+
subscribeToThread,
|
|
1890
|
+
unsubscribeFromThread,
|
|
1829
1891
|
markRoomInboxNotificationAsRead,
|
|
1830
|
-
// Room
|
|
1831
|
-
|
|
1832
|
-
|
|
1892
|
+
// Room subscription settings
|
|
1893
|
+
getSubscriptionSettings,
|
|
1894
|
+
updateSubscriptionSettings,
|
|
1833
1895
|
// Room text editor
|
|
1834
1896
|
createTextMention,
|
|
1835
1897
|
deleteTextMention,
|
|
@@ -1845,7 +1907,7 @@ function createApiClient({
|
|
|
1845
1907
|
// Room storage
|
|
1846
1908
|
streamStorage,
|
|
1847
1909
|
sendMessages,
|
|
1848
|
-
//
|
|
1910
|
+
// Notifications
|
|
1849
1911
|
getInboxNotifications,
|
|
1850
1912
|
getInboxNotificationsSince,
|
|
1851
1913
|
getUnreadInboxNotificationsCount,
|
|
@@ -1853,8 +1915,8 @@ function createApiClient({
|
|
|
1853
1915
|
markInboxNotificationAsRead,
|
|
1854
1916
|
deleteAllInboxNotifications,
|
|
1855
1917
|
deleteInboxNotification,
|
|
1856
|
-
|
|
1857
|
-
|
|
1918
|
+
getNotificationSettings,
|
|
1919
|
+
updateNotificationSettings,
|
|
1858
1920
|
// User threads
|
|
1859
1921
|
getUserThreads_experimental,
|
|
1860
1922
|
getUserThreadsSince_experimental,
|
|
@@ -3603,9 +3665,9 @@ function unlinkDevTools(roomId) {
|
|
|
3603
3665
|
});
|
|
3604
3666
|
}
|
|
3605
3667
|
|
|
3606
|
-
// src/protocol/
|
|
3607
|
-
var kPlain = Symbol("
|
|
3608
|
-
function
|
|
3668
|
+
// src/protocol/NotificationSettings.ts
|
|
3669
|
+
var kPlain = Symbol("notification-settings-plain");
|
|
3670
|
+
function createNotificationSettings(plain) {
|
|
3609
3671
|
const channels = [
|
|
3610
3672
|
"email",
|
|
3611
3673
|
"slack",
|
|
@@ -3629,8 +3691,8 @@ function createUserNotificationSettings(plain) {
|
|
|
3629
3691
|
* no enforced shape for this. And so the standard library definitions have to remain as broad as possible
|
|
3630
3692
|
* to support any valid JavaScript usage (e.g `Object.defineProperty`).
|
|
3631
3693
|
*
|
|
3632
|
-
* So we can safely tells that this getter is typed as `this:
|
|
3633
|
-
* creating a well known shaped object → `
|
|
3694
|
+
* So we can safely tells that this getter is typed as `this: NotificationSettings` because we're
|
|
3695
|
+
* creating a well known shaped object → `NotificationSettings`.
|
|
3634
3696
|
*/
|
|
3635
3697
|
get() {
|
|
3636
3698
|
const value = this[kPlain][channel];
|
|
@@ -3646,8 +3708,8 @@ function createUserNotificationSettings(plain) {
|
|
|
3646
3708
|
}
|
|
3647
3709
|
return create(null, descriptors);
|
|
3648
3710
|
}
|
|
3649
|
-
function
|
|
3650
|
-
const outcoming =
|
|
3711
|
+
function patchNotificationSettings(existing, patch) {
|
|
3712
|
+
const outcoming = createNotificationSettings({
|
|
3651
3713
|
...existing[kPlain]
|
|
3652
3714
|
});
|
|
3653
3715
|
for (const channel of keys(patch)) {
|
|
@@ -6509,6 +6571,10 @@ function defaultMessageFromContext(context) {
|
|
|
6509
6571
|
return "Could not mark thread as resolved";
|
|
6510
6572
|
case "MARK_THREAD_AS_UNRESOLVED_ERROR":
|
|
6511
6573
|
return "Could not mark thread as unresolved";
|
|
6574
|
+
case "SUBSCRIBE_TO_THREAD_ERROR":
|
|
6575
|
+
return "Could not subscribe to thread";
|
|
6576
|
+
case "UNSUBSCRIBE_FROM_THREAD_ERROR":
|
|
6577
|
+
return "Could not unsubscribe from thread";
|
|
6512
6578
|
case "CREATE_COMMENT_ERROR":
|
|
6513
6579
|
return "Could not create new comment";
|
|
6514
6580
|
case "EDIT_COMMENT_ERROR":
|
|
@@ -6529,8 +6595,10 @@ function defaultMessageFromContext(context) {
|
|
|
6529
6595
|
return "Could not delete all inbox notifications";
|
|
6530
6596
|
case "UPDATE_NOTIFICATION_SETTINGS_ERROR":
|
|
6531
6597
|
return "Could not update notification settings";
|
|
6598
|
+
case "UPDATE_ROOM_SUBSCRIPTION_SETTINGS_ERROR":
|
|
6599
|
+
return "Could not update room subscription settings";
|
|
6532
6600
|
case "UPDATE_USER_NOTIFICATION_SETTINGS_ERROR":
|
|
6533
|
-
return "Could not update
|
|
6601
|
+
return "Could not update notification settings";
|
|
6534
6602
|
default:
|
|
6535
6603
|
return assertNever(context, "Unhandled case");
|
|
6536
6604
|
}
|
|
@@ -7717,6 +7785,12 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
7717
7785
|
threadId
|
|
7718
7786
|
});
|
|
7719
7787
|
}
|
|
7788
|
+
async function subscribeToThread(threadId) {
|
|
7789
|
+
return httpClient.subscribeToThread({ roomId, threadId });
|
|
7790
|
+
}
|
|
7791
|
+
async function unsubscribeFromThread(threadId) {
|
|
7792
|
+
return httpClient.unsubscribeFromThread({ roomId, threadId });
|
|
7793
|
+
}
|
|
7720
7794
|
async function createComment(options2) {
|
|
7721
7795
|
return httpClient.createComment({
|
|
7722
7796
|
roomId,
|
|
@@ -7781,14 +7855,14 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
7781
7855
|
function getAttachmentUrl(attachmentId) {
|
|
7782
7856
|
return httpClient.getAttachmentUrl({ roomId, attachmentId });
|
|
7783
7857
|
}
|
|
7784
|
-
function
|
|
7785
|
-
return httpClient.
|
|
7858
|
+
function getSubscriptionSettings(options2) {
|
|
7859
|
+
return httpClient.getSubscriptionSettings({
|
|
7786
7860
|
roomId,
|
|
7787
7861
|
signal: _optionalChain([options2, 'optionalAccess', _158 => _158.signal])
|
|
7788
7862
|
});
|
|
7789
7863
|
}
|
|
7790
|
-
function
|
|
7791
|
-
return httpClient.
|
|
7864
|
+
function updateSubscriptionSettings(settings) {
|
|
7865
|
+
return httpClient.updateSubscriptionSettings({ roomId, settings });
|
|
7792
7866
|
}
|
|
7793
7867
|
async function markInboxNotificationAsRead(inboxNotificationId) {
|
|
7794
7868
|
await httpClient.markRoomInboxNotificationAsRead({
|
|
@@ -7915,6 +7989,8 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
7915
7989
|
editThreadMetadata,
|
|
7916
7990
|
markThreadAsResolved,
|
|
7917
7991
|
markThreadAsUnresolved,
|
|
7992
|
+
subscribeToThread,
|
|
7993
|
+
unsubscribeFromThread,
|
|
7918
7994
|
createComment,
|
|
7919
7995
|
editComment,
|
|
7920
7996
|
deleteComment,
|
|
@@ -7924,8 +8000,10 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
7924
8000
|
uploadAttachment,
|
|
7925
8001
|
getAttachmentUrl,
|
|
7926
8002
|
// Notifications
|
|
7927
|
-
getNotificationSettings,
|
|
7928
|
-
|
|
8003
|
+
getNotificationSettings: getSubscriptionSettings,
|
|
8004
|
+
getSubscriptionSettings,
|
|
8005
|
+
updateNotificationSettings: updateSubscriptionSettings,
|
|
8006
|
+
updateSubscriptionSettings,
|
|
7929
8007
|
markInboxNotificationAsRead
|
|
7930
8008
|
},
|
|
7931
8009
|
// Explictly make the internal field non-enumerable, to avoid aggressive
|
|
@@ -8275,13 +8353,13 @@ function createClient(options) {
|
|
|
8275
8353
|
_optionalChain([win, 'optionalAccess', _185 => _185.addEventListener, 'call', _186 => _186("beforeunload", maybePreventClose)]);
|
|
8276
8354
|
}
|
|
8277
8355
|
async function getNotificationSettings(options2) {
|
|
8278
|
-
const plainSettings = await httpClient.
|
|
8279
|
-
const settings =
|
|
8356
|
+
const plainSettings = await httpClient.getNotificationSettings(options2);
|
|
8357
|
+
const settings = createNotificationSettings(plainSettings);
|
|
8280
8358
|
return settings;
|
|
8281
8359
|
}
|
|
8282
8360
|
async function updateNotificationSettings(settings) {
|
|
8283
|
-
const plainSettings = await httpClient.
|
|
8284
|
-
const settingsObject =
|
|
8361
|
+
const plainSettings = await httpClient.updateNotificationSettings(settings);
|
|
8362
|
+
const settingsObject = createNotificationSettings(plainSettings);
|
|
8285
8363
|
return settingsObject;
|
|
8286
8364
|
}
|
|
8287
8365
|
const client = Object.defineProperty(
|
|
@@ -8297,7 +8375,7 @@ function createClient(options) {
|
|
|
8297
8375
|
markInboxNotificationAsRead: httpClient.markInboxNotificationAsRead,
|
|
8298
8376
|
deleteAllInboxNotifications: httpClient.deleteAllInboxNotifications,
|
|
8299
8377
|
deleteInboxNotification: httpClient.deleteInboxNotification,
|
|
8300
|
-
// Public
|
|
8378
|
+
// Public notification settings API
|
|
8301
8379
|
getNotificationSettings,
|
|
8302
8380
|
updateNotificationSettings,
|
|
8303
8381
|
// Advanced resolvers APIs
|
|
@@ -9166,6 +9244,9 @@ function makePoller(callback, intervalMs, options) {
|
|
|
9166
9244
|
fsm.send({ type: "POLL" });
|
|
9167
9245
|
}
|
|
9168
9246
|
}
|
|
9247
|
+
function markAsStale() {
|
|
9248
|
+
context.lastSuccessfulPollAt = performance.now() - maxStaleTimeMs - 1;
|
|
9249
|
+
}
|
|
9169
9250
|
function setInForeground(inForeground) {
|
|
9170
9251
|
context.inForeground = inForeground;
|
|
9171
9252
|
startOrStop();
|
|
@@ -9182,6 +9263,7 @@ function makePoller(callback, intervalMs, options) {
|
|
|
9182
9263
|
inc,
|
|
9183
9264
|
dec,
|
|
9184
9265
|
pollNowIfStale,
|
|
9266
|
+
markAsStale,
|
|
9185
9267
|
// Internal API, used by unit tests only to simulate visibility events
|
|
9186
9268
|
setInForeground
|
|
9187
9269
|
};
|
|
@@ -9225,6 +9307,18 @@ function shallow(a, b) {
|
|
|
9225
9307
|
}
|
|
9226
9308
|
return shallowObj(a, b);
|
|
9227
9309
|
}
|
|
9310
|
+
function shallow2(a, b) {
|
|
9311
|
+
if (!isPlainObject(a) || !isPlainObject(b)) {
|
|
9312
|
+
return shallow(a, b);
|
|
9313
|
+
}
|
|
9314
|
+
const keysA = Object.keys(a);
|
|
9315
|
+
if (keysA.length !== Object.keys(b).length) {
|
|
9316
|
+
return false;
|
|
9317
|
+
}
|
|
9318
|
+
return keysA.every(
|
|
9319
|
+
(key) => Object.prototype.hasOwnProperty.call(b, key) && shallow(a[key], b[key])
|
|
9320
|
+
);
|
|
9321
|
+
}
|
|
9228
9322
|
|
|
9229
9323
|
// src/lib/SortedList.ts
|
|
9230
9324
|
function bisectRight(arr, x, lt) {
|
|
@@ -9298,6 +9392,14 @@ var SortedList = class _SortedList {
|
|
|
9298
9392
|
}
|
|
9299
9393
|
};
|
|
9300
9394
|
|
|
9395
|
+
// src/protocol/Subscriptions.ts
|
|
9396
|
+
function getSubscriptionKey(subscription, subjectId) {
|
|
9397
|
+
if (typeof subscription === "string") {
|
|
9398
|
+
return `${subscription}:${subjectId}`;
|
|
9399
|
+
}
|
|
9400
|
+
return `${subscription.kind}:${subscription.subjectId}`;
|
|
9401
|
+
}
|
|
9402
|
+
|
|
9301
9403
|
// src/types/Others.ts
|
|
9302
9404
|
var TextEditorType = /* @__PURE__ */ ((TextEditorType2) => {
|
|
9303
9405
|
TextEditorType2["Lexical"] = "lexical";
|
|
@@ -9405,5 +9507,9 @@ var NotificationsApiError = HttpError;
|
|
|
9405
9507
|
|
|
9406
9508
|
|
|
9407
9509
|
|
|
9408
|
-
|
|
9510
|
+
|
|
9511
|
+
|
|
9512
|
+
|
|
9513
|
+
|
|
9514
|
+
exports.ClientMsgCode = ClientMsgCode; exports.CommentsApiError = CommentsApiError; exports.CrdtType = CrdtType; exports.DefaultMap = DefaultMap; exports.Deque = Deque; exports.DerivedSignal = DerivedSignal; exports.HttpError = HttpError; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.LiveblocksError = LiveblocksError; exports.MutableSignal = MutableSignal; exports.NotificationsApiError = NotificationsApiError; exports.OpCode = OpCode; exports.Permission = Permission; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.Signal = Signal; exports.SortedList = SortedList; exports.TextEditorType = TextEditorType; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.ackOp = ackOp; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.batch = batch; exports.checkBounds = checkBounds; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToSubscriptionData = convertToSubscriptionData; exports.convertToThreadData = convertToThreadData; exports.convertToUserSubscriptionData = convertToUserSubscriptionData; exports.createClient = createClient; exports.createCommentAttachmentId = createCommentAttachmentId; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createManagedPool = createManagedPool; exports.createNotificationSettings = createNotificationSettings; exports.createThreadId = createThreadId; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.entries = entries; exports.errorIf = errorIf; exports.freeze = freeze; exports.generateCommentUrl = generateCommentUrl; exports.getMentionedIdsFromCommentBody = getMentionedIdsFromCommentBody; exports.getSubscriptionKey = getSubscriptionKey; exports.html = html; exports.htmlSafe = htmlSafe; exports.isChildCrdt = isChildCrdt; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isNotificationChannelEnabled = isNotificationChannelEnabled; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.isStartsWithOperator = isStartsWithOperator; exports.kInternal = kInternal; exports.keys = keys; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeAbortController = makeAbortController; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.patchNotificationSettings = patchNotificationSettings; exports.raise = raise; exports.resolveUsersInCommentBody = resolveUsersInCommentBody; exports.shallow = shallow; exports.shallow2 = shallow2; exports.stableStringify = stableStringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toAbsoluteUrl = toAbsoluteUrl; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.withTimeout = withTimeout;
|
|
9409
9515
|
//# sourceMappingURL=index.cjs.map
|