Repository: Accenture/sfmc-devtools (js)

Issue:
[BUG] calling refresh without defining a type/key results in unhandled error
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

![image](https://github.com/user-attachments/assets/180f6c7a-05a0-4ff5-a2d8-61faf14c51c0)
when refresh is called without defining a type, this error appears							

### Expected Behavior

it should simply state that type is missing, similar to when keys are missing

### Steps To Reproduce

1. Go to '...'
2. Click on '....'
3. Run '...'
4. See error...


### Version

7.6.1

### Environment

- OS:
- Node:
- npm:


### Participation

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

### Additional comments

_No response_

Pull request:
Bug/1972 calling refresh without defining a type results in unhandled error
# PR details

## What changes did you make? (Give an overview)

- closes #1972 

## 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
- [x] test scripts updated
- [ ] Wiki updated (if applicable)


Patch:
diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts
index 2e1a0e6f..ea6cc146 100644
--- a/@types/lib/index.d.ts
+++ b/@types/lib/index.d.ts
@@ -192,11 +192,11 @@ declare class Mcdev {
      * ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails
      *
      * @param {string} businessUnit references credentials from properties.json
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static refresh(businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static refresh(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
@@ -299,14 +299,14 @@ declare class Mcdev {
      */
     static getFilesToCommit(businessUnit: string, selectedType: string, keyArr: string[]): Promise<string[]>;
     /**
-     * Schedule an item (shortcut for execute --schedule)
+     * Publish an item
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static schedule(businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static publish(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
@@ -319,33 +319,33 @@ declare class Mcdev {
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static publish(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static validate(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
     }>;
     /**
-     * Publish an item
+     * Start/execute an item
      *
      * @param {string} businessUnit name of BU
      * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static validate(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static execute(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
     }>;
     /**
-     * Start/execute an item
+     * Schedule an item (shortcut for execute --schedule)
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static execute(businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static schedule(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
@@ -354,11 +354,11 @@ declare class Mcdev {
      * pause an item
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static pause(businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static pause(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
@@ -367,11 +367,11 @@ declare class Mcdev {
      * stop an item
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
-    static stop(businessUnit: string, selectedTypes?: string[] | TypeKeyCombo, keys?: string[]): Promise<{
+    static stop(businessUnit: string, selectedTypes: string[] | TypeKeyCombo, keys?: string[]): Promise<{
         [x: string]: {
             [x: string]: string[];
         };
diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map
index f342f178..421d7717 100644
--- a/@types/lib/index.d.ts.map
+++ b/@types/lib/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OA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CA4E7C;IAED;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,MAAM,GAAC,SAAS,GAAC,UAAU,GAAC,SAAS,GAAC,oBAAoB,GAAC,SAAS,gBACtF,MAAM,kBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,MAAM,EAAE;SAAC;KAAC,CAAC,CAwNhE;IAED;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,MAAM,GAAC,SAAS,GAAC,UAAU,GAAC,SAAS,GAAC,oBAAoB,GAAC,SAAS,QACtF,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAoD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA4FxB;CACJ"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAwBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gB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O,GAAC,MAAM,GAAC,SAAS,GAAC,UAAU,GAAC,SAAS,GAAC,oBAAoB,GAAC,SAAS,gBACtF,MAAM,kBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN,OAAO,CAAE;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,MAAM,EAAE;SAAC;KAAC,CAAC,CAyOhE;IAED;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,MAAM,GAAC,SAAS,GAAC,UAAU,GAAC,SAAS,GAAC,oBAAoB,GAAC,SAAS,QACtF,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAoD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0D9B;IAED;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CA0E9B;IAED;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,OAAO,CAAE,MAAM,EAAE,CAAC,CAyE9B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA4FxB;CACJ"}
\ No newline at end of file
diff --git a/lib/index.js b/lib/index.js
index 0eb70df1..d3bf9666 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -730,7 +730,7 @@ class Mcdev {
      * ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails
      *
      * @param {string} businessUnit references credentials from properties.json
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
@@ -1412,19 +1412,6 @@ class Mcdev {
         }
     }
 
-    /**
-     * Schedule an item (shortcut for execute --schedule)
-     *
-     * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
-     * @param {string[]} [keys] customerkey of the metadata
-     * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
-     */
-    static async schedule(businessUnit, selectedTypes, keys) {
-        this.setOptions({ schedule: true });
-        return this.#runMethod('execute', businessUnit, selectedTypes, keys);
-    }
-
     /**
      * Publish an item
      *
@@ -1452,7 +1439,7 @@ class Mcdev {
      * Start/execute an item
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
@@ -1460,11 +1447,24 @@ class Mcdev {
         return this.#runMethod('execute', businessUnit, selectedTypes, keys);
     }
 
+    /**
+     * Schedule an item (shortcut for execute --schedule)
+     *
+     * @param {string} businessUnit name of BU
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
+     * @param {string[]} [keys] customerkey of the metadata
+     * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
+     */
+    static async schedule(businessUnit, selectedTypes, keys) {
+        this.setOptions({ schedule: true });
+        return this.#runMethod('execute', businessUnit, selectedTypes, keys);
+    }
+
     /**
      * pause an item
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
@@ -1476,7 +1476,7 @@ class Mcdev {
      * stop an item
      *
      * @param {string} businessUnit name of BU
-     * @param {string[] | TypeKeyCombo} [selectedTypes] limit to given metadata types
+     * @param {string[] | TypeKeyCombo} selectedTypes limit to given metadata types
      * @param {string[]} [keys] customerkey of the metadata
      * @returns {Promise.<Object.<string, Object.<string, string[]>>>} key: business unit name, key2: type, value: list of affected item keys
      */
@@ -1671,6 +1671,7 @@ class Mcdev {
         Util.startLogger();
         let lang_past;
         let lang_present;
+        let requireType;
         let requireKeyOrLike;
         let checkMetadataSupport;
         /** @type {Object.<string, Object.<string, string[]>>} */
@@ -1680,6 +1681,7 @@ class Mcdev {
             case 'execute': {
                 lang_past = 'executed';
                 lang_present = 'executing';
+                requireType = true;
                 requireKeyOrLike = true;
                 checkMetadataSupport = true;
                 break;
@@ -1687,6 +1689,7 @@ class Mcdev {
             case 'pause': {
                 lang_past = 'paused';
                 lang_present = 'pausing';
+                requireType = true;
                 requireKeyOrLike = true;
                 checkMetadataSupport = true;
                 break;
@@ -1694,6 +1697,7 @@ class Mcdev {
             case 'stop': {
                 lang_past = 'stopped';
                 lang_present = 'stopping';
+                requireType = true;
                 requireKeyOrLike = true;
                 checkMetadataSupport = true;
                 break;
@@ -1701,6 +1705,7 @@ class Mcdev {
             case 'publish': {
                 lang_past = 'published';
                 lang_present = 'publishing';
+                requireType = true;
                 requireKeyOrLike = true;
                 checkMetadataSupport = true;
                 break;
@@ -1708,6 +1713,7 @@ class Mcdev {
             case 'validate': {
                 lang_past = 'validated';
                 lang_present = 'validating';
+                requireType = true;
                 requireKeyOrLike = true;
                 checkMetadataSupport = true;
                 break;
@@ -1715,6 +1721,7 @@ class Mcdev {
             case 'fixKeys': {
                 lang_past = 'fixed keys';
                 lang_present = 'fixing keys';
+                requireType = false;
                 requireKeyOrLike = false;
                 checkMetadataSupport = false;
                 break;
@@ -1722,6 +1729,7 @@ class Mcdev {
             case 'replaceCbReference': {
                 lang_past = 'replaced references';
                 lang_present = 'replacing references';
+                requireType = false;
                 requireKeyOrLike = false;
                 checkMetadataSupport = true;
                 break;
@@ -1729,6 +1737,7 @@ class Mcdev {
             case 'refresh': {
                 lang_past = 'refreshed';
                 lang_present = 'refreshing';
+                requireType = true;
                 requireKeyOrLike = false;
                 checkMetadataSupport = true;
                 break;
@@ -1767,6 +1776,14 @@ class Mcdev {
                 selectedTypesObj = selectedTypes;
             }
         }
+        if (
+            requireType &&
+            !Array.isArray(selectedTypesArr) &&
+            (!selectedTypesObj || !Object.keys(selectedTypesObj).length)
+        ) {
+            Util.logger.error('At least one metadata type needs to be defined.');
+            return resultObj;
+        }
         const properties = await config.getProperties();
         if (!(await config.checkProperties(properties))) {
             // return null here to avoid seeing 2 error messages for the same issue


Test patch:
diff --git a/test/general.test.js b/test/general.test.js
index 0bee4239..b34059cc 100644
--- a/test/general.test.js
+++ b/test/general.test.js
@@ -2303,6 +2303,29 @@ describe('GENERAL', () => {
                 );
             });
         });
+
+        describe('Refresh ================', () => {
+            it('Should not refresh anything due to missing type', async () => {
+                // WHEN
+                const replace = await handler.refresh('testInstance/testBU', null);
+                // THEN
+                assert.equal(process.exitCode, 1, 'refresh should have thrown an error');
+                // retrieve result
+
+                assert.deepEqual(
+                    Object.keys(replace).length,
+                    0,
+                    'should not have replaced anything'
+                );
+
+                assert.equal(
+                    testUtils.getAPIHistoryLength(),
+                    0,
+                    'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
+                );
+                return;
+            });
+        });
     });
 
     describe('init ================', () => {