@cocreate/api 1.2.31 → 1.3.0

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,24 @@
1
+ # [1.3.0](https://github.com/CoCreate-app/CoCreate-api/compare/v1.2.33...v1.3.0) (2022-05-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * function readDocumentList has been renamed to readDocuments ([a811c3e](https://github.com/CoCreate-app/CoCreate-api/commit/a811c3e093e9ea401cce3b8ce6eba8720e473906))
7
+
8
+ ## [1.2.33](https://github.com/CoCreate-app/CoCreate-api/compare/v1.2.32...v1.2.33) (2022-05-06)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update config organization_Id to organization_id ([da12a15](https://github.com/CoCreate-app/CoCreate-api/commit/da12a15f26ec015d1bfdd45ff3ff43cd8433427a))
14
+
15
+ ## [1.2.32](https://github.com/CoCreate-app/CoCreate-api/compare/v1.2.31...v1.2.32) (2022-03-06)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * use redocument ot get org if org_id is known ([7ef0d5c](https://github.com/CoCreate-app/CoCreate-api/commit/7ef0d5c3dd1ced316c83173bd3e8a0f02e6949b7))
21
+
1
22
  ## [1.2.31](https://github.com/CoCreate-app/CoCreate-api/compare/v1.2.30...v1.2.31) (2022-02-27)
2
23
 
3
24
 
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  "config": {
3
3
  "apiKey": "2061acef-0451-4545-f754-60cf8160",
4
- "organization_Id": "5ff747727005da1c272740ab",
4
+ "organization_id": "5ff747727005da1c272740ab",
5
5
  "host": "general.cocreate.app"
6
6
  },
7
7
 
package/demo/index.html CHANGED
@@ -46,7 +46,7 @@
46
46
  <script>
47
47
  var config = {
48
48
  apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
49
- organization_Id: '5de0387b12e200ea63204d6c'
49
+ organization_id: '5de0387b12e200ea63204d6c'
50
50
  }
51
51
 
52
52
  </script>
package/docs/index.html CHANGED
@@ -102,7 +102,7 @@
102
102
  <pre><code class="language-javascript">
103
103
  var config = {
104
104
  apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
105
- organization_Id: '5de0387b12e200ea63204d6c',
105
+ organization_id: '5de0387b12e200ea63204d6c',
106
106
  host: 'localhost:8081'
107
107
  }
108
108
  </code></pre>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/api",
3
- "version": "1.2.31",
3
+ "version": "1.3.0",
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
@@ -154,7 +154,7 @@ const CoCreateApi = {
154
154
  getCommonParams: function(info) {
155
155
  return {
156
156
  "apiKey": info.apiKey || config.apiKey,
157
- "organization_id": info.organization_id || config.organization_Id,
157
+ "organization_id": info.organization_id || config.organization_id,
158
158
  "host": info.host || config.host
159
159
  };
160
160
  }
package/src/server.js CHANGED
@@ -46,19 +46,19 @@ var api = ( ()=> {
46
46
  var socket_config = {
47
47
  "config": {
48
48
  "apiKey": config["config"]["apiKey"],
49
- "organization_Id": config["config"]["organization_id"],
49
+ "organization_id": config["config"]["organization_id"],
50
50
  },
51
51
  "prefix": "ws",
52
52
  "host": "server.cocreate.app:8088"
53
53
  };
54
54
 
55
55
  socket.create({
56
- namespace: socket_config.config.organization_Id,
56
+ namespace: socket_config.config.organization_id,
57
57
  room: null,
58
58
  host: socket_config.host
59
59
  })
60
60
 
61
- let data2 = await crud.readDocumentList({
61
+ let data2 = await crud.readDocuments({
62
62
  collection: "organizations",
63
63
  operator: {
64
64
  filters: [{
@@ -80,7 +80,7 @@ var api = ( ()=> {
80
80
  var socket_config = {
81
81
  "config": {
82
82
  "apiKey": org["apiKey"],
83
- "organization_Id": org["_id"].toString(),
83
+ "organization_id": org["_id"].toString(),
84
84
  },
85
85
  "prefix": "ws",
86
86
  "host": "server.cocreate.app:8088"
@@ -88,27 +88,16 @@ var api = ( ()=> {
88
88
 
89
89
  //other connection
90
90
  socket.create({
91
- namespace: socket_config.config.organization_Id,
91
+ namespace: socket_config.config.organization_id,
92
92
  room: null,
93
93
  host: socket_config.host
94
94
  })
95
95
 
96
- // socket.setGlobalScope(socket_config.config.organization_id)
97
- let myOrg = await crud.readDocumentList({
96
+ let myOrg = await crud.readDocument({
98
97
  collection: "organizations",
99
- operator: {
100
- filters: [{
101
- name: '_id',
102
- operator: "$eq",
103
- value: [org["_id"].toString()]
104
- }],
105
- orders: [],
106
- startIndex: 0,
107
- search: { type: 'or', value: []}
108
- },
109
- is_collection: false,
110
- apiKey: org["apiKey"],
111
- organization_id: org["_id"]
98
+ document_id: org["_id"],
99
+ apiKey: org["apiKey"],
100
+ organization_id: org["_id"]
112
101
  });
113
102
  let result = {'row':myOrg,'socket_config':socket_config};
114
103
  return result;