The TypeScript package
An ESM package with strict types and no runtime dependencies. It uses the standard fetch, so it runs on Node.js 20+, Deno, Bun, Cloudflare Workers and in browsers, and it never calls Latitude 10.
Its files
| File | What it holds |
|---|---|
package.json | The name and version, "type": "module" and "engines": { "node": ">=20" }. |
src/client.ts | The client class, named by clientName. |
src/resources/ | The operations, grouped by tag, a method each. |
src/models.ts | The types from your document's schemas. |
src/core.ts | The runtime, the same file in every SDK we generate. It holds no text from your document. |
src/index.ts | What the package exports. |
README.md | Install, use, each resource's methods, errors and retries. |
GENERATION.md | How it was generated, and anything skipped. |
CHANGELOG.md | What changed in each version. |
LICENSE | MIT, in the holder's name. |
tsconfig.json | The build settings. |
Auth
The client takes apiKeys by security scheme name, bearerToken as a string or a function it asks before every request, so you can refresh it, or username and password for basic auth. Each operation sends the first of its schemes the client has credentials for.
Retries and timeouts
- Connection errors, timeouts,
408,429and5xxare retried with backoff, andRetry-Afteris honoured. POSTandPATCHare retried only with an idempotency key:idempotencyKeyin a call's options, or one made for you when the operation declares anIdempotency-Keyheader.- Set
maxRetriesandtimeoutMson the client or per call, and passsignalto cancel.
Errors
A response outside 2xx throws an APIError with status, headers, body and requestId, as one of BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError or InternalServerError. A network failure throws APIConnectionError, a timeout APITimeoutError. All of them extend the client's own error class.
Every method also has a …WithResponse sibling that returns { data, response }, for the headers and the status.
Pagination
An operation that pages, by cursor, offset or page number, returns a page you can await for the first page, or walk with for await for every item of every page. OpenAPI extensions says how a paging operation is found, and GENERATION.md says which methods page.
Where this comes from
app/sdk/_lib/typescript/emit.tsapp/sdk/_lib/typescript/runtime/core.tsapp/sdk/_lib/model.tstests/fixtures/sdk/petstore/expected/README.md