This repository contains official client libraries for the 1Shot API in various programming languages.
- TypeScript/JavaScript - Published to NPM
- Python - Published to PyPI
- Go - Published as a Go module
- C# (Coming soon)
Each client follows its own versioning scheme appropriate for its ecosystem:
- Versioned through
package.json - Published to NPM
- Follows semantic versioning
- Versioned through
setup.py/pyproject.toml - Published to PyPI
- Follows semantic versioning
- Versioned through Git tags in the format
clients/go/vX.Y.Z - Published as a Go module
- Follows semantic versioning
- Example:
clients/go/v0.1.0
The Go client's versioning is managed through Git tags that are specific to the Go module path. This allows the Go client to be versioned independently of other clients in this monorepo.
- Node.js (for TypeScript/JavaScript client)
- Python 3.8+ (for Python client)
- Go 1.21+ (for Go client)
- Docker (for generating clients from OpenAPI spec)
The clients are generated from the OpenAPI specification using the OpenAPI Generator.
# Generate TypeScript client
docker run -v $(pwd):/local openapitools/openapi-generator-cli generate \
-i /local/m2mGatewaySpec.yaml \
-g nodejs-typescript \
-o /local/clients/node
# Generate Python client
docker run -v $(pwd):/local openapitools/openapi-generator-cli generate \
-i /local/m2mGatewaySpec.yaml \
-g python \
-o /local/clients/python
# Generate Go client
docker run -v $(pwd):/local swaggerapi/swagger-codegen-cli-v3 generate \
-i /local/m2mGatewaySpec.yaml \
-l go \
-o /local/clients/go/gennpx @redocly/cli lint m2mGatewaySpec.yamlThis project is licensed under the MIT License - see the LICENSE file for details.
You can validate the openAPI spec like this:
npx @redocly/cli lint m2mGatewaySpec.yamlsudo docker run -v /home/todd/code/1shot-clients/:/local openapitools/openapi-generator-cli generate -i /local/m2mGatewaySpec.yaml -g python -o /local/clients/pythonsudo docker run -v /home/todd/code/1shot-clients/:/local openapitools/openapi-generator-cli generate -i /local/m2mGatewaySpec.yaml -g nodejs-typescript -o /local/clients/node