Removed redundant AuthModel parameter from sendHttpRequest and streamHttpRequest functions, now using authModel from HttpRequestModel directly. Updated all usages, tests, and related logic to reflect this change. Improved streaming response handling in CollectionStateNotifier and HttpResponseModel.
Renamed respModel and historyM to httpResponseModel and historyModel for improved code readability and consistency within the CollectionStateNotifier class.
Improved readability by expanding null checks with braces in CollectionStateNotifier methods. Also added a non-null assertion for historyM when adding a history request.
- Introduced APIAuthType enum for various authentication methods.
- Created APIAuthModel with basic authentication fields.
- Updated RequestModel to include authType and authData.
- Implemented EditAuthType widget for selecting and managing authentication.
- Enhanced CollectionStateNotifier to handle authentication updates.
:wq
- Changed return type of handlePreRequestScript and handlePostResponseScript to Future<RequestModel> for better type safety.
- Updated the logic to return the modified request model after executing scripts.
- Ensured that the request model is updated correctly in the sendRequest method after executing the pre-request script.
Refines JS bridge handlers to process messages directly as typed arguments, removing unnecessary JSON decoding and clarifying error logs.
Updates logic to only execute post-response scripts when present and corrects a warning message.
Refactors pre-request script execution to support environment variable manipulation.
Introduces a simplified key-value map for the environment within the JavaScript context, allowing easier script interaction. Updates the `ad.environment` JS API accordingly.
Implements logic on the Dart side to translate the structured environment model to the simple map before script execution and merge changes back from the map to the model afterward, persisting the modifications.
Initializes JavaScript runtime during application startup.
Executes user-defined pre-request scripts before sending API requests, allowing modification of request details like URL, headers, and body.
Updates script execution environment for better scoping and uses synchronous evaluation.
Updates request model state management to include pre-request and post-request script fields.
Connects the script editor UI to the state notifier, allowing script changes to be persisted.