@liveblocks/core 3.8.0-tiptap1 → 3.8.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 +199 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -6
- package/dist/index.d.ts +49 -6
- package/dist/index.js +75 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -512,6 +512,7 @@ type UpdateDelta = {
|
|
|
512
512
|
type: "update";
|
|
513
513
|
} | {
|
|
514
514
|
type: "delete";
|
|
515
|
+
deletedItem: Lson;
|
|
515
516
|
};
|
|
516
517
|
|
|
517
518
|
/**
|
|
@@ -1295,6 +1296,12 @@ type ThreadDeleteInfo = {
|
|
|
1295
1296
|
type StringOperators<T> = T | {
|
|
1296
1297
|
startsWith: string;
|
|
1297
1298
|
};
|
|
1299
|
+
type NumberOperators<T> = T | {
|
|
1300
|
+
lt?: number;
|
|
1301
|
+
gt?: number;
|
|
1302
|
+
lte?: number;
|
|
1303
|
+
gte?: number;
|
|
1304
|
+
};
|
|
1298
1305
|
/**
|
|
1299
1306
|
* This type can be used to build a metadata query string (compatible
|
|
1300
1307
|
* with `@liveblocks/query-parser`) through a type-safe API.
|
|
@@ -1304,7 +1311,7 @@ type StringOperators<T> = T | {
|
|
|
1304
1311
|
* - `startsWith` (`^` in query string)
|
|
1305
1312
|
*/
|
|
1306
1313
|
type QueryMetadata<M extends BaseMetadata> = {
|
|
1307
|
-
[K in keyof M]: (string extends M[K] ? StringOperators<M[K]> : M[K]) | null;
|
|
1314
|
+
[K in keyof M]: (string extends M[K] ? StringOperators<M[K]> : M[K]) | (number extends M[K] ? NumberOperators<M[K]> : M[K]) | null;
|
|
1308
1315
|
};
|
|
1309
1316
|
|
|
1310
1317
|
type GroupMemberData = {
|
|
@@ -1704,7 +1711,7 @@ interface RoomHttpApi<M extends BaseMetadata> {
|
|
|
1704
1711
|
streamStorage(options: {
|
|
1705
1712
|
roomId: string;
|
|
1706
1713
|
}): Promise<IdTuple<SerializedCrdt>[]>;
|
|
1707
|
-
|
|
1714
|
+
sendMessagesOverHTTP<P extends JsonObject, E extends Json>(options: {
|
|
1708
1715
|
roomId: string;
|
|
1709
1716
|
nonce: string | undefined;
|
|
1710
1717
|
messages: ClientMsg<P, E>[];
|
|
@@ -1756,7 +1763,13 @@ interface NotificationHttpApi<M extends BaseMetadata> {
|
|
|
1756
1763
|
};
|
|
1757
1764
|
requestedAt: Date;
|
|
1758
1765
|
}>;
|
|
1759
|
-
getUnreadInboxNotificationsCount(
|
|
1766
|
+
getUnreadInboxNotificationsCount(options?: {
|
|
1767
|
+
query?: {
|
|
1768
|
+
roomId?: string;
|
|
1769
|
+
kind?: string;
|
|
1770
|
+
};
|
|
1771
|
+
signal?: AbortSignal;
|
|
1772
|
+
}): Promise<number>;
|
|
1760
1773
|
markAllInboxNotificationsAsRead(): Promise<void>;
|
|
1761
1774
|
markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
|
|
1762
1775
|
deleteAllInboxNotifications(): Promise<void>;
|
|
@@ -2070,7 +2083,13 @@ type NotificationsApi<M extends BaseMetadata> = {
|
|
|
2070
2083
|
* @example
|
|
2071
2084
|
* const count = await client.getUnreadInboxNotificationsCount();
|
|
2072
2085
|
*/
|
|
2073
|
-
getUnreadInboxNotificationsCount(
|
|
2086
|
+
getUnreadInboxNotificationsCount(options?: {
|
|
2087
|
+
query?: {
|
|
2088
|
+
roomId?: string;
|
|
2089
|
+
kind?: string;
|
|
2090
|
+
};
|
|
2091
|
+
signal?: AbortSignal;
|
|
2092
|
+
}): Promise<number>;
|
|
2074
2093
|
/**
|
|
2075
2094
|
* Marks all inbox notifications as read.
|
|
2076
2095
|
*
|
|
@@ -4607,6 +4626,12 @@ declare function isPlainObject(blob: unknown): blob is {
|
|
|
4607
4626
|
declare function isStartsWithOperator(blob: unknown): blob is {
|
|
4608
4627
|
startsWith: string;
|
|
4609
4628
|
};
|
|
4629
|
+
declare function isNumberOperator(blob: unknown): blob is {
|
|
4630
|
+
lt?: number;
|
|
4631
|
+
gt?: number;
|
|
4632
|
+
lte?: number;
|
|
4633
|
+
gte?: number;
|
|
4634
|
+
};
|
|
4610
4635
|
|
|
4611
4636
|
declare const nanoid: (t?: number) => string;
|
|
4612
4637
|
|
|
@@ -4622,16 +4647,34 @@ declare const nanoid: (t?: number) => string;
|
|
|
4622
4647
|
* org: {
|
|
4623
4648
|
* startsWith: "liveblocks:",
|
|
4624
4649
|
* },
|
|
4650
|
+
* posX: {
|
|
4651
|
+
* gt: 100,
|
|
4652
|
+
* lt: 200,
|
|
4653
|
+
* },
|
|
4654
|
+
* posY: {
|
|
4655
|
+
* gte: 50,
|
|
4656
|
+
* lte: 300,
|
|
4657
|
+
* },
|
|
4625
4658
|
* },
|
|
4626
4659
|
* });
|
|
4627
4660
|
*
|
|
4628
4661
|
* console.log(query);
|
|
4629
|
-
* // resolved:true AND metadata["status"]:open AND metadata["priority"]:3 AND metadata["org"]^"liveblocks:"
|
|
4662
|
+
* // resolved:true AND metadata["status"]:open AND metadata["priority"]:3 AND metadata["org"]^"liveblocks:" AND metadata["posX"]>100 AND metadata["posX"]<200 AND metadata["posY"]>=50 AND metadata["posY"]<=300
|
|
4630
4663
|
* ```
|
|
4631
4664
|
*/
|
|
4632
4665
|
type SimpleFilterValue = string | number | boolean | null;
|
|
4633
4666
|
type OperatorFilterValue = {
|
|
4634
4667
|
startsWith: string;
|
|
4668
|
+
gt?: never;
|
|
4669
|
+
lt?: never;
|
|
4670
|
+
gte?: never;
|
|
4671
|
+
lte?: never;
|
|
4672
|
+
} | {
|
|
4673
|
+
lt?: number;
|
|
4674
|
+
gt?: number;
|
|
4675
|
+
lte?: number;
|
|
4676
|
+
gte?: number;
|
|
4677
|
+
startsWith?: never;
|
|
4635
4678
|
};
|
|
4636
4679
|
type FilterValue = SimpleFilterValue | OperatorFilterValue;
|
|
4637
4680
|
declare function objectToQuery(obj: {
|
|
@@ -5032,4 +5075,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5032
5075
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5033
5076
|
};
|
|
5034
5077
|
|
|
5035
|
-
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DGI, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
|
5078
|
+
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DGI, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isNumberOperator, isPlainObject, isRootCrdt, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -512,6 +512,7 @@ type UpdateDelta = {
|
|
|
512
512
|
type: "update";
|
|
513
513
|
} | {
|
|
514
514
|
type: "delete";
|
|
515
|
+
deletedItem: Lson;
|
|
515
516
|
};
|
|
516
517
|
|
|
517
518
|
/**
|
|
@@ -1295,6 +1296,12 @@ type ThreadDeleteInfo = {
|
|
|
1295
1296
|
type StringOperators<T> = T | {
|
|
1296
1297
|
startsWith: string;
|
|
1297
1298
|
};
|
|
1299
|
+
type NumberOperators<T> = T | {
|
|
1300
|
+
lt?: number;
|
|
1301
|
+
gt?: number;
|
|
1302
|
+
lte?: number;
|
|
1303
|
+
gte?: number;
|
|
1304
|
+
};
|
|
1298
1305
|
/**
|
|
1299
1306
|
* This type can be used to build a metadata query string (compatible
|
|
1300
1307
|
* with `@liveblocks/query-parser`) through a type-safe API.
|
|
@@ -1304,7 +1311,7 @@ type StringOperators<T> = T | {
|
|
|
1304
1311
|
* - `startsWith` (`^` in query string)
|
|
1305
1312
|
*/
|
|
1306
1313
|
type QueryMetadata<M extends BaseMetadata> = {
|
|
1307
|
-
[K in keyof M]: (string extends M[K] ? StringOperators<M[K]> : M[K]) | null;
|
|
1314
|
+
[K in keyof M]: (string extends M[K] ? StringOperators<M[K]> : M[K]) | (number extends M[K] ? NumberOperators<M[K]> : M[K]) | null;
|
|
1308
1315
|
};
|
|
1309
1316
|
|
|
1310
1317
|
type GroupMemberData = {
|
|
@@ -1704,7 +1711,7 @@ interface RoomHttpApi<M extends BaseMetadata> {
|
|
|
1704
1711
|
streamStorage(options: {
|
|
1705
1712
|
roomId: string;
|
|
1706
1713
|
}): Promise<IdTuple<SerializedCrdt>[]>;
|
|
1707
|
-
|
|
1714
|
+
sendMessagesOverHTTP<P extends JsonObject, E extends Json>(options: {
|
|
1708
1715
|
roomId: string;
|
|
1709
1716
|
nonce: string | undefined;
|
|
1710
1717
|
messages: ClientMsg<P, E>[];
|
|
@@ -1756,7 +1763,13 @@ interface NotificationHttpApi<M extends BaseMetadata> {
|
|
|
1756
1763
|
};
|
|
1757
1764
|
requestedAt: Date;
|
|
1758
1765
|
}>;
|
|
1759
|
-
getUnreadInboxNotificationsCount(
|
|
1766
|
+
getUnreadInboxNotificationsCount(options?: {
|
|
1767
|
+
query?: {
|
|
1768
|
+
roomId?: string;
|
|
1769
|
+
kind?: string;
|
|
1770
|
+
};
|
|
1771
|
+
signal?: AbortSignal;
|
|
1772
|
+
}): Promise<number>;
|
|
1760
1773
|
markAllInboxNotificationsAsRead(): Promise<void>;
|
|
1761
1774
|
markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
|
|
1762
1775
|
deleteAllInboxNotifications(): Promise<void>;
|
|
@@ -2070,7 +2083,13 @@ type NotificationsApi<M extends BaseMetadata> = {
|
|
|
2070
2083
|
* @example
|
|
2071
2084
|
* const count = await client.getUnreadInboxNotificationsCount();
|
|
2072
2085
|
*/
|
|
2073
|
-
getUnreadInboxNotificationsCount(
|
|
2086
|
+
getUnreadInboxNotificationsCount(options?: {
|
|
2087
|
+
query?: {
|
|
2088
|
+
roomId?: string;
|
|
2089
|
+
kind?: string;
|
|
2090
|
+
};
|
|
2091
|
+
signal?: AbortSignal;
|
|
2092
|
+
}): Promise<number>;
|
|
2074
2093
|
/**
|
|
2075
2094
|
* Marks all inbox notifications as read.
|
|
2076
2095
|
*
|
|
@@ -4607,6 +4626,12 @@ declare function isPlainObject(blob: unknown): blob is {
|
|
|
4607
4626
|
declare function isStartsWithOperator(blob: unknown): blob is {
|
|
4608
4627
|
startsWith: string;
|
|
4609
4628
|
};
|
|
4629
|
+
declare function isNumberOperator(blob: unknown): blob is {
|
|
4630
|
+
lt?: number;
|
|
4631
|
+
gt?: number;
|
|
4632
|
+
lte?: number;
|
|
4633
|
+
gte?: number;
|
|
4634
|
+
};
|
|
4610
4635
|
|
|
4611
4636
|
declare const nanoid: (t?: number) => string;
|
|
4612
4637
|
|
|
@@ -4622,16 +4647,34 @@ declare const nanoid: (t?: number) => string;
|
|
|
4622
4647
|
* org: {
|
|
4623
4648
|
* startsWith: "liveblocks:",
|
|
4624
4649
|
* },
|
|
4650
|
+
* posX: {
|
|
4651
|
+
* gt: 100,
|
|
4652
|
+
* lt: 200,
|
|
4653
|
+
* },
|
|
4654
|
+
* posY: {
|
|
4655
|
+
* gte: 50,
|
|
4656
|
+
* lte: 300,
|
|
4657
|
+
* },
|
|
4625
4658
|
* },
|
|
4626
4659
|
* });
|
|
4627
4660
|
*
|
|
4628
4661
|
* console.log(query);
|
|
4629
|
-
* // resolved:true AND metadata["status"]:open AND metadata["priority"]:3 AND metadata["org"]^"liveblocks:"
|
|
4662
|
+
* // resolved:true AND metadata["status"]:open AND metadata["priority"]:3 AND metadata["org"]^"liveblocks:" AND metadata["posX"]>100 AND metadata["posX"]<200 AND metadata["posY"]>=50 AND metadata["posY"]<=300
|
|
4630
4663
|
* ```
|
|
4631
4664
|
*/
|
|
4632
4665
|
type SimpleFilterValue = string | number | boolean | null;
|
|
4633
4666
|
type OperatorFilterValue = {
|
|
4634
4667
|
startsWith: string;
|
|
4668
|
+
gt?: never;
|
|
4669
|
+
lt?: never;
|
|
4670
|
+
gte?: never;
|
|
4671
|
+
lte?: never;
|
|
4672
|
+
} | {
|
|
4673
|
+
lt?: number;
|
|
4674
|
+
gt?: number;
|
|
4675
|
+
lte?: number;
|
|
4676
|
+
gte?: number;
|
|
4677
|
+
startsWith?: never;
|
|
4635
4678
|
};
|
|
4636
4679
|
type FilterValue = SimpleFilterValue | OperatorFilterValue;
|
|
4637
4680
|
declare function objectToQuery(obj: {
|
|
@@ -5032,4 +5075,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5032
5075
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5033
5076
|
};
|
|
5034
5077
|
|
|
5035
|
-
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DGI, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
|
5078
|
+
export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DGI, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isNumberOperator, isPlainObject, isRootCrdt, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
package/dist/index.js
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.8.0
|
|
9
|
+
var PKG_VERSION = "3.8.0";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -927,6 +927,9 @@ function isPlainObject(blob) {
|
|
|
927
927
|
function isStartsWithOperator(blob) {
|
|
928
928
|
return isPlainObject(blob) && typeof blob.startsWith === "string";
|
|
929
929
|
}
|
|
930
|
+
function isNumberOperator(blob) {
|
|
931
|
+
return isPlainObject(blob) && (typeof blob.lt === "number" || typeof blob.gt === "number" || typeof blob.lte === "number" || typeof blob.gte === "number");
|
|
932
|
+
}
|
|
930
933
|
|
|
931
934
|
// src/lib/autoRetry.ts
|
|
932
935
|
var HttpError = class _HttpError extends Error {
|
|
@@ -1281,7 +1284,7 @@ function objectToQuery(obj) {
|
|
|
1281
1284
|
if (isSimpleValue(value)) {
|
|
1282
1285
|
keyValuePairs.push([key, value]);
|
|
1283
1286
|
} else if (isPlainObject(value)) {
|
|
1284
|
-
if (isStartsWithOperator(value)) {
|
|
1287
|
+
if (isStartsWithOperator(value) || isNumberOperator(value)) {
|
|
1285
1288
|
keyValuePairsWithOperator.push([key, value]);
|
|
1286
1289
|
} else {
|
|
1287
1290
|
indexedKeys.push([key, value]);
|
|
@@ -1302,7 +1305,7 @@ function objectToQuery(obj) {
|
|
|
1302
1305
|
}
|
|
1303
1306
|
if (isSimpleValue(nestedValue)) {
|
|
1304
1307
|
nKeyValuePairs.push([formatFilterKey(key, nestedKey), nestedValue]);
|
|
1305
|
-
} else if (isStartsWithOperator(nestedValue)) {
|
|
1308
|
+
} else if (isStartsWithOperator(nestedValue) || isNumberOperator(nestedValue)) {
|
|
1306
1309
|
nKeyValuePairsWithOperator.push([
|
|
1307
1310
|
formatFilterKey(key, nestedKey),
|
|
1308
1311
|
nestedValue
|
|
@@ -1338,6 +1341,34 @@ var getFiltersFromKeyValuePairsWithOperator = (keyValuePairsWithOperator) => {
|
|
|
1338
1341
|
value: value.startsWith
|
|
1339
1342
|
});
|
|
1340
1343
|
}
|
|
1344
|
+
if ("lt" in value && typeof value.lt === "number") {
|
|
1345
|
+
filters.push({
|
|
1346
|
+
key,
|
|
1347
|
+
operator: "<",
|
|
1348
|
+
value: value.lt
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
if ("gt" in value && typeof value.gt === "number") {
|
|
1352
|
+
filters.push({
|
|
1353
|
+
key,
|
|
1354
|
+
operator: ">",
|
|
1355
|
+
value: value.gt
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
if ("gte" in value && typeof value.gte === "number") {
|
|
1359
|
+
filters.push({
|
|
1360
|
+
key,
|
|
1361
|
+
operator: ">=",
|
|
1362
|
+
value: value.gte
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
if ("lte" in value && typeof value.lte === "number") {
|
|
1366
|
+
filters.push({
|
|
1367
|
+
key,
|
|
1368
|
+
operator: "<=",
|
|
1369
|
+
value: value.lte
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1341
1372
|
});
|
|
1342
1373
|
return filters;
|
|
1343
1374
|
};
|
|
@@ -2143,7 +2174,7 @@ function createApiClient({
|
|
|
2143
2174
|
);
|
|
2144
2175
|
return await result.json();
|
|
2145
2176
|
}
|
|
2146
|
-
async function
|
|
2177
|
+
async function sendMessagesOverHTTP(options) {
|
|
2147
2178
|
return httpClient.rawPost(
|
|
2148
2179
|
url`/v2/c/rooms/${options.roomId}/send-message`,
|
|
2149
2180
|
await authManager.getAuthValue({
|
|
@@ -2212,10 +2243,16 @@ function createApiClient({
|
|
|
2212
2243
|
requestedAt: new Date(json.meta.requestedAt)
|
|
2213
2244
|
};
|
|
2214
2245
|
}
|
|
2215
|
-
async function getUnreadInboxNotificationsCount() {
|
|
2246
|
+
async function getUnreadInboxNotificationsCount(options) {
|
|
2247
|
+
let query;
|
|
2248
|
+
if (options?.query) {
|
|
2249
|
+
query = objectToQuery(options.query);
|
|
2250
|
+
}
|
|
2216
2251
|
const { count } = await httpClient.get(
|
|
2217
2252
|
url`/v2/c/inbox-notifications/count`,
|
|
2218
|
-
await authManager.getAuthValue({ requestedScope: "comments:read" })
|
|
2253
|
+
await authManager.getAuthValue({ requestedScope: "comments:read" }),
|
|
2254
|
+
{ query },
|
|
2255
|
+
{ signal: options?.signal }
|
|
2219
2256
|
);
|
|
2220
2257
|
return count;
|
|
2221
2258
|
}
|
|
@@ -2388,7 +2425,7 @@ function createApiClient({
|
|
|
2388
2425
|
getChatAttachmentUrl,
|
|
2389
2426
|
// Room storage
|
|
2390
2427
|
streamStorage,
|
|
2391
|
-
|
|
2428
|
+
sendMessagesOverHTTP,
|
|
2392
2429
|
// Notifications
|
|
2393
2430
|
getInboxNotifications,
|
|
2394
2431
|
getInboxNotificationsSince,
|
|
@@ -7084,7 +7121,12 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
7084
7121
|
const storageUpdate = {
|
|
7085
7122
|
node: this,
|
|
7086
7123
|
type: "LiveMap",
|
|
7087
|
-
updates: {
|
|
7124
|
+
updates: {
|
|
7125
|
+
[parentKey]: {
|
|
7126
|
+
type: "delete",
|
|
7127
|
+
deletedItem: liveNodeToLson(child)
|
|
7128
|
+
}
|
|
7129
|
+
}
|
|
7088
7130
|
};
|
|
7089
7131
|
return { modified: storageUpdate, reverse };
|
|
7090
7132
|
}
|
|
@@ -7177,7 +7219,12 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
7177
7219
|
storageUpdates.set(thisId, {
|
|
7178
7220
|
node: this,
|
|
7179
7221
|
type: "LiveMap",
|
|
7180
|
-
updates: {
|
|
7222
|
+
updates: {
|
|
7223
|
+
[key]: {
|
|
7224
|
+
type: "delete",
|
|
7225
|
+
deletedItem: liveNodeToLson(item)
|
|
7226
|
+
}
|
|
7227
|
+
}
|
|
7181
7228
|
});
|
|
7182
7229
|
this._pool.dispatch(
|
|
7183
7230
|
[
|
|
@@ -7581,13 +7628,13 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
7581
7628
|
}
|
|
7582
7629
|
#applyDeleteObjectKey(op, isLocal) {
|
|
7583
7630
|
const key = op.key;
|
|
7584
|
-
|
|
7631
|
+
const oldValue = this.#map.get(key);
|
|
7632
|
+
if (oldValue === void 0) {
|
|
7585
7633
|
return { modified: false };
|
|
7586
7634
|
}
|
|
7587
7635
|
if (!isLocal && this.#propToLastUpdate.get(key) !== void 0) {
|
|
7588
7636
|
return { modified: false };
|
|
7589
7637
|
}
|
|
7590
|
-
const oldValue = this.#map.get(key);
|
|
7591
7638
|
const id = nn(this._id);
|
|
7592
7639
|
let reverse = [];
|
|
7593
7640
|
if (isLiveNode(oldValue)) {
|
|
@@ -7608,7 +7655,9 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
7608
7655
|
modified: {
|
|
7609
7656
|
node: this,
|
|
7610
7657
|
type: "LiveObject",
|
|
7611
|
-
updates: {
|
|
7658
|
+
updates: {
|
|
7659
|
+
[op.key]: { type: "delete", deletedItem: oldValue }
|
|
7660
|
+
}
|
|
7612
7661
|
},
|
|
7613
7662
|
reverse
|
|
7614
7663
|
};
|
|
@@ -7673,7 +7722,9 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
7673
7722
|
storageUpdates.set(this._id, {
|
|
7674
7723
|
node: this,
|
|
7675
7724
|
type: "LiveObject",
|
|
7676
|
-
updates: {
|
|
7725
|
+
updates: {
|
|
7726
|
+
[key]: { type: "delete", deletedItem: oldValue }
|
|
7727
|
+
}
|
|
7677
7728
|
});
|
|
7678
7729
|
this._pool.dispatch(
|
|
7679
7730
|
[
|
|
@@ -8753,13 +8804,22 @@ function createRoom(options, config) {
|
|
|
8753
8804
|
}
|
|
8754
8805
|
return;
|
|
8755
8806
|
}
|
|
8807
|
+
// NOTE: This strategy is experimental as it will not work in all situations.
|
|
8808
|
+
// It should only be used for broadcasting, presence updates, but isn't suitable
|
|
8809
|
+
// for Storage or Yjs updates yet (because through this channel the server does
|
|
8810
|
+
// not respond with acks or rejections, causing the client's reported status to
|
|
8811
|
+
// be stuck in "synchronizing" forever).
|
|
8756
8812
|
case "experimental-fallback-to-http": {
|
|
8757
8813
|
warn("Message is too large for websockets, so sending over HTTP instead");
|
|
8758
8814
|
const nonce = context.dynamicSessionInfoSig.get()?.nonce ?? raise("Session is not authorized to send message over HTTP");
|
|
8759
|
-
void httpClient.
|
|
8815
|
+
void httpClient.sendMessagesOverHTTP({ roomId, nonce, messages }).then((resp) => {
|
|
8760
8816
|
if (!resp.ok && resp.status === 403) {
|
|
8761
8817
|
managedSocket.reconnect();
|
|
8762
8818
|
}
|
|
8819
|
+
}).catch((err) => {
|
|
8820
|
+
error2(
|
|
8821
|
+
`Failed to deliver message over HTTP: ${String(err)}`
|
|
8822
|
+
);
|
|
8763
8823
|
});
|
|
8764
8824
|
return;
|
|
8765
8825
|
}
|
|
@@ -10024,12 +10084,6 @@ function createClient(options) {
|
|
|
10024
10084
|
);
|
|
10025
10085
|
} else if (resp.token.parsed.k === "sec-legacy" /* SECRET_LEGACY */) {
|
|
10026
10086
|
throw new StopRetrying("AI Copilots requires an ID or Access token");
|
|
10027
|
-
} else {
|
|
10028
|
-
if (!resp.token.parsed.ai) {
|
|
10029
|
-
throw new StopRetrying(
|
|
10030
|
-
"AI Copilots is not yet enabled for this account. To get started, see https://liveblocks.io/docs/get-started/ai-copilots#Quickstart"
|
|
10031
|
-
);
|
|
10032
|
-
}
|
|
10033
10087
|
}
|
|
10034
10088
|
return resp;
|
|
10035
10089
|
},
|
|
@@ -11231,6 +11285,7 @@ export {
|
|
|
11231
11285
|
isJsonScalar,
|
|
11232
11286
|
isLiveNode,
|
|
11233
11287
|
isNotificationChannelEnabled,
|
|
11288
|
+
isNumberOperator,
|
|
11234
11289
|
isPlainObject,
|
|
11235
11290
|
isRootCrdt,
|
|
11236
11291
|
isStartsWithOperator,
|