Skip to content

feat: Console SDK update for version 3.1.0#65

Closed
premtsd-code wants to merge 5 commits intomainfrom
dev
Closed

feat: Console SDK update for version 3.1.0#65
premtsd-code wants to merge 5 commits intomainfrom
dev

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

@premtsd-code premtsd-code commented Feb 24, 2026

This PR contains updates to the Console SDK for version 3.1.0 .

Summary by CodeRabbit

  • New Features

    • Added support for Deno 1.21, 1.24, and 1.35 runtimes.
    • Enhanced database relationship attributes with new update capabilities.
    • Expanded database configuration options with adapter and indexing support.
  • Bug Fixes

    • Made site deployment activation parameter optional.
  • Documentation

    • Updated migration examples with improved resource type definitions.
    • Updated filter documentation for message subscribers.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3cea8e3 and b86d0b2.

📒 Files selected for processing (2)
  • src/enums/appwrite-migration-resource.ts
  • src/models.ts

Walkthrough

Adds new Deno runtime entries to runtime enums; changes Row and Document $sequence types from number to string; extends ConsoleVariables with multiple database capability fields and adds counts to MigrationReport; refactors Databases.updateRelationshipAttribute into typed overloads with a unified implementation; makes Sites.createDeployment's activate parameter optional and adjusts handling/payload; introduces four migration resource enums (Appwrite/Firebase/NHost/Supabase), removes the single Resources export, updates src/index.ts exports, and updates migration service method signatures and docs to use the specific enums; plus minor docs/example formatting and symbol edits.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title refers to a version update, but the primary change is a comprehensive refactor of migration resource enums and related API signatures, plus additions to runtime enums and database models. Consider a more specific title that highlights the main structural changes, such as 'Refactor migration resources to use specific typed enums' or clarify what the 3.1.0 update primarily encompasses.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/models.ts (1)

6404-6443: Naming inconsistency confirmed; likely intentional per API contract.

The inconsistency is accurate: all existing properties use the _APP_* screaming-snake-case pattern, while the new database adapter capability flags (supportForRelationships, supportForOperators, supportForSpatials, etc.) and maxIndexLength use camelCase. This mismatch reflects the server API response structure—these properties come directly from the /console/variables endpoint and are formatted to match the server's camelCase output.

All new fields are non-optional, requiring consumers of ConsoleVariables to handle them unconditionally.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/models.ts` around lines 6404 - 6443, The new camelCase properties on the
ConsoleVariables type (supportForRelationships, supportForOperators,
supportForSpatials, supportForSpatialIndexNull, supportForFulltextWildcard,
supportForMultipleFulltextIndexes, supportForAttributeResizing,
supportForSchemas, maxIndexLength) are non-optional and force consumers to
always handle them; update the ConsoleVariables definition in src/models.ts to
mark each of these properties as optional (add ? to each identifier) so code can
safely handle missing fields from the /console/variables response while
preserving the server-driven camelCase names.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/models.ts`:
- Around line 6404-6443: The new camelCase properties on the ConsoleVariables
type (supportForRelationships, supportForOperators, supportForSpatials,
supportForSpatialIndexNull, supportForFulltextWildcard,
supportForMultipleFulltextIndexes, supportForAttributeResizing,
supportForSchemas, maxIndexLength) are non-optional and force consumers to
always handle them; update the ConsoleVariables definition in src/models.ts to
mark each of these properties as optional (add ? to each identifier) so code can
safely handle missing fields from the /console/variables response while
preserving the server-driven camelCase names.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40d238d and c3c1c7d.

📒 Files selected for processing (8)
  • docs/examples/sites/create-deployment.md
  • src/enums/build-runtime.ts
  • src/enums/runtime.ts
  • src/enums/runtimes.ts
  • src/models.ts
  • src/services/databases.ts
  • src/services/messaging.ts
  • src/services/sites.ts

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/enums/appwrite-migration-resource.ts`:
- Around line 17-20: Rename the mis-cased enum members in
AppwriteMigrationResource to use PascalCase identifiers: change
Environmentvariable -> EnvironmentVariable, Sitedeployment -> SiteDeployment,
and Sitevariable -> SiteVariable while keeping their string values unchanged;
update all usages/imports that reference the old identifiers (search for
AppwriteMigrationResource.Environmentvariable, .Sitedeployment, .Sitevariable)
so callers use the new enum member names.

In `@src/enums/firebase-migration-resource.ts`:
- Around line 1-12: The FirebaseMigrationResource enum contains unsupported
members (Table, Column, Row, Attribute, Collection, Bucket) that will send
invalid resources; update the enum FirebaseMigrationResource to only include the
Appwrite-supported identifiers (e.g., User -> 'users', Database -> 'databases',
Document -> 'documents', File -> 'files') or add a validation layer that
translates or rejects the unsupported members; ensure any code using
FirebaseMigrationResource (callers of the enum) is updated to use the new values
or performs validation/mapping before sending requests so only the allowed
resource strings are emitted.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3c1c7d and fb3594a.

📒 Files selected for processing (14)
  • docs/examples/migrations/create-appwrite-migration.md
  • docs/examples/migrations/create-firebase-migration.md
  • docs/examples/migrations/create-n-host-migration.md
  • docs/examples/migrations/create-supabase-migration.md
  • docs/examples/migrations/get-appwrite-report.md
  • docs/examples/migrations/get-firebase-report.md
  • docs/examples/migrations/get-n-host-report.md
  • docs/examples/migrations/get-supabase-report.md
  • src/enums/appwrite-migration-resource.ts
  • src/enums/firebase-migration-resource.ts
  • src/enums/n-host-migration-resource.ts
  • src/enums/supabase-migration-resource.ts
  • src/index.ts
  • src/services/migrations.ts

Comment on lines +17 to +20
Environmentvariable = 'environment-variable',
Site = 'site',
Sitedeployment = 'site-deployment',
Sitevariable = 'site-variable',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Enum member keys Environmentvariable, Sitedeployment, and Sitevariable should be PascalCase.

Every other member in this enum (and across NHostMigrationResource / SupabaseMigrationResource) uses PascalCase. These three compound-word keys are inconsistently cased and will be visible as part of the public API. The string values (API literals) don't need to change — only the TypeScript identifiers.

🔤 Proposed fix
-    Environmentvariable = 'environment-variable',
-    Site = 'site',
-    Sitedeployment = 'site-deployment',
-    Sitevariable = 'site-variable',
+    EnvironmentVariable = 'environment-variable',
+    Site = 'site',
+    SiteDeployment = 'site-deployment',
+    SiteVariable = 'site-variable',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Environmentvariable = 'environment-variable',
Site = 'site',
Sitedeployment = 'site-deployment',
Sitevariable = 'site-variable',
EnvironmentVariable = 'environment-variable',
Site = 'site',
SiteDeployment = 'site-deployment',
SiteVariable = 'site-variable',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/enums/appwrite-migration-resource.ts` around lines 17 - 20, Rename the
mis-cased enum members in AppwriteMigrationResource to use PascalCase
identifiers: change Environmentvariable -> EnvironmentVariable, Sitedeployment
-> SiteDeployment, and Sitevariable -> SiteVariable while keeping their string
values unchanged; update all usages/imports that reference the old identifiers
(search for AppwriteMigrationResource.Environmentvariable, .Sitedeployment,
.Sitevariable) so callers use the new enum member names.

