Skip to content

feat: SDK update for version 21.0.0#315

Merged
ArnabChatterjee20k merged 1 commit into
masterfrom
dev
May 12, 2026
Merged

feat: SDK update for version 21.0.0#315
ArnabChatterjee20k merged 1 commit into
masterfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 12, 2026

This PR contains updates to the SDK for version 21.0.0.

What's Changed

  • Breaking: Renamed project update-canonical-emails to update-deny-canonical-email-policy
  • Breaking: Renamed project update-disposable-emails to update-deny-disposable-email-policy
  • Breaking: Renamed project update-free-emails to update-deny-free-email-policy
  • Breaking: Renamed proxy update-rule-verification to update-rule-status
  • Breaking: Removed --search option from proxy list-rules
  • Breaking: functions create-variable and sites create-variable now require --variable-id
  • Added: databases create-big-int-attribute and update-big-int-attribute commands
  • Added: tablesdb create-big-int-column and update-big-int-column commands
  • Added: --prompt option on project update-o-auth-2-google
  • Added: Pagination and filter flags on vcs list-repository-branches and sites list-variables
  • Added: --on-duplicate option on migrations create-appwrite-migration, create-csv-import, and create-json-import
  • Updated: Extended key-list query filters with key, resourceType, resourceId, and secret

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Command Line SDK update for version 21.0.0 feat: SDK update for version 21.0.0 May 12, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 12, 2026

Greptile Summary

This PR updates the Appwrite CLI SDK from v20.2.0-rc.1 to v21.0.0, reflecting a set of API-level changes across multiple services and introducing quality-of-life CLI improvements.

  • --where deprecated in favour of --filter: All list commands now expose --filter as the primary flag; --where is kept with a once-per-process deprecation warning via a new parseDeprecatedWhereQuery wrapper.
  • New bigint attribute type: databases and tables-db services gain create-big-int-attribute / update-big-int-attribute commands; the attribute dispatcher and TypeScript type utility both handle the new bigint case.
  • Breaking API renames: proxy update-rule-verificationupdate-rule-status; three update-*-emails project commands replaced by update-deny-*-policy variants; create-variable now requires --variable-id; push.ts auto-generates IDs with ID.unique() when pushing variables.

Confidence Score: 3/5

Mostly safe; the vcs list-repository-branches command exposes filter and sort flags that the underlying API does not support, which will produce runtime errors for any user who uses them.

The vast majority of the changes are straightforward API-version updates applied consistently. The one defect is in vcs.ts: --filter, --where, --sort-asc, and --sort-desc options are registered for list-repository-branches even though the endpoint only supports limit/offset/cursor queries — a user passing those flags will receive an API error with no clear explanation.

lib/commands/services/vcs.ts — the list-repository-branches command exposes query options the API cannot handle.

Important Files Changed

Filename Overview
lib/commands/services/vcs.ts Added pagination/filter options to listRepositoryBranches, but --filter, --where, --sort-asc, and --sort-desc flags are exposed even though the API only supports limit/offset/cursor for that endpoint.
lib/commands/utils/query.ts Renamed --where to --filter with backwards-compatible deprecation wrapper; module-level hasWarnedDeprecatedWhere flag is never reset between test invocations.
lib/config.ts Added useCwdConfig() and findConfigFileInCwd() to pin config resolution to the current directory; findConfigFile() now stops traversal at the home directory.
lib/commands/push.ts Added variableId: ID.unique() when creating function and site variables to satisfy the new v21 API requirement; renamed MethodId import to AuthMethod.
lib/commands/services/project.ts Replaced deprecated email policy commands with update-deny-*-policy variants; getOAuth2Provider option renamed from --provider to --provider-id.
lib/commands/services/proxy.ts Renamed update-rule-verification to update-rule-status; removed --search from list-rules; --filter/--where migration applied cleanly.
lib/commands/services/functions.ts Added --variable-id as a required param for create-variable; update-variable --key changed from required to optional; listVariables gains pagination options.
lib/commands/services/sites.ts Mirrors the functions service changes: create-variable now requires --variable-id, update-variable --key is now optional, listVariables gains pagination options.
lib/commands/init.ts initProject now calls localConfig.useCwdConfig() so the project config is always resolved to the current directory.
lib/commands/utils/attributes.ts Added bigint case to both createAttribute and updateAttribute dispatchers.
lib/shared/typescript-type-utils.ts Added bigint"bigint" TypeScript type mapping for generated type declarations.

Reviews (1): Last reviewed commit: "chore: update Command Line SDK to 21.0.0" | Re-trigger Greptile

Comment on lines +101 to 115
.option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`)
.option(`--filter <expression>`, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field<value, and field<=value.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseFilterQuery(value), previous))
.option(`--where <expression>`, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous))
.option(`--sort-asc <attribute>`, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous))
.option(`--sort-desc <attribute>`, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous))
.option(`--limit <limit>`, `Maximum number of results to return.`, parseInteger)
.option(`--offset <offset>`, `Number of results to skip.`, parseInteger)
.option(`--cursor-after <id>`, `Return results after this cursor ID.`)
.option(`--cursor-before <id>`, `Return results before this cursor ID.`)
.action(
actionRunner(
async ({ installationId, providerRepositoryId }) =>
parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId)),
async ({ installationId, providerRepositoryId, search, queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) =>
parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId, search, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))),
),
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unsupported query options exposed for list-repository-branches

The command's own --queries description says "Only supported methods are limit, offset, cursorAfter, and cursorBefore," yet --filter, --where, --sort-asc, and --sort-desc options are also registered. Any user who passes --filter status=active or --sort-asc name will have those translated into {"method":"equal",...} / {"method":"orderAsc",...} query strings and sent to the API, which will likely reject them. The descriptions for those four flags should either be removed or updated to clarify they are not supported by this specific endpoint.


export const parseWhereQuery = (expression: string): string => {
for (const [pattern, method] of whereOperators) {
let hasWarnedDeprecatedWhere = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Module-level deprecation flag is never reset

hasWarnedDeprecatedWhere is a module-level variable. Because the CLI is a single-process tool this works fine in normal usage, but the state is never reset between invocations of the same module (e.g., in tests or if the module is imported in a long-running process). Consumers writing integration tests that call parseDeprecatedWhereQuery more than once will only observe the warning on the first call, which can mask regressions. Consider exporting a resetDeprecationState() helper for test use, or accepting a warn callback parameter instead.

@ArnabChatterjee20k ArnabChatterjee20k merged commit e430cd2 into master May 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants