import typing


def flatten_catalog(catalog: typing.List[dict]) -> dict:
    """Turn the raw service catalog into a simple dict."""
    return {
        service['type']: {
            endpoint['region']: endpoint['url'] for endpoint in service['endpoints']
        } for service in catalog
    }