@liveblocks/core 2.18.4-uns1 → 2.18.4-uns2
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 +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2528,7 +2528,9 @@ type PrivateUserNotificationSettingsApi = {
|
|
|
2528
2528
|
* User notification settings.
|
|
2529
2529
|
* One channel for one set of settings.
|
|
2530
2530
|
*/
|
|
2531
|
-
type UserNotificationSettings =
|
|
2531
|
+
type UserNotificationSettings = {
|
|
2532
|
+
[C in NotificationChannel]: NotificationChannelSettings | null;
|
|
2533
|
+
} & {
|
|
2532
2534
|
/**
|
|
2533
2535
|
* @private
|
|
2534
2536
|
*
|
|
@@ -2559,13 +2561,13 @@ type PartialUserNotificationSettings = DeepPartialWithAugmentation<UserNotificat
|
|
|
2559
2561
|
* @private
|
|
2560
2562
|
*
|
|
2561
2563
|
* Creates a `UserNotificationSettings` object with the given initial plain settings.
|
|
2562
|
-
* It defines a getter for each channel to access the settings and
|
|
2564
|
+
* It defines a getter for each channel to access the settings and returns `null` with an error log
|
|
2563
2565
|
* in case the required channel isn't enabled in the dashboard.
|
|
2564
2566
|
*
|
|
2565
2567
|
* You can see this function as `Proxy` like around `UserNotificationSettingsPlain` type.
|
|
2566
2568
|
* 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
|
|
2568
|
-
* that isn't enabled in the dashboard.
|
|
2569
|
+
* provide a good DX to developers by returning `null` completed by an error log
|
|
2570
|
+
* when they try to access a channel that isn't enabled in the dashboard.
|
|
2569
2571
|
*/
|
|
2570
2572
|
declare function createUserNotificationSettings(plain: UserNotificationSettingsPlain): UserNotificationSettings;
|
|
2571
2573
|
/**
|
|
@@ -2584,13 +2586,8 @@ declare function patchUserNotificationSettings(existing: UserNotificationSetting
|
|
|
2584
2586
|
* ```ts
|
|
2585
2587
|
* const isEmailChannelEnabled = isNotificationChannelEnabled(settings.email);
|
|
2586
2588
|
* ```
|
|
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).
|
|
2592
2589
|
*/
|
|
2593
|
-
declare function isNotificationChannelEnabled(settings: NotificationChannelSettings): boolean;
|
|
2590
|
+
declare function isNotificationChannelEnabled(settings: NotificationChannelSettings | null): boolean;
|
|
2594
2591
|
|
|
2595
2592
|
interface RoomHttpApi<M extends BaseMetadata> {
|
|
2596
2593
|
getThreads(options: {
|
package/dist/index.d.ts
CHANGED
|
@@ -2528,7 +2528,9 @@ type PrivateUserNotificationSettingsApi = {
|
|
|
2528
2528
|
* User notification settings.
|
|
2529
2529
|
* One channel for one set of settings.
|
|
2530
2530
|
*/
|
|
2531
|
-
type UserNotificationSettings =
|
|
2531
|
+
type UserNotificationSettings = {
|
|
2532
|
+
[C in NotificationChannel]: NotificationChannelSettings | null;
|
|
2533
|
+
} & {
|
|
2532
2534
|
/**
|
|
2533
2535
|
* @private
|
|
2534
2536
|
*
|
|
@@ -2559,13 +2561,13 @@ type PartialUserNotificationSettings = DeepPartialWithAugmentation<UserNotificat
|
|
|
2559
2561
|
* @private
|
|
2560
2562
|
*
|
|
2561
2563
|
* Creates a `UserNotificationSettings` object with the given initial plain settings.
|
|
2562
|
-
* It defines a getter for each channel to access the settings and
|
|
2564
|
+
* It defines a getter for each channel to access the settings and returns `null` with an error log
|
|
2563
2565
|
* in case the required channel isn't enabled in the dashboard.
|
|
2564
2566
|
*
|
|
2565
2567
|
* You can see this function as `Proxy` like around `UserNotificationSettingsPlain` type.
|
|
2566
2568
|
* 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
|
|
2568
|
-
* that isn't enabled in the dashboard.
|
|
2569
|
+
* provide a good DX to developers by returning `null` completed by an error log
|
|
2570
|
+
* when they try to access a channel that isn't enabled in the dashboard.
|
|
2569
2571
|
*/
|
|
2570
2572
|
declare function createUserNotificationSettings(plain: UserNotificationSettingsPlain): UserNotificationSettings;
|
|
2571
2573
|
/**
|
|
@@ -2584,13 +2586,8 @@ declare function patchUserNotificationSettings(existing: UserNotificationSetting
|
|
|
2584
2586
|
* ```ts
|
|
2585
2587
|
* const isEmailChannelEnabled = isNotificationChannelEnabled(settings.email);
|
|
2586
2588
|
* ```
|
|
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).
|
|
2592
2589
|
*/
|
|
2593
|
-
declare function isNotificationChannelEnabled(settings: NotificationChannelSettings): boolean;
|
|
2590
|
+
declare function isNotificationChannelEnabled(settings: NotificationChannelSettings | null): boolean;
|
|
2594
2591
|
|
|
2595
2592
|
interface RoomHttpApi<M extends BaseMetadata> {
|
|
2596
2593
|
getThreads(options: {
|
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 = "2.18.4-
|
|
9
|
+
var PKG_VERSION = "2.18.4-uns2";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3636,10 +3636,11 @@ function createUserNotificationSettings(plain) {
|
|
|
3636
3636
|
*/
|
|
3637
3637
|
get() {
|
|
3638
3638
|
const value = this[kPrivate].__plain__[channel];
|
|
3639
|
-
if (
|
|
3640
|
-
|
|
3641
|
-
`In order to use the '${channel}' channel, please set up your project first.
|
|
3639
|
+
if (typeof value === "undefined") {
|
|
3640
|
+
error2(
|
|
3641
|
+
`In order to use the '${channel}' channel, please set up your project first. For more information https://liveblocks.io/docs/errors/enable-a-notification-channel`
|
|
3642
3642
|
);
|
|
3643
|
+
return null;
|
|
3643
3644
|
}
|
|
3644
3645
|
return value;
|
|
3645
3646
|
}
|
|
@@ -3666,7 +3667,7 @@ function patchUserNotificationSettings(existing, patch) {
|
|
|
3666
3667
|
return outcoming;
|
|
3667
3668
|
}
|
|
3668
3669
|
function isNotificationChannelEnabled(settings) {
|
|
3669
|
-
return values(settings).every((enabled) => enabled === true);
|
|
3670
|
+
return settings !== null ? values(settings).every((enabled) => enabled === true) : false;
|
|
3670
3671
|
}
|
|
3671
3672
|
|
|
3672
3673
|
// src/lib/position.ts
|