@adobe/acc-js-sdk 1.1.43 → 1.1.45

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.
@@ -291,6 +291,8 @@ const root = await node.linkTarget();
291
291
  <tr><td><b>belongsTo</b></td><td>For attribute and elements, indicates the schema id in which they were defined. Since version 1.1.10 of the SDK</td></tr>
292
292
  <tr><td><b>default</b></td><td>Default value if any. Can be an array for collections. Since version 1.1.24 of the SDK</td></tr>
293
293
  <tr><td><b>translatedDefault</b></td><td>Default value if any. Since version 1.1.24 of the SDK</td></tr>
294
+ <tr><td><b>ordered</b></td><td>If children are ordered</td></tr>
295
+ <tr><td><b>doesNotSupportDiff</b></td><td>If returning the whole node when comparing difference</td></tr>
294
296
  </tbody>
295
297
  </table>
296
298
 
@@ -2,6 +2,27 @@
2
2
  layout: page
3
3
  title: Change Log
4
4
  ---
5
+ <section class="changelog"><h1>Version 1.1.45</h1>
6
+ <h2>2024/01/15</h2>
7
+ <li>
8
+ Update follow-redirects 3rd party to fix a potential vulnerability
9
+ </li>
10
+ <li>
11
+ Calling non-static, non-const, and non-pkonly methods would fail with a parameter type mismatch error.
12
+ The reason is that the entity returned by such methods is named &lt;this&gt; and not &lt;entity&gt;.
13
+ Note that const and non-pkonly methods are probably still not handled properly by the SDK.
14
+ </li>
15
+ </section>
16
+
17
+
18
+ <section class="changelog"><h1>Version 1.1.44</h1>
19
+ <h2>2024/01/02</h2>
20
+ <li>
21
+ Add the "ordered" and "doesNotSupportDiff" attributes to the nodes in the application object
22
+ </li>
23
+ </section>
24
+
25
+
5
26
  <section class="changelog"><h1>Version 1.1.43</h1>
6
27
  <h2>2023/12/21</h2>
7
28
  <li>
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@adobe/acc-js-sdk",
9
- "version": "1.1.43",
9
+ "version": "1.1.45",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "axios": "^1.2.1",
@@ -2219,14 +2219,15 @@
2219
2219
  "license": "ISC"
2220
2220
  },
2221
2221
  "node_modules/follow-redirects": {
2222
- "version": "1.15.2",
2222
+ "version": "1.15.5",
2223
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
2224
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
2223
2225
  "funding": [
2224
2226
  {
2225
2227
  "type": "individual",
2226
2228
  "url": "https://github.com/sponsors/RubenVerborgh"
2227
2229
  }
2228
2230
  ],
2229
- "license": "MIT",
2230
2231
  "engines": {
2231
2232
  "node": ">=4.0"
2232
2233
  },
@@ -6185,7 +6186,9 @@
6185
6186
  "dev": true
6186
6187
  },
6187
6188
  "follow-redirects": {
6188
- "version": "1.15.2"
6189
+ "version": "1.15.5",
6190
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
6191
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw=="
6189
6192
  },
