Skip to content

feat(scrapeURL): return js returns from f-e (FIR-1535)#1385

Merged
mogery merged 2 commits intomainfrom
mog/new-actions
Mar 28, 2025
Merged

feat(scrapeURL): return js returns from f-e (FIR-1535)#1385
mogery merged 2 commits intomainfrom
mog/new-actions

Conversation

@mogery
Copy link
Member

@mogery mogery commented Mar 28, 2025

No description provided.

@mogery mogery requested review from Copilot and tomkosm March 28, 2025 11:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality for returning JavaScript execution results from the front-end scraping engine.

  • Adds a new javascriptReturns field to the EngineScrapeResult type and related types.
  • Filters and processes JavaScript execution results in the fire-engine scraper and updates schema validation in checkStatus.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
apps/api/src/scraper/scrapeURL/engines/index.ts Added javascriptReturns field to the EngineScrapeResult type
apps/api/src/scraper/scrapeURL/engines/fire-engine/index.ts Processed and mapped javascriptReturns from response action results
apps/api/src/scraper/scrapeURL/engines/fire-engine/checkStatus.ts Extended schema validation to include executeJavascript results and updated error checks
apps/api/src/controllers/v1/types.ts Updated Document type to include an optional javascriptReturns field
Comments suppressed due to low confidence (1)

apps/api/src/scraper/scrapeURL/engines/fire-engine/index.ts:277

  • Consider adding error handling around JSON.parse to avoid potential runtime exceptions if the input string is not valid JSON.
javascriptReturns: (response.actionResults ?? []).filter(x => x.type === "executeJavascript").map(x => JSON.parse((x.result as any as { return: string }).return)),

@mogery mogery changed the title feat(scrapeURL): return js returns from f-e feat(scrapeURL): return js returns from f-e (FIR-1535) Mar 28, 2025
Copy link
Collaborator

@tomkosm tomkosm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mogery mogery merged commit 46048bc into main Mar 28, 2025
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants