@@ -64,13 +64,13 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
6464 stage : 'Validating Authoring Bundle' ,
6565 label : 'Status' ,
6666 type : 'dynamic-key-value' ,
67- get : ( data ) : string | undefined => data ?. status ?? 'In Progress ' ,
67+ get : ( data ) : string => data ?. status ?? 'IN PROGRESS ' ,
6868 } ,
6969 {
7070 stage : 'Validating Authoring Bundle' ,
7171 label : 'Errors' ,
7272 type : 'dynamic-key-value' ,
73- get : ( data ) : string | undefined => data ?. errors ?? '0' ,
73+ get : ( data ) : string => data ?. errors ?? '0' ,
7474 } ,
7575 ] ,
7676 } ) ;
@@ -81,11 +81,8 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
8181 const conn = targetOrg . getConnection ( flags [ 'api-version' ] ) ;
8282 // Call Agent.compileAfScript() API
8383 await sleep ( Duration . seconds ( 2 ) ) ;
84- const result = await Agent . compileAfScript (
85- conn ,
86- readFileSync ( join ( authoringBundleDir , `${ flags [ 'api-name' ] } .agent` ) , 'utf8' )
87- ) ;
88- mso . updateData ( { status : result !== undefined ? 'Success' : 'Failure' } ) ;
84+ await Agent . compileAfScript ( conn , readFileSync ( join ( authoringBundleDir , `${ flags [ 'api-name' ] } .agent` ) , 'utf8' ) ) ;
85+ mso . updateData ( { status : 'COMPLETED' } ) ;
8986 mso . stop ( 'completed' ) ;
9087 return {
9188 success : true ,
@@ -104,8 +101,8 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
104101 } )
105102 . join ( '\n' ) ;
106103
107- mso . updateData ( { errors : count . toString ( ) , status : 'Failure ' } ) ;
108- mso . stop ( ) ;
104+ mso . updateData ( { errors : count . toString ( ) , status : 'ERROR ' } ) ;
105+ mso . error ( ) ;
109106
110107 this . log ( messages . getMessage ( 'error.compilationFailed' , [ formattedError ] ) ) ;
111108 return {
0 commit comments