@cocreate/crdt 1.23.1 → 1.23.3
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 +14 -0
- package/package.json +1 -2
- package/src/index.js +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.23.3](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.23.2...v1.23.3) (2023-10-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* removed @cocreate/message-client ([8cd41ca](https://github.com/CoCreate-app/CoCreate-crdt/commit/8cd41ca5059e0b2852aa9d0cf7038eb087eab996))
|
|
7
|
+
|
|
8
|
+
## [1.23.2](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.23.1...v1.23.2) (2023-10-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* applied status resolve ([74b2804](https://github.com/CoCreate-app/CoCreate-crdt/commit/74b28045eb31042a7f63e0082de2a9fec2b09888))
|
|
14
|
+
|
|
1
15
|
## [1.23.1](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.23.0...v1.23.1) (2023-10-16)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/crdt",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.3",
|
|
4
4
|
"description": "CoCreate crdt",
|
|
5
5
|
"author": "CoCreate LLC",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@cocreate/crud-client": "^1.28.4",
|
|
44
44
|
"@cocreate/local-storage": "^1.10.5",
|
|
45
|
-
"@cocreate/message-client": "^1.8.3",
|
|
46
45
|
"@cocreate/utils": "^1.25.3"
|
|
47
46
|
}
|
|
48
47
|
}
|
package/src/index.js
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
/*globals config, atob, btoa, localStorage, CustomEvent*/
|
|
24
24
|
import crud from '@cocreate/crud-client';
|
|
25
|
-
import message from '@cocreate/message-client';
|
|
26
25
|
import uuid from '@cocreate/uuid';
|
|
27
26
|
import localStorage from '@cocreate/local-storage';
|
|
28
27
|
|
|
@@ -61,6 +60,7 @@ async function getDoc(data) {
|
|
|
61
60
|
if (!data.newObject) {
|
|
62
61
|
let response = await crud.send({
|
|
63
62
|
method: "read.object",
|
|
63
|
+
status: "resolve",
|
|
64
64
|
array: "crdt-transactions",
|
|
65
65
|
object: {
|
|
66
66
|
$filter: {
|
|
@@ -125,7 +125,7 @@ async function checkDb(data, flag) {
|
|
|
125
125
|
if (data.newObject)
|
|
126
126
|
string = data.newObject
|
|
127
127
|
else {
|
|
128
|
-
let response = await crud.send({ method: 'read.object', array, object: { _id: object, key } });
|
|
128
|
+
let response = await crud.send({ method: 'read.object', status: "resolve", array, object: { _id: object, key } });
|
|
129
129
|
string = crud.getValueFromObject(response.object[0], key);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -221,10 +221,10 @@ function insertChange(data, flag) {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
function broadcastChange(data) {
|
|
224
|
-
|
|
224
|
+
crud.socket.send({
|
|
225
|
+
method: "crdt",
|
|
225
226
|
broadcastSender: false,
|
|
226
227
|
broadcastBrowser: true,
|
|
227
|
-
message: "crdt",
|
|
228
228
|
data
|
|
229
229
|
});
|
|
230
230
|
}
|
|
@@ -267,7 +267,7 @@ function persistChange(data) {
|
|
|
267
267
|
crud.send(Data);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
crud.socket.listen('crdt', function (response) {
|
|
271
271
|
let data = response.data
|
|
272
272
|
let docName = getDocName(data);
|
|
273
273
|
let doc = docs.get(docName);
|