* 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.
* feat: add user-agent support in gRPC client channel options
- Extracted user-agent from request headers and set it as grpc.primary_user_agent channel option.
- Updated client instantiation to merge user-agent with existing channel options for enhanced request handling.
* test: add unit tests for GrpcClient user-agent handling
* test: enhance GrpcClient user-agent tests with edge case handling
* test: enhance GrpcClient channelOptions handling with override capability
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: implement translation utilities for converting Bruno scripts to Postman format
- Added `bru-to-pm-translator` for translating Bruno API calls to Postman equivalents.
- Introduced `pm-to-bru-translator` for reverse translations from Postman to Bruno.
- Created utility functions in `ast-utils` for efficient AST manipulations.
- Enhanced `bruno-to-postman.js` to utilize the new translation functions for script handling.
- Updated tests to cover various translation scenarios, ensuring accuracy and reliability.
* empry commint
* refactor: migrate utility functions to ES module syntax
- Converted utility functions in `ast-utils.js` to named exports for better modularity.
- Updated import statements in `bru-to-pm-translator.js` and `pm-to-bru-translator.js` to use ES module syntax.
- Refactored test files to align with the new import structure, enhancing consistency across the codebase.
* fix: translations
* fix: add info regarding cookie apis
* simplify translations removing legacy inverse translation
* fix: add translation for getFolderVAr
* refactor: simplify transformation functions by removing change tracker
* fix: renamed files and folders
* fix: import statements
* rm : file
* simplify getSize translation
* feat: add support for skipped files in run command and update HTML report template
* refactor: enhance skipped file handling in run command
* fix: improve error display in HTML report for skipped requests
* test: add unit test for HTML report generation of skipped requests with parsing errors
* test: update HTML report generation tests to check for skipped request summaries
* refactor: extract skipped result creation logic into a separate utility function
* refactor: enhance skipped result processing in run command to include additional metadata
* refactor: rename and enhance createSkippedResults function for improved skipped file processing
* refactor: remove unused stripExtension import from run command
* refactor: rename createSkippedResults to createSkippedFileResults for clarity and consistency
* 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>
* feat: apply modified dataBuffer to the response
* fix: ensure dataBuffer regeneration only occurs when res.setBody() is called
* refactor: update dataBuffer handling in BrunoResponse