Skip to content

Commit 0e3ad03

Browse files
committed
chore: update Command Line SDK to 22.2.0
1 parent 2f0063b commit 0e3ad03

18 files changed

Lines changed: 516 additions & 117 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 22.2.0
4+
5+
* Added: OAuth refresh tokens now stored in the OS keychain via `@napi-rs/keyring`, falling back to config
6+
* Added: `--type` option to `functions list-specifications` and `sites list-specifications`
7+
* Updated: Cleaner account selection prompt for `logout` with a `(current)` marker
8+
* Fixed: OAuth login now clears the stale legacy session cookie
9+
310
## 22.1.3
411

512
* Added: `--resource` option to `oauth2 authorize`, `create-device-authorization`, and `create-token` for RFC 8707 resource indicators

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
2929

3030
```sh
3131
$ appwrite -v
32-
22.1.3
32+
22.2.0
3333
```
3434

3535
### Install using prebuilt binaries
@@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
8383
Once the installation completes, you can verify your install using
8484
```
8585
$ appwrite -v
86-
22.1.3
86+
22.2.0
8787
```
8888

8989
## Getting Started

bun.lock

Lines changed: 40 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# You can use "View source" of this page to see the full script.
1414

1515
# REPO
16-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.1.3/appwrite-cli-win-x64.exe"
17-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.1.3/appwrite-cli-win-arm64.exe"
16+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.0/appwrite-cli-win-x64.exe"
17+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.0/appwrite-cli-win-arm64.exe"
1818

1919
$APPWRITE_BINARY_NAME = "appwrite.exe"
2020

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ verifyMacOSCodeSignature() {
120120
downloadBinary() {
121121
echo "[2/5] Downloading executable for $OS ($ARCH) ..."
122122

123-
GITHUB_LATEST_VERSION="22.1.3"
123+
GITHUB_LATEST_VERSION="22.2.0"
124124
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
125125
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
126126

lib/auth/login.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
restoreCurrentSession,
3333
deleteServerSession,
3434
} from "./session.js";
35+
import { setStoredRefreshToken } from "./refresh-token.js";
3536

3637
const DEFAULT_ENDPOINT = "https://cloud.appwrite.io/v1";
3738

@@ -71,7 +72,7 @@ const startWaitingForApprovalSpinner = (): (() => void) => {
7172
};
7273
};
7374

74-
const listenForBrowserOpen = (
75+
export const listenForBrowserOpen = (
7576
url: string,
7677
onCancel: () => void,
7778
): (() => void) => {
@@ -90,17 +91,14 @@ const listenForBrowserOpen = (
9091
if (shouldRestoreRawMode) {
9192
stdin.setRawMode?.(true);
9293
}
93-
const shouldPause = stdin.isPaused();
9494
stdin.resume();
9595

9696
const cleanup = (): void => {
9797
stdin.off("data", onData);
9898
if (shouldRestoreRawMode) {
9999
stdin.setRawMode?.(false);
100100
}
101-
if (shouldPause) {
102-
stdin.pause();
103-
}
101+
stdin.pause();
104102
};
105103

106104
// Open the browser at most once; keep listening afterwards so Ctrl+C still
@@ -393,7 +391,7 @@ const loginWithOAuthDevice = async ({
393391

394392
const tokenExpiry = Date.now() + token.expires_in * 1000;
395393
globalConfig.setAccessToken(token.access_token);
396-
globalConfig.setRefreshToken(token.refresh_token || "");
394+
setStoredRefreshToken(id, token.refresh_token || "");
397395
globalConfig.setTokenExpiry(tokenExpiry);
398396

399397
let tokenEmail = "";
@@ -419,6 +417,7 @@ const loginWithOAuthDevice = async ({
419417
}
420418

421419
globalConfig.setEmail(account.email);
420+
globalConfig.removeCookie();
422421

423422
const { removed: removedLegacySessions, failed: failedLegacySessions } =
424423
await removeLegacySessionsExcept(id);

0 commit comments

Comments
 (0)