feat: Console SDK update for version 3.1.0#65
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
WalkthroughAdds new Deno runtime entries to runtime enums; changes Row and Document Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 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.) andmaxIndexLengthuse camelCase. This mismatch reflects the server API response structure—these properties come directly from the/console/variablesendpoint and are formatted to match the server's camelCase output.All new fields are non-optional, requiring consumers of
ConsoleVariablesto 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
📒 Files selected for processing (8)
docs/examples/sites/create-deployment.mdsrc/enums/build-runtime.tssrc/enums/runtime.tssrc/enums/runtimes.tssrc/models.tssrc/services/databases.tssrc/services/messaging.tssrc/services/sites.ts
There was a problem hiding this comment.
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
📒 Files selected for processing (14)
docs/examples/migrations/create-appwrite-migration.mddocs/examples/migrations/create-firebase-migration.mddocs/examples/migrations/create-n-host-migration.mddocs/examples/migrations/create-supabase-migration.mddocs/examples/migrations/get-appwrite-report.mddocs/examples/migrations/get-firebase-report.mddocs/examples/migrations/get-n-host-report.mddocs/examples/migrations/get-supabase-report.mdsrc/enums/appwrite-migration-resource.tssrc/enums/firebase-migration-resource.tssrc/enums/n-host-migration-resource.tssrc/enums/supabase-migration-resource.tssrc/index.tssrc/services/migrations.ts
| Environmentvariable = 'environment-variable', | ||
| Site = 'site', | ||
| Sitedeployment = 'site-deployment', | ||
| Sitevariable = 'site-variable', |
There was a problem hiding this comment.
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.
| 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.
| 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 |
There was a problem hiding this comment.
🧩 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.
There was a problem hiding this comment.
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.
This PR contains updates to the Console SDK for version 3.1.0 .
Summary by CodeRabbit
New Features
Bug Fixes
Documentation