-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompt_schema.js
More file actions
73 lines (68 loc) · 1.46 KB
/
Copy pathprompt_schema.js
File metadata and controls
73 lines (68 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
prompt_schema.js
Questions for prompt.
*/
exports.credentials = [{
name: 'subdomain',
type: 'input',
message: 'Subdomain:',
validate: function( value ) {
if (value.length) {
return true;
} else {
return 'Please enter your subdomain';
}
}
},{
name: 'username',
type: 'input',
message: 'Username:',
validate: function( value ) {
if (value.length) {
return true;
} else {
return 'Please enter your username or e-mail address';
}
}
},{
name: 'password',
type: 'password',
message: 'Password:',
validate: function(value) {
if (value.length) {
return true;
} else {
return 'Please enter your password';
}
}
}];
exports.menu = [{
type: 'list',
name: 'menu',
message: 'Menu:\n',
choices: ['View all tickets', 'View a ticket', 'Exit'],
default: 'View all tickets'
}];
exports.ticket_number = [{
type: 'input',
name: 'ticket_number',
message: 'Enter ticket ID:\n',
validate: function(value){
var pass = value.match(/^[0-9]*$/)
if (pass){
return true
}
else {
return "Please enter a valid ticket ID (numbers only)."
}
}
}];
exports.view_more = [{
type: 'confirm',
name: 'view_more',
message: 'More tickets available! View more?',
}];
if (require.main === module){
console.log('Please run `node main.js`!')
} else {
}