@cocreate/users 1.25.1 → 1.25.3
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 +16 -0
- package/CoCreate.config.js +4 -5
- package/package.json +7 -7
- package/src/client.js +1 -1
- package/src/server.js +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [1.25.3](https://github.com/CoCreate-app/CoCreate-users/compare/v1.25.2...v1.25.3) (2023-09-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Add path and pathname ([7a1fc61](https://github.com/CoCreate-app/CoCreate-users/commit/7a1fc61e9ec677a54ef685824c02c0983371b7c5))
|
|
7
|
+
* Update dCoCreate dpendencies to latest versions ([b661d74](https://github.com/CoCreate-app/CoCreate-users/commit/b661d74e27144ab448f6317378144e76bf406fd2))
|
|
8
|
+
|
|
9
|
+
## [1.25.2](https://github.com/CoCreate-app/CoCreate-users/compare/v1.25.1...v1.25.2) (2023-09-17)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* renamed filter to $filter ([377765f](https://github.com/CoCreate-app/CoCreate-users/commit/377765fe660a256c01b36f4af3557ea9c5dc1f3b))
|
|
15
|
+
* socket referenced in the data object. data.socket ([6d6dc61](https://github.com/CoCreate-app/CoCreate-users/commit/6d6dc61d53a3813b72c916d44d359019310b19e2))
|
|
16
|
+
|
|
1
17
|
## [1.25.1](https://github.com/CoCreate-app/CoCreate-users/compare/v1.25.0...v1.25.1) (2023-08-21)
|
|
2
18
|
|
|
3
19
|
|
package/CoCreate.config.js
CHANGED
|
@@ -8,17 +8,16 @@ module.exports = {
|
|
|
8
8
|
"object": {
|
|
9
9
|
"_id": "6012f7af86c0ba24512cca2e",
|
|
10
10
|
"name": "index.html",
|
|
11
|
-
"path": "/docs/users
|
|
11
|
+
"path": "/docs/users",
|
|
12
|
+
"pathname": "/docs/users/index.html",
|
|
12
13
|
"src": "{{./docs/index.html}}",
|
|
13
14
|
"host": [
|
|
14
15
|
"*",
|
|
15
16
|
"general.cocreate.app"
|
|
16
17
|
],
|
|
17
|
-
"directory": "
|
|
18
|
-
"parentDirectory": "{{parentDirectory}}",
|
|
18
|
+
"directory": "users",
|
|
19
19
|
"content-type": "{{content-type}}",
|
|
20
|
-
"public": "true"
|
|
21
|
-
"website_id": "644d4bff8036fb9d1d1fd69c"
|
|
20
|
+
"public": "true"
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/users",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.3",
|
|
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",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/actions": "^1.11.
|
|
62
|
-
"@cocreate/crud-client": "^1.
|
|
63
|
-
"@cocreate/element-prototype": "^1.11.
|
|
64
|
-
"@cocreate/elements": "^1.
|
|
65
|
-
"@cocreate/local-storage": "^1.10.
|
|
66
|
-
"@cocreate/render": "^1.27.
|
|
61
|
+
"@cocreate/actions": "^1.11.1",
|
|
62
|
+
"@cocreate/crud-client": "^1.25.0",
|
|
63
|
+
"@cocreate/element-prototype": "^1.11.1",
|
|
64
|
+
"@cocreate/elements": "^1.21.0",
|
|
65
|
+
"@cocreate/local-storage": "^1.10.1",
|
|
66
|
+
"@cocreate/render": "^1.27.2"
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/client.js
CHANGED
package/src/server.js
CHANGED
|
@@ -7,29 +7,29 @@ class CoCreateUser {
|
|
|
7
7
|
|
|
8
8
|
init() {
|
|
9
9
|
if (this.wsManager) {
|
|
10
|
-
this.wsManager.on('signUp', (
|
|
11
|
-
this.wsManager.on('signIn', (
|
|
12
|
-
this.wsManager.on('userStatus', (
|
|
10
|
+
this.wsManager.on('signUp', (data) => this.signUp(data));
|
|
11
|
+
this.wsManager.on('signIn', (data) => this.signIn(data))
|
|
12
|
+
this.wsManager.on('userStatus', (data) => this.userStatus(data))
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
async signUp(
|
|
16
|
+
async signUp(data) {
|
|
17
17
|
const self = this;
|
|
18
18
|
try {
|
|
19
19
|
|
|
20
20
|
if (data.user) {
|
|
21
21
|
data.user.method = 'create.object'
|
|
22
22
|
const response = await this.crud.send(data.user)
|
|
23
|
-
this.wsManager.broadcast(
|
|
23
|
+
this.wsManager.broadcast(response);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
if (data.userKey) {
|
|
27
27
|
data.userKey.method = 'create.object'
|
|
28
28
|
const response = await this.crud.send(data.userKey)
|
|
29
|
-
this.wsManager.broadcast(
|
|
29
|
+
this.wsManager.broadcast(response);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
self.wsManager.send(
|
|
32
|
+
self.wsManager.send(data);
|
|
33
33
|
|
|
34
34
|
} catch (error) {
|
|
35
35
|
console.log('create.object error', error);
|
|
@@ -47,7 +47,7 @@ class CoCreateUser {
|
|
|
47
47
|
organization_id: string
|
|
48
48
|
}
|
|
49
49
|
**/
|
|
50
|
-
async signIn(
|
|
50
|
+
async signIn(data) {
|
|
51
51
|
const self = this;
|
|
52
52
|
try {
|
|
53
53
|
data.method = 'read.object'
|
|
@@ -85,8 +85,8 @@ class CoCreateUser {
|
|
|
85
85
|
// }
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
self.wsManager.send(
|
|
89
|
-
self.wsManager.broadcast(
|
|
88
|
+
self.wsManager.send(response)
|
|
89
|
+
self.wsManager.broadcast({
|
|
90
90
|
method: 'updateUserStatus',
|
|
91
91
|
user_id: response.user_id,
|
|
92
92
|
userStatus: response.userStatus,
|
|
@@ -103,7 +103,7 @@ class CoCreateUser {
|
|
|
103
103
|
/**
|
|
104
104
|
* status: 'on/off/idle'
|
|
105
105
|
*/
|
|
106
|
-
async userStatus(
|
|
106
|
+
async userStatus(data) {
|
|
107
107
|
const self = this;
|
|
108
108
|
try {
|
|
109
109
|
if (!data.user_id || !data.userStatus)
|
|
@@ -116,7 +116,7 @@ class CoCreateUser {
|
|
|
116
116
|
|
|
117
117
|
data.method = 'update.object'
|
|
118
118
|
this.crud.send(data).then((data) => {
|
|
119
|
-
self.wsManager.broadcast(
|
|
119
|
+
self.wsManager.broadcast({
|
|
120
120
|
method: 'updateUserStatus',
|
|
121
121
|
user_id: data.user_id,
|
|
122
122
|
userStatus: data.userStatus,
|