@@ -162,6 +162,86 @@ const questionsCreateProject = [
162
162
default: "unique()"
163
163
}
164
164
];
165
+
166
+ const questionsCreateBucket = [
167
+ {
168
+ type: "input",
169
+ name: "bucket",
170
+ message: "What would you like to name your bucket?",
171
+ default: "My Awesome Bucket"
172
+ },
173
+ {
174
+ type: "input",
175
+ name: "id",
176
+ message: "What ID would you like to have for your bucket?",
177
+ default: "unique()"
178
+ },
179
+ {
180
+ type: "list",
181
+ name: "fileSecurity",
182
+ message: "Enable File-Security configuring permissions for individual file",
183
+ choices: ["No", "Yes"]
184
+ }
185
+ ];
186
+
187
+ const questionsCreateCollection = [
188
+ {
189
+ type: "list",
190
+ name: "database",
191
+ message: "Choose the collection database",
192
+ choices: async () => {
193
+ const { databases } = await paginate(databasesList, { parseOutput: false }, 100, 'databases');
194
+
195
+ let choices = databases.map((database, idx) => {
196
+ return {
197
+ name: `${database.name} (${database.$id})`,
198
+ value: database.$id
199
+ }
200
+ })
201
+
202
+ if (choices.length === 0) {
203
+ throw new Error("No databases found. Please create one in project console.")
204
+ }
205
+
206
+ return choices;
207
+ }
208
+ },
209
+ {
210
+ type: "input",
211
+ name: "collection",
212
+ message: "What would you like to name your collection?",
213
+ default: "My Awesome Collection"
214
+ },
215
+ {
216
+ type: "input",
217
+ name: "id",
218
+ message: "What ID would you like to have for your collection?",
219
+ default: "unique()"
220
+ },
221
+ {
222
+ type: "list",
223
+ name: "documentSecurity",
224
+ message: "Enable Document-Security for configuring permissions for individual documents",
225
+ choices: ["No", "Yes"]
226
+ }
227
+ ];
228
+
229
+ const questionsCreateMessagingTopic = [
230
+ {
231
+ type: "input",
232
+ name: "topic",
233
+ message: "What would you like to name your messaging topic?",
234
+ default: "My Awesome Topic"
235
+ },
236
+ {
237
+ type: "input",
238
+ name: "id",
239
+ message: "What ID would you like to have for your messaging topic?",
240
+ default: "unique()"
241
+ }
242
+ ];
243
+
244
+
165
245
const questionsPullProject = [
166
246
...questionsProject,
167
247
{
@@ -222,7 +302,7 @@ const questionsPullFunction = [
222
302
id: runtime['$id'],
223
303
entrypoint: getEntrypoint(runtime['$id']),
224
304
ignore: getIgnores(runtime['$id']),
225
- commands : getInstallCommand(runtime['$id'])
305
+ commands: getInstallCommand(runtime['$id'])
226
306
},
227
307
}
228
308
})
@@ -431,7 +511,7 @@ const questionsListFactors = [
431
511
name: `Recovery code`,
432
512
value: 'recoveryCode'
433
513
}
434
- ].filter((ch) => factors[ch.value] === true);
514
+ ].filter((ch) => factors[ch.value] === true);
435
515
436
516
return choices;
437
517
}
@@ -454,6 +534,9 @@ const questionsMfaChallenge = [
454
534
455
535
module.exports = {
456
536
questionsCreateProject,
537
+ questionsCreateBucket,
538
+ questionsCreateCollection,
539
+ questionsCreateMessagingTopic,
457
540
questionsPullProject,
458
541
questionsLogin,
459
542
questionsPullFunction,
0 commit comments