1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const inquirer = require("inquirer");
|
4 | exports.ANSWER_OVERWRITE = 'overwrite';
|
5 | exports.ANSWER_UPDATE = 'update';
|
6 | exports.ANSWER_CANCEL = 'cancel';
|
7 | exports.ANSWER_BACKUP = 'backup';
|
8 | function promptForPlatform() {
|
9 | const questions = [
|
10 | {
|
11 | type: 'list',
|
12 | name: 'platform',
|
13 | message: 'Choose your platform',
|
14 | choices: [{
|
15 | value: 'alexaSkill',
|
16 | name: 'Alexa Skill (alexaSkill)',
|
17 | }, {
|
18 | value: 'googleAction',
|
19 | name: 'GoogleAction with DialogFlow (googleAction)',
|
20 | },
|
21 | ],
|
22 | },
|
23 | ];
|
24 | return inquirer.prompt(questions);
|
25 | }
|
26 | exports.promptForPlatform = promptForPlatform;
|
27 | function promptForInit(message) {
|
28 | const questions = [
|
29 | {
|
30 | type: 'list',
|
31 | name: 'platform',
|
32 | message,
|
33 | choices: [{
|
34 | value: 'alexaSkill',
|
35 | name: 'Alexa Skill (alexaSkill)',
|
36 | }, {
|
37 | value: 'googleAction',
|
38 | name: 'GoogleAction with DialogFlow (googleAction)',
|
39 | },
|
40 | ],
|
41 | },
|
42 | ];
|
43 | return inquirer.prompt(questions);
|
44 | }
|
45 | exports.promptForInit = promptForInit;
|
46 | function promptListForProjectId(choices) {
|
47 | const questions = [{
|
48 | type: 'list',
|
49 | name: 'id',
|
50 | message: 'Select your project:',
|
51 | paginated: true,
|
52 | choices,
|
53 | }];
|
54 | return inquirer.prompt(questions);
|
55 | }
|
56 | exports.promptListForProjectId = promptListForProjectId;
|
57 | function promptOverwriteProject() {
|
58 | const questions = [
|
59 | {
|
60 | type: 'list',
|
61 | name: 'overwrite',
|
62 | message: 'There is a folder with a same name. What would you like to do?',
|
63 | choices: [{
|
64 | value: exports.ANSWER_OVERWRITE,
|
65 | name: 'Overwrite',
|
66 | }, {
|
67 | value: exports.ANSWER_CANCEL,
|
68 | name: 'Cancel',
|
69 | },
|
70 | ],
|
71 | },
|
72 | ];
|
73 | return inquirer.prompt(questions);
|
74 | }
|
75 | exports.promptOverwriteProject = promptOverwriteProject;
|
76 | function promptUpdateVersions(numPackages) {
|
77 | const questions = [
|
78 | {
|
79 | type: 'list',
|
80 | name: 'update',
|
81 | message: `Currently ${numPackages} packages are out of date. What would you like to do?`,
|
82 | choices: [{
|
83 | value: exports.ANSWER_UPDATE,
|
84 | name: 'Update all packages to the newest version',
|
85 | }, {
|
86 | value: exports.ANSWER_CANCEL,
|
87 | name: 'Cancel',
|
88 | },
|
89 | ],
|
90 | },
|
91 | ];
|
92 | return inquirer.prompt(questions);
|
93 | }
|
94 | exports.promptUpdateVersions = promptUpdateVersions;
|
95 | function promptOverwriteProjectFiles() {
|
96 | const questions = [
|
97 | {
|
98 | type: 'list',
|
99 | name: 'overwrite',
|
100 | message: 'Found existing project files. How to proceed?',
|
101 | choices: [{
|
102 | value: exports.ANSWER_OVERWRITE,
|
103 | name: 'Overwrite',
|
104 | }, {
|
105 | value: exports.ANSWER_CANCEL,
|
106 | name: 'Cancel',
|
107 | },
|
108 | ],
|
109 | },
|
110 | ];
|
111 | return inquirer.prompt(questions);
|
112 | }
|
113 | exports.promptOverwriteProjectFiles = promptOverwriteProjectFiles;
|
114 | function promptOverwriteReverseBuild() {
|
115 | const questions = [
|
116 | {
|
117 | type: 'list',
|
118 | name: 'promptOverwriteReverseBuild',
|
119 | message: 'Found existing model files. How to proceed?',
|
120 | choices: [{
|
121 | value: exports.ANSWER_OVERWRITE,
|
122 | name: 'Overwrite',
|
123 | }, {
|
124 | value: exports.ANSWER_BACKUP,
|
125 | name: 'Backup old file and proceed',
|
126 | }, {
|
127 | value: exports.ANSWER_CANCEL,
|
128 | name: 'Cancel',
|
129 | },
|
130 | ],
|
131 | },
|
132 | ];
|
133 | return inquirer.prompt(questions);
|
134 | }
|
135 | exports.promptOverwriteReverseBuild = promptOverwriteReverseBuild;
|
136 | function promptNewProject() {
|
137 | const questions = [
|
138 | {
|
139 | type: 'input',
|
140 | name: 'directory',
|
141 | message: 'Missing argument <directory>. How do you want to name your Jovo project?',
|
142 | },
|
143 | ];
|
144 | return inquirer.prompt(questions);
|
145 | }
|
146 | exports.promptNewProject = promptNewProject;
|
147 |
|
\ | No newline at end of file |