@lionweb/json-diff 0.6.13-beta.5
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/CHANGELOG.md +4 -0
- package/LICENSE +201 -0
- package/README.md +27 -0
- package/dist/DiffResult.d.ts +9 -0
- package/dist/DiffResult.d.ts.map +1 -0
- package/dist/DiffResult.js +18 -0
- package/dist/DiffResult.js.map +1 -0
- package/dist/LionWebJsonDiff.d.ts +25 -0
- package/dist/LionWebJsonDiff.d.ts.map +1 -0
- package/dist/LionWebJsonDiff.js +249 -0
- package/dist/LionWebJsonDiff.js.map +1 -0
- package/dist/changes/Change.d.ts +34 -0
- package/dist/changes/Change.d.ts.map +1 -0
- package/dist/changes/Change.js +38 -0
- package/dist/changes/Change.js.map +1 -0
- package/dist/changes/ChunkChange.d.ts +43 -0
- package/dist/changes/ChunkChange.d.ts.map +1 -0
- package/dist/changes/ChunkChange.js +57 -0
- package/dist/changes/ChunkChange.js.map +1 -0
- package/dist/changes/ContainmentChange.d.ts +25 -0
- package/dist/changes/ContainmentChange.d.ts.map +1 -0
- package/dist/changes/ContainmentChange.js +34 -0
- package/dist/changes/ContainmentChange.js.map +1 -0
- package/dist/changes/NodeChange.d.ts +41 -0
- package/dist/changes/NodeChange.d.ts.map +1 -0
- package/dist/changes/NodeChange.js +54 -0
- package/dist/changes/NodeChange.js.map +1 -0
- package/dist/changes/PropertyChange.d.ts +24 -0
- package/dist/changes/PropertyChange.d.ts.map +1 -0
- package/dist/changes/PropertyChange.js +29 -0
- package/dist/changes/PropertyChange.js.map +1 -0
- package/dist/changes/ReferenceChange.d.ts +25 -0
- package/dist/changes/ReferenceChange.d.ts.map +1 -0
- package/dist/changes/ReferenceChange.js +34 -0
- package/dist/changes/ReferenceChange.js.map +1 -0
- package/dist/changes/index.d.ts +7 -0
- package/dist/changes/index.d.ts.map +1 -0
- package/dist/changes/index.js +7 -0
- package/dist/changes/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2022 LionWeb Team
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# The `JSON-diff` package
|
|
2
|
+
|
|
3
|
+
[
|
|
4
|
+
](./LICENSE)
|
|
5
|
+
[
|
|
6
|
+
](https://github.com/LionWeb-io/lionweb-typescript/actions/workflows/test.yaml)
|
|
7
|
+
[
|
|
8
|
+
](https://www.npmjs.com/package/@lionweb/json-diff)
|
|
9
|
+
|
|
10
|
+
An NPM package that can be added to a Node.js/NPM codebase as follows:
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
$ npm add @lionweb/json-diff
|
|
14
|
+
```
|
|
15
|
+
It contains:
|
|
16
|
+
|
|
17
|
+
* Utilities ...
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Development
|
|
21
|
+
|
|
22
|
+
Build it from source as follows:
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffResult.d.ts","sourceRoot":"","sources":["../src/DiffResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,qBAAa,UAAU;IACnB,OAAO,EAAE,MAAM,EAAE,CAAK;IAEtB,MAAM,CAAC,KAAK,EAAE,MAAM;IAIpB,KAAK;IAIL,UAAU,IAAI,OAAO;IAIrB,aAAa,IAAI,MAAM,EAAE;CAG5B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class DiffResult {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.changes = [];
|
|
4
|
+
}
|
|
5
|
+
change(issue) {
|
|
6
|
+
this.changes.push(issue);
|
|
7
|
+
}
|
|
8
|
+
reset() {
|
|
9
|
+
this.changes = [];
|
|
10
|
+
}
|
|
11
|
+
hasChanges() {
|
|
12
|
+
return this.changes.length !== 0;
|
|
13
|
+
}
|
|
14
|
+
asStringArray() {
|
|
15
|
+
return this.changes.map(ch => ch.changeMsg());
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DiffResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffResult.js","sourceRoot":"","sources":["../src/DiffResult.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IAAvB;QACI,YAAO,GAAa,EAAE,CAAA;IAiB1B,CAAC;IAfG,MAAM,CAAC,KAAa;QAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC;IAED,KAAK;QACD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;IACrB,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAA;IACpC,CAAC;IAED,aAAa;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAA;IACjD,CAAC;CACJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LionWebJsonChunk, LionWebJsonContainment, LionWebJsonNode, LionWebJsonReference } from "@lionweb/json";
|
|
2
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
3
|
+
import { Change } from "./changes/Change.js";
|
|
4
|
+
import { DiffResult } from "./DiffResult.js";
|
|
5
|
+
/**
|
|
6
|
+
* Comparing LionWeb JSON chunks and find all differences
|
|
7
|
+
*/
|
|
8
|
+
export declare class LionWebJsonDiff {
|
|
9
|
+
diffResult: DiffResult;
|
|
10
|
+
constructor();
|
|
11
|
+
change(change: Change): void;
|
|
12
|
+
diff(ctx: JsonContext, msg: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Compare two LwNode objects and return their difference
|
|
15
|
+
* @param beforeNode
|
|
16
|
+
* @param afterNode
|
|
17
|
+
*/
|
|
18
|
+
diffLwNode(ctx: JsonContext, beforeNode: LionWebJsonNode, afterNode: LionWebJsonNode): void;
|
|
19
|
+
diffLwChunk(beforeChunk: LionWebJsonChunk, afterChunk: LionWebJsonChunk): void;
|
|
20
|
+
diffContainment(ctx: JsonContext, node: LionWebJsonNode, beforeContainment: LionWebJsonContainment, afterContainment: LionWebJsonContainment): void;
|
|
21
|
+
diffLwReference(ctx: JsonContext, node: LionWebJsonNode, beforeRef: LionWebJsonReference, afterRef: LionWebJsonReference): void;
|
|
22
|
+
private diffLwUsedLanguage;
|
|
23
|
+
private diffLwProperty;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=LionWebJsonDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LionWebJsonDiff.d.ts","sourceRoot":"","sources":["../src/LionWebJsonDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EAEf,oBAAoB,EAGvB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAc,WAAW,EAAa,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAAE,MAAM,EAA0B,MAAM,qBAAqB,CAAA;AAMpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C;;GAEG;AACH,qBAAa,eAAe;IACxB,UAAU,aAAmB;;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI5B,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM;IAKlC;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI;IAkH3F,WAAW,CAAC,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI;IA4C9E,eAAe,CACX,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,eAAe,EACrB,iBAAiB,EAAE,sBAAsB,EACzC,gBAAgB,EAAE,sBAAsB,GACzC,IAAI;IAmCP,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,oBAAoB,GAAG,IAAI;IA4C/H,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,cAAc;CAiBzB"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { isEqualMetaPointer, isEqualReferenceTarget } from "@lionweb/json";
|
|
2
|
+
import { ChunkUtils, JsonContext, NodeUtils } from "@lionweb/json-utils";
|
|
3
|
+
import { GenericChange, Missing } from "./changes/Change.js";
|
|
4
|
+
import { LanguageAdded, LanguageRemoved, NodeAdded, NodeRemoved, SerializationFormatChange } from "./changes/ChunkChange.js";
|
|
5
|
+
import { ChildAdded, ChildOrderChanged, ChildRemoved } from "./changes/ContainmentChange.js";
|
|
6
|
+
import { AnnotationAdded, AnnotationOrderChanged, AnnotationRemoved, TargetAdded, TargetOrderChanged, TargetRemoved } from "./changes/index.js";
|
|
7
|
+
import { NodeClassifierChanged, ParentChanged } from "./changes/NodeChange.js";
|
|
8
|
+
import { PropertyValueChanged } from "./changes/PropertyChange.js";
|
|
9
|
+
import { DiffResult } from "./DiffResult.js";
|
|
10
|
+
/**
|
|
11
|
+
* Comparing LionWeb JSON chunks and find all differences
|
|
12
|
+
*/
|
|
13
|
+
export class LionWebJsonDiff {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.diffResult = new DiffResult();
|
|
16
|
+
}
|
|
17
|
+
change(change) {
|
|
18
|
+
this.diffResult.change(change);
|
|
19
|
+
}
|
|
20
|
+
diff(ctx, msg) {
|
|
21
|
+
const change = new GenericChange(ctx, msg);
|
|
22
|
+
this.diffResult.change(change);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Compare two LwNode objects and return their difference
|
|
26
|
+
* @param beforeNode
|
|
27
|
+
* @param afterNode
|
|
28
|
+
*/
|
|
29
|
+
diffLwNode(ctx, beforeNode, afterNode) {
|
|
30
|
+
if (!isEqualMetaPointer(beforeNode.classifier, afterNode.classifier)) {
|
|
31
|
+
this.change(new NodeClassifierChanged(ctx.concat("classifier"), beforeNode, beforeNode.classifier, afterNode.classifier));
|
|
32
|
+
}
|
|
33
|
+
if (beforeNode.parent !== afterNode.parent) {
|
|
34
|
+
this.change(new ParentChanged(ctx, beforeNode, beforeNode.parent, afterNode.parent));
|
|
35
|
+
}
|
|
36
|
+
// Find diff between previous and next properties
|
|
37
|
+
beforeNode.properties.forEach((beforeProperty, index) => {
|
|
38
|
+
const afterProperty = NodeUtils.findProperty(afterNode, beforeProperty.property);
|
|
39
|
+
if (afterProperty === undefined) {
|
|
40
|
+
this.change(new PropertyValueChanged(ctx.concat("properties", index), beforeNode.id, beforeProperty.property, beforeProperty.value, null, Missing.MissingAfter));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.diffLwProperty(ctx.concat("properties", index), beforeNode, beforeProperty, afterProperty);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
afterNode.properties.forEach((afterProperty, index) => {
|
|
47
|
+
const beforeProperty = NodeUtils.findProperty(beforeNode, afterProperty.property);
|
|
48
|
+
if (beforeProperty === undefined) {
|
|
49
|
+
this.change(new PropertyValueChanged(ctx.concat("properties", index), beforeNode.id, afterProperty.property, null, afterProperty.value, Missing.MissingBefore));
|
|
50
|
+
}
|
|
51
|
+
// no else, if the property exists in both nodes, the diff has been claculated in the loop before this one
|
|
52
|
+
});
|
|
53
|
+
beforeNode.containments.forEach((beforeContainment, index) => {
|
|
54
|
+
const beforeKey = beforeContainment.containment.key;
|
|
55
|
+
const afterContainment = NodeUtils.findChild(afterNode, beforeKey);
|
|
56
|
+
if (afterContainment === undefined) {
|
|
57
|
+
// NB No containment is considered equivalent to a containment with empty _children_
|
|
58
|
+
if (beforeContainment.children.length !== 0) {
|
|
59
|
+
beforeContainment.children.forEach(childId => {
|
|
60
|
+
this.change(new ChildRemoved(ctx.concat("containments", index), beforeNode, beforeContainment.containment, afterContainment, childId, Missing.MissingAfter));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.diffContainment(ctx.concat("containments", index), beforeNode, beforeContainment, afterContainment);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
afterNode.containments.forEach((afterContainment, index) => {
|
|
69
|
+
const afterKey = afterContainment.containment.key;
|
|
70
|
+
const beforeContainment = NodeUtils.findChild(beforeNode, afterKey);
|
|
71
|
+
if (beforeContainment === undefined) {
|
|
72
|
+
if (afterContainment.children.length !== 0) {
|
|
73
|
+
afterContainment.children.forEach(childId => {
|
|
74
|
+
this.change(new ChildAdded(ctx.concat("containments", index), afterNode, afterContainment.containment, afterContainment, childId, Missing.MissingBefore));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// No else, has already been done
|
|
79
|
+
});
|
|
80
|
+
beforeNode.references.forEach((beforeReference, index) => {
|
|
81
|
+
const afterReference = NodeUtils.findReference(afterNode, beforeReference.reference);
|
|
82
|
+
if (afterReference === undefined) {
|
|
83
|
+
if (beforeReference.targets.length !== 0) {
|
|
84
|
+
beforeReference.targets.forEach(target => {
|
|
85
|
+
this.change(new TargetRemoved(ctx.concat("references", index), afterNode, beforeReference, afterReference, target, Missing.MissingAfter));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.diffLwReference(ctx.concat("references", index), beforeNode, beforeReference, afterReference);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
afterNode.references.forEach((afterReference, index) => {
|
|
94
|
+
const beforeReference = NodeUtils.findReference(afterNode, afterReference.reference);
|
|
95
|
+
if (beforeReference === undefined) {
|
|
96
|
+
if (afterReference.targets.length !== 0) {
|
|
97
|
+
afterReference.targets.forEach(target => {
|
|
98
|
+
this.change(new TargetAdded(ctx.concat("references", index), afterNode, beforeReference, afterReference, target, Missing.MissingBefore));
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
if (beforeNode.annotations !== undefined && afterNode.annotations !== undefined) {
|
|
104
|
+
let annotationDiffFound = false;
|
|
105
|
+
beforeNode.annotations.forEach((beforeAnn, index) => {
|
|
106
|
+
if (!afterNode.annotations.includes(beforeAnn)) {
|
|
107
|
+
annotationDiffFound = true;
|
|
108
|
+
this.change(new AnnotationRemoved(ctx, beforeNode, afterNode, beforeAnn, index));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
afterNode.annotations.forEach((afterAnn, index) => {
|
|
112
|
+
if (!beforeNode.annotations.includes(afterAnn)) {
|
|
113
|
+
annotationDiffFound = true;
|
|
114
|
+
this.change(new AnnotationAdded(ctx, beforeNode, afterNode, afterAnn, index));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (!annotationDiffFound) {
|
|
118
|
+
for (let i = 0; i < afterNode.annotations.length; i++) {
|
|
119
|
+
if (afterNode.annotations[i] !== beforeNode.annotations[i]) {
|
|
120
|
+
this.change(new AnnotationOrderChanged(ctx.concat("annotations"), beforeNode, afterNode, "", i));
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
diffLwChunk(beforeChunk, afterChunk) {
|
|
128
|
+
const ctx = new JsonContext(null, ["$"]);
|
|
129
|
+
if (beforeChunk.serializationFormatVersion !== afterChunk.serializationFormatVersion) {
|
|
130
|
+
this.change(new SerializationFormatChange(ctx.concat("serializationFormatVersion"), beforeChunk.serializationFormatVersion, afterChunk.serializationFormatVersion));
|
|
131
|
+
}
|
|
132
|
+
beforeChunk.languages.forEach((beforeLanguage, index) => {
|
|
133
|
+
const afterLanguage = ChunkUtils.findLwUsedLanguage(afterChunk, beforeLanguage.key);
|
|
134
|
+
if (afterLanguage === null) {
|
|
135
|
+
this.change(new LanguageRemoved(ctx.concat("languages", index), beforeLanguage));
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.diffLwUsedLanguage(ctx.concat("languages", index), beforeLanguage, afterLanguage);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
afterChunk.languages.forEach((afterLanguage, index) => {
|
|
142
|
+
const beforeLanguage = ChunkUtils.findLwUsedLanguage(beforeChunk, afterLanguage.key);
|
|
143
|
+
if (beforeLanguage === null) {
|
|
144
|
+
this.change(new LanguageAdded(ctx.concat("languages", index), afterLanguage));
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
beforeChunk.nodes.forEach((beforeNode, index) => {
|
|
148
|
+
const beforeId = beforeNode.id;
|
|
149
|
+
const afterNode = ChunkUtils.findNode(afterChunk, beforeId);
|
|
150
|
+
const newCtx = ctx.concat("nodes", index);
|
|
151
|
+
if (afterNode === null || afterNode === undefined) {
|
|
152
|
+
this.change(new NodeRemoved(ctx, beforeNode));
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.diffLwNode(newCtx, beforeNode, afterNode);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
afterChunk.nodes.forEach((afterNode, index) => {
|
|
159
|
+
const afterId = afterNode.id;
|
|
160
|
+
const beforeNode = ChunkUtils.findNode(beforeChunk, afterId);
|
|
161
|
+
if (beforeNode === null) {
|
|
162
|
+
this.change(new NodeAdded(ctx.concat("nodes", index), afterNode));
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
diffContainment(ctx, node, beforeContainment, afterContainment) {
|
|
167
|
+
if (!isEqualMetaPointer(beforeContainment.containment, afterContainment.containment)) {
|
|
168
|
+
console.error("diffContainment: MetaPointers of containments should be identical");
|
|
169
|
+
this.diff(ctx, `Containment Object has concept ${JSON.stringify(beforeContainment.containment)} vs ${JSON.stringify(afterContainment.containment)}`);
|
|
170
|
+
}
|
|
171
|
+
// Check whether children exist in both objects (two for loops)
|
|
172
|
+
// TODO Also check for the order that can be changed!!!
|
|
173
|
+
let changeFound = false;
|
|
174
|
+
for (const childId1 of beforeContainment.children) {
|
|
175
|
+
if (!afterContainment.children.includes(childId1)) {
|
|
176
|
+
changeFound = true;
|
|
177
|
+
this.change(new ChildRemoved(ctx, node, beforeContainment.containment, afterContainment, childId1));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
for (const childId2 of afterContainment.children) {
|
|
181
|
+
if (!beforeContainment.children.includes(childId2)) {
|
|
182
|
+
changeFound = true;
|
|
183
|
+
this.change(new ChildAdded(ctx, node, beforeContainment.containment, afterContainment, childId2));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (!changeFound) {
|
|
187
|
+
for (let i = 0; i < afterContainment.children.length; i++) {
|
|
188
|
+
if (afterContainment.children[i] !== beforeContainment.children[i]) {
|
|
189
|
+
this.change(new ChildOrderChanged(ctx.concat("children"), node, afterContainment.containment, afterContainment, ""));
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
diffLwReference(ctx, node, beforeRef, afterRef) {
|
|
196
|
+
if (!isEqualMetaPointer(beforeRef.reference, afterRef.reference)) {
|
|
197
|
+
console.error("diffContainment: MetaPointers of references should be identical");
|
|
198
|
+
this.diff(ctx, `Reference has concept ${JSON.stringify(beforeRef.reference)} vs ${JSON.stringify(afterRef.reference)}`);
|
|
199
|
+
}
|
|
200
|
+
let diffFound = false;
|
|
201
|
+
beforeRef.targets.forEach((beforeTarget, index) => {
|
|
202
|
+
const afterTarget = NodeUtils.findReferenceTarget(afterRef.targets, beforeTarget);
|
|
203
|
+
if (afterTarget === undefined) {
|
|
204
|
+
this.change(new TargetRemoved(ctx.concat("targets", index), node, beforeRef, afterRef, beforeTarget));
|
|
205
|
+
diffFound = true;
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
if (!isEqualReferenceTarget(beforeTarget, afterTarget)) {
|
|
209
|
+
this.diff(ctx.concat("targets", index), `ERROR: reference target ${JSON.stringify(beforeTarget)} vs ${JSON.stringify(afterTarget)}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
afterRef.targets.forEach((afterTarget, index) => {
|
|
214
|
+
const beforeTarget = NodeUtils.findReferenceTarget(beforeRef.targets, afterTarget);
|
|
215
|
+
if (beforeTarget === undefined) {
|
|
216
|
+
this.change(new TargetAdded(ctx.concat("targets", index), node, beforeRef, afterRef, afterTarget));
|
|
217
|
+
diffFound = true;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
if (!isEqualReferenceTarget(beforeTarget, afterTarget)) {
|
|
221
|
+
this.diff(ctx.concat("targets", index), `ERROR: reference target ${JSON.stringify(beforeTarget)} vs ${JSON.stringify(afterTarget)}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
if (!diffFound) {
|
|
226
|
+
for (let i = 0; i < beforeRef.targets.length; i++) {
|
|
227
|
+
if (!isEqualReferenceTarget(beforeRef.targets[i], afterRef.targets[i])) {
|
|
228
|
+
this.change(new TargetOrderChanged(ctx.concat("targets"), node, beforeRef, afterRef, beforeRef.targets[i]));
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
diffLwUsedLanguage(ctx, obj1, obj2) {
|
|
235
|
+
if (obj1.key !== obj2.key || obj1.version !== obj2.version) {
|
|
236
|
+
this.diff(ctx, `Different used languages ${JSON.stringify(obj1)} vs ${JSON.stringify(obj2)}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
diffLwProperty(ctx, node, beforeProperty, afterProperty) {
|
|
240
|
+
if (!isEqualMetaPointer(beforeProperty.property, afterProperty.property)) {
|
|
241
|
+
console.error("diffContainment: MetaPointers of properties should be identical");
|
|
242
|
+
this.diff(ctx, `Property Object has concept ${JSON.stringify(beforeProperty.property)} vs ${JSON.stringify(afterProperty.property)}`);
|
|
243
|
+
}
|
|
244
|
+
if (beforeProperty.value !== afterProperty.value) {
|
|
245
|
+
this.change(new PropertyValueChanged(ctx, node.id, beforeProperty.property, beforeProperty.value, afterProperty.value));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=LionWebJsonDiff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LionWebJsonDiff.js","sourceRoot":"","sources":["../src/LionWebJsonDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EAQzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAAU,aAAa,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAC5H,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC5F,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC/I,OAAO,EAAE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EAAE,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;QAC3H,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
2
|
+
export type ChangeType = "GenericChange" | "NodeRemoved" | "NodeAdded" | "ChildRemoved" | "ChildAdded" | "ParentChanged" | "PropertyValueChanged" | "SerializationFormatChange" | "PropertyRemoved" | "PropertyAdded" | "NodeClassifierChanged" | "ContainmentAdded" | "ContainmentRemoved" | "LanguageRemoved" | "LanguageAdded" | "TargetAdded" | "TargetRemoved" | "ReferenceRemoved" | "ReferenceAdded" | "AnnotationRemoved" | "AnnotationAdded" | "ChildOrderChanged" | "AnnotationOrderChanged" | "TargetOrderChanged";
|
|
3
|
+
/**
|
|
4
|
+
* Additionbal property in property, contauinment and reference changes to state
|
|
5
|
+
* that the whole property/ containment / reference definition is missing.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum Missing {
|
|
8
|
+
/**
|
|
9
|
+
* Both before and after have a definition for the property / containment / reference
|
|
10
|
+
*/
|
|
11
|
+
NotMissing = 0,
|
|
12
|
+
/**
|
|
13
|
+
* The definition is missing _before_ for the property / containment / reference
|
|
14
|
+
*/
|
|
15
|
+
MissingBefore = 1,
|
|
16
|
+
/**
|
|
17
|
+
* The definition is missing _after_ for the property / containment / reference
|
|
18
|
+
*/
|
|
19
|
+
MissingAfter = 2
|
|
20
|
+
}
|
|
21
|
+
export declare abstract class Change {
|
|
22
|
+
abstract readonly changeType: ChangeType;
|
|
23
|
+
context: JsonContext;
|
|
24
|
+
constructor(context: JsonContext);
|
|
25
|
+
protected abstract msg(): string;
|
|
26
|
+
changeMsg(): string;
|
|
27
|
+
}
|
|
28
|
+
export declare class GenericChange extends Change {
|
|
29
|
+
protected message: string;
|
|
30
|
+
readonly changeType = "GenericChange";
|
|
31
|
+
constructor(context: JsonContext, message: string);
|
|
32
|
+
protected msg(): string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=Change.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Change.d.ts","sourceRoot":"","sources":["../../src/changes/Change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,MAAM,MAAM,UAAU,GAChB,eAAe,GACf,aAAa,GACb,WAAW,GACX,cAAc,GACd,YAAY,GACZ,eAAe,GACf,sBAAsB,GACtB,2BAA2B,GAC3B,iBAAiB,GACjB,eAAe,GACf,uBAAuB,GACvB,kBAAkB,GAClB,oBAAoB,GACpB,iBAAiB,GACjB,eAAe,GACf,aAAa,GACb,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,oBAAoB,CAAA;AAE1B;;;GAGG;AACH,oBAAY,OAAO;IACf;;OAEG;IACH,UAAU,IAAA;IACV;;OAEG;IACH,aAAa,IAAA;IACb;;OAEG;IACH,YAAY,IAAA;CACf;AAED,8BAAsB,MAAM;IACxB,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IACxC,OAAO,EAAE,WAAW,CAAA;gBAER,OAAO,EAAE,WAAW;IAIhC,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM;IAEzB,SAAS,IAAI,MAAM;CAG7B;AAED,qBAAa,aAAc,SAAQ,MAAM;IAKjC,SAAS,CAAC,OAAO,EAAE,MAAM;IAJ7B,QAAQ,CAAC,UAAU,mBAAkB;gBAGjC,OAAO,EAAE,WAAW,EACV,OAAO,EAAE,MAAM;IAK7B,SAAS,CAAC,GAAG,IAAI,MAAM;CAG1B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additionbal property in property, contauinment and reference changes to state
|
|
3
|
+
* that the whole property/ containment / reference definition is missing.
|
|
4
|
+
*/
|
|
5
|
+
export var Missing;
|
|
6
|
+
(function (Missing) {
|
|
7
|
+
/**
|
|
8
|
+
* Both before and after have a definition for the property / containment / reference
|
|
9
|
+
*/
|
|
10
|
+
Missing[Missing["NotMissing"] = 0] = "NotMissing";
|
|
11
|
+
/**
|
|
12
|
+
* The definition is missing _before_ for the property / containment / reference
|
|
13
|
+
*/
|
|
14
|
+
Missing[Missing["MissingBefore"] = 1] = "MissingBefore";
|
|
15
|
+
/**
|
|
16
|
+
* The definition is missing _after_ for the property / containment / reference
|
|
17
|
+
*/
|
|
18
|
+
Missing[Missing["MissingAfter"] = 2] = "MissingAfter";
|
|
19
|
+
})(Missing || (Missing = {}));
|
|
20
|
+
export class Change {
|
|
21
|
+
constructor(context) {
|
|
22
|
+
this.context = context;
|
|
23
|
+
}
|
|
24
|
+
changeMsg() {
|
|
25
|
+
return `${this.changeType}: ${this.msg()} at ${this.context.toString()} `;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export class GenericChange extends Change {
|
|
29
|
+
constructor(context, message) {
|
|
30
|
+
super(context);
|
|
31
|
+
this.message = message;
|
|
32
|
+
this.changeType = "GenericChange";
|
|
33
|
+
}
|
|
34
|
+
msg() {
|
|
35
|
+
return this.message;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=Change.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Change.js","sourceRoot":"","sources":["../../src/changes/Change.ts"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,MAAM,CAAN,IAAY,OAaX;AAbD,WAAY,OAAO;IACf;;OAEG;IACH,iDAAU,CAAA;IACV;;OAEG;IACH,uDAAa,CAAA;IACb;;OAEG;IACH,qDAAY,CAAA;AAChB,CAAC,EAbW,OAAO,KAAP,OAAO,QAalB;AAED,MAAM,OAAgB,MAAM;IAIxB,YAAY,OAAoB;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;IAIM,SAAS;QACZ,OAAO,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,GAAG,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAA;IAC7E,CAAC;CACJ;AAED,MAAM,OAAO,aAAc,SAAQ,MAAM;IAGrC,YACI,OAAoB,EACV,OAAe;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAA;QAFJ,YAAO,GAAP,OAAO,CAAQ;QAJpB,eAAU,GAAG,eAAe,CAAA;IAOrC,CAAC;IAES,GAAG;QACT,OAAO,IAAI,CAAC,OAAO,CAAA;IACvB,CAAC;CACJ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LionWebJsonNode, LionWebJsonUsedLanguage } from "@lionweb/json";
|
|
2
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
3
|
+
import { Change } from "./Change.js";
|
|
4
|
+
export declare abstract class ChunkChange extends Change {
|
|
5
|
+
context: JsonContext;
|
|
6
|
+
constructor(context: JsonContext);
|
|
7
|
+
}
|
|
8
|
+
export declare class SerializationFormatChange extends ChunkChange {
|
|
9
|
+
context: JsonContext;
|
|
10
|
+
protected original: string;
|
|
11
|
+
protected newValue: string;
|
|
12
|
+
readonly changeType = "SerializationFormatChange";
|
|
13
|
+
constructor(context: JsonContext, original: string, newValue: string);
|
|
14
|
+
protected msg: () => string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NodeRemoved extends ChunkChange {
|
|
17
|
+
context: JsonContext;
|
|
18
|
+
node: LionWebJsonNode;
|
|
19
|
+
readonly changeType = "NodeRemoved";
|
|
20
|
+
constructor(context: JsonContext, node: LionWebJsonNode);
|
|
21
|
+
protected msg: () => string;
|
|
22
|
+
}
|
|
23
|
+
export declare class NodeAdded extends ChunkChange {
|
|
24
|
+
context: JsonContext;
|
|
25
|
+
node: LionWebJsonNode;
|
|
26
|
+
readonly changeType = "NodeAdded";
|
|
27
|
+
constructor(context: JsonContext, node: LionWebJsonNode);
|
|
28
|
+
protected msg: () => string;
|
|
29
|
+
}
|
|
30
|
+
export declare abstract class LanguageChange extends ChunkChange {
|
|
31
|
+
context: JsonContext;
|
|
32
|
+
language: LionWebJsonUsedLanguage;
|
|
33
|
+
constructor(context: JsonContext, language: LionWebJsonUsedLanguage);
|
|
34
|
+
}
|
|
35
|
+
export declare class LanguageRemoved extends LanguageChange {
|
|
36
|
+
readonly changeType = "LanguageRemoved";
|
|
37
|
+
protected msg: () => string;
|
|
38
|
+
}
|
|
39
|
+
export declare class LanguageAdded extends LanguageChange {
|
|
40
|
+
readonly changeType = "LanguageAdded";
|
|
41
|
+
protected msg: () => string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ChunkChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChunkChange.d.ts","sourceRoot":"","sources":["../../src/changes/ChunkChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,8BAAsB,WAAY,SAAQ,MAAM;IACzB,OAAO,EAAE,WAAW;gBAApB,OAAO,EAAE,WAAW;CAG1C;AAED,qBAAa,yBAA0B,SAAQ,WAAW;IAI3C,OAAO,EAAE,WAAW;IAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAC1B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAL9B,QAAQ,CAAC,UAAU,+BAA8B;gBAGtC,OAAO,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM;IAK9B,SAAS,CAAC,GAAG,eAAoF;CACpG;AAED,qBAAa,WAAY,SAAQ,WAAW;IAI7B,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,eAAe;IAJhC,QAAQ,CAAC,UAAU,iBAAgB;gBAGxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,eAAe;IAKhC,SAAS,CAAC,GAAG,eAA0C;CAC1D;AAED,qBAAa,SAAU,SAAQ,WAAW;IAI3B,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,eAAe;IAJhC,QAAQ,CAAC,UAAU,eAAc;gBAGtB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,eAAe;IAKhC,SAAS,CAAC,GAAG,eAAwC;CACxD;AAED,8BAAsB,cAAe,SAAQ,WAAW;IAEzC,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,uBAAuB;gBADjC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,uBAAuB;CAI/C;AAED,qBAAa,eAAgB,SAAQ,cAAc;IAC/C,QAAQ,CAAC,UAAU,qBAAoB;IACvC,SAAS,CAAC,GAAG,eAAkG;CAClH;AAED,qBAAa,aAAc,SAAQ,cAAc;IAC7C,QAAQ,CAAC,UAAU,mBAAkB;IACrC,SAAS,CAAC,GAAG,eAAgG;CAChH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Change } from "./Change.js";
|
|
2
|
+
export class ChunkChange extends Change {
|
|
3
|
+
constructor(context) {
|
|
4
|
+
super(context);
|
|
5
|
+
this.context = context;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export class SerializationFormatChange extends ChunkChange {
|
|
9
|
+
constructor(context, original, newValue) {
|
|
10
|
+
super(context);
|
|
11
|
+
this.context = context;
|
|
12
|
+
this.original = original;
|
|
13
|
+
this.newValue = newValue;
|
|
14
|
+
this.changeType = "SerializationFormatChange";
|
|
15
|
+
this.msg = () => `Serialization versions do not match: ${this.original} vs ${this.newValue}`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class NodeRemoved extends ChunkChange {
|
|
19
|
+
constructor(context, node) {
|
|
20
|
+
super(context);
|
|
21
|
+
this.context = context;
|
|
22
|
+
this.node = node;
|
|
23
|
+
this.changeType = "NodeRemoved";
|
|
24
|
+
this.msg = () => `Node ${this.node.id} is removed`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class NodeAdded extends ChunkChange {
|
|
28
|
+
constructor(context, node) {
|
|
29
|
+
super(context);
|
|
30
|
+
this.context = context;
|
|
31
|
+
this.node = node;
|
|
32
|
+
this.changeType = "NodeAdded";
|
|
33
|
+
this.msg = () => `Node ${this.node.id} is added`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class LanguageChange extends ChunkChange {
|
|
37
|
+
constructor(context, language) {
|
|
38
|
+
super(context);
|
|
39
|
+
this.context = context;
|
|
40
|
+
this.language = language;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export class LanguageRemoved extends LanguageChange {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.changeType = "LanguageRemoved";
|
|
47
|
+
this.msg = () => `Language with key ${this.language.key} and version ${this.language.version} is removed`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export class LanguageAdded extends LanguageChange {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
this.changeType = "LanguageAdded";
|
|
54
|
+
this.msg = () => `Language with key ${this.language.key} and version ${this.language.version} is added`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=ChunkChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChunkChange.js","sourceRoot":"","sources":["../../src/changes/ChunkChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,OAAgB,WAAY,SAAQ,MAAM;IAC5C,YAAmB,OAAoB;QACnC,KAAK,CAAC,OAAO,CAAC,CAAA;QADC,YAAO,GAAP,OAAO,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Ac;IAAnD;;QACa,eAAU,GAAG,iBAAiB,CAAA;QAC7B,QAAG,GAAG,GAAG,EAAE,CAAC,sBAAsB,IAAI,CAAC,QAAQ,CAAC,GAAG,gBAAgB,IAAI,CAAC,QAAQ,CAAC,OAAO,aAAa,CAAA;IACnH,CAAC;CAAA;AAED,MAAM,OAAO,aAAc,SAAQ,cAAc;IAAjD;;QACa,eAAU,GAAG,eAAe,CAAA;QAC3B,QAAG,GAAG,GAAG,EAAE,CAAC,sBAAsB,IAAI,CAAC,QAAQ,CAAC,GAAG,gBAAgB,IAAI,CAAC,QAAQ,CAAC,OAAO,WAAW,CAAA;IACjH,CAAC;CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LionWebId, LionWebJsonContainment, LionWebJsonMetaPointer, LionWebJsonNode } from "@lionweb/json";
|
|
2
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
3
|
+
import { Change, Missing } from "./Change.js";
|
|
4
|
+
export declare abstract class ContainmentChange extends Change {
|
|
5
|
+
context: JsonContext;
|
|
6
|
+
parentNode: LionWebJsonNode;
|
|
7
|
+
containment: LionWebJsonMetaPointer;
|
|
8
|
+
afterContainment: LionWebJsonContainment | undefined;
|
|
9
|
+
childId: LionWebId;
|
|
10
|
+
missing: Missing;
|
|
11
|
+
constructor(context: JsonContext, parentNode: LionWebJsonNode, containment: LionWebJsonMetaPointer, afterContainment: LionWebJsonContainment | undefined, childId: LionWebId, missing?: Missing);
|
|
12
|
+
}
|
|
13
|
+
export declare class ChildAdded extends ContainmentChange {
|
|
14
|
+
readonly changeType = "ChildAdded";
|
|
15
|
+
protected msg: () => string;
|
|
16
|
+
}
|
|
17
|
+
export declare class ChildRemoved extends ContainmentChange {
|
|
18
|
+
readonly changeType = "ChildRemoved";
|
|
19
|
+
protected msg: () => string;
|
|
20
|
+
}
|
|
21
|
+
export declare class ChildOrderChanged extends ContainmentChange {
|
|
22
|
+
readonly changeType = "ChildOrderChanged";
|
|
23
|
+
protected msg: () => string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ContainmentChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContainmentChange.d.ts","sourceRoot":"","sources":["../../src/changes/ContainmentChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7C,8BAAsB,iBAAkB,SAAQ,MAAM;IAEvC,OAAO,EAAE,WAAW;IACpB,UAAU,EAAE,eAAe;IAC3B,WAAW,EAAE,sBAAsB;IACnC,gBAAgB,EAAE,sBAAsB,GAAG,SAAS;IACpD,OAAO,EAAE,SAAS;IAClB,OAAO;gBALP,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,sBAAsB,EACnC,gBAAgB,EAAE,sBAAsB,GAAG,SAAS,EACpD,OAAO,EAAE,SAAS,EAClB,OAAO,UAAqB;CAI1C;AAED,qBAAa,UAAW,SAAQ,iBAAiB;IAC7C,QAAQ,CAAC,UAAU,gBAAe;IAClC,SAAS,CAAC,GAAG,eAA4G;CAC5H;AAED,qBAAa,YAAa,SAAQ,iBAAiB;IAC/C,QAAQ,CAAC,UAAU,kBAAiB;IACpC,SAAS,CAAC,GAAG,eAAkH;CAClI;AAED,qBAAa,iBAAkB,SAAQ,iBAAiB;IACpD,QAAQ,CAAC,UAAU,uBAAsB;IACzC,SAAS,CAAC,GAAG,eAA0G;CAC1H"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Change, Missing } from "./Change.js";
|
|
2
|
+
export class ContainmentChange extends Change {
|
|
3
|
+
constructor(context, parentNode, containment, afterContainment, childId, missing = Missing.NotMissing) {
|
|
4
|
+
super(context);
|
|
5
|
+
this.context = context;
|
|
6
|
+
this.parentNode = parentNode;
|
|
7
|
+
this.containment = containment;
|
|
8
|
+
this.afterContainment = afterContainment;
|
|
9
|
+
this.childId = childId;
|
|
10
|
+
this.missing = missing;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class ChildAdded extends ContainmentChange {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.changeType = "ChildAdded";
|
|
17
|
+
this.msg = () => `Node "${this.parentNode.id}" added child "${this.childId}" to containment ${this.containment.key}`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class ChildRemoved extends ContainmentChange {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.changeType = "ChildRemoved";
|
|
24
|
+
this.msg = () => `Node "${this.parentNode.id}" removed child "${this.childId}" from containment "${this.containment.key}"`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class ChildOrderChanged extends ContainmentChange {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.changeType = "ChildOrderChanged";
|
|
31
|
+
this.msg = () => `Node "${this.parentNode.id}" changed order of children in containment "${this.containment.key}"`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ContainmentChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContainmentChange.js","sourceRoot":"","sources":["../../src/changes/ContainmentChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,OAAgB,iBAAkB,SAAQ,MAAM;IAClD,YACW,OAAoB,EACpB,UAA2B,EAC3B,WAAmC,EACnC,gBAAoD,EACpD,OAAkB,EAClB,UAAU,OAAO,CAAC,UAAU;QAEnC,KAAK,CAAC,OAAO,CAAC,CAAA;QAPP,YAAO,GAAP,OAAO,CAAa;QACpB,eAAU,GAAV,UAAU,CAAiB;QAC3B,gBAAW,GAAX,WAAW,CAAwB;QACnC,qBAAgB,GAAhB,gBAAgB,CAAoC;QACpD,YAAO,GAAP,OAAO,CAAW;QAClB,YAAO,GAAP,OAAO,CAAqB;IAGvC,CAAC;CACJ;AAED,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAAjD;;QACa,eAAU,GAAG,YAAY,CAAA;QACxB,QAAG,GAAG,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,kBAAkB,IAAI,CAAC,OAAO,oBAAoB,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;IAC7H,CAAC;CAAA;AAED,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAAnD;;QACa,eAAU,GAAG,cAAc,CAAA;QAC1B,QAAG,GAAG,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,oBAAoB,IAAI,CAAC,OAAO,uBAAuB,IAAI,CAAC,WAAW,CAAC,GAAG,GAAG,CAAA;IACnI,CAAC;CAAA;AAED,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IAAxD;;QACa,eAAU,GAAG,mBAAmB,CAAA;QAC/B,QAAG,GAAG,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,+CAA+C,IAAI,CAAC,WAAW,CAAC,GAAG,GAAG,CAAA;IAC3H,CAAC;CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LionWebId, LionWebJsonMetaPointer, LionWebJsonNode } from "@lionweb/json";
|
|
2
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
3
|
+
import { Change, ChangeType } from "./Change.js";
|
|
4
|
+
export declare class NodeClassifierChanged extends Change {
|
|
5
|
+
context: JsonContext;
|
|
6
|
+
node: LionWebJsonNode;
|
|
7
|
+
oldClassifier: LionWebJsonMetaPointer;
|
|
8
|
+
newClassifier: LionWebJsonMetaPointer;
|
|
9
|
+
readonly changeType: ChangeType;
|
|
10
|
+
constructor(context: JsonContext, node: LionWebJsonNode, oldClassifier: LionWebJsonMetaPointer, newClassifier: LionWebJsonMetaPointer);
|
|
11
|
+
protected msg: () => string;
|
|
12
|
+
}
|
|
13
|
+
export declare class ParentChanged extends Change {
|
|
14
|
+
context: JsonContext;
|
|
15
|
+
node: LionWebJsonNode;
|
|
16
|
+
beforeParentId: LionWebId | null;
|
|
17
|
+
afterParentId: LionWebId | null;
|
|
18
|
+
readonly changeType = "ParentChanged";
|
|
19
|
+
constructor(context: JsonContext, node: LionWebJsonNode, beforeParentId: LionWebId | null, afterParentId: LionWebId | null);
|
|
20
|
+
protected msg: () => string;
|
|
21
|
+
}
|
|
22
|
+
export declare abstract class AnnotationChange extends Change {
|
|
23
|
+
nodeBefore: LionWebJsonNode;
|
|
24
|
+
nodeAfter: LionWebJsonNode;
|
|
25
|
+
annotationId: LionWebId;
|
|
26
|
+
index: number;
|
|
27
|
+
constructor(ctx: JsonContext, nodeBefore: LionWebJsonNode, nodeAfter: LionWebJsonNode, annotationId: LionWebId, index: number);
|
|
28
|
+
}
|
|
29
|
+
export declare class AnnotationRemoved extends AnnotationChange {
|
|
30
|
+
readonly changeType = "AnnotationRemoved";
|
|
31
|
+
protected msg: () => string;
|
|
32
|
+
}
|
|
33
|
+
export declare class AnnotationAdded extends AnnotationChange {
|
|
34
|
+
readonly changeType = "AnnotationAdded";
|
|
35
|
+
protected msg: () => string;
|
|
36
|
+
}
|
|
37
|
+
export declare class AnnotationOrderChanged extends AnnotationChange {
|
|
38
|
+
readonly changeType = "AnnotationOrderChanged";
|
|
39
|
+
protected msg: () => string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=NodeChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeChange.d.ts","sourceRoot":"","sources":["../../src/changes/NodeChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAA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,qBAAoB;IAEvC,SAAS,CAAC,GAAG,eAA8E;CAC9F;AAED,qBAAa,sBAAuB,SAAQ,gBAAgB;IACxD,QAAQ,CAAC,UAAU,4BAA2B;IAC9C,SAAS,CAAC,GAAG,eAAmE;CACnF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Change } from "./Change.js";
|
|
2
|
+
export class NodeClassifierChanged extends Change {
|
|
3
|
+
constructor(context, node, oldClassifier, newClassifier) {
|
|
4
|
+
super(context);
|
|
5
|
+
this.context = context;
|
|
6
|
+
this.node = node;
|
|
7
|
+
this.oldClassifier = oldClassifier;
|
|
8
|
+
this.newClassifier = newClassifier;
|
|
9
|
+
this.changeType = "NodeClassifierChanged";
|
|
10
|
+
this.msg = () => `Object ${this.node.id} has classifier changed from ${this.oldClassifier.key} to ${this.newClassifier.key}`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class ParentChanged extends Change {
|
|
14
|
+
constructor(context, node, beforeParentId, afterParentId) {
|
|
15
|
+
super(context);
|
|
16
|
+
this.context = context;
|
|
17
|
+
this.node = node;
|
|
18
|
+
this.beforeParentId = beforeParentId;
|
|
19
|
+
this.afterParentId = afterParentId;
|
|
20
|
+
this.changeType = "ParentChanged";
|
|
21
|
+
this.msg = () => `Node "${this.node.id}" changed parent from "${this.beforeParentId}" to "${this.afterParentId}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class AnnotationChange extends Change {
|
|
25
|
+
constructor(ctx, nodeBefore, nodeAfter, annotationId, index) {
|
|
26
|
+
super(ctx);
|
|
27
|
+
this.nodeBefore = nodeBefore;
|
|
28
|
+
this.nodeAfter = nodeAfter;
|
|
29
|
+
this.annotationId = annotationId;
|
|
30
|
+
this.index = index;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export class AnnotationRemoved extends AnnotationChange {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.changeType = "AnnotationRemoved";
|
|
37
|
+
this.msg = () => `Node "${this.nodeBefore.id}" removed annotation "${this.annotationId}"`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class AnnotationAdded extends AnnotationChange {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.changeType = "AnnotationAdded";
|
|
44
|
+
this.msg = () => `Node "${this.nodeAfter.id}" added annotation "${this.annotationId}"`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export class AnnotationOrderChanged extends AnnotationChange {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
this.changeType = "AnnotationOrderChanged";
|
|
51
|
+
this.msg = () => `Node "${this.nodeAfter.id}" changed order of annotations`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=NodeChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeChange.js","sourceRoot":"","sources":["../../src/changes/NodeChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,aAAa,CAAA;AAEhD,MAAM,OAAO,qBAAsB,SAAQ,MAAM;IAG7C,YACW,OAAoB,EACpB,IAAqB,EACrB,aAAqC,EACrC,aAAqC;QAE5C,KAAK,CAAC,OAAO,CAAC,CAAA;QALP,YAAO,GAAP,OAAO,CAAa;QACpB,SAAI,GAAJ,IAAI,CAAiB;QACrB,kBAAa,GAAb,aAAa,CAAwB;QACrC,kBAAa,GAAb,aAAa,CAAwB;QANvC,eAAU,GAAe,uBAAuB,CAAA;QAW/C,QAAG,GAAG,GAAG,EAAE,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,EAAE,gCAAgC,IAAI,CAAC,aAAa,CAAC,GAAG,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;IAFjI,CAAC;CAGJ;AAED,MAAM,OAAO,aAAc,SAAQ,MAAM;IAGrC,YACW,OAAoB,EACpB,IAAqB,EACrB,c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AAE,gCAAgC,CAAA;IACpF,CAAC;CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LionWebId, LionWebJsonMetaPointer, LionWebJsonNode } from "@lionweb/json";
|
|
2
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
3
|
+
import { Change, Missing } from "./Change.js";
|
|
4
|
+
export declare abstract class PropertyChange extends Change {
|
|
5
|
+
context: JsonContext;
|
|
6
|
+
nodeId: LionWebId;
|
|
7
|
+
property: LionWebJsonMetaPointer;
|
|
8
|
+
oldValue: string | null;
|
|
9
|
+
newValue: string | null;
|
|
10
|
+
missing: Missing;
|
|
11
|
+
constructor(context: JsonContext, nodeId: LionWebId, property: LionWebJsonMetaPointer, oldValue: string | null, newValue: string | null, missing?: Missing);
|
|
12
|
+
}
|
|
13
|
+
export declare class PropertyValueChanged extends PropertyChange {
|
|
14
|
+
readonly changeType = "PropertyValueChanged";
|
|
15
|
+
protected msg: () => string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PropertyAdded extends Change {
|
|
18
|
+
node: LionWebJsonNode;
|
|
19
|
+
property: LionWebJsonMetaPointer;
|
|
20
|
+
readonly changeType = "PropertyAdded";
|
|
21
|
+
constructor(ctx: JsonContext, node: LionWebJsonNode, property: LionWebJsonMetaPointer);
|
|
22
|
+
protected msg: () => string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=PropertyChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyChange.d.ts","sourceRoot":"","sources":["../../src/changes/PropertyChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7C,8BAAsB,cAAe,SAAQ,MAAM;IAEpC,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,sBAAsB;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI;IACvB,OAAO,EAAE,OAAO;gBALhB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,OAAO,GAAE,OAA4B;CAInD;AAED,qBAAa,oBAAqB,SAAQ,cAAc;IACpD,QAAQ,CAAC,UAAU,0BAAyB;IAC5C,SAAS,CAAC,GAAG,eAC4G;CAC5H;AAED,qBAAa,aAAc,SAAQ,MAAM;IAI1B,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,sBAAsB;IAJ3C,QAAQ,CAAC,UAAU,mBAAkB;gBAEjC,GAAG,EAAE,WAAW,EACT,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,sBAAsB;IAK3C,SAAS,CAAC,GAAG,eAAuF;CACvG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Change, Missing } from "./Change.js";
|
|
2
|
+
export class PropertyChange extends Change {
|
|
3
|
+
constructor(context, nodeId, property, oldValue, newValue, missing = Missing.NotMissing) {
|
|
4
|
+
super(context);
|
|
5
|
+
this.context = context;
|
|
6
|
+
this.nodeId = nodeId;
|
|
7
|
+
this.property = property;
|
|
8
|
+
this.oldValue = oldValue;
|
|
9
|
+
this.newValue = newValue;
|
|
10
|
+
this.missing = missing;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class PropertyValueChanged extends PropertyChange {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.changeType = "PropertyValueChanged";
|
|
17
|
+
this.msg = () => `Node "${this.nodeId} changed value of property "${this.property.key}" from "${this.oldValue}" to "${this.newValue}"`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class PropertyAdded extends Change {
|
|
21
|
+
constructor(ctx, node, property) {
|
|
22
|
+
super(ctx);
|
|
23
|
+
this.node = node;
|
|
24
|
+
this.property = property;
|
|
25
|
+
this.changeType = "PropertyAdded";
|
|
26
|
+
this.msg = () => `Node "${this.node.id}" containment added: "${JSON.stringify(this.property)}"`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=PropertyChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyChange.js","sourceRoot":"","sources":["../../src/changes/PropertyChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,OAAgB,cAAe,SAAQ,MAAM;IAC/C,YACW,OAAoB,EACpB,MAAiB,EACjB,QAAgC,EAChC,QAAuB,EACvB,QAAuB,EACvB,UAAmB,OAAO,CAAC,UAAU;QAE5C,KAAK,CAAC,OAAO,CAAC,CAAA;QAPP,YAAO,GAAP,OAAO,CAAa;QACpB,WAAM,GAAN,MAAM,CAAW;QACjB,aAAQ,GAAR,QAAQ,CAAwB;QAChC,aAAQ,GAAR,QAAQ,CAAe;QACvB,aAAQ,GAAR,QAAQ,CAAe;QACvB,YAAO,GAAP,OAAO,CAA8B;IAGhD,CAAC;CACJ;AAED,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAAxD;;QACa,eAAU,GAAG,sBAAsB,CAAA;QAClC,QAAG,GAAG,GAAG,EAAE,CACjB,SAAS,IAAI,CAAC,MAAM,+BAA+B,IAAI,CAAC,QAAQ,CAAC,GAAG,WAAW,IAAI,CAAC,QAAQ,SAAS,IAAI,CAAC,QAAQ,GAAG,CAAA;IAC7H,CAAC;CAAA;AAED,MAAM,OAAO,aAAc,SAAQ,MAAM;IAErC,YACI,GAAgB,EACT,IAAqB,EACrB,QAAgC;QAEvC,KAAK,CAAC,GAAG,CAAC,CAAA;QAHH,SAAI,GAAJ,IAAI,CAAiB;QACrB,aAAQ,GAAR,QAAQ,CAAwB;QAJlC,eAAU,GAAG,eAAe,CAAA;QAS3B,QAAG,GAAG,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAA;IAFpG,CAAC;CAGJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LionWebJsonNode, LionWebJsonReference, LionWebJsonReferenceTarget } from "@lionweb/json";
|
|
2
|
+
import { JsonContext } from "@lionweb/json-utils";
|
|
3
|
+
import { Change, Missing } from "./Change.js";
|
|
4
|
+
export declare abstract class ReferenceChange extends Change {
|
|
5
|
+
context: JsonContext;
|
|
6
|
+
node: LionWebJsonNode;
|
|
7
|
+
beforeReference: LionWebJsonReference | undefined;
|
|
8
|
+
afterReference: LionWebJsonReference | undefined;
|
|
9
|
+
target: LionWebJsonReferenceTarget;
|
|
10
|
+
missing: Missing;
|
|
11
|
+
constructor(context: JsonContext, node: LionWebJsonNode, beforeReference: LionWebJsonReference | undefined, afterReference: LionWebJsonReference | undefined, target: LionWebJsonReferenceTarget, missing?: Missing);
|
|
12
|
+
}
|
|
13
|
+
export declare class TargetAdded extends ReferenceChange {
|
|
14
|
+
readonly changeType = "TargetAdded";
|
|
15
|
+
protected msg: () => string;
|
|
16
|
+
}
|
|
17
|
+
export declare class TargetRemoved extends ReferenceChange {
|
|
18
|
+
readonly changeType = "TargetRemoved";
|
|
19
|
+
protected msg: () => string;
|
|
20
|
+
}
|
|
21
|
+
export declare class TargetOrderChanged extends ReferenceChange {
|
|
22
|
+
readonly changeType = "TargetOrderChanged";
|
|
23
|
+
protected msg: () => string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ReferenceChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceChange.d.ts","sourceRoot":"","sources":["../../src/changes/ReferenceChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7C,8BAAsB,eAAgB,SAAQ,MAAM;IAErC,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,eAAe;IACrB,eAAe,EAAE,oBAAoB,GAAG,SAAS;IACjD,cAAc,EAAE,oBAAoB,GAAG,SAAS;IAChD,MAAM,EAAE,0BAA0B;IAClC,OAAO;gBALP,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,eAAe,EACrB,eAAe,EAAE,oBAAoB,GAAG,SAAS,EACjD,cAAc,EAAE,oBAAoB,GAAG,SAAS,EAChD,MAAM,EAAE,0BAA0B,EAClC,OAAO,UAAqB;CAI1C;AAED,qBAAa,WAAY,SAAQ,eAAe;IAC5C,QAAQ,CAAC,UAAU,iBAAgB;IACnC,SAAS,CAAC,GAAG,eAC8G;CAC9H;AAED,qBAAa,aAAc,SAAQ,eAAe;IAC9C,QAAQ,CAAC,UAAU,mBAAkB;IACrC,SAAS,CAAC,GAAG,eACmH;CACnI;AAED,qBAAa,kBAAmB,SAAQ,eAAe;IACnD,QAAQ,CAAC,UAAU,wBAAuB;IAC1C,SAAS,CAAC,GAAG,eAAgH;CAChI"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Change, Missing } from "./Change.js";
|
|
2
|
+
export class ReferenceChange extends Change {
|
|
3
|
+
constructor(context, node, beforeReference, afterReference, target, missing = Missing.NotMissing) {
|
|
4
|
+
super(context);
|
|
5
|
+
this.context = context;
|
|
6
|
+
this.node = node;
|
|
7
|
+
this.beforeReference = beforeReference;
|
|
8
|
+
this.afterReference = afterReference;
|
|
9
|
+
this.target = target;
|
|
10
|
+
this.missing = missing;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class TargetAdded extends ReferenceChange {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.changeType = "TargetAdded";
|
|
17
|
+
this.msg = () => `Node "${this.node.id}" added target "${this.target.reference}" to reference "${this?.afterReference?.reference?.key}"`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class TargetRemoved extends ReferenceChange {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.changeType = "TargetRemoved";
|
|
24
|
+
this.msg = () => `Node "${this.node.id}" removed target "${this.target.reference}" from reference "${this?.beforeReference?.reference?.key}"`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class TargetOrderChanged extends ReferenceChange {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.changeType = "TargetOrderChanged";
|
|
31
|
+
this.msg = () => `Node "${this.node.id}" changed order of targets in reference "${this.afterReference?.reference?.key}"`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ReferenceChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceChange.js","sourceRoot":"","sources":["../../src/changes/ReferenceChange.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,OAAgB,eAAgB,SAAQ,MAAM;IAChD,YACW,OAAoB,EACpB,IAAqB,EACrB,eAAiD,EACjD,cAAgD,EAChD,MAAkC,EAClC,UAAU,OAAO,CAAC,UAAU;QAEnC,KAAK,CAAC,OAAO,CAAC,CAAA;QAPP,YAAO,GAAP,OAAO,CAAa;QACpB,SAAI,GAAJ,IAAI,CAAiB;QACrB,oBAAe,GAAf,eAAe,CAAkC;QACjD,mBAAc,GAAd,cAAc,CAAkC;QAChD,WAAM,GAAN,MAAM,CAA4B;QAClC,YAAO,GAAP,OAAO,CAAqB;IAGvC,CAAC;CACJ;AAED,MAAM,OAAO,WAAY,SAAQ,eAAe;IAAhD;;QACa,eAAU,GAAG,aAAa,CAAA;QACzB,QAAG,GAAG,GAAG,EAAE,CACjB,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,mBAAmB,IAAI,CAAC,MAAM,CAAC,SAAS,mBAAmB,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,GAAG,CAAA;IAC/H,CAAC;CAAA;AAED,MAAM,OAAO,aAAc,SAAQ,eAAe;IAAlD;;QACa,eAAU,GAAG,eAAe,CAAA;QAC3B,QAAG,GAAG,GAAG,EAAE,CACjB,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,qBAAqB,IAAI,CAAC,MAAM,CAAC,SAAS,qBAAqB,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,GAAG,CAAA;IACpI,CAAC;CAAA;AAED,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IAAvD;;QACa,eAAU,GAAG,oBAAoB,CAAA;QAChC,QAAG,GAAG,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,4CAA4C,IAAI,CAAC,cAAc,EAAE,SAAS,EAAE,GAAG,GAAG,CAAA;IACjI,CAAC;CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/changes/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/changes/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lionweb/json-diff",
|
|
3
|
+
"version": "0.6.13-beta.5",
|
|
4
|
+
"description": "Find diff between LionWeb JSON chunks",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/LionWeb-io/lionweb-typescript.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/LionWeb-io/lionweb-typescript/issues"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"clean": "rm -rf dist/ lionweb-json-diff-*.tgz",
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"lint": "eslint src",
|
|
21
|
+
"pre-release-either": "npm run clean && npm install && npm run build",
|
|
22
|
+
"prerelease": "npm run pre-release-either",
|
|
23
|
+
"release": "npm publish",
|
|
24
|
+
"prerelease-beta": "npm run pre-release-either",
|
|
25
|
+
"release-beta": "npm publish --tag beta"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@lionweb/json": "0.6.13-beta.5",
|
|
29
|
+
"@lionweb/json-utils": "0.6.13-beta.5"
|
|
30
|
+
}
|
|
31
|
+
}
|