diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 05368355c..3dacf3934 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -144,11 +144,19 @@ class Automation extends MetadataType { })); found++; } else { - throw new TypeError(JSON.stringify(notificationsResult)); + if ( + !notificationsResult || + typeof notificationsResult !== 'object' || + Object.keys(notificationsResult).length !== 1 || + !notificationsResult?.programId + ) { + throw new TypeError(JSON.stringify(notificationsResult)); + } + // * if there are no automation notifications, the API returns a single object with the programId } } catch (ex) { Util.logger.debug( - ` ☇ skipping Notifications for Automation ${automationLegacy.key}: ${ex.message} ${ex.code}` + ` ☇ issue retrieving Notifications for automation ${automationLegacy.key}: ${ex.message} ${ex.code}` ); skipped++; } @@ -397,14 +405,22 @@ class Automation extends MetadataType { activity.activityObjectId == null ) { Util.logger.debug( - ` - skip parsing of activity due to missing activityObjectId: ${JSON.stringify( - activity - )}` + ` - skipping ${ + metadata[this.definition.keyField] + } activity ${stepNumber}.${ + activity.displayOrder + } due to missing activityObjectId: ${JSON.stringify(activity)}` ); // empty if block } else if (!this.definition.dependencies.includes(activity.r__type)) { Util.logger.debug( - ` - skip parsing because the type is not set up as a dependecy for ${this.definition.type}` + ` - skipping ${ + metadata[this.definition.keyField] + } activity ${stepNumber}.${ + activity.displayOrder + } because the type ${ + activity.r__type + } is not set up as a dependency for ${this.definition.type}` ); } // / if managed by cache we can update references to support deployment diff --git a/lib/util/util.js b/lib/util/util.js index 315fcd1b1..68a1a41e6 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -266,6 +266,7 @@ const Util = { filename: 'logs/' + logFileName + '.log', level: 'debug', // log everything format: winston.format.combine( + winston.format.uncolorize(), winston.format.timestamp({ format: 'HH:mm:ss.SSS' }), winston.format.simple(), winston.format.printf( @@ -278,6 +279,7 @@ const Util = { filename: 'logs/' + logFileName + '-errors.log', level: 'error', // only log errors format: winston.format.combine( + winston.format.uncolorize(), winston.format.timestamp({ format: 'HH:mm:ss.SSS' }), winston.format.simple(), winston.format.printf(