6190
6193
  "form-data": {
6191
6194
  "version": "4.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
4
4
  "description": "ACC Javascript SDK",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/adobe/acc-js-sdk#readme",
@@ -386,6 +386,12 @@ class XtkSchemaNode {
386
386
  */
387
387
  this.unbound = EntityAccessor.getAttributeAsBoolean(xml, "unbound");
388
388
 
389
+ /**
390
+ * If children are ordered
391
+ * @type {boolean}
392
+ */
393
+ this.ordered = EntityAccessor.getAttributeAsBoolean(xml, "ordered");
394
+
389
395
  /**
390
396
  * The expression controlling the visibility of the current node
391
397
  * @type {string}
@@ -410,6 +416,12 @@ class XtkSchemaNode {
410
416
  */
411
417
  this.isAdvanced = EntityAccessor.getAttributeAsBoolean(xml, "advanced");
412
418
 
419
+ /**
420
+ * if returning the whole node when camparing difference
421
+ * @type {boolean}
422
+ */
423
+ this.doesNotSupportDiff = EntityAccessor.getAttributeAsBoolean(xml, "doesNotSupportDiff");
424
+
413
425
  /**
414
426
  * Children of the node. This is a object whose key are the names of the children nodes (without the "@"
415
427
  * character for attributes)
package/src/soap.js CHANGED
@@ -337,6 +337,7 @@ class SoapMethodCall {
337
337
  * In Campaign, non static SOAP calls may return an "entity" DOM Element, which corresponds to the object on which
338
338
  * the method is called. A good example is the xtk:queryDef#SelectAll API call: the method definition does not have
339
339
  * any return parameters, but it still returns an <entity> element contains the queryDef with all select nodes.
340
+ * When the method is implemented in JavaScript instead of C++, then the entity element will actually be named "this".
340
341
  *
341
342
  * @private
342
343
  * @returns the Entity DOM Element if there's one, or null if there isn't. The currentElement pointer will be updated accordingly
@@ -346,7 +347,7 @@ class SoapMethodCall {
346
347
  return null;
347
348
  if (this.elemCurrent.getAttribute("xsi:type") != "ns:Element")
348
349
  return null;
349
- if (this.elemCurrent.tagName != "entity")
350
+ if (this.elemCurrent.tagName != "entity" && this.elemCurrent.tagName != "this")
350
351
  return null;
351
352
  var entity = this.elemCurrent;
352
353
  entity = DomUtil.getFirstChildElement(entity);
@@ -3062,6 +3062,25 @@ describe('ACC Client', function () {
3062
3062
  // second parameter is the call context
3063
3063
  expect(paramsFn.mock.calls[0][1]).toMatchObject({ schemaId: "xtk:session", namespace: "xtkSession" });
3064
3064
  });
3065
+
3066
+ it("Should call non-static JS method", async() => {
3067
+ // Unlike C++ methods, non-static JS method return a this element which is named "this" and not "entity"
3068
+ const client = await Mock.makeClient();
3069
+ client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
3070
+ await client.NLWS.xtkSession.logon();
3071
+
3072
+ client._transport.mockReturnValueOnce(Mock.GET_DATCO_SCHEMA_RESPONSE);
3073
+ client._transport.mockReturnValueOnce(Mock.GET_DATCO_TEST_RESPONSE);
3074
+
3075
+ const dataModelDef = { "name": "testDataModel" };
3076
+ const dataModel = client.NLWS.dacoDataModel.create(dataModelDef);
3077
+ const res = await dataModel.test("hi from client");
3078
+
3079
+ expect(res).toBe("hi - hello from client");
3080
+
3081
+ client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
3082
+ await client.NLWS.xtkSession.logoff();
3083
+ });
3065
3084
  });
3066
3085
 
3067
3086
  describe("Method-level representation", () => {
package/test/mock.js CHANGED
@@ -983,6 +983,54 @@ const GETMODIFIEDENTITIES_ERROR_RESPONSE = Promise.resolve(`<?xml version='1.0'?
983
983
 
984
984
  const GET_DELIVERY_NEW_INSTANCE_RESPONSE = Promise.resolve(`<?xml version='1.0'?><SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:nms:delivery' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'><SOAP-ENV:Body><NewInstanceResponse xmlns='urn:nms:delivery' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><entity xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'><delivery _operation="insert" analysisStep="0" budgetStatus="0" builtIn="false" contentStatus="0" created="2022-09-26 03:13:36.480Z" createdBy-id="6043" deleteStatus="0" deliveryMode="0" deliveryProvider-id="1855" extractionStatus="0" folder-id="1186" folderProcess-id="1206" id="9790" internalName="DM554" isModel="1" jobType="delivery" keepResult="false" label="Email" lastModified="2022-09-26 03:13:36.480Z" launchFCP="0" mapping-id="1775" maxPropositionCount="1" messageType="0" modifiedBy-id="6043" outOfProcess="false" priority="10" sandboxStatus="0" state="0" status="0" targetStatus="0" typology-id="1852" useTargetOffers="false" xtkschema="nms:delivery"><folder _cs="Delivery templates"/><folderProcess _cs="Deliveries"/><createdBy _cs="Gaurav Makkar (gmakkar@adobe.com)"/><modifiedBy _cs="Gaurav Makkar (gmakkar@adobe.com)"/><properties deliveryState="0" warning="false"/><deliveryProvider EMailFunction="0" NChar="0" _cs="Internal email delivery" account="" activationMode="2" active="1" activity="signal" awsKey="" awsRegion="" awsSecret="" azureTenant="" callbackServer="" clientId="" clientSecret="" created="2022-09-16 07:39:50.796Z" createdBy-id="0" dbName="" deliveryMode="1" deployed="0" encryptionType="0" fdaExtAccount-id="0" fileMethod="uploadFile" folder-id="1035" folderSetOfServices-id="0" httpRelayTarget="false" id="1855" imsOrgId="" imsRightsMask="" imsServer="" label="Internal email delivery" lastModified="2022-09-16 07:42:37.469Z" lastMultiUsed="" messageType="0" mirrorURL="" mobileConnector="127" modifiedBy-id="1062" multiMidMode="0" multiMidProvider="0" name="defaultEmailBulk" oAuth="0" onEveryRun="0" packageAutoExport="0" partner="1" password="" port="" productContext="" provider="Snowflake" redirectUrl="" server="" tenant="" timezone="_server_" timezoneName="Europe/Paris" type="3" unicodeData="0" useServerSideEncryption="0" userScope=""><analyticsConfig integrationName="defaultEmailBulk" persistence="7" purge="180" status="3"></analyticsConfig><webAnalyticsParams partner="1" persistence="7" purge="180"><integrationDetails integrationName="defaultEmailBulk" integrationValue="7281015239823888aa73636c74217b84"></integrationDetails></webAnalyticsParams><params allowTranslit="false" bindTimeout="60" dataInOptionalField="false" dataInTextField="false" defaultMoCharset="X-Gsm7Bit" defaultMtCharset="X-Gsm7Bit" deliverIdEncode="default" deliverIdEncode2="0" enableTLS="false" enquireLinkPeriod="30" errorExtractionRegex="\\b[eE][rR][rR]:([a-zA-Z0-9]{3})\\b" errorStatusRegex="^(?:EXPIRED|DELETED|UNDELIV|UNKNOWN|REJECT)" idExtractionRegex="\\b[iI][dD]:([a-fA-F0-9]{1,10})\\b" invalidIdAckLimit="0" maxBinds="1" maxWindow="10" messagePayload="false" messageTimeout="30" rateLimit="0" reconnectPeriod="10" sendFullPhoneNumber="false" skipTLSCertCheck="0" smscName="Generic" statusExtractionRegex="\\b[sS][tT][aA][tT]:([a-zA-Z0-9]{5,15})\\b" submitRespIdEncode="default" submitRespIdEncode2="0" successStatusRegex="^DELIV"><wapPush oAuth="0"/><mms oAuth="0"/><oauthParams thirdPartyApplication="true"/><facebookParams marketingURL="http://www.adobe.com" realtimeSubStatus="0"/><mscrm crmApiVersion="'auto'" crmDeploymentType="webapi" crmGrantType="0"/><salesforce apiVersion="'21.0'"/></params><ffda isFFDA="0" replicationWarehouse="" xxlSchemaSuffix=""/></deliveryProvider><forecast simuResponseType="0" weight="5" weightType="0"><weightFormula>$(deliveryWeight)</weightFormula></forecast><volume duration="1" rate="100"/><scheduling delayExtraction="0" validationMode="manual" webResPurged="false"><waves mode="0" splitDelay="86400" splitSize="20%"/><messagePreparation priority="0"/></scheduling><validation sandboxMode="0" sandboxModeEnforced="0" useBudgetValidation="true" useContentValidation="true" useExtractionValidation="true" useFCPValidation="true" useTargetValidation="true" validationMode="0"><target><validation delay="259200" type="0"/></target><content><validation delay="259200" type="0"/></content><budget><validation delay="259200" type="0"/></budget><extraction><validation delay="259200" type="0"/></extraction><forecast><validation delay="259200" type="0"/></forecast><starting><validation delay="259200" type="0"/></starting><edition><validation delay="259200" type="0"/></edition><external><validation delay="259200" type="0"/></external></validation><execution maxPersoTime="5" maxRetry="5" retryPeriod="3600"><controlGroup type="3"/></execution><typology _cs="Default typology"/><mapping _cs="Recipients (nms:recipient)" blackListAgency="@blackList" blackListEmail="Iif(@blackList!=0, 1, @blackListEmail)" blackListFax="Iif(@blackList!=0, 1,@blackListFax)" blackListPaper="Iif(@blackList!=0, 1,@blackListPostalMail)" blackListPhone="Iif(@blackList!=0, 1,@blackListPhone)" blackListSms="Iif(@blackList!=0, 1,@blackListMobile)" builtIn="1" countryCode="[location/@countryCode]" created="2022-09-16 07:39:50.496Z" createdBy-id="0" defaultOrigin-id="1861" email="Lower(@email)" facebook="" fax="@fax" folder-id="1171" format="@emailFormat" id="1775" isFfda="0" label="Recipients" lastModified="2022-09-16 07:39:52.859Z" modifiedBy-id="0" name="mapRecipient" paper="postalAddress" phone="@phone" recipientLink="" schema="nms:recipient" sms="@mobilePhone" targetSchema="nms:recipient" twitter=""><storage broadLogExclSchema="nms:excludeLogRcp" broadLogFilterKeys="" broadLogRcpKeys="" broadLogSchema="nms:broadLogRcp" broadLogTable="" exclusionType="2" trackingHasDeviceIP="0" trackingLogFilterKeys="" trackingLogRcpKeys="" trackingLogSchema="nms:trackingLogRcp" trackingLogTable=""></storage><social birthDate="@birthDate" email="@email" firstName="@firstName" gender="@gender" lastName="@lastName" locale="@language"/></mapping><scenario validityDuration="432000" webValidityDuration="5184000"/><fcpParameters addFormatInPrefix="true" fcpMailFormat="normal" fcpMode="specificTarget" ignoreBlacklist="true" ignoreDeduplicate="true" ignoreQuarantaine="false" keepDeliveryCode="false" labelPrefix="Proof" useSpecificOutputFile="false"/><mailParameters mirrorPagePolicy="default" needMirrorPage="0" useDefaultErrorAddress="true"><senderName><![CDATA[Automation Inc.]]></senderName><senderAddress><![CDATA[no-reply@Customer.rd.campaign.adobe.com]]></senderAddress><replyAddress><![CDATA[no-reply@Customer.rd.campaign.adobe.com]]></replyAddress><replyName><![CDATA[Automation Inc.]]></replyName></mailParameters><smsParameters mobileMsgType="0" smsAppType="2" smsMode="1" smsPriority="0"/><paperParameters addressPos="ownPage" colorSupport="bw" envelope="C6SW" priceCategory="letterPrio" rectoVerso="recto"/><targets addressField="__db__" allowUnchecked="true" blackListField="__db__" deduplicate="true" excludeOnMissingOffer="0" externalIdField="__db__" formatField="__db__" fromExternalSource="false" maxErrorCount="3" noRcpIdDedup="false" noReconciliation="false" qualityRequired="3" segmentCodeField="__db__" targetMode="0" useBlackList="true" useQuality="1" useQuarantine="1"><deliveryTarget nonEmpty="false"/><proofTarget nonEmpty="false"/><deliveryFile autoDelete="false" upload="true"/><proofFile autoDelete="false" upload="true"/><postalAddress addrDefinedField="__none__" addrErrorCountField="__none__" addrLastCheckField="__none__" addrQualityField="__none__" line1Field="__db__" line2Field="__db__" line3Field="__db__" line4Field="__db__" line5Field="__db__" line6Field="__db__" line7Field="__db__"/></targets><remoteContent remoteValidation="false"/><content IsImagePublished="false" embedImages="false" fcbContentType="0" formatSelection="preferences" htmlCompression="false" ignoreScripts="false" pdfCompression="true" pdfType="simple"><lineContentType><source>text</source></lineContentType><lineVersion><source>line</source></lineVersion><lineDeliveryType><source>pushMsg</source></lineDeliveryType><lineImageType><source>manual</source></lineImageType><lineMultiRegionLayoutType><source>1</source></lineMultiRegionLayoutType></content><output enableLinkDelivery="true" feedbackMode="none"><seedList insertMode="0"/><extraction><source batchSize="200" format="text" rejectsFromTextConnector="false" startPath="/" upload="true"><dataSourceConfig codepage="1252" colType="0" ignoreConfigCheck="false" textQualifier="none" timezone="_inherit_" useCR="false" useLF="false"/><dataSourceConfigDest codepage="1252" colType="0" ignoreConfigCheck="false" textQualifier="none" timezone="_inherit_" useCR="false" useLF="false"/></source><destination downloadDestFile="true" endRecord="0" progressLines="20" putUnmappedCols="true" splitOverOrigin="false" startPath="/" startRecord="0" transactionLines="200"><exportFormat allAsString="false" analyze="false" codepage="1252" delEscaping="duplicateDel" delimitor="delNone" format="text" lineEnd="0" saveTitle="true" separator="sepTab" timezone="_inherit_"><dataFormat decimalCount="-1" hideTime="false" orderDate="ymd" sepDate="/" sepDateTime=" " sepNumber="." sepThousand="false" sepTime=":" showMs="false" showSec="true" yearShort="false"/></exportFormat></destination></extraction></output><tracking enabled="true" openEnabled="true"><clickFormula><![CDATA[<%@ include option='NmsTracking_ClickFormula' %>]]></clickFormula><openFormula><![CDATA[<%@ include option='NmsTracking_OpenFormula' %>]]></openFormula></tracking><advancedParameters DBPreparationMode="0" codepage="65001" emailArchiving="false" emailBCCEmta="false" forceCodepage="false" outOfProcessMode="false" showSQL="false" useDBPreparation="false" useDataManagement="false" verifyMode="false"/><budgetParameters commitmentLevel="0" computationState="0"/></delivery></entity></NewInstanceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>`);
985
985
 
986
+ const GET_DATCO_SCHEMA_RESPONSE = Promise.resolve(`<?xml version='1.0'?>
987
+ <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema'
988
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
989
+ xmlns:ns='urn:wpp:default'
990
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
991
+ <SOAP-ENV:Body>
992
+ <GetEntityIfMoreRecentResponse xmlns='urn:wpp:default' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
993
+ <pdomDoc xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
994
+ <schema entitySchema="xtk:schema" label="Data Models" labelSingular="Data Model" mappingType="sql" name="dataModel" namespace="daco" xtkschema="xtk:schema">
995
+ <element autopk="true" name="dataModel">
996
+ <compute-string expr="@id"/>
997
+ <key internal="true" name="id">
998
+ <keyfield xpath="@id"/>
999
+ </key>
1000
+ <attribute desc="Internal primary key" label="Primary key" name="id" sqlname="iDataModelId" type="long"/>
1001
+ <attribute label="Name" length="255" name="name" sqlname="sName" type="string"/>
1002
+ </element>
1003
+ <methods>
1004
+ <method library="daco:dataModel.js" name="test">
1005
+ <help>Test API</help>
1006
+ <parameters>
1007
+ <param desc="Message" inout="in" name="msg" type="string"/>
1008
+ <param desc="Response" inout="out" name="resp" type="string"/>
1009
+ </parameters>
1010
+ </method>
1011
+ </methods>
1012
+ </schema>
1013
+ </pdomDoc>
1014
+ </GetEntityIfMoreRecentResponse>
1015
+ </SOAP-ENV:Body>
1016
+ </SOAP-ENV:Envelope>`);
1017
+
1018
+ const GET_DATCO_TEST_RESPONSE = Promise.resolve(`<?xml version='1.0'?>
1019
+ <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema'
1020
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
1021
+ xmlns:ns='urn:daco:dataModel'
1022
+ xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
1023
+ <SOAP-ENV:Body>
1024
+ <testResponse xmlns='urn:daco:dataModel' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
1025
+ <this xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
1026
+ <dataModel name="testDataModel" xtkschema="daco:dataModel"/>
1027
+ </this>
1028
+ <resp xsi:type='xsd:string'>hi - hello from client</resp>
1029
+ </testResponse>
1030
+ </SOAP-ENV:Body>
1031
+ </SOAP-ENV:Envelope>
1032
+ `);
1033
+
986
1034
  // Public exports
987
1035
  exports.Mock = {
988
1036
  makeClient: makeClient,
@@ -1040,5 +1088,7 @@ exports.Mock = {
1040
1088
  FILE_RES_WRITE_RESPONSE: FILE_RES_WRITE_RESPONSE,
1041
1089
  PUBLISH_IF_NEEDED_RESPONSE: PUBLISH_IF_NEEDED_RESPONSE,
1042
1090
  GET_URL_RESPONSE: GET_URL_RESPONSE,
1043
- GET_DELIVERY_NEW_INSTANCE_RESPONSE: GET_DELIVERY_NEW_INSTANCE_RESPONSE
1091
+ GET_DELIVERY_NEW_INSTANCE_RESPONSE: GET_DELIVERY_NEW_INSTANCE_RESPONSE,
1092
+ GET_DATCO_SCHEMA_RESPONSE: GET_DATCO_SCHEMA_RESPONSE,
1093
+ GET_DATCO_TEST_RESPONSE: GET_DATCO_TEST_RESPONSE
1044
1094
  }