@almamedia-open-source/cdk-project-target
Version:
 
89 lines (88 loc) • 1.93 kB
TypeScript
/**
* (experimental) Availalbe Enviroment Categories.
*
* Categories are useful grouping to make distinction between `stable`
* environments (`staging` & `production`) from `feature` or `verification`
* environments (such as `test` or `preproduction`).
*
* @experimental
*/
export declare enum EnvironmentCategory {
/**
* @experimental
*/
MOCK = "mock",
/**
* @experimental
*/
DEVELOPMENT = "development",
/**
* @experimental
*/
FEATURE = "feature",
/**
* @experimental
*/
VERIFICATION = "verification",
/**
* @experimental
*/
STABLE = "stable"
}
/**
* (experimental) Available Environment Labels.
*
* Labels are useful since Environment Name can be complex,
* such as `feature/foo-bar` or `qa3`,
* but we need to be able to “label” all `feature/*` and `qaN` environments
* as either `feature` or `qa`.
*
* @experimental
*/
export declare enum EnvironmentLabel {
/**
* @experimental
*/
MOCK = "mock[0-9]",
/**
* @experimental
*/
DEVELOPMENT = "development",
/**
* @experimental
*/
FEATURE = "feature/[/a-zA-z0-9-]+",
/**
* @experimental
*/
TEST = "test",
/**
* @experimental
*/
STAGING = "staging",
/**
* @experimental
*/
QA = "qa[0-9]",
/**
* @experimental
*/
PREPRODUCTION = "preproduction",
/**
* @experimental
*/
PRODUCTION = "production"
}
/**
* Map Environment Type to Environment Category.
* I.e. `staging` and `production` are considered being `stable` environments.
*/
export declare const labelToCategory: Record<EnvironmentLabel, EnvironmentCategory>;
/**
* TODO document
*/
export declare function getLabelByName(name: string): EnvironmentLabel;
/**
* TODO document
*/
export declare function getCategoryByLabel(label: EnvironmentLabel): EnvironmentCategory;