From a6b19fc8bff58ad9b179b8a50f8aa288557dad82 Mon Sep 17 00:00:00 2001 From: Siddharth Gelera Date: Wed, 17 Sep 2025 16:04:50 +0530 Subject: [PATCH] fix: imports for ws files --- .../components/RequestPane/WsBody/index.js | 75 ------------------- .../bruno-app/src/utils/collections/index.js | 12 ++- .../bruno-app/src/utils/importers/common.js | 9 ++- packages/bruno-electron/src/ipc/collection.js | 2 +- .../bruno-filestore/src/formats/bru/index.ts | 2 +- 5 files changed, 19 insertions(+), 81 deletions(-) diff --git a/packages/bruno-app/src/components/RequestPane/WsBody/index.js b/packages/bruno-app/src/components/RequestPane/WsBody/index.js index 215d68686..818c7b511 100644 --- a/packages/bruno-app/src/components/RequestPane/WsBody/index.js +++ b/packages/bruno-app/src/components/RequestPane/WsBody/index.js @@ -60,49 +60,6 @@ const SingleWSMessage = ({ }; const onSave = () => dispatch(saveRequest(item.uid, collection.uid)); - const onRegenerateMessage = async () => { - try { - const methodPath = item.draft?.request?.method || item.request?.method; - - if (!methodPath) { - toastError(new Error('Method path not found in request')); - return; - } - - // Find the method metadata from the appropriate cache - let methodMetadata = null; - - const result = await generateGrpcSampleMessage(methodPath, content, { - arraySize: 2, - methodMetadata // Pass the method metadata to the function - }); - - if (result.success) { - const currentMessages = [...(body.ws || [])]; - - currentMessages[index] = { - name: name ? name : `message ${index + 1}`, - content: result.message - }; - - dispatch( - updateRequestBody({ - content: currentMessages, - itemUid: item.uid, - collectionUid: collection.uid - }) - ); - - toast.success('Sample message generated successfully!'); - } else { - toastError(new Error(result.error || 'Failed to generate sample message')); - } - } catch (error) { - console.error('Error generating sample message:', error); - toastError(error); - } - }; - const onDeleteMessage = () => { const currentMessages = [...(body.ws || [])]; @@ -168,38 +125,6 @@ const SingleWSMessage = ({ - - - - - {canClientStream && ( - - - - )} - {index > 0 && (