add: hooks component
add support for hooks within bruno-lang
fix: hooks is not getting save
hooks implemtation
add hooks component within folders, requests
add: quick js shims for hooks
fix: garbage collected hook managers
send logs to main
rm: hook manager store
feat: introduce HOOK_EVENTS constant for improved hook management
add folder start/end events
add folder run events
rm: folder run related events
add cli support for hooks
support script:hooks instead of hooks
move hooks to script tab
make outer scope available within callback in safemode
added runner, req apis as an abstraction over event based hooks
fix: crash while editing folder hooks
rm: unused files
fix: self review changes
refactor, request specific hook manager deleted once
add: cm
rm: spaces
add prompt var
rm: indent
fix: lint
refactor: shims handling for hooks
fix: enable async calling in dev mode for gui, cli
fix: support async callbacks within safe mode
rm: vm instance
fix: review comments
fix: review comments
add cli tests for hooks
rm: client certs
fix: add hooks to oc yaml
fix: rename uid ot path name for better clarity, app crash when saving folder hooks
rm: console
rm: vm2 runtime leftover
rm: check
add: handler cleanup function
add: playwright test case for hooks
rm: review fixes
fix: review comments
add fallback hook manager
add fallback hook manager
fix: show error from hooks scripts within response pane
change: collection events name
feat: add name spaced hooks
fix: review comments
add: hooks specific collection for testing
use hooks manager as a private field
fix: tests
use collection from bruno-test within playwright
rm: databuffer test
fix: playwright test
rm: unintended changes
rm: file
* chore: update saveRequest calls from example to include silent parameter
- Modified multiple components to pass an additional `true` parameter to the `saveRequest` function, ensuring requests are saved silently when it comes to examples.
- Added AGENTS.md to .gitignore to exclude it from version control.
* feat: add success notifications for cloning, renaming and deleting examples
* refactor: update saveRequest calls to handle success notifications for renaming and deleting examples
* refactor: remove unused toast import from DeleteResponseExampleModal
refactor: improve snippet generation and update test cases
updated to minimise changes
fix: remove exclusive test flag
refactor: enhance interpolation utilities
refactor: expand interpolation utilities for auth, headers, body, and params
refactor: simplify request handling in snippet generation by removing lodash dependency and clarifying auth header processing
fix: tests
refactor: integrate interpolateObject utility for enhanced interpolation across auth, headers, body, and params
refactor: streamline body interpolation by removing lodash dependency and returning updated body structure
refactor: enhance body interpolation logic and streamline auth header processing in snippet generation
refactor: simplify getAuthHeaders function by removing unnecessary parameters for improved clarity
refactor: replace interpolateObject with interpolate for body
* feat: enhance OAuth2 support in snippet generation
* Updated getAuthHeaders function to handle OAuth2 authentication, including token retrieval and placement.
* Added tests for OAuth2 scenarios, ensuring correct Authorization header generation and handling of edge cases.
* Improved error handling for access token retrieval from stored credentials.
* refactor: standardize comparison operators in getAuthHeaders function
* Updated comparison operators in the getAuthHeaders function to use strict equality (===) for improved consistency and reliability in credential checks.
* fix: correct block structure in OAuth2 case of getAuthHeaders function
* Added missing block structure for the 'oauth2' case in the getAuthHeaders function to ensure proper execution flow and maintain code clarity.
* feat: enhance OAuth2 credential retrieval in getAuthHeaders function
* Updated getAuthHeaders function to support retrieval of stored OAuth2 credentials based on collection and item context.
* Improved access token handling by checking for existing credentials before falling back to default values.
* Enhanced test coverage for OAuth2 scenarios to ensure accurate token management and error handling.
* fix: preserve tokenHeaderPrefix value in OAuth2 configuration
* Updated snippet-generator.spec.js to ensure that the tokenHeaderPrefix from OAuth2 configuration is preserved, allowing for empty string scenarios.
* Default to 'Bearer' only if the tokenHeaderPrefix is undefined, enhancing flexibility in token management.
* fix: ensure consistent formatting of authorization header in OAuth2 handling
* Updated getAuthHeaders function to always trim the final result of the authorization header for consistent formatting.
* Adjusted snippet-generator.spec.js to reflect the same trimming logic for the access token, enhancing test reliability.
* fix: clarify token placement handling in getAuthHeaders function
* Updated comments in the getAuthHeaders function to specify that when tokenPlacement is 'url', no auth headers are added, and that token placement in the URL/query params must be managed separately.
* fix: ensure safe handling of OAuth2 credentials in getAuthHeaders function
* Updated getAuthHeaders function to default to an empty array when accessing oauth2Credentials, preventing potential errors when no credentials are available.
Add `isSafeMode()` to Bru API that returns `true` in
case the runtime is a sandbox.
This allows for scripts to test for and handle whether
running in sandbox or not:
```javascript
if (bru.isSafeMode()) {
throw new Error('This script requires Developer mode')
}
```
Co-authored-by: Anoop M D <anoop@usebruno.com>
* fix: include auth in request data for GenerateCodeItem
* fix: conditionally include auth in request data for GenerateCodeItem
* fix: simplify auth inclusion in requestData
* fix: streamline auth assignment in requestData for GenerateCodeItem
* fix: clarify comments on auth resolution
* feat: enhance autosave middleware to support environment draft and folder auth drafts
* feat: extend autosave middleware to handle global and collection environment drafts
* feat: update authentication components to use unified updateAuth function
* refactor: rename updateAuth to updateFolderAuth for consistency in authentication components
* feat: add SVG support for HTML preview in response format handling
* feat: enhance content type detection by adding support for AVIF and SVG formats
* fix: exclude SVG from byte format type detection in response preview
* feat: add helper function to detect SVG content in response handling
* fix: ensure SVG content type detection is case insensitive and remove EPS detection
* fix: correct byte offset for AVIF content type detection in response handling
* fix: preserve workspace name casing in title bar (#6522)
* fix: improve workspace display name handling in title bar
---------
Co-authored-by: Uzairkazi695 <kaziuzair695@gmail.com>
* refactor: enhance WSRequestPane and WSResponsePane with ResponsiveTabs component
- Replaced custom tab implementation with ResponsiveTabs for better consistency and usability.
- Utilized useMemo and useCallback for performance optimizations in tab management.
- Cleaned up unused styles and improved error handling in both components.
- Updated StyledWrapper to remove legacy tab styles, streamlining the component structure.
* refactor: streamline authentication components and enhance WSRequestPane layout
- Removed unnecessary margin from StyledWrapper in ApiKeyAuth, BasicAuth, and BearerAuth components for a cleaner layout.
- Introduced a new right content area in WSRequestPane for better organization of authentication modes.
- Added a 'No Auth' view in WSAuth for improved user feedback when no authentication is selected.
- Cleaned up unused imports and optimized component structure for maintainability.
* fix: grpc import paths
* refactor: extract protobuf include directory logic into a separate function
* rm: comment
* fix: improve filtering of enabled import paths in protobuf configuration
* refactor: streamline import path handling in protobuf configuration
- Removed local state for activeTab and integrated Redux for tab state management.
- Added logic to retrieve and update the active tab using Redux store.
- Updated tab click handler to dispatch actions for tab changes.
* refactor: simplify HtmlPreview component by extracting render logic into a separate function
* refactor: wrap renderHtmlPreview in a fragment for improved JSX structure
* fix: update preview visibility check in response format tests
* refactor: enhance GrpcRequestPane and GrpcResponsePane with ResponsiveTabs component
- Replaced custom tab implementation with ResponsiveTabs for better structure and usability.
- Utilized useMemo and useCallback for performance optimizations in GrpcRequestPane.
- Removed unused imports and simplified tab management logic.
- Updated StyledWrapper to remove legacy tab styles, improving maintainability.
* fix: handle optional chaining for auth mode in GrpcRequestPane
* feat: enhance GrpcRequestPane and GrpcResponsePane with tab initialization and response count indicators
* refactor: simplify GrpcResponsePane tab management and enhance ResponsiveTabs key handling
- Removed unnecessary useMemo for tab initialization in GrpcResponsePane.
- Updated tab comparison logic in ResponsiveTabs to use key arrays for improved performance.
- Adjusted test locator for response tab count to use role-based selection for better accessibility.
* feat: add support for 'none' auth mode in GrpcAuth and integrate GrpcAuthMode in GrpcRequestPane
- Updated StyledWrapper in ApiKeyAuth, BasicAuth, BearerAuth, OAuth2, WsseAuth, and GrpcAuth components to remove unnecessary margin-top, ensuring a uniform appearance across authentication interfaces.
- Adjusted margin in GrantTypeSelector and WSAuth components for better layout consistency.
* refactor: update import statement and enhance error handling in GrpcRequestPane
- Changed the import of 'find' from lodash to a direct import for better clarity.
- Improved error handling by returning null during initialization when requestPaneTab is not set, ensuring smoother user experience.
* refactor: integrate StyledWrapper in SearchInput for improved styling
* refactor: update StyledWrapper color and adjust margin in GrpcTimelineItem for improved layout consistency
* refactor: remove HTML validation functions and simplify HtmlPreview component logic
* chore: fix playwright - removed body value check since response is rendered in webview
---------
Co-authored-by: Bijin A B <bijin@usebruno.com>