@adobe/acc-js-sdk 1.1.9 → 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.
- package/README.md +8 -1960
- package/docs/404.html +11 -0
- package/docs/Gemfile +35 -0
- package/docs/Gemfile.lock +270 -0
- package/docs/_config.yml +55 -0
- package/docs/_data/navigation.yml +119 -0
- package/docs/_includes/navigation.html +33 -0
- package/docs/_layouts/default.html +21 -0
- package/docs/_layouts/home.html +4 -0
- package/docs/_layouts/page.html +5 -0
- package/docs/_layouts/post.html +7 -0
- package/docs/_posts/2022-10-14-welcome.html +149 -0
- package/docs/application.html +366 -0
- package/docs/architecture.html +24 -0
- package/docs/assets/css/styles.css +362 -0
- package/docs/assets/images/adobe-campaign-256.png +0 -0
- package/docs/assets/images/architecture.png +0 -0
- package/docs/assets/images/ref.svg +6 -0
- package/docs/badgerFish.html +14 -0
- package/docs/bestPractices.html +189 -0
- package/docs/blog.html +18 -0
- package/docs/buildAndRun.html +96 -0
- package/docs/caches.html +68 -0
- package/docs/changeLog.html +256 -0
- package/docs/checkList.html +168 -0
- package/docs/concepts.html +130 -0
- package/docs/connecting.html +210 -0
- package/docs/connectionParameters.html +109 -0
- package/docs/contribute.html +54 -0
- package/docs/dataTypes.html +124 -0
- package/docs/differences.html +4 -0
- package/docs/documentation.html +21 -0
- package/docs/domHelper.html +88 -0
- package/docs/dynamicInvoke.html +36 -0
- package/docs/entityAccessor.html +22 -0
- package/docs/errors.html +47 -0
- package/docs/escaping.html +76 -0
- package/docs/favicon.png +0 -0
- package/docs/healthCheck.html +66 -0
- package/docs/httpHeaders.html +78 -0
- package/docs/index.html +64 -0
- package/docs/installation.html +34 -0
- package/docs/license.html +208 -0
- package/docs/messageCenter.html +80 -0
- package/docs/methodLevelRepresentation.html +12 -0
- package/docs/midSourcing.html +19 -0
- package/docs/observability.html +169 -0
- package/docs/passwords.html +27 -0
- package/docs/profiles.html +103 -0
- package/docs/pushDown.html +13 -0
- package/docs/quickstart.html +69 -0
- package/docs/release.html +52 -0
- package/docs/samples.html +82 -0
- package/docs/simpleJson.html +88 -0
- package/docs/soapAPIs.html +234 -0
- package/docs/timeouts.html +23 -0
- package/docs/transport.html +45 -0
- package/docs/troubleshooting.html +17 -0
- package/docs/writeDoc.html +208 -0
- package/docs/xml2json.html +96 -0
- package/docs/xtkCaster.html +67 -0
- package/docs/xtkInterface.html +20 -0
- package/docs/xtkOption.html +54 -0
- package/docs/xtkPackage.html +16 -0
- package/docs/xtkPersist.html +213 -0
- package/docs/xtkQueryDef.html +245 -0
- package/docs/xtkSchema.html +39 -0
- package/docs/xtkSession.html +29 -0
- package/docs/xtkWorkflow.html +28 -0
- package/docs/xtkWrite.html +51 -0
- package/package-lock.json +843 -5820
- package/package.json +1 -1
- package/samples/005 - basics - persist.js +160 -0
- package/src/application.js +5 -0
- package/src/campaign.js +1 -1
- package/src/client.js +68 -25
- package/src/methodCache.js +24 -13
- package/src/soap.js +16 -4
- package/src/xtkCaster.js +61 -3
- package/test/application.test.js +23 -0
- package/test/caches.test.js +1 -1
- package/test/client.test.js +118 -3
- package/test/mock.js +41 -4
- package/test/soap.test.js +13 -0
- package/test/xtkCaster.test.js +62 -0
- package/test/xtkPersist.test.js +97 -0
- package/test/xtkProxy.test.js +81 -0
- package/CHANGELOG.md +0 -245
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
title: Session API
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<p>The <b>xtk:session</b> schema contains APIs to manage sessions and connections to the Campaign server, plus some other general purpose APIs.</p>
|
|
7
|
+
|
|
8
|
+
<h1>Logging on and off</h1>
|
|
9
|
+
|
|
10
|
+
<p>
|
|
11
|
+
The <b>xtk:session</b> schema contains all the methods for logging on and off. They are described in more details in the <a href="{{ site.baseurl }}/connecting.html">Connecting to Campaign</a> page
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<h1>Server time</h1>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
The <b>xtk:session#GetServerTime</b> API call returns the current data/time in the server (i.e. database) referential. This is a useful function
|
|
22
|
+
to use to make sure all timestamps are in the same referential.
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<pre class="code">
|
|
26
|
+
const timestamp = await NLWS.xtkSession.getServerTime();
|
|
27
|
+
console.log(`>> Server timestamp (UTC): ${timestamp.toUTCString()}`);
|
|
28
|
+
console.log(`>> Server timestamp (localized): ${timestamp}`);
|
|
29
|
+
</pre>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
title: Workflow API
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<p>Start and stop wotkflows, passing either an id or workflow internal name</p>
|
|
7
|
+
|
|
8
|
+
<pre class="code">
|
|
9
|
+
await NLWS.xtkWorkflow.stop(4900);
|
|
10
|
+
await NLWS.xtkWorkflow.start(4900);
|
|
11
|
+
</pre>
|
|
12
|
+
|
|
13
|
+
<p>A workflow can be started with parameters. Variables, are passed as attributes of the parameters document.</p>
|
|
14
|
+
<pre class="code">
|
|
15
|
+
await NLWS.xtkWorkflow.startWithParameters(4900, { hello: "world" });
|
|
16
|
+
</pre>
|
|
17
|
+
|
|
18
|
+
<p>The variables can be used in the workflow as attributes of the <b>instance.vars</b> variable.</p>
|
|
19
|
+
|
|
20
|
+
<pre class="code">
|
|
21
|
+
logInfo(instance.vars.hello);
|
|
22
|
+
</pre>
|
|
23
|
+
|
|
24
|
+
<p class="warning">
|
|
25
|
+
Note that workflows are executed asynchronously by Campaign. When the promise returned by the start
|
|
26
|
+
function resolves, the workflow is not finished. The promise resolution indicates that the request
|
|
27
|
+
to start (or stop) the workflow has been accepted by the server.
|
|
28
|
+
</p>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
title: Writer API
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<p>More details on the CRUD API <a href="{{ site.baseurl }}/xtkPersist.html">here</a>.</p>
|
|
7
|
+
|
|
8
|
+
<p>Creates an image (data is base64 encoded)</p>
|
|
9
|
+
|
|
10
|
+
<pre class="code">
|
|
11
|
+
var data = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA9ElEQVQ4jaXTIUsFQRSG4eeKiBjEIBeDYDGoSUwGm81s8SdYtIhFhPMDbEaz/SIIZkGbWg1Gg0GwiIgYZPZuWBxn8bJvWXb2O+/scM70lAhjuMO1sF9IVaES61jFnjBbyLQKjurnJz6yr62CsI2t+m0gRhGERZw1Vk6zTFEQ+rjETOP3b7OqBr1G8SRusPYrc4I3LGCeapN37AqP443g8R/FiYNsZcgGSRCmq1ZxmEXa6Yt0hKh6/dAaLbOcd+H/XOGpi2AFU10EqWsTXQQ7wmsSPNdzP8DXCII0D41BSgxvXboHm1jCXDpnPbHfeME9znEh+AFoTyfEnWJgLQAAAABJRU5ErkJggg==";
|
|
12
|
+
var doc = {
|
|
13
|
+
xtkschema: "xtk:image",
|
|
14
|
+
_operation: "insert",
|
|
15
|
+
namespace: "cus",
|
|
16
|
+
name: "test.png",
|
|
17
|
+
label: "Self test",
|
|
18
|
+
type: "png",
|
|
19
|
+
$data: data
|
|
20
|
+
};
|
|
21
|
+
await NLWS.xtkSession.write(doc);
|
|
22
|
+
</pre>
|
|
23
|
+
|
|
24
|
+
<p>Creates a folder (with image previously created)</p>
|
|
25
|
+
|
|
26
|
+
<pre class="code">
|
|
27
|
+
const folder = {
|
|
28
|
+
xtkschema: "xtk:folder",
|
|
29
|
+
_operation: "insert",
|
|
30
|
+
parent-id: 1167,
|
|
31
|
+
name: "testSDK",
|
|
32
|
+
label: "Test SDK",
|
|
33
|
+
entity: "xtk:folder",
|
|
34
|
+
schema: "xtk:folder",
|
|
35
|
+
model: "xtkFolder",
|
|
36
|
+
"image-namespace": "cus",
|
|
37
|
+
"image-name": "test.png"
|
|
38
|
+
};
|
|
39
|
+
await NLWS.xtkSession.write(folder);
|
|
40
|
+
</pre>
|
|
41
|
+
|
|
42
|
+
<p>Some objects, such as deliveries are created from templates. The `createFromModel` API is preferred in this case. Given a template name, and a patch object, it will return an object created from the template and the patch, applying all sort of business rules and default values. This object can be inserted using a writer.</p>
|
|
43
|
+
|
|
44
|
+
<p>In this example, an email delivery is created from the "mail" delivery template and it's label is set to "Hello".</p>
|
|
45
|
+
|
|
46
|
+
<p class="info">Note the xtkschema attribute in the second parameter of the `createFromModel` API call which is needed for the SDK to perform the proper JSON to XML transformation.</p>
|
|
47
|
+
|
|
48
|
+
<pre class="code">
|
|
49
|
+
const mail = await client.NLWS.nmsDelivery.createFromModel('mail', { xtkschema:'nms:delivery', label:'Hello'});
|
|
50
|
+
await client.NLWS.xtkSession.write(mail);
|
|
51
|
+
</pre>
|