# Path: voeventdb/server/restapi/v1/filter_base.py
# def add_to_filter_registry(cls):
#     def combinator(self, filters):
#     def filter(self, filter_value):
#     def generate_filter_set(self, args):
#     def apply_filter(self, query, args, pre_joins):
# def apply_filters(query, args):
# class QueryFilter(object):
# 
# Path: voeventdb/server/restapi/app.py
# def shutdown_session(exception=None):
#     def serve_docs_in_debug(filename='index.html'):
# 
# Path: voeventdb/server/restapi/v1/views.py
# def add_to_apiv1(queryview_class):
# def get_apiv1_rules():
# def error_to_dict(error):
# def validate_ivorn(url_encoded_ivorn):
# def apiv1_root_view():
# def ivorn_error(error):
# def page_not_found(abort_error):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, query):
#     def get_query(self):
#     def process_query(self, query):
#     def get_query(self):
#     def process_query(self, query):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, q):
# def packet_synopsis(url_encoded_ivorn=None):
# def packet_xml(url_encoded_ivorn=None):
# class Count(QueryView):
# class ListIvorn(ListQueryView):
# class ListIvornReferenceCount(ListQueryView):
# class ListIvornCitedCount(ListQueryView):
# class MapAuthoredMonthCount(QueryView):
# class MapRoleCount(QueryView):
# class MapStreamCount(QueryView):
# class MapStreamRoleCount(QueryView):


import inspect
import voeventdb.server.restapi.v1.views as v0views
import voeventdb.server.restapi.v1.filters as v0filters
from voeventdb.server.restapi.v1.filter_base import filter_registry, QueryFilter
from voeventdb.server.restapi.app import app
from voeventdb.server.restapi.v1.views import QueryView, ListQueryView
# Add filters to registry:



def apiv1_endpoints():
    # Grab all app endpoints, filter to apiv1
    apiv1_rules = [r for r in app.url_map.iter_rules()
                   if r.endpoint.startswith('apiv1')]
    # Filter duplicate listings for path-routed endpoints (packet_xml, synopsis)
    apiv1_rules = [r for r in apiv1_rules if
                   '<' not in str(r)]
    return {str(r.endpoint)[6:]: str(r) for r in apiv1_rules}


def listqueryview_subclasses():
    return [cls for cls in vars(v0views).values()
            if inspect.isclass(cls)
            and issubclass(cls, ListQueryView)
            and not cls is ListQueryView
            ]

def queryfilter_subclasses():
    return [cls for cls in vars(v0filters).values()
            if inspect.isclass(cls)
            and issubclass(cls, QueryFilter)

# Path: voeventdb/server/restapi/v1/filter_base.py
# def add_to_filter_registry(cls):
#     def combinator(self, filters):
#     def filter(self, filter_value):
#     def generate_filter_set(self, args):
#     def apply_filter(self, query, args, pre_joins):
# def apply_filters(query, args):
# class QueryFilter(object):
# 
# Path: voeventdb/server/restapi/app.py
# def shutdown_session(exception=None):
#     def serve_docs_in_debug(filename='index.html'):
# 
# Path: voeventdb/server/restapi/v1/views.py
# def add_to_apiv1(queryview_class):
# def get_apiv1_rules():
# def error_to_dict(error):
# def validate_ivorn(url_encoded_ivorn):
# def apiv1_root_view():
# def ivorn_error(error):
# def page_not_found(abort_error):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, query):
#     def get_query(self):
#     def process_query(self, query):
#     def get_query(self):
#     def process_query(self, query):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, q):
#     def get_query(self):
#     def process_query(self, q):
# def packet_synopsis(url_encoded_ivorn=None):
# def packet_xml(url_encoded_ivorn=None):
# class Count(QueryView):
# class ListIvorn(ListQueryView):
# class ListIvornReferenceCount(ListQueryView):
# class ListIvornCitedCount(ListQueryView):
# class MapAuthoredMonthCount(QueryView):
# class MapRoleCount(QueryView):
# class MapStreamCount(QueryView):
# class MapStreamRoleCount(QueryView):


# Path: voeventdb/server/restapi/inspection_utils.py
import inspect
import voeventdb.server.restapi.v1.views as v0views
import voeventdb.server.restapi.v1.filters as v0filters
from voeventdb.server.restapi.v1.filter_base import filter_registry, QueryFilter
from voeventdb.server.restapi.app import app
from voeventdb.server.restapi.v1.views import QueryView, ListQueryView

# Add filters to registry:



def apiv1_endpoints():
    # Grab all app endpoints, filter to apiv1
    apiv1_rules = [r for r in app.url_map.iter_rules()
                   if r.endpoint.startswith('apiv1')]
    # Filter duplicate listings for path-routed endpoints (packet_xml, synopsis)
    apiv1_rules = [r for r in apiv1_rules if
                   '<' not in str(r)]
    return {str(r.endpoint)[6:]: str(r) for r in apiv1_rules}


def listqueryview_subclasses():
    return [cls for cls in vars(v0views).values()
            if inspect.isclass(cls)
            and issubclass(cls, ListQueryView)
            and not cls is ListQueryView
            ]

def queryfilter_subclasses():
    return [cls for cls in vars(v0filters).values()
            if inspect.isclass(cls)
            and issubclass(cls, QueryFilter)

            and not cls is QueryFilter