@adobe/acc-js-sdk 1.1.10 → 1.1.11

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.
Files changed (76) hide show
  1. package/README.md +8 -2170
  2. package/docs/404.html +11 -0
  3. package/docs/Gemfile +35 -0
  4. package/docs/Gemfile.lock +270 -0
  5. package/docs/_config.yml +55 -0
  6. package/docs/_data/navigation.yml +119 -0
  7. package/docs/_includes/navigation.html +33 -0
  8. package/docs/_layouts/default.html +21 -0
  9. package/docs/_layouts/home.html +4 -0
  10. package/docs/_layouts/page.html +5 -0
  11. package/docs/_layouts/post.html +7 -0
  12. package/docs/_posts/2022-10-14-welcome.html +149 -0
  13. package/docs/application.html +366 -0
  14. package/docs/architecture.html +24 -0
  15. package/docs/assets/css/styles.css +362 -0
  16. package/docs/assets/images/adobe-campaign-256.png +0 -0
  17. package/docs/assets/images/architecture.png +0 -0
  18. package/docs/assets/images/ref.svg +6 -0
  19. package/docs/badgerFish.html +14 -0
  20. package/docs/bestPractices.html +189 -0
  21. package/docs/blog.html +18 -0
  22. package/docs/buildAndRun.html +96 -0
  23. package/docs/caches.html +68 -0
  24. package/docs/changeLog.html +256 -0
  25. package/docs/checkList.html +168 -0
  26. package/docs/concepts.html +130 -0
  27. package/docs/connecting.html +210 -0
  28. package/docs/connectionParameters.html +109 -0
  29. package/docs/contribute.html +54 -0
  30. package/docs/dataTypes.html +124 -0
  31. package/docs/differences.html +4 -0
  32. package/docs/documentation.html +21 -0
  33. package/docs/domHelper.html +88 -0
  34. package/docs/dynamicInvoke.html +36 -0
  35. package/docs/entityAccessor.html +22 -0
  36. package/docs/errors.html +47 -0
  37. package/docs/escaping.html +76 -0
  38. package/docs/favicon.png +0 -0
  39. package/docs/healthCheck.html +66 -0
  40. package/docs/httpHeaders.html +78 -0
  41. package/docs/index.html +64 -0
  42. package/docs/installation.html +34 -0
  43. package/docs/license.html +208 -0
  44. package/docs/messageCenter.html +80 -0
  45. package/docs/methodLevelRepresentation.html +12 -0
  46. package/docs/midSourcing.html +19 -0
  47. package/docs/observability.html +169 -0
  48. package/docs/passwords.html +27 -0
  49. package/docs/profiles.html +103 -0
  50. package/docs/pushDown.html +13 -0
  51. package/docs/quickstart.html +69 -0
  52. package/docs/release.html +52 -0
  53. package/docs/samples.html +82 -0
  54. package/docs/simpleJson.html +88 -0
  55. package/docs/soapAPIs.html +234 -0
  56. package/docs/timeouts.html +23 -0
  57. package/docs/transport.html +45 -0
  58. package/docs/troubleshooting.html +17 -0
  59. package/docs/writeDoc.html +208 -0
  60. package/docs/xml2json.html +96 -0
  61. package/docs/xtkCaster.html +67 -0
  62. package/docs/xtkInterface.html +20 -0
  63. package/docs/xtkOption.html +54 -0
  64. package/docs/xtkPackage.html +16 -0
  65. package/docs/xtkPersist.html +213 -0
  66. package/docs/xtkQueryDef.html +245 -0
  67. package/docs/xtkSchema.html +39 -0
  68. package/docs/xtkSession.html +29 -0
  69. package/docs/xtkWorkflow.html +28 -0
  70. package/docs/xtkWrite.html +51 -0
  71. package/package-lock.json +1 -1
  72. package/package.json +1 -1
  73. package/src/campaign.js +1 -1
  74. package/src/soap.js +6 -6
  75. package/test/soap.test.js +13 -0
  76. package/CHANGELOG.md +0 -252
