@liveblocks/core 1.5.2 → 1.5.3-test1
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 +2 -10
- package/dist/index.d.ts +2 -10
- package/dist/index.js +15 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -41,7 +41,7 @@ declare enum OpCode {
|
|
|
41
41
|
* only.
|
|
42
42
|
*/
|
|
43
43
|
declare type Op = AckOp | CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
|
|
44
|
-
declare type CreateOp =
|
|
44
|
+
declare type CreateOp = CreateChildOp;
|
|
45
45
|
declare type CreateChildOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
|
|
46
46
|
declare type UpdateObjectOp = {
|
|
47
47
|
readonly opId?: string;
|
|
@@ -59,14 +59,6 @@ declare type CreateObjectOp = {
|
|
|
59
59
|
readonly parentKey: string;
|
|
60
60
|
readonly data: JsonObject;
|
|
61
61
|
};
|
|
62
|
-
declare type CreateRootObjectOp = {
|
|
63
|
-
readonly opId?: string;
|
|
64
|
-
readonly id: string;
|
|
65
|
-
readonly type: OpCode.CREATE_OBJECT;
|
|
66
|
-
readonly data: JsonObject;
|
|
67
|
-
readonly parentId?: never;
|
|
68
|
-
readonly parentKey?: never;
|
|
69
|
-
};
|
|
70
62
|
declare type CreateListOp = {
|
|
71
63
|
readonly opId?: string;
|
|
72
64
|
readonly id: string;
|
|
@@ -2438,4 +2430,4 @@ declare type EnsureJson<T> = [
|
|
|
2438
2430
|
[K in keyof T]: EnsureJson<T[K]>;
|
|
2439
2431
|
};
|
|
2440
2432
|
|
|
2441
|
-
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp,
|
|
2433
|
+
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare enum OpCode {
|
|
|
41
41
|
* only.
|
|
42
42
|
*/
|
|
43
43
|
declare type Op = AckOp | CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
|
|
44
|
-
declare type CreateOp =
|
|
44
|
+
declare type CreateOp = CreateChildOp;
|
|
45
45
|
declare type CreateChildOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
|
|
46
46
|
declare type UpdateObjectOp = {
|
|
47
47
|
readonly opId?: string;
|
|
@@ -59,14 +59,6 @@ declare type CreateObjectOp = {
|
|
|
59
59
|
readonly parentKey: string;
|
|
60
60
|
readonly data: JsonObject;
|
|
61
61
|
};
|
|
62
|
-
declare type CreateRootObjectOp = {
|
|
63
|
-
readonly opId?: string;
|
|
64
|
-
readonly id: string;
|
|
65
|
-
readonly type: OpCode.CREATE_OBJECT;
|
|
66
|
-
readonly data: JsonObject;
|
|
67
|
-
readonly parentId?: never;
|
|
68
|
-
readonly parentKey?: never;
|
|
69
|
-
};
|
|
70
62
|
declare type CreateListOp = {
|
|
71
63
|
readonly opId?: string;
|
|
72
64
|
readonly id: string;
|
|
@@ -2438,4 +2430,4 @@ declare type EnsureJson<T> = [
|
|
|
2438
2430
|
[K in keyof T]: EnsureJson<T[K]>;
|
|
2439
2431
|
};
|
|
2440
2432
|
|
|
2441
|
-
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp,
|
|
2433
|
+
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
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 = "1.5.
|
|
9
|
+
var PKG_VERSION = "1.5.3-test1";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3759,17 +3759,14 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
3759
3759
|
}
|
|
3760
3760
|
const opId = _optionalChain([pool, 'optionalAccess', _102 => _102.generateOpId, 'call', _103 => _103()]);
|
|
3761
3761
|
const ops = [];
|
|
3762
|
-
const op =
|
|
3762
|
+
const op = {
|
|
3763
3763
|
type: 4 /* CREATE_OBJECT */,
|
|
3764
3764
|
id: this._id,
|
|
3765
3765
|
opId,
|
|
3766
3766
|
parentId,
|
|
3767
3767
|
parentKey,
|
|
3768
3768
|
data: {}
|
|
3769
|
-
}
|
|
3770
|
-
// Root object
|
|
3771
|
-
{ type: 4 /* CREATE_OBJECT */, id: this._id, opId, data: {} }
|
|
3772
|
-
);
|
|
3769
|
+
};
|
|
3773
3770
|
ops.push(op);
|
|
3774
3771
|
for (const [key, value] of this._map) {
|
|
3775
3772
|
if (isLiveNode(value)) {
|
|
@@ -4377,18 +4374,18 @@ function getTreesDiffOperations(currentItems, newItems) {
|
|
|
4377
4374
|
});
|
|
4378
4375
|
break;
|
|
4379
4376
|
case 0 /* OBJECT */:
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
);
|
|
4377
|
+
if (crdt.parentId === void 0 || crdt.parentKey === void 0) {
|
|
4378
|
+
throw new Error(
|
|
4379
|
+
"Internal error. Cannot serialize storage root into an operation"
|
|
4380
|
+
);
|
|
4381
|
+
}
|
|
4382
|
+
ops.push({
|
|
4383
|
+
type: 4 /* CREATE_OBJECT */,
|
|
4384
|
+
id,
|
|
4385
|
+
parentId: crdt.parentId,
|
|
4386
|
+
parentKey: crdt.parentKey,
|
|
4387
|
+
data: crdt.data
|
|
4388
|
+
});
|
|
4392
4389
|
break;
|
|
4393
4390
|
case 2 /* MAP */:
|
|
4394
4391
|
ops.push({
|