Skip to main content

systemprompt_models/modules/
api_paths.rs

1//! API path constants.
2
3#[derive(Debug, Clone, Copy)]
4pub struct ApiPaths;
5
6impl ApiPaths {
7    pub const API_BASE: &'static str = "/api";
8    pub const API_V1: &'static str = "/api/v1";
9    pub const CORE_BASE: &'static str = "/api/v1/core";
10    pub const AGENTS_BASE: &'static str = "/api/v1/agents";
11    pub const MCP_BASE: &'static str = "/api/v1/mcp";
12    pub const STREAM_BASE: &'static str = "/api/v1/stream";
13    pub const CONTENT_BASE: &'static str = "/api/v1/content";
14    pub const SYNC_BASE: &'static str = "/api/v1/sync";
15    pub const ANALYTICS_BASE: &'static str = "/api/v1/analytics";
16    pub const META_BASE: &'static str = "/api/v1/meta";
17
18    pub const CORE_CONTEXTS: &'static str = "/api/v1/core/contexts";
19    pub const CORE_TASKS: &'static str = "/api/v1/core/tasks";
20    pub const CORE_ARTIFACTS: &'static str = "/api/v1/core/artifacts";
21    pub const CONTEXTS_WEBHOOK: &'static str = "/api/v1/core/contexts/webhook";
22
23    pub const AGENTS_REGISTRY: &'static str = "/api/v1/agents/registry";
24
25    pub const MCP_REGISTRY: &'static str = "/api/v1/mcp/registry";
26
27    pub const STREAM_CONTEXTS: &'static str = "/api/v1/stream/contexts";
28    pub const STREAM_AGUI: &'static str = "/api/v1/stream/agui";
29    pub const STREAM_A2A: &'static str = "/api/v1/stream/a2a";
30
31    pub const AUTH_ME: &'static str = "/api/v1/auth/me";
32
33    pub const OAUTH_BASE: &'static str = "/api/v1/core/oauth";
34    pub const OAUTH_SESSION: &'static str = "/api/v1/core/oauth/session";
35    pub const OAUTH_REGISTER: &'static str = "/api/v1/core/oauth/register";
36    pub const OAUTH_AUTHORIZE: &'static str = "/api/v1/core/oauth/authorize";
37    pub const OAUTH_TOKEN: &'static str = "/api/v1/core/oauth/token";
38    pub const OAUTH_CALLBACK: &'static str = "/api/v1/core/oauth/callback";
39    pub const OAUTH_CONSENT: &'static str = "/api/v1/core/oauth/consent";
40    pub const OAUTH_WEBAUTHN_COMPLETE: &'static str = "/api/v1/core/oauth/webauthn/complete";
41    pub const OAUTH_CLIENTS: &'static str = "/api/v1/core/oauth/clients";
42
43    pub const WEBHOOK: &'static str = "/api/v1/webhook";
44    pub const WEBHOOK_AGUI: &'static str = "/api/v1/webhook/agui";
45    pub const WEBHOOK_A2A: &'static str = "/api/v1/webhook/a2a";
46
47    pub const HEALTH: &'static str = "/api/v1/health";
48    pub const DISCOVERY: &'static str = "/api/v1";
49
50    pub const WELLKNOWN_BASE: &'static str = "/.well-known";
51    pub const WELLKNOWN_AGENT_CARD: &'static str = "/.well-known/agent-card.json";
52    pub const WELLKNOWN_AGENT_CARDS: &'static str = "/.well-known/agent-cards";
53    pub const WELLKNOWN_OAUTH_SERVER: &'static str = "/.well-known/oauth-authorization-server";
54    pub const WELLKNOWN_OPENID_CONFIG: &'static str = "/.well-known/openid-configuration";
55    pub const WELLKNOWN_OAUTH_PROTECTED: &'static str = "/.well-known/oauth-protected-resource";
56
57    pub const A2A_CARD: &'static str = "/api/a2a/card";
58
59    pub const ASSETS_BASE: &'static str = "/assets";
60    pub const FILES_BASE: &'static str = "/files";
61    pub const GENERATED_BASE: &'static str = "/generated";
62    pub const IMAGES_BASE: &'static str = "/images";
63    pub const STATIC_BASE: &'static str = "/static";
64    pub const NEXT_BASE: &'static str = "/_next";
65    pub const DOCS_BASE: &'static str = "/docs";
66    pub const SWAGGER_BASE: &'static str = "/swagger";
67    pub const OPENAPI_BASE: &'static str = "/openapi";
68
69    pub const TRACK_BASE: &'static str = "/track";
70    pub const TRACK_ENGAGEMENT: &'static str = "/track/engagement";
71
72    pub const ADMIN_BASE: &'static str = "/api/v1/admin";
73    pub const ADMIN_LOGS: &'static str = "/api/v1/admin/logs";
74    pub const ADMIN_USERS: &'static str = "/api/v1/admin/users";
75    pub const ADMIN_ANALYTICS: &'static str = "/api/v1/admin/analytics";
76    pub const ADMIN_SESSIONS: &'static str = "/api/v1/admin/sessions";
77
78    pub const MARKETPLACE_BASE: &'static str = "/api/v1/marketplace";
79
80    pub const CLOUD_TENANTS: &'static str = "/api/v1/tenants";
81    pub const CLOUD_CHECKOUT: &'static str = "/api/v1/checkout";
82    pub const CLOUD_CHECKOUT_PLANS: &'static str = "/api/v1/checkout/plans";
83    pub const CLOUD_ACTIVITY: &'static str = "/api/v1/activity";
84
85    pub const ACTIVITY_EVENT_LOGIN: &'static str = "cloud_login";
86    pub const ACTIVITY_EVENT_LOGOUT: &'static str = "cloud_logout";
87
88    pub fn tenant(tenant_id: &str) -> String {
89        format!("{}/{}", Self::CLOUD_TENANTS, tenant_id)
90    }
91
92    pub fn tenant_status(tenant_id: &str) -> String {
93        format!("{}/{}/status", Self::CLOUD_TENANTS, tenant_id)
94    }
95
96    pub fn tenant_registry_token(tenant_id: &str) -> String {
97        format!("{}/{}/registry-token", Self::CLOUD_TENANTS, tenant_id)
98    }
99
100    pub fn tenant_deploy(tenant_id: &str) -> String {
101        format!("{}/{}/deploy", Self::CLOUD_TENANTS, tenant_id)
102    }
103
104    pub fn tenant_events(tenant_id: &str) -> String {
105        format!("{}/{}/events", Self::CLOUD_TENANTS, tenant_id)
106    }
107
108    pub fn tenant_restart(tenant_id: &str) -> String {
109        format!("{}/{}/restart", Self::CLOUD_TENANTS, tenant_id)
110    }
111
112    pub fn tenant_retry_provision(tenant_id: &str) -> String {
113        format!("{}/{}/retry-provision", Self::CLOUD_TENANTS, tenant_id)
114    }
115
116    pub fn tenant_secrets(tenant_id: &str) -> String {
117        format!("{}/{}/secrets", Self::CLOUD_TENANTS, tenant_id)
118    }
119
120    pub fn tenant_external_db_access(tenant_id: &str) -> String {
121        format!("{}/{}/external-db-access", Self::CLOUD_TENANTS, tenant_id)
122    }
123
124    pub fn tenant_rotate_credentials(tenant_id: &str) -> String {
125        format!("{}/{}/rotate-credentials", Self::CLOUD_TENANTS, tenant_id)
126    }
127
128    pub fn tenant_rotate_sync_token(tenant_id: &str) -> String {
129        format!("{}/{}/rotate-sync-token", Self::CLOUD_TENANTS, tenant_id)
130    }
131
132    pub fn tenant_subscription_cancel(tenant_id: &str) -> String {
133        format!("{}/{}/subscription/cancel", Self::CLOUD_TENANTS, tenant_id)
134    }
135
136    pub fn mcp_server_endpoint(server_name: &str) -> String {
137        format!("{}/{}/mcp", Self::MCP_BASE, server_name)
138    }
139
140    pub fn oauth_client_location(client_id: &str) -> String {
141        format!("{}/{}", Self::OAUTH_CLIENTS, client_id)
142    }
143
144    pub fn wellknown_agent_card_named(agent_name: &str) -> String {
145        format!("{}/{}", Self::WELLKNOWN_AGENT_CARDS, agent_name)
146    }
147
148    pub fn agent_endpoint(agent_id: &str) -> String {
149        format!("{}/{}/", Self::AGENTS_BASE, agent_id)
150    }
151
152    pub fn tenant_custom_domain(tenant_id: &str) -> String {
153        format!("{}/{}/custom-domain", Self::CLOUD_TENANTS, tenant_id)
154    }
155}