# Adapter

## What it is responsible for

Adapter turns application handling into environment-specific adapter behavior, with AWS Lambda conversion explicitly documented and connection information extracted across Lambda event sources. `getConnInfo` reads client IP information from API Gateway v1, API Gateway v2, and other documented Lambda sources, while `LambdaEvent` is a work entry point for Lambda event handling. The subsystem also addresses Bun, Cloudflare Pages, Deno, Netlify, and Service Worker connection or request adaptation, as indicated by its documented adapter comments.

## What it needs, and who needs it

Adapter depends on `Utils`, `src/middleware`, and `Helper`. No subsystem is recorded as depending on Adapter. Without those dependencies, Adapter’s documented Lambda conversion, connection-information extraction, and environment-specific adapters would lack their listed supporting modules; the evidence does not identify a more specific failure mode.

## Notable members

`getConnInfo` is the direct connection-information path: its comment says it extracts client IP addresses from various AWS Lambda event sources, including API Gateway v1 and v2. `LambdaEvent` is a documented work entry point and is associated with converting a Hono application to an AWS Lambda handler. `defaultIsContentTypeBinary` checks whether a content type is binary; `isContentEncodingBinary` names the related content-encoding binary check. Processor symbols include `EventV2Processor`, `EventV1Processor`, `ALBProcessor`, and `LatticeV2Processor`; available evidence does not state how `getProcessor` selects them at runtime.

71 entities in `src/adapter`. Nothing else in this repository depends on it.

## What it is made of

Its 71 entities sit in 26 files under `src/adapter`: 31 functions, 22 interfaces, 7 type aliases, 6 constants and 5 more.
`handler.ts` holds 16 of them — more than any other file here.
`EventProcessor` declares 11 methods, the widest surface here.

## Where work enters

- [`getConnInfo`](function-getconninfo-2) — `src/adapter/aws-lambda/conninfo.ts`:45
- [`LambdaEvent`](type-lambdaevent) — `src/adapter/aws-lambda/handler.ts`:23
- [`LatticeProxyEventV2`](interface-latticeproxyeventv2) — `src/adapter/aws-lambda/handler.ts`:29
- [`APIGatewayProxyEventV2`](interface-apigatewayproxyeventv2) — `src/adapter/aws-lambda/handler.ts`:41

## How it refuses and fails

1 of its components records a refusal or a failure handler.
It refuses work outright, under a condition written into the component itself.

## Boundaries

It depends on `Utils`, `Middleware`, `Helper`, and on nothing else in this repository.
