def METHOD_NAME(package_name, registry_base_url=None) -> Dict[str, Any]:
    # returns a dictionary of metadata for all versions of a package
    response = _get_cached(package_name, registry_base_url)
    # Either redirectnamespace or redirectname in the JSON response indicate a redirect
    # redirectnamespace redirects based on package ownership
    # redirectname redirects based on package name
    # Both can be present at the same time, or neither. Fails gracefully to old name
    if ("redirectnamespace" in response) or ("redirectname" in response):
        if ("redirectnamespace" in response) and response["redirectnamespace"] is not None:
            use_namespace = response["redirectnamespace"]
        else:
            use_namespace = response["namespace"]
        if ("redirectname" in response) and response["redirectname"] is not None:
            use_name = response["redirectname"]
        else:
            use_name = response["name"]
        new_nwo = use_namespace + "/" + use_name
        deprecations.warn("package-redirect", old_name=package_name, new_name=new_nwo)
    return response["versions"]