Comment on lines +1 to +12
export enum FirebaseMigrationResource {
User = 'user',
Database = 'database',
Table = 'table',
Column = 'column',
Row = 'row',
Document = 'document',
Attribute = 'attribute',
Collection = 'collection',
Bucket = 'bucket',
File = 'file',
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

fd 'migration-resource.ts' src/enums --exec cat {}

Repository: appwrite/sdk-for-console

Length of output: 1736


🌐 Web query:

Firebase migration resource types Firestore Realtime Database API

💡 Result:

Here are the key resource types / resource-name formats you’ll typically use when migrating or integrating Firebase Realtime Database ↔ Firestore via APIs:

Firestore

  • Firestore Database resource name (REST): projects/{project}/databases/{database} (most commonly {database} is (default)). [1]
  • Cloud Monitoring “monitored resource type” for Firestore: firestore.googleapis.com/Database (also commonly seen: firestore_instance). [2]

Firebase Realtime Database

  • Realtime Database REST endpoint format: https://<dbname>.firebaseio.com/<path>.json (URL varies by region; examples use <dbname>.firebaseio.com). [3]
  • Cloud Monitoring “monitored resource type” for Realtime Database: firebase_namespace. [2]

Migration guidance (RTDB → Firestore)

  • Firebase’s recommended approach includes mapping schema differences and (optionally) mirroring new RTDB writes into Firestore using Cloud Functions during the transition. [4]

Sources: [1] [2] [3] [4]


🌐 Web query:

Appwrite Firebase migration resource enum valid values

💡 Result:

For Appwrite Firebase migrations (POST /v1/migrations/firebase), the resources field is an array validated against Firebase’s supported migration resources on the server side (a whitelist) [1].

In practice, the Firebase migration supports migrating these resource categories [2]:

  • users (Firebase Auth)
  • databases (Firestore schema/collections)
  • documents (Firestore documents; noted as partial support in docs)
  • files (Firebase Storage files)

Sources: the migrations endpoint definition/validation [1] and the migrations docs support matrix [2].


Remove or validate Table, Column, Row, Attribute, Collection, and Bucket enum values.

The Appwrite Firebase migration API only supports: users, databases, documents, and files. The enum includes relational database concepts (Table, Column, Row, Attribute) and unsupported values (Collection, Bucket) that don't match Firebase's document model or Appwrite's migration resource whitelist. Callers using these enum members will send invalid resource identifiers to the backend.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/enums/firebase-migration-resource.ts` around lines 1 - 12, The
FirebaseMigrationResource enum contains unsupported members (Table, Column, Row,
Attribute, Collection, Bucket) that will send invalid resources; update the enum
FirebaseMigrationResource to only include the Appwrite-supported identifiers
(e.g., User -> 'users', Database -> 'databases', Document -> 'documents', File
-> 'files') or add a validation layer that translates or rejects the unsupported
members; ensure any code using FirebaseMigrationResource (callers of the enum)
is updated to use the new values or performs validation/mapping before sending
requests so only the allowed resource strings are emitted.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/models.ts`:
- Around line 6856-6867: The interface MigrationReport contains invalid
hyphenated property identifiers ("site-deployment" and "site-variable"); update
the interface (MigrationReport) to use valid TypeScript keys by either renaming
them to camelCase (e.g., siteDeployment, siteVariable) across the interface and
usages, or change the property declarations to quoted string literal keys
("site-deployment": number, "site-variable": number) so the TypeScript parser
accepts them; ensure you update all references to those properties in code to
match the new names.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb3594a and 8763798.

📒 Files selected for processing (1)
  • src/models.ts

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.

1 participant