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