# APICallMapper

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/api-call-mapper.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/api-call-mapper.ts#L80)

API Call Mapper

## Methods

| Method | Signature | Returns |
|---|---|---|
| `detectAPICalls` | `detectAPICalls(entities: Entity[])` | `DetectedAPICall[]` |
| `detectEndpoints` | `detectEndpoints(entities: Entity[])` | `DetectedEndpoint[]` |
| `mapCallsToEndpoints` | `mapCallsToEndpoints(calls: DetectedAPICall[], endpoints: DetectedEndpoint[])` | `APIMapping[]` |

## Where it refuses work

- `APICallMapper` stops the work with an early return when `call.method === endpoint.method && this.pathsMatch(callPath, endpoint.path)`.
- `APICallMapper` stops the work with an early return when `call.method === endpoint.method && this.pathsPartialMatch(callPath, endpoint.path)`.
- `APICallMapper` stops the work with an early return when `call.method === endpoint.method && this.pathsSimilar(callPath, endpoint.path)`.
- `APICallMapper` stops the work with an early return when `!base`.
- `APICallMapper` stops the work with an early return when `!path`.
- `APICallMapper` stops the work with an early return when `callSegments.length !== endpointSegments.length`.
