@liveblocks/client 0.16.16 → 0.16.17
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/internal.d.ts +4 -2
- package/internal.js +5 -5
- package/internal.mjs +2 -2
- package/package.json +1 -1
package/internal.d.ts
CHANGED
|
@@ -329,7 +329,6 @@ declare type RoomAuthToken = {
|
|
|
329
329
|
roomId: string;
|
|
330
330
|
scopes: string[];
|
|
331
331
|
actor: number;
|
|
332
|
-
maxConnections: number;
|
|
333
332
|
maxConnectionsPerRoom?: number;
|
|
334
333
|
id?: string;
|
|
335
334
|
info?: Json;
|
|
@@ -372,6 +371,9 @@ declare function comparePosition(posA: string, posB: string): number;
|
|
|
372
371
|
* 🍒 case.
|
|
373
372
|
*/
|
|
374
373
|
declare function assertNever(_value: never, errmsg: string): never;
|
|
374
|
+
declare function isPlainObject(blob: unknown): blob is {
|
|
375
|
+
[key: string]: unknown;
|
|
376
|
+
};
|
|
375
377
|
/**
|
|
376
378
|
* Alternative to JSON.parse() that will not throw in production. If the passed
|
|
377
379
|
* string cannot be parsed, this will return `undefined`.
|
|
@@ -382,4 +384,4 @@ declare function tryParseJson(rawMessage: string): Json | undefined;
|
|
|
382
384
|
*/
|
|
383
385
|
declare function b64decode(b64value: string): string;
|
|
384
386
|
|
|
385
|
-
export { AppOnlyAuthToken, AuthToken, BroadcastEventClientMsg, ClientMsg, ClientMsgCode, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateRegisterOp, CreateRootObjectOp, DeleteCrdtOp, DeleteObjectKeyOp, FetchStorageClientMsg, IdTuple, InitialDocumentStateServerMsg, NodeMap, Op, OpCode, ParentToChildNodeMap, RoomAuthToken, RoomStateServerMsg, Scope, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, UpdateObjectOp, UpdatePresenceClientMsg, UpdateStorageClientMsg, UserJoinServerMsg, WebsocketCloseCodes, assertNever, b64decode, comparePosition, deprecate, deprecateIf, errorIf, isAppOnlyAuthToken, isAuthToken, isChildCrdt, isRoomAuthToken, isRootCrdt, isScope, lsonToJson, makePosition, parseAuthToken, patchImmutableObject, patchLiveObjectKey, throwUsageError, tryParseJson };
|
|
387
|
+
export { AppOnlyAuthToken, AuthToken, BroadcastEventClientMsg, ClientMsg, ClientMsgCode, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateRegisterOp, CreateRootObjectOp, DeleteCrdtOp, DeleteObjectKeyOp, FetchStorageClientMsg, IdTuple, InitialDocumentStateServerMsg, NodeMap, Op, OpCode, ParentToChildNodeMap, RoomAuthToken, RoomStateServerMsg, Scope, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, UpdateObjectOp, UpdatePresenceClientMsg, UpdateStorageClientMsg, UserJoinServerMsg, WebsocketCloseCodes, assertNever, b64decode, comparePosition, deprecate, deprecateIf, errorIf, isAppOnlyAuthToken, isAuthToken, isChildCrdt, isPlainObject, isRoomAuthToken, isRootCrdt, isScope, lsonToJson, makePosition, parseAuthToken, patchImmutableObject, patchLiveObjectKey, throwUsageError, tryParseJson };
|
package/internal.js
CHANGED
|
@@ -17,7 +17,7 @@ function isAppOnlyAuthToken(data) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function isRoomAuthToken(data) {
|
|
20
|
-
return "string" == typeof data.appId && "string" == typeof data.roomId && "number" == typeof data.actor && (void 0 === data.id || "string" == typeof data.id) && isStringList(data.scopes) &&
|
|
20
|
+
return "string" == typeof data.appId && "string" == typeof data.roomId && "number" == typeof data.actor && (void 0 === data.id || "string" == typeof data.id) && isStringList(data.scopes) && (void 0 === data.maxConnectionsPerRoom || "number" == typeof data.maxConnectionsPerRoom);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function isAuthToken(data) {
|
|
@@ -200,10 +200,10 @@ exports.comparePosition = LiveObject.comparePosition, exports.deprecate = LiveOb
|
|
|
200
200
|
exports.deprecateIf = LiveObject.deprecateIf, exports.errorIf = LiveObject.errorIf,
|
|
201
201
|
exports.isChildCrdt = LiveObject.isChildCrdt, exports.isJsonArray = LiveObject.isJsonArray,
|
|
202
202
|
exports.isJsonObject = LiveObject.isJsonObject, exports.isJsonScalar = LiveObject.isJsonScalar,
|
|
203
|
-
exports.
|
|
204
|
-
exports.
|
|
205
|
-
exports.
|
|
206
|
-
exports.isRoomAuthToken = isRoomAuthToken, exports.isScope = function(value) {
|
|
203
|
+
exports.isPlainObject = LiveObject.isPlainObject, exports.isRootCrdt = LiveObject.isRootCrdt,
|
|
204
|
+
exports.makePosition = LiveObject.makePosition, exports.throwUsageError = LiveObject.throwUsageError,
|
|
205
|
+
exports.tryParseJson = LiveObject.tryParseJson, exports.isAppOnlyAuthToken = isAppOnlyAuthToken,
|
|
206
|
+
exports.isAuthToken = isAuthToken, exports.isRoomAuthToken = isRoomAuthToken, exports.isScope = function(value) {
|
|
207
207
|
return SCOPES.includes(value);
|
|
208
208
|
}, exports.lsonToJson = lsonToJson, exports.parseAuthToken = function(token) {
|
|
209
209
|
var data = parseJwtToken(token);
|
package/internal.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as tryParseJson, e as b64decode, l as isPlainObject$1, L as LiveObject, b as LiveList, k as LiveMap, n as LiveRegister, A as AbstractCrdt, o as findNonSerializableValue } from "./shared.mjs";
|
|
2
2
|
|
|
3
|
-
export { C as ClientMsgCode, u as CrdtType, O as OpCode, S as ServerMsgCode, W as WebsocketCloseCodes, y as assertNever, e as b64decode, v as comparePosition, p as deprecate, j as deprecateIf, q as errorIf, x as isChildCrdt, c as isJsonArray, f as isJsonObject, z as isJsonScalar, h as isRootCrdt, w as makePosition, s as throwUsageError, t as tryParseJson } from "./shared.mjs";
|
|
3
|
+
export { C as ClientMsgCode, u as CrdtType, O as OpCode, S as ServerMsgCode, W as WebsocketCloseCodes, y as assertNever, e as b64decode, v as comparePosition, p as deprecate, j as deprecateIf, q as errorIf, x as isChildCrdt, c as isJsonArray, f as isJsonObject, z as isJsonScalar, l as isPlainObject, h as isRootCrdt, w as makePosition, s as throwUsageError, t as tryParseJson } from "./shared.mjs";
|
|
4
4
|
|
|
5
5
|
const SCOPES = [ "websocket:presence", "websocket:storage", "room:read", "room:write", "rooms:read", "rooms:write" ];
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ function isAppOnlyAuthToken(data) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function isRoomAuthToken(data) {
|
|
20
|
-
return "string" == typeof data.appId && "string" == typeof data.roomId && "number" == typeof data.actor && (void 0 === data.id || "string" == typeof data.id) && isStringList(data.scopes) &&
|
|
20
|
+
return "string" == typeof data.appId && "string" == typeof data.roomId && "number" == typeof data.actor && (void 0 === data.id || "string" == typeof data.id) && isStringList(data.scopes) && (void 0 === data.maxConnectionsPerRoom || "number" == typeof data.maxConnectionsPerRoom);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function isAuthToken(data) {
|