document-model 6.0.0-dev.105 → 6.0.0-dev.107
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.ts +81 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +216 -0
- package/dist/index.js.map +1 -0
- package/dist/{src/core/node.d.ts → node.d.mts} +25 -23
- package/dist/node.d.mts.map +1 -0
- package/dist/node.mjs +151 -0
- package/dist/node.mjs.map +1 -0
- package/package.json +11 -15
- package/dist/src/core/actions.d.ts +0 -87
- package/dist/src/core/actions.d.ts.map +0 -1
- package/dist/src/core/actions.js +0 -187
- package/dist/src/core/actions.js.map +0 -1
- package/dist/src/core/controller.d.ts +0 -30
- package/dist/src/core/controller.d.ts.map +0 -1
- package/dist/src/core/controller.js +0 -60
- package/dist/src/core/controller.js.map +0 -1
- package/dist/src/core/crypto.d.ts +0 -8
- package/dist/src/core/crypto.d.ts.map +0 -1
- package/dist/src/core/crypto.js +0 -68
- package/dist/src/core/crypto.js.map +0 -1
- package/dist/src/core/documents.d.ts +0 -147
- package/dist/src/core/documents.d.ts.map +0 -1
- package/dist/src/core/documents.js +0 -845
- package/dist/src/core/documents.js.map +0 -1
- package/dist/src/core/errors.d.ts +0 -21
- package/dist/src/core/errors.d.ts.map +0 -1
- package/dist/src/core/errors.js +0 -46
- package/dist/src/core/errors.js.map +0 -1
- package/dist/src/core/files.d.ts +0 -27
- package/dist/src/core/files.d.ts.map +0 -1
- package/dist/src/core/files.js +0 -90
- package/dist/src/core/files.js.map +0 -1
- package/dist/src/core/header.d.ts +0 -63
- package/dist/src/core/header.d.ts.map +0 -1
- package/dist/src/core/header.js +0 -173
- package/dist/src/core/header.js.map +0 -1
- package/dist/src/core/index.d.ts +0 -16
- package/dist/src/core/index.d.ts.map +0 -1
- package/dist/src/core/index.js +0 -16
- package/dist/src/core/index.js.map +0 -1
- package/dist/src/core/logger-types.d.ts +0 -12
- package/dist/src/core/logger-types.d.ts.map +0 -1
- package/dist/src/core/logger-types.js +0 -2
- package/dist/src/core/logger-types.js.map +0 -1
- package/dist/src/core/logger.d.ts +0 -27
- package/dist/src/core/logger.d.ts.map +0 -1
- package/dist/src/core/logger.js +0 -127
- package/dist/src/core/logger.js.map +0 -1
- package/dist/src/core/node.d.ts.map +0 -1
- package/dist/src/core/node.js +0 -155
- package/dist/src/core/node.js.map +0 -1
- package/dist/src/core/operations.d.ts +0 -50
- package/dist/src/core/operations.d.ts.map +0 -1
- package/dist/src/core/operations.js +0 -126
- package/dist/src/core/operations.js.map +0 -1
- package/dist/src/core/ph-types.d.ts +0 -2
- package/dist/src/core/ph-types.d.ts.map +0 -1
- package/dist/src/core/ph-types.js +0 -2
- package/dist/src/core/ph-types.js.map +0 -1
- package/dist/src/core/reducer.d.ts +0 -63
- package/dist/src/core/reducer.d.ts.map +0 -1
- package/dist/src/core/reducer.js +0 -446
- package/dist/src/core/reducer.js.map +0 -1
- package/dist/src/core/schemas.d.ts +0 -75
- package/dist/src/core/schemas.d.ts.map +0 -1
- package/dist/src/core/schemas.js +0 -116
- package/dist/src/core/schemas.js.map +0 -1
- package/dist/src/core/state.d.ts +0 -26
- package/dist/src/core/state.d.ts.map +0 -1
- package/dist/src/core/state.js +0 -56
- package/dist/src/core/state.js.map +0 -1
- package/dist/src/core/types.d.ts +0 -2
- package/dist/src/core/types.d.ts.map +0 -1
- package/dist/src/core/types.js +0 -2
- package/dist/src/core/types.js.map +0 -1
- package/dist/src/core/utils.d.ts +0 -6
- package/dist/src/core/utils.d.ts.map +0 -1
- package/dist/src/core/utils.js +0 -15
- package/dist/src/core/utils.js.map +0 -1
- package/dist/src/core/validation.d.ts +0 -4
- package/dist/src/core/validation.d.ts.map +0 -1
- package/dist/src/core/validation.js +0 -27
- package/dist/src/core/validation.js.map +0 -1
- package/dist/src/document-model/actions.d.ts +0 -164
- package/dist/src/document-model/actions.d.ts.map +0 -1
- package/dist/src/document-model/actions.js +0 -111
- package/dist/src/document-model/actions.js.map +0 -1
- package/dist/src/document-model/constants.d.ts +0 -6
- package/dist/src/document-model/constants.d.ts.map +0 -1
- package/dist/src/document-model/constants.js +0 -584
- package/dist/src/document-model/constants.js.map +0 -1
- package/dist/src/document-model/controller.d.ts +0 -5
- package/dist/src/document-model/controller.d.ts.map +0 -1
- package/dist/src/document-model/controller.js +0 -5
- package/dist/src/document-model/controller.js.map +0 -1
- package/dist/src/document-model/document-schema.d.ts +0 -69
- package/dist/src/document-model/document-schema.d.ts.map +0 -1
- package/dist/src/document-model/document-schema.js +0 -43
- package/dist/src/document-model/document-schema.js.map +0 -1
- package/dist/src/document-model/document-type.d.ts +0 -2
- package/dist/src/document-model/document-type.d.ts.map +0 -1
- package/dist/src/document-model/document-type.js +0 -2
- package/dist/src/document-model/document-type.js.map +0 -1
- package/dist/src/document-model/files.d.ts +0 -5
- package/dist/src/document-model/files.d.ts.map +0 -1
- package/dist/src/document-model/files.js +0 -9
- package/dist/src/document-model/files.js.map +0 -1
- package/dist/src/document-model/index.d.ts +0 -12
- package/dist/src/document-model/index.d.ts.map +0 -1
- package/dist/src/document-model/index.js +0 -12
- package/dist/src/document-model/index.js.map +0 -1
- package/dist/src/document-model/module.d.ts +0 -3
- package/dist/src/document-model/module.d.ts.map +0 -1
- package/dist/src/document-model/module.js +0 -24
- package/dist/src/document-model/module.js.map +0 -1
- package/dist/src/document-model/reducers.d.ts +0 -11
- package/dist/src/document-model/reducers.d.ts.map +0 -1
- package/dist/src/document-model/reducers.js +0 -618
- package/dist/src/document-model/reducers.js.map +0 -1
- package/dist/src/document-model/schemas.d.ts +0 -189
- package/dist/src/document-model/schemas.d.ts.map +0 -1
- package/dist/src/document-model/schemas.js +0 -388
- package/dist/src/document-model/schemas.js.map +0 -1
- package/dist/src/document-model/state.d.ts +0 -15
- package/dist/src/document-model/state.d.ts.map +0 -1
- package/dist/src/document-model/state.js +0 -75
- package/dist/src/document-model/state.js.map +0 -1
- package/dist/src/document-model/types.d.ts +0 -584
- package/dist/src/document-model/types.d.ts.map +0 -1
- package/dist/src/document-model/types.js +0 -2
- package/dist/src/document-model/types.js.map +0 -1
- package/dist/src/document-model/validation.d.ts +0 -32
- package/dist/src/document-model/validation.d.ts.map +0 -1
- package/dist/src/document-model/validation.js +0 -166
- package/dist/src/document-model/validation.js.map +0 -1
- package/dist/src/index.d.ts +0 -6
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/test/document/crypto.test.d.ts +0 -2
- package/dist/test/document/crypto.test.d.ts.map +0 -1
- package/dist/test/document/crypto.test.js +0 -192
- package/dist/test/document/crypto.test.js.map +0 -1
- package/dist/test/document/event-vs-command.test.d.ts +0 -2
- package/dist/test/document/event-vs-command.test.d.ts.map +0 -1
- package/dist/test/document/event-vs-command.test.js +0 -202
- package/dist/test/document/event-vs-command.test.js.map +0 -1
- package/dist/test/document/local.test.d.ts +0 -2
- package/dist/test/document/local.test.d.ts.map +0 -1
- package/dist/test/document/local.test.js +0 -226
- package/dist/test/document/local.test.js.map +0 -1
- package/dist/test/document/operation-id.test.d.ts +0 -2
- package/dist/test/document/operation-id.test.d.ts.map +0 -1
- package/dist/test/document/operation-id.test.js +0 -118
- package/dist/test/document/operation-id.test.js.map +0 -1
- package/dist/test/document/prune.test.d.ts +0 -2
- package/dist/test/document/prune.test.d.ts.map +0 -1
- package/dist/test/document/prune.test.js +0 -159
- package/dist/test/document/prune.test.js.map +0 -1
- package/dist/test/document/reducer.test.d.ts +0 -2
- package/dist/test/document/reducer.test.d.ts.map +0 -1
- package/dist/test/document/reducer.test.js +0 -284
- package/dist/test/document/reducer.test.js.map +0 -1
- package/dist/test/document/skip-operations.test.d.ts +0 -2
- package/dist/test/document/skip-operations.test.d.ts.map +0 -1
- package/dist/test/document/skip-operations.test.js +0 -495
- package/dist/test/document/skip-operations.test.js.map +0 -1
- package/dist/test/document/undo-redo-v2.test.d.ts +0 -2
- package/dist/test/document/undo-redo-v2.test.d.ts.map +0 -1
- package/dist/test/document/undo-redo-v2.test.js +0 -207
- package/dist/test/document/undo-redo-v2.test.js.map +0 -1
- package/dist/test/document/undo-redo.test.d.ts +0 -2
- package/dist/test/document/undo-redo.test.d.ts.map +0 -1
- package/dist/test/document/undo-redo.test.js +0 -413
- package/dist/test/document/undo-redo.test.js.map +0 -1
- package/dist/test/document/utils.test.d.ts +0 -2
- package/dist/test/document/utils.test.d.ts.map +0 -1
- package/dist/test/document/utils.test.js +0 -172
- package/dist/test/document/utils.test.js.map +0 -1
- package/dist/test/document-helpers/addUndo.test.d.ts +0 -2
- package/dist/test/document-helpers/addUndo.test.d.ts.map +0 -1
- package/dist/test/document-helpers/addUndo.test.js +0 -120
- package/dist/test/document-helpers/addUndo.test.js.map +0 -1
- package/dist/test/document-helpers/attachBranch.test.d.ts +0 -2
- package/dist/test/document-helpers/attachBranch.test.d.ts.map +0 -1
- package/dist/test/document-helpers/attachBranch.test.js +0 -364
- package/dist/test/document-helpers/attachBranch.test.js.map +0 -1
- package/dist/test/document-helpers/checkCleanedOperationsIntegrity.test.d.ts +0 -2
- package/dist/test/document-helpers/checkCleanedOperationsIntegrity.test.d.ts.map +0 -1
- package/dist/test/document-helpers/checkCleanedOperationsIntegrity.test.js +0 -252
- package/dist/test/document-helpers/checkCleanedOperationsIntegrity.test.js.map +0 -1
- package/dist/test/document-helpers/conflictResolution.test.d.ts +0 -2
- package/dist/test/document-helpers/conflictResolution.test.d.ts.map +0 -1
- package/dist/test/document-helpers/conflictResolution.test.js +0 -109
- package/dist/test/document-helpers/conflictResolution.test.js.map +0 -1
- package/dist/test/document-helpers/filterDuplicatedOperations.test.d.ts +0 -2
- package/dist/test/document-helpers/filterDuplicatedOperations.test.d.ts.map +0 -1
- package/dist/test/document-helpers/filterDuplicatedOperations.test.js +0 -126
- package/dist/test/document-helpers/filterDuplicatedOperations.test.js.map +0 -1
- package/dist/test/document-helpers/garbageCollect.test.d.ts +0 -2
- package/dist/test/document-helpers/garbageCollect.test.d.ts.map +0 -1
- package/dist/test/document-helpers/garbageCollect.test.js +0 -136
- package/dist/test/document-helpers/garbageCollect.test.js.map +0 -1
- package/dist/test/document-helpers/groupOperationsByScope.test.d.ts +0 -2
- package/dist/test/document-helpers/groupOperationsByScope.test.d.ts.map +0 -1
- package/dist/test/document-helpers/groupOperationsByScope.test.js +0 -102
- package/dist/test/document-helpers/groupOperationsByScope.test.js.map +0 -1
- package/dist/test/document-helpers/headerRevision.test.d.ts +0 -2
- package/dist/test/document-helpers/headerRevision.test.d.ts.map +0 -1
- package/dist/test/document-helpers/headerRevision.test.js +0 -203
- package/dist/test/document-helpers/headerRevision.test.js.map +0 -1
- package/dist/test/document-helpers/merge.test.d.ts +0 -2
- package/dist/test/document-helpers/merge.test.d.ts.map +0 -1
- package/dist/test/document-helpers/merge.test.js +0 -906
- package/dist/test/document-helpers/merge.test.js.map +0 -1
- package/dist/test/document-helpers/nextSkipNumber.test.d.ts +0 -2
- package/dist/test/document-helpers/nextSkipNumber.test.d.ts.map +0 -1
- package/dist/test/document-helpers/nextSkipNumber.test.js +0 -135
- package/dist/test/document-helpers/nextSkipNumber.test.js.map +0 -1
- package/dist/test/document-helpers/prepareOperations.test.d.ts +0 -2
- package/dist/test/document-helpers/prepareOperations.test.d.ts.map +0 -1
- package/dist/test/document-helpers/prepareOperations.test.js +0 -304
- package/dist/test/document-helpers/prepareOperations.test.js.map +0 -1
- package/dist/test/document-helpers/removeExistingOperations.test.d.ts +0 -2
- package/dist/test/document-helpers/removeExistingOperations.test.d.ts.map +0 -1
- package/dist/test/document-helpers/removeExistingOperations.test.js +0 -177
- package/dist/test/document-helpers/removeExistingOperations.test.js.map +0 -1
- package/dist/test/document-helpers/reshuffleByTimestamp.test.d.ts +0 -2
- package/dist/test/document-helpers/reshuffleByTimestamp.test.d.ts.map +0 -1
- package/dist/test/document-helpers/reshuffleByTimestamp.test.js +0 -148
- package/dist/test/document-helpers/reshuffleByTimestamp.test.js.map +0 -1
- package/dist/test/document-helpers/reshuffleByTimestampAndIndex.test.d.ts +0 -2
- package/dist/test/document-helpers/reshuffleByTimestampAndIndex.test.d.ts.map +0 -1
- package/dist/test/document-helpers/reshuffleByTimestampAndIndex.test.js +0 -200
- package/dist/test/document-helpers/reshuffleByTimestampAndIndex.test.js.map +0 -1
- package/dist/test/document-helpers/skipHeaderOperations.test.d.ts +0 -2
- package/dist/test/document-helpers/skipHeaderOperations.test.d.ts.map +0 -1
- package/dist/test/document-helpers/skipHeaderOperations.test.js +0 -72
- package/dist/test/document-helpers/skipHeaderOperations.test.js.map +0 -1
- package/dist/test/document-helpers/sortOperations.test.d.ts +0 -2
- package/dist/test/document-helpers/sortOperations.test.d.ts.map +0 -1
- package/dist/test/document-helpers/sortOperations.test.js +0 -101
- package/dist/test/document-helpers/sortOperations.test.js.map +0 -1
- package/dist/test/document-helpers/split.test.d.ts +0 -2
- package/dist/test/document-helpers/split.test.d.ts.map +0 -1
- package/dist/test/document-helpers/split.test.js +0 -121
- package/dist/test/document-helpers/split.test.js.map +0 -1
- package/dist/test/document-helpers/utils.d.ts +0 -15
- package/dist/test/document-helpers/utils.d.ts.map +0 -1
- package/dist/test/document-helpers/utils.js +0 -61
- package/dist/test/document-helpers/utils.js.map +0 -1
- package/dist/test/document-model/replay.test.d.ts +0 -2
- package/dist/test/document-model/replay.test.d.ts.map +0 -1
- package/dist/test/document-model/replay.test.js +0 -139
- package/dist/test/document-model/replay.test.js.map +0 -1
- package/dist/test/document-model/skip-operations.test.d.ts +0 -2
- package/dist/test/document-model/skip-operations.test.d.ts.map +0 -1
- package/dist/test/document-model/skip-operations.test.js +0 -214
- package/dist/test/document-model/skip-operations.test.js.map +0 -1
- package/dist/test/document-model/validation.test.d.ts +0 -2
- package/dist/test/document-model/validation.test.d.ts.map +0 -1
- package/dist/test/document-model/validation.test.js +0 -451
- package/dist/test/document-model/validation.test.js.map +0 -1
- package/dist/test/document-model/versioning.test.d.ts +0 -2
- package/dist/test/document-model/versioning.test.d.ts.map +0 -1
- package/dist/test/document-model/versioning.test.js +0 -93
- package/dist/test/document-model/versioning.test.js.map +0 -1
- package/dist/test/document-model/zip.test.d.ts +0 -2
- package/dist/test/document-model/zip.test.d.ts.map +0 -1
- package/dist/test/document-model/zip.test.js +0 -79
- package/dist/test/document-model/zip.test.js.map +0 -1
- package/dist/test/helpers.d.ts +0 -79
- package/dist/test/helpers.d.ts.map +0 -1
- package/dist/test/helpers.js +0 -121
- package/dist/test/helpers.js.map +0 -1
- package/dist/test/index.d.ts +0 -4
- package/dist/test/index.d.ts.map +0 -1
- package/dist/test/index.js +0 -3
- package/dist/test/index.js.map +0 -1
- package/dist/test/types.d.ts +0 -6
- package/dist/test/types.d.ts.map +0 -1
- package/dist/test/types.js +0 -2
- package/dist/test/types.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -7
- package/dist/vitest.config.js.map +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { attachBranch, checkCleanedOperationsIntegrity, merge, precedes, reshuffleByTimestamp, } from "document-model/core";
|
|
3
|
-
import { buildOperations } from "./utils.js";
|
|
4
|
-
describe("Conflict resolution", () => {
|
|
5
|
-
it("should not include duplicated operations when resolving a merge conflict", () => {
|
|
6
|
-
// target
|
|
7
|
-
const trunkOperations = buildOperations([
|
|
8
|
-
{
|
|
9
|
-
index: 0,
|
|
10
|
-
skip: 0,
|
|
11
|
-
type: "T_0",
|
|
12
|
-
timestampUtcMs: "2021-01-01T00:00:00.000Z",
|
|
13
|
-
id: "1",
|
|
14
|
-
}, // add folder
|
|
15
|
-
{
|
|
16
|
-
index: 1,
|
|
17
|
-
skip: 0,
|
|
18
|
-
type: "T_1",
|
|
19
|
-
timestampUtcMs: "2021-01-02T00:00:00.000Z",
|
|
20
|
-
id: "2",
|
|
21
|
-
}, // add folder
|
|
22
|
-
{
|
|
23
|
-
index: 2,
|
|
24
|
-
skip: 0,
|
|
25
|
-
type: "T_2",
|
|
26
|
-
timestampUtcMs: "2021-01-05T00:00:00.000Z",
|
|
27
|
-
id: "5",
|
|
28
|
-
}, // 5
|
|
29
|
-
{
|
|
30
|
-
index: 3,
|
|
31
|
-
skip: 0,
|
|
32
|
-
type: "T_3",
|
|
33
|
-
timestampUtcMs: "2021-01-06T00:00:00.000Z",
|
|
34
|
-
id: "6",
|
|
35
|
-
}, // 6
|
|
36
|
-
{
|
|
37
|
-
index: 4,
|
|
38
|
-
skip: 0,
|
|
39
|
-
type: "T_4",
|
|
40
|
-
timestampUtcMs: "2021-01-07T00:00:00.000Z",
|
|
41
|
-
id: "7",
|
|
42
|
-
}, // 7
|
|
43
|
-
{
|
|
44
|
-
index: 5,
|
|
45
|
-
skip: 0,
|
|
46
|
-
type: "T_5",
|
|
47
|
-
timestampUtcMs: "2021-01-08T00:00:00.000Z",
|
|
48
|
-
id: "8",
|
|
49
|
-
}, // 8
|
|
50
|
-
]);
|
|
51
|
-
// new operations
|
|
52
|
-
const branchOperations = buildOperations([
|
|
53
|
-
{
|
|
54
|
-
index: 4,
|
|
55
|
-
skip: 2,
|
|
56
|
-
type: "B_4_2",
|
|
57
|
-
timestampUtcMs: "2021-01-03T00:00:00.000Z",
|
|
58
|
-
id: "3",
|
|
59
|
-
}, // 3
|
|
60
|
-
{
|
|
61
|
-
index: 5,
|
|
62
|
-
skip: 0,
|
|
63
|
-
type: "B_5",
|
|
64
|
-
timestampUtcMs: "2021-01-04T00:00:00.000Z",
|
|
65
|
-
id: "4",
|
|
66
|
-
}, // 4
|
|
67
|
-
{
|
|
68
|
-
index: 6,
|
|
69
|
-
skip: 0,
|
|
70
|
-
type: "T_2",
|
|
71
|
-
timestampUtcMs: "2021-01-05T00:00:00.000Z",
|
|
72
|
-
id: "5",
|
|
73
|
-
}, // 5
|
|
74
|
-
{
|
|
75
|
-
index: 7,
|
|
76
|
-
skip: 0,
|
|
77
|
-
type: "T_3",
|
|
78
|
-
timestampUtcMs: "2021-01-06T00:00:00.000Z",
|
|
79
|
-
id: "6",
|
|
80
|
-
}, // 6
|
|
81
|
-
]);
|
|
82
|
-
const [newTrunk, tail] = attachBranch(trunkOperations, branchOperations);
|
|
83
|
-
expect(newTrunk).toMatchObject([
|
|
84
|
-
{ index: 0, skip: 0, type: "T_0" }, // add folder
|
|
85
|
-
{ index: 1, skip: 0, type: "T_1" }, // add folder
|
|
86
|
-
{ index: 4, skip: 2, type: "B_4_2" }, // 3
|
|
87
|
-
{ index: 5, skip: 0, type: "B_5" }, // 4
|
|
88
|
-
{ index: 6, skip: 0, type: "T_2" }, // 5
|
|
89
|
-
{ index: 7, skip: 0, type: "T_3" }, // 6
|
|
90
|
-
]);
|
|
91
|
-
expect(tail).toMatchObject([
|
|
92
|
-
{ index: 4, skip: 0, type: "T_4" }, // 7
|
|
93
|
-
{ index: 5, skip: 0, type: "T_5" }, // 8
|
|
94
|
-
]);
|
|
95
|
-
expect(checkCleanedOperationsIntegrity(newTrunk)).toHaveLength(0);
|
|
96
|
-
const newHistory = merge(trunkOperations, newTrunk, reshuffleByTimestamp);
|
|
97
|
-
const newOperations = newHistory.filter((op) => trunkOperations.length < 1 ||
|
|
98
|
-
precedes(trunkOperations[trunkOperations.length - 1], op));
|
|
99
|
-
expect(newOperations).toMatchObject([
|
|
100
|
-
{ index: 8, skip: 6, type: "B_4_2", id: "3" }, // 3
|
|
101
|
-
{ index: 9, skip: 0, type: "B_5", id: "4" }, // 4
|
|
102
|
-
{ index: 10, skip: 0, type: "T_2", id: "5" }, // 5
|
|
103
|
-
{ index: 11, skip: 0, type: "T_3", id: "6" }, // 6
|
|
104
|
-
{ index: 12, skip: 0, type: "T_4", id: "7" }, // 7
|
|
105
|
-
{ index: 13, skip: 0, type: "T_5", id: "8" }, // 8
|
|
106
|
-
]);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
//# sourceMappingURL=conflictResolution.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conflictResolution.test.js","sourceRoot":"","sources":["../../../test/document-helpers/conflictResolution.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,+BAA+B,EAC/B,KAAK,EACL,QAAQ,EACR,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAClF,SAAS;QACT,MAAM,eAAe,GAAG,eAAe,CAAC;YACtC;gBACE,KAAK,EAAE,CAAC;gBACR,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,KAAK;gBACX,cAAc,EAAE,0BAA0B;gBAC1C,EAAE,EAAE,GAAG;aACR,EAAE,aAAa;YAChB;gBACE,KAAK,EAAE,CAAC;gBACR,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,KAAK;gBACX,cAAc,EAAE,0BAA0B;gBAC1C,EAAE,EAAE,GAAG;aACR,EAAE,aAAa;YAChB;gBACE,KAAK,EAAE,CAAC;gBACR,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,KAAK;gBACX,cAAc,EAAE,0BAA0B;gBAC1C,EAAE,EAAE,GAAG;aACR,EAAE,IAAI;YACP;gBACE,KAAK,EAAE,CAAC;gBACR,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,KAAK;gBACX,cAAc,EAAE,0BAA0B;gBAC1C,EAAE,EAAE,GAAG;aACR,EAAE,IAAI;YACP;gBACE,KAAK,EAAE,CAAC;gBACR,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,KAAK;gBACX,cAAc,EAAE,0BAA0B;gBAC1C,EAAE,EAAE,GAAG;aACR,EAAE,IAAI;YACP;gBACE,K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,EAAE,IAAI;YACjD,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI;YAClD,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI;YAClD,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI;YAClD,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI;SACnD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterDuplicatedOperations.test.d.ts","sourceRoot":"","sources":["../../../test/document-helpers/filterDuplicatedOperations.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { filterDuplicatedOperations } from "document-model/core";
|
|
3
|
-
import { buildOperations } from "./utils.js";
|
|
4
|
-
describe("filterDuplicatedOperations", () => {
|
|
5
|
-
const scenarios = [
|
|
6
|
-
{
|
|
7
|
-
title: "should filter duplicated operations",
|
|
8
|
-
target: [
|
|
9
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
10
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
11
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
12
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
13
|
-
],
|
|
14
|
-
source: [
|
|
15
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
16
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
17
|
-
],
|
|
18
|
-
result: [
|
|
19
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
20
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: "should remove all the operations if all of them are duplicated",
|
|
25
|
-
target: [
|
|
26
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
27
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
28
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
29
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
30
|
-
],
|
|
31
|
-
source: [
|
|
32
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
33
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
34
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
35
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
36
|
-
],
|
|
37
|
-
result: [],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: "should return empty array if source and target are empty",
|
|
41
|
-
target: [],
|
|
42
|
-
source: [],
|
|
43
|
-
result: [],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
title: "should return empty array if source target is empty",
|
|
47
|
-
target: [],
|
|
48
|
-
source: [
|
|
49
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
50
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
51
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
52
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
53
|
-
],
|
|
54
|
-
result: [],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
title: "should return target operations if source is empty",
|
|
58
|
-
target: [
|
|
59
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
60
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
61
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
62
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
63
|
-
],
|
|
64
|
-
source: [],
|
|
65
|
-
result: [
|
|
66
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
67
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
68
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
69
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
title: "should return target operations if there is no duplicated operations",
|
|
74
|
-
target: [
|
|
75
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
76
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
77
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
78
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
79
|
-
],
|
|
80
|
-
source: [
|
|
81
|
-
{ index: 4, skip: 0, type: "T_4", id: "4" },
|
|
82
|
-
{ index: 5, skip: 0, type: "T_5", id: "5" },
|
|
83
|
-
{ index: 6, skip: 0, type: "T_6", id: "6" },
|
|
84
|
-
{ index: 7, skip: 0, type: "T_7", id: "7" },
|
|
85
|
-
],
|
|
86
|
-
result: [
|
|
87
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
88
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
89
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
90
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title: "should remote duplicated operations that are not in order",
|
|
95
|
-
target: [
|
|
96
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
97
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
98
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
99
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
100
|
-
{ index: 4, skip: 0, type: "T_4", id: "4" },
|
|
101
|
-
{ index: 5, skip: 0, type: "T_5", id: "5" },
|
|
102
|
-
{ index: 6, skip: 0, type: "T_6", id: "6" },
|
|
103
|
-
{ index: 7, skip: 0, type: "T_7", id: "7" },
|
|
104
|
-
],
|
|
105
|
-
source: [
|
|
106
|
-
{ index: 6, skip: 0, type: "T_6", id: "6" },
|
|
107
|
-
{ index: 3, skip: 0, type: "T_3", id: "3" },
|
|
108
|
-
{ index: 1, skip: 0, type: "T_1", id: "1" },
|
|
109
|
-
{ index: 4, skip: 0, type: "T_4", id: "4" },
|
|
110
|
-
],
|
|
111
|
-
result: [
|
|
112
|
-
{ index: 0, skip: 0, type: "T_0", id: "0" },
|
|
113
|
-
{ index: 2, skip: 0, type: "T_2", id: "2" },
|
|
114
|
-
{ index: 5, skip: 0, type: "T_5", id: "5" },
|
|
115
|
-
{ index: 7, skip: 0, type: "T_7", id: "7" },
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
|
-
];
|
|
119
|
-
it.each(scenarios)("$title", (testInput) => {
|
|
120
|
-
const targetOperations = buildOperations(testInput.target);
|
|
121
|
-
const sourceOperations = buildOperations(testInput.source);
|
|
122
|
-
const result = filterDuplicatedOperations(targetOperations, sourceOperations);
|
|
123
|
-
expect(result).toMatchObject(testInput.result);
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
//# sourceMappingURL=filterDuplicatedOperations.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filterDuplicatedOperations.test.js","sourceRoot":"","sources":["../../../test/document-helpers/filterDuplicatedOperations.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAA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CAAC,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollect.test.d.ts","sourceRoot":"","sources":["../../../test/document-helpers/garbageCollect.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { garbageCollect } from "document-model/core";
|
|
3
|
-
import { buildOperation, buildOperations } from "./utils.js";
|
|
4
|
-
describe("garbageCollect", () => {
|
|
5
|
-
it("should return the same list of operations if there is no issues or removals", () => {
|
|
6
|
-
// 0:0 1:0 2:0 => 0:0 1:0 2:0, removals 0, no issues
|
|
7
|
-
const operations = buildOperations([
|
|
8
|
-
{ index: 0, skip: 0 },
|
|
9
|
-
{ index: 1, skip: 0 },
|
|
10
|
-
{ index: 2, skip: 0 },
|
|
11
|
-
]);
|
|
12
|
-
const result = garbageCollect(operations);
|
|
13
|
-
expect(result.length).toBe(operations.length);
|
|
14
|
-
expect(result).toMatchObject(operations);
|
|
15
|
-
});
|
|
16
|
-
it("should remove a single skipped operation", () => {
|
|
17
|
-
// 0:0 1:1 2:0 => 1:1 2:0, removals 1, no issues
|
|
18
|
-
const op0 = buildOperation({ index: 0, skip: 0 });
|
|
19
|
-
const op1 = buildOperation({ index: 1, skip: 1 });
|
|
20
|
-
const op2 = buildOperation({ index: 2, skip: 0 });
|
|
21
|
-
const operations = [op0, op1, op2];
|
|
22
|
-
const result = garbageCollect(operations);
|
|
23
|
-
expect(result.length).toBe(2);
|
|
24
|
-
expect(result).toMatchObject([op1, op2]);
|
|
25
|
-
});
|
|
26
|
-
it("should remove all the skipped operations", () => {
|
|
27
|
-
// 0:0 1:1 2:0 3:1 => 1:1 3:1, removals 2, no issues
|
|
28
|
-
const op0 = buildOperation({ index: 0, skip: 0 });
|
|
29
|
-
const op1 = buildOperation({ index: 1, skip: 1 });
|
|
30
|
-
const op2 = buildOperation({ index: 2, skip: 0 });
|
|
31
|
-
const op3 = buildOperation({ index: 3, skip: 1 });
|
|
32
|
-
const operations = [op0, op1, op2, op3];
|
|
33
|
-
const result = garbageCollect(operations);
|
|
34
|
-
expect(result.length).toBe(2);
|
|
35
|
-
expect(result).toMatchObject([op1, op3]);
|
|
36
|
-
});
|
|
37
|
-
it("should keep only the last operation when it skips all the previous operations", () => {
|
|
38
|
-
// 0:0 1:1 2:0 3:3 => 3:3
|
|
39
|
-
const op0 = buildOperation({ index: 0, skip: 0 });
|
|
40
|
-
const op1 = buildOperation({ index: 1, skip: 1 });
|
|
41
|
-
const op2 = buildOperation({ index: 2, skip: 0 });
|
|
42
|
-
const op3 = buildOperation({ index: 3, skip: 3 });
|
|
43
|
-
const operations = [op0, op1, op2, op3];
|
|
44
|
-
const result = garbageCollect(operations);
|
|
45
|
-
expect(result.length).toBe(1);
|
|
46
|
-
expect(result).toMatchObject([op3]);
|
|
47
|
-
});
|
|
48
|
-
it("should not increase removals if an skipped operation is not present", () => {
|
|
49
|
-
// 1:1 2:0 3:0 => 1:1 2:0 3:0, removals 0, no issues
|
|
50
|
-
const op0 = buildOperation({ index: 1, skip: 1 });
|
|
51
|
-
const op1 = buildOperation({ index: 2, skip: 0 });
|
|
52
|
-
const op2 = buildOperation({ index: 3, skip: 0 });
|
|
53
|
-
const operations = [op0, op1, op2];
|
|
54
|
-
const result = garbageCollect(operations);
|
|
55
|
-
expect(result.length).toBe(3);
|
|
56
|
-
expect(result).toMatchObject(operations);
|
|
57
|
-
});
|
|
58
|
-
it("should return an empty array if there is no operations", () => {
|
|
59
|
-
const result = garbageCollect([]);
|
|
60
|
-
expect(result).toMatchObject([]);
|
|
61
|
-
});
|
|
62
|
-
it("should return the same single operation if there is no skip value", () => {
|
|
63
|
-
// 0:0 => 0:0
|
|
64
|
-
const op0 = buildOperation({ index: 0, skip: 0 });
|
|
65
|
-
const operations = [op0];
|
|
66
|
-
const result = garbageCollect(operations);
|
|
67
|
-
expect(result.length).toBe(1);
|
|
68
|
-
expect(result).toMatchObject(operations);
|
|
69
|
-
});
|
|
70
|
-
it("should return the same single operation if the index and skip value are valid", () => {
|
|
71
|
-
// 1:1 => 1:1
|
|
72
|
-
const op0 = buildOperation({ index: 1, skip: 1 });
|
|
73
|
-
const operations = [op0];
|
|
74
|
-
const result = garbageCollect(operations);
|
|
75
|
-
expect(result.length).toBe(1);
|
|
76
|
-
expect(result).toMatchObject(operations);
|
|
77
|
-
});
|
|
78
|
-
it("should return only the latest opeartion if all the previous ones are skipped", () => {
|
|
79
|
-
// [0:0 1:0 2:0 2:1 2:2] => -1
|
|
80
|
-
const op0 = buildOperation({ index: 0, skip: 0 });
|
|
81
|
-
const op1 = buildOperation({ index: 1, skip: 0 });
|
|
82
|
-
const op2 = buildOperation({ index: 1, skip: 1 });
|
|
83
|
-
const op3 = buildOperation({ index: 2, skip: 0 });
|
|
84
|
-
const op4 = buildOperation({ index: 2, skip: 1 });
|
|
85
|
-
const op5 = buildOperation({ index: 2, skip: 2 });
|
|
86
|
-
const operations = [op0, op1, op2, op3, op4, op5];
|
|
87
|
-
const result = garbageCollect(operations);
|
|
88
|
-
expect(result.length).toBe(1);
|
|
89
|
-
expect(result).toMatchObject([op5]);
|
|
90
|
-
});
|
|
91
|
-
it("should be indifferent to missing skipped operations", () => {
|
|
92
|
-
const op0_x = buildOperation({ index: 0, skip: 0 });
|
|
93
|
-
const op1_v = buildOperation({ index: 1, skip: 1 });
|
|
94
|
-
const op2_x = buildOperation({ index: 2, skip: 0 });
|
|
95
|
-
const op3_x = buildOperation({ index: 3, skip: 0 });
|
|
96
|
-
const op4_x = buildOperation({ index: 4, skip: 0 });
|
|
97
|
-
const op5_x = buildOperation({ index: 4, skip: 1 });
|
|
98
|
-
const op6_v = buildOperation({ index: 4, skip: 2 });
|
|
99
|
-
const equivalentSets = [
|
|
100
|
-
[op0_x, op1_v, op2_x, op3_x, op4_x, op5_x, op6_v],
|
|
101
|
-
[op1_v, op2_x, op3_x, op4_x, op5_x, op6_v],
|
|
102
|
-
[op0_x, op1_v, op3_x, op4_x, op5_x, op6_v],
|
|
103
|
-
[op0_x, op1_v, op2_x, op4_x, op5_x, op6_v],
|
|
104
|
-
[op0_x, op1_v, op2_x, op3_x, op5_x, op6_v],
|
|
105
|
-
[op0_x, op1_v, op2_x, op3_x, op4_x, op6_v],
|
|
106
|
-
[op1_v, op2_x, op4_x, op5_x, op6_v],
|
|
107
|
-
[op0_x, op1_v, op4_x, op5_x, op6_v],
|
|
108
|
-
[op0_x, op1_v, op2_x, op5_x, op6_v],
|
|
109
|
-
[op0_x, op1_v, op2_x, op4_x, op6_v],
|
|
110
|
-
[op1_v, op4_x, op5_x, op6_v],
|
|
111
|
-
[op0_x, op1_v, op5_x, op6_v],
|
|
112
|
-
[op0_x, op1_v, op4_x, op6_v],
|
|
113
|
-
[op1_v, op5_x, op6_v],
|
|
114
|
-
[op0_x, op1_v, op6_v],
|
|
115
|
-
[op1_v, op6_v],
|
|
116
|
-
];
|
|
117
|
-
for (const set of equivalentSets) {
|
|
118
|
-
expect(garbageCollect(set)).toEqual([op1_v, op6_v]);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
it("should be idempotent", () => {
|
|
122
|
-
const op0 = buildOperation({ index: 0, skip: 0 });
|
|
123
|
-
const op1 = buildOperation({ index: 1, skip: 1 });
|
|
124
|
-
const op2 = buildOperation({ index: 2, skip: 0 });
|
|
125
|
-
const op3 = buildOperation({ index: 3, skip: 0 });
|
|
126
|
-
const op4 = buildOperation({ index: 4, skip: 0 });
|
|
127
|
-
const op5 = buildOperation({ index: 4, skip: 2 });
|
|
128
|
-
const operations = [op0, op1, op2, op3, op4, op5];
|
|
129
|
-
const result = garbageCollect(operations);
|
|
130
|
-
expect(result).toHaveLength(2);
|
|
131
|
-
expect(result).toEqual([op1, op5]);
|
|
132
|
-
const result2 = garbageCollect(result);
|
|
133
|
-
expect(result2).toEqual(result);
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
//# sourceMappingURL=garbageCollect.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollect.test.js","sourceRoot":"","sources":["../../../test/document-helpers/garbageCollect.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,6EAA6E,EAAE,GAAG,EAAE;QACrF,oDAAoD;QACpD,MAAM,UAAU,GAAG,eAAe,CAAC;YACjC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;YACrB,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;YACrB,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;SACtB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;QAE1C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,gDAAgD;QAChD,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,cAAc,CAAC,E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;QAClD,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAElD,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;QAE1C,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAEnC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupOperationsByScope.test.d.ts","sourceRoot":"","sources":["../../../test/document-helpers/groupOperationsByScope.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { deriveOperationId, groupOperationsByScope } from "document-model/core";
|
|
2
|
-
import { fakeAction } from "document-model/test";
|
|
3
|
-
import { describe, expect, it } from "vitest";
|
|
4
|
-
const TEST_DOC_ID = "test-doc-id";
|
|
5
|
-
const TEST_BRANCH = "main";
|
|
6
|
-
const fakeOperation = (index, skip, scope, hash) => {
|
|
7
|
-
const action = fakeAction({
|
|
8
|
-
scope,
|
|
9
|
-
type: "TEST",
|
|
10
|
-
});
|
|
11
|
-
return {
|
|
12
|
-
id: deriveOperationId(TEST_DOC_ID, scope, TEST_BRANCH, action.id),
|
|
13
|
-
index,
|
|
14
|
-
skip,
|
|
15
|
-
hash,
|
|
16
|
-
timestampUtcMs: new Date().toISOString(),
|
|
17
|
-
action,
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
describe("groupOperationsByScope", () => {
|
|
21
|
-
const scenarios = [
|
|
22
|
-
{
|
|
23
|
-
title: "case 1",
|
|
24
|
-
getScenario: () => {
|
|
25
|
-
const op1 = fakeOperation(0, 0, "global", "hash1");
|
|
26
|
-
const op2 = fakeOperation(1, 0, "global", "hash2");
|
|
27
|
-
const op3 = fakeOperation(2, 0, "global", "hash3");
|
|
28
|
-
const op4 = fakeOperation(0, 0, "local", "hash4");
|
|
29
|
-
const op5 = fakeOperation(1, 0, "local", "hash5");
|
|
30
|
-
return {
|
|
31
|
-
operations: [op1, op2, op3, op4, op5],
|
|
32
|
-
expected: {
|
|
33
|
-
global: [op1, op2, op3],
|
|
34
|
-
local: [op4, op5],
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: "case 2",
|
|
41
|
-
getScenario: () => {
|
|
42
|
-
const op1 = fakeOperation(0, 0, "global", "hash1");
|
|
43
|
-
const op2 = fakeOperation(1, 0, "global", "hash2");
|
|
44
|
-
const op3 = fakeOperation(2, 0, "global", "hash3");
|
|
45
|
-
const op4 = fakeOperation(0, 0, "local", "hash4");
|
|
46
|
-
const op5 = fakeOperation(1, 0, "local", "hash5");
|
|
47
|
-
const op6 = fakeOperation(3, 0, "global", "hash6");
|
|
48
|
-
const op7 = fakeOperation(4, 0, "global", "hash7");
|
|
49
|
-
const op8 = fakeOperation(5, 0, "global", "hash8");
|
|
50
|
-
const op9 = fakeOperation(2, 0, "local", "hash9");
|
|
51
|
-
const op10 = fakeOperation(3, 0, "local", "hash10");
|
|
52
|
-
return {
|
|
53
|
-
operations: [op1, op2, op4, op3, op5, op6, op10, op7, op8, op9],
|
|
54
|
-
expected: {
|
|
55
|
-
global: [op1, op2, op3, op6, op7, op8],
|
|
56
|
-
local: [op4, op5, op10, op9],
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
title: "case 3 (only global operations)",
|
|
63
|
-
getScenario: () => {
|
|
64
|
-
const op1 = fakeOperation(0, 0, "global", "hash1");
|
|
65
|
-
const op2 = fakeOperation(1, 0, "global", "hash2");
|
|
66
|
-
const op3 = fakeOperation(2, 0, "global", "hash3");
|
|
67
|
-
return {
|
|
68
|
-
operations: [op1, op2, op3],
|
|
69
|
-
expected: {
|
|
70
|
-
global: [op1, op2, op3],
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
title: "case 4 (empty operations)",
|
|
77
|
-
getScenario: () => ({
|
|
78
|
-
operations: [],
|
|
79
|
-
expected: {},
|
|
80
|
-
}),
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
title: "case 5 (only local operations)",
|
|
84
|
-
getScenario: () => {
|
|
85
|
-
const op1 = fakeOperation(0, 0, "local", "hash1");
|
|
86
|
-
const op2 = fakeOperation(1, 0, "local", "hash2");
|
|
87
|
-
return {
|
|
88
|
-
operations: [op1, op2],
|
|
89
|
-
expected: {
|
|
90
|
-
local: [op1, op2],
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
];
|
|
96
|
-
it.each(scenarios)("should group operations by scope: $title", (testInput) => {
|
|
97
|
-
const scenario = testInput.getScenario();
|
|
98
|
-
const result = groupOperationsByScope(scenario.operations);
|
|
99
|
-
expect(result).toMatchObject(scenario.expected);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
//# sourceMappingURL=groupOperationsByScope.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupOperationsByScope.test.js","sourceRoot":"","sources":["../../../test/document-helpers/groupOperationsByScope.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE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,OAAO,CAAC,CAAC;gBAElD,OAAO;oBACL,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;oBACtB,QAAQ,EAAE;wBACR,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;qBAClB;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;IAEF,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAChB,0CAA0C,EAC1C,CAAC,SAAS,EAAE,EAAE;QACZ,MAAM,QAAQ,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,sBAAsB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAE3D,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"headerRevision.test.d.ts","sourceRoot":"","sources":["../../../test/document-helpers/headerRevision.test.ts"],"names":[],"mappings":""}
|