@adobe/acc-js-sdk 1.1.28 → 1.1.29

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.
@@ -3,6 +3,13 @@ layout: page
3
3
  title: Change Log
4
4
  ---
5
5
 
6
+ <section class="changelog"><h1>Version 1.1.29</h1>
7
+ <h2>2023/06/15</h2>
8
+ <li>
9
+ Passing pushdown options to observability layer
10
+ </li>
11
+ </section>
12
+
6
13
  <section class="changelog"><h1>Version 1.1.28</h1>
7
14
  <h2>2023/06/09</h2>
8
15
  <li>
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.28",
3
+ "version": "1.1.29",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@adobe/acc-js-sdk",
9
- "version": "1.1.28",
9
+ "version": "1.1.29",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "axios": "^1.2.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.28",
3
+ "version": "1.1.29",
4
4
  "description": "ACC Javascript SDK",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/adobe/acc-js-sdk#readme",
package/src/client.js CHANGED
@@ -911,7 +911,7 @@ class Client {
911
911
  this._observers.map((observer) => callback(observer));
912
912
  }
913
913
 
914
- _trackEvent(eventName, parentEvent, payload) {
914
+ _trackEvent(eventName, parentEvent, payload, pushDownOptions) {
915
915
  try {
916
916
  if (payload && payload.name === 'CampaignException') {
917
917
  payload = {
@@ -933,6 +933,9 @@ class Client {
933
933
  payload: payload,
934
934
  timestamp: now,
935
935
  };
936
+ if (pushDownOptions) {
937
+ event.pushDownOptions = pushDownOptions;
938
+ }
936
939
  if (parentEvent) event.parentEventId = parentEvent.eventId;
937
940
  this._notifyObservers((observer) => observer.event && observer.event(event, parentEvent));
938
941
 
@@ -1046,6 +1049,7 @@ class Client {
1046
1049
  if (this._traceAPICalls) {
1047
1050
  console.log(`RETRY SOAP//request ${safeCallData}`);
1048
1051
  }
1052
+ const pushDownOptions = soapCall._pushDownOptions;
1049
1053
  const event = this._trackEvent('SOAP//request', undefined, {
1050
1054
  urn: soapCall.urn,
1051
1055
  methodName: soapCall.methodName,
@@ -1053,16 +1057,16 @@ class Client {
1053
1057
  retry: true,
1054
1058
  retryCount: soapCall._retryCount,
1055
1059
  safeCallData: safeCallData,
1056
- });
1060
+ }, pushDownOptions);
1057
1061
  try {
1058
1062
  await soapCall.execute();
1059
1063
  const safeCallResponse = Util.trim(soapCall.response);
1060
1064
  if (this._traceAPICalls) {
1061
1065
  console.log(`SOAP//response ${safeCallResponse}`);
1062
1066
  }
1063
- this._trackEvent('SOAP//response', event, { safeCallResponse: safeCallResponse });
1067
+ this._trackEvent('SOAP//response', event, { safeCallResponse: safeCallResponse }, pushDownOptions);
1064
1068
  } catch(error) {
1065
- this._trackEvent('SOAP//failure', event, error);
1069
+ this._trackEvent('SOAP//failure', event, error, pushDownOptions);
1066
1070
  throw error;
1067
1071
  }
1068
1072
  return;
@@ -1314,6 +1318,7 @@ class Client {
1314
1318
  console.log(`SOAP//request ${safeCallData}`);
1315
1319
  that._notifyObservers((observer) => observer.onSOAPCall && observer.onSOAPCall(soapCall, safeCallData) );
1316
1320
 
1321
+ const pushDownOptions = soapCall._pushDownOptions;
1317
1322
  const event = this._trackEvent('SOAP//request', undefined, {
1318
1323
  urn: soapCall.urn,
1319
1324
  methodName: soapCall.methodName,
@@ -1321,21 +1326,21 @@ class Client {
1321
1326
  retry: false,
1322
1327
  retryCount: soapCall._retryCount,
1323
1328
  safeCallData: safeCallData,
1324
- });
1329
+ }, pushDownOptions);
1325
1330
  return soapCall.execute()
1326
1331
  .then(() => {
1327
1332
  const safeCallResponse = Util.trim(soapCall.response);
1328
1333
  if (that._traceAPICalls)
1329
1334
  console.log(`SOAP//response ${safeCallResponse}`);
1330
1335
  that._notifyObservers((observer) => observer.onSOAPCallSuccess && observer.onSOAPCallSuccess(soapCall, safeCallResponse) );
1331
- this._trackEvent('SOAP//response', event, { safeCallResponse: safeCallResponse });
1336
+ this._trackEvent('SOAP//response', event, { safeCallResponse: safeCallResponse }, pushDownOptions);
1332
1337
  return Promise.resolve();
1333
1338
  })
1334
1339
  .catch((ex) => {
1335
1340
  if (that._traceAPICalls)
1336
1341
  console.log(`SOAP//failure ${ex.toString()}`);
1337
1342
  that._notifyObservers((observer) => observer.onSOAPCallFailure && observer.onSOAPCallFailure(soapCall, ex) );
1338
- this._trackEvent('SOAP//failure', event, ex);
1343
+ this._trackEvent('SOAP//failure', event, ex, pushDownOptions);
1339
1344
  // Call session expiration callback in case of 401
1340
1345
  if (ex.statusCode == 401 && that._refreshClient && soapCall.retry) {
1341
1346
  return this._retrySoapCall(soapCall);
@@ -1680,7 +1685,7 @@ class Client {
1680
1685
  * @private
1681
1686
  * @deprecated since version 1.0.0
1682
1687
  */
1683
- async _getSecretKeyCipher() {
1688
+ async _getSecretKeyCipher() {
1684
1689
  var that = this;
1685
1690
  if (this._secretKeyCipher) return this._secretKeyCipher;
1686
1691
  return that.getOption("XtkSecretKey").then(function(secretKey) {
@@ -1701,7 +1706,7 @@ class Client {
1701
1706
  * @param {boolean} internal indicates an "internal" call, i.e. a call performed by the SDK itself rather than the user of the SDK. For instance, the SDK will dynamically load schemas to find method definitions
1702
1707
  * @return {XML.XtkObject} A DOM or JSON representation of the entity, or null if the entity is not found
1703
1708
  */
1704
- async getEntityIfMoreRecent(entityType, fullName, representation, internal) {
1709
+ async getEntityIfMoreRecent(entityType, fullName, representation, internal) {
1705
1710
  const soapCall = this._prepareSoapCall("xtk:persist", "GetEntityIfMoreRecent", true, internal, this._connectionParameters._options.extraHttpHeaders);
1706
1711
  const inputParams = [
1707
1712
  { name: "pk", type: "string", value: entityType + "|" + fullName },
@@ -2080,7 +2085,7 @@ class Client {
2080
2085
  const result = this._toRepresentation(xml, representation);
2081
2086
  return result;
2082
2087
  } catch(ex) {
2083
- throw CampaignException.REPORT_FETCH_FAILED(callContext.reportName, ex);
2088
+ throw CampaignException.REPORT_FETCH_FAILED(callContext.reportName, ex);
2084
2089
  }
2085
2090
  }
2086
2091