@@ -20,19 +20,18 @@ export const ConfigurationDto = {
20
20
* @returns {{
21
21
* }}
22
22
*/
23
- toJSON : ( configuration ) => ( {
24
- version : configuration . getVersion ( ) ,
25
- jobs : configuration . getJobs ( ) ,
26
- ...( configuration . getHandlers ( ) ? { handlers : configuration . getHandlers ( ) } : { } ) ,
27
- queues : configuration . getQueues ( ) ,
28
- ...( configuration . getSlackRoles ( ) ? { slackRoles : configuration . getSlackRoles ( ) } : { } ) ,
29
- ...( configuration . getEnabledSandboxAudits && configuration . getEnabledSandboxAudits ( ) . length > 0
30
- ? {
31
- sandboxAudits : configuration . getEnabledSandboxAudits ( ) . reduce ( ( acc , auditType ) => {
32
- acc [ auditType ] = configuration . getSandboxAuditConfig ( auditType ) ;
33
- return acc ;
34
- } , { } ) ,
35
- }
36
- : { } ) ,
37
- } ) ,
23
+ toJSON : ( configuration ) => {
24
+ const result = {
25
+ version : configuration . getVersion ( ) ,
26
+ jobs : configuration . getJobs ( ) ,
27
+ ...( configuration . getHandlers ( ) ? { handlers : configuration . getHandlers ( ) } : { } ) ,
28
+ queues : configuration . getQueues ( ) ,
29
+ ...( configuration . getSlackRoles ( ) ? { slackRoles : configuration . getSlackRoles ( ) } : { } ) ,
30
+ ...( configuration . state ?. sandboxAudits
31
+ ? { sandboxAudits : configuration . state . sandboxAudits }
32
+ : { } ) ,
33
+ } ;
34
+ console . log ( '[ConfigurationDto] Serializing configuration with sandboxAudits:' , configuration . state ?. sandboxAudits ) ;
35
+ return result ;
36
+ } ,
38
37
} ;
0 commit comments