# Contributing to the Elastic Email TypeScript SDK

Thanks for taking the time to contribute! This document explains how to report problems, suggest changes and submit pull requests.

## Before you start: this SDK is generated

Almost everything in this repository (`ee-api/`, `ee-api-models/`, `api.ts`, `base.ts`, `common.ts`, `configuration.ts`, `index.ts` and most of `README.md`) is generated by [OpenAPI Generator](https://openapi-generator.tech) from the Elastic Email API specification.

This means:

- **Manual edits to generated files will be overwritten** by the next release.
- If an endpoint, model, parameter or description is wrong or missing, the fix belongs in the API specification. Please [open an issue](https://github.com/ElasticEmail/elasticemail-ts-axios/issues/new/choose) describing the problem. We'll fix it upstream and regenerate the SDK.
- Pull requests are most useful for non-generated content: documentation, examples, tests, build and CI configuration, and repository tooling.

If you're not sure whether something is generated, open an issue first and ask.

## Reporting bugs

Search [existing issues](https://github.com/ElasticEmail/elasticemail-ts-axios/issues) first. If nothing matches, open a new issue using the **Bug report** template and include:

- SDK version (from npm, e.g. `4.2.0`; run `npm ls @elasticemail/elasticemail-client-ts-axios`)
- Node.js version (`node -v`) and TypeScript version, or the browser and bundler if you use it on the front end
- The API method you called and a minimal code sample
- The full error message and HTTP status code (`error.response?.status` and `error.response?.data` from the axios error)

**Never paste your API key** into an issue, log or code sample.

Questions about your Elastic Email account, sending limits, deliverability or billing aren't handled in this repository. The preferred way to get help is the **chat widget on [elasticemail.com](https://elasticemail.com)**.

Looking for sample code? See the [Elastic Email examples repository](https://github.com/ElasticEmail/elasticemail-examples), including the [Node.js examples](https://github.com/ElasticEmail/elasticemail-examples/tree/main/nodejs-elasticemail-examples).

## Suggesting features

Open an issue using the **Feature request** template. Describe the use case first and the solution second. It helps us decide whether the change belongs in the API, the SDK or the documentation.

## Security issues

Please do **not** report security vulnerabilities in public issues. See [SECURITY.md](SECURITY.md).

## Development setup

Requirements: [Node.js](https://nodejs.org) and npm (current LTS recommended).

```bash
git clone https://github.com/ElasticEmail/elasticemail-ts-axios.git
cd elasticemail-ts-axios
npm install
npm run build
```

`npm run build` compiles the TypeScript sources into `dist/` with `tsc`. Keep the library compatible with its current `es6` target and don't add new runtime dependencies without discussing it in an issue first.

## Pull requests

1. Fork the repository and create a branch from `master` (`git checkout -b fix/short-description`).
2. Keep each change focused. One logical change per pull request.
3. Make sure `npm run build` passes.
4. Update documentation if your change affects how the SDK is used.
5. Open a pull request against `master` and fill in the template.

A maintainer will review your pull request and may ask for changes. When a change touches generated code, we may apply it upstream instead of merging the PR directly. You'll still get credit in the release notes.

## Code of Conduct

This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold it.

## License

By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
