-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompt.js
45 lines (41 loc) · 973 Bytes
/
prompt.js
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
"use strict";
const prompt = require("prompt");
module.exports = (cb) => {
const schema = {
properties: {
email: {
description: "Your e-mail address (e.g. [email protected])",
pattern: /.+@.+/,
required: true
},
password: {
description: "Your password (hidden input)",
pattern: /.+/,
hidden: true,
required: true
},
site: {
description: "Base URL (e.g. https://hipchat.your.company.com)",
pattern: /.+/,
required: true
},
memberIdOther: {
description: "Other member's (numeric) member ID (e.g. 1201)",
pattern: /^[0-9]+$/,
required: true
},
dateFrom: {
description: "Delete messages from (e.g. 2016-01-31)",
pattern: /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/,
required: true
},
dateUntil: {
description: "Delete messages until (e.g. 2016-05-31)",
pattern: /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/,
required: true
}
}
};
prompt.start();
prompt.get(schema, cb);
};