TypeScript library to help building SLA4API compliant API contracts. Provides a model compliant with the schema, and a internal DSL using the builder pattern with capabilities to generate the JSON and YAML version of the SLA contract.
Conforms to the specification at SLA4API 1.0.0 Draft
Under src/
you will find:
model/
The schema for a valid SLA Document (plans & agreements).dsl/
A utility interanl DSL to build SLA documents.validator/
A validator for SLA documents.cli/
A command line interface to generate documentation an validation for an SLA document.
Locally in your project:
npm i sla-ts --save
Globally as a CLI tool: (planned / not yet)
npm i -g sla-ts
npm test
Locally:
npm run cli
npm run cli validate samples/sla1-invalid.json
npm run cli validate samples/sla1.yaml
npm run cli document samples/sla1.yaml samples/sla1.html
As a global tool: (planned / not yet)
sla-ts
sla-ts validate samples/sla1-invalid.json
sla-ts validate samples/sla1.yaml
sla-ts document samples/sla1.yaml samples/sla1.html
See changelog.
- SLA4OAI Spec 1.0.0 https://github.com/isa-group/SLA4OAI-Specification/blob/main/versions/1.0.0-Draft.md
- SLA4OAI Spec Working Draft https://github.com/isa-group/SLA4OAI-Specification/blob/main/versions/Working-Draft.md
- OpenAPI spec 3.1.0. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md
Licensed under the MIT License.
Contact: Pedro J. Molina | github: pjmolina | twitter: pmolinam
(c) 2022. Pedro J. Molina at Metadev S.L. https://metadev.pro & contributors.