zcatalyst-cli 1.9.1 → 1.10.0
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.
- package/README.md +3 -3
- package/docs/command_needs/auth.toml +5 -0
- package/docs/commands/iac/export.toml +4 -0
- package/docs/commands/iac/import.toml +4 -0
- package/docs/commands/iac/status.toml +4 -0
- package/docs/commands/project/use.toml +6 -0
- package/docs/iac/status/bundle.toml +4 -0
- package/lib/api-timer.js +81 -0
- package/lib/apig-utils.js +16 -14
- package/lib/archiver.js +83 -45
- package/lib/authentication/login.js +4 -2
- package/lib/bin/catalyst.js +0 -1
- package/lib/client-utils.js +22 -22
- package/lib/client.js +0 -3
- package/lib/command_needs/auth.js +12 -3
- package/lib/command_needs/rc.js +12 -7
- package/lib/commands/apig/status.js +6 -4
- package/lib/commands/client/delete.js +2 -4
- package/lib/commands/client/setup.js +1 -1
- package/lib/commands/deploy.js +3 -1
- package/lib/commands/ds/export.js +3 -1
- package/lib/commands/ds/import.js +3 -1
- package/lib/commands/ds/status.js +145 -149
- package/lib/commands/functions/config.js +1 -1
- package/lib/commands/functions/setup.js +1 -1
- package/lib/commands/help.js +1 -23
- package/lib/commands/iac/export.js +85 -0
- package/lib/commands/iac/import.js +187 -0
- package/lib/commands/iac/pack.js +129 -0
- package/lib/commands/iac/status.js +63 -0
- package/lib/commands/index.js +4 -0
- package/lib/commands/init.js +33 -26
- package/lib/commands/project/list.js +10 -6
- package/lib/commands/project/use.js +42 -25
- package/lib/deploy/features/functions/index.js +2 -1
- package/lib/deploy/index.js +3 -1
- package/lib/endpoints/lib/iac.js +134 -0
- package/lib/error.js +29 -0
- package/lib/errorOut.js +3 -2
- package/lib/fn-utils/lib/common.js +32 -12
- package/lib/fn-utils/lib/java.js +6 -8
- package/lib/fn-utils/lib/node.js +7 -1
- package/lib/iac/status/bundle.js +82 -0
- package/lib/iac/status/deploy.js +74 -0
- package/lib/iac/status/util/index.js +26 -0
- package/lib/index.js +8 -14
- package/lib/init/features/client.js +2 -3
- package/lib/init/features/functions/languages/java.js +2 -5
- package/lib/init/features/functions/languages/node.js +2 -5
- package/lib/init/features/index.js +8 -3
- package/lib/init/features/project.js +70 -33
- package/lib/init/util/client.js +12 -0
- package/lib/init/util/functions.js +20 -0
- package/lib/init/util/project.js +35 -0
- package/lib/internal/api.js +6 -9
- package/lib/internal/command.js +2 -2
- package/lib/internal/config.js +6 -4
- package/lib/migration/index.js +10 -6
- package/lib/option-filter.js +4 -1
- package/lib/port-resolver.js +18 -16
- package/lib/prompt/index.js +92 -0
- package/lib/prompt/types/file-path.js +95 -0
- package/lib/pull/features/client.js +1 -1
- package/lib/pull/features/functions/index.js +5 -7
- package/lib/pull/index.js +4 -1
- package/lib/serve/features/index.js +3 -1
- package/lib/shell/dependencies/http-functions.js +1 -1
- package/lib/shell/index.js +3 -1
- package/lib/track.js +3 -1
- package/lib/util_modules/constants/index.js +3 -1
- package/lib/util_modules/constants/lib/file-names.js +2 -1
- package/lib/util_modules/constants/lib/iac.js +8 -0
- package/lib/util_modules/constants/lib/regex.js +2 -1
- package/lib/util_modules/constants/lib/scopes.js +5 -0
- package/lib/util_modules/constants/project.js +6 -0
- package/lib/util_modules/contextHelp.js +5 -1
- package/lib/util_modules/env.js +2 -5
- package/lib/util_modules/fs/index.js +9 -1
- package/lib/util_modules/fs/lib/async.js +29 -22
- package/lib/util_modules/js.js +6 -0
- package/lib/util_modules/parser/toml.js +5 -1
- package/lib/util_modules/project.js +3 -0
- package/lib/util_modules/shell.js +3 -6
- package/package.json +7 -4
- package/templates/iacSuccess.html +391 -0
- package/lib/prompt.js +0 -49
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<title>Catalyst CLI</title>
|
|
8
|
+
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
|
|
10
|
+
<style media="screen">
|
|
11
|
+
html,
|
|
12
|
+
body {
|
|
13
|
+
height: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
body {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.modalbox.success,
|
|
24
|
+
.modalbox.error {
|
|
25
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
|
|
26
|
+
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
27
|
+
-webkit-border-radius: 2px;
|
|
28
|
+
-moz-border-radius: 2px;
|
|
29
|
+
border-radius: 2px;
|
|
30
|
+
background: #fff;
|
|
31
|
+
padding: 25px 25px 15px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.modalbox.success.animate .icon,
|
|
36
|
+
.modalbox.error.animate .icon {
|
|
37
|
+
-webkit-animation: fall-in 0.75s;
|
|
38
|
+
-moz-animation: fall-in 0.75s;
|
|
39
|
+
-o-animation: fall-in 0.75s;
|
|
40
|
+
animation: fall-in 0.75s;
|
|
41
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.modalbox.success h1,
|
|
45
|
+
.modalbox.error h1 {
|
|
46
|
+
font-family: 'Montserrat', sans-serif;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.modalbox.success p,
|
|
50
|
+
.modalbox.error p {
|
|
51
|
+
font-family: 'Open Sans', sans-serif;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.modalbox.success button,
|
|
55
|
+
.modalbox.error button,
|
|
56
|
+
.modalbox.success button:active,
|
|
57
|
+
.modalbox.error button:active,
|
|
58
|
+
.modalbox.success button:focus,
|
|
59
|
+
.modalbox.error button:focus {
|
|
60
|
+
-webkit-transition: all 0.1s ease-in-out;
|
|
61
|
+
transition: all 0.1s ease-in-out;
|
|
62
|
+
-webkit-border-radius: 30px;
|
|
63
|
+
-moz-border-radius: 30px;
|
|
64
|
+
border-radius: 30px;
|
|
65
|
+
margin-top: 15px;
|
|
66
|
+
width: 80%;
|
|
67
|
+
background: transparent;
|
|
68
|
+
color: #4caf50;
|
|
69
|
+
border-color: #4caf50;
|
|
70
|
+
outline: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.modalbox.success button:hover,
|
|
74
|
+
.modalbox.error button:hover,
|
|
75
|
+
.modalbox.success button:active:hover,
|
|
76
|
+
.modalbox.error button:active:hover,
|
|
77
|
+
.modalbox.success button:focus:hover,
|
|
78
|
+
.modalbox.error button:focus:hover {
|
|
79
|
+
color: #fff;
|
|
80
|
+
background: #4caf50;
|
|
81
|
+
border-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.modalbox.success .icon,
|
|
85
|
+
.modalbox.error .icon {
|
|
86
|
+
position: relative;
|
|
87
|
+
margin: 0 auto;
|
|
88
|
+
margin-top: -75px;
|
|
89
|
+
background: #4caf50;
|
|
90
|
+
height: 100px;
|
|
91
|
+
width: 100px;
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.modalbox.success .icon span,
|
|
96
|
+
.modalbox.error .icon span {
|
|
97
|
+
font-size: 4em;
|
|
98
|
+
color: #fff;
|
|
99
|
+
text-align: center;
|
|
100
|
+
padding-top: 20px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.modalbox.error button,
|
|
104
|
+
.modalbox.error button:active,
|
|
105
|
+
.modalbox.error button:focus {
|
|
106
|
+
color: #f44336;
|
|
107
|
+
border-color: #f44336;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.modalbox.error button:hover,
|
|
111
|
+
.modalbox.error button:active:hover,
|
|
112
|
+
.modalbox.error button:focus:hover {
|
|
113
|
+
color: #fff;
|
|
114
|
+
background: #f44336;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.modalbox.error .icon {
|
|
118
|
+
background: #f44336;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.modalbox.error .icon span {
|
|
122
|
+
padding-top: 25px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.center {
|
|
126
|
+
float: none;
|
|
127
|
+
margin-left: auto;
|
|
128
|
+
margin-right: auto;
|
|
129
|
+
/* stupid browser compat. smh */
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@-webkit-keyframes fall-in {
|
|
133
|
+
0% {
|
|
134
|
+
-ms-transform: scale(3, 3);
|
|
135
|
+
-webkit-transform: scale(3, 3);
|
|
136
|
+
transform: scale(3, 3);
|
|
137
|
+
opacity: 0;
|
|
138
|
+
}
|
|
139
|
+
50% {
|
|
140
|
+
-ms-transform: scale(1, 1);
|
|
141
|
+
-webkit-transform: scale(1, 1);
|
|
142
|
+
transform: scale(1, 1);
|
|
143
|
+
opacity: 1;
|
|
144
|
+
}
|
|
145
|
+
60% {
|
|
146
|
+
-ms-transform: scale(1.1, 1.1);
|
|
147
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
148
|
+
transform: scale(1.1, 1.1);
|
|
149
|
+
}
|
|
150
|
+
100% {
|
|
151
|
+
-ms-transform: scale(1, 1);
|
|
152
|
+
-webkit-transform: scale(1, 1);
|
|
153
|
+
transform: scale(1, 1);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@-moz-keyframes fall-in {
|
|
158
|
+
0% {
|
|
159
|
+
-ms-transform: scale(3, 3);
|
|
160
|
+
-webkit-transform: scale(3, 3);
|
|
161
|
+
transform: scale(3, 3);
|
|
162
|
+
opacity: 0;
|
|
163
|
+
}
|
|
164
|
+
50% {
|
|
165
|
+
-ms-transform: scale(1, 1);
|
|
166
|
+
-webkit-transform: scale(1, 1);
|
|
167
|
+
transform: scale(1, 1);
|
|
168
|
+
opacity: 1;
|
|
169
|
+
}
|
|
170
|
+
60% {
|
|
171
|
+
-ms-transform: scale(1.1, 1.1);
|
|
172
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
173
|
+
transform: scale(1.1, 1.1);
|
|
174
|
+
}
|
|
175
|
+
100% {
|
|
176
|
+
-ms-transform: scale(1, 1);
|
|
177
|
+
-webkit-transform: scale(1, 1);
|
|
178
|
+
transform: scale(1, 1);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@-o-keyframes fall-in {
|
|
183
|
+
0% {
|
|
184
|
+
-ms-transform: scale(3, 3);
|
|
185
|
+
-webkit-transform: scale(3, 3);
|
|
186
|
+
transform: scale(3, 3);
|
|
187
|
+
opacity: 0;
|
|
188
|
+
}
|
|
189
|
+
50% {
|
|
190
|
+
-ms-transform: scale(1, 1);
|
|
191
|
+
-webkit-transform: scale(1, 1);
|
|
192
|
+
transform: scale(1, 1);
|
|
193
|
+
opacity: 1;
|
|
194
|
+
}
|
|
195
|
+
60% {
|
|
196
|
+
-ms-transform: scale(1.1, 1.1);
|
|
197
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
198
|
+
transform: scale(1.1, 1.1);
|
|
199
|
+
}
|
|
200
|
+
100% {
|
|
201
|
+
-ms-transform: scale(1, 1);
|
|
202
|
+
-webkit-transform: scale(1, 1);
|
|
203
|
+
transform: scale(1, 1);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@-webkit-keyframes plunge {
|
|
208
|
+
0% {
|
|
209
|
+
margin-top: -100%;
|
|
210
|
+
}
|
|
211
|
+
100% {
|
|
212
|
+
margin-top: 25%;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@-moz-keyframes plunge {
|
|
217
|
+
0% {
|
|
218
|
+
margin-top: -100%;
|
|
219
|
+
}
|
|
220
|
+
100% {
|
|
221
|
+
margin-top: 25%;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@-o-keyframes plunge {
|
|
226
|
+
0% {
|
|
227
|
+
margin-top: -100%;
|
|
228
|
+
}
|
|
229
|
+
100% {
|
|
230
|
+
margin-top: 25%;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@-moz-keyframes fall-in {
|
|
235
|
+
0% {
|
|
236
|
+
-ms-transform: scale(3, 3);
|
|
237
|
+
-webkit-transform: scale(3, 3);
|
|
238
|
+
transform: scale(3, 3);
|
|
239
|
+
opacity: 0;
|
|
240
|
+
}
|
|
241
|
+
50% {
|
|
242
|
+
-ms-transform: scale(1, 1);
|
|
243
|
+
-webkit-transform: scale(1, 1);
|
|
244
|
+
transform: scale(1, 1);
|
|
245
|
+
opacity: 1;
|
|
246
|
+
}
|
|
247
|
+
60% {
|
|
248
|
+
-ms-transform: scale(1.1, 1.1);
|
|
249
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
250
|
+
transform: scale(1.1, 1.1);
|
|
251
|
+
}
|
|
252
|
+
100% {
|
|
253
|
+
-ms-transform: scale(1, 1);
|
|
254
|
+
-webkit-transform: scale(1, 1);
|
|
255
|
+
transform: scale(1, 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@-webkit-keyframes fall-in {
|
|
260
|
+
0% {
|
|
261
|
+
-ms-transform: scale(3, 3);
|
|
262
|
+
-webkit-transform: scale(3, 3);
|
|
263
|
+
transform: scale(3, 3);
|
|
264
|
+
opacity: 0;
|
|
265
|
+
}
|
|
266
|
+
50% {
|
|
267
|
+
-ms-transform: scale(1, 1);
|
|
268
|
+
-webkit-transform: scale(1, 1);
|
|
269
|
+
transform: scale(1, 1);
|
|
270
|
+
opacity: 1;
|
|
271
|
+
}
|
|
272
|
+
60% {
|
|
273
|
+
-ms-transform: scale(1.1, 1.1);
|
|
274
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
275
|
+
transform: scale(1.1, 1.1);
|
|
276
|
+
}
|
|
277
|
+
100% {
|
|
278
|
+
-ms-transform: scale(1, 1);
|
|
279
|
+
-webkit-transform: scale(1, 1);
|
|
280
|
+
transform: scale(1, 1);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@-o-keyframes fall-in {
|
|
285
|
+
0% {
|
|
286
|
+
-ms-transform: scale(3, 3);
|
|
287
|
+
-webkit-transform: scale(3, 3);
|
|
288
|
+
transform: scale(3, 3);
|
|
289
|
+
opacity: 0;
|
|
290
|
+
}
|
|
291
|
+
50% {
|
|
292
|
+
-ms-transform: scale(1, 1);
|
|
293
|
+
-webkit-transform: scale(1, 1);
|
|
294
|
+
transform: scale(1, 1);
|
|
295
|
+
opacity: 1;
|
|
296
|
+
}
|
|
297
|
+
60% {
|
|
298
|
+
-ms-transform: scale(1.1, 1.1);
|
|
299
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
300
|
+
transform: scale(1.1, 1.1);
|
|
301
|
+
}
|
|
302
|
+
100% {
|
|
303
|
+
-ms-transform: scale(1, 1);
|
|
304
|
+
-webkit-transform: scale(1, 1);
|
|
305
|
+
transform: scale(1, 1);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@keyframes fall-in {
|
|
310
|
+
0% {
|
|
311
|
+
-ms-transform: scale(3, 3);
|
|
312
|
+
-webkit-transform: scale(3, 3);
|
|
313
|
+
transform: scale(3, 3);
|
|
314
|
+
opacity: 0;
|
|
315
|
+
}
|
|
316
|
+
50% {
|
|
317
|
+
-ms-transform: scale(1, 1);
|
|
318
|
+
-webkit-transform: scale(1, 1);
|
|
319
|
+
transform: scale(1, 1);
|
|
320
|
+
opacity: 1;
|
|
321
|
+
}
|
|
322
|
+
60% {
|
|
323
|
+
-ms-transform: scale(1.1, 1.1);
|
|
324
|
+
-webkit-transform: scale(1.1, 1.1);
|
|
325
|
+
transform: scale(1.1, 1.1);
|
|
326
|
+
}
|
|
327
|
+
100% {
|
|
328
|
+
-ms-transform: scale(1, 1);
|
|
329
|
+
-webkit-transform: scale(1, 1);
|
|
330
|
+
transform: scale(1, 1);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
@-moz-keyframes plunge {
|
|
335
|
+
0% {
|
|
336
|
+
margin-top: -100%;
|
|
337
|
+
}
|
|
338
|
+
100% {
|
|
339
|
+
margin-top: 15%;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@-webkit-keyframes plunge {
|
|
344
|
+
0% {
|
|
345
|
+
margin-top: -100%;
|
|
346
|
+
}
|
|
347
|
+
100% {
|
|
348
|
+
margin-top: 15%;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@-o-keyframes plunge {
|
|
353
|
+
0% {
|
|
354
|
+
margin-top: -100%;
|
|
355
|
+
}
|
|
356
|
+
100% {
|
|
357
|
+
margin-top: 15%;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@keyframes plunge {
|
|
362
|
+
0% {
|
|
363
|
+
margin-top: -100%;
|
|
364
|
+
}
|
|
365
|
+
100% {
|
|
366
|
+
margin-top: 15%;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
</style>
|
|
370
|
+
</head>
|
|
371
|
+
|
|
372
|
+
<body>
|
|
373
|
+
<div class="container">
|
|
374
|
+
<div class="row">
|
|
375
|
+
<div class="modalbox success col-sm-8 col-md-6 col-lg-5 center animate">
|
|
376
|
+
<div class="icon">
|
|
377
|
+
<span class="glyphicon glyphicon-ok"></span>
|
|
378
|
+
</div>
|
|
379
|
+
<!--/.icon-->
|
|
380
|
+
<h1>Import Started!</h1>
|
|
381
|
+
<p>You can close this window and
|
|
382
|
+
<br>continue using the <b>CLI</b></p>
|
|
383
|
+
</div>
|
|
384
|
+
<!--/.success-->
|
|
385
|
+
</div>
|
|
386
|
+
<!--/.row-->
|
|
387
|
+
</div>
|
|
388
|
+
<!--/.container-->
|
|
389
|
+
</body>
|
|
390
|
+
|
|
391
|
+
</html>
|
package/lib/prompt.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
18
|
-
exports.default = {
|
|
19
|
-
seperator: (line) => {
|
|
20
|
-
return new inquirer_1.default.Separator(line);
|
|
21
|
-
},
|
|
22
|
-
choice: (name, _a = {}) => {
|
|
23
|
-
var { value = name, short = name, disabled = false, checked = false } = _a, otherOpts = __rest(_a, ["value", "short", "disabled", "checked"]);
|
|
24
|
-
return Object.assign({ name,
|
|
25
|
-
value,
|
|
26
|
-
short,
|
|
27
|
-
disabled,
|
|
28
|
-
checked }, otherOpts);
|
|
29
|
-
},
|
|
30
|
-
ask: (...questions) => {
|
|
31
|
-
return inquirer_1.default.prompt(questions);
|
|
32
|
-
},
|
|
33
|
-
question: (name, question, _a = {}) => {
|
|
34
|
-
var { type = 'input', defaultAns, choices = [], validate = () => {
|
|
35
|
-
return true;
|
|
36
|
-
}, filter = (ans) => {
|
|
37
|
-
return ans;
|
|
38
|
-
}, when = () => {
|
|
39
|
-
return true;
|
|
40
|
-
}, prefix = '', suffix = '' } = _a, otheropts = __rest(_a, ["type", "defaultAns", "choices", "validate", "filter", "when", "prefix", "suffix"]);
|
|
41
|
-
return Object.assign({ type,
|
|
42
|
-
name, message: question, default: defaultAns, choices,
|
|
43
|
-
validate,
|
|
44
|
-
filter,
|
|
45
|
-
when,
|
|
46
|
-
prefix,
|
|
47
|
-
suffix }, otheropts);
|
|
48
|
-
}
|
|
49
|
-
};
|