@cocreate/api 1.7.0 → 1.7.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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.7.2](https://github.com/CoCreate-app/CoCreate-api/compare/v1.7.1...v1.7.2) (2023-02-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * import getAttributes from utils ([0782ede](https://github.com/CoCreate-app/CoCreate-api/commit/0782edef09f271b1beb3da859c8358240471e5b6))
7
+
8
+ ## [1.7.1](https://github.com/CoCreate-app/CoCreate-api/compare/v1.7.0...v1.7.1) (2023-02-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * setData missng data param ([ff9c158](https://github.com/CoCreate-app/CoCreate-api/commit/ff9c1586ea2cabe0f8bb1428b4046afa20bedfcd))
14
+
1
15
  # [1.7.0](https://github.com/CoCreate-app/CoCreate-api/compare/v1.6.12...v1.7.0) (2023-02-11)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/api",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
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
@@ -1,9 +1,10 @@
1
1
  /*globals CustomEvent, config*/
2
- import { getValueFromObject, dotNotationToObject} from "@cocreate/utils";
2
+ import {getAttributes, getValueFromObject, dotNotationToObject} from "@cocreate/utils";
3
3
  import socket from "@cocreate/socket-client";
4
4
  import CoCreateAction from '@cocreate/actions';
5
5
  import CoCreateRender from '@cocreate/render';
6
6
  import '@cocreate/element-prototype';
7
+ import utils from "@cocreate/utils/src/utils";
7
8
 
8
9
  const CoCreateApi = {
9
10
  components: {},
@@ -106,7 +107,7 @@ const CoCreateApi = {
106
107
  return dotNotationToObject(data);
107
108
  },
108
109
 
109
- setData: function(attribute, action, form) {
110
+ setData: function(attribute, action, data, form) {
110
111
  const selector = `[${attribute}^="${action}."]`
111
112
  if (!form)
112
113
  form = document;
@@ -115,7 +116,7 @@ const CoCreateApi = {
115
116
 
116
117
  for (let el of elements) {
117
118
  let name = el.getAttribute(attribute)
118
- const { isRead, isUpdate, isCrdt } = crud.getAttributes(el);
119
+ const { isRead, isUpdate, isCrdt } = getAttributes(el);
119
120
  if (!name || isRead == "false" || isUpdate == "false" || isCrdt == "true") continue;
120
121
 
121
122
  if (el.hasAttribute('actions')) continue;