diff --git a/lib/inquirer.js b/lib/inquirer.js index adafd6b..3ab7a55 100644 --- a/lib/inquirer.js +++ b/lib/inquirer.js @@ -31,6 +31,13 @@ module.exports = a = { message: 'Please enter your authentication code', validate }]), + askFamilyView: () => + inquirer.prompt([{ + name: 'pin', + type: 'password', + message: 'Please provide your family view pin', + validate: e => e && !isNaN(e) && e.length === 4 + }]), askRestrictions: () => inquirer.prompt([{ name: 'tradableOnly', diff --git a/lib/logon.js b/lib/logon.js index 69f0a56..34134b6 100644 --- a/lib/logon.js +++ b/lib/logon.js @@ -27,5 +27,24 @@ module.exports = { back({ manager, community }); }); + }), + checkFamilyView: community => new Promise(back => { + community.loggedIn((error, loggedIn, familyView) => { + if (error) + back(['ERROR']); + + if (!loggedIn) + back(['NOTLOGGEDIN']); + + back(familyView); + }); + }), + parentalUnlock: (community, pin) => new Promise(back => { + community.parentalUnlock(pin , error => { + if (error) + back(['ERROR']); + + back(); + }); }) }; \ No newline at end of file