import { RuntimeStatsListItem, ApplicationId, APIPayload } from '../../common/v2.js'; import '../../utils.js'; /** * APIApplicationStatus#status * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/status */ type ApplicationStatus = "exited" | "created" | "starting" | "restarting" | "deleting" | "running"; declare const ApplicationStatus: { Exited: string; Created: string; Starting: string; Restarting: string; Deleting: string; Running: string; }; /** * APIApplicationStatus#network — network counters. Strings by default * (`" ↓"`); two-element `[in, out]` integer arrays * with `?rawData=true`. * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/status */ interface APIApplicationStatusNetwork { total: Raw extends true ? [number, number] : string; now: Raw extends true ? [number, number] : string; } /** * Runtime stats for a single application (or database). By default the usage * fields come formatted as strings (`"0.50%"`, `"120/512MB"`); pass * `?rawData=true` (see the status query type) to receive raw numbers instead — * parameterize with `APIApplicationStatus`. * @see https://docs.squarecloud.app/en/api-reference/endpoint/apps/status */ interface APIApplicationStatus { /** CPU usage. Formatted (`"0.50%"`) by default, raw number with `rawData`. */ cpu: Raw extends true ? number : string; /** RAM usage. Formatted (`"120/512MB"`) by default, raw number with `rawData`. */ ram: Raw extends true ? number : string; status: ApplicationStatus; /** Convenience flag equivalent to `status === "running"`. */ running: boolean; /** Storage usage. Formatted by default, raw bytes with `rawData`. */ storage: Raw extends true ? number : string; network: APIApplicationStatusNetwork; /** Unix timestamp (ms) at which the resource last started. `null` when not running. */ uptime: number | null; } type APIApplicationStatusPayload = APIPayload>; /** * @see /apps/status https://docs.squarecloud.app/en/api-reference/endpoint/apps/status-all */ type APIApplicationStatusAll = RuntimeStatsListItem; type APIApplicationStatusAllPayload = APIPayload; export { type APIApplicationStatus, type APIApplicationStatusAll, type APIApplicationStatusAllPayload, type APIApplicationStatusNetwork, type APIApplicationStatusPayload, ApplicationStatus };