@almamedia-open-source/cdk-project-target
Version:
 
199 lines (198 loc) • 3.89 kB
TypeScript
import { Account } from '@almamedia-open-source/cdk-project-context';
/**
* @experimental
*/
export declare enum AccountType {
/**
* @experimental
*/
MOCK = "mock",
/**
* @experimental
*/
SHARED = "shared",
/**
* @experimental
*/
DEV = "dev",
/**
* @experimental
*/
PREPROD = "preprod",
/**
* @experimental
*/
PROD = "prod"
}
/**
* @experimental
*/
export interface AccountConfiguration {
/**
* @experimental
*/
readonly id: string;
/**
* @experimental
*/
readonly config?: Record<string, any>;
}
/**
* @experimental
*/
export interface ProjectAccounts {
/**
* @experimental
*/
readonly mock?: Account;
/**
* @experimental
*/
readonly shared?: Account;
/**
* @experimental
*/
readonly dev?: Account;
/**
* @experimental
*/
readonly preprod?: Account;
/**
* @experimental
*/
readonly prod?: Account;
}
/**
* @experimental
*/
export interface AccountsOneProps {
/**
* @experimental
*/
readonly [AccountType.MOCK]?: AccountConfiguration;
/**
* @experimental
*/
readonly [AccountType.SHARED]: AccountConfiguration;
}
/**
* @experimental
*/
export interface AccountsTwoProps {
/**
* @experimental
*/
readonly [AccountType.MOCK]?: AccountConfiguration;
/**
* @experimental
*/
readonly [AccountType.DEV]: AccountConfiguration;
/**
* @experimental
*/
readonly [AccountType.PROD]: AccountConfiguration;
}
/**
* @experimental
*/
export interface AccountThreeProps {
/**
* @experimental
*/
readonly [AccountType.MOCK]?: AccountConfiguration;
/**
* @experimental
*/
readonly [AccountType.DEV]: AccountConfiguration;
/**
* @experimental
*/
readonly [AccountType.PREPROD]: AccountConfiguration;
/**
* @experimental
*/
readonly [AccountType.PROD]: AccountConfiguration;
}
/**
* @experimental
*/
export declare class Accounts {
/**
* (experimental) Enables single account strategy.
*
* 1. `shared` account with environments:
* - development
* - feature/*
* - test
* - qaN
* - staging
* - preproduction
* - production
*
* @experimental
* @example
*
* Accounts.ONE({
* shared: {
* id: '111111111111',
* },
* }),
*/
static one(props: AccountsOneProps): Record<string, Account>;
/**
* (experimental) Enables dual account strategy.
*
* 1. `dev` account with environments:
* - development
* - feature/*
* - test
* - qaN
* - staging
* 2. `prod` account with environments:
* - preproduction
* - production
*
* @experimental
* @example
*
* Accounts.TWO({
* dev: {
* id: '111111111111',
* },
* prod: {
* id: '222222222222',
* },
* }),
*/
static two(props: AccountsTwoProps): Record<string, Account>;
/**
* (experimental) Enables triple account strategy.
*
* 1. `dev` account with environments:
* - development
* - feature/*
* - test
* - staging
* 2. `preprod` account with environments:
* - qaN
* - preproduction
* 3. `prod` account with environments:
* - production
*
* @experimental
* @example
*
* Accounts.THREE({
* dev: {
* id: '111111111111',
* },
* preprod: {
* id: '222222222222',
* },
* prod: {
* id: '333333333333',
* },
* }),
*/
static three(props: AccountThreeProps): Record<string, Account>;
}