@liveblocks/core 2.18.4-uns2 → 2.20.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 +9 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -25
- package/dist/index.d.ts +0 -25
- package/dist/index.js +9 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2507,37 +2507,12 @@ type NotificationChannelSettings = {
|
|
|
2507
2507
|
type UserNotificationSettingsPlain = {
|
|
2508
2508
|
[C in NotificationChannel]?: NotificationChannelSettings;
|
|
2509
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
2510
|
/**
|
|
2528
2511
|
* User notification settings.
|
|
2529
2512
|
* One channel for one set of settings.
|
|
2530
2513
|
*/
|
|
2531
2514
|
type UserNotificationSettings = {
|
|
2532
2515
|
[C in NotificationChannel]: NotificationChannelSettings | null;
|
|
2533
|
-
} & {
|
|
2534
|
-
/**
|
|
2535
|
-
* @private
|
|
2536
|
-
*
|
|
2537
|
-
* `UserNotificationSettings` with private internal properties
|
|
2538
|
-
* to store the plain settings and methods.
|
|
2539
|
-
*/
|
|
2540
|
-
[kPrivate]: PrivateUserNotificationSettingsApi;
|
|
2541
2516
|
};
|
|
2542
2517
|
/**
|
|
2543
2518
|
* It creates a deep partial specific for `UserNotificationSettings`
|
package/dist/index.d.ts
CHANGED
|
@@ -2507,37 +2507,12 @@ type NotificationChannelSettings = {
|
|
|
2507
2507
|
type UserNotificationSettingsPlain = {
|
|
2508
2508
|
[C in NotificationChannel]?: NotificationChannelSettings;
|
|
2509
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
2510
|
/**
|
|
2528
2511
|
* User notification settings.
|
|
2529
2512
|
* One channel for one set of settings.
|
|
2530
2513
|
*/
|
|
2531
2514
|
type UserNotificationSettings = {
|
|
2532
2515
|
[C in NotificationChannel]: NotificationChannelSettings | null;
|
|
2533
|
-
} & {
|
|
2534
|
-
/**
|
|
2535
|
-
* @private
|
|
2536
|
-
*
|
|
2537
|
-
* `UserNotificationSettings` with private internal properties
|
|
2538
|
-
* to store the plain settings and methods.
|
|
2539
|
-
*/
|
|
2540
|
-
[kPrivate]: PrivateUserNotificationSettingsApi;
|
|
2541
2516
|
};
|
|
2542
2517
|
/**
|
|
2543
2518
|
* It creates a deep partial specific for `UserNotificationSettings`
|
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.
|
|
9
|
+
var PKG_VERSION = "2.20.0";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3604,7 +3604,7 @@ function unlinkDevTools(roomId) {
|
|
|
3604
3604
|
}
|
|
3605
3605
|
|
|
3606
3606
|
// src/protocol/UserNotificationSettings.ts
|
|
3607
|
-
var
|
|
3607
|
+
var kPlain = Symbol("user-notification-settings-plain");
|
|
3608
3608
|
function createUserNotificationSettings(plain) {
|
|
3609
3609
|
const channels = [
|
|
3610
3610
|
"email",
|
|
@@ -3613,10 +3613,8 @@ function createUserNotificationSettings(plain) {
|
|
|
3613
3613
|
"webPush"
|
|
3614
3614
|
];
|
|
3615
3615
|
const descriptors = {
|
|
3616
|
-
[
|
|
3617
|
-
value:
|
|
3618
|
-
__plain__: plain
|
|
3619
|
-
},
|
|
3616
|
+
[kPlain]: {
|
|
3617
|
+
value: plain,
|
|
3620
3618
|
enumerable: false
|
|
3621
3619
|
}
|
|
3622
3620
|
};
|
|
@@ -3635,10 +3633,10 @@ function createUserNotificationSettings(plain) {
|
|
|
3635
3633
|
* creating a well known shaped object → `UserNotificationSettings`.
|
|
3636
3634
|
*/
|
|
3637
3635
|
get() {
|
|
3638
|
-
const value = this[
|
|
3636
|
+
const value = this[kPlain][channel];
|
|
3639
3637
|
if (typeof value === "undefined") {
|
|
3640
3638
|
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`
|
|
3639
|
+
`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
3640
|
);
|
|
3643
3641
|
return null;
|
|
3644
3642
|
}
|
|
@@ -3650,7 +3648,7 @@ function createUserNotificationSettings(plain) {
|
|
|
3650
3648
|
}
|
|
3651
3649
|
function patchUserNotificationSettings(existing, patch) {
|
|
3652
3650
|
const outcoming = createUserNotificationSettings({
|
|
3653
|
-
...existing[
|
|
3651
|
+
...existing[kPlain]
|
|
3654
3652
|
});
|
|
3655
3653
|
for (const channel of keys(patch)) {
|
|
3656
3654
|
const updates = patch[channel];
|
|
@@ -3658,8 +3656,8 @@ function patchUserNotificationSettings(existing, patch) {
|
|
|
3658
3656
|
const kindUpdates = Object.fromEntries(
|
|
3659
3657
|
entries(updates).filter(([, value]) => value !== void 0)
|
|
3660
3658
|
);
|
|
3661
|
-
outcoming[
|
|
3662
|
-
...outcoming[
|
|
3659
|
+
outcoming[kPlain][channel] = {
|
|
3660
|
+
...outcoming[kPlain][channel],
|
|
3663
3661
|
...kindUpdates
|
|
3664
3662
|
};
|
|
3665
3663
|
}
|