Repository: Accenture/sfmc-devtools (js)

Issue:
[BUG] error during retrieve of interaction fails entire download
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

if any api error occurs due to a single interaction, no interactions are stored at all.

### Expected Behavior

problems should be logged and the faulty records should then be skipped

### Steps To Reproduce

_No response_

### Version

4.3.0

### Environment

_No response_

### Participation

- [X] I am willing to submit a pull request for this issue.

### Additional comments

_No response_

Pull request description:
Bugfix/689 error during retrieve of interaction fails entire download + remove stats and outcomes from interaction
# PR details

## What is the purpose of this pull request? (put an "X" next to an item)

- [x] Bugfix
- fixes #689 

## What changes did you make? (Give an overview)

**before:**
![image](https://user-images.githubusercontent.com/1917227/216029271-9c14dc35-8515-409a-a8ae-86814de31ad6.png)

**after:**
![image](https://user-images.githubusercontent.com/1917227/216028756-cb30400a-e7f2-43f6-bac7-3d2a7df02b60.png)



## Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] test scripts updated
- n/a Wiki updated (if applicable)


Patch:
diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js
index 9565985e..cc031c2d 100644
--- a/lib/metadataTypes/Automation.js
+++ b/lib/metadataTypes/Automation.js
@@ -63,7 +63,7 @@ class Automation extends MetadataType {
                           }
                           // if we do get here, we should log the error and continue instead of failing to download all automations
                           Util.logger.error(
-                              ` - skipping retrieving Automation ${a.ObjectID}: ${ex.message} ${ex.code}`
+                              ` ☇ skipping Automation ${a.ObjectID}: ${ex.message} ${ex.code}`
                           );
                           return null;
                       }
diff --git a/lib/metadataTypes/Interaction.js b/lib/metadataTypes/Interaction.js
index a36cb9fb..7157723c 100644
--- a/lib/metadataTypes/Interaction.js
+++ b/lib/metadataTypes/Interaction.js
@@ -27,6 +27,7 @@ class Interaction extends MetadataType {
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise
      */
     static async retrieve(retrieveDir, _, __, key) {
+        const extrasDefault = 'activities';
         if (retrieveDir) {
             // only print this during retrieve, not during retrieveForCache
             Util.logBeta(this.definition.type);
@@ -59,17 +60,81 @@ class Interaction extends MetadataType {
             }
             /* eslint-enable unicorn/prefer-ternary */
         }
-        // full details for retrieve, only base data for caching; reduces caching time from minutes to seconds
-        const extras = retrieveDir ? 'all' : '';
 
         try {
-            return await super.retrieveREST(
-                retrieveDir,
-                `/interaction/v1/interactions/${singleKey}?extras=${extras}`,
-                null,
-                null,
-                key
-            );
+            const uri = `/interaction/v1/interactions/`;
+            if (singleKey || !retrieveDir) {
+                // full details for retrieve, only base data for caching; reduces caching time from minutes to seconds
+                const extras = retrieveDir && singleKey ? extrasDefault : '';
+
+                // caching or single retrieve
+                return await super.retrieveREST(
+                    retrieveDir,
+                    `${uri}${singleKey}?extras=${extras}`,
+                    null,
+                    null,
+                    key
+                );
+            } else {
+                // retrieve all
+                const results = this.definition.restPagination
+                    ? await this.client.rest.getBulk(uri, this.definition.restPageSize || 500)
+                    : await this.client.rest.get(uri);
+                // const results = this.parseResponseBody(response);
+                if (results.items?.length) {
+                    // empty results will come back without "items" defined
+                    Util.logger.info(
+                        Util.getGrayMsg(
+                            ` - ${results.items?.length} ${this.definition.type}s found. Retrieving details...`
+                        )
+                    );
+                }
+                // full details for retrieve
+                const extras = extrasDefault;
+
+                const details = results.items
+                    ? await Promise.all(
+                          results.items.map(async (a) => {
+                              try {
+                                  return await this.client.rest.get(
+                                      `${uri}key:${a[this.definition.keyField]}?extras=${extras}`
+                                  );
+                              } catch (ex) {
+                                  // if we do get here, we should log the error and continue instead of failing to download all automations
+                                  Util.logger.error(
+                                      ` ☇ skipping ${this.definition.type} ${
+                                          a[this.definition.nameField]
+                                      } (${a[this.definition.keyField]}): ${ex.message} (${
+                                          ex.code
+                                      })${
+                                          ex.endpoint
+                                              ? Util.getGrayMsg(
+                                                    ' - ' +
+                                                        ex.endpoint.split(
+                                                            'rest.marketingcloudapis.com'
+                                                        )[1]
+                                                )
+                                              : ''
+                                      }`
+                                  );
+                                  return null;
+                              }
+                          })
+                      )
+                    : [];
+                const parsed = this.parseResponseBody({ items: details.filter(Boolean) });
+
+                // * retrieveDir is mandatory in this method as it is not used for caching (there is a seperate method for that)
+                const savedMetadata = await this.saveResults(parsed, retrieveDir, null, null);
+                Util.logger.info(
+                    `Downloaded: ${this.definition.type} (${Object.keys(savedMetadata).length})` +
+                        Util.getKeysString(key)
+                );
+                return {
+                    metadata: parsed,
+                    type: this.definition.type,
+                };
+            }
         } catch (ex) {
             // if the interaction does not exist, the API returns an error code which would otherwise bring execution to a hold
             if (
diff --git a/lib/metadataTypes/definitions/Interaction.definition.js b/lib/metadataTypes/definitions/Interaction.definition.js
index 574da5c3..1afc769b 100644
--- a/lib/metadataTypes/definitions/Interaction.definition.js
+++ b/lib/metadataTypes/definitions/Interaction.definition.js
@@ -15,7 +15,7 @@ module.exports = {
     lastmodDateField: 'modifiedDate',
     lastmodNameField: null,
     restPagination: true,
-    restPageSize: 250,
+    restPageSize: 500,
     type: 'interaction',
     typeDescription: 'Journey (internally called "Interaction").',
     typeRetrieveByDefault: true,
diff --git a/lib/util/auth.js b/lib/util/auth.js
index d9aabe6b..1344531a 100644
--- a/lib/util/auth.js
+++ b/lib/util/auth.js
@@ -114,8 +114,13 @@ function setupSDK(sessionKey, authObject) {
                 );
                 Util.logger.errorStack(ex);
             },
-            // logRequest: (req) => console.log('request', req), // uncomment to log requests
-            // logResponse: (res) => console.log('response:', res), // uncomment to log responses
+            // logRequest: (req) =>
+            //     console.log(`${Util.color.fgMagenta}request${Util.color.reset}`, req), // uncomment to log requests
+            // logResponse: (res) =>
+            //     console.log(
+            //         `${Util.color.bgMagenta}response${Util.color.reset}:`,
+            //         typeof res.data == 'string' && res.data.length > 10000 ? res.data : res
+            //     ), // uncomment to log responses
         },
         requestAttempts: 4,
         retryOnConnectionError: true,
diff --git a/lib/util/util.js b/lib/util/util.js
index 016a986c..50aacad4 100644
--- a/lib/util/util.js
+++ b/lib/util/util.js
@@ -504,6 +504,31 @@ const Util = {
     color: {
         reset: '\x1B[0m',
         dim: '\x1B[2m',
+        bright: '\x1B[1m',
+        underscore: '\x1B[4m',
+        blink: '\x1B[5m',
+        reverse: '\x1B[7m',
+        hidden: '\x1B[8m',
+
+        fgBlack: '\x1B[30m',
+        fgRed: '\x1B[31m',
+        fgGreen: '\x1B[32m',
+        fgYellow: '\x1B[33m',
+        fgBlue: '\x1B[34m',
+        fgMagenta: '\x1B[35m',
+        fgCyan: '\x1B[36m',
+        fgWhite: '\x1B[37m',
+        fgGray: '\x1B[90m',
+
+        bgBlack: '\x1B[40m',
+        bgRed: '\x1B[41m',
+        bgGreen: '\x1B[42m',
+        bgYellow: '\x1B[43m',
+        bgBlue: '\x1B[44m',
+        bgMagenta: '\x1B[45m',
+        bgCyan: '\x1B[46m',
+        bgWhite: '\x1B[47m',
+        bgGray: '\x1B[100m',
     },
     /**
      * helper that wraps a message in the correct color codes to have them printed gray
diff --git a/package.json b/package.json
index acab6139..71bb9581 100644
--- a/package.json
+++ b/package.json
@@ -50,6 +50,7 @@
         "lint-test": "eslint test/**/*.js",
         "upgrade": "npm-check --update",
         "manual-prepare": "husky install",
+        "lint-and-test": "run-s lint test",
         "test": "mocha",
         "coverage": "nyc mocha",
         "version:major": "npm version --no-commit-hooks major",


Test patch:
diff --git a/test/interaction.test.js b/test/interaction.test.js
index 9e26c2f8..667d3b6a 100644
--- a/test/interaction.test.js
+++ b/test/interaction.test.js
@@ -33,7 +33,7 @@ describe('interaction', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                7,
+                9,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -114,7 +114,7 @@ describe('interaction', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                7,
+                9,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
diff --git a/test/resourceFactory.js b/test/resourceFactory.js
index 14bbc794..d7468791 100644
--- a/test/resourceFactory.js
+++ b/test/resourceFactory.js
@@ -1,6 +1,7 @@
 const fs = require('fs-extra');
 const path = require('node:path');
 const { XMLParser } = require('fast-xml-parser');
+const { color } = require('../lib/util/util');
 const parser = new XMLParser();
 const attributeParser = new XMLParser({ ignoreAttributes: false });
 /**
@@ -25,7 +26,11 @@ exports.loadSOAPRecords = async (mcdevAction, type, mid) => {
             encoding: 'utf8',
         });
     }
-    console.log(`error: Please create file ${testPath}`); // eslint-disable-line no-console
+    /* eslint-disable no-console */
+    console.log(
+        `${color.bgRed}${color.fgBlack}test-error${color.reset}: Please create file ${testPath}`
+    );
+    /* eslint-enable no-console */
 
     return fs.readFile(path.join('test', 'resources', mcdevAction + '-response.xml'), {
         encoding: 'utf8',
@@ -98,13 +103,15 @@ exports.handleRESTRequest = async (config) => {
         if (urlObj.searchParams.get('$filter')) {
             filterName = urlObj.searchParams.get('$filter').split(' eq ')[1];
         }
-        const testPath = path.join(
-            'test',
-            'resources',
-            config.headers.Authorization.replace('Bearer ', ''),
-            urlObj.pathname,
-            config.method + '-response.json'
-        );
+        const testPath = path
+            .join(
+                'test',
+                'resources',
+                config.headers.Authorization.replace('Bearer ', ''),
+                urlObj.pathname,
+                config.method + '-response.json'
+            )
+            .replace(':', '_'); // replace : with _ for Windows
 
         if (await fs.pathExists(testPath)) {
             // build filter logic to ensure templating works
@@ -126,7 +133,11 @@ exports.handleRESTRequest = async (config) => {
                 ];
             }
         } else {
-            console.log(`error: Please create file ${testPath}`); // eslint-disable-line no-console
+            /* eslint-disable no-console */
+            console.log(
+                `${color.bgRed}${color.fgBlack}test-error${color.reset}: Please create file ${testPath}`
+            );
+            /* eslint-enable no-console */
 
             return [
                 404,
diff --git a/test/resources/9999999/interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json
new file mode 100644
index 00000000..b3411e45
--- /dev/null
+++ b/test/resources/9999999/interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json
@@ -0,0 +1,219 @@
+{
+    "id": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be",
+    "key": "0b76dccf-594c-b6dc-1acf-10c4493dcb84",
+    "name": "testExisting_temail",
+    "lastPublishedDate": "0001-01-01T00:00:00",
+    "description": "",
+    "version": 1,
+    "workflowApiVersion": 1,
+    "createdDate": "2022-03-24T02:20:32.74",
+    "modifiedDate": "2022-03-24T02:20:40.45",
+    "activities": [
+        {
+            "id": "9606bcb0-9246-4610-9800-963bc77fc20a",
+            "key": "EMAILV2-4",
+            "name": "testExisting_temail",
+            "description": "",
+            "type": "EMAILV2",
+            "outcomes": [
+                {
+                    "key": "1f44021a-74ac-49be-a07c-67862228214d",
+                    "arguments": {},
+                    "metaData": {
+                        "invalid": false
+                    }
+                }
+            ],
+            "arguments": {},
+            "configurationArguments": {
+                "applicationExtensionKey": "jb-email-activity",
+                "isModified": true,
+                "triggeredSend": {
+                    "autoAddSubscribers": true,
+                    "autoUpdateSubscribers": true,
+                    "bccEmail": "",
+                    "ccEmail": "",
+                    "created": {},
+                    "domainExclusions": [],
+                    "dynamicEmailSubject": "test email",
+                    "emailId": 25923,
+                    "emailSubject": "test email",
+                    "exclusionFilter": "",
+                    "isSalesforceTracking": true,
+                    "isMultipart": true,
+                    "isSendLogging": false,
+                    "isStoppedOnJobError": false,
+                    "modified": {},
+                    "preHeader": "",
+                    "priority": 4,
+                    "sendClassificationId": "1284e9b2-a7b8-e711-80cf-1402ec721c9d",
+                    "throttleOpens": "1/1/0001 12:00:00 AM",
+                    "throttleCloses": "1/1/0001 12:00:00 AM",
+                    "deliveryProfileId": "1084e9b2-a7b8-e711-80cf-1402ec721c9d",
+                    "senderProfileId": "0f84e9b2-a7b8-e711-80cf-1402ec721c9d",
+                    "isTrackingClicks": true,
+                    "publicationListId": 15
+                },
+                "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b",
+                "triggeredSendKey": "testExisting_temail"
+            },
+            "metaData": {
+                "highThroughput": {
+                    "definitionKey": "testExisting_temail",
+                    "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7"
+                },
+                "sections": {},
+                "isConfigured": true
+            },
+            "schema": {
+                "arguments": {
+                    "requestID": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "Out",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "messageKey": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "Out",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "activityId": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "definitionId": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": true,
+                        "access": "Hidden"
+                    },
+                    "emailSubjectDataBound": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": true,
+                        "access": "Hidden"
+                    },
+                    "contactId": {
+                        "dataType": "Number",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "contactKey": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "emailAddress": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "sourceCustomObjectId": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "sourceCustomObjectKey": {
+                        "dataType": "LongNumber",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "fieldType": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "eventData": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "obfuscationProperties": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "customObjectKey": {
+                        "dataType": "LongNumber",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": true,
+                        "access": "Hidden"
+                    },
+                    "definitionInstanceId": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    }
+                }
+            }
+        }
+    ],
+    "triggers": [
+        {
+            "key": "TRIGGER",
+            "name": "TRIGGER",
+            "description": "",
+            "type": "transactional-api",
+            "outcomes": [],
+            "arguments": {},
+            "configurationArguments": {},
+            "metaData": {
+                "chainType": "none",
+                "configurationRequired": false,
+                "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg",
+                "title": "Transactional API Event",
+                "category": "Transactional",
+                "entrySourceGroupConfigUrl": "null"
+            }
+        }
+    ],
+    "goals": [],
+    "exits": [],
+    "notifiers": [],
+    "entryMode": "MultipleEntries",
+    "definitionType": "Transactional",
+    "channel": "email",
+    "defaults": {
+        "properties": {
+            "analyticsTracking": {
+                "enabled": false,
+                "analyticsType": "google",
+                "urlDomainsToTrack": []
+            }
+        }
+    },
+    "metaData": {},
+    "executionMode": "Production",
+    "categoryId": 6298,
+    "status": "Published",
+    "scheduledStatus": "Draft",
+    "definitionId": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be"
+}
diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json
new file mode 100644
index 00000000..d29bdfb1
--- /dev/null
+++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json
@@ -0,0 +1,280 @@
+{
+    "id": "233d4413-922c-4568-85a5-e5cc77efc3be",
+    "key": "testExisting_interaction",
+    "name": "testExisting_interaction",
+    "lastPublishedDate": "2017-04-12T08:07:48",
+    "description": "bla bla",
+    "version": 1,
+    "workflowApiVersion": 1,
+    "createdDate": "2017-04-12T05:38:05.837",
+    "modifiedDate": "2017-04-12T08:07:48.333",
+    "activities": [
+        {
+            "id": "69213026-bd2c-433b-8332-5f52d3e87ca5",
+            "key": "WAIT-1",
+            "name": "",
+            "description": "",
+            "type": "WAIT",
+            "outcomes": [
+                {
+                    "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b",
+                    "next": "DATAEXTENSIONUPDATE-1",
+                    "arguments": {},
+                    "metaData": {}
+                }
+            ],
+            "arguments": {
+                "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a",
+                "waitForEventId": "",
+                "executionMode": "{{Context.ExecutionMode}}",
+                "startActivityKey": "{{Context.StartActivityKey}}",
+                "waitQueueId": "{{Context.WaitQueueId}}"
+            },
+            "configurationArguments": {
+                "waitDuration": 1,
+                "waitUnit": "DAYS",
+                "specifiedTime": "",
+                "timeZone": "",
+                "description": "",
+                "waitForEventKey": ""
+            },
+            "metaData": { "waitType": "duration" },
+            "schema": {
+                "arguments": {
+                    "endDate": {
+                        "dataType": "Date",
+                        "isNullable": false,
+                        "direction": "Out",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitEndDateAttributeDataBound": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitDefinitionId": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitForEventId": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "executionMode": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "startActivityKey": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitQueueId": {
+                        "dataType": "LongNumber",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    }
+                }
+            }
+        },
+        {
+            "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6",
+            "key": "WAIT-2",
+            "name": "",
+            "description": "",
+            "type": "WAIT",
+            "outcomes": [
+                {
+                    "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a",
+                    "arguments": {},
+                    "metaData": {}
+                }
+            ],
+            "arguments": {
+                "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b",
+                "waitForEventId": "",
+                "executionMode": "{{Context.ExecutionMode}}",
+                "startActivityKey": "{{Context.StartActivityKey}}",
+                "waitQueueId": "{{Context.WaitQueueId}}"
+            },
+            "configurationArguments": {
+                "waitDuration": 1,
+                "waitUnit": "DAYS",
+                "specifiedTime": "",
+                "timeZone": "",
+                "description": "",
+                "waitForEventKey": ""
+            },
+            "metaData": { "waitType": "duration" },
+            "schema": {
+                "arguments": {
+                    "endDate": {
+                        "dataType": "Date",
+                        "isNullable": false,
+                        "direction": "Out",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitEndDateAttributeDataBound": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitDefinitionId": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitForEventId": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "executionMode": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "startActivityKey": {
+                        "dataType": "Text",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "waitQueueId": {
+                        "dataType": "LongNumber",
+                        "isNullable": true,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    }
+                }
+            }
+        },
+        {
+            "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa",
+            "key": "DATAEXTENSIONUPDATE-1",
+            "name": "",
+            "description": "",
+            "type": "DATAEXTENSIONUPDATE",
+            "outcomes": [
+                {
+                    "key": "a49ecf04-4612-4582-85fe-d7193f872fa8",
+                    "next": "WAIT-2",
+                    "arguments": {},
+                    "metaData": {}
+                }
+            ],
+            "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" },
+            "configurationArguments": {
+                "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4",
+                "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5"
+            },
+            "metaData": {
+                "dataExtensionName": "test_TestData",
+                "cachedFieldName": "JourneyConfirmed",
+                "cachedDisplayValue": ""
+            },
+            "schema": {
+                "arguments": {
+                    "contactKey": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    },
+                    "value": {
+                        "dataType": "Text",
+                        "isNullable": false,
+                        "direction": "In",
+                        "readOnly": false,
+                        "access": "Hidden"
+                    }
+                }
+            }
+        }
+    ],
+    "triggers": [
+        {
+            "id": "a7f8cd93-e0a6-40a5-8557-5bd6fa76c0ea",
+            "key": "TRIGGER",
+            "name": "test_TESTDataentry",
+            "description": "",
+            "type": "APIEvent",
+            "outcomes": [],
+            "arguments": {
+                "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}"
+            },
+            "configurationArguments": {
+                "schemaVersionId": 133,
+                "criteria": "<FilterDefinition><ConditionSet Operator=\"AND\" ConditionSetName=\"Individual Filter Grouping\"></ConditionSet></FilterDefinition>",
+                "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339"
+            },
+            "metaData": {
+                "scheduleState": "No Schedule",
+                "sourceInteractionId": "00000000-0000-0000-0000-000000000000",
+                "eventDefinitionId": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4",
+                "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b",
+                "chainType": "None",
+                "configurationRequired": false,
+                "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg",
+                "title": "",
+                "category": "Event"
+            }
+        }
+    ],
+    "goals": [],
+    "exits": [],
+    "notifiers": [],
+    "stats": {
+        "currentPopulation": 5848,
+        "cumulativePopulation": 3019,
+        "metGoal": 0,
+        "metExitCriteria": 0,
+        "goalPerformance": 0
+    },
+    "healthStats": {
+        "currentlyInCount": 0,
+        "delayedContactCount": 0,
+        "delayedMinuteInterval": 60
+    },
+    "entryMode": "OnceAndDone",
+    "definitionType": "Multistep",
+    "channel": "",
+    "defaults": {
+        "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"],
+        "properties": {}
+    },
+    "metaData": {},
+    "executionMode": "Production",
+    "categoryId": 6298,
+    "status": "Draft",
+    "definitionId": "233d4413-922c-4568-85a5-e5cc77efc3be",
+    "scheduledStatus": "Draft"
+}
diff --git a/test/resources/9999999/triggeredSendDefinition/retrieve-response.xml b/test/resources/9999999/triggeredSendDefinition/retrieve-response.xml
new file mode 100644
index 00000000..d2c1eebd
--- /dev/null
+++ b/test/resources/9999999/triggeredSendDefinition/retrieve-response.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
+    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+    <soap:Header>
+        <wsa:Action>RetrieveResponse</wsa:Action>
+        <wsa:MessageID>urn:uuid:8fe86c01-56d5-4c56-8ac2-991578c79485</wsa:MessageID>
+        <wsa:RelatesTo>urn:uuid:592f71ac-78a0-45a2-8cfe-37a91fc6cfd5</wsa:RelatesTo>
+        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
+        <wsse:Security>
+            <wsu:Timestamp wsu:Id="Timestamp-675af14a-b6a1-44a5-b7e7-4a76c6d18424">
+                <wsu:Created>2023-02-01T10:29:21Z</wsu:Created>
+                <wsu:Expires>2023-02-01T10:34:21Z</wsu:Expires>
+            </wsu:Timestamp>
+        </wsse:Security>
+    </soap:Header>
+    <soap:Body>
+        <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
+            <OverallStatus>OK</OverallStatus>
+            <RequestID>a90dda5e-aeba-440a-82ce-74fb2abf5eb2</RequestID>
+            <Results xsi:type="TriggeredSendDefinition">
+                <PartnerKey xsi:nil="true" />
+                <PartnerProperties>
+                    <Name>TestEmailAddr</Name>
+                    <Value />
+                </PartnerProperties>
+                <CreatedDate>2018-06-25T05:58:00</CreatedDate>
+                <ModifiedDate>2018-06-25T05:58:00</ModifiedDate>
+                <ObjectID>b3150cf0-6e78-e811-80d4-1402ec721c9d</ObjectID>
+                <CustomerKey>2621</CustomerKey>
+                <IsPlatformObject>false</IsPlatformObject>
+                <Name>Unsubscribe_Email</Name>
+                <Description>Unsubscribe_Email</Description>
+                <Keyword />
+                <CategoryID>5654</CategoryID>
+                <SendClassification>
+                    <PartnerKey xsi:nil="true" />
+                    <ObjectID xsi:nil="true" />
+                    <CustomerKey>Default Transactional</CustomerKey>
+                </SendClassification>
+                <FromName>unsubscribe</FromName>
+                <FromAddress>unsubscribe@emails.mcdev.accenture.com</FromAddress>
+                <SuppressTracking>false</SuppressTracking>
+                <TriggeredSendType>Continuous</TriggeredSendType>
+                <TriggeredSendStatus>New</TriggeredSendStatus>
+                <Email>
+                    <PartnerKey xsi:nil="true" />
+                    <ID>1960</ID>
+                    <ObjectID xsi:nil="true" />
+                </Email>
+                <AutoAddSubscribers>false</AutoAddSubscribers>
+                <AutoUpdateSubscribers>false</AutoUpdateSubscribers>
+                <BatchInterval>0</BatchInterval>
+                <BccEmail />
+                <EmailSubject>You are successfully unsubscribed</EmailSubject>
+                <DynamicEmailSubject>You are successfully unsubscribed</DynamicEmailSubject>
+                <IsMultipart>false</IsMultipart>
+                <IsWrapped>true</IsWrapped>
+                <AllowedSlots>0</AllowedSlots>
+                <NewSlotTrigger>0</NewSlotTrigger>
+                <Priority>4</Priority>
+            </Results>
+        </RetrieveResponseMsg>
+    </soap:Body>
+</soap:Envelope>