index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. 'use strict'
  2. var schemas = {
  3. cache: require('./cache.json'),
  4. cacheEntry: require('./cacheEntry.json'),
  5. content: require('./content.json'),
  6. cookie: require('./cookie.json'),
  7. creator: require('./creator.json'),
  8. entry: require('./entry.json'),
  9. har: require('./har.json'),
  10. log: require('./log.json'),
  11. page: require('./page.json'),
  12. pageTimings: require('./pageTimings.json'),
  13. postData: require('./postData.json'),
  14. record: require('./record.json'),
  15. request: require('./request.json'),
  16. response: require('./response.json'),
  17. timings: require('./timings.json')
  18. }
  19. // is-my-json-valid does not provide meaningful error messages for external schemas
  20. // this is a workaround
  21. schemas.cache.properties.beforeRequest = schemas.cacheEntry
  22. schemas.cache.properties.afterRequest = schemas.cacheEntry
  23. schemas.page.properties.pageTimings = schemas.pageTimings
  24. schemas.request.properties.cookies.items = schemas.cookie
  25. schemas.request.properties.headers.items = schemas.record
  26. schemas.request.properties.queryString.items = schemas.record
  27. schemas.request.properties.postData = schemas.postData
  28. schemas.response.properties.cookies.items = schemas.cookie
  29. schemas.response.properties.headers.items = schemas.record
  30. schemas.response.properties.content = schemas.content
  31. schemas.entry.properties.request = schemas.request
  32. schemas.entry.properties.response = schemas.response
  33. schemas.entry.properties.cache = schemas.cache
  34. schemas.entry.properties.timings = schemas.timings
  35. schemas.log.properties.creator = schemas.creator
  36. schemas.log.properties.browser = schemas.creator
  37. schemas.log.properties.pages.items = schemas.page
  38. schemas.log.properties.entries.items = schemas.entry
  39. schemas.har.properties.log = schemas.log
  40. module.exports = schemas