import * as _backstage_core_plugin_api from '@backstage/core-plugin-api'; import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'; import React from 'react'; import { Entity } from '@backstage/catalog-model'; interface PipelinePageProps { orgSlug?: string; pipelineSlug?: string; } declare const BuildkiteWrapper: () => React.JSX.Element; type Status = 'CANCELED' | 'CANCELING' | 'CREATING' | 'FAILED' | 'FAILING' | 'NOT_RUN' | 'BLOCKED' | 'UNBLOCKED' | 'PAUSED' | 'CONTINUE' | 'PASSED' | 'RUNNING' | 'SCHEDULED' | 'SKIPPED' | 'WAIT' | 'WAITER' | 'WAITING' | 'ACCEPTED' | 'ASSIGNED' | 'LIMITED' | 'LIMITING' | 'WAITING_FAILED' | 'TIMING_OUT' | 'Undetermined'; type BuildParams = { status: Status; buildMessage: string; buildNumber: string; author: { avatar: string; name: string; }; branch: string; commitId: string; createdAt: string; timeElapsed: string; steps: BuildStepParams[]; }; type BuildStepParams = { id: string; title?: string; command?: string; icon?: string; status: Status; url?: string; }; type PipelineParams = { name: string; id: string; orgSlug: string; slug: string; navatarColor: string; navatarImage: string; builds: BuildParams[]; repository?: string; }; type DeploymentParams = { id: string; number: number; stage: string; app?: string; status: Status; commit: string; branch: string; message: string; createdAt: string; author: { name: string; avatar: string; }; url: string; version?: string; web_url?: string; }; type BuildRowProps = { build: BuildParams; pipeline: PipelineParams; index: number; expanded: boolean; onExpandClick: (index: number) => void; isUTC: boolean; onTimeClick: () => void; }; declare const BuildRow: React.FC; interface BuildkitePluginConfig { defaultPageSize?: number; apiBaseUrl?: string; } declare const buildkitePlugin: _backstage_core_plugin_api.BackstagePlugin<{ root: _backstage_core_plugin_api.RouteRef; pipeline: _backstage_core_plugin_api.SubRouteRef<_backstage_core_plugin_api.PathParams<"/pipelines/:pipelineSlug">>; build: _backstage_core_plugin_api.SubRouteRef<_backstage_core_plugin_api.PathParams<"/builds/:buildNumber">>; }, {}, {}>; declare const PipelinePage: ({ orgSlug: propOrgSlug, pipelineSlug: propPipelineSlug, }: PipelinePageProps) => JSX.Element; interface BuildkiteBuildsOptions { page?: number; per_page?: number; branch?: string; } interface JobLog { content: string[]; } interface BuildTriggerOptions { commit?: string; branch?: string; message?: string; author?: { name: string; email: string; }; env?: Record; meta_data?: Record; } interface User { avatar_url: string; created_at: string; email: string; graphql_id: string; id: string; name: string; buildkite_avatar_url?: string; } interface BuildkiteAPI { getUser(): Promise; getPipeline(orgSlug: string, pipelineSlug: string): Promise; getBuilds(orgSlug: string, pipelineSlug: string): Promise; getDeployments(orgSlug: string, pipelineSlug: string): Promise; getBuildSteps(orgSlug: string, pipelineSlug: string, buildNumber: string): Promise; rebuildBuild(orgSlug: string, pipelineSlug: string, buildNumber: string): Promise; getJobLogs(orgSlug: string, pipelineSlug: string, buildNumber: string, jobId: string): Promise; triggerBuild(orgSlug: string, pipelineSlug: string, options: BuildTriggerOptions): Promise; getPipelineConfig(orgSlug: string, pipelineSlug: string): Promise; updatePipelineConfig(orgSlug: string, pipelineSlug: string, config: string): Promise; } declare const buildkiteAPIRef: _backstage_core_plugin_api.ApiRef; declare class BuildkiteClient implements BuildkiteAPI { private readonly discoveryAPI; private readonly fetchAPI; private transforms; constructor(options: { discoveryAPI: DiscoveryApi; fetchAPI: FetchApi; config: BuildkitePluginConfig; }); private getCommonHeaders; getJobLogs(orgSlug: string, pipelineSlug: string, buildNumber: string, jobId: string): Promise; private calculateBuildDuration; private getBaseURL; getUser(): Promise; getPipeline(orgSlug: string, pipelineSlug: string): Promise; getBuilds(orgSlug: string, pipelineSlug: string, options?: BuildkiteBuildsOptions): Promise; getDeployments(orgSlug: string, pipelineSlug: string): Promise; getBuildSteps(orgSlug: string, pipelineSlug: string, buildNumber: string): Promise; rebuildBuild(orgSlug: string, pipelineSlug: string, buildNumber: string): Promise; triggerBuild(orgSlug: string, pipelineSlug: string, options: BuildTriggerOptions): Promise; getPipelineConfig(orgSlug: string, pipelineSlug: string): Promise; updatePipelineConfig(orgSlug: string, pipelineSlug: string, config: string): Promise; } /** * The annotation key used to store Buildkite pipeline slug. */ declare const BUILDKITE_ANNOTATION = "buildkite.com/pipeline-slug"; /** * Parses a Buildkite project slug into organization and pipeline slugs. * * @param projectSlug - The project slug in format "organization-slug/pipeline-slug" * @returns Object containing separated organizationSlug and pipelineSlug * @throws Error if the slug format is invalid */ declare function parseBuildkiteProjectSlug(projectSlug: string): { organizationSlug: string; pipelineSlug: string; }; /** * Checks if Buildkite integration is available for an entity. * * @param entity - The entity to check * @returns True if Buildkite integration is available */ declare function isBuildkiteAvailable(entity: Entity): boolean; /** * Version number of the Buildkite plugin. * This should match the version in package.json */ declare const VERSION = "1.3.0"; export { BUILDKITE_ANNOTATION, BuildRow, BuildkiteClient, BuildkiteWrapper, PipelinePage, VERSION, buildkiteAPIRef, buildkitePlugin, isBuildkiteAvailable, parseBuildkiteProjectSlug };