initial
This commit is contained in:
13
node_modules/har-validator/LICENSE
generated
vendored
Normal file
13
node_modules/har-validator/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2015, Ahmad Nassri <ahmad@ahmadnassri.com>
|
||||
|
||||
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.
|
||||
75
node_modules/har-validator/README.md
generated
vendored
Normal file
75
node_modules/har-validator/README.md
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url]
|
||||
|
||||
> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema.
|
||||
|
||||
[![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-validator
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
I recommend using an optimized build matching your Node.js environment version, otherwise, the standard `require` would work just fine with any version of Node `>= v4.0` .
|
||||
|
||||
```js
|
||||
/*
|
||||
* Node 7
|
||||
*/
|
||||
const validate = require('har-validator/lib/node7')
|
||||
|
||||
/*
|
||||
* Node 6
|
||||
*/
|
||||
const validate = require('har-validator/lib/node6')
|
||||
|
||||
/*
|
||||
* Node 4 (Default)
|
||||
*/
|
||||
var validate = require('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/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability 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)*
|
||||
|
||||
----
|
||||
> :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-validator
|
||||
[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square
|
||||
|
||||
[npm-url]: https://www.npmjs.com/package/har-validator
|
||||
[npm-license]: https://img.shields.io/npm/l/har-validator.svg?style=flat-square
|
||||
[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square
|
||||
[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square
|
||||
|
||||
[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator
|
||||
[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square
|
||||
[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square
|
||||
|
||||
[david-url]: https://david-dm.org/ahmadnassri/har-validator
|
||||
[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square
|
||||
|
||||
[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-validator
|
||||
[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-validator/badge?style=flat-square
|
||||
96
node_modules/har-validator/lib/browser/async.js
generated
vendored
Normal file
96
node_modules/har-validator/lib/browser/async.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
import * as schemas from 'har-schema';
|
||||
import Ajv from 'ajv';
|
||||
import HARError from './error';
|
||||
|
||||
let ajv;
|
||||
|
||||
export function validate(name, data = {}, next) {
|
||||
// validator config
|
||||
ajv = ajv || new Ajv({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
let validate = ajv.getSchema(name + '.json');
|
||||
|
||||
let valid = validate(data);
|
||||
|
||||
// callback?
|
||||
if (typeof next === 'function') {
|
||||
return next(!valid ? new HARError(validate.errors) : null, valid);
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
export function afterRequest(data, next) {
|
||||
return validate('afterRequest', data, next);
|
||||
}
|
||||
|
||||
export function beforeRequest(data, next) {
|
||||
return validate('beforeRequest', data, next);
|
||||
}
|
||||
|
||||
export function browser(data, next) {
|
||||
return validate('browser', data, next);
|
||||
}
|
||||
|
||||
export function cache(data, next) {
|
||||
return validate('cache', data, next);
|
||||
}
|
||||
|
||||
export function content(data, next) {
|
||||
return validate('content', data, next);
|
||||
}
|
||||
|
||||
export function cookie(data, next) {
|
||||
return validate('cookie', data, next);
|
||||
}
|
||||
|
||||
export function creator(data, next) {
|
||||
return validate('creator', data, next);
|
||||
}
|
||||
|
||||
export function entry(data, next) {
|
||||
return validate('entry', data, next);
|
||||
}
|
||||
|
||||
export function har(data, next) {
|
||||
return validate('har', data, next);
|
||||
}
|
||||
|
||||
export function header(data, next) {
|
||||
return validate('header', data, next);
|
||||
}
|
||||
|
||||
export function log(data, next) {
|
||||
return validate('log', data, next);
|
||||
}
|
||||
|
||||
export function page(data, next) {
|
||||
return validate('page', data, next);
|
||||
}
|
||||
|
||||
export function pageTimings(data, next) {
|
||||
return validate('pageTimings', data, next);
|
||||
}
|
||||
|
||||
export function postData(data, next) {
|
||||
return validate('postData', data, next);
|
||||
}
|
||||
|
||||
export function query(data, next) {
|
||||
return validate('query', data, next);
|
||||
}
|
||||
|
||||
export function request(data, next) {
|
||||
return validate('request', data, next);
|
||||
}
|
||||
|
||||
export function response(data, next) {
|
||||
return validate('response', data, next);
|
||||
}
|
||||
|
||||
export function timings(data, next) {
|
||||
return validate('timings', data, next);
|
||||
}
|
||||
15
node_modules/har-validator/lib/browser/error.js
generated
vendored
Normal file
15
node_modules/har-validator/lib/browser/error.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export default function HARError(errors) {
|
||||
let 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;
|
||||
93
node_modules/har-validator/lib/browser/promise.js
generated
vendored
Normal file
93
node_modules/har-validator/lib/browser/promise.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import * as schemas from 'har-schema';
|
||||
import Ajv from 'ajv';
|
||||
import HARError from './error';
|
||||
|
||||
let ajv;
|
||||
|
||||
export function validate(name, data = {}) {
|
||||
// validator config
|
||||
ajv = ajv || new Ajv({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
let validate = ajv.getSchema(name + '.json');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let valid = validate(data);
|
||||
|
||||
!valid ? reject(new HARError(validate.errors)) : resolve(data);
|
||||
});
|
||||
}
|
||||
|
||||
export function afterRequest(data) {
|
||||
return validate('afterRequest', data);
|
||||
}
|
||||
|
||||
export function beforeRequest(data) {
|
||||
return validate('beforeRequest', data);
|
||||
}
|
||||
|
||||
export function browser(data) {
|
||||
return validate('browser', data);
|
||||
}
|
||||
|
||||
export function cache(data) {
|
||||
return validate('cache', data);
|
||||
}
|
||||
|
||||
export function content(data) {
|
||||
return validate('content', data);
|
||||
}
|
||||
|
||||
export function cookie(data) {
|
||||
return validate('cookie', data);
|
||||
}
|
||||
|
||||
export function creator(data) {
|
||||
return validate('creator', data);
|
||||
}
|
||||
|
||||
export function entry(data) {
|
||||
return validate('entry', data);
|
||||
}
|
||||
|
||||
export function har(data) {
|
||||
return validate('har', data);
|
||||
}
|
||||
|
||||
export function header(data) {
|
||||
return validate('header', data);
|
||||
}
|
||||
|
||||
export function log(data) {
|
||||
return validate('log', data);
|
||||
}
|
||||
|
||||
export function page(data) {
|
||||
return validate('page', data);
|
||||
}
|
||||
|
||||
export function pageTimings(data) {
|
||||
return validate('pageTimings', data);
|
||||
}
|
||||
|
||||
export function postData(data) {
|
||||
return validate('postData', data);
|
||||
}
|
||||
|
||||
export function query(data) {
|
||||
return validate('query', data);
|
||||
}
|
||||
|
||||
export function request(data) {
|
||||
return validate('request', data);
|
||||
}
|
||||
|
||||
export function response(data) {
|
||||
return validate('response', data);
|
||||
}
|
||||
|
||||
export function timings(data) {
|
||||
return validate('timings', data);
|
||||
}
|
||||
136
node_modules/har-validator/lib/node4/async.js
generated
vendored
Normal file
136
node_modules/har-validator/lib/node4/async.js
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.afterRequest = afterRequest;
|
||||
exports.beforeRequest = beforeRequest;
|
||||
exports.browser = browser;
|
||||
exports.cache = cache;
|
||||
exports.content = content;
|
||||
exports.cookie = cookie;
|
||||
exports.creator = creator;
|
||||
exports.entry = entry;
|
||||
exports.har = har;
|
||||
exports.header = header;
|
||||
exports.log = log;
|
||||
exports.page = page;
|
||||
exports.pageTimings = pageTimings;
|
||||
exports.postData = postData;
|
||||
exports.query = query;
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
exports.timings = timings;
|
||||
|
||||
var _harSchema = require('har-schema');
|
||||
|
||||
var schemas = _interopRequireWildcard(_harSchema);
|
||||
|
||||
var _ajv = require('ajv');
|
||||
|
||||
var _ajv2 = _interopRequireDefault(_ajv);
|
||||
|
||||
var _error = require('./error');
|
||||
|
||||
var _error2 = _interopRequireDefault(_error);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
var ajv = void 0;
|
||||
|
||||
function validate(name) {
|
||||
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var next = arguments[2];
|
||||
|
||||
// validator config
|
||||
ajv = ajv || new _ajv2.default({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
var validate = ajv.getSchema(name + '.json');
|
||||
|
||||
var valid = validate(data);
|
||||
|
||||
// callback?
|
||||
if (typeof next === 'function') {
|
||||
return next(!valid ? new _error2.default(validate.errors) : null, valid);
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
function afterRequest(data, next) {
|
||||
return validate('afterRequest', data, next);
|
||||
}
|
||||
|
||||
function beforeRequest(data, next) {
|
||||
return validate('beforeRequest', data, next);
|
||||
}
|
||||
|
||||
function browser(data, next) {
|
||||
return validate('browser', data, next);
|
||||
}
|
||||
|
||||
function cache(data, next) {
|
||||
return validate('cache', data, next);
|
||||
}
|
||||
|
||||
function content(data, next) {
|
||||
return validate('content', data, next);
|
||||
}
|
||||
|
||||
function cookie(data, next) {
|
||||
return validate('cookie', data, next);
|
||||
}
|
||||
|
||||
function creator(data, next) {
|
||||
return validate('creator', data, next);
|
||||
}
|
||||
|
||||
function entry(data, next) {
|
||||
return validate('entry', data, next);
|
||||
}
|
||||
|
||||
function har(data, next) {
|
||||
return validate('har', data, next);
|
||||
}
|
||||
|
||||
function header(data, next) {
|
||||
return validate('header', data, next);
|
||||
}
|
||||
|
||||
function log(data, next) {
|
||||
return validate('log', data, next);
|
||||
}
|
||||
|
||||
function page(data, next) {
|
||||
return validate('page', data, next);
|
||||
}
|
||||
|
||||
function pageTimings(data, next) {
|
||||
return validate('pageTimings', data, next);
|
||||
}
|
||||
|
||||
function postData(data, next) {
|
||||
return validate('postData', data, next);
|
||||
}
|
||||
|
||||
function query(data, next) {
|
||||
return validate('query', data, next);
|
||||
}
|
||||
|
||||
function request(data, next) {
|
||||
return validate('request', data, next);
|
||||
}
|
||||
|
||||
function response(data, next) {
|
||||
return validate('response', data, next);
|
||||
}
|
||||
|
||||
function timings(data, next) {
|
||||
return validate('timings', data, next);
|
||||
}
|
||||
22
node_modules/har-validator/lib/node4/error.js
generated
vendored
Normal file
22
node_modules/har-validator/lib/node4/error.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = HARError;
|
||||
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 = exports['default'];
|
||||
132
node_modules/har-validator/lib/node4/promise.js
generated
vendored
Normal file
132
node_modules/har-validator/lib/node4/promise.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.afterRequest = afterRequest;
|
||||
exports.beforeRequest = beforeRequest;
|
||||
exports.browser = browser;
|
||||
exports.cache = cache;
|
||||
exports.content = content;
|
||||
exports.cookie = cookie;
|
||||
exports.creator = creator;
|
||||
exports.entry = entry;
|
||||
exports.har = har;
|
||||
exports.header = header;
|
||||
exports.log = log;
|
||||
exports.page = page;
|
||||
exports.pageTimings = pageTimings;
|
||||
exports.postData = postData;
|
||||
exports.query = query;
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
exports.timings = timings;
|
||||
|
||||
var _harSchema = require('har-schema');
|
||||
|
||||
var schemas = _interopRequireWildcard(_harSchema);
|
||||
|
||||
var _ajv = require('ajv');
|
||||
|
||||
var _ajv2 = _interopRequireDefault(_ajv);
|
||||
|
||||
var _error = require('./error');
|
||||
|
||||
var _error2 = _interopRequireDefault(_error);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
var ajv = void 0;
|
||||
|
||||
function validate(name) {
|
||||
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
// validator config
|
||||
ajv = ajv || new _ajv2.default({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
var validate = ajv.getSchema(name + '.json');
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var valid = validate(data);
|
||||
|
||||
!valid ? reject(new _error2.default(validate.errors)) : resolve(data);
|
||||
});
|
||||
}
|
||||
|
||||
function afterRequest(data) {
|
||||
return validate('afterRequest', data);
|
||||
}
|
||||
|
||||
function beforeRequest(data) {
|
||||
return validate('beforeRequest', data);
|
||||
}
|
||||
|
||||
function browser(data) {
|
||||
return validate('browser', data);
|
||||
}
|
||||
|
||||
function cache(data) {
|
||||
return validate('cache', data);
|
||||
}
|
||||
|
||||
function content(data) {
|
||||
return validate('content', data);
|
||||
}
|
||||
|
||||
function cookie(data) {
|
||||
return validate('cookie', data);
|
||||
}
|
||||
|
||||
function creator(data) {
|
||||
return validate('creator', data);
|
||||
}
|
||||
|
||||
function entry(data) {
|
||||
return validate('entry', data);
|
||||
}
|
||||
|
||||
function har(data) {
|
||||
return validate('har', data);
|
||||
}
|
||||
|
||||
function header(data) {
|
||||
return validate('header', data);
|
||||
}
|
||||
|
||||
function log(data) {
|
||||
return validate('log', data);
|
||||
}
|
||||
|
||||
function page(data) {
|
||||
return validate('page', data);
|
||||
}
|
||||
|
||||
function pageTimings(data) {
|
||||
return validate('pageTimings', data);
|
||||
}
|
||||
|
||||
function postData(data) {
|
||||
return validate('postData', data);
|
||||
}
|
||||
|
||||
function query(data) {
|
||||
return validate('query', data);
|
||||
}
|
||||
|
||||
function request(data) {
|
||||
return validate('request', data);
|
||||
}
|
||||
|
||||
function response(data) {
|
||||
return validate('response', data);
|
||||
}
|
||||
|
||||
function timings(data) {
|
||||
return validate('timings', data);
|
||||
}
|
||||
133
node_modules/har-validator/lib/node6/async.js
generated
vendored
Normal file
133
node_modules/har-validator/lib/node6/async.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.afterRequest = afterRequest;
|
||||
exports.beforeRequest = beforeRequest;
|
||||
exports.browser = browser;
|
||||
exports.cache = cache;
|
||||
exports.content = content;
|
||||
exports.cookie = cookie;
|
||||
exports.creator = creator;
|
||||
exports.entry = entry;
|
||||
exports.har = har;
|
||||
exports.header = header;
|
||||
exports.log = log;
|
||||
exports.page = page;
|
||||
exports.pageTimings = pageTimings;
|
||||
exports.postData = postData;
|
||||
exports.query = query;
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
exports.timings = timings;
|
||||
|
||||
var _harSchema = require('har-schema');
|
||||
|
||||
var schemas = _interopRequireWildcard(_harSchema);
|
||||
|
||||
var _ajv = require('ajv');
|
||||
|
||||
var _ajv2 = _interopRequireDefault(_ajv);
|
||||
|
||||
var _error = require('./error');
|
||||
|
||||
var _error2 = _interopRequireDefault(_error);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
let ajv;
|
||||
|
||||
function validate(name, data = {}, next) {
|
||||
// validator config
|
||||
ajv = ajv || new _ajv2.default({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
let validate = ajv.getSchema(name + '.json');
|
||||
|
||||
let valid = validate(data);
|
||||
|
||||
// callback?
|
||||
if (typeof next === 'function') {
|
||||
return next(!valid ? new _error2.default(validate.errors) : null, valid);
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
function afterRequest(data, next) {
|
||||
return validate('afterRequest', data, next);
|
||||
}
|
||||
|
||||
function beforeRequest(data, next) {
|
||||
return validate('beforeRequest', data, next);
|
||||
}
|
||||
|
||||
function browser(data, next) {
|
||||
return validate('browser', data, next);
|
||||
}
|
||||
|
||||
function cache(data, next) {
|
||||
return validate('cache', data, next);
|
||||
}
|
||||
|
||||
function content(data, next) {
|
||||
return validate('content', data, next);
|
||||
}
|
||||
|
||||
function cookie(data, next) {
|
||||
return validate('cookie', data, next);
|
||||
}
|
||||
|
||||
function creator(data, next) {
|
||||
return validate('creator', data, next);
|
||||
}
|
||||
|
||||
function entry(data, next) {
|
||||
return validate('entry', data, next);
|
||||
}
|
||||
|
||||
function har(data, next) {
|
||||
return validate('har', data, next);
|
||||
}
|
||||
|
||||
function header(data, next) {
|
||||
return validate('header', data, next);
|
||||
}
|
||||
|
||||
function log(data, next) {
|
||||
return validate('log', data, next);
|
||||
}
|
||||
|
||||
function page(data, next) {
|
||||
return validate('page', data, next);
|
||||
}
|
||||
|
||||
function pageTimings(data, next) {
|
||||
return validate('pageTimings', data, next);
|
||||
}
|
||||
|
||||
function postData(data, next) {
|
||||
return validate('postData', data, next);
|
||||
}
|
||||
|
||||
function query(data, next) {
|
||||
return validate('query', data, next);
|
||||
}
|
||||
|
||||
function request(data, next) {
|
||||
return validate('request', data, next);
|
||||
}
|
||||
|
||||
function response(data, next) {
|
||||
return validate('response', data, next);
|
||||
}
|
||||
|
||||
function timings(data, next) {
|
||||
return validate('timings', data, next);
|
||||
}
|
||||
22
node_modules/har-validator/lib/node6/error.js
generated
vendored
Normal file
22
node_modules/har-validator/lib/node6/error.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = HARError;
|
||||
function HARError(errors) {
|
||||
let 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 = exports['default'];
|
||||
130
node_modules/har-validator/lib/node6/promise.js
generated
vendored
Normal file
130
node_modules/har-validator/lib/node6/promise.js
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.afterRequest = afterRequest;
|
||||
exports.beforeRequest = beforeRequest;
|
||||
exports.browser = browser;
|
||||
exports.cache = cache;
|
||||
exports.content = content;
|
||||
exports.cookie = cookie;
|
||||
exports.creator = creator;
|
||||
exports.entry = entry;
|
||||
exports.har = har;
|
||||
exports.header = header;
|
||||
exports.log = log;
|
||||
exports.page = page;
|
||||
exports.pageTimings = pageTimings;
|
||||
exports.postData = postData;
|
||||
exports.query = query;
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
exports.timings = timings;
|
||||
|
||||
var _harSchema = require('har-schema');
|
||||
|
||||
var schemas = _interopRequireWildcard(_harSchema);
|
||||
|
||||
var _ajv = require('ajv');
|
||||
|
||||
var _ajv2 = _interopRequireDefault(_ajv);
|
||||
|
||||
var _error = require('./error');
|
||||
|
||||
var _error2 = _interopRequireDefault(_error);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
let ajv;
|
||||
|
||||
function validate(name, data = {}) {
|
||||
// validator config
|
||||
ajv = ajv || new _ajv2.default({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
let validate = ajv.getSchema(name + '.json');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let valid = validate(data);
|
||||
|
||||
!valid ? reject(new _error2.default(validate.errors)) : resolve(data);
|
||||
});
|
||||
}
|
||||
|
||||
function afterRequest(data) {
|
||||
return validate('afterRequest', data);
|
||||
}
|
||||
|
||||
function beforeRequest(data) {
|
||||
return validate('beforeRequest', data);
|
||||
}
|
||||
|
||||
function browser(data) {
|
||||
return validate('browser', data);
|
||||
}
|
||||
|
||||
function cache(data) {
|
||||
return validate('cache', data);
|
||||
}
|
||||
|
||||
function content(data) {
|
||||
return validate('content', data);
|
||||
}
|
||||
|
||||
function cookie(data) {
|
||||
return validate('cookie', data);
|
||||
}
|
||||
|
||||
function creator(data) {
|
||||
return validate('creator', data);
|
||||
}
|
||||
|
||||
function entry(data) {
|
||||
return validate('entry', data);
|
||||
}
|
||||
|
||||
function har(data) {
|
||||
return validate('har', data);
|
||||
}
|
||||
|
||||
function header(data) {
|
||||
return validate('header', data);
|
||||
}
|
||||
|
||||
function log(data) {
|
||||
return validate('log', data);
|
||||
}
|
||||
|
||||
function page(data) {
|
||||
return validate('page', data);
|
||||
}
|
||||
|
||||
function pageTimings(data) {
|
||||
return validate('pageTimings', data);
|
||||
}
|
||||
|
||||
function postData(data) {
|
||||
return validate('postData', data);
|
||||
}
|
||||
|
||||
function query(data) {
|
||||
return validate('query', data);
|
||||
}
|
||||
|
||||
function request(data) {
|
||||
return validate('request', data);
|
||||
}
|
||||
|
||||
function response(data) {
|
||||
return validate('response', data);
|
||||
}
|
||||
|
||||
function timings(data) {
|
||||
return validate('timings', data);
|
||||
}
|
||||
133
node_modules/har-validator/lib/node7/async.js
generated
vendored
Normal file
133
node_modules/har-validator/lib/node7/async.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.afterRequest = afterRequest;
|
||||
exports.beforeRequest = beforeRequest;
|
||||
exports.browser = browser;
|
||||
exports.cache = cache;
|
||||
exports.content = content;
|
||||
exports.cookie = cookie;
|
||||
exports.creator = creator;
|
||||
exports.entry = entry;
|
||||
exports.har = har;
|
||||
exports.header = header;
|
||||
exports.log = log;
|
||||
exports.page = page;
|
||||
exports.pageTimings = pageTimings;
|
||||
exports.postData = postData;
|
||||
exports.query = query;
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
exports.timings = timings;
|
||||
|
||||
var _harSchema = require('har-schema');
|
||||
|
||||
var schemas = _interopRequireWildcard(_harSchema);
|
||||
|
||||
var _ajv = require('ajv');
|
||||
|
||||
var _ajv2 = _interopRequireDefault(_ajv);
|
||||
|
||||
var _error = require('./error');
|
||||
|
||||
var _error2 = _interopRequireDefault(_error);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
let ajv;
|
||||
|
||||
function validate(name, data = {}, next) {
|
||||
// validator config
|
||||
ajv = ajv || new _ajv2.default({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
let validate = ajv.getSchema(name + '.json');
|
||||
|
||||
let valid = validate(data);
|
||||
|
||||
// callback?
|
||||
if (typeof next === 'function') {
|
||||
return next(!valid ? new _error2.default(validate.errors) : null, valid);
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
function afterRequest(data, next) {
|
||||
return validate('afterRequest', data, next);
|
||||
}
|
||||
|
||||
function beforeRequest(data, next) {
|
||||
return validate('beforeRequest', data, next);
|
||||
}
|
||||
|
||||
function browser(data, next) {
|
||||
return validate('browser', data, next);
|
||||
}
|
||||
|
||||
function cache(data, next) {
|
||||
return validate('cache', data, next);
|
||||
}
|
||||
|
||||
function content(data, next) {
|
||||
return validate('content', data, next);
|
||||
}
|
||||
|
||||
function cookie(data, next) {
|
||||
return validate('cookie', data, next);
|
||||
}
|
||||
|
||||
function creator(data, next) {
|
||||
return validate('creator', data, next);
|
||||
}
|
||||
|
||||
function entry(data, next) {
|
||||
return validate('entry', data, next);
|
||||
}
|
||||
|
||||
function har(data, next) {
|
||||
return validate('har', data, next);
|
||||
}
|
||||
|
||||
function header(data, next) {
|
||||
return validate('header', data, next);
|
||||
}
|
||||
|
||||
function log(data, next) {
|
||||
return validate('log', data, next);
|
||||
}
|
||||
|
||||
function page(data, next) {
|
||||
return validate('page', data, next);
|
||||
}
|
||||
|
||||
function pageTimings(data, next) {
|
||||
return validate('pageTimings', data, next);
|
||||
}
|
||||
|
||||
function postData(data, next) {
|
||||
return validate('postData', data, next);
|
||||
}
|
||||
|
||||
function query(data, next) {
|
||||
return validate('query', data, next);
|
||||
}
|
||||
|
||||
function request(data, next) {
|
||||
return validate('request', data, next);
|
||||
}
|
||||
|
||||
function response(data, next) {
|
||||
return validate('response', data, next);
|
||||
}
|
||||
|
||||
function timings(data, next) {
|
||||
return validate('timings', data, next);
|
||||
}
|
||||
22
node_modules/har-validator/lib/node7/error.js
generated
vendored
Normal file
22
node_modules/har-validator/lib/node7/error.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = HARError;
|
||||
function HARError(errors) {
|
||||
let 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 = exports['default'];
|
||||
130
node_modules/har-validator/lib/node7/promise.js
generated
vendored
Normal file
130
node_modules/har-validator/lib/node7/promise.js
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
exports.afterRequest = afterRequest;
|
||||
exports.beforeRequest = beforeRequest;
|
||||
exports.browser = browser;
|
||||
exports.cache = cache;
|
||||
exports.content = content;
|
||||
exports.cookie = cookie;
|
||||
exports.creator = creator;
|
||||
exports.entry = entry;
|
||||
exports.har = har;
|
||||
exports.header = header;
|
||||
exports.log = log;
|
||||
exports.page = page;
|
||||
exports.pageTimings = pageTimings;
|
||||
exports.postData = postData;
|
||||
exports.query = query;
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
exports.timings = timings;
|
||||
|
||||
var _harSchema = require('har-schema');
|
||||
|
||||
var schemas = _interopRequireWildcard(_harSchema);
|
||||
|
||||
var _ajv = require('ajv');
|
||||
|
||||
var _ajv2 = _interopRequireDefault(_ajv);
|
||||
|
||||
var _error = require('./error');
|
||||
|
||||
var _error2 = _interopRequireDefault(_error);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
let ajv;
|
||||
|
||||
function validate(name, data = {}) {
|
||||
// validator config
|
||||
ajv = ajv || new _ajv2.default({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
});
|
||||
|
||||
let validate = ajv.getSchema(name + '.json');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let valid = validate(data);
|
||||
|
||||
!valid ? reject(new _error2.default(validate.errors)) : resolve(data);
|
||||
});
|
||||
}
|
||||
|
||||
function afterRequest(data) {
|
||||
return validate('afterRequest', data);
|
||||
}
|
||||
|
||||
function beforeRequest(data) {
|
||||
return validate('beforeRequest', data);
|
||||
}
|
||||
|
||||
function browser(data) {
|
||||
return validate('browser', data);
|
||||
}
|
||||
|
||||
function cache(data) {
|
||||
return validate('cache', data);
|
||||
}
|
||||
|
||||
function content(data) {
|
||||
return validate('content', data);
|
||||
}
|
||||
|
||||
function cookie(data) {
|
||||
return validate('cookie', data);
|
||||
}
|
||||
|
||||
function creator(data) {
|
||||
return validate('creator', data);
|
||||
}
|
||||
|
||||
function entry(data) {
|
||||
return validate('entry', data);
|
||||
}
|
||||
|
||||
function har(data) {
|
||||
return validate('har', data);
|
||||
}
|
||||
|
||||
function header(data) {
|
||||
return validate('header', data);
|
||||
}
|
||||
|
||||
function log(data) {
|
||||
return validate('log', data);
|
||||
}
|
||||
|
||||
function page(data) {
|
||||
return validate('page', data);
|
||||
}
|
||||
|
||||
function pageTimings(data) {
|
||||
return validate('pageTimings', data);
|
||||
}
|
||||
|
||||
function postData(data) {
|
||||
return validate('postData', data);
|
||||
}
|
||||
|
||||
function query(data) {
|
||||
return validate('query', data);
|
||||
}
|
||||
|
||||
function request(data) {
|
||||
return validate('request', data);
|
||||
}
|
||||
|
||||
function response(data) {
|
||||
return validate('response', data);
|
||||
}
|
||||
|
||||
function timings(data) {
|
||||
return validate('timings', data);
|
||||
}
|
||||
101
node_modules/har-validator/package.json
generated
vendored
Normal file
101
node_modules/har-validator/package.json
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"_from": "har-validator@~4.2.1",
|
||||
"_id": "har-validator@4.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=",
|
||||
"_location": "/har-validator",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "har-validator@~4.2.1",
|
||||
"name": "har-validator",
|
||||
"escapedName": "har-validator",
|
||||
"rawSpec": "~4.2.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~4.2.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/request"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz",
|
||||
"_shasum": "33481d0f1bbff600dd203d75812a6a5fba002e2a",
|
||||
"_spec": "har-validator@~4.2.1",
|
||||
"_where": "C:\\Users\\Tom\\Documents\\Development\\bitsy-image-to-room\\node_modules\\request",
|
||||
"author": {
|
||||
"name": "Ahmad Nassri",
|
||||
"email": "ahmad@ahmadnassri.com",
|
||||
"url": "https://www.ahmadnassri.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ahmadnassri/har-validator/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": "^4.9.1",
|
||||
"har-schema": "^1.0.5"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.18.0",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-preset-env": "1.1.10",
|
||||
"babel-register": "^6.18.0",
|
||||
"codeclimate-test-reporter": "^0.4.0",
|
||||
"cz-conventional-changelog": "^1.2.0",
|
||||
"echint": "^4.0.1",
|
||||
"semantic-release": "^6.3.2",
|
||||
"snazzy": "^6.0.0",
|
||||
"tap": "^10.0.0"
|
||||
},
|
||||
"echint": {
|
||||
"ignore": [
|
||||
"lib/**"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"src"
|
||||
],
|
||||
"homepage": "https://github.com/ahmadnassri/har-validator",
|
||||
"keywords": [
|
||||
"har",
|
||||
"cli",
|
||||
"ajv",
|
||||
"http",
|
||||
"archive",
|
||||
"validate",
|
||||
"validator"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "lib/node4/promise.js",
|
||||
"name": "har-validator",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ahmadnassri/har-validator.git"
|
||||
},
|
||||
"scripts": {
|
||||
"codeclimate": "BABEL_ENV=test tap --coverage-report=text-lcov | codeclimate-test-reporter",
|
||||
"compile": "babel -q src",
|
||||
"coverage": "BABEL_ENV=test tap test --reporter silent --coverage --nyc-arg=--require --nyc-arg=babel-register",
|
||||
"pretest": "snazzy && echint",
|
||||
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
|
||||
"test": "BABEL_ENV=test tap test --reporter spec --node-arg=--require --node-arg=babel-register",
|
||||
"test-one": "BABEL_ENV=test tap --reporter spec --node-arg=--require --node-arg=babel-register"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"lib/**"
|
||||
]
|
||||
},
|
||||
"version": "4.2.1"
|
||||
}
|
||||
96
node_modules/har-validator/src/async.js
generated
vendored
Normal file
96
node_modules/har-validator/src/async.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
import * as schemas from 'har-schema'
|
||||
import Ajv from 'ajv'
|
||||
import HARError from './error'
|
||||
|
||||
let ajv
|
||||
|
||||
export function validate (name, data = {}, next) {
|
||||
// validator config
|
||||
ajv = ajv || new Ajv({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
})
|
||||
|
||||
let validate = ajv.getSchema(name + '.json')
|
||||
|
||||
let valid = validate(data)
|
||||
|
||||
// callback?
|
||||
if (typeof next === 'function') {
|
||||
return next(!valid ? new HARError(validate.errors) : null, valid)
|
||||
}
|
||||
|
||||
return valid
|
||||
}
|
||||
|
||||
export function afterRequest (data, next) {
|
||||
return validate('afterRequest', data, next)
|
||||
}
|
||||
|
||||
export function beforeRequest (data, next) {
|
||||
return validate('beforeRequest', data, next)
|
||||
}
|
||||
|
||||
export function browser (data, next) {
|
||||
return validate('browser', data, next)
|
||||
}
|
||||
|
||||
export function cache (data, next) {
|
||||
return validate('cache', data, next)
|
||||
}
|
||||
|
||||
export function content (data, next) {
|
||||
return validate('content', data, next)
|
||||
}
|
||||
|
||||
export function cookie (data, next) {
|
||||
return validate('cookie', data, next)
|
||||
}
|
||||
|
||||
export function creator (data, next) {
|
||||
return validate('creator', data, next)
|
||||
}
|
||||
|
||||
export function entry (data, next) {
|
||||
return validate('entry', data, next)
|
||||
}
|
||||
|
||||
export function har (data, next) {
|
||||
return validate('har', data, next)
|
||||
}
|
||||
|
||||
export function header (data, next) {
|
||||
return validate('header', data, next)
|
||||
}
|
||||
|
||||
export function log (data, next) {
|
||||
return validate('log', data, next)
|
||||
}
|
||||
|
||||
export function page (data, next) {
|
||||
return validate('page', data, next)
|
||||
}
|
||||
|
||||
export function pageTimings (data, next) {
|
||||
return validate('pageTimings', data, next)
|
||||
}
|
||||
|
||||
export function postData (data, next) {
|
||||
return validate('postData', data, next)
|
||||
}
|
||||
|
||||
export function query (data, next) {
|
||||
return validate('query', data, next)
|
||||
}
|
||||
|
||||
export function request (data, next) {
|
||||
return validate('request', data, next)
|
||||
}
|
||||
|
||||
export function response (data, next) {
|
||||
return validate('response', data, next)
|
||||
}
|
||||
|
||||
export function timings (data, next) {
|
||||
return validate('timings', data, next)
|
||||
}
|
||||
15
node_modules/har-validator/src/error.js
generated
vendored
Normal file
15
node_modules/har-validator/src/error.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export default function HARError (errors) {
|
||||
let 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
|
||||
93
node_modules/har-validator/src/promise.js
generated
vendored
Normal file
93
node_modules/har-validator/src/promise.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import * as schemas from 'har-schema'
|
||||
import Ajv from 'ajv'
|
||||
import HARError from './error'
|
||||
|
||||
let ajv
|
||||
|
||||
export function validate (name, data = {}) {
|
||||
// validator config
|
||||
ajv = ajv || new Ajv({
|
||||
allErrors: true,
|
||||
schemas: schemas
|
||||
})
|
||||
|
||||
let validate = ajv.getSchema(name + '.json')
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let valid = validate(data)
|
||||
|
||||
!valid ? reject(new HARError(validate.errors)) : resolve(data)
|
||||
})
|
||||
}
|
||||
|
||||
export function afterRequest (data) {
|
||||
return validate('afterRequest', data)
|
||||
}
|
||||
|
||||
export function beforeRequest (data) {
|
||||
return validate('beforeRequest', data)
|
||||
}
|
||||
|
||||
export function browser (data) {
|
||||
return validate('browser', data)
|
||||
}
|
||||
|
||||
export function cache (data) {
|
||||
return validate('cache', data)
|
||||
}
|
||||
|
||||
export function content (data) {
|
||||
return validate('content', data)
|
||||
}
|
||||
|
||||
export function cookie (data) {
|
||||
return validate('cookie', data)
|
||||
}
|
||||
|
||||
export function creator (data) {
|
||||
return validate('creator', data)
|
||||
}
|
||||
|
||||
export function entry (data) {
|
||||
return validate('entry', data)
|
||||
}
|
||||
|
||||
export function har (data) {
|
||||
return validate('har', data)
|
||||
}
|
||||
|
||||
export function header (data) {
|
||||
return validate('header', data)
|
||||
}
|
||||
|
||||
export function log (data) {
|
||||
return validate('log', data)
|
||||
}
|
||||
|
||||
export function page (data) {
|
||||
return validate('page', data)
|
||||
}
|
||||
|
||||
export function pageTimings (data) {
|
||||
return validate('pageTimings', data)
|
||||
}
|
||||
|
||||
export function postData (data) {
|
||||
return validate('postData', data)
|
||||
}
|
||||
|
||||
export function query (data) {
|
||||
return validate('query', data)
|
||||
}
|
||||
|
||||
export function request (data) {
|
||||
return validate('request', data)
|
||||
}
|
||||
|
||||
export function response (data) {
|
||||
return validate('response', data)
|
||||
}
|
||||
|
||||
export function timings (data) {
|
||||
return validate('timings', data)
|
||||
}
|
||||
Reference in New Issue
Block a user