feat: SDK update for version 21.0.0#315
Conversation
Greptile SummaryThis 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.
Confidence Score: 3/5Mostly safe; the The vast majority of the changes are straightforward API-version updates applied consistently. The one defect is in lib/commands/services/vcs.ts — the Important Files Changed
Reviews (1): Last reviewed commit: "chore: update Command Line SDK to 21.0.0" | Re-trigger Greptile |
| .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 }))), | ||
| ), | ||
| ); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
This PR contains updates to the SDK for version 21.0.0.
What's Changed
project update-canonical-emailstoupdate-deny-canonical-email-policyproject update-disposable-emailstoupdate-deny-disposable-email-policyproject update-free-emailstoupdate-deny-free-email-policyproxy update-rule-verificationtoupdate-rule-status--searchoption fromproxy list-rulesfunctions create-variableandsites create-variablenow require--variable-iddatabases create-big-int-attributeandupdate-big-int-attributecommandstablesdb create-big-int-columnandupdate-big-int-columncommands--promptoption onproject update-o-auth-2-googlevcs list-repository-branchesandsites list-variables--on-duplicateoption onmigrations create-appwrite-migration,create-csv-import, andcreate-json-importkey,resourceType,resourceId, andsecret