appwrite-cli 6.0.0-rc.5 → 6.0.0-rc.7

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/lib/parser.js CHANGED
@@ -120,7 +120,7 @@ const parseError = (err) => {
120
120
  } catch {
121
121
  }
122
122
 
123
- const version = '6.0.0-rc.5';
123
+ const version = '6.0.0-rc.7';
124
124
  const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
125
125
  const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud}`;
126
126
 
@@ -203,29 +203,26 @@ const commandDescriptions = {
203
203
  "account": `The account command allows you to authenticate and manage a user account.`,
204
204
  "graphql": `The graphql command allows you to query and mutate any resource type on your Appwrite server.`,
205
205
  "avatars": `The avatars command aims to help you complete everyday tasks related to your app image, icons, and avatars.`,
206
- "databases": `The databases command allows you to create structured collections of documents, query and filter lists of documents.`,
207
- "init": `The init command provides a convenient wrapper for creating and initializing project, functions, collections, buckets, teams and messaging in Appwrite.`,
208
- "push": `The push command provides a convenient wrapper for pushing your functions, collections, buckets, teams and messaging.`,
209
- "run": `The run command allows you to run project locally to allow easy development and quick debugging.`,
210
- "functions": `The functions command allows you view, create and manage your Cloud Functions.`,
206
+ "databases": `The databases command allows you to create structured collections of documents and query and filter lists of documents.`,
207
+ "init": `The init command provides a convenient wrapper for creating and initializing projects, functions, collections, buckets, teams, and messaging-topics in Appwrite.`,
208
+ "push": `The push command provides a convenient wrapper for pushing your functions, collections, buckets, teams, and messaging-topics.`,
209
+ "run": `The run command allows you to run the project locally to allow easy development and quick debugging.`,
210
+ "functions": `The functions command allows you to view, create, and manage your Cloud Functions.`,
211
211
  "health": `The health command allows you to both validate and monitor your Appwrite server's health.`,
212
- "pull": `The pull command helps you pull your Appwrite project, functions, collections, buckets, teams and messaging`,
212
+ "pull": `The pull command helps you pull your Appwrite project, functions, collections, buckets, teams, and messaging-topics`,
213
213
  "locale": `The locale command allows you to customize your app based on your users' location.`,
214
- "projects": `The projects command allows you to view, create and manage your Appwrite projects.`,
215
214
  "storage": `The storage command allows you to manage your project files.`,
216
- "teams": `The teams command allows you to group users of your project and to enable them to share read and write access to your project resources`,
215
+ "teams": `The teams command allows you to group users of your project to enable them to share read and write access to your project resources.`,
217
216
  "users": `The users command allows you to manage your project users.`,
218
217
  "client": `The client command allows you to configure your CLI`,
219
218
  "login": `The login command allows you to authenticate and manage a user account.`,
220
- "logout": `The logout command allows you to logout of your Appwrite account.`,
221
- "whoami": `The whoami command gives information about the currently signed in user.`,
219
+ "logout": `The logout command allows you to log out of your Appwrite account.`,
220
+ "whoami": `The whomai command gives information about the currently logged-in user.`,
222
221
  "register": `Outputs the link to create an Appwrite account.`,
223
- "console" : `The console command allows gives you access to the APIs used by the Appwrite console.`,
222
+ "console" : `The console command gives you access to the APIs used by the Appwrite Console.`,
224
223
  "assistant": `The assistant command allows you to interact with the Appwrite Assistant AI`,
225
- "messaging": `The messaging command allows you to send messages.`,
224
+ "messaging": `The messaging command allows you to manage topics and targets and send messages.`,
226
225
  "migrations": `The migrations command allows you to migrate data between services.`,
227
- "project": `The project command is for overall project administration.`,
228
- "proxy": `The proxy command allows you to configure behavior for your attached domains.`,
229
226
  "vcs": `The vcs command allows you to interact with VCS providers and manage your code repositories.`,
230
227
  "main": chalk.redBright(`${logo}${description}`),
231
228
  }
