@cocreate/socket-server 1.28.0 → 1.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/docs/index.html +0 -6
- package/package.json +1 -1
- package/src/index.js +13 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.28.2](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.28.1...v1.28.2) (2024-02-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* data.socket removal before sending ([ed9b6a1](https://github.com/CoCreate-app/CoCreate-socket-server/commit/ed9b6a19e8da58a48f5eabd44b2419cc13f3c433))
|
|
7
|
+
|
|
8
|
+
## [1.28.1](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.28.0...v1.28.1) (2024-02-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Removed https://cdn.cocreate.app/latest/CoCreate.min.css ([f16de7e](https://github.com/CoCreate-app/CoCreate-socket-server/commit/f16de7e2b2f5d985b754eb19a36426ea5e49632e))
|
|
14
|
+
|
|
1
15
|
# [1.28.0](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.27.1...v1.28.0) (2024-01-30)
|
|
2
16
|
|
|
3
17
|
|
package/docs/index.html
CHANGED
|
@@ -18,12 +18,6 @@
|
|
|
18
18
|
content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
19
19
|
<meta name="robots" content="index,follow" />
|
|
20
20
|
|
|
21
|
-
<!-- CoCreate CSS -->
|
|
22
|
-
<link
|
|
23
|
-
rel="stylesheet"
|
|
24
|
-
href="https://cdn.cocreate.app/latest/CoCreate.min.css"
|
|
25
|
-
type="text/css" />
|
|
26
|
-
|
|
27
21
|
<link rel="manifest" href="/manifest.json" />
|
|
28
22
|
</head>
|
|
29
23
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -460,6 +460,7 @@ class SocketServer extends EventEmitter {
|
|
|
460
460
|
} else {
|
|
461
461
|
const sent = []
|
|
462
462
|
|
|
463
|
+
//TODO: get socket using clientId if socket has been deleted from data
|
|
463
464
|
const authorized = await this.authorize.check(data, socket.user_id)
|
|
464
465
|
if (authorized && authorized.authorized)
|
|
465
466
|
data = authorized.authorized
|
|
@@ -478,21 +479,27 @@ class SocketServer extends EventEmitter {
|
|
|
478
479
|
|
|
479
480
|
let sockets = this.get(data);
|
|
480
481
|
|
|
481
|
-
delete data.socket
|
|
482
|
+
// delete data.socket
|
|
482
483
|
|
|
483
484
|
for (let i = 0; i < sockets.length; i++) {
|
|
484
485
|
if (!sockets[i])
|
|
485
486
|
continue
|
|
486
487
|
|
|
487
488
|
const authorized = await this.authorize.check(data, sockets[i].user_id)
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
let Data
|
|
490
|
+
if (authorized && authorized.authorized) {
|
|
491
|
+
Data = { ...authorized.authorized }
|
|
492
|
+
} else {
|
|
493
|
+
Data = { ...data }
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
delete Data.socket
|
|
497
|
+
sockets[i].send(JSON.stringify(Data));
|
|
498
|
+
|
|
492
499
|
sent.push(socket.clientId)
|
|
493
500
|
this.emit("setBandwidth", {
|
|
494
501
|
type: 'out',
|
|
495
|
-
data:
|
|
502
|
+
data: Data,
|
|
496
503
|
organization_id: socket.organization_id
|
|
497
504
|
})
|
|
498
505
|
}
|