import { H as HttpClientConfig } from './types-C8x5GGVP.js'; import { ContentstackRegion } from './regions/index.js'; import { C as ContentstackHttpClient } from './client-C0hESzBg.js'; interface LaunchProject { uid: string; name: string; projectType: "GITPROVIDER" | "FILEUPLOAD"; repository?: { repositoryName?: string; username?: string; repositoryUrl: string; }; /** Environments are only included when fetching a single project, not in list responses. */ environments?: LaunchEnvironment[]; organizationUid: string; createdAt: string; updatedAt: string; createdBy: string; updatedBy: string; } interface LaunchDomain { url: string; createdAt: string; updatedAt: string; } interface LaunchEnvironment { uid: string; name: string; gitBranch?: string; frameworkPreset?: FrameworkPreset; buildCommand?: string; outputDirectory?: string; domains?: LaunchDomain[]; status: "ACTIVE" | "INACTIVE"; /** * Best-effort summary from the environment resource. `status` is often undefined — * use `deployments.getLatest()` for authoritative deployment status when polling. */ latestDeployment?: LaunchDeployment; createdAt: string; updatedAt: string; } type FrameworkPreset = "NEXTJS" | "GATSBY" | "ANGULAR" | "NUXT" | "OTHER"; interface LaunchDeployment { uid: string; status: "QUEUED" | "BUILDING" | "DEPLOYING" | "LIVE" | "FAILED" | "CANCELLED"; environmentUid: string; commitMessage?: string; commitSha?: string; createdAt: string; updatedAt: string; completedAt?: string; } interface DeploymentLog { timestamp: string; message: string; level: "info" | "warn" | "error"; } interface ServerLog { timestamp: string; message: string; requestId?: string; } interface SignedUploadFormField { formFieldKey: string; formFieldValue: string; } interface SignedUploadHeader { key: string; value: string; } interface SignedUploadUrl { uploadUrl: string; expiresAt: string; /** Required to reference the upload when creating a FILEUPLOAD project. */ uploadUid: string; /** HTTP method for the upload request (defaults to POST). */ method?: string; /** S3 presigned form fields — append these before the file in multipart/form-data. */ fields?: SignedUploadFormField[]; headers?: SignedUploadHeader[]; } interface CreateProjectEnvironmentData { name: string; frameworkPreset?: FrameworkPreset; buildCommand?: string; outputDirectory?: string; environmentVariables?: Array<{ key: string; value: string; }>; } interface CreateGitProjectData { name: string; projectType: "GITPROVIDER"; repository?: { repositoryUrl: string; }; } interface CreateFileUploadProjectData { name: string; projectType: "FILEUPLOAD"; environment: CreateProjectEnvironmentData; fileUpload: { uploadUid: string; }; } type CreateProjectData = CreateGitProjectData | CreateFileUploadProjectData; interface WaitForEnvironmentOptions { /** Poll attempts before giving up (default: 6). */ retries?: number; /** Delay between attempts in milliseconds (default: 2000). */ intervalMs?: number; } interface UpdateProjectData { name?: string; } interface TransferGitRepositoryData { organizationUid: string; } interface CreateEnvironmentData { name: string; gitBranch?: string; frameworkPreset?: FrameworkPreset; buildCommand?: string; outputDirectory?: string; } interface UpdateEnvironmentData { name?: string; gitBranch?: string; frameworkPreset?: FrameworkPreset; buildCommand?: string; outputDirectory?: string; } interface CreateDeploymentData { commitSha?: string; commitMessage?: string; } interface ListProjectsOptions { limit?: number; } interface ListDeploymentsOptions { limit?: number; } interface DeploymentLogOptions { timestamp?: string; } interface ServerLogOptions { startTime?: number; endTime?: number; } interface RevalidateCDNData { paths?: string[]; cacheTags?: string[]; hostnames?: string[]; } declare class DeploymentsClient { private readonly http; constructor(http: ContentstackHttpClient); private basePath; list(projectUid: string, environmentUid: string, options?: ListDeploymentsOptions): AsyncIterable; listAll(projectUid: string, environmentUid: string, options?: ListDeploymentsOptions): Promise; /** * Returns the most recently created deployment for an environment. * Prefer this over `environment.latestDeployment` when polling deployment status. */ getLatest(projectUid: string, environmentUid: string): Promise; get(projectUid: string, environmentUid: string, deploymentUid: string): Promise; create(projectUid: string, environmentUid: string, data: CreateDeploymentData): Promise; getDeploymentLogs(projectUid: string, environmentUid: string, deploymentUid: string, options?: DeploymentLogOptions): Promise; getServerLogs(projectUid: string, environmentUid: string, deploymentUid: string, options?: ServerLogOptions): Promise; getUploadUrl(projectUid: string, environmentUid: string): Promise; getDownloadUrl(projectUid: string, environmentUid: string, deploymentUid: string): Promise; } declare class EnvironmentsClient { private readonly http; constructor(http: ContentstackHttpClient); list(projectUid: string): AsyncIterable; listAll(projectUid: string): Promise; /** * Poll until the first environment appears. Launch provisions environments asynchronously * after `projects.create`, so an immediate `listAll` may return an empty array. */ waitForFirst(projectUid: string, options?: WaitForEnvironmentOptions): Promise; get(projectUid: string, envUid: string): Promise; create(projectUid: string, data: CreateEnvironmentData): Promise; update(projectUid: string, envUid: string, data: UpdateEnvironmentData): Promise; delete(projectUid: string, envUid: string): Promise; revalidateCDNCache(projectUid: string, envUid: string, data: RevalidateCDNData): Promise; getUploadUrl(projectUid: string): Promise; } declare class ProjectsClient { private readonly http; constructor(http: ContentstackHttpClient); list(options?: ListProjectsOptions): AsyncIterable; listAll(options?: ListProjectsOptions): Promise; get(projectUid: string): Promise; create(data: CreateProjectData): Promise; update(projectUid: string, data: UpdateProjectData): Promise; delete(projectUid: string): Promise; transferGitRepository(projectUid: string, data: TransferGitRepositoryData): Promise; getUploadUrl(): Promise; } interface LaunchClientConfig { region: ContentstackRegion; organizationUid: string; auth: { type: "oauth"; accessToken: string; } | { type: "authtoken"; token: string; }; httpOptions?: Partial; } interface LaunchClient { projects: ProjectsClient; environments: EnvironmentsClient; deployments: DeploymentsClient; } declare function createLaunchClient(config: LaunchClientConfig): LaunchClient; export { type CreateDeploymentData as C, type DeploymentLog as D, type FrameworkPreset as F, type LaunchClient as L, type RevalidateCDNData as R, type ServerLog as S, type TransferGitRepositoryData as T, type UpdateEnvironmentData as U, type WaitForEnvironmentOptions as W, type CreateEnvironmentData as a, type CreateFileUploadProjectData as b, type CreateGitProjectData as c, type CreateProjectData as d, type CreateProjectEnvironmentData as e, type DeploymentLogOptions as f, type LaunchClientConfig as g, type LaunchDeployment as h, type LaunchDomain as i, type LaunchEnvironment as j, type LaunchProject as k, type ListDeploymentsOptions as l, type ListProjectsOptions as m, type ServerLogOptions as n, type SignedUploadFormField as o, type SignedUploadHeader as p, type SignedUploadUrl as q, type UpdateProjectData as r, createLaunchClient as s };