@cocreate/api 1.15.5 → 1.15.7
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 +14 -0
- package/package.json +1 -1
- package/src/client.js +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.15.7](https://github.com/CoCreate-app/CoCreate-api/compare/v1.15.6...v1.15.7) (2023-10-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* declartion of render functions using object spread ([69de66f](https://github.com/CoCreate-app/CoCreate-api/commit/69de66f9dfbce7b8bca09f152104f087060adf0a))
|
|
7
|
+
|
|
8
|
+
## [1.15.6](https://github.com/CoCreate-app/CoCreate-api/compare/v1.15.5...v1.15.6) (2023-10-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* await getValue() ([3bb412f](https://github.com/CoCreate-app/CoCreate-api/commit/3bb412f03d589eb077bae8288a1511a64eb6e7d8))
|
|
14
|
+
|
|
1
15
|
## [1.15.5](https://github.com/CoCreate-app/CoCreate-api/compare/v1.15.4...v1.15.5) (2023-10-14)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/api",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.7",
|
|
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
|
@@ -3,7 +3,7 @@ import { getAttributes, getValueFromObject, dotNotationToObject } from "@cocreat
|
|
|
3
3
|
import observer from "@cocreate/observer";
|
|
4
4
|
import socket from "@cocreate/socket-client";
|
|
5
5
|
import action from '@cocreate/actions';
|
|
6
|
-
import render from '@cocreate/render';
|
|
6
|
+
import { render } from '@cocreate/render';
|
|
7
7
|
import '@cocreate/element-prototype';
|
|
8
8
|
|
|
9
9
|
const CoCreateApi = {
|
|
@@ -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);
|
|
@@ -174,7 +174,7 @@ const CoCreateApi = {
|
|
|
174
174
|
let items = document.querySelectorAll(`[templateid="${templateid}"]`)
|
|
175
175
|
for (let item of items)
|
|
176
176
|
item.remove()
|
|
177
|
-
render
|
|
177
|
+
render({
|
|
178
178
|
selector: `[template="${templateid}"]`,
|
|
179
179
|
data
|
|
180
180
|
});
|