@@ -30,22 +30,27 @@ const g_lib = require("../support");
3030 * @param {string[] } config.admins - Array of admin user IDs
3131 * @param {string } [config.endpoint] - Globus endpoint (required for GLOBUS type)
3232 * @param {string } [config.path] - File path (required for GLOBUS type)
33- * @param {string } [config.pub_key] - Public SSH key (required for GLOBUS type)
33+ * @param {string } [config.pub_key] - Public key for ZeroMQ CURVE authentication (required for GLOBUS type)
3434 * @param {string } [config.address] - Network address (required for GLOBUS type)
3535 * @param {string } [config.exp_path] - Export path (optional for GLOBUS type)
3636 * @param {string } [config.domain] - Domain name (required for GLOBUS type)
3737 * @returns {{ok: boolean, error: *}|{ok: boolean, value: *} } Result object containing repository or error
3838 * @see https://doc.rust-lang.org/book/ch06-02-match.html
3939 */
4040const createRepositoryByType = ( config ) => {
41- // Validate common fields
42- if ( ! config . id || ! config . type || ! config . title || ! config . capacity || ! config . admins ) {
41+ const missingFields = [ ] ;
42+ if ( ! config . id ) missingFields . push ( "id" ) ;
43+ if ( ! config . type ) missingFields . push ( "type" ) ;
44+ if ( ! config . title ) missingFields . push ( "title" ) ;
45+ if ( ! config . capacity ) missingFields . push ( "capacity" ) ;
46+ if ( ! config . admins ) missingFields . push ( "admins" ) ;
47+
48+ if ( missingFields . length > 0 ) {
4349 return Result . err ( {
4450 code : g_lib . ERR_INVALID_PARAM ,
45- message : " Missing required repository fields" ,
51+ message : ` Missing required repository fields: ${ missingFields . join ( ", " ) } ` ,
4652 } ) ;
4753 }
48-
4954 /**
5055 * Type-based creation using switch (Rust match pattern)
5156 * Each case is like a match arm in Rust, handling a specific variant
0 commit comments