alwaysai
Version:
The alwaysAI command-line interface (CLI)
28 lines • 966 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const alwayscli_1 = require("@alwaysai/alwayscli");
const constants_1 = require("../constants");
const placeholder = '<address>';
exports.alwaysaiUserEmailCliInput = {
required: false,
async getValue(argv) {
if (!argv) {
return undefined;
}
if (argv.length > 2) {
throw new alwayscli_1.UsageError(`Expected a single ${placeholder}`);
}
if (!argv[0]) {
throw new alwayscli_1.UsageError(`Expected an ${placeholder}`);
}
if (!constants_1.VALID_EMAIL_REGULAR_EXPRESSION.test(argv[0])) {
throw new alwayscli_1.TerseError(`"${argv[0]}" is not a valid email`);
}
return argv[0];
},
getDescription() {
return 'Email address associated with your alwaysAI user account';
},
placeholder,
};
//# sourceMappingURL=alwaysai-user-email-cli-input.js.map