appwrite-cli 10.1.0 → 10.2.2

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/config.js CHANGED
@@ -681,15 +681,25 @@ class Global extends Config {
681
681
 
682
682
  getSessions() {
683
683
  const sessions = Object.keys(this.data).filter((key) => !Global.IGNORE_ATTRIBUTES.includes(key))
684
+ const current = this.getCurrentSession();
684
685
 
685
- return sessions.map((session) => {
686
-
687
- return {
688
- id: session,
689
- endpoint: this.data[session][Global.PREFERENCE_ENDPOINT],
690
- email: this.data[session][Global.PREFERENCE_EMAIL]
686
+ const sessionMap = new Map();
687
+
688
+ sessions.forEach((sessionId) => {
689
+ const email = this.data[sessionId][Global.PREFERENCE_EMAIL];
690
+ const endpoint = this.data[sessionId][Global.PREFERENCE_ENDPOINT];
691
+ const key = `${email}|${endpoint}`;
692
+
693
+ if (sessionId === current || !sessionMap.has(key)) {
694
+ sessionMap.set(key, {
695
+ id: sessionId,
696
+ endpoint: this.data[sessionId][Global.PREFERENCE_ENDPOINT],
697
+ email: this.data[sessionId][Global.PREFERENCE_EMAIL]
698
+ });
691
699
  }
692
- })
700
+ });
701
+
702
+ return Array.from(sessionMap.values());
693
703
  }
694
704
 
695
705
  addSession(session, data) {
package/lib/parser.js CHANGED
@@ -122,7 +122,7 @@ const parseError = (err) => {
122
122
  } catch {
123
123
  }
124
124
 
125
- const version = '10.1.0';
125
+ const version = '10.2.2';
126
126
  const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
127
127
  const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud()}`;
128
128
 
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": "10.1.0",
5
+ "version": "10.2.2",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "index.js",
8
8
  "bin": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
3
- "version": "10.1.0",
3
+ "version": "10.2.2",
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/10.1.0/appwrite-cli-win-x64.exe",
9
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/10.2.2/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/10.1.0/appwrite-cli-win-arm64.exe",
18
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/10.2.2/appwrite-cli-win-arm64.exe",
19
19
  "bin": [
20
20
  [
21
21
  "appwrite-cli-win-arm64.exe",