@cocreate/socket-server 1.7.5 → 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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
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
+
1
9
  ## [1.7.5](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.7.4...v1.7.5) (2023-04-24)
2
10
 
3
11
 
@@ -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.5",
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) {