UNPKG

@altostra/core

Version:

Core library for shared types and logic

45 lines (44 loc) 2.93 kB
import type { NonEmptyString } from "../../../common/CustomTypes/NonEmptyString"; import type { Name } from "../../../common/Models/Name"; import type { Assertion, ObjectOfTypeValidation } from '@altostra/type-validations'; import type { DeploymentStrategy } from "../../DeploymentSettings"; export interface DeploymentResponseBase { deploymentStrategy: DeploymentStrategy; region: string; } export interface DownloadDeploymentResponse extends DeploymentResponseBase { deploymentStrategy: 'Download'; } export declare type BossDownloadDeploymentResponse = BossDeploymentResponse<DownloadDeploymentResponse>; export interface AutoDeploymentResponse extends DeploymentResponseBase { deploymentStrategy: 'Auto'; stackId: NonEmptyString; } export declare type BossAutoDeploymentResponse = BossDeploymentResponse<AutoDeploymentResponse>; export interface ManualDeploymentResponse extends DeploymentResponseBase { deploymentStrategy: 'Manual'; changeSetId: NonEmptyString; stackId: NonEmptyString; readonly changesetUrl: string; } export declare type BossManualDeploymentResponse = BossDeploymentResponse<ManualDeploymentResponse>; export declare type DeploymentResponse = AutoDeploymentResponse | DownloadDeploymentResponse | ManualDeploymentResponse; export declare type BossDeploymentResponse<T extends DeploymentResponseBase = DeploymentResponse> = T & { environment: Name; }; export declare const validateDownloadDeploymentResponse: ObjectOfTypeValidation<DownloadDeploymentResponse>; export declare const validateBossDownloadDeploymentResponse: import("@altostra/type-validations").TypeValidation<{ environment: Name; } & DownloadDeploymentResponse>; export declare const validateAutoDeploymentResponse: ObjectOfTypeValidation<AutoDeploymentResponse>; export declare const validateBossAutoDeploymentResponse: import("@altostra/type-validations").TypeValidation<{ environment: Name; } & AutoDeploymentResponse>; export declare const validateManualDeploymentResponse: ObjectOfTypeValidation<ManualDeploymentResponse>; export declare const validateBossManualDeploymentResponse: import("@altostra/type-validations").TypeValidation<{ environment: Name; } & ManualDeploymentResponse>; export declare const isDeploymentResponse: import("@altostra/type-validations").TypeValidation<DownloadDeploymentResponse | AutoDeploymentResponse | ManualDeploymentResponse>; export declare function bossDeploymentResponseValidation<T extends DeploymentResponseBase>(validation: ObjectOfTypeValidation<T>): ObjectOfTypeValidation<BossDeploymentResponse<T>>; export declare const isBossDeploymentResponse: import("@altostra/type-validations").TypeValidation<BossDeploymentResponse<AutoDeploymentResponse> | BossDeploymentResponse<ManualDeploymentResponse> | BossDeploymentResponse<DownloadDeploymentResponse>>; export declare const validateBossDeploymentResponse: Assertion<BossDeploymentResponse>;