namespace _zeitbild.repository.auth_internal { /** */ var _chest : ( null | lib_plankton.storage.type_chest< Array, Record, lib_plankton.database.type_description_create_table, lib_plankton.storage.sql_table_common.type_sql_table_common_search_term, Record > ) = null; /** */ function get_chest( ) : lib_plankton.storage.type_chest< Array, Record, lib_plankton.database.type_description_create_table, lib_plankton.storage.sql_table_common.type_sql_table_common_search_term, Record > { if (_chest === null) { _chest = lib_plankton.storage.sql_table_common.chest( { "database_implementation": _zeitbild.database.get_implementation(), "table_name": "auth_internal", "key_names": ["name"], } ); } else { // do nothing } return _chest; } /** */ export function read( name : string ) : Promise { return ( get_chest().read([name]) .then( (row) => Promise.resolve(row["password_image"]) ) ); } /** */ export function write( name : string, password_image : string ) : Promise { return get_chest().write([name], {"password_image": password_image}); } /** */ export function delete_( name : string ) : Promise { return get_chest().delete([name]); } }