Skip to content

Commit 8052f3c

Browse files
committed
Update endpoint analytics
1 parent 994abb3 commit 8052f3c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cli.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,10 +766,14 @@ const processCLI = function (cmdRun, session) {
766766
const username = readlineSync.questionEMail(` - ${CPROMPT}Your identity${CRESET} : `, { limitMessage: " * Your login email is invalid." })
767767
const password = readlineSync.question(` - ${CPROMPT}Your password${CRESET} : `, { hideEchoBack: true })
768768
return new Promise(function (resolve) {
769+
analytics.updateEvent("_userauth.sign_in", undefined, undefined, true)
769770
authenticate(username, password).then(function (userSession) {
770771
showSubscriptionPlan(userSession)
771772
resolve()
772-
}).catch(error => console.error(error) && resolve())
773+
}).catch(error => {
774+
analytics.updateEvent("_userauth.auth_fail", undefined, undefined, false)
775+
console.error(error) && resolve()
776+
})
773777
})
774778
} else if (cmdRun === "UPGRADE") {
775779
const subscriptionPlan = readlineSync.keyInSelect([
@@ -792,6 +796,7 @@ const processCLI = function (cmdRun, session) {
792796
min: 8, max: 24,
793797
confirmMessage: ` - ${CPROMPT}Confirm password${CRESET} : `
794798
})
799+
analytics.updateEvent("_userauth.sign_up", undefined, undefined, true)
795800
registerUser(fullname, username, password).then(function (user) {
796801
const activation = readlineSync.question(` - ${CPROMPT}Activation code${CRESET} : `, { hideEchoBack: false })
797802
confirmRegistration(user.username, activation).then(function (resultCode) {

const.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ const ALLOWED_COMANDS = ["INIT", "LOGIN", "REGISTER", "CREATE", "DEPLOY", "DESTR
6868

6969
module.exports = {
7070
ALLOWED_COMANDS,
71-
AVAILABLE_COMMANDS
71+
AVAILABLE_COMMANDS,
72+
PLAN_DEFINITIONS
7273
}

0 commit comments

Comments
 (0)