@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 +21 -0
- package/demo/login.html +1 -1
- package/demo/logout.html +1 -1
- package/demo/signup.html +1 -1
- package/package.json +1 -1
- package/src/client.js +2 -2
- package/src/server.js +3 -3
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
package/demo/logout.html
CHANGED
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.
|
|
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
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('
|
|
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('
|
|
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('
|
|
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
|
|
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, '
|
|
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'],
|