@cocreate/organizations 1.23.2 → 1.23.4
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 +18 -0
- package/CoCreate.config.js +1 -2
- package/demo/CoCreate-createUser.html +3 -3
- package/demo/index.html +3 -3
- package/demo/industries/industries.html +3 -3
- package/demo/industries/industry-datatable.html +3 -3
- package/demo/industries/industry-documents-datatable.1.html +3 -3
- package/docs/index.html +2 -2
- package/package.json +5 -5
- package/src/client.js +8 -6
- package/src/server.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.23.4](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.23.3...v1.23.4) (2023-11-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* meta name typo ([02c0347](https://github.com/CoCreate-app/CoCreate-organizations/commit/02c0347f01a5b4f04a01ebabd627f1d28f5b3912))
|
|
7
|
+
* update host ([c6bab56](https://github.com/CoCreate-app/CoCreate-organizations/commit/c6bab56cc5b140d9e3281b1aabad8b404e800047))
|
|
8
|
+
|
|
9
|
+
## [1.23.3](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.23.2...v1.23.3) (2023-11-03)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* favicon.ico path ([0f45edf](https://github.com/CoCreate-app/CoCreate-organizations/commit/0f45edf7cb85c7ac7ae4b53434193b8ec960e81a))
|
|
15
|
+
* if organization_id entered return organiozation_id withoput generating users, keys, etc. ([4839882](https://github.com/CoCreate-app/CoCreate-organizations/commit/48398828b7606f84f38cad14d04cf553a2459c6c))
|
|
16
|
+
* update dependencies to the lates versions ([4778523](https://github.com/CoCreate-app/CoCreate-organizations/commit/47785236ea0a160cfb8455f63803831e87615d48))
|
|
17
|
+
* update method to use object.update etc ([06e9822](https://github.com/CoCreate-app/CoCreate-organizations/commit/06e9822199e62336bbfc843637e642ef48e3dfc4))
|
|
18
|
+
|
|
1
19
|
## [1.23.2](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.23.1...v1.23.2) (2023-10-26)
|
|
2
20
|
|
|
3
21
|
|
package/CoCreate.config.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<!-- CoCreate Favicon -->
|
|
7
7
|
<link
|
|
8
8
|
rel="icon"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type="image/png"
|
|
10
|
+
sizes="32x32"
|
|
11
|
+
href="../assets/favicon.ico" />
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
</head>
|
|
14
14
|
<body class="padding:20px">
|
package/demo/index.html
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<!-- CoCreate Favicon -->
|
|
7
7
|
<link
|
|
8
8
|
rel="icon"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type="image/png"
|
|
10
|
+
sizes="32x32"
|
|
11
|
+
href="../assets/favicon.ico" />
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<!-- CoCreate Favicon -->
|
|
7
7
|
<link
|
|
8
8
|
rel="icon"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type="image/png"
|
|
10
|
+
sizes="32x32"
|
|
11
|
+
href="../assets/favicon.ico" />
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
</head>
|
|
14
14
|
<body class="width:fit-content overflow:auto">
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<!-- CoCreate Favicon -->
|
|
7
7
|
<link
|
|
8
8
|
rel="icon"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type="image/png"
|
|
10
|
+
sizes="32x32"
|
|
11
|
+
href="../assets/favicon.ico" />
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
</head>
|
|
14
14
|
<body class="width:fit-content overflow:auto">
|
package/docs/index.html
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
sizes="32x32"
|
|
12
12
|
href="https://cocreate.app/images/favicon.ico" />
|
|
13
13
|
<meta
|
|
14
|
-
|
|
14
|
+
name="description"
|
|
15
15
|
content="A simple HTML5 and pure javascript component. Easy configuration using HTML5 attributes or Javscript api and highly styleable." />
|
|
16
16
|
<meta
|
|
17
|
-
|
|
17
|
+
name="keywords"
|
|
18
18
|
content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
19
19
|
<meta name="robots" content="index,follow" />
|
|
20
20
|
<meta
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/organizations",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.4",
|
|
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,9 +58,9 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/actions": "^1.12.
|
|
62
|
-
"@cocreate/config": "^1.6.
|
|
63
|
-
"@cocreate/crud-client": "^1.28.
|
|
64
|
-
"@cocreate/elements": "^1.25.
|
|
61
|
+
"@cocreate/actions": "^1.12.1",
|
|
62
|
+
"@cocreate/config": "^1.6.6",
|
|
63
|
+
"@cocreate/crud-client": "^1.28.12",
|
|
64
|
+
"@cocreate/elements": "^1.25.2"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/client.js
CHANGED
|
@@ -12,7 +12,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
|
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
14
|
// Create organization
|
|
15
|
-
organization.method = 'create
|
|
15
|
+
organization.method = 'object.create'
|
|
16
16
|
organization.storage = 'indexeddb'
|
|
17
17
|
organization.database = organization_id
|
|
18
18
|
organization.array = 'organizations'
|
|
@@ -22,7 +22,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
|
|
|
22
22
|
Indexeddb.send(organization);
|
|
23
23
|
|
|
24
24
|
// Create user
|
|
25
|
-
user.method = 'create
|
|
25
|
+
user.method = 'object.create'
|
|
26
26
|
user.storage = 'indexeddb'
|
|
27
27
|
user.database = organization_id
|
|
28
28
|
user.array = 'users'
|
|
@@ -34,7 +34,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
|
|
|
34
34
|
|
|
35
35
|
// Create default key
|
|
36
36
|
let key = {
|
|
37
|
-
method: 'create
|
|
37
|
+
method: 'object.create',
|
|
38
38
|
storage: 'indexeddb',
|
|
39
39
|
database: organization_id,
|
|
40
40
|
array: 'keys',
|
|
@@ -55,7 +55,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
|
|
|
55
55
|
// Create role
|
|
56
56
|
let role_id = Crud.ObjectId().toString();
|
|
57
57
|
let role = {
|
|
58
|
-
method: 'create
|
|
58
|
+
method: 'object.create',
|
|
59
59
|
storage: 'indexeddb',
|
|
60
60
|
database: organization_id,
|
|
61
61
|
array: 'keys',
|
|
@@ -71,7 +71,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
|
|
|
71
71
|
|
|
72
72
|
// Create user key
|
|
73
73
|
let userKey = {
|
|
74
|
-
method: 'create
|
|
74
|
+
method: 'object.create',
|
|
75
75
|
storage: 'indexeddb',
|
|
76
76
|
database: organization_id,
|
|
77
77
|
array: 'keys',
|
|
@@ -98,7 +98,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
|
|
|
98
98
|
async function get() {
|
|
99
99
|
let organization_id = await getOrganizationFromServiceWorker()
|
|
100
100
|
if (!organization_id) {
|
|
101
|
-
let data = await Indexeddb.send({ method: 'read
|
|
101
|
+
let data = await Indexeddb.send({ method: 'database.read' })
|
|
102
102
|
for (let database of data.database) {
|
|
103
103
|
let name = database.name
|
|
104
104
|
if (name.match(/^[0-9a-fA-F]{24}$/)) {
|
|
@@ -156,6 +156,8 @@ async function createOrganizationPromise() {
|
|
|
156
156
|
|
|
157
157
|
const organization_id = prompt("An organization_id could not be found, if you already have an organization_id input it now.\n\nOr leave blank and click 'OK' to create a new organization");
|
|
158
158
|
|
|
159
|
+
if (organization_id)
|
|
160
|
+
return organization_id
|
|
159
161
|
if (organization_id === null)
|
|
160
162
|
return Crud.socket.organization = 'canceled'
|
|
161
163
|
|
package/src/server.js
CHANGED
|
@@ -51,21 +51,21 @@ class CoCreateOrganization {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const Data = {}
|
|
54
|
-
Data.method = 'create
|
|
54
|
+
Data.method = 'object.create'
|
|
55
55
|
Data.database = process.env.organization_id
|
|
56
56
|
Data.organization_id = process.env.organization_id
|
|
57
57
|
|
|
58
58
|
if (organization) {
|
|
59
|
-
const response = await this.crud.send({ ...Data,
|
|
59
|
+
const response = await this.crud.send({ ...Data, array: 'organizations', object: organization })
|
|
60
60
|
this.wsManager.send(this.platformSocket, response);
|
|
61
61
|
}
|
|
62
62
|
if (user) {
|
|
63
|
-
const response = await this.crud.send({ ...Data,
|
|
63
|
+
const response = await this.crud.send({ ...Data, array: 'users', object: user })
|
|
64
64
|
this.wsManager.send(this.platformSocket, response);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if (userKey) {
|
|
68
|
-
const response = await this.crud.send({ ...Data,
|
|
68
|
+
const response = await this.crud.send({ ...Data, array: 'keys', object: userKey })
|
|
69
69
|
this.wsManager.send(this.platformSocket, response);
|
|
70
70
|
}
|
|
71
71
|
|