@cocreate/indexeddb 1.9.3 → 1.9.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 +7 -0
- package/package.json +5 -5
- package/src/index.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.9.4](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.9.3...v1.9.4) (2023-05-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Refactor code to use a more descriptive variable name ([ac0883d](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/ac0883dfb73b2b58fc2d942d3eda8f374bc1d800))
|
|
7
|
+
|
|
1
8
|
## [1.9.3](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.9.2...v1.9.3) (2023-05-19)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/indexeddb",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "A simple indexeddb component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indexeddb",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"webpack-log": "^3.0.1"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cocreate/docs": "^1.7.
|
|
63
|
-
"@cocreate/hosting": "^1.10.
|
|
64
|
-
"@cocreate/utils": "^1.20.
|
|
65
|
-
"@cocreate/uuid": "^1.4.
|
|
62
|
+
"@cocreate/docs": "^1.7.11",
|
|
63
|
+
"@cocreate/hosting": "^1.10.3",
|
|
64
|
+
"@cocreate/utils": "^1.20.9",
|
|
65
|
+
"@cocreate/uuid": "^1.4.10"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/index.js
CHANGED
|
@@ -1021,7 +1021,7 @@ async function readDocs(data, database, collection, objectStore, direction) {
|
|
|
1021
1021
|
|
|
1022
1022
|
async function generateDB(organization = { document: {} }, user = { document: {} }) {
|
|
1023
1023
|
const organization_id = organization.document._id || ObjectId();
|
|
1024
|
-
const
|
|
1024
|
+
const defaultKey = organization.document.key || uuid.generate();
|
|
1025
1025
|
const user_id = user.document._id || ObjectId();
|
|
1026
1026
|
|
|
1027
1027
|
let apiKey = await readDocument({ database: organization_id, collection: 'keys', organization_id })
|
|
@@ -1033,7 +1033,7 @@ async function generateDB(organization = { document: {} }, user = { document: {}
|
|
|
1033
1033
|
organization.database = organization_id
|
|
1034
1034
|
organization.collection = 'organizations'
|
|
1035
1035
|
organization.document._id = organization_id
|
|
1036
|
-
organization.document.key =
|
|
1036
|
+
organization.document.key = defaultKey
|
|
1037
1037
|
organization.document.name = organization.document.name || 'untitiled',
|
|
1038
1038
|
organization.organization_id = organization_id
|
|
1039
1039
|
createDocument(organization);
|
|
@@ -1045,7 +1045,7 @@ async function generateDB(organization = { document: {} }, user = { document: {}
|
|
|
1045
1045
|
document: {
|
|
1046
1046
|
_id: ObjectId(),
|
|
1047
1047
|
type: "key",
|
|
1048
|
-
key:
|
|
1048
|
+
key: defaultKey,
|
|
1049
1049
|
hosts: [
|
|
1050
1050
|
"*"
|
|
1051
1051
|
],
|
|
@@ -1069,7 +1069,7 @@ async function generateDB(organization = { document: {} }, user = { document: {}
|
|
|
1069
1069
|
"sendgrid": ["sendEmail"]
|
|
1070
1070
|
},
|
|
1071
1071
|
admin: "false",
|
|
1072
|
-
|
|
1072
|
+
default: true,
|
|
1073
1073
|
},
|
|
1074
1074
|
organization_id
|
|
1075
1075
|
}
|