@cocreate/api 1.34.0 → 2.1.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/CONTRIBUTING.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Contributing to CoCreate-api
2
2
 
3
- This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-api/graphs/contributors).
4
- You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-api/pulls),
5
- [propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-api/issues).
3
+ This project is work of [many contributors](https://github.com/CoCreateJS/api/graphs/contributors).
4
+ You're encouraged to submit [pull requests](https://github.com/CoCreateJS/api/pulls),
5
+ [propose features and discuss issues](https://github.com/CoCreateJS/api/issues).
6
6
 
7
7
  In the examples below, substitute your Github username for `contributor` in URLs.
8
8
 
9
9
  ## Fork the Project
10
10
 
11
- Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-api) and check out your copy.
11
+ Fork the [project on Github](https://github.com/CoCreateJS/api) and check out your copy.
12
12
 
13
13
  ```
14
14
  git api https://github.com/contributor/CoCreate-api.git
15
15
  cd CoCreate-api
16
- git remote add upstream https://gitlab.com/cocreatejs/CoCreate-api.git
16
+ git remote add upstream https://github.com/CoCreateJS/api.git
17
17
  ```
18
18
 
19
19
  ## Create a Topic Branch
@@ -75,7 +75,7 @@ git push origin my-feature-branch
75
75
 
76
76
  ## Make a Pull Request
77
77
 
78
- Go to [https://github.com/CoCreate-app/CoCreate-api](https://github.com/CoCreate-app/CoCreate-api) and select your feature branch.
78
+ Go to [https://github.com/CoCreateJS/api](https://github.com/CoCreateJS/api) and select your feature branch.
79
79
  Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
80
80
 
81
81
  ## Rebase
package/README.md CHANGED
@@ -19,7 +19,7 @@ For complete API references, integration guides, webhook configuration, and usag
19
19
  - [Client Usage: HTML5 Attributes](#client-usage-html5-attributes)
20
20
  - [Client Usage: JavaScript API](#client-usage-javascript-api)
21
21
  - [Attribute Reference](#attribute-reference)
22
- - [Server Usage](#server-usage)
22
+ - [Server Usage](#usage)
23
23
  - [How it Works](#how-it-works)
24
24
  - [Architecture and Payload Specs](#architecture-and-payload-specs)
25
25
  - [Security Implementations](#security-implementations)
@@ -100,7 +100,7 @@ Clicking the button collects every `[stripe="customers.create"]` element in the
100
100
  {
101
101
  "method": "stripe.customers.create",
102
102
  "stripe": {
103
- "email": "developer@cocreate.app",
103
+ "email": "developer@CoCreateJS.com",
104
104
  "metadata": { "workspace": "production" }
105
105
  },
106
106
  "status": "await"
@@ -227,7 +227,7 @@ Bind the API framework directly during the bootstrapping phase of your core `CoC
227
227
 
228
228
  ```javascript
229
229
  import apiGateway from '@cocreate/api';
230
- import { CoCreateServer } from '@cocreate/server';
230
+ import { CoCreateServer } from '@cocreate/cluster';
231
231
 
232
232
  // Boot the primary application server instance
233
233
  const serverContext = await CoCreateServer.start();
@@ -254,7 +254,7 @@ const payload = {
254
254
  workspace: "production"
255
255
  }
256
256
  },
257
- userEmail: "developer@cocreate.app"
257
+ userEmail: "developer@CoCreateJS.com"
258
258
  };
259
259
 
260
260
  const result = await apiGateway.executeApi(payload);
@@ -344,9 +344,9 @@ Inbound webhooks configured with authentication rules are validated using `crypt
344
344
 
345
345
  ## How to Contribute
346
346
 
347
- We encourage contributions to all CoCreate libraries. Please see our **[CONTRIBUTING.md](https://github.com/CoCreate-app/CoCreate-api/blob/master/CONTRIBUTING.md)** guide for development workflows and contribution guidelines.
347
+ We encourage contributions to all CoCreate libraries. Please see our **[CONTRIBUTING.md](https://github.com/CoCreateJS/api/blob/master/CONTRIBUTING.md)** guide for development workflows and contribution guidelines.
348
348
 
349
- If you discover a bug or would like to request a feature, please open an issue on our **[GitHub Issues](https://github.com/CoCreate-app/CoCreate-api/issues)** tracker.
349
+ If you discover a bug or would like to request a feature, please open an issue on our **[GitHub Issues](https://github.com/CoCreateJS/api/issues)** tracker.
350
350
 
351
351
  For complete API documentation, integration examples, and webhook guides, visit:
352
352
 
@@ -359,4 +359,9 @@ https://cocreatejs.com/docs/api
359
359
  This software is dual-licensed under the GNU Affero General Public License version 3 (AGPLv3) and a commercial license.
360
360
 
361
361
  - **Open Source Use:** For open-source projects and non-commercial use, this software is available under the AGPLv3. For the full license text, see the LICENSE file.
362
- - **Commercial Use:** Commercial users must obtain a commercial license. Commercial licenses are available when signing up for an API key through the CoCreate platform.
362
+ - **Commercial Use:** Commercial users must obtain a commercial license. Commercial licenses are available when signing up for an API key through the CoCreate platform.
363
+ ## HTTP entrance
364
+
365
+ The initialized API service exposes `http(req, res)` alongside `webhook(req, res)`. The module accepts POST JSON bodies up to 1 MiB, resolves organization scope from the hostname, and authorizes through `server.authorize.request` before execution. Bearer API keys and the envelope `apikey` field are supported; conflicting keys are rejected. Missing permission or authorization service returns 403. Caller scope and socket/user identity are excluded, and execution uses the sanitized envelope without the transport key.
366
+
367
+ `send()` remains the execution API used by trusted internal calls and socket dispatch, where socket authorization already occurs. The existing webhook AST owns provider signature verification.
package/demo/index.html CHANGED
@@ -54,7 +54,7 @@
54
54
  <h1>Result</h1>
55
55
 
56
56
  <!--CoCreateJS CDN-->
57
- <!-- <script src="https://cdn.cocreate.app/api/latest/CoCreate-api.min.js"></script> -->
57
+ <!-- <script src="https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js"></script> -->
58
58
  <script src="../dist/CoCreate-api.js"></script>
59
59
  </body>
60
60
  </html>
package/docs/form.html CHANGED
@@ -6,11 +6,11 @@
6
6
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <title>CoCreate-api form Documentation | CoCreateJS </title>
9
- <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
9
+ <link rel="icon" type="image/png" sizes="32x32" href="https://CoCreateJS.com/images/favicon.ico">
10
10
  <meta name="description" content="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API" />
11
11
  <meta name="keywords" content="drag and drop, colaboration, dnd utility, drag and drop utility" />
12
12
  <meta name="robots" content="index,follow" />
13
- <meta property="og:image" content="https://cdn.cocreate.app/docs/api.png">
13
+ <meta property="og:image" content="https://cdn.CoCreateJS.com/docs/api.png">
14
14
 
15
15
  <link rel="stylesheet" href="/docs/index.css" array="files" object="60888216117c640e7596303f" key="src" type="text/css" save="true" />
16
16
  <link rel="manifest" href="/manifest.webmanifest" />
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
  <div class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
32
32
  <div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API"
33
- share-title="CoCreate API form" share-height="600" share-width="700" share-media="https://cdn.cocreate.app/docs/api.png" hover="display:block!important" hover-query=".social-networks">
33
+ share-title="CoCreate API form" share-height="600" share-width="700" share-media="https://cdn.CoCreateJS.com/docs/api.png" hover="display:block!important" hover-query=".social-networks">
34
34
  <div class="display:none social-networks">
35
35
  <a class="margin-right:15px" share-network="twitter" title="Share on twitter"><i src="/assets/svg/twitter.svg"></i></a>
36
36
  <a class="margin-right:15px" share-network="facebook" title="Share on Facebook"><i src="/assets/svg/facebook.svg"></i></a>
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  <a class="margin-right:15px" share-network="share" title="Share on share"><i src="/assets/svg/share-alt.svg"></i></a>
40
40
  </div>
41
- <a href="https://github.com/CoCreate-app/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
41
+ <a href="https://github.com/CoCreateJS/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
42
42
  </div>
43
43
  </div>
44
44
  <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">CoCreate-api is a simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. CoCreate-api includes the
@@ -58,7 +58,7 @@
58
58
  <pre><code class="language-bash">npm i @cocreate/api</code></pre>
59
59
  </p>
60
60
  <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
61
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
61
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
62
62
 
63
63
  <div>
64
64
  <h2 id="api-server-run" hover="display:block" hover-query="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">Server run</h2>
@@ -201,12 +201,12 @@
201
201
  </div>
202
202
  </div>
203
203
  </div>
204
- <button href="https://github.com/CoCreate-app/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
204
+ <button href="https://github.com/CoCreateJS/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
205
205
  <i src="/assets/svg/pencil-alt.svg"></i>
206
206
  </button>
207
207
  </main>
208
208
 
209
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
209
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
210
210
 
211
211
  </body>
212
212
 
package/docs/index.html CHANGED
@@ -6,11 +6,11 @@
6
6
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <title>CoCreate-api Documentation | CoCreateJS </title>
9
- <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
9
+ <link rel="icon" type="image/png" sizes="32x32" href="https://CoCreateJS.com/images/favicon.ico">
10
10
  <meta name="description" content="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API" />
11
11
  <meta name="keywords" content="drag and drop, collaboration, dnd utility, drag and drop utility" />
12
12
  <meta name="robots" content="index,follow" />
13
- <meta property="og:image" content="https://cdn.cocreate.app/docs/api.png">
13
+ <meta property="og:image" content="https://cdn.CoCreateJS.com/docs/api.png">
14
14
  <link rel="stylesheet" href="/docs/index.css" array="files" object="60888216117c640e7596303f" key="src" type="text/css" save="true" />
15
15
 
16
16
  <link rel="manifest" href="/manifest.webmanifest" />
@@ -37,7 +37,7 @@
37
37
  <h2>CoCreate-api</h2>
38
38
  </div>
39
39
  <div class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
40
- <div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="Enter decription here" share-title="testing im a title" share-height="600" share-width="700" share-media="https://cdn.cocreate.app/docs/api.png"
40
+ <div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="Enter decription here" share-title="testing im a title" share-height="600" share-width="700" share-media="https://cdn.CoCreateJS.com/docs/api.png"
41
41
  hover="display:block!important" hover-query=".social-networks">
42
42
  <div class="display:none social-networks">
43
43
  <a class="margin-right:15px" share-network="twitter" title="Share on twitter"><i src="/assets/svg/twitter.svg"></i></a>
@@ -46,7 +46,7 @@
46
46
  </div>
47
47
  <a class="margin-right:15px" share-network="share" title="Share on share"><i src="/assets/svg/share-alt.svg"></i></a>
48
48
  </div>
49
- <a href="https://github.com/CoCreate-app/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
49
+ <a href="https://github.com/CoCreateJS/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
50
50
  </div>
51
51
  </div>
52
52
 
@@ -64,7 +64,7 @@
64
64
 
65
65
  <pre><code class="language-bash">npm i @cocreate/api</code></pre>
66
66
  <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
67
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
67
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
68
68
 
69
69
  <div>
70
70
  <h2 id="api-dependencies" hover="display:block" hover-query="" class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px">Dependencies components</h2>
@@ -90,7 +90,7 @@
90
90
  <pre><code class="language-bash">npm i @cocreate/api</code></pre>
91
91
  </p>
92
92
  <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
93
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
93
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
94
94
 
95
95
  <div>
96
96
  <h2 id="api-server-run" hover="display:block" hover-query="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">Server run</h2>
@@ -229,11 +229,11 @@
229
229
  </div>
230
230
  </div>
231
231
 
232
- <button href="https://github.com/CoCreate-app/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
232
+ <button href="https://github.com/CoCreateJS/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
233
233
  <i src="/assets/svg/pencil-alt.svg"></i>
234
234
  </button>
235
235
  </main>
236
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
236
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
237
237
  </body>
238
238
 
239
239
  </html>
package/docs/module.html CHANGED
@@ -6,11 +6,11 @@
6
6
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <title>CoCreate-api module Documentation | CoCreateJS </title>
9
- <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
9
+ <link rel="icon" type="image/png" sizes="32x32" href="https://CoCreateJS.com/images/favicon.ico">
10
10
  <meta name="description" content="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API" />
11
11
  <meta name="keywords" content="drag and drop, colaboration, dnd utility, drag and drop utility" />
12
12
  <meta name="robots" content="index,follow" />
13
- <meta property="og:image" content="https://cdn.cocreate.app/docs/api.png">
13
+ <meta property="og:image" content="https://cdn.CoCreateJS.com/docs/api.png">
14
14
 
15
15
  <!-- CoCreate CSS -->
16
16
  <link rel="stylesheet" href="" type="text/css" />
@@ -30,7 +30,7 @@
30
30
  <div class="display:flex align-items:center">
31
31
  <h2>CoCreate-api modules</h2>
32
32
  </div>
33
- <a href="https://github.com/CoCreate-app/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
33
+ <a href="https://github.com/CoCreateJS/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
34
34
  </div>
35
35
 
36
36
  <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">CoCreate-api is a simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. CoCreate-api includes the
@@ -49,7 +49,7 @@
49
49
  <pre><code class="language-bash">npm i @cocreate/api</code></pre>
50
50
  </p>
51
51
  <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
52
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
52
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
53
53
 
54
54
  <div>
55
55
  <h2 id="api-dependencies" hover="display:block" hover-query="" class="border-bottom:1px_solid_lightgrey margin-top:80px padding:5px_0px">Dependencies components</h2>
@@ -193,12 +193,12 @@
193
193
  </div>
194
194
  </div>
195
195
  </div>
196
- <button href="https://github.com/CoCreate-app/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
196
+ <button href="https://github.com/CoCreateJS/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
197
197
  <i src="/assets/svg/pencil-alt.svg"></i>
198
198
  </button>
199
199
  </main>
200
200
 
201
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
201
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
202
202
 
203
203
  </body>
204
204
 
package/docs/server.html CHANGED
@@ -6,11 +6,11 @@
6
6
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <title>CoCreate-api server Documentation | CoCreateJS </title>
9
- <link rel="icon" type="image/png" sizes="32x32" href="https://cocreate.app/images/favicon.ico">
9
+ <link rel="icon" type="image/png" sizes="32x32" href="https://CoCreateJS.com/images/favicon.ico">
10
10
  <meta name="description" content="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API" />
11
11
  <meta name="keywords" content="drag and drop, colaboration, dnd utility, drag and drop utility" />
12
12
  <meta name="robots" content="index,follow" />
13
- <meta property="og:image" content="https://cdn.cocreate.app/docs/api.png">
13
+ <meta property="og:image" content="https://cdn.CoCreateJS.com/docs/api.png">
14
14
 
15
15
  <link rel="stylesheet" href="/docs/index.css" array="files" object="60888216117c640e7596303f" key="src" type="text/css" save="true" />
16
16
  <link rel="manifest" href="/manifest.webmanifest">
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
  <div class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
32
32
  <div class="display:flex align-items:center transition:0.3s padding-left:10px" share-network="true" share-text="An api helper component in vanilla javascript to setup thirdparty api intergrations. Apis can be accessible using HTML5 attributes and/or JavaScript API"
33
- share-title="CoCreate API server" share-height="600" share-width="700" share-media="https://cdn.cocreate.app/docs/api.png" hover="display:block!important" hover-query=".social-networks">
33
+ share-title="CoCreate API server" share-height="600" share-width="700" share-media="https://cdn.CoCreateJS.com/docs/api.png" hover="display:block!important" hover-query=".social-networks">
34
34
  <div class="display:none social-networks">
35
35
  <a class="margin-right:15px" share-network="twitter" title="Share on twitter"><i src="/assets/svg/twitter.svg"></i></a>
36
36
  <a class="margin-right:15px" share-network="facebook" title="Share on Facebook"><i src="/assets/svg/facebook.svg"></i></a>
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  <a class="margin-right:15px" share-network="share" title="Share on share"><i src="/assets/svg/share-alt.svg"></i></a>
40
40
  </div>
41
- <a href="https://github.com/CoCreate-app/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
41
+ <a href="https://github.com/CoCreateJS/CoCreate-dnd" target="_blank" class=""><i src="/assets/svg/github.svg"></i></a>
42
42
  </div>
43
43
  </div>
44
44
  <h1 class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">CoCreate-api is a simple api helper component in vanilla javascript used by JavaScript developers to create thirdparty api intergrations. Thirdparty apis can be accessible using HTML5 attributes and/or JavaScript API. CoCreate-api includes the
@@ -55,7 +55,7 @@
55
55
  <pre><code class="language-bash">npm i @cocreate/api</code></pre>
56
56
  </p>
57
57
  <p class="padding:10px_0px line-height:1.5">Or you can use cdn link:</p>
58
- <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
58
+ <pre><code class="language-html">&lt;script&gt;https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js&lt;/script&gt;</code></pre>
59
59
 
60
60
  <div>
61
61
  <h2 id="api-server-run" hover="display:block" hover-query="" class="border-bottom:1px_solid_lightgrey padding:5px_0px">Server run</h2>
@@ -202,12 +202,12 @@
202
202
  </div>
203
203
  </div>
204
204
  </div>
205
- <button href="https://github.com/CoCreate-app/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
205
+ <button href="https://github.com/CoCreateJS/CoCreate-api/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..." target="_blank" class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
206
206
  <i src="/assets/svg/pencil-alt.svg"></i>
207
207
  </button>
208
208
  </main>
209
209
 
210
- <script src="https://CoCreate.app/dist/CoCreate.js"></script>
210
+ <script src="https://CoCreateJS.com/dist/CoCreate.js"></script>
211
211
 
212
212
  </body>
213
213
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/api",
3
- "version": "1.34.0",
3
+ "version": "2.1.0",
4
4
  "description": "A secure, multi-tenant API execution gateway and proxy layer that dynamically resolves endpoint actions, processes AST micro-operators, handles webhooks, and manages third-party integrations with strict tenant environment isolation.",
5
5
  "keywords": [
6
6
  "api-orchestration",
@@ -27,17 +27,17 @@
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "git+https://gitlab.com/cocreatejs/CoCreate-api.git"
30
+ "url": "git+https://github.com/CoCreateJS/api.git"
31
31
  },
32
32
  "author": "CoCreate LLC",
33
33
  "license": "GPL-3.0",
34
34
  "bugs": {
35
- "url": "https://github.com/CoCreate-app/CoCreate-api/issues"
35
+ "url": "https://github.com/CoCreateJS/api/issues"
36
36
  },
37
- "homepage": "https://cocreate.app/docs/api",
37
+ "homepage": "https://CoCreateJS.com/docs/api",
38
38
  "funding": {
39
39
  "type": "GitHub Sponsors ❤",
40
- "url": "https://github.com/sponsors/CoCreate-app"
40
+ "url": "https://github.com/sponsors/CoCreateJS"
41
41
  },
42
42
  "type": "module",
43
43
  "main": "./src/server.js",
@@ -51,14 +51,14 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "@cocreate/actions": "^1.24.0",
55
- "@cocreate/crud-client": "^1.37.0",
56
- "@cocreate/element-prototype": "^1.35.0",
57
- "@cocreate/render": "^1.51.0",
58
- "@cocreate/socket-client": "^1.43.0",
59
- "@cocreate/utils": "^1.54.0"
54
+ "@cocreate/actions": "^2.0.0",
55
+ "@cocreate/crud-client": "^2.0.0",
56
+ "@cocreate/element-prototype": "^2.0.0",
57
+ "@cocreate/render": "^2.0.0",
58
+ "@cocreate/socket-client": "^2.0.0",
59
+ "@cocreate/utils": "^2.0.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@cocreate/webpack": "^1.9.0"
62
+ "@cocreate/webpack": "^2.0.0"
63
63
  }
64
64
  }
package/src/client.js CHANGED
@@ -39,8 +39,19 @@ function getGroupElements({ name, action, element, form, response = false }) {
39
39
  }
40
40
 
41
41
  const CoCreateApi = {
42
+ /**
43
+ *
44
+ * @public
45
+ * @environment client
46
+ */
42
47
  modules: {},
43
48
 
49
+ /**
50
+ * Scans declarative providers when called without a config, or registers the supplied provider config.
51
+ *
52
+ * @public
53
+ * @environment client
54
+ */
44
55
  init: function (moduleConfig) {
45
56
  if (!moduleConfig) {
46
57
  let elements = document.querySelectorAll("[api], [module]");
@@ -58,6 +69,12 @@ const CoCreateApi = {
58
69
  }
59
70
  },
60
71
 
72
+ /**
73
+ * Registers a provider, its Actions callback, DOM listeners, and observers.
74
+ *
75
+ * @public
76
+ * @environment client
77
+ */
61
78
  register: function ({ name, endPoints, options }) {
62
79
  const self = this;
63
80
  if (typeof this.modules[name] === "undefined") {
@@ -121,6 +138,12 @@ const CoCreateApi = {
121
138
  }
122
139
  },
123
140
 
141
+ /**
142
+ * Builds and dispatches a provider request from context and associated elements.
143
+ *
144
+ * @public
145
+ * @environment client
146
+ */
124
147
  request: async function (object) {
125
148
  if (object.element) {
126
149
  if (!object.action)
@@ -159,6 +182,12 @@ const CoCreateApi = {
159
182
  }
160
183
  },
161
184
 
185
+ /**
186
+ * Handles a response, maps values to elements, dispatches completion, and routes errors.
187
+ *
188
+ * @public
189
+ * @environment client
190
+ */
162
191
  response: function (object) {
163
192
  const name = object.name;
164
193
  const action = object.action;
@@ -202,6 +231,12 @@ const CoCreateApi = {
202
231
  }
203
232
  },
204
233
 
234
+ /**
235
+ * Sends a client request through CoCreate Socket.
236
+ *
237
+ * @public
238
+ * @environment client
239
+ */
205
240
  send: async function (object) {
206
241
  const isDataObject = object.data &&
207
242
  typeof object.data === "object" &&
@@ -230,6 +265,12 @@ const CoCreateApi = {
230
265
  this.response(object);
231
266
  },
232
267
 
268
+ /**
269
+ * Collects and normalizes request values from the relevant element group.
270
+ *
271
+ * @public
272
+ * @environment client
273
+ */
233
274
  getData: async function ({ name, action, element, form }) {
234
275
  let data = {};
235
276
 
@@ -281,6 +322,12 @@ const CoCreateApi = {
281
322
  return data;
282
323
  },
283
324
 
325
+ /**
326
+ * Maps response data back to matching elements using setValue or renderValue.
327
+ *
328
+ * @public
329
+ * @environment client
330
+ */
284
331
  setData: function (object) {
285
332
  const name = object.name;
286
333
  const data = object.data.data;
@@ -350,3 +397,146 @@ Observer.init({
350
397
  CoCreateApi.init();
351
398
 
352
399
  export default CoCreateApi;
400
+
401
+ /**
402
+ * Declares/registers an API provider name; provider-specific attributes are derived from this name.
403
+ *
404
+ * @name api | module
405
+ * @kind attribute
406
+ * @valueType string
407
+ * @environment client
408
+ */
409
+
410
+ /**
411
+ * Provider-specific operation/action name.
412
+ *
413
+ * @name {name}
414
+ * @kind attribute
415
+ * @valueType string
416
+ * @environment client
417
+ */
418
+
419
+ /**
420
+ * Endpoint name or path; may be defined on an ancestor group.
421
+ *
422
+ * @name {name}-endpoint
423
+ * @kind attribute
424
+ * @valueType string
425
+ * @environment client
426
+ */
427
+
428
+ /**
429
+ * Provider or HTTP method.
430
+ *
431
+ * @name {name}-method
432
+ * @kind attribute
433
+ * @valueType string
434
+ * @environment client
435
+ */
436
+
437
+ /**
438
+ * Maps an element's value into request data or maps response data back to the element. A key ending in [] accumulates values into an array; {} maps the whole object.
439
+ *
440
+ * @name {name}-key
441
+ * @kind attribute
442
+ * @valueType string
443
+ * @environment client
444
+ */
445
+
446
+ /**
447
+ * Limits automatic requests to matching event types.
448
+ *
449
+ * @name {name}-event
450
+ * @kind attribute
451
+ * @valueType string
452
+ * @environment client
453
+ */
454
+
455
+ /**
456
+ * Excludes an element from request collection or response mapping when set to false.
457
+ *
458
+ * @name {name}-request | {name}-response
459
+ * @kind attribute
460
+ * @valueType boolean-like string
461
+ * @acceptedValues false
462
+ * @environment client
463
+ */
464
+
465
+ /**
466
+ * Declarative selectors recognized by this module.
467
+ *
468
+ * @name declarative-selectors
469
+ * @kind member
470
+ * @selectors
471
+ * @environment client
472
+ * @example
473
+ * ```json
474
+ * [
475
+ * "[${name}-endpoint]",
476
+ * "[${name}=\"${action}\"]:not([${stateAttribute}=\"false\"])",
477
+ * "[${name}], [${name}-endpoint]",
478
+ * "[template*='${name}']",
479
+ * "[template=\"${templateid}\"]",
480
+ * "[module], [api]"
481
+ * ]
482
+ * ```
483
+ */
484
+
485
+ /**
486
+ * Declarative actions supported or registered by this module.
487
+ *
488
+ * @name declarative-actions
489
+ * @kind member
490
+ * @actions
491
+ * @environment client
492
+ * @example
493
+ * ```json
494
+ * [
495
+ * {
496
+ * "name": "{name}",
497
+ * "description": "Actions integration registers each provider as an action; invocation requests the provider operation and processes its response."
498
+ * }
499
+ * ]
500
+ * ```
501
+ */
502
+
503
+ /**
504
+ * Declarative binding behavior for this module.
505
+ *
506
+ * @name declarative-binding
507
+ * @kind member
508
+ * @binding
509
+ * @environment client
510
+ * @example
511
+ * ```json
512
+ * {
513
+ * "selectors": [
514
+ * "[api]",
515
+ * "[module]",
516
+ * "[api-endpoint]",
517
+ * "[module-endpoint]"
518
+ * ],
519
+ * "triggers": [
520
+ * "onload",
521
+ * "input",
522
+ * "attribute change",
523
+ * "Actions invocation"
524
+ * ],
525
+ * "initializesExistingElements": true,
526
+ * "observesAddedNodes": true
527
+ * }
528
+ * ```
529
+ */
530
+
531
+ /**
532
+ * Default export contract for this module.
533
+ *
534
+ * @name api-default-export
535
+ * @kind member
536
+ * @default-export
537
+ * @environment client
538
+ * @example
539
+ * ```json
540
+ * "CoCreateApi"
541
+ * ```
542
+ */