@adobe/acc-js-sdk 1.0.9 → 1.1.2

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,6 +5,31 @@ 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.2
9
+ _2022/03/22_
10
+
11
+ * Add support for choosing the representation (XML or JSON) at the method level using NLWS.xml or NLWS.json.
12
+
13
+ ## Version 1.1.1
14
+ _2022/03/10_
15
+
16
+ * Fixed an issue with encoding: make the default charset encoding to be UTF-8 (https://github.com/adobe/acc-js-sdk/issues/26)
17
+
18
+ ## Version 1.1.0
19
+ _2022/03/05_
20
+
21
+ Changes in the metadata api (`application.getSchema`) which was not completely implemented. While this API is meant to be largely compatible with the [ACC JS API](https://docs.adobe.com/content/help/en/campaign-classic/technicalresources/api/c-Application.html), it's not always possible to do so because of the asynchronous nature of the SDK. The JS API is executed inside the Campaign application server can will synchronously and transparently fetch schemas as needed. Howerer the SDK runs outside of the Campaign server. It will synchronously and transparently fetch schemas as needed, but this will be done adynchronously.
22
+
23
+ Differences are document in the `Application` section of the README.
24
+
25
+ * Provide array and map access to XtkSchemaKey.fields,
26
+ * The order of children of a node has been changed. Beore 1.1.0, it was attributes, then elements. After 1.1.0, it's the order defined in the schema XML
27
+ * New application.getEnumeration function to retreive an enumeration
28
+ * Removed the XtkSchemaNode.hasChild function
29
+ * Support for ref nodes and links: XtkSchemaNode.refTarget(), XtkSchemaNode.linkTarget() functions
30
+ * Reviews XtkSchemaNode.findNode() function to support links, refs, ANY type, etc. and is now asynchronous
31
+ * The name attribute of enumerations (`XtkEnumeration.name`) is now the fully qualified name of the enumeration, i.e. is prefixed by the schema id
32
+
8
33
  ## Version 1.0.9
9
34
  _2022/03/02_
10
35
 
@@ -25,6 +50,8 @@ _2022/03/02_
25
50
  * When label or description is missing from schema nodes or from enumerations, they default to the name value
26
51
  * application.getSchema now uses a in-memory cache
27
52
 
53
+ For breaking changes see the [migration guide](MIGRATION.md)
54
+
28
55
 
29
56
  ## Version 1.0.7
30
57
  _2022/01/24_
package/MIGRATION.md ADDED
@@ -0,0 +1,160 @@
1
+ # Migration guide
2
+
3
+ # Version 1.1.0
4
+
5
+ In version 1.1.0, changes were made in the metadata API. The SDK lets you access schema as JSON objects (method `client.getSchema`) or provides an object model around schemas with typed objects, as in https://experienceleague.adobe.com/developer/campaign-api/api/c-Schema.html, which can be accessed with `application.getSchema`.
6
+
7
+
8
+ The following potentially breaking changes were introduced
9
+
10
+ * Schemas retreived by `application.getSchema` are cached in memory
11
+ * Attributes without an explicit type will be reported as `string` type instead of empty type
12
+ * The `userDescription` property removed from `XtkSchemaNode` and only available on `XtkSchema`
13
+ * The `children` of a `XtkSchemaNode` are now reported in the same order as they appear in the schema
14
+ * Implicit values are propagated for `XtkSchemaNode` and enumeration. It means that empty labels and desciptions not have a non empty value infered from the name attribute
15
+ * The `XtkSchemaNode.hasChild` function has been removed
16
+ * Enumerations of a schema, values of an enumeration, children of a schema node, keys of a schema, and fields of a key are now returned as a `ArrayMap` type instead of a key/value. This change allows to access elements as either an array or a dictionary, or map, filter, iterate through elements.
17
+ * The string representation of schema nodes : `XtkSchema.toString` and `XtkSchemaNode.toString` has changed
18
+ * The `XtkSchemaNode.findNode` method is now asynchronous and its signature has changed
19
+ * The name attribute of enumerations is now always the fully qualified name (ex: `nms:recipient:gender` instead of `gender`). The non qualified name is still available with the `shortName` property.
20
+
21
+ ## In-memory cache
22
+ Schema objects have their own in-memory cache, in addition to the SDK cache
23
+
24
+ ## Attribute type
25
+ Attributes with no type are now reported as `string`.
26
+
27
+ Before
28
+ ```js
29
+ // Deprecated syntax
30
+ if (!attribute.type || attribute.type === "string") ...
31
+ ```
32
+
33
+ After
34
+ ```js
35
+ if (attribute.type === "string") ...
36
+ ```
37
+
38
+ or better, use `XtkCaster.isStringType` which will handle all variant of string types, such as `memo`, `html`, etc.
39
+ ```js
40
+ if (XtkCaster.isStringType(attribute.type)) ...
41
+ ```
42
+
43
+ ## userDescription property
44
+ The `userDescription` property was set on the `XtkSchemaNode` object and has been moved to the `XtkSchema` object
45
+
46
+ ## Order of children
47
+ The order of children of a node has been changed. Beore 1.1.0, it was attributes, then elements. After 1.1.0, it's the order defined in the schema XML
48
+
49
+ ## Propagate implicit values
50
+ Automatically set schema nodes label and description properties if they are not set.
51
+ * Schema node. If a node does not have a label, the SDK will generate a label from the name (with first letter in upper case) instead of returning an empty string. Similarly, the node description property will be set from the label.
52
+ * enumeration label will be set with the same rules
53
+
54
+ ## Removed hasChild function
55
+ The function `XtkSchemaNode.hasChild` has been removed.
56
+
57
+ Before
58
+ ```js
59
+ // Deprecated syntax (will fail at runtime)
60
+ if (node.hasChild("@email")) { ... }
61
+ ```
62
+
63
+ After
64
+ ```js
65
+ if (!node.children.get("@email")) { ... }
66
+ ```
67
+
68
+ ## ArrayMaps
69
+ Collection of child elements which were accessed as maps are now accessed with a special `ArrayMap` object which allows to access them either as maps of arrays and include convenience functions for iteration
70
+ * fields of a key (`XtkSchemaKey.fields`)
71
+ * chldren of a node (`XtkSchemaNode.children`)
72
+ * keys of a node (`XtkSchemaNode.keys`)
73
+ * values of an enumeration (`XtkEnumeration.values`)
74
+ * enumerations of a schema (`XtkSchema.enumerations`)
75
+
76
+ As a consequence, it's deprecated to access the properties above by name. It still works in most of the cases, but will fail for object whose name collides with JavaScript function names. For exampl, for an element named 'forEach'.
77
+
78
+ Instead, use one of the following constructs.
79
+
80
+ To iterate over a collection, use `map`, `forEach`, or a `for ... of` loop. Do not use the for ... in loop.
81
+
82
+ Before
83
+ ```js
84
+ // Not supported anymore. Will only work in some cases
85
+ for (key in node.children) { const child = node.children[key]; ... }
86
+ ```
87
+
88
+ After
89
+ ```js
90
+ node.children.forEach(child => ...);
91
+ node.children.map(child => ...);
92
+ for (child of node.children) { ... }
93
+ for (let i=0 i<node.children.lenght; i++) { const child = node.children[i]; ... }
94
+ ```
95
+
96
+ Collection items can be accessed by name or index with the `get` function, or with an array index.
97
+
98
+ Before
99
+ ```js
100
+ // Not supported anymore. Will only work in some cases
101
+ const child = node.children["@email"];
102
+ ```
103
+
104
+ After
105
+
106
+ ```js
107
+ const child = node.children[3];
108
+ const child = node.children.get(3);
109
+ const child = node.children.get("@email");
110
+ ```
111
+
112
+
113
+ ## Schema and SchemaNode toString
114
+ The `toString` function has been changed to better display a node structure. In general, this function is mostly for debugging purpose, and you should not rely on the exact output.
115
+
116
+ ## XtkSchemaNode.findNode
117
+ The `findNode` function has been modified in multiple ways.
118
+
119
+ * The function is now **asynchronous** and returns a Promise. The reason is that in order to support all the use cases supported in Campaign JS API, findNode needs to follow references and links, and therefore may have to dynamically load schemas.
120
+
121
+ * The function now supports `ref` nodes. Ref nodes are schema nodes having a `ref` property which is a reference to another node, possibly in a different schema.
122
+ * If the xpath passed to the function ends with a ref node, the ref node itself will be returned. We're not following the reference. You can use the `refTarget` method to explicitely follow the reference
123
+ * If the xpath traverse intermediate nodes which are ref nodes, the `findNode` method will follow the reference. For instance, the start activity in a workflow is a reference. Finding the xpath "start/@img" will follow the start reference and find the @img attribute from there
124
+
125
+ * Support of type `ANY`. The type `ANY` in Campaign is used to describe a node which can contain arbitrary child nodes, without any strongly defined structure. The `findNode` function will only be able to return direct children of a node of `ANY` type.
126
+
127
+ * Support for links. If the xpath parameter contains links, `findNode` will follow the link target with the same rules as for reference nodes. To get the target of a link, use the `linkTarget` method instead of `refTarget`.
128
+
129
+ * The `findNode` function now takes only one parameter: the xpath to search for. The `strict` and `mustExist` parameters were removed. The function is now always in strict mode, i.e. will not try to guess if you're searching for an element or attribute. The function will only throw if the schema it's working on are malformed. For instance, if the target property of a link is not a syntaxically correct schema id. If however, the node you're looking for does not exist, or if an intermediate node or schema does not exist, findNode will simply return null or undefined, and will not throw. The `mustExist` param may be reintroduced in the future for better error reporting.
130
+
131
+
132
+ Basic usage of `findNode`
133
+
134
+
135
+ Before
136
+ ```js
137
+ // Deprecated, will not work anymore
138
+ try {
139
+ const email = schema.root.findNode("@email");
140
+ } catch(error) {
141
+ // maybe @email does not exist, or maybe the schema is invalid
142
+ }
143
+ ```
144
+
145
+ After
146
+ ```js
147
+ try {
148
+ const email = await schema.root.findNode("@email");
149
+ if (!email) {
150
+ // @email does not exist
151
+ }
152
+ } catch(error) {
153
+ // schema is invalid
154
+ }
155
+ ```
156
+
157
+
158
+ ## Enumeration name
159
+
160
+ * The name attribute of enumerations (`XtkEnumeration.name`) is now the fully qualified name of the enumeration, i.e. is prefixed by the schema id
package/README.md CHANGED
@@ -129,6 +129,7 @@ transport|axios|Overrides the transport layer
129
129
  noStorage|false|De-activate using of local storage
130
130
  storage|localStorage|Overrides the local storage for caches
131
131
  refreshClient|undefined|Async callback to run when the session token is expired
132
+ charset|UTF-8|The charset encoding used for http requests. In version 1.1.1 and above, the default will be UTF-8. It's possible to override (including setting an empty character set) with this option.
132
133
 
133
134
  ```js
134
135
  const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
@@ -303,6 +304,15 @@ const queryDef = {
303
304
  };
304
305
  ```
305
306
 
307
+ ## Method-level representation
308
+
309
+ The client object is created with a default representation which is used for all API calls in the context of this client. Since version 1.1.2, it is also possible to set the representation at the method level, i.e. use a particular representation for a particular API call.
310
+
311
+ * `client.NLWS`: use the default representation set at the client level
312
+ * `client.NLWS.xml`: use the XML reresentation
313
+ * `client.NLWS.json`: use the SimpleJson representation
314
+
315
+
306
316
  ## SimpleJson format
307
317
  The Simple JSON format works like this:
308
318
 
@@ -323,7 +333,7 @@ XML elements are mapped to JSON objects
323
333
  * XML: `<root><item id=1/></root>`
324
334
  * JSON: `{ item: { id:1 } }`
325
335
 
326
- If the parent element tag ends with `-collecion` children are always an array, even if there are no children, or if there is just one child. The rationale is that XML/JSON conversion is ambigous : XML can have multiple elements with the same tag and when there's only one such element, it's not possible to determine if it should be represented as a JSON object or JSON array unless we have additional metadata.
336
+ If the parent element tag ends with `-collection` children are always an array, even if there are no children, or if there is just one child. The rationale is that XML/JSON conversion is ambigous : XML can have multiple elements with the same tag and when there's only one such element, it's not possible to determine if it should be represented as a JSON object or JSON array unless we have additional metadata.
327
337
 
328
338
  * XML: `<root-collection><item id=1/></root>`
329
339
  * JSON: `{ item: [ { id:1 } ] }`
@@ -1340,7 +1350,8 @@ The `application` object can be obtained from a client, and will mimmic the Camp
1340
1350
  | **instanceName** | The name of the Campaign instance
1341
1351
  | **operator** | Information about the current operator (i.e. logged user), of class `CurrentLogin`
1342
1352
  | **packages** | List of installed packages, as an array of strings
1343
- | **getSchema**(schemaId) | Get a schema by id (see the Schemas section below)
1353
+ | async **getSchema**(schemaId) | Get a schema by id (see the Schemas section below)
1354
+ | async **getEnumeration**(enumerationName, schemaOrSchemaId) | Get an enumeration
1344
1355
  | **hasPackage**(name) | Tests if a package is installed or not
1345
1356
 
1346
1357
 
@@ -1393,18 +1404,130 @@ The Schema API closely mimmics the Campaign server side API : https://docs.adobe
1393
1404
 
1394
1405
  * The `XtkSchema` and associated classes (`XtkSchemaNode`, `XtkSchemaKey`, `XtkEnumeration` and `XtkEnumerationValue`) are all immutable. There are currently no API to create schemas dynamically
1395
1406
  * Not all methods and functions are implemented
1407
+ * Several methods are asynchronous because they may require a server round trip to fetch schemas, etc.
1396
1408
  * There could be slight differences in usage due to Campaign server side JavaScript using some E4X specific constructs to iterate over collections (ex: for each(...)) which are not available in standard JavaScript environments
1397
1409
 
1398
1410
  The entry point is the application object. Obtain a schema from its id:
1399
1411
 
1400
1412
  ```js
1401
1413
  const application = client.application;
1402
- const schema = application.getSchema("nms:recipient");
1414
+ const schema = await application.getSchema("nms:recipient");
1403
1415
  ```
1404
1416
 
1405
1417
  This return a schema object of class `XtkSchema`
1406
1418
 
1407
1419
 
1420
+ ### Iterating over collections
1421
+ The metadata SDK closely mimmics the Campaign API, but provides convenience functions to access collections of objects, such as the children of a node, the values of an enumeration, etc. using an `ArrayMap` structure which allows access as both an array and a map.
1422
+
1423
+ Access as a map. Child elements can be accessed with their names, as if it was a JavaScript map. For instance, accessing the gender of a recipient. This method is kept as a compatibility layer with the legacy API and older versions of the SDK but is deprecated / discouraged. The reason is that there are schemas which have attribut names such as "length", or element names such as "forEach" which collide with JavaScript objects.
1424
+ ```js
1425
+ const schema = await client.application.getSchema("nms:recipient");
1426
+ const enumerations = schema.enumerations;
1427
+ // deprecated, discouraged
1428
+ expect(enumerations.gender.label).toBe("Gender");
1429
+ ```
1430
+
1431
+ Instead, prefer the `get` function which can retreive any enumeration value
1432
+ ```js
1433
+ const schema = await client.application.getSchema("nms:recipient");
1434
+ const enumerations = schema.enumerations;
1435
+ expect(enumerations.get("gender").label).toBe("Gender");
1436
+ ```
1437
+
1438
+ Elements can also be accessed as an array. In this example, we are iterating over the enumerations of a schema
1439
+ ```js
1440
+ const schema = await client.application.getSchema("nms:recipient");
1441
+ const enumerations = schema.enumerations;
1442
+ for (let i=0; i<enumerations.length; i++) {
1443
+ const enumeration = enumerations[i];
1444
+ }
1445
+ ```
1446
+
1447
+ Note that this assumes that there is no enumeration called "length" which will override the "length" attribute. Schemas, schema elements, and sql schemas have attributes named "length", but they are attributes, and will therefore be named "@length" in the metadata API. There is no element named "length" in out-of-the-box schemas.
1448
+
1449
+ The ArrayMap also behaves like an iterator and works fine with the `for...of` syntax
1450
+ ```js
1451
+ const schema = await client.application.getSchema("nms:recipient");
1452
+ const enumerations = schema.enumerations;
1453
+ for (const enumeration of enumerations) {
1454
+ ...
1455
+ }
1456
+ ```
1457
+
1458
+ For convenience, the `map` and `forEach`, `find`, `filter`, `get`, and `flatMap` methods are also available and behave as expected:
1459
+
1460
+ ```js
1461
+ const schema = await client.application.getSchema("nms:recipient");
1462
+ // comma separated list of enumerations
1463
+ const enumerations = schema.enumerations.map(e => e.name).join(',');
1464
+ ```
1465
+
1466
+ ```js
1467
+ const schema = await client.application.getSchema("nms:recipient");
1468
+ schema.enumerations.forEach(e => { ... });
1469
+ ```
1470
+
1471
+ The `for...in` loop is also supported but deprecated/discouraged as it may return incorrect results for collections having items whose key collide with javaScript properties (such as length, map, forEach, etc.). Use a `for...of` construcr instead, or the `map` or `forEach` functions.
1472
+ ```js
1473
+ const schema = await client.application.getSchema("nms:recipient");
1474
+ // deprecated, discouraged
1475
+ for (const key in schema.enumerations) {
1476
+ ...
1477
+ }
1478
+ ```
1479
+
1480
+ ## Navigating schemas
1481
+ The schema API is useful to quickly navigate in the schema hierarchy. Here are a few examples
1482
+
1483
+ Get the label of the email attribute of the nms:recipient schema
1484
+ ```js
1485
+ const schema = await application.getSchema("nms:recipient");
1486
+ const email = await schema.root.findNode("@email");
1487
+ console.log(email.label);
1488
+ ```
1489
+
1490
+ The `findNode` function follows links and references
1491
+ * The function now supports `ref` nodes. Ref nodes are schema nodes having a `ref` property which is a reference to another node, possibly in a different schema.
1492
+ * If the xpath passed to the function ends with a ref node, the ref node itself will be returned. We're not following the reference. You can use the `refTarget` method to explicitely follow the reference
1493
+ * If the xpath traverse intermediate nodes which are ref nodes, the `findNode` method will follow the reference. For instance, the start activity in a workflow is a reference. Finding the xpath "start/@img" will follow the start reference and find the @img attribute from there
1494
+
1495
+ * Support for links. If the xpath parameter contains links, `findNode` will follow the link
1496
+ target with the same rules as for reference nodes. To get the target of a link, use the `linkTarget` method instead of `refTarget`.
1497
+
1498
+
1499
+ For insance, you can get the country of a recipient who clicked in an email. This call follows the link from nms:broadLogRcp to nms:recipient and then from nms:recipient to nms:country, returning the country isoA3 attribute.
1500
+ ```js
1501
+ const schema = await application.getSchema("nms:broadLogRcp");
1502
+ const node = await schema.root.findNode("recipient/country/@isoA3");
1503
+ ```
1504
+
1505
+ The same syntax can be used for reference nodes. For instance, getting the attributes of the start activity of a workflow:
1506
+ ```js
1507
+ const schema = await application.getSchema("xtk:workflow");
1508
+ const node = await schema.root.findNode("start/@name");
1509
+ ```
1510
+
1511
+ In order to actually iterate over the children, things are a little bit more complicated
1512
+ ```js
1513
+ const schema = await application.getSchema("xtk:workflow");
1514
+ const start = await schema.root.findNode("start");
1515
+ // start is the ref node, not the target of the ref. One need to explicitely
1516
+ // follow the ref in order to get the list of children
1517
+ const target = await start.refTarget();
1518
+ target.children.forEach(child => ... );
1519
+ ```
1520
+
1521
+ To get the root node of the target of a link, use the `linkTarget` function
1522
+ ```js
1523
+ const schema = await application.getSchema("nms:broadLogRcp");
1524
+ const node = await schema.root.findNode("recipient/country");
1525
+ // node is the country link, not the root node of the nms:country schema
1526
+ const root = await node.linkTarget();
1527
+ // root is the root node of the nms:country schema
1528
+ ```
1529
+
1530
+
1408
1531
  ### XtkSchema
1409
1532
 
1410
1533
  | Attribute | Description |
@@ -1426,9 +1549,9 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1426
1549
 
1427
1550
  ### XtkSchemaNode
1428
1551
 
1429
- | Attribute | | Description |
1552
+ | Attribute | Description |
1430
1553
  |---|---|
1431
- | **children** | A map of children of the node, indexed by name. Names never contain the "@" sign, even attribute names
1554
+ | **children** | A array/map of children of the node. See note on the ArrayMap structure below
1432
1555
  | **dataPolicy** | Returns a string of characters which provides the data policy of the current node.
1433
1556
  | **description** | A long, human readable, description of the node
1434
1557
  | **editType** |Returns a string of characters which specifies the editing type of the current node.
@@ -1438,12 +1561,12 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1438
1561
  | **image** | Returns the name of the image in the form of a string of characters.
1439
1562
  | **img** | Returns the name of the image in the form of a string of characters. (alias to `image` property)
1440
1563
  | **integrity** | Returns the link integrity type.
1441
- | **keys** | A map of keys in this node, indexed by key name. Map values are of type `XtkSchemaKey`
1564
+ | **keys** | A array/map of keys in this node, indexed by key name. Map values are of type `XtkSchemaKey`
1442
1565
  | **hasEnumeration** | Returns a boolean which indicates whether the value of the current node is linked to an enumeration.
1443
1566
  | **childrenCount** | Number of children nodes
1444
1567
  | **hasSQLTable** | Returns a boolean which indicates whether the current node is linked to an SQL table.
1445
1568
  | **hasUserEnumeration** | Returns a boolean which indicates whether the value of the current node is linked to a user enumeration.
1446
- | **schema** | The schema to which this node belongs
1569
+ | **schema** | The schema (`XtkSchema`) to which this node belongs
1447
1570
  | **isAdvanced** | Returns a boolean which indicates whether the current node is advanced or not.
1448
1571
  | **isAnyType** | Returns a boolean which indicates whether the current node is ordinary.
1449
1572
  | **isAttribute** | Indicates if the node is an attribute (true) or an element (false)
@@ -1466,13 +1589,13 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1466
1589
  | **isRequired** | Returns a boolean which indicates whether or not the value of the current node is mandatory.
1467
1590
  | **isRoot** | Indicates if the node is the root node of a schema, i.e. the first child of the schema node, whose name matches the schema name
1468
1591
  | **isSQL** | Returns a boolean which indicates whether the current node is mapped in SQL.
1469
- | **isTemporaryTable** | Returns a boolean indicating whether the table is a temporary table. The table will not be created during database creation.| id | schema | For schemas, the id of the schema. For instance "nms:recipient"
1592
+ | **isTemporaryTable** | Returns a boolean indicating whether the table is a temporary table. The table will not be created during database creation.
1470
1593
  | **unbound** | Returns a boolean which indicates whether the current node has an unlimited number of children of the same type.
1471
1594
  | **joins** | Element of type "link" has an array of XtkJoin. See `joinNodes` method.
1472
1595
  | **label** | The label (i.e. human readable, localised) name of the node.
1473
1596
  | **name** | The name of the node (internal name)
1474
- | **nodePath** | The absolute full path of the node
1475
- | **parent** | The parent node. Will be null for schema nodes
1597
+ | **nodePath** | The xpath of the node
1598
+ | **parent** | The parent node (a `XtkSchemaNode` object). Will be null for schema nodes
1476
1599
  | **PKSequence** | Returns a character string that provides the name of the sequence to use for the primary key.
1477
1600
  | **packageStatus** | Returns a number that gives the package status.
1478
1601
  | **packageStatusString** | Returns a string that gives the package status ("never", "always", "default", or "preCreate").
@@ -1480,17 +1603,28 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1480
1603
  | **SQLName** | The SQL name of the field. The property is an empty string if the object isn't an SQL type field.
1481
1604
  | **SQLTable** | The SQL name of the table. The property is an empty string if the object isn't the main element or if schema mapping isn't of SQL type.
1482
1605
  | **size** | For string nodes, the maximum length of the node value. Alias to `length`.
1483
- | **length** | For string nodes, the maximum length of the node value
1606
+ | **length** | For string nodes, the maximum length of the node value. Alias to `size`.
1484
1607
  | **target** | A string corresponding to the target of a link. Note that in the SDK, this is a string, whereas in the JS API, this is the actual target node. Because the SDK is async. Use `linkTarget` to get the target node of a link.
1485
1608
  | **type** | The data type of the node, for instance "string", "long", etc.
1486
1609
  | **userEnumeration** | Returns a string of characters which is the name of the user enumeration used by the current node.
1487
1610
  | **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.
1488
1611
  | **isMappedAsXml** | Is the field mapped as XML?
1489
1612
 
1613
+
1614
+
1490
1615
  | Method | Description |
1491
1616
  |---|---|
1492
- | **hasChild**(name) | | Tests if the node has a child wih the given name
1493
- | **findNode**(path) | Find a child node using a xpath
1617
+ | async **findNode** | Find a child node using a xpath. This function follows links and references if necessary and will dynamically fetch/cache necessary schemas.
1618
+ | async **refTarget** | Get the target node of a reference
1619
+ | async **linkTarget** | Get the target node of a link. See `target`
1620
+ | async **joinNodes** | Get the schema nodes corresponding to link. The function returns nodes for both the source and the destination of the link. See `joins`.
1621
+ | async **reverseLink** | Returns the node corresponding to the reverse link of a link. See `revLink` to get the reverse link name rather than the actual node
1622
+ | async **computeString** | Returns the compute string of a node, following references if necessary
1623
+ | async **enumeration** | For nodes whose value is an enumeration, return the `XtkEnumeration` object corresponding to the enumeration definition. See `enum` property to get the enumeration name instead of the object
1624
+ | **firstInternalKeyDef** |
1625
+ | **firstExternalKeyDef** |
1626
+ | **firstKeyDef** |
1627
+
1494
1628
 
1495
1629
 
1496
1630
  ### XtkSchemaKey
@@ -1503,7 +1637,7 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1503
1637
  | **description** | A long, human readable, description of the key
1504
1638
  | **isInternal** | Indicates if the key is an internal key (as opposed to an external key)
1505
1639
  | **allowEmptyPart** |
1506
- | **fields** | A map of key fields making up the key. Each value is a reference to a `XtkSchemaNode`
1640
+ | **fields** | A ArrayMap of key fields making up the key. Each value is a reference to a `XtkSchemaNode`
1507
1641
 
1508
1642
  ### XtkEnumeration
1509
1643
 
@@ -1515,7 +1649,7 @@ A schema is also a `XtkSchemaNode` and the corresponding properties/methods are
1515
1649
  | **baseType** | The base type of the enumeration, usually "string" or "byte"
1516
1650
  | **default** | The default value of the enumeration, casted to the enumeration type
1517
1651
  | **hasImage** | If the enumeration has an image
1518
- | **values** | A map of enumeration values, by name of value. Value is of type `XtkEnumerationValue`
1652
+ | **values** | A ArrayMap of enumeration values, of type `XtkEnumerationValue`
1519
1653
 
1520
1654
  ### XtkEnumerationValue
1521
1655
 
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.1.2",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@adobe/acc-js-sdk",
9
- "version": "1.0.8",
9
+ "version": "1.1.2",
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.0.9",
3
+ "version": "1.1.2",
4
4
  "description": "ACC Javascript SDK",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/adobe/acc-js-sdk#readme",