This commit is contained in:
eric sciple 2020-01-24 12:20:19 -05:00
parent beb1329f9f
commit 2b95e76931
7736 changed files with 1874747 additions and 51184 deletions

9
node_modules/har-validator/LICENSE generated vendored Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2018 Ahmad Nassri <ahmad@ahmadnassri.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

37
node_modules/har-validator/README.md generated vendored Normal file
View file

@ -0,0 +1,37 @@
# HAR Validator
[![License][license-image]][license-url] [![version][npm-image]][npm-url] [![Build Status][circle-image]][circle-url]
> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema.
## Install
```bash
npm install har-validator
```
## CLI Usage
Please refer to [`har-cli`](https://github.com/ahmadnassri/har-cli) for more info.
## API
**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/node-har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. _For backward compatibility with `v1.x` an [async/callback API](docs/async.md) is also provided_
- [async API](docs/async.md)
- [callback API](docs/async.md)
- [Promise API](docs/promise.md) _(default)_
---
> Author: [Ahmad Nassri](https://www.ahmadnassri.com/) &bull;
> Github: [@ahmadnassri](https://github.com/ahmadnassri) &bull;
> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri)
[license-url]: LICENSE
[license-image]: https://img.shields.io/github/license/ahmadnassri/node-har-validator.svg?style=for-the-badge&logo=circleci
[circle-url]: https://circleci.com/gh/ahmadnassri/workflows/node-har-validator
[circle-image]: https://img.shields.io/circleci/project/github/ahmadnassri/node-har-validator/master.svg?style=for-the-badge&logo=circleci
[npm-url]: https://www.npmjs.com/package/har-validator
[npm-image]: https://img.shields.io/npm/v/har-validator.svg?style=for-the-badge&logo=npm

105
node_modules/har-validator/lib/async.js generated vendored Normal file
View file

@ -0,0 +1,105 @@
var Ajv = require('ajv')
var HARError = require('./error')
var schemas = require('har-schema')
var ajv
function createAjvInstance () {
var ajv = new Ajv({
allErrors: true
})
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'))
ajv.addSchema(schemas)
return ajv
}
function validate (name, data, next) {
data = data || {}
// validator config
ajv = ajv || createAjvInstance()
var validate = ajv.getSchema(name + '.json')
var valid = validate(data)
// callback?
if (typeof next === 'function') {
return next(!valid ? new HARError(validate.errors) : null, valid)
}
return valid
}
exports.afterRequest = function (data, next) {
return validate('afterRequest', data, next)
}
exports.beforeRequest = function (data, next) {
return validate('beforeRequest', data, next)
}
exports.browser = function (data, next) {
return validate('browser', data, next)
}
exports.cache = function (data, next) {
return validate('cache', data, next)
}
exports.content = function (data, next) {
return validate('content', data, next)
}
exports.cookie = function (data, next) {
return validate('cookie', data, next)
}
exports.creator = function (data, next) {
return validate('creator', data, next)
}
exports.entry = function (data, next) {
return validate('entry', data, next)
}
exports.har = function (data, next) {
return validate('har', data, next)
}
exports.header = function (data, next) {
return validate('header', data, next)
}
exports.log = function (data, next) {
return validate('log', data, next)
}
exports.page = function (data, next) {
return validate('page', data, next)
}
exports.pageTimings = function (data, next) {
return validate('pageTimings', data, next)
}
exports.postData = function (data, next) {
return validate('postData', data, next)
}
exports.query = function (data, next) {
return validate('query', data, next)
}
exports.request = function (data, next) {
return validate('request', data, next)
}
exports.response = function (data, next) {
return validate('response', data, next)
}
exports.timings = function (data, next) {
return validate('timings', data, next)
}

17
node_modules/har-validator/lib/error.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
function HARError (errors) {
var message = 'validation failed'
this.name = 'HARError'
this.message = message
this.errors = errors
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor)
} else {
this.stack = (new Error(message)).stack
}
}
HARError.prototype = Error.prototype
module.exports = HARError

102
node_modules/har-validator/lib/promise.js generated vendored Normal file
View file

@ -0,0 +1,102 @@
var Ajv = require('ajv')
var HARError = require('./error')
var schemas = require('har-schema')
var ajv
function createAjvInstance () {
var ajv = new Ajv({
allErrors: true
})
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'))
ajv.addSchema(schemas)
return ajv
}
function validate (name, data) {
data = data || {}
// validator config
ajv = ajv || createAjvInstance()
var validate = ajv.getSchema(name + '.json')
return new Promise(function (resolve, reject) {
var valid = validate(data)
!valid ? reject(new HARError(validate.errors)) : resolve(data)
})
}
exports.afterRequest = function (data) {
return validate('afterRequest', data)
}
exports.beforeRequest = function (data) {
return validate('beforeRequest', data)
}
exports.browser = function (data) {
return validate('browser', data)
}
exports.cache = function (data) {
return validate('cache', data)
}
exports.content = function (data) {
return validate('content', data)
}
exports.cookie = function (data) {
return validate('cookie', data)
}
exports.creator = function (data) {
return validate('creator', data)
}
exports.entry = function (data) {
return validate('entry', data)
}
exports.har = function (data) {
return validate('har', data)
}
exports.header = function (data) {
return validate('header', data)
}
exports.log = function (data) {
return validate('log', data)
}
exports.page = function (data) {
return validate('page', data)
}
exports.pageTimings = function (data) {
return validate('pageTimings', data)
}
exports.postData = function (data) {
return validate('postData', data)
}
exports.query = function (data) {
return validate('query', data)
}
exports.request = function (data) {
return validate('request', data)
}
exports.response = function (data) {
return validate('response', data)
}
exports.timings = function (data) {
return validate('timings', data)
}

80
node_modules/har-validator/package.json generated vendored Normal file
View file

@ -0,0 +1,80 @@
{
"_args": [
[
"har-validator@5.1.3",
"/Users/eric/repos/actions/setup-node"
]
],
"_development": true,
"_from": "har-validator@5.1.3",
"_id": "har-validator@5.1.3",
"_inBundle": false,
"_integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
"_location": "/har-validator",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "har-validator@5.1.3",
"name": "har-validator",
"escapedName": "har-validator",
"rawSpec": "5.1.3",
"saveSpec": null,
"fetchSpec": "5.1.3"
},
"_requiredBy": [
"/request"
],
"_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
"_spec": "5.1.3",
"_where": "/Users/eric/repos/actions/setup-node",
"author": {
"name": "Ahmad Nassri",
"email": "ahmad@ahmadnassri.com",
"url": "https://www.ahmadnassri.com/"
},
"bugs": {
"url": "https://github.com/ahmadnassri/node-har-validator/issues"
},
"dependencies": {
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
},
"description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
"devDependencies": {
"tap": "^12.0.1"
},
"engines": {
"node": ">=6"
},
"files": [
"lib"
],
"homepage": "https://github.com/ahmadnassri/node-har-validator",
"keywords": [
"har",
"cli",
"ajv",
"http",
"archive",
"validate",
"validator"
],
"license": "MIT",
"main": "lib/promise.js",
"name": "har-validator",
"repository": {
"type": "git",
"url": "git+https://github.com/ahmadnassri/node-har-validator.git"
},
"scripts": {
"lint": "npx run-p lint:*",
"lint:deps": "npx updated",
"lint:ec": "npx editorconfig-checker .",
"lint:js": "npx eslint .",
"lint:md": "npx remark --quiet --frail .",
"open:coverage": "opener coverage/lcov-report/index.html",
"test": "tap test --coverage-report=lcov --no-browser"
},
"version": "5.1.3"
}