feat: Console SDK update for version 4.0.0#67
Conversation
WalkthroughThis release introduces version 4.0.0 with multiple breaking changes and new features. Key changes include: replacing the generic Resources enum with migration-specific enums (AppwriteMigrationResource, FirebaseMigrationResource, NHostMigrationResource, SupabaseMigrationResource) across the migrations API; requiring explicit Channel IDs instead of optional wildcards; adding domain transfer operations (createTransferIn, createTransferOut, getTransferStatus); introducing new project APIs (updateConsoleAccess, updateStatus with Status enum); adding TTL support to document and row listing operations; making site deployment activation parameter optional and reordering parameters; introducing new health and domain-related model types; and updating documentation examples to reflect API changes. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ 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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/enums/appwrite-migration-resource.ts (1)
17-20: Consider PascalCase for multi-word enum members.The enum members
Environmentvariable,Sitedeployment, andSitevariabledeviate from PascalCase convention used elsewhere (e.g.,User,Database). If the string values are the API contract, the member names could still beEnvironmentVariable,SiteDeployment,SiteVariablefor readability while keeping the string values unchanged.♻️ Suggested naming improvement
- 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, The enum members Environmentvariable, Sitedeployment, and Sitevariable should be renamed to PascalCase for readability; update the enum in appwrite-migration-resource.ts to use EnvironmentVariable, SiteDeployment, and SiteVariable while keeping their string values ('environment-variable', 'site', 'site-deployment', 'site-variable') unchanged and ensure any references to the old names (Environmentvariable, Sitedeployment, Sitevariable) in code are updated to the new identifiers (EnvironmentVariable, SiteDeployment, SiteVariable).
🤖 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/index.ts`:
- Around line 74-77: Add a deprecated compatibility export named Resources to
avoid breaking existing imports: declare and export a Resources type alias that
unions the provider-specific enums (AppwriteMigrationResource |
FirebaseMigrationResource | NHostMigrationResource | SupabaseMigrationResource)
and mark it as deprecated in a comment; place this export alongside the existing
provider exports in src/index.ts so existing `import { Resources }` continues to
work while new code uses the provider-specific symbols.
In `@src/services/sites.ts`:
- Around line 918-932: The JSDoc for the createDeployment method documents the
parameter "activate" as required but the method signature marks it optional;
update the JSDoc `@param` entries for "activate" in the createDeployment docs to
indicate it is optional (e.g., add brackets or a question mark to the type/param
description) so the comments match the method signature in the createDeployment
declaration and overloaded doc block.
- Around line 936-957: The positional-args branch in createDeployment
misinterprets legacy calls where the third positional argument was boolean
activate (it ends up assigned to installCommand); update the else block in
createDeployment to detect if rest[1] is a boolean (legacy activate position)
and, when so, set params.activate = rest[1] and shift
installCommand/buildCommand/outputDirectory/onProgress to rest[2..], otherwise
keep the current mapping; reference the createDeployment function, the
paramsOrFirst/rest arrays and the
params.activate/installCommand/buildCommand/outputDirectory/onProgress
properties to locate and implement the fix.
---
Nitpick comments:
In `@src/enums/appwrite-migration-resource.ts`:
- Around line 17-20: The enum members Environmentvariable, Sitedeployment, and
Sitevariable should be renamed to PascalCase for readability; update the enum in
appwrite-migration-resource.ts to use EnvironmentVariable, SiteDeployment, and
SiteVariable while keeping their string values ('environment-variable', 'site',
'site-deployment', 'site-variable') unchanged and ensure any references to the
old names (Environmentvariable, Sitedeployment, Sitevariable) in code are
updated to the new identifiers (EnvironmentVariable, SiteDeployment,
SiteVariable).
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (27)
docs/examples/databases/list-documents.mddocs/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.mddocs/examples/sites/create-deployment.mddocs/examples/tablesdb/list-rows.mdsrc/channel.tssrc/enums/appwrite-migration-resource.tssrc/enums/build-runtime.tssrc/enums/firebase-migration-resource.tssrc/enums/n-host-migration-resource.tssrc/enums/runtime.tssrc/enums/runtimes.tssrc/enums/supabase-migration-resource.tssrc/index.tssrc/models.tssrc/services/databases.tssrc/services/messaging.tssrc/services/migrations.tssrc/services/sites.tssrc/services/tables-db.tssrc/services/teams.ts
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/models.ts (1)
8683-8686: UseDomainTransferStatusStatusenum forDomain.transferStatusfor type consistency.
DomainTransferStatusStatusis already defined and imported in this file (line 15), and is already used forDomainTransferStatus.status(line 8988). TypingDomain.transferStatuswith the enum instead ofstringstrengthens type safety and maintains consistency across the domain transfer models.🔧 Proposed change
/** * Domain transfer status (e.g., "pending", "completed", "failed"). */ - transferStatus: string; + transferStatus: DomainTransferStatusStatus;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/models.ts` around lines 8683 - 8686, The Domain model's transferStatus property is currently typed as string; change its type to the existing enum DomainTransferStatusStatus to ensure consistency with DomainTransferStatus.status and stronger type safety—update the transferStatus declaration in the Domain interface/class to use DomainTransferStatusStatus (the enum is already imported), and run type checks to confirm no downstream types need adjustment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/examples/domains/create-transfer-in.md`:
- Around line 10-15: The example call to domains.createTransferIn uses an empty
string for the domain parameter which is confusing; update the domain field in
the createTransferIn payload to a descriptive placeholder (for example
'<DOMAIN_NAME>' or 'example.com') so it matches other examples and clarifies
expected input for the domains.createTransferIn function.
In `@src/enums/status.ts`:
- Around line 1-3: The Status enum is incomplete and must include the missing
values used by the API; update the export enum Status (in src/enums/status.ts)
to add entries Archived = 'archived' and Paused = 'paused' alongside Active =
'active' so methods like updateStatus and any callers can use type-safe
Status.Archived and Status.Paused instead of raw string literals.
In `@src/services/domains.ts`:
- Around line 213-214: Update the JSDoc for the createPurchase function to
remove "Team ID" wording and replace with consistent "Organization ID" (or
"Organization that will own the domain") for the params.organizationId
description; locate the createPurchase JSDoc block (references: function
createPurchase, param organizationId) and change both occurrences that read
"Team ID" to the updated phrasing so the docs match the renamed API.
- Around line 447-452: Update the JSDoc summary for createTransferIn to
accurately reflect the actual parameters and behavior: remove the phrase about
"registrant information" and instead state that it creates a domain transfer-in
using domain, organizationId, authCode, and paymentMethodId (and that
paymentMethodId will be used to authorize/capture payment). Edit the comment
block above the createTransferIn function so the description matches the listed
params (domain, organizationId, authCode, paymentMethodId) and clarifies
responsibility for payment authorization.
---
Nitpick comments:
In `@src/models.ts`:
- Around line 8683-8686: The Domain model's transferStatus property is currently
typed as string; change its type to the existing enum DomainTransferStatusStatus
to ensure consistency with DomainTransferStatus.status and stronger type
safety—update the transferStatus declaration in the Domain interface/class to
use DomainTransferStatusStatus (the enum is already imported), and run type
checks to confirm no downstream types need adjustment.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
README.mddocs/examples/domains/create-purchase.mddocs/examples/domains/create-transfer-in.mddocs/examples/domains/create-transfer-out.mddocs/examples/domains/get-transfer-status.mddocs/examples/health/get-console-pausing.mddocs/examples/projects/update-console-access.mddocs/examples/projects/update-status.mdpackage.jsonsrc/client.tssrc/enums/domain-transfer-status-status.tssrc/enums/status.tssrc/index.tssrc/models.tssrc/services/account.tssrc/services/domains.tssrc/services/health.tssrc/services/projects.ts
✅ Files skipped from review due to trivial changes (5)
- docs/examples/domains/create-transfer-out.md
- docs/examples/projects/update-console-access.md
- src/client.ts
- src/services/account.ts
- docs/examples/health/get-console-pausing.md
This PR contains updates to the Console SDK for version 4.0.0.
Changes
Summary by CodeRabbit
Release Notes
New Features
Improvements
Documentation