示例#1
0
文件: urls.py 项目: Xen0byte/zulip
#   - Likewise for the local dev server in tools/run-dev.py.

# These endpoints constitute the currently designed API (V1), which uses:
# * REST verbs
# * Basic auth (username:password is email:apiKey)
# * Take and return json-formatted data
#
# If you're adding a new endpoint to the code that requires authentication,
# please add it here.
# See rest_dispatch in zerver.lib.rest for an explanation of auth methods used
#
# All of these paths are accessed by either a /json or /api/v1 prefix;
# e.g. `PATCH /json/realm` or `PATCH /api/v1/realm`.
v1_api_and_json_patterns = [
    # realm-level calls
    rest_path("realm", PATCH=update_realm),
    path("realm/subdomain/<subdomain>", check_subdomain_available),
    # realm/domains -> zerver.views.realm_domains
    rest_path("realm/domains",
              GET=list_realm_domains,
              POST=create_realm_domain),
    rest_path("realm/domains/<domain>",
              PATCH=patch_realm_domain,
              DELETE=delete_realm_domain),
    # realm/emoji -> zerver.views.realm_emoji
    rest_path("realm/emoji", GET=list_emoji),
    rest_path(
        "realm/emoji/<emoji_name>",
        POST=upload_emoji,
        DELETE=(delete_emoji, {"intentionally_undocumented"}),
    ),
示例#2
0
文件: urls.py 项目: zhouzhiqi/zulip
#   - Likewise for the local dev server in tools/run-dev.py.

# These endpoints constitute the currently designed API (V1), which uses:
# * REST verbs
# * Basic auth (username:password is email:apiKey)
# * Take and return json-formatted data
#
# If you're adding a new endpoint to the code that requires authentication,
# please add it here.
# See rest_dispatch in zerver.lib.rest for an explanation of auth methods used
#
# All of these paths are accessed by either a /json or /api/v1 prefix;
# e.g. `PATCH /json/realm` or `PATCH /api/v1/realm`.
v1_api_and_json_patterns = [
    # realm-level calls
    rest_path('realm', PATCH=update_realm),

    # Returns a 204, used by desktop app to verify connectivity status
    path('generate_204', generate_204),
    path('realm/subdomain/<subdomain>', check_subdomain_available),

    # realm/domains -> zerver.views.realm_domains
    rest_path('realm/domains',
              GET=list_realm_domains,
              POST=create_realm_domain),
    rest_path('realm/domains/<domain>',
              PATCH=patch_realm_domain,
              DELETE=delete_realm_domain),

    # realm/emoji -> zerver.views.realm_emoji
    rest_path('realm/emoji', GET=list_emoji),
示例#3
0
文件: urls.py 项目: yushao2/zulip
from zerver.lib.rest import rest_path
from zilencer.views import (
    register_remote_push_device,
    register_remote_server,
    remote_server_check_analytics,
    remote_server_notify_push,
    remote_server_post_analytics,
    unregister_all_remote_push_devices,
    unregister_remote_push_device,
)

i18n_urlpatterns: Any = []

# Zilencer views following the REST API style
v1_api_and_json_patterns = [
    rest_path("remotes/push/register", POST=register_remote_push_device),
    rest_path("remotes/push/unregister", POST=unregister_remote_push_device),
    rest_path("remotes/push/unregister/all", POST=unregister_all_remote_push_devices),
    rest_path("remotes/push/notify", POST=remote_server_notify_push),
    # Push signup doesn't use the REST API, since there's no auth.
    path("remotes/server/register", register_remote_server),
    # For receiving table data used in analytics and billing
    rest_path("remotes/server/analytics", POST=remote_server_post_analytics),
    rest_path("remotes/server/analytics/status", GET=remote_server_check_analytics),
]

urlpatterns = [
    path("api/v1/", include(v1_api_and_json_patterns)),
    path("json/", include(v1_api_and_json_patterns)),
]
示例#4
0
    # Zephyr/MIT
    path("zephyr/",
         TemplateView.as_view(template_name="corporate/zephyr.html")),
    path("zephyr-mirror/",
         TemplateView.as_view(template_name="corporate/zephyr-mirror.html")),
    path("jobs/", TemplateView.as_view(template_name="corporate/jobs.html")),
    # Billing
    path("billing/", billing_home, name="billing_home"),
    path("upgrade/", initial_upgrade, name="initial_upgrade"),
    path("support/", support_request),
    path("billing/event_status/", event_status_page, name="event_status_page"),
    path("stripe/webhook/", stripe_webhook, name="stripe_webhook"),
]

v1_api_and_json_patterns = [
    rest_path("billing/upgrade", POST=upgrade),
    rest_path("billing/sponsorship", POST=sponsorship),
    rest_path("billing/plan", PATCH=update_plan),
    rest_path("billing/session/start_card_update_session",
              POST=start_card_update_stripe_session),
    rest_path(
        "billing/session/start_retry_payment_intent_session",
        POST=start_retry_payment_intent_session,
    ),
    rest_path("billing/event/status", GET=event_status),
]

# Make a copy of i18n_urlpatterns so that they appear without prefix for English
urlpatterns = list(i18n_urlpatterns)

urlpatterns += [
示例#5
0
    ),
    # User-visible stats page
    path("stats", stats, name="stats"),
]

