@altostra/core
Version:
Core library for shared types and logic
39 lines (38 loc) • 1.68 kB
TypeScript
import type { Blueprint } from "../../../blueprint";
import type { Maybe } from "../../../common/Maybe";
import type { Owner } from "./Owner";
import type { IProject, Project, ProjectId } from "./Project";
import type { Deployer, DeploymentId, DeploymentStatus, Version } from "./Types";
export interface IDeployment {
readonly id: DeploymentId;
readonly project: IProject;
}
export declare class Deployment implements IDeployment {
readonly project: Project;
readonly owner: Owner;
created: Date;
versions: DeploymentVersion[];
name: string;
namespace?: string | undefined;
constructor(project: Project, owner: Owner, created: Date, versions: DeploymentVersion[], name?: string, namespace?: string | undefined);
get id(): DeploymentId;
getLatestVersion(): Maybe<DeploymentVersion>;
addVersion(deploymentVersion: DeploymentVersion): DeploymentVersion;
static isValidId(value: unknown): value is ProjectId;
}
export declare class DeploymentVersion {
readonly deployment: Deployment;
version: Version;
blueprints: Blueprint[];
sourcesRef: string;
projectRef: string;
updated: Date;
deployedBy: Deployer;
isLatestVersion: boolean;
extraData?: Record<string, string> | undefined;
private deploymentStatus;
constructor(deployment: Deployment, version: Version, status: DeploymentStatus, blueprints: Blueprint[], sourcesRef: string, projectRef: string, updated: Date, deployedBy: Deployer, isLatestVersion?: boolean, extraData?: Record<string, string> | undefined);
canChangeStatus(): boolean;
get status(): DeploymentStatus;
updateStatus(newStatus: DeploymentStatus): void;
}