import { TDeployerMetadata, TDeploymentState, TDeploymentType, THref, TImageMetadata, TK8sMetadata, TTarFolderStructure } from "@shepherdorg/metadata"; import { TDescriptorsByKind } from "./deployment-actions/kubectl-action/k8s-deployment-document-identifier"; import { TFileSystemPath, TISODateString } from "./helpers/basic-types"; import { TDockerImageLabels } from "@shepherdorg/docker-image-metadata-loader"; import { TDeploymentRollout } from "./deployment-actions/kubectl-action/kubectl-deployment-action-factory"; import { TLogContext } from "@shepherdorg/logger"; export declare enum THerdSectionType { infrastructure = "infrastructure", images = "images", folders = "folders" } export declare type THerdSectionDeclaration = { herdSectionIndex: number; herdSectionType: THerdSectionType; }; export declare type THerdDeclaration = { key: string; description?: string; delete?: boolean; featureDeployment?: boolean; timeToLiveHours?: number; branchName?: string; sectionDeclaration?: THerdSectionDeclaration; }; export declare type TFolderHerdDeclaration = THerdDeclaration & { path: string; }; export declare type OmitKey = Omit; export declare type TDockerImageHerdDeclaration = THerdDeclaration & { dockerImage?: string; image: string; imagetag: string; }; export declare function isDockerImageHerdSpec(spec: TDockerImageHerdDeclaration | TFolderHerdDeclaration): spec is TDockerImageHerdDeclaration; export declare function isDockerDeploymentAction(spec: IAnyDeploymentAction): spec is IDockerDeploymentAction; export declare function isK8sDeploymentAction(spec: IStatefulExecutableAction): spec is IKubectlDeployAction; export declare type TK8sDeploymentPlan = { dockerLabels?: TDockerImageLabels; deployments?: {}; herdKey: string; displayName: string; files?: TTarFolderStructure; }; export declare type TShepherdMetadata = { imageDeclaration: TDockerImageHerdDeclaration; shepherdMetadata?: TImageMetadata; }; export declare type TImageInformation = TShepherdMetadata & { dockerLabels: { [key: string]: any; }; }; export declare type TDockerImageHerdDeclarations = { [imageKey: string]: OmitKey; }; export declare type TFolderHerdDeclarations = { [imageKey: string]: OmitKey; }; export declare type THerdFileStructure = { folders?: TFolderHerdDeclarations; infrastructure?: TDockerImageHerdDeclarations; images?: TDockerImageHerdDeclarations; }; export declare type TFolderMetadata = { path: TFileSystemPath; buildDate: TISODateString; displayName: string; semanticVersion: string; deploymentType: TDeploymentType; hyperlinks: Array; }; export declare type TActionResult = { code?: number; stdOut?: string; stdErr?: string; executedAction?: IExecutableActionV2; }; export interface IExecutableActionV2 { planString(): string; execute(deploymentOptions: TActionExecutionOptions): Promise; } export interface IBasicExecutableAction { planString(): string; execute(deploymentOptions: TActionExecutionOptions): Promise; } export interface IStatefulExecutableAction extends IBasicExecutableAction { isStateful: boolean; descriptor: string; getActionDeploymentState(): TDeploymentState | undefined; setActionDeploymentState(newState: TDeploymentState | undefined): void; canRollbackExecution(): this is ICanRollbackActionExecution; } export declare type TRollbackResult = TActionResult & { code: number; stdOut?: string; stdErr?: string; }; export interface ICanRollbackActionExecution { rollback(deploymentOptions: TActionExecutionOptions): Promise; } export declare function canRollbackExecution(action: object): action is ICanRollbackActionExecution; export interface IBaseDeploymentAction { metadata: TImageMetadata | TFolderMetadata; herdKey: string; identifier: string; env: string; type: string; version?: string; } export interface IDockerExecutableAction extends IStatefulExecutableAction { command: string; descriptor: string; dockerParameters: string[]; operation: string; origin: string; imageWithoutTag?: string; forTestParameters?: string[]; identifier: string; execute(deploymentOptions: TActionExecutionOptions): Promise; } export interface IDockerDeploymentAction extends IDockerExecutableAction, IBaseDeploymentAction { displayName: string; herdDeclaration: TDockerImageHerdDeclaration; metadata: TDeployerMetadata; } export interface IKubectlAction extends IStatefulExecutableAction { identifier: string; type: string; operation: string; } export interface IKubectlDeployAction extends IKubectlAction { deploymentRollouts: TDeploymentRollout[]; descriptor: string; descriptorsByKind?: TDescriptorsByKind; fileName: string; origin: string; } export declare function isKubectlDeployAction(deployAction: IStatefulExecutableAction): deployAction is IKubectlDeployAction; export interface IK8sDirDeploymentAction extends IKubectlDeployAction, IBaseDeploymentAction { herdDeclaration: TFolderHerdDeclaration; metadata: TFolderMetadata; } export interface IDockerImageKubectlDeploymentAction extends IKubectlDeployAction, IBaseDeploymentAction { herdDeclaration: TDockerImageHerdDeclaration; metadata: TK8sMetadata; } export declare type IAnyDeploymentAction = IDockerDeploymentAction | IDockerImageKubectlDeploymentAction | IK8sDirDeploymentAction; export declare type TDeploymentOptions = { dryRunOutputDir: TFileSystemPath | undefined; dryRun: boolean; }; export declare type TActionExecutionOptions = TDeploymentOptions & { waitForRollout: boolean; rolloutWaitSeconds?: number; pushToUi: boolean; logContext: TLogContext; }; export declare type FnDeploymentStateSave = (stateSignatureObject: any) => Promise; export declare type IPushToShepherdUI = { pushDeploymentStateToUI: (deploymentState: any) => Promise; };