This repository aims to provide a way to quickly generate the latest typescript API client to use with NMKR Studio
In this folder you will find a package.json file with two commands generate-local to generate a client defined by the API definition from the swagger.json file. This can be useful if you want to test new API endpoints or one which still is in development. Additionally, the generate-latest command which will pull the latest available swagger file from https://studio-api.nmkr.io/swagger/v2/swagger.json
TLDR;
npm installto install the dependenciesnpm install openapi-typescript-codegen --save-devto install the generatornpm run generate-localfrom local swagger.json filenpm run generate-latestfrom latest published version on the web
Afterwards, you will find under /nmkr-studio-api/src the generated typescript files. To build them, navigate to cd /nmkr-studio-api in the terminal and run
npm run testnpm run lintnpm run formatnpm run build
To run the tests, you need to provide an API-Key for a NMKR STUDIO ACCOUNT with at least 1 project. This has to be saved in a .env file similar as the .env.example file.
In case you have access rights to the NPM-Account you can, after testing, deploy the new version to npm (only with the required account) via:
npm loginnpm version patchnpm publish
- API Client
- Basic testing setup
- Further testing (100% coverage?)
- Further documentation and usage examples
- Automatic updates after Swagger changes
- Automatic deploy pipeline to simplify PRs
If you have any requests, problems or suggestions regarding this package, the best way to reach us is via this github repository. For general help please contact the NMKR support
If you make a PR, please use the provided linting before commiting your code.
We are using diffrent npm packages and tools to ensure the best developer experience, for further reading please take a look at:
- openapi-typescript-codegen to generate the client
- axios as HTTP-Client