diff --git a/openapi/openapi.json b/openapi/openapi.json index a0214ea..4d13c78 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -10,7 +10,7 @@ } }, "info": { - "description": "Build integrations for your Nodesty account, services, billing, virtual servers, dedicated servers, and firewall resources.\n\n## Authentication\n\nProtected endpoints use permission-scoped **Personal Access Tokens (PAT)**. Create a token from [Dashboard → Access Tokens](/dashboard/my-account/access-tokens), then send it with every request:\n\n```http\nAuthorization: PAT \n```\n\n> Keep access tokens server-side and never expose them in browser code or public repositories.\n\n## Common responses\n\n| Status | Meaning |\n| :--- | :--- |\n| **200** | Request completed successfully. |\n| **400** | The request parameters or payload are invalid. |\n| **401** | Authentication is missing or invalid. |\n| **403** | The token does not have the required permission. |\n| **404** | The requested resource could not be found. |\n| **429** | The request limit has been exceeded. |", + "description": "Build integrations for your Nodesty account, services, teams, billing, virtual servers, dedicated servers, mail hosting, and firewall resources.\n\n## Authentication\n\nProtected endpoints use permission-scoped **Personal Access Tokens (PAT)**. Create a token from [Dashboard → Access Tokens](/dashboard/my-account/access-tokens), then send it with every request:\n\n```http\nAuthorization: PAT \n```\n\n> Keep access tokens server-side and never expose them in browser code or public repositories.\n\n## Common responses\n\n| Status | Meaning |\n| :--- | :--- |\n| **200** | Request completed successfully. |\n| **400** | The request parameters or payload are invalid. |\n| **401** | Authentication is missing or invalid. |\n| **403** | The token does not have the required permission. |\n| **404** | The requested resource could not be found. |\n| **429** | The request limit has been exceeded. |", "title": "API Docs | Nodesty", "version": "1.0.0" }, @@ -334,16 +334,26 @@ "format": "date-time", "type": "integer" }, + "nickname": { + "description": "Name the service owner gave the service", + "example": "Minecraft", + "type": ["string", "null"] + }, "owner": { "description": "Indicates if the current user is the owner of the service", "example": true, "type": "boolean" }, "password": { - "description": "Password associated with the service", + "description": "Password associated with the service; empty on a team service when your team permissions do not include panel login (hosting) or reinstall (servers)", "example": "securepassword123", "type": ["string", "null"] }, + "permissions": { + "description": "What the current user may do on a service shared by a team, as a bit field: 1 power, 2 console, 4 backups, 8 reinstall and passwords, 16 firewall, 32 panel login, 64 reinstall after a team owner or admin approves a request, 128 take backups and restore one after approval. Your own services have the first six bits (63).", + "example": 63, + "type": "number" + }, "productId": { "description": "Product ID associated with the service", "example": 123, @@ -379,10 +389,16 @@ "type": ["string", "null"] }, "teamId": { - "description": "Team ID if the service is associated with a team, otherwise null", + "description": "The first team the service is shared with, otherwise null; see teamIds", "example": 789, "type": ["number", "null"] }, + "teamIds": { + "description": "Every team of yours the service is shared with", + "example": [789], + "items": { "type": "number" }, + "type": "array" + }, "username": { "description": "Username associated with the service", "example": "user123", @@ -407,6 +423,135 @@ }, "parameters": [] }, + "/api/services/{id}/autopay": { + "get": { + "description": "Get the automatic payment settings of an active service and the payment attempts made for it.", + "operationId": "billingGetAutoPaySettings", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "daysBeforeDue": { "example": 3, "type": "integer" }, + "enabled": { "example": true, "type": "boolean" }, + "logs": { + "items": { + "properties": { + "amount": { + "example": 249.9, + "type": "number" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "currency": { + "example": "TRY", + "type": "string" + }, + "errorMessage": { "type": ["string", "null"] }, + "invoiceId": { + "example": 12345, + "type": "integer" + }, + "paymentMethodUsed": { + "enum": [ + "CARD", + "BALANCE", + "FIRST_AVAILABLE" + ], + "type": "string" + }, + "status": { + "enum": [ + "SUCCESS", + "FAILED", + "CHARGED_BUT_SYNC_FAILED" + ], + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "paymentMethod": { + "enum": ["CARD", "BALANCE", "FIRST_AVAILABLE"], + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Auto-Pay settings" + }, + "404": { "description": "Service not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Auto-Pay Settings", + "tags": ["Billing"] + }, + "parameters": [], + "put": { + "description": "Turn automatic payment on or off for an active service. daysBeforeDue is how many days before the due date the invoice is paid. CARD and FIRST_AVAILABLE need a saved card; FIRST_AVAILABLE tries the account balance first, then the cards.", + "operationId": "billingUpdateAutoPaySettings", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "daysBeforeDue": { + "default": 3, + "maximum": 7, + "minimum": 0, + "type": "integer" + }, + "enabled": { "example": true, "type": "boolean" }, + "paymentMethod": { + "default": "FIRST_AVAILABLE", + "enum": ["CARD", "BALANCE", "FIRST_AVAILABLE"], + "type": "string" + } + }, + "required": ["enabled"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "204": { "description": "Auto-Pay settings saved" }, + "400": { + "description": "Invalid body, or no saved card for a card payment method" + }, + "404": { "description": "Service not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Update Auto-Pay Settings", + "tags": ["Billing"] + } + }, "/api/services/{id}/dedicated/action": { "parameters": [], "post": { @@ -906,6 +1051,11 @@ "example": 449455557, "type": "integer" }, + "peakPps": { + "description": "Peak packets per second, where the protection reports it", + "example": 20419, + "type": "integer" + }, "startedAt": { "description": "Timestamp when the attack started", "example": 1700000000000, @@ -982,6 +1132,11 @@ "description": "Whether email notifications are enabled for attack alerts", "example": true, "type": "boolean" + }, + "inAppNotification": { + "description": "Whether attacks appear in the dashboard notification center", + "example": true, + "type": "boolean" } }, "type": "object" @@ -1040,6 +1195,11 @@ "description": "Whether email notifications are enabled", "example": true, "type": "boolean" + }, + "inAppNotification": { + "description": "Whether attacks appear in the dashboard notification center", + "example": true, + "type": "boolean" } }, "required": [], @@ -1064,6 +1224,11 @@ "description": "Whether email notifications are enabled", "example": true, "type": "boolean" + }, + "inAppNotification": { + "description": "Whether attacks appear in the dashboard notification center", + "example": true, + "type": "boolean" } }, "type": "object" @@ -1089,6 +1254,66 @@ "tags": ["Firewall"] } }, + "/api/services/{id}/firewall/{ip}/metrics": { + "get": { + "description": "Get the current allowed and blocked traffic for an IP address protected by the advanced firewall on a Virtual or Dedicated Server", + "operationId": "firewallGetLiveTraffic", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "IP Address", + "in": "path", + "name": "ip", + "required": true, + "schema": { "example": "82.25.42.10", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "dropBps": { + "description": "Blocked traffic in bits per second", + "type": "number" + }, + "dropPps": { + "description": "Blocked packets per second", + "type": "number" + }, + "passBps": { + "description": "Allowed traffic in bits per second", + "type": "number" + }, + "passPps": { + "description": "Allowed packets per second", + "type": "number" + }, + "timestamp": { "example": 1700000000000, "type": "integer" } + }, + "type": "object" + } + } + }, + "description": "Current traffic counters" + }, + "404": { + "description": "Service or IP not found, or the IP is not on the advanced firewall" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Live Traffic", + "tags": ["Firewall"] + }, + "parameters": [] + }, "/api/services/{id}/firewall/{ip}/rdns": { "delete": { "description": "Reset reverse DNS (rDNS) for a specific IP address on a Virtual or Dedicated Server", @@ -1372,7 +1597,7 @@ }, "/api/services/{id}/firewall/{ip}/stats": { "get": { - "description": "Get nShield statistics for a specific IP address on a Virtual or Dedicated Server", + "description": "Get the firewall traffic history for a specific IP address on a Virtual or Dedicated Server", "operationId": "firewallGetStatistics", "parameters": [ { @@ -1388,6 +1613,17 @@ "name": "ip", "required": true, "schema": { "example": "77.90.14.1", "type": "string" } + }, + { + "description": "Time window, for addresses on the advanced firewall only. Other addresses always return the last 7 days", + "in": "query", + "name": "range", + "required": false, + "schema": { + "default": "7d", + "enum": ["1h", "6h", "24h", "7d"], + "type": "string" + } } ], "responses": { @@ -1404,14 +1640,14 @@ "type": "integer" }, "totalDropTraffic": { - "description": "Total traffic that was dropped by the nShield", - "example": "2048576", - "type": "string" + "description": "Traffic that was dropped by the firewall, in bytes per second. Null where no data was recorded", + "example": 2048576, + "type": ["number", "null"] }, "totalPassTraffic": { - "description": "Total traffic that passed through the nShield", - "example": "10248576", - "type": "string" + "description": "Traffic that passed through the firewall, in bytes per second. Null where no data was recorded", + "example": 10248576, + "type": ["number", "null"] } }, "type": "object" @@ -1420,7 +1656,7 @@ } } }, - "description": "nShield statistics for the specified IP address" + "description": "Traffic history for the specified IP address, oldest first" }, "404": { "content": { @@ -1432,7 +1668,8 @@ } }, "description": "Service or IP not found" - } + }, + "502": { "description": "The advanced firewall could not be reached" } }, "security": [{ "personalAccessToken": [] }], "summary": "Get Statistics", @@ -1440,10 +1677,10 @@ }, "parameters": [] }, - "/api/services/{id}/mail/info": { + "/api/services/{id}/mail/aliases": { "get": { - "description": "Get information about a mail hosting service", - "operationId": "mailHostingGetInformation", + "description": "List the aliases (forwarding addresses) of a mail hosting service.", + "operationId": "mailHostingListAliases", "parameters": [ { "description": "Service ID", @@ -1460,99 +1697,501 @@ "schema": { "items": { "properties": { - "archiveYears": { - "properties": { - "number": { - "description": "Number of archived years", - "example": 0, - "type": "integer" - }, - "status": { - "description": "Status of archived years", - "enum": ["enabled", "disabled"], - "example": "disabled", - "type": "string" - } - }, - "type": "object" + "address": { + "example": "info@example.com", + "type": "string" }, - "disk": { + "displayName": { "example": "Info", "type": "string" }, + "features": { "properties": { - "limit": { - "description": "Disk limit in bytes", - "example": 524288000, - "type": "integer" + "allUsers": { + "example": false, + "type": "boolean" }, - "usage": { - "description": "Disk usage in bytes", - "example": 104857600, - "type": "integer" - } - }, - "type": "object" - }, - "dkim": { - "properties": { - "name": { - "description": "DKIM record name", - "example": "asdDjskladl2184._domainKey", - "type": "string" + "catchAll": { + "example": false, + "type": "boolean" }, - "status": { - "description": "Status of DKIM record verification", - "example": true, + "internalOnly": { + "example": false, "type": "boolean" }, - "type": { - "description": "DKIM record type", - "enum": ["TXT"], - "example": "MX", - "type": "string" + "sendFrom": { + "example": false, + "type": "boolean" }, - "value": { - "description": "DKIM record value", - "example": "mail.example.com.", - "type": "string" + "showInGal": { + "example": true, + "type": "boolean" } }, - "type": ["object", "null"] + "type": "object" }, - "dns": { - "items": { - "properties": { - "name": { - "description": "DNS record name", - "example": "mail.example.com", - "type": "string" - }, - "priority": { - "description": "DNS record priority", - "example": 10, - "type": "integer" - }, - "status": { - "description": "Status of DNS record verification", - "example": true, - "type": "boolean" - }, - "type": { - "description": "DNS record type", - "enum": ["MX", "CNAME", "TXT"], - "example": "MX", - "type": "string" - }, - "value": { - "description": "DNS record value", - "example": "mail.example.com.", - "type": "string" - } - }, - "type": "object" - }, + "targets": { + "example": ["john@example.com"], + "items": { "type": "string" }, "type": "array" }, - "domainAlias": { - "properties": { + "username": { "example": "info", "type": "string" } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Aliases" + }, + "404": { "description": "Mail Hosting not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "List Aliases", + "tags": ["Mail Hosting"] + }, + "parameters": [], + "post": { + "description": "Create an alias (forwarding address) on a mail hosting service. targets may be empty only when features.allUsers is true.", + "operationId": "mailHostingCreateAlias", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "displayName": { + "description": "Up to 100 characters", + "example": "Info", + "type": "string" + }, + "features": { + "description": "catchAll also receives mail sent to addresses that do not exist on the domain; showInGal lists the alias in the address book; internalOnly accepts mail only from senders on the domain; sendFrom lets the target mailboxes send as the alias; allUsers delivers to every mailbox on the domain", + "properties": { + "allUsers": { "example": false, "type": "boolean" }, + "catchAll": { "example": false, "type": "boolean" }, + "internalOnly": { "example": false, "type": "boolean" }, + "sendFrom": { "example": false, "type": "boolean" }, + "showInGal": { "example": true, "type": "boolean" } + }, + "type": "object" + }, + "targets": { + "example": ["john@example.com"], + "items": { "format": "email", "type": "string" }, + "maxItems": 100, + "type": "array" + }, + "username": { + "description": "The part before the @", + "example": "info", + "type": "string" + } + }, + "required": ["username", "targets"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Alias created" + }, + "400": { + "description": "Invalid body, or the mail server rejected the request" + }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Mail Hosting not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Create Alias", + "tags": ["Mail Hosting"] + } + }, + "/api/services/{id}/mail/aliases/{alias}": { + "delete": { + "description": "Delete an alias of a mail hosting service.", + "operationId": "mailHostingDeleteAlias", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Alias name, the part before the @", + "in": "path", + "name": "alias", + "required": true, + "schema": { "example": "info", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Alias deleted" + }, + "400": { "description": "The mail server rejected the request" }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Mail Hosting or alias not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Delete Alias", + "tags": ["Mail Hosting"] + }, + "parameters": [], + "put": { + "description": "Rename an alias or change its display name, targets or features. Send only the fields to change; targets replaces the whole list.", + "operationId": "mailHostingUpdateAlias", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Alias name, the part before the @", + "in": "path", + "name": "alias", + "required": true, + "schema": { "example": "info", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "displayName": { + "description": "Up to 100 characters", + "example": "Info", + "type": "string" + }, + "features": { + "description": "catchAll also receives mail sent to addresses that do not exist on the domain; showInGal lists the alias in the address book; internalOnly accepts mail only from senders on the domain; sendFrom lets the target mailboxes send as the alias; allUsers delivers to every mailbox on the domain", + "properties": { + "allUsers": { "example": false, "type": "boolean" }, + "catchAll": { "example": false, "type": "boolean" }, + "internalOnly": { "example": false, "type": "boolean" }, + "sendFrom": { "example": false, "type": "boolean" }, + "showInGal": { "example": true, "type": "boolean" } + }, + "type": "object" + }, + "targets": { + "example": ["john@example.com"], + "items": { "format": "email", "type": "string" }, + "maxItems": 100, + "type": "array" + }, + "username": { + "description": "New name, the part before the @", + "example": "hello", + "type": "string" + } + }, + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Alias updated" + }, + "400": { + "description": "Invalid body, or the mail server rejected the request" + }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Mail Hosting or alias not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Update Alias", + "tags": ["Mail Hosting"] + } + }, + "/api/services/{id}/mail/domain-aliases": { + "get": { + "description": "List the domains that receive mail for the mailboxes of a mail hosting service.", + "operationId": "mailHostingListDomainAliases", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "domain": { "example": "example.org", "type": "string" } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Domain aliases" + }, + "404": { "description": "Mail Hosting not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "List Domain Aliases", + "tags": ["Mail Hosting"] + }, + "parameters": [], + "post": { + "description": "Add a domain whose mail is delivered to the mailboxes with the same name: info@example.net reaches info@ the service domain. Give the added domain the same MX records as the service domain.", + "operationId": "mailHostingAddDomainAlias", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "domain": { "example": "example.net", "type": "string" } + }, + "required": ["domain"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Domain alias added" + }, + "400": { + "description": "Invalid body, or the mail server rejected the request" + }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Mail Hosting not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Add Domain Alias", + "tags": ["Mail Hosting"] + } + }, + "/api/services/{id}/mail/domain-aliases/{alias}": { + "delete": { + "description": "Stop receiving mail for a domain alias.", + "operationId": "mailHostingRemoveDomainAlias", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Domain alias", + "in": "path", + "name": "alias", + "required": true, + "schema": { "example": "example.net", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Domain alias removed" + }, + "400": { "description": "The mail server rejected the request" }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Mail Hosting or domain alias not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Remove Domain Alias", + "tags": ["Mail Hosting"] + }, + "parameters": [] + }, + "/api/services/{id}/mail/info": { + "get": { + "description": "Get information about a mail hosting service", + "operationId": "mailHostingGetInformation", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "archiveYears": { + "properties": { + "number": { + "description": "Number of archived years", + "example": 0, + "type": "integer" + }, + "status": { + "description": "Status of archived years", + "enum": ["enabled", "disabled"], + "example": "disabled", + "type": "string" + } + }, + "type": "object" + }, + "disk": { + "properties": { + "limit": { + "description": "Disk limit in bytes", + "example": 524288000, + "type": "integer" + }, + "usage": { + "description": "Disk usage in bytes", + "example": 104857600, + "type": "integer" + } + }, + "type": "object" + }, + "dkim": { + "properties": { + "name": { + "description": "DKIM record name", + "example": "asdDjskladl2184._domainKey", + "type": "string" + }, + "status": { + "description": "Status of DKIM record verification", + "example": true, + "type": "boolean" + }, + "type": { + "description": "DKIM record type", + "enum": ["TXT"], + "example": "MX", + "type": "string" + }, + "value": { + "description": "DKIM record value", + "example": "mail.example.com.", + "type": "string" + } + }, + "type": ["object", "null"] + }, + "dns": { + "items": { + "properties": { + "name": { + "description": "DNS record name", + "example": "mail.example.com", + "type": "string" + }, + "priority": { + "description": "DNS record priority", + "example": 10, + "type": "integer" + }, + "status": { + "description": "Status of DNS record verification", + "example": true, + "type": "boolean" + }, + "type": { + "description": "DNS record type", + "enum": ["MX", "CNAME", "TXT"], + "example": "MX", + "type": "string" + }, + "value": { + "description": "DNS record value", + "example": "mail.example.com.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "domainAlias": { + "properties": { "count": { "description": "Number of domain aliases", "example": 2, @@ -1571,19 +2210,36 @@ "example": true, "type": "boolean" }, + "hostname": { + "description": "Webmail hostname", + "example": "mail.example.com", + "type": "string" + }, + "mxFilter": { + "description": "Indicates if MXFilter spam filtering is enabled", + "example": true, + "type": "boolean" + }, "office": { "description": "Indicates if Office integration is enabled", "example": true, "type": "boolean" }, "spamExperts": { - "description": "Indicates if SpamExperts is enabled", + "deprecated": true, + "description": "Deprecated, same as mxFilter", "example": true, "type": "boolean" }, "status": { "description": "Current status of the mail hosting service", - "enum": ["active", "pending"], + "enum": [ + "pending", + "active", + "suspended", + "client_suspended", + "admin_suspended" + ], "example": "active", "type": "string" }, @@ -1636,29 +2292,426 @@ }, "type": "object" }, - "type": "array" + "type": "array" + } + } + }, + "description": "Information about the mail hosting service" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { "message": { "type": "string" } }, + "type": "object" + } + } + }, + "description": "Mail Hosting not found" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Information", + "tags": ["Mail Hosting"] + }, + "parameters": [] + }, + "/api/services/{id}/mail/refresh": { + "parameters": [], + "post": { + "description": "Ask the mail server to recount the disk usage and mailbox totals of a mail hosting service.", + "operationId": "mailHostingRefreshUsageStatistics", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Statistics refreshed" + }, + "404": { "description": "Mail Hosting not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Refresh Usage Statistics", + "tags": ["Mail Hosting"] + } + }, + "/api/services/{id}/mail/users": { + "get": { + "description": "List the mailboxes of a mail hosting service. diskLimit is the mailbox quota in MB (0 shares the domain quota); diskUsage is in MB and null for a mailbox without its own quota.", + "operationId": "mailHostingListMailboxes", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "address": { + "example": "john@example.com", + "type": "string" + }, + "admin": { "example": false, "type": "boolean" }, + "diskLimit": { "example": 0, "type": "integer" }, + "diskUsage": { + "example": 500.25, + "type": ["number", "null"] + }, + "displayName": { + "example": "John Doe", + "type": "string" + }, + "enabled": { "example": true, "type": "boolean" }, + "primaryAdmin": { "example": false, "type": "boolean" }, + "username": { "example": "john", "type": "string" } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Mailboxes" + }, + "404": { "description": "Mail Hosting not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "List Mailboxes", + "tags": ["Mail Hosting"] + }, + "parameters": [], + "post": { + "description": "Create a mailbox on a mail hosting service. diskLimit is the mailbox quota in MB; 0 shares the domain quota.", + "operationId": "mailHostingCreateMailbox", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "diskLimit": { + "default": 0, + "example": 0, + "maximum": 1048576, + "minimum": 0, + "type": "integer" + }, + "displayName": { + "description": "Up to 100 characters", + "example": "John Doe", + "type": "string" + }, + "enabled": { "default": true, "type": "boolean" }, + "password": { + "description": "8 to 128 characters", + "example": "correct-horse-battery", + "type": "string" + }, + "username": { + "description": "The part before the @", + "example": "john", + "type": "string" + } + }, + "required": ["username", "password"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Mailbox created" + }, + "400": { + "description": "Invalid body, or the mail server rejected the request" + }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Mail Hosting not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Create Mailbox", + "tags": ["Mail Hosting"] + } + }, + "/api/services/{id}/mail/users/{username}": { + "delete": { + "description": "Delete a mailbox and its mail. The primary administrator mailbox cannot be deleted.", + "operationId": "mailHostingDeleteMailbox", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Mailbox name, the part before the @", + "in": "path", + "name": "username", + "required": true, + "schema": { "example": "john", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" + } + } + }, + "description": "Mailbox deleted" + }, + "400": { "description": "The mail server rejected the request" }, + "403": { + "description": "Missing token scope or team permission, or the mailbox is the primary administrator" + }, + "404": { "description": "Mail Hosting or mailbox not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Delete Mailbox", + "tags": ["Mail Hosting"] + }, + "parameters": [], + "put": { + "description": "Change the display name, quota (MB, 0 shares the domain quota) or status of a mailbox. Send only the fields to change. The primary administrator mailbox cannot be disabled.", + "operationId": "mailHostingUpdateMailbox", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Mailbox name, the part before the @", + "in": "path", + "name": "username", + "required": true, + "schema": { "example": "john", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "diskLimit": { + "example": 2048, + "maximum": 1048576, + "minimum": 0, + "type": "integer" + }, + "displayName": { + "description": "Up to 100 characters", + "example": "John Doe", + "type": "string" + }, + "enabled": { "example": true, "type": "boolean" } + }, + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { "ok": { "example": true, "type": "boolean" } }, + "type": "object" } } }, - "description": "Information about the mail hosting service" + "description": "Mailbox updated" }, - "404": { + "400": { + "description": "Invalid body, or the mail server rejected the request" + }, + "403": { + "description": "Missing token scope or team permission, or the mailbox is the primary administrator" + }, + "404": { "description": "Mail Hosting or mailbox not found" }, + "502": { "description": "Mail server unavailable" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Update Mailbox", + "tags": ["Mail Hosting"] + } + }, + "/api/services/{id}/mail/users/{username}/password": { + "parameters": [], + "post": { + "description": "Set a new password for a mailbox. The primary administrator's password is the service password and cannot be changed here.", + "operationId": "mailHostingChangeMailboxPassword", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Mailbox name, the part before the @", + "in": "path", + "name": "username", + "required": true, + "schema": { "example": "john", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "password": { + "description": "8 to 128 characters", + "example": "correct-horse-battery", + "type": "string" + } + }, + "required": ["password"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { "content": { "application/json": { "schema": { - "properties": { "message": { "type": "string" } }, + "properties": { "ok": { "example": true, "type": "boolean" } }, "type": "object" } } }, - "description": "Mail Hosting not found" - } + "description": "Password changed" + }, + "400": { + "description": "Invalid body, or the mail server rejected the request" + }, + "403": { + "description": "Missing token scope or team permission, or the mailbox is the primary administrator" + }, + "404": { "description": "Mail Hosting or mailbox not found" }, + "502": { "description": "Mail server unavailable" } }, "security": [{ "personalAccessToken": [] }], - "summary": "Get Information", + "summary": "Change Mailbox Password", "tags": ["Mail Hosting"] - }, - "parameters": [] + } + }, + "/api/services/{id}/nickname": { + "parameters": [], + "put": { + "description": "Set the nickname shown for a service in the dashboard. An empty nickname removes it. Only the owner of the service can rename it.", + "operationId": "userRenameService", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "nickname": { + "description": "Up to 40 characters", + "example": "Game server", + "type": "string" + } + }, + "required": ["nickname"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "nickname": { + "example": "Game server", + "type": ["string", "null"] + } + }, + "type": "object" + } + } + }, + "description": "Nickname saved" + }, + "400": { "description": "Invalid body" }, + "403": { + "description": "Missing token scope, or the service is shared with you through a team" + }, + "404": { "description": "Service not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Rename Service", + "tags": ["User"] + } }, "/api/services/{id}/vps/action": { "parameters": [], @@ -1801,15 +2854,186 @@ } }, "security": [{ "personalAccessToken": [] }], - "summary": "Create Backup", + "summary": "Create Backup", + "tags": ["Virtual Server"] + } + }, + "/api/services/{id}/vps/backups/{file}/restore": { + "parameters": [], + "post": { + "description": "Restore a backup for the VPS", + "operationId": "virtualServerRestoreBackup", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Backup file name", + "in": "path", + "name": "file", + "required": true, + "schema": { + "example": "backup-pool:backup/vm/2702/2025-08-09T18:11:41Z", + "type": "string" + } + } + ], + "responses": { + "204": { "description": "VPS backup restore initiated successfully" }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { "message": { "type": "string" } }, + "type": "object" + } + } + }, + "description": "VPS not found" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Restore Backup", + "tags": ["Virtual Server"] + } + }, + "/api/services/{id}/vps/backups/daily-backups": { + "parameters": [], + "put": { + "description": "Change the daily backup status of a Virtual Server", + "operationId": "virtualServerChangeDailyBackupStatus", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "enabled": { + "description": "Whether daily backups are enabled", + "example": true, + "type": "boolean" + } + }, + "required": ["enabled"], + "type": "object" + } + } + }, + "description": "Daily backup configuration", + "required": true + }, + "responses": { + "204": { "description": "Daily backup status changed successfully" }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { "message": { "type": "string" } }, + "type": "object" + } + } + }, + "description": "VPS not found" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Change Daily Backup Status", + "tags": ["Virtual Server"] + } + }, + "/api/services/{id}/vps/boot-order": { + "get": { + "description": "Get the boot order of a Virtual Server. virtio0 is the disk; ide0 to ide2 are CD-ROM drives with an ISO in them.", + "operationId": "virtualServerGetBootOrder", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "example": ["ide2", "virtio0"], + "items": { + "enum": ["virtio0", "ide0", "ide1", "ide2"], + "type": "string" + }, + "type": "array" + } + } + }, + "description": "Boot devices, first to last" + }, + "404": { "description": "Virtual Server not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Boot Order", + "tags": ["Virtual Server"] + }, + "parameters": [], + "put": { + "description": "Set the boot order of a Virtual Server. Send the devices first to last; each must exist on the server. Changes apply once the server is shut down and started again; a reboot does not apply them.", + "operationId": "virtualServerUpdateBootOrder", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": ["ide2", "virtio0"], + "items": { + "enum": ["virtio0", "ide0", "ide1", "ide2"], + "type": "string" + }, + "maxItems": 4, + "minItems": 1, + "type": "array" + } + } + }, + "required": true + }, + "responses": { + "204": { "description": "Boot order saved" }, + "400": { "description": "Invalid body, or a device the server does not have" }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Virtual Server not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Update Boot Order", "tags": ["Virtual Server"] } }, - "/api/services/{id}/vps/backups/{file}/restore": { + "/api/services/{id}/vps/change-password": { "parameters": [], "post": { - "description": "Restore a backup for the VPS", - "operationId": "virtualServerRestoreBackup", + "description": "Change the password of a Virtual Server", + "operationId": "virtualServerChangePassword", "parameters": [ { "description": "Service ID", @@ -1817,20 +3041,34 @@ "name": "id", "required": true, "schema": { "example": "1", "type": "string" } - }, - { - "description": "Backup file name", - "in": "path", - "name": "file", - "required": true, - "schema": { - "example": "backup-pool:backup/vm/2702/2025-08-09T18:11:41Z", - "type": "string" - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "password": { + "description": "New password for the VPS", + "example": "StrongPassword123!", + "type": "string" + }, + "username": { + "description": "User whose password will be changed", + "example": "Administrator", + "type": "string" + } + }, + "required": ["username", "password"], + "type": "object" + } + } + }, + "description": "Change the password of a Virtual Server", + "required": true + }, "responses": { - "204": { "description": "VPS backup restore initiated successfully" }, + "204": { "description": "Password changed successfully" }, "404": { "content": { "application/json": { @@ -1844,15 +3082,14 @@ } }, "security": [{ "personalAccessToken": [] }], - "summary": "Restore Backup", + "summary": "Change Password", "tags": ["Virtual Server"] } }, - "/api/services/{id}/vps/backups/daily-backups": { - "parameters": [], - "put": { - "description": "Change the daily backup status of a Virtual Server", - "operationId": "virtualServerChangeDailyBackupStatus", + "/api/services/{id}/vps/custom-iso": { + "delete": { + "description": "Remove a custom ISO from a Virtual Server. Changes apply once the server is shut down and started again; a reboot does not apply them.", + "operationId": "virtualServerUnmountISO", "parameters": [ { "description": "Service ID", @@ -1866,45 +3103,112 @@ "content": { "application/json": { "schema": { - "properties": { - "enabled": { - "description": "Whether daily backups are enabled", - "example": true, - "type": "boolean" - } - }, - "required": ["enabled"], + "properties": { "isoId": { "format": "uuid", "type": "string" } }, + "required": ["isoId"], "type": "object" } } }, - "description": "Daily backup configuration", "required": true }, "responses": { - "204": { "description": "Daily backup status changed successfully" }, - "404": { + "204": { "description": "ISO unmounted" }, + "400": { "description": "Invalid body" }, + "403": { "description": "Missing token scope or team permission" }, + "404": { "description": "Virtual Server or ISO not found" }, + "409": { "description": "Another custom ISO operation is in progress" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Unmount ISO", + "tags": ["Virtual Server"] + }, + "get": { + "description": "List the custom ISOs mounted on a Virtual Server. pendingRemoval is true for an ISO that leaves once the server is shut down and started again. iso is null for an ISO that is not in your library.", + "operationId": "virtualServerGetMountedISOs", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { "content": { "application/json": { "schema": { - "properties": { "message": { "type": "string" } }, + "properties": { + "mounts": { + "items": { + "properties": { + "device": { + "example": "ide2", + "type": "string" + }, + "iso": { + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "example": "debian-13-netinst.iso", + "type": "string" + }, + "size": { + "description": "Bytes", + "example": 790626304, + "type": "integer" + }, + "status": { + "enum": [ + "UPLOADING", + "READY", + "FAILED", + "DELETING" + ], + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "pendingRemoval": { + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "type": "array" + } + }, "type": "object" } } }, - "description": "VPS not found" - } + "description": "Mounted ISOs" + }, + "404": { "description": "Virtual Server not found" }, + "409": { "description": "Another custom ISO operation is in progress" } }, "security": [{ "personalAccessToken": [] }], - "summary": "Change Daily Backup Status", + "summary": "Get Mounted ISOs", "tags": ["Virtual Server"] - } - }, - "/api/services/{id}/vps/change-password": { + }, "parameters": [], - "post": { - "description": "Change the password of a Virtual Server", - "operationId": "virtualServerChangePassword", + "put": { + "description": "Mount a READY ISO from your custom ISO library on a free CD-ROM drive of a Virtual Server. bootFirst puts that drive first in the boot order. Changes apply once the server is shut down and started again; a reboot does not apply them. Only the owner of the service can mount an ISO.", + "operationId": "virtualServerMountISO", "parameters": [ { "description": "Service ID", @@ -1919,41 +3223,42 @@ "application/json": { "schema": { "properties": { - "password": { - "description": "New password for the VPS", - "example": "StrongPassword123!", - "type": "string" - }, - "username": { - "description": "User whose password will be changed", - "example": "Administrator", - "type": "string" - } + "bootFirst": { "default": false, "type": "boolean" }, + "isoId": { "format": "uuid", "type": "string" } }, - "required": ["username", "password"], + "required": ["isoId"], "type": "object" } } }, - "description": "Change the password of a Virtual Server", "required": true }, "responses": { - "204": { "description": "Password changed successfully" }, - "404": { + "200": { "content": { "application/json": { "schema": { - "properties": { "message": { "type": "string" } }, + "properties": { + "device": { "example": "ide2", "type": "string" }, + "isoId": { "format": "uuid", "type": "string" } + }, "type": "object" } } }, - "description": "VPS not found" + "description": "ISO mounted" + }, + "400": { "description": "Invalid body" }, + "403": { + "description": "Missing token scope, or the service is shared with you through a team" + }, + "404": { "description": "Virtual Server or ISO not found" }, + "409": { + "description": "The ISO is not ready, no CD-ROM drive is free, or another custom ISO operation is in progress" } }, "security": [{ "personalAccessToken": [] }], - "summary": "Change Password", + "summary": "Mount ISO", "tags": ["Virtual Server"] } }, @@ -2080,6 +3385,11 @@ "example": 10737418240, "type": "integer" }, + "hasPendingChanges": { + "description": "Indicates if there are pending changes for the VPS. If true, the VPS may require a restart to apply changes.", + "example": false, + "type": "boolean" + }, "hostname": { "description": "Hostname of the VPS", "example": "vps.example.com", @@ -2284,7 +3594,186 @@ } }, "security": [{ "personalAccessToken": [] }], - "summary": "Reinstall", + "summary": "Reinstall", + "tags": ["Virtual Server"] + } + }, + "/api/services/{id}/vps/schedules": { + "get": { + "description": "List the scheduled power actions of a Virtual Server and its last 20 runs", + "operationId": "virtualServerGetPowerSchedules", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { "description": "Schedules and recent runs" }, + "404": { "description": "VPS not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Power Schedules", + "tags": ["Virtual Server"] + }, + "parameters": [], + "post": { + "description": "Schedule a power action (START, SHUTDOWN, REBOOT or STOP) on a Virtual Server. mode WEEKLY takes days (1 = Monday) and minute after midnight, INTERVAL takes intervalHours and minute past the hour, ONCE takes runAt, CRON takes a five-field cron expression. Power actions on one server, across all its enabled schedules, must be at least 15 minutes apart.", + "operationId": "virtualServerCreatePowerSchedule", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action": { + "enum": ["START", "SHUTDOWN", "REBOOT", "STOP"], + "type": "string" + }, + "cron": { "example": "0 4 * * 1-5", "type": "string" }, + "days": { + "items": { "maximum": 7, "minimum": 1, "type": "integer" }, + "type": "array" + }, + "enabled": { "default": true, "type": "boolean" }, + "forceAfterMinutes": { + "enum": [5, 10, 15, 30], + "type": "integer" + }, + "intervalHours": { + "enum": [1, 2, 3, 4, 6, 8, 12], + "type": "integer" + }, + "minute": { "maximum": 1439, "minimum": 0, "type": "integer" }, + "mode": { + "enum": ["WEEKLY", "INTERVAL", "ONCE", "CRON"], + "type": "string" + }, + "name": { + "description": "Optional label, up to 60 characters", + "type": "string" + }, + "runAt": { "format": "date-time", "type": "string" }, + "timezone": { "example": "Europe/Istanbul", "type": "string" } + }, + "required": ["action", "mode", "timezone"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { "description": "The created schedule" }, + "400": { + "description": "Invalid rule, runs too close together or the limit of 10 schedules reached" + }, + "404": { "description": "VPS not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Create Power Schedule", + "tags": ["Virtual Server"] + } + }, + "/api/services/{id}/vps/schedules/{scheduleId}": { + "delete": { + "description": "Delete a power schedule; its past runs stay in the history", + "operationId": "virtualServerDeletePowerSchedule", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Schedule ID", + "in": "path", + "name": "scheduleId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "204": { "description": "Deleted" }, + "404": { "description": "VPS or schedule not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Delete Power Schedule", + "tags": ["Virtual Server"] + }, + "parameters": [], + "patch": { + "description": "Replace a power schedule with a new rule (same body as creating one) or send only { enabled }", + "operationId": "virtualServerUpdatePowerSchedule", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Schedule ID", + "in": "path", + "name": "scheduleId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "description": "The updated schedule" }, + "400": { "description": "Invalid rule" }, + "404": { "description": "VPS or schedule not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Update Power Schedule", + "tags": ["Virtual Server"] + } + }, + "/api/services/{id}/vps/schedules/{scheduleId}/run": { + "parameters": [], + "post": { + "description": "Run a power schedule once right away. Skipped when the server is already in the target state or busy. At most 3 runs per minute per service.", + "operationId": "virtualServerRunPowerScheduleNow", + "parameters": [ + { + "description": "Service ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + }, + { + "description": "Schedule ID", + "in": "path", + "name": "scheduleId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "The run result: { status: SUCCESS | SKIPPED | FAILED, reason? }" + }, + "404": { "description": "VPS or schedule not found" }, + "429": { "description": "Too many manual runs" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Run Power Schedule Now", "tags": ["Virtual Server"] } }, @@ -2483,6 +3972,11 @@ "description": "Promo code", "example": "PROMOCODE", "type": ["string", "null"] + }, + "teamId": { + "description": "A team you are an active member of to share the new service with. Teams set to share new services automatically get it either way.", + "example": 12, + "type": ["number", "null"] } }, "type": "object" @@ -2502,23 +3996,408 @@ "type": "integer" } }, - "type": "object" + "type": "object" + } + } + }, + "description": "The new invoice ID" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Add Order", + "tags": ["Billing"] + } + }, + "/api/store/groups": { + "get": { + "description": "Get all products groups", + "operationId": "billingGetStoreGroups", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "id": { + "description": "Group ID", + "example": 14, + "type": "number" + }, + "name": { + "description": "Group Name", + "example": "Sanal Sunucu (Ryzen 9 9950x)", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Store Groups" + } + }, + "security": [], + "summary": "Get Store Groups", + "tags": ["Billing"] + }, + "parameters": [] + }, + "/api/teams": { + "get": { + "description": "List the teams you belong to and the teams that invited you. Invitations waiting for your answer come first and carry awaitingApproval: true without membership details.", + "operationId": "teamsListTeams", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "accessExpiresAt": { + "format": "date-time", + "type": ["string", "null"] + }, + "autoShare": { "example": false, "type": "boolean" }, + "awaitingApproval": { + "example": false, + "type": "boolean" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { "example": 1, "type": "integer" }, + "memberCount": { "example": 3, "type": "integer" }, + "name": { "example": "Acme", "type": "string" }, + "sharedServicesCount": { + "example": 4, + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Teams" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "List Teams", + "tags": ["Teams"] + }, + "parameters": [] + }, + "/api/teams/{id}": { + "get": { + "description": "Get a team you are an active member of, with your role and permissions. pendingRequestCount counts open approval requests and is 0 for members.", + "operationId": "teamsGetTeam", + "parameters": [ + { + "description": "Team ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "accessExpiresAt": { + "format": "date-time", + "type": ["string", "null"] + }, + "autoShare": { "example": false, "type": "boolean" }, + "id": { "example": 1, "type": "integer" }, + "memberCount": { "example": 3, "type": "integer" }, + "name": { "example": "Acme", "type": "string" }, + "pendingRequestCount": { "example": 0, "type": "integer" }, + "permissions": { + "description": "Team permission bitfield: 1 power, 2 console, 4 backups, 8 reinstall, 16 firewall, 32 panel login, 64 reinstall with approval, 128 backups with approval. Owners and admins have every permission.", + "example": 255, + "type": "integer" + }, + "role": { + "enum": ["OWNER", "ADMIN", "MEMBER"], + "type": "string" + }, + "serviceCount": { "example": 4, "type": "integer" } + }, + "type": "object" + } + } + }, + "description": "Team" + }, + "404": { "description": "Team not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Team", + "tags": ["Teams"] + }, + "parameters": [] + }, + "/api/teams/{id}/logs": { + "get": { + "description": "Get the activity log of a team, newest first, with the names of the people it mentions. Only owners and admins can read it.", + "operationId": "teamsGetTeamLogs", + "parameters": [ + { + "description": "Team ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "logs": { + "items": { + "properties": { + "action": { + "example": "SHARE_SERVICES", + "type": "string" + }, + "clientId": { + "example": 1234, + "type": "integer" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { "example": 42, "type": "integer" }, + "metadata": { "type": ["object", "null"] } + }, + "type": "object" + }, + "type": "array" + }, + "members": { + "items": { + "properties": { + "clientId": { + "example": 1234, + "type": "integer" + }, + "fullName": { + "example": "John Doe", + "type": "string" + }, + "memberId": { + "example": 7, + "type": ["integer", "null"] + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Team logs" + }, + "404": { "description": "Team not found, or you are not an owner or admin" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Team Logs", + "tags": ["Teams"] + }, + "parameters": [] + }, + "/api/teams/{id}/members": { + "get": { + "description": "List the members of a team. Owners and admins also see pending members and open invitations (kind: invite). Times are Unix timestamps in milliseconds.", + "operationId": "teamsListTeamMembers", + "parameters": [ + { + "description": "Team ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "accessDays": { + "description": "Access length an invitation grants", + "type": ["integer", "null"] + }, + "accessExpiresAt": { "type": ["integer", "null"] }, + "allServices": { "example": true, "type": "boolean" }, + "autoShare": { + "description": "Only on your own row", + "type": "boolean" + }, + "clientId": { + "example": 1234, + "type": ["integer", "null"] + }, + "email": { + "example": "john@example.com", + "type": "string" + }, + "expiresAt": { + "description": "When a pending invitation expires", + "type": ["integer", "null"] + }, + "fullName": { + "example": "John Doe", + "type": ["string", "null"] + }, + "id": { "example": 7, "type": "integer" }, + "kind": { + "enum": ["member", "invite"], + "type": "string" + }, + "permissions": { + "description": "Team permission bitfield: 1 power, 2 console, 4 backups, 8 reinstall, 16 firewall, 32 panel login, 64 reinstall with approval, 128 backups with approval. Owners and admins have every permission.", + "example": 3, + "type": "integer" + }, + "role": { + "enum": ["OWNER", "ADMIN", "MEMBER"], + "type": "string" + }, + "serviceIds": { + "items": { "type": "integer" }, + "type": "array" + }, + "servicePermissions": { + "additionalProperties": { "type": "integer" }, + "description": "Per-service permission overrides keyed by service ID", + "type": "object" + }, + "status": { + "enum": ["ACTIVE", "PENDING"], + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "Members and invitations" + }, + "404": { "description": "Team not found" } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "List Team Members", + "tags": ["Teams"] + }, + "parameters": [] + }, + "/api/teams/{id}/requests": { + "get": { + "description": "List the reinstall and backup restore requests of a team: open ones first, then the decisions of the last 30 days (at most 100). Only owners and admins can read them.", + "operationId": "teamsListApprovalRequests", + "parameters": [ + { + "description": "Team ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "action": { + "enum": ["REINSTALL", "RESTORE_BACKUP"], + "type": "string" + }, + "approvedUntil": { + "format": "date-time", + "type": ["string", "null"] + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "decidedAt": { + "format": "date-time", + "type": ["string", "null"] + }, + "decidedBy": { "type": ["string", "null"] }, + "details": { "type": "object" }, + "id": { "example": 5, "type": "integer" }, + "requestedBy": { + "example": "John Doe", + "type": ["string", "null"] + }, + "serviceId": { "example": 1, "type": "integer" }, + "state": { + "enum": [ + "PENDING", + "APPROVED", + "REJECTED", + "CANCELLED", + "USED", + "EXPIRED" + ], + "type": "string" + } + }, + "type": "object" + }, + "type": "array" } } }, - "description": "The new invoice ID" - } + "description": "Approval requests" + }, + "404": { "description": "Team not found, or you are not an owner or admin" } }, "security": [{ "personalAccessToken": [] }], - "summary": "Add Order", - "tags": ["Billing"] - } + "summary": "List Approval Requests", + "tags": ["Teams"] + }, + "parameters": [] }, - "/api/store/groups": { + "/api/teams/{id}/services": { "get": { - "description": "Get all products groups", - "operationId": "billingGetStoreGroups", - "parameters": [], + "description": "List the services shared with a team that you can see. mine is true for services you shared.", + "operationId": "teamsListTeamServices", + "parameters": [ + { + "description": "Team ID", + "in": "path", + "name": "id", + "required": true, + "schema": { "example": "1", "type": "string" } + } + ], "responses": { "200": { "content": { @@ -2526,15 +4405,12 @@ "schema": { "items": { "properties": { - "id": { - "description": "Group ID", - "example": 14, - "type": "number" - }, - "name": { - "description": "Group Name", - "example": "Sanal Sunucu (Ryzen 9 9950x)", - "type": "string" + "mine": { "example": true, "type": "boolean" }, + "serviceId": { "example": 1, "type": "integer" }, + "sharedAt": { "format": "date-time", "type": "string" }, + "sharedBy": { + "example": "John Doe", + "type": ["string", "null"] } }, "type": "object" @@ -2543,12 +4419,13 @@ } } }, - "description": "Store Groups" - } + "description": "Shared services" + }, + "404": { "description": "Team not found" } }, - "security": [], - "summary": "Get Store Groups", - "tags": ["Billing"] + "security": [{ "personalAccessToken": [] }], + "summary": "List Team Services", + "tags": ["Teams"] }, "parameters": [] }, @@ -2699,6 +4576,121 @@ }, "parameters": [] }, + "/api/users/@me/autopay-statuses": { + "get": { + "description": "Whether automatic payment is on for each active service, keyed by service ID.", + "operationId": "billingGetAutoPayStatuses", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { "type": "boolean" }, + "example": { "1": true, "2": false }, + "type": "object" + } + } + }, + "description": "Auto-Pay status per service" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Auto-Pay Statuses", + "tags": ["Billing"] + }, + "parameters": [] + }, + "/api/users/@me/custom-isos": { + "get": { + "description": "List the ISOs uploaded to your custom ISO library, the Virtual Servers each one is mounted on, and the storage quota in bytes. Upload ISOs from the dashboard.", + "operationId": "virtualServerGetCustomISOLibrary", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "isos": { + "items": { + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { "format": "uuid", "type": "string" }, + "mounts": { + "items": { + "properties": { + "device": { + "example": "ide2", + "type": "string" + }, + "serviceId": { + "example": 1, + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "name": { + "example": "debian-13-netinst.iso", + "type": "string" + }, + "size": { + "description": "Bytes", + "example": 790626304, + "type": "integer" + }, + "status": { + "enum": [ + "UPLOADING", + "READY", + "FAILED", + "DELETING" + ], + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "quota": { + "properties": { + "available": { + "example": 15315501056, + "type": "integer" + }, + "limit": { + "example": 16106127360, + "type": "integer" + }, + "used": { "example": 790626304, "type": "integer" } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "Custom ISO library" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Get Custom ISO Library", + "tags": ["Virtual Server"] + }, + "parameters": [] + }, "/api/users/@me/invoices": { "get": { "description": "Get the current user invoices", @@ -3001,6 +4993,133 @@ "tags": ["Billing"] } }, + "/api/users/@me/invoices/bulk/balance": { + "parameters": [], + "post": { + "description": "Pay several invoices from the account balance. expectedTotal must equal the total returned by the preview.", + "operationId": "billingBulkPayWithBalance", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "expectedTotal": { "example": 40, "type": "number" }, + "invoiceIds": { + "example": [1, 2, 3], + "items": { "type": "integer" }, + "type": "array" + } + }, + "required": ["invoiceIds", "expectedTotal"], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "results": { + "items": { + "properties": { + "amount": { "example": 40, "type": "number" }, + "invoiceId": { + "example": 1, + "type": "integer" + }, + "status": { + "enum": ["paid", "failed"], + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Result per invoice" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Bulk Pay With Balance", + "tags": ["Billing"] + } + }, + "/api/users/@me/invoices/bulk/preview": { + "parameters": [], + "post": { + "description": "Get what is still due on several invoices before paying them together", + "operationId": "billingPreviewBulkPayment", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "invoiceIds": { + "example": [1, 2, 3], + "items": { "type": "integer" }, + "type": "array" + } + }, + "required": ["invoiceIds"], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "balance": { "example": 100, "type": "number" }, + "invoices": { + "items": { + "properties": { + "amount": { "example": 40, "type": "number" }, + "dueDate": { + "example": "2026-10-20", + "type": "string" + }, + "id": { "example": 1, "type": "integer" }, + "isAddFunds": { + "example": false, + "type": "boolean" + }, + "total": { "example": 50, "type": "number" } + }, + "type": "object" + }, + "type": "array" + }, + "total": { "example": 40, "type": "number" }, + "unavailable": { + "items": { "type": "integer" }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Payable invoices with the amount still due, invoices that cannot be paid, and the balance" + } + }, + "security": [{ "personalAccessToken": [] }], + "summary": "Preview Bulk Payment", + "tags": ["Billing"] + } + }, "/api/users/@me/referral": { "get": { "description": "Get the current user referral code", @@ -3017,6 +5136,82 @@ "example": "cmdvq1hjm000008kvmkkk4gb6", "type": "string" }, + "pending": { + "description": "Rewards earned but still waiting for the refund window or a review", + "example": 23.32, + "type": "number" + }, + "program": { + "description": "Terms of the referral program new invitees join", + "properties": { + "holdDays": { + "description": "Days a reward waits", + "example": 14, + "type": "integer" + }, + "invoices": { + "description": "Invoices that earn a reward", + "example": 3, + "type": "integer" + }, + "rate": { + "description": "Reward in percent", + "example": 10, + "type": "number" + }, + "version": { "example": 2, "type": "integer" }, + "welcomeDiscount": { + "description": "One-time first order discount of the invitee, in percent", + "example": 10, + "type": ["number", "null"] + } + }, + "type": "object" + }, + "rewards": { + "description": "Reward history, newest first; never names the invitee", + "items": { + "properties": { + "amount": { + "example": 23.32, + "type": "number" + }, + "currency": { + "example": "TRY", + "type": "string" + }, + "date": { + "example": 1700000000000, + "type": "integer" + }, + "dueAt": { + "example": 1703000000000, + "type": ["integer", "null"] + }, + "reason": { + "enum": ["refunded", "left", null], + "type": ["string", "null"] + }, + "sequence": { + "example": 1, + "type": ["integer", "null"] + }, + "status": { + "enum": [ + "credited", + "pending", + "review", + "rejected", + "void", + "reversed" + ], + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, "uses": { "properties": { "count": { @@ -3183,6 +5378,7 @@ { "name": "Dedicated Server" }, { "name": "Firewall" }, { "name": "Mail Hosting" }, + { "name": "Teams" }, { "name": "User" }, { "name": "Virtual Server" } ] diff --git a/src/generated/facade.gen.ts b/src/generated/facade.gen.ts index 1a1615a..decc2d9 100644 --- a/src/generated/facade.gen.ts +++ b/src/generated/facade.gen.ts @@ -6,6 +6,8 @@ import { userGetHelpRequests, userGetHelpRequest, userGetServices, + billingGetAutoPaySettings, + billingUpdateAutoPaySettings, dedicatedServerPerformAction, dedicatedServerGetHardwareComponents, dedicatedServerGetInformation, @@ -16,31 +18,66 @@ import { firewallGetAttackLogs, firewallGetAttackNotificationSettings, firewallUpdateAttackNotificationSettings, + firewallGetLiveTraffic, firewallResetReverseDns, firewallGetReverseDns, firewallUpsertReverseDns, firewallGetRules, firewallDeleteRule, firewallGetStatistics, + mailHostingListAliases, + mailHostingCreateAlias, + mailHostingDeleteAlias, + mailHostingUpdateAlias, + mailHostingListDomainAliases, + mailHostingAddDomainAlias, + mailHostingRemoveDomainAlias, mailHostingGetInformation, + mailHostingRefreshUsageStatistics, + mailHostingListMailboxes, + mailHostingCreateMailbox, + mailHostingDeleteMailbox, + mailHostingUpdateMailbox, + mailHostingChangeMailboxPassword, + userRenameService, virtualServerPerformAction, virtualServerGetBackups, virtualServerCreateBackup, virtualServerRestoreBackup, virtualServerChangeDailyBackupStatus, + virtualServerGetBootOrder, + virtualServerUpdateBootOrder, virtualServerChangePassword, + virtualServerUnmountIso, + virtualServerGetMountedIsos, + virtualServerMountIso, virtualServerGetGraphs, virtualServerGetInformation, virtualServerGetOsTemplates, virtualServerReinstall, + virtualServerGetPowerSchedules, + virtualServerCreatePowerSchedule, + virtualServerDeletePowerSchedule, + virtualServerUpdatePowerSchedule, + virtualServerRunPowerScheduleNow, virtualServerGetTasks, billingGetProductsByGroupId, billingAddOrder, billingGetStoreGroups, + teamsListTeams, + teamsGetTeam, + teamsGetTeamLogs, + teamsListTeamMembers, + teamsListApprovalRequests, + teamsListTeamServices, userGetCurrentUser, + billingGetAutoPayStatuses, + virtualServerGetCustomIsoLibrary, userGetInvoices, userGetInvoice, billingMakePayment, + billingBulkPayWithBalance, + billingPreviewBulkPayment, userGetReferralCode, userGetSessions, billingGetPaymentMethods, @@ -49,6 +86,8 @@ import type { UserGetHelpRequestsData, UserGetHelpRequestData, UserGetServicesData, + BillingGetAutoPaySettingsData, + BillingUpdateAutoPaySettingsData, DedicatedServerPerformActionData, DedicatedServerGetHardwareComponentsData, DedicatedServerGetInformationData, @@ -59,31 +98,66 @@ import type { FirewallGetAttackLogsData, FirewallGetAttackNotificationSettingsData, FirewallUpdateAttackNotificationSettingsData, + FirewallGetLiveTrafficData, FirewallResetReverseDnsData, FirewallGetReverseDnsData, FirewallUpsertReverseDnsData, FirewallGetRulesData, FirewallDeleteRuleData, FirewallGetStatisticsData, + MailHostingListAliasesData, + MailHostingCreateAliasData, + MailHostingDeleteAliasData, + MailHostingUpdateAliasData, + MailHostingListDomainAliasesData, + MailHostingAddDomainAliasData, + MailHostingRemoveDomainAliasData, MailHostingGetInformationData, + MailHostingRefreshUsageStatisticsData, + MailHostingListMailboxesData, + MailHostingCreateMailboxData, + MailHostingDeleteMailboxData, + MailHostingUpdateMailboxData, + MailHostingChangeMailboxPasswordData, + UserRenameServiceData, VirtualServerPerformActionData, VirtualServerGetBackupsData, VirtualServerCreateBackupData, VirtualServerRestoreBackupData, VirtualServerChangeDailyBackupStatusData, + VirtualServerGetBootOrderData, + VirtualServerUpdateBootOrderData, VirtualServerChangePasswordData, + VirtualServerUnmountIsoData, + VirtualServerGetMountedIsosData, + VirtualServerMountIsoData, VirtualServerGetGraphsData, VirtualServerGetInformationData, VirtualServerGetOsTemplatesData, VirtualServerReinstallData, + VirtualServerGetPowerSchedulesData, + VirtualServerCreatePowerScheduleData, + VirtualServerDeletePowerScheduleData, + VirtualServerUpdatePowerScheduleData, + VirtualServerRunPowerScheduleNowData, VirtualServerGetTasksData, BillingGetProductsByGroupIdData, BillingAddOrderData, BillingGetStoreGroupsData, + TeamsListTeamsData, + TeamsGetTeamData, + TeamsGetTeamLogsData, + TeamsListTeamMembersData, + TeamsListApprovalRequestsData, + TeamsListTeamServicesData, UserGetCurrentUserData, + BillingGetAutoPayStatusesData, + VirtualServerGetCustomIsoLibraryData, UserGetInvoicesData, UserGetInvoiceData, BillingMakePaymentData, + BillingBulkPayWithBalanceData, + BillingPreviewBulkPaymentData, UserGetReferralCodeData, UserGetSessionsData, BillingGetPaymentMethodsData, @@ -127,6 +201,19 @@ export class UserClient { }); } + public renameService( + id: UserRenameServiceData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return userRenameService({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + public getCurrentUser( options?: FacadeOptions, ): ReturnType> { @@ -175,6 +262,121 @@ export class UserClient { } } +export class BillingClient { + public constructor(private readonly client: NodestyClient) {} + + public getAutoPaySettings( + id: BillingGetAutoPaySettingsData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return billingGetAutoPaySettings({ + ...options, + client: this.client, + path: { id }, + }); + } + + public updateAutoPaySettings( + id: BillingUpdateAutoPaySettingsData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return billingUpdateAutoPaySettings({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public getProductsByGroupId( + groupId: BillingGetProductsByGroupIdData['path']['groupId'], + options?: FacadeOptions, + ): ReturnType> { + return billingGetProductsByGroupId({ + ...options, + client: this.client, + path: { groupId }, + }); + } + + public addOrder( + groupId: BillingAddOrderData['path']['groupId'], + productId: BillingAddOrderData['path']['productId'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return billingAddOrder({ + ...options, + client: this.client, + path: { groupId, productId }, + body: data, + }); + } + + public getStoreGroups( + options?: FacadeOptions, + ): ReturnType> { + return billingGetStoreGroups({ + ...options, + client: this.client, + }); + } + + public getAutoPayStatuses( + options?: FacadeOptions, + ): ReturnType> { + return billingGetAutoPayStatuses({ + ...options, + client: this.client, + }); + } + + public makePayment( + id: BillingMakePaymentData['path']['id'], + data?: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return billingMakePayment({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public bulkPayWithBalance( + data?: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return billingBulkPayWithBalance({ + ...options, + client: this.client, + body: data, + }); + } + + public previewBulkPayment( + data?: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return billingPreviewBulkPayment({ + ...options, + client: this.client, + body: data, + }); + } + + public getPaymentMethods( + options?: FacadeOptions, + ): ReturnType> { + return billingGetPaymentMethods({ + ...options, + client: this.client, + }); + } +} + export class DedicatedServerClient { public constructor(private readonly client: NodestyClient) {} @@ -301,6 +503,18 @@ export class FirewallClient { }); } + public getLiveTraffic( + id: FirewallGetLiveTrafficData['path']['id'], + ip: FirewallGetLiveTrafficData['path']['ip'], + options?: FacadeOptions, + ): ReturnType> { + return firewallGetLiveTraffic({ + ...options, + client: this.client, + path: { id, ip }, + }); + } + public resetReverseDns( id: FirewallResetReverseDnsData['path']['id'], ip: FirewallResetReverseDnsData['path']['ip'], @@ -380,6 +594,92 @@ export class FirewallClient { export class MailHostingClient { public constructor(private readonly client: NodestyClient) {} + public listAliases( + id: MailHostingListAliasesData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingListAliases({ + ...options, + client: this.client, + path: { id }, + }); + } + + public createAlias( + id: MailHostingCreateAliasData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return mailHostingCreateAlias({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public deleteAlias( + id: MailHostingDeleteAliasData['path']['id'], + alias: MailHostingDeleteAliasData['path']['alias'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingDeleteAlias({ + ...options, + client: this.client, + path: { id, alias }, + }); + } + + public updateAlias( + id: MailHostingUpdateAliasData['path']['id'], + alias: MailHostingUpdateAliasData['path']['alias'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return mailHostingUpdateAlias({ + ...options, + client: this.client, + path: { id, alias }, + body: data, + }); + } + + public listDomainAliases( + id: MailHostingListDomainAliasesData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingListDomainAliases({ + ...options, + client: this.client, + path: { id }, + }); + } + + public addDomainAlias( + id: MailHostingAddDomainAliasData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return mailHostingAddDomainAlias({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public removeDomainAlias( + id: MailHostingRemoveDomainAliasData['path']['id'], + alias: MailHostingRemoveDomainAliasData['path']['alias'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingRemoveDomainAlias({ + ...options, + client: this.client, + path: { id, alias }, + }); + } + public getInformation( id: MailHostingGetInformationData['path']['id'], options?: FacadeOptions, @@ -390,6 +690,81 @@ export class MailHostingClient { path: { id }, }); } + + public refreshUsageStatistics( + id: MailHostingRefreshUsageStatisticsData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingRefreshUsageStatistics({ + ...options, + client: this.client, + path: { id }, + }); + } + + public listMailboxes( + id: MailHostingListMailboxesData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingListMailboxes({ + ...options, + client: this.client, + path: { id }, + }); + } + + public createMailbox( + id: MailHostingCreateMailboxData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return mailHostingCreateMailbox({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public deleteMailbox( + id: MailHostingDeleteMailboxData['path']['id'], + username: MailHostingDeleteMailboxData['path']['username'], + options?: FacadeOptions, + ): ReturnType> { + return mailHostingDeleteMailbox({ + ...options, + client: this.client, + path: { id, username }, + }); + } + + public updateMailbox( + id: MailHostingUpdateMailboxData['path']['id'], + username: MailHostingUpdateMailboxData['path']['username'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return mailHostingUpdateMailbox({ + ...options, + client: this.client, + path: { id, username }, + body: data, + }); + } + + public changeMailboxPassword( + id: MailHostingChangeMailboxPasswordData['path']['id'], + username: MailHostingChangeMailboxPasswordData['path']['username'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return mailHostingChangeMailboxPassword({ + ...options, + client: this.client, + path: { id, username }, + body: data, + }); + } } export class VirtualServerClient { @@ -455,6 +830,30 @@ export class VirtualServerClient { }); } + public getBootOrder( + id: VirtualServerGetBootOrderData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return virtualServerGetBootOrder({ + ...options, + client: this.client, + path: { id }, + }); + } + + public updateBootOrder( + id: VirtualServerUpdateBootOrderData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return virtualServerUpdateBootOrder({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + public changePassword( id: VirtualServerChangePasswordData['path']['id'], data: NonNullable, @@ -468,6 +867,43 @@ export class VirtualServerClient { }); } + public unmountIso( + id: VirtualServerUnmountIsoData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return virtualServerUnmountIso({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public getMountedIsos( + id: VirtualServerGetMountedIsosData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return virtualServerGetMountedIsos({ + ...options, + client: this.client, + path: { id }, + }); + } + + public mountIso( + id: VirtualServerMountIsoData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return virtualServerMountIso({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + public getGraphs( id: VirtualServerGetGraphsData['path']['id'], options?: FacadeOptions, @@ -514,6 +950,66 @@ export class VirtualServerClient { }); } + public getPowerSchedules( + id: VirtualServerGetPowerSchedulesData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return virtualServerGetPowerSchedules({ + ...options, + client: this.client, + path: { id }, + }); + } + + public createPowerSchedule( + id: VirtualServerCreatePowerScheduleData['path']['id'], + data: NonNullable, + options?: FacadeOptions, + ): ReturnType> { + return virtualServerCreatePowerSchedule({ + ...options, + client: this.client, + path: { id }, + body: data, + }); + } + + public deletePowerSchedule( + id: VirtualServerDeletePowerScheduleData['path']['id'], + scheduleId: VirtualServerDeletePowerScheduleData['path']['scheduleId'], + options?: FacadeOptions, + ): ReturnType> { + return virtualServerDeletePowerSchedule({ + ...options, + client: this.client, + path: { id, scheduleId }, + }); + } + + public updatePowerSchedule( + id: VirtualServerUpdatePowerScheduleData['path']['id'], + scheduleId: VirtualServerUpdatePowerScheduleData['path']['scheduleId'], + options?: FacadeOptions, + ): ReturnType> { + return virtualServerUpdatePowerSchedule({ + ...options, + client: this.client, + path: { id, scheduleId }, + }); + } + + public runPowerScheduleNow( + id: VirtualServerRunPowerScheduleNowData['path']['id'], + scheduleId: VirtualServerRunPowerScheduleNowData['path']['scheduleId'], + options?: FacadeOptions, + ): ReturnType> { + return virtualServerRunPowerScheduleNow({ + ...options, + client: this.client, + path: { id, scheduleId }, + }); + } + public getTasks( id: VirtualServerGetTasksData['path']['id'], options?: FacadeOptions, @@ -524,82 +1020,101 @@ export class VirtualServerClient { path: { id }, }); } + + public getCustomIsoLibrary( + options?: FacadeOptions, + ): ReturnType> { + return virtualServerGetCustomIsoLibrary({ + ...options, + client: this.client, + }); + } } -export class BillingClient { +export class TeamsClient { public constructor(private readonly client: NodestyClient) {} - public getProductsByGroupId( - groupId: BillingGetProductsByGroupIdData['path']['groupId'], - options?: FacadeOptions, - ): ReturnType> { - return billingGetProductsByGroupId({ + public listTeams( + options?: FacadeOptions, + ): ReturnType> { + return teamsListTeams({ ...options, client: this.client, - path: { groupId }, }); } - public addOrder( - groupId: BillingAddOrderData['path']['groupId'], - productId: BillingAddOrderData['path']['productId'], - data: NonNullable, - options?: FacadeOptions, - ): ReturnType> { - return billingAddOrder({ + public getTeam( + id: TeamsGetTeamData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return teamsGetTeam({ ...options, client: this.client, - path: { groupId, productId }, - body: data, + path: { id }, }); } - public getStoreGroups( - options?: FacadeOptions, - ): ReturnType> { - return billingGetStoreGroups({ + public getTeamLogs( + id: TeamsGetTeamLogsData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return teamsGetTeamLogs({ ...options, client: this.client, + path: { id }, }); } - public makePayment( - id: BillingMakePaymentData['path']['id'], - data?: NonNullable, - options?: FacadeOptions, - ): ReturnType> { - return billingMakePayment({ + public listTeamMembers( + id: TeamsListTeamMembersData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return teamsListTeamMembers({ ...options, client: this.client, path: { id }, - body: data, }); } - public getPaymentMethods( - options?: FacadeOptions, - ): ReturnType> { - return billingGetPaymentMethods({ + public listApprovalRequests( + id: TeamsListApprovalRequestsData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return teamsListApprovalRequests({ + ...options, + client: this.client, + path: { id }, + }); + } + + public listTeamServices( + id: TeamsListTeamServicesData['path']['id'], + options?: FacadeOptions, + ): ReturnType> { + return teamsListTeamServices({ ...options, client: this.client, + path: { id }, }); } } export class GeneratedNodestyApiClient { public readonly user: UserClient; + public readonly billing: BillingClient; public readonly dedicatedServer: DedicatedServerClient; public readonly firewall: FirewallClient; public readonly mailHosting: MailHostingClient; public readonly virtualServer: VirtualServerClient; - public readonly billing: BillingClient; + public readonly teams: TeamsClient; public constructor(public readonly client: NodestyClient) { this.user = new UserClient(client); + this.billing = new BillingClient(client); this.dedicatedServer = new DedicatedServerClient(client); this.firewall = new FirewallClient(client); this.mailHosting = new MailHostingClient(client); this.virtualServer = new VirtualServerClient(client); - this.billing = new BillingClient(client); + this.teams = new TeamsClient(client); } } diff --git a/src/generated/sdk.gen.ts b/src/generated/sdk.gen.ts index 26a4a35..b912de0 100644 --- a/src/generated/sdk.gen.ts +++ b/src/generated/sdk.gen.ts @@ -8,6 +8,12 @@ import type { UserGetHelpRequestResponses, UserGetServicesData, UserGetServicesResponses, + BillingGetAutoPaySettingsData, + BillingGetAutoPaySettingsResponses, + BillingGetAutoPaySettingsErrors, + BillingUpdateAutoPaySettingsData, + BillingUpdateAutoPaySettingsResponses, + BillingUpdateAutoPaySettingsErrors, DedicatedServerPerformActionData, DedicatedServerPerformActionResponses, DedicatedServerPerformActionErrors, @@ -38,6 +44,9 @@ import type { FirewallUpdateAttackNotificationSettingsData, FirewallUpdateAttackNotificationSettingsResponses, FirewallUpdateAttackNotificationSettingsErrors, + FirewallGetLiveTrafficData, + FirewallGetLiveTrafficResponses, + FirewallGetLiveTrafficErrors, FirewallResetReverseDnsData, FirewallResetReverseDnsResponses, FirewallResetReverseDnsErrors, @@ -56,9 +65,51 @@ import type { FirewallGetStatisticsData, FirewallGetStatisticsResponses, FirewallGetStatisticsErrors, + MailHostingListAliasesData, + MailHostingListAliasesResponses, + MailHostingListAliasesErrors, + MailHostingCreateAliasData, + MailHostingCreateAliasResponses, + MailHostingCreateAliasErrors, + MailHostingDeleteAliasData, + MailHostingDeleteAliasResponses, + MailHostingDeleteAliasErrors, + MailHostingUpdateAliasData, + MailHostingUpdateAliasResponses, + MailHostingUpdateAliasErrors, + MailHostingListDomainAliasesData, + MailHostingListDomainAliasesResponses, + MailHostingListDomainAliasesErrors, + MailHostingAddDomainAliasData, + MailHostingAddDomainAliasResponses, + MailHostingAddDomainAliasErrors, + MailHostingRemoveDomainAliasData, + MailHostingRemoveDomainAliasResponses, + MailHostingRemoveDomainAliasErrors, MailHostingGetInformationData, MailHostingGetInformationResponses, MailHostingGetInformationErrors, + MailHostingRefreshUsageStatisticsData, + MailHostingRefreshUsageStatisticsResponses, + MailHostingRefreshUsageStatisticsErrors, + MailHostingListMailboxesData, + MailHostingListMailboxesResponses, + MailHostingListMailboxesErrors, + MailHostingCreateMailboxData, + MailHostingCreateMailboxResponses, + MailHostingCreateMailboxErrors, + MailHostingDeleteMailboxData, + MailHostingDeleteMailboxResponses, + MailHostingDeleteMailboxErrors, + MailHostingUpdateMailboxData, + MailHostingUpdateMailboxResponses, + MailHostingUpdateMailboxErrors, + MailHostingChangeMailboxPasswordData, + MailHostingChangeMailboxPasswordResponses, + MailHostingChangeMailboxPasswordErrors, + UserRenameServiceData, + UserRenameServiceResponses, + UserRenameServiceErrors, VirtualServerPerformActionData, VirtualServerPerformActionResponses, VirtualServerPerformActionErrors, @@ -74,9 +125,24 @@ import type { VirtualServerChangeDailyBackupStatusData, VirtualServerChangeDailyBackupStatusResponses, VirtualServerChangeDailyBackupStatusErrors, + VirtualServerGetBootOrderData, + VirtualServerGetBootOrderResponses, + VirtualServerGetBootOrderErrors, + VirtualServerUpdateBootOrderData, + VirtualServerUpdateBootOrderResponses, + VirtualServerUpdateBootOrderErrors, VirtualServerChangePasswordData, VirtualServerChangePasswordResponses, VirtualServerChangePasswordErrors, + VirtualServerUnmountIsoData, + VirtualServerUnmountIsoResponses, + VirtualServerUnmountIsoErrors, + VirtualServerGetMountedIsosData, + VirtualServerGetMountedIsosResponses, + VirtualServerGetMountedIsosErrors, + VirtualServerMountIsoData, + VirtualServerMountIsoResponses, + VirtualServerMountIsoErrors, VirtualServerGetGraphsData, VirtualServerGetGraphsResponses, VirtualServerGetGraphsErrors, @@ -89,6 +155,21 @@ import type { VirtualServerReinstallData, VirtualServerReinstallResponses, VirtualServerReinstallErrors, + VirtualServerGetPowerSchedulesData, + VirtualServerGetPowerSchedulesResponses, + VirtualServerGetPowerSchedulesErrors, + VirtualServerCreatePowerScheduleData, + VirtualServerCreatePowerScheduleResponses, + VirtualServerCreatePowerScheduleErrors, + VirtualServerDeletePowerScheduleData, + VirtualServerDeletePowerScheduleResponses, + VirtualServerDeletePowerScheduleErrors, + VirtualServerUpdatePowerScheduleData, + VirtualServerUpdatePowerScheduleResponses, + VirtualServerUpdatePowerScheduleErrors, + VirtualServerRunPowerScheduleNowData, + VirtualServerRunPowerScheduleNowResponses, + VirtualServerRunPowerScheduleNowErrors, VirtualServerGetTasksData, VirtualServerGetTasksResponses, VirtualServerGetTasksErrors, @@ -98,8 +179,29 @@ import type { BillingAddOrderResponses, BillingGetStoreGroupsData, BillingGetStoreGroupsResponses, + TeamsListTeamsData, + TeamsListTeamsResponses, + TeamsGetTeamData, + TeamsGetTeamResponses, + TeamsGetTeamErrors, + TeamsGetTeamLogsData, + TeamsGetTeamLogsResponses, + TeamsGetTeamLogsErrors, + TeamsListTeamMembersData, + TeamsListTeamMembersResponses, + TeamsListTeamMembersErrors, + TeamsListApprovalRequestsData, + TeamsListApprovalRequestsResponses, + TeamsListApprovalRequestsErrors, + TeamsListTeamServicesData, + TeamsListTeamServicesResponses, + TeamsListTeamServicesErrors, UserGetCurrentUserData, UserGetCurrentUserResponses, + BillingGetAutoPayStatusesData, + BillingGetAutoPayStatusesResponses, + VirtualServerGetCustomIsoLibraryData, + VirtualServerGetCustomIsoLibraryResponses, UserGetInvoicesData, UserGetInvoicesResponses, UserGetInvoiceData, @@ -107,6 +209,10 @@ import type { BillingMakePaymentData, BillingMakePaymentResponses, BillingMakePaymentErrors, + BillingBulkPayWithBalanceData, + BillingBulkPayWithBalanceResponses, + BillingPreviewBulkPaymentData, + BillingPreviewBulkPaymentResponses, UserGetReferralCodeData, UserGetReferralCodeResponses, UserGetSessionsData, @@ -201,6 +307,58 @@ export const userGetServices = ( }); }; +/** + * Get Auto-Pay Settings + * Get the automatic payment settings of an active service and the payment attempts made for it. + */ +export const billingGetAutoPaySettings = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + BillingGetAutoPaySettingsResponses, + BillingGetAutoPaySettingsErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/autopay', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Update Auto-Pay Settings + * Turn automatic payment on or off for an active service. daysBeforeDue is how many days before the due date the invoice is paid. CARD and FIRST_AVAILABLE need a saved card; FIRST_AVAILABLE tries the account balance first, then the cards. + */ +export const billingUpdateAutoPaySettings = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).put< + BillingUpdateAutoPaySettingsResponses, + BillingUpdateAutoPaySettingsErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/autopay', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + /** * Perform Action * Perform an action on a dedicated server @@ -453,6 +611,30 @@ export const firewallUpdateAttackNotificationSettings = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + FirewallGetLiveTrafficResponses, + FirewallGetLiveTrafficErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/firewall/{ip}/metrics', + ...options, + responseStyle: 'fields', + }); +}; + /** * Reset Reverse DNS * Reset reverse DNS (rDNS) for a specific IP address on a Virtual or Dedicated Server @@ -579,7 +761,7 @@ export const firewallDeleteRule = ( /** * Get Statistics - * Get nShield statistics for a specific IP address on a Virtual or Dedicated Server + * Get the firewall traffic history for a specific IP address on a Virtual or Dedicated Server */ export const firewallGetStatistics = ( options: Options, @@ -602,15 +784,15 @@ export const firewallGetStatistics = ( }; /** - * Get Information - * Get information about a mail hosting service + * List Aliases + * List the aliases (forwarding addresses) of a mail hosting service. */ -export const mailHostingGetInformation = ( - options: Options, +export const mailHostingListAliases = ( + options: Options, ) => { return (options.client ?? _heyApiClient).get< - MailHostingGetInformationResponses, - MailHostingGetInformationErrors, + MailHostingListAliasesResponses, + MailHostingListAliasesErrors, ThrowOnError >({ security: [ @@ -619,22 +801,22 @@ export const mailHostingGetInformation = ( type: 'apiKey', }, ], - url: '/api/services/{id}/mail/info', + url: '/api/services/{id}/mail/aliases', ...options, responseStyle: 'fields', }); }; /** - * Perform Action - * Perform an action on a Virtual Server + * Create Alias + * Create an alias (forwarding address) on a mail hosting service. targets may be empty only when features.allUsers is true. */ -export const virtualServerPerformAction = ( - options: Options, +export const mailHostingCreateAlias = ( + options: Options, ) => { return (options.client ?? _heyApiClient).post< - VirtualServerPerformActionResponses, - VirtualServerPerformActionErrors, + MailHostingCreateAliasResponses, + MailHostingCreateAliasErrors, ThrowOnError >({ security: [ @@ -643,7 +825,7 @@ export const virtualServerPerformAction = type: 'apiKey', }, ], - url: '/api/services/{id}/vps/action', + url: '/api/services/{id}/mail/aliases', ...options, responseStyle: 'fields', headers: { @@ -654,15 +836,15 @@ export const virtualServerPerformAction = }; /** - * Get Backups - * Get VPS backups + * Delete Alias + * Delete an alias of a mail hosting service. */ -export const virtualServerGetBackups = ( - options: Options, +export const mailHostingDeleteAlias = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - VirtualServerGetBackupsResponses, - VirtualServerGetBackupsErrors, + return (options.client ?? _heyApiClient).delete< + MailHostingDeleteAliasResponses, + MailHostingDeleteAliasErrors, ThrowOnError >({ security: [ @@ -671,22 +853,22 @@ export const virtualServerGetBackups = ( type: 'apiKey', }, ], - url: '/api/services/{id}/vps/backups', + url: '/api/services/{id}/mail/aliases/{alias}', ...options, responseStyle: 'fields', }); }; /** - * Create Backup - * Create a new backup for the VPS + * Update Alias + * Rename an alias or change its display name, targets or features. Send only the fields to change; targets replaces the whole list. */ -export const virtualServerCreateBackup = ( - options: Options, +export const mailHostingUpdateAlias = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).post< - VirtualServerCreateBackupResponses, - VirtualServerCreateBackupErrors, + return (options.client ?? _heyApiClient).put< + MailHostingUpdateAliasResponses, + MailHostingUpdateAliasErrors, ThrowOnError >({ security: [ @@ -695,22 +877,26 @@ export const virtualServerCreateBackup = ( type: 'apiKey', }, ], - url: '/api/services/{id}/vps/backups', + url: '/api/services/{id}/mail/aliases/{alias}', ...options, responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, }); }; /** - * Restore Backup - * Restore a backup for the VPS + * List Domain Aliases + * List the domains that receive mail for the mailboxes of a mail hosting service. */ -export const virtualServerRestoreBackup = ( - options: Options, +export const mailHostingListDomainAliases = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).post< - VirtualServerRestoreBackupResponses, - VirtualServerRestoreBackupErrors, + return (options.client ?? _heyApiClient).get< + MailHostingListDomainAliasesResponses, + MailHostingListDomainAliasesErrors, ThrowOnError >({ security: [ @@ -719,22 +905,22 @@ export const virtualServerRestoreBackup = type: 'apiKey', }, ], - url: '/api/services/{id}/vps/backups/{file}/restore', + url: '/api/services/{id}/mail/domain-aliases', ...options, responseStyle: 'fields', }); }; /** - * Change Daily Backup Status - * Change the daily backup status of a Virtual Server + * Add Domain Alias + * Add a domain whose mail is delivered to the mailboxes with the same name: info@example.net reaches info@ the service domain. Give the added domain the same MX records as the service domain. */ -export const virtualServerChangeDailyBackupStatus = ( - options: Options, +export const mailHostingAddDomainAlias = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).put< - VirtualServerChangeDailyBackupStatusResponses, - VirtualServerChangeDailyBackupStatusErrors, + return (options.client ?? _heyApiClient).post< + MailHostingAddDomainAliasResponses, + MailHostingAddDomainAliasErrors, ThrowOnError >({ security: [ @@ -743,7 +929,7 @@ export const virtualServerChangeDailyBackupStatus = ( - options: Options, +export const mailHostingRemoveDomainAlias = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).post< - VirtualServerChangePasswordResponses, - VirtualServerChangePasswordErrors, + return (options.client ?? _heyApiClient).delete< + MailHostingRemoveDomainAliasResponses, + MailHostingRemoveDomainAliasErrors, ThrowOnError >({ security: [ @@ -771,26 +957,22 @@ export const virtualServerChangePassword = ( - options: Options, +export const mailHostingGetInformation = ( + options: Options, ) => { return (options.client ?? _heyApiClient).get< - VirtualServerGetGraphsResponses, - VirtualServerGetGraphsErrors, + MailHostingGetInformationResponses, + MailHostingGetInformationErrors, ThrowOnError >({ security: [ @@ -799,22 +981,22 @@ export const virtualServerGetGraphs = ( type: 'apiKey', }, ], - url: '/api/services/{id}/vps/graphs', + url: '/api/services/{id}/mail/info', ...options, responseStyle: 'fields', }); }; /** - * Get Information - * Get information about a Virtual Server + * Refresh Usage Statistics + * Ask the mail server to recount the disk usage and mailbox totals of a mail hosting service. */ -export const virtualServerGetInformation = ( - options: Options, +export const mailHostingRefreshUsageStatistics = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - VirtualServerGetInformationResponses, - VirtualServerGetInformationErrors, + return (options.client ?? _heyApiClient).post< + MailHostingRefreshUsageStatisticsResponses, + MailHostingRefreshUsageStatisticsErrors, ThrowOnError >({ security: [ @@ -823,22 +1005,22 @@ export const virtualServerGetInformation = ( - options: Options, +export const mailHostingListMailboxes = ( + options: Options, ) => { return (options.client ?? _heyApiClient).get< - VirtualServerGetOsTemplatesResponses, - VirtualServerGetOsTemplatesErrors, + MailHostingListMailboxesResponses, + MailHostingListMailboxesErrors, ThrowOnError >({ security: [ @@ -847,22 +1029,22 @@ export const virtualServerGetOsTemplates = ( - options: Options, +export const mailHostingCreateMailbox = ( + options: Options, ) => { return (options.client ?? _heyApiClient).post< - VirtualServerReinstallResponses, - VirtualServerReinstallErrors, + MailHostingCreateMailboxResponses, + MailHostingCreateMailboxErrors, ThrowOnError >({ security: [ @@ -871,7 +1053,7 @@ export const virtualServerReinstall = ( type: 'apiKey', }, ], - url: '/api/services/{id}/vps/reinstall', + url: '/api/services/{id}/mail/users', ...options, responseStyle: 'fields', headers: { @@ -882,15 +1064,15 @@ export const virtualServerReinstall = ( }; /** - * Get Tasks - * Get VPS tasks + * Delete Mailbox + * Delete a mailbox and its mail. The primary administrator mailbox cannot be deleted. */ -export const virtualServerGetTasks = ( - options: Options, +export const mailHostingDeleteMailbox = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - VirtualServerGetTasksResponses, - VirtualServerGetTasksErrors, + return (options.client ?? _heyApiClient).delete< + MailHostingDeleteMailboxResponses, + MailHostingDeleteMailboxErrors, ThrowOnError >({ security: [ @@ -899,22 +1081,22 @@ export const virtualServerGetTasks = ( type: 'apiKey', }, ], - url: '/api/services/{id}/vps/tasks', + url: '/api/services/{id}/mail/users/{username}', ...options, responseStyle: 'fields', }); }; /** - * Get Products by Group ID - * Get all products by group ID + * Update Mailbox + * Change the display name, quota (MB, 0 shares the domain quota) or status of a mailbox. Send only the fields to change. The primary administrator mailbox cannot be disabled. */ -export const billingGetProductsByGroupId = ( - options: Options, +export const mailHostingUpdateMailbox = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - BillingGetProductsByGroupIdResponses, - unknown, + return (options.client ?? _heyApiClient).put< + MailHostingUpdateMailboxResponses, + MailHostingUpdateMailboxErrors, ThrowOnError >({ security: [ @@ -923,27 +1105,35 @@ export const billingGetProductsByGroupId = ( - options: Options, +export const mailHostingChangeMailboxPassword = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).post({ + return (options.client ?? _heyApiClient).post< + MailHostingChangeMailboxPasswordResponses, + MailHostingChangeMailboxPasswordErrors, + ThrowOnError + >({ security: [ { name: 'Authorization', type: 'apiKey', }, ], - url: '/api/store/{groupId}/{productId}/order', + url: '/api/services/{id}/mail/users/{username}/password', ...options, responseStyle: 'fields', headers: { @@ -954,33 +1144,43 @@ export const billingAddOrder = ( }; /** - * Get Store Groups - * Get all products groups + * Rename Service + * Set the nickname shown for a service in the dashboard. An empty nickname removes it. Only the owner of the service can rename it. */ -export const billingGetStoreGroups = ( - options?: Options, +export const userRenameService = ( + options: Options, ) => { - return (options?.client ?? _heyApiClient).get< - BillingGetStoreGroupsResponses, - unknown, + return (options.client ?? _heyApiClient).put< + UserRenameServiceResponses, + UserRenameServiceErrors, ThrowOnError >({ - url: '/api/store/groups', + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/nickname', ...options, responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, }); }; /** - * Get Current User - * Get the current user information + * Perform Action + * Perform an action on a Virtual Server */ -export const userGetCurrentUser = ( - options?: Options, +export const virtualServerPerformAction = ( + options: Options, ) => { - return (options?.client ?? _heyApiClient).get< - UserGetCurrentUserResponses, - unknown, + return (options.client ?? _heyApiClient).post< + VirtualServerPerformActionResponses, + VirtualServerPerformActionErrors, ThrowOnError >({ security: [ @@ -989,41 +1189,831 @@ export const userGetCurrentUser = ( type: 'apiKey', }, ], - url: '/api/users/@me', + url: '/api/services/{id}/vps/action', ...options, responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, }); }; /** - * Get Invoices - * Get the current user invoices + * Get Backups + * Get VPS backups */ -export const userGetInvoices = ( - options?: Options, +export const virtualServerGetBackups = ( + options: Options, ) => { - return (options?.client ?? _heyApiClient).get({ + return (options.client ?? _heyApiClient).get< + VirtualServerGetBackupsResponses, + VirtualServerGetBackupsErrors, + ThrowOnError + >({ security: [ { name: 'Authorization', type: 'apiKey', }, ], - url: '/api/users/@me/invoices', + url: '/api/services/{id}/vps/backups', ...options, responseStyle: 'fields', }); }; /** - * Get Invoice - * Get the current user invoice by ID + * Create Backup + * Create a new backup for the VPS */ -export const userGetInvoice = ( - options: Options, +export const virtualServerCreateBackup = ( + options: Options, ) => { - return (options.client ?? _heyApiClient).get({ - security: [ + return (options.client ?? _heyApiClient).post< + VirtualServerCreateBackupResponses, + VirtualServerCreateBackupErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/backups', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Restore Backup + * Restore a backup for the VPS + */ +export const virtualServerRestoreBackup = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + VirtualServerRestoreBackupResponses, + VirtualServerRestoreBackupErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/backups/{file}/restore', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Change Daily Backup Status + * Change the daily backup status of a Virtual Server + */ +export const virtualServerChangeDailyBackupStatus = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).put< + VirtualServerChangeDailyBackupStatusResponses, + VirtualServerChangeDailyBackupStatusErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/backups/daily-backups', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Get Boot Order + * Get the boot order of a Virtual Server. virtio0 is the disk; ide0 to ide2 are CD-ROM drives with an ISO in them. + */ +export const virtualServerGetBootOrder = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetBootOrderResponses, + VirtualServerGetBootOrderErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/boot-order', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Update Boot Order + * Set the boot order of a Virtual Server. Send the devices first to last; each must exist on the server. Changes apply once the server is shut down and started again; a reboot does not apply them. + */ +export const virtualServerUpdateBootOrder = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).put< + VirtualServerUpdateBootOrderResponses, + VirtualServerUpdateBootOrderErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/boot-order', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Change Password + * Change the password of a Virtual Server + */ +export const virtualServerChangePassword = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + VirtualServerChangePasswordResponses, + VirtualServerChangePasswordErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/change-password', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Unmount ISO + * Remove a custom ISO from a Virtual Server. Changes apply once the server is shut down and started again; a reboot does not apply them. + */ +export const virtualServerUnmountIso = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).delete< + VirtualServerUnmountIsoResponses, + VirtualServerUnmountIsoErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/custom-iso', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Get Mounted ISOs + * List the custom ISOs mounted on a Virtual Server. pendingRemoval is true for an ISO that leaves once the server is shut down and started again. iso is null for an ISO that is not in your library. + */ +export const virtualServerGetMountedIsos = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetMountedIsosResponses, + VirtualServerGetMountedIsosErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/custom-iso', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Mount ISO + * Mount a READY ISO from your custom ISO library on a free CD-ROM drive of a Virtual Server. bootFirst puts that drive first in the boot order. Changes apply once the server is shut down and started again; a reboot does not apply them. Only the owner of the service can mount an ISO. + */ +export const virtualServerMountIso = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).put< + VirtualServerMountIsoResponses, + VirtualServerMountIsoErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/custom-iso', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Get Graphs + * Get VPS usage statistics graphs + */ +export const virtualServerGetGraphs = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetGraphsResponses, + VirtualServerGetGraphsErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/graphs', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Information + * Get information about a Virtual Server + */ +export const virtualServerGetInformation = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetInformationResponses, + VirtualServerGetInformationErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/info', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get OS Templates + * Get available OS templates for a Virtual Server + */ +export const virtualServerGetOsTemplates = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetOsTemplatesResponses, + VirtualServerGetOsTemplatesErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/os-templates', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Reinstall + * Reinstall a Virtual Server with a new OS + */ +export const virtualServerReinstall = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + VirtualServerReinstallResponses, + VirtualServerReinstallErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/reinstall', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Get Power Schedules + * List the scheduled power actions of a Virtual Server and its last 20 runs + */ +export const virtualServerGetPowerSchedules = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetPowerSchedulesResponses, + VirtualServerGetPowerSchedulesErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/schedules', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Create Power Schedule + * Schedule a power action (START, SHUTDOWN, REBOOT or STOP) on a Virtual Server. mode WEEKLY takes days (1 = Monday) and minute after midnight, INTERVAL takes intervalHours and minute past the hour, ONCE takes runAt, CRON takes a five-field cron expression. Power actions on one server, across all its enabled schedules, must be at least 15 minutes apart. + */ +export const virtualServerCreatePowerSchedule = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + VirtualServerCreatePowerScheduleResponses, + VirtualServerCreatePowerScheduleErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/schedules', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Delete Power Schedule + * Delete a power schedule; its past runs stay in the history + */ +export const virtualServerDeletePowerSchedule = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).delete< + VirtualServerDeletePowerScheduleResponses, + VirtualServerDeletePowerScheduleErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/schedules/{scheduleId}', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Update Power Schedule + * Replace a power schedule with a new rule (same body as creating one) or send only { enabled } + */ +export const virtualServerUpdatePowerSchedule = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).patch< + VirtualServerUpdatePowerScheduleResponses, + VirtualServerUpdatePowerScheduleErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/schedules/{scheduleId}', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Run Power Schedule Now + * Run a power schedule once right away. Skipped when the server is already in the target state or busy. At most 3 runs per minute per service. + */ +export const virtualServerRunPowerScheduleNow = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + VirtualServerRunPowerScheduleNowResponses, + VirtualServerRunPowerScheduleNowErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/schedules/{scheduleId}/run', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Tasks + * Get VPS tasks + */ +export const virtualServerGetTasks = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + VirtualServerGetTasksResponses, + VirtualServerGetTasksErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/services/{id}/vps/tasks', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Products by Group ID + * Get all products by group ID + */ +export const billingGetProductsByGroupId = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + BillingGetProductsByGroupIdResponses, + unknown, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/store/{groupId}', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Add Order + * Add a new order + */ +export const billingAddOrder = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).post({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/store/{groupId}/{productId}/order', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); +}; + +/** + * Get Store Groups + * Get all products groups + */ +export const billingGetStoreGroups = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + BillingGetStoreGroupsResponses, + unknown, + ThrowOnError + >({ + url: '/api/store/groups', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * List Teams + * List the teams you belong to and the teams that invited you. Invitations waiting for your answer come first and carry awaitingApproval: true without membership details. + */ +export const teamsListTeams = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/teams', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Team + * Get a team you are an active member of, with your role and permissions. pendingRequestCount counts open approval requests and is 0 for members. + */ +export const teamsGetTeam = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + TeamsGetTeamResponses, + TeamsGetTeamErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/teams/{id}', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Team Logs + * Get the activity log of a team, newest first, with the names of the people it mentions. Only owners and admins can read it. + */ +export const teamsGetTeamLogs = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + TeamsGetTeamLogsResponses, + TeamsGetTeamLogsErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/teams/{id}/logs', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * List Team Members + * List the members of a team. Owners and admins also see pending members and open invitations (kind: invite). Times are Unix timestamps in milliseconds. + */ +export const teamsListTeamMembers = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + TeamsListTeamMembersResponses, + TeamsListTeamMembersErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/teams/{id}/members', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * List Approval Requests + * List the reinstall and backup restore requests of a team: open ones first, then the decisions of the last 30 days (at most 100). Only owners and admins can read them. + */ +export const teamsListApprovalRequests = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + TeamsListApprovalRequestsResponses, + TeamsListApprovalRequestsErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/teams/{id}/requests', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * List Team Services + * List the services shared with a team that you can see. mine is true for services you shared. + */ +export const teamsListTeamServices = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + TeamsListTeamServicesResponses, + TeamsListTeamServicesErrors, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/teams/{id}/services', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Current User + * Get the current user information + */ +export const userGetCurrentUser = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + UserGetCurrentUserResponses, + unknown, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/users/@me', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Auto-Pay Statuses + * Whether automatic payment is on for each active service, keyed by service ID. + */ +export const billingGetAutoPayStatuses = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + BillingGetAutoPayStatusesResponses, + unknown, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/users/@me/autopay-statuses', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Custom ISO Library + * List the ISOs uploaded to your custom ISO library, the Virtual Servers each one is mounted on, and the storage quota in bytes. Upload ISOs from the dashboard. + */ +export const virtualServerGetCustomIsoLibrary = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + VirtualServerGetCustomIsoLibraryResponses, + unknown, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/users/@me/custom-isos', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Invoices + * Get the current user invoices + */ +export const userGetInvoices = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/users/@me/invoices', + ...options, + responseStyle: 'fields', + }); +}; + +/** + * Get Invoice + * Get the current user invoice by ID + */ +export const userGetInvoice = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get({ + security: [ { name: 'Authorization', type: 'apiKey', @@ -1063,6 +2053,62 @@ export const billingMakePayment = ( }); }; +/** + * Bulk Pay With Balance + * Pay several invoices from the account balance. expectedTotal must equal the total returned by the preview. + */ +export const billingBulkPayWithBalance = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).post< + BillingBulkPayWithBalanceResponses, + unknown, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/users/@me/invoices/bulk/balance', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options?.headers, + }, + }); +}; + +/** + * Preview Bulk Payment + * Get what is still due on several invoices before paying them together + */ +export const billingPreviewBulkPayment = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).post< + BillingPreviewBulkPaymentResponses, + unknown, + ThrowOnError + >({ + security: [ + { + name: 'Authorization', + type: 'apiKey', + }, + ], + url: '/api/users/@me/invoices/bulk/preview', + ...options, + responseStyle: 'fields', + headers: { + 'Content-Type': 'application/json', + ...options?.headers, + }, + }); +}; + /** * Get Referral Code * Get the current user referral code diff --git a/src/generated/types.gen.ts b/src/generated/types.gen.ts index 76061b0..41c9847 100644 --- a/src/generated/types.gen.ts +++ b/src/generated/types.gen.ts @@ -231,14 +231,22 @@ export type UserGetServicesResponses = { * Unix timestamp of the next due date for payment */ nextDueDate?: number; + /** + * Name the service owner gave the service + */ + nickname?: string | null; /** * Indicates if the current user is the owner of the service */ owner?: boolean; /** - * Password associated with the service + * Password associated with the service; empty on a team service when your team permissions do not include panel login (hosting) or reinstall (servers) */ password?: string | null; + /** + * What the current user may do on a service shared by a team, as a bit field: 1 power, 2 console, 4 backups, 8 reinstall and passwords, 16 firewall, 32 panel login, 64 reinstall after a team owner or admin approves a request, 128 take backups and restore one after approval. Your own services have the first six bits (63). + */ + permissions?: number; /** * Product ID associated with the service */ @@ -267,9 +275,13 @@ export type UserGetServicesResponses = { */ suspensionReason?: string | null; /** - * Team ID if the service is associated with a team, otherwise null + * The first team the service is shared with, otherwise null; see teamIds */ teamId?: number | null; + /** + * Every team of yours the service is shared with + */ + teamIds?: Array; /** * Username associated with the service */ @@ -283,6 +295,85 @@ export type UserGetServicesResponses = { export type UserGetServicesResponse = UserGetServicesResponses[keyof UserGetServicesResponses]; +export type BillingGetAutoPaySettingsData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/autopay'; +}; + +export type BillingGetAutoPaySettingsErrors = { + /** + * Service not found + */ + 404: unknown; +}; + +export type BillingGetAutoPaySettingsResponses = { + /** + * Auto-Pay settings + */ + 200: { + daysBeforeDue?: number; + enabled?: boolean; + logs?: Array<{ + amount?: number; + createdAt?: string; + currency?: string; + errorMessage?: string | null; + invoiceId?: number; + paymentMethodUsed?: 'CARD' | 'BALANCE' | 'FIRST_AVAILABLE'; + status?: 'SUCCESS' | 'FAILED' | 'CHARGED_BUT_SYNC_FAILED'; + }>; + paymentMethod?: 'CARD' | 'BALANCE' | 'FIRST_AVAILABLE'; + }; +}; + +export type BillingGetAutoPaySettingsResponse = + BillingGetAutoPaySettingsResponses[keyof BillingGetAutoPaySettingsResponses]; + +export type BillingUpdateAutoPaySettingsData = { + body: { + daysBeforeDue?: number; + enabled: boolean; + paymentMethod?: 'CARD' | 'BALANCE' | 'FIRST_AVAILABLE'; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/autopay'; +}; + +export type BillingUpdateAutoPaySettingsErrors = { + /** + * Invalid body, or no saved card for a card payment method + */ + 400: unknown; + /** + * Service not found + */ + 404: unknown; +}; + +export type BillingUpdateAutoPaySettingsResponses = { + /** + * Auto-Pay settings saved + */ + 204: void; +}; + +export type BillingUpdateAutoPaySettingsResponse = + BillingUpdateAutoPaySettingsResponses[keyof BillingUpdateAutoPaySettingsResponses]; + export type DedicatedServerPerformActionData = { /** * Action to perform on the dedicated server @@ -677,6 +768,10 @@ export type FirewallGetAttackLogsResponses = { * Peak traffic during the attack */ peak?: number; + /** + * Peak packets per second, where the protection reports it + */ + peakPps?: number; /** * Timestamp when the attack started */ @@ -732,6 +827,10 @@ export type FirewallGetAttackNotificationSettingsResponses = { * Whether email notifications are enabled for attack alerts */ emailNotification?: boolean; + /** + * Whether attacks appear in the dashboard notification center + */ + inAppNotification?: boolean; }; }; @@ -751,6 +850,10 @@ export type FirewallUpdateAttackNotificationSettingsData = { * Whether email notifications are enabled */ emailNotification?: boolean; + /** + * Whether attacks appear in the dashboard notification center + */ + inAppNotification?: boolean; }; path: { /** @@ -791,12 +894,67 @@ export type FirewallUpdateAttackNotificationSettingsResponses = { * Whether email notifications are enabled */ emailNotification?: boolean; + /** + * Whether attacks appear in the dashboard notification center + */ + inAppNotification?: boolean; }; }; export type FirewallUpdateAttackNotificationSettingsResponse = FirewallUpdateAttackNotificationSettingsResponses[keyof FirewallUpdateAttackNotificationSettingsResponses]; +export type FirewallGetLiveTrafficData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + /** + * IP Address + */ + ip: string; + }; + query?: never; + url: '/api/services/{id}/firewall/{ip}/metrics'; +}; + +export type FirewallGetLiveTrafficErrors = { + /** + * Service or IP not found, or the IP is not on the advanced firewall + */ + 404: unknown; +}; + +export type FirewallGetLiveTrafficResponses = { + /** + * Current traffic counters + */ + 200: { + /** + * Blocked traffic in bits per second + */ + dropBps?: number; + /** + * Blocked packets per second + */ + dropPps?: number; + /** + * Allowed traffic in bits per second + */ + passBps?: number; + /** + * Allowed packets per second + */ + passPps?: number; + timestamp?: number; + }; +}; + +export type FirewallGetLiveTrafficResponse = + FirewallGetLiveTrafficResponses[keyof FirewallGetLiveTrafficResponses]; + export type FirewallResetReverseDnsData = { body?: never; path: { @@ -1036,7 +1194,12 @@ export type FirewallGetStatisticsData = { */ ip: string; }; - query?: never; + query?: { + /** + * Time window, for addresses on the advanced firewall only. Other addresses always return the last 7 days + */ + range?: '1h' | '6h' | '24h' | '7d'; + }; url: '/api/services/{id}/firewall/{ip}/stats'; }; @@ -1047,6 +1210,10 @@ export type FirewallGetStatisticsErrors = { 404: { message?: string; }; + /** + * The advanced firewall could not be reached + */ + 502: unknown; }; export type FirewallGetStatisticsError = @@ -1054,7 +1221,7 @@ export type FirewallGetStatisticsError = export type FirewallGetStatisticsResponses = { /** - * nShield statistics for the specified IP address + * Traffic history for the specified IP address, oldest first */ 200: Array<{ /** @@ -1062,20 +1229,20 @@ export type FirewallGetStatisticsResponses = { */ timestamp?: number; /** - * Total traffic that was dropped by the nShield + * Traffic that was dropped by the firewall, in bytes per second. Null where no data was recorded */ - totalDropTraffic?: string; + totalDropTraffic?: number | null; /** - * Total traffic that passed through the nShield + * Traffic that passed through the firewall, in bytes per second. Null where no data was recorded */ - totalPassTraffic?: string; + totalPassTraffic?: number | null; }>; }; export type FirewallGetStatisticsResponse = FirewallGetStatisticsResponses[keyof FirewallGetStatisticsResponses]; -export type MailHostingGetInformationData = { +export type MailHostingListAliasesData = { body?: never; path: { /** @@ -1084,159 +1251,59 @@ export type MailHostingGetInformationData = { id: string; }; query?: never; - url: '/api/services/{id}/mail/info'; + url: '/api/services/{id}/mail/aliases'; }; -export type MailHostingGetInformationErrors = { +export type MailHostingListAliasesErrors = { /** * Mail Hosting not found */ - 404: { - message?: string; - }; + 404: unknown; }; -export type MailHostingGetInformationError = - MailHostingGetInformationErrors[keyof MailHostingGetInformationErrors]; - -export type MailHostingGetInformationResponses = { +export type MailHostingListAliasesResponses = { /** - * Information about the mail hosting service + * Aliases */ 200: Array<{ - archiveYears?: { - /** - * Number of archived years - */ - number?: number; - /** - * Status of archived years - */ - status?: 'enabled' | 'disabled'; - }; - disk?: { - /** - * Disk limit in bytes - */ - limit?: number; - /** - * Disk usage in bytes - */ - usage?: number; - }; - dkim?: { - /** - * DKIM record name - */ - name?: string; - /** - * Status of DKIM record verification - */ - status?: boolean; - /** - * DKIM record type - */ - type?: 'TXT'; - /** - * DKIM record value - */ - value?: string; - } | null; - dns?: Array<{ - /** - * DNS record name - */ - name?: string; - /** - * DNS record priority - */ - priority?: number; - /** - * Status of DNS record verification - */ - status?: boolean; - /** - * DNS record type - */ - type?: 'MX' | 'CNAME' | 'TXT'; - /** - * DNS record value - */ - value?: string; - }>; - domainAlias?: { - /** - * Number of domain aliases - */ - count?: number; - /** - * Maximum number of domain aliases - */ - limit?: number; - }; - /** - * Indicates if file storage is enabled - */ - fileStorage?: boolean; - /** - * Indicates if Office integration is enabled - */ - office?: boolean; - /** - * Indicates if SpamExperts is enabled - */ - spamExperts?: boolean; - /** - * Current status of the mail hosting service - */ - status?: 'active' | 'pending'; - users?: { - /** - * Number of user aliases - */ - aliasCount?: number; - /** - * Maximum number of user aliases - */ - aliasLimit?: number; - /** - * Number of users - */ - count?: number; - /** - * Maximum number of users - */ - limit?: number; - }; - verified?: { - /** - * Verification TXT record - */ - record?: string; - /** - * Verification status - */ - status?: boolean; - /** - * Type of verification record - */ - type?: 'TXT'; + address?: string; + displayName?: string; + features?: { + allUsers?: boolean; + catchAll?: boolean; + internalOnly?: boolean; + sendFrom?: boolean; + showInGal?: boolean; }; + targets?: Array; + username?: string; }>; }; -export type MailHostingGetInformationResponse = - MailHostingGetInformationResponses[keyof MailHostingGetInformationResponses]; +export type MailHostingListAliasesResponse = + MailHostingListAliasesResponses[keyof MailHostingListAliasesResponses]; -export type VirtualServerPerformActionData = { - /** - * Action to perform on the VPS - */ +export type MailHostingCreateAliasData = { body: { /** - * Action to perform on the VPS + * Up to 100 characters */ - action: 'start' | 'shutdown' | 'reset' | 'stop'; + displayName?: string; + /** + * catchAll also receives mail sent to addresses that do not exist on the domain; showInGal lists the alias in the address book; internalOnly accepts mail only from senders on the domain; sendFrom lets the target mailboxes send as the alias; allUsers delivers to every mailbox on the domain + */ + features?: { + allUsers?: boolean; + catchAll?: boolean; + internalOnly?: boolean; + sendFrom?: boolean; + showInGal?: boolean; + }; + targets: Array; + /** + * The part before the @ + */ + username: string; }; path: { /** @@ -1245,26 +1312,804 @@ export type VirtualServerPerformActionData = { id: string; }; query?: never; - url: '/api/services/{id}/vps/action'; + url: '/api/services/{id}/mail/aliases'; }; -export type VirtualServerPerformActionErrors = { +export type MailHostingCreateAliasErrors = { /** - * VPS not found + * Invalid body, or the mail server rejected the request */ - 404: { - message?: string; - }; -}; - -export type VirtualServerPerformActionError = - VirtualServerPerformActionErrors[keyof VirtualServerPerformActionErrors]; - -export type VirtualServerPerformActionResponses = { + 400: unknown; /** - * Action executed successfully + * Missing token scope or team permission */ - 204: void; + 403: unknown; + /** + * Mail Hosting not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingCreateAliasResponses = { + /** + * Alias created + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingCreateAliasResponse = + MailHostingCreateAliasResponses[keyof MailHostingCreateAliasResponses]; + +export type MailHostingDeleteAliasData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + /** + * Alias name, the part before the @ + */ + alias: string; + }; + query?: never; + url: '/api/services/{id}/mail/aliases/{alias}'; +}; + +export type MailHostingDeleteAliasErrors = { + /** + * The mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Mail Hosting or alias not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingDeleteAliasResponses = { + /** + * Alias deleted + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingDeleteAliasResponse = + MailHostingDeleteAliasResponses[keyof MailHostingDeleteAliasResponses]; + +export type MailHostingUpdateAliasData = { + body: { + /** + * Up to 100 characters + */ + displayName?: string; + /** + * catchAll also receives mail sent to addresses that do not exist on the domain; showInGal lists the alias in the address book; internalOnly accepts mail only from senders on the domain; sendFrom lets the target mailboxes send as the alias; allUsers delivers to every mailbox on the domain + */ + features?: { + allUsers?: boolean; + catchAll?: boolean; + internalOnly?: boolean; + sendFrom?: boolean; + showInGal?: boolean; + }; + targets?: Array; + /** + * New name, the part before the @ + */ + username?: string; + }; + path: { + /** + * Service ID + */ + id: string; + /** + * Alias name, the part before the @ + */ + alias: string; + }; + query?: never; + url: '/api/services/{id}/mail/aliases/{alias}'; +}; + +export type MailHostingUpdateAliasErrors = { + /** + * Invalid body, or the mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Mail Hosting or alias not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingUpdateAliasResponses = { + /** + * Alias updated + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingUpdateAliasResponse = + MailHostingUpdateAliasResponses[keyof MailHostingUpdateAliasResponses]; + +export type MailHostingListDomainAliasesData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/mail/domain-aliases'; +}; + +export type MailHostingListDomainAliasesErrors = { + /** + * Mail Hosting not found + */ + 404: unknown; +}; + +export type MailHostingListDomainAliasesResponses = { + /** + * Domain aliases + */ + 200: Array<{ + domain?: string; + }>; +}; + +export type MailHostingListDomainAliasesResponse = + MailHostingListDomainAliasesResponses[keyof MailHostingListDomainAliasesResponses]; + +export type MailHostingAddDomainAliasData = { + body: { + domain: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/mail/domain-aliases'; +}; + +export type MailHostingAddDomainAliasErrors = { + /** + * Invalid body, or the mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Mail Hosting not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingAddDomainAliasResponses = { + /** + * Domain alias added + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingAddDomainAliasResponse = + MailHostingAddDomainAliasResponses[keyof MailHostingAddDomainAliasResponses]; + +export type MailHostingRemoveDomainAliasData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + /** + * Domain alias + */ + alias: string; + }; + query?: never; + url: '/api/services/{id}/mail/domain-aliases/{alias}'; +}; + +export type MailHostingRemoveDomainAliasErrors = { + /** + * The mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Mail Hosting or domain alias not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingRemoveDomainAliasResponses = { + /** + * Domain alias removed + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingRemoveDomainAliasResponse = + MailHostingRemoveDomainAliasResponses[keyof MailHostingRemoveDomainAliasResponses]; + +export type MailHostingGetInformationData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/mail/info'; +}; + +export type MailHostingGetInformationErrors = { + /** + * Mail Hosting not found + */ + 404: { + message?: string; + }; +}; + +export type MailHostingGetInformationError = + MailHostingGetInformationErrors[keyof MailHostingGetInformationErrors]; + +export type MailHostingGetInformationResponses = { + /** + * Information about the mail hosting service + */ + 200: Array<{ + archiveYears?: { + /** + * Number of archived years + */ + number?: number; + /** + * Status of archived years + */ + status?: 'enabled' | 'disabled'; + }; + disk?: { + /** + * Disk limit in bytes + */ + limit?: number; + /** + * Disk usage in bytes + */ + usage?: number; + }; + dkim?: { + /** + * DKIM record name + */ + name?: string; + /** + * Status of DKIM record verification + */ + status?: boolean; + /** + * DKIM record type + */ + type?: 'TXT'; + /** + * DKIM record value + */ + value?: string; + } | null; + dns?: Array<{ + /** + * DNS record name + */ + name?: string; + /** + * DNS record priority + */ + priority?: number; + /** + * Status of DNS record verification + */ + status?: boolean; + /** + * DNS record type + */ + type?: 'MX' | 'CNAME' | 'TXT'; + /** + * DNS record value + */ + value?: string; + }>; + domainAlias?: { + /** + * Number of domain aliases + */ + count?: number; + /** + * Maximum number of domain aliases + */ + limit?: number; + }; + /** + * Indicates if file storage is enabled + */ + fileStorage?: boolean; + /** + * Webmail hostname + */ + hostname?: string; + /** + * Indicates if MXFilter spam filtering is enabled + */ + mxFilter?: boolean; + /** + * Indicates if Office integration is enabled + */ + office?: boolean; + /** + * Deprecated, same as mxFilter + * @deprecated + */ + spamExperts?: boolean; + /** + * Current status of the mail hosting service + */ + status?: 'pending' | 'active' | 'suspended' | 'client_suspended' | 'admin_suspended'; + users?: { + /** + * Number of user aliases + */ + aliasCount?: number; + /** + * Maximum number of user aliases + */ + aliasLimit?: number; + /** + * Number of users + */ + count?: number; + /** + * Maximum number of users + */ + limit?: number; + }; + verified?: { + /** + * Verification TXT record + */ + record?: string; + /** + * Verification status + */ + status?: boolean; + /** + * Type of verification record + */ + type?: 'TXT'; + }; + }>; +}; + +export type MailHostingGetInformationResponse = + MailHostingGetInformationResponses[keyof MailHostingGetInformationResponses]; + +export type MailHostingRefreshUsageStatisticsData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/mail/refresh'; +}; + +export type MailHostingRefreshUsageStatisticsErrors = { + /** + * Mail Hosting not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingRefreshUsageStatisticsResponses = { + /** + * Statistics refreshed + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingRefreshUsageStatisticsResponse = + MailHostingRefreshUsageStatisticsResponses[keyof MailHostingRefreshUsageStatisticsResponses]; + +export type MailHostingListMailboxesData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/mail/users'; +}; + +export type MailHostingListMailboxesErrors = { + /** + * Mail Hosting not found + */ + 404: unknown; +}; + +export type MailHostingListMailboxesResponses = { + /** + * Mailboxes + */ + 200: Array<{ + address?: string; + admin?: boolean; + diskLimit?: number; + diskUsage?: number | null; + displayName?: string; + enabled?: boolean; + primaryAdmin?: boolean; + username?: string; + }>; +}; + +export type MailHostingListMailboxesResponse = + MailHostingListMailboxesResponses[keyof MailHostingListMailboxesResponses]; + +export type MailHostingCreateMailboxData = { + body: { + diskLimit?: number; + /** + * Up to 100 characters + */ + displayName?: string; + enabled?: boolean; + /** + * 8 to 128 characters + */ + password: string; + /** + * The part before the @ + */ + username: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/mail/users'; +}; + +export type MailHostingCreateMailboxErrors = { + /** + * Invalid body, or the mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Mail Hosting not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingCreateMailboxResponses = { + /** + * Mailbox created + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingCreateMailboxResponse = + MailHostingCreateMailboxResponses[keyof MailHostingCreateMailboxResponses]; + +export type MailHostingDeleteMailboxData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + /** + * Mailbox name, the part before the @ + */ + username: string; + }; + query?: never; + url: '/api/services/{id}/mail/users/{username}'; +}; + +export type MailHostingDeleteMailboxErrors = { + /** + * The mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission, or the mailbox is the primary administrator + */ + 403: unknown; + /** + * Mail Hosting or mailbox not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingDeleteMailboxResponses = { + /** + * Mailbox deleted + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingDeleteMailboxResponse = + MailHostingDeleteMailboxResponses[keyof MailHostingDeleteMailboxResponses]; + +export type MailHostingUpdateMailboxData = { + body: { + diskLimit?: number; + /** + * Up to 100 characters + */ + displayName?: string; + enabled?: boolean; + }; + path: { + /** + * Service ID + */ + id: string; + /** + * Mailbox name, the part before the @ + */ + username: string; + }; + query?: never; + url: '/api/services/{id}/mail/users/{username}'; +}; + +export type MailHostingUpdateMailboxErrors = { + /** + * Invalid body, or the mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission, or the mailbox is the primary administrator + */ + 403: unknown; + /** + * Mail Hosting or mailbox not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingUpdateMailboxResponses = { + /** + * Mailbox updated + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingUpdateMailboxResponse = + MailHostingUpdateMailboxResponses[keyof MailHostingUpdateMailboxResponses]; + +export type MailHostingChangeMailboxPasswordData = { + body: { + /** + * 8 to 128 characters + */ + password: string; + }; + path: { + /** + * Service ID + */ + id: string; + /** + * Mailbox name, the part before the @ + */ + username: string; + }; + query?: never; + url: '/api/services/{id}/mail/users/{username}/password'; +}; + +export type MailHostingChangeMailboxPasswordErrors = { + /** + * Invalid body, or the mail server rejected the request + */ + 400: unknown; + /** + * Missing token scope or team permission, or the mailbox is the primary administrator + */ + 403: unknown; + /** + * Mail Hosting or mailbox not found + */ + 404: unknown; + /** + * Mail server unavailable + */ + 502: unknown; +}; + +export type MailHostingChangeMailboxPasswordResponses = { + /** + * Password changed + */ + 200: { + ok?: boolean; + }; +}; + +export type MailHostingChangeMailboxPasswordResponse = + MailHostingChangeMailboxPasswordResponses[keyof MailHostingChangeMailboxPasswordResponses]; + +export type UserRenameServiceData = { + body: { + /** + * Up to 40 characters + */ + nickname: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/nickname'; +}; + +export type UserRenameServiceErrors = { + /** + * Invalid body + */ + 400: unknown; + /** + * Missing token scope, or the service is shared with you through a team + */ + 403: unknown; + /** + * Service not found + */ + 404: unknown; +}; + +export type UserRenameServiceResponses = { + /** + * Nickname saved + */ + 200: { + nickname?: string | null; + }; +}; + +export type UserRenameServiceResponse = + UserRenameServiceResponses[keyof UserRenameServiceResponses]; + +export type VirtualServerPerformActionData = { + /** + * Action to perform on the VPS + */ + body: { + /** + * Action to perform on the VPS + */ + action: 'start' | 'shutdown' | 'reset' | 'stop'; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/action'; +}; + +export type VirtualServerPerformActionErrors = { + /** + * VPS not found + */ + 404: { + message?: string; + }; +}; + +export type VirtualServerPerformActionError = + VirtualServerPerformActionErrors[keyof VirtualServerPerformActionErrors]; + +export type VirtualServerPerformActionResponses = { + /** + * Action executed successfully + */ + 204: void; }; export type VirtualServerPerformActionResponse = @@ -1431,6 +2276,72 @@ export type VirtualServerChangeDailyBackupStatusResponses = { export type VirtualServerChangeDailyBackupStatusResponse = VirtualServerChangeDailyBackupStatusResponses[keyof VirtualServerChangeDailyBackupStatusResponses]; +export type VirtualServerGetBootOrderData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/boot-order'; +}; + +export type VirtualServerGetBootOrderErrors = { + /** + * Virtual Server not found + */ + 404: unknown; +}; + +export type VirtualServerGetBootOrderResponses = { + /** + * Boot devices, first to last + */ + 200: Array<'virtio0' | 'ide0' | 'ide1' | 'ide2'>; +}; + +export type VirtualServerGetBootOrderResponse = + VirtualServerGetBootOrderResponses[keyof VirtualServerGetBootOrderResponses]; + +export type VirtualServerUpdateBootOrderData = { + body: Array<'virtio0' | 'ide0' | 'ide1' | 'ide2'>; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/boot-order'; +}; + +export type VirtualServerUpdateBootOrderErrors = { + /** + * Invalid body, or a device the server does not have + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Virtual Server not found + */ + 404: unknown; +}; + +export type VirtualServerUpdateBootOrderResponses = { + /** + * Boot order saved + */ + 204: void; +}; + +export type VirtualServerUpdateBootOrderResponse = + VirtualServerUpdateBootOrderResponses[keyof VirtualServerUpdateBootOrderResponses]; + export type VirtualServerChangePasswordData = { /** * Change the password of a Virtual Server @@ -1477,6 +2388,145 @@ export type VirtualServerChangePasswordResponses = { export type VirtualServerChangePasswordResponse = VirtualServerChangePasswordResponses[keyof VirtualServerChangePasswordResponses]; +export type VirtualServerUnmountIsoData = { + body: { + isoId: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/custom-iso'; +}; + +export type VirtualServerUnmountIsoErrors = { + /** + * Invalid body + */ + 400: unknown; + /** + * Missing token scope or team permission + */ + 403: unknown; + /** + * Virtual Server or ISO not found + */ + 404: unknown; + /** + * Another custom ISO operation is in progress + */ + 409: unknown; +}; + +export type VirtualServerUnmountIsoResponses = { + /** + * ISO unmounted + */ + 204: void; +}; + +export type VirtualServerUnmountIsoResponse = + VirtualServerUnmountIsoResponses[keyof VirtualServerUnmountIsoResponses]; + +export type VirtualServerGetMountedIsosData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/custom-iso'; +}; + +export type VirtualServerGetMountedIsosErrors = { + /** + * Virtual Server not found + */ + 404: unknown; + /** + * Another custom ISO operation is in progress + */ + 409: unknown; +}; + +export type VirtualServerGetMountedIsosResponses = { + /** + * Mounted ISOs + */ + 200: { + mounts?: Array<{ + device?: string; + iso?: { + createdAt?: string; + id?: string; + name?: string; + /** + * Bytes + */ + size?: number; + status?: 'UPLOADING' | 'READY' | 'FAILED' | 'DELETING'; + updatedAt?: string; + }; + pendingRemoval?: boolean; + }>; + }; +}; + +export type VirtualServerGetMountedIsosResponse = + VirtualServerGetMountedIsosResponses[keyof VirtualServerGetMountedIsosResponses]; + +export type VirtualServerMountIsoData = { + body: { + bootFirst?: boolean; + isoId: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/custom-iso'; +}; + +export type VirtualServerMountIsoErrors = { + /** + * Invalid body + */ + 400: unknown; + /** + * Missing token scope, or the service is shared with you through a team + */ + 403: unknown; + /** + * Virtual Server or ISO not found + */ + 404: unknown; + /** + * The ISO is not ready, no CD-ROM drive is free, or another custom ISO operation is in progress + */ + 409: unknown; +}; + +export type VirtualServerMountIsoResponses = { + /** + * ISO mounted + */ + 200: { + device?: string; + isoId?: string; + }; +}; + +export type VirtualServerMountIsoResponse = + VirtualServerMountIsoResponses[keyof VirtualServerMountIsoResponses]; + export type VirtualServerGetGraphsData = { body?: never; path: { @@ -1583,6 +2633,10 @@ export type VirtualServerGetInformationResponses = { * Total disk space in bytes */ disk?: number; + /** + * Indicates if there are pending changes for the VPS. If true, the VPS may require a restart to apply changes. + */ + hasPendingChanges?: boolean; /** * Hostname of the VPS */ @@ -1679,50 +2733,222 @@ export type VirtualServerGetOsTemplatesResponse = export type VirtualServerReinstallData = { /** - * Reinstall VPS with a new OS + * Reinstall VPS with a new OS + */ + body: { + /** + * ID of the new OS to install + */ + osId: number; + /** + * New root password for the VPS + */ + password: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/reinstall'; +}; + +export type VirtualServerReinstallErrors = { + /** + * VPS not found + */ + 404: { + message?: string; + }; +}; + +export type VirtualServerReinstallError = + VirtualServerReinstallErrors[keyof VirtualServerReinstallErrors]; + +export type VirtualServerReinstallResponses = { + /** + * VPS reinstallation initiated successfully + */ + 204: void; +}; + +export type VirtualServerReinstallResponse = + VirtualServerReinstallResponses[keyof VirtualServerReinstallResponses]; + +export type VirtualServerGetPowerSchedulesData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/schedules'; +}; + +export type VirtualServerGetPowerSchedulesErrors = { + /** + * VPS not found + */ + 404: unknown; +}; + +export type VirtualServerGetPowerSchedulesResponses = { + /** + * Schedules and recent runs + */ + 200: unknown; +}; + +export type VirtualServerCreatePowerScheduleData = { + body: { + action: 'START' | 'SHUTDOWN' | 'REBOOT' | 'STOP'; + cron?: string; + days?: Array; + enabled?: boolean; + forceAfterMinutes?: 5 | 10 | 15 | 30; + intervalHours?: 1 | 2 | 3 | 4 | 6 | 8 | 12; + minute?: number; + mode: 'WEEKLY' | 'INTERVAL' | 'ONCE' | 'CRON'; + /** + * Optional label, up to 60 characters + */ + name?: string; + runAt?: string; + timezone: string; + }; + path: { + /** + * Service ID + */ + id: string; + }; + query?: never; + url: '/api/services/{id}/vps/schedules'; +}; + +export type VirtualServerCreatePowerScheduleErrors = { + /** + * Invalid rule, runs too close together or the limit of 10 schedules reached + */ + 400: unknown; + /** + * VPS not found + */ + 404: unknown; +}; + +export type VirtualServerCreatePowerScheduleResponses = { + /** + * The created schedule + */ + 200: unknown; +}; + +export type VirtualServerDeletePowerScheduleData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + /** + * Schedule ID + */ + scheduleId: string; + }; + query?: never; + url: '/api/services/{id}/vps/schedules/{scheduleId}'; +}; + +export type VirtualServerDeletePowerScheduleErrors = { + /** + * VPS or schedule not found + */ + 404: unknown; +}; + +export type VirtualServerDeletePowerScheduleResponses = { + /** + * Deleted + */ + 204: void; +}; + +export type VirtualServerDeletePowerScheduleResponse = + VirtualServerDeletePowerScheduleResponses[keyof VirtualServerDeletePowerScheduleResponses]; + +export type VirtualServerUpdatePowerScheduleData = { + body?: never; + path: { + /** + * Service ID + */ + id: string; + /** + * Schedule ID + */ + scheduleId: string; + }; + query?: never; + url: '/api/services/{id}/vps/schedules/{scheduleId}'; +}; + +export type VirtualServerUpdatePowerScheduleErrors = { + /** + * Invalid rule + */ + 400: unknown; + /** + * VPS or schedule not found + */ + 404: unknown; +}; + +export type VirtualServerUpdatePowerScheduleResponses = { + /** + * The updated schedule */ - body: { - /** - * ID of the new OS to install - */ - osId: number; - /** - * New root password for the VPS - */ - password: string; - }; + 200: unknown; +}; + +export type VirtualServerRunPowerScheduleNowData = { + body?: never; path: { /** * Service ID */ id: string; + /** + * Schedule ID + */ + scheduleId: string; }; query?: never; - url: '/api/services/{id}/vps/reinstall'; + url: '/api/services/{id}/vps/schedules/{scheduleId}/run'; }; -export type VirtualServerReinstallErrors = { +export type VirtualServerRunPowerScheduleNowErrors = { /** - * VPS not found + * VPS or schedule not found */ - 404: { - message?: string; - }; + 404: unknown; + /** + * Too many manual runs + */ + 429: unknown; }; -export type VirtualServerReinstallError = - VirtualServerReinstallErrors[keyof VirtualServerReinstallErrors]; - -export type VirtualServerReinstallResponses = { +export type VirtualServerRunPowerScheduleNowResponses = { /** - * VPS reinstallation initiated successfully + * The run result: { status: SUCCESS | SKIPPED | FAILED, reason? } */ - 204: void; + 200: unknown; }; -export type VirtualServerReinstallResponse = - VirtualServerReinstallResponses[keyof VirtualServerReinstallResponses]; - export type VirtualServerGetTasksData = { body?: never; path: { @@ -1857,6 +3083,10 @@ export type BillingAddOrderData = { * Promo code */ promoCode?: string | null; + /** + * A team you are an active member of to share the new service with. Teams set to share new services automatically get it either way. + */ + teamId?: number | null; }; path: { /** @@ -1912,6 +3142,253 @@ export type BillingGetStoreGroupsResponses = { export type BillingGetStoreGroupsResponse = BillingGetStoreGroupsResponses[keyof BillingGetStoreGroupsResponses]; +export type TeamsListTeamsData = { + body?: never; + path?: never; + query?: never; + url: '/api/teams'; +}; + +export type TeamsListTeamsResponses = { + /** + * Teams + */ + 200: Array<{ + accessExpiresAt?: string | null; + autoShare?: boolean; + awaitingApproval?: boolean; + createdAt?: string; + id?: number; + memberCount?: number; + name?: string; + sharedServicesCount?: number; + }>; +}; + +export type TeamsListTeamsResponse = TeamsListTeamsResponses[keyof TeamsListTeamsResponses]; + +export type TeamsGetTeamData = { + body?: never; + path: { + /** + * Team ID + */ + id: string; + }; + query?: never; + url: '/api/teams/{id}'; +}; + +export type TeamsGetTeamErrors = { + /** + * Team not found + */ + 404: unknown; +}; + +export type TeamsGetTeamResponses = { + /** + * Team + */ + 200: { + accessExpiresAt?: string | null; + autoShare?: boolean; + id?: number; + memberCount?: number; + name?: string; + pendingRequestCount?: number; + /** + * Team permission bitfield: 1 power, 2 console, 4 backups, 8 reinstall, 16 firewall, 32 panel login, 64 reinstall with approval, 128 backups with approval. Owners and admins have every permission. + */ + permissions?: number; + role?: 'OWNER' | 'ADMIN' | 'MEMBER'; + serviceCount?: number; + }; +}; + +export type TeamsGetTeamResponse = TeamsGetTeamResponses[keyof TeamsGetTeamResponses]; + +export type TeamsGetTeamLogsData = { + body?: never; + path: { + /** + * Team ID + */ + id: string; + }; + query?: never; + url: '/api/teams/{id}/logs'; +}; + +export type TeamsGetTeamLogsErrors = { + /** + * Team not found, or you are not an owner or admin + */ + 404: unknown; +}; + +export type TeamsGetTeamLogsResponses = { + /** + * Team logs + */ + 200: { + logs?: Array<{ + action?: string; + clientId?: number; + createdAt?: string; + id?: number; + metadata?: { + [key: string]: unknown; + } | null; + }>; + members?: Array<{ + clientId?: number; + fullName?: string; + memberId?: number | null; + }>; + }; +}; + +export type TeamsGetTeamLogsResponse = TeamsGetTeamLogsResponses[keyof TeamsGetTeamLogsResponses]; + +export type TeamsListTeamMembersData = { + body?: never; + path: { + /** + * Team ID + */ + id: string; + }; + query?: never; + url: '/api/teams/{id}/members'; +}; + +export type TeamsListTeamMembersErrors = { + /** + * Team not found + */ + 404: unknown; +}; + +export type TeamsListTeamMembersResponses = { + /** + * Members and invitations + */ + 200: Array<{ + /** + * Access length an invitation grants + */ + accessDays?: number | null; + accessExpiresAt?: number | null; + allServices?: boolean; + /** + * Only on your own row + */ + autoShare?: boolean; + clientId?: number | null; + email?: string; + /** + * When a pending invitation expires + */ + expiresAt?: number | null; + fullName?: string | null; + id?: number; + kind?: 'member' | 'invite'; + /** + * Team permission bitfield: 1 power, 2 console, 4 backups, 8 reinstall, 16 firewall, 32 panel login, 64 reinstall with approval, 128 backups with approval. Owners and admins have every permission. + */ + permissions?: number; + role?: 'OWNER' | 'ADMIN' | 'MEMBER'; + serviceIds?: Array; + /** + * Per-service permission overrides keyed by service ID + */ + servicePermissions?: { + [key: string]: number; + }; + status?: 'ACTIVE' | 'PENDING'; + }>; +}; + +export type TeamsListTeamMembersResponse = + TeamsListTeamMembersResponses[keyof TeamsListTeamMembersResponses]; + +export type TeamsListApprovalRequestsData = { + body?: never; + path: { + /** + * Team ID + */ + id: string; + }; + query?: never; + url: '/api/teams/{id}/requests'; +}; + +export type TeamsListApprovalRequestsErrors = { + /** + * Team not found, or you are not an owner or admin + */ + 404: unknown; +}; + +export type TeamsListApprovalRequestsResponses = { + /** + * Approval requests + */ + 200: Array<{ + action?: 'REINSTALL' | 'RESTORE_BACKUP'; + approvedUntil?: string | null; + createdAt?: string; + decidedAt?: string | null; + decidedBy?: string | null; + details?: { + [key: string]: unknown; + }; + id?: number; + requestedBy?: string | null; + serviceId?: number; + state?: 'PENDING' | 'APPROVED' | 'REJECTED' | 'CANCELLED' | 'USED' | 'EXPIRED'; + }>; +}; + +export type TeamsListApprovalRequestsResponse = + TeamsListApprovalRequestsResponses[keyof TeamsListApprovalRequestsResponses]; + +export type TeamsListTeamServicesData = { + body?: never; + path: { + /** + * Team ID + */ + id: string; + }; + query?: never; + url: '/api/teams/{id}/services'; +}; + +export type TeamsListTeamServicesErrors = { + /** + * Team not found + */ + 404: unknown; +}; + +export type TeamsListTeamServicesResponses = { + /** + * Shared services + */ + 200: Array<{ + mine?: boolean; + serviceId?: number; + sharedAt?: string; + sharedBy?: string | null; + }>; +}; + +export type TeamsListTeamServicesResponse = + TeamsListTeamServicesResponses[keyof TeamsListTeamServicesResponses]; + export type UserGetCurrentUserData = { body?: never; path?: never; @@ -2026,6 +3503,63 @@ export type UserGetCurrentUserResponses = { export type UserGetCurrentUserResponse = UserGetCurrentUserResponses[keyof UserGetCurrentUserResponses]; +export type BillingGetAutoPayStatusesData = { + body?: never; + path?: never; + query?: never; + url: '/api/users/@me/autopay-statuses'; +}; + +export type BillingGetAutoPayStatusesResponses = { + /** + * Auto-Pay status per service + */ + 200: { + [key: string]: boolean; + }; +}; + +export type BillingGetAutoPayStatusesResponse = + BillingGetAutoPayStatusesResponses[keyof BillingGetAutoPayStatusesResponses]; + +export type VirtualServerGetCustomIsoLibraryData = { + body?: never; + path?: never; + query?: never; + url: '/api/users/@me/custom-isos'; +}; + +export type VirtualServerGetCustomIsoLibraryResponses = { + /** + * Custom ISO library + */ + 200: { + isos?: Array<{ + createdAt?: string; + id?: string; + mounts?: Array<{ + device?: string; + serviceId?: number; + }>; + name?: string; + /** + * Bytes + */ + size?: number; + status?: 'UPLOADING' | 'READY' | 'FAILED' | 'DELETING'; + updatedAt?: string; + }>; + quota?: { + available?: number; + limit?: number; + used?: number; + }; + }; +}; + +export type VirtualServerGetCustomIsoLibraryResponse = + VirtualServerGetCustomIsoLibraryResponses[keyof VirtualServerGetCustomIsoLibraryResponses]; + export type UserGetInvoicesData = { body?: never; path?: never; @@ -2237,6 +3771,62 @@ export type BillingMakePaymentResponses = { export type BillingMakePaymentResponse = BillingMakePaymentResponses[keyof BillingMakePaymentResponses]; +export type BillingBulkPayWithBalanceData = { + body?: { + expectedTotal: number; + invoiceIds: Array; + }; + path?: never; + query?: never; + url: '/api/users/@me/invoices/bulk/balance'; +}; + +export type BillingBulkPayWithBalanceResponses = { + /** + * Result per invoice + */ + 200: { + results?: Array<{ + amount?: number; + invoiceId?: number; + status?: 'paid' | 'failed'; + }>; + }; +}; + +export type BillingBulkPayWithBalanceResponse = + BillingBulkPayWithBalanceResponses[keyof BillingBulkPayWithBalanceResponses]; + +export type BillingPreviewBulkPaymentData = { + body?: { + invoiceIds: Array; + }; + path?: never; + query?: never; + url: '/api/users/@me/invoices/bulk/preview'; +}; + +export type BillingPreviewBulkPaymentResponses = { + /** + * Payable invoices with the amount still due, invoices that cannot be paid, and the balance + */ + 200: { + balance?: number; + invoices?: Array<{ + amount?: number; + dueDate?: string; + id?: number; + isAddFunds?: boolean; + total?: number; + }>; + total?: number; + unavailable?: Array; + }; +}; + +export type BillingPreviewBulkPaymentResponse = + BillingPreviewBulkPaymentResponses[keyof BillingPreviewBulkPaymentResponses]; + export type UserGetReferralCodeData = { body?: never; path?: never; @@ -2253,6 +3843,44 @@ export type UserGetReferralCodeResponses = { * Referral code of the user */ code?: string; + /** + * Rewards earned but still waiting for the refund window or a review + */ + pending?: number; + /** + * Terms of the referral program new invitees join + */ + program?: { + /** + * Days a reward waits + */ + holdDays?: number; + /** + * Invoices that earn a reward + */ + invoices?: number; + /** + * Reward in percent + */ + rate?: number; + version?: number; + /** + * One-time first order discount of the invitee, in percent + */ + welcomeDiscount?: number | null; + }; + /** + * Reward history, newest first; never names the invitee + */ + rewards?: Array<{ + amount?: number; + currency?: string; + date?: number; + dueAt?: number | null; + reason?: 'refunded' | 'left' | null; + sequence?: number | null; + status?: 'credited' | 'pending' | 'review' | 'rejected' | 'void' | 'reversed'; + }>; uses?: { /** * Number of times the referral code has been used