@@ -675,9 +675,6 @@ export class Action<
675675
676676 // Construct the request client and perform the poll operation
677677 const requestClient = this . createRequestClient ( dataBundle )
678- if ( ! this . definition . pollStatus ) {
679- throw new IntegrationError ( 'Poll method is not defined.' , 'NotImplemented' , 501 )
680- }
681678 const pollResponse = await this . definition . pollStatus ( requestClient , dataBundle )
682679
683680 return pollResponse
@@ -817,17 +814,19 @@ export class Action<
817814 * Try to use the parsed response `.data` or `.content` string
818815 * @see {@link ../middleware/after-response/prepare-response.ts }
819816 */
820-
821- // Handle async action responses by returning them as it is
822- if ( response && typeof response === 'object' && ( response as any ) . isAsync === true ) {
823- return response
824- }
817+ console . log ( '[parseResponse] response type:' , typeof response )
818+ console . log ( '[parseResponse] response instanceof Response:' , response instanceof Response )
819+ console . log ( '[parseResponse] response value:' , JSON . stringify ( response ) )
820+ console . log ( '[parseResponse] response.data:' , ( response as ModifiedResponse ) . data )
825821
826822 if ( response instanceof Response ) {
827- return ( response as ModifiedResponse ) . data ?? ( response as ModifiedResponse ) . content
823+ const result = ( response as ModifiedResponse ) . data ?? ( response as ModifiedResponse ) . content
824+ console . log ( '[parseResponse] extracted from Response — .data/.content:' , JSON . stringify ( result ) )
825+ return result
828826 }
829827
830828 // otherwise, we don't really know what this is, so return as-is
829+ console . log ( '[parseResponse] returning as-is (not a Response instance)' )
831830 return response
832831 }
833832
0 commit comments