@@ -3,6 +3,7 @@ const { projectsList } = require('./commands/projects');
3
3
const { functionsListRuntimes } = require('./commands/functions');
4
4
const { accountListMfaFactors } = require("./commands/account");
5
5
const { sdkForConsole } = require("./sdks");
6
+ const { validateRequired } = require("./validations");
6
7
7
8
const { databasesList } = require('./commands/databases');
8
9
const JSONbig = require("json-bigint")({ storeAsString: false });
@@ -107,6 +108,7 @@ const getInstallCommand = (runtime) => {
107
108
return undefined;
108
109
};
109
110
111
+
110
112
const questionsInitProject = [
111
113
{
112
114
type: "confirm",
@@ -209,12 +211,12 @@ const questionsInitFunction = [
209
211
parseOutput: false
210
212
})
211
213
let runtimes = response["runtimes"]
212
- let choices = runtimes.map((runtime, idx) => {
214
+ let choices = runtimes.map((runtime, idx) => {
213
215
return {
214
216
name: `${runtime.name} (${runtime['$id']})`,
215
- value: {
216
- id: runtime['$id'],
217
- entrypoint: getEntrypoint(runtime['$id']),
217
+ value: {
218
+ id: runtime['$id'],
219
+ entrypoint: getEntrypoint(runtime['$id']),
218
220
ignore: getIgnores(runtime['$id']),
219
221
commands : getInstallCommand(runtime['$id'])
220
222
},
@@ -281,6 +283,7 @@ const questionsDeployFunctions = [
281
283
type: "checkbox",
282
284
name: "functions",
283
285
message: "Which functions would you like to deploy?",
286
+ validate: (value) => validateRequired('function', value),
284
287
choices: () => {
285
288
let functions = localConfig.getFunctions();
286
289
if (functions.length === 0) {
@@ -307,6 +310,7 @@ const questionsDeployCollections = [
307
310
type: "checkbox",
308
311
name: "collections",
309
312
message: "Which collections would you like to deploy?",
313
+ validate: (value) => validateRequired('collection', value),
310
314
choices: () => {
311
315
let collections = localConfig.getCollections();
312
316
if (collections.length === 0) {
@@ -332,6 +336,7 @@ const questionsDeployBuckets = [
332
336
type: "checkbox",
333
337
name: "buckets",
334
338
message: "Which buckets would you like to deploy?",
339
+ validate: (value) => validateRequired('bucket', value),
335
340
choices: () => {
336
341
let buckets = localConfig.getBuckets();
337
342
if (buckets.length === 0) {
@@ -372,6 +377,7 @@ const questionsDeployTeams = [
372
377
type: "checkbox",
373
378
name: "teams",
374
379
message: "Which teams would you like to deploy?",
380
+ validate: (value) => validateRequired('team', value),
375
381
choices: () => {
376
382
let teams = localConfig.getTeams();
377
383
if (teams.length === 0) {
@@ -403,7 +409,7 @@ const questionsListFactors = [
403
409
sdk: client,
404
410
parseOutput: false
405
411
});
406
-
412
+
407
413
const choices = [
408
414
{
409
415
name: `TOTP (Time-based One-time Password)`,
0 commit comments