@easyflow/javascript-sdk 2.1.8 → 2.1.9
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/README.md +71 -7
- package/dist/index.d.ts +421 -0
- package/package.json +19 -6
- package/.babelrc +0 -5
- package/.github/workflows/deploy-sdk-cf.yml +0 -49
- package/.github/workflows/release-sdk-cdn.yml +0 -144
- package/.github/workflows/release-sdk.yml +0 -112
- package/.prettierrc +0 -6
- package/CDN-DEPLOYMENT.md +0 -175
- package/DEMO.md +0 -258
- package/DEPLOYMENT.md +0 -224
- package/INTEGRATION-GUIDE.md +0 -521
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/easyflow-javascript-sdk/index.html +0 -116
- package/coverage/easyflow-javascript-sdk/libs/constants.mjs.html +0 -268
- package/coverage/easyflow-javascript-sdk/libs/errors.mjs.html +0 -271
- package/coverage/easyflow-javascript-sdk/libs/exception-handler.mjs.html +0 -148
- package/coverage/easyflow-javascript-sdk/libs/fingerprint.mjs.html +0 -895
- package/coverage/easyflow-javascript-sdk/libs/http.mjs.html +0 -502
- package/coverage/easyflow-javascript-sdk/libs/index.html +0 -266
- package/coverage/easyflow-javascript-sdk/libs/logger.mjs.html +0 -568
- package/coverage/easyflow-javascript-sdk/libs/sanitizer.mjs.html +0 -1099
- package/coverage/easyflow-javascript-sdk/libs/security.mjs.html +0 -733
- package/coverage/easyflow-javascript-sdk/libs/types.mjs.html +0 -508
- package/coverage/easyflow-javascript-sdk/libs/utils.mjs.html +0 -379
- package/coverage/easyflow-javascript-sdk/libs/validator.mjs.html +0 -2623
- package/coverage/easyflow-javascript-sdk/sdk.mjs.html +0 -2434
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -131
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/easyflow-javascript-sdk/index.html +0 -116
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/constants.mjs.html +0 -268
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/errors.mjs.html +0 -271
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/exception-handler.mjs.html +0 -148
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/fingerprint.mjs.html +0 -895
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/http.mjs.html +0 -502
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/index.html +0 -266
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/logger.mjs.html +0 -568
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/sanitizer.mjs.html +0 -1099
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/security.mjs.html +0 -733
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/types.mjs.html +0 -508
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/utils.mjs.html +0 -379
- package/coverage/lcov-report/easyflow-javascript-sdk/libs/validator.mjs.html +0 -2623
- package/coverage/lcov-report/easyflow-javascript-sdk/sdk.mjs.html +0 -2434
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -1429
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/dist/435.easyflow-sdk.min.js +0 -1
- package/dist/easyflow-sdk.min.js +0 -1
- package/dist/easyflow-sdk.min.js.LICENSE.txt +0 -1
- package/dist/index.html +0 -756
- package/docs/index.html +0 -775
- package/examples/lovable-integration.html +0 -410
- package/index.html +0 -981
- package/jest.config.js +0 -37
- package/jsdoc.json +0 -42
- package/libs/auto-integration.mjs +0 -333
- package/libs/constants.mjs +0 -61
- package/libs/constants.spec.js +0 -198
- package/libs/errors.mjs +0 -62
- package/libs/errors.spec.js +0 -178
- package/libs/exception-handler.mjs +0 -21
- package/libs/exception-handler.spec.js +0 -237
- package/libs/fingerprint.mjs +0 -270
- package/libs/http.mjs +0 -163
- package/libs/http.spec.js +0 -427
- package/libs/integration-wrapper.mjs +0 -285
- package/libs/logger.mjs +0 -161
- package/libs/logger.spec.js +0 -389
- package/libs/sanitizer.mjs +0 -340
- package/libs/sanitizer.spec.js +0 -583
- package/libs/security.mjs +0 -217
- package/libs/types.mjs +0 -141
- package/libs/utils.mjs +0 -368
- package/libs/utils.spec.js +0 -231
- package/libs/validator.mjs +0 -952
- package/libs/validator.spec.js +0 -615
- package/mocks/offer.mock.js +0 -77
- package/scripts/publish-npm.sh +0 -82
- package/sdk.mjs +0 -945
- package/sdk.spec.js +0 -796
- package/test-setup.cjs +0 -211
- package/test.html +0 -154
- package/webpack.config.cjs +0 -41
package/docs/index.html
DELETED
|
@@ -1,775 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Easyflow SDK - Documentation</title>
|
|
7
|
-
<style>
|
|
8
|
-
:root {
|
|
9
|
-
--easyflow-blue: #2563eb;
|
|
10
|
-
--easyflow-blue-dark: #1d4ed8;
|
|
11
|
-
--easyflow-blue-light: #3b82f6;
|
|
12
|
-
--easyflow-gray: #64748b;
|
|
13
|
-
--easyflow-gray-light: #f1f5f9;
|
|
14
|
-
--easyflow-gray-dark: #334155;
|
|
15
|
-
--easyflow-white: #ffffff;
|
|
16
|
-
--easyflow-border: #e2e8f0;
|
|
17
|
-
--easyflow-success: #10b981;
|
|
18
|
-
--easyflow-warning: #f59e0b;
|
|
19
|
-
--easyflow-error: #ef4444;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
* {
|
|
23
|
-
margin: 0;
|
|
24
|
-
padding: 0;
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
body {
|
|
29
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
30
|
-
line-height: 1.6;
|
|
31
|
-
color: var(--easyflow-gray-dark);
|
|
32
|
-
background: var(--easyflow-white);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.container {
|
|
36
|
-
max-width: 1200px;
|
|
37
|
-
margin: 0 auto;
|
|
38
|
-
padding: 20px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.header {
|
|
42
|
-
background: var(--easyflow-blue);
|
|
43
|
-
color: var(--easyflow-white);
|
|
44
|
-
padding: 40px 20px;
|
|
45
|
-
text-align: center;
|
|
46
|
-
margin-bottom: 30px;
|
|
47
|
-
border-radius: 8px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.header h1 {
|
|
51
|
-
font-size: 2.5rem;
|
|
52
|
-
margin-bottom: 15px;
|
|
53
|
-
font-weight: 600;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.header p {
|
|
57
|
-
font-size: 1.1rem;
|
|
58
|
-
opacity: 0.9;
|
|
59
|
-
max-width: 600px;
|
|
60
|
-
margin: 0 auto;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.nav {
|
|
64
|
-
background: var(--easyflow-gray-light);
|
|
65
|
-
padding: 20px;
|
|
66
|
-
border-radius: 8px;
|
|
67
|
-
margin-bottom: 30px;
|
|
68
|
-
border: 1px solid var(--easyflow-border);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.nav ul {
|
|
72
|
-
list-style: none;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-wrap: wrap;
|
|
75
|
-
gap: 15px;
|
|
76
|
-
justify-content: center;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.nav a {
|
|
80
|
-
color: var(--easyflow-blue);
|
|
81
|
-
text-decoration: none;
|
|
82
|
-
padding: 10px 20px;
|
|
83
|
-
border-radius: 6px;
|
|
84
|
-
border: 1px solid var(--easyflow-border);
|
|
85
|
-
background: var(--easyflow-white);
|
|
86
|
-
transition: all 0.2s ease;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.nav a:hover {
|
|
90
|
-
background: var(--easyflow-blue);
|
|
91
|
-
color: var(--easyflow-white);
|
|
92
|
-
border-color: var(--easyflow-blue);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.section {
|
|
96
|
-
background: var(--easyflow-white);
|
|
97
|
-
padding: 30px;
|
|
98
|
-
border-radius: 8px;
|
|
99
|
-
margin-bottom: 30px;
|
|
100
|
-
border: 1px solid var(--easyflow-border);
|
|
101
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.section h2 {
|
|
105
|
-
color: var(--easyflow-blue);
|
|
106
|
-
margin-bottom: 20px;
|
|
107
|
-
font-size: 1.8rem;
|
|
108
|
-
font-weight: 600;
|
|
109
|
-
border-bottom: 2px solid var(--easyflow-blue);
|
|
110
|
-
padding-bottom: 10px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.section h3 {
|
|
114
|
-
color: var(--easyflow-gray-dark);
|
|
115
|
-
margin: 25px 0 15px 0;
|
|
116
|
-
font-size: 1.4rem;
|
|
117
|
-
font-weight: 600;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.code-block {
|
|
121
|
-
background: var(--easyflow-gray-dark);
|
|
122
|
-
color: var(--easyflow-white);
|
|
123
|
-
padding: 20px;
|
|
124
|
-
border-radius: 6px;
|
|
125
|
-
overflow-x: auto;
|
|
126
|
-
margin: 15px 0;
|
|
127
|
-
font-family: 'Monaco', 'Menlo', monospace;
|
|
128
|
-
font-size: 14px;
|
|
129
|
-
line-height: 1.4;
|
|
130
|
-
border: 1px solid var(--easyflow-border);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.highlight {
|
|
134
|
-
background: #fef3c7;
|
|
135
|
-
border-left: 4px solid var(--easyflow-warning);
|
|
136
|
-
padding: 15px;
|
|
137
|
-
margin: 15px 0;
|
|
138
|
-
border-radius: 0 6px 6px 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.success-box {
|
|
142
|
-
background: #f0fdf4;
|
|
143
|
-
border-left: 4px solid var(--easyflow-success);
|
|
144
|
-
padding: 15px;
|
|
145
|
-
margin: 15px 0;
|
|
146
|
-
border-radius: 0 6px 6px 0;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.error-box {
|
|
150
|
-
background: #fef2f2;
|
|
151
|
-
border-left: 4px solid var(--easyflow-error);
|
|
152
|
-
padding: 15px;
|
|
153
|
-
margin: 15px 0;
|
|
154
|
-
border-radius: 0 6px 6px 0;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.method {
|
|
158
|
-
background: var(--easyflow-gray-light);
|
|
159
|
-
border: 1px solid var(--easyflow-border);
|
|
160
|
-
border-radius: 6px;
|
|
161
|
-
padding: 20px;
|
|
162
|
-
margin: 15px 0;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.method h4 {
|
|
166
|
-
color: var(--easyflow-blue);
|
|
167
|
-
margin-bottom: 10px;
|
|
168
|
-
font-size: 1.1rem;
|
|
169
|
-
font-weight: 600;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.method .signature {
|
|
173
|
-
background: var(--easyflow-gray-dark);
|
|
174
|
-
color: var(--easyflow-white);
|
|
175
|
-
padding: 10px;
|
|
176
|
-
border-radius: 4px;
|
|
177
|
-
font-family: monospace;
|
|
178
|
-
margin: 10px 0;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.method .description {
|
|
182
|
-
color: var(--easyflow-gray);
|
|
183
|
-
margin: 10px 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.method .params {
|
|
187
|
-
margin: 10px 0;
|
|
188
|
-
padding: 10px;
|
|
189
|
-
background: rgba(37, 99, 235, 0.05);
|
|
190
|
-
border-radius: 4px;
|
|
191
|
-
border-left: 3px solid var(--easyflow-blue);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.method .params strong {
|
|
195
|
-
color: var(--easyflow-gray-dark);
|
|
196
|
-
font-weight: 600;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.method .example {
|
|
200
|
-
background: var(--easyflow-gray-light);
|
|
201
|
-
border-left: 3px solid var(--easyflow-blue);
|
|
202
|
-
padding: 15px;
|
|
203
|
-
margin: 10px 0;
|
|
204
|
-
border-radius: 0 6px 6px 0;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.tabs {
|
|
208
|
-
display: flex;
|
|
209
|
-
border-bottom: 1px solid var(--easyflow-border);
|
|
210
|
-
margin-bottom: 20px;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.tab {
|
|
214
|
-
padding: 12px 24px;
|
|
215
|
-
cursor: pointer;
|
|
216
|
-
border-bottom: 2px solid transparent;
|
|
217
|
-
transition: all 0.2s ease;
|
|
218
|
-
color: var(--easyflow-gray);
|
|
219
|
-
background: var(--easyflow-gray-light);
|
|
220
|
-
border-radius: 6px 6px 0 0;
|
|
221
|
-
margin-right: 5px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.tab.active {
|
|
225
|
-
border-bottom-color: var(--easyflow-blue);
|
|
226
|
-
color: var(--easyflow-blue);
|
|
227
|
-
background: var(--easyflow-white);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.tab:hover:not(.active) {
|
|
231
|
-
background: var(--easyflow-white);
|
|
232
|
-
color: var(--easyflow-gray-dark);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.tab-content {
|
|
236
|
-
display: none;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.tab-content.active {
|
|
240
|
-
display: block;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.platform-grid {
|
|
244
|
-
display: grid;
|
|
245
|
-
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
246
|
-
gap: 20px;
|
|
247
|
-
margin: 20px 0;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.platform-card {
|
|
251
|
-
background: var(--easyflow-white);
|
|
252
|
-
border: 1px solid var(--easyflow-border);
|
|
253
|
-
border-radius: 8px;
|
|
254
|
-
padding: 20px;
|
|
255
|
-
text-align: center;
|
|
256
|
-
transition: all 0.2s ease;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.platform-card:hover {
|
|
260
|
-
border-color: var(--easyflow-blue);
|
|
261
|
-
box-shadow: 0 4px 8px rgba(37, 99, 235, 0.1);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.platform-card h4 {
|
|
265
|
-
color: var(--easyflow-blue);
|
|
266
|
-
margin-bottom: 10px;
|
|
267
|
-
font-size: 1.2rem;
|
|
268
|
-
font-weight: 600;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.platform-card p {
|
|
272
|
-
color: var(--easyflow-gray);
|
|
273
|
-
margin-bottom: 15px;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.platform-card .code {
|
|
277
|
-
background: var(--easyflow-gray-light);
|
|
278
|
-
padding: 10px;
|
|
279
|
-
border-radius: 4px;
|
|
280
|
-
font-family: monospace;
|
|
281
|
-
font-size: 12px;
|
|
282
|
-
color: var(--easyflow-gray-dark);
|
|
283
|
-
border: 1px solid var(--easyflow-border);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.footer {
|
|
287
|
-
text-align: center;
|
|
288
|
-
padding: 30px 20px;
|
|
289
|
-
color: var(--easyflow-gray);
|
|
290
|
-
border-top: 1px solid var(--easyflow-border);
|
|
291
|
-
margin-top: 40px;
|
|
292
|
-
background: var(--easyflow-gray-light);
|
|
293
|
-
border-radius: 8px;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.footer a {
|
|
297
|
-
color: var(--easyflow-blue);
|
|
298
|
-
text-decoration: none;
|
|
299
|
-
font-weight: 500;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.footer a:hover {
|
|
303
|
-
text-decoration: underline;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
@media (max-width: 768px) {
|
|
307
|
-
.nav ul {
|
|
308
|
-
flex-direction: column;
|
|
309
|
-
align-items: center;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.header h1 {
|
|
313
|
-
font-size: 2rem;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.container {
|
|
317
|
-
padding: 15px;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.section {
|
|
321
|
-
padding: 20px;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.platform-grid {
|
|
325
|
-
grid-template-columns: 1fr;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.tabs {
|
|
329
|
-
flex-direction: column;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.tab {
|
|
333
|
-
border-radius: 6px;
|
|
334
|
-
border-bottom: none;
|
|
335
|
-
border-right: 3px solid transparent;
|
|
336
|
-
margin-right: 0;
|
|
337
|
-
margin-bottom: 5px;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.tab.active {
|
|
341
|
-
border-right-color: var(--easyflow-blue);
|
|
342
|
-
border-bottom: none;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
</style>
|
|
346
|
-
</head>
|
|
347
|
-
<body>
|
|
348
|
-
<div class="container">
|
|
349
|
-
<!-- Header -->
|
|
350
|
-
<div class="header">
|
|
351
|
-
<h1>Easyflow SDK</h1>
|
|
352
|
-
<p>Documentation for integration with low-code/no-code platforms</p>
|
|
353
|
-
</div>
|
|
354
|
-
|
|
355
|
-
<!-- Navigation -->
|
|
356
|
-
<div class="nav">
|
|
357
|
-
<ul>
|
|
358
|
-
<li><a href="#quick-start">Quick Start</a></li>
|
|
359
|
-
<li><a href="#integration">Integration</a></li>
|
|
360
|
-
<li><a href="#api-reference">API Reference</a></li>
|
|
361
|
-
<li><a href="#examples">Examples</a></li>
|
|
362
|
-
<li><a href="#platforms">Platforms</a></li>
|
|
363
|
-
<li><a href="#troubleshooting">Troubleshooting</a></li>
|
|
364
|
-
</ul>
|
|
365
|
-
</div>
|
|
366
|
-
|
|
367
|
-
<!-- Quick Start -->
|
|
368
|
-
<div id="quick-start" class="section">
|
|
369
|
-
<h2>Quick Start</h2>
|
|
370
|
-
|
|
371
|
-
<div class="highlight">
|
|
372
|
-
<strong>Important:</strong> This documentation is automatically updated and always synchronized with the latest version of the SDK.
|
|
373
|
-
</div>
|
|
374
|
-
|
|
375
|
-
<h3>1. Include the SDK</h3>
|
|
376
|
-
<p>Add the SDK script to your project:</p>
|
|
377
|
-
<div class="code-block">
|
|
378
|
-
<script src="https://easyflow-sdk.pages.dev/easyflow-sdk.min.js"></script>
|
|
379
|
-
</div>
|
|
380
|
-
|
|
381
|
-
<h3>2. Automatic Functionalities</h3>
|
|
382
|
-
<p>After including the script, all functionalities become automatically available:</p>
|
|
383
|
-
<div class="code-block">
|
|
384
|
-
// Functionalities available automatically
|
|
385
|
-
window.easyflowSDK = {
|
|
386
|
-
// Customers
|
|
387
|
-
createCustomer: function(data) { /* ... */ },
|
|
388
|
-
getCustomer: function(id) { /* ... */ },
|
|
389
|
-
updateCustomer: function(id, data) { /* ... */ },
|
|
390
|
-
|
|
391
|
-
// Payments
|
|
392
|
-
placeOrder: function(offerId, data) { /* ... */ },
|
|
393
|
-
charge: function(data) { /* ... */ },
|
|
394
|
-
|
|
395
|
-
// Validation
|
|
396
|
-
validate: { email: function(email) { /* ... */ } },
|
|
397
|
-
|
|
398
|
-
// Event callbacks
|
|
399
|
-
on: function(event, callback) { /* ... */ }
|
|
400
|
-
}
|
|
401
|
-
</div>
|
|
402
|
-
|
|
403
|
-
<h3>3. Configure Callbacks</h3>
|
|
404
|
-
<div class="code-block">
|
|
405
|
-
// Configure callbacks for events
|
|
406
|
-
easyflowSDK.on('customerCreated', function(customer) {
|
|
407
|
-
console.log('Customer created:', customer);
|
|
408
|
-
// Update platform UI
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
easyflowSDK.on('paymentProcessed', function(result) {
|
|
412
|
-
console.log('Payment processed:', result);
|
|
413
|
-
// Redirect or update status
|
|
414
|
-
});
|
|
415
|
-
</div>
|
|
416
|
-
</div>
|
|
417
|
-
|
|
418
|
-
<!-- Integration -->
|
|
419
|
-
<div id="integration" class="section">
|
|
420
|
-
<h2>NO BRAINER Integration</h2>
|
|
421
|
-
|
|
422
|
-
<div class="success-box">
|
|
423
|
-
<strong>NO BRAINER:</strong> The SDK automatically integrates with low-code/no-code platforms, exposing all functionalities globally.
|
|
424
|
-
</div>
|
|
425
|
-
|
|
426
|
-
<h3>How It Works</h3>
|
|
427
|
-
<ol>
|
|
428
|
-
<li><strong>Loading:</strong> The script is loaded via CDN</li>
|
|
429
|
-
<li><strong>Auto-initialization:</strong> The SDK initializes automatically</li>
|
|
430
|
-
<li><strong>Global exposure:</strong> All functionalities become available in <code>window.easyflowSDK</code></li>
|
|
431
|
-
<li><strong>Callbacks:</strong> Event system for platform integration</li>
|
|
432
|
-
</ol>
|
|
433
|
-
|
|
434
|
-
<h3>Traditional Initialization (Optional)</h3>
|
|
435
|
-
<p>For developers who prefer manual control:</p>
|
|
436
|
-
<div class="code-block">
|
|
437
|
-
// Traditional initialization
|
|
438
|
-
const sdk = new EasyflowSDK('your-business-id');
|
|
439
|
-
|
|
440
|
-
// Or use the integration wrapper
|
|
441
|
-
const wrapper = EasyflowSDK.initializeForPlatform({
|
|
442
|
-
businessId: 'your-business-id',
|
|
443
|
-
enableDebug: true
|
|
444
|
-
});
|
|
445
|
-
</div>
|
|
446
|
-
</div>
|
|
447
|
-
|
|
448
|
-
<!-- API Reference -->
|
|
449
|
-
<div id="api-reference" class="section">
|
|
450
|
-
<h2>API Reference</h2>
|
|
451
|
-
|
|
452
|
-
<div class="tabs">
|
|
453
|
-
<div class="tab active" onclick="showTab('customers')">Customers</div>
|
|
454
|
-
<div class="tab" onclick="showTab('payments')">Payments</div>
|
|
455
|
-
<div class="tab" onclick="showTab('validation')">Validation</div>
|
|
456
|
-
<div class="tab" onclick="showTab('events')">Events</div>
|
|
457
|
-
</div>
|
|
458
|
-
|
|
459
|
-
<!-- Customers Tab -->
|
|
460
|
-
<div id="customers" class="tab-content active">
|
|
461
|
-
<div class="method">
|
|
462
|
-
<h4>createCustomer(data)</h4>
|
|
463
|
-
<div class="signature">easyflowSDK.createCustomer(customerData)</div>
|
|
464
|
-
<div class="description">Creates a new customer in the system</div>
|
|
465
|
-
<div class="params">
|
|
466
|
-
<strong>Parameters:</strong> customerData (Object) - Customer data
|
|
467
|
-
</div>
|
|
468
|
-
<div class="example">
|
|
469
|
-
<strong>Example:</strong>
|
|
470
|
-
<div class="code-block">
|
|
471
|
-
const result = await easyflowSDK.createCustomer({
|
|
472
|
-
name: "João Silva",
|
|
473
|
-
email: "joao@email.com",
|
|
474
|
-
document: {
|
|
475
|
-
type: "CPF",
|
|
476
|
-
number: "12345678909"
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
</div>
|
|
480
|
-
</div>
|
|
481
|
-
</div>
|
|
482
|
-
|
|
483
|
-
<div class="method">
|
|
484
|
-
<h4>getCustomer(id)</h4>
|
|
485
|
-
<div class="signature">easyflowSDK.getCustomer(customerId)</div>
|
|
486
|
-
<div class="description">Gets data from an existing customer</div>
|
|
487
|
-
<div class="params">
|
|
488
|
-
<strong>Parameters:</strong> customerId (String) - Customer ID
|
|
489
|
-
</div>
|
|
490
|
-
</div>
|
|
491
|
-
|
|
492
|
-
<div class="method">
|
|
493
|
-
<h4>updateCustomer(id, data)</h4>
|
|
494
|
-
<div class="signature">easyflowSDK.updateCustomer(customerId, updateData)</div>
|
|
495
|
-
<div class="description">Updates data from an existing customer</div>
|
|
496
|
-
</div>
|
|
497
|
-
</div>
|
|
498
|
-
|
|
499
|
-
<!-- Payments Tab -->
|
|
500
|
-
<div id="payments" class="tab-content">
|
|
501
|
-
<div class="method">
|
|
502
|
-
<h4>placeOrder(offerId, data)</h4>
|
|
503
|
-
<div class="signature">easyflowSDK.placeOrder(offerId, orderData)</div>
|
|
504
|
-
<div class="description">Creates an order with specific offer</div>
|
|
505
|
-
</div>
|
|
506
|
-
|
|
507
|
-
<div class="method">
|
|
508
|
-
<h4>charge(data)</h4>
|
|
509
|
-
<div class="signature">easyflowSDK.charge(paymentData)</div>
|
|
510
|
-
<div class="description">Processes direct payment</div>
|
|
511
|
-
</div>
|
|
512
|
-
|
|
513
|
-
<div class="method">
|
|
514
|
-
<h4>addCreditCard(customerId, token)</h4>
|
|
515
|
-
<div class="signature">easyflowSDK.addCreditCard(customerId, cardToken)</div>
|
|
516
|
-
<div class="description">Adds credit card to customer</div>
|
|
517
|
-
</div>
|
|
518
|
-
</div>
|
|
519
|
-
|
|
520
|
-
<!-- Validation Tab -->
|
|
521
|
-
<div id="validation" class="tab-content">
|
|
522
|
-
<div class="method">
|
|
523
|
-
<h4>validate.email(email)</h4>
|
|
524
|
-
<div class="signature">easyflowSDK.validate.email(emailAddress)</div>
|
|
525
|
-
<div class="description">Validates email format</div>
|
|
526
|
-
<div class="example">
|
|
527
|
-
<strong>Example:</strong>
|
|
528
|
-
<div class="code-block">
|
|
529
|
-
const isValid = easyflowSDK.validate.email("test@email.com");
|
|
530
|
-
// Returns: true or false
|
|
531
|
-
</div>
|
|
532
|
-
</div>
|
|
533
|
-
</div>
|
|
534
|
-
|
|
535
|
-
<div class="method">
|
|
536
|
-
<h4>validate.cpf(cpf)</h4>
|
|
537
|
-
<div class="signature">easyflowSDK.validate.cpf(cpfNumber)</div>
|
|
538
|
-
<div class="description">Validates Brazilian CPF</div>
|
|
539
|
-
</div>
|
|
540
|
-
|
|
541
|
-
<div class="method">
|
|
542
|
-
<h4>validate.cnpj(cnpj)</h4>
|
|
543
|
-
<div class="signature">easyflowSDK.validate.cnpj(cnpjNumber)</div>
|
|
544
|
-
<div class="description">Validates Brazilian CNPJ</div>
|
|
545
|
-
</div>
|
|
546
|
-
</div>
|
|
547
|
-
|
|
548
|
-
<!-- Events Tab -->
|
|
549
|
-
<div id="events" class="tab-content">
|
|
550
|
-
<div class="method">
|
|
551
|
-
<h4>on(event, callback)</h4>
|
|
552
|
-
<div class="signature">easyflowSDK.on(eventName, callbackFunction)</div>
|
|
553
|
-
<div class="description">Configures callback for events</div>
|
|
554
|
-
<div class="example">
|
|
555
|
-
<strong>Available events:</strong>
|
|
556
|
-
<ul>
|
|
557
|
-
<li><code>'customerCreated'</code> - Customer created</li>
|
|
558
|
-
<li><code>'paymentProcessed'</code> - Payment processed</li>
|
|
559
|
-
<li><code>'error'</code> - Error occurred</li>
|
|
560
|
-
</ul>
|
|
561
|
-
</div>
|
|
562
|
-
</div>
|
|
563
|
-
</div>
|
|
564
|
-
</div>
|
|
565
|
-
|
|
566
|
-
<!-- Examples -->
|
|
567
|
-
<div id="examples" class="section">
|
|
568
|
-
<h2>Practical Examples</h2>
|
|
569
|
-
|
|
570
|
-
<h3>Customer Registration Form</h3>
|
|
571
|
-
<div class="code-block">
|
|
572
|
-
// Customer registration form
|
|
573
|
-
async function handleCustomerRegistration(formData) {
|
|
574
|
-
try {
|
|
575
|
-
// Validate data
|
|
576
|
-
const emailValid = easyflowSDK.validate.email(formData.email);
|
|
577
|
-
const cpfValid = easyflowSDK.validate.cpf(formData.cpf);
|
|
578
|
-
|
|
579
|
-
if (!emailValid || !cpfValid) {
|
|
580
|
-
throw new Error('Invalid data');
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
// Create customer
|
|
584
|
-
const result = await easyflowSDK.createCustomer({
|
|
585
|
-
name: formData.name,
|
|
586
|
-
email: formData.email,
|
|
587
|
-
document: {
|
|
588
|
-
type: 'CPF',
|
|
589
|
-
number: formData.cpf
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
if (result.success) {
|
|
594
|
-
console.log('Customer created:', result.data);
|
|
595
|
-
// Redirect to checkout
|
|
596
|
-
}
|
|
597
|
-
} catch (error) {
|
|
598
|
-
console.error('Error:', error.message);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
</div>
|
|
602
|
-
|
|
603
|
-
<h3>Payment Processing</h3>
|
|
604
|
-
<div class="code-block">
|
|
605
|
-
// Process payment
|
|
606
|
-
async function processPayment(offerId, customerId, paymentData) {
|
|
607
|
-
try {
|
|
608
|
-
// Create order
|
|
609
|
-
const orderResult = await easyflowSDK.placeOrder(offerId, {
|
|
610
|
-
buyer: customerId,
|
|
611
|
-
payments: [paymentData]
|
|
612
|
-
});
|
|
613
|
-
|
|
614
|
-
if (orderResult.success) {
|
|
615
|
-
console.log('Order created:', orderResult.data);
|
|
616
|
-
// Redirect to success
|
|
617
|
-
}
|
|
618
|
-
} catch (error) {
|
|
619
|
-
console.error('Payment error:', error.message);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
</div>
|
|
623
|
-
</div>
|
|
624
|
-
|
|
625
|
-
<!-- Platforms -->
|
|
626
|
-
<div id="platforms" class="section">
|
|
627
|
-
<h2>Supported Platforms</h2>
|
|
628
|
-
|
|
629
|
-
<div class="platform-grid">
|
|
630
|
-
<div class="platform-card">
|
|
631
|
-
<h4>Lovable.dev</h4>
|
|
632
|
-
<p>Automatic integration with AI chat and workflows</p>
|
|
633
|
-
<div class="code">
|
|
634
|
-
// Works automatically
|
|
635
|
-
easyflowSDK.createCustomer(data)
|
|
636
|
-
</div>
|
|
637
|
-
</div>
|
|
638
|
-
|
|
639
|
-
<div class="platform-card">
|
|
640
|
-
<h4>Bubble</h4>
|
|
641
|
-
<p>Custom JavaScript with callbacks</p>
|
|
642
|
-
<div class="code">
|
|
643
|
-
// Configure callbacks
|
|
644
|
-
easyflowSDK.on('customerCreated', callback)
|
|
645
|
-
</div>
|
|
646
|
-
</div>
|
|
647
|
-
|
|
648
|
-
<div class="platform-card">
|
|
649
|
-
<h4>Webflow</h4>
|
|
650
|
-
<p>Custom HTML with JavaScript</p>
|
|
651
|
-
<div class="code">
|
|
652
|
-
// Use in forms
|
|
653
|
-
<script src="..."></script>
|
|
654
|
-
</div>
|
|
655
|
-
</div>
|
|
656
|
-
|
|
657
|
-
<div class="platform-card">
|
|
658
|
-
<h4>Zapier</h4>
|
|
659
|
-
<p>Webhooks and automations</p>
|
|
660
|
-
<div class="code">
|
|
661
|
-
// Webhook endpoint
|
|
662
|
-
POST /api/easyflow
|
|
663
|
-
</div>
|
|
664
|
-
</div>
|
|
665
|
-
</div>
|
|
666
|
-
</div>
|
|
667
|
-
|
|
668
|
-
<!-- Troubleshooting -->
|
|
669
|
-
<div id="troubleshooting" class="section">
|
|
670
|
-
<h2>Troubleshooting</h2>
|
|
671
|
-
|
|
672
|
-
<h3>Common Problems</h3>
|
|
673
|
-
|
|
674
|
-
<div class="error-box">
|
|
675
|
-
<strong>"easyflowSDK is not defined"</strong>
|
|
676
|
-
<p>The script was not loaded correctly. Check:</p>
|
|
677
|
-
<ul>
|
|
678
|
-
<li>Script URL is correct</li>
|
|
679
|
-
<li>Script was included before your code</li>
|
|
680
|
-
<li>Browser console shows no errors</li>
|
|
681
|
-
</ul>
|
|
682
|
-
</div>
|
|
683
|
-
|
|
684
|
-
<div class="error-box">
|
|
685
|
-
<strong>"Method not found"</strong>
|
|
686
|
-
<p>Method doesn't exist or wasn't exposed. Check:</p>
|
|
687
|
-
<ul>
|
|
688
|
-
<li>SDK version is updated</li>
|
|
689
|
-
<li>Method is listed in documentation</li>
|
|
690
|
-
<li>Console shows <code>typeof easyflowSDK</code></li>
|
|
691
|
-
</ul>
|
|
692
|
-
</div>
|
|
693
|
-
|
|
694
|
-
<div class="success-box">
|
|
695
|
-
<strong>Debug Mode</strong>
|
|
696
|
-
<p>To enable debug logs:</p>
|
|
697
|
-
<div class="code-block">
|
|
698
|
-
easyflowSDK.configure({ enableDebug: true });
|
|
699
|
-
</div>
|
|
700
|
-
</div>
|
|
701
|
-
|
|
702
|
-
<h3>Check Status</h3>
|
|
703
|
-
<div class="code-block">
|
|
704
|
-
// Check if SDK is working
|
|
705
|
-
console.log('SDK Status:', easyflowSDK.getStatus());
|
|
706
|
-
console.log('Available methods:', Object.keys(easyflowSDK));
|
|
707
|
-
</div>
|
|
708
|
-
</div>
|
|
709
|
-
|
|
710
|
-
<!-- Footer -->
|
|
711
|
-
<div class="footer">
|
|
712
|
-
<p>
|
|
713
|
-
<strong>Easyflow SDK</strong> - Public documentation automatically updated<br />
|
|
714
|
-
Maintained by <a href="https://github.com/dmourainatel" target="_blank">Diego Moura</a> |
|
|
715
|
-
<a href="https://easyflow.digital" target="_blank">Easyflow.digital</a>
|
|
716
|
-
</p>
|
|
717
|
-
<p style="margin-top: 15px; font-size: 0.9rem; color: var(--easyflow-gray);">
|
|
718
|
-
This documentation is served via CDN and is always synchronized with the latest version of the SDK.
|
|
719
|
-
</p>
|
|
720
|
-
</div>
|
|
721
|
-
</div>
|
|
722
|
-
|
|
723
|
-
<script>
|
|
724
|
-
// Tab functionality
|
|
725
|
-
function showTab(tabName) {
|
|
726
|
-
// Hide all tabs
|
|
727
|
-
document.querySelectorAll('.tab-content').forEach(tab => {
|
|
728
|
-
tab.classList.remove('active');
|
|
729
|
-
});
|
|
730
|
-
document.querySelectorAll('.tab').forEach(tab => {
|
|
731
|
-
tab.classList.remove('active');
|
|
732
|
-
});
|
|
733
|
-
|
|
734
|
-
// Show selected tab
|
|
735
|
-
document.getElementById(tabName).classList.add('active');
|
|
736
|
-
event.target.classList.add('active');
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
// Smooth scrolling for navigation
|
|
740
|
-
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
741
|
-
anchor.addEventListener('click', function (e) {
|
|
742
|
-
e.preventDefault();
|
|
743
|
-
const target = document.querySelector(this.getAttribute('href'));
|
|
744
|
-
if (target) {
|
|
745
|
-
target.scrollIntoView({
|
|
746
|
-
behavior: 'smooth',
|
|
747
|
-
block: 'start'
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
});
|
|
751
|
-
});
|
|
752
|
-
|
|
753
|
-
// Highlight current section in navigation
|
|
754
|
-
window.addEventListener('scroll', () => {
|
|
755
|
-
const sections = document.querySelectorAll('.section');
|
|
756
|
-
const navLinks = document.querySelectorAll('.nav a');
|
|
757
|
-
|
|
758
|
-
let current = '';
|
|
759
|
-
sections.forEach(section => {
|
|
760
|
-
const sectionTop = section.offsetTop;
|
|
761
|
-
if (pageYOffset >= sectionTop - 60) {
|
|
762
|
-
current = section.getAttribute('id');
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
|
|
766
|
-
navLinks.forEach(link => {
|
|
767
|
-
link.classList.remove('active');
|
|
768
|
-
if (link.getAttribute('href') === `#${current}`) {
|
|
769
|
-
link.classList.add('active');
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
});
|
|
773
|
-
</script>
|
|
774
|
-
</body>
|
|
775
|
-
</html>
|