@cocreate/unique 1.14.1 → 1.14.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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.14.3](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.14.2...v1.14.3) (2023-09-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add path and pathname ([c99a4a2](https://github.com/CoCreate-app/CoCreate-unique/commit/c99a4a229043a9ad0772248e5e02c1bb323d6673))
7
+ * Update dCoCreate dpendencies to latest versions ([971943a](https://github.com/CoCreate-app/CoCreate-unique/commit/971943a3889ff959eab02514469629666fa892c2))
8
+
9
+ ## [1.14.2](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.14.1...v1.14.2) (2023-09-17)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * renamed filter to $filter ([5db5a1f](https://github.com/CoCreate-app/CoCreate-unique/commit/5db5a1f4795aa37574e69e3b5c4fa10b5b72895a))
15
+ * socket referenced in the data object. data.socket ([da15823](https://github.com/CoCreate-app/CoCreate-unique/commit/da15823e0b781c921bad72363f3f4edeb8e85a09))
16
+
1
17
  ## [1.14.1](https://github.com/CoCreate-app/CoCreate-unique/compare/v1.14.0...v1.14.1) (2023-08-21)
2
18
 
3
19
 
@@ -8,17 +8,16 @@ module.exports = {
8
8
  "object": {
9
9
  "_id": "6020a3863c260207bf49cad0",
10
10
  "name": "index.html",
11
- "path": "/docs/unique/index.html",
11
+ "path": "/docs/unique",
12
+ "pathname": "/docs/unique/index.html",
12
13
  "src": "{{./docs/index.html}}",
13
14
  "host": [
14
15
  "*",
15
16
  "general.cocreate.app"
16
17
  ],
17
- "directory": "/docs/unique",
18
- "parentDirectory": "{{parentDirectory}}",
18
+ "directory": "unique",
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/unique",
3
- "version": "1.14.1",
3
+ "version": "1.14.3",
4
4
  "description": "A simple unique component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "unique",
@@ -58,7 +58,7 @@
58
58
  "webpack-log": "^3.0.1"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/crud-client": "^1.24.0",
62
- "@cocreate/uuid": "^1.7.0"
61
+ "@cocreate/crud-client": "^1.25.0",
62
+ "@cocreate/uuid": "^1.7.1"
63
63
  }
64
64
  }
package/src/client.js CHANGED
@@ -47,7 +47,7 @@ async function isUnique(element) {
47
47
  method: 'read.object',
48
48
  db: 'indexeddb',
49
49
  array: element.getAttribute('array'),
50
- filter: {
50
+ $filter: {
51
51
  query: [{
52
52
  key,
53
53
  value,
package/src/server.js CHANGED
@@ -10,8 +10,7 @@ class CoCreateUnique {
10
10
 
11
11
  init() {
12
12
  if (this.wsManager) {
13
- this.wsManager.on('isUnique',
14
- (socket, data) => this.isUnique(socket, data));
13
+ this.wsManager.on('isUnique', (data) => this.isUnique(data));
15
14
  }
16
15
  }
17
16
 
@@ -24,7 +23,7 @@ class CoCreateUnique {
24
23
  *
25
24
  * @return { Promise } - resolves with the response from the server or rejects with an error if there was a
26
25
  */
27
- async isUnique(socket, data) {
26
+ async isUnique(data) {
28
27
  const self = this
29
28
  try {
30
29
  data.method = 'read.object'
@@ -38,7 +37,7 @@ class CoCreateUnique {
38
37
  if (data.object.length) {
39
38
  response.unique = false;
40
39
  }
41
- return self.wsManager.send(socket, response);
40
+ return self.wsManager.send(response);
42
41
  })
43
42
  } catch (error) {
44
43
  console.log(error);