Skip to content

Commit 63e617f

Browse files
authored
chore: update Command Line SDK to 24.0.0 (#347)
1 parent b541187 commit 63e617f

17 files changed

Lines changed: 52 additions & 62 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,12 @@ jobs:
226226
echo "formula_path=${FORMULA_PATH}"
227227
} >> "$GITHUB_OUTPUT"
228228
229-
- name: Open pull request on Homebrew tap
229+
- name: Commit Homebrew formula update
230230
working-directory: homebrew-tap
231231
env:
232232
RELEASE_TAG: ${{ github.event.release.tag_name }}
233233
EXECUTABLE_NAME: ${{ steps.tap.outputs.executable }}
234234
FORMULA_PATH: ${{ steps.tap.outputs.formula_path }}
235-
SOURCE_REPO: ${{ github.repository }}
236-
SERVER_URL: ${{ github.server_url }}
237-
GH_TOKEN: ${{ steps.bot-token.outputs.token }}
238235
run: |
239236
set -euo pipefail
240237
@@ -243,27 +240,12 @@ jobs:
243240
exit 0
244241
fi
245242
246-
BASE_BRANCH="$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')"
247-
BRANCH="release/${EXECUTABLE_NAME}-${RELEASE_TAG}"
248-
249243
git config user.name "appwrite-bot[bot]"
250244
git config user.email "217594562+appwrite-bot[bot]@users.noreply.github.com"
251245
252-
git checkout -B "$BRANCH"
253246
git add "$FORMULA_PATH"
254247
git commit -m "${EXECUTABLE_NAME} ${RELEASE_TAG}"
255-
git push -f -u origin "$BRANCH"
256-
257-
PR_TITLE="${EXECUTABLE_NAME} ${RELEASE_TAG}"
258-
PR_BODY=$(printf 'Automated formula update for the `%s` CLI release [`%s`](%s/%s/releases/tag/%s).\n\nOpened automatically by the `%s` publish workflow after release binaries were uploaded.' "$EXECUTABLE_NAME" "$RELEASE_TAG" "$SERVER_URL" "$SOURCE_REPO" "$RELEASE_TAG" "${SOURCE_REPO#*/}")
259248
260-
EXISTING_PR="$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number' || true)"
261-
if [ -n "$EXISTING_PR" ]; then
262-
gh pr edit "$EXISTING_PR" --title "$PR_TITLE" --body "$PR_BODY"
263-
else
264-
gh pr create \
265-
--title "$PR_TITLE" \
266-
--body "$PR_BODY" \
267-
--base "$BASE_BRANCH" \
268-
--head "$BRANCH"
269-
fi
249+
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
250+
git pull --rebase origin "$BRANCH"
251+
git push origin "HEAD:${BRANCH}"

CHANGELOG.md

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

3+
## 24.0.0
4+
5+
* Added: `login` against Cloud now signs in through your browser
6+
* Updated: `--email`, `--password`, `--mfa`, and `--code` now apply to self-hosted instances only
7+
* Updated: Existing Cloud sessions keep working in read-only mode until you run `login` again
8+
39
## 23.2.0
410

