Skip to content
1 min read · 208 words

Interface: ScrapperRequestContext

Defined in: src/batteries/tools/scrapper/shared.ts:117

Mutable context handed to each input-pipeline stage before the HTTP request is sent. Identical for both verbs.

Properties

PropertyModifierTypeDescriptionDefined in
headerspublicToolHeadersResolved request headers sent to the SCRAPPER INSTANCE (auth). Mutable.src/batteries/tools/scrapper/shared.ts:125
instanceUrlreadonlystringThe Scrapper instance base URL (read-only).src/batteries/tools/scrapper/shared.ts:127
paramspublicRecord<string, string>Wire-kebab query params (everything except url). Mutable.src/batteries/tools/scrapper/shared.ts:123
stashreadonlyMap<string, unknown>Cross-stage scratch space; also carried onto the response context.src/batteries/tools/scrapper/shared.ts:129
toolNamereadonlystringThe tool's name (read-only).src/batteries/tools/scrapper/shared.ts:119
urlpublicstringThe target page URL (the url argument). Mutable.src/batteries/tools/scrapper/shared.ts:121

Methods

shortCircuit()

ts
shortCircuit(result: string): void;

Defined in: src/batteries/tools/scrapper/shared.ts:131

Skip the fetch and return result verbatim as the tool's output (e.g. a cache hit).

Parameters

ParameterType
resultstring

Returns

void