@cocreate/socket-server 1.7.4 → 1.7.6

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.
@@ -8,7 +8,11 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  - name: Checkout
11
- uses: actions/checkout@v2
11
+ uses: actions/checkout@v3
12
+ - name: setup nodejs
13
+ uses: actions/setup-node@v3
14
+ with:
15
+ node-version: 16
12
16
  - name: Jaid/action-sync-node-meta
13
17
  uses: jaid/action-sync-node-meta@v1.4.0
14
18
  with:
@@ -19,6 +23,10 @@ jobs:
19
23
  steps:
20
24
  - name: Checkout
21
25
  uses: actions/checkout@v3
26
+ - name: setup nodejs
27
+ uses: actions/setup-node@v3
28
+ with:
29
+ node-version: 16
22
30
  - name: Semantic Release
23
31
  uses: cycjimmy/semantic-release-action@v3
24
32
  id: semantic
@@ -38,6 +46,10 @@ jobs:
38
46
  runs-on: ubuntu-latest
39
47
  steps:
40
48
  - name: Checkout
41
- uses: actions/checkout@v2
49
+ uses: actions/checkout@v3
50
+ - name: setup nodejs
51
+ uses: actions/setup-node@v3
52
+ with:
53
+ node-version: 16
42
54
  - name: update documentation
43
55
  uses: CoCreate-app/CoCreate-docs@master
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [1.7.6](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.7.5...v1.7.6) (2023-05-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * apikey renamed to key ([b64597a](https://github.com/CoCreate-app/CoCreate-socket-server/commit/b64597af40ef4c3eb20e7e5e7f902a330db3f9d5))
7
+ * createOrg ([e859b23](https://github.com/CoCreate-app/CoCreate-socket-server/commit/e859b23662e41344defc53e066e4f17570e6e064))
8
+
9
+ ## [1.7.5](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.7.4...v1.7.5) (2023-04-24)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * node version 16 in build action ([946a52e](https://github.com/CoCreate-app/CoCreate-socket-server/commit/946a52e79afb0af741269f1820ba17d4a3d59b5b))
15
+
1
16
  ## [1.7.4](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.7.3...v1.7.4) (2023-04-24)
2
17
 
3
18
 
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  "config": {
3
3
  "organization_id": "5ff747727005da1c272740ab",
4
- "apiKey": "2061acef-0451-4545-f754-60cf8160",
4
+ "key": "2061acef-0451-4545-f754-60cf8160",
5
5
  "host": "general.cocreate.app"
6
6
  },
7
7
  "sources": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/socket-server",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "CoCreate-socket-server",
5
5
  "keywords": [
6
6
  "cocreate-socket",
package/src/index.js CHANGED
@@ -146,15 +146,15 @@ class SocketServer extends EventEmitter{
146
146
  if (this.authInstance)
147
147
  user_id = await this.authInstance.getUserId(req);
148
148
 
149
- //. check permission
150
- if (this.permissionInstance) {
149
+ if (action !== 'createOrg' && this.permissionInstance) {
150
+ // if (this.permissionInstance) {
151
151
  const permission = await this.permissionInstance.check(action, data, req, user_id)
152
152
  if (!permission || permission.error) {
153
153
  // if (action == 'syncServer' && permission.database === true)
154
154
  // if (action == 'syncServer')
155
155
  // this.emit('createDocument', socket, data);
156
156
  // else
157
- this.send(socket, 'Access Denied', {action, permission, data})
157
+ this.send(socket, 'Access Denied', {action, permission, ...data})
158
158
  return;
159
159
  }
160
160
  }
@@ -217,8 +217,8 @@ class SocketServer extends EventEmitter{
217
217
  for (let room of rooms) {
218
218
  let url = url;
219
219
  url += `/${room}`;
220
+
220
221
  const clients = this.clients.get(url);
221
-
222
222
  if (clients) {
223
223
  clients.forEach((client) => {
224
224
  if (socket != client && data.broadcast != false || socket == client && data.broadcastSender != false) {