@cocreate/users 1.6.0 → 1.7.0

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,24 @@
1
+ # [1.7.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.6.2...v1.7.0) (2022-05-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * function readDocumentList has been renamed to readDocuments ([1cbdec0](https://github.com/CoCreate-app/CoCreate-users/commit/1cbdec073ed41b1e5b17aac47b7e960186a87e20))
7
+
8
+ ## [1.6.2](https://github.com/CoCreate-app/CoCreate-users/compare/v1.6.1...v1.6.2) (2022-05-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * renamed usersCurrentOrg to userCurrentOrg ([3910c8a](https://github.com/CoCreate-app/CoCreate-users/commit/3910c8ad2e2e8175cc53b032aab25b184fa0492c))
14
+
15
+ ## [1.6.1](https://github.com/CoCreate-app/CoCreate-users/compare/v1.6.0...v1.6.1) (2022-05-11)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * bump cdn version to 1.14.6 ([b6db64b](https://github.com/CoCreate-app/CoCreate-users/commit/b6db64b4173dbce1c64142040ca4c43083413390))
21
+
1
22
  # [1.6.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.5.5...v1.6.0) (2022-05-11)
2
23
 
3
24
 
package/demo/login.html CHANGED
@@ -83,7 +83,7 @@
83
83
  }
84
84
  </script>
85
85
 
86
- <script src="https://cdn.cocreate.app/1.14.5/CoCreate.min.js"></script>
86
+ <script src="https://cdn.cocreate.app/1.14.6/CoCreate.min.js"></script>
87
87
  <!-- <script src="../../../CoCreateJS/dist/CoCreate.js"></script> -->
88
88
 
89
89
  </body>
package/demo/logout.html CHANGED
@@ -32,7 +32,7 @@
32
32
  </div>
33
33
  </div>
34
34
 
35
- <script src="https://cdn.cocreate.app/1.14.5/CoCreate.min.js"></script>
35
+ <script src="https://cdn.cocreate.app/1.14.6/CoCreate.min.js"></script>
36
36
  <!-- <script src="../../../CoCreateJS/dist/CoCreate.js"></script> -->
37
37
 
38
38
  </body>
package/demo/signup.html CHANGED
@@ -103,7 +103,7 @@
103
103
  host: 'server.cocreate.app' // Points to socket server. If not defined it will use the url in web browser by default
104
104
  }
105
105
  </script>
106
- <script src="https://cdn.cocreate.app/1.14.5/CoCreate.min.js"></script>
106
+ <script src="https://cdn.cocreate.app/1.14.6/CoCreate.min.js"></script>
107
107
  <!-- <script src="../../../CoCreateJS/dist/CoCreate.js"></script> -->
108
108
 
109
109
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/users",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "A simple users component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "users",
package/src/client.js CHANGED
@@ -37,7 +37,7 @@ const CoCreateUser = {
37
37
  crud.listen('fetchedUser', this.checkPermissions);
38
38
  crud.listen('login', (instance) => self.loginResponse(instance));
39
39
  crud.listen('updateUserStatus', this.updateUserStatus);
40
- crud.listen('usersCurrentOrg', (instance) => self.setCurrentOrg(instance));
40
+ crud.listen('userCurrentOrg', (instance) => self.setCurrentOrg(instance));
41
41
  },
42
42
 
43
43
  loginRequest: function(btn) {
@@ -100,7 +100,7 @@ const CoCreateUser = {
100
100
  },
101
101
 
102
102
  getCurrentOrg: function(user_id, collection) {
103
- crud.send('usersCurrentOrg', {
103
+ crud.send('userCurrentOrg', {
104
104
  "apiKey": window.config.apiKey,
105
105
  "organization_id": window.config.organization_id,
106
106
  "collection": collection || 'users',
package/src/server.js CHANGED
@@ -11,7 +11,7 @@ class CoCreateUser {
11
11
  if (this.wsManager) {
12
12
  this.wsManager.on('createUser', (socket, data, socketInfo) => this.createUser(socket, data, socketInfo));
13
13
  this.wsManager.on('login', (socket, data, socketInfo) => this.login(socket, data, socketInfo))
14
- this.wsManager.on('usersCurrentOrg', (socket, data, socketInfo) => this.usersCurrentOrg(socket, data, socketInfo))
14
+ this.wsManager.on('userCurrentOrg', (socket, data, socketInfo) => this.userCurrentOrg(socket, data, socketInfo))
15
15
  this.wsManager.on('userStatus', (socket, data, socketInfo) => this.userStatus(socket, data, socketInfo))
16
16
  }
17
17
  }
@@ -121,7 +121,7 @@ class CoCreateUser {
121
121
  href: string
122
122
  }
123
123
  **/
124
- async usersCurrentOrg(socket, data, socketInfo) {
124
+ async userCurrentOrg(socket, data, socketInfo) {
125
125
  try {
126
126
  const self = this;
127
127
  const {organization_id, db} = data
@@ -142,7 +142,7 @@ class CoCreateUser {
142
142
 
143
143
  orgCollection.find({"_id": new ObjectId(org_id),}).toArray(function(err, res) {
144
144
  if (!err && res && res.length > 0) {
145
- self.wsManager.send(socket, 'usersCurrentOrg', {
145
+ self.wsManager.send(socket, 'userCurrentOrg', {
146
146
  success: true,
147
147
  user_id: result[0]['_id'],
148
148
  current_org: result[0]['current_org'],