parse-dashboard 9.0.0-alpha.1 → 9.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
const crypto = require('crypto');
|
|
2
|
-
let inquirer
|
|
3
|
-
|
|
4
|
-
inquirer
|
|
5
|
-
|
|
2
|
+
let inquirer;
|
|
3
|
+
const loadInquirer = async () => {
|
|
4
|
+
if (!inquirer) {
|
|
5
|
+
const mod = await import('inquirer');
|
|
6
|
+
inquirer = mod.default || mod;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
6
9
|
const OTPAuth = require('otpauth');
|
|
7
10
|
const { copy } = require('./utils.js');
|
|
8
11
|
const phrases = {
|
|
@@ -11,9 +14,10 @@ const phrases = {
|
|
|
11
14
|
enterAppName: 'Enter the app name:',
|
|
12
15
|
}
|
|
13
16
|
const getAlgorithm = async () => {
|
|
17
|
+
await loadInquirer();
|
|
14
18
|
let { algorithm } = await inquirer.prompt([
|
|
15
19
|
{
|
|
16
|
-
type: '
|
|
20
|
+
type: 'select',
|
|
17
21
|
name: 'algorithm',
|
|
18
22
|
message: 'Which hashing algorithm do you want to use?',
|
|
19
23
|
default: 'SHA1',
|
|
@@ -141,6 +145,7 @@ const showInstructions = ({ app, username, passwordCopied, encrypt, config }) =>
|
|
|
141
145
|
|
|
142
146
|
module.exports = {
|
|
143
147
|
async createUser() {
|
|
148
|
+
await loadInquirer();
|
|
144
149
|
const data = {};
|
|
145
150
|
|
|
146
151
|
console.log('');
|
|
@@ -210,6 +215,7 @@ module.exports = {
|
|
|
210
215
|
showInstructions({ app: data.app, username, passwordCopied: true, encrypt, config });
|
|
211
216
|
},
|
|
212
217
|
async createMFA() {
|
|
218
|
+
await loadInquirer();
|
|
213
219
|
console.log('');
|
|
214
220
|
const { username, app } = await inquirer.prompt([
|
|
215
221
|
{
|