import { NerdVisionConfig } from "./NerdVisionConfig"; export default class Configuration implements NerdVisionConfig { api_key: string; name: string; tags: { [key: string]: string; }; task_root: string; asyncTraceDepth: number; debug: boolean; api_url: string; grpc_backoff_max: number; grpc_backoff_multiplier: number; client_registration_backoff_multiplier: number; client_registration_backoff_max: number; env_max_str_length: number; env_regex: RegExp; license_url: string; license_api: string; grpc_url: string; grpc_port: number; event_snapshot_api: string; event_snapshot_url: string; event_error_api: string; event_error_url: string; max_step_count: number; bp_rate_limit: number; /** * This is the root of the project as a url e.g. file:///home/ben **/ root: string; /** * This is the root path of the project e.g. /home/ben **/ root_path: string; readonly isWindows: boolean; readonly pathPrefixLength: number; isServerless: boolean; static generateAuthToken(username: string, password: string): string; static findRoot(isWindows: boolean, isServerless: boolean, nvTaskRoot: string, lambdaRoot?: string, mainModule?: string, cwd?: string): Promise<{ root: string; root_path: string; }>; /** * Return the returns the ENV value if defined, if not then the config value. If neither are defined, returns null. * * @param type | string - the type of the value we expect from the ENV/Config so it can be assigned correctly in returnValForType * @param envValue | string - the value as defined in the ENV file (if applicable) * @param configValue | any - the value as defined in the config given to the init method (if applicable) */ private static addValueIfDefined; /** * Return the given value in the type specified * * @param value | any - the value from the ENV or config, typed as any because it depends on the type param. * @param type | string - The type of the value, so we can use the switch to return the value in the correct type. */ static returnValForType(value: any, type: 'number' | 'boolean' | 'string'): T; init(config: NerdVisionConfig, isServerless: boolean): Promise; /** * Adds tags property if they are defined in the ENV or config. * NOTE: Ignores config that doesn't follow the format: key=value * * @param userConfig | NerdVisionConfig - the config as defined in the init method (if applicable) * @param tagEnvVar the value from the environment */ private addTagsToConfig; }