@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.
Files changed (88) hide show
  1. package/README.md +8 -1960
  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 +843 -5820
  72. package/package.json +1 -1
  73. package/samples/005 - basics - persist.js +160 -0
  74. package/src/application.js +5 -0
  75. package/src/campaign.js +1 -1
  76. package/src/client.js +68 -25
  77. package/src/methodCache.js +24 -13
  78. package/src/soap.js +16 -4
  79. package/src/xtkCaster.js +61 -3
  80. package/test/application.test.js +23 -0
  81. package/test/caches.test.js +1 -1
  82. package/test/client.test.js +118 -3
  83. package/test/mock.js +41 -4
  84. package/test/soap.test.js +13 -0
  85. package/test/xtkCaster.test.js +62 -0
  86. package/test/xtkPersist.test.js +97 -0
  87. package/test/xtkProxy.test.js +81 -0
  88. package/CHANGELOG.md +0 -245
package/CHANGELOG.md DELETED
@@ -1,245 +0,0 @@
1
- # Adobe Campaign Classic (ACC) SDK in JavaScript (node.js and browser)
2
-
3
- This is a node.js SDK for Campaign API. It exposes the Campaign API exactly like it is used inside Campaign using the NLWS notation.
4
-
5
-
6
- # Changelog
7
-
8
- ## Version 1.1.9
9
- _2022/10/11_
10
-
11
- * Added support for schema visibleIf attribute
12
-
13
- ## Version 1.1.8
14
- _2022/10/03_
15
-
16
- * Added translation ids (`labelLocalizationId`,`descriptionLocalizationId`, `labelSingularLocalizationId`) for `XtkSchema`, `XtkSchemaNode`, `XtkEnumerationValue` and `XtkEnumeration`
17
-
18
- ## Version 1.1.7
19
- _2022/08/30_
20
-
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.
22
- * Experimental file upload feature. Will require server-side changes to work, and is currently limited to be used with browsers only.
23
-
24
- ## Version 1.1.6
25
- _2022/08/19_
26
-
27
- * New auto-refresh mechanism to keep schemas and option caches up-to-date. See `client.startRefreshCaches` and `client.stopRefreshCaches` functions.
28
-
29
- ## Version 1.1.5
30
- _2022/07/07_
31
-
32
- * The SOAP method name was not showing up properly in the Chrome console
33
-
34
- ## Version 1.1.4
35
- _2022/07/07_
36
-
37
- * Added `application.version` which returns the server version in the format major.minor.servicePack (ex: 8.2.10)
38
- * Added the ability to push down parameters to the SOAP and transport layers. See the pushDown section of the readme file.
39
- * The pushDown mechanism can be used to simply overwrite the request timeout, either globally or at the method level
40
- * Publicly export the HttpError class so that custom transports can be written more safely. A failure during transport should return an HttpError object
41
- * By default, the SOAP method name is now added in the URLs for better troubleshooting
42
-
43
- ## Version 1.1.3
44
- _2022/05/30_
45
-
46
- * Fix a bug in client.hasPackage which was returning an incorrect result when passed a single parameter (it would always return false). Fixed the corresponding unit test too.
47
- * Fix a bug causing API calls having a input parameter of type "int" to fail. Usually the type is described as "long", but sometimes "int" is used instead, such as, for instance, in the nms:extAccount#UpdateMCSynchWkf method.
48
- * When using XML representations and DOMDocument method parameter type, the SDK expects to be passed an actual DOM document. Now it supports being passed a DOM element too. This is a common case when using the nms:delivery#createFromModel API followed by a xtk:session#Write API call.
49
- * Avoid the error 'Cannot transform entity to xml because no XML root name was given' by using SOAP method parameter name as the default for XML document root when no other root is available
50
- * Document how to set the password of an external account
51
- * By default, SDK will send additional HTTP headers to help troubleshooting and usage tracking
52
- * Add the ability to pass extra HTTP headers to API calls, either globally (to all HTTP headers), or locally, i.e. for a specific method
53
- * Remove .vscode folder from the sources
54
- * Example for xtkBuilder.installPackage API
55
- * For APIs which have parameters of type DOMElement and which are called using XML, support passing either a DOMElement or a DOMDocument
56
-
57
-
58
- ## Version 1.1.2
59
- _2022/03/22_
60
-
61
- * Add support for choosing the representation (XML or JSON) at the method level using NLWS.xml or NLWS.json.
62
-
63
- ## Version 1.1.1
64
- _2022/03/10_
65
-
66
- * Fixed an issue with encoding: make the default charset encoding to be UTF-8 (https://github.com/adobe/acc-js-sdk/issues/26)
67
-
68
- ## Version 1.1.0
69
- _2022/03/05_
70
-
71
- 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.
72
-
73
- Differences are document in the `Application` section of the README.
74
-
75
- * Provide array and map access to XtkSchemaKey.fields,
76
- * 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
77
- * New application.getEnumeration function to retreive an enumeration
78
- * Removed the XtkSchemaNode.hasChild function
79
- * Support for ref nodes and links: XtkSchemaNode.refTarget(), XtkSchemaNode.linkTarget() functions
80
- * Reviews XtkSchemaNode.findNode() function to support links, refs, ANY type, etc. and is now asynchronous
81
- * The name attribute of enumerations (`XtkEnumeration.name`) is now the fully qualified name of the enumeration, i.e. is prefixed by the schema id
82
-
83
- ## Version 1.0.9
84
- _2022/03/02_
85
-
86
- * Ability to invoke SOAP calls dynamically with parameters computed at invocation time by a delegate function
87
- * Fixed bug in XPath constructor which now supports expanded paths, i.e. xpaths such as `[@recipient-id]`.
88
- * EntityAccessor: change the heuristic to detect XML types: use "nodeType" and "tagName" functions instead of "insertAdjacentElement" (which was not always working in the context of a React application)
89
- * Add new escaping functions: `escapeForLike`, `expandXPath`, `unexpandXPath`, `xtkConstText`
90
- * New XtkCaster methods: `asDatetime` (alias to `asTimestamp`), `isStringType`, and `isNumericType`
91
- * Metadata API (application.getSchema)
92
- * keys have a `isInternal` internal attribute which was mistakenly using the "string" type. It's now correctly using the boolean type.
93
- * Added missing attributes on the XtkSchema: md5
94
- * Added missing attributes on the XtkSchemaNode objects: dataPolicy, editType folderModel, enumerationImage, size, userEnumeration, hasUserEnumeration, isCollection,
95
- isAdvanced, isAnyType, isLink, hasEnumeration, hasSQLTable, SQLName, SQLTable, isMappedAsXML, isTemporaryTable, isElementOnly, isDefaultOnDuplicate, isExternalJoin,
96
- isMemo, isMemoData, isBlob, isCDATA, isNotNull, isRequired, isSQL, PKSequence, revLink, isCalculated, expr, isAutoIncrement, isAutoPK, isAutoUUID, isAutoStg, packageStatusString, and packageStatus
97
- * Attribute type defaults to string if not set
98
- * Removed userDescription attribut from schema nodes (only available at the schema level)
99
- * Changed the toString function to use 4 spaces instead of 3 for indentation and display node label and internal name
100
- * When label or description is missing from schema nodes or from enumerations, they default to the name value
101
- * application.getSchema now uses a in-memory cache
102
-
103
- For breaking changes see the [migration guide](MIGRATION.md)
104
-
105
-
106
- ## Version 1.0.7
107
- _2022/01/24_
108
- * Added a hook `refreshClient` on connection parameters. This is a callback called when an authentication token expires. It can be used to implement reconnection logic
109
- * New attributes on the schema API (application.getSchema)
110
- * The `enum` attribute of a schema node returns the corresponding enum attribute, i.e. the enumeration name
111
- * The `target` attribute of a schema node (of type link) returns the target (schema id) of the link
112
- * The `integrity` attribute of a schema node (of type link) returns the link integrity ("define", "own", etc.)
113
- * Added a github workflow for code analysis (CodeQL) to detect more potential issues before release
114
- * Upgrade dependencies to fix some vulnerabilities
115
- * Add new conversion functions in XtkCaster to support for int, timespan, uuid, html and blob
116
-
117
- ## Version 1.0.6
118
- _2021/11/03_
119
- * New ofBearerToken authentication for IMS access token
120
- * Fix a small issue in the compile script which did not create the dist folder if it was missing
121
- * Fix an intermittent bug when running the SDK in the browser and when using local storage cache. The schema cache and method cache
122
- should contain XML representation of Campaign schemas and methods. Before it is put in local storage, data needs to be serialized
123
- as text. This was only working of JavaScript objects, but DOM elements were not being serialied causing various errors when
124
- using the cache later
125
-
126
- ## Version 1.0.5
127
- _2021/10/09_
128
- * Fix an issue in the logon() function which was not always returning a promise. Some authentication methods such as SessionToken we returning synchronously. Made it so that logon always returns a promise. This should not be a breaking change as logon does not actually return a value
129
- * Refactor caches (Options cache, Schemas cache, and Methods cache) to use a generic cache class
130
- * Make sure options parameter of ConnectionParameters constructor is not modified
131
- * Added a persistent cache for schemas, methods, and options using the browser localStorage by default
132
- * Make sure X-Security-Token header is hidden as well as session token cookies
133
- * Added jshint configuration and fixed warnings reported by jshint
134
- * Fixed vulnerability in ansi-regex; upgrade jest-junit to version 13 to fix
135
- * Small jsdoc improvements
136
-
137
- ## Version 1.0.4
138
- _2021/10/07_
139
- * Fix a bug which caused XML text and cdata elements to be skipped during SimpleJson transformation
140
- * Make sure passwords are not logged (replace with "***") when activating traces
141
-
142
- ## Version 1.0.3
143
- _2021/10/06_
144
- * Added the `sdk.ip()` function to retreive the ouptbound IP to be whitelisted to access Campaign
145
- * New `ofSecurityToken` authentication method for the client-side SDK, which can be used to log on with a security token only. The session token will be passed automatically by the browser.
146
-
147
- ## Version 1.0.2
148
- _2021/09/17_
149
- * Dummy version to fix NPM build. Need to have the version in both package.json and a commit message to be "Release x.y.z" in master
150
-
151
- ## Version 1.0.1
152
- _2021/09/16_
153
- * Dummy version to fix NPM build
154
-
155
- ## Version 1.0.0
156
- _2021/09/16_
157
- * Support for a simpler flavor of JSON (see SimpleJson vs. BadgerFish) which is now the default
158
- * New `EntityAccessor` object to access entity properties regardless of their representation
159
- * Finalize the implementation to support int64
160
- * Add 100% coverage for all tests
161
- * Make some members of the Client object private to clarify what is the public API
162
- * Fixed bug in JSON serialization for XML elments having an attribute named "length" (see `isArray` utility)
163
- * New `application` object to mimic the public SDK (can be accessed via `client.application`)
164
- * New schema API (`application.getSchema`) to easily navigate schemas
165
- * New Campaign enumeration constants (`campaign.js`) for better readability of code using numerical enumeration values
166
- * BadgerFish objects now have a `__representation = "BadgerFish"` attribute to easily distinguish between BadgerFish & SimpleJson
167
- * Logon will fail if server returns a payload which does not contain a `userInfo` object
168
- * New `setOption` function which allows to set (and cache) an option value
169
- * Deprecated the `getSecretKeyCipher` function which may fail on instances where Vault is setup. Use `ConnectionParameters.ofExternalAccount` instead
170
- * `getEntityIfMoreRecent` now takes an additional parameter which allows to specify and force a representation (xml, json...)
171
- * New helper function `DomUtil.isArray` to test if a JavaScript object is an array
172
- * New `EntityAccessor` object which allows to get attributes and child elements from xml or json objects, regardless of their representation
173
- * New `escapeXtk` function to escape litteral values in Xtk expression. Can be used as a function or as a tagged template litteral
174
- * New function `XtkCaster._variantStorageAttribute` which returns the name of a schema attribute used to store variant value types. The name of the attribute depends on the type: stringValue, longValue, etc.
175
- * Support for non static method that mutate the object on which they apply. For instance, the xtk:queryDef#SelectAll
176
- * Added samples in the samples/ folder
177
- * Support of logon with session token only with sdk.ConnectionParameters.ofSessionToken
178
- * Error management. Return a proper CampaignException upon failure with attributes that can be used to retreive error details (both http and soap)
179
- * Message Center API and examples
180
- * Added support for anonymous authentication via the "ofAnonymousUser" credentials function
181
- * Implement SDK functions for /r/test, /nl/jsp/ping.jsp, nl/jsp/mcPing.jsp (health check functions)
182
- * All HTTP request now add a user agent string identifying the SDK and it's version
183
- * CampaignException has been improved to report errors on both SOAP and HTTP requests. It's now defined in `campaign.js`
184
- * Added full jsdoc documentation of the SDK (run with `npm run jsdoc`). Result is saved in the `doc/jsdoc` folder
185
- * Use "strict" mode
186
- * Use E6 classes instead of prototype based inheritance
187
- * Using `axios` as the default protocol instead of `request-promise-native` which is deprecated
188
- * Added the notion of observer that can be called on any SOAP or HTTP request
189
- * SOAP calls now have an "internal" flag, which indicates if the SOAP calls comes from the framework itself (for example, the framework will load schemas) or from a client app
190
- * All session and security tokens are removed from logs
191
- * Moved to DomUtil.isArray helper function to a new Utils package (internal)
192
- * Fixed many tests which were not executed corresctly (assertion was not executed, leading to think the test was successful)
193
- * Fixed CVE-2021-23343 in dependencies
194
-
195
- _Breaking changes in 1.0.0_
196
- * The default representation is now `SimpleJson` instead of `BadgerFish`
197
- * Changes in the `sdk.init`, `Client` constructor, and `logon` functions. Now using `ConnectionParameters` and `Credentials` objects to configure a Campaign connection
198
- * Client object members are now private: access to representation, etc. attributes is not allowed anymore except for `NLWS`, `XtkCaster`, and `DomUtil`
199
- * Access to the `sessionInfo` object after `logon` can be done via the new `getSessionInfo` call
200
- * Options cache internal strucutre change: option values in the cache are now object litterals containing the option value, type, and raw value (which may not be casted to the expected type yet)
201
- * Connecting to mid-sourcing (or other Campaign instances which are defined by an external account) is now done with the `ConnectionParameters.ofExternalAccount` function. As a consequence, `getSecretKeyCipher` is now private and deprecated
202
- * CampaignException object signature changed (but was not previously exposed)
203
- * The client-side bundle is now generated in the `dist/bundle.js` file instead of `bundle.js``
204
- * The main global object for the client SDK is now `document.accSDK` and not `accSDK`
205
- * The client.traceSOAPCalls() function is now named client.traceAPICalls because it traces both SOAP and HTTP calls
206
-
207
- ---
208
-
209
- ## Version 0.1.24
210
- _2021/09/16_
211
- * Fix potential security vulnerabilities in the dependencies
212
-
213
- ## Versin 0.1.23
214
- _2021/07/27_
215
- * Support for int64 type (represented as a string to avoid rounding errors)
216
- * Fix issue with the SoapAction header for interface methods. When calling a method which is defined on an interface (for instance xtk:persist), the SoapAction
217
- header must use the interface id and not the schema id. For instance, when one calls the xtk:session Write method, one should call NLWS.xtkSession.Write, but
218
- the SoapAction header must be "xtk:persist#Write" and not "xtk:session#Write" for the call to complete successfully. In older SDK versions, one had to call
219
- NLWS.xtkPersist.Write which would only work if the xtk:persist interface schema was cached before. As there's no xtk:schema entity for the interfaces, the only
220
- way to cache such an interface is to have previously called a method on xtk:session. This call will indirectly cache the xtk:session schema and its interfaces,
221
- hence xtk:persist. From SDK 0.1.23 on, while the previous (incorrect) syntax NLWS.xtkPersist.Write still works, it's recommended to use NLWS.xtkSession.Write
222
- * Upgrade 3rd parties (browserslist, hosted-git-info, lodash, ws) to fix vulnerabilities
223
-
224
- ## Version 0.1.22
225
- _2021/02/23_
226
- * Update node-notifier library (used by jest) to version 8.0.1 to fix a possible injection
227
-
228
- ### Version 0.1.20
229
- Add client.hasPackage function to test if a package is installed or an instance or not (https://github.com/adobe/acc-js-sdk/issues/5)
230
-
231
- ### Version 0.1.3
232
- Bug fixes
233
- * Query returning empty result should return null when getIfExists operation, should fail when using get operation, and should return an empty array with select operation (https://github.com/adobe/acc-js-sdk/issues/3)
234
-
235
- ### Version 0.1.2
236
- * Use github action to automatically publish to npm when one pushes a commit with the message "Release 1.2.3"
237
-
238
- ### Version 0.1.1
239
- Bug fixes
240
- * Query in select mode should always return an array, even if result is empty or one one row (https://github.com/adobe/acc-js-sdk/issues/1)
241
-
242
-
243
- ### Version 0.1.0
244
- Initial version
245
-