package/lib/questions.js CHANGED
@@ -189,11 +189,11 @@ const questionsInitProject = [
189
189
  message: "Choose your Appwrite project.",
190
190
  choices: async (answers) => {
191
191
  const queries = [
192
- JSON.stringify({ method: 'equal', attribute: 'teamId', values: [answers.organization.id] }),
193
- JSON.stringify({ method: 'orderDesc', attribute: 'Id' })
192
+ JSON.stringify({ method: 'equal', attribute: 'teamId', values: [answers.organization] }),
193
+ JSON.stringify({ method: 'orderDesc', attribute: '$id' })
194
194
  ]
195
195
 
196
- const { projects } = await paginate(projectsList, { parseOutput: false, queries, }, 100, 'projects');
196
+ const { projects } = await paginate(projectsList, { parseOutput: false }, 100, 'projects', queries);
197
197
 
198
198
  let choices = projects.map((project) => {
199
199
  return {
@@ -301,22 +301,7 @@ const questionsCreateFunction = [
301
301
  })
302
302
  return choices;
303
303
  },
304
- },
305
- {
306
- type: "list",
307
- name: "template",
308
- message: "How would you like to start your function code?",
309
- choices: [
310
- {
311
- name: `Start from scratch ${chalk.blackBright(`(starter)`)}`,
312
- value: "starter"
313
- },
314
- {
315
- name: "Pick a template",
316
- value: "custom"
317
- }
318
- ]
319
- },
304
+ }
320
305
  ];
321
306
 
322
307
  const questionsCreateFunctionSelectTemplate = (templates) => {
@@ -646,11 +631,6 @@ const questionsPushFunctions = [
646
631
  return choices;
647
632
  }
648
633
  },
649
- {
650
- type: "input",
651
- name: "override",
652
- message: 'Are you sure you want to override this function\'s variables? This can lead to loss of secrets! Type "YES" to confirm.'
653
- },
654
634
  ]
655
635
 
656
636
  const questionsPushCollections = [
@@ -678,7 +658,15 @@ const questionPushChanges = [
678
658
  {
679
659
  type: "input",
680
660
  name: "changes",
681
- message: `Would you like to apply these changes? Type "YES" to confirm.`
661
+ message: `Are you sure you want to apply these changes? (YES/NO)`
662
+ }
663
+ ];
664
+
665
+ const questionPushChangesConfirmation = [
666
+ {
667
+ type: "input",
668
+ name: "changes",
669
+ message: `Please type 'YES' or 'NO':`
682
670
  }
683
671
  ];
684
672
 
@@ -708,6 +696,7 @@ const questionsPushMessagingTopics = [
708
696
  type: "checkbox",
709
697
  name: "topics",
710
698
  message: "Which messaging topic would you like to push?",
699
+ validate: (value) => validateRequired('topics', value),
711
700
  when: () => localConfig.getMessagingTopics().length > 0,
712
701
  choices: () => {
713
702
  let topics = localConfig.getMessagingTopics();
@@ -719,11 +708,6 @@ const questionsPushMessagingTopics = [
719
708
  }
720
709
  });
721
710
  }
722
- },
723
- {
724
- type: "input",
725
- name: "override",
726
- message: 'Would you like to override existing topics? This can lead to loss of data! Type "YES" to confirm.'
727
711
  }
728
712
  ]
729
713
 
@@ -862,5 +846,6 @@ module.exports = {
862
846
  questionGetEndpoint,
863
847
  questionsInitResources,
864
848
  questionsCreateTeam,
865
- questionPushChanges
849
+ questionPushChanges,
850
+ questionPushChangesConfirmation
866
851
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "appwrite-cli",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "6.0.0-rc.5",
5
+ "version": "6.0.0-rc.7",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "index.js",
8
8
  "bin": {
@@ -34,7 +34,8 @@
34
34
  "tar": "^6.1.11",
35
35
  "ignore": "^5.2.0",
36
36
  "chokidar": "^3.6.0",
37
- "tail": "^2.2.6"
37
+ "tail": "^2.2.6",
38
+ "dotenv": "^16.4.5"
38
39
  },
39
40
  "devDependencies": {
40
41
  "pkg": "5.8.1"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
3
- "version": "6.0.0-rc.5",
3
+ "version": "6.0.0-rc.7",
4
4
  "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
5
5
  "homepage": "https://github.com/appwrite/sdk-for-cli",
6
6
  "license": "BSD-3-Clause",
7
7
  "architecture": {
8
8
  "64bit": {
9
- "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.5/appwrite-cli-win-x64.exe",
9
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.7/appwrite-cli-win-x64.exe",
10
10
  "bin": [
11
11
  [
12
12
  "appwrite-cli-win-x64.exe",
@@ -15,7 +15,7 @@
15
15
  ]
16
16
  },
17
17
  "arm64": {
18
- "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.5/appwrite-cli-win-arm64.exe",
18
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.7/appwrite-cli-win-arm64.exe",
19
19
  "bin": [
20
20
  [
21
21
  "appwrite-cli-win-arm64.exe",