import { FilesServiceInterface, EnvironmentConfigVar } from '../../typescript-angular'; import { ApplicationsServiceInterface } from '../../typescript-angular'; import { CommonArgs } from './common-args'; import { EnvironmentConfigVarList } from './model'; export interface CreateRequestArgs extends CommonArgs { var: EnvironmentConfigVar; } export interface UpdateRequestArgs extends CommonArgs { var: EnvironmentConfigVar; } export interface ReplaceAllArgs extends CommonArgs { varList: EnvironmentConfigVarList; } export interface DeleteRequestArgs extends CommonArgs { name: string; } export interface GetRequestArgs extends CommonArgs { name: string; } export type ListRequestArgs = CommonArgs; export declare function blob_to_str(blob: Blob): Promise; /** * ApplicationEnvironmentConfig provides a facade for managing the configuration of an * application's environment. * * The general approach taken in to map multiple environment variables into a single * Files API file, which is linked to a single EnvironmentConfig in the application instance. * Consequently, the majority of the complexity here is in managing that File and the * EnvironmentConfig. */ export declare class ApplicationEnvironmentConfig { private files; private applications; constructor(files: FilesServiceInterface, applications: ApplicationsServiceInterface); private find_environ_config; private get_env_vars_as_obj; private create_env_file; private update_env_file; private create_env_config_vars; private create_environ_config; private update_environ_config; private update_environ_config_to_file; private apply_updated_env; private get_file_store_uri_if_exists; /** * Updates the local state with the state from the API. Call this before anything * else. */ private get_state; private ensure_state; private replace_vars; /** * Creates a new environment variable. * * @param args The arguments for the create function. In particular, a `name` and `value` to set. * * @return An EnvConfigVar representing the newly created environment variable. */ create(args: CreateRequestArgs): Promise; /** * Updates an existing environment variable. * * @param args The arguments for the update function. In particular, a `name` and `value` to update. * * @return An EnvConfig representing the updated environment variable. * * @throws An EnvironmentConfigError with `status` '404' if `name` is not found. */ update(args: UpdateRequestArgs): Promise; /** * Replaces all environment variables. This will replace the entire set, so any that were previously * present but now are not will be removed. Any new ones will be added. Any existing ones will be * updated. This is useful if the workflow using the SDK operates on the entire set of environment * variables at once. * * @param args The arguments for the replace_all function. * * @return An EnvironmentConfigVarList representing the updated environment variables. */ replace_all(args: ReplaceAllArgs): Promise; /** * Patches any environment variables which have changed. New ones are added, existing updated * if they have changed, and removed removed. Takes the union of all items in the values to apply, * and the values from the API, giving priority to the ones to apply. * Remove any items which were in the baseline, but not in the set to apply. * * @param args The arguments for the replace_all function. * * @return An EnvironmentConfigVarList representing the latest values stored in the API. */ patch_all(args: ReplaceAllArgs): Promise; /** * Deletes an Enviroment Variable. * * @param args The arguments for the celete function. In particular, a `name` to delete * * @throws An EnvironmentConfigError with `status` '404' if `name` is not found. */ delete(args: DeleteRequestArgs): Promise; /** * Gets an environment variable * * @param args The arguments for the get function. In particular, a `name` to get. * * @return An EnvConfig representing the environment variable. * * @throws An EnvironmentConfigError with `status` '404' if `name` is not found. */ get(args: GetRequestArgs): Promise; /** * Gets all of the environment variables for the application instance. * * @param args The arguments to the list function. * * @return An EnvConfig[] representing the environment variables. */ list(args: ListRequestArgs): Promise; }