Commit Graph

10 Commits

Author SHA1 Message Date
Udhay-Adithya
1dab4fe007 feat: add pre_post_script_utils test 2025-07-02 00:09:30 +05:30
Ankit Mahato
053d2ea309 Update flutter_js_service.dart 2025-06-29 01:23:20 +05:30
Ashita Prasad
53fff89056 Update flutter_js_service.dart 2025-06-22 21:24:03 +05:30
Udhay-Adithya
12aa846792 feat: update scripts code pane to use ad dropdown button 2025-06-22 20:09:50 +05:30
Udhay-Adithya
14ff728870 fix: JS bridge message handling and script execution checks
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.
2025-05-16 14:30:58 +05:30
Udhay-Adithya
c2c67a7fca feat: implement post-response script handling and update environment variables 2025-05-02 01:26:52 +05:30
Udhay-Adithya
36061f660a feat add pre-request script execution
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.
2025-05-01 16:48:50 +05:30
Udhay-Adithya
fadf49372f feat: add support for pre-request scripts
Introduces `preRequestScript` and `postRequestScript` fields to the request model to store user-defined scripts.

Implements a service using `flutter_js` to execute JavaScript pre-request scripts before a request is sent.
The script can access and modify request data (like headers, body, URL) and environment variables.

Adds bridging to forward JavaScript `console.log`, `console.warn`, and `console.error` calls to the Dart console for easier debugging
2025-04-25 23:26:31 +05:30
Udhay-Adithya
839d8b5c00 feat: add JavaScript scripting foundation
Introduces a JavaScript setup script that defines the `ad` helper object.
This `ad` object exposes APIs for manipulating request data, accessing response details, and managing environment variables within scripts.

Adds an `evaluate` function to execute JS code using the `flutter_js` runtime and log results or errors.
This establishes the core infrastructure for pre-request and post-response scripting.
2025-04-25 22:34:02 +05:30
Udhay-Adithya
f97b39a103 feat: add flutter_js dependency and implement JS runtime service 2025-04-22 14:39:06 +05:30