Add node modules and compiled JavaScript from main (#57)

Co-authored-by: Oliver King <oking3@uncc.edu>
This commit is contained in:
github-actions[bot] 2022-06-21 12:18:30 -04:00 committed by GitHub
parent d893f27da9
commit 7f7e5ba5ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6750 changed files with 1745644 additions and 10860 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.

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

@ -0,0 +1,43 @@
# HAR Validator
[![license][license-img]][license-url]
[![version][npm-img]][npm-url]
[![super linter][super-linter-img]][super-linter-url]
[![test][test-img]][test-url]
[![release][release-img]][release-url]
[license-url]: LICENSE
[license-img]: https://badgen.net/github/license/ahmadnassri/node-har-validator
[npm-url]: https://www.npmjs.com/package/har-validator
[npm-img]: https://badgen.net/npm/v/har-validator
[super-linter-url]: https://github.com/ahmadnassri/node-har-validator/actions?query=workflow%3Asuper-linter
[super-linter-img]: https://github.com/ahmadnassri/node-har-validator/workflows/super-linter/badge.svg
[test-url]: https://github.com/ahmadnassri/node-har-validator/actions?query=workflow%3Atest
[test-img]: https://github.com/ahmadnassri/node-har-validator/workflows/test/badge.svg
[release-url]: https://github.com/ahmadnassri/node-har-validator/actions?query=workflow%3Arelease
[release-img]: https://github.com/ahmadnassri/node-har-validator/workflows/release/badge.svg
> 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)_

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)
}

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

@ -0,0 +1,43 @@
{
"version": "5.1.5",
"name": "har-validator",
"description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
"author": "Ahmad Nassri <ahmad@ahmadnassri.com> (https://www.ahmadnassri.com/)",
"homepage": "https://github.com/ahmadnassri/node-har-validator",
"repository": {
"type": "git",
"url": "https://github.com/ahmadnassri/node-har-validator.git"
},
"license": "MIT",
"main": "lib/promise.js",
"keywords": [
"har",
"cli",
"ajv",
"http",
"archive",
"validate",
"validator"
],
"engines": {
"node": ">=6"
},
"files": [
"lib"
],
"bugs": {
"url": "https://github.com/ahmadnassri/node-har-validator/issues"
},
"scripts": {
"lint": "npx run-p lint:*",
"test": "tap test --no-coverage",
"test:coverage": "tap test --coverage-report=lcov --no-browser"
},
"devDependencies": {
"tap": "^14.10.8"
},
"dependencies": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
}
}