Status.js

  1. /**
  2. * An API returned status object
  3. * @class Status
  4. */
  5. class Status {
  6. constructor(content) {
  7. /**
  8. * Name or id of the api service
  9. * @type {string}
  10. */
  11. this.id = content.id;
  12. /**
  13. * Attributes of the Status
  14. * @type {Object}
  15. * @property {Date} attributes.releasedAt Time of the latest version release
  16. * @property {string} attributes.version Semantic version
  17. */
  18. this.attributes = {
  19. releasedAt: new Date(content.attributes.releasedAt),
  20. version: content.attributes.version,
  21. };
  22. }
  23. }
  24. module.exports = Status;