@svatah/yam-adapter-http
HTTP/API adapter
- Source:
packages/adapter-http· README:packages/adapter-http/README.md - Install:
npm install @svatah/yam-adapter-http - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
ApiRequestError | class | export class ApiRequestError extends Error | |
createHttpSurface | function | export function createHttpSurface(config: Config, overrides: HttpAdapterOptions = {}): HttpSurface | Build an HTTP surface from a project config (LLD §2.4). |
executeRequest | function | export async function executeRequest( | Execute one request. |
expand | function | export function expand(text: string, scope: TemplateScope): string | Expand every {…} in a string. A reference with no value becomes empty. |
expandRecord | function | export function expandRecord( | Expand every string in a record. |
fillPathParams | function | export function fillPathParams( | Substitute :name and {name} in a URL path from pathParams. |
HttpAdapterOptions | interface | export interface HttpAdapterOptions | |
HttpSurface | class | export class HttpSurface implements AgentSurface | |
JsonPathError | class | export class JsonPathError extends Error {} | The JSON-path subset a capture uses (REQ-ADP-2: "responses are JSON-path |
parseJsonPath | function | export function parseJsonPath(path: string): Segment[] | Parse $.a.b[0] into segments. Throws on anything outside the subset. |
readJsonPath | function | export function readJsonPath(body: unknown, path: string): unknown | Read a path out of a parsed body. undefined when it is not there. |
registerHttpAdapter | function | export function registerHttpAdapter(): void | |
RequestOptions | interface | export interface RequestOptions | |
TemplateScope | interface | export interface TemplateScope | What a template can read. {data.x}, {input.x}, {x} and {Story.x}. |