json-patch-to-crdt 0.1.1 → 0.1.2
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/README.md +71 -1
- package/dist/{merge-CKcP1ZPt.mjs → compact-BJBGW9tC.mjs} +795 -200
- package/dist/{merge-BAfuC6bf.js → compact-CkLd4Yh5.js} +836 -199
- package/dist/{merge-B8nmGV-o.d.ts → depth-p6fX9Ak7.d.ts} +83 -3
- package/dist/{merge-DQ_KDtnE.d.mts → depth-wDeQ1hO1.d.mts} +83 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -16
- package/dist/index.mjs +2 -2
- package/dist/internals.d.mts +15 -3
- package/dist/internals.d.ts +15 -3
- package/dist/internals.js +65 -58
- package/dist/internals.mjs +2 -2
- package/package.json +12 -2
|
@@ -92,6 +92,8 @@ type SerializedState = {
|
|
|
92
92
|
doc: SerializedDoc;
|
|
93
93
|
clock: SerializedClock;
|
|
94
94
|
};
|
|
95
|
+
/** Typed reasons for rejecting malformed serialized CRDT payloads. */
|
|
96
|
+
type DeserializeErrorReason = "INVALID_SERIALIZED_SHAPE" | "INVALID_SERIALIZED_INVARIANT";
|
|
95
97
|
/**
|
|
96
98
|
* Internal intent operations produced by compiling RFC 6902 JSON Patch ops.
|
|
97
99
|
* Each variant maps to a specific CRDT mutation.
|
|
@@ -181,7 +183,7 @@ type ApplyPatchAsActorOptions = {
|
|
|
181
183
|
semantics?: PatchSemantics;
|
|
182
184
|
};
|
|
183
185
|
/** Typed failure reason used across patch/merge helpers. */
|
|
184
|
-
type PatchErrorReason = "INVALID_PATCH" | "INVALID_POINTER" | "MISSING_PARENT" | "MISSING_TARGET" | "INVALID_TARGET" | "OUT_OF_BOUNDS" | "TEST_FAILED" | "INVALID_MOVE" | "LINEAGE_MISMATCH";
|
|
186
|
+
type PatchErrorReason = "INVALID_PATCH" | "INVALID_POINTER" | "MISSING_PARENT" | "MISSING_TARGET" | "INVALID_TARGET" | "OUT_OF_BOUNDS" | "TEST_FAILED" | "INVALID_MOVE" | "DOT_GENERATION_EXHAUSTED" | "MAX_DEPTH_EXCEEDED" | "LINEAGE_MISMATCH";
|
|
185
187
|
/** Structured conflict payload used by non-throwing APIs. */
|
|
186
188
|
type ApplyError = {
|
|
187
189
|
ok: false; /** HTTP-friendly status code for conflict-style failures. */
|
|
@@ -275,6 +277,34 @@ type TryMergeStateResult = {
|
|
|
275
277
|
ok: false;
|
|
276
278
|
error: ApplyError;
|
|
277
279
|
};
|
|
280
|
+
/** Options for tombstone compaction helpers. */
|
|
281
|
+
type TombstoneCompactionOptions = {
|
|
282
|
+
/**
|
|
283
|
+
* Causally stable checkpoint. Only tombstones at or below this checkpoint
|
|
284
|
+
* are candidates for pruning.
|
|
285
|
+
*/
|
|
286
|
+
stable: VersionVector;
|
|
287
|
+
/**
|
|
288
|
+
* Mutate the input value in place.
|
|
289
|
+
* Defaults to `false` (immutable output).
|
|
290
|
+
*/
|
|
291
|
+
mutate?: boolean;
|
|
292
|
+
};
|
|
293
|
+
/** Counts emitted by tombstone compaction helpers. */
|
|
294
|
+
type TombstoneCompactionStats = {
|
|
295
|
+
objectTombstonesRemoved: number;
|
|
296
|
+
sequenceTombstonesRemoved: number;
|
|
297
|
+
};
|
|
298
|
+
/** Result for `compactDocTombstones`. */
|
|
299
|
+
type CompactDocTombstonesResult = {
|
|
300
|
+
doc: Doc;
|
|
301
|
+
stats: TombstoneCompactionStats;
|
|
302
|
+
};
|
|
303
|
+
/** Result for `compactStateTombstones`. */
|
|
304
|
+
type CompactStateTombstonesResult = {
|
|
305
|
+
state: CrdtState;
|
|
306
|
+
stats: TombstoneCompactionStats;
|
|
307
|
+
};
|
|
278
308
|
/** Options-object overload shape for low-level JSON Patch -> CRDT conversion. */
|
|
279
309
|
type JsonPatchToCrdtOptions = {
|
|
280
310
|
base: Doc;
|
|
@@ -287,7 +317,19 @@ type JsonPatchToCrdtOptions = {
|
|
|
287
317
|
};
|
|
288
318
|
/** Options for `crdtToJsonPatch` and `diffJsonPatch`. */
|
|
289
319
|
type DiffOptions = {
|
|
320
|
+
/**
|
|
321
|
+
* Array diff mode.
|
|
322
|
+
* - `"lcs"` (default): index-level edits using LCS.
|
|
323
|
+
* - `"atomic"`: one-op root/field replacement for changed arrays.
|
|
324
|
+
*/
|
|
290
325
|
arrayStrategy?: "atomic" | "lcs";
|
|
326
|
+
/**
|
|
327
|
+
* Maximum LCS matrix cells (`(base.length + 1) * (next.length + 1)`) before
|
|
328
|
+
* falling back to atomic replacement. Defaults to `250_000`.
|
|
329
|
+
*
|
|
330
|
+
* Set to `Number.POSITIVE_INFINITY` to always allow LCS.
|
|
331
|
+
*/
|
|
332
|
+
lcsMaxCells?: number;
|
|
291
333
|
};
|
|
292
334
|
/**
|
|
293
335
|
* Internal sentinel key used in `IntentOp` to represent root-level operations.
|
|
@@ -403,6 +445,12 @@ declare function diffJsonPatch(base: JsonValue, next: JsonValue, options?: DiffO
|
|
|
403
445
|
declare function jsonEquals(a: JsonValue, b: JsonValue): boolean;
|
|
404
446
|
//#endregion
|
|
405
447
|
//#region src/serialize.d.ts
|
|
448
|
+
declare class DeserializeError extends Error {
|
|
449
|
+
readonly code: 409;
|
|
450
|
+
readonly reason: DeserializeErrorReason;
|
|
451
|
+
readonly path: string;
|
|
452
|
+
constructor(reason: DeserializeErrorReason, path: string, message: string);
|
|
453
|
+
}
|
|
406
454
|
/** Serialize a CRDT document to a JSON-safe representation (Maps become plain objects). */
|
|
407
455
|
declare function serializeDoc(doc: Doc): SerializedDoc;
|
|
408
456
|
/** Reconstruct a CRDT document from its serialized form. */
|
|
@@ -416,7 +464,7 @@ declare function deserializeState(data: SerializedState): CrdtState;
|
|
|
416
464
|
/** Error thrown by throwing merge helpers (`mergeDoc` / `mergeState`). */
|
|
417
465
|
declare class MergeError extends Error {
|
|
418
466
|
readonly code: 409;
|
|
419
|
-
readonly reason:
|
|
467
|
+
readonly reason: PatchErrorReason;
|
|
420
468
|
readonly path?: string;
|
|
421
469
|
constructor(error: ApplyError);
|
|
422
470
|
}
|
|
@@ -451,4 +499,36 @@ declare function mergeState(a: CrdtState, b: CrdtState, options?: MergeStateOpti
|
|
|
451
499
|
/** Non-throwing `mergeState` variant with structured conflict details. */
|
|
452
500
|
declare function tryMergeState(a: CrdtState, b: CrdtState, options?: MergeStateOptions): TryMergeStateResult;
|
|
453
501
|
//#endregion
|
|
454
|
-
|
|
502
|
+
//#region src/compact.d.ts
|
|
503
|
+
/**
|
|
504
|
+
* Compact causally-stable tombstones in a document.
|
|
505
|
+
*
|
|
506
|
+
* Safety note:
|
|
507
|
+
* - Only compact at checkpoints that are causally stable across all peers you
|
|
508
|
+
* may still merge with.
|
|
509
|
+
* - Do not merge this compacted document with replicas that might be behind
|
|
510
|
+
* the provided checkpoint.
|
|
511
|
+
*/
|
|
512
|
+
declare function compactDocTombstones(doc: Doc, options: TombstoneCompactionOptions): CompactDocTombstonesResult;
|
|
513
|
+
/**
|
|
514
|
+
* Compact causally-stable tombstones in a state document.
|
|
515
|
+
*
|
|
516
|
+
* Safety note:
|
|
517
|
+
* - Only compact at checkpoints that are causally stable across all peers you
|
|
518
|
+
* may still merge with.
|
|
519
|
+
* - Do not merge this compacted state with replicas that might be behind the
|
|
520
|
+
* provided checkpoint.
|
|
521
|
+
*/
|
|
522
|
+
declare function compactStateTombstones(state: CrdtState, options: TombstoneCompactionOptions): CompactStateTombstonesResult;
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/depth.d.ts
|
|
525
|
+
declare const MAX_TRAVERSAL_DEPTH = 16384;
|
|
526
|
+
declare class TraversalDepthError extends Error {
|
|
527
|
+
readonly code: 409;
|
|
528
|
+
readonly reason: "MAX_DEPTH_EXCEEDED";
|
|
529
|
+
readonly depth: number;
|
|
530
|
+
readonly maxDepth: number;
|
|
531
|
+
constructor(depth: number, maxDepth?: number);
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
export { JsonPatchToCrdtOptions as $, tryApplyPatchInPlace as A, CompactDocTombstonesResult as B, applyPatch as C, TryMergeStateResult as Ct, forkState as D, createState as E, ApplyPatchAsActorResult as F, DiffOptions as G, CompilePatchOptions as H, ApplyPatchInPlaceOptions as I, ElemId as J, Doc as K, ApplyPatchOptions as L, ActorId as M, ApplyError as N, toJson as O, ApplyPatchAsActorOptions as P, JsonPatchOp as Q, ApplyResult as R, PatchError as S, TryMergeDocResult as St, applyPatchInPlace as T, VersionVector as Tt, CrdtState as U, CompactStateTombstonesResult as V, DeserializeErrorReason as W, IntentOp as X, ForkStateOptions as Y, JsonPatch as Z, diffJsonPatch as _, SerializedState as _t, MergeError as a, Node as at, parseJsonPointer as b, TryApplyPatchInPlaceResult as bt, tryMergeDoc as c, PatchErrorReason as ct, deserializeDoc as d, RgaElem as dt, JsonPrimitive as et, deserializeState as f, RgaSeq as ft, compileJsonPatchToIntent as g, SerializedRgaElem as gt, PatchCompileError as h, SerializedNode as ht, compactStateTombstones as i, MergeStateOptions as it, validateJsonPatch as j, tryApplyPatch as k, tryMergeState as l, PatchSemantics as lt, serializeState as m, SerializedDoc as mt, TraversalDepthError as n, LwwReg as nt, mergeDoc as o, ObjEntry as ot, serializeDoc as p, SerializedClock as pt, Dot as q, compactDocTombstones as r, MergeDocOptions as rt, mergeState as s, ObjNode as st, MAX_TRAVERSAL_DEPTH as t, JsonValue as tt, DeserializeError as u, ROOT_KEY as ut, getAtJson as v, TombstoneCompactionOptions as vt, applyPatchAsActor as w, ValidatePatchResult as wt, stringifyJsonPointer as x, TryApplyPatchResult as xt, jsonEquals as y, TombstoneCompactionStats as yt, Clock as z };
|
|
@@ -92,6 +92,8 @@ type SerializedState = {
|
|
|
92
92
|
doc: SerializedDoc;
|
|
93
93
|
clock: SerializedClock;
|
|
94
94
|
};
|
|
95
|
+
/** Typed reasons for rejecting malformed serialized CRDT payloads. */
|
|
96
|
+
type DeserializeErrorReason = "INVALID_SERIALIZED_SHAPE" | "INVALID_SERIALIZED_INVARIANT";
|
|
95
97
|
/**
|
|
96
98
|
* Internal intent operations produced by compiling RFC 6902 JSON Patch ops.
|
|
97
99
|
* Each variant maps to a specific CRDT mutation.
|
|
@@ -181,7 +183,7 @@ type ApplyPatchAsActorOptions = {
|
|
|
181
183
|
semantics?: PatchSemantics;
|
|
182
184
|
};
|
|
183
185
|
/** Typed failure reason used across patch/merge helpers. */
|
|
184
|
-
type PatchErrorReason = "INVALID_PATCH" | "INVALID_POINTER" | "MISSING_PARENT" | "MISSING_TARGET" | "INVALID_TARGET" | "OUT_OF_BOUNDS" | "TEST_FAILED" | "INVALID_MOVE" | "LINEAGE_MISMATCH";
|
|
186
|
+
type PatchErrorReason = "INVALID_PATCH" | "INVALID_POINTER" | "MISSING_PARENT" | "MISSING_TARGET" | "INVALID_TARGET" | "OUT_OF_BOUNDS" | "TEST_FAILED" | "INVALID_MOVE" | "DOT_GENERATION_EXHAUSTED" | "MAX_DEPTH_EXCEEDED" | "LINEAGE_MISMATCH";
|
|
185
187
|
/** Structured conflict payload used by non-throwing APIs. */
|
|
186
188
|
type ApplyError = {
|
|
187
189
|
ok: false; /** HTTP-friendly status code for conflict-style failures. */
|
|
@@ -275,6 +277,34 @@ type TryMergeStateResult = {
|
|
|
275
277
|
ok: false;
|
|
276
278
|
error: ApplyError;
|
|
277
279
|
};
|
|
280
|
+
/** Options for tombstone compaction helpers. */
|
|
281
|
+
type TombstoneCompactionOptions = {
|
|
282
|
+
/**
|
|
283
|
+
* Causally stable checkpoint. Only tombstones at or below this checkpoint
|
|
284
|
+
* are candidates for pruning.
|
|
285
|
+
*/
|
|
286
|
+
stable: VersionVector;
|
|
287
|
+
/**
|
|
288
|
+
* Mutate the input value in place.
|
|
289
|
+
* Defaults to `false` (immutable output).
|
|
290
|
+
*/
|
|
291
|
+
mutate?: boolean;
|
|
292
|
+
};
|
|
293
|
+
/** Counts emitted by tombstone compaction helpers. */
|
|
294
|
+
type TombstoneCompactionStats = {
|
|
295
|
+
objectTombstonesRemoved: number;
|
|
296
|
+
sequenceTombstonesRemoved: number;
|
|
297
|
+
};
|
|
298
|
+
/** Result for `compactDocTombstones`. */
|
|
299
|
+
type CompactDocTombstonesResult = {
|
|
300
|
+
doc: Doc;
|
|
301
|
+
stats: TombstoneCompactionStats;
|
|
302
|
+
};
|
|
303
|
+
/** Result for `compactStateTombstones`. */
|
|
304
|
+
type CompactStateTombstonesResult = {
|
|
305
|
+
state: CrdtState;
|
|
306
|
+
stats: TombstoneCompactionStats;
|
|
307
|
+
};
|
|
278
308
|
/** Options-object overload shape for low-level JSON Patch -> CRDT conversion. */
|
|
279
309
|
type JsonPatchToCrdtOptions = {
|
|
280
310
|
base: Doc;
|
|
@@ -287,7 +317,19 @@ type JsonPatchToCrdtOptions = {
|
|
|
287
317
|
};
|
|
288
318
|
/** Options for `crdtToJsonPatch` and `diffJsonPatch`. */
|
|
289
319
|
type DiffOptions = {
|
|
320
|
+
/**
|
|
321
|
+
* Array diff mode.
|
|
322
|
+
* - `"lcs"` (default): index-level edits using LCS.
|
|
323
|
+
* - `"atomic"`: one-op root/field replacement for changed arrays.
|
|
324
|
+
*/
|
|
290
325
|
arrayStrategy?: "atomic" | "lcs";
|
|
326
|
+
/**
|
|
327
|
+
* Maximum LCS matrix cells (`(base.length + 1) * (next.length + 1)`) before
|
|
328
|
+
* falling back to atomic replacement. Defaults to `250_000`.
|
|
329
|
+
*
|
|
330
|
+
* Set to `Number.POSITIVE_INFINITY` to always allow LCS.
|
|
331
|
+
*/
|
|
332
|
+
lcsMaxCells?: number;
|
|
291
333
|
};
|
|
292
334
|
/**
|
|
293
335
|
* Internal sentinel key used in `IntentOp` to represent root-level operations.
|
|
@@ -403,6 +445,12 @@ declare function diffJsonPatch(base: JsonValue, next: JsonValue, options?: DiffO
|
|
|
403
445
|
declare function jsonEquals(a: JsonValue, b: JsonValue): boolean;
|
|
404
446
|
//#endregion
|
|
405
447
|
//#region src/serialize.d.ts
|
|
448
|
+
declare class DeserializeError extends Error {
|
|
449
|
+
readonly code: 409;
|
|
450
|
+
readonly reason: DeserializeErrorReason;
|
|
451
|
+
readonly path: string;
|
|
452
|
+
constructor(reason: DeserializeErrorReason, path: string, message: string);
|
|
453
|
+
}
|
|
406
454
|
/** Serialize a CRDT document to a JSON-safe representation (Maps become plain objects). */
|
|
407
455
|
declare function serializeDoc(doc: Doc): SerializedDoc;
|
|
408
456
|
/** Reconstruct a CRDT document from its serialized form. */
|
|
@@ -416,7 +464,7 @@ declare function deserializeState(data: SerializedState): CrdtState;
|
|
|
416
464
|
/** Error thrown by throwing merge helpers (`mergeDoc` / `mergeState`). */
|
|
417
465
|
declare class MergeError extends Error {
|
|
418
466
|
readonly code: 409;
|
|
419
|
-
readonly reason:
|
|
467
|
+
readonly reason: PatchErrorReason;
|
|
420
468
|
readonly path?: string;
|
|
421
469
|
constructor(error: ApplyError);
|
|
422
470
|
}
|
|
@@ -451,4 +499,36 @@ declare function mergeState(a: CrdtState, b: CrdtState, options?: MergeStateOpti
|
|
|
451
499
|
/** Non-throwing `mergeState` variant with structured conflict details. */
|
|
452
500
|
declare function tryMergeState(a: CrdtState, b: CrdtState, options?: MergeStateOptions): TryMergeStateResult;
|
|
453
501
|
//#endregion
|
|
454
|
-
|
|
502
|
+
//#region src/compact.d.ts
|
|
503
|
+
/**
|
|
504
|
+
* Compact causally-stable tombstones in a document.
|
|
505
|
+
*
|
|
506
|
+
* Safety note:
|
|
507
|
+
* - Only compact at checkpoints that are causally stable across all peers you
|
|
508
|
+
* may still merge with.
|
|
509
|
+
* - Do not merge this compacted document with replicas that might be behind
|
|
510
|
+
* the provided checkpoint.
|
|
511
|
+
*/
|
|
512
|
+
declare function compactDocTombstones(doc: Doc, options: TombstoneCompactionOptions): CompactDocTombstonesResult;
|
|
513
|
+
/**
|
|
514
|
+
* Compact causally-stable tombstones in a state document.
|
|
515
|
+
*
|
|
516
|
+
* Safety note:
|
|
517
|
+
* - Only compact at checkpoints that are causally stable across all peers you
|
|
518
|
+
* may still merge with.
|
|
519
|
+
* - Do not merge this compacted state with replicas that might be behind the
|
|
520
|
+
* provided checkpoint.
|
|
521
|
+
*/
|
|
522
|
+
declare function compactStateTombstones(state: CrdtState, options: TombstoneCompactionOptions): CompactStateTombstonesResult;
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/depth.d.ts
|
|
525
|
+
declare const MAX_TRAVERSAL_DEPTH = 16384;
|
|
526
|
+
declare class TraversalDepthError extends Error {
|
|
527
|
+
readonly code: 409;
|
|
528
|
+
readonly reason: "MAX_DEPTH_EXCEEDED";
|
|
529
|
+
readonly depth: number;
|
|
530
|
+
readonly maxDepth: number;
|
|
531
|
+
constructor(depth: number, maxDepth?: number);
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
export { JsonPatchToCrdtOptions as $, tryApplyPatchInPlace as A, CompactDocTombstonesResult as B, applyPatch as C, TryMergeStateResult as Ct, forkState as D, createState as E, ApplyPatchAsActorResult as F, DiffOptions as G, CompilePatchOptions as H, ApplyPatchInPlaceOptions as I, ElemId as J, Doc as K, ApplyPatchOptions as L, ActorId as M, ApplyError as N, toJson as O, ApplyPatchAsActorOptions as P, JsonPatchOp as Q, ApplyResult as R, PatchError as S, TryMergeDocResult as St, applyPatchInPlace as T, VersionVector as Tt, CrdtState as U, CompactStateTombstonesResult as V, DeserializeErrorReason as W, IntentOp as X, ForkStateOptions as Y, JsonPatch as Z, diffJsonPatch as _, SerializedState as _t, MergeError as a, Node as at, parseJsonPointer as b, TryApplyPatchInPlaceResult as bt, tryMergeDoc as c, PatchErrorReason as ct, deserializeDoc as d, RgaElem as dt, JsonPrimitive as et, deserializeState as f, RgaSeq as ft, compileJsonPatchToIntent as g, SerializedRgaElem as gt, PatchCompileError as h, SerializedNode as ht, compactStateTombstones as i, MergeStateOptions as it, validateJsonPatch as j, tryApplyPatch as k, tryMergeState as l, PatchSemantics as lt, serializeState as m, SerializedDoc as mt, TraversalDepthError as n, LwwReg as nt, mergeDoc as o, ObjEntry as ot, serializeDoc as p, SerializedClock as pt, Dot as q, compactDocTombstones as r, MergeDocOptions as rt, mergeState as s, ObjNode as st, MAX_TRAVERSAL_DEPTH as t, JsonValue as tt, DeserializeError as u, ROOT_KEY as ut, getAtJson as v, TombstoneCompactionOptions as vt, applyPatchAsActor as w, ValidatePatchResult as wt, stringifyJsonPointer as x, TryApplyPatchResult as xt, jsonEquals as y, TombstoneCompactionStats as yt, Clock as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, type CrdtState, type DiffOptions, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValue, MergeError, type MergeStateOptions, PatchError, type PatchErrorReason, type PatchSemantics, type SerializedState, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryMergeStateResult, type ValidatePatchResult, applyPatch, applyPatchInPlace, createState, deserializeState, diffJsonPatch, forkState, mergeState, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryMergeState, validateJsonPatch };
|
|
1
|
+
import { A as tryApplyPatchInPlace, C as applyPatch, Ct as TryMergeStateResult, D as forkState, E as createState, G as DiffOptions, I as ApplyPatchInPlaceOptions, L as ApplyPatchOptions, M as ActorId, N as ApplyError, O as toJson, Q as JsonPatchOp, S as PatchError, T as applyPatchInPlace, U as CrdtState, V as CompactStateTombstonesResult, W as DeserializeErrorReason, Y as ForkStateOptions, Z as JsonPatch, _ as diffJsonPatch, _t as SerializedState, a as MergeError, bt as TryApplyPatchInPlaceResult, ct as PatchErrorReason, et as JsonPrimitive, f as deserializeState, i as compactStateTombstones, it as MergeStateOptions, j as validateJsonPatch, k as tryApplyPatch, l as tryMergeState, lt as PatchSemantics, m as serializeState, n as TraversalDepthError, s as mergeState, t as MAX_TRAVERSAL_DEPTH, tt as JsonValue, u as DeserializeError, vt as TombstoneCompactionOptions, wt as ValidatePatchResult, xt as TryApplyPatchResult, yt as TombstoneCompactionStats } from "./depth-wDeQ1hO1.mjs";
|
|
2
|
+
export { type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, type CompactStateTombstonesResult, type CrdtState, DeserializeError, type DeserializeErrorReason, type DiffOptions, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValue, MAX_TRAVERSAL_DEPTH, MergeError, type MergeStateOptions, PatchError, type PatchErrorReason, type PatchSemantics, type SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryMergeStateResult, type ValidatePatchResult, applyPatch, applyPatchInPlace, compactStateTombstones, createState, deserializeState, diffJsonPatch, forkState, mergeState, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryMergeState, validateJsonPatch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, type CrdtState, type DiffOptions, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValue, MergeError, type MergeStateOptions, PatchError, type PatchErrorReason, type PatchSemantics, type SerializedState, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryMergeStateResult, type ValidatePatchResult, applyPatch, applyPatchInPlace, createState, deserializeState, diffJsonPatch, forkState, mergeState, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryMergeState, validateJsonPatch };
|
|
1
|
+
import { A as tryApplyPatchInPlace, C as applyPatch, Ct as TryMergeStateResult, D as forkState, E as createState, G as DiffOptions, I as ApplyPatchInPlaceOptions, L as ApplyPatchOptions, M as ActorId, N as ApplyError, O as toJson, Q as JsonPatchOp, S as PatchError, T as applyPatchInPlace, U as CrdtState, V as CompactStateTombstonesResult, W as DeserializeErrorReason, Y as ForkStateOptions, Z as JsonPatch, _ as diffJsonPatch, _t as SerializedState, a as MergeError, bt as TryApplyPatchInPlaceResult, ct as PatchErrorReason, et as JsonPrimitive, f as deserializeState, i as compactStateTombstones, it as MergeStateOptions, j as validateJsonPatch, k as tryApplyPatch, l as tryMergeState, lt as PatchSemantics, m as serializeState, n as TraversalDepthError, s as mergeState, t as MAX_TRAVERSAL_DEPTH, tt as JsonValue, u as DeserializeError, vt as TombstoneCompactionOptions, wt as ValidatePatchResult, xt as TryApplyPatchResult, yt as TombstoneCompactionStats } from "./depth-p6fX9Ak7.js";
|
|
2
|
+
export { type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, type CompactStateTombstonesResult, type CrdtState, DeserializeError, type DeserializeErrorReason, type DiffOptions, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValue, MAX_TRAVERSAL_DEPTH, MergeError, type MergeStateOptions, PatchError, type PatchErrorReason, type PatchSemantics, type SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryMergeStateResult, type ValidatePatchResult, applyPatch, applyPatchInPlace, compactStateTombstones, createState, deserializeState, diffJsonPatch, forkState, mergeState, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryMergeState, validateJsonPatch };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_compact = require('./compact-CkLd4Yh5.js');
|
|
3
3
|
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
4
|
+
exports.DeserializeError = require_compact.DeserializeError;
|
|
5
|
+
exports.MAX_TRAVERSAL_DEPTH = require_compact.MAX_TRAVERSAL_DEPTH;
|
|
6
|
+
exports.MergeError = require_compact.MergeError;
|
|
7
|
+
exports.PatchError = require_compact.PatchError;
|
|
8
|
+
exports.TraversalDepthError = require_compact.TraversalDepthError;
|
|
9
|
+
exports.applyPatch = require_compact.applyPatch;
|
|
10
|
+
exports.applyPatchInPlace = require_compact.applyPatchInPlace;
|
|
11
|
+
exports.compactStateTombstones = require_compact.compactStateTombstones;
|
|
12
|
+
exports.createState = require_compact.createState;
|
|
13
|
+
exports.deserializeState = require_compact.deserializeState;
|
|
14
|
+
exports.diffJsonPatch = require_compact.diffJsonPatch;
|
|
15
|
+
exports.forkState = require_compact.forkState;
|
|
16
|
+
exports.mergeState = require_compact.mergeState;
|
|
17
|
+
exports.serializeState = require_compact.serializeState;
|
|
18
|
+
exports.toJson = require_compact.toJson;
|
|
19
|
+
exports.tryApplyPatch = require_compact.tryApplyPatch;
|
|
20
|
+
exports.tryApplyPatchInPlace = require_compact.tryApplyPatchInPlace;
|
|
21
|
+
exports.tryMergeState = require_compact.tryMergeState;
|
|
22
|
+
exports.validateJsonPatch = require_compact.validateJsonPatch;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { P as diffJsonPatch, S as validateJsonPatch, _ as createState, a as mergeState, at as MAX_TRAVERSAL_DEPTH, b as tryApplyPatch, c as DeserializeError, f as serializeState, g as applyPatchInPlace, m as applyPatch, n as compactStateTombstones, ot as TraversalDepthError, p as PatchError, r as MergeError, s as tryMergeState, u as deserializeState, v as forkState, x as tryApplyPatchInPlace, y as toJson } from "./compact-BJBGW9tC.mjs";
|
|
2
2
|
|
|
3
|
-
export { MergeError, PatchError, applyPatch, applyPatchInPlace, createState, deserializeState, diffJsonPatch, forkState, mergeState, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryMergeState, validateJsonPatch };
|
|
3
|
+
export { DeserializeError, MAX_TRAVERSAL_DEPTH, MergeError, PatchError, TraversalDepthError, applyPatch, applyPatchInPlace, compactStateTombstones, createState, deserializeState, diffJsonPatch, forkState, mergeState, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryMergeState, validateJsonPatch };
|
package/dist/internals.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as JsonPatchToCrdtOptions, A as tryApplyPatchInPlace, B as CompactDocTombstonesResult, C as applyPatch, Ct as TryMergeStateResult, D as forkState, E as createState, F as ApplyPatchAsActorResult, G as DiffOptions, H as CompilePatchOptions, I as ApplyPatchInPlaceOptions, J as ElemId, K as Doc, L as ApplyPatchOptions, M as ActorId, N as ApplyError, O as toJson, P as ApplyPatchAsActorOptions, Q as JsonPatchOp, R as ApplyResult, S as PatchError, St as TryMergeDocResult, T as applyPatchInPlace, Tt as VersionVector, U as CrdtState, V as CompactStateTombstonesResult, W as DeserializeErrorReason, X as IntentOp, Y as ForkStateOptions, Z as JsonPatch, _ as diffJsonPatch, _t as SerializedState, a as MergeError, at as Node, b as parseJsonPointer, bt as TryApplyPatchInPlaceResult, c as tryMergeDoc, ct as PatchErrorReason, d as deserializeDoc, dt as RgaElem, et as JsonPrimitive, f as deserializeState, ft as RgaSeq, g as compileJsonPatchToIntent, gt as SerializedRgaElem, h as PatchCompileError, ht as SerializedNode, i as compactStateTombstones, it as MergeStateOptions, j as validateJsonPatch, k as tryApplyPatch, l as tryMergeState, lt as PatchSemantics, m as serializeState, mt as SerializedDoc, n as TraversalDepthError, nt as LwwReg, o as mergeDoc, ot as ObjEntry, p as serializeDoc, pt as SerializedClock, q as Dot, r as compactDocTombstones, rt as MergeDocOptions, s as mergeState, st as ObjNode, t as MAX_TRAVERSAL_DEPTH, tt as JsonValue, u as DeserializeError, ut as ROOT_KEY, v as getAtJson, vt as TombstoneCompactionOptions, w as applyPatchAsActor, wt as ValidatePatchResult, x as stringifyJsonPointer, xt as TryApplyPatchResult, y as jsonEquals, yt as TombstoneCompactionStats, z as Clock } from "./depth-wDeQ1hO1.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/clock.d.ts
|
|
4
4
|
/**
|
|
@@ -75,7 +75,7 @@ declare function crdtToJsonPatch(base: Doc, head: Doc, options?: DiffOptions): J
|
|
|
75
75
|
declare function crdtToFullReplace(doc: Doc): JsonPatchOp[];
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/materialize.d.ts
|
|
78
|
-
/**
|
|
78
|
+
/** Convert a CRDT node graph into a plain JSON value using an explicit stack. */
|
|
79
79
|
declare function materialize(node: Node): JsonValue;
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/dot.d.ts
|
|
@@ -91,13 +91,25 @@ declare function newReg(value: JsonValue, dot: Dot): LwwReg;
|
|
|
91
91
|
declare function lwwSet(reg: LwwReg, value: JsonValue, dot: Dot): void;
|
|
92
92
|
declare function objSet(obj: ObjNode, key: string, node: Node, dot: Dot): void;
|
|
93
93
|
declare function objRemove(obj: ObjNode, key: string, dot: Dot): void;
|
|
94
|
+
/**
|
|
95
|
+
* Prune object tombstones that satisfy a caller-provided stability predicate.
|
|
96
|
+
* Returns the number of removed tombstone records.
|
|
97
|
+
*/
|
|
98
|
+
declare function objCompactTombstones(obj: ObjNode, isStable: (dot: Dot) => boolean): number;
|
|
94
99
|
//#endregion
|
|
95
100
|
//#region src/rga.d.ts
|
|
96
101
|
declare const HEAD: ElemId;
|
|
97
102
|
declare function rgaLinearizeIds(seq: RgaSeq): ElemId[];
|
|
98
103
|
declare function rgaInsertAfter(seq: RgaSeq, prev: ElemId, id: ElemId, insDot: Dot, value: Node): void;
|
|
99
104
|
declare function rgaDelete(seq: RgaSeq, id: ElemId): void;
|
|
105
|
+
/**
|
|
106
|
+
* Prune tombstoned elements that are causally stable and have no live descendants
|
|
107
|
+
* depending on them for sequence traversal.
|
|
108
|
+
*
|
|
109
|
+
* Returns the number of removed elements.
|
|
110
|
+
*/
|
|
111
|
+
declare function rgaCompactTombstones(seq: RgaSeq, isStable: (dot: Dot) => boolean): number;
|
|
100
112
|
declare function rgaIdAtIndex(seq: RgaSeq, index: number): ElemId | undefined;
|
|
101
113
|
declare function rgaPrevForInsertAtIndex(seq: RgaSeq, index: number): ElemId;
|
|
102
114
|
//#endregion
|
|
103
|
-
export { ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, type CompilePatchOptions, CrdtState, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValue, type LwwReg, type MergeDocOptions, MergeError, MergeStateOptions, type Node, type ObjEntry, type ObjNode, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type RgaElem, type RgaSeq, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryMergeDocResult, TryMergeStateResult, ValidatePatchResult, type VersionVector, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compareDot, compileJsonPatchToIntent, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, newObj, newReg, newSeq, nextDotForActor, objRemove, objSet, observeDot, parseJsonPointer, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchInPlace, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, vvHasDot, vvMerge };
|
|
115
|
+
export { ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, type CompactDocTombstonesResult, type CompactStateTombstonesResult, type CompilePatchOptions, CrdtState, DeserializeError, DeserializeErrorReason, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValue, type LwwReg, MAX_TRAVERSAL_DEPTH, type MergeDocOptions, MergeError, MergeStateOptions, type Node, type ObjEntry, type ObjNode, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type RgaElem, type RgaSeq, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryMergeDocResult, TryMergeStateResult, ValidatePatchResult, type VersionVector, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchInPlace, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, vvHasDot, vvMerge };
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as JsonPatchToCrdtOptions, A as tryApplyPatchInPlace, B as CompactDocTombstonesResult, C as applyPatch, Ct as TryMergeStateResult, D as forkState, E as createState, F as ApplyPatchAsActorResult, G as DiffOptions, H as CompilePatchOptions, I as ApplyPatchInPlaceOptions, J as ElemId, K as Doc, L as ApplyPatchOptions, M as ActorId, N as ApplyError, O as toJson, P as ApplyPatchAsActorOptions, Q as JsonPatchOp, R as ApplyResult, S as PatchError, St as TryMergeDocResult, T as applyPatchInPlace, Tt as VersionVector, U as CrdtState, V as CompactStateTombstonesResult, W as DeserializeErrorReason, X as IntentOp, Y as ForkStateOptions, Z as JsonPatch, _ as diffJsonPatch, _t as SerializedState, a as MergeError, at as Node, b as parseJsonPointer, bt as TryApplyPatchInPlaceResult, c as tryMergeDoc, ct as PatchErrorReason, d as deserializeDoc, dt as RgaElem, et as JsonPrimitive, f as deserializeState, ft as RgaSeq, g as compileJsonPatchToIntent, gt as SerializedRgaElem, h as PatchCompileError, ht as SerializedNode, i as compactStateTombstones, it as MergeStateOptions, j as validateJsonPatch, k as tryApplyPatch, l as tryMergeState, lt as PatchSemantics, m as serializeState, mt as SerializedDoc, n as TraversalDepthError, nt as LwwReg, o as mergeDoc, ot as ObjEntry, p as serializeDoc, pt as SerializedClock, q as Dot, r as compactDocTombstones, rt as MergeDocOptions, s as mergeState, st as ObjNode, t as MAX_TRAVERSAL_DEPTH, tt as JsonValue, u as DeserializeError, ut as ROOT_KEY, v as getAtJson, vt as TombstoneCompactionOptions, w as applyPatchAsActor, wt as ValidatePatchResult, x as stringifyJsonPointer, xt as TryApplyPatchResult, y as jsonEquals, yt as TombstoneCompactionStats, z as Clock } from "./depth-p6fX9Ak7.js";
|
|
2
2
|
|
|
3
3
|
//#region src/clock.d.ts
|
|
4
4
|
/**
|
|
@@ -75,7 +75,7 @@ declare function crdtToJsonPatch(base: Doc, head: Doc, options?: DiffOptions): J
|
|
|
75
75
|
declare function crdtToFullReplace(doc: Doc): JsonPatchOp[];
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/materialize.d.ts
|
|
78
|
-
/**
|
|
78
|
+
/** Convert a CRDT node graph into a plain JSON value using an explicit stack. */
|
|
79
79
|
declare function materialize(node: Node): JsonValue;
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/dot.d.ts
|
|
@@ -91,13 +91,25 @@ declare function newReg(value: JsonValue, dot: Dot): LwwReg;
|
|
|
91
91
|
declare function lwwSet(reg: LwwReg, value: JsonValue, dot: Dot): void;
|
|
92
92
|
declare function objSet(obj: ObjNode, key: string, node: Node, dot: Dot): void;
|
|
93
93
|
declare function objRemove(obj: ObjNode, key: string, dot: Dot): void;
|
|
94
|
+
/**
|
|
95
|
+
* Prune object tombstones that satisfy a caller-provided stability predicate.
|
|
96
|
+
* Returns the number of removed tombstone records.
|
|
97
|
+
*/
|
|
98
|
+
declare function objCompactTombstones(obj: ObjNode, isStable: (dot: Dot) => boolean): number;
|
|
94
99
|
//#endregion
|
|
95
100
|
//#region src/rga.d.ts
|
|
96
101
|
declare const HEAD: ElemId;
|
|
97
102
|
declare function rgaLinearizeIds(seq: RgaSeq): ElemId[];
|
|
98
103
|
declare function rgaInsertAfter(seq: RgaSeq, prev: ElemId, id: ElemId, insDot: Dot, value: Node): void;
|
|
99
104
|
declare function rgaDelete(seq: RgaSeq, id: ElemId): void;
|
|
105
|
+
/**
|
|
106
|
+
* Prune tombstoned elements that are causally stable and have no live descendants
|
|
107
|
+
* depending on them for sequence traversal.
|
|
108
|
+
*
|
|
109
|
+
* Returns the number of removed elements.
|
|
110
|
+
*/
|
|
111
|
+
declare function rgaCompactTombstones(seq: RgaSeq, isStable: (dot: Dot) => boolean): number;
|
|
100
112
|
declare function rgaIdAtIndex(seq: RgaSeq, index: number): ElemId | undefined;
|
|
101
113
|
declare function rgaPrevForInsertAtIndex(seq: RgaSeq, index: number): ElemId;
|
|
102
114
|
//#endregion
|
|
103
|
-
export { ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, type CompilePatchOptions, CrdtState, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValue, type LwwReg, type MergeDocOptions, MergeError, MergeStateOptions, type Node, type ObjEntry, type ObjNode, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type RgaElem, type RgaSeq, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryMergeDocResult, TryMergeStateResult, ValidatePatchResult, type VersionVector, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compareDot, compileJsonPatchToIntent, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, newObj, newReg, newSeq, nextDotForActor, objRemove, objSet, observeDot, parseJsonPointer, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchInPlace, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, vvHasDot, vvMerge };
|
|
115
|
+
export { ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, type CompactDocTombstonesResult, type CompactStateTombstonesResult, type CompilePatchOptions, CrdtState, DeserializeError, DeserializeErrorReason, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValue, type LwwReg, MAX_TRAVERSAL_DEPTH, type MergeDocOptions, MergeError, MergeStateOptions, type Node, type ObjEntry, type ObjNode, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type RgaElem, type RgaSeq, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryMergeDocResult, TryMergeStateResult, ValidatePatchResult, type VersionVector, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchInPlace, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, vvHasDot, vvMerge };
|
package/dist/internals.js
CHANGED
|
@@ -1,60 +1,67 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_compact = require('./compact-CkLd4Yh5.js');
|
|
3
3
|
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
exports.
|
|
51
|
-
exports.
|
|
52
|
-
exports.
|
|
53
|
-
exports.
|
|
54
|
-
exports.
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
4
|
+
exports.DeserializeError = require_compact.DeserializeError;
|
|
5
|
+
exports.HEAD = require_compact.HEAD;
|
|
6
|
+
exports.MAX_TRAVERSAL_DEPTH = require_compact.MAX_TRAVERSAL_DEPTH;
|
|
7
|
+
exports.MergeError = require_compact.MergeError;
|
|
8
|
+
exports.PatchCompileError = require_compact.PatchCompileError;
|
|
9
|
+
exports.PatchError = require_compact.PatchError;
|
|
10
|
+
exports.ROOT_KEY = require_compact.ROOT_KEY;
|
|
11
|
+
exports.TraversalDepthError = require_compact.TraversalDepthError;
|
|
12
|
+
exports.applyIntentsToCrdt = require_compact.applyIntentsToCrdt;
|
|
13
|
+
exports.applyPatch = require_compact.applyPatch;
|
|
14
|
+
exports.applyPatchAsActor = require_compact.applyPatchAsActor;
|
|
15
|
+
exports.applyPatchInPlace = require_compact.applyPatchInPlace;
|
|
16
|
+
exports.cloneClock = require_compact.cloneClock;
|
|
17
|
+
exports.cloneDoc = require_compact.cloneDoc;
|
|
18
|
+
exports.compactDocTombstones = require_compact.compactDocTombstones;
|
|
19
|
+
exports.compactStateTombstones = require_compact.compactStateTombstones;
|
|
20
|
+
exports.compareDot = require_compact.compareDot;
|
|
21
|
+
exports.compileJsonPatchToIntent = require_compact.compileJsonPatchToIntent;
|
|
22
|
+
exports.crdtToFullReplace = require_compact.crdtToFullReplace;
|
|
23
|
+
exports.crdtToJsonPatch = require_compact.crdtToJsonPatch;
|
|
24
|
+
exports.createClock = require_compact.createClock;
|
|
25
|
+
exports.createState = require_compact.createState;
|
|
26
|
+
exports.deserializeDoc = require_compact.deserializeDoc;
|
|
27
|
+
exports.deserializeState = require_compact.deserializeState;
|
|
28
|
+
exports.diffJsonPatch = require_compact.diffJsonPatch;
|
|
29
|
+
exports.docFromJson = require_compact.docFromJson;
|
|
30
|
+
exports.docFromJsonWithDot = require_compact.docFromJsonWithDot;
|
|
31
|
+
exports.dotToElemId = require_compact.dotToElemId;
|
|
32
|
+
exports.forkState = require_compact.forkState;
|
|
33
|
+
exports.getAtJson = require_compact.getAtJson;
|
|
34
|
+
exports.jsonEquals = require_compact.jsonEquals;
|
|
35
|
+
exports.jsonPatchToCrdt = require_compact.jsonPatchToCrdt;
|
|
36
|
+
exports.jsonPatchToCrdtSafe = require_compact.jsonPatchToCrdtSafe;
|
|
37
|
+
exports.lwwSet = require_compact.lwwSet;
|
|
38
|
+
exports.materialize = require_compact.materialize;
|
|
39
|
+
exports.mergeDoc = require_compact.mergeDoc;
|
|
40
|
+
exports.mergeState = require_compact.mergeState;
|
|
41
|
+
exports.newObj = require_compact.newObj;
|
|
42
|
+
exports.newReg = require_compact.newReg;
|
|
43
|
+
exports.newSeq = require_compact.newSeq;
|
|
44
|
+
exports.nextDotForActor = require_compact.nextDotForActor;
|
|
45
|
+
exports.objCompactTombstones = require_compact.objCompactTombstones;
|
|
46
|
+
exports.objRemove = require_compact.objRemove;
|
|
47
|
+
exports.objSet = require_compact.objSet;
|
|
48
|
+
exports.observeDot = require_compact.observeDot;
|
|
49
|
+
exports.parseJsonPointer = require_compact.parseJsonPointer;
|
|
50
|
+
exports.rgaCompactTombstones = require_compact.rgaCompactTombstones;
|
|
51
|
+
exports.rgaDelete = require_compact.rgaDelete;
|
|
52
|
+
exports.rgaIdAtIndex = require_compact.rgaIdAtIndex;
|
|
53
|
+
exports.rgaInsertAfter = require_compact.rgaInsertAfter;
|
|
54
|
+
exports.rgaLinearizeIds = require_compact.rgaLinearizeIds;
|
|
55
|
+
exports.rgaPrevForInsertAtIndex = require_compact.rgaPrevForInsertAtIndex;
|
|
56
|
+
exports.serializeDoc = require_compact.serializeDoc;
|
|
57
|
+
exports.serializeState = require_compact.serializeState;
|
|
58
|
+
exports.stringifyJsonPointer = require_compact.stringifyJsonPointer;
|
|
59
|
+
exports.toJson = require_compact.toJson;
|
|
60
|
+
exports.tryApplyPatch = require_compact.tryApplyPatch;
|
|
61
|
+
exports.tryApplyPatchInPlace = require_compact.tryApplyPatchInPlace;
|
|
62
|
+
exports.tryJsonPatchToCrdt = require_compact.tryJsonPatchToCrdt;
|
|
63
|
+
exports.tryMergeDoc = require_compact.tryMergeDoc;
|
|
64
|
+
exports.tryMergeState = require_compact.tryMergeState;
|
|
65
|
+
exports.validateJsonPatch = require_compact.validateJsonPatch;
|
|
66
|
+
exports.vvHasDot = require_compact.vvHasDot;
|
|
67
|
+
exports.vvMerge = require_compact.vvMerge;
|
package/dist/internals.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as rgaLinearizeIds, A as jsonPatchToCrdtSafe, B as lwwSet, C as applyIntentsToCrdt, D as docFromJson, E as crdtToJsonPatch, F as getAtJson, G as objRemove, H as newReg, I as jsonEquals, J as HEAD, K as objSet, L as parseJsonPointer, M as PatchCompileError, N as compileJsonPatchToIntent, O as docFromJsonWithDot, P as diffJsonPatch, Q as rgaInsertAfter, R as stringifyJsonPointer, S as validateJsonPatch, T as crdtToFullReplace, U as newSeq, V as newObj, W as objCompactTombstones, X as rgaDelete, Y as rgaCompactTombstones, Z as rgaIdAtIndex, _ as createState, a as mergeState, at as MAX_TRAVERSAL_DEPTH, b as tryApplyPatch, c as DeserializeError, ct as createClock, d as serializeDoc, et as rgaPrevForInsertAtIndex, f as serializeState, g as applyPatchInPlace, h as applyPatchAsActor, i as mergeDoc, it as vvMerge, j as tryJsonPatchToCrdt, k as jsonPatchToCrdt, l as deserializeDoc, lt as nextDotForActor, m as applyPatch, n as compactStateTombstones, nt as dotToElemId, o as tryMergeDoc, ot as TraversalDepthError, p as PatchError, q as materialize, r as MergeError, rt as vvHasDot, s as tryMergeState, st as cloneClock, t as compactDocTombstones, tt as compareDot, u as deserializeState, ut as observeDot, v as forkState, w as cloneDoc, x as tryApplyPatchInPlace, y as toJson, z as ROOT_KEY } from "./compact-BJBGW9tC.mjs";
|
|
2
2
|
|
|
3
|
-
export { HEAD, MergeError, PatchCompileError, PatchError, ROOT_KEY, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compareDot, compileJsonPatchToIntent, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, newObj, newReg, newSeq, nextDotForActor, objRemove, objSet, observeDot, parseJsonPointer, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchInPlace, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, vvHasDot, vvMerge };
|
|
3
|
+
export { DeserializeError, HEAD, MAX_TRAVERSAL_DEPTH, MergeError, PatchCompileError, PatchError, ROOT_KEY, TraversalDepthError, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchInPlace, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, vvHasDot, vvMerge };
|