@cocreate/organizations 1.18.1 → 1.19.1
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 +20 -0
- package/CoCreate.config.js +4 -5
- package/package.json +4 -4
- package/src/server.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [1.19.1](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.19.0...v1.19.1) (2023-09-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Add path and pathname ([2d952c4](https://github.com/CoCreate-app/CoCreate-organizations/commit/2d952c42509f1196b769c226747dd32f1ddbd47a))
|
|
7
|
+
* Update dCoCreate dpendencies to latest versions ([9aaa1b3](https://github.com/CoCreate-app/CoCreate-organizations/commit/9aaa1b380a9ebf1d3fcffefe7172c42815a8b1c8))
|
|
8
|
+
|
|
9
|
+
# [1.19.0](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.18.1...v1.19.0) (2023-09-17)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* socket referenced in the data object. data.socket ([121c8ab](https://github.com/CoCreate-app/CoCreate-organizations/commit/121c8ab1c37b0c980148fd28b14cede8e5a80aa0))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* set balance and dataTransfered on newly created organizations ([f20747b](https://github.com/CoCreate-app/CoCreate-organizations/commit/f20747bf2463d79afd24530afb529331285e7670))
|
|
20
|
+
|
|
1
21
|
## [1.18.1](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.18.0...v1.18.1) (2023-08-21)
|
|
2
22
|
|
|
3
23
|
|
package/CoCreate.config.js
CHANGED
|
@@ -8,17 +8,16 @@ module.exports = {
|
|
|
8
8
|
"object": {
|
|
9
9
|
"_id": "60207e303c260207bf49cab8",
|
|
10
10
|
"name": "index.html",
|
|
11
|
-
"path": "/docs/organizations
|
|
11
|
+
"path": "/docs/organizations",
|
|
12
|
+
"pathname": "/docs/organizations/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": "organizations",
|
|
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/organizations",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "A simple organizations component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"organizations",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/actions": "^1.11.
|
|
62
|
-
"@cocreate/crud-client": "^1.
|
|
63
|
-
"@cocreate/elements": "^1.
|
|
61
|
+
"@cocreate/actions": "^1.11.1",
|
|
62
|
+
"@cocreate/crud-client": "^1.25.0",
|
|
63
|
+
"@cocreate/elements": "^1.21.0"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/src/server.js
CHANGED
|
@@ -12,13 +12,13 @@ class CoCreateOrganization {
|
|
|
12
12
|
|
|
13
13
|
init() {
|
|
14
14
|
if (this.wsManager) {
|
|
15
|
-
this.wsManager.on('createOrganization', (
|
|
16
|
-
this.createOrganization(
|
|
15
|
+
this.wsManager.on('createOrganization', (data) =>
|
|
16
|
+
this.createOrganization(data)
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
async createOrganization(
|
|
21
|
+
async createOrganization(data) {
|
|
22
22
|
try {
|
|
23
23
|
if (!data.organization || !data.organization._id) return
|
|
24
24
|
if (!data.user || !data.user._id || !data.user.email || !data.user.password) return
|
|
@@ -27,7 +27,9 @@ class CoCreateOrganization {
|
|
|
27
27
|
_id: data.organization._id,
|
|
28
28
|
name: data.organization.name || 'untitled',
|
|
29
29
|
host: data.organization.host || [],
|
|
30
|
-
owner: data.user._id
|
|
30
|
+
owner: data.user._id,
|
|
31
|
+
balance: 10, // TODO: set balance to 0 and create a transcation with type credit to add the $10
|
|
32
|
+
dataTransfered: 0
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
// TODO: check if user exist and confirm credentials
|
|
@@ -67,7 +69,7 @@ class CoCreateOrganization {
|
|
|
67
69
|
this.wsManager.broadcast(this.platformSocket, response);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
this.wsManager.send(
|
|
72
|
+
this.wsManager.send(data);
|
|
71
73
|
} catch (error) {
|
|
72
74
|
console.log('createObject error', error);
|
|
73
75
|
}
|