'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.ErrorCodes = exports.ValidationError = exports.SchemerError = undefined; var _es6Error = require('es6-error'); var _es6Error2 = _interopRequireDefault(_es6Error); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var SchemerError = exports.SchemerError = function (_ExtendableError) { _inherits(SchemerError, _ExtendableError); function SchemerError(errors) { _classCallCheck(this, SchemerError); var message = errors.map(function (e) { return e.message; }).join('\n'); var _this = _possibleConstructorReturn(this, (SchemerError.__proto__ || Object.getPrototypeOf(SchemerError)).call(this, message)); _this.errors = errors; return _this; } return SchemerError; }(_es6Error2.default); var ValidationError = exports.ValidationError = function (_ExtendableError2) { _inherits(ValidationError, _ExtendableError2); function ValidationError(_ref) { var errorCode = _ref.errorCode, fieldPath = _ref.fieldPath, message = _ref.message, data = _ref.data, meta = _ref.meta; _classCallCheck(this, ValidationError); var _this2 = _possibleConstructorReturn(this, (ValidationError.__proto__ || Object.getPrototypeOf(ValidationError)).call(this, message)); _this2.errorCode = errorCode; _this2.fieldPath = fieldPath; _this2.message = message; _this2.data = data; _this2.meta = meta; return _this2; } return ValidationError; }(_es6Error2.default); var ErrorCodes = exports.ErrorCodes = { SCHEMA_VALIDATION_ERROR: 'SCHEMA_VALIDATION_ERROR', SCHEMA_ADDITIONAL_PROPERTY: 'SCHEMA_ADDITIONAL_PROPERTY', SCHEMA_MISSING_REQUIRED_PROPERTY: 'SCHEMA_MISSING_REQUIRED_PROPERTY', SCHEMA_INVALID_PATTERN: 'SCHEMA_INVALID_PATTERN', INVALID_ASSET_URI: 'INVALID_ASSET_URI', INVALID_DIMENSIONS: 'INVALID_DIMENSIONS', INVALID_CONTENT_TYPE: 'INVALID_CONTENT_TYPE', NOT_SQUARE: 'NOT_SQUARE' };