File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -502,8 +502,14 @@ class SocketSdk {
502502
503503 try {
504504 const client = await this . #getClient( )
505- const data = await client . post ( `purl?${ formattedQueryParam } ` , { json : components } ) . json ( )
506- return { success : true , status : 200 , data }
505+ const data = await client . post ( `purl?${ formattedQueryParam } ` , { json : components } )
506+
507+ // Parse the ndjson response
508+ const /** @type {{[key: string]: any}[] } */ resp_json = [ ]
509+ const ndjson = data . body . split ( '\n' )
510+ ndjson . map ( o => o && resp_json . push ( JSON . parse ( o ) ) )
511+
512+ return { success : true , status : 200 , data : resp_json }
507513 } catch ( err ) {
508514 return /** @type {SocketSdkErrorType<'batchPackageFetch'> } */ ( this . #handleApiError( err ) )
509515 }
You can’t perform that action at this time.
0 commit comments