# These endpoints are a part of the API (V1), which uses:
# * REST verbs
# * Basic auth (username:password is email:apiKey)
# * Takes and returns json-formatted data
#
# See rest_dispatch in zerver.lib.rest for an explanation of auth methods used
#
# All of these paths are accessed by either a /json or /api prefix
v1_api_and_json_patterns = [
    # get data for the graphs at /stats
    rest_path("analytics/chart_data", GET=get_chart_data),
    rest_path("analytics/chart_data/realm/<realm_str>", GET=get_chart_data_for_realm),
    rest_path("analytics/chart_data/installation", GET=get_chart_data_for_installation),
    rest_path(
        "analytics/chart_data/remote/<int:remote_server_id>/installation",
        GET=get_chart_data_for_remote_installation,
    ),
    rest_path(
        "analytics/chart_data/remote/<int:remote_server_id>/realm/<int:remote_realm_id>",
        GET=get_chart_data_for_remote_realm,
    ),
]

i18n_urlpatterns += [
    path("api/v1/", include(v1_api_and_json_patterns)),
    path("json/", include(v1_api_and_json_patterns)),
示例#6
0
    sponsorship,
    update_plan,
    upgrade,
)
from zerver.lib.rest import rest_path

i18n_urlpatterns: Any = [
    # Zephyr/MIT
    path("zephyr/", TemplateView.as_view(template_name="corporate/zephyr.html")),
    path("zephyr-mirror/", TemplateView.as_view(template_name="corporate/zephyr-mirror.html")),
    path("jobs/", TemplateView.as_view(template_name="corporate/jobs.html")),
    # Billing
    path("billing/", billing_home),
    path("upgrade/", initial_upgrade, name="initial_upgrade"),
]

v1_api_and_json_patterns = [
    rest_path("billing/upgrade", POST=upgrade),
    rest_path("billing/sponsorship", POST=sponsorship),
    rest_path("billing/plan", PATCH=update_plan),
    rest_path("billing/sources/change", POST=replace_payment_source),
]

# Make a copy of i18n_urlpatterns so that they appear without prefix for English
urlpatterns = list(i18n_urlpatterns)

urlpatterns += [
    path("api/v1/", include(v1_api_and_json_patterns)),
    path("json/", include(v1_api_and_json_patterns)),
]
示例#7
0
文件: urls.py 项目: zhouzhiqi/zulip
    # User-visible stats page
    path('stats', stats, name='stats'),
]

# These endpoints are a part of the API (V1), which uses:
# * REST verbs
# * Basic auth (username:password is email:apiKey)
# * Takes and returns json-formatted data
#
# See rest_dispatch in zerver.lib.rest for an explanation of auth methods used
#
# All of these paths are accessed by either a /json or /api prefix
v1_api_and_json_patterns = [
    # get data for the graphs at /stats
    rest_path('analytics/chart_data', GET=get_chart_data),
    rest_path('analytics/chart_data/realm/<realm_str>',
              GET=get_chart_data_for_realm),
    rest_path('analytics/chart_data/installation',
              GET=get_chart_data_for_installation),
    rest_path(
        'analytics/chart_data/remote/<int:remote_server_id>/installation',
        GET=get_chart_data_for_remote_installation),
    rest_path(
        'analytics/chart_data/remote/<int:remote_server_id>/realm/<int:remote_realm_id>',
        GET=get_chart_data_for_remote_realm),
]

i18n_urlpatterns += [
    path('api/v1/', include(v1_api_and_json_patterns)),
    path('json/', include(v1_api_and_json_patterns)),
示例#8
0
文件: urls.py 项目: yushao2/zulip
    upgrade,
)
from zerver.lib.rest import rest_path

i18n_urlpatterns: Any = [
    # Zephyr/MIT
    path("zephyr/",
         TemplateView.as_view(template_name="corporate/zephyr.html")),
    path("zephyr-mirror/",
         TemplateView.as_view(template_name="corporate/zephyr-mirror.html")),
    path("jobs/", TemplateView.as_view(template_name="corporate/jobs.html")),
    # Billing
    path("billing/", billing_home),
    path("upgrade/", initial_upgrade, name="initial_upgrade"),
]

v1_api_and_json_patterns = [
    rest_path("billing/upgrade", POST=upgrade),
    rest_path("billing/sponsorship", POST=sponsorship),
    rest_path("billing/plan/change", POST=change_plan_status),
    rest_path("billing/sources/change", POST=replace_payment_source),
]

# Make a copy of i18n_urlpatterns so that they appear without prefix for English
urlpatterns = list(i18n_urlpatterns)

urlpatterns += [
    path("api/v1/", include(v1_api_and_json_patterns)),
    path("json/", include(v1_api_and_json_patterns)),
]