import type { GateState } from "@render-lab/tasks-core"; /** * A Render deploy's lifecycle status. The pending states re-poll; `live` is the * success terminal; the rest are failure terminals (see {@link classifyDeploy}). */ export type DeployStatus = "created" | "queued" | "build_in_progress" | "update_in_progress" | "pre_deploy_in_progress" | "live" | "build_failed" | "update_failed" | "pre_deploy_failed" | "canceled" | "deactivated"; /** * A Render data primitive's (Postgres / Key Value) provisioning status. * `available` is ready; `creating`/maintenance re-poll; the rest fail. */ export type ResourceStatus = "creating" | "available" | "unavailable" | "suspended" | "maintenance_in_progress" | "recovery_in_progress" | "recovery_failed" | "unknown"; export type RenderServiceType = "web_service" | "private_service" | "background_worker" | "static_site"; /** Minimal Render service, mapped to a plain DTO. */ export interface ServiceDTO { id: string; name: string; /** e.g. "web_service", "private_service", "background_worker", "cron_job". */ type: string; runtime?: string | null; region?: string | null; plan?: string | null; repositoryUrl?: string | null; branch?: string | null; createdAt?: string; updatedAt?: string; /** True when the service is currently suspended. */ suspended: boolean; /** Public (web) or internal (private) URL if the API exposed one, else null. */ url: string | null; dashboardUrl: string | null; } /** A Render deploy, mapped to a plain DTO. */ export interface DeployDTO { id: string; serviceId: string; status: DeployStatus; commitId: string | null; createdAt?: string; updatedAt?: string; finishedAt?: string | null; failureReason?: string | null; } /** A Render Postgres instance, mapped to a plain DTO. */ export interface PostgresDTO { id: string; name: string; status: ResourceStatus; plan: string | null; region: string | null; } /** A Render Key Value instance, mapped to a plain DTO. */ export interface KeyValueDTO { id: string; name: string; status: ResourceStatus; plan: string | null; region: string | null; } /** A Render project, mapped to a plain DTO. */ export interface ProjectDTO { id: string; name: string; } export interface EnvironmentVariableInput { key: string; value: string; } export interface DiskInput { name: string; mountPath: string; sizeGB: number; } export interface DiskDTO extends DiskInput { id: string; ownerId?: string; serviceId: string; createdAt?: string; updatedAt?: string; } /** POST /v1/services/{serviceId}/deploys */ export interface TriggerDeployInput { serviceId: string; /** Clear the build cache for this deploy. */ clearCache?: boolean; /** Deploy a specific commit SHA (defaults to the branch head). */ commitId?: string; } export interface TriggerDeployResult { serviceId: string; deployId: string; status: DeployStatus; } /** Durably poll GET /v1/services/{serviceId}/deploys/{deployId} until terminal. */ export interface AwaitDeployInput { serviceId: string; deployId: string; } export interface AwaitDeployResult { serviceId: string; deployId: string; status: DeployStatus; /** True when the deploy reached `live`. */ live: boolean; } /** POST /v1/services/{serviceId}/scale (numInstances) and/or PATCH plan. */ export interface ScaleServiceInput { serviceId: string; /** Target instance count. */ numInstances?: number; /** Target instance plan (e.g. "starter", "standard"). */ plan?: string; } export interface ScaleServiceResult { serviceId: string; numInstances: number | null; plan: string | null; } export interface SuspendServiceInput { serviceId: string; } export interface SuspendServiceResult { serviceId: string; suspended: boolean; } export interface ResumeServiceInput { serviceId: string; } export interface ResumeServiceResult { serviceId: string; suspended: boolean; } /** POST /v1/postgres, then poll until `available`. Idempotent by `name`. */ export interface ProvisionPostgresInput { name: string; /** Owner (team/user) id; defaults to RENDER_OWNER_ID. */ ownerId?: string; plan?: string; region?: string; /** Postgres major version, e.g. "16". */ version?: string; databaseName?: string; databaseUser?: string; /** Project environment to place the instance in (see `render.createProject`). */ environmentId?: string; } /** POST /v1/key-value, then poll until `available`. Idempotent by `name`. */ export interface ProvisionKeyValueInput { name: string; /** Owner (team/user) id; defaults to RENDER_OWNER_ID. */ ownerId?: string; plan?: string; region?: string; /** Eviction policy, e.g. "allkeys-lru", "noeviction". */ maxmemoryPolicy?: string; /** Project environment to place the instance in (see `render.createProject`). */ environmentId?: string; } /** * POST /v1/services (type=private_service), then poll its initial deploy until * live. Idempotent by `name`. A source is required: a git `repo` (+`branch`) or * a container `image`. */ export interface CreatePrivateServiceInput { name: string; /** Owner (team/user) id; defaults to RENDER_OWNER_ID. */ ownerId?: string; region?: string; plan?: string; /** Git repo URL to deploy (mutually exclusive with `image`). */ repo?: string; /** Branch to track when deploying from `repo`. */ branch?: string; /** Container image URL to deploy (mutually exclusive with `repo`). */ image?: string; /** Non-secret env vars to seed the service with. */ envVars?: Array<{ key: string; value: string; }>; } export interface CreatePrivateServiceResult { serviceId: string; name: string; status: DeployStatus; live: boolean; url: string | null; } export interface GetServiceInput { serviceId: string; } interface BaseProvisionServiceInput { name: string; ownerId?: string; region?: string; plan?: string; repo?: string; branch?: string; rootDir?: string; buildCommand?: string; preDeployCommand?: string; autoDeploy?: boolean; envVars?: EnvironmentVariableInput[]; disk?: DiskInput; /** Project environment to place the service in (see `render.createProject`). */ environmentId?: string; } /** * Docker (`env: "docker"`) Git-build settings. Only meaningful when the * service's `runtime` is `"docker"`; forwarded under * `serviceDetails.envSpecificDetails` (the API's `dockerDetails` shape), NOT the * flat `buildCommand`/`startCommand` path used for native runtimes. Static sites * are not Docker-capable, so these are absent there. */ export interface DockerBuildInput { /** Dockerfile path relative to the repo root, e.g. "./apps/web/Dockerfile". */ dockerfilePath?: string; /** Docker build context directory, e.g. "." or "./apps/web". */ dockerContext?: string; /** Run command for the Docker service (the `env: "docker"` analog of `startCommand`). */ dockerCommand?: string; } export type ProvisionServiceInput = (BaseProvisionServiceInput & DockerBuildInput & { type: "web_service"; runtime: string; startCommand: string; healthCheckPath?: string; }) | (BaseProvisionServiceInput & DockerBuildInput & { type: "private_service"; runtime?: string; startCommand?: string; image?: string; }) | (BaseProvisionServiceInput & DockerBuildInput & { type: "background_worker"; runtime: string; startCommand: string; }) | (Omit & { type: "static_site"; buildCommand: string; publishPath: string; }); export interface ProvisionServiceResult { service: ServiceDTO; created: boolean; deployId: string | null; status: DeployStatus; live: boolean; } export type DeleteResourceInput = { kind: "service"; id: string; } | { kind: "postgres"; id: string; } | { kind: "keyValue"; id: string; } | { kind: "disk"; id: string; }; export interface DeleteResourceResult { kind: DeleteResourceInput["kind"]; id: string; deleted: true; alreadyMissing: boolean; } /** * POST /v1/projects — find-or-create a project by exact `name` so a retried or * resumed deploy reuses the same project rather than duplicating it. The project * is created with a single environment (`environmentName`, default * "production"); resources are placed in it via the returned `environmentId`. */ export interface CreateProjectInput { name: string; /** Owner (team/user) id; defaults to RENDER_OWNER_ID. */ ownerId?: string; /** Name of the single environment to create/reuse. Defaults to "production". */ environmentName?: string; } export interface CreateProjectResult { project: ProjectDTO; /** Id of the project's (single) environment — pass as `environmentId` to provision*. */ environmentId: string; } /** * DELETE /v1/projects/{projectId}. Convergent — a missing project returns * `alreadyMissing: true`. Does NOT cascade: the caller must delete the contained * resources first (the API 409s while any environment is non-empty). */ export interface DeleteProjectInput { projectId: string; } export interface DeleteProjectResult { projectId: string; deleted: true; alreadyMissing: boolean; } export interface LogLineDTO { timestamp: string; resourceId: string; level: string; type: string; message: string; } export interface GetDeployDiagnosticsInput { serviceId: string; deployId: string; /** Workspace (owner) id — required by GET /v1/logs. */ ownerId: string; maxBytes?: number; maxLines?: number; } export interface DeployDiagnosticsResult { deploy: { id: string; serviceId: string; status: DeployStatus; commitId: string | null; createdAt: string; updatedAt: string; finishedAt: string | null; }; logs: LogLineDTO[]; failureReason: string | null; truncated: boolean; nextStartTime: string | null; } /** Map a deploy status to a {@link GateState} for `pollGate`. */ export declare function classifyDeploy(status: string): GateState; /** Map a Postgres/Key Value status to a {@link GateState} for `pollGate`. */ export declare function classifyResource(status: string): GateState; export {}; //# sourceMappingURL=types.d.ts.map