UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

37 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.alwaysaiUserLoginPromptComponent = void 0; const post_tracking_data_to_hubspot_1 = require("../../infrastructure/post-tracking-data-to-hubspot"); const constants_1 = require("../../constants"); const util_1 = require("../../util"); const alwaysai_user_login_yes_component_1 = require("./alwaysai-user-login-yes-component"); async function alwaysaiUserLoginPromptComponent(props = {}) { const answers = await (0, util_1.promptForInput)({ purpose: 'to enter your alwaysAI user account credentials', alternative: 'authenticate yourself first with the command "alwaysai user login"', questions: [ { type: 'text', name: 'email', message: 'Email address associated with your alwaysAI user:', initial: props.alwaysaiUserEmail, validate: (value) => constants_1.VALID_EMAIL_REGULAR_EXPRESSION.test(value) || `"${value}" is not a valid email address` }, { type: 'password', name: 'password', message: 'Password', initial: props.alwaysaiUserPassword, validate: (value) => value.length >= 8 || 'Password must be eight or more characters' } ] }); await (0, alwaysai_user_login_yes_component_1.alwaysaiUserLoginYesComponent)({ alwaysaiUserEmail: answers.email, alwaysaiUserPassword: answers.password }); await (0, post_tracking_data_to_hubspot_1.postTrackingDataToHubspot)('activated_cli', true); } exports.alwaysaiUserLoginPromptComponent = alwaysaiUserLoginPromptComponent; //# sourceMappingURL=alwaysai-user-login-prompt-component.js.map