@@ -0,0 +1,362 @@
1
+ ---
2
+ ---
3
+ * {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ html {
10
+ font-family: Helvetica, Sans-Serif;
11
+ -ms-text-size-adjust: 100%;
12
+ -webkit-text-size-adjust: 100%;
13
+ font-weight: 300;
14
+ font-size: 18px;
15
+ line-height: 28px;
16
+ }
17
+
18
+ body {
19
+ display: flex;
20
+ flex-direction: column;
21
+ }
22
+
23
+ .notFound {
24
+ display: flex;
25
+ flex-direction: column;
26
+ margin: auto;
27
+ width: 800px;
28
+ max-width: 800px;
29
+ margin-top: 80px;
30
+ }
31
+
32
+
33
+ .header {
34
+ display: flex;
35
+ flex-direction: row;
36
+ height: 52px;
37
+ min-height: 52px;
38
+ border-bottom: 1px solid #4f966a;
39
+ position: fixed;
40
+ top: 0px;
41
+ left: 0px;
42
+ width: 100%;
43
+ background-color: white;
44
+ cursor: pointer;
45
+ }
46
+
47
+ .logo {
48
+ display: flex;
49
+ margin-left: 16px;
50
+ margin-right: 0;
51
+ margin-top: 4px;
52
+ margin-bottom: 4px;
53
+ cursor: pointer;
54
+ }
55
+
56
+ .header h1 {
57
+ display: flex;
58
+ line-height: 44px;
59
+ margin-left: 16px;
60
+ font-size: 36px;
61
+ font-weight: 300;
62
+ border: none;
63
+ margin-top: 0 !important ;
64
+ }
65
+
66
+ .footer {
67
+ width: 100%;
68
+ margin-bottom: 16px;
69
+ }
70
+
71
+ .body {
72
+ display: flex;
73
+ flex-direction: column;
74
+ margin: auto;
75
+ width: 800px;
76
+ max-width: 800px;
77
+ margin-top: 16px;
78
+ margin-top: 72px;
79
+ }
80
+
81
+ nav {
82
+ display: flex;
83
+ flex-direction: column;
84
+ position: fixed;
85
+ top: 0px;
86
+ left: 0px;
87
+ margin-left: 16px;
88
+ height: 100%;
89
+ padding-top: 92px;
90
+ font-size: 16px;
91
+ line-height: 20px;
92
+ }
93
+
94
+ nav a, nav a:visited, nav a:active {
95
+ text-decoration: none;
96
+ }
97
+
98
+ nav ul {
99
+ overflow: scroll
100
+ }
101
+
102
+ nav li {
103
+ list-style: none;
104
+ }
105
+
106
+ nav li li {
107
+ margin-left: 8px;
108
+ }
109
+
110
+ a, a:visited, a:active {
111
+ color: #4f966a;
112
+ cursor: pointer;
113
+ }
114
+ a:hover {
115
+ text-decoration:underline;
116
+ }
117
+
118
+ h1 {
119
+ color: #4f966a;
120
+ font-size: 34px;
121
+ font-weight: 300;
122
+ padding-bottom: 4px;
123
+ }
124
+
125
+ h1:not(:first-child) {
126
+ margin-top: 42px;
127
+ }
128
+
129
+ h2 {
130
+ margin-top: 42px;
131
+ color: #4f966a;
132
+ font-size: 24px;
133
+ font-weight: 300;
134
+ padding-bottom: 0px;
135
+ }
136
+
137
+ p {
138
+ margin-top: 20px;
139
+ margin-bottom: 4px;
140
+ }
141
+
142
+ b {
143
+ font-weight: 400;
144
+ }
145
+
146
+ table {
147
+ border: 1px solid #4f966a;
148
+ border-collapse: collapse;
149
+ }
150
+ thead {
151
+ border-bottom: 1px solid #4f966a;
152
+ }
153
+ th {
154
+ color: #4f966a;
155
+ font-weight: 400;
156
+ text-align: left;
157
+ padding-left: 8px;
158
+ padding-right: 8px;
159
+ padding-top: 8px;
160
+ padding-bottom: 8px;
161
+ }
162
+ tr:nth-child(even){
163
+ background-color: #ecf6f0;
164
+ }
165
+ td {
166
+ padding-left: 8px;
167
+ padding-right: 8px;
168
+ padding-bottom: 8px;
169
+ }
170
+
171
+ .cta {
172
+ width: 200px;
173
+ min-width: 200px;
174
+ max-width: 200px;
175
+ margin-top: 36px;
176
+ margin-bottom: 36px;
177
+ margin-left: auto;
178
+ margin-right: auto;
179
+ height: 48px;
180
+ border: 1px solid #4f966a;
181
+ border-radius: 3px;
182
+ color: #4f966a;
183
+ background-color: #ecf6f0;
184
+ cursor: pointer;
185
+ font-size: 24px;
186
+ }
187
+ .cta:hover {
188
+ background-color: white;
189
+ }
190
+
191
+ .card-row {
192
+ display: flex;
193
+ flex-direction: row;
194
+ margin-top: 36px;
195
+ margin-bottom: 36px;
196
+ margin-left: auto;
197
+ margin-right: auto;
198
+ gap: 36px;
199
+ }
200
+
201
+ .card {
202
+ display: flex;
203
+ flex-direction: column;
204
+ border: 1px solid #4f966a;
205
+ width: 340px;
206
+ max-width: 340px;
207
+ min-width: 340px;
208
+ min-height: 280px;
209
+ }
210
+
211
+ .card h1 {
212
+ text-align: center;
213
+ font-size: 24px;
214
+ margin-top: 8px;
215
+ }
216
+
217
+ .code {
218
+ color: #72d999;
219
+ font-family: Inconsolata, monospace;
220
+ font-weight: 300;
221
+ font-size: 14px;
222
+ line-height: 18px;
223
+ background-color: #383E42;
224
+ padding-top: 8px;
225
+ padding-bottom: 8px;
226
+ padding-left: 18px;
227
+ padding-right: 18px;
228
+ border-radius: 8px;
229
+ word-wrap: break-word;
230
+ overflow-wrap: break-word;;
231
+ white-space: pre-wrap;
232
+ }
233
+ section.changelog {
234
+ margin-top: 16px;
235
+ margin-bottom: 24px;
236
+ }
237
+
238
+ section.changelog h1 {
239
+ font-size: 24px;
240
+ font-weight: 300;
241
+ margin-top: 0;
242
+ margin-bottom: 0;
243
+ }
244
+
245
+ section.changelog h2 {
246
+ font-size: 14px;
247
+ font-weight: 300;
248
+ margin-top: 0;
249
+ margin-bottom: 12px;
250
+ color: #383E42;
251
+ font-style: italic;
252
+ }
253
+
254
+ .warning {
255
+ color: #D972B2;
256
+ border-left: 4px solid #D972B2;
257
+ padding-left: 10px;
258
+ margin-bottom: 18px;
259
+ }
260
+
261
+ .info {
262
+ border-left: 4px solid gray;
263
+ padding-left: 10px;
264
+ margin-bottom: 18px;
265
+ }
266
+
267
+ .license {
268
+ margin-left: auto;
269
+ margin-right: auto;
270
+ margin-top: 24px;
271
+ font-size: 12px;
272
+ line-height: 14px;;
273
+ white-space: pre;;
274
+ }
275
+
276
+ .marquee {
277
+ color: #4f966a;
278
+ font-size: 36px;
279
+ line-height: 56px;
280
+ margin-left: auto;
281
+ margin-right: auto;
282
+ margin-top: 40px;
283
+ margin-bottom: 12px;
284
+ }
285
+
286
+ .caption {
287
+ font-style: italic;
288
+ text-align: center;
289
+ margin-left: auto;
290
+ margin-right: auto;
291
+ margin-top: -2px;
292
+ color: #383E42;
293
+ }
294
+
295
+ span.emphasis {
296
+ color: white;
297
+ }
298
+
299
+ span.comment {
300
+ color: #4f966a;
301
+ }
302
+
303
+ p.ref {
304
+ margin-top: 2px;
305
+ margin-bottom: 2px;
306
+ }
307
+
308
+ p.ref:before {
309
+ content: url({{ site.baseurl }}/assets/images/ref.svg);
310
+ margin-right: 8px;
311
+ }
312
+
313
+ .doc-example {
314
+ margin-left: 120px;
315
+ margin-top: 6px;
316
+ margin-bottom: 6px;
317
+ }
318
+
319
+ .doc-exampleh1, .doc-example h2 {
320
+ margin-top: 4px !important;
321
+ margin-bottom: 4px !important;
322
+ }
323
+
324
+ .blog {
325
+ }
326
+
327
+ .blog li {
328
+ list-style: none;
329
+ }
330
+
331
+ .blog-expert {
332
+ }
333
+
334
+ .blog-header {
335
+ font-size: 16px;
336
+ line-height: 16px;
337
+ font-style: italic;
338
+ color: #383E42;
339
+ margin-top: 2px;
340
+ margin-bottom: 4px;
341
+ }
342
+
343
+ .blog-expert h2 {
344
+ font-size: 18px;
345
+ }
346
+ .blog-expert h2 a {
347
+ text-decoration: none;
348
+ }
349
+ .blog-expert h2 a:hover, .blog-expert h2 a:active {
350
+ text-decoration: underline;
351
+ }
352
+
353
+ img {
354
+ margin: auto;
355
+ width: 400px;
356
+ max-width: 400px;
357
+ }
358
+ .logo img {
359
+ margin: 0;
360
+ width: 40px;
361
+ height: 40px;
362
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generated by IcoMoon.io -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
5
+ <path fill="#000000" d="M6.5 15h2.5c0.827 0 1.5-0.673 1.5-1.5 0-0.267-0.070-0.518-0.193-0.736 0.417-0.267 0.693-0.734 0.693-1.264 0-0.384-0.145-0.734-0.383-1 0.238-0.266 0.383-0.616 0.383-1 0-0.175-0.030-0.344-0.086-0.5h3.586c0.827 0 1.5-0.673 1.5-1.5s-0.673-1.5-1.5-1.5h-6.167l1.466-2.75c0.131-0.227 0.201-0.486 0.201-0.75 0-0.827-0.673-1.5-1.5-1.5-0.412 0-0.796 0.164-1.082 0.461-0.004 0.004-0.007 0.008-0.011 0.012l-3.407 3.737v-0.71c0-0.276-0.224-0.5-0.5-0.5h-3c-0.276 0-0.5 0.224-0.5 0.5v10c0 0.276 0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-0.691l2.276 1.138c0.069 0.035 0.146 0.053 0.224 0.053zM2.5 14c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5 0.5 0.224 0.5 0.5-0.224 0.5-0.5 0.5zM6.618 14l-2.618-1.309v-5.997l4.143-4.544c0.095-0.097 0.221-0.15 0.357-0.15 0.276 0 0.5 0.224 0.5 0.5 0 0.085-0.020 0.166-0.061 0.239-0.005 0.008-0.010 0.017-0.014 0.025l-1.866 3.5c-0.083 0.155-0.078 0.342 0.013 0.492s0.253 0.243 0.429 0.243h7c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-0.5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-2.382z"></path>
6
+ </svg>
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: page
3
+ title: BadgerFish format
4
+ ---
5
+
6
+ <p>
7
+ To distinguish between BadgerFish and SimpleJson format, all BadgerFish objects will have the BadgerFishObject class, that includes the top-level object, but also all children objects. A badgerfish object can be created as follows. It will automatically convert all the object literals into BadgerFishObjet class.
8
+ </p>
9
+
10
+ <p class="warning">BadgerFish representation is deprecated and only available for backwards compatibility reasons.</p>
11
+
12
+ <pre class="code">
13
+ const obj = new DomuUtil.BadgerFishObject({ "@att":"value });
14
+ </pre>
@@ -0,0 +1,189 @@
1
+ ---
2
+ layout: page
3
+ title: Best Practices
4
+ ---
5
+
6
+ <h1>Start with the concepts</h1>
7
+
8
+ <p></p>
9
+ <p class="ref">Start with the <a href="{{ site.baseurl }}/concepts.html">concepts</a> behind Campaign and the SDK.</p>
10
+
11
+
12
+
13
+
14
+
15
+ <h1>API limits</h1>
16
+
17
+ <p>
18
+ Most of the Campaign APIs are not meant for high volume, low concurrency processing. For instance, we
19
+ provide APIs to create recipients. However, this is not meant to be used as a streaming ingestion
20
+ API, i.e. you do not want to use this API to insert large amount of recipients. This kind of operation
21
+ should still be done in batch, using workflows.
22
+ </p>
23
+
24
+ <p>
25
+ However, the APIs are well fit to use for use cases such as an UI, Landing pages, within the provisioned
26
+ capacity.
27
+ </p>
28
+
29
+
30
+
31
+
32
+ <h1>XML or JSON</h1>
33
+
34
+ <p>
35
+ The SDK supports both JSON and XML. Campaign internally uses XML, so it's always more accurate to use XML.
36
+ However it's not as simple to use XML as it is to use JSON. Still, the SDK provides several
37
+ <a href="{{ site.baseurl }}/domHelper.html">helpers</a> do deal with XML in a simple way.
38
+ </p>
39
+
40
+ <p>
41
+ You can use either one or both, however, it's a good idea to undestand the gotchas of using JSON. It
42
+ may seem easier than XML, but there are a few gotchas which makes this not an obvious choice.
43
+ </p>
44
+
45
+ <p></p>
46
+ <p class="ref">Learn about the <a href="{{ site.baseurl }}/xml2json.html">Gotchas of using JSON</a></p>
47
+ <p class="ref">Understand the <a href="{{ site.baseurl }}/domHelper.html">DOM helpers</a> to make your life simpler with XML</p>
48
+
49
+
50
+
51
+ <h1>Data types</h1>
52
+
53
+ <p>
54
+ The SDK will not always return the proper data types. For instance, it may return a string instead of a
55
+ number, an object in place of an array, etc.
56
+ </p>
57
+
58
+ <p>
59
+ Those are all consequences of using XML in the first place (attribute values are all serialized as strings)
60
+ but also of transforming XML to JSON and back.
61
+ </p>
62
+
63
+ <p>
64
+ Dealing with those inconsistencies in the application code can be challenging: it's difficult to always
65
+ keep them in mind and error-prone to rely on such rigor to make sure things are always correct.
66
+ </p>
67
+
68
+ <p>
69
+ Let's take as an example a <b>condition</b> object. This is usually used in queries to filter the
70
+ result, but is also available at many other places, such as sys filters, delivery targets, etc. The
71
+ <b>condition</b> object is defined in the xtk:queryDef schema from which there's an extract below.
72
+ </p>
73
+
74
+ <pre class="code">
75
+ &lt;element name="condition">
76
+ &lt;attribute name="expr" type="string" label="Expression"/>
77
+ &lt;attribute name="ignore" <span class="emphasis">type="boolean"</span> label="Ignore condition"/>
78
+ ...
79
+ <span class="emphasis">
80
+ &lt;element ref="xtk:queryDef:condition" name="condition" ordered="true" unbound="true"/>
81
+ </span>
82
+ ...
83
+ &lt;/element>
84
+ </pre>
85
+
86
+ <p>
87
+ In this example, we see two things: the ignore attribute is a boolean, and conditions are recursive objects
88
+ which can contain sub conditions. We also see that the <b>condition</b> node is a collection, i.e. that there
89
+ can be zero, one or more sub-conditions (unbound="true")
90
+ </p>
91
+
92
+ <pre class="code">
93
+ &lt;condition> <span class="comment">&lt;-- I have exactly one child element --></span>
94
+ &lt;condition boolOperator="AND"> <span class="comment">&lt;-- I have exactly two children elements --></span>
95
+ &lt;condition boolOperator="OR" ignore="false" expr=.../>
96
+ &lt;condition boolOperator="OR" ignore="1" expr=.../>
97
+ &lt;/condition>
98
+ &lt;/condition>
99
+ </pre>
100
+ <p class="caption">An example of a condition object in XML</p>
101
+
102
+ <p>
103
+ What this example shows that the ignore attribute, which is a boolean, can have a variety of values, such a "true", "false", "1", "0", etc.
104
+ We also see that the first level of condition (with AND operator) has 2 children, but the top level condition has only one children.
105
+ </p>
106
+
107
+ <p>
108
+ In JSON, such an object will become this
109
+ </p>
110
+
111
+ <pre class="code">
112
+ const condition = {
113
+ condition: {
114
+ boolOperator: "AND",
115
+ condition: [
116
+ { boolOperator: "OR", ignore: "false", expr:"..." },
117
+ { boolOperator: "OR", ignore: "1", expr:"..." },
118
+ ]
119
+ }
120
+ }
121
+ </pre>
122
+
123
+ <p>
124
+ As you can see, the SDK did not realize that the ignore property is a boolean, and did not cast it for you. Similarly, it did not
125
+ realize that the condition element is a collection (an array), and has generated both an array (for the two OR conditions) and
126
+ an object (for the AND condition).
127
+ </p>
128
+
129
+ <p>
130
+ This can become quickly very hard to use. For instance, if I want to test the ignore boolean, I need to write
131
+ </p>
132
+
133
+ <pre class="code">
134
+ const ignore = condition.condition.condition[0].ignore;
135
+ if (ignore == "true" || ignore == "1") {
136
+ ...
137
+ }
138
+ </pre>
139
+
140
+
141
+ <p>
142
+ One would want to simply test ignore as a boolean, and you can (should) use the XTK caster to force the conversion
143
+ </p>
144
+
145
+ <pre class="code">
146
+ const ignore = XtkCaster.asBoolean(condition.condition.condition[0].ignore);
147
+ if (ignore) {
148
+ ...
149
+ }
150
+ </pre>
151
+
152
+ <p>
153
+ In fact, you should use XtkCaster for the condition objects which are potential arrays, as follows
154
+ </p>
155
+
156
+ <pre class="code">
157
+ const ignore = XtkCaster.asBoolean(
158
+ XtkCaster.asArray(
159
+ XtkCaster.asArray(condition.condition)
160
+ .condition
161
+ )[0].ignore);
162
+ if (ignore) {
163
+ ...
164
+ }
165
+ </pre>
166
+
167
+ <p>
168
+ This is a little bit hard to read. It's better to create an object model and make sure data is casted to the proper types
169
+ as the objects are constructed.
170
+ </p>
171
+
172
+ <pre class="code">
173
+ const makeCondition = (condition) => {
174
+ if (condition === null || condition === undefined) return condition;
175
+ return {
176
+ boolOperator: XtkCaster.asString(condition.boolOperator),
177
+ ignore: XtkCaster.asBoolean(condition.ignore),
178
+ condition: makeCondition(condition.condition);
179
+ };
180
+ }
181
+ const safeCondition = makeCondition(condition);
182
+ expect(safeCondition.ignore).toBe(false);
183
+ </pre>
184
+
185
+
186
+ <p></p>
187
+ <p class="ref">Use the <a href="{{ site.baseurl }}/xtkCaster.html">XTK Caster</a></p>
188
+ <p class="ref">Use the <a href="{{ site.baseurl }}/application.html">Application object</a> to handle schemas</p>
189
+ <p class="ref">Learn about the <a href="{{ site.baseurl }}/xml2json.html">Gotchas of using JSON</a></p>
package/docs/blog.html ADDED
@@ -0,0 +1,18 @@
1
+ ---
2
+ layout: page
3
+ title: Blog (latest posts)
4
+ ---
5
+
6
+ <div class="blog">
7
+ <ul>
8
+ {% for post in site.posts %}
9
+ <li>
10
+ <div class="blog-expert">
11
+ <h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
12
+ <div class="blog-header">{{ post.author }} - {{ post.date | date_to_string }}</div>
13
+ {{ post.excerpt }}
14
+ </div>
15
+ </li>
16
+ {% endfor %}
17
+ </ul>
18
+ </div>
@@ -0,0 +1,96 @@
1
+ ---
2
+ layout: page
3
+ title: Build &amp Run
4
+ ---
5
+
6
+ <p>To build this project, you need node and npm</p>
7
+
8
+ <pre class="code">
9
+ npm install
10
+ </pre>
11
+
12
+
13
+ <p>Run tests</p>
14
+ <pre class="code">
15
+ npm run unit-tests
16
+ </pre>
17
+
18
+ <h1>Client Side SDK</h1>
19
+
20
+ <p>The SDK can also be used client side. </p>
21
+
22
+ <p>To Compile the client-side SDK, go to the root folder of the SDK and compile the SDK</p>
23
+ <pre class="code">
24
+ node ./compile.js
25
+ </pre>
26
+
27
+ <p>It generates a file named <b>dist/bundle.js</b></p>
28
+ <pre class="code">
29
+ ACC client-side SDK compiler version 0.1.0
30
+ Bundling ../package.json
31
+ Bundling ./web/jsdom.js
32
+ Bundling ./web/crypto.js
33
+ Bundling ./web/request.js
34
+ Bundling ./xtkCaster.js
35
+ Bundling ./domUtil.js
36
+ Bundling ./xtkEntityCache.js
37
+ Bundling ./methodCache.js
38
+ Bundling ./optionCache.js
39
+ Bundling ./soap.js
40
+ Bundling ./crypto.js
41
+ Bundling ./client.js
42
+ Bundling ./index.js
43
+ Client-side SDK generated in ./dist/bundle.js
44
+ </pre>
45
+
46
+
47
+ <h2>Use a proxy</h2>
48
+ <p>Using the client side SDK cannot be done directly because the Campaign server has CORS configured to reject HTTP requests from resources not served by Campaign.
49
+ Therefore a server-side proxy is need to relay the calls to Campaign, or you need to serve the SDK and corresponding web pages from Campaign itself</p>
50
+
51
+ <h2>Deploy the SDK to a Campaign server</h2>
52
+
53
+ <p>Once compiled, copy it to the Campaign server (here on a dev environment).</p>
54
+ <pre class="code">
55
+ cd /c/cygwin64/home/neolane/ac
56
+ cp "Z:\amorin On My Mac\Documents\dev\git\ac7\acc-js-sdk\dist/bundle.js" nl/web/accSDK.js
57
+ </pre>
58
+
59
+ <p>This makes them available on the following endpoint</p>
60
+ <pre class="code">
61
+ /nl/accSDK.js
62
+ </pre>
63
+
64
+
65
+
66
+
67
+ <h2>Usage</h2>
68
+
69
+ Include the SDK
70
+ <pre class="code">
71
+ &lt;script src="accSDK.js">&lt;/script>
72
+ </pre>
73
+
74
+ Use the SDK. Note that the SDK variable is now called `document.accSDK` to avoid potential name collision with the common name "sdk".
75
+ <pre class="code">
76
+ &lt;script>
77
+
78
+ (async () => {
79
+ const sdk = document.accSDK;
80
+
81
+ const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
82
+ "http://ffdamid:8080", "admin", "admin");
83
+ const client = await sdk.init(connectionParameters);
84
+
85
+ console.log(sdk.getSDKVersion());
86
+ await client.logon();
87
+
88
+ var databaseId = await client.getOption("XtkDatabaseId");
89
+ console.log(databaseId);
90
+ document.getElementById("hello").textContent = databaseId;
91
+
92
+ await client.logoff();
93
+ })();
94
+
95
+ &lt;/script>
96
+ </pre>