@cocreate/api 1.34.0 → 2.0.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/.github/FUNDING.yml +1 -1
- package/.github/workflows/automated.yml +18 -7
- package/CHANGELOG.md +635 -595
- package/CONTRIBUTING.md +6 -6
- package/README.md +6 -6
- package/demo/index.html +1 -1
- package/docs/form.html +7 -7
- package/docs/index.html +8 -8
- package/docs/module.html +6 -6
- package/docs/server.html +7 -7
- package/package.json +5 -5
- package/src/client.js +197 -0
- package/src/server.js +32 -0
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/
|
|
4
|
-
You're encouraged to submit [pull requests](https://github.com/
|
|
5
|
-
[propose features and discuss issues](https://github.com/
|
|
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/
|
|
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://
|
|
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/
|
|
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](#
|
|
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@
|
|
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/
|
|
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@
|
|
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/
|
|
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/
|
|
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
|
|
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.
|
|
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://
|
|
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.
|
|
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.
|
|
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/
|
|
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"><script>https://cdn.
|
|
61
|
+
<pre><code class="language-html"><script>https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js</script></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/
|
|
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://
|
|
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://
|
|
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.
|
|
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.
|
|
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/
|
|
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"><script>https://cdn.
|
|
67
|
+
<pre><code class="language-html"><script>https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js</script></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"><script>https://cdn.
|
|
93
|
+
<pre><code class="language-html"><script>https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js</script></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/
|
|
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://
|
|
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://
|
|
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.
|
|
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/
|
|
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"><script>https://cdn.
|
|
52
|
+
<pre><code class="language-html"><script>https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js</script></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/
|
|
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://
|
|
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://
|
|
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.
|
|
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.
|
|
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/
|
|
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"><script>https://cdn.
|
|
58
|
+
<pre><code class="language-html"><script>https://cdn.CoCreateJS.com/api/latest/CoCreate-api.min.js</script></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/
|
|
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://
|
|
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": "
|
|
3
|
+
"version": "2.0.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://
|
|
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/
|
|
35
|
+
"url": "https://github.com/CoCreateJS/api/issues"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://
|
|
37
|
+
"homepage": "https://CoCreateJS.com/docs/api",
|
|
38
38
|
"funding": {
|
|
39
39
|
"type": "GitHub Sponsors ❤",
|
|
40
|
-
"url": "https://github.com/sponsors/
|
|
40
|
+
"url": "https://github.com/sponsors/CoCreateJS"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|
|
43
43
|
"main": "./src/server.js",
|
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,153 @@ 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 member
|
|
406
|
+
* @attribute
|
|
407
|
+
* @valueType string
|
|
408
|
+
* @environment client
|
|
409
|
+
*/
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Provider-specific operation/action name.
|
|
413
|
+
*
|
|
414
|
+
* @name {name}
|
|
415
|
+
* @kind member
|
|
416
|
+
* @attribute
|
|
417
|
+
* @valueType string
|
|
418
|
+
* @environment client
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Endpoint name or path; may be defined on an ancestor group.
|
|
423
|
+
*
|
|
424
|
+
* @name {name}-endpoint
|
|
425
|
+
* @kind member
|
|
426
|
+
* @attribute
|
|
427
|
+
* @valueType string
|
|
428
|
+
* @environment client
|
|
429
|
+
*/
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Provider or HTTP method.
|
|
433
|
+
*
|
|
434
|
+
* @name {name}-method
|
|
435
|
+
* @kind member
|
|
436
|
+
* @attribute
|
|
437
|
+
* @valueType string
|
|
438
|
+
* @environment client
|
|
439
|
+
*/
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* 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.
|
|
443
|
+
*
|
|
444
|
+
* @name {name}-key
|
|
445
|
+
* @kind member
|
|
446
|
+
* @attribute
|
|
447
|
+
* @valueType string
|
|
448
|
+
* @environment client
|
|
449
|
+
*/
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Limits automatic requests to matching event types.
|
|
453
|
+
*
|
|
454
|
+
* @name {name}-event
|
|
455
|
+
* @kind member
|
|
456
|
+
* @attribute
|
|
457
|
+
* @valueType string
|
|
458
|
+
* @environment client
|
|
459
|
+
*/
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Excludes an element from request collection or response mapping when set to false.
|
|
463
|
+
*
|
|
464
|
+
* @name {name}-request | {name}-response
|
|
465
|
+
* @kind member
|
|
466
|
+
* @attribute
|
|
467
|
+
* @valueType boolean-like string
|
|
468
|
+
* @acceptedValues false
|
|
469
|
+
* @environment client
|
|
470
|
+
*/
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Declarative selectors recognized by this module.
|
|
474
|
+
*
|
|
475
|
+
* @name declarative-selectors
|
|
476
|
+
* @kind member
|
|
477
|
+
* @selectors
|
|
478
|
+
* @environment client
|
|
479
|
+
* @example
|
|
480
|
+
* ```json
|
|
481
|
+
* [
|
|
482
|
+
* "[${name}-endpoint]",
|
|
483
|
+
* "[${name}=\"${action}\"]:not([${stateAttribute}=\"false\"])",
|
|
484
|
+
* "[${name}], [${name}-endpoint]",
|
|
485
|
+
* "[template*='${name}']",
|
|
486
|
+
* "[template=\"${templateid}\"]",
|
|
487
|
+
* "[module], [api]"
|
|
488
|
+
* ]
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Declarative actions supported or registered by this module.
|
|
494
|
+
*
|
|
495
|
+
* @name declarative-actions
|
|
496
|
+
* @kind member
|
|
497
|
+
* @actions
|
|
498
|
+
* @environment client
|
|
499
|
+
* @example
|
|
500
|
+
* ```json
|
|
501
|
+
* [
|
|
502
|
+
* {
|
|
503
|
+
* "name": "{name}",
|
|
504
|
+
* "description": "Actions integration registers each provider as an action; invocation requests the provider operation and processes its response."
|
|
505
|
+
* }
|
|
506
|
+
* ]
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Declarative binding behavior for this module.
|
|
512
|
+
*
|
|
513
|
+
* @name declarative-binding
|
|
514
|
+
* @kind member
|
|
515
|
+
* @binding
|
|
516
|
+
* @environment client
|
|
517
|
+
* @example
|
|
518
|
+
* ```json
|
|
519
|
+
* {
|
|
520
|
+
* "selectors": [
|
|
521
|
+
* "[api]",
|
|
522
|
+
* "[module]",
|
|
523
|
+
* "[api-endpoint]",
|
|
524
|
+
* "[module-endpoint]"
|
|
525
|
+
* ],
|
|
526
|
+
* "triggers": [
|
|
527
|
+
* "onload",
|
|
528
|
+
* "input",
|
|
529
|
+
* "attribute change",
|
|
530
|
+
* "Actions invocation"
|
|
531
|
+
* ],
|
|
532
|
+
* "initializesExistingElements": true,
|
|
533
|
+
* "observesAddedNodes": true
|
|
534
|
+
* }
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Default export contract for this module.
|
|
540
|
+
*
|
|
541
|
+
* @name api-default-export
|
|
542
|
+
* @kind member
|
|
543
|
+
* @default-export
|
|
544
|
+
* @environment client
|
|
545
|
+
* @example
|
|
546
|
+
* ```json
|
|
547
|
+
* "CoCreateApi"
|
|
548
|
+
* ```
|
|
549
|
+
*/
|