Skip to content

Commit 8432002

Browse files
committed
Improve copies
1 parent 0bf394e commit 8432002

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

templates/cli/lib/commands/push.js.twig

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,17 +1190,17 @@ const pushBucket = async ({ returnOnZero } = { returnOnZero: false }) => {
11901190
buckets.push(...idBuckets);
11911191
}
11921192

1193+
log('Pushing buckets ...');
1194+
11931195
for (let bucket of buckets) {
1194-
log(`Pushing bucket ${bucket.name} ( ${bucket['$id']} )`)
1196+
log(`Pushing bucket ${chalk.bold(bucket['name'])} ...`);
11951197

11961198
try {
11971199
response = await storageGetBucket({
11981200
bucketId: bucket['$id'],
11991201
parseOutput: false,
12001202
})
12011203

1202-
log(`Updating bucket ...`)
1203-
12041204
await storageUpdateBucket({
12051205
bucketId: bucket['$id'],
12061206
name: bucket.name,
@@ -1214,8 +1214,6 @@ const pushBucket = async ({ returnOnZero } = { returnOnZero: false }) => {
12141214
compression: bucket.compression,
12151215
parseOutput: false
12161216
});
1217-
1218-
success(`Pushed ${bucket.name} ( ${bucket['$id']} )`);
12191217
} catch (e) {
12201218
if (Number(e.code) === 404) {
12211219
log(`Bucket ${bucket.name} does not exist in the project. Creating ... `);
@@ -1233,13 +1231,13 @@ const pushBucket = async ({ returnOnZero } = { returnOnZero: false }) => {
12331231
antivirus: bucket.antivirus,
12341232
parseOutput: false
12351233
})
1236-
1237-
success(`Pushed ${bucket.name} ( ${bucket['$id']} )`);
12381234
} else {
12391235
throw e;
12401236
}
12411237
}
12421238
}
1239+
1240+
success(`Successfully pushed ${buckets.length} buckets.`);
12431241
}
12441242

12451243
const pushTeam = async ({ returnOnZero } = { returnOnZero: false }) => {
@@ -1269,24 +1267,22 @@ const pushTeam = async ({ returnOnZero } = { returnOnZero: false }) => {
12691267
teams.push(...idTeams);
12701268
}
12711269

1270+
log('Pushing teams ...');
1271+
12721272
for (let team of teams) {
1273-
log(`Pushing team ${team.name} ( ${team['$id']} )`)
1273+
log(`Pushing team ${chalk.bold(team['name'])} ...`);
12741274

12751275
try {
12761276
response = await teamsGet({
12771277
teamId: team['$id'],
12781278
parseOutput: false,
12791279
})
12801280

1281-
log(`Updating team ...`)
1282-
12831281
await teamsUpdateName({
12841282
teamId: team['$id'],
12851283
name: team.name,
12861284
parseOutput: false
12871285
});
1288-
1289-
success(`Pushed ${team.name} ( ${team['$id']} )`);
12901286
} catch (e) {
12911287
if (Number(e.code) === 404) {
12921288
log(`Team ${team.name} does not exist in the project. Creating ... `);
@@ -1296,13 +1292,13 @@ const pushTeam = async ({ returnOnZero } = { returnOnZero: false }) => {
12961292
name: team.name,
12971293
parseOutput: false
12981294
})
1299-
1300-
success(`Pushed ${team.name} ( ${team['$id']} )`);
13011295
} else {
13021296
throw e;
13031297
}
13041298
}
13051299
}
1300+
1301+
success(`Successfully pushed ${teams.length} teams.`);
13061302
}
13071303

13081304
const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) => {
@@ -1340,8 +1336,10 @@ const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) =>
13401336
}
13411337
}
13421338

1339+
log('Pushing topics ...');
1340+
13431341
for (let topic of topics) {
1344-
log(`Pushing topic ${topic.name} ( ${topic['$id']} )`)
1342+
log(`Pushing topic ${chalk.bold(topic['name'])} ...`);
13451343

13461344
try {
13471345
response = await messagingGetTopic({
@@ -1355,16 +1353,12 @@ const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) =>
13551353
continue;
13561354
}
13571355

1358-
log(`Updating Topic ...`)
1359-
13601356
await messagingUpdateTopic({
13611357
topicId: topic['$id'],
13621358
name: topic.name,
13631359
subscribe: topic.subscribe,
13641360
parseOutput: false
13651361
});
1366-
1367-
success(`Pushed ${topic.name} ( ${topic['$id']} )`);
13681362
} catch (e) {
13691363
if (Number(e.code) === 404) {
13701364
log(`Topic ${topic.name} does not exist in the project. Creating ... `);
@@ -1382,6 +1376,8 @@ const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) =>
13821376
}
13831377
}
13841378
}
1379+
1380+
success(`Successfully pushed ${topics.length} topics.`);
13851381
}
13861382

13871383
const push = new Command("push")

templates/cli/lib/config.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const JSONbig = require("json-bigint")({ storeAsString: false });
66

77
const KeysFunction = ["path", "$id", "execute", "name", "enabled", "logging", "runtime", "scopes", "events", "schedule", "timeout", "entrypoint", "commands"];
88
const KeysDatabase = ["$id", "name", "enabled"];
9-
const KeysCollection = ["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"]; // TODO: Limit attributes and indexes
9+
const KeysCollection = ["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"];
1010
const KeysStorage = ["$id", "$permissions", "fileSecurity", "name", "enabled", "maximumFileSize", "allowedFileExtensions", "compression", "encryption", "antivirus"];
1111
const KeyTopics = ["$id", "name", "subscribe"];
1212
const KeyAttributes = ["key", "type", "required", "array", "size", "default"];

0 commit comments

Comments
 (0)