@cocreate/api 1.15.5 → 1.15.6

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,10 @@
1
+ ## [1.15.6](https://github.com/CoCreate-app/CoCreate-api/compare/v1.15.5...v1.15.6) (2023-10-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * await getValue() ([3bb412f](https://github.com/CoCreate-app/CoCreate-api/commit/3bb412f03d589eb077bae8288a1511a64eb6e7d8))
7
+
1
8
  ## [1.15.5](https://github.com/CoCreate-app/CoCreate-api/compare/v1.15.4...v1.15.5) (2023-10-14)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/api",
3
- "version": "1.15.5",
3
+ "version": "1.15.6",
4
4
  "description": "A simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. CoCreate-api includes the client component and server side for api processing. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. ",
5
5
  "keywords": [
6
6
  "thirdparty-api-intergration",
package/src/client.js CHANGED
@@ -97,9 +97,9 @@ const CoCreateApi = {
97
97
  }
98
98
  },
99
99
 
100
- __request: function ({ name, endPoint, element }) {
100
+ __request: async function ({ name, endPoint, element }) {
101
101
  let form = element.closest('form');
102
- let data = this.getData({ name, endPoint, form });
102
+ let data = await this.getData({ name, endPoint, form });
103
103
  this.send(name, endPoint, data[endPoint]);
104
104
  },
105
105
 
@@ -140,7 +140,7 @@ const CoCreateApi = {
140
140
  },
141
141
 
142
142
 
143
- getData: function ({ name, endPoint, element, form }) {
143
+ getData: async function ({ name, endPoint, element, form }) {
144
144
  const data = {}
145
145
  const selector = `[${name}^="${endPoint}."]`
146
146
  let elements
@@ -152,7 +152,7 @@ const CoCreateApi = {
152
152
  if (!el || el.closest('[template]')) continue
153
153
  let attribute = el.getAttribute(name)
154
154
  if (attribute)
155
- data[attribute] = el.getValue()
155
+ data[attribute] = await el.getValue()
156
156
  }
157
157
 
158
158
  return dotNotationToObject(data);