2017-03-06 08:35:57 +01:00
|
|
|
from typing import Any
|
|
|
|
|
2017-11-16 00:55:49 +01:00
|
|
|
from django.conf.urls import include, url
|
2017-03-06 08:35:57 +01:00
|
|
|
|
2016-10-27 15:05:55 +02:00
|
|
|
import zilencer.views
|
2017-11-16 00:55:49 +01:00
|
|
|
from zerver.lib.rest import rest_dispatch
|
2016-04-27 06:33:37 +02:00
|
|
|
|
2018-01-13 19:38:13 +01:00
|
|
|
i18n_urlpatterns = [
|
2018-03-31 04:13:44 +02:00
|
|
|
url(r'^billing/$', zilencer.views.billing_home, name='zilencer.views.billing_home'),
|
|
|
|
url(r'^upgrade/$', zilencer.views.initial_upgrade, name='zilencer.views.initial_upgrade'),
|
2018-01-13 19:38:13 +01:00
|
|
|
] # type: Any
|
2016-04-27 06:33:37 +02:00
|
|
|
|
|
|
|
# Zilencer views following the REST API style
|
2016-06-24 02:26:09 +02:00
|
|
|
v1_api_and_json_patterns = [
|
2016-10-27 23:55:31 +02:00
|
|
|
url('^remotes/push/register$', rest_dispatch,
|
2018-04-29 00:06:26 +02:00
|
|
|
{'POST': 'zilencer.views.register_remote_push_device'}),
|
2016-10-27 23:55:31 +02:00
|
|
|
url('^remotes/push/unregister$', rest_dispatch,
|
2018-04-29 00:07:47 +02:00
|
|
|
{'POST': 'zilencer.views.unregister_remote_push_device'}),
|
2017-05-08 13:48:16 +02:00
|
|
|
url('^remotes/push/notify$', rest_dispatch,
|
|
|
|
{'POST': 'zilencer.views.remote_server_notify_push'}),
|
2018-05-04 01:40:46 +02:00
|
|
|
|
|
|
|
# Push signup doesn't use the REST API, since there's no auth.
|
|
|
|
url('^remotes/server/register$', zilencer.views.register_remote_server),
|
2016-06-24 02:26:09 +02:00
|
|
|
]
|
2016-04-27 06:33:37 +02:00
|
|
|
|
2018-01-18 00:52:46 +01:00
|
|
|
# Make a copy of i18n_urlpatterns so that they appear without prefix for English
|
|
|
|
urlpatterns = list(i18n_urlpatterns)
|
|
|
|
|
|
|
|
urlpatterns += [
|
2016-04-27 06:33:37 +02:00
|
|
|
url(r'^api/v1/', include(v1_api_and_json_patterns)),
|
|
|
|
url(r'^json/', include(v1_api_and_json_patterns)),
|
2017-03-06 08:17:34 +01:00
|
|
|
]
|