@cocreate/socket-server 1.21.6 → 1.21.8

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 CHANGED
@@ -1,3 +1,20 @@
1
+ ## [1.21.8](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.7...v1.21.8) (2023-11-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * url bug ([5265962](https://github.com/CoCreate-app/CoCreate-socket-server/commit/526596254d9554de67dc78b296abe57765cb51fc))
7
+
8
+ ## [1.21.7](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.6...v1.21.7) (2023-11-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * meta name typo ([37b85be](https://github.com/CoCreate-app/CoCreate-socket-server/commit/37b85bee20c4ff7e73eccca039f9dbeb84c82417))
14
+ * update crud methods ([2853e1f](https://github.com/CoCreate-app/CoCreate-socket-server/commit/2853e1f82c76998cdf2d5de3ee05128c454bd2e8))
15
+ * update host ([4139426](https://github.com/CoCreate-app/CoCreate-socket-server/commit/41394268a2b0814d2373870184c7d30c60b94383))
16
+ * updated date to ISO format with UTC timezone ([98b5e0a](https://github.com/CoCreate-app/CoCreate-socket-server/commit/98b5e0abd9768e8297b54db9a4b86babf3fc69ca))
17
+
1
18
  ## [1.21.6](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.5...v1.21.6) (2023-11-03)
2
19
 
3
20
 
@@ -12,8 +12,7 @@ module.exports = {
12
12
  "pathname": "/docs/socket-server/index.html",
13
13
  "src": "{{./docs/index.html}}",
14
14
  "host": [
15
- "*",
16
- "general.cocreate.app"
15
+ "*"
17
16
  ],
18
17
  "directory": "socket-server",
19
18
  "content-type": "text/html",
package/docs/index.html CHANGED
@@ -11,10 +11,10 @@
11
11
  sizes="32x32"
12
12
  href="https://cocreate.app/images/favicon.ico" />
13
13
  <meta
14
- key="description"
14
+ name="description"
15
15
  content="A simple HTML5 and pure javascript component. Easy configuration using data-attributes and highly styleable." />
16
16
  <meta
17
- key="keywords"
17
+ name="keywords"
18
18
  content="helper classes, utility classes, css framework, css library, inline style classes" />
19
19
  <meta name="robots" content="index,follow" />
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/socket-server",
3
- "version": "1.21.6",
3
+ "version": "1.21.8",
4
4
  "description": "CoCreate-socket-server",
5
5
  "keywords": [
6
6
  "cocreate-socket",
package/src/index.js CHANGED
@@ -57,8 +57,10 @@ class SocketServer extends EventEmitter {
57
57
  socket.socketUrl = socket.origin + socket.pathname
58
58
 
59
59
  if (socket.origin && socket.origin !== 'null') {
60
- const url = new URL(socket.origin);
61
- socket.host = url.host || socket.origin;
60
+ if (socket.origin.includes('://'))
61
+ socket.host = new URL(socket.origin).host
62
+ else
63
+ socket.host = socket.origin;
62
64
  }
63
65
 
64
66
  if (!organization || organization && organization.status !== false) {
@@ -82,7 +84,7 @@ class SocketServer extends EventEmitter {
82
84
  else
83
85
  data.$filter.limit = 1
84
86
 
85
- self.emit('read.object', data);
87
+ self.emit('object.read', data);
86
88
 
87
89
  if (self.authenticate) {
88
90
  const { user_id, expires } = self.authenticate.decodeToken(options.token)
@@ -330,7 +332,7 @@ class SocketServer extends EventEmitter {
330
332
  if (data.method === 'region.added' || data.method === 'region.removed')
331
333
  console.log('data.method: ', data.method)
332
334
 
333
- if (socket.user_id && socket.expires && new Date().getTime() >= socket.expires) {
335
+ if (socket.user_id && socket.expires && new Date(new Date().toISOString()).getTime() >= socket.expires) {
334
336
  socket.user_id = socket.expires = null
335
337
  this.send({ socket, method: 'updateUserStatus', userStatus: 'off', socketId: data.socketId, organization_id })
336
338
  }