518 lines
15 KiB
Python
518 lines
15 KiB
Python
"""app URL Configuration
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
https://docs.djangoproject.com/en/4.0/topics/http/urls/
|
|
Examples:
|
|
Function views
|
|
1. Add an import: from my_app import views
|
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
Class-based views
|
|
1. Add an import: from other_app.views import Home
|
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
Including another URLconf
|
|
1. Import the include() function: from django.urls import include, path
|
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
"""
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.contrib.auth.views import LogoutView
|
|
from django.urls import include, path
|
|
from two_factor.urls import urlpatterns as tf_urls
|
|
|
|
from core.views import (
|
|
ais,
|
|
base,
|
|
compose,
|
|
groups,
|
|
identifiers,
|
|
instagram,
|
|
manipulations,
|
|
messages,
|
|
notifications,
|
|
osint,
|
|
people,
|
|
personas,
|
|
queues,
|
|
sessions,
|
|
signal,
|
|
whatsapp,
|
|
workspace,
|
|
)
|
|
|
|
urlpatterns = [
|
|
path("__debug__/", include("debug_toolbar.urls")),
|
|
path("", base.Home.as_view(), name="home"),
|
|
path("admin/", admin.site.urls),
|
|
# 2FA login urls
|
|
path("", include(tf_urls)),
|
|
path("accounts/signup/", base.Signup.as_view(), name="signup"),
|
|
path("accounts/logout/", LogoutView.as_view(), name="logout"),
|
|
# Notifications
|
|
path(
|
|
"notifications/<str:type>/update/",
|
|
notifications.NotificationsUpdate.as_view(),
|
|
name="notifications_update",
|
|
),
|
|
path(
|
|
"services/signal/",
|
|
signal.Signal.as_view(),
|
|
name="signal",
|
|
),
|
|
path(
|
|
"services/whatsapp/",
|
|
whatsapp.WhatsApp.as_view(),
|
|
name="whatsapp",
|
|
),
|
|
path(
|
|
"services/instagram/",
|
|
instagram.Instagram.as_view(),
|
|
name="instagram",
|
|
),
|
|
path(
|
|
"services/signal/<str:type>/",
|
|
signal.SignalAccounts.as_view(),
|
|
name="signal_accounts",
|
|
),
|
|
path(
|
|
"services/whatsapp/<str:type>/",
|
|
whatsapp.WhatsAppAccounts.as_view(),
|
|
name="whatsapp_accounts",
|
|
),
|
|
path(
|
|
"services/instagram/<str:type>/",
|
|
instagram.InstagramAccounts.as_view(),
|
|
name="instagram_accounts",
|
|
),
|
|
path(
|
|
"services/signal/<str:type>/contacts/<str:pk>/",
|
|
signal.SignalContactsList.as_view(),
|
|
name="signal_contacts",
|
|
),
|
|
path(
|
|
"services/signal/<str:type>/chats/<str:pk>/",
|
|
signal.SignalChatsList.as_view(),
|
|
name="signal_chats",
|
|
),
|
|
path(
|
|
"services/signal/<str:type>/messages/<str:pk>/<str:chat_id>/",
|
|
signal.SignalMessagesList.as_view(),
|
|
name="signal_messages",
|
|
),
|
|
path(
|
|
"services/signal/<str:type>/add/",
|
|
signal.SignalAccountAdd.as_view(),
|
|
name="signal_account_add",
|
|
),
|
|
path(
|
|
"services/whatsapp/<str:type>/add/",
|
|
whatsapp.WhatsAppAccountAdd.as_view(),
|
|
name="whatsapp_account_add",
|
|
),
|
|
path(
|
|
"services/instagram/<str:type>/add/",
|
|
instagram.InstagramAccountAdd.as_view(),
|
|
name="instagram_account_add",
|
|
),
|
|
path(
|
|
"compose/page/",
|
|
compose.ComposePage.as_view(),
|
|
name="compose_page",
|
|
),
|
|
path(
|
|
"compose/workspace/",
|
|
compose.ComposeWorkspace.as_view(),
|
|
name="compose_workspace",
|
|
),
|
|
path(
|
|
"compose/widget/",
|
|
compose.ComposeWidget.as_view(),
|
|
name="compose_widget",
|
|
),
|
|
path(
|
|
"compose/workspace/widget/contacts/",
|
|
compose.ComposeWorkspaceContactsWidget.as_view(),
|
|
name="compose_workspace_contacts_widget",
|
|
),
|
|
path(
|
|
"compose/send/",
|
|
compose.ComposeSend.as_view(),
|
|
name="compose_send",
|
|
),
|
|
path(
|
|
"compose/drafts/",
|
|
compose.ComposeDrafts.as_view(),
|
|
name="compose_drafts",
|
|
),
|
|
path(
|
|
"compose/summary/",
|
|
compose.ComposeSummary.as_view(),
|
|
name="compose_summary",
|
|
),
|
|
path(
|
|
"compose/quick-insights/",
|
|
compose.ComposeQuickInsights.as_view(),
|
|
name="compose_quick_insights",
|
|
),
|
|
path(
|
|
"compose/engage/preview/",
|
|
compose.ComposeEngagePreview.as_view(),
|
|
name="compose_engage_preview",
|
|
),
|
|
path(
|
|
"compose/engage/send/",
|
|
compose.ComposeEngageSend.as_view(),
|
|
name="compose_engage_send",
|
|
),
|
|
path(
|
|
"compose/thread/",
|
|
compose.ComposeThread.as_view(),
|
|
name="compose_thread",
|
|
),
|
|
path(
|
|
"compose/media/blob/",
|
|
compose.ComposeMediaBlob.as_view(),
|
|
name="compose_media_blob",
|
|
),
|
|
path(
|
|
"compose/widget/contacts/",
|
|
compose.ComposeContactsDropdown.as_view(),
|
|
name="compose_contacts_dropdown",
|
|
),
|
|
# AIs
|
|
path(
|
|
"ai/workspace/",
|
|
workspace.AIWorkspace.as_view(),
|
|
name="ai_workspace",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/contacts/",
|
|
workspace.AIWorkspaceContactsWidget.as_view(),
|
|
name="ai_workspace_contacts",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/",
|
|
workspace.AIWorkspacePersonWidget.as_view(),
|
|
name="ai_workspace_person",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/timeline/",
|
|
workspace.AIWorkspacePersonTimelineWidget.as_view(),
|
|
name="ai_workspace_person_timeline",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/insights/graphs/",
|
|
workspace.AIWorkspaceInsightGraphs.as_view(),
|
|
name="ai_workspace_insight_graphs",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/information/",
|
|
workspace.AIWorkspaceInformation.as_view(),
|
|
name="ai_workspace_information",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/insights/help/",
|
|
workspace.AIWorkspaceInsightHelp.as_view(),
|
|
name="ai_workspace_insight_help",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/insights/<str:metric>/",
|
|
workspace.AIWorkspaceInsightDetail.as_view(),
|
|
name="ai_workspace_insight_detail",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/run/<str:operation>/",
|
|
workspace.AIWorkspaceRunOperation.as_view(),
|
|
name="ai_workspace_run",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/send/",
|
|
workspace.AIWorkspaceSendDraft.as_view(),
|
|
name="ai_workspace_send",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/queue/",
|
|
workspace.AIWorkspaceQueueDraft.as_view(),
|
|
name="ai_workspace_queue",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/create/",
|
|
workspace.AIWorkspaceCreateMitigation.as_view(),
|
|
name="ai_workspace_mitigation_create",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/chat/",
|
|
workspace.AIWorkspaceMitigationChat.as_view(),
|
|
name="ai_workspace_mitigation_chat",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/export/",
|
|
workspace.AIWorkspaceExportArtifact.as_view(),
|
|
name="ai_workspace_mitigation_export",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/artifact/create/<str:kind>/",
|
|
workspace.AIWorkspaceCreateArtifact.as_view(),
|
|
name="ai_workspace_mitigation_artifact_create",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/artifact/<str:kind>/<uuid:artifact_id>/save/",
|
|
workspace.AIWorkspaceUpdateArtifact.as_view(),
|
|
name="ai_workspace_mitigation_artifact_save",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/artifact/<str:kind>/<uuid:artifact_id>/delete/",
|
|
workspace.AIWorkspaceDeleteArtifact.as_view(),
|
|
name="ai_workspace_mitigation_artifact_delete",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/artifact/<str:kind>/delete-all/",
|
|
workspace.AIWorkspaceDeleteArtifactList.as_view(),
|
|
name="ai_workspace_mitigation_artifact_delete_all",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/engage/share/",
|
|
workspace.AIWorkspaceEngageShare.as_view(),
|
|
name="ai_workspace_mitigation_engage_share",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/auto/",
|
|
workspace.AIWorkspaceAutoSettings.as_view(),
|
|
name="ai_workspace_mitigation_auto",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/fundamentals/save/",
|
|
workspace.AIWorkspaceUpdateFundamentals.as_view(),
|
|
name="ai_workspace_mitigation_fundamentals_save",
|
|
),
|
|
path(
|
|
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/"
|
|
"<uuid:plan_id>/meta/save/",
|
|
workspace.AIWorkspaceUpdatePlanMeta.as_view(),
|
|
name="ai_workspace_mitigation_meta_save",
|
|
),
|
|
path(
|
|
"ai/<str:type>/",
|
|
ais.AIList.as_view(),
|
|
name="ais",
|
|
),
|
|
path(
|
|
"search/<str:type>/",
|
|
osint.OSINTSearch.as_view(),
|
|
name="osint_search",
|
|
),
|
|
path(
|
|
"osint/workspace/",
|
|
osint.OSINTWorkspace.as_view(),
|
|
name="osint_workspace",
|
|
),
|
|
path(
|
|
"osint/workspace/widget/tabs/",
|
|
osint.OSINTWorkspaceTabsWidget.as_view(),
|
|
name="osint_workspace_tabs_widget",
|
|
),
|
|
path(
|
|
"ai/<str:type>/create/",
|
|
ais.AICreate.as_view(),
|
|
name="ai_create",
|
|
),
|
|
path(
|
|
"ai/<str:type>/update/<str:pk>/",
|
|
ais.AIUpdate.as_view(),
|
|
name="ai_update",
|
|
),
|
|
path(
|
|
"ai/<str:type>/delete/<str:pk>/",
|
|
ais.AIDelete.as_view(),
|
|
name="ai_delete",
|
|
),
|
|
# People
|
|
path(
|
|
"person/<str:type>/",
|
|
people.PersonList.as_view(),
|
|
name="people",
|
|
),
|
|
path(
|
|
"person/<str:type>/create/",
|
|
people.PersonCreate.as_view(),
|
|
name="person_create",
|
|
),
|
|
path(
|
|
"person/<str:type>/update/<str:pk>/",
|
|
people.PersonUpdate.as_view(),
|
|
name="person_update",
|
|
),
|
|
path(
|
|
"person/<str:type>/delete/<str:pk>/",
|
|
people.PersonDelete.as_view(),
|
|
name="person_delete",
|
|
),
|
|
# Groups
|
|
path(
|
|
"group/<str:type>/",
|
|
groups.GroupList.as_view(),
|
|
name="groups",
|
|
),
|
|
path(
|
|
"group/<str:type>/create/",
|
|
groups.GroupCreate.as_view(),
|
|
name="group_create",
|
|
),
|
|
path(
|
|
"group/<str:type>/update/<str:pk>/",
|
|
groups.GroupUpdate.as_view(),
|
|
name="group_update",
|
|
),
|
|
path(
|
|
"group/<str:type>/delete/<str:pk>/",
|
|
groups.GroupDelete.as_view(),
|
|
name="group_delete",
|
|
),
|
|
# Personas
|
|
path(
|
|
"persona/<str:type>/",
|
|
personas.PersonaList.as_view(),
|
|
name="personas",
|
|
),
|
|
path(
|
|
"persona/<str:type>/create/",
|
|
personas.PersonaCreate.as_view(),
|
|
name="persona_create",
|
|
),
|
|
path(
|
|
"persona/<str:type>/update/<str:pk>/",
|
|
personas.PersonaUpdate.as_view(),
|
|
name="persona_update",
|
|
),
|
|
path(
|
|
"persona/<str:type>/delete/<str:pk>/",
|
|
personas.PersonaDelete.as_view(),
|
|
name="persona_delete",
|
|
),
|
|
# Manipulations
|
|
path(
|
|
"manipulation/<str:type>/",
|
|
manipulations.ManipulationList.as_view(),
|
|
name="manipulations",
|
|
),
|
|
path(
|
|
"manipulation/<str:type>/create/",
|
|
manipulations.ManipulationCreate.as_view(),
|
|
name="manipulation_create",
|
|
),
|
|
path(
|
|
"manipulation/<str:type>/update/<str:pk>/",
|
|
manipulations.ManipulationUpdate.as_view(),
|
|
name="manipulation_update",
|
|
),
|
|
path(
|
|
"manipulation/<str:type>/delete/<str:pk>/",
|
|
manipulations.ManipulationDelete.as_view(),
|
|
name="manipulation_delete",
|
|
),
|
|
# Sessions
|
|
path(
|
|
"session/<str:type>/",
|
|
sessions.SessionList.as_view(),
|
|
name="sessions",
|
|
),
|
|
path(
|
|
"session/<str:type>/create/",
|
|
sessions.SessionCreate.as_view(),
|
|
name="session_create",
|
|
),
|
|
path(
|
|
"session/<str:type>/update/<str:pk>/",
|
|
sessions.SessionUpdate.as_view(),
|
|
name="session_update",
|
|
),
|
|
path(
|
|
"session/<str:type>/delete/<str:pk>/",
|
|
sessions.SessionDelete.as_view(),
|
|
name="session_delete",
|
|
),
|
|
# Identifiers
|
|
path(
|
|
"person/<str:type>/identifiers/<str:person>/",
|
|
identifiers.PersonIdentifierList.as_view(),
|
|
name="person_identifiers",
|
|
),
|
|
path(
|
|
"person/<str:type>/identifiers/create/<str:person>",
|
|
identifiers.PersonIdentifierCreate.as_view(),
|
|
name="person_identifier_create",
|
|
),
|
|
path(
|
|
"person/<str:type>/identifiers/update/<str:person>/<str:pk>/",
|
|
identifiers.PersonIdentifierUpdate.as_view(),
|
|
name="person_identifier_update",
|
|
),
|
|
path(
|
|
"person/<str:type>/identifiers/delete/<str:person>/<str:pk>/",
|
|
identifiers.PersonIdentifierDelete.as_view(),
|
|
name="person_identifier_delete",
|
|
),
|
|
# Messages
|
|
path(
|
|
"session/<str:type>/messages/<str:session>/",
|
|
messages.MessageList.as_view(),
|
|
name="messages",
|
|
),
|
|
path(
|
|
"session/<str:type>/messages/create/<str:session>",
|
|
messages.MessageCreate.as_view(),
|
|
name="message_create",
|
|
),
|
|
path(
|
|
"session/<str:type>/messages/update/<str:session>/<str:pk>/",
|
|
messages.MessageUpdate.as_view(),
|
|
name="message_update",
|
|
),
|
|
path(
|
|
"session/<str:type>/messages/delete/<str:session>/<str:pk>/",
|
|
messages.MessageDelete.as_view(),
|
|
name="message_delete",
|
|
),
|
|
# API
|
|
# Queues
|
|
path(
|
|
"api/v1/queue/message/accept/<str:message_id>/",
|
|
queues.AcceptMessageAPI.as_view(),
|
|
name="message_accept_api",
|
|
),
|
|
path(
|
|
"api/v1/queue/message/reject/<str:message_id>/",
|
|
queues.RejectMessageAPI.as_view(),
|
|
name="message_reject_api",
|
|
),
|
|
path(
|
|
"queue/<str:type>/",
|
|
queues.QueueList.as_view(),
|
|
name="queues",
|
|
),
|
|
path(
|
|
"queue/<str:type>/create/",
|
|
queues.QueueCreate.as_view(),
|
|
name="queue_create",
|
|
),
|
|
path(
|
|
"queue/<str:type>/update/<str:pk>/",
|
|
queues.QueueUpdate.as_view(),
|
|
name="queue_update",
|
|
),
|
|
path(
|
|
"queue/<str:type>/delete/<str:pk>/",
|
|
queues.QueueDelete.as_view(),
|
|
name="queue_delete",
|
|
),
|
|
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|