routers.py 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
  2. # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
  3. # Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. from taiga.base import routers
  17. router = routers.DefaultRouter(trailing_slash=False)
  18. # Locales
  19. from taiga.locale.api import LocalesViewSet
  20. router.register(r"locales", LocalesViewSet, base_name="locales")
  21. # Users & Roles
  22. from taiga.auth.api import AuthViewSet
  23. from taiga.users.api import UsersViewSet
  24. from taiga.users.api import RolesViewSet
  25. router.register(r"auth", AuthViewSet, base_name="auth")
  26. router.register(r"users", UsersViewSet, base_name="users")
  27. router.register(r"roles", RolesViewSet, base_name="roles")
  28. # User Storage
  29. from taiga.userstorage.api import StorageEntriesViewSet
  30. router.register(r"user-storage", StorageEntriesViewSet, base_name="user-storage")
  31. # Notify policies
  32. from taiga.projects.notifications.api import NotifyPolicyViewSet
  33. router.register(r"notify-policies", NotifyPolicyViewSet, base_name="notifications")
  34. # Projects & Selectors
  35. from taiga.projects.api import ProjectViewSet
  36. from taiga.projects.api import ProjectFansViewSet
  37. from taiga.projects.api import ProjectWatchersViewSet
  38. from taiga.projects.api import MembershipViewSet
  39. from taiga.projects.api import InvitationViewSet
  40. from taiga.projects.api import UserStoryStatusViewSet
  41. from taiga.projects.api import PointsViewSet
  42. from taiga.projects.api import TaskStatusViewSet
  43. from taiga.projects.api import IssueStatusViewSet
  44. from taiga.projects.api import IssueTypeViewSet
  45. from taiga.projects.api import PriorityViewSet
  46. from taiga.projects.api import SeverityViewSet
  47. from taiga.projects.api import ProjectTemplateViewSet
  48. router.register(r"projects", ProjectViewSet, base_name="projects")
  49. router.register(r"projects/(?P<resource_id>\d+)/fans", ProjectFansViewSet, base_name="project-fans")
  50. router.register(r"projects/(?P<resource_id>\d+)/watchers", ProjectWatchersViewSet, base_name="project-watchers")
  51. router.register(r"project-templates", ProjectTemplateViewSet, base_name="project-templates")
  52. router.register(r"memberships", MembershipViewSet, base_name="memberships")
  53. router.register(r"invitations", InvitationViewSet, base_name="invitations")
  54. router.register(r"userstory-statuses", UserStoryStatusViewSet, base_name="userstory-statuses")
  55. router.register(r"points", PointsViewSet, base_name="points")
  56. router.register(r"task-statuses", TaskStatusViewSet, base_name="task-statuses")
  57. router.register(r"issue-statuses", IssueStatusViewSet, base_name="issue-statuses")
  58. router.register(r"issue-types", IssueTypeViewSet, base_name="issue-types")
  59. router.register(r"priorities", PriorityViewSet, base_name="priorities")
  60. router.register(r"severities",SeverityViewSet , base_name="severities")
  61. # Custom Attributes
  62. from taiga.projects.custom_attributes.api import UserStoryCustomAttributeViewSet
  63. from taiga.projects.custom_attributes.api import TaskCustomAttributeViewSet
  64. from taiga.projects.custom_attributes.api import IssueCustomAttributeViewSet
  65. from taiga.projects.custom_attributes.api import UserStoryCustomAttributesValuesViewSet
  66. from taiga.projects.custom_attributes.api import TaskCustomAttributesValuesViewSet
  67. from taiga.projects.custom_attributes.api import IssueCustomAttributesValuesViewSet
  68. router.register(r"userstory-custom-attributes", UserStoryCustomAttributeViewSet,
  69. base_name="userstory-custom-attributes")
  70. router.register(r"task-custom-attributes", TaskCustomAttributeViewSet,
  71. base_name="task-custom-attributes")
  72. router.register(r"issue-custom-attributes", IssueCustomAttributeViewSet,
  73. base_name="issue-custom-attributes")
  74. router.register(r"userstories/custom-attributes-values", UserStoryCustomAttributesValuesViewSet,
  75. base_name="userstory-custom-attributes-values")
  76. router.register(r"tasks/custom-attributes-values", TaskCustomAttributesValuesViewSet,
  77. base_name="task-custom-attributes-values")
  78. router.register(r"issues/custom-attributes-values", IssueCustomAttributesValuesViewSet,
  79. base_name="issue-custom-attributes-values")
  80. # Search
  81. from taiga.searches.api import SearchViewSet
  82. router.register(r"search", SearchViewSet, base_name="search")
  83. # Resolver
  84. from taiga.projects.references.api import ResolverViewSet
  85. router.register(r"resolver", ResolverViewSet, base_name="resolver")
  86. # Attachments
  87. from taiga.projects.attachments.api import UserStoryAttachmentViewSet
  88. from taiga.projects.attachments.api import IssueAttachmentViewSet
  89. from taiga.projects.attachments.api import TaskAttachmentViewSet
  90. from taiga.projects.attachments.api import WikiAttachmentViewSet
  91. router.register(r"userstories/attachments", UserStoryAttachmentViewSet,
  92. base_name="userstory-attachments")
  93. router.register(r"tasks/attachments", TaskAttachmentViewSet, base_name="task-attachments")
  94. router.register(r"issues/attachments", IssueAttachmentViewSet, base_name="issue-attachments")
  95. router.register(r"wiki/attachments", WikiAttachmentViewSet, base_name="wiki-attachments")
  96. # Project components
  97. from taiga.projects.milestones.api import MilestoneViewSet
  98. from taiga.projects.milestones.api import MilestoneWatchersViewSet
  99. from taiga.projects.userstories.api import UserStoryViewSet
  100. from taiga.projects.userstories.api import UserStoryVotersViewSet
  101. from taiga.projects.userstories.api import UserStoryWatchersViewSet
  102. from taiga.projects.tasks.api import TaskViewSet
  103. from taiga.projects.tasks.api import TaskVotersViewSet
  104. from taiga.projects.tasks.api import TaskWatchersViewSet
  105. from taiga.projects.issues.api import IssueViewSet
  106. from taiga.projects.issues.api import IssueVotersViewSet
  107. from taiga.projects.issues.api import IssueWatchersViewSet
  108. from taiga.projects.wiki.api import WikiViewSet
  109. from taiga.projects.wiki.api import WikiLinkViewSet
  110. from taiga.projects.wiki.api import WikiWatchersViewSet
  111. router.register(r"milestones", MilestoneViewSet, base_name="milestones")
  112. router.register(r"milestones/(?P<resource_id>\d+)/watchers", MilestoneWatchersViewSet, base_name="milestone-watchers")
  113. router.register(r"userstories", UserStoryViewSet, base_name="userstories")
  114. router.register(r"userstories/(?P<resource_id>\d+)/voters", UserStoryVotersViewSet, base_name="userstory-voters")
  115. router.register(r"userstories/(?P<resource_id>\d+)/watchers", UserStoryWatchersViewSet, base_name="userstory-watchers")
  116. router.register(r"tasks", TaskViewSet, base_name="tasks")
  117. router.register(r"tasks/(?P<resource_id>\d+)/voters", TaskVotersViewSet, base_name="task-voters")
  118. router.register(r"tasks/(?P<resource_id>\d+)/watchers", TaskWatchersViewSet, base_name="task-watchers")
  119. router.register(r"issues", IssueViewSet, base_name="issues")
  120. router.register(r"issues/(?P<resource_id>\d+)/voters", IssueVotersViewSet, base_name="issue-voters")
  121. router.register(r"issues/(?P<resource_id>\d+)/watchers", IssueWatchersViewSet, base_name="issue-watchers")
  122. router.register(r"wiki", WikiViewSet, base_name="wiki")
  123. router.register(r"wiki/(?P<resource_id>\d+)/watchers", WikiWatchersViewSet, base_name="wiki-watchers")
  124. router.register(r"wiki-links", WikiLinkViewSet, base_name="wiki-links")
  125. # History & Components
  126. from taiga.projects.history.api import UserStoryHistory
  127. from taiga.projects.history.api import TaskHistory
  128. from taiga.projects.history.api import IssueHistory
  129. from taiga.projects.history.api import WikiHistory
  130. router.register(r"history/userstory", UserStoryHistory, base_name="userstory-history")
  131. router.register(r"history/task", TaskHistory, base_name="task-history")
  132. router.register(r"history/issue", IssueHistory, base_name="issue-history")
  133. router.register(r"history/wiki", WikiHistory, base_name="wiki-history")
  134. # Timelines
  135. from taiga.timeline.api import ProfileTimeline
  136. from taiga.timeline.api import UserTimeline
  137. from taiga.timeline.api import ProjectTimeline
  138. router.register(r"timeline/profile", ProfileTimeline, base_name="profile-timeline")
  139. router.register(r"timeline/user", UserTimeline, base_name="user-timeline")
  140. router.register(r"timeline/project", ProjectTimeline, base_name="project-timeline")
  141. # Webhooks
  142. from taiga.webhooks.api import WebhookViewSet
  143. from taiga.webhooks.api import WebhookLogViewSet
  144. router.register(r"webhooks", WebhookViewSet, base_name="webhooks")
  145. router.register(r"webhooklogs", WebhookLogViewSet, base_name="webhooklogs")
  146. # GitHub webhooks
  147. from taiga.hooks.github.api import GitHubViewSet
  148. router.register(r"github-hook", GitHubViewSet, base_name="github-hook")
  149. # Gitlab webhooks
  150. from taiga.hooks.gitlab.api import GitLabViewSet
  151. router.register(r"gitlab-hook", GitLabViewSet, base_name="gitlab-hook")
  152. # Bitbucket webhooks
  153. from taiga.hooks.bitbucket.api import BitBucketViewSet
  154. router.register(r"bitbucket-hook", BitBucketViewSet, base_name="bitbucket-hook")
  155. # Importer
  156. from taiga.export_import.api import ProjectImporterViewSet, ProjectExporterViewSet
  157. router.register(r"importer", ProjectImporterViewSet, base_name="importer")
  158. router.register(r"exporter", ProjectExporterViewSet, base_name="exporter")
  159. # Stats
  160. # - see taiga.stats.routers and taiga.stats.apps
  161. # Feedback
  162. # - see taiga.feedback.routers and taiga.feedback.apps