511
* Added: `apps` installation commands: `list-installations`, `get-installation`, `delete-installation`, `create-installation-token`

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-
23.2.0
32+
24.0.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-
23.2.0
86+
24.0.0
8787
```
8888

8989
## Getting Started

bun.lock

Lines changed: 2 additions & 2 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/23.2.0/appwrite-cli-win-x64.exe"
17-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/23.2.0/appwrite-cli-win-arm64.exe"
16+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/24.0.0/appwrite-cli-win-x64.exe"
17+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/24.0.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="23.2.0"
123+
GITHUB_LATEST_VERSION="24.0.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: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
isRegionalCloudEndpoint,
1414
openBrowser,
1515
} from "../utils.js";
16-
import { isFlagEnabled } from "../flags.js";
1716
import ID from "../id.js";
1817
import {
1918
questionsListFactors,
@@ -476,8 +475,13 @@ export const loginCommand = async ({
476475
const configEndpoint = normalizeCloudConsoleEndpoint(
477476
(endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT,
478477
);
479-
const shouldUseCloudLogin =
480-
isFlagEnabled("oauthLogin") && isCloudLoginEndpoint(configEndpoint);
478+
const shouldUseCloudLogin = isCloudLoginEndpoint(configEndpoint);
479+
480+
if (shouldUseCloudLogin && (email || password || mfa || code)) {
481+
throw new Error(
482+
`Cloud sign-in happens in your browser. Run '${EXECUTABLE_NAME} login' without --email, --password, --mfa or --code — those options are for self-hosted instances.`,
483+
);
484+
}
481485

482486
let oldCurrent = globalConfig.getCurrentSession();
483487

@@ -493,7 +497,7 @@ export const loginCommand = async ({
493497

494498
if (account) {
495499
if (
496-
isFlagEnabled("oauthLogin") &&
500+
shouldUseCloudLogin &&
497501
!globalConfig.getAccessToken() &&
498502
globalConfig.getCookie()
499503
) {

lib/commands/generic.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ export const register = new Command("register")
8181

8282
export const login = new Command("login")
8383
.description(commandDescriptions["login"])
84-
.option(`--email [email]`, `Email`)
85-
.option(`--password [password]`, `Password`)
84+
.option(`--email [email]`, `Email, for self hosted instances`)
85+
.option(`--password [password]`, `Password, for self hosted instances`)
8686
.option(
8787
`--mfa [factor]`,
88-
`Factor used for MFA. Must be one of: email, phone, totp, recoveryCode`,
88+
`Factor used for MFA on self hosted instances. Must be one of: email, phone, totp, recoveryCode`,
8989
)
90-
.option(`--code [code]`, `Code used for MFA`)
90+
.option(`--code [code]`, `Code used for MFA on self hosted instances`)
9191
.option(
9292
`--endpoint [endpoint]`,
9393
`Appwrite endpoint for self hosted instances`,

lib/commands/services/backups.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,17 @@ const backupsCreateRestorationCommand = backups
181181
.command(`create-restoration`)
182182
.description(`Create and trigger a new restoration for a backup on a project.
183183
184-
For a backup of one database, the restoration resolves its destination before it is queued. Pass \`newResourceId\` to restore into that database ID, including the archived database ID to overwrite it. When \`newResourceId\` is omitted, a new database ID is generated and returned in \`options\`.
184+
For a backup of one database, the restoration resolves its destination before it is queued. When \`newResourceId\` is omitted, the archived database is restored in place and its own ID is returned in \`options\`. Pass a different \`newResourceId\` to restore alongside it as a new database instead.
185185
186186
The restoration migration records the archived database in \`resourceId\` and \`resourceType\`, and the resolved database in \`destinationResourceId\` and \`destinationResourceType\`. Database types are stored canonically as \`database\`, \`documentsdb\`, or \`vectorsdb\`. Project-wide restorations leave these fields empty because they do not have a single source or destination database.
187187
188188
To list every migration related to one database, use its canonical type in a nested \`OR(AND(...), AND(...), AND(...))\` across the root, parent, and destination relation pairs: \`(resourceType, resourceId)\`, \`(parentResourceType, parentResourceId)\`, and \`(destinationResourceType, destinationResourceId)\`. Legacy and TablesDB databases use \`database\`; the operational \`resourceType\` of a table migration is not rewritten to \`tablesdb\`.
189189
190-
When restoring a DocumentsDB or VectorsDB database to a new resource from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification.
190+
When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead.
191191
`)
192192
.requiredOption(`--archive-id <archive-id>`, `Backup archive ID to restore`)
193193
.requiredOption(`--services [services...]`, `Array of services to restore`)
194-
.option(`--new-resource-id <new-resource-id>`, `Destination resource ID. Omit to generate a new ID, or pass the archived resource ID to overwrite it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
194+
.option(`--new-resource-id <new-resource-id>`, `Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
195195
.option(`--new-resource-name <new-resource-name>`, `Database name. Max length: 128 chars.`)
196196
.action(
197197
actionRunner(

lib/commands/services/storage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunking l
221221
.requiredOption(`--file-id <file-id>`, `File ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
222222
.requiredOption(`--file <file>`, `Binary file. Appwrite SDKs provide helpers to handle file input. Learn about file input (https://appwrite.io/docs/products/storage/upload-download#input-file).`)
223223
.option(`--permissions [permissions...]`, `An array of permission strings. By default, only the current user is granted all permissions. Learn more about permissions (https://appwrite.io/docs/permissions).`)
224+
.option(`--folder <folder>`, `Virtual folder to place the file in, for example "photos/2026". Nest folders with \`/\`. Defaults to the bucket root.`)
224225
.action(
225226
actionRunner(
226-
async ({ bucketId, fileId, file, permissions }) =>
227-
parse(await (await getStorageClient()).createFile(bucketId, fileId, file !== undefined ? await resolveFileParam(file) : undefined, permissions)),
227+
async ({ bucketId, fileId, file, permissions, folder }) =>
228+
parse(await (await getStorageClient()).createFile(bucketId, fileId, file !== undefined ? await resolveFileParam(file) : undefined, permissions, folder)),
228229
),
229230
);
230231

0 commit comments

Comments
 (0)