Skip to content

feat: SDK update for version 22.6.0#337

Merged
ChiragAgg5k merged 3 commits into
masterfrom
dev
Jul 10, 2026
Merged

feat: SDK update for version 22.6.0#337
ChiragAgg5k merged 3 commits into
masterfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Jul 10, 2026

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 22.6.0, generated with sdk-generator 2.4.5.

Pins @appwrite.io/console to the 15.3.0 release.

What's Changed

  • Added: push functions and pull now work with API key authentication, enabling CI usage without a console session
  • Updated: Console-only steps during push, like default domain rules, are skipped with a warning when using an API key
  • Updated: Clearer authentication errors that distinguish API key and console session requirements

@ChiragAgg5k ChiragAgg5k changed the title feat: Command Line SDK update for version 22.6.0 feat: SDK update for version 22.6.0 Jul 10, 2026
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR bumps the CLI to version 22.6.0 and introduces a new lib/auth/capabilities.ts module that cleanly separates auth concerns so that push functions and pull can operate with API key authentication, enabling CI usage without a console session.

  • New capabilities.ts module adds getAuthMode, canUseConsole, requireProjectAuth, requireConsoleAuth, and isAuthScopeError helpers, moving auth-gating out of createPushInstance/createPullInstance and onto individual operations.
  • push.ts / pull.ts refactoring: console-only steps (project settings, default domain rules) now warn and gracefully skip when using API key auth instead of blocking the entire command; new createDefaultSiteRule and ensureDefaultFunctionRule helpers unify scope-error handling for domain rule creation.
  • Dependency upgrades: @appwrite.io/console promoted from 15.3.0-rc.1 to the stable 15.3.0 release (note: the PR description incorrectly says the RC pin is kept), plus minor devDependency bumps (typescript-eslint 8.63, prettier 3.9.4, tar 7.5.19, etc.).

Confidence Score: 5/5

Safe to merge. The auth refactoring is well-structured and the new API key fallback paths are guarded at every console-only operation.

All console-only operations (settings push/pull, default domain rule creation) are individually gated with the new capability helpers so they warn and skip gracefully when only an API key is present. The project-level auth check runs eagerly in createPushInstance/createPullInstance, preventing unauthenticated use. The scope-error soft-fail path in ensureDefaultFunctionRule/createDefaultSiteRule is correctly bounded to missing-scope exceptions and does not swallow real authorization failures. Dependency upgrades are routine patch/minor bumps.

No files require special attention.

Important Files Changed

Filename Overview
lib/auth/capabilities.ts New module centralising auth helpers; logic is correct and intentionally narrow. The "console session required" substring in isAuthScopeError has no matching thrown Error in the current codebase (all thrown messages say "requires a console session" or "Session not found"), making it dead code — but harmless and consistent with the comment's forward-defensive intent.
lib/commands/push.ts createDefaultFunctionRule/createDefaultSiteRule now return boolean and soft-fail on scope errors; ensureDefaultFunctionRule wraps the existing-rule check with the same soft-fail. Settings push correctly guards with requireConsoleAuth. No regressions found.
lib/commands/pull.ts requireProjectAuth moved to createPullInstance; pullSettings now calls requireConsoleAuth upfront. Console client is attached when present, not required unconditionally.
lib/sdks.ts Error messages updated to differentiate API key vs no-auth scenarios; sdkForProject error message aligned with capabilities.ts wording. Clean.
package.json Version bumped to 22.6.0; @appwrite.io/console promoted from 15.3.0-rc.1 to the stable 15.3.0 release. PR description incorrectly states the RC pin is kept.

Reviews (2): Last reviewed commit: "(build): move @appwrite.io/console pin t..." | Re-trigger Greptile

Comment thread lib/commands/push.ts
@@ -1197,6 +1306,7 @@ export class Push {
projectName?: string;

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 Redundant requireConsoleAuth call

requireConsoleAuth("Pushing project settings") is called here inside Push.pushSettings(), but the two entry points that reach this method already guard with the same check: the standalone pushSettings function calls it at line ~3307, and pushResources gates the call behind if (canUseConsole()). The inner call is harmless (fast-exit), but the duplication makes the intent less clear. A brief comment explaining that the inner guard is for callers who bypass the outer guards would improve readability.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/commands/push.ts
Line: 1306

Comment:
**Redundant `requireConsoleAuth` call**

`requireConsoleAuth("Pushing project settings")` is called here inside `Push.pushSettings()`, but the two entry points that reach this method already guard with the same check: the standalone `pushSettings` function calls it at line ~3307, and `pushResources` gates the call behind `if (canUseConsole())`. The inner call is harmless (fast-exit), but the duplication makes the intent less clear. A brief comment explaining that the inner guard is for callers who bypass the outer guards would improve readability.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

@ChiragAgg5k
ChiragAgg5k merged commit 821bc8d into master Jul 10, 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