{
    "code": 4,
    "subDomains": {
        "assert": {
            "code": 1,
            "errors": {
                "invalid_plugins_dir": {
                    "description": "The enabled plugins directory cannot be opened",
                    "code": 1,
                    "message": "Unable to read plugins directory \"%s\"; %s.",
                    "class": "InternalError"
                },
                "cannot_load": {
                    "description": "Kuzzle is unable to load a plugin",
                    "code": 2,
                    "message": "Unable to load plugin from path \"%s\"; %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_hook": {
                    "description": "A hook must point to either a function named directly exposed by the plugin, or a function. This error is thrown when a hook property is configured with neither of these values",
                    "code": 3,
                    "message": "Unable to configure a hook for the event \"%s\": \"%s\" should be a function. %s",
                    "class": "PluginImplementationError"
                },
                "invalid_pipe": {
                    "description": "A pipe must point to either a function named directly exposed by the plugin, or a function. This error is thrown when a hook property is configured with neither of these values",
                    "code": 4,
                    "message": "Unable to configure a pipe for the event \"%s\": \"%s\" should be a function. %s",
                    "class": "PluginImplementationError"
                },
                "init_not_found": {
                    "description": "The plugin does not have an 'init' function",
                    "code": 5,
                    "message": "Plugin \"%s\": No \"init\" method found.",
                    "class": "PluginImplementationError"
                },
                "privileged_not_supported": {
                    "description": "The 'privileged' flag has been set in Kuzzle's configuration for that plugin, but not in the plugin's manifest",
                    "code": 6,
                    "message": "The plugin \"%s\" is configured to run in privileged mode, but it does not seem to support it.",
                    "class": "PluginImplementationError"
                },
                "privileged_not_set": {
                    "description": "The 'privileged' flag has been set in the plugin's manifest file, but it needs also to be added in Kuzzle's configuration",
                    "code": 7,
                    "message": "The plugin \"%s\" needs to run in privileged mode to work, you have to explicitly set \"privileged: true\" in its configuration.",
                    "class": "PluginImplementationError"
                },
                "not_a_constructor": {
                    "description": "The exposed plugin is not a constructor",
                    "code": 8,
                    "message": "Plugin \"%s\" is not a constructor.",
                    "class": "PluginImplementationError"
                },
                "name_already_exists": {
                    "description": "Another plugin with the same name has already been loaded",
                    "code": 9,
                    "message": "A plugin named %s already exists",
                    "class": "PluginImplementationError"
                },
                "invalid_plugin_name": {
                    "description": "The plugin name is invalid. Plugin names can only contain lowercase letters and dashes.",
                    "code": 10,
                    "message": "Plugin name \"%s\" is invalid. Plugin names must be in kebab-case.",
                    "class": "PluginImplementationError"
                },
                "no_name_provided": {
                    "description": "The plugin does not have a constructor method and no name has been provided.",
                    "code": 11,
                    "message": "Cannot infer plugin name. No constructor method and no name provided",
                    "class": "PluginImplementationError"
                },
                "invalid_controller_definition": {
                    "description": "The controller definition is incorrect.",
                    "code": 12,
                    "message": "Incorrect \"%s\" controller definition: %s",
                    "class": "PluginImplementationError"
                },
                "invalid_application_name": {
                    "description": "The application name is invalid. Application names can only contain lowercase letters and dashes.",
                    "code": 13,
                    "message": "Application name \"%s\" is invalid. Application names must be in kebab-case.",
                    "class": "PluginImplementationError"
                },
                "duplicated_api_definition": {
                    "description": "You cannot use the \"api\" and the \"controllers\" objects at the same time. Use the \"api\" object to define controllers.",
                    "code": 14,
                    "message": "Cannot define new controllers in the \"api\" and the \"controllers\" objects at the same time",
                    "class": "PluginImplementationError"
                },
                "plugin_not_found": {
                    "description": "The request plugin does not exists or have not been loaded yet.",
                    "code": 15,
                    "message": "Plugin \"%s\" not found.%s",
                    "class": "NotFoundError"
                },
                "invalid_openapi_schema": {
                    "description": "OpenAPI specification is invalid",
                    "code": 16,
                    "message": "Invalid OpenAPI specification: \"%s\"",
                    "class": "PluginImplementationError"
                }
            }
        },
        "runtime": {
            "code": 2,
            "errors": {
                "failed_init": {
                    "description": "An exception was thrown by a plugin's init function",
                    "code": 1,
                    "message": "Something went wrong during initialization of \"%s\" plugin. Set \"plugins.common.failsafeMode\" to true to bypass plugin initialization.",
                    "class": "PluginImplementationError"
                },
                "unexpected_error": {
                    "description": "Embeds an unexpected plugin error into a standardized KuzzleError object",
                    "code": 2,
                    "message": "Caught an unexpected plugin error: %s",
                    "class": "PluginImplementationError"
                },
                "pipe_timeout": {
                    "description": "A pipe function execution took more than the configured server limit",
                    "code": 3,
                    "message": "Plugin \"%s\": timeout error. A pipe on the event \"%s\" exceeded the timeout delay (%sms). Aborting.",
                    "class": "GatewayTimeoutError",
                    "deprecated": "2.2.0"
                },
                "too_many_pipes": {
                    "description": "The number of running pipes exceeds the configured capacity (see configuration files). This may be caused by pipes being too slow, or by an insufficient number of Kuzzle nodes.",
                    "code": 4,
                    "message": "Request discarded: maximum number of executing pipe functions reached.",
                    "class": "ServiceUnavailableError"
                },
                "already_started": {
                    "description": "Features definition cannot be changed after startup.",
                    "code": 5,
                    "message": "Cannot use property \"%s\" when application is already running",
                    "class": "PluginImplementationError"
                },
                "unavailable_before_start": {
                    "description": "The property is only accessible after application startup.",
                    "code": 6,
                    "message": "Cannot use property \"%s\" before application startup",
                    "class": "PluginImplementationError"
                },
                "unknown_pipe": {
                    "description": "The provided pipe identifier is unknown.",
                    "code": 7,
                    "message": "Unknown pipe ID \"%s\"",
                    "class": "PluginImplementationError"
                },
                "unexpected_installation_error": {
                    "description": "Embeds an unexpected installation error into a standardized KuzzleError object.",
                    "code": 8,
                    "message": "Caught an unexpected error while executing installation \"%s\": %s",
                    "class": "PluginImplementationError"
                },
                "incompatible": {
                    "description": "Some features incompatible are being used at the same time",
                    "code": 9,
                    "message": "\"%s\" and \"%s\" are incompatible. Please use only one of these features at the same time.",
                    "class": "PluginImplementationError"
                }
            }
        },
        "strategy": {
            "code": 3,
            "errors": {
                "invalid_description": {
                    "description": "The strategy.description field must be an object",
                    "code": 1,
                    "message": "%s expected the strategy description to be an object, got: %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_methods": {
                    "description": "The strategy.methods field must be an object",
                    "code": 2,
                    "message": "%s expected a \"methods\" property of type \"object\", got: %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_method_type": {
                    "description": "Method definitions in the strategy.methods configuration must be of type string",
                    "code": 3,
                    "message": "%s expected a \"%s\" property of type \"string\", got: %s.",
                    "class": "PluginImplementationError"
                },
                "missing_method_function": {
                    "description": "A required strategy method is missing",
                    "code": 4,
                    "message": "%s the strategy method \"%s\" must point to an exposed function.",
                    "class": "PluginImplementationError"
                },
                "invalid_config": {
                    "description": "The strategy.config field must be an object",
                    "code": 5,
                    "message": "%s expected a \"config\" property of type \"object\", got: %s.",
                    "class": "PluginImplementationError"
                },
                "unexpected_constructor": {
                    "description": "The (deprecated) constructor property can only be set if there is no authenticator defined",
                    "code": 6,
                    "message": "%s the \"authenticator\" and \"constructor\" parameters cannot both be set.",
                    "class": "PluginImplementationError"
                },
                "invalid_constructor": {
                    "description": "The strategy.constructor field must be a constructor",
                    "code": 7,
                    "message": "%s invalid \"constructor\" property value: constructor expected.",
                    "class": "PluginImplementationError"
                },
                "invalid_authenticator": {
                    "description": "The strategy.authenticator field must be a string",
                    "code": 8,
                    "message": "%s expected an \"authenticator\" property of type \"string\", got: %s.",
                    "class": "PluginImplementationError"
                },
                "unknown_authenticator": {
                    "description": "This strategy uses an authenticator that hasn't been declared in this.authenticators",
                    "code": 9,
                    "message": "%s unknown authenticator: %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_option": {
                    "description": "If defined, the \"strategy.config.strategyOptions\" and \"strategy.config.authenticateOptions\" properties must be objects",
                    "code": 10,
                    "message": "%s expected the \"%s\" property to be of type \"object\", got: %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_fields": {
                    "description": "The field strategy.config.fields must be an array or null",
                    "code": 11,
                    "message": "%s expected the \"fields\" property to be of type \"array\", got: %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_definition": {
                    "description": "The strategies property must be a non-empty object",
                    "code": 12,
                    "message": "%s the exposed \"strategies\" plugin property must be a non-empty object.",
                    "class": "PluginImplementationError"
                },
                "failed_registration": {
                    "description": "Passportjs rejected this strategy (see the message for more information)",
                    "code": 13,
                    "message": "Failed to register strategy \"%s\": %s",
                    "class": "PluginImplementationError"
                },
                "invalid_verify_return": {
                    "description": "The \"verify\" method must return a promise",
                    "code": 14,
                    "message": "%s The \"verify\" method is expected to return a Promise, got: %s.",
                    "class": "PluginImplementationError"
                },
                "invalid_verify_resolve": {
                    "description": "The \"verify\" strategy method resolved to a non-object return value",
                    "code": 15,
                    "message": "%s invalid authentication strategy result (expected an object).",
                    "class": "PluginImplementationError"
                },
                "invalid_kuid": {
                    "description": "The \"verify\" method returned an invalid kuid",
                    "code": 16,
                    "message": "%s invalid authentication kuid returned: expected a string, got a %s.",
                    "class": "PluginImplementationError"
                },
                "unknown_kuid": {
                    "description": "The \"verify\" method returned an unknown kuid",
                    "code": 17,
                    "message": "%s returned an unknown Kuzzle user identifier.",
                    "class": "PluginImplementationError"
                },
                "unauthorized_removal": {
                    "description": "Tried to remove a strategy owned by another plugin",
                    "code": 18,
                    "message": "Cannot remove strategy %s: owned by another plugin.",
                    "class": "PluginImplementationError"
                },
                "strategy_not_found": {
                    "description": "Attempted to remove a non-existent authentication strategy",
                    "code": 19,
                    "message": "Cannot remove strategy %s: strategy does not exist.",
                    "class": "NotFoundError"
                },
                "missing_user": {
                    "description": "A strategy plugin approved credentials without providing a user object to Kuzzle",
                    "code": 20,
                    "message": "%s",
                    "class": "UnauthorizedError"
                },
                "missing_optional_method": {
                    "description": "An optional method has not been implemented for this strategy",
                    "code": 21,
                    "message": "\"%s\" method is optional. The %s strategy plugin has not yet implemented it.",
                    "class": "PluginImplementationError"
                }
            }
        },
        "controller": {
            "code": 4,
            "errors": {
                "invalid_description": {
                    "description": "The controller description must be an object",
                    "code": 1,
                    "message": "%s Invalid controller description type (expected object, got: \"%s\").",
                    "class": "PluginImplementationError"
                },
                "invalid_action": {
                    "description": "A controller action must be a function name, or a function",
                    "code": 2,
                    "message": "%s Action for \"%s\" is neither a function nor a function name. %s",
                    "class": "PluginImplementationError"
                },
                "unexpected_route_property": {
                    "description": "An unexpected property has been found in a controller route definition",
                    "code": 3,
                    "message": "%s Unexpected property \"%s\" in route definition. %s",
                    "class": "PluginImplementationError"
                },
                "invalid_route_property": {
                    "description": "Invalid route property format (must be a non-empty string)",
                    "code": 4,
                    "message": "%s \"%s\" must be a non-empty string.",
                    "class": "PluginImplementationError"
                },
                "undefined_controller": {
                    "description": "A HTTP route points to an non-existent controller",
                    "code": 5,
                    "message": "%s Undefined controller \"%s\". %s",
                    "class": "PluginImplementationError"
                },
                "undefined_action": {
                    "description": "A HTTP route points to an non-existent controller action",
                    "code": 6,
                    "message": "%s Undefined action \"%s\". %s",
                    "class": "PluginImplementationError"
                },
                "unsupported_verb": {
                    "description": "A HTTP route is using an unsupported HTTP verb",
                    "code": 7,
                    "message": "%s Only the following http verbs are allowed: \"%s\". %s",
                    "class": "PluginImplementationError"
                },
                "unserializable_response": {
                    "description": "A plugin controller action returned a non-serializable response",
                    "code": 8,
                    "message": "Unable to serialize response. Are you trying to return the request?",
                    "class": "PluginImplementationError"
                },
                "invalid_action_response": {
                    "description": "API actions added by plugins must return a promise",
                    "code": 9,
                    "message": "Unexpected return value from action \"%s:%s\": expected a Promise",
                    "class": "PluginImplementationError"
                },
                "invalid_openapi_schema": {
                    "description": "OpenAPI specification is invalid",
                    "code": 10,
                    "message": "Invalid OpenAPI specification in \"%s:%s\", %s : %s",
                    "class": "PluginImplementationError"
                }
            }
        },
        "manifest": {
            "code": 5,
            "errors": {
                "cannot_load": {
                    "description": "Unable to load the plugin's manifest file",
                    "code": 1,
                    "message": "[%s] Unable to load the file 'manifest.json': %s",
                    "class": "PluginImplementationError"
                },
                "version_mismatch": {
                    "description": "Current Kuzzle's version does not match the plugin's requirements",
                    "code": 2,
                    "message": "[%s] Version mismatch: current Kuzzle version %s does not match the manifest requirements (%s).",
                    "class": "PluginImplementationError"
                },
                "invalid_name_type": {
                    "description": "Invalid plugin's name",
                    "code": 3,
                    "message": "[%s] Invalid \"name\" property: expected a non-empty string.",
                    "class": "PluginImplementationError"
                },
                "invalid_name": {
                    "description": "Invalid characters in a plugin's name",
                    "code": 4,
                    "message": "[%s] Invalid plugin name. The name must be comprised only of letters, numbers, hyphens and underscores.",
                    "class": "PluginImplementationError"
                },
                "missing_name": {
                    "description": "A plugin name is required",
                    "code": 5,
                    "message": "[%s] A \"name\" property is required.",
                    "class": "PluginImplementationError"
                },
                "invalid_errors": {
                    "description": "The 'errors' property format is invalid",
                    "code": 6,
                    "message": "[%s] errors field in manifest.json badly formatted: %s",
                    "class": "PluginImplementationError"
                },
                "invalid_privileged": {
                    "description": "The \"privileged\" property is invalid",
                    "code": 7,
                    "message": "[%s] Invalid \"privileged\" property: expected a boolean, got a %s.",
                    "class": "PluginImplementationError"
                },
                "missing_package": {
                    "description": "The plugin is missing a 'package.json' file (run 'npm init' to create one)",
                    "code": 8,
                    "message": "[%s] No package.json file found.",
                    "class": "PluginImplementationError"
                },
                "missing_package_name": {
                    "description": "A 'name' property in the 'package.json' file is required by Kuzzle, as it is used as the plugin's unique name",
                    "code": 9,
                    "message": "[%s] No \"name\" property provided in package.json.",
                    "class": "PluginImplementationError"
                },
                "missing_version": {
                    "description": "Plugin manifest must provide a kuzzleVersion parameter, with the range of compatible Kuzzle versions",
                    "code": 10,
                    "message": "[%s] A \"kuzzleVersion\" property is required",
                    "class": "PluginImplementationError"
                }
            }
        },
        "context": {
            "code": 6,
            "errors": {
                "missing_collection": {
                    "description": "The 'collection' argument is required, but none was provided",
                    "code": 1,
                    "message": "Missing collection argument.",
                    "class": "PluginImplementationError"
                },
                "unavailable_realtime": {
                    "description": "Due to technical limitations, subscribe and unsubscribe methods are only available through the embedded SDK.",
                    "code": 2,
                    "message": "The method \"realtime:%s\" is unavailable with execute(). Use the embedded SDK instead.",
                    "class": "PluginImplementationError"
                },
                "invalid_user": {
                    "description": "The user object provided to the sdk.as() method is not a valid user with a least an '_id' property",
                    "code": 3,
                    "message": "You must provide a valid User object when adding context with as().",
                    "class": "PluginImplementationError"
                },
                "invalid_callback": {
                    "description": "A non-function callback has been provided",
                    "code": 4,
                    "message": "Invalid argument: Expected callback to be a function, received \"%s\".",
                    "class": "PluginImplementationError"
                },
                "missing_request": {
                    "description": "A Request object is required, but none was supplied",
                    "code": 5,
                    "message": "Invalid argument: a Request object must be supplied.",
                    "class": "PluginImplementationError"
                },
                "missing_request_data": {
                    "description": "A Request object and/or request data must be provided",
                    "code": 6,
                    "message": "A Request object and/or request data must be provided.",
                    "class": "PluginImplementationError"
                },
                "invalid_event": {
                    "description": "Invalid event name (colons are not allowed in event names)",
                    "deprecated": "2.2.0",
                    "code": 7,
                    "message": "Custom event invalid name (%s). Colons are not allowed in custom events.",
                    "class": "PluginImplementationError"
                },
                "missing_authenticator": {
                    "description": "Missing \"strategy.config.authenticator\" property",
                    "code": 8,
                    "message": "[%s] Strategy %s: dynamic strategy registration can only be done using an \"authenticator\" option (see https://tinyurl.com/y7boozbk).",
                    "class": "PluginImplementationError"
                }
            }
        },
        "authenticators": {
            "code": 7,
            "errors": {
                "not_an_object": {
                    "description": "The \"authenticators\" property must be an object",
                    "code": 1,
                    "message": "%s the exposed \"authenticators\" plugin property must be of type \"object\".",
                    "class": "PluginImplementationError"
                },
                "invalid_authenticator": {
                    "description": "Authenticators exposed in the \"authenticators\" object must be constructors",
                    "code": 2,
                    "message": "%s invalid authenticator.%s property: expected a constructor.",
                    "class": "PluginImplementationError"
                }
            }
        }
    }
}
