@cocreate/socket-server 1.21.8 → 1.21.10
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 +4 -4
- package/src/index.js +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.21.10](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.9...v1.21.10) (2023-11-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump dependencies for latest features ([1289fea](https://github.com/CoCreate-app/CoCreate-socket-server/commit/1289fead1840da1d092cb52d4b4bd71bb47c3d2b))
|
|
7
|
+
|
|
8
|
+
## [1.21.9](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.8...v1.21.9) (2023-11-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* sync console.log ([b49bb6a](https://github.com/CoCreate-app/CoCreate-socket-server/commit/b49bb6a2ccf8cf3f166b9f7acd511a28109202eb))
|
|
14
|
+
|
|
1
15
|
## [1.21.8](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.7...v1.21.8) (2023-11-09)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/socket-server",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.10",
|
|
4
4
|
"description": "CoCreate-socket-server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cocreate-socket",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://cocreate.app/docs/CoCreate-socket-server",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@cocreate/config": "^1.6.
|
|
44
|
-
"@cocreate/uuid": "^1.7.
|
|
45
|
-
"@cocreate/utils": "^1.
|
|
43
|
+
"@cocreate/config": "^1.6.8",
|
|
44
|
+
"@cocreate/uuid": "^1.7.4",
|
|
45
|
+
"@cocreate/utils": "^1.27.1",
|
|
46
46
|
"ws": "7.5.9"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/index.js
CHANGED
|
@@ -416,14 +416,17 @@ class SocketServer extends EventEmitter {
|
|
|
416
416
|
return
|
|
417
417
|
|
|
418
418
|
for (let i = 0; i < data.object.length; i++) {
|
|
419
|
-
data.object[i].data
|
|
420
|
-
|
|
419
|
+
if (data.object[i].data) {
|
|
420
|
+
data.object[i].data._id = data.object[i]._id
|
|
421
|
+
data.object[i].data.sync = true
|
|
421
422
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
423
|
+
const authorized = await this.authorize.check(data.object[i].data, socket.user_id)
|
|
424
|
+
if (authorized && authorized.authorized)
|
|
425
|
+
socket.send(JSON.stringify(authorized.authorized));
|
|
426
|
+
else
|
|
427
|
+
socket.send(JSON.stringify(data.object[i].data));
|
|
428
|
+
} else
|
|
429
|
+
console.log('server sync missing data')
|
|
427
430
|
}
|
|
428
431
|
} else {
|
|
429
432
|
const sent = []
|