Skip to content

SLA Schema Model in TypeScript to help parsing and building SLA Documents for OpenAPI

License

Notifications You must be signed in to change notification settings

metadevpro/sla-ts

Repository files navigation

SLA-TS

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.

Node.js CI

Conforms to the specification at SLA4API 1.0.0 Draft

Contains

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.

Install

Locally in your project:

npm i sla-ts --save

Globally as a CLI tool: (planned / not yet)

npm i -g sla-ts

Test

npm test

How to use the CLI

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

Versions & Changelog

See changelog.

References

License

Licensed under the MIT License.

Credits

Contact: Pedro J. Molina | github: pjmolina | twitter: pmolinam

(c) 2022. Pedro J. Molina at Metadev S.L. https://metadev.pro & contributors.

About

SLA Schema Model in TypeScript to help parsing and building SLA Documents for OpenAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published