diff --git a/crates/connector-hub/src/main.rs b/crates/connector-hub/src/main.rs index 12a2d28..2edc4ee 100644 --- a/crates/connector-hub/src/main.rs +++ b/crates/connector-hub/src/main.rs @@ -271,16 +271,17 @@ fn build_catalogue() -> anyhow::Result { } register_email_operations(&mut catalogue); + register_ops_operations(&mut catalogue); Ok(catalogue) } fn register_email_operations(catalogue: &mut hub_core::Catalogue) { catalogue.register(hub_core::Operation { - id: hub_core::OperationId("email.send".into()), + id: hub_core::OperationId("email.send_email".into()), provider: "email".into(), summary: "Send an email via SMTP".into(), - description: "Send an email message using the configured SMTP transport. Supports plain text, HTML, and multipart bodies. Requires SMTP credentials configured via EMAIL_SMTP_* environment variables.".into(), + description: "Send an email message using the configured SMTP transport.".into(), mutation_class: hub_policy::MutationClass::Mutating, http_method: "POST".into(), path_template: String::new(), @@ -289,47 +290,433 @@ fn register_email_operations(catalogue: &mut hub_core::Catalogue) { "type": "object", "required": ["to", "subject"], "properties": { - "to": { - "description": "Recipient email address(es). String or array of strings.", - "oneOf": [ - {"type": "string"}, - {"type": "array", "items": {"type": "string"}} - ] - }, - "cc": { - "description": "CC recipients", - "oneOf": [ - {"type": "string"}, - {"type": "array", "items": {"type": "string"}} - ] - }, - "bcc": { - "description": "BCC recipients", - "oneOf": [ - {"type": "string"}, - {"type": "array", "items": {"type": "string"}} - ] - }, - "subject": { - "type": "string", - "description": "Email subject" - }, - "body": { - "type": "string", - "description": "Plain text body" - }, - "body_html": { - "type": "string", - "description": "HTML body (sent as multipart/alternative with plain text)" - }, - "from": { - "type": "string", - "description": "Override sender address (defaults to configured from_address)" - } + "to": {"description": "Recipient email address(es)", "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}, + "cc": {"description": "CC recipients", "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}, + "bcc": {"description": "BCC recipients", "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}, + "subject": {"type": "string", "description": "Email subject"}, + "body": {"type": "string", "description": "Plain text body"}, + "body_html": {"type": "string", "description": "HTML body"}, + "from": {"type": "string", "description": "Override sender address"} } }), }, tags: vec!["email".into(), "smtp".into()], transport: hub_core::Transport::Smtp, }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("email.list_accounts".into()), + provider: "email".into(), + summary: "List configured email accounts".into(), + description: "List all IMAP/SMTP email accounts configured via environment variables." + .into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({"type": "object"}), + }, + tags: vec!["email".into(), "imap".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("email.check_inbox".into()), + provider: "email".into(), + summary: "Check inbox for new messages".into(), + description: "Connect via IMAP and retrieve recent messages from the inbox.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "properties": { + "account": {"type": "string", "description": "Account label (default: first configured)"}, + "limit": {"type": "integer", "description": "Max messages to return", "default": 10}, + "folder": {"type": "string", "description": "IMAP folder", "default": "INBOX"} + } + }), + }, + tags: vec!["email".into(), "imap".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("email.search".into()), + provider: "email".into(), + summary: "Search emails via IMAP".into(), + description: "Search for emails matching criteria using IMAP SEARCH.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["query"], + "properties": { + "query": {"type": "string", "description": "IMAP search query"}, + "account": {"type": "string", "description": "Account label"}, + "limit": {"type": "integer", "description": "Max results", "default": 20}, + "folder": {"type": "string", "description": "IMAP folder", "default": "INBOX"} + } + }), + }, + tags: vec!["email".into(), "imap".into()], + transport: hub_core::Transport::Local, + }); +} + +fn register_ops_operations(catalogue: &mut hub_core::Catalogue) { + // ops_ssh: 3 actions + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_ssh.run_local".into()), + provider: "ops_ssh".into(), + summary: "Run a command on the local host".into(), + description: "Execute a shell command locally with configurable timeout.".into(), + mutation_class: hub_policy::MutationClass::Destructive, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["command"], + "properties": { + "command": {"type": "string", "description": "Shell command to execute"}, + "timeout": {"type": "integer", "description": "Timeout in seconds", "default": 30} + } + }), + }, + tags: vec!["ops".into(), "ssh".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_ssh.run_ssh".into()), + provider: "ops_ssh".into(), + summary: "Run a command on a remote host via SSH".into(), + description: "Execute a command on a remote host using SSH key authentication.".into(), + mutation_class: hub_policy::MutationClass::Destructive, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["host", "command"], + "properties": { + "host": {"type": "string", "description": "SSH host (from SSH_HOSTS or user@host)"}, + "command": {"type": "string", "description": "Command to execute"}, + "timeout": {"type": "integer", "description": "Timeout in seconds", "default": 30} + } + }), + }, + tags: vec!["ops".into(), "ssh".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_ssh.list_hosts".into()), + provider: "ops_ssh".into(), + summary: "List configured SSH hosts".into(), + description: "List the hosts configured in the SSH_HOSTS environment variable.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({"type": "object"}), + }, + tags: vec!["ops".into(), "ssh".into()], + transport: hub_core::Transport::Local, + }); + + // ops_browser: 3 actions + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_browser.fetch".into()), + provider: "ops_browser".into(), + summary: "Fetch a URL and return its content".into(), + description: "HTTP GET a URL with SSRF protection and return the response body.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["url"], + "properties": { + "url": {"type": "string", "description": "URL to fetch"}, + "method": {"type": "string", "description": "HTTP method", "default": "GET"}, + "max_bytes": {"type": "integer", "description": "Max response size", "default": 2000000} + } + }), + }, + tags: vec!["ops".into(), "browser".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_browser.check_status".into()), + provider: "ops_browser".into(), + summary: "Check HTTP status of a URL".into(), + description: "Perform a HEAD request and return the HTTP status code and headers.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["url"], + "properties": { + "url": {"type": "string", "description": "URL to check"} + } + }), + }, + tags: vec!["ops".into(), "browser".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_browser.screenshot".into()), + provider: "ops_browser".into(), + summary: "Take a screenshot of a URL".into(), + description: "Capture a screenshot of a web page (stub — requires headless browser)." + .into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["url"], + "properties": { + "url": {"type": "string", "description": "URL to capture"}, + "width": {"type": "integer", "description": "Viewport width", "default": 1280}, + "height": {"type": "integer", "description": "Viewport height", "default": 720} + } + }), + }, + tags: vec!["ops".into(), "browser".into()], + transport: hub_core::Transport::Local, + }); + + // ops_security: 5 actions + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_security.audit_password_strength".into()), + provider: "ops_security".into(), + summary: "Audit password strength".into(), + description: "Evaluate a password against common strength criteria.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["password"], + "properties": { + "password": {"type": "string", "description": "Password to audit"} + } + }), + }, + tags: vec!["ops".into(), "security".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_security.check_ssl".into()), + provider: "ops_security".into(), + summary: "Check SSL certificate for a domain".into(), + description: "Connect to a host and inspect its TLS certificate for validity and expiry." + .into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["host"], + "properties": { + "host": {"type": "string", "description": "Hostname to check"}, + "port": {"type": "integer", "description": "Port", "default": 443} + } + }), + }, + tags: vec!["ops".into(), "security".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_security.scan_common_exposure".into()), + provider: "ops_security".into(), + summary: "Scan for common exposure paths".into(), + description: "Check a target for commonly exposed files and directories.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["url"], + "properties": { + "url": {"type": "string", "description": "Base URL to scan"} + } + }), + }, + tags: vec!["ops".into(), "security".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_security.ssh_config_audit".into()), + provider: "ops_security".into(), + summary: "Audit SSH server configuration".into(), + description: "Connect to an SSH server and audit its configuration for security issues." + .into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["host"], + "properties": { + "host": {"type": "string", "description": "SSH host to audit"}, + "port": {"type": "integer", "description": "SSH port", "default": 22} + } + }), + }, + tags: vec!["ops".into(), "security".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_security.generate_secret".into()), + provider: "ops_security".into(), + summary: "Generate a cryptographic secret".into(), + description: "Generate a random secret string of specified length and charset.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "properties": { + "length": {"type": "integer", "description": "Secret length", "default": 32}, + "charset": {"type": "string", "description": "Character set: alphanumeric, hex, base64, ascii", "default": "alphanumeric"} + } + }), + }, + tags: vec!["ops".into(), "security".into()], + transport: hub_core::Transport::Local, + }); + + // ops_network: 5 actions + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_network.ping".into()), + provider: "ops_network".into(), + summary: "Ping a host".into(), + description: "Send ICMP pings to a host and report latency.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["host"], + "properties": { + "host": {"type": "string", "description": "Host to ping"}, + "count": {"type": "integer", "description": "Number of pings", "default": 4} + } + }), + }, + tags: vec!["ops".into(), "network".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_network.dns_lookup".into()), + provider: "ops_network".into(), + summary: "DNS lookup".into(), + description: "Resolve DNS records for a domain.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["domain"], + "properties": { + "domain": {"type": "string", "description": "Domain to look up"}, + "record_type": {"type": "string", "description": "Record type (A, AAAA, MX, etc.)", "default": "A"} + } + }), + }, + tags: vec!["ops".into(), "network".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_network.port_check".into()), + provider: "ops_network".into(), + summary: "Check if a port is open".into(), + description: "Test TCP connectivity to a host on a specific port.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["host", "port"], + "properties": { + "host": {"type": "string", "description": "Host to check"}, + "port": {"type": "integer", "description": "Port to check"}, + "timeout": {"type": "integer", "description": "Timeout in seconds", "default": 5} + } + }), + }, + tags: vec!["ops".into(), "network".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_network.traceroute".into()), + provider: "ops_network".into(), + summary: "Traceroute to a host".into(), + description: "Trace the network path to a destination host.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["host"], + "properties": { + "host": {"type": "string", "description": "Destination host"}, + "max_hops": {"type": "integer", "description": "Maximum number of hops", "default": 30} + } + }), + }, + tags: vec!["ops".into(), "network".into()], + transport: hub_core::Transport::Local, + }); + + catalogue.register(hub_core::Operation { + id: hub_core::OperationId("ops_network.http_headers".into()), + provider: "ops_network".into(), + summary: "Inspect HTTP response headers".into(), + description: "Send an HTTP request and return response headers for analysis.".into(), + mutation_class: hub_policy::MutationClass::ReadOnly, + http_method: String::new(), + path_template: String::new(), + parameters: hub_core::ParameterSchema { + json_schema: serde_json::json!({ + "type": "object", + "required": ["url"], + "properties": { + "url": {"type": "string", "description": "URL to inspect"}, + "method": {"type": "string", "description": "HTTP method", "default": "HEAD"} + } + }), + }, + tags: vec!["ops".into(), "network".into()], + transport: hub_core::Transport::Local, + }); } diff --git a/crates/hub-auth/src/store.rs b/crates/hub-auth/src/store.rs index fcfc7d9..461fa0d 100644 --- a/crates/hub-auth/src/store.rs +++ b/crates/hub-auth/src/store.rs @@ -389,6 +389,148 @@ impl AuthStore { } } + // Linode + if let Ok(token) = std::env::var("LINODE_API_TOKEN") { + store.add(Credential { + provider: "linode".into(), + account_id: "default".into(), + base_url: Some("https://api.linode.com/v4".into()), + auth: AuthMethod::Bearer { token }, + }); + } + + // Kimi (Moonshot) + if let Ok(key) = + std::env::var("MOONSHOT_API_KEY").or_else(|_| std::env::var("KIMI_API_KEY")) + { + let base = std::env::var("MOONSHOT_BASE_URL") + .unwrap_or_else(|_| "https://api.moonshot.cn/v1".into()); + store.add(Credential { + provider: "kimi".into(), + account_id: "default".into(), + base_url: Some(base), + auth: AuthMethod::Bearer { token: key }, + }); + } + + // Cloudflare AI + if let (Ok(token), Ok(account_id)) = ( + std::env::var("CLOUDFLARE_API_TOKEN"), + std::env::var("CLOUDFLARE_ACCOUNT_ID"), + ) { + store.add(Credential { + provider: "cloudflare".into(), + account_id: "default".into(), + base_url: Some(format!( + "https://api.cloudflare.com/client/v4/accounts/{account_id}" + )), + auth: AuthMethod::Bearer { token }, + }); + } + + // OneProvider + if let Ok(key) = std::env::var("ONEPROVIDER_API_KEY") { + store.add(Credential { + provider: "oneprovider".into(), + account_id: "default".into(), + base_url: Some("https://api.oneprovider.com".into()), + auth: AuthMethod::Bearer { token: key }, + }); + } + + // Tawk.to + if let Ok(key) = std::env::var("TAWK_API_KEY") { + store.add(Credential { + provider: "tawk".into(), + account_id: "default".into(), + base_url: Some("https://api.tawk.to/v1".into()), + auth: AuthMethod::Bearer { token: key }, + }); + } + + // WHM + if let (Ok(host), Ok(user), Ok(token)) = ( + std::env::var("WHM_HOST"), + std::env::var("WHM_USER"), + std::env::var("WHM_API_TOKEN"), + ) { + store.add(Credential { + provider: "whm".into(), + account_id: "default".into(), + base_url: Some(format!("https://{host}:2087")), + auth: AuthMethod::Header { + name: "Authorization".into(), + value: format!("whm {user}:{token}"), + }, + }); + } + + // cPanel + if let (Ok(host), Ok(user), Ok(token)) = ( + std::env::var("CPANEL_HOST"), + std::env::var("CPANEL_USER"), + std::env::var("CPANEL_API_TOKEN"), + ) { + store.add(Credential { + provider: "cpanel".into(), + account_id: "default".into(), + base_url: Some(format!("https://{host}:2083")), + auth: AuthMethod::Header { + name: "Authorization".into(), + value: format!("cpanel {user}:{token}"), + }, + }); + } + + // WHMCS + if let (Ok(url), Ok(identifier), Ok(secret)) = ( + std::env::var("WHMCS_URL"), + std::env::var("WHMCS_API_IDENTIFIER"), + std::env::var("WHMCS_API_SECRET"), + ) { + store.add(Credential { + provider: "whmcs".into(), + account_id: "default".into(), + base_url: Some(format!("{}/includes/api.php", url.trim_end_matches('/'))), + auth: AuthMethod::Basic { + username: identifier, + password: secret, + }, + }); + } + + // UltaHost (WHMCS billing) + if let (Ok(url), Ok(user), Ok(key)) = ( + std::env::var("ULTRAHOST_WHMCS_URL"), + std::env::var("ULTRAHOST_API_USER"), + std::env::var("ULTRAHOST_API_KEY"), + ) { + store.add(Credential { + provider: "ultrahost".into(), + account_id: "default".into(), + base_url: Some(url), + auth: AuthMethod::Basic { + username: user, + password: key, + }, + }); + } + + // Claude/Anthropic auth is already registered above under "anthropic". + // The spec file is named "claude.json" so the provider is "claude". + // We need a mapping from "claude" to the anthropic credentials. + if let Ok(key) = std::env::var("ANTHROPIC_API_KEY") { + store.add(Credential { + provider: "claude".into(), + account_id: "default".into(), + base_url: Some("https://api.anthropic.com/v1".into()), + auth: AuthMethod::Header { + name: "x-api-key".into(), + value: key, + }, + }); + } + // Contabo password grant if let (Ok(client_id), Ok(client_secret), Ok(username), Ok(password)) = ( std::env::var("CONTABO_CLIENT_ID"), diff --git a/crates/hub-core/src/dispatch.rs b/crates/hub-core/src/dispatch.rs index dc15cfb..d458e29 100644 --- a/crates/hub-core/src/dispatch.rs +++ b/crates/hub-core/src/dispatch.rs @@ -60,6 +60,12 @@ impl Dispatcher { Transport::Smtp => { return self.execute_smtp(auth, account, args).await; } + Transport::Local => { + return Ok(ExecutionOutcome::ConfigurationRequired { + provider: op.provider.clone(), + missing: vec![format!("local runtime required for operation {}", op.id)], + }); + } Transport::Http => {} } diff --git a/crates/hub-core/src/operation.rs b/crates/hub-core/src/operation.rs index 01f2506..6e03dc7 100644 --- a/crates/hub-core/src/operation.rs +++ b/crates/hub-core/src/operation.rs @@ -36,6 +36,7 @@ pub enum Transport { #[default] Http, Smtp, + Local, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/specs/claude.json b/specs/claude.json new file mode 100644 index 0000000..a502c27 --- /dev/null +++ b/specs/claude.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Claude API", + "version": "1.0.0" + }, + "servers": [ + { "url": "https://api.anthropic.com/v1" } + ], + "security": [ + { "ApiKeyAuth": [] } + ], + "components": { + "securitySchemes": { + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "x-api-key" + } + } + }, + "paths": { + "/messages": { + "post": { + "operationId": "chat", + "summary": "Create a message", + "tags": ["llm", "chat"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["messages"], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { "type": "string" }, + "content": { "type": "string" } + } + } + }, + "model": { "type": "string" }, + "system": { "type": "string" }, + "max_tokens": { "type": "integer", "default": 1024 }, + "temperature": { "type": "number" } + } + } + } + } + } + } + }, + "/models": { + "get": { + "operationId": "list_models", + "summary": "List available models", + "tags": ["llm", "models"] + } + } + } +} diff --git a/specs/cloudflare.json b/specs/cloudflare.json new file mode 100644 index 0000000..735fdc3 --- /dev/null +++ b/specs/cloudflare.json @@ -0,0 +1,90 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Cloudflare Workers AI API", + "version": "1.0.0" + }, + "servers": [ + { "url": "https://api.cloudflare.com/client/v4" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/accounts/{account_id}/ai/run/{model}": { + "post": { + "operationId": "chat", + "summary": "Run a chat completion on Workers AI", + "tags": ["llm", "chat"], + "parameters": [ + { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "model", "in": "path", "required": true, "schema": { "type": "string", "default": "@cf/meta/llama-3.1-8b-instruct" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["messages"], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { "type": "string" }, + "content": { "type": "string" } + } + } + }, + "max_tokens": { "type": "integer" }, + "temperature": { "type": "number" }, + "stream": { "type": "boolean" } + } + } + } + } + } + } + }, + "/accounts/{account_id}/ai/run": { + "post": { + "operationId": "run_model", + "summary": "Run an arbitrary AI model", + "tags": ["llm", "inference"], + "parameters": [ + { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["model", "input"], + "properties": { + "model": { "type": "string" }, + "input": { + "oneOf": [ + { "type": "object" }, + { "type": "string" } + ] + } + } + } + } + } + } + } + } + } +} diff --git a/specs/contabo.json b/specs/contabo.json new file mode 100644 index 0000000..b57c509 --- /dev/null +++ b/specs/contabo.json @@ -0,0 +1,114 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Contabo API", + "version": "1.0.0", + "description": "Manage Contabo compute instances: create, start, stop, restart instances, and list images and snapshots." + }, + "servers": [ + { "url": "https://api.contabo.com/v1" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/compute/instances": { + "get": { + "operationId": "list_instances", + "summary": "List all compute instances", + "tags": ["cloud", "compute"] + }, + "post": { + "operationId": "create_instance", + "summary": "Create a new compute instance", + "tags": ["cloud", "compute"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["image_id", "product_id"], + "properties": { + "image_id": { "type": "string", "description": "Image ID to deploy" }, + "product_id": { "type": "string", "description": "Product/plan ID" }, + "region": { "type": "string", "description": "Region for deployment" }, + "period": { "type": "integer", "description": "Billing period in months" }, + "displayName": { "type": "string", "description": "Display name for the instance" }, + "rootPassword": { "type": "string", "description": "Root password" }, + "sshKeys": { "type": "array", "items": { "type": "string" }, "description": "SSH key IDs" }, + "userData": { "type": "string", "description": "Cloud-init user data" } + } + } + } + } + } + } + }, + "/compute/instances/{id}": { + "get": { + "operationId": "get_instance", + "summary": "Get details of a specific compute instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/compute/instances/{id}/actions/start": { + "post": { + "operationId": "start", + "summary": "Start a compute instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/compute/instances/{id}/actions/stop": { + "post": { + "operationId": "stop", + "summary": "Stop a compute instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/compute/instances/{id}/actions/restart": { + "post": { + "operationId": "restart", + "summary": "Restart a compute instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/compute/images": { + "get": { + "operationId": "list_images", + "summary": "List available images", + "tags": ["cloud", "compute"] + } + }, + "/compute/instances/{id}/snapshots": { + "get": { + "operationId": "list_snapshots", + "summary": "List snapshots for a compute instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + } + } +} diff --git a/specs/cpanel.json b/specs/cpanel.json new file mode 100644 index 0000000..7af2c9f --- /dev/null +++ b/specs/cpanel.json @@ -0,0 +1,201 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "cPanel UAPI", + "version": "1.0.0", + "description": "cPanel Unified API (UAPI) for managing domains, email accounts, databases, files, cron jobs, and disk quotas." + }, + "servers": [ + { "url": "https://localhost:2083" } + ], + "security": [ + { "TokenAuth": [] } + ], + "components": { + "securitySchemes": { + "TokenAuth": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "paths": { + "/execute/DomainInfo/domains_data": { + "get": { + "operationId": "list_domains", + "summary": "List all domains on the account", + "description": "Returns data for all domains (addon, parked, sub) associated with the cPanel account.", + "tags": ["hosting", "cpanel"] + } + }, + "/execute/SubDomain/addsubdomain": { + "post": { + "operationId": "add_subdomain", + "summary": "Add a subdomain", + "description": "Creates a new subdomain under the specified root domain.", + "tags": ["hosting", "cpanel"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["subdomain", "rootdomain", "dir"], + "properties": { + "subdomain": { "type": "string", "description": "Subdomain name (e.g. 'blog')" }, + "rootdomain": { "type": "string", "description": "Root domain (e.g. 'example.com')" }, + "dir": { "type": "string", "description": "Document root directory for the subdomain" } + } + } + } + } + } + } + }, + "/execute/Email/list_pops": { + "get": { + "operationId": "list_email_accounts", + "summary": "List email accounts", + "description": "Returns a list of all POP/IMAP email accounts on the cPanel account.", + "tags": ["hosting", "cpanel"] + } + }, + "/execute/Email/add_pop": { + "post": { + "operationId": "add_email", + "summary": "Create an email account", + "description": "Creates a new email account with the specified address, password, and mailbox quota.", + "tags": ["hosting", "cpanel"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["email", "password"], + "properties": { + "email": { "type": "string", "description": "Email address to create (local part or full address)" }, + "password": { "type": "string", "description": "Password for the email account" }, + "quota": { "type": "integer", "default": 250, "description": "Mailbox quota in MB" } + } + } + } + } + } + } + }, + "/execute/Mysql/list_databases": { + "get": { + "operationId": "list_databases", + "summary": "List MySQL databases", + "description": "Returns a list of all MySQL databases owned by the cPanel account.", + "tags": ["hosting", "cpanel"] + } + }, + "/execute/Mysql/create_database": { + "post": { + "operationId": "create_database", + "summary": "Create a MySQL database", + "description": "Creates a new MySQL database with the given name (prefixed with cPanel username).", + "tags": ["hosting", "cpanel"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["name"], + "properties": { + "name": { "type": "string", "description": "Database name (will be prefixed with cPanel username)" } + } + } + } + } + } + } + }, + "/execute/Mysql/create_user": { + "post": { + "operationId": "create_db_user", + "summary": "Create a MySQL database user", + "description": "Creates a new MySQL user that can be granted access to databases.", + "tags": ["hosting", "cpanel"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["user", "password"], + "properties": { + "user": { "type": "string", "description": "MySQL username to create" }, + "password": { "type": "string", "description": "Password for the MySQL user" } + } + } + } + } + } + } + }, + "/execute/Fileman/list_files": { + "get": { + "operationId": "file_list", + "summary": "List files in a directory", + "description": "Returns a directory listing with file names, sizes, types, and permissions.", + "tags": ["hosting", "cpanel"], + "parameters": [ + { + "name": "dir", + "in": "query", + "schema": { "type": "string", "default": "." }, + "description": "Directory path to list (relative to home)" + } + ] + } + }, + "/execute/Cron/list_cron": { + "get": { + "operationId": "cron_list", + "summary": "List cron jobs", + "description": "Returns all cron jobs configured for the cPanel account.", + "tags": ["hosting", "cpanel"] + } + }, + "/execute/Cron/add_line": { + "post": { + "operationId": "cron_add", + "summary": "Add a cron job", + "description": "Creates a new cron job with the specified schedule and command.", + "tags": ["hosting", "cpanel"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["command"], + "properties": { + "command": { "type": "string", "description": "Command to execute" }, + "minute": { "type": "string", "default": "0", "description": "Minute field (0-59 or *)" }, + "hour": { "type": "string", "default": "0", "description": "Hour field (0-23 or *)" }, + "day": { "type": "string", "default": "*", "description": "Day of month (1-31 or *)" }, + "month": { "type": "string", "default": "*", "description": "Month (1-12 or *)" }, + "weekday": { "type": "string", "default": "*", "description": "Day of week (0-7 or *)" } + } + } + } + } + } + } + }, + "/execute/Quota/get_quota_info": { + "get": { + "operationId": "disk_usage", + "summary": "Get disk usage and quota info", + "description": "Returns current disk usage and quota limits for the cPanel account.", + "tags": ["hosting", "cpanel"] + } + } + } +} diff --git a/specs/github.json b/specs/github.json new file mode 100644 index 0000000..e2f0688 --- /dev/null +++ b/specs/github.json @@ -0,0 +1,527 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "GitHub API", + "version": "1.0.0", + "description": "GitHub REST API for managing repositories, issues, pull requests, actions workflows, webhooks, and code search." + }, + "servers": [ + { "url": "https://api.github.com" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/user": { + "get": { + "operationId": "get_me", + "summary": "Get the authenticated user", + "description": "Returns details of the currently authenticated GitHub user.", + "tags": ["github", "scm"] + } + }, + "/user/repos": { + "get": { + "operationId": "list_repos", + "summary": "List repositories for the authenticated user", + "description": "Returns repositories that the authenticated user has access to.", + "tags": ["github", "scm"], + "parameters": [ + { + "name": "visibility", + "in": "query", + "schema": { "type": "string", "enum": ["all", "public", "private"] }, + "description": "Filter by repository visibility" + }, + { + "name": "per_page", + "in": "query", + "schema": { "type": "integer", "default": 30 }, + "description": "Results per page (max 100)" + } + ] + }, + "post": { + "operationId": "create_repo", + "summary": "Create a new repository", + "description": "Creates a new repository for the authenticated user.", + "tags": ["github", "scm"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["name"], + "properties": { + "name": { "type": "string", "description": "Repository name" }, + "private": { "type": "boolean", "description": "Whether the repository is private" }, + "description": { "type": "string", "description": "Repository description" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}": { + "get": { + "operationId": "get_repo", + "summary": "Get a repository", + "description": "Returns details of a specific repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ] + }, + "delete": { + "operationId": "delete_repo", + "summary": "Delete a repository", + "description": "Permanently deletes a repository. Requires admin access.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/repos/{owner}/{repo}/branches": { + "get": { + "operationId": "list_branches", + "summary": "List branches", + "description": "Returns all branches in the repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/repos/{owner}/{repo}/git/refs": { + "post": { + "operationId": "create_branch", + "summary": "Create a branch", + "description": "Creates a new git reference (branch) in the repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["branch"], + "properties": { + "branch": { "type": "string", "description": "New branch name" }, + "from_branch": { "type": "string", "description": "Source branch to create from (defaults to default branch)" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/contents/{path}": { + "get": { + "operationId": "get_file", + "summary": "Get file contents", + "description": "Returns the contents of a file or directory in a repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "path", "in": "path", "required": true, "schema": { "type": "string" } }, + { + "name": "ref", + "in": "query", + "schema": { "type": "string" }, + "description": "Branch, tag, or commit SHA to read from" + } + ] + }, + "put": { + "operationId": "put_file", + "summary": "Create or update a file", + "description": "Creates or updates a file in the repository. Provide sha to update an existing file.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "path", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["content", "message"], + "properties": { + "content": { "type": "string", "description": "Base64-encoded file content" }, + "message": { "type": "string", "description": "Commit message" }, + "branch": { "type": "string", "description": "Branch to commit to" }, + "sha": { "type": "string", "description": "SHA of the file being replaced (required for updates)" } + } + } + } + } + } + }, + "delete": { + "operationId": "delete_file", + "summary": "Delete a file", + "description": "Deletes a file from the repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "path", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["message", "sha"], + "properties": { + "message": { "type": "string", "description": "Commit message for the deletion" }, + "sha": { "type": "string", "description": "SHA of the file to delete" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues": { + "get": { + "operationId": "list_issues", + "summary": "List repository issues", + "description": "Returns issues for a repository, filtered by state.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { + "name": "state", + "in": "query", + "schema": { "type": "string", "default": "open", "enum": ["open", "closed", "all"] }, + "description": "Filter by issue state" + } + ] + }, + "post": { + "operationId": "create_issue", + "summary": "Create an issue", + "description": "Creates a new issue in the repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["title"], + "properties": { + "title": { "type": "string", "description": "Issue title" }, + "body": { "type": "string", "description": "Issue body in Markdown" }, + "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels to apply" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}/comments": { + "post": { + "operationId": "comment_issue", + "summary": "Add a comment to an issue", + "description": "Creates a new comment on an existing issue or pull request.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "number", "in": "path", "required": true, "schema": { "type": "integer" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["body"], + "properties": { + "body": { "type": "string", "description": "Comment body in Markdown" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/issues/{number}": { + "patch": { + "operationId": "close_issue", + "summary": "Close an issue", + "description": "Closes an open issue by setting its state to closed.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "number", "in": "path", "required": true, "schema": { "type": "integer" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "state": { "type": "string", "enum": ["closed"], "default": "closed" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls": { + "get": { + "operationId": "list_prs", + "summary": "List pull requests", + "description": "Returns pull requests for a repository, filtered by state.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { + "name": "state", + "in": "query", + "schema": { "type": "string", "default": "open", "enum": ["open", "closed", "all"] }, + "description": "Filter by PR state" + } + ] + }, + "post": { + "operationId": "create_pr", + "summary": "Create a pull request", + "description": "Creates a new pull request from a head branch to a base branch.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["title", "head", "base"], + "properties": { + "title": { "type": "string", "description": "Pull request title" }, + "head": { "type": "string", "description": "Branch containing the changes" }, + "base": { "type": "string", "description": "Branch to merge into" }, + "body": { "type": "string", "description": "Pull request description in Markdown" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}/merge": { + "put": { + "operationId": "merge_pr", + "summary": "Merge a pull request", + "description": "Merges a pull request using the specified merge method.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "number", "in": "path", "required": true, "schema": { "type": "integer" } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "method": { "type": "string", "default": "merge", "enum": ["merge", "squash", "rebase"], "description": "Merge method" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/pulls/{number}/reviews": { + "post": { + "operationId": "review_pr", + "summary": "Create a pull request review", + "description": "Submits a review on a pull request (approve, request changes, or comment).", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "number", "in": "path", "required": true, "schema": { "type": "integer" } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "event": { "type": "string", "default": "APPROVE", "enum": ["APPROVE", "REQUEST_CHANGES", "COMMENT"], "description": "Review action" }, + "body": { "type": "string", "description": "Review comment body" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows": { + "get": { + "operationId": "list_workflows", + "summary": "List repository workflows", + "description": "Returns all GitHub Actions workflows configured in the repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": { + "post": { + "operationId": "dispatch_workflow", + "summary": "Dispatch a workflow run", + "description": "Triggers a workflow_dispatch event to start a workflow run.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "workflow_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Workflow ID or filename" } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ref": { "type": "string", "default": "main", "description": "Git ref to run the workflow on" }, + "inputs": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Workflow input parameters" } + } + } + } + } + } + } + }, + "/repos/{owner}/{repo}/actions/runs": { + "get": { + "operationId": "list_workflow_runs", + "summary": "List workflow runs", + "description": "Returns all workflow runs for a repository.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/repos/{owner}/{repo}/actions/secrets": { + "get": { + "operationId": "list_secrets_meta", + "summary": "List repository secrets metadata", + "description": "Returns metadata (name, created/updated dates) for all repository secrets. Does not return secret values.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/repos/{owner}/{repo}/hooks": { + "post": { + "operationId": "create_webhook", + "summary": "Create a repository webhook", + "description": "Creates a webhook that sends HTTP POST payloads to the specified URL on configured events.", + "tags": ["github", "scm"], + "parameters": [ + { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" } }, + { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" } } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["url"], + "properties": { + "url": { "type": "string", "description": "Payload delivery URL" }, + "events": { "type": "array", "items": { "type": "string" }, "default": ["push"], "description": "Events that trigger the webhook" } + } + } + } + } + } + } + }, + "/search/code": { + "get": { + "operationId": "search_code", + "summary": "Search code across repositories", + "description": "Searches for code matching the query across GitHub repositories.", + "tags": ["github", "scm"], + "parameters": [ + { + "name": "query", + "in": "query", + "required": true, + "schema": { "type": "string" }, + "description": "Search query using GitHub code search syntax" + } + ] + } + }, + "/search/repositories": { + "get": { + "operationId": "search_repos", + "summary": "Search repositories", + "description": "Searches for repositories matching the query.", + "tags": ["github", "scm"], + "parameters": [ + { + "name": "query", + "in": "query", + "required": true, + "schema": { "type": "string" }, + "description": "Search query using GitHub search syntax" + } + ] + } + } + } +} diff --git a/specs/kimi.json b/specs/kimi.json new file mode 100644 index 0000000..822de10 --- /dev/null +++ b/specs/kimi.json @@ -0,0 +1,65 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Kimi API", + "version": "1.0.0" + }, + "servers": [ + { "url": "https://api.moonshot.cn/v1" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/chat/completions": { + "post": { + "operationId": "chat", + "summary": "Create a chat completion", + "tags": ["llm", "chat"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["messages"], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { "type": "string" }, + "content": { "type": "string" } + } + } + }, + "model": { "type": "string", "default": "kimi-k2-0711-preview" }, + "temperature": { "type": "number" }, + "max_tokens": { "type": "integer" }, + "top_p": { "type": "number" }, + "stream": { "type": "boolean" } + } + } + } + } + } + } + }, + "/models": { + "get": { + "operationId": "list_models", + "summary": "List available models", + "tags": ["llm", "models"] + } + } + } +} diff --git a/specs/linode.json b/specs/linode.json new file mode 100644 index 0000000..f3f13a2 --- /dev/null +++ b/specs/linode.json @@ -0,0 +1,130 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Linode API", + "version": "1.0.0", + "description": "Manage Linode cloud instances: create, boot, shutdown, reboot, and delete Linodes, and list available regions and instance types." + }, + "servers": [ + { "url": "https://api.linode.com/v4" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/linode/instances": { + "get": { + "operationId": "list_linodes", + "summary": "List all Linode instances", + "tags": ["cloud", "compute"] + }, + "post": { + "operationId": "create_linode", + "summary": "Create a new Linode instance", + "tags": ["cloud", "compute"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["region", "type", "image", "root_pass"], + "properties": { + "region": { "type": "string", "description": "Region to deploy the Linode in" }, + "type": { "type": "string", "description": "Linode plan type" }, + "image": { "type": "string", "description": "Image ID to deploy" }, + "root_pass": { "type": "string", "description": "Root password for the Linode" }, + "label": { "type": "string", "description": "Label for the Linode" }, + "authorized_keys": { "type": "array", "items": { "type": "string" }, "description": "SSH public keys to install" }, + "tags": { "type": "array", "items": { "type": "string" }, "description": "Tags for categorization" } + } + } + } + } + } + } + }, + "/linode/instances/{id}": { + "get": { + "operationId": "get_linode", + "summary": "Get details for a specific Linode instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + }, + "delete": { + "operationId": "delete_linode", + "summary": "Delete a Linode instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/linode/instances/{id}/boot": { + "post": { + "operationId": "boot", + "summary": "Boot a Linode instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "config_id": { "type": "integer", "description": "Optional configuration profile ID to boot with" } + } + } + } + } + } + } + }, + "/linode/instances/{id}/shutdown": { + "post": { + "operationId": "shutdown", + "summary": "Shutdown a Linode instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/linode/instances/{id}/reboot": { + "post": { + "operationId": "reboot", + "summary": "Reboot a Linode instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/regions": { + "get": { + "operationId": "list_regions", + "summary": "List available regions", + "tags": ["cloud", "compute"] + } + }, + "/linode/types": { + "get": { + "operationId": "list_types", + "summary": "List available Linode instance types (plans)", + "tags": ["cloud", "compute"] + } + } + } +} diff --git a/specs/oneprovider.json b/specs/oneprovider.json new file mode 100644 index 0000000..f95faa2 --- /dev/null +++ b/specs/oneprovider.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "OneProvider API", + "version": "1.0.0", + "description": "Manage OneProvider dedicated servers: list, get details, reboot servers, and view locations, templates, and bandwidth usage." + }, + "servers": [ + { "url": "https://api.oneprovider.com" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/servers": { + "get": { + "operationId": "list_servers", + "summary": "List all servers", + "tags": ["cloud", "compute"] + } + }, + "/servers/{id}": { + "get": { + "operationId": "get_server", + "summary": "Get details of a specific server", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/servers/{id}/reboot": { + "post": { + "operationId": "reboot", + "summary": "Reboot a server", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + }, + "/locations": { + "get": { + "operationId": "list_locations", + "summary": "List available server locations", + "tags": ["cloud", "compute"] + } + }, + "/templates": { + "get": { + "operationId": "list_templates", + "summary": "List available server templates", + "tags": ["cloud", "compute"] + } + }, + "/servers/{id}/bandwidth": { + "get": { + "operationId": "bandwidth", + "summary": "Get bandwidth usage for a server", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } + ] + } + } + } +} diff --git a/specs/openai.json b/specs/openai.json new file mode 100644 index 0000000..f9b7517 --- /dev/null +++ b/specs/openai.json @@ -0,0 +1,92 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "OpenAI API", + "version": "1.0.0" + }, + "servers": [ + { "url": "https://api.openai.com/v1" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/chat/completions": { + "post": { + "operationId": "chat", + "summary": "Create a chat completion", + "tags": ["llm", "chat"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["messages"], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { "type": "string" }, + "content": { "type": "string" } + } + } + }, + "model": { "type": "string", "default": "gpt-4o-mini" }, + "temperature": { "type": "number" }, + "max_tokens": { "type": "integer" }, + "top_p": { "type": "number" }, + "stream": { "type": "boolean" } + } + } + } + } + } + } + }, + "/models": { + "get": { + "operationId": "list_models", + "summary": "List available models", + "tags": ["llm", "models"] + } + }, + "/embeddings": { + "post": { + "operationId": "embeddings", + "summary": "Create embeddings", + "tags": ["llm", "embeddings"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["input"], + "properties": { + "input": { + "oneOf": [ + { "type": "string" }, + { "type": "array", "items": { "type": "string" } } + ] + }, + "model": { "type": "string", "default": "text-embedding-3-small" } + } + } + } + } + } + } + } + } +} diff --git a/specs/ovh.json b/specs/ovh.json new file mode 100644 index 0000000..558b2a0 --- /dev/null +++ b/specs/ovh.json @@ -0,0 +1,82 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "OVH API", + "version": "1.0.0", + "description": "Manage OVH cloud resources: VPS instances, dedicated servers, IP addresses, and account information." + }, + "servers": [ + { "url": "https://api.ovh.com/1.0" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/vps": { + "get": { + "operationId": "list_vps", + "summary": "List all VPS instances", + "tags": ["cloud", "compute"] + } + }, + "/vps/{name}": { + "get": { + "operationId": "get_vps", + "summary": "Get details of a specific VPS", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "name", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/vps/{name}/reboot": { + "post": { + "operationId": "reboot_vps", + "summary": "Reboot a VPS instance", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "name", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/dedicated/server": { + "get": { + "operationId": "list_dedicated", + "summary": "List all dedicated servers", + "tags": ["cloud", "compute"] + } + }, + "/dedicated/server/{name}": { + "get": { + "operationId": "get_dedicated", + "summary": "Get details of a specific dedicated server", + "tags": ["cloud", "compute"], + "parameters": [ + { "name": "name", "in": "path", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/me": { + "get": { + "operationId": "get_me", + "summary": "Get current account information", + "tags": ["cloud", "compute"] + } + }, + "/ip": { + "get": { + "operationId": "list_ips", + "summary": "List all IP addresses", + "tags": ["cloud", "compute"] + } + } + } +} diff --git a/specs/tawk.json b/specs/tawk.json new file mode 100644 index 0000000..e9e125b --- /dev/null +++ b/specs/tawk.json @@ -0,0 +1,197 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Tawk.to API", + "version": "1.0.0", + "description": "Tawk.to live chat and support ticket API for managing chats, tickets, agents, and properties." + }, + "servers": [ + { "url": "https://api.tawk.to/v1" } + ], + "security": [ + { "BearerAuth": [] } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + }, + "paths": { + "/chats": { + "get": { + "operationId": "list_chats", + "summary": "List chat conversations", + "description": "Returns a list of chat conversations, optionally filtered by property and status.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "property_id", + "in": "query", + "schema": { "type": "string" }, + "description": "Filter by property (site) ID" + }, + { + "name": "status", + "in": "query", + "schema": { "type": "string", "enum": ["open", "pending", "closed"] }, + "description": "Filter by chat status" + } + ] + } + }, + "/chats/{chat_id}": { + "get": { + "operationId": "get_chat", + "summary": "Get a specific chat conversation", + "description": "Returns full details and message history for a single chat conversation.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "chat_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Chat conversation ID" + } + ] + } + }, + "/chats/{chat_id}/messages": { + "post": { + "operationId": "send_message", + "summary": "Send a message in a chat", + "description": "Sends a new message to an existing chat conversation.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "chat_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Chat conversation ID" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["message"], + "properties": { + "message": { "type": "string", "description": "Message text to send" } + } + } + } + } + } + } + }, + "/tickets": { + "get": { + "operationId": "list_tickets", + "summary": "List support tickets", + "description": "Returns a list of support tickets, optionally filtered by property and status.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "property_id", + "in": "query", + "schema": { "type": "string" }, + "description": "Filter by property (site) ID" + }, + { + "name": "status", + "in": "query", + "schema": { "type": "string" }, + "description": "Filter by ticket status" + } + ] + } + }, + "/tickets/{ticket_id}": { + "get": { + "operationId": "get_ticket", + "summary": "Get a specific support ticket", + "description": "Returns full details and replies for a single support ticket.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "ticket_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Support ticket ID" + } + ] + } + }, + "/tickets/{ticket_id}/replies": { + "post": { + "operationId": "reply_ticket", + "summary": "Reply to a support ticket", + "description": "Adds a reply to an existing support ticket.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "ticket_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Support ticket ID" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["message"], + "properties": { + "message": { "type": "string", "description": "Reply message text" } + } + } + } + } + } + } + }, + "/agents": { + "get": { + "operationId": "list_agents", + "summary": "List agents", + "description": "Returns a list of agents, optionally filtered by property.", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "property_id", + "in": "query", + "schema": { "type": "string" }, + "description": "Filter by property (site) ID" + } + ] + } + }, + "/properties/{property_id}": { + "get": { + "operationId": "property_info", + "summary": "Get property information", + "description": "Returns details for a specific tawk.to property (website/chat widget).", + "tags": ["chat", "support"], + "parameters": [ + { + "name": "property_id", + "in": "path", + "required": true, + "schema": { "type": "string" }, + "description": "Property (site) ID" + } + ] + } + } + } +} diff --git a/specs/ultrahost.json b/specs/ultrahost.json new file mode 100644 index 0000000..41718d5 --- /dev/null +++ b/specs/ultrahost.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "UltaHost WHMCS API", + "version": "1.0.0", + "description": "UltaHost VPS management via WHMCS billing API" + }, + "servers": [{"url": "https://billing.ultahost.com"}], + "paths": { + "/includes/api.php#list_services": { + "post": { + "operationId": "list_services", + "summary": "List all services/VPS instances", + "tags": ["cloud", "billing"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "limit": {"type": "integer", "description": "Max results to return"} + } + } + } + } + }, + "responses": {"200": {"description": "OK"}} + } + }, + "/includes/api.php#get_service": { + "post": { + "operationId": "get_service", + "summary": "Get details of a specific service", + "tags": ["cloud", "billing"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": {"type": "integer", "description": "Service ID"} + } + } + } + } + }, + "responses": {"200": {"description": "OK"}} + } + }, + "/includes/api.php#reboot": { + "post": { + "operationId": "reboot", + "summary": "Reboot a VPS instance", + "tags": ["cloud", "power"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": {"type": "integer", "description": "Service ID"} + } + } + } + } + }, + "responses": {"200": {"description": "OK"}} + } + }, + "/includes/api.php#start": { + "post": { + "operationId": "start", + "summary": "Start/unsuspend a VPS instance", + "tags": ["cloud", "power"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": {"type": "integer", "description": "Service ID"} + } + } + } + } + }, + "responses": {"200": {"description": "OK"}} + } + }, + "/includes/api.php#stop": { + "post": { + "operationId": "stop", + "summary": "Stop/suspend a VPS instance", + "tags": ["cloud", "power"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": {"type": "integer", "description": "Service ID"} + } + } + } + } + }, + "responses": {"200": {"description": "OK"}} + } + }, + "/includes/api.php#status": { + "post": { + "operationId": "status", + "summary": "Get status of a VPS instance", + "tags": ["cloud", "monitoring"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["id"], + "properties": { + "id": {"type": "integer", "description": "Service ID"} + } + } + } + } + }, + "responses": {"200": {"description": "OK"}} + } + } + } +} diff --git a/specs/whm.json b/specs/whm.json new file mode 100644 index 0000000..1c47fe4 --- /dev/null +++ b/specs/whm.json @@ -0,0 +1,159 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "WHM API", + "version": "1.0.0", + "description": "WebHost Manager (WHM) JSON API for managing cPanel hosting accounts, packages, DNS zones, and server status." + }, + "servers": [ + { "url": "https://localhost:2087" } + ], + "security": [ + { "TokenAuth": [] } + ], + "components": { + "securitySchemes": { + "TokenAuth": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "paths": { + "/json-api/listaccts": { + "get": { + "operationId": "list_accounts", + "summary": "List all cPanel accounts on the server", + "description": "Returns a list of all cPanel accounts with their details including domain, owner, plan, disk usage, and status.", + "tags": ["hosting", "whm"] + } + }, + "/json-api/createacct": { + "post": { + "operationId": "create_account", + "summary": "Create a new cPanel account", + "description": "Provisions a new cPanel hosting account with the specified domain, username, and optional plan.", + "tags": ["hosting", "whm"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["domain", "username", "password"], + "properties": { + "domain": { "type": "string", "description": "Primary domain for the new account" }, + "username": { "type": "string", "description": "cPanel username (max 8 characters)" }, + "password": { "type": "string", "description": "Password for the new account" }, + "plan": { "type": "string", "description": "Hosting package/plan name" }, + "contactemail": { "type": "string", "description": "Contact email address for the account owner" } + } + } + } + } + } + } + }, + "/json-api/suspendacct": { + "post": { + "operationId": "suspend_account", + "summary": "Suspend a cPanel account", + "description": "Suspends the specified cPanel account, disabling access to the website and cPanel interface.", + "tags": ["hosting", "whm"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["user"], + "properties": { + "user": { "type": "string", "description": "cPanel username to suspend" }, + "reason": { "type": "string", "description": "Reason for suspension" } + } + } + } + } + } + } + }, + "/json-api/unsuspendacct": { + "post": { + "operationId": "unsuspend_account", + "summary": "Unsuspend a cPanel account", + "description": "Reactivates a previously suspended cPanel account.", + "tags": ["hosting", "whm"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["user"], + "properties": { + "user": { "type": "string", "description": "cPanel username to unsuspend" } + } + } + } + } + } + } + }, + "/json-api/removeacct": { + "post": { + "operationId": "terminate_account", + "summary": "Terminate and remove a cPanel account", + "description": "Permanently removes a cPanel account and all its data from the server.", + "tags": ["hosting", "whm"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["user"], + "properties": { + "user": { "type": "string", "description": "cPanel username to terminate" }, + "keepdns": { "type": "boolean", "description": "If true, keep DNS zone files after account removal" } + } + } + } + } + } + } + }, + "/json-api/listpkgs": { + "get": { + "operationId": "list_packages", + "summary": "List all hosting packages", + "description": "Returns a list of all hosting packages (plans) configured on the server.", + "tags": ["hosting", "whm"] + } + }, + "/json-api/servicestatus": { + "get": { + "operationId": "server_status", + "summary": "Get server service status", + "description": "Returns the running status of all monitored services on the server (Apache, MySQL, etc.).", + "tags": ["hosting", "whm"] + } + }, + "/json-api/listzones": { + "get": { + "operationId": "list_zones", + "summary": "List all DNS zones", + "description": "Returns a list of all DNS zones hosted on the server.", + "tags": ["hosting", "whm"] + } + }, + "/json-api/version": { + "get": { + "operationId": "version", + "summary": "Get WHM version", + "description": "Returns the WHM and cPanel version information.", + "tags": ["hosting", "whm"] + } + } + } +} diff --git a/specs/whmcs.json b/specs/whmcs.json new file mode 100644 index 0000000..50c5994 --- /dev/null +++ b/specs/whmcs.json @@ -0,0 +1,252 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "WHMCS API", + "version": "1.0.0", + "description": "WHMCS billing and client management API. All actions use form-encoded POST to a single endpoint with an 'action' parameter." + }, + "servers": [ + { "url": "https://localhost" } + ], + "security": [ + { "ApiCredentials": [] } + ], + "components": { + "securitySchemes": { + "ApiCredentials": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + }, + "paths": { + "/includes/api.php": { + "post": { + "operationId": "get_clients", + "summary": "Get a list of clients", + "description": "Retrieves a paginated list of all clients in the WHMCS system.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action"], + "properties": { + "action": { "type": "string", "enum": ["GetClients"], "default": "GetClients" }, + "limit": { "type": "integer", "default": 25, "description": "Number of results to return" } + } + } + } + } + } + } + }, + "/includes/api.php#GetClientsDetails": { + "post": { + "operationId": "get_client", + "summary": "Get details for a specific client", + "description": "Retrieves full details for a single client by their client ID.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action", "client_id"], + "properties": { + "action": { "type": "string", "enum": ["GetClientsDetails"], "default": "GetClientsDetails" }, + "client_id": { "type": "integer", "description": "Client ID to retrieve" } + } + } + } + } + } + } + }, + "/includes/api.php#GetInvoices": { + "post": { + "operationId": "get_invoices", + "summary": "Get invoices", + "description": "Retrieves a list of invoices, optionally filtered by status and client.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action"], + "properties": { + "action": { "type": "string", "enum": ["GetInvoices"], "default": "GetInvoices" }, + "limit": { "type": "integer", "description": "Number of results to return" }, + "status": { "type": "string", "description": "Filter by invoice status (Paid, Unpaid, Cancelled, etc.)" }, + "client_id": { "type": "integer", "description": "Filter by client ID" } + } + } + } + } + } + } + }, + "/includes/api.php#GetTickets": { + "post": { + "operationId": "get_tickets", + "summary": "Get support tickets", + "description": "Retrieves a list of support tickets, optionally filtered by status and client.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action"], + "properties": { + "action": { "type": "string", "enum": ["GetTickets"], "default": "GetTickets" }, + "limit": { "type": "integer", "description": "Number of results to return" }, + "status": { "type": "string", "description": "Filter by ticket status (Open, Answered, Closed, etc.)" }, + "client_id": { "type": "integer", "description": "Filter by client ID" } + } + } + } + } + } + } + }, + "/includes/api.php#AddTicketReply": { + "post": { + "operationId": "reply_ticket", + "summary": "Reply to a support ticket", + "description": "Adds a reply message to an existing support ticket.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action", "ticket_id", "message"], + "properties": { + "action": { "type": "string", "enum": ["AddTicketReply"], "default": "AddTicketReply" }, + "ticket_id": { "type": "integer", "description": "Ticket ID to reply to" }, + "message": { "type": "string", "description": "Reply message body" } + } + } + } + } + } + } + }, + "/includes/api.php#AddClient": { + "post": { + "operationId": "add_client", + "summary": "Add a new client", + "description": "Creates a new client account in WHMCS.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action", "firstname", "lastname", "email", "password"], + "properties": { + "action": { "type": "string", "enum": ["AddClient"], "default": "AddClient" }, + "firstname": { "type": "string", "description": "Client first name" }, + "lastname": { "type": "string", "description": "Client last name" }, + "email": { "type": "string", "description": "Client email address" }, + "password": { "type": "string", "description": "Client account password" } + } + } + } + } + } + } + }, + "/includes/api.php#CreateInvoice": { + "post": { + "operationId": "create_invoice", + "summary": "Create a new invoice", + "description": "Creates a new invoice for a client with the specified line items.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action", "client_id", "items"], + "properties": { + "action": { "type": "string", "enum": ["CreateInvoice"], "default": "CreateInvoice" }, + "client_id": { "type": "integer", "description": "Client ID to create the invoice for" }, + "items": { + "type": "array", + "description": "Invoice line items", + "items": { + "type": "object", + "properties": { + "description": { "type": "string" }, + "amount": { "type": "number" } + } + } + } + } + } + } + } + } + } + }, + "/includes/api.php#GetProducts": { + "post": { + "operationId": "get_products", + "summary": "Get products and services", + "description": "Retrieves configured products/services, optionally filtered by product or group ID.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action"], + "properties": { + "action": { "type": "string", "enum": ["GetProducts"], "default": "GetProducts" }, + "product_id": { "type": "integer", "description": "Filter by specific product ID" }, + "group_id": { "type": "integer", "description": "Filter by product group ID" } + } + } + } + } + } + } + }, + "/includes/api.php#ModuleAction": { + "post": { + "operationId": "module_action", + "summary": "Execute a module action on a service", + "description": "Triggers a provisioning module action (create, suspend, unsuspend, or terminate) on a client service.", + "tags": ["hosting", "billing"], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "required": ["action", "service_id"], + "properties": { + "action": { "type": "string", "enum": ["ModuleSuspend", "ModuleUnsuspend", "ModuleTerminate", "ModuleCreate"], "description": "Module action to execute" }, + "service_id": { "type": "integer", "description": "Service ID to perform the action on" } + } + } + } + } + } + } + } + } +}