@cocreate/socket-server 1.4.32 → 1.4.34
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 +15 -0
- package/docs/index.html +23 -56
- package/package.json +3 -3
- package/src/index.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.4.34](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.4.33...v1.4.34) (2022-12-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update demos and bump dependencies ([cb9c829](https://github.com/CoCreate-app/CoCreate-socket-server/commit/cb9c829b418d3f68842168ab2b340cf72bd3c167))
|
|
7
|
+
|
|
8
|
+
## [1.4.33](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.4.32...v1.4.33) (2022-12-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies ([0d0d214](https://github.com/CoCreate-app/CoCreate-socket-server/commit/0d0d214e741e987a9ef28417f5d5d9b004876bf0))
|
|
14
|
+
* reduce message userStatus ([4f9ba84](https://github.com/CoCreate-app/CoCreate-socket-server/commit/4f9ba847cd7cfa684f898907fdca58308b54484d))
|
|
15
|
+
|
|
1
16
|
## [1.4.32](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.4.31...v1.4.32) (2022-12-20)
|
|
2
17
|
|
|
3
18
|
|
package/docs/index.html
CHANGED
|
@@ -11,16 +11,8 @@
|
|
|
11
11
|
<meta name="robots" content="index,follow" />
|
|
12
12
|
|
|
13
13
|
<!-- CoCreate CSS -->
|
|
14
|
-
<link rel="stylesheet" href="https://
|
|
14
|
+
<link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css" />
|
|
15
15
|
|
|
16
|
-
<!-- Font Awesome -->
|
|
17
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" crossorigin="anonymous" />
|
|
18
|
-
|
|
19
|
-
<!-- Codemirror -->
|
|
20
|
-
<link rel="stylesheet" href="https://server.cocreate.app/CoCreate-plugins/CoCreate-codemirror/src/CoCreate-codemirror.css" type="text/css" />
|
|
21
|
-
<link rel=stylesheet href="https://codemirror.net/lib/codemirror.css" async defer>
|
|
22
|
-
|
|
23
|
-
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/themes/prism.min.css" rel="stylesheet" />
|
|
24
16
|
</head>
|
|
25
17
|
|
|
26
18
|
<body>
|
|
@@ -68,53 +60,28 @@
|
|
|
68
60
|
</div>
|
|
69
61
|
|
|
70
62
|
<div class="flex-grow:1 min-width:300px width:50% padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey">
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="svRow">
|
|
96
|
-
|
|
97
|
-
<div class="svColumn">
|
|
98
|
-
|
|
99
|
-
<div class="svPanel">
|
|
100
|
-
<div realtime="false"
|
|
101
|
-
collection="modules"
|
|
102
|
-
document_id="5eefe30952c6e94c75fb5e3f"
|
|
103
|
-
name="html"
|
|
104
|
-
id="7"
|
|
105
|
-
class="codemirror height:100% min-width:300px">
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="svSplitter svHorizontal"> </div>
|
|
109
|
-
|
|
110
|
-
<div class="svPanel">
|
|
111
|
-
<iframe get-value="7" frameBorder="0" height="100%" width="100%" class="min-width:300px"></iframe>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
<!-- End SandBox -->
|
|
63
|
+
<!-- SandBox -->
|
|
64
|
+
<div class="position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground">
|
|
65
|
+
|
|
66
|
+
<div id="demo-code" resizable class="position:relative height:50%">
|
|
67
|
+
<textarea type="code" lang="html" collection="demos" document_id="" name="demo" save="false" id="demo" class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
|
|
68
|
+
<div resize="bottom" class="background:lightgrey"></div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div id="demo-preview" class="position:relative display:flex height:100% background-color:white">
|
|
72
|
+
<div get-value="#demo" class="padding:20px"></div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
|
|
76
|
+
<a class="margin-right:10px" id="eye" show="#eye-slash" hide="#eye, #demo-preview" toggle="code-height" toggle-target="#demo-code"><i class="far fa-eye"></i></a>
|
|
77
|
+
<a class="margin-right:10px" hidden id="eye-slash" show="#eye, #demo-preview" hide="#eye-slash" toggle="code-height" toggle-target="#demo-code"><i class="fas fa-eye-slash"></i></a>
|
|
78
|
+
<a class="margin-right:10px" id="code" show="#code-slash" hide="#code, #demo-code"><i class="fa fa-code"></i></a>
|
|
79
|
+
<a class="margin-right:10px" hidden id="code-slash" show="#code, #demo-code" hide="#code-slash"><i class="fas fa-code"></i></a>
|
|
80
|
+
<a class="margin-right:5px" fullscreen target="#playground"><i class="fas fa-expand"></i></a>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
<!-- End SandBox -->
|
|
118
85
|
</div>
|
|
119
86
|
</div>
|
|
120
87
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/socket-server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.34",
|
|
4
4
|
"description": "CoCreate-socket-server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cocreate-socket",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://cocreate.app/docs/CoCreate-socket-server",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@cocreate/docs": "^1.4.
|
|
44
|
-
"@cocreate/uuid": "^1.2.
|
|
43
|
+
"@cocreate/docs": "^1.4.22",
|
|
44
|
+
"@cocreate/uuid": "^1.2.43"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"express": "^4.17.1",
|
package/src/index.js
CHANGED
|
@@ -64,6 +64,7 @@ class SocketServer extends EventEmitter{
|
|
|
64
64
|
|
|
65
65
|
addClient(socket) {
|
|
66
66
|
let organization_id = socket.config.organization_id
|
|
67
|
+
let user_id = socket.config.user_id
|
|
67
68
|
let key = socket.config.key
|
|
68
69
|
let room_clients = this.clients.get(key);
|
|
69
70
|
if (room_clients) {
|
|
@@ -78,7 +79,10 @@ class SocketServer extends EventEmitter{
|
|
|
78
79
|
if (!asyncMessage) {
|
|
79
80
|
this.asyncMessages.set(key, new AsyncMessage(key));
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
+
|
|
83
|
+
if (user_id)
|
|
84
|
+
this.emit('userStatus', socket, {user_id, userStatus: 'on', organization_id});
|
|
85
|
+
|
|
82
86
|
//. add metrics
|
|
83
87
|
let total_cnt = 0;
|
|
84
88
|
this.clients.forEach((c) => total_cnt += c.length)
|
|
@@ -157,8 +161,8 @@ class SocketServer extends EventEmitter{
|
|
|
157
161
|
if (user_id) {
|
|
158
162
|
if (!socket.config.user_id ) {
|
|
159
163
|
socket.config.user_id = user_id
|
|
164
|
+
this.emit('userStatus', socket, {user_id, userStatus: 'on', organization_id});
|
|
160
165
|
}
|
|
161
|
-
this.emit('userStatus', socket, {user_id, userStatus: 'on', organization_id});
|
|
162
166
|
}
|
|
163
167
|
|
|
164
168
|
//. checking async status....
|