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