Repository: Accenture/sfmc-devtools (js)

Issue:
[BUG] "Blank File Behavior" not retrieved for importFile activity
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

there is a drop down in the advanced section that does not get downloaded right now, and hence cannot be deployed either:
![image](https://github.com/Accenture/sfmc-devtools/assets/1917227/975b0d11-b104-45db-a857-7e3911843e08)


### Expected Behavior

info from dropdown is retrieved and is deployable

### Version

6.0.2

### Participation

- [X] I am willing to submit a pull request for this issue.


Pull request:
Bugfix/1189 blank file behavior not retrieved for importfile activity
# PR details

## What changes did you make? (Give an overview)

- closes #1189 

## Further details (optional)

...

## Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] test scripts updated
- [ ] Wiki updated (if applicable)


Patch:
diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md
index c46eccb6..1f3eeaf3 100644
--- a/docs/dist/documentation.md
+++ b/docs/dist/documentation.md
@@ -866,7 +866,7 @@ FileTransfer MetadataType
 
 * [Asset](#Asset) ⇐ [<code>MetadataType</code>](#MetadataType)
     * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ <code>Promise.&lt;{metadata: TYPE.AssetMap, type: string}&gt;</code>
-    * [.retrieveForCache(_, [subTypeArr])](#Asset.retrieveForCache) ⇒ <code>Promise.&lt;{metadata: TYPE.AssetMap, type: string}&gt;</code>
+    * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ <code>Promise.&lt;{metadata: TYPE.AssetMap, type: string}&gt;</code>
     * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ <code>Promise.&lt;{metadata: TYPE.AssetItem, type: string}&gt;</code>
     * [.create(metadata)](#Asset.create) ⇒ <code>Promise</code>
     * [.update(metadata)](#Asset.update) ⇒ <code>Promise</code>
@@ -909,7 +909,7 @@ Retrieves Metadata of Asset
 
 <a name="Asset.retrieveForCache"></a>
 
-### Asset.retrieveForCache(_, [subTypeArr]) ⇒ <code>Promise.&lt;{metadata: TYPE.AssetMap, type: string}&gt;</code>
+### Asset.retrieveForCache([_], [subTypeArr]) ⇒ <code>Promise.&lt;{metadata: TYPE.AssetMap, type: string}&gt;</code>
 Retrieves asset metadata for caching
 
 **Kind**: static method of [<code>Asset</code>](#Asset)  
@@ -917,7 +917,7 @@ Retrieves asset metadata for caching
 
 | Param | Type | Description |
 | --- | --- | --- |
-| _ | <code>void</code> | unused |
+| [_] | <code>void</code> | parameter not used |
 | [subTypeArr] | <code>Array.&lt;string&gt;</code> | optionally limit to a single subtype |
 
 <a name="Asset.retrieveAsTemplate"></a>
@@ -2877,7 +2877,7 @@ Folder MetadataType
 
 * [Folder](#Folder) ⇐ [<code>MetadataType</code>](#MetadataType)
     * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ <code>Promise</code>
-    * [.retrieveForCache(_, [subTypeArr])](#Folder.retrieveForCache) ⇒ <code>Promise</code>
+    * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ <code>Promise</code>
     * [.upsert(metadata)](#Folder.upsert) ⇒ <code>Promise.&lt;object&gt;</code>
     * [.create(metadataEntry)](#Folder.create) ⇒ <code>Promise</code>
     * [.update(metadataEntry)](#Folder.update) ⇒ <code>Promise</code>
@@ -2904,7 +2904,7 @@ Retrieves metadata of metadata type into local filesystem. executes callback wit
 
 <a name="Folder.retrieveForCache"></a>
 
-### Folder.retrieveForCache(_, [subTypeArr]) ⇒ <code>Promise</code>
+### Folder.retrieveForCache([_], [subTypeArr]) ⇒ <code>Promise</code>
 Retrieves folder metadata for caching
 
 **Kind**: static method of [<code>Folder</code>](#Folder)  
@@ -2912,7 +2912,7 @@ Retrieves folder metadata for caching
 
 | Param | Type | Description |
 | --- | --- | --- |
-| _ | <code>void</code> | unused |
+| [_] | <code>void</code> | parameter not used |
 | [subTypeArr] | <code>Array.&lt;string&gt;</code> | content type of folder |
 
 <a name="Folder.upsert"></a>
@@ -3028,13 +3028,14 @@ ImportFile MetadataType
 
 * [ImportFile](#ImportFile) ⇐ [<code>MetadataType</code>](#MetadataType)
     * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
-    * [.retrieveForCache()](#ImportFile.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+    * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
     * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
     * [.postRetrieveTasks(importDef)](#ImportFile.postRetrieveTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
     * [.create(importFile)](#ImportFile.create) ⇒ <code>Promise</code>
     * [.update(importFile)](#ImportFile.update) ⇒ <code>Promise</code>
     * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ <code>Promise</code>
     * [.parseMetadata(metadata)](#ImportFile.parseMetadata) ⇒ <code>TYPE.MetadataTypeItem</code>
+    * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ <code>boolean</code>
 
 <a name="ImportFile.retrieve"></a>
 
@@ -3055,11 +3056,18 @@ Currently it is not needed to loop over Imports with endpoint /automation/v1/imp
 
 <a name="ImportFile.retrieveForCache"></a>
 
-### ImportFile.retrieveForCache() ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+### ImportFile.retrieveForCache([_], [__], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
 Retrieves import definition metadata for caching
 
 **Kind**: static method of [<code>ImportFile</code>](#ImportFile)  
 **Returns**: <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code> - Promise  
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [_] | <code>void</code> | parameter not used |
+| [__] | <code>void</code> | parameter not used |
+| [key] | <code>string</code> | customer key of single item to retrieve |
+
 <a name="ImportFile.retrieveAsTemplate"></a>
 
 ### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
@@ -3134,6 +3142,18 @@ parses retrieved Metadata before saving
 | --- | --- | --- |
 | metadata | <code>TYPE.MetadataTypeItem</code> | a single import definition |
 
+<a name="ImportFile.deleteByKey"></a>
+
+### ImportFile.deleteByKey(customerKey) ⇒ <code>boolean</code>
+Delete a metadata item from the specified business unit
+
+**Kind**: static method of [<code>ImportFile</code>](#ImportFile)  
+**Returns**: <code>boolean</code> - deletion success status  
+
+| Param | Type | Description |
+| --- | --- | --- |
+| customerKey | <code>string</code> | Identifier of data extension |
+
 <a name="Journey"></a>
 
 ## Journey ⇐ [<code>MetadataType</code>](#MetadataType)
@@ -3390,7 +3410,7 @@ Provides default functionality that can be overwritten by child metadata type cl
     * [.setFolderId(metadata)](#MetadataType.setFolderId)
     * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
     * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
-    * [.retrieveForCache([additionalFields], [subTypeArr])](#MetadataType.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+    * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
     * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
     * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ <code>Promise.&lt;{metadata: TYPE.MetadataTypeItem, type: string}&gt;</code>
     * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
@@ -3616,7 +3636,7 @@ Gets metadata from Marketing Cloud
 
 <a name="MetadataType.retrieveForCache"></a>
 
-### MetadataType.retrieveForCache([additionalFields], [subTypeArr]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
 Gets metadata cache with limited fields and does not store value to disk
 
 **Kind**: static method of [<code>MetadataType</code>](#MetadataType)  
@@ -3626,6 +3646,7 @@ Gets metadata cache with limited fields and does not store value to disk
 | --- | --- | --- |
 | [additionalFields] | <code>Array.&lt;string&gt;</code> | Returns specified fields even if their retrieve definition is not set to true |
 | [subTypeArr] | <code>Array.&lt;string&gt;</code> | optionally limit to a single subtype |
+| [key] | <code>string</code> | customer key of single item to retrieve |
 
 <a name="MetadataType.retrieveAsTemplate"></a>
 
@@ -4341,7 +4362,7 @@ MobileKeyword MetadataType
     * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code> \| <code>void</code>
     * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ <code>TYPE.MetadataTypeMap</code>
     * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ <code>&#x27;create&#x27;</code> \| <code>&#x27;update&#x27;</code> \| <code>&#x27;skip&#x27;</code>
-    * [.retrieveForCache(_, __, [key])](#MobileKeyword.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+    * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
     * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
     * [.create(metadata)](#MobileKeyword.create) ⇒ <code>Promise</code>
     * [.update(metadata)](#MobileKeyword.update) ⇒ <code>Promise</code>
@@ -4405,7 +4426,7 @@ helper for [upsert](#MetadataType.upsert)
 
 <a name="MobileKeyword.retrieveForCache"></a>
 
-### MobileKeyword.retrieveForCache(_, __, [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
 Retrieves event definition metadata for caching
 
 **Kind**: static method of [<code>MobileKeyword</code>](#MobileKeyword)  
@@ -4413,8 +4434,8 @@ Retrieves event definition metadata for caching
 
 | Param | Type | Description |
 | --- | --- | --- |
-| _ | <code>void</code> | parameter not used |
-| __ | <code>void</code> | parameter not used |
+| [_] | <code>void</code> | parameter not used |
+| [__] | <code>void</code> | parameter not used |
 | [key] | <code>string</code> | customer key of single item to retrieve |
 
 <a name="MobileKeyword.retrieveAsTemplate"></a>
@@ -4632,7 +4653,7 @@ MobileMessage MetadataType
 
 * [MobileMessage](#MobileMessage) ⇐ [<code>MetadataType</code>](#MetadataType)
     * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code> \| <code>void</code>
-    * [.retrieveForCache(_, __, [key])](#MobileMessage.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+    * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
     * [.update(metadata)](#MobileMessage.update) ⇒ <code>Promise</code>
     * [.create(metadata)](#MobileMessage.create) ⇒ <code>Promise</code>
     * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ <code>Promise.&lt;string&gt;</code>
@@ -4664,7 +4685,7 @@ Retrieves Metadata of Mobile Keywords
 
 <a name="MobileMessage.retrieveForCache"></a>
 
-### MobileMessage.retrieveForCache(_, __, [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
 Retrieves event definition metadata for caching
 
 **Kind**: static method of [<code>MobileMessage</code>](#MobileMessage)  
@@ -4672,8 +4693,8 @@ Retrieves event definition metadata for caching
 
 | Param | Type | Description |
 | --- | --- | --- |
-| _ | <code>void</code> | parameter not used |
-| __ | <code>void</code> | parameter not used |
+| [_] | <code>void</code> | parameter not used |
+| [__] | <code>void</code> | parameter not used |
 | [key] | <code>string</code> | customer key of single item to retrieve |
 
 <a name="MobileMessage.update"></a>
@@ -5516,7 +5537,7 @@ TransactionalMessage MetadataType
 
 * [TransactionalMessage](#TransactionalMessage) ⇐ [<code>MetadataType</code>](#MetadataType)
     * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
-    * [.retrieveForCache([key])](#TransactionalMessage.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+    * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
     * [.update(metadata)](#TransactionalMessage.update) ⇒ <code>Promise</code>
     * [.create(metadata)](#TransactionalMessage.create) ⇒ <code>Promise</code>
     * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
@@ -5538,7 +5559,7 @@ Retrieves Metadata
 
 <a name="TransactionalMessage.retrieveForCache"></a>
 
-### TransactionalMessage.retrieveForCache([key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
+### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
 Retrieves event definition metadata for caching
 
 **Kind**: static method of [<code>TransactionalMessage</code>](#TransactionalMessage)  
@@ -5546,6 +5567,8 @@ Retrieves event definition metadata for caching
 
 | Param | Type | Description |
 | --- | --- | --- |
+| [_] | <code>void</code> | parameter not used |
+| [__] | <code>void</code> | parameter not used |
 | [key] | <code>string</code> | customer key of single item to cache |
 
 <a name="TransactionalMessage.update"></a>
diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js
index 3abad802..61f5517c 100644
--- a/lib/metadataTypes/Asset.js
+++ b/lib/metadataTypes/Asset.js
@@ -49,7 +49,7 @@ class Asset extends MetadataType {
     /**
      * Retrieves asset metadata for caching
      *
-     * @param {void} _ unused
+     * @param {void} [_] parameter not used
      * @param {string[]} [subTypeArr] optionally limit to a single subtype
      * @returns {Promise.<{metadata: TYPE.AssetMap, type: string}>} Promise
      */
diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js
index b4b2b6ae..bdc02654 100644
--- a/lib/metadataTypes/Folder.js
+++ b/lib/metadataTypes/Folder.js
@@ -150,7 +150,7 @@ class Folder extends MetadataType {
     /**
      * Retrieves folder metadata for caching
      *
-     * @param {void} _ unused
+     * @param {void} [_] parameter not used
      * @param {string[]} [subTypeArr] content type of folder
      * @returns {Promise} Promise
      */
diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js
index 5348a490..26efb0f3 100644
--- a/lib/metadataTypes/ImportFile.js
+++ b/lib/metadataTypes/ImportFile.js
@@ -23,17 +23,38 @@ class ImportFile extends MetadataType {
      * @param {string} [key] customer key of single item to retrieve
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise
      */
-    static retrieve(retrieveDir, _, __, key) {
-        return super.retrieveREST(retrieveDir, '/automation/v1/imports/', null, key);
+    static async retrieve(retrieveDir, _, __, key) {
+        let objectId = null;
+        if (key) {
+            // using '?$filter=customerKey%20eq%20' + encodeURIComponent(key) would also work but that just retrieves more data for no reason
+            objectId = await this._getObjectIdForSingleRetrieve(key);
+            if (!objectId) {
+                // avoid running the rest request below by returning early
+                Util.logger.info(
+                    `Downloaded: ${this.definition.type} (0)${Util.getKeysString(key)}`
+                );
+                return { metadata: {}, type: this.definition.type };
+            }
+        }
+
+        return super.retrieveREST(
+            retrieveDir,
+            '/automation/v1/imports/' + (objectId || ''),
+            null,
+            key
+        );
     }
 
     /**
      * Retrieves import definition metadata for caching
      *
+     * @param {void} [_] parameter not used
+     * @param {void} [__] parameter not used
+     * @param {string} [key] customer key of single item to retrieve
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise
      */
-    static async retrieveForCache() {
-        return super.retrieveREST(null, '/automation/v1/imports/');
+    static retrieveForCache(_, __, key) {
+        return this.retrieve(null, null, null, key);
     }
 
     /**
@@ -45,12 +66,12 @@ class ImportFile extends MetadataType {
      * @returns {Promise.<TYPE.MetadataTypeItemObj>} Promise
      */
     static async retrieveAsTemplate(templateDir, name, templateVariables) {
-        const res = await this.client.rest.get(
-            '/automation/v1/imports/?$filter=name%20eq%20' + encodeURIComponent(name)
-        );
-        if (Array.isArray(res?.items) && res?.items.length) {
+        // using '?$filter=name%20eq%20' + encodeURIComponent(name) would also work but that just retrieves more data for no reason
+        const cache = await this.retrieveForCache(null, null, 'name:' + name);
+        const metadataArr = Object.values(cache?.metadata);
+        if (Array.isArray(metadataArr) && metadataArr.length) {
             // eq-operator returns a similar, not exact match and hence might return more than 1 entry
-            const metadata = res.items.find((item) => item.name === name);
+            const metadata = metadataArr.find((item) => item.name === name);
             if (!metadata) {
                 Util.logger.error(`No ${this.definition.typeName} found with name "${name}"`);
                 return;
@@ -72,16 +93,39 @@ class ImportFile extends MetadataType {
             );
             Util.logger.info(`- templated ${this.definition.type}: ${name}`);
             return { metadata: val, type: this.definition.type };
-        } else if (res?.items) {
+        } else if (metadataArr) {
             Util.logger.error(`No ${this.definition.typeName} found with name "${name}"`);
         } else {
             throw new Error(
                 `Encountered unknown error when retrieveing ${
                     this.definition.typeName
-                } "${name}": ${JSON.stringify(res)}`
+                } "${name}": ${JSON.stringify(metadataArr)}`
             );
         }
     }
+    /**
+     * helper to allow us to select single metadata entries via REST
+     *
+     * @private
+     * @param {string} key customer key
+     * @returns {Promise.<string>} objectId or enpty string
+     */
+    static async _getObjectIdForSingleRetrieve(key) {
+        const response = await this.client.soap.retrieve('ImportDefinition', ['ObjectID'], {
+            filter: key.startsWith('name:')
+                ? {
+                      leftOperand: 'Name',
+                      operator: 'equals',
+                      rightOperand: key.slice(5),
+                  }
+                : {
+                      leftOperand: 'CustomerKey',
+                      operator: 'equals',
+                      rightOperand: key,
+                  },
+        });
+        return response?.Results?.length ? response.Results[0].ObjectID : null;
+    }
 
     /**
      * manages post retrieve steps
@@ -90,8 +134,7 @@ class ImportFile extends MetadataType {
      * @returns {TYPE.MetadataTypeItem} metadata
      */
     static postRetrieveTasks(importDef) {
-        const val = this.parseMetadata(importDef);
-        return val;
+        return this.parseMetadata(importDef);
     }
 
     /**
@@ -163,6 +206,11 @@ class ImportFile extends MetadataType {
                 } not fully supported. Deploy might fail.`
             );
         }
+        if (metadata.c__blankFileProcessing) {
+            // omit this if not set
+            metadata.blankFileProcessingType =
+                this.definition.blankFileProcessingTypeMapping[metadata.c__blankFileProcessing];
+        }
         // When the destinationObjectTypeId is 584 it refers to Mobile Connect which is not supported as an Import Type
         metadata.destinationObjectTypeId =
             this.definition.destinationObjectTypeMapping[metadata.c__destinationType];
@@ -216,6 +264,14 @@ class ImportFile extends MetadataType {
                 Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`);
             }
         }
+        if (metadata.blankFileProcessingType) {
+            // omit this if not set
+            metadata.c__blankFileProcessing = Util.inverseGet(
+                this.definition.blankFileProcessingTypeMapping,
+                metadata.blankFileProcessingType
+            );
+            delete metadata.blankFileProcessingType;
+        }
 
         metadata.c__subscriberImportType = Util.inverseGet(
             this.definition.subscriberImportTypeMapping,
diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js
index 2ea9cb9c..7d30ab4d 100644
--- a/lib/metadataTypes/MetadataType.js
+++ b/lib/metadataTypes/MetadataType.js
@@ -266,10 +266,11 @@ class MetadataType {
      *
      * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true
      * @param {string[]} [subTypeArr] optionally limit to a single subtype
+     * @param {string} [key] customer key of single item to retrieve
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} metadata
      */
-    static async retrieveForCache(additionalFields, subTypeArr) {
-        return this.retrieve(null, additionalFields, subTypeArr);
+    static async retrieveForCache(additionalFields, subTypeArr, key) {
+        return this.retrieve(null, additionalFields, subTypeArr, key);
     }
     /**
      * Gets metadata cache with limited fields and does not store value to disk
@@ -1063,7 +1064,13 @@ class MetadataType {
         if (this.definition.hasExtended) {
             Util.logger.debug(' - retrieving extended metadata');
             const extended = await this.client.rest.getCollection(
-                Object.keys(results).map((key) => uri + results[key][this.definition.idField])
+                Object.keys(results)
+                    .map((key) =>
+                        uri.endsWith(results[key][this.definition.idField])
+                            ? null
+                            : uri + results[key][this.definition.idField]
+                    )
+                    .filter(Boolean)
             );
             for (const ext of extended) {
                 const key = ext[this.definition.keyField];
diff --git a/lib/metadataTypes/MobileKeyword.js b/lib/metadataTypes/MobileKeyword.js
index 23f753cb..547151f9 100644
--- a/lib/metadataTypes/MobileKeyword.js
+++ b/lib/metadataTypes/MobileKeyword.js
@@ -151,8 +151,8 @@ class MobileKeyword extends MetadataType {
     /**
      * Retrieves event definition metadata for caching
      *
-     * @param {void} _ parameter not used
-     * @param {void} __ parameter not used
+     * @param {void} [_] parameter not used
+     * @param {void} [__] parameter not used
      * @param {string} [key] customer key of single item to retrieve
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise of metadata
      */
diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js
index 756d8175..492be105 100644
--- a/lib/metadataTypes/MobileMessage.js
+++ b/lib/metadataTypes/MobileMessage.js
@@ -50,8 +50,8 @@ class MobileMessage extends MetadataType {
     /**
      * Retrieves event definition metadata for caching
      *
-     * @param {void} _ parameter not used
-     * @param {void} __ parameter not used
+     * @param {void} [_] parameter not used
+     * @param {void} [__] parameter not used
      * @param {string} [key] customer key of single item to retrieve
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise of metadata
      */
diff --git a/lib/metadataTypes/TransactionalEmail.js b/lib/metadataTypes/TransactionalEmail.js
index 35ad0cf1..079ccdc5 100644
--- a/lib/metadataTypes/TransactionalEmail.js
+++ b/lib/metadataTypes/TransactionalEmail.js
@@ -212,7 +212,7 @@ class TransactionalEmail extends TransactionalMessage {
      * @returns {Promise.<boolean>} deletion success status
      */
     static async deleteByKey(key) {
-        const metadataMapObj = await this.retrieveForCache(key);
+        const metadataMapObj = await this.retrieveForCache(null, null, key);
         const journeyKey = metadataMapObj?.metadata?.[key]?.journey?.interactionKey;
 
         const isDeleted = await super.deleteByKeyREST(
diff --git a/lib/metadataTypes/TransactionalMessage.js b/lib/metadataTypes/TransactionalMessage.js
index 523c6ac2..38ec5369 100644
--- a/lib/metadataTypes/TransactionalMessage.js
+++ b/lib/metadataTypes/TransactionalMessage.js
@@ -67,10 +67,12 @@ class TransactionalMessage extends MetadataType {
     /**
      * Retrieves event definition metadata for caching
      *
+     * @param {void} [_] parameter not used
+     * @param {void} [__] parameter not used
      * @param {string} [key] customer key of single item to cache
      * @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise of metadata
      */
-    static retrieveForCache(key) {
+    static retrieveForCache(_, __, key) {
         // the call to /messaging/v1/email/definitions/ does not return definitionId
         // definitionId is required for resolving dependencies on interactions.
         // we should therefore use the already defined retrieve method
diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js
index dc4263c2..0b3aa28a 100644
--- a/lib/metadataTypes/definitions/ImportFile.definition.js
+++ b/lib/metadataTypes/definitions/ImportFile.definition.js
@@ -8,7 +8,7 @@ export default {
         SMS: 584,
         Push: 613,
     },
-    hasExtended: false,
+    hasExtended: true,
     idField: 'importDefinitionId',
     keyIsFixed: false,
     keyField: 'customerKey',
@@ -33,6 +33,11 @@ export default {
         Overwrite: 4,
         Update: 2,
     },
+    blankFileProcessingTypeMapping: {
+        Fail: 0,
+        Process: 1,
+        Skip: 2,
+    },
     fields: {
         allowErrors: {
             isCreateable: true,
@@ -40,6 +45,13 @@ export default {
             retrieving: true,
             template: true,
         },
+        blankFileProcessingType: {
+            // only visible if retrieved with ID
+            isCreateable: true,
+            isUpdateable: true,
+            retrieving: true,
+            template: true,
+        },
         createdDate: {
             isCreateable: false,
             isUpdateable: false,
@@ -76,6 +88,13 @@ export default {
             retrieving: false,
             template: false,
         },
+        destinationName: {
+            // only visible if retrieved with ID
+            isCreateable: false,
+            isUpdateable: false,
+            retrieving: false,
+            template: false,
+        },
         destinationObjectId: {
             isCreateable: true,
             isUpdateable: true,
@@ -89,6 +108,7 @@ export default {
             template: true,
         },
         encodingName: {
+            // only visible if retrieved with ID
             isCreateable: true,
             isUpdateable: true,
             retrieving: true,
@@ -115,6 +135,13 @@ export default {
             retrieving: true,
             template: true,
         },
+        fileTransferLocationName: {
+            // only visible if retrieved with ID
+            isCreateable: false,
+            isUpdateable: false,
+            retrieving: false,
+            template: false,
+        },
         fileTransferLocationTypeId: {
             isCreateable: true,
             isUpdateable: true,
@@ -258,5 +285,11 @@ export default {
             retrieving: true,
             template: true,
         },
+        c__blankFileProcessing: {
+            isCreateable: false,
+            isUpdateable: false,
+            retrieving: true,
+            template: true,
+        },
     },
 };


Test patch:
diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json
index 70fdc604..16c63181 100644
--- a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json
+++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json
@@ -5,6 +5,7 @@
     "dateFormatLocale": "en-US",
     "deleteFile": false,
     "description": "updated on deploy",
+    "encodingName": "utf-8",
     "fieldMappingType": "InferFromColumnHeadings",
     "fieldMappings": [],
     "fileNamingPattern": "blabla",
@@ -21,9 +22,10 @@
     "name": "testExisting_importFile",
     "sendEmailNotification": false,
     "standardQuotedStrings": true,
-    "r__fileLocation_name": "ExactTarget Enhanced FTP",
+    "c__blankFileProcessing": "Process",
+    "c__dataAction": "AddUpdate",
     "c__destinationType": "DataExtension",
-    "r__dataExtension_CustomerKey": "testExisting_dataExtension",
     "c__subscriberImportType": "DataExtension",
-    "c__dataAction": "AddUpdate"
+    "r__dataExtension_CustomerKey": "testExisting_dataExtension",
+    "r__fileLocation_name": "ExactTarget Enhanced FTP"
 }
diff --git a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json
new file mode 100644
index 00000000..9e443db6
--- /dev/null
+++ b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json
@@ -0,0 +1,35 @@
+{
+    "allowErrors": true,
+    "customerKey": "testExisting_importFile",
+    "createdDate": "2022-11-09T05:32:30.533",
+    "modifiedDate": "2022-11-17T07:13:03.95",
+    "dateFormatLocale": "en-US",
+    "deleteFile": false,
+    "description": "17.11.2022",
+    "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
+    "destinationId": 0,
+    "destinationObjectTypeId": 310,
+    "destinationName": "testExisting_dataExtension",
+    "encodingName": "utf-8",
+    "fieldMappings": [],
+    "fieldMappingType": "InferFromColumnHeadings",
+    "fileNamingPattern": "blabla",
+    "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
+    "fileTransferLocationName": "ExactTarget Enhanced FTP",
+    "fileType": "CSV",
+    "filter": "",
+    "hasColumnHeader": true,
+    "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b",
+    "isOrderedImport": true,
+    "isSequential": true,
+    "maxFileAgeHours": 0,
+    "maxImportFrequencyHours": 0,
+    "maxFileAgeScheduleOffsetHours": 0,
+    "name": "testExisting_importFile",
+    "sendEmailNotification": false,
+    "standardQuotedStrings": true,
+    "subscriberImportTypeId": 255,
+    "updateTypeId": 0,
+    "fileTransferLocationTypeId": 0,
+    "blankFileProcessingType": 2
+}
diff --git a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json
index 09b433e8..be6e1094 100644
--- a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json
+++ b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json
@@ -1,31 +1,35 @@
 {
     "allowErrors": true,
     "customerKey": "testExisting_importFile",
+    "createdDate": "2022-11-09T05:32:30.533",
+    "modifiedDate": "2023-07-18T09:11:26.19",
     "dateFormatLocale": "en-US",
     "deleteFile": false,
     "description": "updated on deploy",
-    "fieldMappingType": "InferFromColumnHeadings",
+    "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
+    "destinationId": 0,
+    "destinationObjectTypeId": 310,
+    "destinationName": "testExisting_dataExtension",
+    "encodingName": "utf-8",
     "fieldMappings": [],
+    "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
-    "fileTransferLocationTypeId": 0,
+    "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
+    "fileTransferLocationName": "ExactTarget Enhanced FTP",
     "fileType": "CSV",
     "filter": "",
     "hasColumnHeader": true,
+    "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b",
     "isOrderedImport": true,
     "isSequential": true,
     "maxFileAgeHours": 0,
-    "maxFileAgeScheduleOffsetHours": 0,
     "maxImportFrequencyHours": 0,
+    "maxFileAgeScheduleOffsetHours": 0,
     "name": "testExisting_importFile",
     "sendEmailNotification": false,
     "standardQuotedStrings": true,
-    "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
-    "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
-    "destinationObjectTypeId": 310,
     "subscriberImportTypeId": 255,
     "updateTypeId": 0,
-    "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b",
-    "createdDate": "2022-11-09T05:53:03.243",
-    "destinationId": 0,
-    "modifiedDate": "2023-07-18T09:11:26.19"
+    "fileTransferLocationTypeId": 0,
+    "blankFileProcessingType": 1
 }
diff --git a/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml b/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml
new file mode 100644
index 00000000..0af2d258
--- /dev/null
+++ b/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml
@@ -0,0 +1,30 @@
+<?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:58a4181c-9ea7-4d26-835b-f1eb50877b0b</wsa:MessageID>
+        <wsa:RelatesTo>urn:uuid:dab39bb4-2262-453a-9cb1-c591db9222d9</wsa:RelatesTo>
+        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
+        <wsse:Security>
+            <wsu:Timestamp wsu:Id="Timestamp-b8a68a2b-ad18-4ac0-8cea-dabe7d7d55c9">
+                <wsu:Created>2024-01-25T21:59:01Z</wsu:Created>
+                <wsu:Expires>2024-01-25T22:04:01Z</wsu:Expires>
+            </wsu:Timestamp>
+        </wsse:Security>
+    </soap:Header>
+    <soap:Body>
+        <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
+            <OverallStatus>OK</OverallStatus>
+            <RequestID>fdc476c9-46dc-43f5-b8a6-57f2299c65ac</RequestID>
+            <Results xsi:type="ImportDefinition">
+                <PartnerKey xsi:nil="true" />
+                <ObjectID>9d16f42c-2260-ed11-b849-48df37d1de8b</ObjectID>
+            </Results>
+        </RetrieveResponseMsg>
+    </soap:Body>
+</soap:Envelope>
diff --git a/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml b/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml
new file mode 100644
index 00000000..0af2d258
--- /dev/null
+++ b/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml
@@ -0,0 +1,30 @@
+<?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:58a4181c-9ea7-4d26-835b-f1eb50877b0b</wsa:MessageID>
+        <wsa:RelatesTo>urn:uuid:dab39bb4-2262-453a-9cb1-c591db9222d9</wsa:RelatesTo>
+        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
+        <wsse:Security>
+            <wsu:Timestamp wsu:Id="Timestamp-b8a68a2b-ad18-4ac0-8cea-dabe7d7d55c9">
+                <wsu:Created>2024-01-25T21:59:01Z</wsu:Created>
+                <wsu:Expires>2024-01-25T22:04:01Z</wsu:Expires>
+            </wsu:Timestamp>
+        </wsse:Security>
+    </soap:Header>
+    <soap:Body>
+        <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
+            <OverallStatus>OK</OverallStatus>
+            <RequestID>fdc476c9-46dc-43f5-b8a6-57f2299c65ac</RequestID>
+            <Results xsi:type="ImportDefinition">
+                <PartnerKey xsi:nil="true" />
+                <ObjectID>9d16f42c-2260-ed11-b849-48df37d1de8b</ObjectID>
+            </Results>
+        </RetrieveResponseMsg>
+    </soap:Body>
+</soap:Envelope>
diff --git a/test/resources/9999999/importFile/build-expected.json b/test/resources/9999999/importFile/build-expected.json
index a1e8feed..11e81a29 100644
--- a/test/resources/9999999/importFile/build-expected.json
+++ b/test/resources/9999999/importFile/build-expected.json
@@ -1,5 +1,6 @@
 {
     "allowErrors": true,
+    "c__blankFileProcessing": "Skip",
     "c__dataAction": "AddUpdate",
     "c__destinationType": "DataExtension",
     "c__subscriberImportType": "DataExtension",
@@ -7,8 +8,9 @@
     "dateFormatLocale": "en-US",
     "deleteFile": false,
     "description": "17.11.2022",
-    "fieldMappingType": "InferFromColumnHeadings",
+    "encodingName": "utf-8",
     "fieldMappings": [],
+    "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
     "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
diff --git a/test/resources/9999999/importFile/get-expected.json b/test/resources/9999999/importFile/get-expected.json
index 4175265c..a704e228 100644
--- a/test/resources/9999999/importFile/get-expected.json
+++ b/test/resources/9999999/importFile/get-expected.json
@@ -1,12 +1,17 @@
 {
     "allowErrors": true,
+    "c__blankFileProcessing": "Skip",
+    "c__dataAction": "AddUpdate",
+    "c__destinationType": "DataExtension",
+    "c__subscriberImportType": "DataExtension",
     "createdDate": "2022-11-09T05:32:30.533",
     "customerKey": "testExisting_importFile",
     "dateFormatLocale": "en-US",
     "deleteFile": false,
     "description": "17.11.2022",
-    "fieldMappingType": "InferFromColumnHeadings",
+    "encodingName": "utf-8",
     "fieldMappings": [],
+    "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
     "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
@@ -19,11 +24,8 @@
     "maxImportFrequencyHours": 0,
     "modifiedDate": "2022-11-17T07:13:03.95",
     "name": "testExisting_importFile",
-    "sendEmailNotification": false,
-    "standardQuotedStrings": true,
-    "c__dataAction": "AddUpdate",
-    "c__destinationType": "DataExtension",
-    "c__subscriberImportType": "DataExtension",
     "r__dataExtension_CustomerKey": "testExisting_dataExtension",
-    "r__fileLocation_name": "ExactTarget Enhanced FTP"
+    "r__fileLocation_name": "ExactTarget Enhanced FTP",
+    "sendEmailNotification": false,
+    "standardQuotedStrings": true
 }
diff --git a/test/resources/9999999/importFile/patch-expected.json b/test/resources/9999999/importFile/patch-expected.json
index 844d9dd5..0d761839 100644
--- a/test/resources/9999999/importFile/patch-expected.json
+++ b/test/resources/9999999/importFile/patch-expected.json
@@ -1,15 +1,17 @@
 {
     "allowErrors": true,
+    "c__blankFileProcessing": "Process",
     "c__dataAction": "AddUpdate",
     "c__destinationType": "DataExtension",
     "c__subscriberImportType": "DataExtension",
-    "createdDate": "2022-11-09T05:53:03.243",
+    "createdDate": "2022-11-09T05:32:30.533",
     "customerKey": "testExisting_importFile",
     "dateFormatLocale": "en-US",
     "deleteFile": false,
     "description": "updated on deploy",
-    "fieldMappingType": "InferFromColumnHeadings",
+    "encodingName": "utf-8",
     "fieldMappings": [],
+    "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
     "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
diff --git a/test/resources/9999999/importFile/template-expected.json b/test/resources/9999999/importFile/template-expected.json
index 6be382e9..ff26a685 100644
--- a/test/resources/9999999/importFile/template-expected.json
+++ b/test/resources/9999999/importFile/template-expected.json
@@ -1,5 +1,6 @@
 {
     "allowErrors": true,
+    "c__blankFileProcessing": "Skip",
     "c__dataAction": "AddUpdate",
     "c__destinationType": "DataExtension",
     "c__subscriberImportType": "DataExtension",
@@ -7,6 +8,7 @@
     "dateFormatLocale": "en-US",
     "deleteFile": false,
     "description": "17.11.2022",
+    "encodingName": "utf-8",
     "fieldMappingType": "InferFromColumnHeadings",
     "fieldMappings": [],
     "fileNamingPattern": "blabla",
diff --git a/test/type.automation.test.js b/test/type.automation.test.js
index 140c3eed..543859e6 100644
--- a/test/type.automation.test.js
+++ b/test/type.automation.test.js
@@ -45,7 +45,7 @@ describe('type: automation', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                18,
+                19,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -119,7 +119,7 @@ describe('type: automation', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                25,
+                26,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -188,7 +188,7 @@ describe('type: automation', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                33,
+                34,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -256,7 +256,7 @@ describe('type: automation', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                29,
+                30,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -291,7 +291,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                18,
+                19,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -335,7 +335,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                40,
+                42,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -379,7 +379,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                42,
+                44,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -423,7 +423,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                43,
+                45,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -463,7 +463,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                35,
+                37,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -504,7 +504,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                41,
+                43,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -545,7 +545,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                43,
+                45,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -596,7 +596,7 @@ describe('type: automation', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                20,
+                21,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -643,7 +643,7 @@ describe('type: automation', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                18,
+                19,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js
index 06ca6c00..7e90a8de 100644
--- a/test/type.importFile.test.js
+++ b/test/type.importFile.test.js
@@ -33,7 +33,35 @@ describe('type: importFile', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                10,
+                11,
+                'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
+            );
+            return;
+        });
+        it('Should retrieve a importFile by key', async () => {
+            // WHEN
+            await handler.retrieve(
+                'testInstance/testBU',
+                ['importFile'],
+                ['testExisting_importFile']
+            );
+            // THEN
+            assert.equal(process.exitCode, false, 'retrieve should not have thrown an error');
+            // get results from cache
+            const result = cache.getCache();
+            assert.equal(
+                result.importFile ? Object.keys(result.importFile).length : 0,
+                1,
+                'only one importFile expected'
+            );
+            assert.deepEqual(
+                await testUtils.getActualJson('testExisting_importFile', 'importFile'),
+                await testUtils.getExpectedJson('9999999', 'importFile', 'get'),
+                'returned JSON was not equal expected'
+            );
+            assert.equal(
+                testUtils.getAPIHistoryLength(),
+                11,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -71,7 +99,7 @@ describe('type: importFile', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                12,
+                13,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -116,7 +144,7 @@ describe('type: importFile', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                10,
+                11,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -161,7 +189,7 @@ describe('type: importFile', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                10,
+                11,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -173,7 +201,7 @@ describe('type: importFile', () => {
             const isDeleted = await handler.deleteByKey(
                 'testInstance/testBU',
                 'importFile',
-                'testExisting_fileTranfer'
+                'testExisting_importFile'
             );
             // THEN
             assert.equal(
diff --git a/test/type.query.test.js b/test/type.query.test.js
index 57c16d8f..dc2b183c 100644
--- a/test/type.query.test.js
+++ b/test/type.query.test.js
@@ -455,7 +455,7 @@ describe('type: query', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                34,
+                35,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -495,7 +495,7 @@ describe('type: query', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                36,
+                37,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;