@@ -3,7 +3,7 @@ const JSONbig = require("json-bigint")({ storeAsString: false });
3
3
const { Command } = require("commander");
4
4
const { localConfig } = require("../config");
5
5
const { paginate } = require('../paginate');
6
- const { questionsPushBuckets, questionsPushTeams, questionsPushFunctions, questionsGetEntrypoint, questionsPushCollections, questionsConfirmPushCollections, questionsDeployMessagingTopics } = require("../questions");
6
+ const { questionsPushBuckets, questionsPushTeams, questionsPushFunctions, questionsGetEntrypoint, questionsPushCollections, questionsConfirmPushCollections, questionsPushMessagingTopics } = require("../questions");
7
7
const { actionRunner, success, log, error, commandDescriptions } = require("../parser");
8
8
const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsUpdateDeployment, functionsListVariables, functionsDeleteVariable, functionsCreateVariable } = require('./functions');
9
9
const {
@@ -910,21 +910,21 @@ const pushTeam = async ({ all, yes } = {}) => {
910
910
}
911
911
}
912
912
913
- const deployMessagingTopic = async ({ all, yes } = {}) => {
913
+ const pushMessagingTopic = async ({ all, yes } = {}) => {
914
914
let response = {};
915
915
916
916
let topicsIds = [];
917
917
const configTopics = localConfig.getMessagingTopics();
918
918
919
919
if (all) {
920
920
if (configTopics.length === 0) {
921
- throw new Error("No topics found in the current directory. Run `appwrite init topics` to fetch all your messaging topics.");
921
+ throw new Error("No topics found in the current directory. Run `appwrite pull topics` to pull all your messaging topics.");
922
922
}
923
923
topicsIds.push(...configTopics.map((b) => b.$id));
924
924
}
925
925
926
926
if (topicsIds.length === 0) {
927
- const answers = await inquirer.prompt(questionsDeployMessagingTopics [0])
927
+ const answers = await inquirer.prompt(questionsPushMessagingTopics [0])
928
928
topicsIds.push(...answers.topics);
929
929
}
930
930
@@ -936,7 +936,7 @@ const deployMessagingTopic = async ({ all, yes } = {}) => {
936
936
}
937
937
938
938
for (let topic of topics) {
939
- log(`Deploying topic ${topic.name} ( ${topic['$id']} )`)
939
+ log(`Pushing topic ${topic.name} ( ${topic['$id']} )`)
940
940
941
941
try {
942
942
response = await messagingGetTopic({
@@ -946,7 +946,7 @@ const deployMessagingTopic = async ({ all, yes } = {}) => {
946
946
log(`Topic ${topic.name} ( ${topic['$id']} ) already exists.`);
947
947
948
948
if (!yes) {
949
- const answers = await inquirer.prompt(questionsDeployMessagingTopics [1])
949
+ const answers = await inquirer.prompt(questionsPushMessagingTopics [1])
950
950
if (answers.override.toLowerCase() !== "yes") {
951
951
log(`Received "${answers.override}". Skipping ${topic.name} ( ${topic['$id']} )`);
952
952
continue;
@@ -962,7 +962,7 @@ const deployMessagingTopic = async ({ all, yes } = {}) => {
962
962
parseOutput: false
963
963
});
964
964
965
- success(`Deployed ${topic.name} ( ${topic['$id']} )`);
965
+ success(`Pushed ${topic.name} ( ${topic['$id']} )`);
966
966
} catch (e) {
967
967
if (e.code == 404) {
968
968
log(`Topic ${topic.name} does not exist in the project. Creating ... `);
@@ -974,7 +974,7 @@ const deployMessagingTopic = async ({ all, yes } = {}) => {
974
974
parseOutput: false
975
975
})
976
976
977
- success(`Deployed ${topic.name} ( ${topic['$id']} )`);
977
+ success(`Pushed ${topic.name} ( ${topic['$id']} )`);
978
978
} else {
979
979
throw e;
980
980
}
@@ -1011,12 +1011,12 @@ push
1011
1011
.option(`--yes`, `Flag to confirm all warnings`)
1012
1012
.action(actionRunner(pushTeam));
1013
1013
1014
- deploy
1014
+ push
1015
1015
.command("topic")
1016
- .description("Deploy messaging topics in the current project.")
1016
+ .description("Push messaging topics in the current project.")
1017
1017
.option(`--all`, `Flag to deploy all topics`)
1018
1018
.option(`--yes`, `Flag to confirm all warnings`)
1019
- .action(actionRunner(deployMessagingTopic ));
1019
+ .action(actionRunner(pushMessagingTopic ));
1020
1020
1021
1021
module.exports = {
1022
1022
push
0 commit comments