Skip to content
1 min read · 208 words

Interface: ScrapperRequestContext

Defined in: batteries/tools/scrapper/shared.ts:115

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.batteries/tools/scrapper/shared.ts:123
instanceUrlreadonlystringThe Scrapper instance base URL (read-only).batteries/tools/scrapper/shared.ts:125
paramspublicRecord<string, string>Wire-kebab query params (everything except url). Mutable.batteries/tools/scrapper/shared.ts:121
stashreadonlyMap<string, unknown>Cross-stage scratch space; also carried onto the response context.batteries/tools/scrapper/shared.ts:127
toolNamereadonlystringThe tool's name (read-only).batteries/tools/scrapper/shared.ts:117
urlpublicstringThe target page URL (the url argument). Mutable.batteries/tools/scrapper/shared.ts:119

Methods

shortCircuit()

ts
shortCircuit(result: string): void;

Defined in: batteries/tools/scrapper/shared.ts:129

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

Parameters

ParameterType
resultstring

Returns

void