@adobe/acc-js-sdk 1.1.8 → 1.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/CHANGELOG.md CHANGED
@@ -5,29 +5,34 @@ This is a node.js SDK for Campaign API. It exposes the Campaign API exactly like
5
5
 
6
6
  # Changelog
7
7
 
8
+ ## Version 1.1.9
9
+ _2022/10/11_
10
+
11
+ * Added support for schema visibleIf attribute
12
+
8
13
  ## Version 1.1.8
9
- _2022_10_03_
14
+ _2022/10/03_
10
15
 
11
16
  * Added translation ids (`labelLocalizationId`,`descriptionLocalizationId`, `labelSingularLocalizationId`) for `XtkSchema`, `XtkSchemaNode`, `XtkEnumerationValue` and `XtkEnumeration`
12
17
 
13
18
  ## Version 1.1.7
14
- _2022_08_30_
19
+ _2022/08/30_
15
20
 
16
21
  * New listener interface to be notified of internal events from the SDK. Can be used to integrate with observability frameworks. See the "Observers" section of the README file.
17
22
  * Experimental file upload feature. Will require server-side changes to work, and is currently limited to be used with browsers only.
18
23
 
19
24
  ## Version 1.1.6
20
- _2022_08_19_
25
+ _2022/08/19_
21
26
 
22
27
  * New auto-refresh mechanism to keep schemas and option caches up-to-date. See `client.startRefreshCaches` and `client.stopRefreshCaches` functions.
23
28
 
24
29
  ## Version 1.1.5
25
- _2022/07/07__
30
+ _2022/07/07_
26
31
 
27
32
  * The SOAP method name was not showing up properly in the Chrome console
28
33
 
29
34
  ## Version 1.1.4
30
- _2022/07/07__
35
+ _2022/07/07_
31
36
 
32
37
  * Added `application.version` which returns the server version in the format major.minor.servicePack (ex: 8.2.10)
33
38
  * Added the ability to push down parameters to the SOAP and transport layers. See the pushDown section of the readme file.
package/README.md CHANGED
@@ -1830,7 +1830,7 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1830
1830
  | **userEnumeration** | Returns a string of characters which is the name of the user enumeration used by the current node.
1831
1831
  | **ref** | Some nodes are only references to other nodes. There are 2 kind of references. Local references are simply a xpath in the current schema (starting from the schema itself, and not the schema root). Fully qualified references are prefixed with a schema id. The target node can be accessed with the `refTarget` funtion.
1832
1832
  | **isMappedAsXml** | Is the field mapped as XML?
1833
-
1833
+ | **visibleIf** | The visibility expression of the node (if any) since version 1.1.9 of the SDK
1834
1834
 
1835
1835
 
1836
1836
  | Method | Description |
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@adobe/acc-js-sdk",
9
- "version": "1.1.8",
9
+ "version": "1.1.9",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "axios": "^0.25.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "ACC Javascript SDK",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/adobe/acc-js-sdk#readme",
@@ -373,6 +373,12 @@ class XtkSchemaNode {
373
373
  */
374
374
  this.unbound = EntityAccessor.getAttributeAsBoolean(xml, "unbound");
375
375
 
376
+ /**
377
+ * The expression controlling the visibility of the current node
378
+ * @type {string}
379
+ */
380
+ this.visibleIf = EntityAccessor.getAttributeAsString(xml, "visibleIf");
381
+
376
382
  /**
377
383
  * Has an unlimited number of children of the same type
378
384
  * @type {boolean}
@@ -1255,6 +1255,21 @@ describe('Application', () => {
1255
1255
  });
1256
1256
  });
1257
1257
 
1258
+ describe("visibleIf", () => {
1259
+
1260
+ it("Should extract visibleIf", async () => {
1261
+ var xml = DomUtil.parse(`<schema namespace='nms' name='recipient'>
1262
+ <element name='recipient' label='Recipients'>
1263
+ <element name="myAddress" visibleIf="HasPackage('pkg')"/>
1264
+ </element>
1265
+ </schema>`);
1266
+ var schema = newSchema(xml);
1267
+ // Pointing to the node with ref itself => return it
1268
+ var node = await schema.root.findNode("myAddress");
1269
+ expect(node).toMatchObject({ name:"myAddress", visibleIf:"HasPackage('pkg')", childrenCount:0 });
1270
+ });
1271
+ });
1272
+
1258
1273
  describe("Links", () => {
1259
1274
  it("Should find link node", async () => {
1260
1275
  var xml = DomUtil.parse(`<schema namespace='nms' name='recipient'>