UNPKG

@atomixdesign/nodepay-core

Version:
31 lines (30 loc) 2.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ErrorFactory = exports.ErrorType = void 0; var ErrorType; (function (ErrorType) { ErrorType["NotEmpty"] = "$[identifier] is empty. Value is required."; ErrorType["AlphanumRequired"] = "$[identifier] contains illegal characters. Only letters and numbers allowed, received $value."; ErrorType["NotAValidIP"] = "$[identifier] is invalid. Received $value."; ErrorType["FieldTooLong"] = "$[identifier] is too long. Maximal length is $constraint1 characters."; ErrorType["NotANumber"] = "$[identifier] is not a number. Number required, received $value."; ErrorType["NotACreditCard"] = "$[identifier] is not a valid credit card number. Received $value."; ErrorType["NotADate"] = "$[identifier] is not a valid date. Received $value."; ErrorType["NotAnEmail"] = "$[identifier] is not a valid email. Received $value."; ErrorType["NotAMobilePhone"] = "$[identifier] is not a valid mobile phone number. Received $value."; ErrorType["NotAPhoneNumber"] = "$[identifier] is not a valid phone number. Received $value."; ErrorType["NotABoolean"] = "$[identifier] is not a valid mobile phone number. Received $value."; ErrorType["NotAPostalCode"] = "$[identifier] is not a valid postal code with the selected locale. Received $value."; ErrorType["LengthOutOfBounds"] = "$[identifier] falls out of the expected length. Expected length between $constraint1 and $constraint2."; ErrorType["ValueTooLow"] = "Value too low for $[identifier]. Was $value, but minimum is $constraint1"; ErrorType["NotInAllowedSet"] = "Value for $[identifier] was not in the allowed set. Received $value."; })(ErrorType = exports.ErrorType || (exports.ErrorType = {})); var ErrorFactory = /** @class */ (function () { function ErrorFactory() { } ErrorFactory.getErrorMessage = function (messageForType, id) { return messageForType.replace('$[identifier]', id); }; return ErrorFactory; }()); exports.ErrorFactory = ErrorFactory;