@liveblocks/core 1.1.7 → 1.1.8

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.d.mts CHANGED
@@ -557,6 +557,19 @@ declare type Resolve<T> = T extends (...args: unknown[]) => unknown ? T : {
557
557
  [K in keyof T]: T[K];
558
558
  };
559
559
 
560
+ declare type CustomAuthenticationResult = {
561
+ token: string;
562
+ error?: never;
563
+ } | {
564
+ token?: never;
565
+ error: "forbidden";
566
+ reason: string;
567
+ } | {
568
+ token?: never;
569
+ error: string;
570
+ reason: string;
571
+ };
572
+
560
573
  /**
561
574
  * This type is used by clients to define the metadata for a user.
562
575
  */
@@ -1419,9 +1432,7 @@ declare type Client = {
1419
1432
  */
1420
1433
  leave(roomId: string): void;
1421
1434
  };
1422
- declare type AuthEndpoint = string | ((room: string) => Promise<{
1423
- token: string;
1424
- }>);
1435
+ declare type AuthEndpoint = string | ((room: string) => Promise<CustomAuthenticationResult>);
1425
1436
  /**
1426
1437
  * The authentication endpoint that is called to ensure that the current user has access to a room.
1427
1438
  * Can be an url or a callback if you need to add additional headers.
@@ -1653,19 +1664,6 @@ declare function asPos(str: string): Pos;
1653
1664
  */
1654
1665
  declare function shallow(a: unknown, b: unknown): boolean;
1655
1666
 
1656
- declare type CustomAuthenticationResult = {
1657
- token: string;
1658
- error?: never;
1659
- } | {
1660
- token?: never;
1661
- error: "forbidden";
1662
- reason: string;
1663
- } | {
1664
- token?: never;
1665
- error: string;
1666
- reason: string;
1667
- };
1668
-
1669
1667
  declare enum ClientMsgCode {
1670
1668
  UPDATE_PRESENCE = 100,
1671
1669
  BROADCAST_EVENT = 103,
package/dist/index.d.ts CHANGED
@@ -557,6 +557,19 @@ declare type Resolve<T> = T extends (...args: unknown[]) => unknown ? T : {
557
557
  [K in keyof T]: T[K];
558
558
  };
559
559
 
560
+ declare type CustomAuthenticationResult = {
561
+ token: string;
562
+ error?: never;
563
+ } | {
564
+ token?: never;
565
+ error: "forbidden";
566
+ reason: string;
567
+ } | {
568
+ token?: never;
569
+ error: string;
570
+ reason: string;
571
+ };
572
+
560
573
  /**
561
574
  * This type is used by clients to define the metadata for a user.
562
575
  */
@@ -1419,9 +1432,7 @@ declare type Client = {
1419
1432
  */
1420
1433
  leave(roomId: string): void;
1421
1434
  };
1422
- declare type AuthEndpoint = string | ((room: string) => Promise<{
1423
- token: string;
1424
- }>);
1435
+ declare type AuthEndpoint = string | ((room: string) => Promise<CustomAuthenticationResult>);
1425
1436
  /**
1426
1437
  * The authentication endpoint that is called to ensure that the current user has access to a room.
1427
1438
  * Can be an url or a callback if you need to add additional headers.
@@ -1653,19 +1664,6 @@ declare function asPos(str: string): Pos;
1653
1664
  */
1654
1665
  declare function shallow(a: unknown, b: unknown): boolean;
1655
1666
 
1656
- declare type CustomAuthenticationResult = {
1657
- token: string;
1658
- error?: never;
1659
- } | {
1660
- token?: never;
1661
- error: "forbidden";
1662
- reason: string;
1663
- } | {
1664
- token?: never;
1665
- error: string;
1666
- reason: string;
1667
- };
1668
-
1669
1667
  declare enum ClientMsgCode {
1670
1668
  UPDATE_PRESENCE = 100,
1671
1669
  BROADCAST_EVENT = 103,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/version.ts
2
2
  var PKG_NAME = "@liveblocks/core";
3
- var PKG_VERSION = "1.1.7";
3
+ var PKG_VERSION = "1.1.8";
4
4
  var PKG_FORMAT = "cjs";
5
5
 
6
6
  // src/dupe-detection.ts