UNPKG

imagic-sdk

Version:

Official Node.js SDK for Imagic image optimization API

45 lines 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NetworkError = exports.AuthenticationError = exports.ValidationError = exports.ImagicError = exports.SUPPORTED_MIME_TYPES = void 0; // Supported file types exports.SUPPORTED_MIME_TYPES = [ "image/png", "image/jpeg", "image/jpg", "image/bmp", "image/gif", "image/webp", "image/svg+xml", ]; // Error types class ImagicError extends Error { constructor(message, statusCode, errorType) { super(message); this.name = "ImagicError"; this.statusCode = statusCode; this.errorType = errorType; } } exports.ImagicError = ImagicError; class ValidationError extends ImagicError { constructor(message) { super(message, 400, "validation_error"); this.name = "ValidationError"; } } exports.ValidationError = ValidationError; class AuthenticationError extends ImagicError { constructor(message) { super(message, 401, "authentication_error"); this.name = "AuthenticationError"; } } exports.AuthenticationError = AuthenticationError; class NetworkError extends ImagicError { constructor(message) { super(message, 0, "network_error"); this.name = "NetworkError"; } } exports.NetworkError = NetworkError; //# sourceMappingURL=types.js.map