@cocreate/indexeddb 1.9.0 → 1.9.2
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 +15 -0
- package/CoCreate.config.js +1 -1
- package/docs/index.html +1 -1
- package/package.json +1 -1
- package/src/index.js +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.9.2](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.9.1...v1.9.2) (2023-05-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* apikey renamed to key ([67e767f](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/67e767ffd5b91e07d233d2e9f78cc7ee12052589))
|
|
7
|
+
* apikey renamed to key ([cb135a8](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/cb135a8742e6e4a92a15c8d10404e39d47995cf1))
|
|
8
|
+
|
|
9
|
+
## [1.9.1](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.9.0...v1.9.1) (2023-05-10)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* duplicate keys ([e87668f](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/e87668f17412e08a1497a53acbf7ba8592b53756))
|
|
15
|
+
|
|
1
16
|
# [1.9.0](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.8.7...v1.9.0) (2023-05-10)
|
|
2
17
|
|
|
3
18
|
|
package/CoCreate.config.js
CHANGED
package/docs/index.html
CHANGED
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1016,10 +1016,14 @@ async function readDocs(data, database, collection, objectStore, direction) {
|
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
|
-
function generateDB(organization = {document: {}}, user = {document: {}}) {
|
|
1020
|
-
const organization_id = organization._id || ObjectId();
|
|
1021
|
-
const primaryKey = organization.key || uuid.generate();
|
|
1022
|
-
const user_id = user._id || ObjectId();
|
|
1019
|
+
async function generateDB(organization = {document: {}}, user = {document: {}}) {
|
|
1020
|
+
const organization_id = organization.document._id || ObjectId();
|
|
1021
|
+
const primaryKey = organization.document.key || uuid.generate();
|
|
1022
|
+
const user_id = user.document._id || ObjectId();
|
|
1023
|
+
|
|
1024
|
+
let apiKey = await readDocument({database: organization_id, collection: 'keys', organization_id})
|
|
1025
|
+
if (apiKey && apiKey.document && apiKey.document[0])
|
|
1026
|
+
return
|
|
1023
1027
|
|
|
1024
1028
|
try {
|
|
1025
1029
|
// Create organization
|
|
@@ -1037,7 +1041,7 @@ function generateDB(organization = {document: {}}, user = {document: {}}) {
|
|
|
1037
1041
|
collection: 'keys',
|
|
1038
1042
|
document: {
|
|
1039
1043
|
_id: ObjectId(),
|
|
1040
|
-
type: "
|
|
1044
|
+
type: "key",
|
|
1041
1045
|
key: primaryKey,
|
|
1042
1046
|
hosts: [
|
|
1043
1047
|
"*"
|