@liveblocks/core 2.18.2 → 2.18.4-uns1
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.mjs → index.cjs} +373 -285
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +81 -12
- package/dist/index.d.ts +81 -12
- package/dist/index.js +372 -284
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/index.mjs.map +0 -1
|
@@ -2495,11 +2495,47 @@ type NotificationChannelSettings = {
|
|
|
2495
2495
|
[K in NotificationKind]: boolean;
|
|
2496
2496
|
};
|
|
2497
2497
|
/**
|
|
2498
|
-
*
|
|
2498
|
+
* @private
|
|
2499
|
+
*
|
|
2500
|
+
* Base definition of user notification settings.
|
|
2501
|
+
* Plain means it's a simple object coming from the remote backend.
|
|
2502
|
+
*
|
|
2503
|
+
* It's the raw settings object where somme channels cannot exists
|
|
2504
|
+
* because there are no notification kinds enabled on the dashboard.
|
|
2505
|
+
* And this object isn't yet proxied by the creator factory `createUserNotificationSettings`.
|
|
2506
|
+
*/
|
|
2507
|
+
type UserNotificationSettingsPlain = {
|
|
2508
|
+
[C in NotificationChannel]?: NotificationChannelSettings;
|
|
2509
|
+
};
|
|
2510
|
+
/**
|
|
2511
|
+
* @private
|
|
2512
|
+
*
|
|
2513
|
+
* Symbol to brand some properties and methods
|
|
2514
|
+
* as internal and private in `UserNotificationSettings`
|
|
2515
|
+
*/
|
|
2516
|
+
declare const kPrivate: unique symbol;
|
|
2517
|
+
/**
|
|
2518
|
+
* @private
|
|
2519
|
+
*
|
|
2520
|
+
* Private properties and methods internal to `UserNotificationSettings`.
|
|
2521
|
+
* As a user of Liveblocks, you should NEVER USE ANY OF THESE DIRECTLY,
|
|
2522
|
+
* because bad things will happen.
|
|
2523
|
+
*/
|
|
2524
|
+
type PrivateUserNotificationSettingsApi = {
|
|
2525
|
+
__plain__: UserNotificationSettingsPlain;
|
|
2526
|
+
};
|
|
2527
|
+
/**
|
|
2528
|
+
* User notification settings.
|
|
2499
2529
|
* One channel for one set of settings.
|
|
2500
2530
|
*/
|
|
2501
|
-
type UserNotificationSettings = {
|
|
2502
|
-
|
|
2531
|
+
type UserNotificationSettings = Required<UserNotificationSettingsPlain> & {
|
|
2532
|
+
/**
|
|
2533
|
+
* @private
|
|
2534
|
+
*
|
|
2535
|
+
* `UserNotificationSettings` with private internal properties
|
|
2536
|
+
* to store the plain settings and methods.
|
|
2537
|
+
*/
|
|
2538
|
+
[kPrivate]: PrivateUserNotificationSettingsApi;
|
|
2503
2539
|
};
|
|
2504
2540
|
/**
|
|
2505
2541
|
* It creates a deep partial specific for `UserNotificationSettings`
|
|
@@ -2514,14 +2550,45 @@ type DeepPartialWithAugmentation<T> = T extends object ? {
|
|
|
2514
2550
|
} : DeepPartialWithAugmentation<T[P]>;
|
|
2515
2551
|
} : T;
|
|
2516
2552
|
/**
|
|
2517
|
-
* Partial user notification settings
|
|
2518
|
-
*
|
|
2553
|
+
* Partial user notification settings with augmentation preserved gracefully.
|
|
2554
|
+
* It means you can update the settings without being forced to define every keys.
|
|
2555
|
+
* Useful when implementing update functions.
|
|
2556
|
+
*/
|
|
2557
|
+
type PartialUserNotificationSettings = DeepPartialWithAugmentation<UserNotificationSettingsPlain>;
|
|
2558
|
+
/**
|
|
2559
|
+
* @private
|
|
2560
|
+
*
|
|
2561
|
+
* Creates a `UserNotificationSettings` object with the given initial plain settings.
|
|
2562
|
+
* It defines a getter for each channel to access the settings and throws and error
|
|
2563
|
+
* in case the required channel isn't enabled in the dashboard.
|
|
2564
|
+
*
|
|
2565
|
+
* You can see this function as `Proxy` like around `UserNotificationSettingsPlain` type.
|
|
2566
|
+
* We can't predict what will be enabled on the dashboard or not, so it's important
|
|
2567
|
+
* provide a good DX to developers by throwing an error when they try to access a channel
|
|
2568
|
+
* that isn't enabled in the dashboard.
|
|
2569
|
+
*/
|
|
2570
|
+
declare function createUserNotificationSettings(plain: UserNotificationSettingsPlain): UserNotificationSettings;
|
|
2571
|
+
/**
|
|
2572
|
+
* @private
|
|
2573
|
+
*
|
|
2574
|
+
* Patch a `UserNotificationSettings` object by applying notification kind updates
|
|
2575
|
+
* coming from a `PartialUserNotificationSettings` object.
|
|
2519
2576
|
*/
|
|
2520
|
-
|
|
2577
|
+
declare function patchUserNotificationSettings(existing: UserNotificationSettings, patch: PartialUserNotificationSettings): UserNotificationSettings;
|
|
2521
2578
|
/**
|
|
2522
2579
|
*
|
|
2523
2580
|
* Utility to check if a notification channel settings
|
|
2524
2581
|
* is enabled for every notification kinds.
|
|
2582
|
+
*
|
|
2583
|
+
* Usage:
|
|
2584
|
+
* ```ts
|
|
2585
|
+
* const isEmailChannelEnabled = isNotificationChannelEnabled(settings.email);
|
|
2586
|
+
* ```
|
|
2587
|
+
*
|
|
2588
|
+
* ⚠️ Warning: when using this function, you should be aware
|
|
2589
|
+
* you need to ensure you have notification kinds enabled in the dashboard
|
|
2590
|
+
* for the channel you're checking. Otherwise, it will raise an error at runtime because
|
|
2591
|
+
* the backend don't send the settings for a not enabled channel (e.g. no notification kinds enabled in a channel).
|
|
2525
2592
|
*/
|
|
2526
2593
|
declare function isNotificationChannelEnabled(settings: NotificationChannelSettings): boolean;
|
|
2527
2594
|
|
|
@@ -2739,8 +2806,10 @@ interface NotificationHttpApi<M extends BaseMetadata> {
|
|
|
2739
2806
|
markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
|
|
2740
2807
|
deleteAllInboxNotifications(): Promise<void>;
|
|
2741
2808
|
deleteInboxNotification(inboxNotificationId: string): Promise<void>;
|
|
2742
|
-
getUserNotificationSettings(
|
|
2743
|
-
|
|
2809
|
+
getUserNotificationSettings(options?: {
|
|
2810
|
+
signal?: AbortSignal;
|
|
2811
|
+
}): Promise<UserNotificationSettingsPlain>;
|
|
2812
|
+
updateUserNotificationSettings(settings: PartialUserNotificationSettings): Promise<UserNotificationSettingsPlain>;
|
|
2744
2813
|
}
|
|
2745
2814
|
interface LiveblocksHttpApi<M extends BaseMetadata> extends RoomHttpApi<M>, NotificationHttpApi<M> {
|
|
2746
2815
|
getUserThreads_experimental(options?: {
|
|
@@ -3814,10 +3883,10 @@ declare class SortedList<T> {
|
|
|
3814
3883
|
}
|
|
3815
3884
|
|
|
3816
3885
|
/**
|
|
3817
|
-
* Like JSON.stringify(), but
|
|
3818
|
-
*
|
|
3886
|
+
* Like JSON.stringify(), but using stable (sorted) object key order, so that
|
|
3887
|
+
* it returns the same value for the same keys, no matter their order.
|
|
3819
3888
|
*/
|
|
3820
|
-
declare function
|
|
3889
|
+
declare function stableStringify(value: unknown): string;
|
|
3821
3890
|
|
|
3822
3891
|
type QueryParams = Record<string, string | number | null | undefined> | URLSearchParams;
|
|
3823
3892
|
/**
|
|
@@ -3972,4 +4041,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
3972
4041
|
/** @deprecated Use HttpError instead. */
|
|
3973
4042
|
declare const NotificationsApiError: typeof HttpError;
|
|
3974
4043
|
|
|
3975
|
-
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, 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, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, 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 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, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type PartialUserNotificationSettings, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, 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 SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, 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 UserNotificationSettings, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createThreadId, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, resolveUsersInCommentBody, shallow,
|
|
4044
|
+
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, 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, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, 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 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, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type PartialUserNotificationSettings, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, 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 SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, 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 UserNotificationSettings, type UserNotificationSettingsPlain, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createThreadId, createUserNotificationSettings, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchUserNotificationSettings, raise, resolveUsersInCommentBody, shallow, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -2495,11 +2495,47 @@ type NotificationChannelSettings = {
|
|
|
2495
2495
|
[K in NotificationKind]: boolean;
|
|
2496
2496
|
};
|
|
2497
2497
|
/**
|
|
2498
|
-
*
|
|
2498
|
+
* @private
|
|
2499
|
+
*
|
|
2500
|
+
* Base definition of user notification settings.
|
|
2501
|
+
* Plain means it's a simple object coming from the remote backend.
|
|
2502
|
+
*
|
|
2503
|
+
* It's the raw settings object where somme channels cannot exists
|
|
2504
|
+
* because there are no notification kinds enabled on the dashboard.
|
|
2505
|
+
* And this object isn't yet proxied by the creator factory `createUserNotificationSettings`.
|
|
2506
|
+
*/
|
|
2507
|
+
type UserNotificationSettingsPlain = {
|
|
2508
|
+
[C in NotificationChannel]?: NotificationChannelSettings;
|
|
2509
|
+
};
|
|
2510
|
+
/**
|
|
2511
|
+
* @private
|
|
2512
|
+
*
|
|
2513
|
+
* Symbol to brand some properties and methods
|
|
2514
|
+
* as internal and private in `UserNotificationSettings`
|
|
2515
|
+
*/
|
|
2516
|
+
declare const kPrivate: unique symbol;
|
|
2517
|
+
/**
|
|
2518
|
+
* @private
|
|
2519
|
+
*
|
|
2520
|
+
* Private properties and methods internal to `UserNotificationSettings`.
|
|
2521
|
+
* As a user of Liveblocks, you should NEVER USE ANY OF THESE DIRECTLY,
|
|
2522
|
+
* because bad things will happen.
|
|
2523
|
+
*/
|
|
2524
|
+
type PrivateUserNotificationSettingsApi = {
|
|
2525
|
+
__plain__: UserNotificationSettingsPlain;
|
|
2526
|
+
};
|
|
2527
|
+
/**
|
|
2528
|
+
* User notification settings.
|
|
2499
2529
|
* One channel for one set of settings.
|
|
2500
2530
|
*/
|
|
2501
|
-
type UserNotificationSettings = {
|
|
2502
|
-
|
|
2531
|
+
type UserNotificationSettings = Required<UserNotificationSettingsPlain> & {
|
|
2532
|
+
/**
|
|
2533
|
+
* @private
|
|
2534
|
+
*
|
|
2535
|
+
* `UserNotificationSettings` with private internal properties
|
|
2536
|
+
* to store the plain settings and methods.
|
|
2537
|
+
*/
|
|
2538
|
+
[kPrivate]: PrivateUserNotificationSettingsApi;
|
|
2503
2539
|
};
|
|
2504
2540
|
/**
|
|
2505
2541
|
* It creates a deep partial specific for `UserNotificationSettings`
|
|
@@ -2514,14 +2550,45 @@ type DeepPartialWithAugmentation<T> = T extends object ? {
|
|
|
2514
2550
|
} : DeepPartialWithAugmentation<T[P]>;
|
|
2515
2551
|
} : T;
|
|
2516
2552
|
/**
|
|
2517
|
-
* Partial user notification settings
|
|
2518
|
-
*
|
|
2553
|
+
* Partial user notification settings with augmentation preserved gracefully.
|
|
2554
|
+
* It means you can update the settings without being forced to define every keys.
|
|
2555
|
+
* Useful when implementing update functions.
|
|
2556
|
+
*/
|
|
2557
|
+
type PartialUserNotificationSettings = DeepPartialWithAugmentation<UserNotificationSettingsPlain>;
|
|
2558
|
+
/**
|
|
2559
|
+
* @private
|
|
2560
|
+
*
|
|
2561
|
+
* Creates a `UserNotificationSettings` object with the given initial plain settings.
|
|
2562
|
+
* It defines a getter for each channel to access the settings and throws and error
|
|
2563
|
+
* in case the required channel isn't enabled in the dashboard.
|
|
2564
|
+
*
|
|
2565
|
+
* You can see this function as `Proxy` like around `UserNotificationSettingsPlain` type.
|
|
2566
|
+
* We can't predict what will be enabled on the dashboard or not, so it's important
|
|
2567
|
+
* provide a good DX to developers by throwing an error when they try to access a channel
|
|
2568
|
+
* that isn't enabled in the dashboard.
|
|
2569
|
+
*/
|
|
2570
|
+
declare function createUserNotificationSettings(plain: UserNotificationSettingsPlain): UserNotificationSettings;
|
|
2571
|
+
/**
|
|
2572
|
+
* @private
|
|
2573
|
+
*
|
|
2574
|
+
* Patch a `UserNotificationSettings` object by applying notification kind updates
|
|
2575
|
+
* coming from a `PartialUserNotificationSettings` object.
|
|
2519
2576
|
*/
|
|
2520
|
-
|
|
2577
|
+
declare function patchUserNotificationSettings(existing: UserNotificationSettings, patch: PartialUserNotificationSettings): UserNotificationSettings;
|
|
2521
2578
|
/**
|
|
2522
2579
|
*
|
|
2523
2580
|
* Utility to check if a notification channel settings
|
|
2524
2581
|
* is enabled for every notification kinds.
|
|
2582
|
+
*
|
|
2583
|
+
* Usage:
|
|
2584
|
+
* ```ts
|
|
2585
|
+
* const isEmailChannelEnabled = isNotificationChannelEnabled(settings.email);
|
|
2586
|
+
* ```
|
|
2587
|
+
*
|
|
2588
|
+
* ⚠️ Warning: when using this function, you should be aware
|
|
2589
|
+
* you need to ensure you have notification kinds enabled in the dashboard
|
|
2590
|
+
* for the channel you're checking. Otherwise, it will raise an error at runtime because
|
|
2591
|
+
* the backend don't send the settings for a not enabled channel (e.g. no notification kinds enabled in a channel).
|
|
2525
2592
|
*/
|
|
2526
2593
|
declare function isNotificationChannelEnabled(settings: NotificationChannelSettings): boolean;
|
|
2527
2594
|
|
|
@@ -2739,8 +2806,10 @@ interface NotificationHttpApi<M extends BaseMetadata> {
|
|
|
2739
2806
|
markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
|
|
2740
2807
|
deleteAllInboxNotifications(): Promise<void>;
|
|
2741
2808
|
deleteInboxNotification(inboxNotificationId: string): Promise<void>;
|
|
2742
|
-
getUserNotificationSettings(
|
|
2743
|
-
|
|
2809
|
+
getUserNotificationSettings(options?: {
|
|
2810
|
+
signal?: AbortSignal;
|
|
2811
|
+
}): Promise<UserNotificationSettingsPlain>;
|
|
2812
|
+
updateUserNotificationSettings(settings: PartialUserNotificationSettings): Promise<UserNotificationSettingsPlain>;
|
|
2744
2813
|
}
|
|
2745
2814
|
interface LiveblocksHttpApi<M extends BaseMetadata> extends RoomHttpApi<M>, NotificationHttpApi<M> {
|
|
2746
2815
|
getUserThreads_experimental(options?: {
|
|
@@ -3814,10 +3883,10 @@ declare class SortedList<T> {
|
|
|
3814
3883
|
}
|
|
3815
3884
|
|
|
3816
3885
|
/**
|
|
3817
|
-
* Like JSON.stringify(), but
|
|
3818
|
-
*
|
|
3886
|
+
* Like JSON.stringify(), but using stable (sorted) object key order, so that
|
|
3887
|
+
* it returns the same value for the same keys, no matter their order.
|
|
3819
3888
|
*/
|
|
3820
|
-
declare function
|
|
3889
|
+
declare function stableStringify(value: unknown): string;
|
|
3821
3890
|
|
|
3822
3891
|
type QueryParams = Record<string, string | number | null | undefined> | URLSearchParams;
|
|
3823
3892
|
/**
|
|
@@ -3972,4 +4041,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
3972
4041
|
/** @deprecated Use HttpError instead. */
|
|
3973
4042
|
declare const NotificationsApiError: typeof HttpError;
|
|
3974
4043
|
|
|
3975
|
-
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, 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, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, 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 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, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type PartialUserNotificationSettings, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, 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 SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, 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 UserNotificationSettings, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createThreadId, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, resolveUsersInCommentBody, shallow,
|
|
4044
|
+
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, 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, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, 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 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, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type PartialUserNotificationSettings, 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 Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, 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 SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, 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 UserNotificationSettings, type UserNotificationSettingsPlain, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createThreadId, createUserNotificationSettings, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchUserNotificationSettings, raise, resolveUsersInCommentBody, shallow, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|