pax_global_header00006660000000000000000000000064130754660320014520gustar00rootroot0000000000000052 comment=d006b0500e083a5b3e42635f110f3fb702ccdbb1 har-schema-2.0.0/000077500000000000000000000000001307546603200135275ustar00rootroot00000000000000har-schema-2.0.0/.codeclimate.yml000066400000000000000000000003011307546603200165730ustar00rootroot00000000000000engines: fixme: enabled: true duplication: enabled: true config: languages: - javascript eslint: enabled: true ratings: paths: - lib/** - test/** har-schema-2.0.0/.editorconfig000066400000000000000000000003261307546603200162050ustar00rootroot00000000000000# http://editorconfig.org root = true [*] charset = utf-8 end_of_line = lf indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false har-schema-2.0.0/.gitignore000066400000000000000000000000411307546603200155120ustar00rootroot00000000000000*.log /node_modules /.nyc_output har-schema-2.0.0/.travis.yml000066400000000000000000000005121307546603200156360ustar00rootroot00000000000000language: node_js node_js: - 4 - 6 - 7 env: - BABEL_ENV=test matrix: fast_finish: true cache: directories: - node_modules before_script: - npm prune after_success: - npm run coverage - npm run codeclimate - npm run semantic-release branches: except: - /^v\d+\.\d+\.\d+$/ - /^greenkeeper\/.+/ har-schema-2.0.0/LICENSE000066400000000000000000000013631307546603200145370ustar00rootroot00000000000000Copyright (c) 2015, Ahmad Nassri Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. har-schema-2.0.0/README.md000066400000000000000000000041051307546603200150060ustar00rootroot00000000000000# HAR Schema [![version][npm-version]][npm-url] [![License][npm-license]][license-url] > JSON Schema for HTTP Archive ([HAR][spec]). [![Build Status][travis-image]][travis-url] [![Downloads][npm-downloads]][npm-url] [![Code Climate][codeclimate-quality]][codeclimate-url] [![Coverage Status][codeclimate-coverage]][codeclimate-url] [![Dependency Status][dependencyci-image]][dependencyci-url] [![Dependencies][david-image]][david-url] ## Install ```bash npm install --only=production --save har-schema ``` ## Usage Compatible with any [JSON Schema validation tool][validator]. ---- > :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/)  ·  > License: [ISC][license-url]  ·  > Github: [@ahmadnassri](https://github.com/ahmadnassri)  ·  > Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri) [license-url]: http://choosealicense.com/licenses/isc/ [travis-url]: https://travis-ci.org/ahmadnassri/har-schema [travis-image]: https://img.shields.io/travis/ahmadnassri/har-schema.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/har-schema [npm-license]: https://img.shields.io/npm/l/har-schema.svg?style=flat-square [npm-version]: https://img.shields.io/npm/v/har-schema.svg?style=flat-square [npm-downloads]: https://img.shields.io/npm/dm/har-schema.svg?style=flat-square [codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-schema [codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-schema.svg?style=flat-square [codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-schema.svg?style=flat-square [david-url]: https://david-dm.org/ahmadnassri/har-schema [david-image]: https://img.shields.io/david/ahmadnassri/har-schema.svg?style=flat-square [dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-schema [dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-schema/badge?style=flat-square [spec]: https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md [validator]: https://github.com/ahmadnassri/har-validator har-schema-2.0.0/lib/000077500000000000000000000000001307546603200142755ustar00rootroot00000000000000har-schema-2.0.0/lib/afterRequest.json000066400000000000000000000013151307546603200176420ustar00rootroot00000000000000{ "$id": "afterRequest.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "optional": true, "required": [ "lastAccess", "eTag", "hitCount" ], "properties": { "expires": { "type": "string", "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?" }, "lastAccess": { "type": "string", "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?" }, "eTag": { "type": "string" }, "hitCount": { "type": "integer" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/beforeRequest.json000066400000000000000000000013161307546603200200040ustar00rootroot00000000000000{ "$id": "beforeRequest.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "optional": true, "required": [ "lastAccess", "eTag", "hitCount" ], "properties": { "expires": { "type": "string", "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?" }, "lastAccess": { "type": "string", "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?" }, "eTag": { "type": "string" }, "hitCount": { "type": "integer" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/browser.json000066400000000000000000000004701307546603200166540ustar00rootroot00000000000000{ "$id": "browser.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "name", "version" ], "properties": { "name": { "type": "string" }, "version": { "type": "string" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/cache.json000066400000000000000000000006201307546603200162310ustar00rootroot00000000000000{ "$id": "cache.json#", "$schema": "http://json-schema.org/draft-06/schema#", "properties": { "beforeRequest": { "oneOf": [ { "type": "null" }, { "$ref": "beforeRequest.json#" } ] }, "afterRequest": { "oneOf": [ { "type": "null" }, { "$ref": "afterRequest.json#" } ] }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/content.json000066400000000000000000000007131307546603200166430ustar00rootroot00000000000000{ "$id": "content.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "size", "mimeType" ], "properties": { "size": { "type": "integer" }, "compression": { "type": "integer" }, "mimeType": { "type": "string" }, "text": { "type": "string" }, "encoding": { "type": "string" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/cookie.json000066400000000000000000000011031307546603200164340ustar00rootroot00000000000000{ "$id": "cookie.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "name", "value" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" }, "path": { "type": "string" }, "domain": { "type": "string" }, "expires": { "type": ["string", "null"], "format": "date-time" }, "httpOnly": { "type": "boolean" }, "secure": { "type": "boolean" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/creator.json000066400000000000000000000004701307546603200166300ustar00rootroot00000000000000{ "$id": "creator.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "name", "version" ], "properties": { "name": { "type": "string" }, "version": { "type": "string" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/entry.json000066400000000000000000000020071307546603200163300ustar00rootroot00000000000000{ "$id": "entry.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "optional": true, "required": [ "startedDateTime", "time", "request", "response", "cache", "timings" ], "properties": { "pageref": { "type": "string" }, "startedDateTime": { "type": "string", "format": "date-time", "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" }, "time": { "type": "number", "min": 0 }, "request": { "$ref": "request.json#" }, "response": { "$ref": "response.json#" }, "cache": { "$ref": "cache.json#" }, "timings": { "$ref": "timings.json#" }, "serverIPAddress": { "type": "string", "oneOf": [ { "format": "ipv4" }, { "format": "ipv6" } ] }, "connection": { "type": "string" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/har.json000066400000000000000000000003101307546603200157340ustar00rootroot00000000000000{ "$id": "har.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "log" ], "properties": { "log": { "$ref": "log.json#" } } } har-schema-2.0.0/lib/header.json000066400000000000000000000004631307546603200164230ustar00rootroot00000000000000{ "$id": "header.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "name", "value" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/index.js000066400000000000000000000013121307546603200157370ustar00rootroot00000000000000'use strict' module.exports = { afterRequest: require('./afterRequest.json'), beforeRequest: require('./beforeRequest.json'), browser: require('./browser.json'), cache: require('./cache.json'), content: require('./content.json'), cookie: require('./cookie.json'), creator: require('./creator.json'), entry: require('./entry.json'), har: require('./har.json'), header: require('./header.json'), log: require('./log.json'), page: require('./page.json'), pageTimings: require('./pageTimings.json'), postData: require('./postData.json'), query: require('./query.json'), request: require('./request.json'), response: require('./response.json'), timings: require('./timings.json') } har-schema-2.0.0/lib/log.json000066400000000000000000000011171307546603200157510ustar00rootroot00000000000000{ "$id": "log.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "version", "creator", "entries" ], "properties": { "version": { "type": "string" }, "creator": { "$ref": "creator.json#" }, "browser": { "$ref": "browser.json#" }, "pages": { "type": "array", "items": { "$ref": "page.json#" } }, "entries": { "type": "array", "items": { "$ref": "entry.json#" } }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/page.json000066400000000000000000000012251307546603200161040ustar00rootroot00000000000000{ "$id": "page.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "optional": true, "required": [ "startedDateTime", "id", "title", "pageTimings" ], "properties": { "startedDateTime": { "type": "string", "format": "date-time", "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" }, "id": { "type": "string", "unique": true }, "title": { "type": "string" }, "pageTimings": { "$ref": "pageTimings.json#" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/pageTimings.json000066400000000000000000000004671307546603200174460ustar00rootroot00000000000000{ "$id": "pageTimings.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "properties": { "onContentLoad": { "type": "number", "min": -1 }, "onLoad": { "type": "number", "min": -1 }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/postData.json000066400000000000000000000013411307546603200167460ustar00rootroot00000000000000{ "$id": "postData.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "optional": true, "required": [ "mimeType" ], "properties": { "mimeType": { "type": "string" }, "text": { "type": "string" }, "params": { "type": "array", "required": [ "name" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" }, "fileName": { "type": "string" }, "contentType": { "type": "string" }, "comment": { "type": "string" } } }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/query.json000066400000000000000000000004621307546603200163370ustar00rootroot00000000000000{ "$id": "query.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "name", "value" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/request.json000066400000000000000000000016721307546603200166660ustar00rootroot00000000000000{ "$id": "request.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "method", "url", "httpVersion", "cookies", "headers", "queryString", "headersSize", "bodySize" ], "properties": { "method": { "type": "string" }, "url": { "type": "string", "format": "uri" }, "httpVersion": { "type": "string" }, "cookies": { "type": "array", "items": { "$ref": "cookie.json#" } }, "headers": { "type": "array", "items": { "$ref": "header.json#" } }, "queryString": { "type": "array", "items": { "$ref": "query.json#" } }, "postData": { "$ref": "postData.json#" }, "headersSize": { "type": "integer" }, "bodySize": { "type": "integer" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/response.json000066400000000000000000000016111307546603200170250ustar00rootroot00000000000000{ "$id": "response.json#", "$schema": "http://json-schema.org/draft-06/schema#", "type": "object", "required": [ "status", "statusText", "httpVersion", "cookies", "headers", "content", "redirectURL", "headersSize", "bodySize" ], "properties": { "status": { "type": "integer" }, "statusText": { "type": "string" }, "httpVersion": { "type": "string" }, "cookies": { "type": "array", "items": { "$ref": "cookie.json#" } }, "headers": { "type": "array", "items": { "$ref": "header.json#" } }, "content": { "$ref": "content.json#" }, "redirectURL": { "type": "string" }, "headersSize": { "type": "integer" }, "bodySize": { "type": "integer" }, "comment": { "type": "string" } } } har-schema-2.0.0/lib/timings.json000066400000000000000000000012071307546603200166420ustar00rootroot00000000000000{ "$id": "timings.json#", "$schema": "http://json-schema.org/draft-06/schema#", "required": [ "send", "wait", "receive" ], "properties": { "dns": { "type": "number", "min": -1 }, "connect": { "type": "number", "min": -1 }, "blocked": { "type": "number", "min": -1 }, "send": { "type": "number", "min": -1 }, "wait": { "type": "number", "min": -1 }, "receive": { "type": "number", "min": -1 }, "ssl": { "type": "number", "min": -1 }, "comment": { "type": "string" } } } har-schema-2.0.0/package.json000066400000000000000000000025501307546603200160170ustar00rootroot00000000000000{ "version": "0.0.0-development", "name": "har-schema", "description": "JSON Schema for HTTP Archive (HAR)", "author": "Ahmad Nassri (https://www.ahmadnassri.com/)", "contributors": [ "Evgeny Poberezkin " ], "homepage": "https://github.com/ahmadnassri/har-schema", "repository": { "type": "git", "url": "https://github.com/ahmadnassri/har-schema.git" }, "license": "ISC", "main": "lib/index.js", "keywords": [ "har", "http", "archive", "JSON", "schema", "JSON-schema" ], "engines": { "node": ">=4" }, "files": [ "lib" ], "bugs": { "url": "https://github.com/ahmadnassri/har-schema/issues" }, "scripts": { "test": "tap test --reporter spec", "pretest": "snazzy && echint", "coverage": "tap test --reporter silent --coverage", "codeclimate": "tap --coverage-report=text-lcov | codeclimate-test-reporter", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }, "devDependencies": { "ajv": "^5.0.0", "codeclimate-test-reporter": "^0.4.0", "cz-conventional-changelog": "^1.2.0", "echint": "^2.1.0", "semantic-release": "^6.3.2", "snazzy": "^5.0.0", "tap": "^8.0.1" } } har-schema-2.0.0/test/000077500000000000000000000000001307546603200145065ustar00rootroot00000000000000har-schema-2.0.0/test/index.js000066400000000000000000000006101307546603200161500ustar00rootroot00000000000000'use strict' const schemas = require('../lib') const Ajv = require('ajv') const tap = require('tap') tap.test('har-schema', (assert) => { const ajv = new Ajv() const keys = Object.keys(schemas) assert.plan(keys.length * 2) keys.forEach((key) => assert.doesNotThrow(() => ajv.addSchema(schemas[key]))) keys.forEach((key) => assert.type(ajv.compile(schemas[key]), 'function')) })