unifi-client
Version:
NodeJs client for Unifi products (https://www.ui.com/)
88 lines (87 loc) • 5.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EErrorsCodes = void 0;
var EErrorsCodes;
(function (EErrorsCodes) {
EErrorsCodes[EErrorsCodes["UNKNOWN_ERROR"] = 0] = "UNKNOWN_ERROR";
/**
* fail to detect if it's UnifiOs or not
*/
EErrorsCodes[EErrorsCodes["FAIL_TO_DETECT_UNIFIOS"] = 1] = "FAIL_TO_DETECT_UNIFIOS";
/**
* Fail to read CSRF token from cookie in unifi answer
*/
EErrorsCodes[EErrorsCodes["FAIL_GET_CSRF_COOKIE"] = 2] = "FAIL_GET_CSRF_COOKIE";
/**
* the version of your controller is too old to access this property
*/
EErrorsCodes[EErrorsCodes["NEED_MORE_RECENT_CONTROLLER"] = 3] = "NEED_MORE_RECENT_CONTROLLER";
/**
* the type of controller (unifiOs / non unifiOs) doesn't allow this property
*/
EErrorsCodes[EErrorsCodes["UNIFI_CONTROLLER_TYPE_MISMATCH"] = 4] = "UNIFI_CONTROLLER_TYPE_MISMATCH";
/**
* you need to login before using this function
*/
EErrorsCodes[EErrorsCodes["NEED_LOGIN"] = 5] = "NEED_LOGIN";
/**
* some functions will show a message, and you can force to use it
*/
EErrorsCodes[EErrorsCodes["NEED_TO_FORCE"] = 6] = "NEED_TO_FORCE";
/**
* you pass an incorrect parameter
*/
EErrorsCodes[EErrorsCodes["BAD_PARAMETERS"] = 7] = "BAD_PARAMETERS";
/**
* Client fail to login
*/
EErrorsCodes[EErrorsCodes["FAIL_LOGIN"] = 8] = "FAIL_LOGIN";
/**
* fixed ip is needed to set fixed ip
*/
EErrorsCodes[EErrorsCodes["FIXED_IP_NEEDED"] = 9] = "FIXED_IP_NEEDED";
// CODE THAT CAN COME FROM UNIFI ( 100 to 600 )
EErrorsCodes[EErrorsCodes["CONTINUE"] = 100] = "CONTINUE";
EErrorsCodes[EErrorsCodes["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
EErrorsCodes[EErrorsCodes["OK"] = 200] = "OK";
EErrorsCodes[EErrorsCodes["CREATED"] = 201] = "CREATED";
EErrorsCodes[EErrorsCodes["ACCEPTED"] = 202] = "ACCEPTED";
EErrorsCodes[EErrorsCodes["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
EErrorsCodes[EErrorsCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
EErrorsCodes[EErrorsCodes["RESET_CONTENT"] = 205] = "RESET_CONTENT";
EErrorsCodes[EErrorsCodes["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
EErrorsCodes[EErrorsCodes["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
EErrorsCodes[EErrorsCodes["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
EErrorsCodes[EErrorsCodes["FOUND"] = 302] = "FOUND";
EErrorsCodes[EErrorsCodes["SEE_OTHER"] = 303] = "SEE_OTHER";
EErrorsCodes[EErrorsCodes["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
EErrorsCodes[EErrorsCodes["USE_PROXY"] = 305] = "USE_PROXY";
EErrorsCodes[EErrorsCodes["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
EErrorsCodes[EErrorsCodes["BAD_REQUEST"] = 400] = "BAD_REQUEST";
EErrorsCodes[EErrorsCodes["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
EErrorsCodes[EErrorsCodes["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
EErrorsCodes[EErrorsCodes["FORBIDDEN"] = 403] = "FORBIDDEN";
EErrorsCodes[EErrorsCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
EErrorsCodes[EErrorsCodes["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
EErrorsCodes[EErrorsCodes["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
EErrorsCodes[EErrorsCodes["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
EErrorsCodes[EErrorsCodes["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
EErrorsCodes[EErrorsCodes["CONFLICT"] = 409] = "CONFLICT";
EErrorsCodes[EErrorsCodes["GONE"] = 410] = "GONE";
EErrorsCodes[EErrorsCodes["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
EErrorsCodes[EErrorsCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
EErrorsCodes[EErrorsCodes["REQUEST_ENTITY_TOO_LARGE"] = 413] = "REQUEST_ENTITY_TOO_LARGE";
EErrorsCodes[EErrorsCodes["REQUEST_URI_TOO_LONG"] = 414] = "REQUEST_URI_TOO_LONG";
EErrorsCodes[EErrorsCodes["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
EErrorsCodes[EErrorsCodes["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
EErrorsCodes[EErrorsCodes["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
EErrorsCodes[EErrorsCodes["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
EErrorsCodes[EErrorsCodes["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
EErrorsCodes[EErrorsCodes["NEED_2FA"] = 499] = "NEED_2FA";
EErrorsCodes[EErrorsCodes["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
EErrorsCodes[EErrorsCodes["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
EErrorsCodes[EErrorsCodes["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
EErrorsCodes[EErrorsCodes["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
EErrorsCodes[EErrorsCodes["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
EErrorsCodes[EErrorsCodes["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
})(EErrorsCodes || (exports.EErrorsCodes = EErrorsCodes = {}));